@docusaurus/theme-classic 0.0.0-4927 → 0.0.0-4930

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.
Files changed (36) hide show
  1. package/lib/theme-classic.d.ts +37 -2
  2. package/lib-next/theme/DocPage/Layout/Main.js +1 -1
  3. package/lib-next/theme/DocPage/Layout/Main.module.css +28 -0
  4. package/lib-next/theme/DocPage/Layout/Sidebar/ExpandButton.js +34 -0
  5. package/lib-next/theme/DocPage/Layout/Sidebar/ExpandButton.module.css +37 -0
  6. package/lib-next/theme/DocPage/Layout/{Aside.js → Sidebar/index.js} +5 -31
  7. package/lib-next/theme/DocPage/Layout/Sidebar/index.module.css +32 -0
  8. package/lib-next/theme/DocPage/Layout/index.js +3 -3
  9. package/lib-next/theme/DocPage/Layout/index.module.css +15 -0
  10. package/lib-next/theme/DocPage/index.js +2 -32
  11. package/lib-next/theme/TOCCollapsible/CollapseButton.js +29 -0
  12. package/{src/theme/TOCCollapsible/styles.module.css → lib-next/theme/TOCCollapsible/CollapseButton.module.css} +1 -22
  13. package/lib-next/theme/TOCCollapsible/index.js +3 -13
  14. package/lib-next/theme/TOCCollapsible/index.module.css +31 -0
  15. package/lib-next/theme/TOCItems/Tree.js +41 -0
  16. package/lib-next/theme/TOCItems/index.js +3 -34
  17. package/package.json +13 -13
  18. package/src/theme/DocPage/Layout/Main.module.css +28 -0
  19. package/src/theme/DocPage/Layout/Main.tsx +1 -1
  20. package/src/theme/DocPage/Layout/Sidebar/ExpandButton.module.css +37 -0
  21. package/src/theme/DocPage/Layout/Sidebar/ExpandButton.tsx +40 -0
  22. package/src/theme/DocPage/Layout/Sidebar/index.module.css +32 -0
  23. package/src/theme/DocPage/Layout/{Aside.tsx → Sidebar/index.tsx} +5 -31
  24. package/src/theme/DocPage/Layout/index.module.css +15 -0
  25. package/src/theme/DocPage/Layout/index.tsx +3 -3
  26. package/src/theme/DocPage/index.tsx +2 -39
  27. package/src/theme/MDXComponents/Details.tsx +2 -3
  28. package/{lib-next/theme/TOCCollapsible/styles.module.css → src/theme/TOCCollapsible/CollapseButton.module.css} +1 -22
  29. package/src/theme/TOCCollapsible/CollapseButton.tsx +35 -0
  30. package/src/theme/TOCCollapsible/index.module.css +31 -0
  31. package/src/theme/TOCCollapsible/index.tsx +3 -14
  32. package/src/theme/TOCItems/Tree.tsx +46 -0
  33. package/src/theme/TOCItems/index.tsx +2 -41
  34. package/src/theme-classic.d.ts +37 -2
  35. package/lib-next/theme/DocPage/Layout/styles.module.css +0 -87
  36. package/src/theme/DocPage/Layout/styles.module.css +0 -87
