@docusaurus/theme-classic 0.0.0-4774 → 0.0.0-4777

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.
@@ -64,6 +64,9 @@ function DropdownNavbarItemDesktop({items, position, className, ...props}) {
64
64
  'dropdown--show': showDropdown,
65
65
  })}>
66
66
  <NavbarNavLink
67
+ aria-haspopup="true"
68
+ aria-expanded={showDropdown}
69
+ role="button"
67
70
  href={props.to ? undefined : '#'}
68
71
  className={clsx('navbar__link', className)}
69
72
  {...props}
@@ -87,7 +90,12 @@ function DropdownNavbarItemDesktop({items, position, className, ...props}) {
87
90
  const nextNavbarItem = dropdownRef.current.nextElementSibling;
88
91
 
89
92
  if (nextNavbarItem) {
90
- nextNavbarItem.focus();
93
+ const targetItem =
94
+ nextNavbarItem instanceof HTMLAnchorElement
95
+ ? nextNavbarItem // Next item is another dropdown; focus on the inner
96
+ : // anchor element instead so there's outline
97
+ nextNavbarItem.querySelector('a');
98
+ targetItem.focus();
91
99
  }
92
100
  }
93
101
  }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docusaurus/theme-classic",
3
- "version": "0.0.0-4774",
3
+ "version": "0.0.0-4777",
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-4774",
25
- "@docusaurus/plugin-content-blog": "0.0.0-4774",
26
- "@docusaurus/plugin-content-docs": "0.0.0-4774",
27
- "@docusaurus/plugin-content-pages": "0.0.0-4774",
28
- "@docusaurus/theme-common": "0.0.0-4774",
29
- "@docusaurus/theme-translations": "0.0.0-4774",
30
- "@docusaurus/utils": "0.0.0-4774",
31
- "@docusaurus/utils-common": "0.0.0-4774",
32
- "@docusaurus/utils-validation": "0.0.0-4774",
24
+ "@docusaurus/core": "0.0.0-4777",
25
+ "@docusaurus/plugin-content-blog": "0.0.0-4777",
26
+ "@docusaurus/plugin-content-docs": "0.0.0-4777",
27
+ "@docusaurus/plugin-content-pages": "0.0.0-4777",
28
+ "@docusaurus/theme-common": "0.0.0-4777",
29
+ "@docusaurus/theme-translations": "0.0.0-4777",
30
+ "@docusaurus/utils": "0.0.0-4777",
31
+ "@docusaurus/utils-common": "0.0.0-4777",
32
+ "@docusaurus/utils-validation": "0.0.0-4777",
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,8 @@
42
42
  "rtlcss": "^3.5.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@docusaurus/module-type-aliases": "0.0.0-4774",
46
- "@docusaurus/types": "0.0.0-4774",
45
+ "@docusaurus/module-type-aliases": "0.0.0-4777",
46
+ "@docusaurus/types": "0.0.0-4777",
47
47
  "@types/mdx-js__react": "^1.5.5",
48
48
  "@types/prismjs": "^1.26.0",
49
49
  "@types/rtlcss": "^3.1.2",
@@ -59,5 +59,5 @@
59
59
  "engines": {
60
60
  "node": ">=14"
61
61
  },
62
- "gitHead": "1ecf4ff2577c5bbe0afb608e01ae76590cb00af3"
62
+ "gitHead": "245a2a7fe952df111da8cccf7f3b8b8ec389d39e"
63
63
  }
@@ -85,6 +85,9 @@ function DropdownNavbarItemDesktop({
85
85
  'dropdown--show': showDropdown,
86
86
  })}>
87
87
  <NavbarNavLink
88
+ aria-haspopup="true"
89
+ aria-expanded={showDropdown}
90
+ role="button"
88
91
  href={props.to ? undefined : '#'}
89
92
  className={clsx('navbar__link', className)}
90
93
  {...props}
@@ -107,7 +110,13 @@ function DropdownNavbarItemDesktop({
107
110
  setShowDropdown(false);
108
111
  const nextNavbarItem = dropdownRef.current!.nextElementSibling;
109
112
  if (nextNavbarItem) {
110
- (nextNavbarItem as HTMLElement).focus();
113
+ const targetItem =
114
+ nextNavbarItem instanceof HTMLAnchorElement
115
+ ? nextNavbarItem
116
+ : // Next item is another dropdown; focus on the inner
117
+ // anchor element instead so there's outline
118
+ nextNavbarItem.querySelector('a');
119
+ (targetItem as HTMLElement).focus();
111
120
  }
112
121
  }
113
122
  }}