chore: upgrade Infima to alpha.39 (#7306)

This commit is contained in:
Alexey Pyltsyn 2022-05-04 17:06:54 +03:00 committed by GitHub
parent 470e242eef
commit be0dc6b0c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
30 changed files with 147 additions and 208 deletions

View file

@ -15,7 +15,7 @@ export default function DebugRegistry(): JSX.Element {
return (
<DebugLayout>
<h2>Registry</h2>
<ul className={styles.list}>
<ul className="clean-list">
{Object.values(registry).map(([, aliasedPath, resolved]) => (
<li key={aliasedPath} className={styles.listItem}>
<div style={{marginBottom: '10px'}}>

View file

@ -5,12 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
.list {
padding: 0;
}
.listItem {
list-style: none;
background-color: #242526;
padding: 10px;
border-radius: 4px;

View file

@ -16,7 +16,7 @@ export default function DebugRoutes(): JSX.Element {
return (
<DebugLayout>
<h2>Routes</h2>
<ul className={styles.list}>
<ul className="clean-list">
{routes.map(({path, exact, routes: childRoutes}) => (
<li key={path} className={styles.listItem}>
<div className={styles.route}>

View file

@ -5,12 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/
.list {
padding: 0;
}
.listItem {
list-style: none;
background-color: #242526;
padding: 10px;
border-radius: 4px;

View file

@ -24,7 +24,7 @@ export default function DebugMetadata(): JSX.Element {
<code>{siteMetadata.siteVersion || 'No version specified'}</code>
</div>
<h3 className={styles.sectionTitle}>Plugins and themes</h3>
<ul className={styles.list}>
<ul className="clean-list">
{Object.entries(siteMetadata.pluginVersions).map(
([name, versionInformation]) => (
<li key={name} className={styles.listItem}>

View file

@ -9,12 +9,7 @@
margin-top: 20px;
}
.list {
padding: 0;
}
.listItem {
list-style: none;
background-color: #242526;
padding: 10px;
border-radius: 4px;

View file

@ -33,7 +33,7 @@
"@mdx-js/react": "^1.6.22",
"clsx": "^1.1.1",
"copy-text-to-clipboard": "^3.0.1",
"infima": "0.2.0-alpha.38",
"infima": "0.2.0-alpha.39",
"lodash": "^4.17.21",
"nprogress": "^0.2.0",
"postcss": "^8.4.13",

View file

@ -997,6 +997,7 @@ declare module '@theme/PaginatorNavLink' {
export interface Props extends Omit<PropNavigationLink, 'title'> {
readonly title: ReactNode;
readonly subLabel?: JSX.Element;
readonly isNext?: boolean;
}
export default function PaginatorNavLink(props: Props): JSX.Element;

View file

@ -22,7 +22,6 @@ export default function BlogListPaginator(props: Props): JSX.Element {
message: 'Blog list page navigation',
description: 'The ARIA label for the blog pagination',
})}>
<div className="pagination-nav__item">
{previousPage && (
<PaginatorNavLink
permalink={previousPage}
@ -35,8 +34,6 @@ export default function BlogListPaginator(props: Props): JSX.Element {
}
/>
)}
</div>
<div className="pagination-nav__item pagination-nav__item--next">
{nextPage && (
<PaginatorNavLink
permalink={nextPage}
@ -47,9 +44,9 @@ export default function BlogListPaginator(props: Props): JSX.Element {
Older Entries
</Translate>
}
isNext
/>
)}
</div>
</nav>
);
}

View file

@ -9,8 +9,6 @@ import React from 'react';
import Link, {type Props as LinkProps} from '@docusaurus/Link';
import type {Props} from '@theme/BlogPostAuthor';
import styles from './styles.module.css';
function MaybeLink(props: LinkProps): JSX.Element {
if (props.href) {
return <Link {...props} />;
@ -24,11 +22,9 @@ export default function BlogPostAuthor({author}: Props): JSX.Element {
return (
<div className="avatar margin-bottom--sm">
{imageURL && (
<span className="avatar__photo-link avatar__photo">
<MaybeLink href={link}>
<img className={styles.image} src={imageURL} alt={name} />
<MaybeLink href={link} className="avatar__photo-link">
<img className="avatar__photo" src={imageURL} alt={name} />
</MaybeLink>
</span>
)}
{name && (

View file

@ -1,12 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
.image {
width: 100%;
height: 100%;
object-fit: cover;
}

View file

@ -21,7 +21,6 @@ export default function BlogPostPaginator(props: Props): JSX.Element {
message: 'Blog post page navigation',
description: 'The ARIA label for the blog posts pagination',
})}>
<div className="pagination-nav__item">
{prevItem && (
<PaginatorNavLink
{...prevItem}
@ -34,8 +33,6 @@ export default function BlogPostPaginator(props: Props): JSX.Element {
}
/>
)}
</div>
<div className="pagination-nav__item pagination-nav__item--next">
{nextItem && (
<PaginatorNavLink
{...nextItem}
@ -46,9 +43,9 @@ export default function BlogPostPaginator(props: Props): JSX.Element {
Older Post
</Translate>
}
isNext
/>
)}
</div>
</nav>
);
}

View file

@ -26,7 +26,7 @@ export default function BlogSidebarDesktop({sidebar}: Props): JSX.Element {
<div className={clsx(styles.sidebarItemTitle, 'margin-bottom--md')}>
{sidebar.title}
</div>
<ul className={styles.sidebarItemList}>
<ul className={clsx(styles.sidebarItemList, 'clean-list')}>
{sidebar.items.map((item) => (
<li key={item.permalink} className={styles.sidebarItem}>
<Link

View file

@ -18,9 +18,7 @@
}
.sidebarItemList {
list-style: none;
font-size: 0.9rem;
padding-left: 0;
}
.sidebarItem {

View file

@ -15,11 +15,12 @@
align-items: center;
justify-content: center;
transition: background-color var(--ifm-transition-fast) ease;
background-color: var(--docusaurus-collapse-button-bg);
}
.expandButton:hover,
.expandButton:focus {
background-color: var(--ifm-color-emphasis-200);
background-color: var(--docusaurus-collapse-button-bg-hover);
}
.expandButtonIcon {
@ -29,9 +30,4 @@
[dir='rtl'] .expandButtonIcon {
transform: rotate(180deg);
}
[data-theme='dark'] .expandButton:hover,
[data-theme='dark'] .expandButton:focus {
background-color: var(--collapse-button-bg-color-dark);
}
}

View file

@ -21,7 +21,6 @@ export default function DocPaginator(props: Props): JSX.Element {
message: 'Docs pages navigation',
description: 'The ARIA label for the docs pagination',
})}>
<div className="pagination-nav__item">
{previous && (
<PaginatorNavLink
{...previous}
@ -34,8 +33,6 @@ export default function DocPaginator(props: Props): JSX.Element {
}
/>
)}
</div>
<div className="pagination-nav__item pagination-nav__item--next">
{next && (
<PaginatorNavLink
{...next}
@ -46,9 +43,9 @@ export default function DocPaginator(props: Props): JSX.Element {
Next
</Translate>
}
isNext
/>
)}
</div>
</nav>
);
}

View file

@ -6,13 +6,19 @@
*/
:root {
--collapse-button-bg-color-dark: #2e333a;
--docusaurus-collapse-button-bg: transparent;
--docusaurus-collapse-button-bg-hover: rgb(0 0 0 / 10%);
}
[data-theme='dark']:root {
--docusaurus-collapse-button-bg: rgb(255 255 255 / 5%);
--docusaurus-collapse-button-bg-hover: rgb(255 255 255 / 10%);
}
@media (min-width: 997px) {
.collapseSidebarButton {
display: block !important;
background-color: var(--ifm-button-background-color);
background-color: var(--docusaurus-collapse-button-bg);
height: 40px;
position: sticky;
bottom: 0;
@ -29,13 +35,9 @@
transform: rotate(0);
}
[data-theme='dark'] .collapseSidebarButton {
background-color: var(--collapse-button-bg-color-dark);
}
[data-theme='dark'] .collapseSidebarButton:hover,
[data-theme='dark'] .collapseSidebarButton:focus {
background-color: var(--ifm-color-emphasis-200);
.collapseSidebarButton:hover,
.collapseSidebarButton:focus {
background-color: var(--docusaurus-collapse-button-bg-hover);
}
}

View file

@ -31,7 +31,7 @@ function Column({column}: {column: ColumnType}) {
return (
<div className="col footer__col">
<div className="footer__title">{column.title}</div>
<ul className="footer__items">
<ul className="footer__items clean-list">
{column.items.map((item, i) => (
<ColumnLinkItem key={i} item={item} />
))}

View file

@ -1,11 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
.contains-task-list {
padding-left: 0;
list-style: none;
}

View file

@ -9,17 +9,13 @@ import React from 'react';
import clsx from 'clsx';
import type {Props} from '@theme/MDXComponents/Ul';
import styles from './Ul.module.css';
const containsClassListLocalClass = styles['contains-task-list'];
function transformUlClassName(className?: string): string {
return clsx(
className,
// This class is set globally by GitHub/MDX
// We keep the global class, but apply scoped CSS
// We keep the global class, but add Infima class to get list without styling
// See https://github.com/syntax-tree/mdast-util-to-hast/issues/28
className?.includes('contains-task-list') && containsClassListLocalClass,
className?.includes('contains-task-list') && 'clean-list',
);
}

View file

@ -13,7 +13,7 @@ export default function NavbarLogo(): JSX.Element {
<Logo
className="navbar__brand"
imageClassName="navbar__logo"
titleClassName="navbar__title"
titleClassName="navbar__title text--truncate"
/>
);
}

View file

@ -58,10 +58,10 @@ export default function LocaleDropdownNavbarItem({
{...props}
mobile={mobile}
label={
<span>
<>
<IconLanguage className={styles.iconLanguage} />
{dropdownLabel}
</span>
</>
}
items={items}
/>

View file

@ -6,13 +6,19 @@
*/
import React from 'react';
import clsx from 'clsx';
import Link from '@docusaurus/Link';
import type {Props} from '@theme/PaginatorNavLink';
export default function PaginatorNavLink(props: Props): JSX.Element {
const {permalink, title, subLabel} = props;
const {permalink, title, subLabel, isNext} = props;
return (
<Link className="pagination-nav__link" to={permalink}>
<Link
className={clsx(
'pagination-nav__link',
isNext ? 'pagination-nav__link--next' : 'pagination-nav__link--prev',
)}
to={permalink}>
{subLabel && <div className="pagination-nav__sublabel">{subLabel}</div>}
<div className="pagination-nav__label">{title}</div>
</Link>

View file

@ -25,7 +25,7 @@ html[data-theme='dark'] {
--site-color-feedback-background: #f0f8ff;
--site-color-favorite-background: #1d1e1e;
--site-color-checkbox-checked-bg: hsl(167deg 56% 73% / 10%);
--docusaurus-highlighted-code-line-bg: rgb(66 66 66 / 30%);
--docusaurus-highlighted-code-line-bg: rgb(66 66 66 / 35%);
}
[data-theme='light'] {

View file

@ -168,7 +168,7 @@ function ShowcaseFilters() {
</div>
<ShowcaseFilterToggle />
</div>
<ul className={styles.checkboxList}>
<ul className="clean-list">
{TagList.map((tag, i) => {
const {label, description, color} = Tags[tag];
const id = `showcase_checkbox_id_${tag}`;
@ -287,7 +287,7 @@ function ShowcaseCards() {
<FavoriteIcon svgClass={styles.svgIconFavorite} />
<SearchBar />
</div>
<ul className={clsx('container', styles.showcaseList)}>
<ul className="container clean-list">
{favoriteUsers.map((user) => (
<ShowcaseCard key={user.title} user={user} />
))}
@ -298,7 +298,7 @@ function ShowcaseCards() {
<h2 className={styles.showcaseHeader}>
<Translate id="showcase.usersList.allUsers">All sites</Translate>
</h2>
<ul className={styles.showcaseList}>
<ul className="clean-list">
{otherUsers.map((user) => (
<ShowcaseCard key={user.title} user={user} />
))}
@ -314,7 +314,7 @@ function ShowcaseCards() {
)}>
<SearchBar />
</div>
<ul className={styles.showcaseList}>
<ul className="clean-list">
{filteredUsers.map((user) => (
<ShowcaseCard key={user.title} user={user} />
))}

View file

@ -30,12 +30,6 @@
flex-wrap: wrap;
}
.checkboxList,
.showcaseList {
padding: 0;
list-style: none;
}
.checkboxListItem {
user-select: none;
white-space: nowrap;

View file

@ -23,7 +23,6 @@ export default function ChangelogPaginator(props: Props): JSX.Element {
message: 'Changelog item navigation',
description: 'The ARIA label for the changelog pagination',
})}>
<div className="pagination-nav__item">
{prevItem && (
<PaginatorNavLink
{...prevItem}
@ -36,8 +35,6 @@ export default function ChangelogPaginator(props: Props): JSX.Element {
}
/>
)}
</div>
<div className="pagination-nav__item pagination-nav__item--next">
{nextItem && (
<PaginatorNavLink
{...nextItem}
@ -48,9 +45,9 @@ export default function ChangelogPaginator(props: Props): JSX.Element {
Older release
</Translate>
}
isNext
/>
)}
</div>
</nav>
);
}

View file

@ -10,7 +10,7 @@ import darkTheme from 'prism-react-renderer/themes/vsDark/index.cjs.js';
export default {
plain: {
color: '#D4D4D4',
backgroundColor: '#1E1E1E',
backgroundColor: '#212121',
},
styles: [
...darkTheme.styles,

View file

@ -32,11 +32,11 @@ const EXPECTED_CSS_MARKERS = [
'.markdown>h2',
'.button--outline.button--active',
'.DocSearch-Hit-content-wrapper',
'.navbar__title',
'--ifm-color-scheme:light',
'.col[class*=col--]',
'.padding-vert--xl',
'.footer__link-item',
'.navbar__title',
'.pagination__item',
'.pills__item',
'.tabs__item',

View file

@ -8617,10 +8617,10 @@ infer-owner@^1.0.4:
resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467"
integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==
infima@0.2.0-alpha.38:
version "0.2.0-alpha.38"
resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.38.tgz#e41d95c7cd82756549b17df12f613fed4af3d528"
integrity sha512-1WsmqSMI5IqzrUx3goq+miJznHBonbE3aoqZ1AR/i/oHhroxNeSV6Awv5VoVfXBhfTzLSnxkHaRI2qpAMYcCzw==
infima@0.2.0-alpha.39:
version "0.2.0-alpha.39"
resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.39.tgz#054b13ac44f3e9a42bc083988f1a1586add2f59c"
integrity sha512-UyYiwD3nwHakGhuOUfpe3baJ8gkiPpRVx4a4sE/Ag+932+Y6swtLsdPoRR8ezhwqGnduzxmFkjumV9roz6QoLw==
inflight@^1.0.4:
version "1.0.6"