@carbon/react 1.29.0 → 1.30.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (580) hide show
  1. package/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
  2. package/es/components/Accordion/Accordion.Skeleton.js +0 -7
  3. package/es/components/Accordion/Accordion.js +1 -8
  4. package/es/components/Accordion/AccordionItem.js +5 -19
  5. package/es/components/AspectRatio/AspectRatio.js +0 -5
  6. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
  7. package/es/components/Breadcrumb/Breadcrumb.js +0 -3
  8. package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
  9. package/es/components/Button/Button.Skeleton.js +2 -7
  10. package/es/components/Button/Button.js +2 -36
  11. package/es/components/ButtonSet/ButtonSet.js +0 -2
  12. package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
  13. package/es/components/Checkbox/Checkbox.js +4 -20
  14. package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
  15. package/es/components/ClassPrefix/index.d.ts +26 -0
  16. package/es/components/ClassPrefix/index.js +0 -2
  17. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
  18. package/es/components/CodeSnippet/CodeSnippet.js +6 -45
  19. package/es/components/ComboBox/ComboBox.js +12 -79
  20. package/es/components/ComboBox/tools/filter.js +0 -1
  21. package/es/components/ComboButton/index.js +0 -14
  22. package/es/components/ComposedModal/ComposedModal.js +2 -32
  23. package/es/components/ComposedModal/ModalFooter.js +0 -21
  24. package/es/components/ComposedModal/ModalHeader.js +0 -12
  25. package/es/components/ContainedList/ContainedList.js +5 -32
  26. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
  27. package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
  28. package/es/components/ContextMenu/useContextMenu.js +1 -6
  29. package/es/components/Copy/Copy.js +8 -31
  30. package/es/components/CopyButton/CopyButton.js +0 -4
  31. package/es/components/DangerButton/DangerButton.js +0 -1
  32. package/es/components/DataTable/DataTable.js +171 -91
  33. package/es/components/DataTable/Table.js +0 -6
  34. package/es/components/DataTable/TableBatchAction.js +0 -4
  35. package/es/components/DataTable/TableBatchActions.js +0 -8
  36. package/es/components/DataTable/TableBody.js +0 -1
  37. package/es/components/DataTable/TableContainer.js +0 -5
  38. package/es/components/DataTable/TableExpandHeader.js +0 -7
  39. package/es/components/DataTable/TableExpandRow.js +0 -6
  40. package/es/components/DataTable/TableExpandedRow.js +0 -6
  41. package/es/components/DataTable/TableHeader.d.ts +1 -1
  42. package/es/components/DataTable/TableHeader.js +3 -19
  43. package/es/components/DataTable/TableRow.js +4 -5
  44. package/es/components/DataTable/TableSelectAll.js +0 -8
  45. package/es/components/DataTable/TableSelectRow.js +2 -10
  46. package/es/components/DataTable/TableToolbar.js +0 -3
  47. package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
  48. package/es/components/DataTable/TableToolbarMenu.js +3 -6
  49. package/es/components/DataTable/TableToolbarSearch.js +2 -30
  50. package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
  51. package/es/components/DataTable/state/sorting.js +5 -8
  52. package/es/components/DataTable/tools/denormalize.js +2 -2
  53. package/es/components/DataTable/tools/filter.js +0 -2
  54. package/es/components/DataTable/tools/instanceId.js +0 -1
  55. package/es/components/DataTable/tools/normalize.js +10 -10
  56. package/es/components/DataTable/tools/sorting.js +5 -13
  57. package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
  58. package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
  59. package/es/components/DatePicker/DatePicker.js +154 -177
  60. package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
  61. package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
  62. package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
  63. package/es/components/DatePickerInput/DatePickerInput.js +2 -28
  64. package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
  65. package/es/components/Dropdown/Dropdown.js +43 -52
  66. package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
  67. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
  68. package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
  69. package/es/components/FeatureFlags/index.js +8 -20
  70. package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
  71. package/es/components/FileUploader/FileUploader.js +3 -38
  72. package/es/components/FileUploader/FileUploaderButton.js +3 -24
  73. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
  74. package/es/components/FileUploader/FileUploaderItem.js +1 -11
  75. package/es/components/FileUploader/Filename.js +0 -10
  76. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
  77. package/es/components/FluidComboBox/FluidComboBox.js +0 -18
  78. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
  79. package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
  80. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
  81. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
  82. package/es/components/FluidDropdown/FluidDropdown.js +0 -18
  83. package/es/components/FluidForm/FluidForm.js +0 -2
  84. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
  85. package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
  86. package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
  87. package/es/components/FluidSelect/FluidSelect.js +0 -10
  88. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
  89. package/es/components/FluidTextArea/FluidTextArea.js +0 -20
  90. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
  91. package/es/components/FluidTextInput/FluidTextInput.js +0 -14
  92. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
  93. package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
  94. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
  95. package/es/components/Form/Form.d.ts +23 -0
  96. package/es/components/Form/Form.js +3 -6
  97. package/es/components/Form/index.d.ts +7 -0
  98. package/es/components/FormGroup/FormGroup.js +0 -7
  99. package/es/components/FormItem/FormItem.js +0 -2
  100. package/es/components/FormLabel/FormLabel.js +1 -7
  101. package/es/components/Grid/CSSGrid.js +2 -15
  102. package/es/components/Grid/Column.js +18 -59
  103. package/es/components/Grid/ColumnHang.js +2 -5
  104. package/es/components/Grid/FlexGrid.js +2 -8
  105. package/es/components/Grid/Grid.js +0 -8
  106. package/es/components/Grid/GridContext.js +1 -3
  107. package/es/components/Grid/Row.js +2 -7
  108. package/es/components/Heading/index.js +0 -4
  109. package/es/components/Icon/Icon.Skeleton.js +2 -2
  110. package/es/components/IconButton/index.js +0 -10
  111. package/es/components/IdPrefix/index.js +0 -2
  112. package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
  113. package/es/components/InlineLoading/InlineLoading.js +0 -12
  114. package/es/components/Layer/index.js +3 -6
  115. package/es/components/Layout/LayoutDirection.js +0 -3
  116. package/es/components/Layout/useLayoutDirection.js +0 -1
  117. package/es/components/Link/Link.js +3 -10
  118. package/es/components/ListBox/ListBox.js +2 -13
  119. package/es/components/ListBox/ListBoxField.js +0 -5
  120. package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
  121. package/es/components/ListBox/ListBoxMenuItem.js +2 -6
  122. package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
  123. package/es/components/ListBox/ListBoxSelection.js +1 -13
  124. package/es/components/ListBox/next/ListBoxSelection.js +1 -14
  125. package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
  126. package/es/components/ListItem/ListItem.d.ts +23 -0
  127. package/es/components/ListItem/ListItem.js +4 -8
  128. package/es/components/ListItem/index.d.ts +7 -0
  129. package/es/components/Loading/Loading.js +0 -6
  130. package/es/components/Menu/Menu.js +22 -40
  131. package/es/components/Menu/MenuContext.js +4 -5
  132. package/es/components/Menu/MenuItem.js +5 -39
  133. package/es/components/MenuButton/index.js +0 -9
  134. package/es/components/Modal/Modal.js +0 -43
  135. package/es/components/ModalWrapper/ModalWrapper.js +2 -15
  136. package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
  137. package/es/components/MultiSelect/MultiSelect.js +22 -70
  138. package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
  139. package/es/components/MultiSelect/index.js +0 -1
  140. package/es/components/MultiSelect/tools/itemToString.js +0 -2
  141. package/es/components/MultiSelect/tools/sorting.js +3 -4
  142. package/es/components/Notification/Notification.js +0 -78
  143. package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
  144. package/es/components/NumberInput/NumberInput.js +3 -60
  145. package/es/components/OrderedList/OrderedList.d.ts +39 -0
  146. package/es/components/OrderedList/OrderedList.js +7 -19
  147. package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
  148. package/es/components/OverflowMenu/OverflowMenu.js +65 -86
  149. package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
  150. package/es/components/OverflowMenuV2/index.js +0 -5
  151. package/es/components/Pagination/Pagination.Skeleton.js +0 -2
  152. package/es/components/Pagination/Pagination.js +11 -47
  153. package/es/components/Pagination/experimental/PageSelector.js +0 -10
  154. package/es/components/Pagination/experimental/Pagination.js +2 -48
  155. package/es/components/PaginationNav/PaginationNav.js +15 -59
  156. package/es/components/Popover/index.d.ts +14 -8
  157. package/es/components/Popover/index.js +44 -48
  158. package/es/components/PrimaryButton/PrimaryButton.js +0 -1
  159. package/es/components/ProgressBar/ProgressBar.js +0 -15
  160. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
  161. package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
  162. package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
  163. package/es/components/RadioButton/RadioButton.js +0 -13
  164. package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
  165. package/es/components/RadioTile/RadioTile.js +0 -12
  166. package/es/components/Search/Search.Skeleton.js +0 -2
  167. package/es/components/Search/Search.js +1 -28
  168. package/es/components/SecondaryButton/SecondaryButton.js +0 -1
  169. package/es/components/Select/Select.Skeleton.js +0 -2
  170. package/es/components/Select/Select.d.ts +1 -1
  171. package/es/components/Select/Select.js +6 -33
  172. package/es/components/SelectItem/SelectItem.js +0 -5
  173. package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
  174. package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
  175. package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
  176. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
  177. package/es/components/SkeletonText/SkeletonText.js +0 -12
  178. package/es/components/Slider/Slider.Skeleton.js +0 -2
  179. package/es/components/Slider/Slider.d.ts +0 -1
  180. package/es/components/Slider/Slider.js +112 -135
  181. package/es/components/Stack/Stack.js +1 -8
  182. package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
  183. package/es/components/StructuredList/StructuredList.js +1 -25
  184. package/es/components/Switch/IconSwitch.js +0 -18
  185. package/es/components/Switch/Switch.js +0 -11
  186. package/es/components/TabContent/TabContent.js +2 -6
  187. package/es/components/Tabs/Tabs.Skeleton.js +0 -4
  188. package/es/components/Tabs/Tabs.js +135 -104
  189. package/es/components/Tabs/usePressable.js +18 -31
  190. package/es/components/Tag/Tag.Skeleton.js +0 -2
  191. package/es/components/Tag/Tag.js +0 -15
  192. package/es/components/Text/Text.js +5 -18
  193. package/es/components/Text/TextDirection.js +0 -3
  194. package/es/components/Text/TextDirectionContext.js +0 -1
  195. package/es/components/Text/createTextComponent.js +0 -3
  196. package/es/components/TextArea/TextArea.Skeleton.js +0 -2
  197. package/es/components/TextArea/TextArea.js +11 -33
  198. package/es/components/TextInput/ControlledPasswordInput.js +0 -20
  199. package/es/components/TextInput/PasswordInput.js +0 -25
  200. package/es/components/TextInput/TextInput.Skeleton.js +0 -2
  201. package/es/components/TextInput/TextInput.d.ts +1 -1
  202. package/es/components/TextInput/TextInput.js +5 -33
  203. package/es/components/TextInput/util.js +3 -5
  204. package/es/components/Theme/index.js +1 -6
  205. package/es/components/Tile/Tile.js +32 -59
  206. package/es/components/TileGroup/TileGroup.js +1 -22
  207. package/es/components/TimePicker/TimePicker.js +6 -32
  208. package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
  209. package/es/components/Toggle/Toggle.Skeleton.js +0 -8
  210. package/es/components/Toggle/Toggle.js +0 -16
  211. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
  212. package/es/components/Toggletip/index.d.ts +148 -0
  213. package/es/components/Toggletip/index.js +20 -44
  214. package/es/components/Tooltip/DefinitionTooltip.js +0 -11
  215. package/es/components/Tooltip/Tooltip.d.ts +1 -1
  216. package/es/components/Tooltip/Tooltip.js +4 -21
  217. package/es/components/TreeView/TreeNode.js +21 -66
  218. package/es/components/TreeView/TreeView.js +11 -67
  219. package/es/components/UIShell/Content.js +2 -4
  220. package/es/components/UIShell/Header.js +0 -2
  221. package/es/components/UIShell/HeaderContainer.d.ts +33 -0
  222. package/es/components/UIShell/HeaderContainer.js +13 -11
  223. package/es/components/UIShell/HeaderGlobalAction.js +0 -6
  224. package/es/components/UIShell/HeaderGlobalBar.js +0 -1
  225. package/es/components/UIShell/HeaderMenu.js +32 -31
  226. package/es/components/UIShell/HeaderMenuButton.js +2 -4
  227. package/es/components/UIShell/HeaderMenuItem.js +0 -8
  228. package/es/components/UIShell/HeaderName.js +0 -5
  229. package/es/components/UIShell/HeaderNavigation.js +0 -2
  230. package/es/components/UIShell/HeaderPanel.js +0 -2
  231. package/es/components/UIShell/HeaderSideNavItems.js +0 -2
  232. package/es/components/UIShell/Link.js +2 -3
  233. package/es/components/UIShell/SideNav.d.ts +3 -1
  234. package/es/components/UIShell/SideNav.js +44 -36
  235. package/es/components/UIShell/SideNavDetails.js +0 -3
  236. package/es/components/UIShell/SideNavDivider.js +0 -1
  237. package/es/components/UIShell/SideNavFooter.js +1 -4
  238. package/es/components/UIShell/SideNavHeader.js +0 -4
  239. package/es/components/UIShell/SideNavIcon.js +0 -3
  240. package/es/components/UIShell/SideNavItem.js +0 -3
  241. package/es/components/UIShell/SideNavItems.js +2 -6
  242. package/es/components/UIShell/SideNavLink.js +3 -7
  243. package/es/components/UIShell/SideNavLinkText.js +0 -2
  244. package/es/components/UIShell/SideNavMenu.js +0 -16
  245. package/es/components/UIShell/SideNavMenuItem.js +0 -2
  246. package/es/components/UIShell/SideNavSwitcher.js +2 -5
  247. package/es/components/UIShell/SkipToContent.d.ts +32 -0
  248. package/es/components/UIShell/SkipToContent.js +8 -15
  249. package/es/components/UIShell/Switcher.js +0 -2
  250. package/es/components/UIShell/SwitcherDivider.js +0 -1
  251. package/es/components/UIShell/SwitcherItem.js +0 -3
  252. package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
  253. package/es/components/UnorderedList/UnorderedList.js +6 -16
  254. package/es/components/UnorderedList/index.d.ts +7 -0
  255. package/es/index.js +7 -8
  256. package/es/internal/ClickListener.js +3 -13
  257. package/es/internal/FloatingMenu.js +57 -63
  258. package/es/internal/OptimizedResize.js +6 -12
  259. package/es/internal/Selection.js +2 -25
  260. package/es/internal/createClassWrapper.js +0 -2
  261. package/es/internal/deprecateFieldOnObject.js +0 -4
  262. package/es/internal/focus/index.js +0 -1
  263. package/es/internal/keyboard/keys.js +2 -1
  264. package/es/internal/keyboard/match.js +1 -6
  265. package/es/internal/keyboard/navigation.js +8 -7
  266. package/es/internal/useAnnouncer.js +0 -1
  267. package/es/internal/useAttachedMenu.js +1 -9
  268. package/es/internal/useControllableState.js +6 -13
  269. package/es/internal/useDelayedState.js +2 -4
  270. package/es/internal/useEffectOnce.js +0 -1
  271. package/es/internal/useEvent.js +61 -3
  272. package/es/internal/useId.js +2 -5
  273. package/es/internal/useIsomorphicEffect.js +1 -0
  274. package/es/internal/useMergedRefs.js +2 -2
  275. package/es/internal/useNoInteractiveChildren.js +2 -13
  276. package/es/internal/useNormalizedInputProps.js +0 -3
  277. package/es/internal/useSavedCallback.js +1 -2
  278. package/es/internal/warning.js +0 -3
  279. package/es/internal/wrapFocus.js +1 -8
  280. package/es/prop-types/deprecate.js +2 -5
  281. package/es/prop-types/isRequiredOneOf.js +2 -5
  282. package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
  283. package/es/tools/array.js +0 -3
  284. package/es/tools/events.js +0 -3
  285. package/es/tools/mergeRefs.js +0 -2
  286. package/es/tools/wrapComponent.js +2 -5
  287. package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
  288. package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
  289. package/lib/components/Accordion/Accordion.js +1 -27
  290. package/lib/components/Accordion/AccordionItem.js +5 -19
  291. package/lib/components/AspectRatio/AspectRatio.js +0 -5
  292. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
  293. package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
  294. package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
  295. package/lib/components/Button/Button.Skeleton.js +2 -26
  296. package/lib/components/Button/Button.js +2 -36
  297. package/lib/components/ButtonSet/ButtonSet.js +0 -2
  298. package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
  299. package/lib/components/Checkbox/Checkbox.js +4 -20
  300. package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
  301. package/lib/components/ClassPrefix/index.d.ts +26 -0
  302. package/lib/components/ClassPrefix/index.js +0 -2
  303. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
  304. package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
  305. package/lib/components/ComboBox/ComboBox.js +19 -86
  306. package/lib/components/ComboBox/tools/filter.js +0 -1
  307. package/lib/components/ComboButton/index.js +0 -14
  308. package/lib/components/ComposedModal/ComposedModal.js +2 -32
  309. package/lib/components/ComposedModal/ModalFooter.js +0 -21
  310. package/lib/components/ComposedModal/ModalHeader.js +0 -12
  311. package/lib/components/ContainedList/ContainedList.js +5 -32
  312. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
  313. package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
  314. package/lib/components/ContextMenu/useContextMenu.js +1 -6
  315. package/lib/components/Copy/Copy.js +8 -50
  316. package/lib/components/CopyButton/CopyButton.js +0 -4
  317. package/lib/components/DangerButton/DangerButton.js +0 -1
  318. package/lib/components/DataTable/DataTable.js +171 -91
  319. package/lib/components/DataTable/Table.js +0 -6
  320. package/lib/components/DataTable/TableBatchAction.js +0 -4
  321. package/lib/components/DataTable/TableBatchActions.js +0 -8
  322. package/lib/components/DataTable/TableBody.js +0 -1
  323. package/lib/components/DataTable/TableContainer.js +0 -5
  324. package/lib/components/DataTable/TableExpandHeader.js +0 -7
  325. package/lib/components/DataTable/TableExpandRow.js +0 -6
  326. package/lib/components/DataTable/TableExpandedRow.js +0 -6
  327. package/lib/components/DataTable/TableHeader.d.ts +1 -1
  328. package/lib/components/DataTable/TableHeader.js +3 -19
  329. package/lib/components/DataTable/TableRow.js +4 -5
  330. package/lib/components/DataTable/TableSelectAll.js +0 -8
  331. package/lib/components/DataTable/TableSelectRow.js +2 -10
  332. package/lib/components/DataTable/TableToolbar.js +0 -3
  333. package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
  334. package/lib/components/DataTable/TableToolbarMenu.js +3 -6
  335. package/lib/components/DataTable/TableToolbarSearch.js +2 -30
  336. package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
  337. package/lib/components/DataTable/state/sorting.js +5 -8
  338. package/lib/components/DataTable/tools/denormalize.js +2 -2
  339. package/lib/components/DataTable/tools/filter.js +0 -2
  340. package/lib/components/DataTable/tools/instanceId.js +0 -1
  341. package/lib/components/DataTable/tools/normalize.js +10 -10
  342. package/lib/components/DataTable/tools/sorting.js +5 -13
  343. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
  344. package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
  345. package/lib/components/DatePicker/DatePicker.js +154 -177
  346. package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
  347. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
  348. package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
  349. package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
  350. package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
  351. package/lib/components/Dropdown/Dropdown.js +50 -59
  352. package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
  353. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
  354. package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
  355. package/lib/components/FeatureFlags/index.js +8 -20
  356. package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
  357. package/lib/components/FileUploader/FileUploader.js +3 -57
  358. package/lib/components/FileUploader/FileUploaderButton.js +3 -43
  359. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
  360. package/lib/components/FileUploader/FileUploaderItem.js +1 -30
  361. package/lib/components/FileUploader/Filename.js +0 -10
  362. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
  363. package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
  364. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
  365. package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
  366. package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
  367. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
  368. package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
  369. package/lib/components/FluidForm/FluidForm.js +0 -2
  370. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
  371. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
  372. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
  373. package/lib/components/FluidSelect/FluidSelect.js +0 -10
  374. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
  375. package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
  376. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
  377. package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
  378. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
  379. package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
  380. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
  381. package/lib/components/Form/Form.d.ts +23 -0
  382. package/lib/components/Form/Form.js +3 -6
  383. package/lib/components/Form/index.d.ts +7 -0
  384. package/lib/components/FormGroup/FormGroup.js +0 -7
  385. package/lib/components/FormItem/FormItem.js +0 -2
  386. package/lib/components/FormLabel/FormLabel.js +1 -26
  387. package/lib/components/Grid/CSSGrid.js +2 -15
  388. package/lib/components/Grid/Column.js +18 -59
  389. package/lib/components/Grid/ColumnHang.js +2 -5
  390. package/lib/components/Grid/FlexGrid.js +2 -8
  391. package/lib/components/Grid/Grid.js +0 -8
  392. package/lib/components/Grid/GridContext.js +1 -3
  393. package/lib/components/Grid/Row.js +2 -7
  394. package/lib/components/Heading/index.js +0 -4
  395. package/lib/components/Icon/Icon.Skeleton.js +2 -2
  396. package/lib/components/IconButton/index.js +0 -10
  397. package/lib/components/IdPrefix/index.js +0 -2
  398. package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
  399. package/lib/components/InlineLoading/InlineLoading.js +0 -12
  400. package/lib/components/Layer/index.js +3 -6
  401. package/lib/components/Layout/LayoutDirection.js +0 -3
  402. package/lib/components/Layout/useLayoutDirection.js +0 -1
  403. package/lib/components/Link/Link.js +3 -10
  404. package/lib/components/ListBox/ListBox.js +2 -13
  405. package/lib/components/ListBox/ListBoxField.js +0 -5
  406. package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
  407. package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
  408. package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
  409. package/lib/components/ListBox/ListBoxSelection.js +1 -13
  410. package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
  411. package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
  412. package/lib/components/ListItem/ListItem.d.ts +23 -0
  413. package/lib/components/ListItem/ListItem.js +4 -8
  414. package/lib/components/ListItem/index.d.ts +7 -0
  415. package/lib/components/Loading/Loading.js +0 -6
  416. package/lib/components/Menu/Menu.js +22 -40
  417. package/lib/components/Menu/MenuContext.js +4 -5
  418. package/lib/components/Menu/MenuItem.js +5 -39
  419. package/lib/components/MenuButton/index.js +0 -9
  420. package/lib/components/Modal/Modal.js +0 -43
  421. package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
  422. package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
  423. package/lib/components/MultiSelect/MultiSelect.js +30 -78
  424. package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
  425. package/lib/components/MultiSelect/index.js +0 -1
  426. package/lib/components/MultiSelect/tools/itemToString.js +0 -2
  427. package/lib/components/MultiSelect/tools/sorting.js +3 -4
  428. package/lib/components/Notification/Notification.js +0 -78
  429. package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
  430. package/lib/components/NumberInput/NumberInput.js +3 -60
  431. package/lib/components/OrderedList/OrderedList.d.ts +39 -0
  432. package/lib/components/OrderedList/OrderedList.js +7 -19
  433. package/lib/components/OrderedList/index.d.ts +7 -0
  434. package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
  435. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
  436. package/lib/components/OverflowMenuV2/index.js +0 -5
  437. package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
  438. package/lib/components/Pagination/Pagination.js +11 -47
  439. package/lib/components/Pagination/experimental/PageSelector.js +0 -10
  440. package/lib/components/Pagination/experimental/Pagination.js +2 -67
  441. package/lib/components/PaginationNav/PaginationNav.js +15 -78
  442. package/lib/components/Popover/index.d.ts +14 -8
  443. package/lib/components/Popover/index.js +44 -48
  444. package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
  445. package/lib/components/ProgressBar/ProgressBar.js +0 -15
  446. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
  447. package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
  448. package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
  449. package/lib/components/RadioButton/RadioButton.js +0 -13
  450. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
  451. package/lib/components/RadioTile/RadioTile.js +0 -12
  452. package/lib/components/Search/Search.Skeleton.js +0 -2
  453. package/lib/components/Search/Search.js +1 -28
  454. package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
  455. package/lib/components/Select/Select.Skeleton.js +0 -2
  456. package/lib/components/Select/Select.d.ts +1 -1
  457. package/lib/components/Select/Select.js +6 -33
  458. package/lib/components/SelectItem/SelectItem.js +0 -5
  459. package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
  460. package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
  461. package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
  462. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
  463. package/lib/components/SkeletonText/SkeletonText.js +0 -12
  464. package/lib/components/Slider/Slider.Skeleton.js +0 -2
  465. package/lib/components/Slider/Slider.d.ts +0 -1
  466. package/lib/components/Slider/Slider.js +112 -154
  467. package/lib/components/Stack/Stack.js +1 -8
  468. package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
  469. package/lib/components/StructuredList/StructuredList.js +1 -25
  470. package/lib/components/Switch/IconSwitch.js +0 -18
  471. package/lib/components/Switch/Switch.js +0 -11
  472. package/lib/components/TabContent/TabContent.js +2 -6
  473. package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
  474. package/lib/components/Tabs/Tabs.js +133 -102
  475. package/lib/components/Tabs/usePressable.js +18 -31
  476. package/lib/components/Tag/Tag.Skeleton.js +0 -2
  477. package/lib/components/Tag/Tag.js +0 -15
  478. package/lib/components/Text/Text.js +5 -18
  479. package/lib/components/Text/TextDirection.js +0 -3
  480. package/lib/components/Text/TextDirectionContext.js +0 -1
  481. package/lib/components/Text/createTextComponent.js +0 -3
  482. package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
  483. package/lib/components/TextArea/TextArea.js +10 -32
  484. package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
  485. package/lib/components/TextInput/PasswordInput.js +0 -25
  486. package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
  487. package/lib/components/TextInput/TextInput.d.ts +1 -1
  488. package/lib/components/TextInput/TextInput.js +5 -52
  489. package/lib/components/TextInput/util.js +3 -5
  490. package/lib/components/Theme/index.js +1 -6
  491. package/lib/components/Tile/Tile.js +31 -58
  492. package/lib/components/TileGroup/TileGroup.js +1 -22
  493. package/lib/components/TimePicker/TimePicker.js +6 -32
  494. package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
  495. package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
  496. package/lib/components/Toggle/Toggle.js +0 -16
  497. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
  498. package/lib/components/Toggletip/index.d.ts +148 -0
  499. package/lib/components/Toggletip/index.js +20 -44
  500. package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
  501. package/lib/components/Tooltip/Tooltip.d.ts +1 -1
  502. package/lib/components/Tooltip/Tooltip.js +4 -21
  503. package/lib/components/TreeView/TreeNode.js +21 -66
  504. package/lib/components/TreeView/TreeView.js +11 -67
  505. package/lib/components/UIShell/Content.js +2 -4
  506. package/lib/components/UIShell/Header.js +0 -2
  507. package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
  508. package/lib/components/UIShell/HeaderContainer.js +13 -11
  509. package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
  510. package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
  511. package/lib/components/UIShell/HeaderMenu.js +32 -31
  512. package/lib/components/UIShell/HeaderMenuButton.js +2 -4
  513. package/lib/components/UIShell/HeaderMenuItem.js +0 -8
  514. package/lib/components/UIShell/HeaderName.js +0 -5
  515. package/lib/components/UIShell/HeaderNavigation.js +0 -2
  516. package/lib/components/UIShell/HeaderPanel.js +0 -2
  517. package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
  518. package/lib/components/UIShell/Link.js +2 -3
  519. package/lib/components/UIShell/SideNav.d.ts +3 -1
  520. package/lib/components/UIShell/SideNav.js +43 -35
  521. package/lib/components/UIShell/SideNavDetails.js +0 -3
  522. package/lib/components/UIShell/SideNavDivider.js +0 -1
  523. package/lib/components/UIShell/SideNavFooter.js +1 -4
  524. package/lib/components/UIShell/SideNavHeader.js +0 -4
  525. package/lib/components/UIShell/SideNavIcon.js +0 -3
  526. package/lib/components/UIShell/SideNavItem.js +0 -3
  527. package/lib/components/UIShell/SideNavItems.js +2 -6
  528. package/lib/components/UIShell/SideNavLink.js +3 -7
  529. package/lib/components/UIShell/SideNavLinkText.js +0 -2
  530. package/lib/components/UIShell/SideNavMenu.js +0 -16
  531. package/lib/components/UIShell/SideNavMenuItem.js +0 -2
  532. package/lib/components/UIShell/SideNavSwitcher.js +2 -5
  533. package/lib/components/UIShell/SkipToContent.d.ts +32 -0
  534. package/lib/components/UIShell/SkipToContent.js +8 -15
  535. package/lib/components/UIShell/Switcher.js +0 -2
  536. package/lib/components/UIShell/SwitcherDivider.js +0 -1
  537. package/lib/components/UIShell/SwitcherItem.js +0 -3
  538. package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
  539. package/lib/components/UnorderedList/UnorderedList.js +6 -16
  540. package/lib/components/UnorderedList/index.d.ts +7 -0
  541. package/lib/index.js +42 -43
  542. package/lib/internal/ClickListener.js +3 -13
  543. package/lib/internal/FloatingMenu.js +57 -63
  544. package/lib/internal/OptimizedResize.js +6 -12
  545. package/lib/internal/Selection.js +2 -25
  546. package/lib/internal/createClassWrapper.js +0 -2
  547. package/lib/internal/deprecateFieldOnObject.js +0 -4
  548. package/lib/internal/focus/index.js +0 -1
  549. package/lib/internal/keyboard/keys.js +2 -1
  550. package/lib/internal/keyboard/match.js +1 -6
  551. package/lib/internal/keyboard/navigation.js +8 -7
  552. package/lib/internal/useAnnouncer.js +0 -1
  553. package/lib/internal/useAttachedMenu.js +1 -9
  554. package/lib/internal/useControllableState.js +6 -13
  555. package/lib/internal/useDelayedState.js +2 -4
  556. package/lib/internal/useEffectOnce.js +0 -1
  557. package/lib/internal/useEvent.js +61 -2
  558. package/lib/internal/useId.js +2 -5
  559. package/lib/internal/useIsomorphicEffect.js +1 -0
  560. package/lib/internal/useMergedRefs.js +2 -2
  561. package/lib/internal/useNoInteractiveChildren.js +2 -13
  562. package/lib/internal/useNormalizedInputProps.js +0 -3
  563. package/lib/internal/useSavedCallback.js +1 -2
  564. package/lib/internal/warning.js +0 -3
  565. package/lib/internal/wrapFocus.js +1 -8
  566. package/lib/prop-types/deprecate.js +2 -5
  567. package/lib/prop-types/isRequiredOneOf.js +2 -5
  568. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
  569. package/lib/tools/array.js +0 -3
  570. package/lib/tools/events.js +0 -3
  571. package/lib/tools/mergeRefs.js +0 -2
  572. package/lib/tools/wrapComponent.js +2 -5
  573. package/package.json +9 -9
  574. package/es/components/Tab/Tab.js +0 -185
  575. package/es/components/Tab/index.js +0 -14
  576. package/es/components/TimePickerSelect/index.js +0 -13
  577. package/lib/components/Form/index.js +0 -17
  578. package/lib/components/Tab/Tab.js +0 -214
  579. package/lib/components/Tab/index.js +0 -39
  580. package/lib/components/TimePickerSelect/index.js +0 -38
