@carbon/react 1.29.0 → 1.30.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (580) hide show
  1. package/es/_virtual/_rollupPluginBabelHelpers.js +16 -5
  2. package/es/components/Accordion/Accordion.Skeleton.js +0 -7
  3. package/es/components/Accordion/Accordion.js +1 -8
  4. package/es/components/Accordion/AccordionItem.js +5 -19
  5. package/es/components/AspectRatio/AspectRatio.js +0 -5
  6. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
  7. package/es/components/Breadcrumb/Breadcrumb.js +0 -3
  8. package/es/components/Breadcrumb/BreadcrumbItem.js +0 -7
  9. package/es/components/Button/Button.Skeleton.js +2 -7
  10. package/es/components/Button/Button.js +2 -36
  11. package/es/components/ButtonSet/ButtonSet.js +0 -2
  12. package/es/components/Checkbox/Checkbox.Skeleton.js +0 -1
  13. package/es/components/Checkbox/Checkbox.js +4 -20
  14. package/es/components/CheckboxGroup/CheckboxGroup.js +0 -11
  15. package/es/components/ClassPrefix/index.d.ts +26 -0
  16. package/es/components/ClassPrefix/index.js +0 -2
  17. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
  18. package/es/components/CodeSnippet/CodeSnippet.js +6 -45
  19. package/es/components/ComboBox/ComboBox.js +12 -79
  20. package/es/components/ComboBox/tools/filter.js +0 -1
  21. package/es/components/ComboButton/index.js +0 -14
  22. package/es/components/ComposedModal/ComposedModal.js +2 -32
  23. package/es/components/ComposedModal/ModalFooter.js +0 -21
  24. package/es/components/ComposedModal/ModalHeader.js +0 -12
  25. package/es/components/ContainedList/ContainedList.js +5 -32
  26. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
  27. package/es/components/ContentSwitcher/ContentSwitcher.js +11 -23
  28. package/es/components/ContextMenu/useContextMenu.js +1 -6
  29. package/es/components/Copy/Copy.js +8 -31
  30. package/es/components/CopyButton/CopyButton.js +0 -4
  31. package/es/components/DangerButton/DangerButton.js +0 -1
  32. package/es/components/DataTable/DataTable.js +171 -91
  33. package/es/components/DataTable/Table.js +0 -6
  34. package/es/components/DataTable/TableBatchAction.js +0 -4
  35. package/es/components/DataTable/TableBatchActions.js +0 -8
  36. package/es/components/DataTable/TableBody.js +0 -1
  37. package/es/components/DataTable/TableContainer.js +0 -5
  38. package/es/components/DataTable/TableExpandHeader.js +0 -7
  39. package/es/components/DataTable/TableExpandRow.js +0 -6
  40. package/es/components/DataTable/TableExpandedRow.js +0 -6
  41. package/es/components/DataTable/TableHeader.d.ts +1 -1
  42. package/es/components/DataTable/TableHeader.js +3 -19
  43. package/es/components/DataTable/TableRow.js +4 -5
  44. package/es/components/DataTable/TableSelectAll.js +0 -8
  45. package/es/components/DataTable/TableSelectRow.js +2 -10
  46. package/es/components/DataTable/TableToolbar.js +0 -3
  47. package/es/components/DataTable/TableToolbarMenu.d.ts +1 -1
  48. package/es/components/DataTable/TableToolbarMenu.js +3 -6
  49. package/es/components/DataTable/TableToolbarSearch.js +2 -30
  50. package/es/components/DataTable/state/getDerivedStateFromProps.js +0 -4
  51. package/es/components/DataTable/state/sorting.js +5 -8
  52. package/es/components/DataTable/tools/denormalize.js +2 -2
  53. package/es/components/DataTable/tools/filter.js +0 -2
  54. package/es/components/DataTable/tools/instanceId.js +0 -1
  55. package/es/components/DataTable/tools/normalize.js +10 -10
  56. package/es/components/DataTable/tools/sorting.js +5 -13
  57. package/es/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
  58. package/es/components/DatePicker/DatePicker.Skeleton.js +0 -6
  59. package/es/components/DatePicker/DatePicker.js +154 -177
  60. package/es/components/DatePicker/plugins/appendToPlugin.js +3 -7
  61. package/es/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
  62. package/es/components/DatePicker/plugins/rangePlugin.js +2 -7
  63. package/es/components/DatePickerInput/DatePickerInput.js +2 -28
  64. package/es/components/Dropdown/Dropdown.Skeleton.js +0 -2
  65. package/es/components/Dropdown/Dropdown.js +43 -52
  66. package/es/components/ErrorBoundary/ErrorBoundary.js +0 -10
  67. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
  68. package/es/components/ExpandableSearch/ExpandableSearch.js +1 -10
  69. package/es/components/FeatureFlags/index.js +8 -20
  70. package/es/components/FileUploader/FileUploader.Skeleton.js +0 -2
  71. package/es/components/FileUploader/FileUploader.js +3 -38
  72. package/es/components/FileUploader/FileUploaderButton.js +3 -24
  73. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -28
  74. package/es/components/FileUploader/FileUploaderItem.js +1 -11
  75. package/es/components/FileUploader/Filename.js +0 -10
  76. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
  77. package/es/components/FluidComboBox/FluidComboBox.js +0 -18
  78. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
  79. package/es/components/FluidDatePicker/FluidDatePicker.js +0 -6
  80. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
  81. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
  82. package/es/components/FluidDropdown/FluidDropdown.js +0 -18
  83. package/es/components/FluidForm/FluidForm.js +0 -2
  84. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
  85. package/es/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
  86. package/es/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
  87. package/es/components/FluidSelect/FluidSelect.js +0 -10
  88. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
  89. package/es/components/FluidTextArea/FluidTextArea.js +0 -20
  90. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
  91. package/es/components/FluidTextInput/FluidTextInput.js +0 -14
  92. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
  93. package/es/components/FluidTimePicker/FluidTimePicker.js +1 -11
  94. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
  95. package/es/components/Form/Form.d.ts +23 -0
  96. package/es/components/Form/Form.js +3 -6
  97. package/es/components/Form/index.d.ts +7 -0
  98. package/es/components/FormGroup/FormGroup.js +0 -7
  99. package/es/components/FormItem/FormItem.js +0 -2
  100. package/es/components/FormLabel/FormLabel.js +1 -7
  101. package/es/components/Grid/CSSGrid.js +2 -15
  102. package/es/components/Grid/Column.js +18 -59
  103. package/es/components/Grid/ColumnHang.js +2 -5
  104. package/es/components/Grid/FlexGrid.js +2 -8
  105. package/es/components/Grid/Grid.js +0 -8
  106. package/es/components/Grid/GridContext.js +1 -3
  107. package/es/components/Grid/Row.js +2 -7
  108. package/es/components/Heading/index.js +0 -4
  109. package/es/components/Icon/Icon.Skeleton.js +2 -2
  110. package/es/components/IconButton/index.js +0 -10
  111. package/es/components/IdPrefix/index.js +0 -2
  112. package/es/components/InlineCheckbox/InlineCheckbox.js +0 -14
  113. package/es/components/InlineLoading/InlineLoading.js +0 -12
  114. package/es/components/Layer/index.js +3 -6
  115. package/es/components/Layout/LayoutDirection.js +0 -3
  116. package/es/components/Layout/useLayoutDirection.js +0 -1
  117. package/es/components/Link/Link.js +3 -10
  118. package/es/components/ListBox/ListBox.js +2 -13
  119. package/es/components/ListBox/ListBoxField.js +0 -5
  120. package/es/components/ListBox/ListBoxMenuIcon.js +0 -4
  121. package/es/components/ListBox/ListBoxMenuItem.js +2 -6
  122. package/es/components/ListBox/ListBoxPropTypes.d.ts +2 -2
  123. package/es/components/ListBox/ListBoxSelection.js +1 -13
  124. package/es/components/ListBox/next/ListBoxSelection.js +1 -14
  125. package/es/components/ListBox/next/ListBoxTrigger.js +1 -3
  126. package/es/components/ListItem/ListItem.d.ts +23 -0
  127. package/es/components/ListItem/ListItem.js +4 -8
  128. package/es/components/ListItem/index.d.ts +7 -0
  129. package/es/components/Loading/Loading.js +0 -6
  130. package/es/components/Menu/Menu.js +22 -40
  131. package/es/components/Menu/MenuContext.js +4 -5
  132. package/es/components/Menu/MenuItem.js +5 -39
  133. package/es/components/MenuButton/index.js +0 -9
  134. package/es/components/Modal/Modal.js +0 -43
  135. package/es/components/ModalWrapper/ModalWrapper.js +2 -15
  136. package/es/components/MultiSelect/FilterableMultiSelect.js +2 -60
  137. package/es/components/MultiSelect/MultiSelect.js +22 -70
  138. package/es/components/MultiSelect/MultiSelectPropTypes.js +0 -1
  139. package/es/components/MultiSelect/index.js +0 -1
  140. package/es/components/MultiSelect/tools/itemToString.js +0 -2
  141. package/es/components/MultiSelect/tools/sorting.js +3 -4
  142. package/es/components/Notification/Notification.js +0 -78
  143. package/es/components/NumberInput/NumberInput.Skeleton.js +0 -2
  144. package/es/components/NumberInput/NumberInput.js +3 -60
  145. package/es/components/OrderedList/OrderedList.d.ts +39 -0
  146. package/es/components/OrderedList/OrderedList.js +7 -19
  147. package/es/components/{Form/index.js → OrderedList/index.d.ts} +1 -3
  148. package/es/components/OverflowMenu/OverflowMenu.js +65 -86
  149. package/es/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
  150. package/es/components/OverflowMenuV2/index.js +0 -5
  151. package/es/components/Pagination/Pagination.Skeleton.js +0 -2
  152. package/es/components/Pagination/Pagination.js +11 -47
  153. package/es/components/Pagination/experimental/PageSelector.js +0 -10
  154. package/es/components/Pagination/experimental/Pagination.js +2 -48
  155. package/es/components/PaginationNav/PaginationNav.js +15 -59
  156. package/es/components/Popover/index.d.ts +14 -8
  157. package/es/components/Popover/index.js +44 -48
  158. package/es/components/PrimaryButton/PrimaryButton.js +0 -1
  159. package/es/components/ProgressBar/ProgressBar.js +0 -15
  160. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
  161. package/es/components/ProgressIndicator/ProgressIndicator.js +2 -40
  162. package/es/components/RadioButton/RadioButton.Skeleton.js +0 -1
  163. package/es/components/RadioButton/RadioButton.js +0 -13
  164. package/es/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
  165. package/es/components/RadioTile/RadioTile.js +0 -12
  166. package/es/components/Search/Search.Skeleton.js +0 -2
  167. package/es/components/Search/Search.js +1 -28
  168. package/es/components/SecondaryButton/SecondaryButton.js +0 -1
  169. package/es/components/Select/Select.Skeleton.js +0 -2
  170. package/es/components/Select/Select.d.ts +1 -1
  171. package/es/components/Select/Select.js +6 -33
  172. package/es/components/SelectItem/SelectItem.js +0 -5
  173. package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
  174. package/es/components/SelectItemGroup/SelectItemGroup.js +1 -7
  175. package/es/components/SkeletonIcon/SkeletonIcon.js +0 -2
  176. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
  177. package/es/components/SkeletonText/SkeletonText.js +0 -12
  178. package/es/components/Slider/Slider.Skeleton.js +0 -2
  179. package/es/components/Slider/Slider.d.ts +0 -1
  180. package/es/components/Slider/Slider.js +112 -135
  181. package/es/components/Stack/Stack.js +1 -8
  182. package/es/components/StructuredList/StructuredList.Skeleton.js +0 -5
  183. package/es/components/StructuredList/StructuredList.js +1 -25
  184. package/es/components/Switch/IconSwitch.js +0 -18
  185. package/es/components/Switch/Switch.js +0 -11
  186. package/es/components/TabContent/TabContent.js +2 -6
  187. package/es/components/Tabs/Tabs.Skeleton.js +0 -4
  188. package/es/components/Tabs/Tabs.js +135 -104
  189. package/es/components/Tabs/usePressable.js +18 -31
  190. package/es/components/Tag/Tag.Skeleton.js +0 -2
  191. package/es/components/Tag/Tag.js +0 -15
  192. package/es/components/Text/Text.js +5 -18
  193. package/es/components/Text/TextDirection.js +0 -3
  194. package/es/components/Text/TextDirectionContext.js +0 -1
  195. package/es/components/Text/createTextComponent.js +0 -3
  196. package/es/components/TextArea/TextArea.Skeleton.js +0 -2
  197. package/es/components/TextArea/TextArea.js +11 -33
  198. package/es/components/TextInput/ControlledPasswordInput.js +0 -20
  199. package/es/components/TextInput/PasswordInput.js +0 -25
  200. package/es/components/TextInput/TextInput.Skeleton.js +0 -2
  201. package/es/components/TextInput/TextInput.d.ts +1 -1
  202. package/es/components/TextInput/TextInput.js +5 -33
  203. package/es/components/TextInput/util.js +3 -5
  204. package/es/components/Theme/index.js +1 -6
  205. package/es/components/Tile/Tile.js +32 -59
  206. package/es/components/TileGroup/TileGroup.js +1 -22
  207. package/es/components/TimePicker/TimePicker.js +6 -32
  208. package/es/components/TimePickerSelect/TimePickerSelect.js +2 -5
  209. package/es/components/Toggle/Toggle.Skeleton.js +0 -8
  210. package/es/components/Toggle/Toggle.js +0 -16
  211. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
  212. package/es/components/Toggletip/index.d.ts +148 -0
  213. package/es/components/Toggletip/index.js +20 -44
  214. package/es/components/Tooltip/DefinitionTooltip.js +0 -11
  215. package/es/components/Tooltip/Tooltip.d.ts +1 -1
  216. package/es/components/Tooltip/Tooltip.js +4 -21
  217. package/es/components/TreeView/TreeNode.js +21 -66
  218. package/es/components/TreeView/TreeView.js +11 -67
  219. package/es/components/UIShell/Content.js +2 -4
  220. package/es/components/UIShell/Header.js +0 -2
  221. package/es/components/UIShell/HeaderContainer.d.ts +33 -0
  222. package/es/components/UIShell/HeaderContainer.js +13 -11
  223. package/es/components/UIShell/HeaderGlobalAction.js +0 -6
  224. package/es/components/UIShell/HeaderGlobalBar.js +0 -1
  225. package/es/components/UIShell/HeaderMenu.js +32 -31
  226. package/es/components/UIShell/HeaderMenuButton.js +2 -4
  227. package/es/components/UIShell/HeaderMenuItem.js +0 -8
  228. package/es/components/UIShell/HeaderName.js +0 -5
  229. package/es/components/UIShell/HeaderNavigation.js +0 -2
  230. package/es/components/UIShell/HeaderPanel.js +0 -2
  231. package/es/components/UIShell/HeaderSideNavItems.js +0 -2
  232. package/es/components/UIShell/Link.js +2 -3
  233. package/es/components/UIShell/SideNav.d.ts +3 -1
  234. package/es/components/UIShell/SideNav.js +44 -36
  235. package/es/components/UIShell/SideNavDetails.js +0 -3
  236. package/es/components/UIShell/SideNavDivider.js +0 -1
  237. package/es/components/UIShell/SideNavFooter.js +1 -4
  238. package/es/components/UIShell/SideNavHeader.js +0 -4
  239. package/es/components/UIShell/SideNavIcon.js +0 -3
  240. package/es/components/UIShell/SideNavItem.js +0 -3
  241. package/es/components/UIShell/SideNavItems.js +2 -6
  242. package/es/components/UIShell/SideNavLink.js +3 -7
  243. package/es/components/UIShell/SideNavLinkText.js +0 -2
  244. package/es/components/UIShell/SideNavMenu.js +0 -16
  245. package/es/components/UIShell/SideNavMenuItem.js +0 -2
  246. package/es/components/UIShell/SideNavSwitcher.js +2 -5
  247. package/es/components/UIShell/SkipToContent.d.ts +32 -0
  248. package/es/components/UIShell/SkipToContent.js +8 -15
  249. package/es/components/UIShell/Switcher.js +0 -2
  250. package/es/components/UIShell/SwitcherDivider.js +0 -1
  251. package/es/components/UIShell/SwitcherItem.js +0 -3
  252. package/es/components/UnorderedList/UnorderedList.d.ts +34 -0
  253. package/es/components/UnorderedList/UnorderedList.js +6 -16
  254. package/es/components/UnorderedList/index.d.ts +7 -0
  255. package/es/index.js +7 -8
  256. package/es/internal/ClickListener.js +3 -13
  257. package/es/internal/FloatingMenu.js +57 -63
  258. package/es/internal/OptimizedResize.js +6 -12
  259. package/es/internal/Selection.js +2 -25
  260. package/es/internal/createClassWrapper.js +0 -2
  261. package/es/internal/deprecateFieldOnObject.js +0 -4
  262. package/es/internal/focus/index.js +0 -1
  263. package/es/internal/keyboard/keys.js +2 -1
  264. package/es/internal/keyboard/match.js +1 -6
  265. package/es/internal/keyboard/navigation.js +8 -7
  266. package/es/internal/useAnnouncer.js +0 -1
  267. package/es/internal/useAttachedMenu.js +1 -9
  268. package/es/internal/useControllableState.js +6 -13
  269. package/es/internal/useDelayedState.js +2 -4
  270. package/es/internal/useEffectOnce.js +0 -1
  271. package/es/internal/useEvent.js +61 -3
  272. package/es/internal/useId.js +2 -5
  273. package/es/internal/useIsomorphicEffect.js +1 -0
  274. package/es/internal/useMergedRefs.js +2 -2
  275. package/es/internal/useNoInteractiveChildren.js +2 -13
  276. package/es/internal/useNormalizedInputProps.js +0 -3
  277. package/es/internal/useSavedCallback.js +1 -2
  278. package/es/internal/warning.js +0 -3
  279. package/es/internal/wrapFocus.js +1 -8
  280. package/es/prop-types/deprecate.js +2 -5
  281. package/es/prop-types/isRequiredOneOf.js +2 -5
  282. package/es/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
  283. package/es/tools/array.js +0 -3
  284. package/es/tools/events.js +0 -3
  285. package/es/tools/mergeRefs.js +0 -2
  286. package/es/tools/wrapComponent.js +2 -5
  287. package/lib/_virtual/_rollupPluginBabelHelpers.js +17 -4
  288. package/lib/components/Accordion/Accordion.Skeleton.js +0 -7
  289. package/lib/components/Accordion/Accordion.js +1 -27
  290. package/lib/components/Accordion/AccordionItem.js +5 -19
  291. package/lib/components/AspectRatio/AspectRatio.js +0 -5
  292. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +0 -3
  293. package/lib/components/Breadcrumb/Breadcrumb.js +0 -3
  294. package/lib/components/Breadcrumb/BreadcrumbItem.js +0 -7
  295. package/lib/components/Button/Button.Skeleton.js +2 -26
  296. package/lib/components/Button/Button.js +2 -36
  297. package/lib/components/ButtonSet/ButtonSet.js +0 -2
  298. package/lib/components/Checkbox/Checkbox.Skeleton.js +0 -1
  299. package/lib/components/Checkbox/Checkbox.js +4 -20
  300. package/lib/components/CheckboxGroup/CheckboxGroup.js +0 -11
  301. package/lib/components/ClassPrefix/index.d.ts +26 -0
  302. package/lib/components/ClassPrefix/index.js +0 -2
  303. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +0 -5
  304. package/lib/components/CodeSnippet/CodeSnippet.js +6 -45
  305. package/lib/components/ComboBox/ComboBox.js +19 -86
  306. package/lib/components/ComboBox/tools/filter.js +0 -1
  307. package/lib/components/ComboButton/index.js +0 -14
  308. package/lib/components/ComposedModal/ComposedModal.js +2 -32
  309. package/lib/components/ComposedModal/ModalFooter.js +0 -21
  310. package/lib/components/ComposedModal/ModalHeader.js +0 -12
  311. package/lib/components/ContainedList/ContainedList.js +5 -32
  312. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -6
  313. package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -23
  314. package/lib/components/ContextMenu/useContextMenu.js +1 -6
  315. package/lib/components/Copy/Copy.js +8 -50
  316. package/lib/components/CopyButton/CopyButton.js +0 -4
  317. package/lib/components/DangerButton/DangerButton.js +0 -1
  318. package/lib/components/DataTable/DataTable.js +171 -91
  319. package/lib/components/DataTable/Table.js +0 -6
  320. package/lib/components/DataTable/TableBatchAction.js +0 -4
  321. package/lib/components/DataTable/TableBatchActions.js +0 -8
  322. package/lib/components/DataTable/TableBody.js +0 -1
  323. package/lib/components/DataTable/TableContainer.js +0 -5
  324. package/lib/components/DataTable/TableExpandHeader.js +0 -7
  325. package/lib/components/DataTable/TableExpandRow.js +0 -6
  326. package/lib/components/DataTable/TableExpandedRow.js +0 -6
  327. package/lib/components/DataTable/TableHeader.d.ts +1 -1
  328. package/lib/components/DataTable/TableHeader.js +3 -19
  329. package/lib/components/DataTable/TableRow.js +4 -5
  330. package/lib/components/DataTable/TableSelectAll.js +0 -8
  331. package/lib/components/DataTable/TableSelectRow.js +2 -10
  332. package/lib/components/DataTable/TableToolbar.js +0 -3
  333. package/lib/components/DataTable/TableToolbarMenu.d.ts +1 -1
  334. package/lib/components/DataTable/TableToolbarMenu.js +3 -6
  335. package/lib/components/DataTable/TableToolbarSearch.js +2 -30
  336. package/lib/components/DataTable/state/getDerivedStateFromProps.js +0 -4
  337. package/lib/components/DataTable/state/sorting.js +5 -8
  338. package/lib/components/DataTable/tools/denormalize.js +2 -2
  339. package/lib/components/DataTable/tools/filter.js +0 -2
  340. package/lib/components/DataTable/tools/instanceId.js +0 -1
  341. package/lib/components/DataTable/tools/normalize.js +10 -10
  342. package/lib/components/DataTable/tools/sorting.js +5 -13
  343. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +5 -20
  344. package/lib/components/DatePicker/DatePicker.Skeleton.js +0 -6
  345. package/lib/components/DatePicker/DatePicker.js +154 -177
  346. package/lib/components/DatePicker/plugins/appendToPlugin.js +3 -7
  347. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +14 -25
  348. package/lib/components/DatePicker/plugins/rangePlugin.js +2 -7
  349. package/lib/components/DatePickerInput/DatePickerInput.js +2 -28
  350. package/lib/components/Dropdown/Dropdown.Skeleton.js +0 -2
  351. package/lib/components/Dropdown/Dropdown.js +50 -59
  352. package/lib/components/ErrorBoundary/ErrorBoundary.js +0 -10
  353. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -1
  354. package/lib/components/ExpandableSearch/ExpandableSearch.js +1 -10
  355. package/lib/components/FeatureFlags/index.js +8 -20
  356. package/lib/components/FileUploader/FileUploader.Skeleton.js +0 -2
  357. package/lib/components/FileUploader/FileUploader.js +3 -57
  358. package/lib/components/FileUploader/FileUploaderButton.js +3 -43
  359. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -28
  360. package/lib/components/FileUploader/FileUploaderItem.js +1 -30
  361. package/lib/components/FileUploader/Filename.js +0 -10
  362. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +0 -1
  363. package/lib/components/FluidComboBox/FluidComboBox.js +0 -18
  364. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +0 -2
  365. package/lib/components/FluidDatePicker/FluidDatePicker.js +0 -6
  366. package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +2 -1
  367. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +0 -1
  368. package/lib/components/FluidDropdown/FluidDropdown.js +0 -18
  369. package/lib/components/FluidForm/FluidForm.js +0 -2
  370. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +0 -1
  371. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +0 -19
  372. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +0 -1
  373. package/lib/components/FluidSelect/FluidSelect.js +0 -10
  374. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +0 -1
  375. package/lib/components/FluidTextArea/FluidTextArea.js +0 -20
  376. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +0 -1
  377. package/lib/components/FluidTextInput/FluidTextInput.js +0 -14
  378. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +0 -3
  379. package/lib/components/FluidTimePicker/FluidTimePicker.js +1 -11
  380. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +0 -6
  381. package/lib/components/Form/Form.d.ts +23 -0
  382. package/lib/components/Form/Form.js +3 -6
  383. package/lib/components/Form/index.d.ts +7 -0
  384. package/lib/components/FormGroup/FormGroup.js +0 -7
  385. package/lib/components/FormItem/FormItem.js +0 -2
  386. package/lib/components/FormLabel/FormLabel.js +1 -26
  387. package/lib/components/Grid/CSSGrid.js +2 -15
  388. package/lib/components/Grid/Column.js +18 -59
  389. package/lib/components/Grid/ColumnHang.js +2 -5
  390. package/lib/components/Grid/FlexGrid.js +2 -8
  391. package/lib/components/Grid/Grid.js +0 -8
  392. package/lib/components/Grid/GridContext.js +1 -3
  393. package/lib/components/Grid/Row.js +2 -7
  394. package/lib/components/Heading/index.js +0 -4
  395. package/lib/components/Icon/Icon.Skeleton.js +2 -2
  396. package/lib/components/IconButton/index.js +0 -10
  397. package/lib/components/IdPrefix/index.js +0 -2
  398. package/lib/components/InlineCheckbox/InlineCheckbox.js +0 -14
  399. package/lib/components/InlineLoading/InlineLoading.js +0 -12
  400. package/lib/components/Layer/index.js +3 -6
  401. package/lib/components/Layout/LayoutDirection.js +0 -3
  402. package/lib/components/Layout/useLayoutDirection.js +0 -1
  403. package/lib/components/Link/Link.js +3 -10
  404. package/lib/components/ListBox/ListBox.js +2 -13
  405. package/lib/components/ListBox/ListBoxField.js +0 -5
  406. package/lib/components/ListBox/ListBoxMenuIcon.js +0 -4
  407. package/lib/components/ListBox/ListBoxMenuItem.js +2 -6
  408. package/lib/components/ListBox/ListBoxPropTypes.d.ts +2 -2
  409. package/lib/components/ListBox/ListBoxSelection.js +1 -13
  410. package/lib/components/ListBox/next/ListBoxSelection.js +1 -14
  411. package/lib/components/ListBox/next/ListBoxTrigger.js +1 -3
  412. package/lib/components/ListItem/ListItem.d.ts +23 -0
  413. package/lib/components/ListItem/ListItem.js +4 -8
  414. package/lib/components/ListItem/index.d.ts +7 -0
  415. package/lib/components/Loading/Loading.js +0 -6
  416. package/lib/components/Menu/Menu.js +22 -40
  417. package/lib/components/Menu/MenuContext.js +4 -5
  418. package/lib/components/Menu/MenuItem.js +5 -39
  419. package/lib/components/MenuButton/index.js +0 -9
  420. package/lib/components/Modal/Modal.js +0 -43
  421. package/lib/components/ModalWrapper/ModalWrapper.js +2 -15
  422. package/lib/components/MultiSelect/FilterableMultiSelect.js +8 -66
  423. package/lib/components/MultiSelect/MultiSelect.js +30 -78
  424. package/lib/components/MultiSelect/MultiSelectPropTypes.js +0 -1
  425. package/lib/components/MultiSelect/index.js +0 -1
  426. package/lib/components/MultiSelect/tools/itemToString.js +0 -2
  427. package/lib/components/MultiSelect/tools/sorting.js +3 -4
  428. package/lib/components/Notification/Notification.js +0 -78
  429. package/lib/components/NumberInput/NumberInput.Skeleton.js +0 -2
  430. package/lib/components/NumberInput/NumberInput.js +3 -60
  431. package/lib/components/OrderedList/OrderedList.d.ts +39 -0
  432. package/lib/components/OrderedList/OrderedList.js +7 -19
  433. package/lib/components/OrderedList/index.d.ts +7 -0
  434. package/lib/components/OverflowMenu/OverflowMenu.js +65 -86
  435. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +6 -23
  436. package/lib/components/OverflowMenuV2/index.js +0 -5
  437. package/lib/components/Pagination/Pagination.Skeleton.js +0 -2
  438. package/lib/components/Pagination/Pagination.js +11 -47
  439. package/lib/components/Pagination/experimental/PageSelector.js +0 -10
  440. package/lib/components/Pagination/experimental/Pagination.js +2 -67
  441. package/lib/components/PaginationNav/PaginationNav.js +15 -78
  442. package/lib/components/Popover/index.d.ts +14 -8
  443. package/lib/components/Popover/index.js +44 -48
  444. package/lib/components/PrimaryButton/PrimaryButton.js +0 -1
  445. package/lib/components/ProgressBar/ProgressBar.js +0 -15
  446. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +0 -4
  447. package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -40
  448. package/lib/components/RadioButton/RadioButton.Skeleton.js +0 -1
  449. package/lib/components/RadioButton/RadioButton.js +0 -13
  450. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +3 -23
  451. package/lib/components/RadioTile/RadioTile.js +0 -12
  452. package/lib/components/Search/Search.Skeleton.js +0 -2
  453. package/lib/components/Search/Search.js +1 -28
  454. package/lib/components/SecondaryButton/SecondaryButton.js +0 -1
  455. package/lib/components/Select/Select.Skeleton.js +0 -2
  456. package/lib/components/Select/Select.d.ts +1 -1
  457. package/lib/components/Select/Select.js +6 -33
  458. package/lib/components/SelectItem/SelectItem.js +0 -5
  459. package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -1
  460. package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -26
  461. package/lib/components/SkeletonIcon/SkeletonIcon.js +0 -2
  462. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +0 -1
  463. package/lib/components/SkeletonText/SkeletonText.js +0 -12
  464. package/lib/components/Slider/Slider.Skeleton.js +0 -2
  465. package/lib/components/Slider/Slider.d.ts +0 -1
  466. package/lib/components/Slider/Slider.js +112 -154
  467. package/lib/components/Stack/Stack.js +1 -8
  468. package/lib/components/StructuredList/StructuredList.Skeleton.js +0 -5
  469. package/lib/components/StructuredList/StructuredList.js +1 -25
  470. package/lib/components/Switch/IconSwitch.js +0 -18
  471. package/lib/components/Switch/Switch.js +0 -11
  472. package/lib/components/TabContent/TabContent.js +2 -6
  473. package/lib/components/Tabs/Tabs.Skeleton.js +0 -4
  474. package/lib/components/Tabs/Tabs.js +133 -102
  475. package/lib/components/Tabs/usePressable.js +18 -31
  476. package/lib/components/Tag/Tag.Skeleton.js +0 -2
  477. package/lib/components/Tag/Tag.js +0 -15
  478. package/lib/components/Text/Text.js +5 -18
  479. package/lib/components/Text/TextDirection.js +0 -3
  480. package/lib/components/Text/TextDirectionContext.js +0 -1
  481. package/lib/components/Text/createTextComponent.js +0 -3
  482. package/lib/components/TextArea/TextArea.Skeleton.js +0 -2
  483. package/lib/components/TextArea/TextArea.js +10 -32
  484. package/lib/components/TextInput/ControlledPasswordInput.js +0 -20
  485. package/lib/components/TextInput/PasswordInput.js +0 -25
  486. package/lib/components/TextInput/TextInput.Skeleton.js +0 -2
  487. package/lib/components/TextInput/TextInput.d.ts +1 -1
  488. package/lib/components/TextInput/TextInput.js +5 -52
  489. package/lib/components/TextInput/util.js +3 -5
  490. package/lib/components/Theme/index.js +1 -6
  491. package/lib/components/Tile/Tile.js +31 -58
  492. package/lib/components/TileGroup/TileGroup.js +1 -22
  493. package/lib/components/TimePicker/TimePicker.js +6 -32
  494. package/lib/components/TimePickerSelect/TimePickerSelect.js +2 -5
  495. package/lib/components/Toggle/Toggle.Skeleton.js +0 -8
  496. package/lib/components/Toggle/Toggle.js +0 -16
  497. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +0 -7
  498. package/lib/components/Toggletip/index.d.ts +148 -0
  499. package/lib/components/Toggletip/index.js +20 -44
  500. package/lib/components/Tooltip/DefinitionTooltip.js +0 -11
  501. package/lib/components/Tooltip/Tooltip.d.ts +1 -1
  502. package/lib/components/Tooltip/Tooltip.js +4 -21
  503. package/lib/components/TreeView/TreeNode.js +21 -66
  504. package/lib/components/TreeView/TreeView.js +11 -67
  505. package/lib/components/UIShell/Content.js +2 -4
  506. package/lib/components/UIShell/Header.js +0 -2
  507. package/lib/components/UIShell/HeaderContainer.d.ts +33 -0
  508. package/lib/components/UIShell/HeaderContainer.js +13 -11
  509. package/lib/components/UIShell/HeaderGlobalAction.js +0 -6
  510. package/lib/components/UIShell/HeaderGlobalBar.js +0 -1
  511. package/lib/components/UIShell/HeaderMenu.js +32 -31
  512. package/lib/components/UIShell/HeaderMenuButton.js +2 -4
  513. package/lib/components/UIShell/HeaderMenuItem.js +0 -8
  514. package/lib/components/UIShell/HeaderName.js +0 -5
  515. package/lib/components/UIShell/HeaderNavigation.js +0 -2
  516. package/lib/components/UIShell/HeaderPanel.js +0 -2
  517. package/lib/components/UIShell/HeaderSideNavItems.js +0 -2
  518. package/lib/components/UIShell/Link.js +2 -3
  519. package/lib/components/UIShell/SideNav.d.ts +3 -1
  520. package/lib/components/UIShell/SideNav.js +43 -35
  521. package/lib/components/UIShell/SideNavDetails.js +0 -3
  522. package/lib/components/UIShell/SideNavDivider.js +0 -1
  523. package/lib/components/UIShell/SideNavFooter.js +1 -4
  524. package/lib/components/UIShell/SideNavHeader.js +0 -4
  525. package/lib/components/UIShell/SideNavIcon.js +0 -3
  526. package/lib/components/UIShell/SideNavItem.js +0 -3
  527. package/lib/components/UIShell/SideNavItems.js +2 -6
  528. package/lib/components/UIShell/SideNavLink.js +3 -7
  529. package/lib/components/UIShell/SideNavLinkText.js +0 -2
  530. package/lib/components/UIShell/SideNavMenu.js +0 -16
  531. package/lib/components/UIShell/SideNavMenuItem.js +0 -2
  532. package/lib/components/UIShell/SideNavSwitcher.js +2 -5
  533. package/lib/components/UIShell/SkipToContent.d.ts +32 -0
  534. package/lib/components/UIShell/SkipToContent.js +8 -15
  535. package/lib/components/UIShell/Switcher.js +0 -2
  536. package/lib/components/UIShell/SwitcherDivider.js +0 -1
  537. package/lib/components/UIShell/SwitcherItem.js +0 -3
  538. package/lib/components/UnorderedList/UnorderedList.d.ts +34 -0
  539. package/lib/components/UnorderedList/UnorderedList.js +6 -16
  540. package/lib/components/UnorderedList/index.d.ts +7 -0
  541. package/lib/index.js +42 -43
  542. package/lib/internal/ClickListener.js +3 -13
  543. package/lib/internal/FloatingMenu.js +57 -63
  544. package/lib/internal/OptimizedResize.js +6 -12
  545. package/lib/internal/Selection.js +2 -25
  546. package/lib/internal/createClassWrapper.js +0 -2
  547. package/lib/internal/deprecateFieldOnObject.js +0 -4
  548. package/lib/internal/focus/index.js +0 -1
  549. package/lib/internal/keyboard/keys.js +2 -1
  550. package/lib/internal/keyboard/match.js +1 -6
  551. package/lib/internal/keyboard/navigation.js +8 -7
  552. package/lib/internal/useAnnouncer.js +0 -1
  553. package/lib/internal/useAttachedMenu.js +1 -9
  554. package/lib/internal/useControllableState.js +6 -13
  555. package/lib/internal/useDelayedState.js +2 -4
  556. package/lib/internal/useEffectOnce.js +0 -1
  557. package/lib/internal/useEvent.js +61 -2
  558. package/lib/internal/useId.js +2 -5
  559. package/lib/internal/useIsomorphicEffect.js +1 -0
  560. package/lib/internal/useMergedRefs.js +2 -2
  561. package/lib/internal/useNoInteractiveChildren.js +2 -13
  562. package/lib/internal/useNormalizedInputProps.js +0 -3
  563. package/lib/internal/useSavedCallback.js +1 -2
  564. package/lib/internal/warning.js +0 -3
  565. package/lib/internal/wrapFocus.js +1 -8
  566. package/lib/prop-types/deprecate.js +2 -5
  567. package/lib/prop-types/isRequiredOneOf.js +2 -5
  568. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +0 -2
  569. package/lib/tools/array.js +0 -3
  570. package/lib/tools/events.js +0 -3
  571. package/lib/tools/mergeRefs.js +0 -2
  572. package/lib/tools/wrapComponent.js +2 -5
  573. package/package.json +9 -9
  574. package/es/components/Tab/Tab.js +0 -185
  575. package/es/components/Tab/index.js +0 -14
  576. package/es/components/TimePickerSelect/index.js +0 -13
  577. package/lib/components/Form/index.js +0 -17
  578. package/lib/components/Tab/Tab.js +0 -214
  579. package/lib/components/Tab/index.js +0 -39
  580. package/lib/components/TimePickerSelect/index.js +0 -38
