@carbon/react 1.83.0-rc.0 → 1.83.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 (361) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1008 -938
  2. package/es/components/AILabel/index.js +13 -13
  3. package/es/components/AISkeleton/AISkeletonIcon.js +2 -2
  4. package/es/components/AISkeleton/AISkeletonPlaceholder.js +2 -2
  5. package/es/components/AISkeleton/AISkeletonText.js +2 -2
  6. package/es/components/Accordion/Accordion.Skeleton.js +15 -15
  7. package/es/components/Accordion/Accordion.js +3 -3
  8. package/es/components/Accordion/AccordionItem.js +9 -9
  9. package/es/components/Accordion/AccordionProvider.js +2 -2
  10. package/es/components/AspectRatio/AspectRatio.js +2 -2
  11. package/es/components/BadgeIndicator/index.js +3 -3
  12. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +5 -5
  13. package/es/components/Breadcrumb/Breadcrumb.js +3 -3
  14. package/es/components/Breadcrumb/BreadcrumbItem.js +9 -9
  15. package/es/components/Button/Button.Skeleton.js +3 -3
  16. package/es/components/Button/Button.js +5 -5
  17. package/es/components/Button/ButtonBase.js +5 -5
  18. package/es/components/ButtonSet/ButtonSet.js +2 -2
  19. package/es/components/ChatButton/ChatButton.Skeleton.js +2 -2
  20. package/es/components/ChatButton/ChatButton.js +3 -3
  21. package/es/components/Checkbox/Checkbox.Skeleton.js +4 -4
  22. package/es/components/Checkbox/Checkbox.js +15 -15
  23. package/es/components/CheckboxGroup/CheckboxGroup.js +12 -12
  24. package/es/components/ClassPrefix/index.js +2 -2
  25. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +7 -7
  26. package/es/components/CodeSnippet/CodeSnippet.js +16 -16
  27. package/es/components/ComboBox/ComboBox.js +18 -18
  28. package/es/components/ComboButton/index.js +7 -7
  29. package/es/components/ComposedModal/ComposedModal.js +20 -20
  30. package/es/components/ComposedModal/ModalFooter.js +8 -8
  31. package/es/components/ComposedModal/ModalHeader.js +8 -8
  32. package/es/components/ContainedList/ContainedList.js +7 -7
  33. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +7 -7
  34. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +8 -0
  35. package/es/components/ContentSwitcher/ContentSwitcher.js +13 -7
  36. package/es/components/Copy/Copy.js +2 -2
  37. package/es/components/CopyButton/CopyButton.js +4 -4
  38. package/es/components/DangerButton/DangerButton.js +2 -2
  39. package/es/components/DataTable/DataTable.d.ts +81 -283
  40. package/es/components/DataTable/DataTable.js +83 -123
  41. package/es/components/DataTable/Table.d.ts +2 -2
  42. package/es/components/DataTable/Table.js +4 -4
  43. package/es/components/DataTable/TableActionList.d.ts +1 -1
  44. package/es/components/DataTable/TableBatchAction.js +2 -2
  45. package/es/components/DataTable/TableBatchActions.js +9 -9
  46. package/es/components/DataTable/TableBody.d.ts +3 -3
  47. package/es/components/DataTable/TableBody.js +2 -2
  48. package/es/components/DataTable/TableCell.d.ts +3 -4
  49. package/es/components/DataTable/TableCell.js +2 -2
  50. package/es/components/DataTable/TableContainer.d.ts +2 -3
  51. package/es/components/DataTable/TableContainer.js +6 -6
  52. package/es/components/DataTable/TableDecoratorRow.js +4 -4
  53. package/es/components/DataTable/TableExpandHeader.d.ts +2 -3
  54. package/es/components/DataTable/TableExpandHeader.js +4 -4
  55. package/es/components/DataTable/TableExpandRow.js +8 -8
  56. package/es/components/DataTable/TableExpandedRow.d.ts +3 -3
  57. package/es/components/DataTable/TableExpandedRow.js +4 -4
  58. package/es/components/DataTable/TableHead.d.ts +1 -1
  59. package/es/components/DataTable/TableHeader.d.ts +4 -4
  60. package/es/components/DataTable/TableHeader.js +15 -15
  61. package/es/components/DataTable/TableRow.d.ts +3 -4
  62. package/es/components/DataTable/TableRow.js +4 -4
  63. package/es/components/DataTable/TableSelectAll.js +3 -3
  64. package/es/components/DataTable/TableSelectRow.js +4 -4
  65. package/es/components/DataTable/TableSlugRow.js +3 -3
  66. package/es/components/DataTable/TableToolbar.js +2 -2
  67. package/es/components/DataTable/TableToolbarAction.js +2 -2
  68. package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
  69. package/es/components/DataTable/TableToolbarMenu.js +2 -2
  70. package/es/components/DataTable/TableToolbarSearch.js +2 -2
  71. package/es/components/DataTable/index.d.ts +1 -1
  72. package/es/components/DataTableSkeleton/DataTableSkeleton.js +15 -15
  73. package/es/components/DatePicker/DatePicker.Skeleton.js +8 -8
  74. package/es/components/DatePicker/DatePicker.js +17 -17
  75. package/es/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  76. package/es/components/DatePickerInput/DatePickerInput.js +19 -19
  77. package/es/components/Dialog/index.d.ts +5 -6
  78. package/es/components/Dialog/index.js +10 -10
  79. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  80. package/es/components/Dropdown/Dropdown.Skeleton.js +4 -4
  81. package/es/components/Dropdown/Dropdown.d.ts +3 -3
  82. package/es/components/Dropdown/Dropdown.js +18 -18
  83. package/es/components/ErrorBoundary/ErrorBoundary.js +2 -2
  84. package/es/components/ExpandableSearch/ExpandableSearch.js +3 -3
  85. package/es/components/FeatureFlags/index.js +2 -2
  86. package/es/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  87. package/es/components/FileUploader/FileUploader.Skeleton.js +5 -5
  88. package/es/components/FileUploader/FileUploader.d.ts +2 -3
  89. package/es/components/FileUploader/FileUploader.js +12 -12
  90. package/es/components/FileUploader/FileUploaderButton.d.ts +2 -3
  91. package/es/components/FileUploader/FileUploaderButton.js +4 -4
  92. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  93. package/es/components/FileUploader/FileUploaderDropContainer.js +5 -5
  94. package/es/components/FileUploader/FileUploaderItem.d.ts +2 -3
  95. package/es/components/FileUploader/FileUploaderItem.js +13 -13
  96. package/es/components/FileUploader/Filename.d.ts +3 -4
  97. package/es/components/FileUploader/Filename.js +7 -7
  98. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +5 -5
  99. package/es/components/FluidComboBox/FluidComboBox.js +4 -4
  100. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +11 -11
  101. package/es/components/FluidDatePicker/FluidDatePicker.js +4 -4
  102. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
  103. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +5 -5
  104. package/es/components/FluidDropdown/FluidDropdown.js +4 -4
  105. package/es/components/FluidForm/FluidForm.d.ts +3 -4
  106. package/es/components/FluidForm/FluidForm.js +3 -3
  107. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +5 -5
  108. package/es/components/FluidMultiSelect/FluidMultiSelect.js +5 -5
  109. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +5 -5
  110. package/es/components/FluidNumberInput/FluidNumberInput.js +4 -4
  111. package/es/components/FluidSearch/FluidSearch.Skeleton.js +5 -5
  112. package/es/components/FluidSearch/FluidSearch.js +4 -4
  113. package/es/components/FluidSelect/FluidSelect.Skeleton.js +5 -5
  114. package/es/components/FluidSelect/FluidSelect.js +4 -4
  115. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +5 -5
  116. package/es/components/FluidTextArea/FluidTextArea.js +3 -3
  117. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +5 -5
  118. package/es/components/FluidTextInput/FluidTextInput.js +5 -5
  119. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +3 -3
  120. package/es/components/FluidTimePicker/FluidTimePicker.js +13 -13
  121. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -3
  122. package/es/components/Form/Form.js +2 -2
  123. package/es/components/FormGroup/FormGroup.d.ts +3 -4
  124. package/es/components/FormGroup/FormGroup.js +4 -4
  125. package/es/components/FormItem/FormItem.js +2 -2
  126. package/es/components/FormLabel/FormLabel.js +2 -2
  127. package/es/components/Grid/CSSGrid.js +8 -8
  128. package/es/components/Grid/Column.js +5 -5
  129. package/es/components/Grid/ColumnHang.js +2 -2
  130. package/es/components/Grid/FlexGrid.js +4 -4
  131. package/es/components/Grid/Grid.js +3 -3
  132. package/es/components/Grid/GridContext.d.ts +2 -2
  133. package/es/components/Grid/GridContext.js +1 -1
  134. package/es/components/Grid/Row.js +2 -2
  135. package/es/components/Heading/index.js +9 -9
  136. package/es/components/Icon/Icon.Skeleton.js +2 -2
  137. package/es/components/IconButton/index.js +11 -6
  138. package/es/components/IconIndicator/index.js +4 -4
  139. package/es/components/IdPrefix/index.js +2 -2
  140. package/es/components/InlineCheckbox/InlineCheckbox.js +6 -6
  141. package/es/components/InlineLoading/InlineLoading.js +10 -10
  142. package/es/components/Layer/LayerContext.js +2 -2
  143. package/es/components/Layer/index.d.ts +4 -0
  144. package/es/components/Layer/index.js +15 -8
  145. package/es/components/Layout/index.js +5 -5
  146. package/es/components/LayoutDirection/LayoutDirection.js +4 -4
  147. package/es/components/LayoutDirection/LayoutDirectionContext.js +2 -2
  148. package/es/components/Link/Link.js +6 -6
  149. package/es/components/ListBox/ListBox.d.ts +2 -3
  150. package/es/components/ListBox/ListBox.js +5 -5
  151. package/es/components/ListBox/ListBoxField.d.ts +3 -4
  152. package/es/components/ListBox/ListBoxField.js +2 -2
  153. package/es/components/ListBox/ListBoxMenu.d.ts +2 -3
  154. package/es/components/ListBox/ListBoxMenu.js +2 -2
  155. package/es/components/ListBox/ListBoxMenuIcon.js +4 -4
  156. package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  157. package/es/components/ListBox/ListBoxMenuItem.js +3 -3
  158. package/es/components/ListBox/ListBoxSelection.js +6 -6
  159. package/es/components/ListBox/next/ListBoxSelection.js +7 -7
  160. package/es/components/ListBox/next/ListBoxTrigger.js +4 -4
  161. package/es/components/ListItem/ListItem.js +2 -2
  162. package/es/components/Loading/Loading.d.ts +3 -3
  163. package/es/components/Loading/Loading.js +6 -6
  164. package/es/components/Menu/Menu.js +3 -3
  165. package/es/components/Menu/MenuItem.js +16 -16
  166. package/es/components/MenuButton/index.js +4 -4
  167. package/es/components/Modal/Modal.d.ts +2 -3
  168. package/es/components/Modal/Modal.js +35 -35
  169. package/es/components/ModalWrapper/ModalWrapper.js +7 -7
  170. package/es/components/MultiSelect/FilterableMultiSelect.js +22 -26
  171. package/es/components/MultiSelect/MultiSelect.js +23 -23
  172. package/es/components/Notification/Notification.js +41 -41
  173. package/es/components/NumberInput/NumberInput.Skeleton.js +4 -4
  174. package/es/components/NumberInput/NumberInput.js +22 -22
  175. package/es/components/OrderedList/OrderedList.js +2 -2
  176. package/es/components/OverflowMenu/OverflowMenu.js +7 -7
  177. package/es/components/OverflowMenu/index.js +3 -3
  178. package/es/components/OverflowMenu/next/index.js +6 -6
  179. package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
  180. package/es/components/OverflowMenuV2/index.js +3 -3
  181. package/es/components/PageHeader/PageHeader.js +29 -29
  182. package/es/components/Pagination/Pagination.Skeleton.js +8 -8
  183. package/es/components/Pagination/Pagination.js +17 -17
  184. package/es/components/Pagination/experimental/PageSelector.js +3 -3
  185. package/es/components/Pagination/experimental/Pagination.js +14 -14
  186. package/es/components/PaginationNav/PaginationNav.js +31 -31
  187. package/es/components/Popover/index.js +15 -15
  188. package/es/components/PrimaryButton/PrimaryButton.js +2 -2
  189. package/es/components/ProgressBar/ProgressBar.js +13 -13
  190. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +7 -7
  191. package/es/components/ProgressIndicator/ProgressIndicator.js +20 -20
  192. package/es/components/RadioButton/RadioButton.Skeleton.js +4 -4
  193. package/es/components/RadioButton/RadioButton.js +10 -10
  194. package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -16
  195. package/es/components/RadioTile/RadioTile.js +12 -12
  196. package/es/components/Search/Search.Skeleton.js +4 -4
  197. package/es/components/Search/Search.js +11 -11
  198. package/es/components/SecondaryButton/SecondaryButton.js +2 -2
  199. package/es/components/Select/Select.Skeleton.js +5 -5
  200. package/es/components/Select/Select.js +19 -19
  201. package/es/components/SelectItem/SelectItem.js +2 -2
  202. package/es/components/SelectItemGroup/SelectItemGroup.js +2 -2
  203. package/es/components/ShapeIndicator/index.js +7 -7
  204. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  205. package/es/components/SkeletonIcon/SkeletonIcon.js +3 -7
  206. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -2
  207. package/es/components/SkeletonText/SkeletonText.js +4 -4
  208. package/es/components/Slider/Slider.Skeleton.js +17 -17
  209. package/es/components/Slider/Slider.js +38 -38
  210. package/es/components/Slider/SliderHandles.js +19 -19
  211. package/es/components/Stack/HStack.js +2 -2
  212. package/es/components/Stack/Stack.js +2 -2
  213. package/es/components/Stack/VStack.js +2 -2
  214. package/es/components/StructuredList/StructuredList.Skeleton.js +12 -12
  215. package/es/components/StructuredList/StructuredList.js +24 -24
  216. package/es/components/Switch/IconSwitch.js +3 -3
  217. package/es/components/Switch/Switch.js +4 -4
  218. package/es/components/TabContent/TabContent.js +2 -2
  219. package/es/components/Tabs/Tabs.Skeleton.js +7 -7
  220. package/es/components/Tabs/Tabs.js +60 -60
  221. package/es/components/Tag/DismissibleTag.js +10 -10
  222. package/es/components/Tag/OperationalTag.js +6 -6
  223. package/es/components/Tag/SelectableTag.js +6 -6
  224. package/es/components/Tag/Tag.Skeleton.js +2 -2
  225. package/es/components/Tag/Tag.js +15 -15
  226. package/es/components/Text/Text.js +4 -4
  227. package/es/components/Text/TextDirection.js +2 -2
  228. package/es/components/Text/createTextComponent.js +2 -2
  229. package/es/components/TextArea/TextArea.Skeleton.js +4 -4
  230. package/es/components/TextArea/TextArea.js +19 -19
  231. package/es/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  232. package/es/components/TextInput/ControlledPasswordInput.js +13 -13
  233. package/es/components/TextInput/PasswordInput.js +15 -15
  234. package/es/components/TextInput/TextInput.Skeleton.js +4 -4
  235. package/es/components/TextInput/TextInput.js +17 -17
  236. package/es/components/Theme/index.js +10 -10
  237. package/es/components/Tile/Tile.js +36 -36
  238. package/es/components/TileGroup/TileGroup.d.ts +3 -4
  239. package/es/components/TileGroup/TileGroup.js +8 -8
  240. package/es/components/TimePicker/TimePicker.d.ts +2 -3
  241. package/es/components/TimePicker/TimePicker.js +14 -14
  242. package/es/components/TimePickerSelect/TimePickerSelect.js +4 -4
  243. package/es/components/Toggle/Toggle.Skeleton.js +4 -4
  244. package/es/components/Toggle/Toggle.js +10 -10
  245. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +8 -8
  246. package/es/components/Toggletip/index.js +12 -12
  247. package/es/components/Tooltip/DefinitionTooltip.js +4 -4
  248. package/es/components/Tooltip/Tooltip.d.ts +3 -0
  249. package/es/components/Tooltip/Tooltip.js +25 -13
  250. package/es/components/TreeView/TreeNode.js +45 -36
  251. package/es/components/TreeView/TreeView.js +30 -21
  252. package/es/components/UIShell/Content.js +2 -2
  253. package/es/components/UIShell/Header.js +2 -2
  254. package/es/components/UIShell/HeaderContainer.js +2 -2
  255. package/es/components/UIShell/HeaderGlobalAction.js +3 -3
  256. package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  257. package/es/components/UIShell/HeaderMenu.js +14 -14
  258. package/es/components/UIShell/HeaderMenuButton.js +4 -4
  259. package/es/components/UIShell/HeaderMenuItem.js +11 -9
  260. package/es/components/UIShell/HeaderName.js +3 -3
  261. package/es/components/UIShell/HeaderNavigation.js +3 -3
  262. package/es/components/UIShell/HeaderPanel.js +3 -3
  263. package/es/components/UIShell/HeaderSideNavItems.js +2 -2
  264. package/es/components/UIShell/Link.js +3 -3
  265. package/es/components/UIShell/SideNav.js +7 -7
  266. package/es/components/UIShell/SideNavDetails.js +3 -3
  267. package/es/components/UIShell/SideNavDivider.js +3 -3
  268. package/es/components/UIShell/SideNavFooter.js +7 -7
  269. package/es/components/UIShell/SideNavHeader.js +3 -3
  270. package/es/components/UIShell/SideNavIcon.js +2 -2
  271. package/es/components/UIShell/SideNavItem.js +2 -2
  272. package/es/components/UIShell/SideNavItems.js +5 -5
  273. package/es/components/UIShell/SideNavLink.js +5 -5
  274. package/es/components/UIShell/SideNavLinkText.js +2 -2
  275. package/es/components/UIShell/SideNavMenu.js +10 -10
  276. package/es/components/UIShell/SideNavMenuItem.js +5 -5
  277. package/es/components/UIShell/SideNavSwitcher.js +8 -8
  278. package/es/components/UIShell/SkipToContent.js +2 -2
  279. package/es/components/UIShell/Switcher.js +8 -8
  280. package/es/components/UIShell/SwitcherDivider.js +2 -2
  281. package/es/components/UIShell/SwitcherItem.js +3 -3
  282. package/es/components/UnorderedList/UnorderedList.js +2 -2
  283. package/es/index.js +23 -24
  284. package/es/internal/FloatingMenu.js +4 -4
  285. package/es/internal/__mocks__/mockHTMLElement.d.ts +9 -0
  286. package/es/internal/createClassWrapper.js +2 -2
  287. package/es/internal/useId.js +2 -2
  288. package/es/internal/useIdPrefix.js +3 -3
  289. package/es/internal/useNormalizedInputProps.js +3 -3
  290. package/es/internal/usePrefix.js +3 -3
  291. package/es/internal/useResizeObserver.d.ts +14 -0
  292. package/es/internal/useResizeObserver.js +74 -0
  293. package/es/internal/wrapFocus.js +3 -6
  294. package/es/tools/wrapComponent.d.ts +3 -4
  295. package/es/tools/wrapComponent.js +2 -2
  296. package/es/types/common.d.ts +0 -2
  297. package/lib/components/CodeSnippet/CodeSnippet.js +2 -3
  298. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +8 -0
  299. package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -1
  300. package/lib/components/DataTable/DataTable.d.ts +81 -283
  301. package/lib/components/DataTable/DataTable.js +82 -123
  302. package/lib/components/DataTable/Table.d.ts +2 -2
  303. package/lib/components/DataTable/TableActionList.d.ts +1 -1
  304. package/lib/components/DataTable/TableBody.d.ts +3 -3
  305. package/lib/components/DataTable/TableCell.d.ts +3 -4
  306. package/lib/components/DataTable/TableContainer.d.ts +2 -3
  307. package/lib/components/DataTable/TableExpandHeader.d.ts +2 -3
  308. package/lib/components/DataTable/TableExpandedRow.d.ts +3 -3
  309. package/lib/components/DataTable/TableHead.d.ts +1 -1
  310. package/lib/components/DataTable/TableHeader.d.ts +4 -4
  311. package/lib/components/DataTable/TableRow.d.ts +3 -4
  312. package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
  313. package/lib/components/DataTable/index.d.ts +1 -1
  314. package/lib/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  315. package/lib/components/Dialog/index.d.ts +5 -6
  316. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  317. package/lib/components/Dropdown/Dropdown.d.ts +3 -3
  318. package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  319. package/lib/components/FileUploader/FileUploader.d.ts +2 -3
  320. package/lib/components/FileUploader/FileUploaderButton.d.ts +2 -3
  321. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  322. package/lib/components/FileUploader/FileUploaderItem.d.ts +2 -3
  323. package/lib/components/FileUploader/Filename.d.ts +3 -4
  324. package/lib/components/FluidForm/FluidForm.d.ts +3 -4
  325. package/lib/components/FormGroup/FormGroup.d.ts +3 -4
  326. package/lib/components/Grid/GridContext.d.ts +2 -2
  327. package/lib/components/Grid/GridContext.js +5 -23
  328. package/lib/components/IconButton/index.js +6 -1
  329. package/lib/components/Layer/index.d.ts +4 -0
  330. package/lib/components/Layer/index.js +9 -2
  331. package/lib/components/Link/Link.js +1 -1
  332. package/lib/components/ListBox/ListBox.d.ts +2 -3
  333. package/lib/components/ListBox/ListBoxField.d.ts +3 -4
  334. package/lib/components/ListBox/ListBoxMenu.d.ts +2 -3
  335. package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  336. package/lib/components/Loading/Loading.d.ts +3 -3
  337. package/lib/components/Modal/Modal.d.ts +2 -3
  338. package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -5
  339. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  340. package/lib/components/SkeletonIcon/SkeletonIcon.js +1 -5
  341. package/lib/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  342. package/lib/components/TileGroup/TileGroup.d.ts +3 -4
  343. package/lib/components/TimePicker/TimePicker.d.ts +2 -3
  344. package/lib/components/Tooltip/Tooltip.d.ts +3 -0
  345. package/lib/components/Tooltip/Tooltip.js +18 -6
  346. package/lib/components/TreeView/TreeNode.js +20 -11
  347. package/lib/components/TreeView/TreeView.js +27 -18
  348. package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  349. package/lib/components/UIShell/HeaderMenuItem.js +7 -5
  350. package/lib/index.js +46 -47
  351. package/lib/internal/__mocks__/mockHTMLElement.d.ts +9 -0
  352. package/lib/internal/useResizeObserver.d.ts +14 -0
  353. package/lib/internal/useResizeObserver.js +78 -0
  354. package/lib/internal/wrapFocus.js +3 -6
  355. package/lib/tools/wrapComponent.d.ts +3 -4
  356. package/lib/types/common.d.ts +0 -2
  357. package/package.json +5 -6
  358. package/scss/components/content-switcher/_tokens.scss +9 -0
  359. package/telemetry.yml +4 -1
  360. package/es/components/DataTable/index.js +0 -76
  361. package/lib/components/DataTable/index.js +0 -82
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import { ReactAttr } from '../../types/common';
9
- export interface FileUploaderSkeletonProps extends ReactAttr<HTMLDivElement> {
8
+ import { type HTMLAttributes } from 'react';
9
+ export interface FileUploaderSkeletonProps extends HTMLAttributes<HTMLDivElement> {
10
10
  /**
11
11
  * Specify an optional className to add.
12
12
  */
@@ -4,9 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
8
- import { ReactAttr } from '../../types/common';
9
- export interface FileUploaderProps extends ReactAttr<HTMLSpanElement> {
7
+ import React, { type HTMLAttributes } from 'react';
8
+ export interface FileUploaderProps extends HTMLAttributes<HTMLSpanElement> {
10
9
  /**
11
10
  * Specify the types of files that this input should be able to receive
12
11
  */
@@ -5,9 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import React from 'react';
9
- import { ReactAttr } from '../../types/common';
10
- export interface FileUploaderButtonProps extends Omit<ReactAttr<HTMLButtonElement>, 'onChange' | 'tabIndex'> {
8
+ import React, { type HTMLAttributes } from 'react';
9
+ export interface FileUploaderButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'onChange' | 'tabIndex'> {
11
10
  /**
12
11
  * Specify the types of files that this input should be able to receive
13
12
  */
@@ -4,10 +4,9 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import React, { type HTMLAttributes } from 'react';
8
8
  import PropTypes from 'prop-types';
9
- import { ReactAttr } from '../../types/common';
10
- export interface FileUploaderDropContainerProps extends Omit<ReactAttr<HTMLButtonElement>, 'tabIndex'> {
9
+ export interface FileUploaderDropContainerProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'tabIndex'> {
11
10
  /**
12
11
  * Specify the types of files that this input should be able to receive
13
12
  */
@@ -5,9 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import React from 'react';
9
- import { ReactAttr } from '../../types/common';
10
- export interface FileUploaderItemProps extends ReactAttr<HTMLSpanElement> {
8
+ import React, { type HTMLAttributes } from 'react';
9
+ export interface FileUploaderItemProps extends HTMLAttributes<HTMLSpanElement> {
11
10
  /**
12
11
  * Error message body for an invalid file upload
13
12
  */
@@ -1,15 +1,14 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import React from 'react';
9
- import { ReactAttr } from '../../types/common';
8
+ import React, { type HTMLAttributes } from 'react';
10
9
  export type FilenameStatus = 'edit' | 'complete' | 'uploading';
11
10
  type SVGAttr = React.SVGAttributes<React.ReactSVGElement>;
12
- export interface FilenameProps extends Omit<ReactAttr & SVGAttr, 'tabIndex' | 'type'> {
11
+ export interface FilenameProps extends Omit<HTMLAttributes<HTMLElement> & SVGAttr, 'tabIndex' | 'type'> {
13
12
  /**
14
13
  * Specify an id that describes the error to be read by screen readers when the filename is invalid
15
14
  */
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
8
- import { ReactAttr } from '../../types/common';
9
- export type FluidFormProps = ReactAttr<HTMLFormElement>;
7
+ import React, { type HTMLAttributes } from 'react';
8
+ export type FluidFormProps = HTMLAttributes<HTMLFormElement>;
10
9
  declare const FluidForm: React.FC<FluidFormProps>;
11
10
  export default FluidForm;
@@ -1,13 +1,12 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import React from 'react';
9
- import { ReactAttr } from '../../types/common';
10
- export interface FormGroupProps extends ReactAttr<HTMLFieldSetElement> {
8
+ import React, { type HTMLAttributes } from 'react';
9
+ export interface FormGroupProps extends HTMLAttributes<HTMLFieldSetElement> {
11
10
  /**
12
11
  * Provide the children form elements to be rendered inside of the <fieldset>
13
12
  */
@@ -1,10 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as React from 'react';
7
+ import React from 'react';
8
8
  export type GridMode = 'flexbox' | 'css-grid';
9
9
  export interface GridSettingContext {
10
10
  /**
@@ -14,32 +14,14 @@ var React = require('react');
14
14
 
15
15
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
16
 
17
- function _interopNamespace(e) {
18
- if (e && e.__esModule) return e;
19
- var n = Object.create(null);
20
- if (e) {
21
- Object.keys(e).forEach(function (k) {
22
- if (k !== 'default') {
23
- var d = Object.getOwnPropertyDescriptor(e, k);
24
- Object.defineProperty(n, k, d.get ? d : {
25
- enumerable: true,
26
- get: function () { return e[k]; }
27
- });
28
- }
29
- });
30
- }
31
- n["default"] = e;
32
- return Object.freeze(n);
33
- }
34
-
35
17
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
36
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
18
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
37
19
 
38
20
  /**
39
21
  * Provides a grid context for communication the grid "mode" (flexbox or
40
22
  * css-grid) along with subgrid information.
41
23
  */
42
- const GridSettingsContext = /*#__PURE__*/React__namespace.createContext({
24
+ const GridSettingsContext = /*#__PURE__*/React__default["default"].createContext({
43
25
  mode: 'flexbox',
44
26
  subgrid: false
45
27
  });
@@ -49,13 +31,13 @@ const GridSettings = _ref => {
49
31
  mode,
50
32
  subgrid = false
51
33
  } = _ref;
52
- const value = React__namespace.useMemo(() => {
34
+ const value = React__default["default"].useMemo(() => {
53
35
  return {
54
36
  mode,
55
37
  subgrid
56
38
  };
57
39
  }, [mode, subgrid]);
58
- return /*#__PURE__*/React__namespace.createElement(GridSettingsContext.Provider, {
40
+ return /*#__PURE__*/React__default["default"].createElement(GridSettingsContext.Provider, {
59
41
  value: value
60
42
  }, children);
61
43
  };
@@ -80,7 +62,7 @@ GridSettings.propTypes = {
80
62
  * Helper function for accessing the GridContext value
81
63
  */
82
64
  const useGridSettings = () => {
83
- return React__namespace.useContext(GridSettingsContext);
65
+ return React__default["default"].useContext(GridSettingsContext);
84
66
  };
85
67
 
86
68
  exports.GridSettings = GridSettings;
@@ -77,7 +77,7 @@ const IconButton = /*#__PURE__*/React__default["default"].forwardRef(function Ic
77
77
  isSelected: isSelected,
78
78
  hasIconOnly: true,
79
79
  className: className,
80
- "aria-describedby": badgeCount && badgeId
80
+ "aria-describedby": rest['aria-describedby'] || badgeCount && badgeId
81
81
  }), children, !disabled && badgeCount !== undefined && /*#__PURE__*/React__default["default"].createElement(index.BadgeIndicator, {
82
82
  id: badgeId,
83
83
  count: badgeCount > 0 ? badgeCount : undefined
@@ -165,8 +165,13 @@ IconButton.propTypes = {
165
165
  /**
166
166
  * Provide the label to be rendered inside of the Tooltip. The label will use
167
167
  * `aria-labelledby` and will fully describe the child node that is provided.
168
+ * If the child node already has an `aria-label`, the tooltip will not apply
169
+ * `aria-labelledby`. If the child node has `aria-labelledby`, that value will
170
+ * be used instead. Otherwise, the tooltip will use its own ID as the label.
168
171
  * This means that if you have text in the child node it will not be
169
172
  * announced to the screen reader.
173
+ * If using `badgeCount={0}`, make sure the label explains that there is a
174
+ * new notification.
170
175
  */
171
176
  label: PropTypes__default["default"].node.isRequired,
172
177
  /**
@@ -29,6 +29,10 @@ export interface LayerBaseProps {
29
29
  * Specify the layer level and override any existing levels based on hierarchy
30
30
  */
31
31
  level?: LayerLevel;
32
+ /**
33
+ * Applies a css background-color set to $layer-background
34
+ */
35
+ withBackground?: boolean;
32
36
  }
33
37
  export type LayerProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, LayerBaseProps>;
34
38
  declare const Layer: React.ForwardRefExoticComponent<LayerBaseProps & {
@@ -41,12 +41,15 @@ const Layer = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
41
41
  className: customClassName,
42
42
  children,
43
43
  level: overrideLevel,
44
+ withBackground = false,
44
45
  ...rest
45
46
  } = _ref;
46
47
  const contextLevel = React__default["default"].useContext(LayerContext.LayerContext);
47
48
  const level = overrideLevel ?? contextLevel;
48
49
  const prefix = usePrefix.usePrefix();
49
- const className = cx__default["default"](`${prefix}--layer-${LayerLevel.levels[level]}`, customClassName);
50
+ const className = cx__default["default"](`${prefix}--layer-${LayerLevel.levels[level]}`, {
51
+ [`${prefix}--layer__with-background`]: withBackground
52
+ }, customClassName);
50
53
  // The level should be between MIN_LEVEL and MAX_LEVEL
51
54
  const value = clamp.clamp(level + 1, LayerLevel.MIN_LEVEL, LayerLevel.MAX_LEVEL);
52
55
  const BaseComponent = as || 'div';
@@ -77,7 +80,11 @@ Layer.propTypes = {
77
80
  /**
78
81
  * Specify the layer level and override any existing levels based on hierarchy
79
82
  */
80
- level: PropTypes__default["default"].oneOf([0, 1, 2])
83
+ level: PropTypes__default["default"].oneOf([0, 1, 2]),
84
+ /**
85
+ * Applies a css background-color set to $layer-background
86
+ */
87
+ withBackground: PropTypes__default["default"].bool
81
88
  };
82
89
 
83
90
  exports.Layer = Layer;
@@ -45,7 +45,7 @@ const LinkBase = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
45
45
  });
46
46
  const rel = target === '_blank' ? 'noopener' : undefined;
47
47
  const linkProps = {
48
- className: BaseComponent ? undefined : className,
48
+ className,
49
49
  rel,
50
50
  target
51
51
  };
@@ -4,11 +4,10 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
7
+ import React, { type HTMLAttributes } from 'react';
8
8
  import { type ListBoxSize, type ListBoxType } from '.';
9
- import { ReactAttr } from '../../types/common';
10
9
  type ExcludedAttributes = 'onKeyDown' | 'onKeyPress' | 'ref';
11
- export interface ListBoxProps extends Omit<ReactAttr<HTMLDivElement>, ExcludedAttributes> {
10
+ export interface ListBoxProps extends Omit<HTMLAttributes<HTMLDivElement>, ExcludedAttributes> {
12
11
  /**
13
12
  * Specify whether the ListBox is currently disabled
14
13
  */
@@ -1,13 +1,12 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
8
- import { ReactAttr } from '../../types/common';
7
+ import React, { type HTMLAttributes } from 'react';
9
8
  export declare const translationIds: {};
10
- export interface ListBoxFieldProps extends ReactAttr<HTMLDivElement> {
9
+ export interface ListBoxFieldProps extends HTMLAttributes<HTMLDivElement> {
11
10
  /**
12
11
  * Specify if the parent <ListBox> is disabled
13
12
  */
@@ -4,10 +4,9 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
8
- import { ReactAttr } from '../../types/common';
7
+ import React, { type HTMLAttributes } from 'react';
9
8
  type ExcludedAttributes = 'id';
10
- export interface ListBoxMenuProps extends Omit<ReactAttr<HTMLUListElement>, ExcludedAttributes> {
9
+ export interface ListBoxMenuProps extends Omit<HTMLAttributes<HTMLUListElement>, ExcludedAttributes> {
11
10
  children?: any;
12
11
  /**
13
12
  * Specify a custom `id`
@@ -4,9 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { ReactNode } from 'react';
8
- import { ReactAttr } from '../../types/common';
9
- export interface ListBoxMenuItemProps extends ReactAttr<HTMLLIElement> {
7
+ import React, { type HTMLAttributes, type ReactNode } from 'react';
8
+ export interface ListBoxMenuItemProps extends HTMLAttributes<HTMLLIElement> {
10
9
  /**
11
10
  * Specify any children nodes that should be rendered inside of the ListBox
12
11
  * Menu Item
@@ -1,12 +1,12 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import { ReactAttr } from '../../types/common';
9
- export interface LoadingProps extends ReactAttr<HTMLDivElement> {
8
+ import { type HTMLAttributes } from 'react';
9
+ export interface LoadingProps extends HTMLAttributes<HTMLDivElement> {
10
10
  /**
11
11
  * Specify whether you want the loading indicator to be spinning or not
12
12
  */
@@ -4,8 +4,7 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { type ReactNode, type Ref } from 'react';
8
- import { ReactAttr } from '../../types/common';
7
+ import React, { type HTMLAttributes, type ReactNode, type Ref } from 'react';
9
8
  import { InlineLoadingStatus } from '../InlineLoading/InlineLoading';
10
9
  export declare const ModalSizes: readonly ["xs", "sm", "md", "lg"];
11
10
  export type ModalSize = (typeof ModalSizes)[number];
@@ -13,7 +12,7 @@ export interface ModalSecondaryButton {
13
12
  buttonText?: string | ReactNode;
14
13
  onClick?: React.MouseEventHandler<HTMLButtonElement>;
15
14
  }
16
- export interface ModalProps extends ReactAttr<HTMLDivElement> {
15
+ export interface ModalProps extends HTMLAttributes<HTMLDivElement> {
17
16
  /**
18
17
  * Specify whether the Modal is displaying an alert, error or warning
19
18
  * Should go hand in hand with the danger prop.
@@ -555,11 +555,7 @@ const FilterableMultiSelect = /*#__PURE__*/React.forwardRef(function FilterableM
555
555
  }
556
556
  }
557
557
  } : {};
558
- const clearSelectionContent = controlledSelectedItems.length > 0 ? /*#__PURE__*/React__default["default"].createElement("span", {
559
- className: `${prefix}--visually-hidden`
560
- }, clearSelectionDescription, " ", controlledSelectedItems.length, ",", clearSelectionText) : /*#__PURE__*/React__default["default"].createElement("span", {
561
- className: `${prefix}--visually-hidden`
562
- }, clearSelectionDescription, ": 0");
558
+ const clearSelectionContent = controlledSelectedItems.length > 0 ? `${clearSelectionDescription} ${controlledSelectedItems.length}. ${clearSelectionText}.` : `${clearSelectionDescription} 0.`;
563
559
  return /*#__PURE__*/React__default["default"].createElement("div", {
564
560
  className: wrapperClasses
565
561
  }, titleText ? /*#__PURE__*/React__default["default"].createElement("label", _rollupPluginBabelHelpers["extends"]({
@@ -4,10 +4,6 @@ export interface SkeletonIconProps {
4
4
  * Specify an optional className to add.
5
5
  */
6
6
  className?: string;
7
- /**
8
- * The CSS styles.
9
- */
10
- style?: React.CSSProperties;
11
7
  }
12
8
  declare const SkeletonIcon: React.FC<SkeletonIconProps>;
13
9
  export default SkeletonIcon;
@@ -38,11 +38,7 @@ SkeletonIcon.propTypes = {
38
38
  /**
39
39
  * Specify an optional className to add.
40
40
  */
41
- className: PropTypes__default["default"].string,
42
- /**
43
- * The CSS styles.
44
- */
45
- style: PropTypes__default["default"].object
41
+ className: PropTypes__default["default"].string
46
42
  };
47
43
 
48
44
  exports["default"] = SkeletonIcon;
@@ -4,9 +4,8 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
8
- import { ReactAttr } from '../../types/common';
9
- export interface ControlledPasswordInputProps extends ReactAttr<HTMLInputElement> {
7
+ import React, { type HTMLAttributes } from 'react';
8
+ export interface ControlledPasswordInputProps extends HTMLAttributes<HTMLInputElement> {
10
9
  /**
11
10
  * Provide a custom className that is applied directly to the underlying
12
11
  * `<input>` node
@@ -1,14 +1,13 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import { ReactNode } from 'react';
9
- import { ReactAttr } from '../../types/common';
8
+ import { type HTMLAttributes, type ReactNode } from 'react';
10
9
  type ExcludedAttributes = 'onChange';
11
- export interface TileGroupProps extends Omit<ReactAttr<HTMLFieldSetElement>, ExcludedAttributes> {
10
+ export interface TileGroupProps extends Omit<HTMLAttributes<HTMLFieldSetElement>, ExcludedAttributes> {
12
11
  /**
13
12
  * Provide a collection of <RadioTile> components to render in the group
14
13
  */
@@ -4,10 +4,9 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
8
- import { ReactAttr } from '../../types/common';
7
+ import React, { type HTMLAttributes } from 'react';
9
8
  type ExcludedAttributes = 'id' | 'value';
10
- export interface TimePickerProps extends Omit<ReactAttr<HTMLInputElement>, ExcludedAttributes> {
9
+ export interface TimePickerProps extends Omit<HTMLAttributes<HTMLInputElement>, ExcludedAttributes> {
11
10
  /**
12
11
  * Pass in the children that will be rendered next to the form control
13
12
  */
@@ -54,6 +54,9 @@ interface TooltipBaseProps {
54
54
  /**
55
55
  * Provide the label to be rendered inside of the Tooltip. The label will use
56
56
  * `aria-labelledby` and will fully describe the child node that is provided.
57
+ * If the child already has an `aria-label`, the tooltip will not apply
58
+ * `aria-labelledby`. If the child has its own `aria-labelledby`, that value
59
+ * will be kept. Otherwise, the tooltip will use its own ID to label the child.
57
60
  * This means that if you have text in the child node, that it will not be
58
61
  * announced to the screen reader.
59
62
  *
@@ -56,6 +56,21 @@ const Tooltip = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
56
56
  const id = useId.useId('tooltip');
57
57
  const prefix = usePrefix.usePrefix();
58
58
  const child = React__default["default"].Children.only(children);
59
+ const {
60
+ 'aria-label': ariaLabel,
61
+ 'aria-labelledby': ariaLabelledBy,
62
+ 'aria-describedby': ariaDescribedBy
63
+ } = child?.props ?? {};
64
+ const hasLabel = !!label;
65
+ const hasAriaLabel = typeof ariaLabel === 'string' ? ariaLabel.trim() !== '' : false;
66
+
67
+ // An `aria-label` takes precedence over `aria-describedby`, but when it's
68
+ // needed and the user doesn't specify one, the fallback `id` is used.
69
+ const labelledBy = hasAriaLabel ? null : hasLabel ? ariaLabelledBy ?? id : undefined;
70
+
71
+ // If `aria-label` is present, use any provided `aria-describedby`.
72
+ // If not, fallback to child's `aria-describedby` or the tooltip `id` if needed.
73
+ const describedBy = hasAriaLabel ? ariaDescribedBy : ariaDescribedBy ?? (!hasLabel && !ariaLabelledBy ? id : undefined);
59
74
  const triggerProps = {
60
75
  onFocus: () => !focusByMouse && setOpen(true),
61
76
  onBlur: () => {
@@ -68,7 +83,9 @@ const Tooltip = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
68
83
  onMouseLeave,
69
84
  onMouseDown,
70
85
  onMouseMove: onMouseMove,
71
- onTouchStart: onDragStart
86
+ onTouchStart: onDragStart,
87
+ 'aria-labelledby': labelledBy,
88
+ 'aria-describedby': describedBy
72
89
  };
73
90
  function getChildEventHandlers(childProps) {
74
91
  const eventHandlerFunctions = Object.keys(triggerProps).filter(prop => prop.startsWith('on'));
@@ -83,11 +100,6 @@ const Tooltip = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =>
83
100
  });
84
101
  return eventHandlers;
85
102
  }
86
- if (label) {
87
- triggerProps['aria-labelledby'] = id;
88
- } else {
89
- triggerProps['aria-describedby'] = id;
90
- }
91
103
  const onKeyDown = React.useCallback(event => {
92
104
  if (open && match.match(event, keys.Escape)) {
93
105
  event.stopPropagation();
@@ -80,19 +80,28 @@ const TreeNode = /*#__PURE__*/React__default["default"].forwardRef((_ref, forwar
80
80
  forwardedRef.current = element;
81
81
  }
82
82
  };
83
- const nodesWithProps = React__default["default"].Children.map(children, node => {
84
- if (/*#__PURE__*/React__default["default"].isValidElement(node)) {
83
+ function enhanceTreeNodes(children) {
84
+ return React__default["default"].Children.map(children, node => {
85
+ if (! /*#__PURE__*/React__default["default"].isValidElement(node)) return node;
86
+ const isTreeNode = node.type.displayName === 'TreeNode';
87
+ if (isTreeNode) {
88
+ return /*#__PURE__*/React__default["default"].cloneElement(node, {
89
+ active,
90
+ depth: depth + 1,
91
+ disabled: disabled || node.props.disabled,
92
+ onTreeSelect,
93
+ onNodeFocusEvent,
94
+ selected,
95
+ tabIndex: node.props.disabled ? null : -1
96
+ });
97
+ }
98
+ const newChildren = enhanceTreeNodes(node.props.children);
85
99
  return /*#__PURE__*/React__default["default"].cloneElement(node, {
86
- active,
87
- depth: depth + 1,
88
- disabled: disabled || node.props.disabled,
89
- onTreeSelect,
90
- onNodeFocusEvent,
91
- selected,
92
- tabIndex: !node.props.disabled && -1 || null
100
+ children: newChildren
93
101
  });
94
- }
95
- });
102
+ });
103
+ }
104
+ const nodesWithProps = enhanceTreeNodes(children);
96
105
  const isActive = active === id;
97
106
  const isSelected = selected.includes(id);
98
107
  const treeNodeClasses = cx__default["default"](className, `${prefix}--tree-node`, {
@@ -121,24 +121,33 @@ const TreeView = _ref => {
121
121
  }
122
122
  }
123
123
  let focusTarget = false;
124
- const nodesWithProps = React__default["default"].Children.map(children, _node => {
125
- const node = _node;
126
- const sharedNodeProps = {
127
- active,
128
- depth: 0,
129
- onNodeFocusEvent: handleFocusEvent,
130
- onTreeSelect: handleTreeSelect,
131
- selected,
132
- tabIndex: !node.props.disabled && -1 || undefined
133
- };
134
- if (!focusTarget && !node.props.disabled) {
135
- sharedNodeProps.tabIndex = 0;
136
- focusTarget = true;
137
- }
138
- if (/*#__PURE__*/React__default["default"].isValidElement(node)) {
139
- return /*#__PURE__*/React__default["default"].cloneElement(node, sharedNodeProps);
140
- }
141
- });
124
+ function enhanceTreeNodes(children) {
125
+ return React__default["default"].Children.map(children, child => {
126
+ if (! /*#__PURE__*/React__default["default"].isValidElement(child)) return child;
127
+ const isTreeNode = child.type.displayName === 'TreeNode';
128
+ if (isTreeNode) {
129
+ const node = child;
130
+ const sharedNodeProps = {
131
+ active,
132
+ depth: 0,
133
+ onNodeFocusEvent: handleFocusEvent,
134
+ onTreeSelect: handleTreeSelect,
135
+ selected,
136
+ tabIndex: node.props.disabled ? undefined : -1
137
+ };
138
+ if (!focusTarget && !node.props.disabled) {
139
+ sharedNodeProps.tabIndex = 0;
140
+ focusTarget = true;
141
+ }
142
+ return /*#__PURE__*/React__default["default"].cloneElement(child, sharedNodeProps);
143
+ }
144
+ const newChildren = enhanceTreeNodes(child.props.children);
145
+ return /*#__PURE__*/React__default["default"].cloneElement(child, {
146
+ children: newChildren
147
+ });
148
+ });
149
+ }
150
+ const nodesWithProps = enhanceTreeNodes(children);
142
151
  function handleKeyDown(event) {
143
152
  event.stopPropagation();
144
153
  if (match.matches(event, [keys.ArrowUp, keys.ArrowDown, keys.Home, keys.End])) {
@@ -7,5 +7,5 @@
7
7
  /**
8
8
  * Generic container for `HeaderGlobalAction` components
9
9
  */
10
- declare const HeaderGlobalBar: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement<any>;
10
+ declare const HeaderGlobalBar: (props: import("react").HTMLAttributes<"div">) => React.ReactElement<any>;
11
11
  export default HeaderGlobalBar;