@@ -20,15 +20,12 @@ const translationKeys = {
20
20
  'carbon.table.batch.items.selected': 'items selected',
21
21
  'carbon.table.batch.item.selected': 'item selected'
22
22
  };
23
-
24
23
  const translateWithId = (id, state) => {
25
24
  if (id === 'carbon.table.batch.cancel') {
26
25
  return translationKeys[id];
27
26
  }
28
-
29
27
  return `${state.totalSelected} ${translationKeys[id]}`;
30
28
  };
31
-
32
29
  const TableBatchActions = _ref => {
33
30
  let {
34
31
  className,
@@ -70,30 +67,25 @@ const TableBatchActions = _ref => {
70
67
  onClick: onCancel
71
68
  }, t('carbon.table.batch.cancel'))));
72
69
  };
73
-
74
70
  TableBatchActions.translationKeys = Object.keys(translationKeys);
75
71
  TableBatchActions.propTypes = {
76
72
  children: PropTypes.node,
77
73
  className: PropTypes.string,
78
-
79
74
  /**
80
75
  * Hook required to listen for when the user initiates a cancel request
81
76
  * through this component
82
77
  */
83
78
  onCancel: PropTypes.func.isRequired,
84
-
85
79
  /**
86
80
  * Boolean specifier for whether or not the batch action bar should be
87
81
  * displayed
88
82
  */
89
83
  shouldShowBatchActions: PropTypes.bool,
90
-
91
84
  /**
92
85
  * Numeric representation of the total number of items selected in a table.
93
86
  * This number is used to derive the selection message
94
87
  */
95
88
  totalSelected: PropTypes.number.isRequired,
96
-
97
89
  /**
98
90
  * Supply a method to translate internal strings with your i18n tool of
99
91
  * choice. Translation keys are available on the `translationKeys` field for
@@ -19,7 +19,6 @@ const TableBody = _ref => {
19
19
  className: className
20
20
  }, rest), children);
21
21
  };
22
-
23
22
  TableBody.propTypes = {
24
23
  /**
25
24
  * `polite` Adjust the notification behavior of screen readers
@@ -51,26 +51,21 @@ const TableContainer = _ref => {
51
51
  id: descriptionId
52
52
  }, description)), children));
53
53
  };
54
-
55
54
  TableContainer.propTypes = {
56
55
  children: PropTypes.node,
57
56
  className: PropTypes.string,
58
-
59
57
  /**
60
58
  * Optional description text for the Table
61
59
  */
62
60
  description: PropTypes.node,
63
-
64
61
  /**
65
62
  * Specify whether the table should have a sticky header
66
63
  */
67
64
  stickyHeader: PropTypes.bool,
68
-
69
65
  /**
70
66
  * Provide a title for the Table
71
67
  */
72
68
  title: PropTypes.node,
73
-
74
69
  /**
75
70
  * If true, will use a width of 'fit-content' to match the inner table width
76
71
  */
@@ -46,7 +46,6 @@ const TableExpandHeader = _ref => {
46
46
  "aria-label": expandIconDescription
47
47
  })) : null, children);