@@ -48,23 +48,19 @@ ModalBody.propTypes = {
48
48
  * Required props for the accessibility label of the header
49
49
  */
50
50
  ['aria-label']: requiredIfGivenPropIsTruthy('hasScrollingContent', PropTypes.string),
51
-
52
51
  /**
53
52
  * Specify the content to be placed in the ModalBody
54
53
  */
55
54
  children: PropTypes.node,
56
-
57
55
  /**
58
56
  * Specify an optional className to be added to the Modal Body node
59
57
  */
60
58
  className: PropTypes.string,
61
-
62
59
  /**
63
60
  * Provide whether the modal content has a form element.
64
61
  * If `true` is used here, non-form child content should have `bx--modal-content__regular-content` class.
65
62
  */
66
63
  hasForm: PropTypes.bool,
67
-
68
64
  /**
69
65
  * Specify whether the modal contains scrolling content
70
66
  */
@@ -95,37 +91,30 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
95
91
  const button = useRef();
96
92
  const startSentinel = useRef();
97
93
  const endSentinel = useRef();
98
-
99
94
  if (open !== prevOpen) {
100
95
  setisOpen(open);
101
96
  setPrevOpen(open);
102
97
  }
103
-
104
98
  function handleKeyDown(evt) {
105
99
  // Esc key
106
100
  if (evt.which === 27) {
107
101
  closeModal(evt);
108
102
  }
109
-
110
103
  onKeyDown(evt);
111
104
  }
112
-
113
105
  function handleMousedown(evt) {
114
106
  if (!innerModal.current.contains(evt.target) && preventCloseOnClickOutside) {
115
107
  return;
116
108
  }
117
-
118
109
  if (innerModal.current && !innerModal.current.contains(evt.target)) {
119
110
  closeModal(evt);
120
111
  }
121
112
  }
122
-
123
113
  function handleBlur(_ref3) {
124
114
  let {
125
115
  target: oldActiveNode,
126
116
  relatedTarget: currentActiveNode
127
117
  } = _ref3;
128
-
129
118
  if (open && currentActiveNode && oldActiveNode) {
130
119
  const {
131
120
  current: bodyNode
@@ -146,13 +135,11 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
146
135
  });
147
136
  }
148
137
  }
