@carbon/react 1.27.0 → 1.28.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 (591) hide show
  1. package/es/_virtual/_rollupPluginBabelHelpers.js +1 -313
  2. package/es/components/Accordion/Accordion.Skeleton.js +28 -30
  3. package/es/components/Accordion/Accordion.js +18 -21
  4. package/es/components/Accordion/AccordionItem.js +37 -49
  5. package/es/components/AspectRatio/AspectRatio.js +10 -12
  6. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +10 -11
  7. package/es/components/Breadcrumb/Breadcrumb.js +14 -13
  8. package/es/components/Breadcrumb/BreadcrumbItem.js +24 -22
  9. package/es/components/Button/Button.Skeleton.js +25 -23
  10. package/es/components/Button/Button.js +77 -72
  11. package/es/components/ButtonSet/ButtonSet.js +12 -10
  12. package/es/components/Checkbox/Checkbox.Skeleton.js +10 -11
  13. package/es/components/Checkbox/Checkbox.js +55 -52
  14. package/es/components/CheckboxGroup/CheckboxGroup.js +33 -31
  15. package/es/components/ClassPrefix/index.js +4 -2
  16. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +15 -14
  17. package/es/components/CodeSnippet/CodeSnippet.js +199 -102
  18. package/es/components/ComboBox/ComboBox.js +349 -178
  19. package/es/components/ComboBox/tools/filter.js +6 -4
  20. package/es/components/ComboButton/index.js +38 -43
  21. package/es/components/ComposedModal/ComposedModal.js +187 -85
  22. package/es/components/ComposedModal/ModalFooter.js +54 -49
  23. package/es/components/ComposedModal/ModalHeader.js +39 -26
  24. package/es/components/ContainedList/ContainedList.js +18 -17
  25. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +20 -18
  26. package/es/components/ContentSwitcher/ContentSwitcher.js +83 -98
  27. package/es/components/ContentSwitcher/index.js +1 -1
  28. package/es/components/ContextMenu/useContextMenu.js +12 -21
  29. package/es/components/Copy/Copy.js +24 -29
  30. package/es/components/CopyButton/CopyButton.js +10 -10
  31. package/es/components/DangerButton/DangerButton.js +3 -5
  32. package/es/components/DataTable/DataTable.js +334 -361
  33. package/es/components/DataTable/Table.js +29 -26
  34. package/es/components/DataTable/TableActionList.js +2 -4
  35. package/es/components/DataTable/TableBatchAction.js +2 -4
  36. package/es/components/DataTable/TableBatchActions.js +29 -30
  37. package/es/components/DataTable/TableBody.js +7 -8
  38. package/es/components/DataTable/TableCell.js +1 -1
  39. package/es/components/DataTable/TableContainer.js +23 -23
  40. package/es/components/DataTable/TableContext.js +1 -1
  41. package/es/components/DataTable/TableExpandHeader.js +19 -21
  42. package/es/components/DataTable/TableExpandRow.js +23 -23
  43. package/es/components/DataTable/TableExpandedRow.js +18 -23
  44. package/es/components/DataTable/TableHead.js +1 -1
  45. package/es/components/DataTable/TableHeader.js +45 -41
  46. package/es/components/DataTable/TableRow.js +7 -8
  47. package/es/components/DataTable/TableSelectAll.js +13 -11
  48. package/es/components/DataTable/TableSelectRow.js +29 -21
  49. package/es/components/DataTable/TableToolbar.js +19 -14
  50. package/es/components/DataTable/TableToolbarAction.js +6 -6
  51. package/es/components/DataTable/TableToolbarContent.js +2 -4
  52. package/es/components/DataTable/TableToolbarMenu.js +11 -12
  53. package/es/components/DataTable/TableToolbarSearch.js +52 -71
  54. package/es/components/DataTable/state/getDerivedStateFromProps.js +15 -15
  55. package/es/components/DataTable/state/sortStates.js +1 -1
  56. package/es/components/DataTable/state/sorting.js +28 -20
  57. package/es/components/DataTable/tools/cells.js +1 -3
  58. package/es/components/DataTable/tools/denormalize.js +4 -17
  59. package/es/components/DataTable/tools/filter.js +18 -16
  60. package/es/components/DataTable/tools/instanceId.js +2 -2
  61. package/es/components/DataTable/tools/normalize.js +28 -25
  62. package/es/components/DataTable/tools/sorting.js +28 -25
  63. package/es/components/DataTableSkeleton/DataTableSkeleton.js +36 -38
  64. package/es/components/DatePicker/DatePicker.Skeleton.js +17 -18
  65. package/es/components/DatePicker/DatePicker.js +206 -195
  66. package/es/components/DatePicker/plugins/appendToPlugin.js +45 -43
  67. package/es/components/DatePicker/plugins/fixEventsPlugin.js +117 -107
  68. package/es/components/DatePicker/plugins/rangePlugin.js +19 -11
  69. package/es/components/DatePickerInput/DatePickerInput.js +83 -74
  70. package/es/components/Dropdown/Dropdown.Skeleton.js +13 -12
  71. package/es/components/Dropdown/Dropdown.js +266 -109
  72. package/es/components/ErrorBoundary/ErrorBoundary.js +27 -48
  73. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +3 -2
  74. package/es/components/ExpandableSearch/ExpandableSearch.d.ts +13 -0
  75. package/es/components/ExpandableSearch/ExpandableSearch.js +18 -25
  76. package/es/components/FeatureFlags/index.js +25 -43
  77. package/es/components/FileUploader/FileUploader.Skeleton.js +8 -9
  78. package/es/components/FileUploader/FileUploader.js +120 -147
  79. package/es/components/FileUploader/FileUploaderButton.js +36 -48
  80. package/es/components/FileUploader/FileUploaderDropContainer.js +49 -53
  81. package/es/components/FileUploader/FileUploaderItem.js +30 -30
  82. package/es/components/FileUploader/Filename.js +13 -14
  83. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +11 -12
  84. package/es/components/FluidComboBox/FluidComboBox.js +11 -9
  85. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +18 -18
  86. package/es/components/FluidDatePicker/FluidDatePicker.js +19 -16
  87. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
  88. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +11 -12
  89. package/es/components/FluidDropdown/FluidDropdown.js +11 -9
  90. package/es/components/FluidForm/FluidForm.js +9 -10
  91. package/es/components/FluidForm/FormContext.js +1 -1
  92. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +11 -12
  93. package/es/components/FluidMultiSelect/FluidMultiSelect.js +12 -10
  94. package/es/components/FluidSelect/FluidSelect.Skeleton.js +11 -12
  95. package/es/components/FluidSelect/FluidSelect.js +9 -9
  96. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +9 -10
  97. package/es/components/FluidTextArea/FluidTextArea.js +7 -8
  98. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +9 -10
  99. package/es/components/FluidTextInput/FluidTextInput.js +10 -9
  100. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +11 -10
  101. package/es/components/FluidTimePicker/FluidTimePicker.js +30 -26
  102. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +7 -7
  103. package/es/components/Form/Form.js +9 -10
  104. package/es/components/FormGroup/FormGroup.js +16 -17
  105. package/es/components/FormItem/FormItem.js +8 -9
  106. package/es/components/FormLabel/FormLabel.js +11 -10
  107. package/es/components/Grid/CSSGrid.js +38 -39
  108. package/es/components/Grid/Column.js +86 -79
  109. package/es/components/Grid/ColumnHang.js +12 -14
  110. package/es/components/Grid/FlexGrid.js +19 -21
  111. package/es/components/Grid/Grid.js +2 -2
  112. package/es/components/Grid/GridContext.js +12 -11
  113. package/es/components/Grid/Row.js +16 -18
  114. package/es/components/Heading/index.js +11 -13
  115. package/es/components/Icon/Icon.Skeleton.js +10 -12
  116. package/es/components/IconButton/index.js +19 -22
  117. package/es/components/IdPrefix/index.js +4 -2
  118. package/es/components/InlineCheckbox/InlineCheckbox.js +89 -36
  119. package/es/components/InlineLoading/InlineLoading.js +23 -25
  120. package/es/components/Layer/LayerContext.js +1 -1
  121. package/es/components/Layer/index.js +17 -18
  122. package/es/components/Layout/LayoutDirection.js +8 -10
  123. package/es/components/Layout/LayoutDirectionContext.js +1 -1
  124. package/es/components/Link/Link.js +25 -25
  125. package/es/components/ListBox/ListBox.js +38 -31
  126. package/es/components/ListBox/ListBoxField.js +9 -10
  127. package/es/components/ListBox/ListBoxMenu.js +9 -10
  128. package/es/components/ListBox/ListBoxMenuIcon.js +16 -14
  129. package/es/components/ListBox/ListBoxMenuItem.js +23 -26
  130. package/es/components/ListBox/ListBoxPropTypes.js +4 -4
  131. package/es/components/ListBox/ListBoxSelection.js +30 -25
  132. package/es/components/ListBox/index.js +1 -1
  133. package/es/components/ListBox/next/ListBoxSelection.js +27 -24
  134. package/es/components/ListBox/next/ListBoxTrigger.js +20 -19
  135. package/es/components/ListItem/ListItem.js +9 -10
  136. package/es/components/Loading/Loading.js +24 -24
  137. package/es/components/Menu/Menu.js +67 -80
  138. package/es/components/Menu/MenuContext.js +9 -12
  139. package/es/components/Menu/MenuItem.js +104 -128
  140. package/es/components/MenuButton/index.js +37 -41
  141. package/es/components/Modal/Modal.js +281 -120
  142. package/es/components/ModalWrapper/ModalWrapper.js +72 -96
  143. package/es/components/MultiSelect/FilterableMultiSelect.js +299 -163
  144. package/es/components/MultiSelect/MultiSelect.js +162 -174
  145. package/es/components/MultiSelect/MultiSelectPropTypes.js +1 -1
  146. package/es/components/MultiSelect/tools/itemToString.js +3 -4
  147. package/es/components/MultiSelect/tools/sorting.js +15 -13
  148. package/es/components/Notification/Notification.js +436 -164
  149. package/es/components/NumberInput/NumberInput.Skeleton.js +10 -11
  150. package/es/components/NumberInput/NumberInput.js +140 -139
  151. package/es/components/OrderedList/OrderedList.js +17 -15
  152. package/es/components/OverflowMenu/OverflowMenu.js +359 -227
  153. package/es/components/OverflowMenu/index.js +1 -1
  154. package/es/components/OverflowMenuItem/OverflowMenuItem.js +32 -37
  155. package/es/components/OverflowMenuV2/index.js +26 -28
  156. package/es/components/Pagination/Pagination.Skeleton.js +9 -10
  157. package/es/components/Pagination/Pagination.js +98 -140
  158. package/es/components/Pagination/experimental/PageSelector.js +16 -16
  159. package/es/components/Pagination/experimental/Pagination.js +73 -94
  160. package/es/components/PaginationNav/PaginationNav.js +98 -117
  161. package/es/components/Popover/index.js +74 -80
  162. package/es/components/PrimaryButton/PrimaryButton.js +3 -5
  163. package/es/components/ProgressBar/ProgressBar.js +39 -37
  164. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +15 -14
  165. package/es/components/ProgressIndicator/ProgressIndicator.js +71 -71
  166. package/es/components/RadioButton/RadioButton.Skeleton.js +9 -10
  167. package/es/components/RadioButton/RadioButton.js +27 -27
  168. package/es/components/RadioButtonGroup/RadioButtonGroup.js +55 -65
  169. package/es/components/RadioTile/RadioTile.js +27 -25
  170. package/es/components/Search/Search.Skeleton.js +16 -16
  171. package/es/components/Search/Search.d.ts +83 -0
  172. package/es/components/Search/Search.js +65 -72
  173. package/es/components/Search/index.d.ts +11 -0
  174. package/es/components/SecondaryButton/SecondaryButton.js +3 -5
  175. package/es/components/Select/Select.Skeleton.js +12 -13
  176. package/es/components/Select/Select.js +79 -73
  177. package/es/components/SelectItem/SelectItem.js +17 -13
  178. package/es/components/SelectItemGroup/SelectItemGroup.js +11 -12
  179. package/es/components/SkeletonIcon/SkeletonIcon.js +11 -11
  180. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +11 -11
  181. package/es/components/SkeletonText/SkeletonText.js +29 -29
  182. package/es/components/Slider/Slider.Skeleton.js +17 -18
  183. package/es/components/Slider/Slider.js +306 -329
  184. package/es/components/Slider/index.js +1 -1
  185. package/es/components/Stack/Stack.js +19 -20
  186. package/es/components/Stack/index.js +2 -2
  187. package/es/components/StructuredList/StructuredList.Skeleton.js +25 -24
  188. package/es/components/StructuredList/StructuredList.js +134 -106
  189. package/es/components/Switch/IconSwitch.js +48 -54
  190. package/es/components/Switch/Switch.js +33 -31
  191. package/es/components/Tab/Tab.js +77 -83
  192. package/es/components/Tab/index.js +1 -1
  193. package/es/components/TabContent/TabContent.js +16 -18
  194. package/es/components/Tabs/Tabs.Skeleton.js +14 -13
  195. package/es/components/Tabs/Tabs.js +195 -206
  196. package/es/components/Tabs/usePressable.js +27 -36
  197. package/es/components/Tag/Tag.Skeleton.js +10 -9
  198. package/es/components/Tag/Tag.js +34 -31
  199. package/es/components/Text/Text.js +20 -20
  200. package/es/components/Text/TextDirection.js +8 -7
  201. package/es/components/Text/TextDirectionContext.js +1 -1
  202. package/es/components/Text/index.js +1 -1
  203. package/es/components/TextArea/TextArea.Skeleton.js +11 -12
  204. package/es/components/TextArea/TextArea.js +89 -83
  205. package/es/components/TextInput/ControlledPasswordInput.js +79 -73
  206. package/es/components/TextInput/PasswordInput.js +101 -91
  207. package/es/components/TextInput/TextInput.Skeleton.js +11 -12
  208. package/es/components/TextInput/TextInput.js +104 -92
  209. package/es/components/TextInput/util.js +26 -28
  210. package/es/components/Theme/index.js +25 -20
  211. package/es/components/Tile/Tile.js +135 -176
  212. package/es/components/TileGroup/TileGroup.js +55 -70
  213. package/es/components/TileGroup/index.js +1 -1
  214. package/es/components/TimePicker/TimePicker.js +60 -67
  215. package/es/components/TimePickerSelect/TimePickerSelect.js +20 -18
  216. package/es/components/TimePickerSelect/index.js +1 -1
  217. package/es/components/Toggle/Toggle.Skeleton.js +63 -52
  218. package/es/components/Toggle/Toggle.js +44 -48
  219. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +56 -50
  220. package/es/components/Toggletip/index.js +52 -48
  221. package/es/components/Tooltip/DefinitionTooltip.js +24 -31
  222. package/es/components/Tooltip/Tooltip.js +35 -50
  223. package/es/components/TreeView/TreeNode.js +94 -74
  224. package/es/components/TreeView/TreeView.js +72 -83
  225. package/es/components/UIShell/Content.js +12 -14
  226. package/es/components/UIShell/Header.js +16 -12
  227. package/es/components/UIShell/HeaderContainer.js +8 -14
  228. package/es/components/UIShell/HeaderGlobalAction.js +26 -19
  229. package/es/components/UIShell/HeaderGlobalBar.js +1 -3
  230. package/es/components/UIShell/HeaderMenu.js +114 -129
  231. package/es/components/UIShell/HeaderMenuButton.js +31 -22
  232. package/es/components/UIShell/HeaderMenuItem.js +28 -20
  233. package/es/components/UIShell/HeaderName.js +19 -14
  234. package/es/components/UIShell/HeaderNavigation.js +19 -15
  235. package/es/components/UIShell/HeaderPanel.js +23 -17
  236. package/es/components/UIShell/HeaderSideNavItems.js +11 -9
  237. package/es/components/UIShell/Link.js +11 -11
  238. package/es/components/UIShell/SideNav.js +66 -62
  239. package/es/components/UIShell/SideNavDetails.js +11 -12
  240. package/es/components/UIShell/SideNavDivider.js +5 -3
  241. package/es/components/UIShell/SideNavFooter.js +12 -12
  242. package/es/components/UIShell/SideNavHeader.js +8 -6
  243. package/es/components/UIShell/SideNavIcon.js +11 -8
  244. package/es/components/UIShell/SideNavItem.js +11 -9
  245. package/es/components/UIShell/SideNavItems.js +13 -11
  246. package/es/components/UIShell/SideNavLink.js +19 -17
  247. package/es/components/UIShell/SideNavLinkText.js +8 -9
  248. package/es/components/UIShell/SideNavMenu.js +28 -35
  249. package/es/components/UIShell/SideNavMenuItem.js +14 -14
  250. package/es/components/UIShell/SideNavSwitcher.js +19 -19
  251. package/es/components/UIShell/SkipToContent.js +10 -11
  252. package/es/components/UIShell/Switcher.js +20 -11
  253. package/es/components/UIShell/SwitcherDivider.js +10 -9
  254. package/es/components/UIShell/SwitcherItem.js +26 -19
  255. package/es/components/UIShell/_utils.js +1 -1
  256. package/es/components/UnorderedList/UnorderedList.js +14 -14
  257. package/es/index.js +5 -5
  258. package/es/internal/ClickListener.js +49 -65
  259. package/es/internal/FloatingMenu.js +193 -200
  260. package/es/internal/OptimizedResize.js +9 -8
  261. package/es/internal/Selection.js +92 -111
  262. package/es/internal/createClassWrapper.js +2 -2
  263. package/es/internal/deprecateFieldOnObject.js +5 -3
  264. package/es/internal/environment.js +1 -1
  265. package/es/internal/focus/index.js +1 -1
  266. package/es/internal/keyboard/keys.js +11 -11
  267. package/es/internal/keyboard/match.js +7 -6
  268. package/es/internal/keyboard/navigation.js +15 -5
  269. package/es/internal/useAnnouncer.js +2 -2
  270. package/es/internal/useAttachedMenu.js +12 -20
  271. package/es/internal/useControllableState.js +11 -16
  272. package/es/internal/useDelayedState.js +9 -18
  273. package/es/internal/useEffectOnce.js +4 -4
  274. package/es/internal/useEvent.js +4 -4
  275. package/es/internal/useId.js +15 -19
  276. package/es/internal/useIdPrefix.js +1 -1
  277. package/es/internal/useIsomorphicEffect.js +1 -1
  278. package/es/internal/useMergedRefs.js +3 -3
  279. package/es/internal/useNoInteractiveChildren.js +8 -19
  280. package/es/internal/useNormalizedInputProps.js +16 -14
  281. package/es/internal/usePrefix.js +1 -1
  282. package/es/internal/useSavedCallback.js +3 -3
  283. package/es/internal/warning.js +4 -4
  284. package/es/internal/wrapFocus.js +16 -21
  285. package/es/prop-types/AriaPropTypes.js +1 -1
  286. package/es/prop-types/deprecate.js +6 -5
  287. package/es/prop-types/isRequiredOneOf.js +12 -25
  288. package/es/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
  289. package/es/prop-types/types.js +1 -1
  290. package/es/tools/array.js +1 -1
  291. package/es/tools/events.js +21 -14
  292. package/es/tools/mergeRefs.js +3 -3
  293. package/es/tools/setupGetInstanceId.js +1 -1
  294. package/es/tools/uniqueId.js +3 -3
  295. package/es/tools/wrapComponent.js +14 -13
  296. package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -336
  297. package/lib/components/Accordion/Accordion.Skeleton.js +27 -29
  298. package/lib/components/Accordion/Accordion.js +17 -20
  299. package/lib/components/Accordion/AccordionItem.js +36 -48
  300. package/lib/components/AspectRatio/AspectRatio.js +9 -11
  301. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +9 -10
  302. package/lib/components/Breadcrumb/Breadcrumb.js +13 -12
  303. package/lib/components/Breadcrumb/BreadcrumbItem.js +23 -21
  304. package/lib/components/Button/Button.Skeleton.js +24 -22
  305. package/lib/components/Button/Button.js +76 -71
  306. package/lib/components/ButtonSet/ButtonSet.js +11 -9
  307. package/lib/components/Checkbox/Checkbox.Skeleton.js +9 -10
  308. package/lib/components/Checkbox/Checkbox.js +54 -51
  309. package/lib/components/CheckboxGroup/CheckboxGroup.js +32 -30
  310. package/lib/components/ClassPrefix/index.js +4 -2
  311. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +14 -13
  312. package/lib/components/CodeSnippet/CodeSnippet.js +198 -101
  313. package/lib/components/ComboBox/ComboBox.js +348 -177
  314. package/lib/components/ComboBox/tools/filter.js +6 -4
  315. package/lib/components/ComboButton/index.js +37 -42
  316. package/lib/components/ComposedModal/ComposedModal.js +187 -85
  317. package/lib/components/ComposedModal/ModalFooter.js +53 -48
  318. package/lib/components/ComposedModal/ModalHeader.js +38 -25
  319. package/lib/components/ContainedList/ContainedList.js +18 -17
  320. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +20 -18
  321. package/lib/components/ContentSwitcher/ContentSwitcher.js +82 -97
  322. package/lib/components/ContentSwitcher/index.js +1 -1
  323. package/lib/components/ContextMenu/useContextMenu.js +12 -21
  324. package/lib/components/Copy/Copy.js +23 -28
  325. package/lib/components/CopyButton/CopyButton.js +9 -9
  326. package/lib/components/DangerButton/DangerButton.js +3 -5
  327. package/lib/components/DataTable/DataTable.js +332 -359
  328. package/lib/components/DataTable/Table.js +28 -25
  329. package/lib/components/DataTable/TableActionList.js +2 -4
  330. package/lib/components/DataTable/TableBatchAction.js +2 -4
  331. package/lib/components/DataTable/TableBatchActions.js +28 -29
  332. package/lib/components/DataTable/TableBody.js +6 -7
  333. package/lib/components/DataTable/TableCell.js +1 -1
  334. package/lib/components/DataTable/TableContainer.js +22 -22
  335. package/lib/components/DataTable/TableContext.js +1 -1
  336. package/lib/components/DataTable/TableExpandHeader.js +18 -20
  337. package/lib/components/DataTable/TableExpandRow.js +22 -22
  338. package/lib/components/DataTable/TableExpandedRow.js +17 -22
  339. package/lib/components/DataTable/TableHead.js +1 -1
  340. package/lib/components/DataTable/TableHeader.js +43 -39
  341. package/lib/components/DataTable/TableRow.js +7 -8
  342. package/lib/components/DataTable/TableSelectAll.js +13 -11
  343. package/lib/components/DataTable/TableSelectRow.js +28 -20
  344. package/lib/components/DataTable/TableToolbar.js +18 -13
  345. package/lib/components/DataTable/TableToolbarAction.js +5 -5
  346. package/lib/components/DataTable/TableToolbarContent.js +2 -4
  347. package/lib/components/DataTable/TableToolbarMenu.js +10 -11
  348. package/lib/components/DataTable/TableToolbarSearch.js +51 -70
  349. package/lib/components/DataTable/state/getDerivedStateFromProps.js +15 -15
  350. package/lib/components/DataTable/state/sortStates.js +1 -1
  351. package/lib/components/DataTable/state/sorting.js +28 -20
  352. package/lib/components/DataTable/tools/cells.js +1 -3
  353. package/lib/components/DataTable/tools/denormalize.js +4 -17
  354. package/lib/components/DataTable/tools/filter.js +18 -16
  355. package/lib/components/DataTable/tools/instanceId.js +2 -2
  356. package/lib/components/DataTable/tools/normalize.js +28 -25
  357. package/lib/components/DataTable/tools/sorting.js +27 -24
  358. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +35 -37
  359. package/lib/components/DatePicker/DatePicker.Skeleton.js +16 -17
  360. package/lib/components/DatePicker/DatePicker.js +205 -194
  361. package/lib/components/DatePicker/plugins/appendToPlugin.js +45 -43
  362. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +117 -107
  363. package/lib/components/DatePicker/plugins/rangePlugin.js +19 -11
  364. package/lib/components/DatePickerInput/DatePickerInput.js +83 -74
  365. package/lib/components/Dropdown/Dropdown.Skeleton.js +12 -11
  366. package/lib/components/Dropdown/Dropdown.js +265 -108
  367. package/lib/components/ErrorBoundary/ErrorBoundary.js +27 -48
  368. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +3 -2
  369. package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +13 -0
  370. package/lib/components/ExpandableSearch/ExpandableSearch.js +17 -24
  371. package/lib/components/FeatureFlags/index.js +25 -43
  372. package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -8
  373. package/lib/components/FileUploader/FileUploader.js +119 -146
  374. package/lib/components/FileUploader/FileUploaderButton.js +35 -47
  375. package/lib/components/FileUploader/FileUploaderDropContainer.js +48 -52
  376. package/lib/components/FileUploader/FileUploaderItem.js +29 -29
  377. package/lib/components/FileUploader/Filename.js +12 -13
  378. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +10 -11
  379. package/lib/components/FluidComboBox/FluidComboBox.js +10 -8
  380. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +17 -17
  381. package/lib/components/FluidDatePicker/FluidDatePicker.js +18 -15
  382. package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +3 -3
  383. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +10 -11
  384. package/lib/components/FluidDropdown/FluidDropdown.js +10 -8
  385. package/lib/components/FluidForm/FluidForm.js +8 -9
  386. package/lib/components/FluidForm/FormContext.js +1 -1
  387. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +10 -11
  388. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +11 -9
  389. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +10 -11
  390. package/lib/components/FluidSelect/FluidSelect.js +8 -8
  391. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +8 -9
  392. package/lib/components/FluidTextArea/FluidTextArea.js +6 -7
  393. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +8 -9
  394. package/lib/components/FluidTextInput/FluidTextInput.js +9 -8
  395. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +10 -9
  396. package/lib/components/FluidTimePicker/FluidTimePicker.js +30 -26
  397. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +6 -6
  398. package/lib/components/Form/Form.js +8 -9
  399. package/lib/components/FormGroup/FormGroup.js +15 -16
  400. package/lib/components/FormItem/FormItem.js +7 -8
  401. package/lib/components/FormLabel/FormLabel.js +10 -9
  402. package/lib/components/Grid/CSSGrid.js +37 -38
  403. package/lib/components/Grid/Column.js +85 -78
  404. package/lib/components/Grid/ColumnHang.js +11 -13
  405. package/lib/components/Grid/FlexGrid.js +19 -21
  406. package/lib/components/Grid/Grid.js +2 -2
  407. package/lib/components/Grid/GridContext.js +12 -11
  408. package/lib/components/Grid/Row.js +16 -18
  409. package/lib/components/Heading/index.js +11 -13
  410. package/lib/components/Icon/Icon.Skeleton.js +9 -11
  411. package/lib/components/IconButton/index.js +18 -21
  412. package/lib/components/IdPrefix/index.js +4 -2
  413. package/lib/components/InlineCheckbox/InlineCheckbox.js +89 -36
  414. package/lib/components/InlineLoading/InlineLoading.js +22 -24
  415. package/lib/components/Layer/LayerContext.js +1 -1
  416. package/lib/components/Layer/index.js +16 -17
  417. package/lib/components/Layout/LayoutDirection.js +7 -9
  418. package/lib/components/Layout/LayoutDirectionContext.js +1 -1
  419. package/lib/components/Link/Link.js +24 -24
  420. package/lib/components/ListBox/ListBox.js +37 -30
  421. package/lib/components/ListBox/ListBoxField.js +8 -9
  422. package/lib/components/ListBox/ListBoxMenu.js +8 -9
  423. package/lib/components/ListBox/ListBoxMenuIcon.js +16 -14
  424. package/lib/components/ListBox/ListBoxMenuItem.js +22 -25
  425. package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
  426. package/lib/components/ListBox/ListBoxSelection.js +30 -25
  427. package/lib/components/ListBox/index.js +1 -1
  428. package/lib/components/ListBox/next/ListBoxSelection.js +26 -23
  429. package/lib/components/ListBox/next/ListBoxTrigger.js +19 -18
  430. package/lib/components/ListItem/ListItem.js +8 -9
  431. package/lib/components/Loading/Loading.js +23 -23
  432. package/lib/components/Menu/Menu.js +66 -79
  433. package/lib/components/Menu/MenuContext.js +9 -12
  434. package/lib/components/Menu/MenuItem.js +103 -127
  435. package/lib/components/MenuButton/index.js +36 -40
  436. package/lib/components/Modal/Modal.js +280 -119
  437. package/lib/components/ModalWrapper/ModalWrapper.js +71 -95
  438. package/lib/components/MultiSelect/FilterableMultiSelect.js +298 -162
  439. package/lib/components/MultiSelect/MultiSelect.js +163 -175
  440. package/lib/components/MultiSelect/MultiSelectPropTypes.js +1 -1
  441. package/lib/components/MultiSelect/tools/itemToString.js +3 -4
  442. package/lib/components/MultiSelect/tools/sorting.js +15 -13
  443. package/lib/components/Notification/Notification.js +434 -162
  444. package/lib/components/NumberInput/NumberInput.Skeleton.js +9 -10
  445. package/lib/components/NumberInput/NumberInput.js +139 -138
  446. package/lib/components/OrderedList/OrderedList.js +16 -14
  447. package/lib/components/OverflowMenu/OverflowMenu.js +358 -226
  448. package/lib/components/OverflowMenu/index.js +1 -1
  449. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +31 -36
  450. package/lib/components/OverflowMenuV2/index.js +25 -27
  451. package/lib/components/Pagination/Pagination.Skeleton.js +8 -9
  452. package/lib/components/Pagination/Pagination.js +97 -139
  453. package/lib/components/Pagination/experimental/PageSelector.js +17 -17
  454. package/lib/components/Pagination/experimental/Pagination.js +72 -93
  455. package/lib/components/PaginationNav/PaginationNav.js +97 -116
  456. package/lib/components/Popover/index.js +73 -79
  457. package/lib/components/PrimaryButton/PrimaryButton.js +3 -5
  458. package/lib/components/ProgressBar/ProgressBar.js +38 -36
  459. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +14 -13
  460. package/lib/components/ProgressIndicator/ProgressIndicator.js +70 -70
  461. package/lib/components/RadioButton/RadioButton.Skeleton.js +8 -9
  462. package/lib/components/RadioButton/RadioButton.js +26 -26
  463. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +54 -64
  464. package/lib/components/RadioTile/RadioTile.js +26 -24
  465. package/lib/components/Search/Search.Skeleton.js +15 -15
  466. package/lib/components/Search/Search.d.ts +83 -0
  467. package/lib/components/Search/Search.js +62 -69
  468. package/lib/components/Search/index.d.ts +11 -0
  469. package/lib/components/SecondaryButton/SecondaryButton.js +3 -5
  470. package/lib/components/Select/Select.Skeleton.js +11 -12
  471. package/lib/components/Select/Select.js +78 -72
  472. package/lib/components/SelectItem/SelectItem.js +16 -12
  473. package/lib/components/SelectItemGroup/SelectItemGroup.js +10 -11
  474. package/lib/components/SkeletonIcon/SkeletonIcon.js +10 -10
  475. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +10 -10
  476. package/lib/components/SkeletonText/SkeletonText.js +28 -28
  477. package/lib/components/Slider/Slider.Skeleton.js +16 -17
  478. package/lib/components/Slider/Slider.js +305 -328
  479. package/lib/components/Slider/index.js +1 -1
  480. package/lib/components/Stack/Stack.js +18 -19
  481. package/lib/components/Stack/index.js +2 -2
  482. package/lib/components/StructuredList/StructuredList.Skeleton.js +24 -23
  483. package/lib/components/StructuredList/StructuredList.js +133 -105
  484. package/lib/components/Switch/IconSwitch.js +45 -51
  485. package/lib/components/Switch/Switch.js +33 -31
  486. package/lib/components/Tab/Tab.js +76 -82
  487. package/lib/components/Tab/index.js +1 -1
  488. package/lib/components/TabContent/TabContent.js +15 -17
  489. package/lib/components/Tabs/Tabs.Skeleton.js +13 -12
  490. package/lib/components/Tabs/Tabs.js +194 -205
  491. package/lib/components/Tabs/usePressable.js +27 -36
  492. package/lib/components/Tag/Tag.Skeleton.js +9 -8
  493. package/lib/components/Tag/Tag.js +33 -30
  494. package/lib/components/Text/Text.js +19 -19
  495. package/lib/components/Text/TextDirection.js +8 -7
  496. package/lib/components/Text/TextDirectionContext.js +1 -1
  497. package/lib/components/Text/index.js +1 -1
  498. package/lib/components/TextArea/TextArea.Skeleton.js +10 -11
  499. package/lib/components/TextArea/TextArea.js +88 -82
  500. package/lib/components/TextInput/ControlledPasswordInput.js +78 -72
  501. package/lib/components/TextInput/PasswordInput.js +100 -90
  502. package/lib/components/TextInput/TextInput.Skeleton.js +10 -11
  503. package/lib/components/TextInput/TextInput.js +104 -92
  504. package/lib/components/TextInput/util.js +28 -30
  505. package/lib/components/Theme/index.js +24 -19
  506. package/lib/components/Tile/Tile.js +134 -175
  507. package/lib/components/TileGroup/TileGroup.js +54 -69
  508. package/lib/components/TileGroup/index.js +1 -1
  509. package/lib/components/TimePicker/TimePicker.js +59 -66
  510. package/lib/components/TimePickerSelect/TimePickerSelect.js +19 -17
  511. package/lib/components/TimePickerSelect/index.js +1 -1
  512. package/lib/components/Toggle/Toggle.Skeleton.js +68 -57
  513. package/lib/components/Toggle/Toggle.js +43 -47
  514. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +60 -54
  515. package/lib/components/Toggletip/index.js +51 -47
  516. package/lib/components/Tooltip/DefinitionTooltip.js +23 -30
  517. package/lib/components/Tooltip/Tooltip.js +34 -49
  518. package/lib/components/TreeView/TreeNode.js +93 -73
  519. package/lib/components/TreeView/TreeView.js +71 -82
  520. package/lib/components/UIShell/Content.js +12 -14
  521. package/lib/components/UIShell/Header.js +15 -11
  522. package/lib/components/UIShell/HeaderContainer.js +8 -14
  523. package/lib/components/UIShell/HeaderGlobalAction.js +25 -18
  524. package/lib/components/UIShell/HeaderGlobalBar.js +1 -3
  525. package/lib/components/UIShell/HeaderMenu.js +113 -128
  526. package/lib/components/UIShell/HeaderMenuButton.js +30 -21
  527. package/lib/components/UIShell/HeaderMenuItem.js +27 -19
  528. package/lib/components/UIShell/HeaderName.js +18 -13
  529. package/lib/components/UIShell/HeaderNavigation.js +18 -14
  530. package/lib/components/UIShell/HeaderPanel.js +22 -16
  531. package/lib/components/UIShell/HeaderSideNavItems.js +11 -9
  532. package/lib/components/UIShell/Link.js +11 -11
  533. package/lib/components/UIShell/SideNav.js +65 -61
  534. package/lib/components/UIShell/SideNavDetails.js +10 -11
  535. package/lib/components/UIShell/SideNavDivider.js +5 -3
  536. package/lib/components/UIShell/SideNavFooter.js +12 -12
  537. package/lib/components/UIShell/SideNavHeader.js +8 -6
  538. package/lib/components/UIShell/SideNavIcon.js +11 -8
  539. package/lib/components/UIShell/SideNavItem.js +11 -9
  540. package/lib/components/UIShell/SideNavItems.js +13 -11
  541. package/lib/components/UIShell/SideNavLink.js +18 -16
  542. package/lib/components/UIShell/SideNavLinkText.js +7 -8
  543. package/lib/components/UIShell/SideNavMenu.js +28 -35
  544. package/lib/components/UIShell/SideNavMenuItem.js +13 -13
  545. package/lib/components/UIShell/SideNavSwitcher.js +19 -19
  546. package/lib/components/UIShell/SkipToContent.js +9 -10
  547. package/lib/components/UIShell/Switcher.js +19 -10
  548. package/lib/components/UIShell/SwitcherDivider.js +9 -8
  549. package/lib/components/UIShell/SwitcherItem.js +25 -18
  550. package/lib/components/UIShell/_utils.js +1 -1
  551. package/lib/components/UnorderedList/UnorderedList.js +13 -13
  552. package/lib/index.js +10 -10
  553. package/lib/internal/ClickListener.js +49 -65
  554. package/lib/internal/FloatingMenu.js +192 -199
  555. package/lib/internal/OptimizedResize.js +9 -8
  556. package/lib/internal/Selection.js +91 -110
  557. package/lib/internal/createClassWrapper.js +2 -2
  558. package/lib/internal/deprecateFieldOnObject.js +5 -3
  559. package/lib/internal/environment.js +1 -1
  560. package/lib/internal/focus/index.js +1 -1
  561. package/lib/internal/keyboard/keys.js +11 -11
  562. package/lib/internal/keyboard/match.js +7 -6
  563. package/lib/internal/keyboard/navigation.js +15 -5
  564. package/lib/internal/useAnnouncer.js +2 -2
  565. package/lib/internal/useAttachedMenu.js +12 -20
  566. package/lib/internal/useControllableState.js +11 -16
  567. package/lib/internal/useDelayedState.js +9 -18
  568. package/lib/internal/useEffectOnce.js +4 -4
  569. package/lib/internal/useEvent.js +4 -4
  570. package/lib/internal/useId.js +14 -18
  571. package/lib/internal/useIdPrefix.js +1 -1
  572. package/lib/internal/useIsomorphicEffect.js +1 -1
  573. package/lib/internal/useMergedRefs.js +3 -3
  574. package/lib/internal/useNoInteractiveChildren.js +8 -19
  575. package/lib/internal/useNormalizedInputProps.js +16 -14
  576. package/lib/internal/usePrefix.js +1 -1
  577. package/lib/internal/useSavedCallback.js +3 -3
  578. package/lib/internal/warning.js +4 -4
  579. package/lib/internal/wrapFocus.js +16 -21
  580. package/lib/prop-types/AriaPropTypes.js +1 -1
  581. package/lib/prop-types/deprecate.js +6 -5
  582. package/lib/prop-types/isRequiredOneOf.js +15 -28
  583. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
  584. package/lib/prop-types/types.js +1 -1
  585. package/lib/tools/array.js +1 -1
  586. package/lib/tools/events.js +21 -14
  587. package/lib/tools/mergeRefs.js +3 -3
  588. package/lib/tools/setupGetInstanceId.js +1 -1
  589. package/lib/tools/uniqueId.js +3 -3
  590. package/lib/tools/wrapComponent.js +14 -13
  591. package/package.json +6 -6
