@carbon/react 1.83.0 → 1.84.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 (524) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +909 -874
  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 +50 -36
  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 +74 -65
  133. package/es/components/ModalWrapper/ModalWrapper.js +2 -2
  134. package/es/components/MultiSelect/FilterableMultiSelect.js +67 -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 +39 -46
  146. package/es/components/OverflowMenu/next/index.js +12 -13
  147. package/es/components/PageHeader/PageHeader.d.ts +39 -14
  148. package/es/components/PageHeader/PageHeader.js +187 -81
  149. package/es/components/PageHeader/index.d.ts +2 -2
  150. package/es/components/PageHeader/index.js +1 -1
  151. package/es/components/Pagination/Pagination.Skeleton.js +4 -5
  152. package/es/components/Pagination/Pagination.js +24 -25
  153. package/es/components/Pagination/experimental/PageSelector.js +8 -9
  154. package/es/components/Pagination/experimental/Pagination.js +20 -21
  155. package/es/components/PaginationNav/PaginationNav.js +33 -38
  156. package/es/components/Popover/index.js +26 -28
  157. package/es/components/ProgressBar/ProgressBar.js +11 -12
  158. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
  159. package/es/components/ProgressIndicator/ProgressIndicator.js +29 -32
  160. package/es/components/RadioTile/RadioTile.js +17 -18
  161. package/es/components/Search/Search.Skeleton.js +5 -6
  162. package/es/components/Search/Search.js +26 -29
  163. package/es/components/Select/Select.Skeleton.js +5 -6
  164. package/es/components/Select/Select.js +24 -25
  165. package/es/components/SelectItem/SelectItem.js +8 -9
  166. package/es/components/SelectItemGroup/SelectItemGroup.js +7 -8
  167. package/es/components/ShapeIndicator/index.js +7 -8
  168. package/es/components/SkeletonIcon/SkeletonIcon.js +4 -5
  169. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
  170. package/es/components/SkeletonText/SkeletonText.js +8 -9
  171. package/es/components/Slider/Slider.Skeleton.js +8 -9
  172. package/es/components/Slider/Slider.js +75 -83
  173. package/es/components/Slider/SliderHandles.js +6 -6
  174. package/es/components/StructuredList/StructuredList.Skeleton.js +5 -6
  175. package/es/components/Tabs/Tabs.Skeleton.js +5 -6
  176. package/es/components/Tabs/Tabs.js +83 -98
  177. package/es/components/Tabs/usePressable.js +7 -8
  178. package/es/components/Tag/DismissibleTag.js +16 -17
  179. package/es/components/Tag/OperationalTag.js +10 -11
  180. package/es/components/Tag/SelectableTag.js +13 -14
  181. package/es/components/Tag/Tag.Skeleton.js +5 -6
  182. package/es/components/Tag/Tag.js +19 -20
  183. package/es/components/Text/Text.js +6 -7
  184. package/es/components/Text/TextDirection.js +5 -6
  185. package/es/components/TextArea/TextArea.js +7 -7
  186. package/es/components/TextInput/ControlledPasswordInput.js +24 -25
  187. package/es/components/TextInput/PasswordInput.js +26 -27
  188. package/es/components/TextInput/TextInput.Skeleton.js +5 -6
  189. package/es/components/TextInput/TextInput.js +27 -28
  190. package/es/components/TextInput/util.js +14 -17
  191. package/es/components/Theme/index.js +10 -12
  192. package/es/components/Tile/Tile.js +68 -74
  193. package/es/components/TileGroup/TileGroup.d.ts +4 -4
  194. package/es/components/TileGroup/TileGroup.js +45 -53
  195. package/es/components/TileGroup/index.d.ts +3 -3
  196. package/es/components/Toggle/Toggle.Skeleton.js +4 -5
  197. package/es/components/Toggle/Toggle.js +17 -18
  198. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
  199. package/es/components/Toggletip/index.js +33 -39
  200. package/es/components/Tooltip/DefinitionTooltip.js +13 -14
  201. package/es/components/Tooltip/Tooltip.js +15 -16
  202. package/es/components/TreeView/TreeNode.js +20 -21
  203. package/es/components/TreeView/TreeView.js +14 -16
  204. package/es/components/UIShell/Content.js +6 -7
  205. package/es/components/UIShell/Header.js +5 -6
  206. package/es/components/UIShell/HeaderContainer.js +5 -6
  207. package/es/components/UIShell/HeaderGlobalAction.js +12 -13
  208. package/es/components/UIShell/HeaderMenu.d.ts +10 -112
  209. package/es/components/UIShell/HeaderMenu.js +154 -201
  210. package/es/components/UIShell/HeaderMenuButton.js +10 -11
  211. package/es/components/UIShell/HeaderMenuItem.js +12 -12
  212. package/es/components/UIShell/HeaderName.js +6 -7
  213. package/es/components/UIShell/HeaderNavigation.js +7 -8
  214. package/es/components/UIShell/HeaderPanel.js +9 -10
  215. package/es/components/UIShell/HeaderSideNavItems.js +5 -6
  216. package/es/components/UIShell/Link.js +8 -9
  217. package/es/components/UIShell/SideNav.js +23 -25
  218. package/es/components/UIShell/SideNavDetails.js +6 -7
  219. package/es/components/UIShell/SideNavDivider.js +3 -4
  220. package/es/components/UIShell/SideNavFooter.js +6 -7
  221. package/es/components/UIShell/SideNavHeader.js +5 -6
  222. package/es/components/UIShell/SideNavIcon.js +5 -6
  223. package/es/components/UIShell/SideNavItem.js +5 -6
  224. package/es/components/UIShell/SideNavItems.js +5 -6
  225. package/es/components/UIShell/SideNavLink.js +10 -11
  226. package/es/components/UIShell/SideNavLinkText.js +5 -6
  227. package/es/components/UIShell/SideNavMenu.js +11 -12
  228. package/es/components/UIShell/SkipToContent.js +7 -8
  229. package/es/components/UIShell/Switcher.js +4 -5
  230. package/es/components/UIShell/SwitcherDivider.js +4 -5
  231. package/es/components/UnorderedList/UnorderedList.js +6 -7
  232. package/es/index.js +3 -3
  233. package/es/internal/FloatingMenu.js +26 -28
  234. package/es/internal/Selection.js +15 -17
  235. package/es/internal/getAnnouncement.d.ts +8 -0
  236. package/es/internal/getAnnouncement.js +22 -0
  237. package/es/internal/keyboard/match.js +6 -7
  238. package/es/internal/useControllableState.d.ts +1 -1
  239. package/es/internal/useControllableState.js +8 -9
  240. package/es/internal/useDelayedState.js +1 -2
  241. package/es/internal/useDocumentLang.d.ts +12 -0
  242. package/es/internal/useId.js +2 -4
  243. package/es/internal/useMatchMedia.js +1 -2
  244. package/es/internal/useMergedRefs.d.ts +1 -1
  245. package/es/internal/useNoInteractiveChildren.js +2 -4
  246. package/es/internal/useNormalizedInputProps.js +9 -10
  247. package/es/internal/useOverflowItems.d.ts +29 -0
  248. package/es/internal/useOverflowItems.js +122 -0
  249. package/es/internal/useResizeObserver.js +4 -5
  250. package/es/internal/useSavedCallback.js +1 -3
  251. package/es/internal/wrapFocus.js +20 -29
  252. package/es/prop-types/deprecate.js +1 -4
  253. package/es/prop-types/deprecateValuesWithin.js +1 -4
  254. package/es/prop-types/isRequiredOneOf.js +1 -4
  255. package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  256. package/es/tools/events.js +1 -4
  257. package/es/tools/mergeRefs.js +9 -14
  258. package/es/tools/uniqueId.js +1 -2
  259. package/es/tools/wrapComponent.js +9 -11
  260. package/lib/components/AILabel/index.js +27 -30
  261. package/lib/components/AISkeleton/AISkeletonIcon.js +4 -5
  262. package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
  263. package/lib/components/AISkeleton/AISkeletonText.js +4 -5
  264. package/lib/components/Accordion/Accordion.Skeleton.js +9 -10
  265. package/lib/components/Accordion/Accordion.js +10 -11
  266. package/lib/components/Accordion/AccordionItem.js +13 -14
  267. package/lib/components/Accordion/AccordionProvider.js +4 -5
  268. package/lib/components/AspectRatio/AspectRatio.js +7 -8
  269. package/lib/components/BadgeIndicator/index.js +5 -6
  270. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
  271. package/lib/components/Button/Button.Skeleton.js +7 -8
  272. package/lib/components/Button/ButtonBase.js +23 -24
  273. package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -6
  274. package/lib/components/ChatButton/ChatButton.js +11 -12
  275. package/lib/components/Checkbox/Checkbox.Skeleton.js +4 -5
  276. package/lib/components/Checkbox/Checkbox.js +19 -20
  277. package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -17
  278. package/lib/components/ClassPrefix/index.js +4 -5
  279. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
  280. package/lib/components/CodeSnippet/CodeSnippet.js +25 -26
  281. package/lib/components/ComboBox/ComboBox.js +24 -30
  282. package/lib/components/ComboBox/tools/filter.js +9 -12
  283. package/lib/components/ComboButton/index.js +16 -18
  284. package/lib/components/ComposedModal/ComposedModal.js +50 -36
  285. package/lib/components/ComposedModal/ModalFooter.js +37 -42
  286. package/lib/components/ComposedModal/ModalHeader.js +14 -15
  287. package/lib/components/ContainedList/ContainedList.js +10 -11
  288. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
  289. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +9 -29
  290. package/lib/components/ContentSwitcher/ContentSwitcher.js +94 -126
  291. package/lib/components/ContentSwitcher/index.d.ts +3 -4
  292. package/lib/components/ContextMenu/useContextMenu.js +1 -2
  293. package/lib/components/Copy/Copy.js +11 -12
  294. package/lib/components/CopyButton/CopyButton.js +10 -11
  295. package/lib/components/DataTable/DataTable.js +45 -53
  296. package/lib/components/DataTable/Table.js +15 -18
  297. package/lib/components/DataTable/TableBatchAction.js +8 -11
  298. package/lib/components/DataTable/TableBatchActions.js +18 -20
  299. package/lib/components/DataTable/TableBody.js +8 -11
  300. package/lib/components/DataTable/TableContainer.js +9 -10
  301. package/lib/components/DataTable/TableDecoratorRow.js +4 -5
  302. package/lib/components/DataTable/TableExpandHeader.js +14 -15
  303. package/lib/components/DataTable/TableExpandRow.js +13 -14
  304. package/lib/components/DataTable/TableExpandedRow.js +6 -7
  305. package/lib/components/DataTable/TableHeader.js +15 -16
  306. package/lib/components/DataTable/TableSelectAll.js +11 -12
  307. package/lib/components/DataTable/TableSelectRow.js +12 -13
  308. package/lib/components/DataTable/TableSlugRow.js +4 -5
  309. package/lib/components/DataTable/TableToolbar.js +7 -8
  310. package/lib/components/DataTable/TableToolbarMenu.js +8 -9
  311. package/lib/components/DataTable/TableToolbarSearch.js +22 -24
  312. package/lib/components/DataTable/state/sorting.js +3 -4
  313. package/lib/components/DataTable/tools/filter.js +10 -12
  314. package/lib/components/DataTable/tools/normalize.js +6 -8
  315. package/lib/components/DataTable/tools/sorting.js +24 -30
  316. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
  317. package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -8
  318. package/lib/components/DatePicker/DatePicker.js +87 -64
  319. package/lib/components/DatePickerInput/DatePickerInput.js +5 -6
  320. package/lib/components/Dialog/index.d.ts +193 -8
  321. package/lib/components/Dialog/index.js +457 -33
  322. package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
  323. package/lib/components/Dropdown/Dropdown.js +40 -43
  324. package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -2
  325. package/lib/components/ExpandableSearch/ExpandableSearch.js +9 -10
  326. package/lib/components/FeatureFlags/index.js +11 -12
  327. package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -5
  328. package/lib/components/FileUploader/FileUploader.js +22 -24
  329. package/lib/components/FileUploader/FileUploaderButton.js +16 -17
  330. package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
  331. package/lib/components/FileUploader/FileUploaderItem.js +13 -14
  332. package/lib/components/FileUploader/Filename.js +9 -10
  333. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
  334. package/lib/components/FluidComboBox/FluidComboBox.js +5 -6
  335. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
  336. package/lib/components/FluidDatePicker/FluidDatePicker.js +10 -11
  337. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
  338. package/lib/components/FluidDropdown/FluidDropdown.js +5 -6
  339. package/lib/components/FluidForm/FluidForm.js +5 -6
  340. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
  341. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
  342. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
  343. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
  344. package/lib/components/FluidNumberInput/FluidNumberInput.js +38 -5
  345. package/lib/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
  346. package/lib/components/FluidSearch/FluidSearch.js +4 -5
  347. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
  348. package/lib/components/FluidSelect/FluidSelect.js +5 -6
  349. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
  350. package/lib/components/FluidTextArea/FluidTextArea.js +4 -5
  351. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
  352. package/lib/components/FluidTextInput/FluidTextInput.js +5 -6
  353. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
  354. package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -12
  355. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
  356. package/lib/components/Form/Form.js +5 -6
  357. package/lib/components/FormGroup/FormGroup.js +11 -12
  358. package/lib/components/FormItem/FormItem.js +5 -6
  359. package/lib/components/FormLabel/FormLabel.js +6 -7
  360. package/lib/components/Grid/CSSGrid.js +17 -19
  361. package/lib/components/Grid/Column.js +28 -27
  362. package/lib/components/Grid/ColumnHang.js +6 -7
  363. package/lib/components/Grid/FlexGrid.js +9 -10
  364. package/lib/components/Grid/GridContext.js +5 -6
  365. package/lib/components/Grid/Row.js +8 -9
  366. package/lib/components/Heading/index.js +5 -6
  367. package/lib/components/Icon/Icon.Skeleton.js +4 -5
  368. package/lib/components/IconButton/index.js +20 -21
  369. package/lib/components/IconIndicator/index.js +7 -8
  370. package/lib/components/IdPrefix/index.js +4 -5
  371. package/lib/components/InlineLoading/InlineLoading.js +9 -10
  372. package/lib/components/Layer/index.js +8 -9
  373. package/lib/components/Layout/index.js +21 -26
  374. package/lib/components/LayoutDirection/LayoutDirection.js +6 -7
  375. package/lib/components/Link/Link.d.ts +1 -1
  376. package/lib/components/Link/Link.js +14 -15
  377. package/lib/components/ListBox/ListBoxField.js +6 -7
  378. package/lib/components/ListBox/ListBoxMenu.js +5 -6
  379. package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
  380. package/lib/components/ListBox/ListBoxMenuItem.js +8 -10
  381. package/lib/components/ListBox/ListBoxSelection.js +8 -9
  382. package/lib/components/ListBox/next/ListBoxSelection.js +9 -10
  383. package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
  384. package/lib/components/ListItem/ListItem.js +5 -6
  385. package/lib/components/Loading/Loading.js +8 -9
  386. package/lib/components/Menu/Menu.js +23 -24
  387. package/lib/components/Menu/MenuItem.js +39 -44
  388. package/lib/components/MenuButton/index.js +16 -18
  389. package/lib/components/Modal/Modal.js +74 -65
  390. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  391. package/lib/components/MultiSelect/FilterableMultiSelect.js +66 -47
  392. package/lib/components/MultiSelect/MultiSelect.js +43 -45
  393. package/lib/components/MultiSelect/tools/sorting.js +11 -15
  394. package/lib/components/Notification/Notification.js +96 -105
  395. package/lib/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
  396. package/lib/components/NumberInput/NumberFormatPropTypes.js +48 -0
  397. package/lib/components/NumberInput/NumberInput.Skeleton.js +6 -7
  398. package/lib/components/NumberInput/NumberInput.d.ts +39 -3
  399. package/lib/components/NumberInput/NumberInput.js +173 -43
  400. package/lib/components/OrderedList/OrderedList.js +7 -8
  401. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  402. package/lib/components/OverflowMenu/OverflowMenu.js +39 -46
  403. package/lib/components/OverflowMenu/next/index.js +12 -13
  404. package/lib/components/PageHeader/PageHeader.d.ts +39 -14
  405. package/lib/components/PageHeader/PageHeader.js +185 -81
  406. package/lib/components/PageHeader/index.d.ts +2 -2
  407. package/lib/components/PageHeader/index.js +0 -2
  408. package/lib/components/Pagination/Pagination.Skeleton.js +4 -5
  409. package/lib/components/Pagination/Pagination.js +24 -25
  410. package/lib/components/Pagination/experimental/PageSelector.js +8 -9
  411. package/lib/components/Pagination/experimental/Pagination.js +20 -21
  412. package/lib/components/PaginationNav/PaginationNav.js +33 -38
  413. package/lib/components/Popover/index.js +26 -28
  414. package/lib/components/ProgressBar/ProgressBar.js +11 -12
  415. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
  416. package/lib/components/ProgressIndicator/ProgressIndicator.js +29 -32
  417. package/lib/components/RadioTile/RadioTile.js +17 -18
  418. package/lib/components/Search/Search.Skeleton.js +5 -6
  419. package/lib/components/Search/Search.js +26 -29
  420. package/lib/components/Select/Select.Skeleton.js +5 -6
  421. package/lib/components/Select/Select.js +24 -25
  422. package/lib/components/SelectItem/SelectItem.js +8 -9
  423. package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -8
  424. package/lib/components/ShapeIndicator/index.js +7 -8
  425. package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -5
  426. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
  427. package/lib/components/SkeletonText/SkeletonText.js +8 -9
  428. package/lib/components/Slider/Slider.Skeleton.js +8 -9
  429. package/lib/components/Slider/Slider.js +75 -83
  430. package/lib/components/Slider/SliderHandles.js +6 -6
  431. package/lib/components/StructuredList/StructuredList.Skeleton.js +5 -6
  432. package/lib/components/Tabs/Tabs.Skeleton.js +5 -6
  433. package/lib/components/Tabs/Tabs.js +83 -98
  434. package/lib/components/Tabs/usePressable.js +7 -8
  435. package/lib/components/Tag/DismissibleTag.js +16 -17
  436. package/lib/components/Tag/OperationalTag.js +10 -11
  437. package/lib/components/Tag/SelectableTag.js +13 -14
  438. package/lib/components/Tag/Tag.Skeleton.js +5 -6
  439. package/lib/components/Tag/Tag.js +19 -20
  440. package/lib/components/Text/Text.js +6 -7
  441. package/lib/components/Text/TextDirection.js +5 -6
  442. package/lib/components/TextArea/TextArea.js +7 -7
  443. package/lib/components/TextInput/ControlledPasswordInput.js +24 -25
  444. package/lib/components/TextInput/PasswordInput.js +26 -27
  445. package/lib/components/TextInput/TextInput.Skeleton.js +5 -6
  446. package/lib/components/TextInput/TextInput.js +27 -28
  447. package/lib/components/TextInput/util.js +14 -17
  448. package/lib/components/Theme/index.js +10 -12
  449. package/lib/components/Tile/Tile.js +68 -74
  450. package/lib/components/TileGroup/TileGroup.d.ts +4 -4
  451. package/lib/components/TileGroup/TileGroup.js +44 -52
  452. package/lib/components/TileGroup/index.d.ts +3 -3
  453. package/lib/components/Toggle/Toggle.Skeleton.js +4 -5
  454. package/lib/components/Toggle/Toggle.js +17 -18
  455. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
  456. package/lib/components/Toggletip/index.js +33 -39
  457. package/lib/components/Tooltip/DefinitionTooltip.js +13 -14
  458. package/lib/components/Tooltip/Tooltip.js +15 -16
  459. package/lib/components/TreeView/TreeNode.js +20 -21
  460. package/lib/components/TreeView/TreeView.js +14 -16
  461. package/lib/components/UIShell/Content.js +6 -7
  462. package/lib/components/UIShell/Header.js +5 -6
  463. package/lib/components/UIShell/HeaderContainer.js +5 -6
  464. package/lib/components/UIShell/HeaderGlobalAction.js +12 -13
  465. package/lib/components/UIShell/HeaderMenu.d.ts +10 -112
  466. package/lib/components/UIShell/HeaderMenu.js +152 -199
  467. package/lib/components/UIShell/HeaderMenuButton.js +10 -11
  468. package/lib/components/UIShell/HeaderMenuItem.js +12 -12
  469. package/lib/components/UIShell/HeaderName.js +6 -7
  470. package/lib/components/UIShell/HeaderNavigation.js +7 -8
  471. package/lib/components/UIShell/HeaderPanel.js +9 -10
  472. package/lib/components/UIShell/HeaderSideNavItems.js +5 -6
  473. package/lib/components/UIShell/Link.js +8 -9
  474. package/lib/components/UIShell/SideNav.js +23 -25
  475. package/lib/components/UIShell/SideNavDetails.js +6 -7
  476. package/lib/components/UIShell/SideNavDivider.js +3 -4
  477. package/lib/components/UIShell/SideNavFooter.js +6 -7
  478. package/lib/components/UIShell/SideNavHeader.js +5 -6
  479. package/lib/components/UIShell/SideNavIcon.js +5 -6
  480. package/lib/components/UIShell/SideNavItem.js +5 -6
  481. package/lib/components/UIShell/SideNavItems.js +5 -6
  482. package/lib/components/UIShell/SideNavLink.js +10 -11
  483. package/lib/components/UIShell/SideNavLinkText.js +5 -6
  484. package/lib/components/UIShell/SideNavMenu.js +11 -12
  485. package/lib/components/UIShell/SkipToContent.js +7 -8
  486. package/lib/components/UIShell/Switcher.js +4 -5
  487. package/lib/components/UIShell/SwitcherDivider.js +4 -5
  488. package/lib/components/UnorderedList/UnorderedList.js +6 -7
  489. package/lib/index.js +36 -36
  490. package/lib/internal/FloatingMenu.js +26 -28
  491. package/lib/internal/Selection.js +15 -17
  492. package/lib/internal/getAnnouncement.d.ts +8 -0
  493. package/lib/internal/getAnnouncement.js +26 -0
  494. package/lib/internal/keyboard/match.js +6 -7
  495. package/lib/internal/useControllableState.d.ts +1 -1
  496. package/lib/internal/useControllableState.js +8 -9
  497. package/lib/internal/useDelayedState.js +1 -2
  498. package/lib/internal/useDocumentLang.d.ts +12 -0
  499. package/lib/internal/useId.js +2 -4
  500. package/lib/internal/useMatchMedia.js +1 -2
  501. package/lib/internal/useMergedRefs.d.ts +1 -1
  502. package/lib/internal/useNoInteractiveChildren.js +2 -4
  503. package/lib/internal/useNormalizedInputProps.js +9 -10
  504. package/lib/internal/useOverflowItems.d.ts +29 -0
  505. package/lib/internal/useOverflowItems.js +126 -0
  506. package/lib/internal/useResizeObserver.js +4 -5
  507. package/lib/internal/useSavedCallback.js +1 -3
  508. package/lib/internal/wrapFocus.js +20 -29
  509. package/lib/prop-types/deprecate.js +1 -4
  510. package/lib/prop-types/deprecateValuesWithin.js +1 -4
  511. package/lib/prop-types/isRequiredOneOf.js +1 -4
  512. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  513. package/lib/tools/events.js +1 -4
  514. package/lib/tools/mergeRefs.js +9 -14
  515. package/lib/tools/uniqueId.js +1 -2
  516. package/lib/tools/wrapComponent.js +9 -11
  517. package/package.json +21 -19
  518. package/telemetry.yml +25 -1
  519. package/es/components/ContentSwitcher/index.js +0 -13
  520. package/es/feature-flags.d.ts +0 -7
  521. package/es/internal/useAnnouncer.js +0 -21
  522. package/lib/components/ContentSwitcher/index.js +0 -18
  523. package/lib/feature-flags.d.ts +0 -7
  524. package/lib/internal/useAnnouncer.js +0 -25
