@docusaurus/theme-classic 0.0.0-5668 → 0.0.0-5670

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.
@@ -56,18 +56,28 @@ function useCategoryHrefWithSSRFallback(item) {
56
56
  return findFirstSidebarItemLink(item);
57
57
  }, [item, isBrowser]);
58
58
  }
59
- function CollapseButton({categoryLabel, onClick}) {
59
+ function CollapseButton({collapsed, categoryLabel, onClick}) {
60
60
  return (
61
61
  <button
62
- aria-label={translate(
63
- {
64
- id: 'theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel',
65
- message: "Toggle the collapsible sidebar category '{label}'",
66
- description:
67
- 'The ARIA label to toggle the collapsible sidebar category',
68
- },
69
- {label: categoryLabel},
70
- )}
62
+ aria-label={
63
+ collapsed
64
+ ? translate(
65
+ {
66
+ id: 'theme.DocSidebarItem.expandCategoryAriaLabel',
67
+ message: "Expand sidebar category '{label}'",
68
+ description: 'The ARIA label to expand the sidebar category',
69
+ },
70
+ {label: categoryLabel},
71
+ )
72
+ : translate(
73
+ {
74
+ id: 'theme.DocSidebarItem.collapseCategoryAriaLabel',
75
+ message: "Collapse sidebar category '{label}'",
76
+ description: 'The ARIA label to collapse the sidebar category',
77
+ },
78
+ {label: categoryLabel},
79
+ )
80
+ }
71
81
  type="button"
72
82
  className="clean-btn menu__caret"
73
83
  onClick={onClick}
@@ -162,6 +172,7 @@ export default function DocSidebarItemCategory({
162
172
  </Link>
163
173
  {href && collapsible && (
164
174
  <CollapseButton
175
+ collapsed={collapsed}
165
176
  categoryLabel={label}
166
177
  onClick={(e) => {
167
178
  e.preventDefault();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-5668",
3
+ "version": "0.0.0-5670",
4
4
  "description": "Classic theme for Docusaurus",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/theme-classic.d.ts",
@@ -20,18 +20,18 @@
20
20
  "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@docusaurus/core": "0.0.0-5668",
24
- "@docusaurus/mdx-loader": "0.0.0-5668",
25
- "@docusaurus/module-type-aliases": "0.0.0-5668",
26
- "@docusaurus/plugin-content-blog": "0.0.0-5668",
27
- "@docusaurus/plugin-content-docs": "0.0.0-5668",
28
- "@docusaurus/plugin-content-pages": "0.0.0-5668",
29
- "@docusaurus/theme-common": "0.0.0-5668",
30
- "@docusaurus/theme-translations": "0.0.0-5668",
31
- "@docusaurus/types": "0.0.0-5668",
32
- "@docusaurus/utils": "0.0.0-5668",
33
- "@docusaurus/utils-common": "0.0.0-5668",
34
- "@docusaurus/utils-validation": "0.0.0-5668",
23
+ "@docusaurus/core": "0.0.0-5670",
24
+ "@docusaurus/mdx-loader": "0.0.0-5670",
25
+ "@docusaurus/module-type-aliases": "0.0.0-5670",
26
+ "@docusaurus/plugin-content-blog": "0.0.0-5670",
27
+ "@docusaurus/plugin-content-docs": "0.0.0-5670",
28
+ "@docusaurus/plugin-content-pages": "0.0.0-5670",
29
+ "@docusaurus/theme-common": "0.0.0-5670",
30
+ "@docusaurus/theme-translations": "0.0.0-5670",
31
+ "@docusaurus/types": "0.0.0-5670",
32
+ "@docusaurus/utils": "0.0.0-5670",
33
+ "@docusaurus/utils-common": "0.0.0-5670",
34
+ "@docusaurus/utils-validation": "0.0.0-5670",
35
35
  "@mdx-js/react": "^2.1.5",
36
36
  "clsx": "^1.2.1",
37
37
  "copy-text-to-clipboard": "^3.2.0",
@@ -62,5 +62,5 @@
62
62
  "engines": {
63
63
  "node": ">=16.14"
64
64
  },
65
- "gitHead": "3748f001923c7d9a73f43cd32cfc03ceb68d9399"
65
+ "gitHead": "2449c29e71a3f9327e597fbb3902d1ef61416b27"
66
66
  }
@@ -72,23 +72,35 @@ function useCategoryHrefWithSSRFallback(
72
72
  }
73
73
 
74
74
  function CollapseButton({
75
+ collapsed,
75
76
  categoryLabel,
76
77
  onClick,
77
78
  }: {
79
+ collapsed: boolean;
78
80
  categoryLabel: string;
79
81
  onClick: ComponentProps<'button'>['onClick'];
80
82
  }) {
81
83
  return (
82
84
  <button
83
- aria-label={translate(
84
- {
85
- id: 'theme.DocSidebarItem.toggleCollapsedCategoryAriaLabel',
86
- message: "Toggle the collapsible sidebar category '{label}'",
87
- description:
88
- 'The ARIA label to toggle the collapsible sidebar category',
89
- },
90
- {label: categoryLabel},
91
- )}
85
+ aria-label={
86
+ collapsed
87
+ ? translate(
88
+ {
89
+ id: 'theme.DocSidebarItem.expandCategoryAriaLabel',
90
+ message: "Expand sidebar category '{label}'",
91
+ description: 'The ARIA label to expand the sidebar category',
92
+ },
93
+ {label: categoryLabel},
94
+ )
95
+ : translate(
96
+ {
97
+ id: 'theme.DocSidebarItem.collapseCategoryAriaLabel',
98
+ message: "Collapse sidebar category '{label}'",
99
+ description: 'The ARIA label to collapse the sidebar category',
100
+ },
101
+ {label: categoryLabel},
102
+ )
103
+ }
92
104
  type="button"
93
105
  className="clean-btn menu__caret"
94
106
  onClick={onClick}
@@ -188,6 +200,7 @@ export default function DocSidebarItemCategory({
188
200
  </Link>
189
201
  {href && collapsible && (
190
202
  <CollapseButton
203
+ collapsed={collapsed}
191
204
  categoryLabel={label}
192
205
  onClick={(e) => {
193
206
  e.preventDefault();