149
-
150
138
  function closeModal(evt) {
151
139
  if (!onClose || onClose(evt) !== false) {
152
140
  setisOpen(false);
153
141
  }
154
142
  }
155
-
156
143
  const modalClass = cx({
157
144
  [`${prefix}--modal`]: true,
158
145
  'is-visible': isOpen,
@@ -164,8 +151,9 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
164
151
  [`${prefix}--modal-container--${size}`]: size,
165
152
  [`${prefix}--modal-container--full-width`]: isFullWidth,
166
153
  [containerClassName]: containerClassName
167
- }); // Generate aria-label based on Modal Header label if one is not provided (L253)
154
+ });
168
155
 
156
+ // Generate aria-label based on Modal Header label if one is not provided (L253)
169
157
  let generatedAriaLabel;
170
158
  const childrenWithProps = React__default.Children.toArray(children).map(child => {
171
159
  switch (child.type) {
@@ -174,13 +162,11 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
174
162
  return /*#__PURE__*/React__default.cloneElement(child, {
175
163
  closeModal: closeModal
176
164
  });
177
-
178
165
  case React__default.createElement(ModalFooter).type:
179
166
  return /*#__PURE__*/React__default.cloneElement(child, {
180
167
  closeModal: closeModal,
181
168
  inputref: button
182
169
  });
183
-
184
170
  default:
185
171
  return child;
186
172
  }
@@ -201,22 +187,18 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
201
187
  const focusButton = focusContainerElement => {
202
188
  if (focusContainerElement) {
203
189
  const primaryFocusElement = focusContainerElement.querySelector(selectorPrimaryFocus);
204
-
205
190
  if (primaryFocusElement) {
206
191
  primaryFocusElement.focus();
207
192
  return;
208
193
  }
209
-
210
194
  if (button.current) {
211
195
  button.current.focus();
212
196
  }
213
197
  }
214
198
  };
215
-
216
199
  if (!open) {
217
200
  return;
218
201
  }
219
-
220
202
  if (innerModal.current) {
221
203
  focusButton(innerModal.current);
222
204
  }
@@ -253,67 +235,55 @@ ComposedModal.propTypes = {
253
235
  * Specify the aria-label for bx--modal-container
254
236
  */
255
237
  ['aria-label']: PropTypes.string,
256
-
257
238
  /**
258
239
  * Specify the aria-labelledby for bx--modal-container
259
240
  */
260
241
  ['aria-labelledby']: PropTypes.string,
261
-
262
242
  /**
263
243
  * Specify the content to be placed in the ComposedModal
264
244
  */
265
245
  children: PropTypes.node,
266
-
267
246
  /**
268
247
  * Specify an optional className to be applied to the modal root node
269
248
  */
270
249
  className: PropTypes.string,
271
-
272
250
  /**
273
251
  * Specify an optional className to be applied to the modal node
274
252
  */
275
253
  containerClassName: PropTypes.string,
276
-
277
254
  /**
278
255
  * Specify whether the primary button should be replaced with danger button.
279
256
  * Note that this prop is not applied if you render primary/danger button by yourself
280
257
  */
281
258
  danger: PropTypes.bool,
282
-
283
259
  /**
284
260
  * Specify whether or not the Modal content should have any inner padding.
285
261
  */
286
262
  isFullWidth: PropTypes.bool,
287
-
288
263
  /**
289
264
  * Specify an optional handler for closing modal.
290
265
  * Returning `false` here prevents closing modal.
291
266
  */
292
267
  onClose: PropTypes.func,
293
-
294
268
  /**
295
269
  * Specify an optional handler for the `onKeyDown` event. Called for all
296
270
  * `onKeyDown` events that do not close the modal
297
271
  */
298
272
  onKeyDown: PropTypes.func,
299
-
300
273
  /**
301
274
  * Specify whether the Modal is currently open
302
275
  */
303
276
  open: PropTypes.bool,
304
277
  preventCloseOnClickOutside: PropTypes.bool,
305
-
306
278
  /**
307
279
  * Specify a CSS selector that matches the DOM element that should be
308
280
  * focused when the Modal opens
309
281
  */
310
282
  selectorPrimaryFocus: PropTypes.string,
311
-
312
283
  /**
313
284
  * Specify the CSS selectors that match the floating menus
314
285
  */
315
286
  selectorsFloatingMenus: PropTypes.arrayOf(PropTypes.string),
316
-
317
287
  /**
318
288
  * Specify the size variant.
319
289
  */
@@ -21,12 +21,10 @@ function SecondaryButtonSet(_ref) {
21
21
  closeModal,
22
22
  onRequestClose
23
23
  } = _ref;
24
-
25
24
  function handleRequestClose(evt) {
26
25
  closeModal(evt);
27
26
  onRequestClose(evt);
28
27
  }
29
-
30
28
  if (Array.isArray(secondaryButtons) && secondaryButtons.length <= 2) {
31
29
  return secondaryButtons.map((_ref2, i) => {
32
30
  let {
@@ -41,7 +39,6 @@ function SecondaryButtonSet(_ref) {
41
39
  }, buttonText);
42
40
  });
43
41
  }
44
-
45
42
  if (secondaryButtonText) {
46
43
  return /*#__PURE__*/React__default.createElement(Button, {
47
44
  className: secondaryClassName,
@@ -49,10 +46,8 @@ function SecondaryButtonSet(_ref) {
49
46
  kind: "secondary"
50
47
  }, secondaryButtonText);
51
48
  }
52
-
53
49
  return null;
54
50
  }
55
-
56
51
  SecondaryButtonSet.propTypes = {
57
52
  closeModal: PropTypes.func,
58
53
  onRequestClose: PropTypes.func,
@@ -62,7 +57,6 @@ SecondaryButtonSet.propTypes = {
62
57
  if (!Array.isArray(props.secondaryButtons) || props.secondaryButtons.length !== 2) {
63
58
  return new Error(`${propName} needs to be an array of two button config objects`);
64
59
  }
65
-
66
60
  const shape = {
67
61
  buttonText: PropTypes.node,
68
62
  onClick: PropTypes.func
@@ -71,7 +65,6 @@ SecondaryButtonSet.propTypes = {
71
65
  PropTypes.checkPropTypes(shape, secondaryButton, propName, componentName);
72
66
  });
73
67
  }
74
-
75
68
  return null;
76
69
  },
77
70
  secondaryClassName: PropTypes.string
@@ -123,62 +116,51 @@ ModalFooter.propTypes = {
123
116
  * Pass in content that will be rendered in the Modal Footer
124
117
  */
125
118
  children: PropTypes.node,
126
-
127
119
  /**
128
120
  * Specify a custom className to be applied to the Modal Footer container
129
121
  */
130
122
  className: PropTypes.string,
131
-
132
123
  /**
133
124
  * Specify an optional function that is called whenever the modal is closed
134
125
  */
135
126
  closeModal: PropTypes.func,
136
-
137
127
  /**
138
128
  * Specify whether the primary button should be replaced with danger button.
139
129
  * Note that this prop is not applied if you render primary/danger button by yourself
140
130
  */
141
131
  danger: PropTypes.bool,
142
-
143
132
  /**
144
133
  * The `ref` callback for the primary button.
145
134
  */
146
135
  inputref: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
147
136
  current: PropTypes.any
148
137
  })]),