48
48
  };
49
-
50
49
  TableExpandHeader.propTypes = {
51
50
  /**
52
51
  * Specify the string read by a voice reader when the expand trigger is
@@ -55,33 +54,27 @@ TableExpandHeader.propTypes = {
55
54
  ariaLabel: PropTypes.oneOfType([requiredIfGivenPropIsTruthy('enableExpando', PropTypes.string), requiredIfGivenPropIsTruthy('enableToggle', PropTypes.string)]),
56
55
  children: PropTypes.node,
57
56
  className: PropTypes.string,
58
-
59
57
  /**
60
58
  * The enableExpando prop is being replaced by enableToggle
61
59
  */
62
60
  enableExpando: deprecate(PropTypes.bool, 'The `enableExpando` prop has been deprecated in favor of `enableToggle`. This prop will be removed in the next major release.'),
63
-
64
61
  /**
65
62
  * Specify whether an expand all button should be displayed
66
63
  */
67
64
  enableToggle: PropTypes.bool,
68
-
69
65
  /**
70
66
  * The description of the chevron right icon, to be put in its SVG `<title>` element.
71
67
  */
72
68
  expandIconDescription: PropTypes.string,
73
-
74
69
  /**
75
70
  * Supply an id to the th element.
76
71
  */
77
72
  id: PropTypes.string,
78
-
79
73
  /**
80
74
  * Specify whether this row is expanded or not. This helps coordinate data
81
75
  * attributes so that `TableExpandRow` and `TableExpandedRow` work together
82
76
  */
83
77
  isExpanded: requiredIfGivenPropIsTruthy('enableToggle', PropTypes.bool),
84
-
85
78
  /**
86
79
  * Hook for when a listener initiates a request to expand the given row
87
80
  */
@@ -50,7 +50,6 @@ const TableExpandRow = _ref => {
50
50
  "aria-label": expandIconDescription
51
51
  }))), children);