@@ -0,0 +1,37 @@
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
+ @media (min-width: 997px) {
9
+ .expandButton {
10
+ position: sticky;
11
+ top: 0;
12
+ height: 100%;
13
+ max-height: 100vh;
14
+ display: flex;
15
+ align-items: center;
16
+ justify-content: center;
17
+ transition: background-color var(--ifm-transition-fast) ease;
18
+ }
19
+
20
+ .expandButton:hover,
21
+ .expandButton:focus {
22
+ background-color: var(--ifm-color-emphasis-200);
23
+ }
24
+
25
+ .expandButtonIcon {
26
+ transform: rotate(0);
27
+ }
28
+
29
+ [dir='rtl'] .expandButtonIcon {
30
+ transform: rotate(180deg);
31
+ }
32
+
33
+ [data-theme='dark'] .expandButton:hover,
34
+ [data-theme='dark'] .expandButton:focus {
35
+ background-color: var(--collapse-button-bg-color-dark);
36
+ }
37
+ }
@@ -0,0 +1,40 @@
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 IconArrow from '@theme/IconArrow';
10
+ import {translate} from '@docusaurus/Translate';
11
+ import type {Props} from '@theme/DocPage/Layout/Sidebar/ExpandButton';
12
+
13
+ import styles from './ExpandButton.module.css';
14
+
15
+ export default function DocPageLayoutSidebarExpandButton({
16
+ toggleSidebar,
17
+ }: Props): JSX.Element {
18
+ return (
19
+ <div
20
+ className={styles.expandButton}
21
+ title={translate({
22
+ id: 'theme.docs.sidebar.expandButtonTitle',
23
+ message: 'Expand sidebar',
24
+ description:
25
+ 'The ARIA label and title attribute for expand button of doc sidebar',
26
+ })}
27
+ aria-label={translate({
28
+ id: 'theme.docs.sidebar.expandButtonAriaLabel',
29
+ message: 'Expand sidebar',
30
+ description:
31
+ 'The ARIA label and title attribute for expand button of doc sidebar',
32
+ })}
33
+ tabIndex={0}
34
+ role="button"
35
+ onKeyDown={toggleSidebar}
36
+ onClick={toggleSidebar}>
37
+ <IconArrow className={styles.expandButtonIcon} />
38
+ </div>
39
+ );
40
+ }
@@ -0,0 +1,32 @@
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
+ :root {
9
+ --doc-sidebar-width: 300px;
10
+ --doc-sidebar-hidden-width: 30px;
11
+ }
12
+
13
+ .docSidebarContainer {
14
+ display: none;
15
+ }
16
+
17
+ @media (min-width: 997px) {
18
+ .docSidebarContainer {
19
+ display: block;
20
+ width: var(--doc-sidebar-width);
21
+ margin-top: calc(-1 * var(--ifm-navbar-height));
22
+ border-right: 1px solid var(--ifm-toc-border-color);
23
+ will-change: width;
24
+ transition: width var(--ifm-transition-fast) ease;
25
+ clip-path: inset(0);
26
+ }
27
+
28
+ .docSidebarContainerHidden {
29
+ width: var(--doc-sidebar-hidden-width);
30
+ cursor: pointer;
31
+ }
32
+ }
@@ -7,41 +7,15 @@
7
7
 
8
8
  import React, {type ReactNode, useState, useCallback} from 'react';
9
9
  import DocSidebar from '@theme/DocSidebar';
10
- import IconArrow from '@theme/IconArrow';
11
- import {translate} from '@docusaurus/Translate';
12
10
  import {useLocation} from '@docusaurus/router';
13
- import type {Props} from '@theme/DocPage/Layout/Aside';
11
+ import type {Props} from '@theme/DocPage/Layout/Sidebar';
12
+ import ExpandButton from '@theme/DocPage/Layout/Sidebar/ExpandButton';
14
13
 
15
14
  import clsx from 'clsx';
16
- import styles from './styles.module.css';
15
+ import styles from './index.module.css';
17
16
 
18
17
  import {ThemeClassNames, useDocsSidebar} from '@docusaurus/theme-common';
19
18
 
20
- function SidebarExpandButton({toggleSidebar}: {toggleSidebar: () => void}) {
21
- return (
22
- <div
23
- className={styles.collapsedDocSidebar}
24
- title={translate({
25
- id: 'theme.docs.sidebar.expandButtonTitle',
26
- message: 'Expand sidebar',
27
- description:
28
- 'The ARIA label and title attribute for expand button of doc sidebar',
29
- })}
30
- aria-label={translate({
31
- id: 'theme.docs.sidebar.expandButtonAriaLabel',
32
- message: 'Expand sidebar',
33
- description:
34
- 'The ARIA label and title attribute for expand button of doc sidebar',
35
- })}
36
- tabIndex={0}
37
- role="button"
38
- onKeyDown={toggleSidebar}
39
- onClick={toggleSidebar}>
40
- <IconArrow className={styles.expandSidebarButtonIcon} />
41
- </div>
42
- );
43
- }
44
-
45
19
  // Reset sidebar state when sidebar changes
46
20
  // Use React key to unmount/remount the children
47
21
  // See https://github.com/facebook/docusaurus/issues/3414
@@ -54,7 +28,7 @@ function ResetOnSidebarChange({children}: {children: ReactNode}) {
54
28
  );
55
29
  }
56
30
 