149
-
150
138
  /**
151
139
  * Specify an optional function for when the modal is requesting to be
152
140
  * closed
153
141
  */
154
142
  onRequestClose: PropTypes.func,
155
-
156
143
  /**
157
144
  * Specify an optional function for when the modal is requesting to be
158
145
  * submitted
159
146
  */
160
147
  onRequestSubmit: PropTypes.func,
161
-
162
148
  /**
163
149
  * Specify whether the primary button should be disabled
164
150
  */
165
151
  primaryButtonDisabled: PropTypes.bool,
166
-
167
152
  /**
168
153
  * Specify the text for the primary button
169
154
  */
170
155
  primaryButtonText: PropTypes.string,
171
-
172
156
  /**
173
157
  * Specify a custom className to be applied to the primary button
174
158
  */
175
159
  primaryClassName: PropTypes.string,
176
-
177
160
  /**
178
161
  * Specify the text for the secondary button
179
162
  */
180
163
  secondaryButtonText: PropTypes.string,
181
-
182
164
  /**
183
165
  * Specify an array of config objects for secondary buttons
184
166
  * (`Array<{
@@ -191,7 +173,6 @@ ModalFooter.propTypes = {
191
173
  if (!Array.isArray(props.secondaryButtons) || props.secondaryButtons.length !== 2) {
192
174
  return new Error(`${propName} needs to be an array of two button config objects`);
193
175
  }
194
-
195
176
  const shape = {
196
177
  buttonText: PropTypes.node,
197
178
  onClick: PropTypes.func
@@ -200,10 +181,8 @@ ModalFooter.propTypes = {
200
181
  PropTypes.checkPropTypes(shape, secondaryButton, propName, componentName);
201
182
  });
202
183
  }
203
-
204
184
  return null;
205
185
  },
206
-
207
186
  /**
208
187
  * Specify a custom className to be applied to the secondary button
209
188
  */
