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 ( return (
<DebugLayout> <DebugLayout>
<h2>Registry</h2> <h2>Registry</h2>
<ul className={styles.list}> <ul className="clean-list">
{Object.values(registry).map(([, aliasedPath, resolved]) => ( {Object.values(registry).map(([, aliasedPath, resolved]) => (
<li key={aliasedPath} className={styles.listItem}> <li key={aliasedPath} className={styles.listItem}>
<div style={{marginBottom: '10px'}}> <div style={{marginBottom: '10px'}}>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -22,34 +22,31 @@ export default function BlogListPaginator(props: Props): JSX.Element {
message: 'Blog list page navigation', message: 'Blog list page navigation',
description: 'The ARIA label for the blog pagination', description: 'The ARIA label for the blog pagination',
})}> })}>
<div className="pagination-nav__item"> {previousPage && (
{previousPage && ( <PaginatorNavLink
<PaginatorNavLink permalink={previousPage}
permalink={previousPage} title={
title={ <Translate
<Translate id="theme.blog.paginator.newerEntries"
id="theme.blog.paginator.newerEntries" description="The label used to navigate to the newer blog posts page (previous page)">
description="The label used to navigate to the newer blog posts page (previous page)"> Newer Entries
Newer Entries </Translate>
</Translate> }
} />
/> )}
)} {nextPage && (
</div> <PaginatorNavLink
<div className="pagination-nav__item pagination-nav__item--next"> permalink={nextPage}
{nextPage && ( title={
<PaginatorNavLink <Translate
permalink={nextPage} id="theme.blog.paginator.olderEntries"
title={ description="The label used to navigate to the older blog posts page (next page)">
<Translate Older Entries
id="theme.blog.paginator.olderEntries" </Translate>
description="The label used to navigate to the older blog posts page (next page)"> }
Older Entries isNext
</Translate> />
} )}
/>
)}
</div>
</nav> </nav>
); );
} }

View file

@ -9,8 +9,6 @@ import React from 'react';
import Link, {type Props as LinkProps} from '@docusaurus/Link'; import Link, {type Props as LinkProps} from '@docusaurus/Link';
import type {Props} from '@theme/BlogPostAuthor'; import type {Props} from '@theme/BlogPostAuthor';
import styles from './styles.module.css';
function MaybeLink(props: LinkProps): JSX.Element { function MaybeLink(props: LinkProps): JSX.Element {
if (props.href) { if (props.href) {
return <Link {...props} />; return <Link {...props} />;
@ -24,11 +22,9 @@ export default function BlogPostAuthor({author}: Props): JSX.Element {
return ( return (
<div className="avatar margin-bottom--sm"> <div className="avatar margin-bottom--sm">
{imageURL && ( {imageURL && (
<span className="avatar__photo-link avatar__photo"> <MaybeLink href={link} className="avatar__photo-link">
<MaybeLink href={link}> <img className="avatar__photo" src={imageURL} alt={name} />
<img className={styles.image} src={imageURL} alt={name} /> </MaybeLink>
</MaybeLink>
</span>
)} )}
{name && ( {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,34 +21,31 @@ export default function BlogPostPaginator(props: Props): JSX.Element {
message: 'Blog post page navigation', message: 'Blog post page navigation',
description: 'The ARIA label for the blog posts pagination', description: 'The ARIA label for the blog posts pagination',
})}> })}>
<div className="pagination-nav__item"> {prevItem && (
{prevItem && ( <PaginatorNavLink
<PaginatorNavLink {...prevItem}
{...prevItem} subLabel={
subLabel={ <Translate
<Translate id="theme.blog.post.paginator.newerPost"
id="theme.blog.post.paginator.newerPost" description="The blog post button label to navigate to the newer/previous post">
description="The blog post button label to navigate to the newer/previous post"> Newer Post
Newer Post </Translate>
</Translate> }
} />
/> )}
)} {nextItem && (
</div> <PaginatorNavLink
<div className="pagination-nav__item pagination-nav__item--next"> {...nextItem}
{nextItem && ( subLabel={
<PaginatorNavLink <Translate
{...nextItem} id="theme.blog.post.paginator.olderPost"
subLabel={ description="The blog post button label to navigate to the older/next post">
<Translate Older Post
id="theme.blog.post.paginator.olderPost" </Translate>
description="The blog post button label to navigate to the older/next post"> }
Older Post isNext
</Translate> />
} )}
/>
)}
</div>
</nav> </nav>
); );
} }

View file

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

View file

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

View file

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

View file

@ -21,34 +21,31 @@ export default function DocPaginator(props: Props): JSX.Element {
message: 'Docs pages navigation', message: 'Docs pages navigation',
description: 'The ARIA label for the docs pagination', description: 'The ARIA label for the docs pagination',
})}> })}>
<div className="pagination-nav__item"> {previous && (
{previous && ( <PaginatorNavLink
<PaginatorNavLink {...previous}
{...previous} subLabel={
subLabel={ <Translate
<Translate id="theme.docs.paginator.previous"
id="theme.docs.paginator.previous" description="The label used to navigate to the previous doc">
description="The label used to navigate to the previous doc"> Previous
Previous </Translate>
</Translate> }
} />
/> )}
)} {next && (
</div> <PaginatorNavLink
<div className="pagination-nav__item pagination-nav__item--next"> {...next}
{next && ( subLabel={
<PaginatorNavLink <Translate
{...next} id="theme.docs.paginator.next"
subLabel={ description="The label used to navigate to the next doc">
<Translate Next
id="theme.docs.paginator.next" </Translate>
description="The label used to navigate to the next doc"> }
Next isNext
</Translate> />
} )}
/>
)}
</div>
</nav> </nav>
); );
} }

