@carbon/react 1.82.1 → 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 (402) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +943 -828
  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/AccordionItem/index.d.ts +9 -0
  11. package/es/components/AspectRatio/AspectRatio.js +2 -2
  12. package/es/components/BadgeIndicator/index.js +3 -3
  13. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +5 -5
  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 +3 -3
  17. package/es/components/Button/Button.js +5 -5
  18. package/es/components/Button/ButtonBase.js +5 -5
  19. package/es/components/ButtonSet/ButtonSet.js +2 -2
  20. package/es/components/ChatButton/ChatButton.Skeleton.js +2 -2
  21. package/es/components/ChatButton/ChatButton.js +3 -3
  22. package/es/components/Checkbox/Checkbox.Skeleton.js +4 -4
  23. package/es/components/Checkbox/Checkbox.js +15 -15
  24. package/es/components/CheckboxGroup/CheckboxGroup.js +12 -12
  25. package/es/components/ClassPrefix/index.js +2 -2
  26. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +7 -7
  27. package/es/components/CodeSnippet/CodeSnippet.js +16 -16
  28. package/es/components/ComboBox/ComboBox.js +18 -18
  29. package/es/components/ComboButton/index.js +7 -7
  30. package/es/components/ComposedModal/ComposedModal.js +20 -20
  31. package/es/components/ComposedModal/ModalFooter.js +8 -8
  32. package/es/components/ComposedModal/ModalHeader.js +8 -8
  33. package/es/components/ContainedList/ContainedList.js +7 -7
  34. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +7 -7
  35. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +8 -0
  36. package/es/components/ContentSwitcher/ContentSwitcher.js +13 -7
  37. package/es/components/Copy/Copy.js +2 -2
  38. package/es/components/CopyButton/CopyButton.js +4 -4
  39. package/es/components/DangerButton/DangerButton.js +2 -2
  40. package/es/components/DataTable/DataTable.d.ts +81 -283
  41. package/es/components/DataTable/DataTable.js +83 -123
  42. package/es/components/DataTable/Table.d.ts +2 -2
  43. package/es/components/DataTable/Table.js +4 -4
  44. package/es/components/DataTable/TableActionList.d.ts +1 -1
  45. package/es/components/DataTable/TableBatchAction.js +2 -2
  46. package/es/components/DataTable/TableBatchActions.js +9 -9
  47. package/es/components/DataTable/TableBody.d.ts +3 -3
  48. package/es/components/DataTable/TableBody.js +2 -2
  49. package/es/components/DataTable/TableCell.d.ts +3 -4
  50. package/es/components/DataTable/TableCell.js +2 -2
  51. package/es/components/DataTable/TableContainer.d.ts +2 -3
  52. package/es/components/DataTable/TableContainer.js +6 -6
  53. package/es/components/DataTable/TableDecoratorRow.js +4 -4
  54. package/es/components/DataTable/TableExpandHeader.d.ts +2 -3
  55. package/es/components/DataTable/TableExpandHeader.js +4 -4
  56. package/es/components/DataTable/TableExpandRow.js +8 -8
  57. package/es/components/DataTable/TableExpandedRow.d.ts +3 -3
  58. package/es/components/DataTable/TableExpandedRow.js +4 -4
  59. package/es/components/DataTable/TableHead.d.ts +1 -1
  60. package/es/components/DataTable/TableHeader.d.ts +4 -4
  61. package/es/components/DataTable/TableHeader.js +15 -15
  62. package/es/components/DataTable/TableRow.d.ts +3 -4
  63. package/es/components/DataTable/TableRow.js +4 -4
  64. package/es/components/DataTable/TableSelectAll.js +3 -3
  65. package/es/components/DataTable/TableSelectRow.js +4 -4
  66. package/es/components/DataTable/TableSlugRow.js +3 -3
  67. package/es/components/DataTable/TableToolbar.js +2 -2
  68. package/es/components/DataTable/TableToolbarAction.js +2 -2
  69. package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
  70. package/es/components/DataTable/TableToolbarMenu.js +2 -2
  71. package/es/components/DataTable/TableToolbarSearch.js +2 -2
  72. package/es/components/DataTable/index.d.ts +1 -1
  73. package/es/components/DataTableSkeleton/DataTableSkeleton.js +15 -15
  74. package/es/components/DatePicker/DatePicker.Skeleton.js +8 -8
  75. package/es/components/DatePicker/DatePicker.d.ts +1 -1
  76. package/es/components/DatePicker/DatePicker.js +23 -20
  77. package/es/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  78. package/es/components/DatePickerInput/DatePickerInput.js +19 -19
  79. package/es/components/Dialog/index.d.ts +5 -6
  80. package/es/components/Dialog/index.js +10 -10
  81. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  82. package/es/components/Dropdown/Dropdown.Skeleton.js +4 -4
  83. package/es/components/Dropdown/Dropdown.d.ts +3 -3
  84. package/es/components/Dropdown/Dropdown.js +18 -18
  85. package/es/components/ErrorBoundary/ErrorBoundary.js +2 -2
  86. package/es/components/ExpandableSearch/ExpandableSearch.js +3 -3
  87. package/es/components/FeatureFlags/index.js +2 -2
  88. package/es/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  89. package/es/components/FileUploader/FileUploader.Skeleton.js +5 -5
  90. package/es/components/FileUploader/FileUploader.d.ts +2 -3
  91. package/es/components/FileUploader/FileUploader.js +12 -12
  92. package/es/components/FileUploader/FileUploaderButton.d.ts +3 -4
  93. package/es/components/FileUploader/FileUploaderButton.js +6 -5
  94. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  95. package/es/components/FileUploader/FileUploaderDropContainer.js +5 -5
  96. package/es/components/FileUploader/FileUploaderItem.d.ts +2 -3
  97. package/es/components/FileUploader/FileUploaderItem.js +13 -13
  98. package/es/components/FileUploader/Filename.d.ts +3 -4
  99. package/es/components/FileUploader/Filename.js +7 -7
  100. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +5 -5
  101. package/es/components/FluidComboBox/FluidComboBox.js +4 -4
  102. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +11 -11
  103. package/es/components/FluidDatePicker/FluidDatePicker.js +4 -4
  104. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
  105. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +5 -5
  106. package/es/components/FluidDropdown/FluidDropdown.js +4 -4
  107. package/es/components/FluidForm/FluidForm.d.ts +3 -4
  108. package/es/components/FluidForm/FluidForm.js +3 -3
  109. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +5 -5
  110. package/es/components/FluidMultiSelect/FluidMultiSelect.js +5 -5
  111. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +5 -5
  112. package/es/components/FluidNumberInput/FluidNumberInput.js +4 -4
  113. package/es/components/FluidSearch/FluidSearch.Skeleton.js +5 -5
  114. package/es/components/FluidSearch/FluidSearch.js +4 -4
  115. package/es/components/FluidSelect/FluidSelect.Skeleton.js +5 -5
  116. package/es/components/FluidSelect/FluidSelect.js +4 -4
  117. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +5 -5
  118. package/es/components/FluidTextArea/FluidTextArea.js +3 -3
  119. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +5 -5
  120. package/es/components/FluidTextInput/FluidTextInput.js +5 -5
  121. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +3 -3
  122. package/es/components/FluidTimePicker/FluidTimePicker.js +13 -13
  123. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -3
  124. package/es/components/Form/Form.js +2 -2
  125. package/es/components/FormGroup/FormGroup.d.ts +3 -4
  126. package/es/components/FormGroup/FormGroup.js +4 -4
  127. package/es/components/FormItem/FormItem.js +2 -2
  128. package/es/components/FormLabel/FormLabel.js +2 -2
  129. package/es/components/Grid/CSSGrid.js +8 -8
  130. package/es/components/Grid/Column.d.ts +5 -5
  131. package/es/components/Grid/Column.js +15 -15
  132. package/es/components/Grid/ColumnHang.js +2 -2
  133. package/es/components/Grid/FlexGrid.js +4 -4
  134. package/es/components/Grid/Grid.js +3 -3
  135. package/es/components/Grid/GridContext.d.ts +2 -2
  136. package/es/components/Grid/GridContext.js +1 -1
  137. package/es/components/Grid/Row.js +2 -2
  138. package/es/components/Heading/index.js +9 -9
  139. package/es/components/Icon/Icon.Skeleton.js +2 -2
  140. package/es/components/IconButton/index.js +11 -6
  141. package/es/components/IconIndicator/index.js +4 -4
  142. package/es/components/IdPrefix/index.js +2 -2
  143. package/es/components/InlineCheckbox/InlineCheckbox.js +6 -6
  144. package/es/components/InlineLoading/InlineLoading.js +10 -10
  145. package/es/components/Layer/LayerContext.js +2 -2
  146. package/es/components/Layer/index.d.ts +4 -0
  147. package/es/components/Layer/index.js +15 -8
  148. package/es/components/Layout/index.js +5 -5
  149. package/es/components/LayoutDirection/LayoutDirection.js +4 -4
  150. package/es/components/LayoutDirection/LayoutDirectionContext.js +2 -2
  151. package/es/components/LayoutDirection/index.d.ts +8 -0
  152. package/es/components/Link/Link.js +6 -6
  153. package/es/components/ListBox/ListBox.d.ts +2 -3
  154. package/es/components/ListBox/ListBox.js +5 -5
  155. package/es/components/ListBox/ListBoxField.d.ts +3 -4
  156. package/es/components/ListBox/ListBoxField.js +2 -2
  157. package/es/components/ListBox/ListBoxMenu.d.ts +2 -3
  158. package/es/components/ListBox/ListBoxMenu.js +2 -2
  159. package/es/components/ListBox/ListBoxMenuIcon.js +4 -4
  160. package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  161. package/es/components/ListBox/ListBoxMenuItem.js +3 -3
  162. package/es/components/ListBox/ListBoxSelection.js +6 -6
  163. package/es/components/ListBox/next/ListBoxSelection.js +7 -7
  164. package/es/components/ListBox/next/ListBoxTrigger.js +4 -4
  165. package/es/components/ListItem/ListItem.js +2 -2
  166. package/es/components/Loading/Loading.d.ts +3 -3
  167. package/es/components/Loading/Loading.js +6 -6
  168. package/es/components/Menu/Menu.js +5 -4
  169. package/es/components/Menu/MenuItem.js +18 -17
  170. package/es/components/MenuButton/index.js +4 -4
  171. package/es/components/Modal/Modal.d.ts +3 -4
  172. package/es/components/Modal/Modal.js +40 -38
  173. package/es/components/ModalWrapper/ModalWrapper.js +7 -7
  174. package/es/components/MultiSelect/FilterableMultiSelect.js +22 -26
  175. package/es/components/MultiSelect/MultiSelect.js +23 -23
  176. package/es/components/Notification/Notification.js +41 -41
  177. package/es/components/NumberInput/NumberInput.Skeleton.js +4 -4
  178. package/es/components/NumberInput/NumberInput.js +22 -22
  179. package/es/components/OrderedList/OrderedList.js +2 -2
  180. package/es/components/OverflowMenu/OverflowMenu.js +7 -7
  181. package/es/components/OverflowMenu/index.js +3 -3
  182. package/es/components/OverflowMenu/next/index.js +6 -6
  183. package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
  184. package/es/components/OverflowMenuV2/index.js +3 -3
  185. package/es/components/PageHeader/PageHeader.js +29 -29
  186. package/es/components/Pagination/Pagination.Skeleton.js +8 -8
  187. package/es/components/Pagination/Pagination.js +17 -17
  188. package/es/components/Pagination/experimental/PageSelector.js +3 -3
  189. package/es/components/Pagination/experimental/Pagination.js +14 -14
  190. package/es/components/PaginationNav/PaginationNav.js +31 -31
  191. package/es/components/Popover/index.js +15 -15
  192. package/es/components/PrimaryButton/PrimaryButton.js +2 -2
  193. package/es/components/ProgressBar/ProgressBar.js +13 -13
  194. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +7 -7
  195. package/es/components/ProgressIndicator/ProgressIndicator.js +20 -20
  196. package/es/components/RadioButton/RadioButton.Skeleton.js +4 -4
  197. package/es/components/RadioButton/RadioButton.js +10 -10
  198. package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -16
  199. package/es/components/RadioTile/RadioTile.js +12 -12
  200. package/es/components/Search/Search.Skeleton.js +4 -4
  201. package/es/components/Search/Search.js +11 -11
  202. package/es/components/SecondaryButton/SecondaryButton.js +2 -2
  203. package/es/components/Select/Select.Skeleton.js +5 -5
  204. package/es/components/Select/Select.js +19 -19
  205. package/es/components/SelectItem/SelectItem.js +2 -2
  206. package/es/components/SelectItemGroup/SelectItemGroup.js +2 -2
  207. package/es/components/ShapeIndicator/index.js +7 -7
  208. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  209. package/es/components/SkeletonIcon/SkeletonIcon.js +3 -7
  210. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +2 -2
  211. package/es/components/SkeletonText/SkeletonText.js +4 -4
  212. package/es/components/Slider/Slider.Skeleton.js +17 -17
  213. package/es/components/Slider/Slider.d.ts +8 -0
  214. package/es/components/Slider/Slider.js +44 -38
  215. package/es/components/Slider/SliderHandles.js +19 -19
  216. package/es/components/Stack/HStack.js +2 -2
  217. package/es/components/Stack/Stack.js +2 -2
  218. package/es/components/Stack/VStack.js +2 -2
  219. package/es/components/StructuredList/StructuredList.Skeleton.js +12 -12
  220. package/es/components/StructuredList/StructuredList.js +24 -24
  221. package/es/components/Switch/IconSwitch.js +3 -3
  222. package/es/components/Switch/Switch.js +4 -4
  223. package/es/components/TabContent/TabContent.js +2 -2
  224. package/es/components/Tabs/Tabs.Skeleton.js +7 -7
  225. package/es/components/Tabs/Tabs.js +65 -62
  226. package/es/components/Tag/DismissibleTag.d.ts +4 -0
  227. package/es/components/Tag/DismissibleTag.js +18 -13
  228. package/es/components/Tag/OperationalTag.js +6 -6
  229. package/es/components/Tag/SelectableTag.d.ts +4 -0
  230. package/es/components/Tag/SelectableTag.js +18 -9
  231. package/es/components/Tag/Tag.Skeleton.js +2 -2
  232. package/es/components/Tag/Tag.js +15 -15
  233. package/es/components/Text/Text.js +4 -4
  234. package/es/components/Text/TextDirection.js +2 -2
  235. package/es/components/Text/createTextComponent.js +2 -2
  236. package/es/components/TextArea/TextArea.Skeleton.js +4 -4
  237. package/es/components/TextArea/TextArea.js +19 -19
  238. package/es/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  239. package/es/components/TextInput/ControlledPasswordInput.js +13 -13
  240. package/es/components/TextInput/PasswordInput.js +15 -15
  241. package/es/components/TextInput/TextInput.Skeleton.js +4 -4
  242. package/es/components/TextInput/TextInput.js +17 -17
  243. package/es/components/Theme/index.js +10 -10
  244. package/es/components/Tile/Tile.js +36 -36
  245. package/es/components/TileGroup/TileGroup.d.ts +3 -4
  246. package/es/components/TileGroup/TileGroup.js +8 -8
  247. package/es/components/TimePicker/TimePicker.d.ts +2 -3
  248. package/es/components/TimePicker/TimePicker.js +14 -14
  249. package/es/components/TimePickerSelect/TimePickerSelect.js +4 -4
  250. package/es/components/Toggle/Toggle.Skeleton.js +4 -4
  251. package/es/components/Toggle/Toggle.js +10 -10
  252. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +8 -8
  253. package/es/components/Toggletip/index.js +12 -12
  254. package/es/components/Tooltip/DefinitionTooltip.js +4 -4
  255. package/es/components/Tooltip/Tooltip.d.ts +3 -0
  256. package/es/components/Tooltip/Tooltip.js +25 -13
  257. package/es/components/TreeView/TreeNode.js +45 -36
  258. package/es/components/TreeView/TreeView.js +30 -21
  259. package/es/components/UIShell/Content.js +2 -2
  260. package/es/components/UIShell/Header.js +2 -2
  261. package/es/components/UIShell/HeaderContainer.js +2 -2
  262. package/es/components/UIShell/HeaderGlobalAction.js +3 -3
  263. package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  264. package/es/components/UIShell/HeaderMenu.js +14 -14
  265. package/es/components/UIShell/HeaderMenuButton.js +4 -4
  266. package/es/components/UIShell/HeaderMenuItem.js +11 -9
  267. package/es/components/UIShell/HeaderName.js +3 -3
  268. package/es/components/UIShell/HeaderNavigation.js +3 -3
  269. package/es/components/UIShell/HeaderPanel.js +3 -3
  270. package/es/components/UIShell/HeaderSideNavItems.js +2 -2
  271. package/es/components/UIShell/Link.js +3 -3
  272. package/es/components/UIShell/SideNav.js +7 -7
  273. package/es/components/UIShell/SideNavDetails.js +3 -3
  274. package/es/components/UIShell/SideNavDivider.js +3 -3
  275. package/es/components/UIShell/SideNavFooter.js +7 -7
  276. package/es/components/UIShell/SideNavHeader.js +3 -3
  277. package/es/components/UIShell/SideNavIcon.js +2 -2
  278. package/es/components/UIShell/SideNavItem.js +2 -2
  279. package/es/components/UIShell/SideNavItems.js +5 -5
  280. package/es/components/UIShell/SideNavLink.js +5 -5
  281. package/es/components/UIShell/SideNavLinkText.js +2 -2
  282. package/es/components/UIShell/SideNavMenu.js +10 -10
  283. package/es/components/UIShell/SideNavMenuItem.js +5 -5
  284. package/es/components/UIShell/SideNavSwitcher.js +8 -8
  285. package/es/components/UIShell/SkipToContent.js +2 -2
  286. package/es/components/UIShell/Switcher.js +9 -9
  287. package/es/components/UIShell/SwitcherDivider.js +2 -2
  288. package/es/components/UIShell/SwitcherItem.js +3 -3
  289. package/es/components/UnorderedList/UnorderedList.js +2 -2
  290. package/es/feature-flags.d.ts +7 -0
  291. package/es/index.js +25 -26
  292. package/es/internal/FloatingMenu.js +4 -4
  293. package/es/internal/__mocks__/mockHTMLElement.d.ts +9 -0
  294. package/es/internal/createClassWrapper.js +2 -2
  295. package/es/internal/debounce.d.ts +8 -0
  296. package/es/internal/environment.d.ts +12 -0
  297. package/es/internal/useId.js +2 -2
  298. package/es/internal/useIdPrefix.js +3 -3
  299. package/es/internal/useNormalizedInputProps.js +3 -3
  300. package/es/internal/usePrefix.js +3 -3
  301. package/es/internal/usePreviousValue.d.ts +17 -0
  302. package/es/internal/usePreviousValue.js +28 -0
  303. package/es/internal/useResizeObserver.d.ts +14 -0
  304. package/es/internal/useResizeObserver.js +74 -0
  305. package/es/internal/wrapFocus.js +3 -6
  306. package/es/prop-types/AriaPropTypes.d.ts +8 -0
  307. package/es/tools/wrapComponent.d.ts +3 -4
  308. package/es/tools/wrapComponent.js +2 -2
  309. package/es/types/common.d.ts +0 -2
  310. package/lib/components/AccordionItem/index.d.ts +9 -0
  311. package/lib/components/CodeSnippet/CodeSnippet.js +2 -3
  312. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +8 -0
  313. package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -1
  314. package/lib/components/DataTable/DataTable.d.ts +81 -283
  315. package/lib/components/DataTable/DataTable.js +82 -123
  316. package/lib/components/DataTable/Table.d.ts +2 -2
  317. package/lib/components/DataTable/TableActionList.d.ts +1 -1
  318. package/lib/components/DataTable/TableBody.d.ts +3 -3
  319. package/lib/components/DataTable/TableCell.d.ts +3 -4
  320. package/lib/components/DataTable/TableContainer.d.ts +2 -3
  321. package/lib/components/DataTable/TableExpandHeader.d.ts +2 -3
  322. package/lib/components/DataTable/TableExpandedRow.d.ts +3 -3
  323. package/lib/components/DataTable/TableHead.d.ts +1 -1
  324. package/lib/components/DataTable/TableHeader.d.ts +4 -4
  325. package/lib/components/DataTable/TableRow.d.ts +3 -4
  326. package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
  327. package/lib/components/DataTable/index.d.ts +1 -1
  328. package/lib/components/DatePicker/DatePicker.d.ts +1 -1
  329. package/lib/components/DatePicker/DatePicker.js +6 -3
  330. package/lib/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  331. package/lib/components/Dialog/index.d.ts +5 -6
  332. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  333. package/lib/components/Dropdown/Dropdown.d.ts +3 -3
  334. package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  335. package/lib/components/FileUploader/FileUploader.d.ts +2 -3
  336. package/lib/components/FileUploader/FileUploaderButton.d.ts +3 -4
  337. package/lib/components/FileUploader/FileUploaderButton.js +3 -2
  338. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  339. package/lib/components/FileUploader/FileUploaderItem.d.ts +2 -3
  340. package/lib/components/FileUploader/Filename.d.ts +3 -4
  341. package/lib/components/FluidForm/FluidForm.d.ts +3 -4
  342. package/lib/components/FormGroup/FormGroup.d.ts +3 -4
  343. package/lib/components/Grid/Column.d.ts +5 -5
  344. package/lib/components/Grid/Column.js +10 -10
  345. package/lib/components/Grid/GridContext.d.ts +2 -2
  346. package/lib/components/Grid/GridContext.js +5 -23
  347. package/lib/components/IconButton/index.js +6 -1
  348. package/lib/components/Layer/index.d.ts +4 -0
  349. package/lib/components/Layer/index.js +9 -2
  350. package/lib/components/LayoutDirection/index.d.ts +8 -0
  351. package/lib/components/Link/Link.js +1 -1
  352. package/lib/components/ListBox/ListBox.d.ts +2 -3
  353. package/lib/components/ListBox/ListBoxField.d.ts +3 -4
  354. package/lib/components/ListBox/ListBoxMenu.d.ts +2 -3
  355. package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  356. package/lib/components/Loading/Loading.d.ts +3 -3
  357. package/lib/components/Menu/Menu.js +2 -1
  358. package/lib/components/Menu/MenuItem.js +2 -1
  359. package/lib/components/Modal/Modal.d.ts +3 -4
  360. package/lib/components/Modal/Modal.js +5 -3
  361. package/lib/components/MultiSelect/FilterableMultiSelect.js +1 -5
  362. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  363. package/lib/components/SkeletonIcon/SkeletonIcon.js +1 -5
  364. package/lib/components/Slider/Slider.d.ts +8 -0
  365. package/lib/components/Slider/Slider.js +6 -0
  366. package/lib/components/Tabs/Tabs.js +5 -2
  367. package/lib/components/Tag/DismissibleTag.d.ts +4 -0
  368. package/lib/components/Tag/DismissibleTag.js +8 -3
  369. package/lib/components/Tag/SelectableTag.d.ts +4 -0
  370. package/lib/components/Tag/SelectableTag.js +12 -3
  371. package/lib/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  372. package/lib/components/TileGroup/TileGroup.d.ts +3 -4
  373. package/lib/components/TimePicker/TimePicker.d.ts +2 -3
  374. package/lib/components/Tooltip/Tooltip.d.ts +3 -0
  375. package/lib/components/Tooltip/Tooltip.js +18 -6
  376. package/lib/components/TreeView/TreeNode.js +20 -11
  377. package/lib/components/TreeView/TreeView.js +27 -18
  378. package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  379. package/lib/components/UIShell/HeaderMenuItem.js +7 -5
  380. package/lib/components/UIShell/Switcher.js +3 -3
  381. package/lib/feature-flags.d.ts +7 -0
  382. package/lib/index.js +50 -51
  383. package/lib/internal/__mocks__/mockHTMLElement.d.ts +9 -0
  384. package/lib/internal/debounce.d.ts +8 -0
  385. package/lib/internal/environment.d.ts +12 -0
  386. package/lib/internal/usePreviousValue.d.ts +17 -0
  387. package/lib/internal/usePreviousValue.js +32 -0
  388. package/lib/internal/useResizeObserver.d.ts +14 -0
  389. package/lib/internal/useResizeObserver.js +78 -0
  390. package/lib/internal/wrapFocus.js +3 -6
  391. package/lib/prop-types/AriaPropTypes.d.ts +8 -0
  392. package/lib/tools/wrapComponent.d.ts +3 -4
  393. package/lib/types/common.d.ts +0 -2
  394. package/package.json +5 -6
  395. package/scss/components/content-switcher/_tokens.scss +9 -0
  396. package/telemetry.yml +5 -1
  397. package/es/components/DataTable/index.js +0 -76
  398. package/es/prop-types/tools/getDisplayName.js +0 -34
  399. package/es/prop-types/types.js +0 -13
  400. package/lib/components/DataTable/index.js +0 -82
  401. package/lib/prop-types/tools/getDisplayName.js +0 -38
  402. package/lib/prop-types/types.js +0 -17