57
- export default function DocPageLayoutAside({
31
+ export default function DocPageLayoutSidebar({
58
32
  sidebar,
59
33
  hiddenSidebarContainer,
60
34
  setHiddenSidebarContainer,
@@ -94,7 +68,7 @@ export default function DocPageLayoutAside({
94
68
  />
95
69
  </ResetOnSidebarChange>
96
70
 
97
- {hiddenSidebar && <SidebarExpandButton toggleSidebar={toggleSidebar} />}
71
+ {hiddenSidebar && <ExpandButton toggleSidebar={toggleSidebar} />}
98
72
  </aside>
99
73
  );
100
74
  }
@@ -0,0 +1,15 @@
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
+ .docPage {
9
+ display: flex;
10
+ width: 100%;
11
+ }
12
+
13
+ .docsWrapper {
14
+ display: flex;
15
+ }
@@ -9,10 +9,10 @@ import React, {useState} from 'react';
9
9
  import Layout from '@theme/Layout';
10
10
  import BackToTopButton from '@theme/BackToTopButton';
11
11
  import type {Props} from '@theme/DocPage/Layout';
12
- import DocPageLayoutAside from '@theme/DocPage/Layout/Aside';
12
+ import DocPageLayoutSidebar from '@theme/DocPage/Layout/Sidebar';
13
13
  import DocPageLayoutMain from '@theme/DocPage/Layout/Main';
14
14
 
15
- import styles from './styles.module.css';
15
+ import styles from './index.module.css';
16
16
 
17
17
  import {useDocsSidebar} from '@docusaurus/theme-common';
18
18
 
@@ -24,7 +24,7 @@ export default function DocPageLayout({children}: Props): JSX.Element {
24
24
  <BackToTopButton />
25
25
  <div className={styles.docPage}>
26
26
  {sidebar && (
27
- <DocPageLayoutAside
27
+ <DocPageLayoutSidebar
28
28
  sidebar={sidebar.items}
29
29
  hiddenSidebarContainer={hiddenSidebarContainer}
30
30
  setHiddenSidebarContainer={setHiddenSidebarContainer}
@@ -6,12 +6,9 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
- import renderRoutes from '@docusaurus/renderRoutes';
10
- import type {PropSidebar} from '@docusaurus/plugin-content-docs';
11
9
  import NotFound from '@theme/NotFound';
12
10
  import type {Props} from '@theme/DocPage';
13
11
  import DocPageLayout from '@theme/DocPage/Layout';
14
- import {matchPath} from '@docusaurus/router';
15
12
 
16
13
  import clsx from 'clsx';
17
14
 
@@ -21,47 +18,13 @@ import {
21
18
  docVersionSearchTag,
22
19
  DocsSidebarProvider,
23
20
  DocsVersionProvider,
21
+ useDocRouteMetadata,
24
22
  } from '@docusaurus/theme-common';
25
23
  import SearchMetadata from '@theme/SearchMetadata';
26
24
 
27
- function extractDocRouteMetadata(props: Props): null | {
28
- docElement: JSX.Element;
29
- sidebarName: string | undefined;
30
- sidebarItems: PropSidebar | undefined;
31
- } {
32
- const {
33
- route: {routes: docRoutes},
34
- versionMetadata,
35
- location,
36
- } = props;
37
- const currentDocRoute = docRoutes!.find((docRoute) =>
38
- matchPath(location.pathname, docRoute),
39
- );
40
- if (!currentDocRoute) {
41
- return null;
42
- }
43
-
44
- // For now, the sidebarName is added as route config: not ideal!
45
- const sidebarName = currentDocRoute.sidebar;
46
-
47
- const sidebarItems = sidebarName
48
- ? versionMetadata.docsSidebars[sidebarName]
49
- : undefined;
50
-
51
- const docElement = renderRoutes(props.route.routes, {
52
- versionMetadata,
53
- });
54
-
55
- return {
56
- docElement,
57
- sidebarName,
58
- sidebarItems,
59
- };
60
- }
61
-
62
25
  export default function DocPage(props: Props): JSX.Element {
63
26
  const {versionMetadata} = props;
64
- const currentDocRouteMetadata = extractDocRouteMetadata(props);
27
+ const currentDocRouteMetadata = useDocRouteMetadata(props);
65
28
  if (!currentDocRouteMetadata) {
66
29
  return <NotFound />;
67
30
  }
@@ -13,9 +13,8 @@ export default function MDXDetails(props: Props): JSX.Element {
13
13
  const items = React.Children.toArray(props.children) as ReactElement[];
14
14
  // Split summary item from the rest to pass it as a separate prop to the
15
15
  // Details theme component
16
- const summary: ReactElement<ComponentProps<'summary'>> = items.find(
17
- (item) => item?.props?.mdxType === 'summary',
18
- )!;
16
+ const summary: ReactElement<ComponentProps<'summary'>> | undefined =
17
+ items.find((item) => item?.props?.mdxType === 'summary');
19
18
  const children = <>{items.filter((item) => item !== summary)}</>;
20
19
 
21
20
  return (
@@ -5,12 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
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
8
  .tocCollapsibleButton {
15
9
  font-size: inherit;
16
10
  display: flex;
@@ -30,21 +24,6 @@
30
24
  transition: transform var(--ifm-transition-fast);
31
25
  }
32
26
 
33
- .tocCollapsibleContent > ul {
34
- border-left: none;
35
- border-top: 1px solid var(--ifm-color-emphasis-300);
36
- padding: 0.2rem 0;
37
- font-size: 15px;
38
- }
39
-
40
- .tocCollapsibleContent ul li {
41
- margin: 0.4rem 0.8rem;
42
- }
43
-
44
- .tocCollapsibleContent a {
45
- display: block;
46
- }
47
-
48
- .tocCollapsibleExpanded .tocCollapsibleButton::after {
27
+ .tocCollapsibleButtonExpanded::after {
49
28
  transform: none;
50
29
  }
@@ -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 './styles.module.css';
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
- <button
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
+ /* eslint-disable jsx-a11y/control-has-associated-label */
13
+ function TOCItemTree({
14
+ toc,
15
+ className,
16
+ linkClassName,
17
+ isChild,
18
+ }: Props): JSX.Element | null {
19
+ if (!toc.length) {
20
+ return null;
21
+ }
22
+ return (
23
+ <ul className={isChild ? undefined : className}>
24
+ {toc.map((heading) => (
25
+ <li key={heading.id}>
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
- <TOCItemList
54
+ <TOCItemTree
94
55
  toc={tocTree}
95
56
  className={className}
96
57
  linkClassName={linkClassName}
@@ -268,7 +268,7 @@ declare module '@theme/DocPage/Layout' {
268
268
  export default function DocPageLayout(props: Props): JSX.Element;
269
269
  }
270
270
 
271
- declare module '@theme/DocPage/Layout/Aside' {
271
+ declare module '@theme/DocPage/Layout/Sidebar' {
272
272
  import type {Dispatch, SetStateAction} from 'react';
273
273
  import type {PropSidebar} from '@docusaurus/plugin-content-docs';
274
274
 
@@ -278,7 +278,17 @@ declare module '@theme/DocPage/Layout/Aside' {
278
278
  readonly setHiddenSidebarContainer: Dispatch<SetStateAction<boolean>>;
279
279
  }
280
280
 
281
- export default function DocPageLayoutAside(props: Props): JSX.Element;
281
+ export default function DocPageLayoutSidebar(props: Props): JSX.Element;
282
+ }
283
+
284
+ declare module '@theme/DocPage/Layout/Sidebar/ExpandButton' {
285
+ export interface Props {
286
+ toggleSidebar: () => void;
287
+ }
288
+
289
+ export default function DocPageLayoutSidebarExpandButton(
290
+ props: Props,
291
+ ): JSX.Element;
282
292
  }
283
293
 
284
294
  declare module '@theme/DocPage/Layout/Main' {
@@ -1061,6 +1071,19 @@ declare module '@theme/TOCItems' {
1061
1071
  export default function TOCItems(props: Props): JSX.Element;
1062
1072
  }
1063
1073
 
1074
+ declare module '@theme/TOCItems/Tree' {
1075
+ import type {TOCTreeNode} from '@docusaurus/theme-common';
1076
+
1077
+ export interface Props {
1078
+ readonly toc: readonly TOCTreeNode[];
1079
+ readonly className: string;
1080
+ readonly linkClassName: string | null;
1081
+ readonly isChild?: boolean;
1082
+ }
1083
+
1084
+ export default function TOCItems(props: Props): JSX.Element;
1085
+ }
1086
+
1064
1087
  declare module '@theme/TOC' {
1065
1088
  import type {TOCItem} from '@docusaurus/types';
1066
1089
 
@@ -1101,6 +1124,18 @@ declare module '@theme/TOCCollapsible' {
1101
1124
  export default function TOCCollapsible(props: Props): JSX.Element;
1102
1125
  }
1103
1126
 
1127
+ declare module '@theme/TOCCollapsible/CollapseButton' {
1128
+ import type {ComponentProps} from 'react';
1129
+
1130
+ export interface Props extends ComponentProps<'button'> {
1131
+ collapsed: boolean;
1132
+ }
1133
+
1134
+ export default function TOCCollapsibleCollapseButton(
1135
+ props: Props,
1136
+ ): JSX.Element;
1137
+ }
1138
+
1104
1139
  declare module '@theme/ColorModeToggle' {
1105
1140
  import type {ColorMode} from '@docusaurus/theme-common';
1106
1141