View file

@ -6,13 +6,19 @@
*/ */
:root { :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) { @media (min-width: 997px) {
.collapseSidebarButton { .collapseSidebarButton {
display: block !important; display: block !important;
background-color: var(--ifm-button-background-color); background-color: var(--docusaurus-collapse-button-bg);
height: 40px; height: 40px;
position: sticky; position: sticky;
bottom: 0; bottom: 0;
@ -29,13 +35,9 @@
transform: rotate(0); transform: rotate(0);
} }
[data-theme='dark'] .collapseSidebarButton { .collapseSidebarButton:hover,
background-color: var(--collapse-button-bg-color-dark); .collapseSidebarButton:focus {
} background-color: var(--docusaurus-collapse-button-bg-hover);
[data-theme='dark'] .collapseSidebarButton:hover,
[data-theme='dark'] .collapseSidebarButton:focus {
background-color: var(--ifm-color-emphasis-200);
} }
} }

View file

@ -31,7 +31,7 @@ function Column({column}: {column: ColumnType}) {
return ( return (
<div className="col footer__col"> <div className="col footer__col">
<div className="footer__title">{column.title}</div> <div className="footer__title">{column.title}</div>
<ul className="footer__items"> <ul className="footer__items clean-list">
{column.items.map((item, i) => ( {column.items.map((item, i) => (
<ColumnLinkItem key={i} item={item} /> <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 clsx from 'clsx';
import type {Props} from '@theme/MDXComponents/Ul'; import type {Props} from '@theme/MDXComponents/Ul';
import styles from './Ul.module.css';
const containsClassListLocalClass = styles['contains-task-list'];
function transformUlClassName(className?: string): string { function transformUlClassName(className?: string): string {
return clsx( return clsx(
className, className,
// This class is set globally by GitHub/MDX // 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 // 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 <Logo
className="navbar__brand" className="navbar__brand"
imageClassName="navbar__logo" imageClassName="navbar__logo"
titleClassName="navbar__title" titleClassName="navbar__title text--truncate"
/> />
); );
} }

View file

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

View file

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

View file

@ -25,7 +25,7 @@ html[data-theme='dark'] {
--site-color-feedback-background: #f0f8ff; --site-color-feedback-background: #f0f8ff;
--site-color-favorite-background: #1d1e1e; --site-color-favorite-background: #1d1e1e;
--site-color-checkbox-checked-bg: hsl(167deg 56% 73% / 10%); --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'] { [data-theme='light'] {

View file

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

View file

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

View file

@ -23,34 +23,31 @@ export default function ChangelogPaginator(props: Props): JSX.Element {
message: 'Changelog item navigation', message: 'Changelog item navigation',
description: 'The ARIA label for the changelog pagination', description: 'The ARIA label for the changelog pagination',
})}> })}>
<div className="pagination-nav__item"> {prevItem && (
{prevItem && ( <PaginatorNavLink
<PaginatorNavLink {...prevItem}
{...prevItem} subLabel={
subLabel={ <Translate
<Translate id="theme.changelog.post.paginator.newerRelease"
id="theme.changelog.post.paginator.newerRelease" description="The changelog button label to navigate to the newer release">
description="The changelog button label to navigate to the newer release"> Newer release
Newer release </Translate>
</Translate> }
} />
/> )}
)} {nextItem && (
</div> <PaginatorNavLink
<div className="pagination-nav__item pagination-nav__item--next"> {...nextItem}
{nextItem && ( subLabel={
<PaginatorNavLink <Translate
{...nextItem} id="theme.changelog.post.paginator.olderRelease"
subLabel={ description="The changelog button label to navigate to the older release">
<Translate Older release
id="theme.changelog.post.paginator.olderRelease" </Translate>
description="The changelog button label to navigate to the older release"> }
Older release isNext
</Translate> />
} )}
/>
)}
</div>
</nav> </nav>
); );
} }

View file

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

View file

@ -32,11 +32,11 @@ const EXPECTED_CSS_MARKERS = [
'.markdown>h2', '.markdown>h2',
'.button--outline.button--active', '.button--outline.button--active',
'.DocSearch-Hit-content-wrapper', '.DocSearch-Hit-content-wrapper',
'.navbar__title',
'--ifm-color-scheme:light', '--ifm-color-scheme:light',
'.col[class*=col--]', '.col[class*=col--]',
'.padding-vert--xl', '.padding-vert--xl',
'.footer__link-item', '.footer__link-item',
'.navbar__title',
'.pagination__item', '.pagination__item',
'.pills__item', '.pills__item',
'.tabs__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" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467"
integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==
infima@0.2.0-alpha.38: infima@0.2.0-alpha.39:
version "0.2.0-alpha.38" version "0.2.0-alpha.39"
resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.38.tgz#e41d95c7cd82756549b17df12f613fed4af3d528" resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.39.tgz#054b13ac44f3e9a42bc083988f1a1586add2f59c"
integrity sha512-1WsmqSMI5IqzrUx3goq+miJznHBonbE3aoqZ1AR/i/oHhroxNeSV6Awv5VoVfXBhfTzLSnxkHaRI2qpAMYcCzw== integrity sha512-UyYiwD3nwHakGhuOUfpe3baJ8gkiPpRVx4a4sE/Ag+932+Y6swtLsdPoRR8ezhwqGnduzxmFkjumV9roz6QoLw==
inflight@^1.0.4: inflight@^1.0.4:
version "1.0.6" version "1.0.6"