@@ -7,7 +7,7 @@
7
7
 
8
8
  import cx from 'classnames';
9
9
  import PropTypes from 'prop-types';
10
- import React__default from 'react';
10
+ import React from 'react';
11
11
  import { usePrefix } from '../internal/usePrefix.js';
12
12
 
13
13
  /**
@@ -32,7 +32,7 @@ const wrapComponent = _ref => {
32
32
  } = _ref2;
33
33
  const prefix = usePrefix();
34
34
  const componentClass = cx(typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
35
- return /*#__PURE__*/React__default.createElement(type, {
35
+ return /*#__PURE__*/React.createElement(type, {
36
36
  ...other,
37
37
  // Prevent Weird quirk where `cx` will evaluate to an empty string, '',
38
38
  // and so we have empty `class` attributes in the resulting markup
@@ -4,8 +4,6 @@
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';
8
- export type ReactAttr<T = HTMLElement> = React.HTMLAttributes<T>;
9
7
  /**
10
8
  * For "as" props. Creates an "as" property that supports native html tags such as 'span', 'a', 'button' as well as custom functional components
11
9
  * All native props for the supplied html tag/component are inferred as part of the base component props, allowing us to use props like `href` on an 'a' element etc
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2025
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { AccordionItem } from '../Accordion';
8
+ export default AccordionItem;
9
+ export { AccordionItem };
@@ -13,7 +13,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
13
13
  var PropTypes = require('prop-types');
14
14
  var React = require('react');
15
15
  var cx = require('classnames');
16
- var useResizeObserver = require('use-resize-observer');
16
+ var useResizeObserver = require('../../internal/useResizeObserver.js');
17
17
  var iconsReact = require('@carbon/icons-react');
18
18
  var Copy = require('../Copy/Copy.js');
19
19
  var Button = require('../Button/Button.js');
@@ -31,7 +31,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
31
31
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
32
32
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
33
33
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
34
- var useResizeObserver__default = /*#__PURE__*/_interopDefaultLegacy(useResizeObserver);
35
34
  var copy__default = /*#__PURE__*/_interopDefaultLegacy(copy);
36
35
 
37
36
  const rowHeightInPixels = 16;
@@ -112,7 +111,7 @@ function CodeSnippet(_ref) {
112
111
  setHasLeftOverflow(horizontalOverflow && !!codeScrollLeft);
113
112
  setHasRightOverflow(horizontalOverflow && codeScrollLeft + codeClientWidth !== codeScrollWidth);
114
113
  }, [type, getCodeRefDimensions]);
115
- useResizeObserver__default["default"]({
114
+ useResizeObserver.useResizeObserver({
116
115
  // Cast the ref until the hook supports React 19
117
116
  // https://github.com/ZeeCoder/use-resize-observer/issues/108
118
117
  ref: getCodeRef(),
@@ -28,6 +28,10 @@ export interface ContentSwitcherProps extends Omit<HTMLAttributes<HTMLElement>,
28
28
  * been deprecated in favor of the new `Layer` component. It will be removed in the next major release.
29
29
  */
30
30
  light?: boolean;
31
+ /**
32
+ * `true` to use the low contrast version.
33
+ */
34
+ lowContrast?: boolean;
31
35
  /**
32
36
  * Specify an `onChange` handler that is called whenever the ContentSwitcher
33
37
  * changes which item is selected
@@ -72,6 +76,10 @@ export default class ContentSwitcher extends React.Component<ContentSwitcherProp
72
76
  * `true` to use the light variant.
73
77
  */
74
78
  light: (props: any, propName: any, componentName: any, ...rest: any[]) => any;
79
+ /**
80
+ * `true` to use the low contrast version.
81
+ */
82
+ lowContrast: PropTypes.Requireable<boolean>;
75
83
  /**
76
84
  * Specify an `onChange` handler that is called whenever the ContentSwitcher
77
85
  * changes which item is selected
@@ -111,6 +111,7 @@ class ContentSwitcher extends React__default["default"].Component {
111
111
  children,
112
112
  className,
113
113
  light,
114
+ lowContrast,
114
115
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
115
116
  selectedIndex = 0,
116
117
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -128,7 +129,8 @@ class ContentSwitcher extends React__default["default"].Component {
128
129
  [`${prefix}--content-switcher--${size}`]: size,
129
130
  // TODO: V12 - Remove this class
130
131
  [`${prefix}--layout--size-${size}`]: size,
131
- [`${prefix}--content-switcher--icon-only`]: isIconOnly
132
+ [`${prefix}--content-switcher--icon-only`]: isIconOnly,
133
+ [`${prefix}--content-switcher--low-contrast`]: lowContrast
132
134
  });
133
135
  return /*#__PURE__*/React__default["default"].createElement(index.LayoutConstraint, _rollupPluginBabelHelpers["extends"]({
134
136
  size: {
@@ -163,6 +165,10 @@ _rollupPluginBabelHelpers.defineProperty(ContentSwitcher, "propTypes", {
163
165
  * `true` to use the light variant.
164
166
  */
165
167
  light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `ContentSwitcher` is no longer needed and has ' + 'been deprecated. It will be removed in the next major release.'),
168
+ /**
169
+ * `true` to use the low contrast version.
170
+ */
171
+ lowContrast: PropTypes__default["default"].bool,
166
172
  /**
167
173
  * Specify an `onChange` handler that is called whenever the ContentSwitcher
168
174
  * changes which item is selected
@@ -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 PropTypes from 'prop-types';
8
- import React, { type MouseEvent } from 'react';
7
+ import React, { Component, type ChangeEvent, type MouseEvent, type ReactElement, type ReactNode } from 'react';
9
8
  import type { DataTableSortState } from './state/sortStates';
10
9
  import Table from './Table';
11
10
  import TableActionList from './TableActionList';
@@ -51,10 +50,12 @@ export interface DataTableCell<T> {
51
50
  isEditable: boolean;
52
51
  isEditing: boolean;
53
52
  isValid: boolean;
54
- errors: null | Array<Error>;
53
+ errors: null | Error[];
55
54
  info: {
56
55
  header: string;
57
56
  };
57
+ hasAILabelHeader?: boolean;
58
+ hasDecoratorHeader?: boolean;
58
59
  }
59
60
  type DataTableCells<T extends any[]> = {
60
61
  [K in keyof T]: DataTableCell<T[K]>;
@@ -68,18 +69,18 @@ export interface DataTableRow<ColTypes extends any[]> {
68
69
  }
69
70
  export interface DataTableHeader {
70
71
  key: string;
71
- header: React.ReactNode;
72
- slug?: React.ReactElement<any>;
73
- decorator?: React.ReactElement<any>;
72
+ header: ReactNode;
73
+ slug?: ReactElement;
74
+ decorator?: ReactElement;
74
75
  }
75
76
  export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
76
- headers: Array<DataTableHeader>;
77
- rows: Array<DataTableRow<ColTypes> & RowType>;
78
- selectedRows: Array<DataTableRow<ColTypes> & RowType>;
79
- getHeaderProps: (getHeaderPropsArgs: {
77
+ headers: DataTableHeader[];
78
+ rows: (DataTableRow<ColTypes> & RowType)[];
79
+ selectedRows: (DataTableRow<ColTypes> & RowType)[];
80
+ getHeaderProps: (options: {
80
81
  header: DataTableHeader;
81
82
  isSortable?: boolean;
82
- onClick?: (e: React.MouseEvent<HTMLButtonElement>, sortState: {
83
+ onClick?: (event: MouseEvent<HTMLButtonElement>, sortState: {
83
84
  sortHeaderKey: string;
84
85
  sortDirection: DataTableSortState;
85
86
  }) => void;
@@ -88,24 +89,24 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
88
89
  isSortable: boolean | undefined;
89
90
  isSortHeader: boolean;
90
91
  key: string;
91
- onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
92
+ onClick: (event: MouseEvent<HTMLButtonElement>) => void;
92
93
  sortDirection: DataTableSortState;
93
94
  [key: string]: unknown;
94
95
  };
95
- getExpandHeaderProps: (getExpandHeaderPropsArgs?: {
96
- onClick?: (e: React.MouseEvent<HTMLButtonElement>, expandState: {
96
+ getExpandHeaderProps: (options?: {
97
+ onClick?: (event: MouseEvent<HTMLButtonElement>, expandState: {
97
98
  isExpanded?: boolean;
98
99
  }) => void;
99
- onExpand?: (e: React.MouseEvent<HTMLButtonElement>) => void;
100
+ onExpand?: (event: MouseEvent<HTMLButtonElement>) => void;
100
101
  [key: string]: unknown;
101
102
  }) => {
102
103
  ['aria-label']: string;
103
104
  isExpanded: boolean;
104
- onExpand: (e: React.MouseEvent<HTMLButtonElement>) => void;
105
+ onExpand: (event: MouseEvent<HTMLButtonElement>) => void;
105
106
  [key: string]: unknown;
106
107
  };
107
- getRowProps: (getRowPropsArgs: {
108
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
108
+ getRowProps: (options: {
109
+ onClick?: (event: MouseEvent<HTMLButtonElement>) => void;
109
110
  row: DataTableRow<ColTypes>;
110
111
  [key: string]: unknown;
111
112
  }) => {
@@ -114,19 +115,19 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
114
115
  isExpanded?: boolean;
115
116
  isSelected?: boolean;
116
117
  key: string;
117
- onExpand: (e: React.MouseEvent<HTMLButtonElement>) => void;
118
+ onExpand: (event: MouseEvent<HTMLButtonElement>) => void;
118
119
  [key: string]: unknown;
119
120
  };
120
- getExpandedRowProps: (getExpandedRowPropsArgs: {
121
+ getExpandedRowProps: (options: {
121
122
  row: DataTableRow<ColTypes>;
122
123
  [key: string]: unknown;
123
124
  }) => {
124
125
  ['id']: string;
125
126
  [key: string]: unknown;
126
127
  };
127
- getSelectionProps: (getSelectionPropsArgs?: {
128
- onClick?: (e: MouseEvent<HTMLInputElement, globalThis.MouseEvent>) => void;
129
- row: DataTableRow<ColTypes>;
128
+ getSelectionProps: (options?: {
129
+ onClick?: (event: MouseEvent<HTMLInputElement, globalThis.MouseEvent>) => void;
130
+ row?: DataTableRow<ColTypes>;
130
131
  [key: string]: unknown;
131
132
  }) => {
132
133
  'aria-label': string;
@@ -135,17 +136,17 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
135
136
  id: string;
136
137
  indeterminate?: boolean;
137
138
  name: string;
138
- onSelect: (e: React.MouseEvent<HTMLInputElement>) => void;
139
+ onSelect: (event: MouseEvent<HTMLInputElement>) => void;
139
140
  radio?: boolean | undefined;
140
141
  [key: string]: unknown;
141
142
  };
142
- getToolbarProps: (getToolbarPropsArgs?: {
143
+ getToolbarProps: (options?: {
143
144
  [key: string]: unknown;
144
145
  }) => {
145
146
  size: 'sm' | undefined;
146
147
  [key: string]: unknown;
147
148
  };
148
- getBatchActionProps: (getBatchActionPropsArgs?: {
149
+ getBatchActionProps: (options?: {
149
150
  [key: string]: unknown;
150
151
  }) => {
151
152
  onCancel: () => void;
@@ -168,14 +169,14 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
168
169
  stickyHeader?: boolean;
169
170
  useStaticWidth?: boolean;
170
171
  };
171
- getCellProps: (getCellPropsArgs: {
172
+ getCellProps: (options: {
172
173
  cell: DataTableCell<ColTypes>;
173
174
  }) => {
174
175
  [key: string]: unknown;
175
176
  hasAILabelHeader?: boolean;
176
177
  hasDecoratorHeader?: boolean;
177
178
  };
178
- onInputChange: (e: React.ChangeEvent<HTMLInputElement>, defaultValue?: string) => void;
179
+ onInputChange: (event: ChangeEvent<HTMLInputElement>, defaultValue?: string) => void;
179
180
  sortBy: (headerKey: string) => void;
180
181
  selectAll: () => void;
181
182
  selectRow: (rowId: string) => void;
@@ -184,24 +185,24 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
184
185
  radio: boolean | undefined;
185
186
  }
186
187
  export interface DataTableProps<RowType, ColTypes extends any[]> extends TranslateWithId<TranslationKey> {
187
- children?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement<any>;
188
+ children?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => ReactElement;
188
189
  experimentalAutoAlign?: boolean;
189
- filterRows?: (filterRowsArgs: {
190
+ filterRows?: (options: {
190
191
  cellsById: Record<string, DataTableCell<ColTypes>>;
191
192
  getCellId: (rowId: string, header: string) => string;
192
- headers: Array<DataTableHeader>;
193
+ headers: DataTableHeader[];
193
194
  inputValue: string;
194
- rowIds: Array<string>;
195
- }) => Array<string>;
196
- headers: Array<DataTableHeader>;
195
+ rowIds: string[];
196
+ }) => string[];
197
+ headers: DataTableHeader[];
197
198
  isSortable?: boolean;
198
199
  locale?: string;
199
200
  overflowMenuOnHover?: boolean;
200
201
  radio?: boolean;
201
- render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => React.ReactElement<any>;
202
- rows: Array<Omit<DataTableRow<ColTypes>, 'cells'>>;
202
+ render?: (renderProps: DataTableRenderProps<RowType, ColTypes>) => ReactElement;
203
+ rows: Omit<DataTableRow<ColTypes>, 'cells'>[];
203
204
  size?: DataTableSize;
204
- sortRow?: (cellA: any, cellB: any, sortRowOptions: {
205
+ sortRow?: (cellA: any, cellB: any, options: {
205
206
  sortDirection: DataTableSortState;
206
207
  sortStates: Record<DataTableSortState, DataTableSortState>;
207
208
  locale: string;
@@ -215,9 +216,9 @@ export interface DataTableProps<RowType, ColTypes extends any[]> extends Transla
215
216
  interface DataTableState<ColTypes extends any[]> {
216
217
  cellsById: Record<string, DataTableCell<ColTypes>>;
217
218
  filterInputValue: string | null;
218
- initialRowOrder: Array<string>;
219
+ initialRowOrder: string[];
219
220
  isExpandedAll: boolean;
220
- rowIds: Array<string>;
221
+ rowIds: string[];
221
222
  rowsById: Record<string, DataTableRow<ColTypes>>;
222
223
  shouldShowBatchActions: boolean;
223
224
  sortDirection: DataTableSortState;
@@ -233,84 +234,8 @@ interface DataTableState<ColTypes extends any[]> {
233
234
  * and updating the state of the single entity will cascade updates to the
234
235
  * consumer.
235
236
  */
236
- declare class DataTable<RowType, ColTypes extends any[]> extends React.Component<DataTableProps<RowType, ColTypes>, DataTableState<ColTypes>> {
237
+ declare class DataTable<RowType, ColTypes extends any[]> extends Component<DataTableProps<RowType, ColTypes>, DataTableState<ColTypes>> {
237
238
  instanceId: number;
238
- static propTypes: {
239
- /**
240
- * Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
241
- */
242
- experimentalAutoAlign: PropTypes.Requireable<boolean>;
243
- /**
244
- * Optional hook to manually control filtering of the rows from the
245
- * TableToolbarSearch component
246
- */
247
- filterRows: PropTypes.Requireable<(...args: any[]) => any>;
248
- /**
249
- * The `headers` prop represents the order in which the headers should
250
- * appear in the table. We expect an array of objects to be passed in, where
251
- * `key` is the name of the key in a row object, and `header` is the name of
252
- * the header.
253
- */
254
- headers: PropTypes.Validator<(PropTypes.InferProps<{
255
- key: PropTypes.Validator<string>;
256
- header: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
257
- }> | null | undefined)[]>;
258
- /**
259
- * Specify whether the table should be able to be sorted by its headers
260
- */
261
- isSortable: PropTypes.Requireable<boolean>;
262
- /**
263
- * Provide a string for the current locale
264
- */
265
- locale: PropTypes.Requireable<string>;
266
- /**
267
- * Specify whether the overflow menu (if it exists) should be shown always, or only on hover
268
- */
269
- overflowMenuOnHover: PropTypes.Requireable<boolean>;
270
- /**
271
- * Specify whether the control should be a radio button or inline checkbox
272
- */
273
- radio: PropTypes.Requireable<boolean>;
274
- /**
275
- * The `rows` prop is where you provide us with a list of all the rows that
276
- * you want to render in the table. The only hard requirement is that this
277
- * is an array of objects, and that each object has a unique `id` field
278
- * available on it.
279
- */
280
- rows: PropTypes.Validator<(PropTypes.InferProps<{
281
- id: PropTypes.Validator<string>;
282
- disabled: PropTypes.Requireable<boolean>;
283
- isSelected: PropTypes.Requireable<boolean>;
284
- isExpanded: PropTypes.Requireable<boolean>;
285
- }> | null | undefined)[]>;
286
- /**
287
- * Change the row height of table. Currently supports `xs`, `sm`, `md`, `lg`, and `xl`.
288
- */
289
- size: PropTypes.Requireable<string>;
290
- /**
291
- * Optional hook to manually control sorting of the rows.
292
- */
293
- sortRow: PropTypes.Requireable<(...args: any[]) => any>;
294
- /**
295
- * Specify whether the header should be sticky.
296
- * Still experimental: may not work with every combination of table props
297
- */
298
- stickyHeader: PropTypes.Requireable<boolean>;
299
- /**
300
- * Optional method that takes in a message id and returns an
301
- * internationalized string. See `DataTable.translationKeys` for all
302
- * available message ids.
303
- */
304
- translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
305
- /**
306
- * `false` If true, will use a width of 'auto' instead of 100%
307
- */
308
- useStaticWidth: PropTypes.Requireable<boolean>;
309
- /**
310
- * `true` to add useZebraStyles striping.
311
- */
312
- useZebraStyles: PropTypes.Requireable<boolean>;
313
- };
314
239
  static translationKeys: ("carbon.table.row.expand" | "carbon.table.row.collapse" | "carbon.table.all.expand" | "carbon.table.all.collapse" | "carbon.table.all.select" | "carbon.table.all.unselect" | "carbon.table.row.select" | "carbon.table.row.unselect")[];
315
240
  static Table: typeof Table;
316
241
  static TableActionList: typeof TableActionList;
@@ -334,200 +259,82 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
334
259
  static TableToolbarContent: typeof TableToolbarContent;
335
260
  static TableToolbarSearch: typeof TableToolbarSearch;
336
261
  static TableToolbarMenu: typeof TableToolbarMenu;
337
- constructor(props: any);
338
- shouldComponentUpdate(nextProps: any): boolean;
262
+ private readonly rp;
263
+ constructor(props: DataTableProps<RowType, ColTypes>);
264
+ shouldComponentUpdate(nextProps: DataTableProps<RowType, ColTypes>): boolean;
339
265
  /**
340
266
  * Get the props associated with the given header. Mostly used for adding in
341
267
  * sorting behavior.
342
- *
343
- * @param {object} config
344
- * @param {string} config.header the header we want the props for
345
- * @param {Function} config.onClick a custom click handler for the header
346
- * @param {boolean} config.isSortable
347
- * @returns {object}
348
268
  */
349
- getHeaderProps: ({ header, onClick, isSortable, ...rest }: {
350
- header: DataTableHeader;
351
- onClick?: (e: React.MouseEvent<HTMLButtonElement>, sortState: {
352
- sortHeaderKey: string;
353
- sortDirection: DataTableSortState;
354
- }) => void;
355
- isSortable?: boolean;
356
- [key: string]: unknown;
357
- }) => {
358
- key: string;
359
- sortDirection: DataTableSortState;
360
- isSortable: boolean | undefined;
361
- isSortHeader: boolean;
362
- slug: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
363
- decorator: React.ReactElement<any, string | React.JSXElementConstructor<any>> | undefined;
364
- onClick: (event: any) => void;
365
- };
269
+ getHeaderProps: (typeof this.rp)['getHeaderProps'];
366
270
  /**
367
271
  * Get the props associated with the given expand header.
368
- *
369
- * @param {object} config
370
- * @param {Function} config.onClick a custom click handler for the expand header
371
- * @param {Function} config.onExpand a custom click handler called when header is expanded
372
- * @returns {object}
373
272
  */
374
- getExpandHeaderProps: ({ onClick, onExpand, ...rest }?: {
375
- [key: string]: unknown;
376
- onClick?: (e: React.MouseEvent<HTMLButtonElement>, expandState: {
377
- isExpanded: boolean;
378
- }) => void;
379
- onExpand?: (e: React.MouseEvent<HTMLButtonElement>) => void;
380
- }) => {
381
- 'aria-label': any;
382
- 'aria-controls': string;
383
- isExpanded: boolean;
384
- onExpand: (event: React.MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, ...args: any[]) => void;
385
- };
273
+ getExpandHeaderProps: (typeof this.rp)['getExpandHeaderProps'];
386
274
  /**
387
275
  * Decorate consumer's `onClick` event handler with sort parameters
388
- *
389
- * @param {Function} onClick
390
- * @param {object} sortParams
391
- * @returns {Function}
392
276
  */
393
- handleOnHeaderClick: (onClick: any, sortParams: any) => (e: any) => any;
277
+ handleOnHeaderClick: (onClick: (event: MouseEvent<HTMLButtonElement>, sortParams: {
278
+ sortHeaderKey: string;
279
+ sortDirection: DataTableSortState;
280
+ }) => void, sortParams: {
281
+ sortHeaderKey: string;
282
+ sortDirection: DataTableSortState;
283
+ }) => (event: MouseEvent<HTMLButtonElement>) => void;
394
284
  /**
395
- * Decorate consumer's `onClick` event handler with sort parameters
396
- *
397
- * @param {Function} onClick
398
- * @param {object} expandParams
399
- * @returns {Function}
285
+ * Decorate consumer's `onClick` event handler with expand parameters
400
286
  */
401
- handleOnExpandHeaderClick: (onClick: any, expandParams: any) => (e: any) => any;
287
+ handleOnExpandHeaderClick: (onClick: (event: MouseEvent<HTMLButtonElement>, expandParams: {
288
+ isExpanded: boolean;
289
+ }) => void, expandParams: {
290
+ isExpanded: boolean;
291
+ }) => (event: MouseEvent<HTMLButtonElement>) => void;
402
292
  /**
403
293
  * Get the props associated with the given row. Mostly used for expansion.
404
- *
405
- * @param {object} config
406
- * @param {object} config.row the row we want the props for
407
- * @param {Function} config.onClick a custom click handler for the header
408
- * @returns {object}
409
294
  */
410
- getRowProps: ({ row, onClick, ...rest }: {
411
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
412
- row: DataTableRow<ColTypes>;
413
- [key: string]: unknown;
414
- }) => {
415
- key: string;
416
- onExpand: (event: React.MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, ...args: any[]) => void;
417
- isExpanded: boolean | undefined;
418
- 'aria-label': any;
419
- 'aria-controls': string;
420
- isSelected: boolean | undefined;
421
- disabled: boolean | undefined;
422
- };
295
+ getRowProps: (typeof this.rp)['getRowProps'];
423
296
  /**
424
297
  * Get the props associated with an expanded row
425
- *
426
- * @param {object} config
427
- * @param {object} config.row the parent row we want the props for
428
- * @returns {object}
429
298
  */
430
- getExpandedRowProps: ({ row, ...rest }: {
431
- row: DataTableRow<ColTypes>;
432
- [key: string]: unknown;
433
- }) => {
434
- id: string;
435
- };
299
+ getExpandedRowProps: (typeof this.rp)['getExpandedRowProps'];
436
300
  /**
437
301
  * Gets the props associated with selection for a header or a row, where
438
302
  * applicable. Most often used to indicate selection status of the table or
439
303
  * for a specific row.
440
304
  */
441
- getSelectionProps: ({ onClick, row, ...rest }?: {
442
- [key: string]: unknown;
443
- onClick?: (e: MouseEvent<HTMLInputElement, globalThis.MouseEvent>) => void;
444
- row: DataTableRow<ColTypes>;
445
- }) => {
446
- checked: boolean | undefined;
447
- onSelect: (event: React.MouseEvent<HTMLInputElement, globalThis.MouseEvent>, ...args: any[]) => void;
448
- id: string;
449
- name: string;
450
- 'aria-label': any;
451
- disabled: boolean | undefined;
452
- radio: boolean | undefined;
453
- } | {
454
- 'aria-label': any;
455
- checked: boolean;
456
- id: string;
457
- indeterminate: boolean;
458
- name: string;
459
- onSelect: (event: React.MouseEvent<HTMLInputElement, globalThis.MouseEvent>, ...args: any[]) => void;
460
- };
461
- getToolbarProps: (props?: {}) => {
462
- size: "sm" | undefined;
463
- [key: string]: unknown;
464
- };
465
- getBatchActionProps: (props?: {}) => {
466
- shouldShowBatchActions: boolean;
467
- totalSelected: number;
468
- onCancel: () => void;
469
- onSelectAll: undefined;
470
- totalCount: number;
471
- };
472
- /**
473
- * Helper utility to get the Table Props.
474
- */
475
- getTableProps: () => {
476
- useZebraStyles: boolean | undefined;
477
- size: DataTableSize;
478
- isSortable: boolean | undefined;
479
- useStaticWidth: boolean | undefined;
480
- stickyHeader: boolean | undefined;
481
- overflowMenuOnHover: boolean;
482
- experimentalAutoAlign: boolean | undefined;
483
- };
484
- /**
485
- * Helper utility to get the TableContainer Props.
486
- */
487
- getTableContainerProps: () => {
488
- stickyHeader: boolean | undefined;
489
- useStaticWidth: boolean | undefined;
490
- };
305
+ getSelectionProps: (typeof this.rp)['getSelectionProps'];
306
+ getToolbarProps: (typeof this.rp)['getToolbarProps'];
307
+ getBatchActionProps: (typeof this.rp)['getBatchActionProps'];
308
+ getTableProps: (typeof this.rp)['getTableProps'];
309
+ getTableContainerProps: (typeof this.rp)['getTableContainerProps'];
491
310
  /**
492
311
  * Get the props associated with the given table cell.
493
- *
494
- * @param {object} config
495
- * @param {object} config.cell the cell we want the props for
496
- * @returns {object}
497
312
  */
498
- getCellProps: ({ cell, ...rest }: {
499
- [x: string]: any;
500
- cell: any;
501
- }) => {
502
- hasAILabelHeader: any;
503
- hasDecoratorHeader: any;
504
- };
313
+ getCellProps: (typeof this.rp)['getCellProps'];
505
314
  /**
506
315
  * Helper utility to get all the currently selected rows
507
- * @returns {Array<string>} the array of rowIds that are currently selected
316
+ *
317
+ * @returns the array of rowIds that are currently selected
508
318
  */
509
319
  getSelectedRows: () => string[];
510
320
  /**
511
321
  * Helper utility to get all of the available rows after applying the filter
512
- * @returns {Array<string>} the array of rowIds that are currently included through the filter
513
- * */
322
+ *
323
+ * @returns the array of rowIds that are currently included through the filter
324
+ */
514
325
  getFilteredRowIds: () => string[];
515
326
  /**
516
327
  * Helper for getting the table prefix for elements that require an
517
328
  * `id` attribute that is unique.
518
- *
519
- * @returns {string}
520
329
  */
521
330
  getTablePrefix: () => string;
522
331
  /**
523
332
  * Helper for toggling all selected items in a state. Does not call
524
333
  * setState, so use it when setting state.
525
- * @param {object} initialState
526
- * @returns {object} object to put into this.setState (use spread operator)
334
+ *
335
+ * @returns object to put into this.setState (use spread operator)
527
336
  */
528
- setAllSelectedState: (initialState: any, isSelected: any, filteredRowIds: any) => {
529
- rowsById: any;
530
- };
337
+ setAllSelectedState: (initialState: DataTableState<ColTypes>, isSelected: boolean, filteredRowIds: string[]) => Pick<DataTableState<ColTypes>, "rowsById">;
531
338
  /**
532
339
  * Handler for the `onCancel` event to hide the batch action bar and
533
340
  * deselect all selected rows
@@ -539,18 +346,12 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
539
346
  handleSelectAll: () => void;
540
347
  /**
541
348
  * Handler for toggling the selection state of a given row.
542
- *
543
- * @param {string} rowId
544
- * @returns {Function}
545
349
  */
546
- handleOnSelectRow: (rowId: any) => () => void;
350
+ handleOnSelectRow: (rowId: string) => () => void;
547
351
  /**
548
352
  * Handler for toggling the expansion state of a given row.
549
- *
550
- * @param {string} rowId
551
- * @returns {Function}
552
353
  */
553
- handleOnExpandRow: (rowId: any) => () => void;
354
+ handleOnExpandRow: (rowId: string) => () => void;
554
355
  /**
555
356
  * Handler for changing the expansion state of all rows.
556
357
  */
@@ -558,17 +359,14 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
558
359
  /**
559
360
  * Handler for transitioning to the next sort state of the table
560
361
  *
561
- * @param {string} headerKey the field for the header that we are sorting by
562
- * @returns {Function}
362
+ * @param headerKey - The field for the header that we are sorting by.
563
363
  */
564
- handleSortBy: (headerKey: any) => () => void;
364
+ handleSortBy: (headerKey: string) => () => void;
565
365
  /**
566
366
  * Event handler for transitioning input value state changes for the table
567
367
  * filter component.
568
- *
569
- * @param {Event} event
570
368
  */
571
- handleOnInputValueChange: (event: any, defaultValue: any) => void;
572
- render(): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
369
+ handleOnInputValueChange: (event: ChangeEvent<HTMLInputElement>, defaultValue?: string) => void;
370
+ render(): React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | null;
573
371
  }
574
372
  export default DataTable;