@carbon/react 1.83.0 → 1.84.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (510) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +980 -945
  2. package/README.md +1 -1
  3. package/es/components/AILabel/index.js +27 -30
  4. package/es/components/AISkeleton/AISkeletonIcon.js +4 -5
  5. package/es/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
  6. package/es/components/AISkeleton/AISkeletonText.js +4 -5
  7. package/es/components/Accordion/Accordion.Skeleton.js +9 -10
  8. package/es/components/Accordion/Accordion.js +10 -11
  9. package/es/components/Accordion/AccordionItem.js +13 -14
  10. package/es/components/Accordion/AccordionProvider.js +4 -5
  11. package/es/components/AspectRatio/AspectRatio.js +7 -8
  12. package/es/components/BadgeIndicator/index.js +5 -6
  13. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
  14. package/es/components/Button/Button.Skeleton.js +7 -8
  15. package/es/components/Button/ButtonBase.js +23 -24
  16. package/es/components/ChatButton/ChatButton.Skeleton.js +5 -6
  17. package/es/components/ChatButton/ChatButton.js +11 -12
  18. package/es/components/Checkbox/Checkbox.Skeleton.js +4 -5
  19. package/es/components/Checkbox/Checkbox.js +19 -20
  20. package/es/components/CheckboxGroup/CheckboxGroup.js +16 -17
  21. package/es/components/ClassPrefix/index.js +4 -5
  22. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
  23. package/es/components/CodeSnippet/CodeSnippet.js +25 -26
  24. package/es/components/ComboBox/ComboBox.js +24 -30
  25. package/es/components/ComboBox/tools/filter.js +9 -12
  26. package/es/components/ComboButton/index.js +16 -18
  27. package/es/components/ComposedModal/ComposedModal.js +31 -34
  28. package/es/components/ComposedModal/ModalFooter.js +37 -42
  29. package/es/components/ComposedModal/ModalHeader.js +14 -15
  30. package/es/components/ContainedList/ContainedList.js +10 -11
  31. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
  32. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +9 -29
  33. package/es/components/ContentSwitcher/ContentSwitcher.js +96 -128
  34. package/es/components/ContentSwitcher/index.d.ts +3 -4
  35. package/es/components/ContextMenu/useContextMenu.js +1 -2
  36. package/es/components/Copy/Copy.js +11 -12
  37. package/es/components/CopyButton/CopyButton.js +10 -11
  38. package/es/components/DataTable/DataTable.js +45 -53
  39. package/es/components/DataTable/Table.js +15 -18
  40. package/es/components/DataTable/TableBatchAction.js +8 -11
  41. package/es/components/DataTable/TableBatchActions.js +18 -20
  42. package/es/components/DataTable/TableBody.js +8 -11
  43. package/es/components/DataTable/TableContainer.js +9 -10
  44. package/es/components/DataTable/TableDecoratorRow.js +4 -5
  45. package/es/components/DataTable/TableExpandHeader.js +14 -15
  46. package/es/components/DataTable/TableExpandRow.js +13 -14
  47. package/es/components/DataTable/TableExpandedRow.js +6 -7
  48. package/es/components/DataTable/TableHeader.js +15 -16
  49. package/es/components/DataTable/TableSelectAll.js +11 -12
  50. package/es/components/DataTable/TableSelectRow.js +12 -13
  51. package/es/components/DataTable/TableSlugRow.js +4 -5
  52. package/es/components/DataTable/TableToolbar.js +7 -8
  53. package/es/components/DataTable/TableToolbarMenu.js +8 -9
  54. package/es/components/DataTable/TableToolbarSearch.js +22 -24
  55. package/es/components/DataTable/state/sorting.js +3 -4
  56. package/es/components/DataTable/tools/filter.js +10 -12
  57. package/es/components/DataTable/tools/normalize.js +6 -8
  58. package/es/components/DataTable/tools/sorting.js +24 -30
  59. package/es/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
  60. package/es/components/DatePicker/DatePicker.Skeleton.js +7 -8
  61. package/es/components/DatePicker/DatePicker.js +88 -65
  62. package/es/components/DatePickerInput/DatePickerInput.js +5 -6
  63. package/es/components/Dialog/index.d.ts +193 -8
  64. package/es/components/Dialog/index.js +454 -35
  65. package/es/components/Dropdown/Dropdown.Skeleton.js +6 -7
  66. package/es/components/Dropdown/Dropdown.js +40 -43
  67. package/es/components/ErrorBoundary/ErrorBoundary.js +2 -2
  68. package/es/components/ExpandableSearch/ExpandableSearch.js +9 -10
  69. package/es/components/FeatureFlags/index.js +11 -12
  70. package/es/components/FileUploader/FileUploader.Skeleton.js +4 -5
  71. package/es/components/FileUploader/FileUploader.js +22 -24
  72. package/es/components/FileUploader/FileUploaderButton.js +16 -17
  73. package/es/components/FileUploader/FileUploaderDropContainer.js +15 -16
  74. package/es/components/FileUploader/FileUploaderItem.js +13 -14
  75. package/es/components/FileUploader/Filename.js +9 -10
  76. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
  77. package/es/components/FluidComboBox/FluidComboBox.js +5 -6
  78. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
  79. package/es/components/FluidDatePicker/FluidDatePicker.js +10 -11
  80. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
  81. package/es/components/FluidDropdown/FluidDropdown.js +5 -6
  82. package/es/components/FluidForm/FluidForm.js +5 -6
  83. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
  84. package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
  85. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
  86. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
  87. package/es/components/FluidNumberInput/FluidNumberInput.js +38 -5
  88. package/es/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
  89. package/es/components/FluidSearch/FluidSearch.js +4 -5
  90. package/es/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
  91. package/es/components/FluidSelect/FluidSelect.js +5 -6
  92. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
  93. package/es/components/FluidTextArea/FluidTextArea.js +4 -5
  94. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
  95. package/es/components/FluidTextInput/FluidTextInput.js +5 -6
  96. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
  97. package/es/components/FluidTimePicker/FluidTimePicker.js +11 -12
  98. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
  99. package/es/components/Form/Form.js +5 -6
  100. package/es/components/FormGroup/FormGroup.js +11 -12
  101. package/es/components/FormItem/FormItem.js +5 -6
  102. package/es/components/FormLabel/FormLabel.js +6 -7
  103. package/es/components/Grid/CSSGrid.js +17 -19
  104. package/es/components/Grid/Column.js +28 -27
  105. package/es/components/Grid/ColumnHang.js +6 -7
  106. package/es/components/Grid/FlexGrid.js +9 -10
  107. package/es/components/Grid/GridContext.js +5 -6
  108. package/es/components/Grid/Row.js +8 -9
  109. package/es/components/Heading/index.js +5 -6
  110. package/es/components/Icon/Icon.Skeleton.js +4 -5
  111. package/es/components/IconButton/index.js +20 -21
  112. package/es/components/IconIndicator/index.js +7 -8
  113. package/es/components/IdPrefix/index.js +4 -5
  114. package/es/components/InlineLoading/InlineLoading.js +9 -10
  115. package/es/components/Layer/index.js +8 -9
  116. package/es/components/Layout/index.js +21 -26
  117. package/es/components/LayoutDirection/LayoutDirection.js +6 -7
  118. package/es/components/Link/Link.d.ts +1 -1
  119. package/es/components/Link/Link.js +14 -15
  120. package/es/components/ListBox/ListBoxField.js +6 -7
  121. package/es/components/ListBox/ListBoxMenu.js +5 -6
  122. package/es/components/ListBox/ListBoxMenuIcon.js +4 -5
  123. package/es/components/ListBox/ListBoxMenuItem.js +8 -10
  124. package/es/components/ListBox/ListBoxSelection.js +8 -9
  125. package/es/components/ListBox/next/ListBoxSelection.js +9 -10
  126. package/es/components/ListBox/next/ListBoxTrigger.js +5 -6
  127. package/es/components/ListItem/ListItem.js +5 -6
  128. package/es/components/Loading/Loading.js +8 -9
  129. package/es/components/Menu/Menu.js +23 -24
  130. package/es/components/Menu/MenuItem.js +39 -44
  131. package/es/components/MenuButton/index.js +16 -18
  132. package/es/components/Modal/Modal.js +55 -63
  133. package/es/components/ModalWrapper/ModalWrapper.js +2 -2
  134. package/es/components/MultiSelect/FilterableMultiSelect.js +46 -48
  135. package/es/components/MultiSelect/MultiSelect.js +43 -45
  136. package/es/components/MultiSelect/tools/sorting.js +11 -15
  137. package/es/components/Notification/Notification.js +96 -105
  138. package/es/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
  139. package/es/components/NumberInput/NumberFormatPropTypes.js +40 -0
  140. package/es/components/NumberInput/NumberInput.Skeleton.js +6 -7
  141. package/es/components/NumberInput/NumberInput.d.ts +39 -3
  142. package/es/components/NumberInput/NumberInput.js +174 -44
  143. package/es/components/OrderedList/OrderedList.js +7 -8
  144. package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  145. package/es/components/OverflowMenu/OverflowMenu.js +35 -41
  146. package/es/components/OverflowMenu/next/index.js +12 -13
  147. package/es/components/PageHeader/PageHeader.d.ts +29 -5
  148. package/es/components/PageHeader/PageHeader.js +119 -73
  149. package/es/components/Pagination/Pagination.Skeleton.js +4 -5
  150. package/es/components/Pagination/Pagination.js +24 -25
  151. package/es/components/Pagination/experimental/PageSelector.js +8 -9
  152. package/es/components/Pagination/experimental/Pagination.js +20 -21
  153. package/es/components/PaginationNav/PaginationNav.js +33 -38
  154. package/es/components/Popover/index.js +26 -28
  155. package/es/components/ProgressBar/ProgressBar.js +11 -12
  156. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
  157. package/es/components/ProgressIndicator/ProgressIndicator.js +29 -32
  158. package/es/components/RadioTile/RadioTile.js +17 -18
  159. package/es/components/Search/Search.Skeleton.js +5 -6
  160. package/es/components/Search/Search.js +26 -28
  161. package/es/components/Select/Select.Skeleton.js +5 -6
  162. package/es/components/Select/Select.js +24 -25
  163. package/es/components/SelectItem/SelectItem.js +8 -9
  164. package/es/components/SelectItemGroup/SelectItemGroup.js +7 -8
  165. package/es/components/ShapeIndicator/index.js +7 -8
  166. package/es/components/SkeletonIcon/SkeletonIcon.js +4 -5
  167. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
  168. package/es/components/SkeletonText/SkeletonText.js +8 -9
  169. package/es/components/Slider/Slider.Skeleton.js +8 -9
  170. package/es/components/Slider/Slider.js +69 -83
  171. package/es/components/Slider/SliderHandles.js +6 -6
  172. package/es/components/StructuredList/StructuredList.Skeleton.js +5 -6
  173. package/es/components/Tabs/Tabs.Skeleton.js +5 -6
  174. package/es/components/Tabs/Tabs.js +83 -98
  175. package/es/components/Tabs/usePressable.js +7 -8
  176. package/es/components/Tag/DismissibleTag.js +16 -17
  177. package/es/components/Tag/OperationalTag.js +10 -11
  178. package/es/components/Tag/SelectableTag.js +13 -14
  179. package/es/components/Tag/Tag.Skeleton.js +5 -6
  180. package/es/components/Tag/Tag.js +19 -20
  181. package/es/components/Text/Text.js +6 -7
  182. package/es/components/Text/TextDirection.js +5 -6
  183. package/es/components/TextArea/TextArea.js +3 -3
  184. package/es/components/TextInput/ControlledPasswordInput.js +24 -25
  185. package/es/components/TextInput/PasswordInput.js +26 -27
  186. package/es/components/TextInput/TextInput.Skeleton.js +5 -6
  187. package/es/components/TextInput/TextInput.js +27 -28
  188. package/es/components/TextInput/util.js +14 -17
  189. package/es/components/Theme/index.js +10 -12
  190. package/es/components/Tile/Tile.js +68 -74
  191. package/es/components/Toggle/Toggle.Skeleton.js +4 -5
  192. package/es/components/Toggle/Toggle.js +17 -18
  193. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
  194. package/es/components/Toggletip/index.js +33 -39
  195. package/es/components/Tooltip/DefinitionTooltip.js +13 -14
  196. package/es/components/Tooltip/Tooltip.js +15 -16
  197. package/es/components/TreeView/TreeNode.js +20 -21
  198. package/es/components/TreeView/TreeView.js +14 -16
  199. package/es/components/UIShell/Content.js +6 -7
  200. package/es/components/UIShell/Header.js +5 -6
  201. package/es/components/UIShell/HeaderContainer.js +5 -6
  202. package/es/components/UIShell/HeaderGlobalAction.js +12 -13
  203. package/es/components/UIShell/HeaderMenu.d.ts +10 -112
  204. package/es/components/UIShell/HeaderMenu.js +154 -201
  205. package/es/components/UIShell/HeaderMenuButton.js +10 -11
  206. package/es/components/UIShell/HeaderMenuItem.js +10 -11
  207. package/es/components/UIShell/HeaderName.js +6 -7
  208. package/es/components/UIShell/HeaderNavigation.js +7 -8
  209. package/es/components/UIShell/HeaderPanel.js +9 -10
  210. package/es/components/UIShell/HeaderSideNavItems.js +5 -6
  211. package/es/components/UIShell/Link.js +8 -9
  212. package/es/components/UIShell/SideNav.js +23 -25
  213. package/es/components/UIShell/SideNavDetails.js +6 -7
  214. package/es/components/UIShell/SideNavDivider.js +3 -4
  215. package/es/components/UIShell/SideNavFooter.js +6 -7
  216. package/es/components/UIShell/SideNavHeader.js +5 -6
  217. package/es/components/UIShell/SideNavIcon.js +5 -6
  218. package/es/components/UIShell/SideNavItem.js +5 -6
  219. package/es/components/UIShell/SideNavItems.js +5 -6
  220. package/es/components/UIShell/SideNavLink.js +10 -11
  221. package/es/components/UIShell/SideNavLinkText.js +5 -6
  222. package/es/components/UIShell/SideNavMenu.js +11 -12
  223. package/es/components/UIShell/SkipToContent.js +7 -8
  224. package/es/components/UIShell/Switcher.js +4 -5
  225. package/es/components/UIShell/SwitcherDivider.js +4 -5
  226. package/es/components/UnorderedList/UnorderedList.js +6 -7
  227. package/es/index.js +2 -2
  228. package/es/internal/FloatingMenu.js +26 -28
  229. package/es/internal/Selection.js +15 -17
  230. package/es/internal/getAnnouncement.d.ts +8 -0
  231. package/es/internal/getAnnouncement.js +22 -0
  232. package/es/internal/keyboard/match.js +6 -7
  233. package/es/internal/useControllableState.d.ts +1 -1
  234. package/es/internal/useControllableState.js +8 -9
  235. package/es/internal/useDelayedState.js +1 -2
  236. package/es/internal/useDocumentLang.d.ts +12 -0
  237. package/es/internal/useId.js +2 -4
  238. package/es/internal/useMatchMedia.js +1 -2
  239. package/es/internal/useMergedRefs.d.ts +1 -1
  240. package/es/internal/useNoInteractiveChildren.js +2 -4
  241. package/es/internal/useNormalizedInputProps.js +9 -10
  242. package/es/internal/useResizeObserver.js +4 -5
  243. package/es/internal/useSavedCallback.js +1 -3
  244. package/es/internal/wrapFocus.js +20 -29
  245. package/es/prop-types/deprecate.js +1 -4
  246. package/es/prop-types/deprecateValuesWithin.js +1 -4
  247. package/es/prop-types/isRequiredOneOf.js +1 -4
  248. package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  249. package/es/tools/events.js +1 -4
  250. package/es/tools/mergeRefs.js +9 -14
  251. package/es/tools/uniqueId.js +1 -2
  252. package/es/tools/wrapComponent.js +9 -11
  253. package/lib/components/AILabel/index.js +27 -30
  254. package/lib/components/AISkeleton/AISkeletonIcon.js +4 -5
  255. package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
  256. package/lib/components/AISkeleton/AISkeletonText.js +4 -5
  257. package/lib/components/Accordion/Accordion.Skeleton.js +9 -10
  258. package/lib/components/Accordion/Accordion.js +10 -11
  259. package/lib/components/Accordion/AccordionItem.js +13 -14
  260. package/lib/components/Accordion/AccordionProvider.js +4 -5
  261. package/lib/components/AspectRatio/AspectRatio.js +7 -8
  262. package/lib/components/BadgeIndicator/index.js +5 -6
  263. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
  264. package/lib/components/Button/Button.Skeleton.js +7 -8
  265. package/lib/components/Button/ButtonBase.js +23 -24
  266. package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -6
  267. package/lib/components/ChatButton/ChatButton.js +11 -12
  268. package/lib/components/Checkbox/Checkbox.Skeleton.js +4 -5
  269. package/lib/components/Checkbox/Checkbox.js +19 -20
  270. package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -17
  271. package/lib/components/ClassPrefix/index.js +4 -5
  272. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
  273. package/lib/components/CodeSnippet/CodeSnippet.js +25 -26
  274. package/lib/components/ComboBox/ComboBox.js +24 -30
  275. package/lib/components/ComboBox/tools/filter.js +9 -12
  276. package/lib/components/ComboButton/index.js +16 -18
  277. package/lib/components/ComposedModal/ComposedModal.js +31 -34
  278. package/lib/components/ComposedModal/ModalFooter.js +37 -42
  279. package/lib/components/ComposedModal/ModalHeader.js +14 -15
  280. package/lib/components/ContainedList/ContainedList.js +10 -11
  281. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
  282. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +9 -29
  283. package/lib/components/ContentSwitcher/ContentSwitcher.js +94 -126
  284. package/lib/components/ContentSwitcher/index.d.ts +3 -4
  285. package/lib/components/ContextMenu/useContextMenu.js +1 -2
  286. package/lib/components/Copy/Copy.js +11 -12
  287. package/lib/components/CopyButton/CopyButton.js +10 -11
  288. package/lib/components/DataTable/DataTable.js +45 -53
  289. package/lib/components/DataTable/Table.js +15 -18
  290. package/lib/components/DataTable/TableBatchAction.js +8 -11
  291. package/lib/components/DataTable/TableBatchActions.js +18 -20
  292. package/lib/components/DataTable/TableBody.js +8 -11
  293. package/lib/components/DataTable/TableContainer.js +9 -10
  294. package/lib/components/DataTable/TableDecoratorRow.js +4 -5
  295. package/lib/components/DataTable/TableExpandHeader.js +14 -15
  296. package/lib/components/DataTable/TableExpandRow.js +13 -14
  297. package/lib/components/DataTable/TableExpandedRow.js +6 -7
  298. package/lib/components/DataTable/TableHeader.js +15 -16
  299. package/lib/components/DataTable/TableSelectAll.js +11 -12
  300. package/lib/components/DataTable/TableSelectRow.js +12 -13
  301. package/lib/components/DataTable/TableSlugRow.js +4 -5
  302. package/lib/components/DataTable/TableToolbar.js +7 -8
  303. package/lib/components/DataTable/TableToolbarMenu.js +8 -9
  304. package/lib/components/DataTable/TableToolbarSearch.js +22 -24
  305. package/lib/components/DataTable/state/sorting.js +3 -4
  306. package/lib/components/DataTable/tools/filter.js +10 -12
  307. package/lib/components/DataTable/tools/normalize.js +6 -8
  308. package/lib/components/DataTable/tools/sorting.js +24 -30
  309. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
  310. package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -8
  311. package/lib/components/DatePicker/DatePicker.js +87 -64
  312. package/lib/components/DatePickerInput/DatePickerInput.js +5 -6
  313. package/lib/components/Dialog/index.d.ts +193 -8
  314. package/lib/components/Dialog/index.js +457 -33
  315. package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
  316. package/lib/components/Dropdown/Dropdown.js +40 -43
  317. package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -2
  318. package/lib/components/ExpandableSearch/ExpandableSearch.js +9 -10
  319. package/lib/components/FeatureFlags/index.js +11 -12
  320. package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -5
  321. package/lib/components/FileUploader/FileUploader.js +22 -24
  322. package/lib/components/FileUploader/FileUploaderButton.js +16 -17
  323. package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
  324. package/lib/components/FileUploader/FileUploaderItem.js +13 -14
  325. package/lib/components/FileUploader/Filename.js +9 -10
  326. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
  327. package/lib/components/FluidComboBox/FluidComboBox.js +5 -6
  328. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
  329. package/lib/components/FluidDatePicker/FluidDatePicker.js +10 -11
  330. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
  331. package/lib/components/FluidDropdown/FluidDropdown.js +5 -6
  332. package/lib/components/FluidForm/FluidForm.js +5 -6
  333. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
  334. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
  335. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
  336. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
  337. package/lib/components/FluidNumberInput/FluidNumberInput.js +38 -5
  338. package/lib/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
  339. package/lib/components/FluidSearch/FluidSearch.js +4 -5
  340. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
  341. package/lib/components/FluidSelect/FluidSelect.js +5 -6
  342. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
  343. package/lib/components/FluidTextArea/FluidTextArea.js +4 -5
  344. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
  345. package/lib/components/FluidTextInput/FluidTextInput.js +5 -6
  346. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
  347. package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -12
  348. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
  349. package/lib/components/Form/Form.js +5 -6
  350. package/lib/components/FormGroup/FormGroup.js +11 -12
  351. package/lib/components/FormItem/FormItem.js +5 -6
  352. package/lib/components/FormLabel/FormLabel.js +6 -7
  353. package/lib/components/Grid/CSSGrid.js +17 -19
  354. package/lib/components/Grid/Column.js +28 -27
  355. package/lib/components/Grid/ColumnHang.js +6 -7
  356. package/lib/components/Grid/FlexGrid.js +9 -10
  357. package/lib/components/Grid/GridContext.js +5 -6
  358. package/lib/components/Grid/Row.js +8 -9
  359. package/lib/components/Heading/index.js +5 -6
  360. package/lib/components/Icon/Icon.Skeleton.js +4 -5
  361. package/lib/components/IconButton/index.js +20 -21
  362. package/lib/components/IconIndicator/index.js +7 -8
  363. package/lib/components/IdPrefix/index.js +4 -5
  364. package/lib/components/InlineLoading/InlineLoading.js +9 -10
  365. package/lib/components/Layer/index.js +8 -9
  366. package/lib/components/Layout/index.js +21 -26
  367. package/lib/components/LayoutDirection/LayoutDirection.js +6 -7
  368. package/lib/components/Link/Link.d.ts +1 -1
  369. package/lib/components/Link/Link.js +14 -15
  370. package/lib/components/ListBox/ListBoxField.js +6 -7
  371. package/lib/components/ListBox/ListBoxMenu.js +5 -6
  372. package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
  373. package/lib/components/ListBox/ListBoxMenuItem.js +8 -10
  374. package/lib/components/ListBox/ListBoxSelection.js +8 -9
  375. package/lib/components/ListBox/next/ListBoxSelection.js +9 -10
  376. package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
  377. package/lib/components/ListItem/ListItem.js +5 -6
  378. package/lib/components/Loading/Loading.js +8 -9
  379. package/lib/components/Menu/Menu.js +23 -24
  380. package/lib/components/Menu/MenuItem.js +39 -44
  381. package/lib/components/MenuButton/index.js +16 -18
  382. package/lib/components/Modal/Modal.js +55 -63
  383. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  384. package/lib/components/MultiSelect/FilterableMultiSelect.js +45 -47
  385. package/lib/components/MultiSelect/MultiSelect.js +43 -45
  386. package/lib/components/MultiSelect/tools/sorting.js +11 -15
  387. package/lib/components/Notification/Notification.js +96 -105
  388. package/lib/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
  389. package/lib/components/NumberInput/NumberFormatPropTypes.js +48 -0
  390. package/lib/components/NumberInput/NumberInput.Skeleton.js +6 -7
  391. package/lib/components/NumberInput/NumberInput.d.ts +39 -3
  392. package/lib/components/NumberInput/NumberInput.js +173 -43
  393. package/lib/components/OrderedList/OrderedList.js +7 -8
  394. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  395. package/lib/components/OverflowMenu/OverflowMenu.js +35 -41
  396. package/lib/components/OverflowMenu/next/index.js +12 -13
  397. package/lib/components/PageHeader/PageHeader.d.ts +29 -5
  398. package/lib/components/PageHeader/PageHeader.js +119 -73
  399. package/lib/components/Pagination/Pagination.Skeleton.js +4 -5
  400. package/lib/components/Pagination/Pagination.js +24 -25
  401. package/lib/components/Pagination/experimental/PageSelector.js +8 -9
  402. package/lib/components/Pagination/experimental/Pagination.js +20 -21
  403. package/lib/components/PaginationNav/PaginationNav.js +33 -38
  404. package/lib/components/Popover/index.js +26 -28
  405. package/lib/components/ProgressBar/ProgressBar.js +11 -12
  406. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
  407. package/lib/components/ProgressIndicator/ProgressIndicator.js +29 -32
  408. package/lib/components/RadioTile/RadioTile.js +17 -18
  409. package/lib/components/Search/Search.Skeleton.js +5 -6
  410. package/lib/components/Search/Search.js +26 -28
  411. package/lib/components/Select/Select.Skeleton.js +5 -6
  412. package/lib/components/Select/Select.js +24 -25
  413. package/lib/components/SelectItem/SelectItem.js +8 -9
  414. package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -8
  415. package/lib/components/ShapeIndicator/index.js +7 -8
  416. package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -5
  417. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
  418. package/lib/components/SkeletonText/SkeletonText.js +8 -9
  419. package/lib/components/Slider/Slider.Skeleton.js +8 -9
  420. package/lib/components/Slider/Slider.js +69 -83
  421. package/lib/components/Slider/SliderHandles.js +6 -6
  422. package/lib/components/StructuredList/StructuredList.Skeleton.js +5 -6
  423. package/lib/components/Tabs/Tabs.Skeleton.js +5 -6
  424. package/lib/components/Tabs/Tabs.js +83 -98
  425. package/lib/components/Tabs/usePressable.js +7 -8
  426. package/lib/components/Tag/DismissibleTag.js +16 -17
  427. package/lib/components/Tag/OperationalTag.js +10 -11
  428. package/lib/components/Tag/SelectableTag.js +13 -14
  429. package/lib/components/Tag/Tag.Skeleton.js +5 -6
  430. package/lib/components/Tag/Tag.js +19 -20
  431. package/lib/components/Text/Text.js +6 -7
  432. package/lib/components/Text/TextDirection.js +5 -6
  433. package/lib/components/TextArea/TextArea.js +3 -3
  434. package/lib/components/TextInput/ControlledPasswordInput.js +24 -25
  435. package/lib/components/TextInput/PasswordInput.js +26 -27
  436. package/lib/components/TextInput/TextInput.Skeleton.js +5 -6
  437. package/lib/components/TextInput/TextInput.js +27 -28
  438. package/lib/components/TextInput/util.js +14 -17
  439. package/lib/components/Theme/index.js +10 -12
  440. package/lib/components/Tile/Tile.js +68 -74
  441. package/lib/components/Toggle/Toggle.Skeleton.js +4 -5
  442. package/lib/components/Toggle/Toggle.js +17 -18
  443. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
  444. package/lib/components/Toggletip/index.js +33 -39
  445. package/lib/components/Tooltip/DefinitionTooltip.js +13 -14
  446. package/lib/components/Tooltip/Tooltip.js +15 -16
  447. package/lib/components/TreeView/TreeNode.js +20 -21
  448. package/lib/components/TreeView/TreeView.js +14 -16
  449. package/lib/components/UIShell/Content.js +6 -7
  450. package/lib/components/UIShell/Header.js +5 -6
  451. package/lib/components/UIShell/HeaderContainer.js +5 -6
  452. package/lib/components/UIShell/HeaderGlobalAction.js +12 -13
  453. package/lib/components/UIShell/HeaderMenu.d.ts +10 -112
  454. package/lib/components/UIShell/HeaderMenu.js +152 -199
  455. package/lib/components/UIShell/HeaderMenuButton.js +10 -11
  456. package/lib/components/UIShell/HeaderMenuItem.js +10 -11
  457. package/lib/components/UIShell/HeaderName.js +6 -7
  458. package/lib/components/UIShell/HeaderNavigation.js +7 -8
  459. package/lib/components/UIShell/HeaderPanel.js +9 -10
  460. package/lib/components/UIShell/HeaderSideNavItems.js +5 -6
  461. package/lib/components/UIShell/Link.js +8 -9
  462. package/lib/components/UIShell/SideNav.js +23 -25
  463. package/lib/components/UIShell/SideNavDetails.js +6 -7
  464. package/lib/components/UIShell/SideNavDivider.js +3 -4
  465. package/lib/components/UIShell/SideNavFooter.js +6 -7
  466. package/lib/components/UIShell/SideNavHeader.js +5 -6
  467. package/lib/components/UIShell/SideNavIcon.js +5 -6
  468. package/lib/components/UIShell/SideNavItem.js +5 -6
  469. package/lib/components/UIShell/SideNavItems.js +5 -6
  470. package/lib/components/UIShell/SideNavLink.js +10 -11
  471. package/lib/components/UIShell/SideNavLinkText.js +5 -6
  472. package/lib/components/UIShell/SideNavMenu.js +11 -12
  473. package/lib/components/UIShell/SkipToContent.js +7 -8
  474. package/lib/components/UIShell/Switcher.js +4 -5
  475. package/lib/components/UIShell/SwitcherDivider.js +4 -5
  476. package/lib/components/UnorderedList/UnorderedList.js +6 -7
  477. package/lib/index.js +35 -35
  478. package/lib/internal/FloatingMenu.js +26 -28
  479. package/lib/internal/Selection.js +15 -17
  480. package/lib/internal/getAnnouncement.d.ts +8 -0
  481. package/lib/internal/getAnnouncement.js +26 -0
  482. package/lib/internal/keyboard/match.js +6 -7
  483. package/lib/internal/useControllableState.d.ts +1 -1
  484. package/lib/internal/useControllableState.js +8 -9
  485. package/lib/internal/useDelayedState.js +1 -2
  486. package/lib/internal/useDocumentLang.d.ts +12 -0
  487. package/lib/internal/useId.js +2 -4
  488. package/lib/internal/useMatchMedia.js +1 -2
  489. package/lib/internal/useMergedRefs.d.ts +1 -1
  490. package/lib/internal/useNoInteractiveChildren.js +2 -4
  491. package/lib/internal/useNormalizedInputProps.js +9 -10
  492. package/lib/internal/useResizeObserver.js +4 -5
  493. package/lib/internal/useSavedCallback.js +1 -3
  494. package/lib/internal/wrapFocus.js +20 -29
  495. package/lib/prop-types/deprecate.js +1 -4
  496. package/lib/prop-types/deprecateValuesWithin.js +1 -4
  497. package/lib/prop-types/isRequiredOneOf.js +1 -4
  498. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  499. package/lib/tools/events.js +1 -4
  500. package/lib/tools/mergeRefs.js +9 -14
  501. package/lib/tools/uniqueId.js +1 -2
  502. package/lib/tools/wrapComponent.js +9 -11
  503. package/package.json +21 -19
  504. package/telemetry.yml +23 -1
  505. package/es/components/ContentSwitcher/index.js +0 -13
  506. package/es/feature-flags.d.ts +0 -7
  507. package/es/internal/useAnnouncer.js +0 -21
  508. package/lib/components/ContentSwitcher/index.js +0 -18
  509. package/lib/feature-flags.d.ts +0 -7
  510. package/lib/internal/useAnnouncer.js +0 -25
