@docusaurus/theme-classic 3.7.0-canary-6221 → 3.7.0-canary-6223

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.
@@ -32,18 +32,18 @@ function useCategoryItemsPlural() {
32
32
  ),
33
33
  );
34
34
  }
35
- function CardContainer({href, children}) {
35
+ function CardContainer({className, href, children}) {
36
36
  return (
37
37
  <Link
38
38
  href={href}
39
- className={clsx('card padding--lg', styles.cardContainer)}>
39
+ className={clsx('card padding--lg', styles.cardContainer, className)}>
40
40
  {children}
41
41
  </Link>
42
42
  );
43
43
  }
44
- function CardLayout({href, icon, title, description}) {
44
+ function CardLayout({className, href, icon, title, description}) {
45
45
  return (
46
- <CardContainer href={href}>
46
+ <CardContainer href={href} className={className}>
47
47
  <Heading
48
48
  as="h2"
49
49
  className={clsx('text--truncate', styles.cardTitle)}
@@ -69,6 +69,7 @@ function CardCategory({item}) {
69
69
  }
70
70
  return (
71
71
  <CardLayout
72
+ className={item.className}
72
73
  href={href}
73
74
  icon="🗃️"
74
75
  title={item.label}
@@ -81,6 +82,7 @@ function CardLink({item}) {
81
82
  const doc = useDocById(item.docId ?? undefined);
82
83
  return (
83
84
  <CardLayout
85
+ className={item.className}
84
86
  href={item.href}
85
87
  icon={icon}
86
88
  title={item.label}
@@ -124,6 +124,10 @@ function DropdownNavbarItemMobile({
124
124
  'menu__link menu__link--sublist menu__link--sublist-caret',
125
125
  className,
126
126
  )}
127
+ // # hash permits to make the <a> tag focusable in case no link target
128
+ // See https://github.com/facebook/docusaurus/pull/6003
129
+ // There's probably a better solution though...
130
+ href={props.to ? undefined : '#'}
127
131
  {...props}
128
132
  onClick={(e) => {
129
133
  e.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "3.7.0-canary-6221",
3
+ "version": "3.7.0-canary-6223",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -20,19 +20,19 @@
20
20
  "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@docusaurus/core": "3.7.0-canary-6221",
24
- "@docusaurus/logger": "3.7.0-canary-6221",
25
- "@docusaurus/mdx-loader": "3.7.0-canary-6221",
26
- "@docusaurus/module-type-aliases": "3.7.0-canary-6221",
27
- "@docusaurus/plugin-content-blog": "3.7.0-canary-6221",
28
- "@docusaurus/plugin-content-docs": "3.7.0-canary-6221",
29
- "@docusaurus/plugin-content-pages": "3.7.0-canary-6221",
30
- "@docusaurus/theme-common": "3.7.0-canary-6221",
31
- "@docusaurus/theme-translations": "3.7.0-canary-6221",
32
- "@docusaurus/types": "3.7.0-canary-6221",
33
- "@docusaurus/utils": "3.7.0-canary-6221",
34
- "@docusaurus/utils-common": "3.7.0-canary-6221",
35
- "@docusaurus/utils-validation": "3.7.0-canary-6221",
23
+ "@docusaurus/core": "3.7.0-canary-6223",
24
+ "@docusaurus/logger": "3.7.0-canary-6223",
25
+ "@docusaurus/mdx-loader": "3.7.0-canary-6223",
26
+ "@docusaurus/module-type-aliases": "3.7.0-canary-6223",
27
+ "@docusaurus/plugin-content-blog": "3.7.0-canary-6223",
28
+ "@docusaurus/plugin-content-docs": "3.7.0-canary-6223",
29
+ "@docusaurus/plugin-content-pages": "3.7.0-canary-6223",
30
+ "@docusaurus/theme-common": "3.7.0-canary-6223",
31
+ "@docusaurus/theme-translations": "3.7.0-canary-6223",
32
+ "@docusaurus/types": "3.7.0-canary-6223",
33
+ "@docusaurus/utils": "3.7.0-canary-6223",
34
+ "@docusaurus/utils-common": "3.7.0-canary-6223",
35
+ "@docusaurus/utils-validation": "3.7.0-canary-6223",
36
36
  "@mdx-js/react": "^3.0.0",
37
37
  "clsx": "^2.0.0",
38
38
  "copy-text-to-clipboard": "^3.2.0",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=18.0"
64
64
  },
65
- "gitHead": "c11c15f8ff994eecafb0b5fad877b8a2283bbc64"
65
+ "gitHead": "aa1e344c591e9a480057e0c5d7815bae4d6d1dbd"
66
66
  }
@@ -43,34 +43,38 @@ function useCategoryItemsPlural() {
43
43
  }
44
44
 
45
45
  function CardContainer({
46
+ className,
46
47
  href,
47
48
  children,
48
49
  }: {
50
+ className?: string;
49
51
  href: string;
50
52
  children: ReactNode;
51
53
  }): ReactNode {
52
54
  return (
53
55
  <Link
54
56
  href={href}
55
- className={clsx('card padding--lg', styles.cardContainer)}>
57
+ className={clsx('card padding--lg', styles.cardContainer, className)}>
56
58
  {children}
57
59
  </Link>
58
60
  );
59
61
  }
60
62
 
61
63
  function CardLayout({
64
+ className,
62
65
  href,
63
66
  icon,
64
67
  title,
65
68
  description,
66
69
  }: {
70
+ className?: string;
67
71
  href: string;
68
72
  icon: ReactNode;
69
73
  title: string;
70
74
  description?: string;
71
75
  }): ReactNode {
72
76
  return (
73
- <CardContainer href={href}>
77
+ <CardContainer href={href} className={className}>
74
78
  <Heading
75
79
  as="h2"
76
80
  className={clsx('text--truncate', styles.cardTitle)}
@@ -99,6 +103,7 @@ function CardCategory({item}: {item: PropSidebarItemCategory}): ReactNode {
99
103
 
100
104
  return (
101
105
  <CardLayout
106
+ className={item.className}
102
107
  href={href}
103
108
  icon="🗃️"
104
109
  title={item.label}
@@ -112,6 +117,7 @@ function CardLink({item}: {item: PropSidebarItemLink}): ReactNode {
112
117
  const doc = useDocById(item.docId ?? undefined);
113
118
  return (
114
119
  <CardLayout
120
+ className={item.className}
115
121
  href={item.href}
116
122
  icon={icon}
117
123
  title={item.label}
@@ -151,6 +151,10 @@ function DropdownNavbarItemMobile({
151
151
  'menu__link menu__link--sublist menu__link--sublist-caret',
152
152
  className,
153
153
  )}
154
+ // # hash permits to make the <a> tag focusable in case no link target
155
+ // See https://github.com/facebook/docusaurus/pull/6003
156
+ // There's probably a better solution though...
157
+ href={props.to ? undefined : '#'}
154
158
  {...props}
155
159
  onClick={(e) => {
156
160
  e.preventDefault();