52
52
  };
53
-
54
53
  TableExpandRow.propTypes = {
55
54
  /**
56
55
  * Specify the string read by a voice reader when the expand trigger is
@@ -59,28 +58,23 @@ TableExpandRow.propTypes = {
59
58
  ariaLabel: PropTypes.string.isRequired,
60
59
  children: PropTypes.node,
61
60
  className: PropTypes.string,
62
-
63
61
  /**
64
62
  * The id of the matching th node in the table head. Addresses a11y concerns outlined here: https://www.ibm.com/able/guidelines/ci162/info_and_relationships.html and https://www.w3.org/TR/WCAG20-TECHS/H43
65
63
  */
66
64
  expandHeader: PropTypes.string,
67
-
68
65
  /**
69
66
  * The description of the chevron right icon, to be put in its SVG `<title>` element.
70
67
  */
71
68
  expandIconDescription: PropTypes.string,
72
-
73
69
  /**
74
70
  * Specify whether this row is expanded or not. This helps coordinate data
75
71
  * attributes so that `TableExpandRow` and `TableExpandedRow` work together
76
72
  */
77
73
  isExpanded: PropTypes.bool.isRequired,
78
-
79
74
  /**
80
75
  * Specify if the row is selected
81
76
  */
82
77
  isSelected: PropTypes.bool,
83
-
84
78
  /**
85
79
  * Hook for when a listener initiates a request to expand the given row
86
80
  */
@@ -22,11 +22,9 @@ const TableExpandedRow = _ref => {
22
22
  const rowRef = useRef(null);
23
23
  const prefix = usePrefix();
24
24
  const className = cx(`${prefix}--expandable-row`, customClassName);
25
-
26
25
  const toggleParentHoverClass = eventType => {
27
26
  if (rowRef && rowRef.current && rowRef.current.previousElementSibling) {
28
27
  const parentNode = rowRef.current.previousElementSibling;
29
-
30
28
  if (eventType === 'enter') {
31
29
  parentNode.classList.add(`${prefix}--expandable-row--hover`);
32
30
  } else {
@@ -34,7 +32,6 @@ const TableExpandedRow = _ref => {
34
32
  }
35
33
  }
36
34
  };
37
-
38
35
  return /*#__PURE__*/React__default.createElement("tr", _extends({
39
36
  ref: rowRef,
40
37
  onMouseEnter: () => toggleParentHoverClass('enter'),
@@ -48,18 +45,15 @@ const TableExpandedRow = _ref => {
48
45
  className: `${prefix}--child-row-inner-container`
49
46
  }, children)));
50
47
  };
51
-
52
48
  TableExpandedRow.propTypes = {
53
49
  /**
54
50
  * Pass in the contents for your TableExpandedRow
55
51
  */
56
52
  children: PropTypes.node,
57
-
58
53
  /**
59
54
  * Specify an optional className to be applied to the container node
60
55
  */
61
56
  className: PropTypes.string,
62
-
63
57
  /**
64
58
  * The width of the expanded row's internal cell
65
59
  */
@@ -42,7 +42,7 @@ interface TableHeaderProps extends ReactAttr<HTMLTableCellElement & HTMLButtonEl
42
42
  * attribute at the following URL:
43
43
  * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope
44
44
  */
45
- scope: string;
45
+ scope?: string;
46
46
  /**
47
47
  * Specify which direction we are currently sorting by, should be one of DESC,
48
48
  * NONE, or ASC.
@@ -15,10 +15,10 @@ import { useId } from '../../internal/useId.js';
15
15
  import { usePrefix } from '../../internal/usePrefix.js';
16
16
  import { sortStates } from './state/sortStates.js';
17
17
 
18
+ const defaultScope = 'col';
18
19
  const translationKeys = {
19
20
  buttonDescription: 'carbon.table.header.icon.description'
20
21
  };
21
-
22
22
  const translateWithId = (key, args) => {
23
23
  if (args && key === translationKeys.buttonDescription) {
24
24
  if (args.isSortHeader && sortStates) {
@@ -27,20 +27,15 @@ const translateWithId = (key, args) => {
27
27
  if (args.sortDirection === sortStates.NONE) {
28
28
  return `Click to sort rows by ${args.header} header in ascending order`;
29
29
  }
30
-
31
30
  if (args.sortDirection === sortStates.ASC) {
32
31
  return `Click to sort rows by ${args.header} header in descending order`;
33
32
  }
34
-
35
33
  return `Click to unsort rows by ${args.header} header`;
36
34
  }
37
-
38
35
  return `Click to sort rows by ${args.header} header in ascending order`;
39
36
  }
40
-
41
37
  return '';
42
38
  };
43
-
44
39
  const sortDirections = {
45
40
  [sortStates.NONE]: 'none',
46
41
  [sortStates.ASC]: 'ascending',
@@ -54,7 +49,7 @@ const TableHeader = /*#__PURE__*/React__default.forwardRef(function TableHeader(
54
49
  isSortable,
55
50
  isSortHeader,
56
51
  onClick,
57
- scope,
52
+ scope = defaultScope,
58
53
  sortDirection,
59
54
  translateWithId: t,
60
55
  id,
@@ -62,7 +57,6 @@ const TableHeader = /*#__PURE__*/React__default.forwardRef(function TableHeader(
62
57
  } = _ref;
63
58
  const prefix = usePrefix();
64
59
  const uniqueId = useId('table-sort');
65
-
66
60
  if (!isSortable) {
67
61
  return /*#__PURE__*/React__default.createElement("th", _extends({}, rest, {
68
62
  id: id,
@@ -74,7 +68,6 @@ const TableHeader = /*#__PURE__*/React__default.forwardRef(function TableHeader(
74
68
  className: `${prefix}--table-header-label`
75
69
  }, children) : null);
76
70
  }
77
-
78
71
  const className = cx(headerClassName, {
79
72
  [`${prefix}--table-sort`]: true,
80
73
  [`${prefix}--table-sort--active`]: isSortHeader && sortDirection !== sortStates.NONE,
@@ -119,52 +112,43 @@ TableHeader.propTypes = {
119
112
  * Pass in children that will be embedded in the table header label
120
113
  */
121
114
  children: PropTypes.node,
122
-
123
115
  /**
124
116
  * Specify an optional className to be applied to the container node
125
117
  */
126
118
  className: PropTypes.string,
127
-
128
119
  /**
129
120
  * Specify `colSpan` as a non-negative integer value to indicate how
130
121
  * many columns the TableHeader cell extends in a table
131
122
  */
132
123
  colSpan: PropTypes.number,
133
-
134
124
  /**
135
125
  * Supply an id to the th element.
136
126
  */
137
127
  id: PropTypes.string,
138
-
139
128
  /**
140
129
  * Specify whether this header is the header by which a table is being sorted
141
130
  * by
142
131
  */
143
132
  isSortHeader: PropTypes.bool,
144
-
145
133
  /**
146
134
  * Specify whether this header is one through which a user can sort the table
147
135
  */
148
136
  isSortable: PropTypes.bool,
149
-
150
137
  /**
151
138
  * Hook that is invoked when the header is clicked
152
139
  */
153
140
  onClick: PropTypes.func,
154
-
155
141
  /**
156
142
  * Specify the scope of this table header. You can find more info about this
157
143
  * attribute at the following URL:
158
144
  * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/th#attr-scope
159
145
  */
160
146
  scope: PropTypes.string.isRequired,
161
-
162
147
  /**
163
148
  * Specify which direction we are currently sorting by, should be one of DESC,
164
149
  * NONE, or ASC.
165
150
  */
166
151
  sortDirection: PropTypes.oneOf(Object.values(sortStates)),
167
-
168
152
  /**
169
153
  * Supply a method to translate internal strings with your i18n tool of
170
154
  * choice. Translation keys are available on the `translationKeys` field for
@@ -174,7 +158,7 @@ TableHeader.propTypes = {
174
158
  };
175
159
  TableHeader.defaultProps = {
176
160
  isSortable: false,
177
- scope: 'col',
161
+ scope: defaultScope,
178
162
  translateWithId
179
163
  };
180
164
  TableHeader.translationKeys = Object.values(translationKeys);
@@ -12,24 +12,23 @@ import cx from 'classnames';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
 
14
14
  const TableRow = props => {
15
- const prefix = usePrefix(); // Remove unnecessary props if provided to this component, these are
15
+ const prefix = usePrefix();
16
+ // Remove unnecessary props if provided to this component, these are
16
17
  // only useful in `TableExpandRow`
17
-
18
18
  const className = cx(props.className, {
19
19
  [`${prefix}--data-table--selected`]: props.isSelected
20
20
  });
21
- const cleanProps = { ...omit(props, ['ariaLabel', 'onExpand', 'isExpanded', 'isSelected']),
21
+ const cleanProps = {
22
+ ...omit(props, ['ariaLabel', 'onExpand', 'isExpanded', 'isSelected']),
22
23
  className: className || undefined
23
24
  };
24
25
  return /*#__PURE__*/React__default.createElement("tr", cleanProps);
25
26
  };
26
-
27
27
  TableRow.propTypes = {
28
28
  /**
29
29
  * Specify an optional className to be applied to the container node
30
30
  */
31
31
  className: PropTypes.string,
32
-
33
32
  /**
34
33
  * Specify if the row is selected
35
34
  */
@@ -36,43 +36,35 @@ const TableSelectAll = _ref => {
36
36
  disabled: disabled
37
37
  }));
38
38
  };
39
-
40
39
  TableSelectAll.propTypes = {
41
40
  /**
42
41
  * Specify the aria label for the underlying input control
43
42
  */
44
43
  ariaLabel: PropTypes.string.isRequired,
45
-
46
44
  /**
47
45
  * Specify whether all items are selected, or not
48
46
  */
49
47
  checked: PropTypes.bool.isRequired,
50
-
51
48
  /**
52
49
  * The CSS class names of the cell that wraps the underlying input control
53
50
  */
54
51
  className: PropTypes.string,
55
-
56
52
  /**
57
53
  * Specify whether the checkbox input should be disabled
58
54
  */
59
55
  disabled: PropTypes.bool,
60
-
61
56
  /**
62
57
  * Provide an `id` for the underlying input control
63
58
  */
64
59
  id: PropTypes.string.isRequired,
65
-
66
60
  /**
67
61
  * Specify whether the selection only has a subset of all items
68
62
  */
69
63
  indeterminate: PropTypes.bool,
70
-
71
64
  /**
72
65
  * Provide a `name` for the underlying input control
73
66
  */
74
67
  name: PropTypes.string.isRequired,
75
-
76
68
  /**
77
69
  * Provide a handler to listen to when a user initiates a selection request
78
70
  */
@@ -35,7 +35,8 @@ const TableSelectRow = _ref => {
35
35
  disabled
36
36
  };
37
37
  const InlineInputComponent = radio ? RadioButton : InlineCheckbox;
38
- const tableSelectRowClasses = cx(`${prefix}--table-column-checkbox`, { ...(className && {
38
+ const tableSelectRowClasses = cx(`${prefix}--table-column-checkbox`, {
39
+ ...(className && {
39
40
  [className]: true
40
41
  }),
41
42
  [`${prefix}--table-column-radio`]: radio
@@ -49,48 +50,39 @@ const TableSelectRow = _ref => {
49
50
  ['aria-label']: ariaLabel
50
51
  })));
51
52
  };
52
-
53
53
  TableSelectRow.propTypes = {
54
54
  /**
55
55
  * Specify the aria label for the underlying input control
56
56
  */
57
57
  ariaLabel: PropTypes.string.isRequired,
58
-
59
58
  /**
60
59
  * Specify whether this row is selected, or not
61
60
  */
62
61
  checked: PropTypes.bool.isRequired,
63
-
64
62
  /**
65
63
  * The CSS class names of the cell that wraps the underlying input control
66
64
  */
67
65
  className: PropTypes.string,
68
-
69
66
  /**
70
67
  * Specify whether the control is disabled
71
68
  */
72
69
  disabled: PropTypes.bool,
73
-
74
70
  /**
75
71
  * Provide an `id` for the underlying input control
76
72
  */
77
73
  id: PropTypes.string.isRequired,
78
-
79
74
  /**
80
75
  * Provide a `name` for the underlying input control
81
76
  */
82
77
  name: PropTypes.string.isRequired,
83
-
84
78
  /**
85
79
  * Provide an optional hook that is called each time the input is updated
86
80
  */
87
81
  onChange: PropTypes.func,
88
-
89
82
  /**
90
83
  * Provide a handler to listen to when a user initiates a selection request
91
84
  */
92
85
  onSelect: PropTypes.func.isRequired,
93
-
94
86
  /**
95
87
  * Specify whether the control should be a radio button or inline checkbox
96
88
  */
@@ -27,18 +27,15 @@ const TableToolbar = _ref => {
27
27
  className: className
28
28
  }), children);
29
29
  };
30
-
31
30
  TableToolbar.propTypes = {
32
31
  /**
33
32
  * Required props for the accessibility label of the TableToolbar
34
33
  */
35
34
  ...AriaLabelPropType,
36
-
37
35
  /**
38
36
  * Pass in the children that will be rendered inside the TableToolbar
39
37
  */
40
38
  children: PropTypes.node,
41
-
42
39
  /**
43
40
  * `lg` Change the row height of table
44
41
  */
@@ -14,7 +14,7 @@ export interface TableToolbarMenuProps extends React.HTMLAttributes<HTMLDivEleme
14
14
  /**
15
15
  * The description of the menu icon.
16
16
  */
17
- iconDescription: string;
17
+ iconDescription?: string;
18
18
  /**
19
19
  * Optional prop to allow overriding the default menu icon
20
20
  */
@@ -13,11 +13,12 @@ import React__default from 'react';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
14
  import OverflowMenu from '../OverflowMenu/index.js';
15
15
 
16
+ const defaultIconDescription = 'Settings';
16
17
  const TableToolbarMenu = _ref => {
17
18
  let {
18
19
  className,
19
20
  renderIcon,
20
- iconDescription,
21
+ iconDescription = defaultIconDescription,
21
22
  children,
22
23
  ...rest
23
24
  } = _ref;
@@ -32,24 +33,20 @@ const TableToolbarMenu = _ref => {
32
33
  flipped: true
33
34
  }, rest), children);
34
35
  };
35
-
36
36
  TableToolbarMenu.defaultProps = {
37
37
  renderIcon: Settings,
38
- iconDescription: 'Settings'
38
+ iconDescription: defaultIconDescription
39
39
  };
40
40
  TableToolbarMenu.propTypes = {
41
41
  children: PropTypes.node.isRequired,
42
-
43
42
  /**
44
43
  * Provide an optional class name for the toolbar menu
45
44
  */
46
45
  className: PropTypes.string,
47
-
48
46
  /**
49
47
  * The description of the menu icon.
50
48
  */
51
49
  iconDescription: PropTypes.string.isRequired,
52
-
53
50
  /**
54
51
  * Optional prop to allow overriding the default menu icon
55
52
  */
@@ -19,11 +19,9 @@ const translationKeys = {
19
19
  'carbon.table.toolbar.search.label': 'Filter table',
20
20
  'carbon.table.toolbar.search.placeholder': 'Filter table'
21
21
  };
22
-
23
22
  const translateWithId = id => {
24
23
  return translationKeys[id];
25
24
  };
26
-
27
25
  const TableToolbarSearch = _ref => {
28
26
  let {
29
27
  className,
@@ -64,7 +62,8 @@ const TableToolbarSearch = _ref => {
64
62
  if (defaultValue) {
65
63
  onChangeProp('', defaultValue);
66
64
  }
67
- }, //eslint-disable-next-line react-hooks/exhaustive-deps
65
+ },
66
+ //eslint-disable-next-line react-hooks/exhaustive-deps
68
67
  []);
69
68
  const searchClasses = cx(className, {
70
69
  [searchContainerClass]: searchContainerClass,
@@ -73,33 +72,25 @@ const TableToolbarSearch = _ref => {
73
72
  [`${prefix}--toolbar-search-container-expandable`]: !persistent,
74
73
  [`${prefix}--toolbar-search-container-persistent`]: persistent
75
74
  });
76
-
77
75
  const handleExpand = function (event) {
78
76
  let value = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : !expanded;
79
-
80
77
  if (!disabled) {
81
78
  if (!controlled && !persistent) {
82
79
  setExpandedState(value);
83
80
  }
84
-
85
81
  if (onExpand) {
86
82
  onExpand(event, value);
87
83
  }
88
84
  }
89
85
  };
90
-
91
86
  const onChange = e => {
92
87
  setValue(e.target.value);
93
-
94
88
  if (onChangeProp) {
95
89
  onChangeProp(e);
96
90
  }
97
91
  };
98
-
99
92
  const handleOnFocus = event => handleExpand(event, true);
100
-
101
93
  const handleOnBlur = event => !value && handleExpand(event, false);
102
-
103
94
  return /*#__PURE__*/React__default.createElement(Search, _extends({
104
95
  disabled: disabled,
105
96
  className: searchClasses,
@@ -114,99 +105,80 @@ const TableToolbarSearch = _ref => {
114
105
  size: size
115
106
  }, rest));
116
107
  };
117
-
118
108
  TableToolbarSearch.propTypes = {
119
109
  children: PropTypes.node,
120
-
121
110
  /**
122
111
  * Provide an optional class name for the search container
123
112
  */
124
113
  className: PropTypes.string,
125
-
126
114
  /**
127
115
  * Specifies if the search should initially render in an expanded state
128
116
  */
129
117
  defaultExpanded: PropTypes.bool,
130
-
131
118
  /**
132
119
  * Provide an optional default value for the Search component
133
120
  */
134
121
  defaultValue: PropTypes.string,
135
-
136
122
  /**
137
123
  * Specifies if the search should be disabled
138
124
  */
139
125
  disabled: PropTypes.bool,
140
-
141
126
  /**
142
127
  * Specifies if the search should expand
143
128
  */
144
129
  expanded: PropTypes.bool,
145
-
146
130
  /**
147
131
  * Provide an optional id for the search container
148
132
  */
149
133
  id: PropTypes.string,
150
-
151
134
  /**
152
135
  * Provide an optional label text for the Search component icon
153
136
  */
154
137
  labelText: PropTypes.string,
155
-
156
138
  /**
157
139
  * Provide an optional function to be called when the search input loses focus, this will be
158
140
  * passed the event as the first parameter and a function to handle the expanding of the search
159
141
  * input as the second
160
142
  */
161
143
  onBlur: PropTypes.func,
162
-
163
144
  /**
164
145
  * Provide an optional hook that is called each time the input is updated
165
146
  */
166
147
  onChange: PropTypes.func,
167
-
168
148
  /**
169
149
  * Optional callback called when the search value is cleared.
170
150
  */
171
151
  onClear: PropTypes.func,
172
-
173
152
  /**
174
153
  * Provide an optional hook that is called each time the input is expanded
175
154
  */
176
155
  onExpand: PropTypes.func,
177
-
178
156
  /**
179
157
  * Provide an optional function to be called when the search input gains focus, this will be
180
158
  * passed the event as the first parameter and a function to handle the expanding of the search
181
159
  * input as the second.
182
160
  */
183
161
  onFocus: PropTypes.func,
184
-
185
162
  /**
186
163
  * Whether the search should be allowed to expand
187
164
  */
188
165
  persistent: PropTypes.bool,
189
-
190
166
  /**
191
167
  * Provide an optional placeholder text for the Search component
192
168
  */
193
169
  placeholder: PropTypes.string,
194
-
195
170
  /**
196
171
  * Provide an optional className for the overall container of the Search
197
172
  */
198
173
  searchContainerClass: PropTypes.string,
199
-
200
174
  /**
201
175
  * Specify the size of the Search
202
176
  */
203
177
  size: PropTypes.oneOf(['sm', 'md', 'lg']),
204
-
205
178
  /**
206
179
  * Optional prop to specify the tabIndex of the <Search> (in expanded state) or the container (in collapsed state)
207
180
  */
208
181
  tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
209
-
210
182
  /**
211
183
  * Provide custom text for the component for each translation id
212
184
  */