@carbon/react 1.83.0-rc.0 → 1.84.0-rc.0

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 (635) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +895 -790
  2. package/README.md +1 -1
  3. package/es/components/AILabel/index.js +37 -40
  4. package/es/components/AISkeleton/AISkeletonIcon.js +6 -7
  5. package/es/components/AISkeleton/AISkeletonPlaceholder.js +6 -7
  6. package/es/components/AISkeleton/AISkeletonText.js +6 -7
  7. package/es/components/Accordion/Accordion.Skeleton.js +24 -25
  8. package/es/components/Accordion/Accordion.js +13 -14
  9. package/es/components/Accordion/AccordionItem.js +22 -23
  10. package/es/components/Accordion/AccordionProvider.js +6 -7
  11. package/es/components/AspectRatio/AspectRatio.js +9 -10
  12. package/es/components/BadgeIndicator/index.js +7 -8
  13. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +9 -10
  14. package/es/components/Breadcrumb/Breadcrumb.js +3 -3
  15. package/es/components/Breadcrumb/BreadcrumbItem.js +9 -9
  16. package/es/components/Button/Button.Skeleton.js +10 -11
  17. package/es/components/Button/Button.js +5 -5
  18. package/es/components/Button/ButtonBase.js +27 -28
  19. package/es/components/ButtonSet/ButtonSet.js +2 -2
  20. package/es/components/ChatButton/ChatButton.Skeleton.js +7 -8
  21. package/es/components/ChatButton/ChatButton.js +13 -14
  22. package/es/components/Checkbox/Checkbox.Skeleton.js +8 -9
  23. package/es/components/Checkbox/Checkbox.js +33 -34
  24. package/es/components/CheckboxGroup/CheckboxGroup.js +28 -29
  25. package/es/components/ClassPrefix/index.js +6 -7
  26. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +12 -13
  27. package/es/components/CodeSnippet/CodeSnippet.js +41 -42
  28. package/es/components/ComboBox/ComboBox.js +42 -48
  29. package/es/components/ComboBox/tools/filter.js +9 -12
  30. package/es/components/ComboButton/index.js +22 -24
  31. package/es/components/ComposedModal/ComposedModal.js +49 -52
  32. package/es/components/ComposedModal/ModalFooter.js +42 -47
  33. package/es/components/ComposedModal/ModalHeader.js +21 -22
  34. package/es/components/ContainedList/ContainedList.js +17 -18
  35. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +16 -17
  36. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
  37. package/es/components/ContentSwitcher/ContentSwitcher.js +100 -126
  38. package/es/components/ContentSwitcher/index.d.ts +3 -4
  39. package/es/components/ContextMenu/useContextMenu.js +1 -2
  40. package/es/components/Copy/Copy.js +13 -14
  41. package/es/components/CopyButton/CopyButton.js +14 -15
  42. package/es/components/DangerButton/DangerButton.js +2 -2
  43. package/es/components/DataTable/DataTable.d.ts +81 -283
  44. package/es/components/DataTable/DataTable.js +124 -172
  45. package/es/components/DataTable/Table.d.ts +2 -2
  46. package/es/components/DataTable/Table.js +19 -22
  47. package/es/components/DataTable/TableActionList.d.ts +1 -1
  48. package/es/components/DataTable/TableBatchAction.js +9 -12
  49. package/es/components/DataTable/TableBatchActions.js +27 -29
  50. package/es/components/DataTable/TableBody.d.ts +3 -3
  51. package/es/components/DataTable/TableBody.js +9 -12
  52. package/es/components/DataTable/TableCell.d.ts +3 -4
  53. package/es/components/DataTable/TableCell.js +2 -2
  54. package/es/components/DataTable/TableContainer.d.ts +2 -3
  55. package/es/components/DataTable/TableContainer.js +15 -16
  56. package/es/components/DataTable/TableDecoratorRow.js +8 -9
  57. package/es/components/DataTable/TableExpandHeader.d.ts +2 -3
  58. package/es/components/DataTable/TableExpandHeader.js +18 -19
  59. package/es/components/DataTable/TableExpandRow.js +20 -21
  60. package/es/components/DataTable/TableExpandedRow.d.ts +3 -3
  61. package/es/components/DataTable/TableExpandedRow.js +10 -11
  62. package/es/components/DataTable/TableHead.d.ts +1 -1
  63. package/es/components/DataTable/TableHeader.d.ts +4 -4
  64. package/es/components/DataTable/TableHeader.js +29 -30
  65. package/es/components/DataTable/TableRow.d.ts +3 -4
  66. package/es/components/DataTable/TableRow.js +4 -4
  67. package/es/components/DataTable/TableSelectAll.js +14 -15
  68. package/es/components/DataTable/TableSelectRow.js +16 -17
  69. package/es/components/DataTable/TableSlugRow.js +7 -8
  70. package/es/components/DataTable/TableToolbar.js +9 -10
  71. package/es/components/DataTable/TableToolbarAction.js +2 -2
  72. package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
  73. package/es/components/DataTable/TableToolbarMenu.js +10 -11
  74. package/es/components/DataTable/TableToolbarSearch.js +24 -26
  75. package/es/components/DataTable/index.d.ts +1 -1
  76. package/es/components/DataTable/state/sorting.js +3 -4
  77. package/es/components/DataTable/tools/filter.js +10 -12
  78. package/es/components/DataTable/tools/normalize.js +6 -8
  79. package/es/components/DataTable/tools/sorting.js +24 -30
  80. package/es/components/DataTableSkeleton/DataTableSkeleton.js +26 -27
  81. package/es/components/DatePicker/DatePicker.Skeleton.js +15 -16
  82. package/es/components/DatePicker/DatePicker.js +104 -81
  83. package/es/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  84. package/es/components/DatePickerInput/DatePickerInput.js +24 -25
  85. package/es/components/Dialog/index.d.ts +194 -10
  86. package/es/components/Dialog/index.js +458 -39
  87. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  88. package/es/components/Dropdown/Dropdown.Skeleton.js +10 -11
  89. package/es/components/Dropdown/Dropdown.d.ts +3 -3
  90. package/es/components/Dropdown/Dropdown.js +57 -60
  91. package/es/components/ErrorBoundary/ErrorBoundary.js +4 -4
  92. package/es/components/ExpandableSearch/ExpandableSearch.js +11 -12
  93. package/es/components/FeatureFlags/index.js +13 -14
  94. package/es/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  95. package/es/components/FileUploader/FileUploader.Skeleton.js +9 -10
  96. package/es/components/FileUploader/FileUploader.d.ts +2 -3
  97. package/es/components/FileUploader/FileUploader.js +33 -35
  98. package/es/components/FileUploader/FileUploaderButton.d.ts +2 -3
  99. package/es/components/FileUploader/FileUploaderButton.js +20 -21
  100. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  101. package/es/components/FileUploader/FileUploaderDropContainer.js +20 -21
  102. package/es/components/FileUploader/FileUploaderItem.d.ts +2 -3
  103. package/es/components/FileUploader/FileUploaderItem.js +26 -27
  104. package/es/components/FileUploader/Filename.d.ts +3 -4
  105. package/es/components/FileUploader/Filename.js +16 -17
  106. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +9 -10
  107. package/es/components/FluidComboBox/FluidComboBox.js +8 -9
  108. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +16 -17
  109. package/es/components/FluidDatePicker/FluidDatePicker.js +13 -14
  110. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
  111. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +9 -10
  112. package/es/components/FluidDropdown/FluidDropdown.js +8 -9
  113. package/es/components/FluidForm/FluidForm.d.ts +3 -4
  114. package/es/components/FluidForm/FluidForm.js +8 -9
  115. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +9 -10
  116. package/es/components/FluidMultiSelect/FluidMultiSelect.js +10 -11
  117. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +9 -10
  118. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
  119. package/es/components/FluidNumberInput/FluidNumberInput.js +41 -8
  120. package/es/components/FluidSearch/FluidSearch.Skeleton.js +9 -10
  121. package/es/components/FluidSearch/FluidSearch.js +7 -8
  122. package/es/components/FluidSelect/FluidSelect.Skeleton.js +9 -10
  123. package/es/components/FluidSelect/FluidSelect.js +8 -9
  124. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +9 -10
  125. package/es/components/FluidTextArea/FluidTextArea.js +7 -8
  126. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +9 -10
  127. package/es/components/FluidTextInput/FluidTextInput.js +9 -10
  128. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +8 -9
  129. package/es/components/FluidTimePicker/FluidTimePicker.js +23 -24
  130. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +7 -8
  131. package/es/components/Form/Form.js +7 -8
  132. package/es/components/FormGroup/FormGroup.d.ts +3 -4
  133. package/es/components/FormGroup/FormGroup.js +15 -16
  134. package/es/components/FormItem/FormItem.js +7 -8
  135. package/es/components/FormLabel/FormLabel.js +8 -9
  136. package/es/components/Grid/CSSGrid.js +23 -25
  137. package/es/components/Grid/Column.js +32 -31
  138. package/es/components/Grid/ColumnHang.js +8 -9
  139. package/es/components/Grid/FlexGrid.js +12 -13
  140. package/es/components/Grid/Grid.js +3 -3
  141. package/es/components/Grid/GridContext.d.ts +2 -2
  142. package/es/components/Grid/GridContext.js +6 -7
  143. package/es/components/Grid/Row.js +10 -11
  144. package/es/components/Heading/index.js +13 -14
  145. package/es/components/Icon/Icon.Skeleton.js +6 -7
  146. package/es/components/IconButton/index.js +30 -26
  147. package/es/components/IconIndicator/index.js +10 -11
  148. package/es/components/IdPrefix/index.js +6 -7
  149. package/es/components/InlineCheckbox/InlineCheckbox.js +6 -6
  150. package/es/components/InlineLoading/InlineLoading.js +19 -20
  151. package/es/components/Layer/LayerContext.js +2 -2
  152. package/es/components/Layer/index.d.ts +4 -0
  153. package/es/components/Layer/index.js +21 -15
  154. package/es/components/Layout/index.js +24 -29
  155. package/es/components/LayoutDirection/LayoutDirection.js +10 -11
  156. package/es/components/LayoutDirection/LayoutDirectionContext.js +2 -2
  157. package/es/components/Link/Link.d.ts +1 -1
  158. package/es/components/Link/Link.js +19 -20
  159. package/es/components/ListBox/ListBox.d.ts +2 -3
  160. package/es/components/ListBox/ListBox.js +5 -5
  161. package/es/components/ListBox/ListBoxField.d.ts +3 -4
  162. package/es/components/ListBox/ListBoxField.js +8 -9
  163. package/es/components/ListBox/ListBoxMenu.d.ts +2 -3
  164. package/es/components/ListBox/ListBoxMenu.js +7 -8
  165. package/es/components/ListBox/ListBoxMenuIcon.js +8 -9
  166. package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  167. package/es/components/ListBox/ListBoxMenuItem.js +11 -13
  168. package/es/components/ListBox/ListBoxSelection.js +14 -15
  169. package/es/components/ListBox/next/ListBoxSelection.js +16 -17
  170. package/es/components/ListBox/next/ListBoxTrigger.js +8 -9
  171. package/es/components/ListItem/ListItem.js +7 -8
  172. package/es/components/Loading/Loading.d.ts +3 -3
  173. package/es/components/Loading/Loading.js +14 -15
  174. package/es/components/Menu/Menu.js +26 -27
  175. package/es/components/Menu/MenuItem.js +55 -60
  176. package/es/components/MenuButton/index.js +20 -22
  177. package/es/components/Modal/Modal.d.ts +2 -3
  178. package/es/components/Modal/Modal.js +85 -93
  179. package/es/components/ModalWrapper/ModalWrapper.js +9 -9
  180. package/es/components/MultiSelect/FilterableMultiSelect.js +68 -74
  181. package/es/components/MultiSelect/MultiSelect.js +65 -67
  182. package/es/components/MultiSelect/tools/sorting.js +11 -15
  183. package/es/components/Notification/Notification.js +137 -146
  184. package/es/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
  185. package/es/components/NumberInput/NumberFormatPropTypes.js +40 -0
  186. package/es/components/NumberInput/NumberInput.Skeleton.js +10 -11
  187. package/es/components/NumberInput/NumberInput.d.ts +39 -3
  188. package/es/components/NumberInput/NumberInput.js +195 -65
  189. package/es/components/OrderedList/OrderedList.js +9 -10
  190. package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  191. package/es/components/OverflowMenu/OverflowMenu.js +42 -48
  192. package/es/components/OverflowMenu/index.js +3 -3
  193. package/es/components/OverflowMenu/next/index.js +17 -18
  194. package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
  195. package/es/components/OverflowMenuV2/index.js +3 -3
  196. package/es/components/PageHeader/PageHeader.d.ts +29 -5
  197. package/es/components/PageHeader/PageHeader.js +136 -90
  198. package/es/components/Pagination/Pagination.Skeleton.js +12 -13
  199. package/es/components/Pagination/Pagination.js +40 -41
  200. package/es/components/Pagination/experimental/PageSelector.js +11 -12
  201. package/es/components/Pagination/experimental/Pagination.js +34 -35
  202. package/es/components/PaginationNav/PaginationNav.js +63 -68
  203. package/es/components/Popover/index.js +40 -42
  204. package/es/components/PrimaryButton/PrimaryButton.js +2 -2
  205. package/es/components/ProgressBar/ProgressBar.js +24 -25
  206. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +12 -13
  207. package/es/components/ProgressIndicator/ProgressIndicator.js +49 -52
  208. package/es/components/RadioButton/RadioButton.Skeleton.js +4 -4
  209. package/es/components/RadioButton/RadioButton.js +10 -10
  210. package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -16
  211. package/es/components/RadioTile/RadioTile.js +28 -29
  212. package/es/components/Search/Search.Skeleton.js +9 -10
  213. package/es/components/Search/Search.js +36 -38
  214. package/es/components/SecondaryButton/SecondaryButton.js +2 -2
  215. package/es/components/Select/Select.Skeleton.js +10 -11
  216. package/es/components/Select/Select.js +42 -43
  217. package/es/components/SelectItem/SelectItem.js +10 -11
  218. package/es/components/SelectItemGroup/SelectItemGroup.js +9 -10
  219. package/es/components/ShapeIndicator/index.js +13 -14
  220. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  221. package/es/components/SkeletonIcon/SkeletonIcon.js +7 -12
  222. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +6 -7
  223. package/es/components/SkeletonText/SkeletonText.js +12 -13
  224. package/es/components/Slider/Slider.Skeleton.js +25 -26
  225. package/es/components/Slider/Slider.js +99 -113
  226. package/es/components/Slider/SliderHandles.js +20 -20
  227. package/es/components/Stack/HStack.js +2 -2
  228. package/es/components/Stack/Stack.js +2 -2
  229. package/es/components/Stack/VStack.js +2 -2
  230. package/es/components/StructuredList/StructuredList.Skeleton.js +17 -18
  231. package/es/components/StructuredList/StructuredList.js +24 -24
  232. package/es/components/Switch/IconSwitch.js +3 -3
  233. package/es/components/Switch/Switch.js +4 -4
  234. package/es/components/TabContent/TabContent.js +2 -2
  235. package/es/components/Tabs/Tabs.Skeleton.js +12 -13
  236. package/es/components/Tabs/Tabs.js +141 -156
  237. package/es/components/Tabs/usePressable.js +7 -8
  238. package/es/components/Tag/DismissibleTag.js +26 -27
  239. package/es/components/Tag/OperationalTag.js +16 -17
  240. package/es/components/Tag/SelectableTag.js +19 -20
  241. package/es/components/Tag/Tag.Skeleton.js +7 -8
  242. package/es/components/Tag/Tag.js +33 -34
  243. package/es/components/Text/Text.js +9 -10
  244. package/es/components/Text/TextDirection.js +7 -8
  245. package/es/components/Text/createTextComponent.js +2 -2
  246. package/es/components/TextArea/TextArea.Skeleton.js +4 -4
  247. package/es/components/TextArea/TextArea.js +22 -22
  248. package/es/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  249. package/es/components/TextInput/ControlledPasswordInput.js +36 -37
  250. package/es/components/TextInput/PasswordInput.js +40 -41
  251. package/es/components/TextInput/TextInput.Skeleton.js +9 -10
  252. package/es/components/TextInput/TextInput.js +43 -44
  253. package/es/components/TextInput/util.js +14 -17
  254. package/es/components/Theme/index.js +19 -21
  255. package/es/components/Tile/Tile.js +98 -104
  256. package/es/components/TileGroup/TileGroup.d.ts +3 -4
  257. package/es/components/TileGroup/TileGroup.js +8 -8
  258. package/es/components/TimePicker/TimePicker.d.ts +2 -3
  259. package/es/components/TimePicker/TimePicker.js +14 -14
  260. package/es/components/TimePickerSelect/TimePickerSelect.js +4 -4
  261. package/es/components/Toggle/Toggle.Skeleton.js +8 -9
  262. package/es/components/Toggle/Toggle.js +27 -28
  263. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +14 -15
  264. package/es/components/Toggletip/index.js +43 -49
  265. package/es/components/Tooltip/DefinitionTooltip.js +17 -18
  266. package/es/components/Tooltip/Tooltip.d.ts +3 -0
  267. package/es/components/Tooltip/Tooltip.js +39 -28
  268. package/es/components/TreeView/TreeNode.js +64 -56
  269. package/es/components/TreeView/TreeView.js +44 -37
  270. package/es/components/UIShell/Content.js +8 -9
  271. package/es/components/UIShell/Header.js +7 -8
  272. package/es/components/UIShell/HeaderContainer.js +7 -8
  273. package/es/components/UIShell/HeaderGlobalAction.js +14 -15
  274. package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  275. package/es/components/UIShell/HeaderMenu.d.ts +10 -112
  276. package/es/components/UIShell/HeaderMenu.js +154 -201
  277. package/es/components/UIShell/HeaderMenuButton.js +14 -15
  278. package/es/components/UIShell/HeaderMenuItem.js +21 -20
  279. package/es/components/UIShell/HeaderName.js +9 -10
  280. package/es/components/UIShell/HeaderNavigation.js +10 -11
  281. package/es/components/UIShell/HeaderPanel.js +11 -12
  282. package/es/components/UIShell/HeaderSideNavItems.js +7 -8
  283. package/es/components/UIShell/Link.js +11 -12
  284. package/es/components/UIShell/SideNav.js +30 -32
  285. package/es/components/UIShell/SideNavDetails.js +9 -10
  286. package/es/components/UIShell/SideNavDivider.js +6 -7
  287. package/es/components/UIShell/SideNavFooter.js +13 -14
  288. package/es/components/UIShell/SideNavHeader.js +8 -9
  289. package/es/components/UIShell/SideNavIcon.js +7 -8
  290. package/es/components/UIShell/SideNavItem.js +7 -8
  291. package/es/components/UIShell/SideNavItems.js +10 -11
  292. package/es/components/UIShell/SideNavLink.js +15 -16
  293. package/es/components/UIShell/SideNavLinkText.js +7 -8
  294. package/es/components/UIShell/SideNavMenu.js +20 -21
  295. package/es/components/UIShell/SideNavMenuItem.js +5 -5
  296. package/es/components/UIShell/SideNavSwitcher.js +8 -8
  297. package/es/components/UIShell/SkipToContent.js +9 -10
  298. package/es/components/UIShell/Switcher.js +12 -13
  299. package/es/components/UIShell/SwitcherDivider.js +6 -7
  300. package/es/components/UIShell/SwitcherItem.js +3 -3
  301. package/es/components/UnorderedList/UnorderedList.js +8 -9
  302. package/es/index.js +25 -26
  303. package/es/internal/FloatingMenu.js +30 -32
  304. package/es/internal/Selection.js +15 -17
  305. package/{lib/feature-flags.d.ts → es/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
  306. package/es/internal/createClassWrapper.js +2 -2
  307. package/es/internal/getAnnouncement.d.ts +8 -0
  308. package/es/internal/getAnnouncement.js +22 -0
  309. package/es/internal/keyboard/match.js +6 -7
  310. package/es/internal/useControllableState.d.ts +1 -1
  311. package/es/internal/useControllableState.js +8 -9
  312. package/es/internal/useDelayedState.js +1 -2
  313. package/es/internal/useDocumentLang.d.ts +12 -0
  314. package/es/internal/useId.js +4 -6
  315. package/es/internal/useIdPrefix.js +3 -3
  316. package/es/internal/useMatchMedia.js +1 -2
  317. package/es/internal/useMergedRefs.d.ts +1 -1
  318. package/es/internal/useNoInteractiveChildren.js +2 -4
  319. package/es/internal/useNormalizedInputProps.js +12 -13
  320. package/es/internal/usePrefix.js +3 -3
  321. package/es/internal/useResizeObserver.d.ts +14 -0
  322. package/es/internal/useResizeObserver.js +73 -0
  323. package/es/internal/useSavedCallback.js +1 -3
  324. package/es/internal/wrapFocus.js +23 -35
  325. package/es/prop-types/deprecate.js +1 -4
  326. package/es/prop-types/deprecateValuesWithin.js +1 -4
  327. package/es/prop-types/isRequiredOneOf.js +1 -4
  328. package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  329. package/es/tools/events.js +1 -4
  330. package/es/tools/mergeRefs.js +9 -14
  331. package/es/tools/uniqueId.js +1 -2
  332. package/es/tools/wrapComponent.d.ts +3 -4
  333. package/es/tools/wrapComponent.js +11 -13
  334. package/es/types/common.d.ts +0 -2
  335. package/lib/components/AILabel/index.js +27 -30
  336. package/lib/components/AISkeleton/AISkeletonIcon.js +4 -5
  337. package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
  338. package/lib/components/AISkeleton/AISkeletonText.js +4 -5
  339. package/lib/components/Accordion/Accordion.Skeleton.js +9 -10
  340. package/lib/components/Accordion/Accordion.js +10 -11
  341. package/lib/components/Accordion/AccordionItem.js +13 -14
  342. package/lib/components/Accordion/AccordionProvider.js +4 -5
  343. package/lib/components/AspectRatio/AspectRatio.js +7 -8
  344. package/lib/components/BadgeIndicator/index.js +5 -6
  345. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
  346. package/lib/components/Button/Button.Skeleton.js +7 -8
  347. package/lib/components/Button/ButtonBase.js +23 -24
  348. package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -6
  349. package/lib/components/ChatButton/ChatButton.js +11 -12
  350. package/lib/components/Checkbox/Checkbox.Skeleton.js +4 -5
  351. package/lib/components/Checkbox/Checkbox.js +19 -20
  352. package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -17
  353. package/lib/components/ClassPrefix/index.js +4 -5
  354. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
  355. package/lib/components/CodeSnippet/CodeSnippet.js +27 -29
  356. package/lib/components/ComboBox/ComboBox.js +24 -30
  357. package/lib/components/ComboBox/tools/filter.js +9 -12
  358. package/lib/components/ComboButton/index.js +16 -18
  359. package/lib/components/ComposedModal/ComposedModal.js +31 -34
  360. package/lib/components/ComposedModal/ModalFooter.js +37 -42
  361. package/lib/components/ComposedModal/ModalHeader.js +14 -15
  362. package/lib/components/ContainedList/ContainedList.js +10 -11
  363. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
  364. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
  365. package/lib/components/ContentSwitcher/ContentSwitcher.js +98 -124
  366. package/lib/components/ContentSwitcher/index.d.ts +3 -4
  367. package/lib/components/ContextMenu/useContextMenu.js +1 -2
  368. package/lib/components/Copy/Copy.js +11 -12
  369. package/lib/components/CopyButton/CopyButton.js +10 -11
  370. package/lib/components/DataTable/DataTable.d.ts +81 -283
  371. package/lib/components/DataTable/DataTable.js +123 -172
  372. package/lib/components/DataTable/Table.d.ts +2 -2
  373. package/lib/components/DataTable/Table.js +15 -18
  374. package/lib/components/DataTable/TableActionList.d.ts +1 -1
  375. package/lib/components/DataTable/TableBatchAction.js +8 -11
  376. package/lib/components/DataTable/TableBatchActions.js +18 -20
  377. package/lib/components/DataTable/TableBody.d.ts +3 -3
  378. package/lib/components/DataTable/TableBody.js +8 -11
  379. package/lib/components/DataTable/TableCell.d.ts +3 -4
  380. package/lib/components/DataTable/TableContainer.d.ts +2 -3
  381. package/lib/components/DataTable/TableContainer.js +9 -10
  382. package/lib/components/DataTable/TableDecoratorRow.js +4 -5
  383. package/lib/components/DataTable/TableExpandHeader.d.ts +2 -3
  384. package/lib/components/DataTable/TableExpandHeader.js +14 -15
  385. package/lib/components/DataTable/TableExpandRow.js +13 -14
  386. package/lib/components/DataTable/TableExpandedRow.d.ts +3 -3
  387. package/lib/components/DataTable/TableExpandedRow.js +6 -7
  388. package/lib/components/DataTable/TableHead.d.ts +1 -1
  389. package/lib/components/DataTable/TableHeader.d.ts +4 -4
  390. package/lib/components/DataTable/TableHeader.js +15 -16
  391. package/lib/components/DataTable/TableRow.d.ts +3 -4
  392. package/lib/components/DataTable/TableSelectAll.js +11 -12
  393. package/lib/components/DataTable/TableSelectRow.js +12 -13
  394. package/lib/components/DataTable/TableSlugRow.js +4 -5
  395. package/lib/components/DataTable/TableToolbar.js +7 -8
  396. package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
  397. package/lib/components/DataTable/TableToolbarMenu.js +8 -9
  398. package/lib/components/DataTable/TableToolbarSearch.js +22 -24
  399. package/lib/components/DataTable/index.d.ts +1 -1
  400. package/lib/components/DataTable/state/sorting.js +3 -4
  401. package/lib/components/DataTable/tools/filter.js +10 -12
  402. package/lib/components/DataTable/tools/normalize.js +6 -8
  403. package/lib/components/DataTable/tools/sorting.js +24 -30
  404. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
  405. package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -8
  406. package/lib/components/DatePicker/DatePicker.js +87 -64
  407. package/lib/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  408. package/lib/components/DatePickerInput/DatePickerInput.js +5 -6
  409. package/lib/components/Dialog/index.d.ts +194 -10
  410. package/lib/components/Dialog/index.js +457 -33
  411. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  412. package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
  413. package/lib/components/Dropdown/Dropdown.d.ts +3 -3
  414. package/lib/components/Dropdown/Dropdown.js +40 -43
  415. package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -2
  416. package/lib/components/ExpandableSearch/ExpandableSearch.js +9 -10
  417. package/lib/components/FeatureFlags/index.js +11 -12
  418. package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  419. package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -5
  420. package/lib/components/FileUploader/FileUploader.d.ts +2 -3
  421. package/lib/components/FileUploader/FileUploader.js +22 -24
  422. package/lib/components/FileUploader/FileUploaderButton.d.ts +2 -3
  423. package/lib/components/FileUploader/FileUploaderButton.js +16 -17
  424. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  425. package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
  426. package/lib/components/FileUploader/FileUploaderItem.d.ts +2 -3
  427. package/lib/components/FileUploader/FileUploaderItem.js +13 -14
  428. package/lib/components/FileUploader/Filename.d.ts +3 -4
  429. package/lib/components/FileUploader/Filename.js +9 -10
  430. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
  431. package/lib/components/FluidComboBox/FluidComboBox.js +5 -6
  432. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
  433. package/lib/components/FluidDatePicker/FluidDatePicker.js +10 -11
  434. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
  435. package/lib/components/FluidDropdown/FluidDropdown.js +5 -6
  436. package/lib/components/FluidForm/FluidForm.d.ts +3 -4
  437. package/lib/components/FluidForm/FluidForm.js +5 -6
  438. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
  439. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
  440. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
  441. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
  442. package/lib/components/FluidNumberInput/FluidNumberInput.js +38 -5
  443. package/lib/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
  444. package/lib/components/FluidSearch/FluidSearch.js +4 -5
  445. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
  446. package/lib/components/FluidSelect/FluidSelect.js +5 -6
  447. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
  448. package/lib/components/FluidTextArea/FluidTextArea.js +4 -5
  449. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
  450. package/lib/components/FluidTextInput/FluidTextInput.js +5 -6
  451. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
  452. package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -12
  453. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
  454. package/lib/components/Form/Form.js +5 -6
  455. package/lib/components/FormGroup/FormGroup.d.ts +3 -4
  456. package/lib/components/FormGroup/FormGroup.js +11 -12
  457. package/lib/components/FormItem/FormItem.js +5 -6
  458. package/lib/components/FormLabel/FormLabel.js +6 -7
  459. package/lib/components/Grid/CSSGrid.js +17 -19
  460. package/lib/components/Grid/Column.js +28 -27
  461. package/lib/components/Grid/ColumnHang.js +6 -7
  462. package/lib/components/Grid/FlexGrid.js +9 -10
  463. package/lib/components/Grid/GridContext.d.ts +2 -2
  464. package/lib/components/Grid/GridContext.js +10 -29
  465. package/lib/components/Grid/Row.js +8 -9
  466. package/lib/components/Heading/index.js +5 -6
  467. package/lib/components/Icon/Icon.Skeleton.js +4 -5
  468. package/lib/components/IconButton/index.js +26 -22
  469. package/lib/components/IconIndicator/index.js +7 -8
  470. package/lib/components/IdPrefix/index.js +4 -5
  471. package/lib/components/InlineLoading/InlineLoading.js +9 -10
  472. package/lib/components/Layer/index.d.ts +4 -0
  473. package/lib/components/Layer/index.js +16 -10
  474. package/lib/components/Layout/index.js +21 -26
  475. package/lib/components/LayoutDirection/LayoutDirection.js +6 -7
  476. package/lib/components/Link/Link.d.ts +1 -1
  477. package/lib/components/Link/Link.js +15 -16
  478. package/lib/components/ListBox/ListBox.d.ts +2 -3
  479. package/lib/components/ListBox/ListBoxField.d.ts +3 -4
  480. package/lib/components/ListBox/ListBoxField.js +6 -7
  481. package/lib/components/ListBox/ListBoxMenu.d.ts +2 -3
  482. package/lib/components/ListBox/ListBoxMenu.js +5 -6
  483. package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
  484. package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  485. package/lib/components/ListBox/ListBoxMenuItem.js +8 -10
  486. package/lib/components/ListBox/ListBoxSelection.js +8 -9
  487. package/lib/components/ListBox/next/ListBoxSelection.js +9 -10
  488. package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
  489. package/lib/components/ListItem/ListItem.js +5 -6
  490. package/lib/components/Loading/Loading.d.ts +3 -3
  491. package/lib/components/Loading/Loading.js +8 -9
  492. package/lib/components/Menu/Menu.js +23 -24
  493. package/lib/components/Menu/MenuItem.js +39 -44
  494. package/lib/components/MenuButton/index.js +16 -18
  495. package/lib/components/Modal/Modal.d.ts +2 -3
  496. package/lib/components/Modal/Modal.js +55 -63
  497. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  498. package/lib/components/MultiSelect/FilterableMultiSelect.js +46 -52
  499. package/lib/components/MultiSelect/MultiSelect.js +43 -45
  500. package/lib/components/MultiSelect/tools/sorting.js +11 -15
  501. package/lib/components/Notification/Notification.js +96 -105
  502. package/lib/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
  503. package/lib/components/NumberInput/NumberFormatPropTypes.js +48 -0
  504. package/lib/components/NumberInput/NumberInput.Skeleton.js +6 -7
  505. package/lib/components/NumberInput/NumberInput.d.ts +39 -3
  506. package/lib/components/NumberInput/NumberInput.js +173 -43
  507. package/lib/components/OrderedList/OrderedList.js +7 -8
  508. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  509. package/lib/components/OverflowMenu/OverflowMenu.js +35 -41
  510. package/lib/components/OverflowMenu/next/index.js +12 -13
  511. package/lib/components/PageHeader/PageHeader.d.ts +29 -5
  512. package/lib/components/PageHeader/PageHeader.js +119 -73
  513. package/lib/components/Pagination/Pagination.Skeleton.js +4 -5
  514. package/lib/components/Pagination/Pagination.js +24 -25
  515. package/lib/components/Pagination/experimental/PageSelector.js +8 -9
  516. package/lib/components/Pagination/experimental/Pagination.js +20 -21
  517. package/lib/components/PaginationNav/PaginationNav.js +33 -38
  518. package/lib/components/Popover/index.js +26 -28
  519. package/lib/components/ProgressBar/ProgressBar.js +11 -12
  520. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
  521. package/lib/components/ProgressIndicator/ProgressIndicator.js +29 -32
  522. package/lib/components/RadioTile/RadioTile.js +17 -18
  523. package/lib/components/Search/Search.Skeleton.js +5 -6
  524. package/lib/components/Search/Search.js +26 -28
  525. package/lib/components/Select/Select.Skeleton.js +5 -6
  526. package/lib/components/Select/Select.js +24 -25
  527. package/lib/components/SelectItem/SelectItem.js +8 -9
  528. package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -8
  529. package/lib/components/ShapeIndicator/index.js +7 -8
  530. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  531. package/lib/components/SkeletonIcon/SkeletonIcon.js +5 -10
  532. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
  533. package/lib/components/SkeletonText/SkeletonText.js +8 -9
  534. package/lib/components/Slider/Slider.Skeleton.js +8 -9
  535. package/lib/components/Slider/Slider.js +69 -83
  536. package/lib/components/Slider/SliderHandles.js +6 -6
  537. package/lib/components/StructuredList/StructuredList.Skeleton.js +5 -6
  538. package/lib/components/Tabs/Tabs.Skeleton.js +5 -6
  539. package/lib/components/Tabs/Tabs.js +83 -98
  540. package/lib/components/Tabs/usePressable.js +7 -8
  541. package/lib/components/Tag/DismissibleTag.js +16 -17
  542. package/lib/components/Tag/OperationalTag.js +10 -11
  543. package/lib/components/Tag/SelectableTag.js +13 -14
  544. package/lib/components/Tag/Tag.Skeleton.js +5 -6
  545. package/lib/components/Tag/Tag.js +19 -20
  546. package/lib/components/Text/Text.js +6 -7
  547. package/lib/components/Text/TextDirection.js +5 -6
  548. package/lib/components/TextArea/TextArea.js +3 -3
  549. package/lib/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  550. package/lib/components/TextInput/ControlledPasswordInput.js +24 -25
  551. package/lib/components/TextInput/PasswordInput.js +26 -27
  552. package/lib/components/TextInput/TextInput.Skeleton.js +5 -6
  553. package/lib/components/TextInput/TextInput.js +27 -28
  554. package/lib/components/TextInput/util.js +14 -17
  555. package/lib/components/Theme/index.js +10 -12
  556. package/lib/components/Tile/Tile.js +68 -74
  557. package/lib/components/TileGroup/TileGroup.d.ts +3 -4
  558. package/lib/components/TimePicker/TimePicker.d.ts +2 -3
  559. package/lib/components/Toggle/Toggle.Skeleton.js +4 -5
  560. package/lib/components/Toggle/Toggle.js +17 -18
  561. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
  562. package/lib/components/Toggletip/index.js +33 -39
  563. package/lib/components/Tooltip/DefinitionTooltip.js +13 -14
  564. package/lib/components/Tooltip/Tooltip.d.ts +3 -0
  565. package/lib/components/Tooltip/Tooltip.js +33 -22
  566. package/lib/components/TreeView/TreeNode.js +40 -32
  567. package/lib/components/TreeView/TreeView.js +41 -34
  568. package/lib/components/UIShell/Content.js +6 -7
  569. package/lib/components/UIShell/Header.js +5 -6
  570. package/lib/components/UIShell/HeaderContainer.js +5 -6
  571. package/lib/components/UIShell/HeaderGlobalAction.js +12 -13
  572. package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  573. package/lib/components/UIShell/HeaderMenu.d.ts +10 -112
  574. package/lib/components/UIShell/HeaderMenu.js +152 -199
  575. package/lib/components/UIShell/HeaderMenuButton.js +10 -11
  576. package/lib/components/UIShell/HeaderMenuItem.js +17 -16
  577. package/lib/components/UIShell/HeaderName.js +6 -7
  578. package/lib/components/UIShell/HeaderNavigation.js +7 -8
  579. package/lib/components/UIShell/HeaderPanel.js +9 -10
  580. package/lib/components/UIShell/HeaderSideNavItems.js +5 -6
  581. package/lib/components/UIShell/Link.js +8 -9
  582. package/lib/components/UIShell/SideNav.js +23 -25
  583. package/lib/components/UIShell/SideNavDetails.js +6 -7
  584. package/lib/components/UIShell/SideNavDivider.js +3 -4
  585. package/lib/components/UIShell/SideNavFooter.js +6 -7
  586. package/lib/components/UIShell/SideNavHeader.js +5 -6
  587. package/lib/components/UIShell/SideNavIcon.js +5 -6
  588. package/lib/components/UIShell/SideNavItem.js +5 -6
  589. package/lib/components/UIShell/SideNavItems.js +5 -6
  590. package/lib/components/UIShell/SideNavLink.js +10 -11
  591. package/lib/components/UIShell/SideNavLinkText.js +5 -6
  592. package/lib/components/UIShell/SideNavMenu.js +11 -12
  593. package/lib/components/UIShell/SkipToContent.js +7 -8
  594. package/lib/components/UIShell/Switcher.js +4 -5
  595. package/lib/components/UIShell/SwitcherDivider.js +4 -5
  596. package/lib/components/UnorderedList/UnorderedList.js +6 -7
  597. package/lib/index.js +81 -82
  598. package/lib/internal/FloatingMenu.js +26 -28
  599. package/lib/internal/Selection.js +15 -17
  600. package/{es/feature-flags.d.ts → lib/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
  601. package/lib/internal/getAnnouncement.d.ts +8 -0
  602. package/lib/internal/getAnnouncement.js +26 -0
  603. package/lib/internal/keyboard/match.js +6 -7
  604. package/lib/internal/useControllableState.d.ts +1 -1
  605. package/lib/internal/useControllableState.js +8 -9
  606. package/lib/internal/useDelayedState.js +1 -2
  607. package/lib/internal/useDocumentLang.d.ts +12 -0
  608. package/lib/internal/useId.js +2 -4
  609. package/lib/internal/useMatchMedia.js +1 -2
  610. package/lib/internal/useMergedRefs.d.ts +1 -1
  611. package/lib/internal/useNoInteractiveChildren.js +2 -4
  612. package/lib/internal/useNormalizedInputProps.js +9 -10
  613. package/lib/internal/useResizeObserver.d.ts +14 -0
  614. package/lib/internal/useResizeObserver.js +77 -0
  615. package/lib/internal/useSavedCallback.js +1 -3
  616. package/lib/internal/wrapFocus.js +23 -35
  617. package/lib/prop-types/deprecate.js +1 -4
  618. package/lib/prop-types/deprecateValuesWithin.js +1 -4
  619. package/lib/prop-types/isRequiredOneOf.js +1 -4
  620. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  621. package/lib/tools/events.js +1 -4
  622. package/lib/tools/mergeRefs.js +9 -14
  623. package/lib/tools/uniqueId.js +1 -2
  624. package/lib/tools/wrapComponent.d.ts +3 -4
  625. package/lib/tools/wrapComponent.js +9 -11
  626. package/lib/types/common.d.ts +0 -2
  627. package/package.json +21 -20
  628. package/scss/components/content-switcher/_tokens.scss +9 -0
  629. package/telemetry.yml +27 -2
  630. package/es/components/ContentSwitcher/index.js +0 -13
  631. package/es/components/DataTable/index.js +0 -76
  632. package/es/internal/useAnnouncer.js +0 -21
  633. package/lib/components/ContentSwitcher/index.js +0 -18
  634. package/lib/components/DataTable/index.js +0 -82
  635. package/lib/internal/useAnnouncer.js +0 -25
@@ -5,10 +5,10 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { defineProperty as _defineProperty, extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
8
+ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import { ChevronDown } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
- import React__default from 'react';
11
+ import React, { useContext, useState, useRef, Children, forwardRef, isValidElement, cloneElement } from 'react';
12
12
  import PropTypes from 'prop-types';
13
13
  import { Enter, Space, Escape } from '../../internal/keyboard/keys.js';
14
14
  import { matches } from '../../internal/keyboard/match.js';
@@ -16,205 +16,165 @@ import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
16
16
  import { PrefixContext } from '../../internal/usePrefix.js';
17
17
  import deprecate from '../../prop-types/deprecate.js';
18
18
  import { composeEventHandlers } from '../../tools/events.js';
19
+ import { useMergedRefs } from '../../internal/useMergedRefs.js';
19
20
 
20
- /**
21
- * `HeaderMenu` is used to render submenu's in the `Header`. Most often children
22
- * will be a `HeaderMenuItem`. It handles certain keyboard events to help
23
- * with managing focus. It also passes along refs to each child so that it can
24
- * help manage focus state of its children.
25
- */
21
+ const frFn = forwardRef;
22
+ const HeaderMenu = frFn((props, ref) => {
23
+ const {
24
+ isActive,
25
+ isCurrentPage,
26
+ 'aria-label': ariaLabel,
27
+ 'aria-labelledby': ariaLabelledBy,
28
+ className: customClassName,
29
+ children,
30
+ renderMenuContent: MenuContent,
31
+ menuLinkName,
32
+ focusRef,
33
+ onBlur,
34
+ onClick,
35
+ onKeyDown,
36
+ ...rest
37
+ } = props;
38
+ const prefix = useContext(PrefixContext);
39
+ const [expanded, setExpanded] = useState(false);
40
+ const menuButtonRef = useRef(null);
41
+ const subMenusRef = useRef(null);
42
+ const itemRefs = useRef([]);
43
+ const mergedButtonRef = useMergedRefs([ref, focusRef, menuButtonRef]);
26
44
 
27
- class HeaderMenu extends React__default.Component {
28
- constructor(props) {
29
- super(props);
30
- _defineProperty(this, "_subMenus", /*#__PURE__*/React__default.createRef());
31
- _defineProperty(this, "items", []);
32
- _defineProperty(this, "menuButtonRef", null);
33
- /**
34
- * Toggle the expanded state of the menu on click.
35
- */
36
- _defineProperty(this, "handleOnClick", e => {
37
- const {
38
- current: subMenusNode
39
- } = this._subMenus;
40
- if (!subMenusNode || !subMenusNode.contains(e.target)) {
41
- e.preventDefault();
42
- }
43
- this.setState(prevState => ({
44
- expanded: !prevState.expanded
45
- }));
46
- });
47
- /**
48
- * Keyboard event handler for the entire menu.
49
- */
50
- _defineProperty(this, "handleOnKeyDown", event => {
51
- // Handle enter or space key for toggling the expanded state of the menu.
52
- if (matches(event, [Enter, Space])) {
53
- event.stopPropagation();
54
- event.preventDefault();
55
- this.setState(prevState => ({
56
- expanded: !prevState.expanded
57
- }));
58
- return;
59
- }
60
- });
61
- /**
62
- * Handle our blur event from our underlying menuitems. Will mostly be used
63
- * for closing our menu in response to a user clicking off or tabbing out of
64
- * the menu or menubar.
65
- */
66
- _defineProperty(this, "handleOnBlur", event => {
67
- // Close the menu on blur when the related target is not a sibling menu item
68
- // or a child in a submenu
69
- const siblingItemBlurredTo = this.items.find(element => element === event.relatedTarget);
70
- const childItemBlurredTo = this._subMenus.current?.contains(event.relatedTarget);
71
- if (!siblingItemBlurredTo && !childItemBlurredTo) {
72
- this.setState({
73
- expanded: false,
74
- selectedIndex: null
75
- });
76
- }
77
- });
78
- /**
79
- * ref handler for our menu button. If we are supplied a `focusRef` prop, we also
80
- * forward along the node.
81
- *
82
- * This is useful when this component is a child in a
83
- * menu or menubar as it will allow the parent to explicitly focus the menu
84
- * button node when that child should receive focus.
85
- */
86
- _defineProperty(this, "handleMenuButtonRef", node => {
87
- const {
88
- focusRef
89
- } = this.props;
90
- // Check if focusRef is a function before calling it
91
- if (typeof focusRef === 'function') {
92
- focusRef(node);
93
- }
94
- this.menuButtonRef = node;
95
- });
96
- /**
97
- * Handles individual menuitem refs. We assign them to a class instance
98
- * property so that we can properly manage focus of our children.
99
- */
100
- _defineProperty(this, "handleItemRef", index => node => {
101
- this.items[index] = node;
102
- });
103
- _defineProperty(this, "handleMenuClose", event => {
104
- // Handle ESC keydown for closing the expanded menu.
105
- if (matches(event, [Escape]) && this.state.expanded) {
106
- event.stopPropagation();
107
- event.preventDefault();
108
- this.setState(() => ({
109
- expanded: false,
110
- selectedIndex: null
111
- }));
45
+ /**
46
+ * Toggle the expanded state of the menu on click.
47
+ */
48
+ const handleOnClick = e => {
49
+ if (!subMenusRef.current || e.target instanceof Node && !subMenusRef.current.contains(e.target)) {
50
+ e.preventDefault();
51
+ }
52
+ setExpanded(prev => !prev);
53
+ };
112
54
 
113
- // Return focus to menu button when the user hits ESC.
114
- if (this.menuButtonRef !== null) {
115
- this.menuButtonRef.focus();
116
- }
117
- return;
118
- }
119
- });
120
- /**
121
- * We capture the `ref` for each child inside of `this.items` to properly
122
- * manage focus. In addition to this focus management, all items receive a
123
- * `tabIndex: -1` so the user won't hit a large number of items in their tab
124
- * sequence when they might not want to go through all the items.
125
- */
126
- _defineProperty(this, "_renderMenuItem", (item, index) => {
127
- if (/*#__PURE__*/React__default.isValidElement(item)) {
128
- return /*#__PURE__*/React__default.cloneElement(item, {
129
- ref: this.handleItemRef(index)
130
- });
55
+ /**
56
+ * Keyboard event handler for the entire menu.
57
+ */
58
+ const handleOnKeyDown = event => {
59
+ // Handle enter or space key for toggling the expanded state of the menu.
60
+ if (matches(event, [Enter, Space])) {
61
+ event.stopPropagation();
62
+ event.preventDefault();
63
+ setExpanded(prev => !prev);
64
+ return;
65
+ }
66
+ };
67
+
68
+ /**
69
+ * Handle our blur event from our underlying menuitems. Will mostly be used
70
+ * for closing our menu in response to a user clicking off or tabbing out of
71
+ * the menu or menubar.
72
+ */
73
+ const handleOnBlur = event => {
74
+ // Close the menu on blur when the related target is not a sibling menu item
75
+ // or a child in a submenu
76
+ const siblingItemBlurredTo = itemRefs.current.find(element => element === event.relatedTarget);
77
+ const childItemBlurredTo = subMenusRef.current?.contains(event.relatedTarget);
78
+ if (!siblingItemBlurredTo && !childItemBlurredTo) {
79
+ setExpanded(false);
80
+ }
81
+ };
82
+
83
+ /**
84
+ * Handles individual menuitem refs. We assign them to a class instance
85
+ * property so that we can properly manage focus of our children.
86
+ */
87
+ const handleItemRef = index => node => {
88
+ itemRefs.current[index] = node;
89
+ };
90
+ const handleMenuClose = event => {
91
+ // Handle ESC keydown for closing the expanded menu.
92
+ if (matches(event, [Escape]) && expanded) {
93
+ event.stopPropagation();
94
+ event.preventDefault();
95
+ setExpanded(false);
96
+
97
+ // Return focus to menu button when the user hits ESC.
98
+ if (menuButtonRef.current) {
99
+ menuButtonRef.current.focus();
131
100
  }
132
- });
133
- this.state = {
134
- // Used to manage the expansion state of the menu
135
- expanded: false,
136
- // Refers to the menuitem that is currently focused
137
- // Note: children should have `role="menuitem"` on node consuming ref
138
- selectedIndex: null
139
- };
140
- this.items = [];
141
- }
142
- render() {
143
- const prefix = this.context;
101
+ }
102
+ };
103
+ const hasActiveDescendant = childrenArg => Children.toArray(childrenArg).some(child => {
104
+ if (! /*#__PURE__*/isValidElement(child)) {
105
+ return false;
106
+ }
144
107
  const {
145
108
  isActive,
146
109
  isCurrentPage,
147
- 'aria-label': ariaLabel,
148
- 'aria-labelledby': ariaLabelledBy,
149
- className: customClassName,
150
- children,
151
- renderMenuContent: MenuContent,
152
- menuLinkName,
153
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
154
- focusRef,
155
- onBlur,
156
- onClick,
157
- onKeyDown,
158
- ...rest
159
- } = this.props;
160
- const hasActiveDescendant = childrenArg => React__default.Children.toArray(childrenArg).some(child => {
161
- if (! /*#__PURE__*/React__default.isValidElement(child)) {
162
- return false;
163
- }
110
+ children
111
+ } = child.props;
112
+ return isActive || isCurrentPage || Array.isArray(children) && hasActiveDescendant(children);
113
+ });
164
114
 
165
- // Explicitly type the element to access props safely
166
- const element = child;
167
- return element.props.isActive || element.props.isCurrentPage || Array.isArray(element.props.children) && hasActiveDescendant(element.props.children);
168
- });
169
- const accessibilityLabel = {
170
- 'aria-label': ariaLabel,
171
- 'aria-labelledby': ariaLabelledBy
172
- };
173
- const itemClassName = cx({
174
- [`${prefix}--header__submenu`]: true,
175
- [`${customClassName}`]: !!customClassName
176
- });
177
- const isActivePage = isActive ? isActive : isCurrentPage;
178
- const linkClassName = cx({
179
- [`${prefix}--header__menu-item`]: true,
180
- [`${prefix}--header__menu-title`]: true,
181
- // We set the current class only if `isActive` is passed in and we do
182
- // not have an `aria-current="page"` set for the breadcrumb item
183
- [`${prefix}--header__menu-item--current`]: isActivePage || hasActiveDescendant(children) && !this.state.expanded
184
- });
115
+ /**
116
+ * We capture the `ref` for each child inside of `this.items` to properly
117
+ * manage focus. In addition to this focus management, all items receive a
118
+ * `tabIndex: -1` so the user won't hit a large number of items in their tab
119
+ * sequence when they might not want to go through all the items.
120
+ */
121
+ const renderMenuItem = (item, index) => {
122
+ if (/*#__PURE__*/isValidElement(item)) {
123
+ return /*#__PURE__*/cloneElement(item, {
124
+ ref: handleItemRef(index)
125
+ });
126
+ }
127
+ return item;
128
+ };
129
+ const accessibilityLabel = {
130
+ 'aria-label': ariaLabel,
131
+ 'aria-labelledby': ariaLabelledBy
132
+ };
133
+ const itemClassName = cx({
134
+ [`${prefix}--header__submenu`]: true,
135
+ [`${customClassName}`]: !!customClassName
136
+ });
137
+ const isActivePage = isActive ? isActive : isCurrentPage;
138
+ const linkClassName = cx({
139
+ [`${prefix}--header__menu-item`]: true,
140
+ [`${prefix}--header__menu-title`]: true,
141
+ // We set the current class only if `isActive` is passed in and we do
142
+ // not have an `aria-current="page"` set for the breadcrumb item
143
+ [`${prefix}--header__menu-item--current`]: isActivePage || hasActiveDescendant(children) && !expanded
144
+ });
185
145
 
186
- // Notes on eslint comments and based on the examples in:
187
- // https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html#
188
- // - The focus is handled by the <a> menuitem, onMouseOver is for mouse
189
- // users
190
- // - aria-haspopup can definitely have the value "menu"
191
- // - aria-expanded is on their example node with role="menuitem"
192
- // - href can be set to javascript:void(0), ideally this will be a button
193
- return /*#__PURE__*/React__default.createElement("li", _extends({}, rest, {
194
- className: itemClassName,
195
- onKeyDown: composeEventHandlers([onKeyDown, this.handleMenuClose]),
196
- onClick: composeEventHandlers([onClick, this.handleOnClick]),
197
- onBlur: composeEventHandlers([onBlur, this.handleOnBlur])
198
- }), /*#__PURE__*/React__default.createElement("a", _extends({
199
- // eslint-disable-line jsx-a11y/role-supports-aria-props,jsx-a11y/anchor-is-valid
200
- "aria-haspopup": "menu" // eslint-disable-line jsx-a11y/aria-proptypes
201
- ,
202
- "aria-expanded": this.state.expanded,
203
- className: linkClassName,
204
- href: "#",
205
- onKeyDown: this.handleOnKeyDown,
206
- ref: this.handleMenuButtonRef,
207
- tabIndex: 0
208
- }, accessibilityLabel), menuLinkName, MenuContent ? /*#__PURE__*/React__default.createElement(MenuContent, null) : /*#__PURE__*/React__default.createElement(ChevronDown, {
209
- className: `${this.context}--header__menu-arrow`
210
- })), /*#__PURE__*/React__default.createElement("ul", _extends({}, accessibilityLabel, {
211
- ref: this._subMenus,
212
- onClick: this.handleOnClick,
213
- className: `${prefix}--header__menu`
214
- }), React__default.Children.map(children, this._renderMenuItem)));
215
- }
216
- }
217
- _defineProperty(HeaderMenu, "propTypes", {
146
+ // Notes on eslint comments and based on the examples in:
147
+ // https://www.w3.org/TR/wai-aria-practices/examples/menubar/menubar-1/menubar-1.html#
148
+ // - The focus is handled by the <a> menuitem, onMouseOver is for mouse
149
+ // users
150
+ // - aria-haspopup can definitely have the value "menu"
151
+ // - aria-expanded is on their example node with role="menuitem"
152
+ // - href can be set to javascript:void(0), ideally this will be a button
153
+ return /*#__PURE__*/React.createElement("li", _extends({}, rest, {
154
+ className: itemClassName,
155
+ onKeyDown: composeEventHandlers([onKeyDown, handleMenuClose]),
156
+ onClick: composeEventHandlers([onClick, handleOnClick]),
157
+ onBlur: composeEventHandlers([onBlur, handleOnBlur]),
158
+ ref: ref
159
+ }), /*#__PURE__*/React.createElement("a", _extends({
160
+ // eslint-disable-line jsx-a11y/role-supports-aria-props,jsx-a11y/anchor-is-valid
161
+ "aria-haspopup": "menu" // eslint-disable-line jsx-a11y/aria-proptypes
162
+ ,
163
+ "aria-expanded": expanded,
164
+ className: linkClassName,
165
+ href: "#",
166
+ onKeyDown: handleOnKeyDown,
167
+ ref: mergedButtonRef,
168
+ tabIndex: 0
169
+ }, accessibilityLabel), menuLinkName, MenuContent ? /*#__PURE__*/React.createElement(MenuContent, null) : /*#__PURE__*/React.createElement(ChevronDown, {
170
+ className: `${prefix}--header__menu-arrow`
171
+ })), /*#__PURE__*/React.createElement("ul", _extends({}, accessibilityLabel, {
172
+ ref: subMenusRef,
173
+ className: `${prefix}--header__menu`
174
+ }), Children.map(children, renderMenuItem)));
175
+ });
176
+ HeaderMenu.displayName = 'HeaderMenu';
177
+ HeaderMenu.propTypes = {
218
178
  /**
219
179
  * Required props for the accessibility label of the menu
220
180
  */
@@ -263,13 +223,6 @@ _defineProperty(HeaderMenu, "propTypes", {
263
223
  * Optionally provide a tabIndex for the underlying menu button
264
224
  */
265
225
  tabIndex: PropTypes.number
266
- });
267
- _defineProperty(HeaderMenu, "contextType", PrefixContext);
268
- const HeaderMenuForwardRef = /*#__PURE__*/React__default.forwardRef((props, ref) => {
269
- return /*#__PURE__*/React__default.createElement(HeaderMenu, _extends({}, props, {
270
- focusRef: ref
271
- }));
272
- });
273
- HeaderMenuForwardRef.displayName = 'HeaderMenu';
226
+ };
274
227
 
275
- export { HeaderMenu, HeaderMenuForwardRef as default };
228
+ export { HeaderMenu, HeaderMenu as default };
@@ -8,23 +8,22 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import { Menu, Close } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
- import React__default from 'react';
11
+ import React from 'react';
12
12
  import PropTypes from 'prop-types';
13
13
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
14
14
  import { usePrefix } from '../../internal/usePrefix.js';
15
15
 
16
16
  var _Menu, _Close;
17
- function HeaderMenuButton(_ref) {
18
- let {
19
- 'aria-label': ariaLabel,
20
- 'aria-labelledby': ariaLabelledBy,
21
- className: customClassName,
22
- renderMenuIcon,
23
- renderCloseIcon,
24
- isActive,
25
- isCollapsible,
26
- ...rest
27
- } = _ref;
17
+ function HeaderMenuButton({
18
+ 'aria-label': ariaLabel,
19
+ 'aria-labelledby': ariaLabelledBy,
20
+ className: customClassName,
21
+ renderMenuIcon,
22
+ renderCloseIcon,
23
+ isActive,
24
+ isCollapsible,
25
+ ...rest
26
+ }) {
28
27
  const prefix = usePrefix();
29
28
  const className = cx({
30
29
  ...(typeof customClassName === 'string' && {
@@ -36,13 +35,13 @@ function HeaderMenuButton(_ref) {
36
35
  [`${prefix}--header__menu-toggle`]: true,
37
36
  [`${prefix}--header__menu-toggle__hidden`]: !isCollapsible
38
37
  });
39
- const menuIcon = renderMenuIcon ? renderMenuIcon : _Menu || (_Menu = /*#__PURE__*/React__default.createElement(Menu, {
38
+ const menuIcon = renderMenuIcon ? renderMenuIcon : _Menu || (_Menu = /*#__PURE__*/React.createElement(Menu, {
40
39
  size: 20
41
40
  }));
42
- const closeIcon = renderCloseIcon ? renderCloseIcon : _Close || (_Close = /*#__PURE__*/React__default.createElement(Close, {
41
+ const closeIcon = renderCloseIcon ? renderCloseIcon : _Close || (_Close = /*#__PURE__*/React.createElement(Close, {
43
42
  size: 20
44
43
  }));
45
- return /*#__PURE__*/React__default.createElement("button", _extends({}, rest, {
44
+ return /*#__PURE__*/React.createElement("button", _extends({}, rest, {
46
45
  "aria-label": ariaLabel,
47
46
  "aria-labelledby": ariaLabelledBy,
48
47
  className: className,
@@ -7,42 +7,43 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React__default, { forwardRef } from 'react';
10
+ import React, { forwardRef } from 'react';
11
11
  import cx from 'classnames';
12
12
  import Link, { LinkPropTypes } from './Link.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
14
  import deprecate from '../../prop-types/deprecate.js';
15
15
 
16
- const HeaderMenuItem = /*#__PURE__*/forwardRef(function HeaderMenuItem(_ref, ref) {
17
- let {
18
- className,
19
- isActive,
20
- isCurrentPage,
21
- 'aria-current': ariaCurrent,
22
- children,
23
- role,
24
- tabIndex,
25
- ...rest
26
- } = _ref;
16
+ const HeaderMenuItem = /*#__PURE__*/forwardRef(function HeaderMenuItem({
17
+ className,
18
+ isActive,
19
+ isCurrentPage,
20
+ 'aria-current': ariaCurrent,
21
+ children,
22
+ role,
23
+ tabIndex,
24
+ ...rest
25
+ }, ref) {
27
26
  const prefix = usePrefix();
28
27
  if (isCurrentPage) {
29
28
  isActive = isCurrentPage;
30
29
  }
30
+ // We set the current class only if `isActive` is passed in and we do
31
+ // not have an `aria-current="page"` set for the breadcrumb item. When this
32
+ // class is added we also set `aria-current` as `true`
33
+ const hasCurrentClass = isActive && ariaCurrent !== 'page';
31
34
  const linkClassName = cx({
32
35
  [`${prefix}--header__menu-item`]: true,
33
- // We set the current class only if `isActive` is passed in and we do
34
- // not have an `aria-current="page"` set for the breadcrumb item
35
- [`${prefix}--header__menu-item--current`]: isActive && ariaCurrent !== 'page'
36
+ [`${prefix}--header__menu-item--current`]: hasCurrentClass
36
37
  });
37
- return /*#__PURE__*/React__default.createElement("li", {
38
+ return /*#__PURE__*/React.createElement("li", {
38
39
  className: className,
39
40
  role: role
40
- }, /*#__PURE__*/React__default.createElement(Link, _extends({}, rest, {
41
- "aria-current": ariaCurrent,
41
+ }, /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
42
+ "aria-current": hasCurrentClass ? true : ariaCurrent,
42
43
  className: linkClassName,
43
44
  ref: ref,
44
45
  tabIndex: tabIndex
45
- }), /*#__PURE__*/React__default.createElement("span", {
46
+ }), /*#__PURE__*/React.createElement("span", {
46
47
  className: `${prefix}--text-truncate--end`
47
48
  }, children)));
48
49
  });
@@ -63,7 +64,7 @@ HeaderMenuItem.propTypes = {
63
64
  */
64
65
  className: PropTypes.string,
65
66
  /**
66
- * Applies selected styles to the item if a user sets this to true and `aria-current !== 'page'`.
67
+ * If `true` and `aria-current !== 'page'`, applies selected styles to the item and sets `aria-current="true"`.
67
68
  */
68
69
  isActive: PropTypes.bool,
69
70
  /**
@@ -7,23 +7,22 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
- import React__default from 'react';
10
+ import React from 'react';
11
11
  import PropTypes from 'prop-types';
12
12
  import Link, { LinkPropTypes } from './Link.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
14
 
15
- function HeaderName(_ref) {
16
- let {
17
- children,
18
- className: customClassName,
19
- prefix = 'IBM',
20
- ...rest
21
- } = _ref;
15
+ function HeaderName({
16
+ children,
17
+ className: customClassName,
18
+ prefix = 'IBM',
19
+ ...rest
20
+ }) {
22
21
  const selectorPrefix = usePrefix();
23
22
  const className = cx(`${selectorPrefix}--header__name`, customClassName);
24
- return /*#__PURE__*/React__default.createElement(Link, _extends({}, rest, {
23
+ return /*#__PURE__*/React.createElement(Link, _extends({}, rest, {
25
24
  className: className
26
- }), prefix && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", {
25
+ }), prefix && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
27
26
  className: `${selectorPrefix}--header__name--prefix`
28
27
  }, prefix), "\xA0"), children);
29
28
  }
@@ -7,26 +7,25 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
- import React__default from 'react';
10
+ import React from 'react';
11
11
  import PropTypes from 'prop-types';
12
12
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
14
 
15
- function HeaderNavigation(_ref) {
16
- let {
17
- 'aria-label': ariaLabel,
18
- 'aria-labelledby': ariaLabelledBy,
19
- children,
20
- className: customClassName,
21
- ...rest
22
- } = _ref;
15
+ function HeaderNavigation({
16
+ 'aria-label': ariaLabel,
17
+ 'aria-labelledby': ariaLabelledBy,
18
+ children,
19
+ className: customClassName,
20
+ ...rest
21
+ }) {
23
22
  const prefix = usePrefix();
24
23
  const className = cx(`${prefix}--header__nav`, customClassName);
25
- return /*#__PURE__*/React__default.createElement("nav", _extends({}, rest, {
24
+ return /*#__PURE__*/React.createElement("nav", _extends({}, rest, {
26
25
  "aria-label": ariaLabel,
27
26
  "aria-labelledby": ariaLabelledBy,
28
27
  className: className
29
- }), /*#__PURE__*/React__default.createElement("ul", {
28
+ }), /*#__PURE__*/React.createElement("ul", {
30
29
  className: `${prefix}--header__menu-bar`
31
30
  }, children));
32
31
  }
@@ -8,7 +8,7 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
- import React__default, { useRef, useState } from 'react';
11
+ import React, { useRef, useState } from 'react';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
  import { Escape } from '../../internal/keyboard/keys.js';
14
14
  import { match } from '../../internal/keyboard/match.js';
@@ -16,16 +16,15 @@ import { useWindowEvent } from '../../internal/useEvent.js';
16
16
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
17
17
 
18
18
  const noopFn = () => {};
19
- const HeaderPanel = /*#__PURE__*/React__default.forwardRef(function HeaderPanel(_ref, ref) {
20
- let {
21
- children,
22
- className: customClassName,
23
- expanded,
24
- addFocusListeners = true,
25
- onHeaderPanelFocus = noopFn,
26
- href,
27
- ...rest
28
- } = _ref;
19
+ const HeaderPanel = /*#__PURE__*/React.forwardRef(function HeaderPanel({
20
+ children,
21
+ className: customClassName,
22
+ expanded,
23
+ addFocusListeners = true,
24
+ onHeaderPanelFocus = noopFn,
25
+ href,
26
+ ...rest
27
+ }, ref) {
29
28
  const prefix = usePrefix();
30
29
  const headerPanelReference = useRef(null);
31
30
  const headerPanelRef = useMergedRefs([headerPanelReference, ref]);
@@ -67,7 +66,7 @@ const HeaderPanel = /*#__PURE__*/React__default.forwardRef(function HeaderPanel(
67
66
  onHeaderPanelFocus();
68
67
  }
69
68
  });
70
- return /*#__PURE__*/React__default.createElement("div", _extends({}, rest, {
69
+ return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
71
70
  className: className,
72
71
  ref: headerPanelRef
73
72
  }, eventHandlers), children);
@@ -6,22 +6,21 @@
6
6
  */
7
7
 
8
8
  import cx from 'classnames';
9
- import React__default from 'react';
9
+ import React from 'react';
10
10
  import PropTypes from 'prop-types';
11
11
  import { usePrefix } from '../../internal/usePrefix.js';
12
12
 
13
- function HeaderSideNavItems(_ref) {
14
- let {
15
- className: customClassName,
16
- children,
17
- hasDivider = false
18
- } = _ref;
13
+ function HeaderSideNavItems({
14
+ className: customClassName,
15
+ children,
16
+ hasDivider = false
17
+ }) {
19
18
  const prefix = usePrefix();
20
19
  const className = cx({
21
20
  [`${prefix}--side-nav__header-navigation`]: true,
22
21
  [`${prefix}--side-nav__header-divider`]: hasDivider
23
22
  }, customClassName);
24
- return /*#__PURE__*/React__default.createElement("ul", {
23
+ return /*#__PURE__*/React.createElement("ul", {
25
24
  className: className
26
25
  }, children);
27
26
  }