@@ -33,8 +33,7 @@ import { Text } from '../Text/Text.js';
33
33
  * @param {func} callback - function to be called
34
34
  * @param {bool} override - escape hatch to conditionally call the callback
35
35
  */
36
- function useEscapeToClose(ref, callback) {
37
- let override = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
36
+ function useEscapeToClose(ref, callback, override = true) {
38
37
  const handleKeyDown = event => {
39
38
  // The callback should only be called when focus is on or within the container
40
39
  const elementContainsFocus = ref.current && document.activeElement === ref.current || ref.current?.contains(document.activeElement);
@@ -49,14 +48,13 @@ function useEscapeToClose(ref, callback) {
49
48
  return () => document.removeEventListener('keydown', handleKeyDown, false);
50
49
  });
51
50
  }
52
- function NotificationActionButton(_ref) {
53
- let {
54
- children,
55
- className: customClassName,
56
- onClick,
57
- inline,
58
- ...rest
59
- } = _ref;
51
+ function NotificationActionButton({
52
+ children,
53
+ className: customClassName,
54
+ onClick,
55
+ inline,
56
+ ...rest
57
+ }) {
60
58
  const prefix = usePrefix();
61
59
  const className = cx(customClassName, {
62
60
  [`${prefix}--actionable-notification__action-button`]: true
@@ -92,17 +90,16 @@ NotificationActionButton.propTypes = {
92
90
  * ==================
93
91
  */
94
92
 
95
- function NotificationButton(_ref2) {
96
- let {
97
- 'aria-label': ariaLabel = 'close notification',
98
- ariaLabel: deprecatedAriaLabel,
99
- className,
100
- type = 'button',
101
- renderIcon: IconTag = Close,
102
- name,
103
- notificationType = 'toast',
104
- ...rest
105
- } = _ref2;
93
+ function NotificationButton({
94
+ 'aria-label': ariaLabel = 'close notification',
95
+ ariaLabel: deprecatedAriaLabel,
96
+ className,
97
+ type = 'button',
98
+ renderIcon: IconTag = Close,
99
+ name,
100
+ notificationType = 'toast',
101
+ ...rest
102
+ }) {
106
103
  const prefix = usePrefix();
107
104
  const buttonClassName = cx(className, {
108
105
  [`${prefix}--${notificationType}-notification__close-button`]: notificationType
@@ -167,12 +164,11 @@ const iconTypes = {
167
164
  info: InformationFilled,
168
165
  ['info-square']: InformationSquareFilled
169
166
  };
170
- function NotificationIcon(_ref3) {
171
- let {
172
- iconDescription,
173
- kind,
174
- notificationType
175
- } = _ref3;
167
+ function NotificationIcon({
168
+ iconDescription,
169
+ kind,
170
+ notificationType
171
+ }) {
176
172
  const prefix = usePrefix();
177
173
  const IconForKind = iconTypes[kind];
178
174
  if (!IconForKind) {
@@ -194,26 +190,25 @@ NotificationIcon.propTypes = {
194
190
  * =================
195
191
  */
196
192
 
197
- function ToastNotification(_ref4) {
198
- let {
199
- ['aria-label']: ariaLabel,
200
- // @ts-expect-error: deprecated prop
201
- ariaLabel: deprecatedAriaLabel,
202
- role = 'status',
203
- onClose,
204
- onCloseButtonClick = noopFn,
205
- statusIconDescription,
206
- className,
207
- children,
208
- kind = 'error',
209
- lowContrast,
210
- hideCloseButton = false,
211
- timeout = 0,
212
- title,
213
- caption,
214
- subtitle,
215
- ...rest
216
- } = _ref4;
193
+ function ToastNotification({
194
+ ['aria-label']: ariaLabel,
195
+ // @ts-expect-error: deprecated prop
196
+ ariaLabel: deprecatedAriaLabel,
197
+ role = 'status',
198
+ onClose,
199
+ onCloseButtonClick = noopFn,
200
+ statusIconDescription,
201
+ className,
202
+ children,
203
+ kind = 'error',
204
+ lowContrast,
205
+ hideCloseButton = false,
206
+ timeout = 0,
207
+ title,
208
+ caption,
209
+ subtitle,
210
+ ...rest
211
+ }) {
217
212
  const [isOpen, setIsOpen] = useState(true);
218
213
  const prefix = usePrefix();
219
214
  const containerClassName = cx(className, {
@@ -351,22 +346,21 @@ ToastNotification.propTypes = {
351
346
  * ==================
352
347
  */
353
348
 
354
- function InlineNotification(_ref5) {
355
- let {
356
- ['aria-label']: ariaLabel,
357
- children,
358
- title,
359
- subtitle,
360
- role = 'status',
361
- onClose,
362
- onCloseButtonClick = noopFn,
363
- statusIconDescription,
364
- className,
365
- kind = 'error',
366
- lowContrast,
367
- hideCloseButton = false,
368
- ...rest
369
- } = _ref5;
349
+ function InlineNotification({
350
+ ['aria-label']: ariaLabel,
351
+ children,
352
+ title,
353
+ subtitle,
354
+ role = 'status',
355
+ onClose,
356
+ onCloseButtonClick = noopFn,
357
+ statusIconDescription,
358
+ className,
359
+ kind = 'error',
360
+ lowContrast,
361
+ hideCloseButton = false,
362
+ ...rest
363
+ }) {
370
364
  const [isOpen, setIsOpen] = useState(true);
371
365
  const prefix = usePrefix();
372
366
  const containerClassName = cx(className, {
@@ -473,29 +467,28 @@ InlineNotification.propTypes = {
473
467
  * ======================
474
468
  */
475
469
 
476
- function ActionableNotification(_ref6) {
477
- let {
478
- actionButtonLabel,
479
- ['aria-label']: ariaLabel,
480
- // @ts-expect-error: deprecated prop
481
- ariaLabel: deprecatedAriaLabel,
482
- children,
483
- role = 'alertdialog',
484
- onActionButtonClick,
485
- onClose,
486
- onCloseButtonClick = noopFn,
487
- statusIconDescription,
488
- className,
489
- inline = false,
490
- kind = 'error',
491
- lowContrast,
492
- hideCloseButton = false,
493
- hasFocus = true,
494
- closeOnEscape = true,
495
- title,
496
- subtitle,
497
- ...rest
498
- } = _ref6;
470
+ function ActionableNotification({
471
+ actionButtonLabel,
472
+ ['aria-label']: ariaLabel,
473
+ // @ts-expect-error: deprecated prop
474
+ ariaLabel: deprecatedAriaLabel,
475
+ children,
476
+ role = 'alertdialog',
477
+ onActionButtonClick,
478
+ onClose,
479
+ onCloseButtonClick = noopFn,
480
+ statusIconDescription,
481
+ className,
482
+ inline = false,
483
+ kind = 'error',
484
+ lowContrast,
485
+ hideCloseButton = false,
486
+ hasFocus = true,
487
+ closeOnEscape = true,
488
+ title,
489
+ subtitle,
490
+ ...rest
491
+ }) {
499
492
  const [isOpen, setIsOpen] = useState(true);
500
493
  const prefix = usePrefix();
501
494
  const id = useId('actionable-notification');
@@ -518,11 +511,10 @@ function ActionableNotification(_ref6) {
518
511
  button?.focus();
519
512
  }
520
513
  });
521
- function handleBlur(_ref7) {
522
- let {
523
- target: oldActiveNode,
524
- relatedTarget: currentActiveNode
525
- } = _ref7;
514
+ function handleBlur({
515
+ target: oldActiveNode,
516
+ relatedTarget: currentActiveNode
517
+ }) {
526
518
  if (isOpen && currentActiveNode && oldActiveNode && role === 'alertdialog') {
527
519
  const {
528
520
  current: bodyNode
@@ -708,20 +700,19 @@ const propMappingFunction = deprecatedValue => {
708
700
  };
709
701
  return mapping[deprecatedValue];
710
702
  };
711
- function Callout(_ref8) {
712
- let {
713
- actionButtonLabel,
714
- children,
715
- onActionButtonClick,
716
- title,
717
- titleId,
718
- subtitle,
719
- statusIconDescription,
720
- className,
721
- kind = 'info',
722
- lowContrast,
723
- ...rest
724
- } = _ref8;
703
+ function Callout({
704
+ actionButtonLabel,
705
+ children,
706
+ onActionButtonClick,
707
+ title,
708
+ titleId,
709
+ subtitle,
710
+ statusIconDescription,
711
+ className,
712
+ kind = 'info',
713
+ lowContrast,
714
+ ...rest
715
+ }) {
725
716
  const prefix = usePrefix();
726
717
  const containerClassName = cx(className, {
727
718
  [`${prefix}--actionable-notification`]: true,
@@ -0,0 +1,29 @@
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
+ import PropTypes from 'prop-types';
8
+ export declare const NumberFormatOptionsPropType: PropTypes.Requireable<PropTypes.InferProps<{
9
+ localeMatcher: PropTypes.Requireable<string>;
10
+ style: PropTypes.Requireable<string>;
11
+ currency: PropTypes.Requireable<string>;
12
+ currencyDisplay: PropTypes.Requireable<string>;
13
+ currencySign: PropTypes.Requireable<string>;
14
+ unit: PropTypes.Requireable<string>;
15
+ unitDisplay: PropTypes.Requireable<string>;
16
+ notation: PropTypes.Requireable<string>;
17
+ compactDisplay: PropTypes.Requireable<string>;
18
+ signDisplay: PropTypes.Requireable<string>;
19
+ minimumIntegerDigits: PropTypes.Requireable<number>;
20
+ minimumFractionDigits: PropTypes.Requireable<number>;
21
+ maximumFractionDigits: PropTypes.Requireable<number>;
22
+ minimumSignificantDigits: PropTypes.Requireable<number>;
23
+ maximumSignificantDigits: PropTypes.Requireable<number>;
24
+ useGrouping: PropTypes.Requireable<NonNullable<string | boolean | null | undefined>>;
25
+ numberingSystem: PropTypes.Requireable<string>;
26
+ roundingIncrement: PropTypes.Requireable<number>;
27
+ roundingMode: PropTypes.Requireable<string>;
28
+ trailingZeroDisplay: PropTypes.Requireable<string>;
29
+ }>>;
@@ -0,0 +1,40 @@
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
+ import PropTypes from 'prop-types';
9
+
10
+ const NumberFormatOptionsPropType = PropTypes.shape({
11
+ // Locale Options
12
+ localeMatcher: PropTypes.oneOf(['best fit', 'lookup']),
13
+ // Style Options
14
+ style: PropTypes.oneOf(['decimal', 'currency', 'percent', 'unit']),
15
+ currency: PropTypes.string,
16
+ // e.g., 'USD'
17
+ currencyDisplay: PropTypes.oneOf(['symbol', 'narrowSymbol', 'code', 'name']),
18
+ currencySign: PropTypes.oneOf(['standard', 'accounting']),
19
+ unit: PropTypes.string,
20
+ // e.g., 'liter', 'mile-per-hour'
21
+ unitDisplay: PropTypes.oneOf(['short', 'narrow', 'long']),
22
+ notation: PropTypes.oneOf(['standard', 'scientific', 'engineering', 'compact']),
23
+ compactDisplay: PropTypes.oneOf(['short', 'long']),
24
+ signDisplay: PropTypes.oneOf(['auto', 'never', 'always', 'exceptZero']),
25
+ // Digit Options
26
+ minimumIntegerDigits: PropTypes.number,
27
+ minimumFractionDigits: PropTypes.number,
28
+ maximumFractionDigits: PropTypes.number,
29
+ minimumSignificantDigits: PropTypes.number,
30
+ maximumSignificantDigits: PropTypes.number,
31
+ useGrouping: PropTypes.oneOfType([PropTypes.bool, PropTypes.oneOf(['always', 'auto', 'min2'])]),
32
+ // Misc/Other Options
33
+ numberingSystem: PropTypes.string,
34
+ // e.g., 'latn', 'arab'
35
+ roundingIncrement: PropTypes.number,
36
+ roundingMode: PropTypes.oneOf(['ceil', 'floor', 'expand', 'trunc', 'halfCeil', 'halfFloor', 'halfExpand', 'halfTrunc', 'halfEven']),
37
+ trailingZeroDisplay: PropTypes.oneOf(['auto', 'stripIfInteger'])
38
+ });
39
+
40
+ export { NumberFormatOptionsPropType };
@@ -11,13 +11,12 @@ import React from 'react';
11
11
  import cx from 'classnames';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
 
14
- function NumberInputSkeleton(_ref) {
15
- let {
16
- hideLabel,
17
- className,
18
- size = 'md',
19
- ...rest
20
- } = _ref;
14
+ function NumberInputSkeleton({
15
+ hideLabel,
16
+ className,
17
+ size = 'md',
18
+ ...rest
19
+ }) {
21
20
  const prefix = usePrefix();
22
21
  return /*#__PURE__*/React.createElement("div", _extends({
23
22
  className: cx(`${prefix}--form-item`, className)
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import React, { ReactNode } from 'react';
8
8
  import { TranslateWithId } from '../../types/common';
9
+ import { type NumberFormatOptions } from '@carbon/utilities';
9
10
  export declare const translationIds: {
10
11
  readonly 'increment.number': "increment.number";
11
12
  readonly 'decrement.number': "decrement.number";
@@ -25,7 +26,8 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
25
26
  */
26
27
  className?: string;
27
28
  /**
28
- * **Experimental**: Provide a `decorator` component to be rendered inside the `TextInput` component
29
+ * **Experimental**: Provide a `decorator` component to be rendered inside the
30
+ * `TextInput` component
29
31
  */
30
32
  decorator?: ReactNode;
31
33
  /**
@@ -40,6 +42,13 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
40
42
  * Specify if the control should be disabled, or not
41
43
  */
42
44
  disabled?: boolean;
45
+ /**
46
+ * **Experimental:** Specify Intl.NumberFormat options applied to internal
47
+ * number parsing and formatting. Use with `type="text"`, has no effect when
48
+ * `type="number"`.
49
+ * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#options
50
+ */
51
+ formatOptions?: NumberFormatOptions;
43
52
  /**
44
53
  * Provide text that is used alongside the control label for additional help
45
54
  */
@@ -60,6 +69,12 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
60
69
  * Specify a custom `id` for the input
61
70
  */
62
71
  id: string;
72
+ /**
73
+ * Instruct the browser which keyboard to display on mobile devices. Note that
74
+ * standard numeric keyboards vary across devices and operating systems.
75
+ * @see https://css-tricks.com/everything-you-ever-wanted-to-know-about-inputmode/
76
+ */
77
+ inputMode?: React.HTMLAttributes<HTMLInputElement>['inputMode'];
63
78
  /**
64
79
  * Specify if the currently value is invalid.
65
80
  */
@@ -77,9 +92,16 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
77
92
  * `true` to use the light version.
78
93
  *
79
94
  * @deprecated The `light` prop for `NumberInput` is no longer needed and has
80
- * been deprecated in v11 in favor of the new `Layer` component. It will be moved in the next major release.
95
+ * been deprecated in v11 in favor of the new `Layer` component. It will be
96
+ * removed in the next major release.
81
97
  */
82
98
  light?: boolean;
99
+ /**
100
+ * **Experimental:** Specify a [BCP47](https://www.ietf.org/rfc/bcp/bcp47.txt)
101
+ * language code for parsing and formatting. Use with `type="text"`, has no
102
+ * effect when `type="number"`.
103
+ */
104
+ locale?: string;
83
105
  /**
84
106
  * The maximum value.
85
107
  */
@@ -91,9 +113,12 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
91
113
  /**
92
114
  * Provide an optional handler that is called when the internal state of
93
115
  * NumberInput changes. This handler is called with event and state info.
116
+ * When type="number", this is called on every change of the input.
117
+ * When type="text", this is only called on blur after the number has been
118
+ * parsed and formatted.
94
119
  * `(event, { value, direction }) => void`
95
120
  */
96
- onChange?: (event: React.MouseEvent<HTMLButtonElement>, state: {
121
+ onChange?: (event: React.MouseEvent<HTMLButtonElement> | React.FocusEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>, state: {
97
122
  value: number | string;
98
123
  direction: string;
99
124
  }) => void;
@@ -108,6 +133,11 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
108
133
  * Provide an optional function to be called when a key is pressed in the number input
109
134
  */
110
135
  onKeyUp?: React.KeyboardEventHandler<HTMLInputElement>;
136
+ /**
137
+ * When type="text", provide an optional pattern to restrict user input. Has
138
+ * no effect when type="number".
139
+ */
140
+ pattern?: string;
111
141
  /**
112
142
  * Specify if the component should be read-only
113
143
  */
@@ -125,6 +155,12 @@ export interface NumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInp
125
155
  * Specify how much the values should increase/decrease upon clicking on up/down button
126
156
  */
127
157
  step?: number;
158
+ /**
159
+ * **Experimental**: Specify if the input should be of type text or number.
160
+ * Use type="text" with `locale`, `formatOptions`, and guide user input with
161
+ * `pattern` and `inputMode`.
162
+ */
163
+ type?: 'number' | 'text';
128
164
  /**
129
165
  * Specify the value of the input
130
166
  */