@docusaurus/theme-classic 2.0.0-beta.18 → 2.0.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/admonitions.css +4 -0
- package/lib/default.css +3038 -0
- package/lib/getSwizzleConfig.js +9 -2
- package/lib/index.js +4 -4
- package/lib/nprogress.css +41 -0
- package/lib/nprogress.js +46 -0
- package/lib/theme-classic.d.ts +315 -33
- package/lib/validateThemeConfig.js +72 -14
- package/lib-next/theme/BackToTopButton/index.js +6 -102
- package/lib-next/theme/BlogLayout/index.js +1 -5
- package/lib-next/theme/BlogListPaginator/index.js +25 -28
- package/lib-next/theme/BlogPostAuthor/index.js +3 -6
- package/lib-next/theme/BlogPostItem/styles.module.css +9 -0
- package/lib-next/theme/BlogPostPaginator/index.js +25 -28
- package/lib-next/theme/BlogSidebar/Desktop/index.js +41 -0
- package/lib-next/theme/BlogSidebar/{styles.module.css → Desktop/styles.module.css} +1 -2
- package/lib-next/theme/BlogSidebar/Mobile/index.js +36 -0
- package/lib-next/theme/BlogSidebar/index.js +11 -31
- package/lib-next/theme/BlogTagsListPage/index.js +2 -3
- package/lib-next/theme/BlogTagsPostsPage/index.js +4 -6
- package/lib-next/theme/CodeBlock/Container/index.js +29 -0
- package/lib-next/theme/CodeBlock/Container/styles.module.css +14 -0
- package/lib-next/theme/CodeBlock/Content/Element.js +23 -0
- package/lib-next/theme/CodeBlock/Content/String.js +104 -0
- package/{src/theme/CodeBlock → lib-next/theme/CodeBlock/Content}/styles.module.css +39 -9
- package/lib-next/theme/CodeBlock/CopyButton/index.js +3 -2
- package/lib-next/theme/CodeBlock/CopyButton/styles.module.css +0 -19
- package/lib-next/theme/CodeBlock/Line/index.js +49 -0
- package/lib-next/theme/CodeBlock/Line/styles.module.css +51 -0
- package/lib-next/theme/CodeBlock/WordWrapButton/index.js +40 -0
- package/lib-next/theme/CodeBlock/WordWrapButton/styles.module.css +15 -0
- package/lib-next/theme/CodeBlock/index.js +27 -133
- package/lib-next/theme/Details/index.js +1 -1
- package/lib-next/theme/DocBreadcrumbs/index.js +50 -23
- package/lib-next/theme/DocBreadcrumbs/styles.module.css +8 -0
- package/lib-next/theme/DocCardList/index.js +6 -4
- package/lib-next/theme/DocCategoryGeneratedIndexPage/index.js +3 -3
- package/lib-next/theme/DocCategoryGeneratedIndexPage/styles.module.css +8 -0
- package/lib-next/theme/DocItem/index.js +1 -1
- package/lib-next/theme/DocItem/styles.module.css +6 -0
- package/lib-next/theme/DocPage/Layout/Main/index.js +29 -0
- package/lib-next/theme/DocPage/Layout/Main/styles.module.css +28 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/ExpandButton/index.js +34 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +33 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/index.js +68 -0
- package/lib-next/theme/DocPage/Layout/Sidebar/index.module.css +32 -0
- package/lib-next/theme/DocPage/Layout/index.js +34 -0
- package/lib-next/theme/{BlogPostAuthor/styles.module.css → DocPage/Layout/index.module.css} +6 -3
- package/lib-next/theme/DocPage/index.js +28 -146
- package/lib-next/theme/DocPaginator/index.js +25 -28
- package/lib-next/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +11 -9
- package/lib-next/theme/DocSidebar/Desktop/Content/styles.module.css +6 -0
- package/lib-next/theme/DocSidebar/Desktop/index.js +4 -2
- package/lib-next/theme/DocSidebarItem/Category.js +197 -0
- package/lib-next/theme/DocSidebarItem/Html.js +27 -0
- package/{src/theme/DocSidebarItem/styles.module.css → lib-next/theme/DocSidebarItem/Html.module.css} +0 -4
- package/lib-next/theme/DocSidebarItem/Link.js +53 -0
- package/{src/theme/MDXComponents/Ul.module.css → lib-next/theme/DocSidebarItem/Link.module.css} +2 -3
- package/lib-next/theme/DocSidebarItem/index.js +4 -246
- package/lib-next/theme/DocSidebarItems/index.js +1 -6
- package/lib-next/theme/DocTagDocListPage/index.js +3 -3
- package/lib-next/theme/DocVersionBanner/index.js +2 -2
- package/lib-next/theme/Footer/Links/MultiColumn/index.js +1 -1
- package/lib-next/theme/Heading/index.js +4 -20
- package/lib-next/theme/IconHome/index.js +17 -0
- package/lib-next/theme/LastUpdated/index.js +1 -0
- package/lib-next/theme/Layout/index.js +1 -1
- package/lib-next/theme/MDXComponents/Ul.js +2 -4
- package/lib-next/theme/Navbar/Content/index.js +6 -1
- package/lib-next/theme/Navbar/Logo/index.js +1 -1
- package/lib-next/theme/Navbar/Search/index.js +11 -0
- package/lib-next/theme/Navbar/Search/styles.module.css +20 -0
- package/lib-next/theme/NavbarItem/ComponentTypes.js +27 -0
- package/lib-next/theme/NavbarItem/DocNavbarItem.js +11 -28
- package/lib-next/theme/NavbarItem/DocSidebarNavbarItem.js +10 -42
- package/lib-next/theme/NavbarItem/DocsVersionDropdownNavbarItem.js +25 -29
- package/lib-next/theme/NavbarItem/DocsVersionNavbarItem.js +2 -9
- package/lib-next/theme/NavbarItem/DropdownNavbarItem.js +4 -1
- package/lib-next/theme/NavbarItem/HtmlNavbarItem.js +30 -0
- package/lib-next/theme/NavbarItem/LocaleDropdownNavbarItem/index.js +5 -10
- package/lib-next/theme/NavbarItem/NavbarNavLink.js +49 -31
- package/lib-next/theme/NavbarItem/SearchNavbarItem.js +6 -1
- package/lib-next/theme/NavbarItem/index.js +4 -23
- package/lib-next/theme/NavbarItem/utils.js +2 -1
- package/lib-next/theme/PaginatorNavLink/index.js +8 -2
- package/lib-next/theme/SiteMetadata/index.js +8 -7
- package/lib-next/theme/SkipToContent/index.js +3 -29
- package/lib-next/theme/TOCCollapsible/CollapseButton.js +29 -0
- package/{src/theme/TOCCollapsible/styles.module.css → lib-next/theme/TOCCollapsible/CollapseButton.module.css} +1 -22
- package/lib-next/theme/TOCCollapsible/index.js +3 -13
- package/lib-next/theme/TOCCollapsible/index.module.css +31 -0
- package/lib-next/theme/TOCItems/Tree.js +40 -0
- package/lib-next/theme/TOCItems/index.js +3 -34
- package/lib-next/theme/TabItem/index.js +3 -1
- package/lib-next/theme/{MDXComponents/Ul.module.css → TabItem/styles.module.css} +2 -3
- package/lib-next/theme/Tabs/__tests__/index.test.js +3 -3
- package/lib-next/theme/Tabs/index.js +3 -3
- package/lib-next/theme/Tabs/styles.module.css +4 -0
- package/lib-next/theme/Tag/index.js +2 -3
- package/lib-next/theme/TagsListInline/index.js +1 -1
- package/package.json +23 -18
- package/src/admonitions.css +4 -0
- package/src/getSwizzleConfig.ts +10 -2
- package/src/index.ts +4 -3
- package/src/nprogress.css +41 -0
- package/src/nprogress.ts +31 -0
- package/src/theme/BackToTopButton/index.tsx +5 -112
- package/src/theme/BlogLayout/index.tsx +1 -5
- package/src/theme/BlogListPaginator/index.tsx +25 -28
- package/src/theme/BlogPostAuthor/index.tsx +3 -7
- package/src/theme/BlogPostItem/styles.module.css +9 -0
- package/src/theme/BlogPostPaginator/index.tsx +25 -28
- package/src/theme/BlogSidebar/Desktop/index.tsx +45 -0
- package/src/theme/BlogSidebar/{styles.module.css → Desktop/styles.module.css} +1 -2
- package/src/theme/BlogSidebar/Mobile/index.tsx +38 -0
- package/src/theme/BlogSidebar/index.tsx +10 -31
- package/src/theme/BlogTagsListPage/index.tsx +2 -3
- package/src/theme/BlogTagsPostsPage/index.tsx +8 -5
- package/src/theme/CodeBlock/Container/index.tsx +35 -0
- package/src/theme/CodeBlock/Container/styles.module.css +14 -0
- package/src/theme/CodeBlock/Content/Element.tsx +30 -0
- package/src/theme/CodeBlock/Content/String.tsx +111 -0
- package/{lib-next/theme/CodeBlock → src/theme/CodeBlock/Content}/styles.module.css +39 -9
- package/src/theme/CodeBlock/CopyButton/index.tsx +3 -2
- package/src/theme/CodeBlock/CopyButton/styles.module.css +0 -19
- package/src/theme/CodeBlock/Line/index.tsx +48 -0
- package/src/theme/CodeBlock/Line/styles.module.css +51 -0
- package/src/theme/CodeBlock/WordWrapButton/index.tsx +49 -0
- package/src/theme/CodeBlock/WordWrapButton/styles.module.css +15 -0
- package/src/theme/CodeBlock/index.tsx +29 -133
- package/src/theme/Details/index.tsx +1 -1
- package/src/theme/DocBreadcrumbs/index.tsx +50 -20
- package/src/theme/DocBreadcrumbs/styles.module.css +8 -0
- package/src/theme/DocCardList/index.tsx +5 -7
- package/src/theme/DocCategoryGeneratedIndexPage/index.tsx +3 -3
- package/src/theme/DocCategoryGeneratedIndexPage/styles.module.css +8 -0
- package/src/theme/DocItem/index.tsx +1 -1
- package/src/theme/DocItem/styles.module.css +6 -0
- package/src/theme/DocPage/Layout/Main/index.tsx +37 -0
- package/src/theme/DocPage/Layout/Main/styles.module.css +28 -0
- package/src/theme/DocPage/Layout/Sidebar/ExpandButton/index.tsx +40 -0
- package/src/theme/DocPage/Layout/Sidebar/ExpandButton/styles.module.css +33 -0
- package/src/theme/DocPage/Layout/Sidebar/index.module.css +32 -0
- package/src/theme/DocPage/Layout/Sidebar/index.tsx +74 -0
- package/src/theme/{BlogPostAuthor/styles.module.css → DocPage/Layout/index.module.css} +6 -3
- package/src/theme/DocPage/Layout/index.tsx +39 -0
- package/src/theme/DocPage/index.tsx +28 -157
- package/src/theme/DocPaginator/index.tsx +25 -28
- package/src/theme/DocSidebar/Desktop/CollapseButton/styles.module.css +11 -9
- package/src/theme/DocSidebar/Desktop/Content/styles.module.css +6 -0
- package/src/theme/DocSidebar/Desktop/index.tsx +4 -2
- package/src/theme/DocSidebarItem/Category.tsx +210 -0
- package/{lib-next/theme/DocSidebarItem/styles.module.css → src/theme/DocSidebarItem/Html.module.css} +0 -4
- package/src/theme/DocSidebarItem/Html.tsx +34 -0
- package/src/theme/DocSidebarItem/Link.module.css +10 -0
- package/src/theme/DocSidebarItem/Link.tsx +58 -0
- package/src/theme/DocSidebarItem/index.tsx +4 -259
- package/src/theme/DocSidebarItems/index.tsx +1 -6
- package/src/theme/DocTagDocListPage/index.tsx +3 -4
- package/src/theme/DocVersionBanner/index.tsx +2 -2
- package/src/theme/Footer/Links/MultiColumn/index.tsx +1 -1
- package/src/theme/Heading/index.tsx +4 -18
- package/src/theme/IconHome/index.tsx +20 -0
- package/src/theme/LastUpdated/index.tsx +1 -0
- package/src/theme/Layout/index.tsx +1 -1
- package/src/theme/MDXComponents/Details.tsx +2 -3
- package/src/theme/MDXComponents/Ul.tsx +2 -6
- package/src/theme/Navbar/Content/index.tsx +6 -1
- package/src/theme/Navbar/Logo/index.tsx +1 -1
- package/src/theme/Navbar/Search/index.tsx +15 -0
- package/src/theme/Navbar/Search/styles.module.css +20 -0
- package/src/theme/NavbarItem/ComponentTypes.tsx +32 -0
- package/src/theme/NavbarItem/DocNavbarItem.tsx +13 -32
- package/src/theme/NavbarItem/DocSidebarNavbarItem.tsx +9 -49
- package/src/theme/NavbarItem/DocsVersionDropdownNavbarItem.tsx +26 -33
- package/src/theme/NavbarItem/DocsVersionNavbarItem.tsx +3 -10
- package/src/theme/NavbarItem/DropdownNavbarItem.tsx +4 -1
- package/src/theme/NavbarItem/HtmlNavbarItem.tsx +32 -0
- package/src/theme/NavbarItem/LocaleDropdownNavbarItem/index.tsx +5 -9
- package/src/theme/NavbarItem/NavbarNavLink.tsx +41 -25
- package/src/theme/NavbarItem/SearchNavbarItem.tsx +6 -1
- package/src/theme/NavbarItem/index.tsx +9 -38
- package/src/theme/NavbarItem/utils.ts +5 -2
- package/src/theme/PaginatorNavLink/index.tsx +8 -2
- package/src/theme/SiteMetadata/index.tsx +8 -8
- package/src/theme/SkipToContent/index.tsx +3 -29
- package/{lib-next/theme/TOCCollapsible/styles.module.css → src/theme/TOCCollapsible/CollapseButton.module.css} +1 -22
- package/src/theme/TOCCollapsible/CollapseButton.tsx +35 -0
- package/src/theme/TOCCollapsible/index.module.css +31 -0
- package/src/theme/TOCCollapsible/index.tsx +3 -14
- package/src/theme/TOCItems/Tree.tsx +46 -0
- package/src/theme/TOCItems/index.tsx +2 -41
- package/src/theme/TabItem/index.tsx +7 -1
- package/src/theme/TabItem/styles.module.css +10 -0
- package/src/theme/Tabs/index.tsx +3 -3
- package/src/theme/Tabs/styles.module.css +4 -0
- package/src/theme/Tag/index.tsx +2 -4
- package/src/theme/TagsListInline/index.tsx +1 -1
- package/src/theme-classic.d.ts +315 -33
- package/src/validateThemeConfig.ts +80 -13
- package/lib/types.d.ts +0 -11
- package/lib-next/theme/DocPage/styles.module.css +0 -82
- package/src/theme/DocPage/styles.module.css +0 -82
- package/src/types.d.ts +0 -11
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import clsx from 'clsx';
|
|
10
|
+
import Translate from '@docusaurus/Translate';
|
|
11
|
+
import styles from './CollapseButton.module.css';
|
|
12
|
+
import type {Props} from '@theme/TOCCollapsible/CollapseButton';
|
|
13
|
+
|
|
14
|
+
export default function TOCCollapsibleCollapseButton({
|
|
15
|
+
collapsed,
|
|
16
|
+
...props
|
|
17
|
+
}: Props): JSX.Element {
|
|
18
|
+
return (
|
|
19
|
+
<button
|
|
20
|
+
type="button"
|
|
21
|
+
{...props}
|
|
22
|
+
className={clsx(
|
|
23
|
+
'clean-btn',
|
|
24
|
+
styles.tocCollapsibleButton,
|
|
25
|
+
!collapsed && styles.tocCollapsibleButtonExpanded,
|
|
26
|
+
props.className,
|
|
27
|
+
)}>
|
|
28
|
+
<Translate
|
|
29
|
+
id="theme.TOCCollapsible.toggleButtonLabel"
|
|
30
|
+
description="The label used by the button on the collapsible TOC component">
|
|
31
|
+
On this page
|
|
32
|
+
</Translate>
|
|
33
|
+
</button>
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.tocCollapsible {
|
|
9
|
+
background-color: var(--ifm-menu-color-background-active);
|
|
10
|
+
border-radius: var(--ifm-global-radius);
|
|
11
|
+
margin: 1rem 0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.tocCollapsibleContent > ul {
|
|
15
|
+
border-left: none;
|
|
16
|
+
border-top: 1px solid var(--ifm-color-emphasis-300);
|
|
17
|
+
padding: 0.2rem 0;
|
|
18
|
+
font-size: 15px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.tocCollapsibleContent ul li {
|
|
22
|
+
margin: 0.4rem 0.8rem;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.tocCollapsibleContent a {
|
|
26
|
+
display: block;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.tocCollapsibleExpanded {
|
|
30
|
+
transform: none;
|
|
31
|
+
}
|
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import clsx from 'clsx';
|
|
10
|
-
import Translate from '@docusaurus/Translate';
|
|
11
10
|
import {useCollapsible, Collapsible} from '@docusaurus/theme-common';
|
|
12
|
-
import styles from './
|
|
11
|
+
import styles from './index.module.css';
|
|
13
12
|
import TOCItems from '@theme/TOCItems';
|
|
14
13
|
import type {Props} from '@theme/TOCCollapsible';
|
|
14
|
+
import CollapseButton from '@theme/TOCCollapsible/CollapseButton';
|
|
15
15
|
|
|
16
16
|
export default function TOCCollapsible({
|
|
17
17
|
toc,
|
|
@@ -22,7 +22,6 @@ export default function TOCCollapsible({
|
|
|
22
22
|
const {collapsed, toggleCollapsed} = useCollapsible({
|
|
23
23
|
initialState: true,
|
|
24
24
|
});
|
|
25
|
-
|
|
26
25
|
return (
|
|
27
26
|
<div
|
|
28
27
|
className={clsx(
|
|
@@ -30,17 +29,7 @@ export default function TOCCollapsible({
|
|
|
30
29
|
!collapsed && styles.tocCollapsibleExpanded,
|
|
31
30
|
className,
|
|
32
31
|
)}>
|
|
33
|
-
<
|
|
34
|
-
type="button"
|
|
35
|
-
className={clsx('clean-btn', styles.tocCollapsibleButton)}
|
|
36
|
-
onClick={toggleCollapsed}>
|
|
37
|
-
<Translate
|
|
38
|
-
id="theme.TOCCollapsible.toggleButtonLabel"
|
|
39
|
-
description="The label used by the button on the collapsible TOC component">
|
|
40
|
-
On this page
|
|
41
|
-
</Translate>
|
|
42
|
-
</button>
|
|
43
|
-
|
|
32
|
+
<CollapseButton collapsed={collapsed} onClick={toggleCollapsed} />
|
|
44
33
|
<Collapsible
|
|
45
34
|
lazy
|
|
46
35
|
className={styles.tocCollapsibleContent}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import React from 'react';
|
|
9
|
+
import type {Props} from '@theme/TOCItems/Tree';
|
|
10
|
+
|
|
11
|
+
// Recursive component rendering the toc tree
|
|
12
|
+
function TOCItemTree({
|
|
13
|
+
toc,
|
|
14
|
+
className,
|
|
15
|
+
linkClassName,
|
|
16
|
+
isChild,
|
|
17
|
+
}: Props): JSX.Element | null {
|
|
18
|
+
if (!toc.length) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return (
|
|
22
|
+
<ul className={isChild ? undefined : className}>
|
|
23
|
+
{toc.map((heading) => (
|
|
24
|
+
<li key={heading.id}>
|
|
25
|
+
{/* eslint-disable-next-line jsx-a11y/control-has-associated-label */}
|
|
26
|
+
<a
|
|
27
|
+
href={`#${heading.id}`}
|
|
28
|
+
className={linkClassName ?? undefined}
|
|
29
|
+
// Developer provided the HTML, so assume it's safe.
|
|
30
|
+
// eslint-disable-next-line react/no-danger
|
|
31
|
+
dangerouslySetInnerHTML={{__html: heading.value}}
|
|
32
|
+
/>
|
|
33
|
+
<TOCItemTree
|
|
34
|
+
isChild
|
|
35
|
+
toc={heading.children}
|
|
36
|
+
className={className}
|
|
37
|
+
linkClassName={linkClassName}
|
|
38
|
+
/>
|
|
39
|
+
</li>
|
|
40
|
+
))}
|
|
41
|
+
</ul>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Memo only the tree root is enough
|
|
46
|
+
export default React.memo(TOCItemTree);
|
|
@@ -7,53 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
import React, {useMemo} from 'react';
|
|
9
9
|
import type {Props} from '@theme/TOCItems';
|
|
10
|
+
import TOCItemTree from '@theme/TOCItems/Tree';
|
|
10
11
|
import {
|
|
11
12
|
type TOCHighlightConfig,
|
|
12
|
-
type TOCTreeNode,
|
|
13
13
|
useThemeConfig,
|
|
14
14
|
useTOCHighlight,
|
|
15
15
|
useFilteredAndTreeifiedTOC,
|
|
16
16
|
} from '@docusaurus/theme-common';
|
|
17
17
|
|
|
18
|
-
// Recursive component rendering the toc tree
|
|
19
|
-
/* eslint-disable jsx-a11y/control-has-associated-label */
|
|
20
|
-
function TOCItemList({
|
|
21
|
-
toc,
|
|
22
|
-
className,
|
|
23
|
-
linkClassName,
|
|
24
|
-
isChild,
|
|
25
|
-
}: {
|
|
26
|
-
readonly toc: readonly TOCTreeNode[];
|
|
27
|
-
readonly className: string;
|
|
28
|
-
readonly linkClassName: string | null;
|
|
29
|
-
readonly isChild?: boolean;
|
|
30
|
-
}): JSX.Element | null {
|
|
31
|
-
if (!toc.length) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
return (
|
|
35
|
-
<ul className={isChild ? undefined : className}>
|
|
36
|
-
{toc.map((heading) => (
|
|
37
|
-
<li key={heading.id}>
|
|
38
|
-
<a
|
|
39
|
-
href={`#${heading.id}`}
|
|
40
|
-
className={linkClassName ?? undefined}
|
|
41
|
-
// Developer provided the HTML, so assume it's safe.
|
|
42
|
-
// eslint-disable-next-line react/no-danger
|
|
43
|
-
dangerouslySetInnerHTML={{__html: heading.value}}
|
|
44
|
-
/>
|
|
45
|
-
<TOCItemList
|
|
46
|
-
isChild
|
|
47
|
-
toc={heading.children}
|
|
48
|
-
className={className}
|
|
49
|
-
linkClassName={linkClassName}
|
|
50
|
-
/>
|
|
51
|
-
</li>
|
|
52
|
-
))}
|
|
53
|
-
</ul>
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
18
|
export default function TOCItems({
|
|
58
19
|
toc,
|
|
59
20
|
className = 'table-of-contents table-of-contents__left-border',
|
|
@@ -90,7 +51,7 @@ export default function TOCItems({
|
|
|
90
51
|
useTOCHighlight(tocHighlightConfig);
|
|
91
52
|
|
|
92
53
|
return (
|
|
93
|
-
<
|
|
54
|
+
<TOCItemTree
|
|
94
55
|
toc={tocTree}
|
|
95
56
|
className={className}
|
|
96
57
|
linkClassName={linkClassName}
|
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import type {Props} from '@theme/TabItem';
|
|
10
|
+
import clsx from 'clsx';
|
|
11
|
+
|
|
12
|
+
import styles from './styles.module.css';
|
|
10
13
|
|
|
11
14
|
export default function TabItem({
|
|
12
15
|
children,
|
|
@@ -14,7 +17,10 @@ export default function TabItem({
|
|
|
14
17
|
className,
|
|
15
18
|
}: Props): JSX.Element {
|
|
16
19
|
return (
|
|
17
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
role="tabpanel"
|
|
22
|
+
className={clsx(styles.tabItem, className)}
|
|
23
|
+
{...{hidden}}>
|
|
18
24
|
{children}
|
|
19
25
|
</div>
|
|
20
26
|
);
|
package/src/theme/Tabs/index.tsx
CHANGED
|
@@ -141,7 +141,7 @@ function TabsComponent(props: Props): JSX.Element {
|
|
|
141
141
|
};
|
|
142
142
|
|
|
143
143
|
return (
|
|
144
|
-
<div className=
|
|
144
|
+
<div className={clsx('tabs-container', styles.tabList)}>
|
|
145
145
|
<ul
|
|
146
146
|
role="tablist"
|
|
147
147
|
aria-orientation="horizontal"
|
|
@@ -181,10 +181,10 @@ function TabsComponent(props: Props): JSX.Element {
|
|
|
181
181
|
children.filter(
|
|
182
182
|
(tabItem) => tabItem.props.value === selectedValue,
|
|
183
183
|
)[0]!,
|
|
184
|
-
{className: 'margin-
|
|
184
|
+
{className: 'margin-top--md'},
|
|
185
185
|
)
|
|
186
186
|
) : (
|
|
187
|
-
<div className="margin-
|
|
187
|
+
<div className="margin-top--md">
|
|
188
188
|
{children.map((tabItem, i) =>
|
|
189
189
|
cloneElement(tabItem, {
|
|
190
190
|
key: i,
|
package/src/theme/Tag/index.tsx
CHANGED
|
@@ -12,9 +12,7 @@ import type {Props} from '@theme/Tag';
|
|
|
12
12
|
|
|
13
13
|
import styles from './styles.module.css';
|
|
14
14
|
|
|
15
|
-
export default function Tag(
|
|
16
|
-
const {permalink, name, count} = props;
|
|
17
|
-
|
|
15
|
+
export default function Tag({permalink, label, count}: Props): JSX.Element {
|
|
18
16
|
return (
|
|
19
17
|
<Link
|
|
20
18
|
href={permalink}
|
|
@@ -22,7 +20,7 @@ export default function Tag(props: Props): JSX.Element {
|
|
|
22
20
|
styles.tag,
|
|
23
21
|
count ? styles.tagWithCount : styles.tagRegular,
|
|
24
22
|
)}>
|
|
25
|
-
{
|
|
23
|
+
{label}
|
|
26
24
|
{count && <span>{count}</span>}
|
|
27
25
|
</Link>
|
|
28
26
|
);
|
|
@@ -26,7 +26,7 @@ export default function TagsListInline({tags}: Props): JSX.Element {
|
|
|
26
26
|
<ul className={clsx(styles.tags, 'padding--none', 'margin-left--sm')}>
|
|
27
27
|
{tags.map(({label, permalink: tagPermalink}) => (
|
|
28
28
|
<li key={tagPermalink} className={styles.tag}>
|
|
29
|
-
<Tag
|
|
29
|
+
<Tag label={label} permalink={tagPermalink} />
|
|
30
30
|
</li>
|
|
31
31
|
))}
|
|
32
32
|
</ul>
|