@@ -54,16 +54,15 @@ const DIRECTION_BOTTOM = 'bottom';
54
54
  * Computes the floating menu's position based on the menu size, trigger element
55
55
  * position, offset, direction, and container.
56
56
  */
57
- const getFloatingPosition = _ref => {
58
- let {
59
- menuSize,
60
- refPosition,
61
- offset,
62
- direction,
63
- scrollX,
64
- scrollY,
65
- container
66
- } = _ref;
57
+ const getFloatingPosition = ({
58
+ menuSize,
59
+ refPosition,
60
+ offset,
61
+ direction,
62
+ scrollX,
63
+ scrollY,
64
+ container
65
+ }) => {
67
66
  const {
68
67
  left: refLeft = 0,
69
68
  top: refTop = 0,
@@ -106,24 +105,23 @@ const getFloatingPosition = _ref => {
106
105
  };
107
106
  return positions[direction]();
108
107
  };
109
- const FloatingMenu = _ref2 => {
110
- let {
111
- children,
112
- flipped,
113
- focusTrap,
114
- menuDirection = DIRECTION_BOTTOM,
115
- menuOffset = {
116
- top: 0,
117
- left: 0
118
- },
119
- menuRef: externalMenuRef,
120
- onPlace,
121
- selectorPrimaryFocus,
122
- styles,
123
- target = () => document.body,
124
- triggerRef,
125
- updateOrientation
126
- } = _ref2;
108
+ const FloatingMenu = ({
109
+ children,
110
+ flipped,
111
+ focusTrap,
112
+ menuDirection = DIRECTION_BOTTOM,
113
+ menuOffset = {
114
+ top: 0,
115
+ left: 0
116
+ },
117
+ menuRef: externalMenuRef,
118
+ onPlace,
119
+ selectorPrimaryFocus,
120
+ styles,
121
+ target = () => document.body,
122
+ triggerRef,
123
+ updateOrientation
124
+ }) => {
127
125
  const prefix = React.useContext(usePrefix.PrefixContext);
128
126
  const [floatingPosition, setFloatingPosition] = React.useState(undefined);
129
127
  const menuBodyRef = React.useRef(null);
@@ -16,14 +16,13 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
16
16
 
17
17
  var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
18
18
 
19
- const callOnChangeHandler = _ref => {
20
- let {
21
- isControlled,
22
- isMounted,
23
- onChangeHandlerControlled,
24
- onChangeHandlerUncontrolled,
25
- selectedItems
26
- } = _ref;
19
+ const callOnChangeHandler = ({
20
+ isControlled,
21
+ isMounted,
22
+ onChangeHandlerControlled,
23
+ onChangeHandlerUncontrolled,
24
+ selectedItems
25
+ }) => {
27
26
  if (isControlled) {
28
27
  if (isMounted && onChangeHandlerControlled) {
29
28
  onChangeHandlerControlled({
@@ -34,15 +33,14 @@ const callOnChangeHandler = _ref => {
34
33
  onChangeHandlerUncontrolled(selectedItems);
35
34
  }
36
35
  };
37
- const useSelection = _ref2 => {
38
- let {
39
- disabled,
40
- onChange,
41
- initialSelectedItems = [],
42
- selectedItems: controlledItems,
43
- selectAll = false,
44
- filteredItems = []
45
- } = _ref2;
36
+ const useSelection = ({
37
+ disabled,
38
+ onChange,
39
+ initialSelectedItems = [],
40
+ selectedItems: controlledItems,
41
+ selectAll = false,
42
+ filteredItems = []
43
+ }) => {
46
44
  const isMounted = React.useRef(false);
47
45
  const savedOnChange = React.useRef(onChange);
48
46
  const [uncontrolledItems, setUncontrolledItems] = React.useState(initialSelectedItems);
@@ -0,0 +1,8 @@
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
+ /** Returns an announcement message when the remaining count is low. */
8
+ export declare const getAnnouncement: (count: number, maxCount?: number, singularEntityName?: string, pluralEntityName?: string) => string | null;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
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
+
8
+ 'use strict';
9
+
10
+ Object.defineProperty(exports, '__esModule', { value: true });
11
+
12
+ /** Returns an announcement message when the remaining count is low. */
13
+ const getAnnouncement = (count, maxCount, singularEntityName = 'character', pluralEntityName = 'characters') => {
14
+ if (typeof maxCount === 'undefined') return null;
15
+ const remaining = maxCount - count;
16
+ if (remaining <= 10 && remaining > 0) {
17
+ const entityName = remaining === 1 ? singularEntityName : pluralEntityName;
18
+ return `${remaining} ${entityName} left.`;
19
+ }
20
+ if (remaining <= 0) {
21
+ return `Maximum ${pluralEntityName} reached.`;
22
+ }
23
+ return null;
24
+ };
25
+
26
+ exports.getAnnouncement = getAnnouncement;
@@ -34,13 +34,12 @@ const matches = (event, keysToMatch) => {
34
34
  * @param keyObj - An object with key properties to match against.
35
35
  * @returns `true` if the event or code matches the key definition.
36
36
  */
37
- const match = (eventOrCode, _ref) => {
38
- let {
39
- key,
40
- which,
41
- keyCode,
42
- code
43
- } = _ref;
37
+ const match = (eventOrCode, {
38
+ key,
39
+ which,
40
+ keyCode,
41
+ code
42
+ }) => {
44
43
  if (typeof eventOrCode === 'string') {
45
44
  return eventOrCode === key;
46
45
  }
@@ -30,5 +30,5 @@ interface UseControllableStateConfig<T> {
30
30
  * Note: This hook will warn if the component switches between controlled and
31
31
  * uncontrolled states.
32
32
  */
33
- export declare const useControllableState: <T>({ defaultValue, name, onChange, value, }: UseControllableStateConfig<T>) => [T, (stateOrUpdater: T | ((prev: T) => T)) => void];
33
+ export declare const useControllableState: <T>({ defaultValue, name, onChange, value, }: UseControllableStateConfig<T>) => [T, (stateOrUpdater: T | ((prev: T) => T)) => void, boolean];
34
34
  export {};
@@ -20,13 +20,12 @@ var warning = require('./warning.js');
20
20
  * Note: This hook will warn if the component switches between controlled and
21
21
  * uncontrolled states.
22
22
  */
23
- const useControllableState = _ref => {
24
- let {
25
- defaultValue,
26
- name = 'custom',
27
- onChange,
28
- value
29
- } = _ref;
23
+ const useControllableState = ({
24
+ defaultValue,
25
+ name = 'custom',
26
+ onChange,
27
+ value
28
+ }) => {
30
29
  const [state, internalSetState] = React.useState(typeof value !== 'undefined' ? value : defaultValue);
31
30
  const controlled = React.useRef(null);
32
31
  if (controlled.current === null) {
@@ -55,9 +54,9 @@ const useControllableState = _ref => {
55
54
  }
56
55
  }, [name, value]);
57
56
  if (controlled.current === true) {
58
- return [value, setState];
57
+ return [value, setState, controlled.current];
59
58
  }
60
- return [state, setState];
59
+ return [state, setState, controlled.current];
61
60
  };
62
61
 
63
62
  exports.useControllableState = useControllableState;
@@ -27,8 +27,7 @@ function useDelayedState(initialState) {
27
27
  const timeoutId = React.useRef(null);
28
28
  // We use `useCallback` to match the signature of React's `useState` which will
29
29
  // always return the same reference for the `setState` updater
30
- const setStateWithDelay = React.useCallback(function (stateToSet) {
31
- let delayMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
30
+ const setStateWithDelay = React.useCallback((stateToSet, delayMs = 0) => {
32
31
  window.clearTimeout(timeoutId.current ?? undefined);
33
32
  timeoutId.current = null;
34
33
  if (delayMs === 0) {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ /**
8
+ * React hook that returns the current document language and updates on changes.
9
+ *
10
+ * @returns {string} The current document language code.
11
+ */
12
+ export declare function useDocumentLang(): string;
@@ -38,8 +38,7 @@ const defaultId = 'id';
38
38
  * @param {string} [prefix]
39
39
  * @returns {string}
40
40
  */
41
- function useCompatibleId() {
42
- let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultId;
41
+ function useCompatibleId(prefix = defaultId) {
43
42
  const contextPrefix = useIdPrefix.useIdPrefix();
44
43
  const [id, setId] = React.useState(() => {
45
44
  if (serverHandoffCompleted) {
@@ -66,8 +65,7 @@ function useCompatibleId() {
66
65
  * @param {string} [prefix]
67
66
  * @returns {string}
68
67
  */
69
- function useReactId() {
70
- let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultId;
68
+ function useReactId(prefix = defaultId) {
71
69
  const contextPrefix = useIdPrefix.useIdPrefix();
72
70
  return `${contextPrefix ? `${contextPrefix}-` : ``}${prefix}-${_React.useId()}`;
73
71
  }
@@ -17,8 +17,7 @@ var React = require('react');
17
17
  * @param defaultState - The initial state to return before the media query is evaluated. Defaults to `false`.
18
18
  * @returns Whether the media query matches.
19
19
  */
20
- const useMatchMedia = function (mediaQuery) {
21
- let defaultState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
20
+ const useMatchMedia = (mediaQuery, defaultState = false) => {
22
21
  const [matches, setMatches] = React.useState(defaultState);
23
22
  React.useEffect(() => {
24
23
  const listener = event => {
@@ -13,4 +13,4 @@ import { type ForwardedRef, type Ref } from 'react';
13
13
  * accepts an array of refs and returns a callback ref that, when attached to a
14
14
  * node, assigns that node to every ref in the array.
15
15
  */
16
- export declare const useMergedRefs: <T>(refs: ForwardedRef<T>[]) => Ref<T>;
16
+ export declare const useMergedRefs: <T>(refs: (ForwardedRef<T> | undefined)[]) => Ref<T>;
@@ -11,8 +11,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var React = require('react');
13
13
 
14
- function useNoInteractiveChildren(ref) {
15
- let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'component should have no interactive child nodes';
14
+ function useNoInteractiveChildren(ref, message = 'component should have no interactive child nodes') {
16
15
  if (process.env.NODE_ENV !== 'production') {
17
16
  // TODO: https://github.com/carbon-design-system/carbon/issues/19005
18
17
  /*
@@ -29,8 +28,7 @@ function useNoInteractiveChildren(ref) {
29
28
  }, []);
30
29
  }
31
30
  }
32
- function useInteractiveChildrenNeedDescription(ref) {
33
- let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : `interactive child node(s) should have an \`aria-describedby\` property`;
31
+ function useInteractiveChildrenNeedDescription(ref, message = `interactive child node(s) should have an \`aria-describedby\` property`) {
34
32
  if (process.env.NODE_ENV !== 'production') {
35
33
  // TODO: https://github.com/carbon-design-system/carbon/issues/19005
36
34
  /*
@@ -28,16 +28,15 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
28
28
  * helper messages, and conditionally provides the appropriate validation
29
29
  * message and accompanying icon.
30
30
  */
31
- const useNormalizedInputProps = _ref => {
32
- let {
33
- id,
34
- readOnly,
35
- disabled,
36
- invalid,
37
- invalidText,
38
- warn,
39
- warnText
40
- } = _ref;
31
+ const useNormalizedInputProps = ({
32
+ id,
33
+ readOnly,
34
+ disabled,
35
+ invalid,
36
+ invalidText,
37
+ warn,
38
+ warnText
39
+ }) => {
41
40
  const prefix = usePrefix.usePrefix();
42
41
  const normalizedProps = {
43
42
  disabled: !readOnly && disabled,
@@ -11,11 +11,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var React = require('react');
13
13
 
14
- const useResizeObserver = _ref => {
15
- let {
16
- ref,
17
- onResize
18
- } = _ref;
14
+ const useResizeObserver = ({
15
+ ref,
16
+ onResize
17
+ }) => {
19
18
  const [width, setWidth] = React.useState(-1);
20
19
  const [height, setHeight] = React.useState(-1);
21
20
  const entriesToHandle = React.useRef(null);
@@ -24,9 +24,7 @@ const useSavedCallback = callback => {
24
24
  React.useEffect(() => {
25
25
  savedCallback.current = callback;
26
26
  }, [callback]);
27
- return React.useCallback(function () {
28
- return savedCallback.current ? savedCallback.current(...arguments) : undefined;
29
- }, []);
27
+ return React.useCallback((...args) => savedCallback.current ? savedCallback.current(...args) : undefined, []);
30
28
  };
31
29
 
32
30
  exports.useSavedCallback = useSavedCallback;
@@ -34,8 +34,7 @@ const DOCUMENT_POSITION_BROAD_FOLLOWING = typeof Node !== 'undefined' ? Node.DOC
34
34
  * @returns {boolean} Whether the node or one of its ancestors is in a floating
35
35
  * menu.
36
36
  */
37
- const elementOrParentIsFloatingMenu = function (node) {
38
- let selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
37
+ const elementOrParentIsFloatingMenu = (node, selectorsFloatingMenus = []) => {
39
38
  if (node instanceof Element && typeof node.closest === 'function') {
40
39
  const allSelectorsFloatingMenus = ['.cds--overflow-menu-options', '.cds--tooltip', '.flatpickr-calendar', ...selectorsFloatingMenus];
41
40
  return allSelectorsFloatingMenus.some(selector => !!node.closest(selector));
@@ -47,36 +46,29 @@ const elementOrParentIsFloatingMenu = function (node) {
47
46
  * Ensures the focus is kept within the given container by implementing
48
47
  * "focus-wrap" behavior.
49
48
  */
50
- const wrapFocus = _ref => {
51
- let {
52
- bodyNode,
53
- startTrapNode,
54
- endTrapNode,
55
- currentActiveNode,
56
- oldActiveNode,
57
- selectorsFloatingMenus
58
- } = _ref;
49
+ const wrapFocus = ({
50
+ bodyNode,
51
+ startTrapNode,
52
+ endTrapNode,
53
+ currentActiveNode,
54
+ oldActiveNode,
55
+ selectorsFloatingMenus
56
+ }) => {
59
57
  if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
60
58
  const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
61
59
  if (currentActiveNode === startTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_PRECEDING) {
62
- const tabbableElement = Array.from(bodyNode.querySelectorAll(navigation.selectorTabbable)).reverse().find(_ref2 => {
63
- let {
64
- offsetParent
65
- } = _ref2;
66
- return Boolean(offsetParent);
67
- });
60
+ const tabbableElement = Array.from(bodyNode.querySelectorAll(navigation.selectorTabbable)).reverse().find(({
61
+ offsetParent
62
+ }) => Boolean(offsetParent));
68
63
  if (tabbableElement) {
69
64
  tabbableElement.focus();
70
65
  } else if (bodyNode !== oldActiveNode) {
71
66
  bodyNode.focus();
72
67
  }
73
68
  } else if (currentActiveNode === endTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_FOLLOWING) {
74
- const tabbableElement = Array.from(bodyNode.querySelectorAll(navigation.selectorTabbable)).find(_ref3 => {
75
- let {
76
- offsetParent
77
- } = _ref3;
78
- return Boolean(offsetParent);
79
- });
69
+ const tabbableElement = Array.from(bodyNode.querySelectorAll(navigation.selectorTabbable)).find(({
70
+ offsetParent
71
+ }) => Boolean(offsetParent));
80
72
  if (tabbableElement) {
81
73
  tabbableElement.focus();
82
74
  } else if (bodyNode !== oldActiveNode) {
@@ -92,12 +84,11 @@ const wrapFocus = _ref => {
92
84
  *
93
85
  * Note: This must be called *before* focus moves using `onKeyDown` or similar.
94
86
  */
95
- const wrapFocusWithoutSentinels = _ref4 => {
96
- let {
97
- containerNode,
98
- currentActiveNode,
99
- event
100
- } = _ref4;
87
+ const wrapFocusWithoutSentinels = ({
88
+ containerNode,
89
+ currentActiveNode,
90
+ event
91
+ }) => {
101
92
  if (!containerNode) return;
102
93
  if (['blur', 'focusout', 'focusin', 'focus'].includes(event.type) && process.env.NODE_ENV !== 'production') {
103
94
  throw new Error(`Error: wrapFocusWithoutSentinels(...) called in unsupported ${event.type} event.\n\nCall wrapFocusWithoutSentinels(...) from onKeyDown instead.`);
@@ -13,7 +13,7 @@ var warning = require('../internal/warning.js');
13
13
 
14
14
  const didWarnAboutDeprecation = {};
15
15
  function deprecate(propType, message) {
16
- function checker(props, propName, componentName) {
16
+ function checker(props, propName, componentName, ...rest) {
17
17
  if (props[propName] === undefined) {
18
18
  return;
19
19
  }
@@ -24,9 +24,6 @@ function deprecate(propType, message) {
24
24
  };
25
25
  process.env.NODE_ENV !== "production" ? warning.warning(false, message || `The prop \`${propName}\` has been deprecated for the ` + `${componentName} component. It will be removed in the next major ` + `release`) : void 0;
26
26
  }
27
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
28
- rest[_key - 3] = arguments[_key];
29
- }
30
27
  return propType(props, propName, componentName, ...rest);
31
28
  }
32
29
  return checker;
@@ -13,7 +13,7 @@ var warning = require('../internal/warning.js');
13
13
 
14
14
  const didWarnAboutDeprecation = {};
15
15
  function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
16
- return function checker(props, propName, componentName) {
16
+ return function checker(props, propName, componentName, ...rest) {
17
17
  if (props[propName] === undefined) {
18
18
  return;
19
19
  }
@@ -29,9 +29,6 @@ function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
29
29
  process.env.NODE_ENV !== "production" ? warning.warning(false, message) : void 0;
30
30
  }
31
31
  }
32
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
33
- rest[_key - 3] = arguments[_key];
34
- }
35
32
  return propType(props, propName, componentName, ...rest);
36
33
  };
37
34
  }
@@ -19,13 +19,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
19
19
  */
20
20
  const isRequiredOneOf = propTypes => {
21
21
  const names = Object.keys(propTypes);
22
- const checker = propType => function (props, propName, componentName) {
22
+ const checker = propType => (props, propName, componentName, ...rest) => {
23
23
  if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
24
24
  return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
25
25
  }
26
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
27
- rest[_key - 3] = arguments[_key];
28
- }
29
26
  return propType(props, propName, componentName, ...rest);
30
27
  };
31
28
  return names.reduce((acc, name) => ({
@@ -17,13 +17,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
17
17
  * becomes required if the prop corresponding to the provided prop name exists.
18
18
  */
19
19
  function requiredIfGivenPropIsTruthy(name, propType) {
20
- return function check(props, propName, componentName) {
20
+ return function check(props, propName, componentName, ...rest) {
21
21
  if (process.env.NODE_ENV !== 'production' && props[name] == true && props[propName] == null) {
22
22
  return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` exists.`);
23
23
  }
24
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
25
- rest[_key - 3] = arguments[_key];
26
- }
27
24
  return propType(props, propName, componentName, ...rest);
28
25
  };
29
26
  }
@@ -18,10 +18,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
18
18
  * @param handlers - An array of event handler functions.
19
19
  * @returns A composite event handler.
20
20
  */
21
- const composeEventHandlers = handlers => function (event) {
22
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
23
- args[_key - 1] = arguments[_key];
24
- }
21
+ const composeEventHandlers = handlers => (event, ...args) => {
25
22
  for (const handler of handlers) {
26
23
  if (event.defaultPrevented) {
27
24
  break;
@@ -13,20 +13,15 @@ Object.defineProperty(exports, '__esModule', { value: true });
13
13
  * @param {...Ref<Element>} refs List of React refs to merge.
14
14
  * @returns {Ref<Element>} Merged React ref.
15
15
  */
16
- const mergeRefs = function () {
17
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
18
- refs[_key] = arguments[_key];
19
- }
20
- return el => {
21
- refs.forEach(ref => {
22
- // https://github.com/facebook/react/issues/13029#issuecomment-410002316
23
- if (typeof ref === 'function') {
24
- ref(el);
25
- } else if (Object(ref) === ref) {
26
- ref.current = el;
27
- }
28
- });
29
- };
16
+ const mergeRefs = (...refs) => el => {
17
+ refs.forEach(ref => {
18
+ // https://github.com/facebook/react/issues/13029#issuecomment-410002316
19
+ if (typeof ref === 'function') {
20
+ ref(el);
21
+ } else if (Object(ref) === ref) {
22
+ ref.current = el;
23
+ }
24
+ });
30
25
  };
31
26
  var mergeRefs$1 = mergeRefs;
32
27
 
@@ -10,8 +10,7 @@
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  let lastId = 0;
13
- const uniqueId = function () {
14
- let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';
13
+ const uniqueId = (prefix = 'id') => {
15
14
  lastId++;
16
15
  return `${prefix}${lastId}`;
17
16
  };
@@ -24,22 +24,20 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  * @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
25
25
  * @returns
26
26
  */
27
- const wrapComponent = _ref => {
28
- let {
29
- name,
30
- className: getClassName,
31
- type
32
- } = _ref;
27
+ const wrapComponent = ({
28
+ name,
29
+ className: getClassName,
30
+ type
31
+ }) => {
33
32
  /**
34
33
  *
35
34
  * @param {{ className?: string, [x: string]: any}} param0
36
35
  * @returns
37
36
  */
38
- function Component(_ref2) {
39
- let {
40
- className: baseClassName,
41
- ...other
42
- } = _ref2;
37
+ function Component({
38
+ className: baseClassName,
39
+ ...other
40
+ }) {
43
41
  const prefix = usePrefix.usePrefix();
44
42
  const componentClass = cx__default["default"](typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
45
43
  return /*#__PURE__*/React__default["default"].createElement(type, {