@carbon/react 1.83.0-rc.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 (635) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +895 -790
  2. package/README.md +1 -1
  3. package/es/components/AILabel/index.js +37 -40
  4. package/es/components/AISkeleton/AISkeletonIcon.js +6 -7
  5. package/es/components/AISkeleton/AISkeletonPlaceholder.js +6 -7
  6. package/es/components/AISkeleton/AISkeletonText.js +6 -7
  7. package/es/components/Accordion/Accordion.Skeleton.js +24 -25
  8. package/es/components/Accordion/Accordion.js +13 -14
  9. package/es/components/Accordion/AccordionItem.js +22 -23
  10. package/es/components/Accordion/AccordionProvider.js +6 -7
  11. package/es/components/AspectRatio/AspectRatio.js +9 -10
  12. package/es/components/BadgeIndicator/index.js +7 -8
  13. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +9 -10
  14. package/es/components/Breadcrumb/Breadcrumb.js +3 -3
  15. package/es/components/Breadcrumb/BreadcrumbItem.js +9 -9
  16. package/es/components/Button/Button.Skeleton.js +10 -11
  17. package/es/components/Button/Button.js +5 -5
  18. package/es/components/Button/ButtonBase.js +27 -28
  19. package/es/components/ButtonSet/ButtonSet.js +2 -2
  20. package/es/components/ChatButton/ChatButton.Skeleton.js +7 -8
  21. package/es/components/ChatButton/ChatButton.js +13 -14
  22. package/es/components/Checkbox/Checkbox.Skeleton.js +8 -9
  23. package/es/components/Checkbox/Checkbox.js +33 -34
  24. package/es/components/CheckboxGroup/CheckboxGroup.js +28 -29
  25. package/es/components/ClassPrefix/index.js +6 -7
  26. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +12 -13
  27. package/es/components/CodeSnippet/CodeSnippet.js +41 -42
  28. package/es/components/ComboBox/ComboBox.js +42 -48
  29. package/es/components/ComboBox/tools/filter.js +9 -12
  30. package/es/components/ComboButton/index.js +22 -24
  31. package/es/components/ComposedModal/ComposedModal.js +49 -52
  32. package/es/components/ComposedModal/ModalFooter.js +42 -47
  33. package/es/components/ComposedModal/ModalHeader.js +21 -22
  34. package/es/components/ContainedList/ContainedList.js +17 -18
  35. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +16 -17
  36. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
  37. package/es/components/ContentSwitcher/ContentSwitcher.js +100 -126
  38. package/es/components/ContentSwitcher/index.d.ts +3 -4
  39. package/es/components/ContextMenu/useContextMenu.js +1 -2
  40. package/es/components/Copy/Copy.js +13 -14
  41. package/es/components/CopyButton/CopyButton.js +14 -15
  42. package/es/components/DangerButton/DangerButton.js +2 -2
  43. package/es/components/DataTable/DataTable.d.ts +81 -283
  44. package/es/components/DataTable/DataTable.js +124 -172
  45. package/es/components/DataTable/Table.d.ts +2 -2
  46. package/es/components/DataTable/Table.js +19 -22
  47. package/es/components/DataTable/TableActionList.d.ts +1 -1
  48. package/es/components/DataTable/TableBatchAction.js +9 -12
  49. package/es/components/DataTable/TableBatchActions.js +27 -29
  50. package/es/components/DataTable/TableBody.d.ts +3 -3
  51. package/es/components/DataTable/TableBody.js +9 -12
  52. package/es/components/DataTable/TableCell.d.ts +3 -4
  53. package/es/components/DataTable/TableCell.js +2 -2
  54. package/es/components/DataTable/TableContainer.d.ts +2 -3
  55. package/es/components/DataTable/TableContainer.js +15 -16
  56. package/es/components/DataTable/TableDecoratorRow.js +8 -9
  57. package/es/components/DataTable/TableExpandHeader.d.ts +2 -3
  58. package/es/components/DataTable/TableExpandHeader.js +18 -19
  59. package/es/components/DataTable/TableExpandRow.js +20 -21
  60. package/es/components/DataTable/TableExpandedRow.d.ts +3 -3
  61. package/es/components/DataTable/TableExpandedRow.js +10 -11
  62. package/es/components/DataTable/TableHead.d.ts +1 -1
  63. package/es/components/DataTable/TableHeader.d.ts +4 -4
  64. package/es/components/DataTable/TableHeader.js +29 -30
  65. package/es/components/DataTable/TableRow.d.ts +3 -4
  66. package/es/components/DataTable/TableRow.js +4 -4
  67. package/es/components/DataTable/TableSelectAll.js +14 -15
  68. package/es/components/DataTable/TableSelectRow.js +16 -17
  69. package/es/components/DataTable/TableSlugRow.js +7 -8
  70. package/es/components/DataTable/TableToolbar.js +9 -10
  71. package/es/components/DataTable/TableToolbarAction.js +2 -2
  72. package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
  73. package/es/components/DataTable/TableToolbarMenu.js +10 -11
  74. package/es/components/DataTable/TableToolbarSearch.js +24 -26
  75. package/es/components/DataTable/index.d.ts +1 -1
  76. package/es/components/DataTable/state/sorting.js +3 -4
  77. package/es/components/DataTable/tools/filter.js +10 -12
  78. package/es/components/DataTable/tools/normalize.js +6 -8
  79. package/es/components/DataTable/tools/sorting.js +24 -30
  80. package/es/components/DataTableSkeleton/DataTableSkeleton.js +26 -27
  81. package/es/components/DatePicker/DatePicker.Skeleton.js +15 -16
  82. package/es/components/DatePicker/DatePicker.js +104 -81
  83. package/es/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  84. package/es/components/DatePickerInput/DatePickerInput.js +24 -25
  85. package/es/components/Dialog/index.d.ts +194 -10
  86. package/es/components/Dialog/index.js +458 -39
  87. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  88. package/es/components/Dropdown/Dropdown.Skeleton.js +10 -11
  89. package/es/components/Dropdown/Dropdown.d.ts +3 -3
  90. package/es/components/Dropdown/Dropdown.js +57 -60
  91. package/es/components/ErrorBoundary/ErrorBoundary.js +4 -4
  92. package/es/components/ExpandableSearch/ExpandableSearch.js +11 -12
  93. package/es/components/FeatureFlags/index.js +13 -14
  94. package/es/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  95. package/es/components/FileUploader/FileUploader.Skeleton.js +9 -10
  96. package/es/components/FileUploader/FileUploader.d.ts +2 -3
  97. package/es/components/FileUploader/FileUploader.js +33 -35
  98. package/es/components/FileUploader/FileUploaderButton.d.ts +2 -3
  99. package/es/components/FileUploader/FileUploaderButton.js +20 -21
  100. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  101. package/es/components/FileUploader/FileUploaderDropContainer.js +20 -21
  102. package/es/components/FileUploader/FileUploaderItem.d.ts +2 -3
  103. package/es/components/FileUploader/FileUploaderItem.js +26 -27
  104. package/es/components/FileUploader/Filename.d.ts +3 -4
  105. package/es/components/FileUploader/Filename.js +16 -17
  106. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +9 -10
  107. package/es/components/FluidComboBox/FluidComboBox.js +8 -9
  108. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +16 -17
  109. package/es/components/FluidDatePicker/FluidDatePicker.js +13 -14
  110. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
  111. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +9 -10
  112. package/es/components/FluidDropdown/FluidDropdown.js +8 -9
  113. package/es/components/FluidForm/FluidForm.d.ts +3 -4
  114. package/es/components/FluidForm/FluidForm.js +8 -9
  115. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +9 -10
  116. package/es/components/FluidMultiSelect/FluidMultiSelect.js +10 -11
  117. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +9 -10
  118. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
  119. package/es/components/FluidNumberInput/FluidNumberInput.js +41 -8
  120. package/es/components/FluidSearch/FluidSearch.Skeleton.js +9 -10
  121. package/es/components/FluidSearch/FluidSearch.js +7 -8
  122. package/es/components/FluidSelect/FluidSelect.Skeleton.js +9 -10
  123. package/es/components/FluidSelect/FluidSelect.js +8 -9
  124. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +9 -10
  125. package/es/components/FluidTextArea/FluidTextArea.js +7 -8
  126. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +9 -10
  127. package/es/components/FluidTextInput/FluidTextInput.js +9 -10
  128. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +8 -9
  129. package/es/components/FluidTimePicker/FluidTimePicker.js +23 -24
  130. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +7 -8
  131. package/es/components/Form/Form.js +7 -8
  132. package/es/components/FormGroup/FormGroup.d.ts +3 -4
  133. package/es/components/FormGroup/FormGroup.js +15 -16
  134. package/es/components/FormItem/FormItem.js +7 -8
  135. package/es/components/FormLabel/FormLabel.js +8 -9
  136. package/es/components/Grid/CSSGrid.js +23 -25
  137. package/es/components/Grid/Column.js +32 -31
  138. package/es/components/Grid/ColumnHang.js +8 -9
  139. package/es/components/Grid/FlexGrid.js +12 -13
  140. package/es/components/Grid/Grid.js +3 -3
  141. package/es/components/Grid/GridContext.d.ts +2 -2
  142. package/es/components/Grid/GridContext.js +6 -7
  143. package/es/components/Grid/Row.js +10 -11
  144. package/es/components/Heading/index.js +13 -14
  145. package/es/components/Icon/Icon.Skeleton.js +6 -7
  146. package/es/components/IconButton/index.js +30 -26
  147. package/es/components/IconIndicator/index.js +10 -11
  148. package/es/components/IdPrefix/index.js +6 -7
  149. package/es/components/InlineCheckbox/InlineCheckbox.js +6 -6
  150. package/es/components/InlineLoading/InlineLoading.js +19 -20
  151. package/es/components/Layer/LayerContext.js +2 -2
  152. package/es/components/Layer/index.d.ts +4 -0
  153. package/es/components/Layer/index.js +21 -15
  154. package/es/components/Layout/index.js +24 -29
  155. package/es/components/LayoutDirection/LayoutDirection.js +10 -11
  156. package/es/components/LayoutDirection/LayoutDirectionContext.js +2 -2
  157. package/es/components/Link/Link.d.ts +1 -1
  158. package/es/components/Link/Link.js +19 -20
  159. package/es/components/ListBox/ListBox.d.ts +2 -3
  160. package/es/components/ListBox/ListBox.js +5 -5
  161. package/es/components/ListBox/ListBoxField.d.ts +3 -4
  162. package/es/components/ListBox/ListBoxField.js +8 -9
  163. package/es/components/ListBox/ListBoxMenu.d.ts +2 -3
  164. package/es/components/ListBox/ListBoxMenu.js +7 -8
  165. package/es/components/ListBox/ListBoxMenuIcon.js +8 -9
  166. package/es/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  167. package/es/components/ListBox/ListBoxMenuItem.js +11 -13
  168. package/es/components/ListBox/ListBoxSelection.js +14 -15
  169. package/es/components/ListBox/next/ListBoxSelection.js +16 -17
  170. package/es/components/ListBox/next/ListBoxTrigger.js +8 -9
  171. package/es/components/ListItem/ListItem.js +7 -8
  172. package/es/components/Loading/Loading.d.ts +3 -3
  173. package/es/components/Loading/Loading.js +14 -15
  174. package/es/components/Menu/Menu.js +26 -27
  175. package/es/components/Menu/MenuItem.js +55 -60
  176. package/es/components/MenuButton/index.js +20 -22
  177. package/es/components/Modal/Modal.d.ts +2 -3
  178. package/es/components/Modal/Modal.js +85 -93
  179. package/es/components/ModalWrapper/ModalWrapper.js +9 -9
  180. package/es/components/MultiSelect/FilterableMultiSelect.js +68 -74
  181. package/es/components/MultiSelect/MultiSelect.js +65 -67
  182. package/es/components/MultiSelect/tools/sorting.js +11 -15
  183. package/es/components/Notification/Notification.js +137 -146
  184. package/es/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
  185. package/es/components/NumberInput/NumberFormatPropTypes.js +40 -0
  186. package/es/components/NumberInput/NumberInput.Skeleton.js +10 -11
  187. package/es/components/NumberInput/NumberInput.d.ts +39 -3
  188. package/es/components/NumberInput/NumberInput.js +195 -65
  189. package/es/components/OrderedList/OrderedList.js +9 -10
  190. package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  191. package/es/components/OverflowMenu/OverflowMenu.js +42 -48
  192. package/es/components/OverflowMenu/index.js +3 -3
  193. package/es/components/OverflowMenu/next/index.js +17 -18
  194. package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -4
  195. package/es/components/OverflowMenuV2/index.js +3 -3
  196. package/es/components/PageHeader/PageHeader.d.ts +29 -5
  197. package/es/components/PageHeader/PageHeader.js +136 -90
  198. package/es/components/Pagination/Pagination.Skeleton.js +12 -13
  199. package/es/components/Pagination/Pagination.js +40 -41
  200. package/es/components/Pagination/experimental/PageSelector.js +11 -12
  201. package/es/components/Pagination/experimental/Pagination.js +34 -35
  202. package/es/components/PaginationNav/PaginationNav.js +63 -68
  203. package/es/components/Popover/index.js +40 -42
  204. package/es/components/PrimaryButton/PrimaryButton.js +2 -2
  205. package/es/components/ProgressBar/ProgressBar.js +24 -25
  206. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +12 -13
  207. package/es/components/ProgressIndicator/ProgressIndicator.js +49 -52
  208. package/es/components/RadioButton/RadioButton.Skeleton.js +4 -4
  209. package/es/components/RadioButton/RadioButton.js +10 -10
  210. package/es/components/RadioButtonGroup/RadioButtonGroup.js +16 -16
  211. package/es/components/RadioTile/RadioTile.js +28 -29
  212. package/es/components/Search/Search.Skeleton.js +9 -10
  213. package/es/components/Search/Search.js +36 -38
  214. package/es/components/SecondaryButton/SecondaryButton.js +2 -2
  215. package/es/components/Select/Select.Skeleton.js +10 -11
  216. package/es/components/Select/Select.js +42 -43
  217. package/es/components/SelectItem/SelectItem.js +10 -11
  218. package/es/components/SelectItemGroup/SelectItemGroup.js +9 -10
  219. package/es/components/ShapeIndicator/index.js +13 -14
  220. package/es/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  221. package/es/components/SkeletonIcon/SkeletonIcon.js +7 -12
  222. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +6 -7
  223. package/es/components/SkeletonText/SkeletonText.js +12 -13
  224. package/es/components/Slider/Slider.Skeleton.js +25 -26
  225. package/es/components/Slider/Slider.js +99 -113
  226. package/es/components/Slider/SliderHandles.js +20 -20
  227. package/es/components/Stack/HStack.js +2 -2
  228. package/es/components/Stack/Stack.js +2 -2
  229. package/es/components/Stack/VStack.js +2 -2
  230. package/es/components/StructuredList/StructuredList.Skeleton.js +17 -18
  231. package/es/components/StructuredList/StructuredList.js +24 -24
  232. package/es/components/Switch/IconSwitch.js +3 -3
  233. package/es/components/Switch/Switch.js +4 -4
  234. package/es/components/TabContent/TabContent.js +2 -2
  235. package/es/components/Tabs/Tabs.Skeleton.js +12 -13
  236. package/es/components/Tabs/Tabs.js +141 -156
  237. package/es/components/Tabs/usePressable.js +7 -8
  238. package/es/components/Tag/DismissibleTag.js +26 -27
  239. package/es/components/Tag/OperationalTag.js +16 -17
  240. package/es/components/Tag/SelectableTag.js +19 -20
  241. package/es/components/Tag/Tag.Skeleton.js +7 -8
  242. package/es/components/Tag/Tag.js +33 -34
  243. package/es/components/Text/Text.js +9 -10
  244. package/es/components/Text/TextDirection.js +7 -8
  245. package/es/components/Text/createTextComponent.js +2 -2
  246. package/es/components/TextArea/TextArea.Skeleton.js +4 -4
  247. package/es/components/TextArea/TextArea.js +22 -22
  248. package/es/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  249. package/es/components/TextInput/ControlledPasswordInput.js +36 -37
  250. package/es/components/TextInput/PasswordInput.js +40 -41
  251. package/es/components/TextInput/TextInput.Skeleton.js +9 -10
  252. package/es/components/TextInput/TextInput.js +43 -44
  253. package/es/components/TextInput/util.js +14 -17
  254. package/es/components/Theme/index.js +19 -21
  255. package/es/components/Tile/Tile.js +98 -104
  256. package/es/components/TileGroup/TileGroup.d.ts +3 -4
  257. package/es/components/TileGroup/TileGroup.js +8 -8
  258. package/es/components/TimePicker/TimePicker.d.ts +2 -3
  259. package/es/components/TimePicker/TimePicker.js +14 -14
  260. package/es/components/TimePickerSelect/TimePickerSelect.js +4 -4
  261. package/es/components/Toggle/Toggle.Skeleton.js +8 -9
  262. package/es/components/Toggle/Toggle.js +27 -28
  263. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +14 -15
  264. package/es/components/Toggletip/index.js +43 -49
  265. package/es/components/Tooltip/DefinitionTooltip.js +17 -18
  266. package/es/components/Tooltip/Tooltip.d.ts +3 -0
  267. package/es/components/Tooltip/Tooltip.js +39 -28
  268. package/es/components/TreeView/TreeNode.js +64 -56
  269. package/es/components/TreeView/TreeView.js +44 -37
  270. package/es/components/UIShell/Content.js +8 -9
  271. package/es/components/UIShell/Header.js +7 -8
  272. package/es/components/UIShell/HeaderContainer.js +7 -8
  273. package/es/components/UIShell/HeaderGlobalAction.js +14 -15
  274. package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  275. package/es/components/UIShell/HeaderMenu.d.ts +10 -112
  276. package/es/components/UIShell/HeaderMenu.js +154 -201
  277. package/es/components/UIShell/HeaderMenuButton.js +14 -15
  278. package/es/components/UIShell/HeaderMenuItem.js +21 -20
  279. package/es/components/UIShell/HeaderName.js +9 -10
  280. package/es/components/UIShell/HeaderNavigation.js +10 -11
  281. package/es/components/UIShell/HeaderPanel.js +11 -12
  282. package/es/components/UIShell/HeaderSideNavItems.js +7 -8
  283. package/es/components/UIShell/Link.js +11 -12
  284. package/es/components/UIShell/SideNav.js +30 -32
  285. package/es/components/UIShell/SideNavDetails.js +9 -10
  286. package/es/components/UIShell/SideNavDivider.js +6 -7
  287. package/es/components/UIShell/SideNavFooter.js +13 -14
  288. package/es/components/UIShell/SideNavHeader.js +8 -9
  289. package/es/components/UIShell/SideNavIcon.js +7 -8
  290. package/es/components/UIShell/SideNavItem.js +7 -8
  291. package/es/components/UIShell/SideNavItems.js +10 -11
  292. package/es/components/UIShell/SideNavLink.js +15 -16
  293. package/es/components/UIShell/SideNavLinkText.js +7 -8
  294. package/es/components/UIShell/SideNavMenu.js +20 -21
  295. package/es/components/UIShell/SideNavMenuItem.js +5 -5
  296. package/es/components/UIShell/SideNavSwitcher.js +8 -8
  297. package/es/components/UIShell/SkipToContent.js +9 -10
  298. package/es/components/UIShell/Switcher.js +12 -13
  299. package/es/components/UIShell/SwitcherDivider.js +6 -7
  300. package/es/components/UIShell/SwitcherItem.js +3 -3
  301. package/es/components/UnorderedList/UnorderedList.js +8 -9
  302. package/es/index.js +25 -26
  303. package/es/internal/FloatingMenu.js +30 -32
  304. package/es/internal/Selection.js +15 -17
  305. package/{lib/feature-flags.d.ts → es/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
  306. package/es/internal/createClassWrapper.js +2 -2
  307. package/es/internal/getAnnouncement.d.ts +8 -0
  308. package/es/internal/getAnnouncement.js +22 -0
  309. package/es/internal/keyboard/match.js +6 -7
  310. package/es/internal/useControllableState.d.ts +1 -1
  311. package/es/internal/useControllableState.js +8 -9
  312. package/es/internal/useDelayedState.js +1 -2
  313. package/es/internal/useDocumentLang.d.ts +12 -0
  314. package/es/internal/useId.js +4 -6
  315. package/es/internal/useIdPrefix.js +3 -3
  316. package/es/internal/useMatchMedia.js +1 -2
  317. package/es/internal/useMergedRefs.d.ts +1 -1
  318. package/es/internal/useNoInteractiveChildren.js +2 -4
  319. package/es/internal/useNormalizedInputProps.js +12 -13
  320. package/es/internal/usePrefix.js +3 -3
  321. package/es/internal/useResizeObserver.d.ts +14 -0
  322. package/es/internal/useResizeObserver.js +73 -0
  323. package/es/internal/useSavedCallback.js +1 -3
  324. package/es/internal/wrapFocus.js +23 -35
  325. package/es/prop-types/deprecate.js +1 -4
  326. package/es/prop-types/deprecateValuesWithin.js +1 -4
  327. package/es/prop-types/isRequiredOneOf.js +1 -4
  328. package/es/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  329. package/es/tools/events.js +1 -4
  330. package/es/tools/mergeRefs.js +9 -14
  331. package/es/tools/uniqueId.js +1 -2
  332. package/es/tools/wrapComponent.d.ts +3 -4
  333. package/es/tools/wrapComponent.js +11 -13
  334. package/es/types/common.d.ts +0 -2
  335. package/lib/components/AILabel/index.js +27 -30
  336. package/lib/components/AISkeleton/AISkeletonIcon.js +4 -5
  337. package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -5
  338. package/lib/components/AISkeleton/AISkeletonText.js +4 -5
  339. package/lib/components/Accordion/Accordion.Skeleton.js +9 -10
  340. package/lib/components/Accordion/Accordion.js +10 -11
  341. package/lib/components/Accordion/AccordionItem.js +13 -14
  342. package/lib/components/Accordion/AccordionProvider.js +4 -5
  343. package/lib/components/AspectRatio/AspectRatio.js +7 -8
  344. package/lib/components/BadgeIndicator/index.js +5 -6
  345. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +4 -5
  346. package/lib/components/Button/Button.Skeleton.js +7 -8
  347. package/lib/components/Button/ButtonBase.js +23 -24
  348. package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -6
  349. package/lib/components/ChatButton/ChatButton.js +11 -12
  350. package/lib/components/Checkbox/Checkbox.Skeleton.js +4 -5
  351. package/lib/components/Checkbox/Checkbox.js +19 -20
  352. package/lib/components/CheckboxGroup/CheckboxGroup.js +16 -17
  353. package/lib/components/ClassPrefix/index.js +4 -5
  354. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +5 -6
  355. package/lib/components/CodeSnippet/CodeSnippet.js +27 -29
  356. package/lib/components/ComboBox/ComboBox.js +24 -30
  357. package/lib/components/ComboBox/tools/filter.js +9 -12
  358. package/lib/components/ComboButton/index.js +16 -18
  359. package/lib/components/ComposedModal/ComposedModal.js +31 -34
  360. package/lib/components/ComposedModal/ModalFooter.js +37 -42
  361. package/lib/components/ComposedModal/ModalHeader.js +14 -15
  362. package/lib/components/ContainedList/ContainedList.js +10 -11
  363. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +9 -10
  364. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +17 -29
  365. package/lib/components/ContentSwitcher/ContentSwitcher.js +98 -124
  366. package/lib/components/ContentSwitcher/index.d.ts +3 -4
  367. package/lib/components/ContextMenu/useContextMenu.js +1 -2
  368. package/lib/components/Copy/Copy.js +11 -12
  369. package/lib/components/CopyButton/CopyButton.js +10 -11
  370. package/lib/components/DataTable/DataTable.d.ts +81 -283
  371. package/lib/components/DataTable/DataTable.js +123 -172
  372. package/lib/components/DataTable/Table.d.ts +2 -2
  373. package/lib/components/DataTable/Table.js +15 -18
  374. package/lib/components/DataTable/TableActionList.d.ts +1 -1
  375. package/lib/components/DataTable/TableBatchAction.js +8 -11
  376. package/lib/components/DataTable/TableBatchActions.js +18 -20
  377. package/lib/components/DataTable/TableBody.d.ts +3 -3
  378. package/lib/components/DataTable/TableBody.js +8 -11
  379. package/lib/components/DataTable/TableCell.d.ts +3 -4
  380. package/lib/components/DataTable/TableContainer.d.ts +2 -3
  381. package/lib/components/DataTable/TableContainer.js +9 -10
  382. package/lib/components/DataTable/TableDecoratorRow.js +4 -5
  383. package/lib/components/DataTable/TableExpandHeader.d.ts +2 -3
  384. package/lib/components/DataTable/TableExpandHeader.js +14 -15
  385. package/lib/components/DataTable/TableExpandRow.js +13 -14
  386. package/lib/components/DataTable/TableExpandedRow.d.ts +3 -3
  387. package/lib/components/DataTable/TableExpandedRow.js +6 -7
  388. package/lib/components/DataTable/TableHead.d.ts +1 -1
  389. package/lib/components/DataTable/TableHeader.d.ts +4 -4
  390. package/lib/components/DataTable/TableHeader.js +15 -16
  391. package/lib/components/DataTable/TableRow.d.ts +3 -4
  392. package/lib/components/DataTable/TableSelectAll.js +11 -12
  393. package/lib/components/DataTable/TableSelectRow.js +12 -13
  394. package/lib/components/DataTable/TableSlugRow.js +4 -5
  395. package/lib/components/DataTable/TableToolbar.js +7 -8
  396. package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
  397. package/lib/components/DataTable/TableToolbarMenu.js +8 -9
  398. package/lib/components/DataTable/TableToolbarSearch.js +22 -24
  399. package/lib/components/DataTable/index.d.ts +1 -1
  400. package/lib/components/DataTable/state/sorting.js +3 -4
  401. package/lib/components/DataTable/tools/filter.js +10 -12
  402. package/lib/components/DataTable/tools/normalize.js +6 -8
  403. package/lib/components/DataTable/tools/sorting.js +24 -30
  404. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +11 -12
  405. package/lib/components/DatePicker/DatePicker.Skeleton.js +7 -8
  406. package/lib/components/DatePicker/DatePicker.js +87 -64
  407. package/lib/components/DatePickerInput/DatePickerInput.d.ts +3 -4
  408. package/lib/components/DatePickerInput/DatePickerInput.js +5 -6
  409. package/lib/components/Dialog/index.d.ts +194 -10
  410. package/lib/components/Dialog/index.js +457 -33
  411. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -3
  412. package/lib/components/Dropdown/Dropdown.Skeleton.js +6 -7
  413. package/lib/components/Dropdown/Dropdown.d.ts +3 -3
  414. package/lib/components/Dropdown/Dropdown.js +40 -43
  415. package/lib/components/ErrorBoundary/ErrorBoundary.js +2 -2
  416. package/lib/components/ExpandableSearch/ExpandableSearch.js +9 -10
  417. package/lib/components/FeatureFlags/index.js +11 -12
  418. package/lib/components/FileUploader/FileUploader.Skeleton.d.ts +3 -3
  419. package/lib/components/FileUploader/FileUploader.Skeleton.js +4 -5
  420. package/lib/components/FileUploader/FileUploader.d.ts +2 -3
  421. package/lib/components/FileUploader/FileUploader.js +22 -24
  422. package/lib/components/FileUploader/FileUploaderButton.d.ts +2 -3
  423. package/lib/components/FileUploader/FileUploaderButton.js +16 -17
  424. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +2 -3
  425. package/lib/components/FileUploader/FileUploaderDropContainer.js +15 -16
  426. package/lib/components/FileUploader/FileUploaderItem.d.ts +2 -3
  427. package/lib/components/FileUploader/FileUploaderItem.js +13 -14
  428. package/lib/components/FileUploader/Filename.d.ts +3 -4
  429. package/lib/components/FileUploader/Filename.js +9 -10
  430. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +4 -5
  431. package/lib/components/FluidComboBox/FluidComboBox.js +5 -6
  432. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +5 -6
  433. package/lib/components/FluidDatePicker/FluidDatePicker.js +10 -11
  434. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +4 -5
  435. package/lib/components/FluidDropdown/FluidDropdown.js +5 -6
  436. package/lib/components/FluidForm/FluidForm.d.ts +3 -4
  437. package/lib/components/FluidForm/FluidForm.js +5 -6
  438. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +4 -5
  439. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +6 -7
  440. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +4 -5
  441. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +40 -1
  442. package/lib/components/FluidNumberInput/FluidNumberInput.js +38 -5
  443. package/lib/components/FluidSearch/FluidSearch.Skeleton.js +4 -5
  444. package/lib/components/FluidSearch/FluidSearch.js +4 -5
  445. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +4 -5
  446. package/lib/components/FluidSelect/FluidSelect.js +5 -6
  447. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +4 -5
  448. package/lib/components/FluidTextArea/FluidTextArea.js +4 -5
  449. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +4 -5
  450. package/lib/components/FluidTextInput/FluidTextInput.js +5 -6
  451. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +5 -6
  452. package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -12
  453. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +5 -6
  454. package/lib/components/Form/Form.js +5 -6
  455. package/lib/components/FormGroup/FormGroup.d.ts +3 -4
  456. package/lib/components/FormGroup/FormGroup.js +11 -12
  457. package/lib/components/FormItem/FormItem.js +5 -6
  458. package/lib/components/FormLabel/FormLabel.js +6 -7
  459. package/lib/components/Grid/CSSGrid.js +17 -19
  460. package/lib/components/Grid/Column.js +28 -27
  461. package/lib/components/Grid/ColumnHang.js +6 -7
  462. package/lib/components/Grid/FlexGrid.js +9 -10
  463. package/lib/components/Grid/GridContext.d.ts +2 -2
  464. package/lib/components/Grid/GridContext.js +10 -29
  465. package/lib/components/Grid/Row.js +8 -9
  466. package/lib/components/Heading/index.js +5 -6
  467. package/lib/components/Icon/Icon.Skeleton.js +4 -5
  468. package/lib/components/IconButton/index.js +26 -22
  469. package/lib/components/IconIndicator/index.js +7 -8
  470. package/lib/components/IdPrefix/index.js +4 -5
  471. package/lib/components/InlineLoading/InlineLoading.js +9 -10
  472. package/lib/components/Layer/index.d.ts +4 -0
  473. package/lib/components/Layer/index.js +16 -10
  474. package/lib/components/Layout/index.js +21 -26
  475. package/lib/components/LayoutDirection/LayoutDirection.js +6 -7
  476. package/lib/components/Link/Link.d.ts +1 -1
  477. package/lib/components/Link/Link.js +15 -16
  478. package/lib/components/ListBox/ListBox.d.ts +2 -3
  479. package/lib/components/ListBox/ListBoxField.d.ts +3 -4
  480. package/lib/components/ListBox/ListBoxField.js +6 -7
  481. package/lib/components/ListBox/ListBoxMenu.d.ts +2 -3
  482. package/lib/components/ListBox/ListBoxMenu.js +5 -6
  483. package/lib/components/ListBox/ListBoxMenuIcon.js +4 -5
  484. package/lib/components/ListBox/ListBoxMenuItem.d.ts +2 -3
  485. package/lib/components/ListBox/ListBoxMenuItem.js +8 -10
  486. package/lib/components/ListBox/ListBoxSelection.js +8 -9
  487. package/lib/components/ListBox/next/ListBoxSelection.js +9 -10
  488. package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
  489. package/lib/components/ListItem/ListItem.js +5 -6
  490. package/lib/components/Loading/Loading.d.ts +3 -3
  491. package/lib/components/Loading/Loading.js +8 -9
  492. package/lib/components/Menu/Menu.js +23 -24
  493. package/lib/components/Menu/MenuItem.js +39 -44
  494. package/lib/components/MenuButton/index.js +16 -18
  495. package/lib/components/Modal/Modal.d.ts +2 -3
  496. package/lib/components/Modal/Modal.js +55 -63
  497. package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
  498. package/lib/components/MultiSelect/FilterableMultiSelect.js +46 -52
  499. package/lib/components/MultiSelect/MultiSelect.js +43 -45
  500. package/lib/components/MultiSelect/tools/sorting.js +11 -15
  501. package/lib/components/Notification/Notification.js +96 -105
  502. package/lib/components/NumberInput/NumberFormatPropTypes.d.ts +29 -0
  503. package/lib/components/NumberInput/NumberFormatPropTypes.js +48 -0
  504. package/lib/components/NumberInput/NumberInput.Skeleton.js +6 -7
  505. package/lib/components/NumberInput/NumberInput.d.ts +39 -3
  506. package/lib/components/NumberInput/NumberInput.js +173 -43
  507. package/lib/components/OrderedList/OrderedList.js +7 -8
  508. package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
  509. package/lib/components/OverflowMenu/OverflowMenu.js +35 -41
  510. package/lib/components/OverflowMenu/next/index.js +12 -13
  511. package/lib/components/PageHeader/PageHeader.d.ts +29 -5
  512. package/lib/components/PageHeader/PageHeader.js +119 -73
  513. package/lib/components/Pagination/Pagination.Skeleton.js +4 -5
  514. package/lib/components/Pagination/Pagination.js +24 -25
  515. package/lib/components/Pagination/experimental/PageSelector.js +8 -9
  516. package/lib/components/Pagination/experimental/Pagination.js +20 -21
  517. package/lib/components/PaginationNav/PaginationNav.js +33 -38
  518. package/lib/components/Popover/index.js +26 -28
  519. package/lib/components/ProgressBar/ProgressBar.js +11 -12
  520. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +5 -6
  521. package/lib/components/ProgressIndicator/ProgressIndicator.js +29 -32
  522. package/lib/components/RadioTile/RadioTile.js +17 -18
  523. package/lib/components/Search/Search.Skeleton.js +5 -6
  524. package/lib/components/Search/Search.js +26 -28
  525. package/lib/components/Select/Select.Skeleton.js +5 -6
  526. package/lib/components/Select/Select.js +24 -25
  527. package/lib/components/SelectItem/SelectItem.js +8 -9
  528. package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -8
  529. package/lib/components/ShapeIndicator/index.js +7 -8
  530. package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +0 -4
  531. package/lib/components/SkeletonIcon/SkeletonIcon.js +5 -10
  532. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -5
  533. package/lib/components/SkeletonText/SkeletonText.js +8 -9
  534. package/lib/components/Slider/Slider.Skeleton.js +8 -9
  535. package/lib/components/Slider/Slider.js +69 -83
  536. package/lib/components/Slider/SliderHandles.js +6 -6
  537. package/lib/components/StructuredList/StructuredList.Skeleton.js +5 -6
  538. package/lib/components/Tabs/Tabs.Skeleton.js +5 -6
  539. package/lib/components/Tabs/Tabs.js +83 -98
  540. package/lib/components/Tabs/usePressable.js +7 -8
  541. package/lib/components/Tag/DismissibleTag.js +16 -17
  542. package/lib/components/Tag/OperationalTag.js +10 -11
  543. package/lib/components/Tag/SelectableTag.js +13 -14
  544. package/lib/components/Tag/Tag.Skeleton.js +5 -6
  545. package/lib/components/Tag/Tag.js +19 -20
  546. package/lib/components/Text/Text.js +6 -7
  547. package/lib/components/Text/TextDirection.js +5 -6
  548. package/lib/components/TextArea/TextArea.js +3 -3
  549. package/lib/components/TextInput/ControlledPasswordInput.d.ts +2 -3
  550. package/lib/components/TextInput/ControlledPasswordInput.js +24 -25
  551. package/lib/components/TextInput/PasswordInput.js +26 -27
  552. package/lib/components/TextInput/TextInput.Skeleton.js +5 -6
  553. package/lib/components/TextInput/TextInput.js +27 -28
  554. package/lib/components/TextInput/util.js +14 -17
  555. package/lib/components/Theme/index.js +10 -12
  556. package/lib/components/Tile/Tile.js +68 -74
  557. package/lib/components/TileGroup/TileGroup.d.ts +3 -4
  558. package/lib/components/TimePicker/TimePicker.d.ts +2 -3
  559. package/lib/components/Toggle/Toggle.Skeleton.js +4 -5
  560. package/lib/components/Toggle/Toggle.js +17 -18
  561. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +6 -7
  562. package/lib/components/Toggletip/index.js +33 -39
  563. package/lib/components/Tooltip/DefinitionTooltip.js +13 -14
  564. package/lib/components/Tooltip/Tooltip.d.ts +3 -0
  565. package/lib/components/Tooltip/Tooltip.js +33 -22
  566. package/lib/components/TreeView/TreeNode.js +40 -32
  567. package/lib/components/TreeView/TreeView.js +41 -34
  568. package/lib/components/UIShell/Content.js +6 -7
  569. package/lib/components/UIShell/Header.js +5 -6
  570. package/lib/components/UIShell/HeaderContainer.js +5 -6
  571. package/lib/components/UIShell/HeaderGlobalAction.js +12 -13
  572. package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  573. package/lib/components/UIShell/HeaderMenu.d.ts +10 -112
  574. package/lib/components/UIShell/HeaderMenu.js +152 -199
  575. package/lib/components/UIShell/HeaderMenuButton.js +10 -11
  576. package/lib/components/UIShell/HeaderMenuItem.js +17 -16
  577. package/lib/components/UIShell/HeaderName.js +6 -7
  578. package/lib/components/UIShell/HeaderNavigation.js +7 -8
  579. package/lib/components/UIShell/HeaderPanel.js +9 -10
  580. package/lib/components/UIShell/HeaderSideNavItems.js +5 -6
  581. package/lib/components/UIShell/Link.js +8 -9
  582. package/lib/components/UIShell/SideNav.js +23 -25
  583. package/lib/components/UIShell/SideNavDetails.js +6 -7
  584. package/lib/components/UIShell/SideNavDivider.js +3 -4
  585. package/lib/components/UIShell/SideNavFooter.js +6 -7
  586. package/lib/components/UIShell/SideNavHeader.js +5 -6
  587. package/lib/components/UIShell/SideNavIcon.js +5 -6
  588. package/lib/components/UIShell/SideNavItem.js +5 -6
  589. package/lib/components/UIShell/SideNavItems.js +5 -6
  590. package/lib/components/UIShell/SideNavLink.js +10 -11
  591. package/lib/components/UIShell/SideNavLinkText.js +5 -6
  592. package/lib/components/UIShell/SideNavMenu.js +11 -12
  593. package/lib/components/UIShell/SkipToContent.js +7 -8
  594. package/lib/components/UIShell/Switcher.js +4 -5
  595. package/lib/components/UIShell/SwitcherDivider.js +4 -5
  596. package/lib/components/UnorderedList/UnorderedList.js +6 -7
  597. package/lib/index.js +81 -82
  598. package/lib/internal/FloatingMenu.js +26 -28
  599. package/lib/internal/Selection.js +15 -17
  600. package/{es/feature-flags.d.ts → lib/internal/__mocks__/mockHTMLElement.d.ts} +4 -2
  601. package/lib/internal/getAnnouncement.d.ts +8 -0
  602. package/lib/internal/getAnnouncement.js +26 -0
  603. package/lib/internal/keyboard/match.js +6 -7
  604. package/lib/internal/useControllableState.d.ts +1 -1
  605. package/lib/internal/useControllableState.js +8 -9
  606. package/lib/internal/useDelayedState.js +1 -2
  607. package/lib/internal/useDocumentLang.d.ts +12 -0
  608. package/lib/internal/useId.js +2 -4
  609. package/lib/internal/useMatchMedia.js +1 -2
  610. package/lib/internal/useMergedRefs.d.ts +1 -1
  611. package/lib/internal/useNoInteractiveChildren.js +2 -4
  612. package/lib/internal/useNormalizedInputProps.js +9 -10
  613. package/lib/internal/useResizeObserver.d.ts +14 -0
  614. package/lib/internal/useResizeObserver.js +77 -0
  615. package/lib/internal/useSavedCallback.js +1 -3
  616. package/lib/internal/wrapFocus.js +23 -35
  617. package/lib/prop-types/deprecate.js +1 -4
  618. package/lib/prop-types/deprecateValuesWithin.js +1 -4
  619. package/lib/prop-types/isRequiredOneOf.js +1 -4
  620. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -4
  621. package/lib/tools/events.js +1 -4
  622. package/lib/tools/mergeRefs.js +9 -14
  623. package/lib/tools/uniqueId.js +1 -2
  624. package/lib/tools/wrapComponent.d.ts +3 -4
  625. package/lib/tools/wrapComponent.js +9 -11
  626. package/lib/types/common.d.ts +0 -2
  627. package/package.json +21 -20
  628. package/scss/components/content-switcher/_tokens.scss +9 -0
  629. package/telemetry.yml +27 -2
  630. package/es/components/ContentSwitcher/index.js +0 -13
  631. package/es/components/DataTable/index.js +0 -76
  632. package/es/internal/useAnnouncer.js +0 -21
  633. package/lib/components/ContentSwitcher/index.js +0 -18
  634. package/lib/components/DataTable/index.js +0 -82
  635. package/lib/internal/useAnnouncer.js +0 -25
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React__default from 'react';
8
+ import React from 'react';
9
9
  import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
10
10
  import '../components/Text/index.js';
11
11
  import { usePrefix } from './usePrefix.js';
@@ -20,16 +20,15 @@ import { Text } from '../components/Text/Text.js';
20
20
  * helper messages, and conditionally provides the appropriate validation
21
21
  * message and accompanying icon.
22
22
  */
23
- const useNormalizedInputProps = _ref => {
24
- let {
25
- id,
26
- readOnly,
27
- disabled,
28
- invalid,
29
- invalidText,
30
- warn,
31
- warnText
32
- } = _ref;
23
+ const useNormalizedInputProps = ({
24
+ id,
25
+ readOnly,
26
+ disabled,
27
+ invalid,
28
+ invalidText,
29
+ warn,
30
+ warnText
31
+ }) => {
33
32
  const prefix = usePrefix();
34
33
  const normalizedProps = {
35
34
  disabled: !readOnly && disabled,
@@ -43,14 +42,14 @@ const useNormalizedInputProps = _ref => {
43
42
  };
44
43
  if (normalizedProps.invalid) {
45
44
  normalizedProps.icon = WarningFilled;
46
- normalizedProps.validation = /*#__PURE__*/React__default.createElement(Text, {
45
+ normalizedProps.validation = /*#__PURE__*/React.createElement(Text, {
47
46
  as: "div",
48
47
  className: `${prefix}--form-requirement`,
49
48
  id: normalizedProps.invalidId
50
49
  }, invalidText);
51
50
  } else if (normalizedProps.warn) {
52
51
  normalizedProps.icon = WarningAltFilled;
53
- normalizedProps.validation = /*#__PURE__*/React__default.createElement(Text, {
52
+ normalizedProps.validation = /*#__PURE__*/React.createElement(Text, {
54
53
  as: "div",
55
54
  className: `${prefix}--form-requirement`,
56
55
  id: normalizedProps.warnId
@@ -5,11 +5,11 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React__default from 'react';
8
+ import React from 'react';
9
9
 
10
- const PrefixContext = /*#__PURE__*/React__default.createContext('cds');
10
+ const PrefixContext = /*#__PURE__*/React.createContext('cds');
11
11
  function usePrefix() {
12
- return React__default.useContext(PrefixContext);
12
+ return React.useContext(PrefixContext);
13
13
  }
14
14
 
15
15
  export { PrefixContext, usePrefix };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright IBM Corp. 2025, 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 { RefObject } from 'react';
8
+ export declare const useResizeObserver: ({ ref, onResize, }: {
9
+ ref: RefObject<HTMLElement>;
10
+ onResize?: (rect: DOMRectReadOnly) => void;
11
+ }) => {
12
+ width: number;
13
+ height: number;
14
+ };
@@ -0,0 +1,73 @@
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 { useState, useRef, useEffect, useLayoutEffect } from 'react';
9
+
10
+ const useResizeObserver = ({
11
+ ref,
12
+ onResize
13
+ }) => {
14
+ const [width, setWidth] = useState(-1);
15
+ const [height, setHeight] = useState(-1);
16
+ const entriesToHandle = useRef(null);
17
+ const cb = useRef(onResize);
18
+ useEffect(() => {
19
+ // ref for onResize removes it as dependency from useLayoutEffect
20
+ // This significantly reduces repeated calls if a function is redefined on every
21
+ // render
22
+ cb.current = onResize;
23
+ }, [onResize]);
24
+ useEffect(() => {
25
+ const getInitialSize = () => {
26
+ if (ref.current) {
27
+ const refComputedStyle = window.getComputedStyle(ref.current);
28
+ const initialWidth = (ref.current?.offsetWidth ?? 0) - (typeof refComputedStyle?.paddingLeft === 'string' && refComputedStyle?.paddingLeft.length ? parseFloat(refComputedStyle?.paddingLeft) : 0) - (typeof refComputedStyle?.paddingRight === 'string' && refComputedStyle?.paddingRight.length ? parseFloat(refComputedStyle?.paddingRight) : 0);
29
+ const initialHeight = (ref.current?.offsetHeight ?? 0) - (typeof refComputedStyle?.paddingTop === 'string' && refComputedStyle?.paddingTop.length ? parseFloat(refComputedStyle?.paddingTop) : 0) - (typeof refComputedStyle?.paddingBottom === 'string' && refComputedStyle?.paddingBottom.length ? parseFloat(refComputedStyle?.paddingBottom) : 0);
30
+ setWidth(initialWidth);
31
+ setHeight(initialHeight);
32
+ }
33
+ };
34
+ if (!ref?.current || width >= 0 && height >= 0) {
35
+ return;
36
+ }
37
+ getInitialSize();
38
+ }, [width, height]);
39
+ useLayoutEffect(() => {
40
+ if (!ref?.current) {
41
+ return;
42
+ }
43
+ const doCallbacks = () => {
44
+ if (!ref?.current || !Array.isArray(entriesToHandle?.current)) {
45
+ return;
46
+ }
47
+ const entry = entriesToHandle.current[0];
48
+ setWidth(entry.contentRect.width);
49
+ setHeight(entry.contentRect.height);
50
+ cb.current && cb.current(entry.contentRect);
51
+ };
52
+ const observer = new ResizeObserver(entries => {
53
+ // always update entriesToHandle
54
+ entriesToHandle.current = entries;
55
+ window.requestAnimationFrame(() => {
56
+ // do callbacks
57
+ doCallbacks();
58
+ });
59
+ });
60
+
61
+ // observe all refs passed
62
+ observer.observe(ref.current);
63
+ return () => {
64
+ observer.disconnect();
65
+ };
66
+ }, []);
67
+ return {
68
+ width,
69
+ height
70
+ };
71
+ };
72
+
73
+ export { useResizeObserver };
@@ -20,9 +20,7 @@ const useSavedCallback = callback => {
20
20
  useEffect(() => {
21
21
  savedCallback.current = callback;
22
22
  }, [callback]);
23
- return useCallback(function () {
24
- return savedCallback.current ? savedCallback.current(...arguments) : undefined;
25
- }, []);
23
+ return useCallback((...args) => savedCallback.current ? savedCallback.current(...args) : undefined, []);
26
24
  };
27
25
 
28
26
  export { useSavedCallback };
@@ -5,7 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { useEffect } from 'react';
9
8
  import { tabbable } from 'tabbable';
10
9
  import { selectorTabbable } from './keyboard/navigation.js';
11
10
 
@@ -31,8 +30,7 @@ const DOCUMENT_POSITION_BROAD_FOLLOWING = typeof Node !== 'undefined' ? Node.DOC
31
30
  * @returns {boolean} Whether the node or one of its ancestors is in a floating
32
31
  * menu.
33
32
  */
34
- const elementOrParentIsFloatingMenu = function (node) {
35
- let selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
33
+ const elementOrParentIsFloatingMenu = (node, selectorsFloatingMenus = []) => {
36
34
  if (node instanceof Element && typeof node.closest === 'function') {
37
35
  const allSelectorsFloatingMenus = ['.cds--overflow-menu-options', '.cds--tooltip', '.flatpickr-calendar', ...selectorsFloatingMenus];
38
36
  return allSelectorsFloatingMenus.some(selector => !!node.closest(selector));
@@ -44,36 +42,29 @@ const elementOrParentIsFloatingMenu = function (node) {
44
42
  * Ensures the focus is kept within the given container by implementing
45
43
  * "focus-wrap" behavior.
46
44
  */
47
- const wrapFocus = _ref => {
48
- let {
49
- bodyNode,
50
- startTrapNode,
51
- endTrapNode,
52
- currentActiveNode,
53
- oldActiveNode,
54
- selectorsFloatingMenus
55
- } = _ref;
45
+ const wrapFocus = ({
46
+ bodyNode,
47
+ startTrapNode,
48
+ endTrapNode,
49
+ currentActiveNode,
50
+ oldActiveNode,
51
+ selectorsFloatingMenus
52
+ }) => {
56
53
  if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
57
54
  const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
58
55
  if (currentActiveNode === startTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_PRECEDING) {
59
- const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).reverse().find(_ref2 => {
60
- let {
61
- offsetParent
62
- } = _ref2;
63
- return Boolean(offsetParent);
64
- });
56
+ const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).reverse().find(({
57
+ offsetParent
58
+ }) => Boolean(offsetParent));
65
59
  if (tabbableElement) {
66
60
  tabbableElement.focus();
67
61
  } else if (bodyNode !== oldActiveNode) {
68
62
  bodyNode.focus();
69
63
  }
70
64
  } else if (currentActiveNode === endTrapNode || comparisonResult & DOCUMENT_POSITION_BROAD_FOLLOWING) {
71
- const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).find(_ref3 => {
72
- let {
73
- offsetParent
74
- } = _ref3;
75
- return Boolean(offsetParent);
76
- });
65
+ const tabbableElement = Array.from(bodyNode.querySelectorAll(selectorTabbable)).find(({
66
+ offsetParent
67
+ }) => Boolean(offsetParent));
77
68
  if (tabbableElement) {
78
69
  tabbableElement.focus();
79
70
  } else if (bodyNode !== oldActiveNode) {
@@ -89,18 +80,15 @@ const wrapFocus = _ref => {
89
80
  *
90
81
  * Note: This must be called *before* focus moves using `onKeyDown` or similar.
91
82
  */
92
- const wrapFocusWithoutSentinels = _ref4 => {
93
- let {
94
- containerNode,
95
- currentActiveNode,
96
- event
97
- } = _ref4;
83
+ const wrapFocusWithoutSentinels = ({
84
+ containerNode,
85
+ currentActiveNode,
86
+ event
87
+ }) => {
98
88
  if (!containerNode) return;
99
- useEffect(() => {
100
- if (['blur', 'focusout', 'focusin', 'focus'].includes(event.type) && process.env.NODE_ENV !== 'production') {
101
- throw new Error(`Error: wrapFocusWithoutSentinels(...) called in unsupported ${event.type} event.\n\nCall wrapFocusWithoutSentinels(...) from onKeyDown instead.`);
102
- }
103
- }, []);
89
+ if (['blur', 'focusout', 'focusin', 'focus'].includes(event.type) && process.env.NODE_ENV !== 'production') {
90
+ throw new Error(`Error: wrapFocusWithoutSentinels(...) called in unsupported ${event.type} event.\n\nCall wrapFocusWithoutSentinels(...) from onKeyDown instead.`);
91
+ }
104
92
 
105
93
  // Use `tabbable` to get the focusable elements in tab order.
106
94
  // `selectorTabbable` returns elements in DOM order which is why it's not
@@ -9,7 +9,7 @@ import { warning } from '../internal/warning.js';
9
9
 
10
10
  const didWarnAboutDeprecation = {};
11
11
  function deprecate(propType, message) {
12
- function checker(props, propName, componentName) {
12
+ function checker(props, propName, componentName, ...rest) {
13
13
  if (props[propName] === undefined) {
14
14
  return;
15
15
  }
@@ -20,9 +20,6 @@ function deprecate(propType, message) {
20
20
  };
21
21
  process.env.NODE_ENV !== "production" ? warning(false, message || `The prop \`${propName}\` has been deprecated for the ` + `${componentName} component. It will be removed in the next major ` + `release`) : void 0;
22
22
  }
23
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
24
- rest[_key - 3] = arguments[_key];
25
- }
26
23
  return propType(props, propName, componentName, ...rest);
27
24
  }
28
25
  return checker;
@@ -9,7 +9,7 @@ import { warning } from '../internal/warning.js';
9
9
 
10
10
  const didWarnAboutDeprecation = {};
11
11
  function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
12
- return function checker(props, propName, componentName) {
12
+ return function checker(props, propName, componentName, ...rest) {
13
13
  if (props[propName] === undefined) {
14
14
  return;
15
15
  }
@@ -25,9 +25,6 @@ function deprecateValuesWithin(propType, allowedValues, propMappingFunction) {
25
25
  process.env.NODE_ENV !== "production" ? warning(false, message) : void 0;
26
26
  }
27
27
  }
28
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
29
- rest[_key - 3] = arguments[_key];
30
- }
31
28
  return propType(props, propName, componentName, ...rest);
32
29
  };
33
30
  }
@@ -15,13 +15,10 @@
15
15
  */
16
16
  const isRequiredOneOf = propTypes => {
17
17
  const names = Object.keys(propTypes);
18
- const checker = propType => function (props, propName, componentName) {
18
+ const checker = propType => (props, propName, componentName, ...rest) => {
19
19
  if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
20
20
  return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
21
21
  }
22
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
23
- rest[_key - 3] = arguments[_key];
24
- }
25
22
  return propType(props, propName, componentName, ...rest);
26
23
  };
27
24
  return names.reduce((acc, name) => ({
@@ -13,13 +13,10 @@
13
13
  * becomes required if the prop corresponding to the provided prop name exists.
14
14
  */
15
15
  function requiredIfGivenPropIsTruthy(name, propType) {
16
- return function check(props, propName, componentName) {
16
+ return function check(props, propName, componentName, ...rest) {
17
17
  if (process.env.NODE_ENV !== 'production' && props[name] == true && props[propName] == null) {
18
18
  return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` exists.`);
19
19
  }
20
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
21
- rest[_key - 3] = arguments[_key];
22
- }
23
20
  return propType(props, propName, componentName, ...rest);
24
21
  };
25
22
  }
@@ -14,10 +14,7 @@
14
14
  * @param handlers - An array of event handler functions.
15
15
  * @returns A composite event handler.
16
16
  */
17
- const composeEventHandlers = handlers => function (event) {
18
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
19
- args[_key - 1] = arguments[_key];
20
- }
17
+ const composeEventHandlers = handlers => (event, ...args) => {
21
18
  for (const handler of handlers) {
22
19
  if (event.defaultPrevented) {
23
20
  break;
@@ -9,20 +9,15 @@
9
9
  * @param {...Ref<Element>} refs List of React refs to merge.
10
10
  * @returns {Ref<Element>} Merged React ref.
11
11
  */
12
- const mergeRefs = function () {
13
- for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) {
14
- refs[_key] = arguments[_key];
15
- }
16
- return 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
- });
25
- };
12
+ const mergeRefs = (...refs) => el => {
13
+ refs.forEach(ref => {
14
+ // https://github.com/facebook/react/issues/13029#issuecomment-410002316
15
+ if (typeof ref === 'function') {
16
+ ref(el);
17
+ } else if (Object(ref) === ref) {
18
+ ref.current = el;
19
+ }
20
+ });
26
21
  };
27
22
  var mergeRefs$1 = mergeRefs;
28
23
 
@@ -6,8 +6,7 @@
6
6
  */
7
7
 
8
8
  let lastId = 0;
9
- const uniqueId = function () {
10
- let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';
9
+ const uniqueId = (prefix = 'id') => {
11
10
  lastId++;
12
11
  return `${prefix}${lastId}`;
13
12
  };
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React from 'react';
8
- import { ReactAttr } from '../types/common';
7
+ import React, { type HTMLAttributes } from 'react';
9
8
  type HTMLTagName = keyof HTMLElementTagNameMap;
10
9
  type WrapComponentArgs<T extends HTMLTagName> = {
11
10
  name: string;
@@ -16,5 +15,5 @@ type WrapComponentArgs<T extends HTMLTagName> = {
16
15
  * @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
17
16
  * @returns
18
17
  */
19
- declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props: ReactAttr<T>) => React.ReactElement<any>);
18
+ declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props: HTMLAttributes<T>) => React.ReactElement<any>);
20
19
  export default wrapComponent;
@@ -7,32 +7,30 @@
7
7
 
8
8
  import cx from 'classnames';
9
9
  import PropTypes from 'prop-types';
10
- import React__default from 'react';
10
+ import React from 'react';
11
11
  import { usePrefix } from '../internal/usePrefix.js';
12
12
 
13
13
  /**
14
14
  * @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
15
15
  * @returns
16
16
  */
17
- const wrapComponent = _ref => {
18
- let {
19
- name,
20
- className: getClassName,
21
- type
22
- } = _ref;
17
+ const wrapComponent = ({
18
+ name,
19
+ className: getClassName,
20
+ type
21
+ }) => {
23
22
  /**
24
23
  *
25
24
  * @param {{ className?: string, [x: string]: any}} param0
26
25
  * @returns
27
26
  */
28
- function Component(_ref2) {
29
- let {
30
- className: baseClassName,
31
- ...other
32
- } = _ref2;
27
+ function Component({
28
+ className: baseClassName,
29
+ ...other
30
+ }) {
33
31
  const prefix = usePrefix();
34
32
  const componentClass = cx(typeof getClassName === 'function' ? getClassName(prefix) : getClassName, baseClassName);
35
- return /*#__PURE__*/React__default.createElement(type, {
33
+ return /*#__PURE__*/React.createElement(type, {
36
34
  ...other,
37
35
  // Prevent Weird quirk where `cx` will evaluate to an empty string, '',
38
36
  // and so we have empty `class` attributes in the resulting markup
@@ -4,8 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import * as React from 'react';
8
- export type ReactAttr<T = HTMLElement> = React.HTMLAttributes<T>;
9
7
  /**
10
8
  * For "as" props. Creates an "as" property that supports native html tags such as 'span', 'a', 'button' as well as custom functional components
11
9
  * All native props for the supplied html tag/component are inferred as part of the base component props, allowing us to use props like `href` on an 'a' element etc
@@ -29,12 +29,11 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
29
29
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
30
30
 
31
31
  var _Undo;
32
- const AILabelContent = /*#__PURE__*/React__default["default"].forwardRef(function AILabelContent(_ref, ref) {
33
- let {
34
- className,
35
- children,
36
- ...rest
37
- } = _ref;
32
+ const AILabelContent = /*#__PURE__*/React__default["default"].forwardRef(function AILabelContent({
33
+ className,
34
+ children,
35
+ ...rest
36
+ }, ref) {
38
37
  const prefix = usePrefix.usePrefix();
39
38
  const hasAILabelActions = React__default["default"].Children.toArray(children).some(child => {
40
39
  const item = child;
@@ -59,12 +58,11 @@ AILabelContent.propTypes = {
59
58
  */
60
59
  className: PropTypes__default["default"].string
61
60
  };
62
- const AILabelActions = /*#__PURE__*/React__default["default"].forwardRef(function AILabelActions(_ref2, ref) {
63
- let {
64
- className,
65
- children,
66
- ...rest
67
- } = _ref2;
61
+ const AILabelActions = /*#__PURE__*/React__default["default"].forwardRef(function AILabelActions({
62
+ className,
63
+ children,
64
+ ...rest
65
+ }, ref) {
68
66
  const prefix = usePrefix.usePrefix();
69
67
  const aiLabelActionsClasses = cx__default["default"](className, {
70
68
  [`${prefix}--ai-label-actions`]: true
@@ -90,24 +88,23 @@ AILabelActions.propTypes = {
90
88
  * @deprecated Use NewPopoverAlignment instead.
91
89
  */
92
90
 
93
- const AILabel = /*#__PURE__*/React__default["default"].forwardRef(function AILabel(_ref3, ref) {
94
- let {
95
- aiText = 'AI',
96
- aiTextLabel,
97
- textLabel,
98
- align,
99
- autoAlign = true,
100
- children,
101
- className,
102
- kind = 'default',
103
- onRevertClick,
104
- revertActive,
105
- revertLabel = 'Revert to AI input',
106
- slugLabel = 'Show information',
107
- ['aria-label']: ariaLabel = 'Show information',
108
- size = 'xs',
109
- ...rest
110
- } = _ref3;
91
+ const AILabel = /*#__PURE__*/React__default["default"].forwardRef(function AILabel({
92
+ aiText = 'AI',
93
+ aiTextLabel,
94
+ textLabel,
95
+ align,
96
+ autoAlign = true,
97
+ children,
98
+ className,
99
+ kind = 'default',
100
+ onRevertClick,
101
+ revertActive,
102
+ revertLabel = 'Revert to AI input',
103
+ slugLabel = 'Show information',
104
+ ['aria-label']: ariaLabel = 'Show information',
105
+ size = 'xs',
106
+ ...rest
107
+ }, ref) {
111
108
  const prefix = usePrefix.usePrefix();
112
109
  const id = useId.useId('AILabel');
113
110
  const aiLabelClasses = cx__default["default"](className, {
@@ -22,11 +22,10 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
22
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
23
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
24
 
25
- const AISkeletonIcon = _ref => {
26
- let {
27
- className,
28
- ...rest
29
- } = _ref;
25
+ const AISkeletonIcon = ({
26
+ className,
27
+ ...rest
28
+ }) => {
30
29
  const prefix = usePrefix.usePrefix();
31
30
  const AISkeletonIconClasses = cx__default["default"](className, {
32
31
  [`${prefix}--skeleton__icon--ai`]: true
@@ -22,11 +22,10 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
22
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
23
23
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
24
 
25
- const AISkeletonPlaceholder = _ref => {
26
- let {
27
- className,
28
- ...other
29
- } = _ref;
25
+ const AISkeletonPlaceholder = ({
26
+ className,
27
+ ...other
28
+ }) => {
30
29
  const prefix = usePrefix.usePrefix();
31
30
  const AISkeletonPlaceholderClasses = cx__default["default"]({
32
31
  className,
@@ -22,11 +22,10 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
22
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
23
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
24
24
 
25
- const AISkeletonText = _ref => {
26
- let {
27
- className,
28
- ...rest
29
- } = _ref;
25
+ const AISkeletonText = ({
26
+ className,
27
+ ...rest
28
+ }) => {
30
29
  const prefix = usePrefix.usePrefix();
31
30
  const aiSkeletonTextClasses = cx__default["default"](className, {
32
31
  [`${prefix}--skeleton__text--ai`]: true
@@ -24,16 +24,15 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
25
25
 
26
26
  var _SkeletonText, _SkeletonText2, _SkeletonText3;
27
- function AccordionSkeleton(_ref) {
28
- let {
29
- align = 'end',
30
- className,
31
- count = 4,
32
- isFlush,
33
- open = true,
34
- ordered = false,
35
- ...rest
36
- } = _ref;
27
+ function AccordionSkeleton({
28
+ align = 'end',
29
+ className,
30
+ count = 4,
31
+ isFlush,
32
+ open = true,
33
+ ordered = false,
34
+ ...rest
35
+ }) {
37
36
  const prefix = usePrefix.usePrefix();
38
37
  const classes = cx__default["default"](`${prefix}--accordion`, `${prefix}--skeleton`, className, {
39
38
  [`${prefix}--accordion--${align}`]: align,
@@ -22,17 +22,16 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
22
22
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
23
23
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
24
24
 
25
- function Accordion(_ref) {
26
- let {
27
- align = 'end',
28
- children,
29
- className: customClassName,
30
- disabled = false,
31
- isFlush = false,
32
- ordered = false,
33
- size,
34
- ...rest
35
- } = _ref;
25
+ function Accordion({
26
+ align = 'end',
27
+ children,
28
+ className: customClassName,
29
+ disabled = false,
30
+ isFlush = false,
31
+ ordered = false,
32
+ size,
33
+ ...rest
34
+ }) {
36
35
  const prefix = usePrefix.usePrefix();
37
36
  const className = cx__default["default"](`${prefix}--accordion`, customClassName, {
38
37
  [`${prefix}--accordion--${align}`]: align,