@@ -28,12 +28,10 @@ const ModalHeader = /*#__PURE__*/React__default.forwardRef(function ModalHeader(
28
28
  ...rest
29
29
  } = _ref;
30
30
  const prefix = usePrefix();
31
-
32
31
  function handleCloseButtonClick(evt) {
33
32
  closeModal(evt);
34
33
  buttonOnClick();
35
34
  }
36
-
37
35
  const headerClass = cx({
38
36
  [`${prefix}--modal-header`]: true,
39
37
  [customClassName]: customClassName
@@ -79,53 +77,43 @@ ModalHeader.propTypes = {
79
77
  * clicked
80
78
  */
81
79
  buttonOnClick: PropTypes.func,
82
-
83
80
  /**
84
81
  * Specify the content to be placed in the ModalHeader
85
82
  */
86
83
  children: PropTypes.node,
87
-
88
84
  /**
89
85
  * Specify an optional className to be applied to the modal header
90
86
  */
91
87
  className: PropTypes.string,
92
-
93
88
  /**
94
89
  * Specify an optional className to be applied to the modal close node
95
90
  */
96
91
  closeClassName: PropTypes.string,
97
-
98
92
  /**
99
93
  * Specify an optional className to be applied to the modal close icon node
100
94
  */
101
95
  closeIconClassName: PropTypes.string,
102
-
103
96
  /**
104
97
  * Provide an optional function to be called when the modal is closed
105
98
  */
106
99
  closeModal: PropTypes.func,
107
-
108
100
  /**
109
101
  * Specify a description for the close icon that can be read by screen
110
102
  * readers
111
103
  */
112
104
  iconDescription: PropTypes.string,
113
-
114
105
  /**
115
106
  * Specify an optional label to be displayed
116
107
  */
117
108
  label: PropTypes.node,
118
-
119
109
  /**
120
110
  * Specify an optional className to be applied to the modal header label
121
111
  */
122
112
  labelClassName: PropTypes.string,
123
-
124
113
  /**
125
114
  * Specify an optional title to be displayed
126
115
  */
127
116
  title: PropTypes.node,
128
-
129
117
  /**
130
118
  * Specify an optional className to be applied to the modal heading
131
119
  */
@@ -12,50 +12,30 @@ import { useId } from '../../internal/useId.js';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
13
 
14
14
  const variants = ['on-page', 'disclosed'];
15
-
16
15
  function filterChildren(children) {
17
- var _children$type;
18
-
19
16
  if (Array.isArray(children)) {
20
- return children === null || children === void 0 ? void 0 : children.filter(child => {
21
- var _child$type;
22
-
23
- return !['Search', 'ExpandableSearch'].includes(child === null || child === void 0 ? void 0 : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.displayName);
24
- });
17
+ return children?.filter(child => !['Search', 'ExpandableSearch'].includes(child?.type?.displayName));
25
18
  }
26
-
27
- if (children && !['Search', 'ExpandableSearch'].includes(children === null || children === void 0 ? void 0 : (_children$type = children.type) === null || _children$type === void 0 ? void 0 : _children$type.displayName)) {
19
+ if (children && !['Search', 'ExpandableSearch'].includes(children?.type?.displayName)) {
28
20
  return children;
29
21
  }
30
-
31
22
  return null;
32
23
  }
33
-
34
24
  function renderChildren(children) {
35
- var _children$type2;
36
-
37
25
  if (Array.isArray(children)) {
38
26
  children.map((child, index) => {
39
- var _child$type2;
40
-
41
- if (index === 0 && ((_child$type2 = child.type) === null || _child$type2 === void 0 ? void 0 : _child$type2.displayName) === 'Search') {
27
+ if (index === 0 && child.type?.displayName === 'Search') {
42
28
  return child;
43
29
  }
44
-
45
30
  return child;
46
31
  });
47
32
  }
48
-
49
- if (children && ((_children$type2 = children.type) === null || _children$type2 === void 0 ? void 0 : _children$type2.displayName) === 'Search') {
33
+ if (children && children.type?.displayName === 'Search') {
50
34
  return children;
51
35
  }
52
-
53
36
  return children;
54
37
  }
55
-
56
38
  function ContainedList(_ref) {
57
- var _action$type;
58
-
59
39
  let {
60
40
  action,
61
41
  children,
@@ -71,7 +51,7 @@ function ContainedList(_ref) {
71
51
  [`${prefix}--contained-list--inset-rulers`]: isInset
72
52
  }, `${prefix}--contained-list--${kind}`, `${prefix}--contained-list--${size}`, className);
73
53
  const filteredChildren = filterChildren(children);
74
- const isActionSearch = ['Search', 'ExpandableSearch'].includes(action === null || action === void 0 ? void 0 : (_action$type = action.type) === null || _action$type === void 0 ? void 0 : _action$type.displayName);
54
+ const isActionSearch = ['Search', 'ExpandableSearch'].includes(action?.type?.displayName);
75
55
  const renderedChildren = renderChildren(children);
76
56
  return /*#__PURE__*/React__default.createElement("div", {
77
57
  className: classes
@@ -86,38 +66,31 @@ function ContainedList(_ref) {
86
66
  "aria-labelledby": labelId
87
67
  }, isActionSearch ? filteredChildren : renderedChildren));
88
68
  }
89
-
90
69
  ContainedList.propTypes = {
91
70
  /**
92
71
  * A slot for a possible interactive element to render.
93
72
  */
94
73
  action: PropTypes.node,
95
-
96
74
  /**
97
75
  * A collection of ContainedListItems to be rendered in the ContainedList
98
76
  */
99
77
  children: PropTypes.node,
100
-
101
78
  /**
102
79
  * Additional CSS class names.
103
80
  */
104
81
  className: PropTypes.string,
105
-
106
82
  /**
107
83
  * Specify whether the dividing lines in between list items should be inset.
108
84
  */
109
85
  isInset: PropTypes.bool,
110
-
111
86
  /**
112
87
  * The kind of ContainedList you want to display
113
88
  */
114
89
  kind: PropTypes.oneOf(variants),
115
-
116
90
  /**
117
91
  * A label describing the contained list.
118
92
  */
119
93
  label: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
120
-
121
94
  /**
122
95
  * Specify the size of the contained list.
123
96
  */
@@ -42,33 +42,27 @@ function ContainedListItem(_ref) {
42
42
  className: `${prefix}--contained-list-item__action`
43
43
  }, action));
44
44
  }
45
-
46
45
  ContainedListItem.propTypes = {
47
46
  /**
48
47
  * A slot for a possible interactive element to render within the item.
49
48
  */
50
49
  action: PropTypes.node,
51
-
52
50
  /**
53
51
  * The content of this item. Must not contain any interactive elements. Use props.action to include those.
54
52
  */
55
53
  children: PropTypes.node,
56
-
57
54
  /**
58
55
  * Additional CSS class names.
59
56
  */
60
57
  className: PropTypes.string,
61
-
62
58
  /**
63
59
  * Whether this item is disabled.
64
60
  */
65
61
  disabled: PropTypes.bool,
66
-
67
62
  /**
68
63
  * Provide an optional function to be called when the item is clicked.
69
64
  */
70
65
  onClick: PropTypes.func,
71
-
72
66
  /**
73
67
  * Provide an optional icon to render in front of the item's content.
74
68
  */
@@ -19,35 +19,29 @@ import { ArrowRight, ArrowLeft } from '../../internal/keyboard/keys.js';
19
19
  class ContentSwitcher extends React__default.Component {
20
20
  constructor() {
21
21
  super(...arguments);
22
-
23
22
  _defineProperty(this, "_switchRefs", []);
24
-
25
23
  _defineProperty(this, "state", {});
26
-
27
24
  _defineProperty(this, "handleItemRef", index => ref => {
28
25
  this._switchRefs[index] = ref;
29
26
  });
30
-
31
27
  _defineProperty(this, "handleChildChange", data => {
32
28
  const {
33
29
  selectionMode
34
- } = this.props; // the currently selected child index
35
-
30
+ } = this.props;
31
+ // the currently selected child index
36
32
  const {
37
33
  selectedIndex
38
- } = this.state; // the newly selected child index
39
-
34
+ } = this.state;
35
+ // the newly selected child index
40
36
  const {
41
37
  index
42
38
  } = data;
43
39
  const {
44
40
  key
45
41
  } = data;
46
-
47
42
  if (matches(data, [ArrowRight, ArrowLeft])) {
48
43
  const nextIndex = getNextIndex(key, index, this.props.children.length);
49
44
  const children = React__default.Children.toArray(this.props.children);
50
-
51
45
  if (selectionMode === 'manual') {
52
46
  const switchRef = this._switchRefs[nextIndex];
53
47
  switchRef && switchRef.focus();
@@ -58,7 +52,8 @@ class ContentSwitcher extends React__default.Component {
58
52
  const child = children[this.state.selectedIndex];
59
53
  const switchRef = this._switchRefs[this.state.selectedIndex];
60
54
  switchRef && switchRef.focus();
61
- this.props.onChange({ ...data,
55
+ this.props.onChange({
56
+ ...data,
62
57
  index: this.state.selectedIndex,
63
58
  name: child.props.name,
64
59
  text: child.props.text
@@ -76,7 +71,11 @@ class ContentSwitcher extends React__default.Component {
76
71
  }
77
72
  });
78
73
  }
79
-
74
+ /**
75
+ * The DOM references of child `<Switch>`.
76
+ * @type {Array<Element>}
77
+ * @private
78
+ */
80
79
  static getDerivedStateFromProps(_ref, state) {
81
80
  let {
82
81
  selectedIndex
@@ -89,7 +88,6 @@ class ContentSwitcher extends React__default.Component {
89
88
  prevSelectedIndex: selectedIndex
90
89
  };
91
90
  }
92
-
93
91
  render() {
94
92
  const prefix = this.context;
95
93
  const {
@@ -123,49 +121,39 @@ class ContentSwitcher extends React__default.Component {
123
121
  size
124
122
  })));
125
123
  }
126
-
127
124
  }
128
-
129
125
  _defineProperty(ContentSwitcher, "propTypes", {
130
126
  /**
131
127
  * Pass in Switch components to be rendered in the ContentSwitcher
132
128
  */
133
129
  children: PropTypes.node,
134
-
135
130
  /**
136
131
  * Specify an optional className to be added to the container node
137
132
  */
138
133
  className: PropTypes.string,
139
-
140
134
  /**
141
135
  * `true` to use the light variant.
142
136
  */
143
137
  light: deprecate(PropTypes.bool, 'The `light` prop for `ContentSwitcher` is no longer needed and has ' + 'been deprecated. It will be removed in the next major release.'),
144
-
145
138
  /**
146
139
  * Specify an `onChange` handler that is called whenever the ContentSwitcher
147
140
  * changes which item is selected
148
141
  */
149
142
  onChange: PropTypes.func.isRequired,
150
-
151
143
  /**
152
144
  * Specify a selected index for the initially selected content
153
145
  */
154
146
  selectedIndex: PropTypes.number,
155
-
156
147
  /**
157
148
  * Choose whether or not to automatically change selection on focus
158
149
  */
159
150
  selectionMode: PropTypes.oneOf(['automatic', 'manual']),
160
-
161
151
  /**
162
152
  * Specify the size of the Content Switcher. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
163
153
  */
164
154
  size: PropTypes.oneOf(['sm', 'md', 'lg'])
165
155
  });
166
-
167
156
  _defineProperty(ContentSwitcher, "contextType", PrefixContext);
168
-
169
157
  _defineProperty(ContentSwitcher, "defaultProps", {
170
158
  selectedIndex: 0,
171
159
  selectionMode: 'automatic',
@@ -11,12 +11,10 @@ import { useState, useEffect } from 'react';
11
11
  * @param {Element|Document|Window|object} [trigger=document] The element or ref which should trigger the Menu on right-click
12
12
  * @returns {object} Props object to pass onto Menu component
13
13
  */
14
-
15
14
  function useContextMenu() {
16
15
  let trigger = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
17
16
  const [open, setOpen] = useState(false);
18
17
  const [position, setPosition] = useState([0, 0]);
19
-
20
18
  function openContextMenu(e) {
21
19
  e.preventDefault();
22
20
  const {
@@ -26,14 +24,11 @@ function useContextMenu() {
26
24
  setPosition([x, y]);
27
25
  setOpen(true);
28
26
  }
29
-
30
27
  function onClose() {
31
28
  setOpen(false);
32
29
  }
33
-
34
30
  useEffect(() => {
35
- const el = (trigger === null || trigger === void 0 ? void 0 : trigger.current) ?? trigger;
36
-
31
+ const el = trigger?.current ?? trigger;
37
32
  if (el && el instanceof Element || el instanceof Document || el instanceof Window) {
38
33
  el.addEventListener('contextmenu', openContextMenu);
39
34
  return () => {