@docusaurus/theme-classic 0.0.0-4844 → 0.0.0-4848

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.
@@ -176,6 +176,7 @@ declare module '@theme/DocCardList' {
176
176
 
177
177
  export interface Props {
178
178
  readonly items: PropSidebarItem[];
179
+ readonly className?: string;
179
180
  }
180
181
 
181
182
  export default function DocCardList(props: Props): JSX.Element;
@@ -568,7 +569,9 @@ declare module '@theme/MDXComponents' {
568
569
  readonly h4: (props: ComponentProps<'h4'>) => JSX.Element;
569
570
  readonly h5: (props: ComponentProps<'h5'>) => JSX.Element;
570
571
  readonly h6: (props: ComponentProps<'h6'>) => JSX.Element;
571
- } & {[tagName: string]: ComponentType<unknown>};
572
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
573
+ [tagName: string]: ComponentType<any>;
574
+ };
572
575
 
573
576
  const MDXComponents: MDXComponentsObject;
574
577
  export default MDXComponents;
@@ -878,7 +881,7 @@ declare module '@theme/ThemedImage' {
878
881
  }
879
882
 
880
883
  declare module '@theme/Details' {
881
- import {Details, type DetailsProps} from '@docusaurus/theme-common';
884
+ import {Details, type DetailsProps} from '@docusaurus/theme-common/Details';
882
885
 
883
886
  export interface Props extends DetailsProps {}
884
887
  export default Details;
@@ -29,6 +29,7 @@
29
29
 
30
30
  .sidebarItemLink {
31
31
  color: var(--ifm-font-color-base);
32
+ display: block;
32
33
  }
33
34
 
34
35
  .sidebarItemLink:hover {
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import clsx from 'clsx';
9
- import {Details as DetailsGeneric} from '@docusaurus/theme-common';
9
+ import {Details as DetailsGeneric} from '@docusaurus/theme-common/Details';
10
10
  import styles from './styles.module.css'; // Should we have a custom details/summary comp in Infima instead of reusing
11
11
  // alert classes?
12
12
 
@@ -5,9 +5,11 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
+ import clsx from 'clsx';
8
9
  import DocCard from '@theme/DocCard';
9
- import {findFirstCategoryLink} from '@docusaurus/theme-common'; // Filter categories that don't have a link.
10
+ import {findFirstCategoryLink} from '@docusaurus/theme-common';
10
11
 
12
+ // Filter categories that don't have a link.
11
13
  function filterItems(items) {
12
14
  return items.filter((item) => {
13
15
  if (item.type === 'category') {
@@ -18,9 +20,9 @@ function filterItems(items) {
18
20
  });
19
21
  }
20
22
 
21
- export default function DocCardList({items}) {
23
+ export default function DocCardList({items, className}) {
22
24
  return (
23
- <div className="row">
25
+ <div className={clsx('row', className)}>
24
26
  {filterItems(items).map((item, index) => (
25
27
  <article key={index} className="col col--6 margin-bottom--lg">
26
28
  <DocCard key={index} item={item} />
@@ -52,7 +52,7 @@ function DocCategoryGeneratedIndexPageContent({categoryGeneratedIndex}) {
52
52
  )}
53
53
  </header>
54
54
  <main className="margin-top--lg">
55
- <DocCardList items={category.items} />
55
+ <DocCardList items={category.items} className={styles.list} />
56
56
  </main>
57
57
  <footer className="margin-top--lg">
58
58
  <DocPaginator
@@ -16,3 +16,7 @@
16
16
  --ifm-h1-font-size: 3rem;
17
17
  margin-bottom: calc(1.25 * var(--ifm-leading));
18
18
  }
19
+
20
+ .list article:nth-last-child(-n + 2) {
21
+ margin-bottom: 0 !important;
22
+ }
@@ -20,3 +20,9 @@
20
20
  display: none;
21
21
  }
22
22
  }
23
+
24
+ @media print {
25
+ .tocMobile {
26
+ display: none;
27
+ }
28
+ }
@@ -51,7 +51,7 @@ export default function LocaleDropdownNavbarItem({
51
51
  label={
52
52
  <span>
53
53
  <IconLanguage className={styles.iconLanguage} />
54
- <span>{dropdownLabel}</span>
54
+ {dropdownLabel}
55
55
  </span>
56
56
  }
57
57
  items={items}
@@ -5,13 +5,15 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
+ import clsx from 'clsx';
9
+ import styles from './styles.module.css';
8
10
  export default function TabItem({children, hidden, className}) {
9
11
  return (
10
12
  <div
11
13
  role="tabpanel"
14
+ className={clsx(styles.tabItem, className)}
12
15
  {...{
13
16
  hidden,
14
- className,
15
17
  }}>
16
18
  {children}
17
19
  </div>
@@ -0,0 +1,10 @@
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
+ .tabItem > *:last-child {
9
+ margin-bottom: 0;
10
+ }
@@ -132,7 +132,7 @@ function TabsComponent(props) {
132
132
  };
133
133
 
134
134
  return (
135
- <div className="tabs-container">
135
+ <div className={clsx('tabs-container', styles.tabList)}>
136
136
  <ul
137
137
  role="tablist"
138
138
  aria-orientation="horizontal"
@@ -173,11 +173,11 @@ function TabsComponent(props) {
173
173
  (tabItem) => tabItem.props.value === selectedValue,
174
174
  )[0],
175
175
  {
176
- className: 'margin-vert--md',
176
+ className: 'margin-top--md',
177
177
  },
178
178
  )
179
179
  ) : (
180
- <div className="margin-vert--md">
180
+ <div className="margin-top--md">
181
181
  {children.map((tabItem, i) =>
182
182
  cloneElement(tabItem, {
183
183
  key: i,
@@ -5,6 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ .tabList {
9
+ margin-bottom: var(--ifm-leading);
10
+ }
11
+
8
12
  .tabItem {
9
13
  margin-top: 0 !important;
10
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4844",
3
+ "version": "0.0.0-4848",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -21,15 +21,15 @@
21
21
  "format:lib-next": "prettier --config ../../.prettierrc --write \"lib-next/**/*.{js,ts,jsx,tsc}\""
22
22
  },
23
23
  "dependencies": {
24
- "@docusaurus/core": "0.0.0-4844",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4844",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4844",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4844",
28
- "@docusaurus/theme-common": "0.0.0-4844",
29
- "@docusaurus/theme-translations": "0.0.0-4844",
30
- "@docusaurus/utils": "0.0.0-4844",
31
- "@docusaurus/utils-common": "0.0.0-4844",
32
- "@docusaurus/utils-validation": "0.0.0-4844",
24
+ "@docusaurus/core": "0.0.0-4848",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4848",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4848",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4848",
28
+ "@docusaurus/theme-common": "0.0.0-4848",
29
+ "@docusaurus/theme-translations": "0.0.0-4848",
30
+ "@docusaurus/utils": "0.0.0-4848",
31
+ "@docusaurus/utils-common": "0.0.0-4848",
32
+ "@docusaurus/utils-validation": "0.0.0-4848",
33
33
  "@mdx-js/react": "^1.6.22",
34
34
  "clsx": "^1.1.1",
35
35
  "copy-text-to-clipboard": "^3.0.1",
@@ -42,8 +42,11 @@
42
42
  "rtlcss": "^3.5.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@docusaurus/module-type-aliases": "0.0.0-4844",
46
- "@docusaurus/types": "0.0.0-4844",
45
+ "@babel/cli": "^7.17.6",
46
+ "@babel/core": "^7.17.9",
47
+ "@babel/preset-typescript": "^7.16.7",
48
+ "@docusaurus/module-type-aliases": "0.0.0-4848",
49
+ "@docusaurus/types": "0.0.0-4848",
47
50
  "@types/mdx-js__react": "^1.5.5",
48
51
  "@types/prismjs": "^1.26.0",
49
52
  "@types/rtlcss": "^3.1.3",
@@ -59,5 +62,5 @@
59
62
  "engines": {
60
63
  "node": ">=14"
61
64
  },
62
- "gitHead": "e0f8d5729166419088bbfd857d12d063c7a53a1e"
65
+ "gitHead": "42eb5ce83a8718cf6d7ea6dae731898cfd86b99c"
63
66
  }
@@ -29,6 +29,7 @@
29
29
 
30
30
  .sidebarItemLink {
31
31
  color: var(--ifm-font-color-base);
32
+ display: block;
32
33
  }
33
34
 
34
35
  .sidebarItemLink:hover {
@@ -7,7 +7,7 @@
7
7
 
8
8
  import React from 'react';
9
9
  import clsx from 'clsx';
10
- import {Details as DetailsGeneric} from '@docusaurus/theme-common';
10
+ import {Details as DetailsGeneric} from '@docusaurus/theme-common/Details';
11
11
  import type {Props} from '@theme/Details';
12
12
  import styles from './styles.module.css';
13
13
 
@@ -6,10 +6,12 @@
6
6
  */
7
7
 
8
8
  import React from 'react';
9
+ import clsx from 'clsx';
9
10
 
10
11
  import DocCard from '@theme/DocCard';
11
12
  import type {PropSidebarItem} from '@docusaurus/plugin-content-docs';
12
13
  import {findFirstCategoryLink} from '@docusaurus/theme-common';
14
+ import type {Props} from '@theme/DocCardList';
13
15
 
14
16
  // Filter categories that don't have a link.
15
17
  function filterItems(items: PropSidebarItem[]): PropSidebarItem[] {
@@ -21,13 +23,9 @@ function filterItems(items: PropSidebarItem[]): PropSidebarItem[] {
21
23
  });
22
24
  }
23
25
 
24
- export default function DocCardList({
25
- items,
26
- }: {
27
- items: PropSidebarItem[];
28
- }): JSX.Element {
26
+ export default function DocCardList({items, className}: Props): JSX.Element {
29
27
  return (
30
- <div className="row">
28
+ <div className={clsx('row', className)}>
31
29
  {filterItems(items).map((item, index) => (
32
30
  <article key={index} className="col col--6 margin-bottom--lg">
33
31
  <DocCard key={index} item={item} />
@@ -61,7 +61,7 @@ function DocCategoryGeneratedIndexPageContent({
61
61
  )}
62
62
  </header>
63
63
  <main className="margin-top--lg">
64
- <DocCardList items={category.items} />
64
+ <DocCardList items={category.items} className={styles.list} />
65
65
  </main>
66
66
  <footer className="margin-top--lg">
67
67
  <DocPaginator
@@ -16,3 +16,7 @@
16
16
  --ifm-h1-font-size: 3rem;
17
17
  margin-bottom: calc(1.25 * var(--ifm-leading));
18
18
  }
19
+
20
+ .list article:nth-last-child(-n + 2) {
21
+ margin-bottom: 0 !important;
22
+ }
@@ -20,3 +20,9 @@
20
20
  display: none;
21
21
  }
22
22
  }
23
+
24
+ @media print {
25
+ .tocMobile {
26
+ display: none;
27
+ }
28
+ }
@@ -60,7 +60,7 @@ export default function LocaleDropdownNavbarItem({
60
60
  label={
61
61
  <span>
62
62
  <IconLanguage className={styles.iconLanguage} />
63
- <span>{dropdownLabel}</span>
63
+ {dropdownLabel}
64
64
  </span>
65
65
  }
66
66
  items={items}
@@ -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 role="tabpanel" {...{hidden, className}}>
20
+ <div
21
+ role="tabpanel"
22
+ className={clsx(styles.tabItem, className)}
23
+ {...{hidden}}>
18
24
  {children}
19
25
  </div>
20
26
  );
@@ -0,0 +1,10 @@
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
+ .tabItem > *:last-child {
9
+ margin-bottom: 0;
10
+ }
@@ -141,7 +141,7 @@ function TabsComponent(props: Props): JSX.Element {
141
141
  };
142
142
 
143
143
  return (
144
- <div className="tabs-container">
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-vert--md'},
184
+ {className: 'margin-top--md'},
185
185
  )
186
186
  ) : (
187
- <div className="margin-vert--md">
187
+ <div className="margin-top--md">
188
188
  {children.map((tabItem, i) =>
189
189
  cloneElement(tabItem, {
190
190
  key: i,
@@ -5,6 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
+ .tabList {
9
+ margin-bottom: var(--ifm-leading);
10
+ }
11
+
8
12
  .tabItem {
9
13
  margin-top: 0 !important;
10
14
  }
@@ -176,6 +176,7 @@ declare module '@theme/DocCardList' {
176
176
 
177
177
  export interface Props {
178
178
  readonly items: PropSidebarItem[];
179
+ readonly className?: string;
179
180
  }
180
181
 
181
182
  export default function DocCardList(props: Props): JSX.Element;
@@ -568,7 +569,9 @@ declare module '@theme/MDXComponents' {
568
569
  readonly h4: (props: ComponentProps<'h4'>) => JSX.Element;
569
570
  readonly h5: (props: ComponentProps<'h5'>) => JSX.Element;
570
571
  readonly h6: (props: ComponentProps<'h6'>) => JSX.Element;
571
- } & {[tagName: string]: ComponentType<unknown>};
572
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
573
+ [tagName: string]: ComponentType<any>;
574
+ };
572
575
 
573
576
  const MDXComponents: MDXComponentsObject;
574
577
  export default MDXComponents;
@@ -878,7 +881,7 @@ declare module '@theme/ThemedImage' {
878
881
  }
879
882
 
880
883
  declare module '@theme/Details' {
881
- import {Details, type DetailsProps} from '@docusaurus/theme-common';
884
+ import {Details, type DetailsProps} from '@docusaurus/theme-common/Details';
882
885
 
883
886
  export interface Props extends DetailsProps {}
884
887
  export default Details;