@@ -9,7 +9,6 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
12
  var React = require('react');
14
13
  var warning = require('./warning.js');
15
14
 
@@ -36,25 +35,21 @@ var warning = require('./warning.js');
36
35
  */
37
36
 
38
37
  function useControllableState(_ref) {
39
- var defaultValue = _ref.defaultValue,
40
- _ref$name = _ref.name,
41
- name = _ref$name === void 0 ? 'custom' : _ref$name,
42
- onChange = _ref.onChange,
43
- value = _ref.value;
44
-
45
- var _useState = React.useState(value !== null && value !== void 0 ? value : defaultValue),
46
- _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
47
- state = _useState2[0],
48
- internalSetState = _useState2[1];
49
-
50
- var controlled = React.useRef(null);
38
+ let {
39
+ defaultValue,
40
+ name = 'custom',
41
+ onChange,
42
+ value
43
+ } = _ref;
44
+ const [state, internalSetState] = React.useState(value ?? defaultValue);
45
+ const controlled = React.useRef(null);
51
46
 
52
47
  if (controlled.current === null) {
53
48
  controlled.current = value !== undefined;
54
49
  }
55
50
 
56
51
  function setState(stateOrUpdater) {
57
- var value = typeof stateOrUpdater === 'function' ? stateOrUpdater(state) : stateOrUpdater;
52
+ const value = typeof stateOrUpdater === 'function' ? stateOrUpdater(state) : stateOrUpdater;
58
53
 
59
54
  if (controlled.current === false) {
60
55
  internalSetState(value);
@@ -65,8 +60,8 @@ function useControllableState(_ref) {
65
60
  }
66
61
  }
67
62
 
68
- React.useEffect(function () {
69
- var controlledValue = value !== undefined; // Uncontrolled -> Controlled
63
+ React.useEffect(() => {
64
+ const controlledValue = value !== undefined; // Uncontrolled -> Controlled
70
65
  // If the component prop is uncontrolled, the prop value should be undefined
71
66
 
72
67
  if (controlled.current === false && controlledValue) {
@@ -9,7 +9,6 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
12
  var React = require('react');
14
13
 
15
14
  /**
@@ -24,19 +23,13 @@ var React = require('react');
24
23
  */
25
24
 
26
25
  function useDelayedState(initialState) {
27
- var _useState = React.useState(initialState),
28
- _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
29
- state = _useState2[0],
30
- setState = _useState2[1];
31
-
32
- var timeoutId = React.useRef(null); // We use `useCallback` to match the signature of React's `useState` which will
26
+ const [state, setState] = React.useState(initialState);
27
+ const timeoutId = React.useRef(null); // We use `useCallback` to match the signature of React's `useState` which will
33
28
  // always return the same reference for the `setState` updater
34
29
 
35
- var setStateWithDelay = React.useCallback(function (stateToSet) {
36
- var _timeoutId$current;
37
-
38
- var delayMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
39
- window.clearTimeout((_timeoutId$current = timeoutId.current) !== null && _timeoutId$current !== void 0 ? _timeoutId$current : undefined);
30
+ const setStateWithDelay = React.useCallback(function (stateToSet) {
31
+ let delayMs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
32
+ window.clearTimeout(timeoutId.current ?? undefined);
40
33
  timeoutId.current = null;
41
34
 
42
35
  if (delayMs === 0) {
@@ -44,16 +37,14 @@ function useDelayedState(initialState) {
44
37
  return;
45
38
  }
46
39
 
47
- timeoutId.current = window.setTimeout(function () {
40
+ timeoutId.current = window.setTimeout(() => {
48
41
  setState(stateToSet);
49
42
  timeoutId.current = null;
50
43
  }, delayMs);
51
44
  }, []);
52
- React.useEffect(function () {
53
- return function () {
54
- var _timeoutId$current2;
55
-
56
- window.clearTimeout((_timeoutId$current2 = timeoutId.current) !== null && _timeoutId$current2 !== void 0 ? _timeoutId$current2 : undefined);
45
+ React.useEffect(() => {
46
+ return () => {
47
+ window.clearTimeout(timeoutId.current ?? undefined);
57
48
  };
58
49
  }, []);
59
50
  return [state, setStateWithDelay];
@@ -19,12 +19,12 @@ var React = require('react');
19
19
  */
20
20
 
21
21
  function useEffectOnce(callback) {
22
- var savedCallback = React.useRef(callback);
23
- var effectGuard = React.useRef(false);
24
- React.useEffect(function () {
22
+ const savedCallback = React.useRef(callback);
23
+ const effectGuard = React.useRef(false);
24
+ React.useEffect(() => {
25
25
  savedCallback.current = callback;
26
26
  });
27
- React.useEffect(function () {
27
+ React.useEffect(() => {
28
28
  if (effectGuard.current !== true) {
29
29
  effectGuard.current = true;
30
30
  savedCallback.current();
@@ -12,11 +12,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  var React = require('react');
13
13
 
14
14
  function useWindowEvent(eventName, callback) {
15
- var savedCallback = React.useRef(null);
16
- React.useEffect(function () {
15
+ const savedCallback = React.useRef(null);
16
+ React.useEffect(() => {
17
17
  savedCallback.current = callback;
18
18
  });
19
- React.useEffect(function () {
19
+ React.useEffect(() => {
20
20
  function handler(event) {
21
21
  if (savedCallback.current) {
22
22
  savedCallback.current(event);
@@ -24,7 +24,7 @@ function useWindowEvent(eventName, callback) {
24
24
  }
25
25
 
26
26
  window.addEventListener(eventName, handler);
27
- return function () {
27
+ return () => {
28
28
  window.removeEventListener(eventName, handler);
29
29
  };
30
30
  }, [eventName]);
@@ -9,15 +9,15 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
12
  var React = require('react');
14
13
  var setupGetInstanceId = require('../tools/setupGetInstanceId.js');
15
14
  var environment = require('./environment.js');
16
15
  var useIdPrefix = require('./useIdPrefix.js');
17
16
 
18
- var getId = setupGetInstanceId["default"]();
19
- var useIsomorphicLayoutEffect = environment.canUseDOM ? React.useLayoutEffect : React.useEffect;
20
- var serverHandoffCompleted = false;
17
+ // This file was heavily inspired by Reach UI and their work on their auto-id
18
+ const getId = setupGetInstanceId["default"]();
19
+ const useIsomorphicLayoutEffect = environment.canUseDOM ? React.useLayoutEffect : React.useEffect;
20
+ let serverHandoffCompleted = false;
21
21
  /**
22
22
  * Generate a unique ID with an optional prefix prepended to it
23
23
  * @param {string} [prefix]
@@ -25,27 +25,23 @@ var serverHandoffCompleted = false;
25
25
  */
26
26
 
27
27
  function useId() {
28
- var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';
28
+ let prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'id';
29
29
 
30
- var _prefix = useIdPrefix.useIdPrefix();
30
+ const _prefix = useIdPrefix.useIdPrefix();
31
31
 
32
- var _useState = React.useState(function () {
32
+ const [id, setId] = React.useState(() => {
33
33
  if (serverHandoffCompleted) {
34
- return "".concat(_prefix ? "".concat(_prefix, "-") : "").concat(prefix, "-").concat(getId());
34
+ return `${_prefix ? `${_prefix}-` : ``}${prefix}-${getId()}`;
35
35
  }
36
36
 
37
37
  return null;
38
- }),
39
- _useState2 = _rollupPluginBabelHelpers.slicedToArray(_useState, 2),
40
- id = _useState2[0],
41
- setId = _useState2[1];
42
-
43
- useIsomorphicLayoutEffect(function () {
38
+ });
39
+ useIsomorphicLayoutEffect(() => {
44
40
  if (id === null) {
45
- setId("".concat(_prefix ? "".concat(_prefix, "-") : "").concat(prefix, "-").concat(getId()));
41
+ setId(`${_prefix ? `${_prefix}-` : ``}${prefix}-${getId()}`);
46
42
  }
47
43
  }, [getId]);
48
- React.useEffect(function () {
44
+ React.useEffect(() => {
49
45
  if (serverHandoffCompleted === false) {
50
46
  serverHandoffCompleted = true;
51
47
  }
@@ -59,8 +55,8 @@ function useId() {
59
55
  */
60
56
 
61
57
  function useFallbackId(id) {
62
- var fallback = useId();
63
- return id !== null && id !== void 0 ? id : fallback;
58
+ const fallback = useId();
59
+ return id ?? fallback;
64
60
  }
65
61
 
66
62
  exports.useFallbackId = useFallbackId;
@@ -15,7 +15,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
15
15
 
16
16
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
17
 
18
- var IdPrefixContext = /*#__PURE__*/React__default["default"].createContext(null);
18
+ const IdPrefixContext = /*#__PURE__*/React__default["default"].createContext(null);
19
19
  function useIdPrefix() {
20
20
  return React__default["default"].useContext(IdPrefixContext);
21
21
  }
@@ -11,7 +11,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  var React = require('react');
13
13
 
14
- var useIsomorphicEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
14
+ const useIsomorphicEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
15
15
  var useIsomorphicEffect$1 = useIsomorphicEffect;
16
16
 
17
17
  exports["default"] = useIsomorphicEffect$1;
@@ -17,9 +17,9 @@ var React = require('react');
17
17
  * the same node.
18
18
  */
19
19
 
20
- var useMergedRefs = function useMergedRefs(refs) {
21
- return React.useCallback(function (node) {
22
- refs.forEach(function (ref) {
20
+ const useMergedRefs = refs => {
21
+ return React.useCallback(node => {
22
+ refs.forEach(ref => {
23
23
  if (typeof ref === 'function') {
24
24
  ref(node);
25
25
  } else if (ref !== null && ref !== undefined) {
@@ -9,19 +9,18 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
12
  var React = require('react');
14
13
 
15
14
  function useNoInteractiveChildren(ref) {
16
- var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'component should have no interactive child nodes';
15
+ let message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'component should have no interactive child nodes';
17
16
 
18
17
  if (process.env.NODE_ENV !== "production") {
19
18
  // eslint-disable-next-line react-hooks/rules-of-hooks
20
- React.useEffect(function () {
21
- var node = ref.current ? getInteractiveContent(ref.current) : false;
19
+ React.useEffect(() => {
20
+ const node = ref.current ? getInteractiveContent(ref.current) : false;
22
21
 
23
22
  if (node) {
24
- throw new Error("Error: ".concat(message, ".\n\nInstead found: ").concat(node.outerHTML));
23
+ throw new Error(`Error: ${message}.\n\nInstead found: ${node.outerHTML}`);
25
24
  }
26
25
  });
27
26
  }
@@ -43,22 +42,12 @@ function getInteractiveContent(node) {
43
42
  return node;
44
43
  }
45
44
 
46
- var _iterator = _rollupPluginBabelHelpers.createForOfIteratorHelper(node.childNodes),
47
- _step;
45
+ for (const childNode of node.childNodes) {
46
+ const interactiveNode = getInteractiveContent(childNode);
48
47
 
49
- try {
50
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
51
- var childNode = _step.value;
52
- var interactiveNode = getInteractiveContent(childNode);
53
-
54
- if (interactiveNode) {
55
- return interactiveNode;
56
- }
48
+ if (interactiveNode) {
49
+ return interactiveNode;
57
50
  }
58
- } catch (err) {
59
- _iterator.e(err);
60
- } finally {
61
- _iterator.f();
62
51
  }
63
52
 
64
53
  return null;
@@ -55,35 +55,37 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
55
55
  */
56
56
 
57
57
  function useNormalizedInputProps(_ref) {
58
- var id = _ref.id,
59
- readOnly = _ref.readOnly,
60
- disabled = _ref.disabled,
61
- invalid = _ref.invalid,
62
- invalidText = _ref.invalidText,
63
- warn = _ref.warn,
64
- warnText = _ref.warnText;
65
- var prefix = usePrefix.usePrefix();
66
- var normalizedProps = {
58
+ let {
59
+ id,
60
+ readOnly,
61
+ disabled,
62
+ invalid,
63
+ invalidText,
64
+ warn,
65
+ warnText
66
+ } = _ref;
67
+ const prefix = usePrefix.usePrefix();
68
+ const normalizedProps = {
67
69
  disabled: !readOnly && disabled,
68
70
  invalid: !readOnly && invalid,
69
- invalidId: "".concat(id, "-error-msg"),
71
+ invalidId: `${id}-error-msg`,
70
72
  warn: !readOnly && !invalid && warn,
71
- warnId: "".concat(id, "-warn-msg"),
73
+ warnId: `${id}-warn-msg`,
72
74
  validation: null,
73
75
  icon: null,
74
- helperId: "".concat(id, "-helper-text")
76
+ helperId: `${id}-helper-text`
75
77
  };
76
78
 
77
79
  if (normalizedProps.invalid) {
78
80
  normalizedProps.icon = iconsReact.WarningFilled;
79
81
  normalizedProps.validation = /*#__PURE__*/React__default["default"].createElement("div", {
80
- className: "".concat(prefix, "--form-requirement"),
82
+ className: `${prefix}--form-requirement`,
81
83
  id: normalizedProps.invalidId
82
84
  }, invalidText);
83
85
  } else if (normalizedProps.warn) {
84
86
  normalizedProps.icon = iconsReact.WarningAltFilled;
85
87
  normalizedProps.validation = /*#__PURE__*/React__default["default"].createElement("div", {
86
- className: "".concat(prefix, "--form-requirement"),
88
+ className: `${prefix}--form-requirement`,
87
89
  id: normalizedProps.warnId
88
90
  }, warnText);
89
91
  }
@@ -15,7 +15,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
15
15
 
16
16
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
17
 
18
- var PrefixContext = /*#__PURE__*/React__default["default"].createContext('cds');
18
+ const PrefixContext = /*#__PURE__*/React__default["default"].createContext('cds');
19
19
  function usePrefix() {
20
20
  return React__default["default"].useContext(PrefixContext);
21
21
  }
@@ -22,13 +22,13 @@ var React = require('react');
22
22
  */
23
23
 
24
24
  function useSavedCallback(callback) {
25
- var savedCallback = React.useRef(callback);
26
- React.useEffect(function () {
25
+ const savedCallback = React.useRef(callback);
26
+ React.useEffect(() => {
27
27
  savedCallback.current = callback;
28
28
  });
29
29
  return React.useCallback(function () {
30
30
  if (savedCallback.current) {
31
- return savedCallback.current.apply(savedCallback, arguments);
31
+ return savedCallback.current(...arguments);
32
32
  }
33
33
  }, []);
34
34
  }
@@ -9,9 +9,9 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var emptyFunction = function emptyFunction() {};
12
+ const emptyFunction = function () {};
13
13
 
14
- var warning = process.env.NODE_ENV !== "production" ? function warning(condition, format) {
14
+ const warning = process.env.NODE_ENV !== "production" ? function warning(condition, format) {
15
15
  for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
16
16
  args[_key - 2] = arguments[_key];
17
17
  }
@@ -21,8 +21,8 @@ var warning = process.env.NODE_ENV !== "production" ? function warning(condition
21
21
  }
22
22
 
23
23
  if (!condition) {
24
- var index = 0;
25
- var message = format.replace(/%s/g, function () {
24
+ let index = 0;
25
+ const message = format.replace(/%s/g, () => {
26
26
  return args[index++];
27
27
  });
28
28
  console.warn('Warning: ' + message);
@@ -9,7 +9,6 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
12
  var findLast = require('lodash.findlast');
14
13
  var navigation = require('./keyboard/navigation.js');
15
14
 
@@ -24,13 +23,11 @@ var findLast__default = /*#__PURE__*/_interopDefaultLegacy(findLast);
24
23
  */
25
24
 
26
25
  function elementOrParentIsFloatingMenu(node) {
27
- var selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
26
+ let selectorsFloatingMenus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
28
27
 
29
28
  if (node && typeof node.closest === 'function') {
30
- var allSelectorsFloatingMenus = [".cds--overflow-menu-options", ".cds--tooltip", '.flatpickr-calendar'].concat(_rollupPluginBabelHelpers.toConsumableArray(selectorsFloatingMenus));
31
- return allSelectorsFloatingMenus.some(function (selector) {
32
- return node.closest(selector);
33
- });
29
+ const allSelectorsFloatingMenus = [`.cds--overflow-menu-options`, `.cds--tooltip`, '.flatpickr-calendar', ...selectorsFloatingMenus];
30
+ return allSelectorsFloatingMenus.some(selector => node.closest(selector));
34
31
  }
35
32
  }
36
33
  /**
@@ -46,20 +43,20 @@ function elementOrParentIsFloatingMenu(node) {
46
43
 
47
44
 
48
45
  function wrapFocus(_ref) {
49
- var bodyNode = _ref.bodyNode,
50
- startTrapNode = _ref.startTrapNode,
51
- endTrapNode = _ref.endTrapNode,
52
- currentActiveNode = _ref.currentActiveNode,
53
- oldActiveNode = _ref.oldActiveNode,
54
- selectorsFloatingMenus = _ref.selectorsFloatingMenus;
46
+ let {
47
+ bodyNode,
48
+ startTrapNode,
49
+ endTrapNode,
50
+ currentActiveNode,
51
+ oldActiveNode,
52
+ selectorsFloatingMenus
53
+ } = _ref;
55
54
 
56
55
  if (bodyNode && currentActiveNode && oldActiveNode && !bodyNode.contains(currentActiveNode) && !elementOrParentIsFloatingMenu(currentActiveNode, selectorsFloatingMenus)) {
57
- var comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
56
+ const comparisonResult = oldActiveNode.compareDocumentPosition(currentActiveNode);
58
57
 
59
58
  if (currentActiveNode === startTrapNode || comparisonResult & navigation.DOCUMENT_POSITION_BROAD_PRECEDING) {
60
- var tabbable = findLast__default["default"](bodyNode.querySelectorAll(navigation.selectorTabbable), function (elem) {
61
- return Boolean(elem.offsetParent);
62
- });
59
+ const tabbable = findLast__default["default"](bodyNode.querySelectorAll(navigation.selectorTabbable), elem => Boolean(elem.offsetParent));
63
60
 
64
61
  if (tabbable) {
65
62
  tabbable.focus();
@@ -67,12 +64,10 @@ function wrapFocus(_ref) {
67
64
  bodyNode.focus();
68
65
  }
69
66
  } else if (currentActiveNode === endTrapNode || comparisonResult & navigation.DOCUMENT_POSITION_BROAD_FOLLOWING) {
70
- var _tabbable = Array.prototype.find.call(bodyNode.querySelectorAll(navigation.selectorTabbable), function (elem) {
71
- return Boolean(elem.offsetParent);
72
- });
67
+ const tabbable = Array.prototype.find.call(bodyNode.querySelectorAll(navigation.selectorTabbable), elem => Boolean(elem.offsetParent));
73
68
 
74
- if (_tabbable) {
75
- _tabbable.focus();
69
+ if (tabbable) {
70
+ tabbable.focus();
76
71
  } else if (bodyNode !== oldActiveNode) {
77
72
  bodyNode.focus();
78
73
  }
@@ -16,7 +16,7 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
16
16
 
17
17
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
18
18
 
19
- var AriaLabelPropType = isRequiredOneOf["default"]({
19
+ const AriaLabelPropType = isRequiredOneOf["default"]({
20
20
  'aria-label': PropTypes__default["default"].string,
21
21
  'aria-labelledby': PropTypes__default["default"].string
22
22
  });
@@ -9,10 +9,9 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
12
  var warning = require('../internal/warning.js');
14
13
 
15
- var didWarnAboutDeprecation = {};
14
+ const didWarnAboutDeprecation = {};
16
15
  function deprecate(propType, message) {
17
16
  function checker(props, propName, componentName) {
18
17
  if (props[propName] === undefined) {
@@ -20,15 +19,17 @@ function deprecate(propType, message) {
20
19
  }
21
20
 
22
21
  if (!didWarnAboutDeprecation[componentName] || !didWarnAboutDeprecation[componentName][propName]) {
23
- didWarnAboutDeprecation[componentName] = _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, didWarnAboutDeprecation[componentName]), {}, _rollupPluginBabelHelpers.defineProperty({}, propName, true));
24
- process.env.NODE_ENV !== "production" ? warning.warning(false, message || "The prop `".concat(propName, "` has been deprecated for the ") + "".concat(componentName, " component. It will be removed in the next major ") + "release") : void 0;
22
+ didWarnAboutDeprecation[componentName] = { ...didWarnAboutDeprecation[componentName],
23
+ [propName]: true
24
+ };
25
+ process.env.NODE_ENV !== "production" ? warning.warning(false, message || `The prop \`${propName}\` has been deprecated for the ` + `${componentName} component. It will be removed in the next major ` + `release`) : void 0;
25
26
  }
26
27
 
27
28
  for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
28
29
  rest[_key - 3] = arguments[_key];
29
30
  }
30
31
 
31
- return propType.apply(void 0, [props, propName, componentName].concat(rest));
32
+ return propType(props, propName, componentName, ...rest);
32
33
  }
33
34
 
34
35
  return checker;
@@ -9,15 +9,6 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.js');
13
-
14
- /**
15
- * Copyright IBM Corp. 2016, 2023
16
- *
17
- * This source code is licensed under the Apache-2.0 license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- */
20
-
21
12
  /**
22
13
  * @param {Object<string, Function>} propTypes The list of type checkers, keyed by prop names.
23
14
  * @returns {Object<string, Function>}
@@ -25,27 +16,23 @@ var _rollupPluginBabelHelpers = require('../_virtual/_rollupPluginBabelHelpers.j
25
16
  * in addition to the original type checkings.
26
17
  */
27
18
  function isRequiredOneOf(propTypes) {
28
- var names = Object.keys(propTypes);
29
-
30
- var checker = function checker(propType) {
31
- return function (props, propName, componentName) {
32
- if (process.env.NODE_ENV !== "production" && names.every(function (name) {
33
- return typeof props[name] === 'undefined';
34
- })) {
35
- return new Error("".concat(componentName, " requires one of the following props: ").concat(names.join(', ')));
36
- }
37
-
38
- for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
39
- rest[_key - 3] = arguments[_key];
40
- }
41
-
42
- return propType.apply(void 0, [props, propName, componentName].concat(rest));
43
- };
19
+ const names = Object.keys(propTypes);
20
+
21
+ const checker = propType => function (props, propName, componentName) {
22
+ if (process.env.NODE_ENV !== "production" && names.every(name => typeof props[name] === 'undefined')) {
23
+ return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
24
+ }
25
+
26
+ for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
27
+ rest[_key - 3] = arguments[_key];
28
+ }
29
+
30
+ return propType(props, propName, componentName, ...rest);
44
31
  };
45
32
 
46
- return names.reduce(function (o, name) {
47
- return _rollupPluginBabelHelpers.objectSpread2(_rollupPluginBabelHelpers.objectSpread2({}, o), {}, _rollupPluginBabelHelpers.defineProperty({}, name, checker(propTypes[name])));
48
- }, {});
33
+ return names.reduce((o, name) => ({ ...o,
34
+ [name]: checker(propTypes[name])
35
+ }), {});
49
36
  }
50
37
 
51
38
  exports["default"] = isRequiredOneOf;
@@ -19,14 +19,14 @@ Object.defineProperty(exports, '__esModule', { value: true });
19
19
  function requiredIfGivenPropIsTruthy(name, propType) {
20
20
  return function check(props, propName, componentName) {
21
21
  if (process.env.NODE_ENV !== "production" && props[name] == true && props[propName] == null) {
22
- return new Error("You must provide a value for `".concat(propName, "` in `").concat(componentName, "` if `").concat(name, "` exists."));
22
+ return new Error(`You must provide a value for \`${propName}\` in \`${componentName}\` if \`${name}\` exists.`);
23
23
  }
24
24
 
25
25
  for (var _len = arguments.length, rest = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++) {
26
26
  rest[_key - 3] = arguments[_key];
27
27
  }
28
28
 
29
- return propType.apply(void 0, [props, propName, componentName].concat(rest));
29
+ return propType(props, propName, componentName, ...rest);
30
30
  };
31
31
  }
32
32
 
@@ -9,6 +9,6 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
- var ButtonKinds = ['primary', 'secondary', 'danger', 'ghost', 'danger--primary', 'danger--ghost', 'danger--tertiary', 'tertiary'];
12
+ const ButtonKinds = ['primary', 'secondary', 'danger', 'ghost', 'danger--primary', 'danger--ghost', 'danger--tertiary', 'tertiary'];
13
13
 
14
14
  exports.ButtonKinds = ButtonKinds;
@@ -24,7 +24,7 @@ function equals(arr1, arr2) {
24
24
  return true;
25
25
  }
26
26
 
27
- for (var i = 0; i < arr1.length; i++) {
27
+ for (let i = 0; i < arr1.length; i++) {
28
28
  if (arr1[i] !== arr2[i]) {
29
29
  return false;
30
30
  }