@carbon/react 1.103.0 → 1.104.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 (769) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +956 -956
  2. package/es/_virtual/_rolldown/runtime.js +25 -0
  3. package/es/components/AILabel/index.d.ts +29 -2
  4. package/es/components/AILabel/index.js +114 -169
  5. package/es/components/AISkeleton/AISkeletonIcon.js +23 -27
  6. package/es/components/AISkeleton/AISkeletonPlaceholder.js +19 -27
  7. package/es/components/AISkeleton/AISkeletonText.js +26 -39
  8. package/es/components/Accordion/Accordion.Skeleton.js +55 -79
  9. package/es/components/Accordion/Accordion.js +43 -61
  10. package/es/components/Accordion/AccordionItem.js +102 -156
  11. package/es/components/Accordion/AccordionProvider.js +18 -15
  12. package/es/components/AspectRatio/AspectRatio.js +41 -47
  13. package/es/components/BadgeIndicator/index.js +28 -33
  14. package/es/components/Breadcrumb/Breadcrumb.Skeleton.js +39 -50
  15. package/es/components/Breadcrumb/Breadcrumb.js +39 -51
  16. package/es/components/Breadcrumb/BreadcrumbItem.js +80 -83
  17. package/es/components/Button/Button.Skeleton.js +49 -58
  18. package/es/components/Button/Button.d.ts +1 -1
  19. package/es/components/Button/Button.js +146 -240
  20. package/es/components/Button/ButtonBase.js +82 -104
  21. package/es/components/Button/index.js +13 -6
  22. package/es/components/ButtonSet/ButtonSet.js +74 -98
  23. package/es/components/ButtonSet/index.js +12 -4
  24. package/es/components/ChatButton/ChatButton.Skeleton.js +27 -27
  25. package/es/components/ChatButton/ChatButton.js +64 -79
  26. package/es/components/Checkbox/Checkbox.Skeleton.js +26 -25
  27. package/es/components/Checkbox/Checkbox.js +116 -195
  28. package/es/components/Checkbox/index.js +13 -5
  29. package/es/components/CheckboxGroup/CheckboxGroup.js +100 -148
  30. package/es/components/ClassPrefix/index.js +21 -17
  31. package/es/components/CodeSnippet/CodeSnippet.Skeleton.js +45 -42
  32. package/es/components/CodeSnippet/CodeSnippet.js +210 -299
  33. package/es/components/ComboBox/ComboBox.js +621 -970
  34. package/es/components/ComboBox/index.js +12 -4
  35. package/es/components/ComboButton/index.js +172 -208
  36. package/es/components/ComposedModal/ComposedModal.js +311 -450
  37. package/es/components/ComposedModal/ComposedModalPresence.js +47 -42
  38. package/es/components/ComposedModal/ModalFooter.js +127 -207
  39. package/es/components/ComposedModal/ModalHeader.js +71 -101
  40. package/es/components/ComposedModal/useComposedModalState.js +21 -15
  41. package/es/components/ContainedList/ContainedList.js +67 -102
  42. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +49 -67
  43. package/es/components/ContainedList/ContainedListItem/index.js +12 -4
  44. package/es/components/ContainedList/index.js +15 -12
  45. package/es/components/ContentSwitcher/ContentSwitcher.js +108 -140
  46. package/es/components/ContextMenu/useContextMenu.js +41 -36
  47. package/es/components/Copy/Copy.js +97 -117
  48. package/es/components/Copy/index.js +12 -4
  49. package/es/components/CopyButton/CopyButton.js +81 -94
  50. package/es/components/CopyButton/index.js +12 -4
  51. package/es/components/DangerButton/DangerButton.js +11 -9
  52. package/es/components/DataTable/DataTable.d.ts +11 -11
  53. package/es/components/DataTable/DataTable.js +448 -630
  54. package/es/components/DataTable/Table.js +111 -156
  55. package/es/components/DataTable/TableActionList.js +14 -6
  56. package/es/components/DataTable/TableBatchAction.js +25 -34
  57. package/es/components/DataTable/TableBatchActions.js +78 -113
  58. package/es/components/DataTable/TableBody.js +26 -19
  59. package/es/components/DataTable/TableCell.js +31 -46
  60. package/es/components/DataTable/TableContainer.js +75 -82
  61. package/es/components/DataTable/TableContext.js +14 -6
  62. package/es/components/DataTable/TableDecoratorRow.js +30 -36
  63. package/es/components/DataTable/TableExpandHeader.js +53 -90
  64. package/es/components/DataTable/TableExpandRow.js +82 -119
  65. package/es/components/DataTable/TableExpandedRow.js +45 -51
  66. package/es/components/DataTable/TableHead.js +7 -5
  67. package/es/components/DataTable/TableHeader.js +138 -181
  68. package/es/components/DataTable/TableRow.d.ts +1 -1
  69. package/es/components/DataTable/TableRow.js +42 -76
  70. package/es/components/DataTable/TableSelectAll.js +42 -70
  71. package/es/components/DataTable/TableSelectRow.js +63 -98
  72. package/es/components/DataTable/TableSlugRow.js +35 -43
  73. package/es/components/DataTable/TableToolbar.js +33 -45
  74. package/es/components/DataTable/TableToolbarAction.js +25 -20
  75. package/es/components/DataTable/TableToolbarContent.js +14 -6
  76. package/es/components/DataTable/TableToolbarMenu.js +35 -46
  77. package/es/components/DataTable/TableToolbarSearch.js +97 -187
  78. package/es/components/DataTable/state/getDerivedStateFromProps.js +38 -43
  79. package/es/components/DataTable/state/sortStates.js +11 -9
  80. package/es/components/DataTable/state/sorting.js +53 -72
  81. package/es/components/DataTable/tools/cells.js +15 -7
  82. package/es/components/DataTable/tools/denormalize.js +27 -19
  83. package/es/components/DataTable/tools/filter.js +21 -22
  84. package/es/components/DataTable/tools/normalize.js +57 -72
  85. package/es/components/DataTable/tools/sorting.js +50 -71
  86. package/es/components/DataTableSkeleton/DataTableSkeleton.js +66 -94
  87. package/es/components/DatePicker/DatePicker.Skeleton.js +44 -51
  88. package/es/components/DatePicker/DatePicker.js +485 -752
  89. package/es/components/DatePicker/DatePickerLocales.js +75 -126
  90. package/es/components/DatePicker/index.js +13 -5
  91. package/es/components/DatePicker/plugins/appendToPlugin.js +31 -45
  92. package/es/components/DatePicker/plugins/fixEventsPlugin.js +127 -171
  93. package/es/components/DatePicker/plugins/rangePlugin.js +40 -48
  94. package/es/components/DatePicker/utils.js +11 -3
  95. package/es/components/DatePickerInput/DatePickerInput.js +179 -289
  96. package/es/components/DatePickerInput/index.js +12 -4
  97. package/es/components/Dialog/Dialog.js +303 -574
  98. package/es/components/Dialog/index.js +18 -2
  99. package/es/components/Dropdown/Dropdown.Skeleton.js +26 -38
  100. package/es/components/Dropdown/Dropdown.js +344 -535
  101. package/es/components/Dropdown/index.js +13 -5
  102. package/es/components/ErrorBoundary/ErrorBoundary.js +36 -58
  103. package/es/components/ErrorBoundary/ErrorBoundaryContext.js +14 -9
  104. package/es/components/ExpandableSearch/ExpandableSearch.js +60 -69
  105. package/es/components/ExpandableSearch/index.js +12 -4
  106. package/es/components/FeatureFlags/index.d.ts +11 -2
  107. package/es/components/FeatureFlags/index.js +79 -77
  108. package/es/components/FileUploader/FileUploader.Skeleton.js +35 -30
  109. package/es/components/FileUploader/FileUploader.js +269 -343
  110. package/es/components/FileUploader/FileUploaderButton.js +110 -160
  111. package/es/components/FileUploader/FileUploaderDropContainer.js +144 -221
  112. package/es/components/FileUploader/FileUploaderItem.js +138 -157
  113. package/es/components/FileUploader/Filename.d.ts +1 -1
  114. package/es/components/FileUploader/Filename.js +53 -72
  115. package/es/components/FluidComboBox/FluidComboBox.Skeleton.js +26 -28
  116. package/es/components/FluidComboBox/FluidComboBox.js +54 -105
  117. package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.js +56 -53
  118. package/es/components/FluidDatePicker/FluidDatePicker.js +46 -68
  119. package/es/components/FluidDatePickerInput/FluidDatePickerInput.js +23 -16
  120. package/es/components/FluidDropdown/FluidDropdown.Skeleton.js +26 -28
  121. package/es/components/FluidDropdown/FluidDropdown.js +55 -111
  122. package/es/components/FluidForm/FluidForm.js +29 -31
  123. package/es/components/FluidForm/FormContext.js +12 -6
  124. package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +26 -28
  125. package/es/components/FluidMultiSelect/FluidMultiSelect.js +67 -197
  126. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +27 -30
  127. package/es/components/FluidNumberInput/FluidNumberInput.js +63 -147
  128. package/es/components/FluidSearch/FluidSearch.Skeleton.js +27 -30
  129. package/es/components/FluidSearch/FluidSearch.js +41 -84
  130. package/es/components/FluidSelect/FluidSelect.Skeleton.js +26 -28
  131. package/es/components/FluidSelect/FluidSelect.js +40 -76
  132. package/es/components/FluidSelect/index.js +13 -5
  133. package/es/components/FluidTextArea/FluidTextArea.Skeleton.js +27 -30
  134. package/es/components/FluidTextArea/FluidTextArea.js +48 -112
  135. package/es/components/FluidTextInput/FluidPasswordInput.js +44 -99
  136. package/es/components/FluidTextInput/FluidTextInput.Skeleton.js +27 -30
  137. package/es/components/FluidTextInput/FluidTextInput.js +49 -104
  138. package/es/components/FluidTextInput/index.js +14 -6
  139. package/es/components/FluidTimePicker/FluidTimePicker.Skeleton.js +30 -33
  140. package/es/components/FluidTimePicker/FluidTimePicker.js +68 -115
  141. package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +28 -47
  142. package/es/components/Form/Form.js +23 -25
  143. package/es/components/FormGroup/FormGroup.js +45 -67
  144. package/es/components/FormItem/FormItem.js +23 -25
  145. package/es/components/FormLabel/FormLabel.js +28 -34
  146. package/es/components/Grid/CSSGrid.d.ts +1 -1
  147. package/es/components/Grid/CSSGrid.js +85 -127
  148. package/es/components/Grid/Column.js +192 -324
  149. package/es/components/Grid/ColumnHang.js +28 -36
  150. package/es/components/Grid/FlexGrid.js +40 -60
  151. package/es/components/Grid/Grid.js +29 -42
  152. package/es/components/Grid/GridContext.js +36 -42
  153. package/es/components/Grid/Row.js +31 -49
  154. package/es/components/Heading/index.js +36 -51
  155. package/es/components/Icon/Icon.Skeleton.js +21 -21
  156. package/es/components/IconButton/index.js +117 -178
  157. package/es/components/IconIndicator/index.d.ts +1 -1
  158. package/es/components/IconIndicator/index.js +59 -60
  159. package/es/components/IdPrefix/index.js +21 -17
  160. package/es/components/InlineCheckbox/InlineCheckbox.js +69 -113
  161. package/es/components/InlineCheckbox/index.js +12 -4
  162. package/es/components/InlineLoading/InlineLoading.js +83 -100
  163. package/es/components/InlineLoading/index.js +12 -4
  164. package/es/components/Layer/LayerContext.js +12 -4
  165. package/es/components/Layer/LayerLevel.js +20 -4
  166. package/es/components/Layer/index.js +54 -66
  167. package/es/components/Layout/index.js +77 -109
  168. package/es/components/LayoutDirection/LayoutDirection.d.ts +1 -1
  169. package/es/components/LayoutDirection/LayoutDirection.js +33 -37
  170. package/es/components/LayoutDirection/LayoutDirectionContext.js +12 -6
  171. package/es/components/LayoutDirection/useLayoutDirection.js +15 -7
  172. package/es/components/Link/Link.js +63 -108
  173. package/es/components/Link/index.js +12 -4
  174. package/es/components/ListBox/ListBox.js +78 -126
  175. package/es/components/ListBox/ListBoxField.js +24 -43
  176. package/es/components/ListBox/ListBoxMenu.js +36 -42
  177. package/es/components/ListBox/ListBoxMenuIcon.js +39 -40
  178. package/es/components/ListBox/ListBoxMenuItem.js +67 -88
  179. package/es/components/ListBox/ListBoxPropTypes.js +17 -5
  180. package/es/components/ListBox/ListBoxSelection.js +71 -96
  181. package/es/components/ListBox/index.js +16 -14
  182. package/es/components/ListBox/next/ListBoxSelection.js +79 -117
  183. package/es/components/ListBox/next/ListBoxTrigger.js +44 -48
  184. package/es/components/ListItem/ListItem.js +25 -28
  185. package/es/components/Loading/Loading.js +64 -73
  186. package/es/components/Loading/index.js +12 -4
  187. package/es/components/Menu/Menu.js +220 -363
  188. package/es/components/Menu/MenuContext.d.ts +1 -1
  189. package/es/components/Menu/MenuContext.js +41 -38
  190. package/es/components/Menu/MenuItem.js +282 -413
  191. package/es/components/MenuButton/index.js +134 -195
  192. package/es/components/Modal/Modal.js +500 -660
  193. package/es/components/Modal/ModalPresence.js +39 -37
  194. package/es/components/Modal/index.js +13 -5
  195. package/es/components/ModalWrapper/ModalWrapper.d.ts +2 -2
  196. package/es/components/ModalWrapper/ModalWrapper.js +106 -130
  197. package/es/components/MultiSelect/FilterableMultiSelect.js +605 -918
  198. package/es/components/MultiSelect/MultiSelect.js +454 -716
  199. package/es/components/MultiSelect/MultiSelectPropTypes.js +13 -30
  200. package/es/components/MultiSelect/filter.js +14 -9
  201. package/es/components/MultiSelect/tools/sorting.js +21 -34
  202. package/es/components/Notification/Notification.js +508 -785
  203. package/es/components/NumberInput/NumberFormatPropTypes.js +69 -30
  204. package/es/components/NumberInput/NumberInput.Skeleton.js +29 -33
  205. package/es/components/NumberInput/NumberInput.js +567 -947
  206. package/es/components/OrderedList/OrderedList.js +31 -44
  207. package/es/components/OverflowMenu/OverflowMenu.js +335 -450
  208. package/es/components/OverflowMenu/index.js +25 -16
  209. package/es/components/OverflowMenu/next/index.js +154 -186
  210. package/es/components/OverflowMenuItem/OverflowMenuItem.js +100 -160
  211. package/es/components/OverflowMenuItem/index.js +12 -4
  212. package/es/components/OverflowMenuV2/index.js +15 -13
  213. package/es/components/PageHeader/PageHeader.js +297 -442
  214. package/es/components/PageHeader/index.js +24 -2
  215. package/es/components/Pagination/Pagination.Skeleton.js +34 -35
  216. package/es/components/Pagination/Pagination.d.ts +1 -1
  217. package/es/components/Pagination/Pagination.js +251 -356
  218. package/es/components/Pagination/experimental/PageSelector.js +38 -54
  219. package/es/components/Pagination/experimental/Pagination-story.d.ts +114 -0
  220. package/es/components/Pagination/experimental/Pagination.js +144 -196
  221. package/es/components/PaginationNav/PaginationNav.js +320 -426
  222. package/es/components/Popover/index.js +318 -437
  223. package/es/components/PrimaryButton/PrimaryButton.js +11 -9
  224. package/es/components/ProgressBar/ProgressBar.js +117 -143
  225. package/es/components/ProgressIndicator/ProgressIndicator.Skeleton.js +42 -38
  226. package/es/components/ProgressIndicator/ProgressIndicator.js +146 -243
  227. package/es/components/RadioButton/RadioButton.Skeleton.js +23 -25
  228. package/es/components/RadioButton/RadioButton.js +101 -174
  229. package/es/components/RadioButton/index.js +12 -4
  230. package/es/components/RadioButtonGroup/RadioButtonGroup.js +135 -207
  231. package/es/components/RadioTile/RadioTile.js +104 -168
  232. package/es/components/RadioTile/index.js +12 -4
  233. package/es/components/Search/Search.Skeleton.js +28 -33
  234. package/es/components/Search/Search.js +182 -278
  235. package/es/components/Search/index.js +13 -5
  236. package/es/components/Search/utils.js +11 -3
  237. package/es/components/SecondaryButton/SecondaryButton.js +11 -9
  238. package/es/components/Select/Select.Skeleton.js +27 -30
  239. package/es/components/Select/Select.js +178 -257
  240. package/es/components/Select/index.js +13 -5
  241. package/es/components/SelectItem/SelectItem.js +33 -48
  242. package/es/components/SelectItem/index.js +12 -4
  243. package/es/components/SelectItemGroup/SelectItemGroup.js +27 -37
  244. package/es/components/ShapeIndicator/index.d.ts +1 -1
  245. package/es/components/ShapeIndicator/index.js +74 -80
  246. package/es/components/SkeletonIcon/SkeletonIcon.js +21 -24
  247. package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +15 -24
  248. package/es/components/SkeletonText/SkeletonText.js +67 -81
  249. package/es/components/SkeletonText/index.js +12 -4
  250. package/es/components/Slider/Slider.Skeleton.js +68 -91
  251. package/es/components/Slider/Slider.js +864 -1315
  252. package/es/components/Slider/SliderHandles.js +73 -66
  253. package/es/components/Stack/HStack.js +19 -11
  254. package/es/components/Stack/Stack.js +56 -80
  255. package/es/components/Stack/VStack.js +19 -11
  256. package/es/components/StructuredList/StructuredList.Skeleton.js +55 -48
  257. package/es/components/StructuredList/StructuredList.js +178 -317
  258. package/es/components/Switch/IconSwitch.js +99 -145
  259. package/es/components/Switch/Switch.js +66 -99
  260. package/es/components/TabContent/TabContent.js +28 -34
  261. package/es/components/Tabs/Tabs.Skeleton.js +41 -36
  262. package/es/components/Tabs/Tabs.js +732 -1149
  263. package/es/components/Tabs/usePressable.js +97 -112
  264. package/es/components/Tag/DismissibleTag.js +119 -156
  265. package/es/components/Tag/OperationalTag.js +91 -111
  266. package/es/components/Tag/SelectableTag.js +94 -129
  267. package/es/components/Tag/Tag.Skeleton.js +26 -30
  268. package/es/components/Tag/Tag.js +152 -200
  269. package/es/components/Tag/isEllipsisActive.js +13 -8
  270. package/es/components/Text/Text.js +66 -79
  271. package/es/components/Text/TextDirection.js +36 -37
  272. package/es/components/Text/TextDirectionContext.js +14 -8
  273. package/es/components/Text/createTextComponent.js +21 -20
  274. package/es/components/TextArea/TextArea.Skeleton.js +25 -29
  275. package/es/components/TextArea/TextArea.js +315 -422
  276. package/es/components/TextArea/index.js +13 -5
  277. package/es/components/TextInput/ControlledPasswordInput.js +133 -198
  278. package/es/components/TextInput/PasswordInput.js +196 -303
  279. package/es/components/TextInput/TextInput.Skeleton.js +24 -28
  280. package/es/components/TextInput/TextInput.js +219 -317
  281. package/es/components/TextInput/index.js +13 -5
  282. package/es/components/TextInput/util.js +21 -25
  283. package/es/components/Theme/index.js +79 -95
  284. package/es/components/Tile/Tile.js +394 -593
  285. package/es/components/TileGroup/TileGroup.js +70 -111
  286. package/es/components/TimePicker/TimePicker.d.ts +1 -1
  287. package/es/components/TimePicker/TimePicker.js +148 -247
  288. package/es/components/TimePickerSelect/TimePickerSelect.js +43 -58
  289. package/es/components/Toggle/Toggle.Skeleton.js +24 -22
  290. package/es/components/Toggle/Toggle.js +102 -171
  291. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +46 -51
  292. package/es/components/Toggletip/index.d.ts +2 -2
  293. package/es/components/Toggletip/index.js +170 -256
  294. package/es/components/Tooltip/DefinitionTooltip.js +98 -138
  295. package/es/components/Tooltip/Tooltip.js +188 -263
  296. package/es/components/TreeView/TreeContext.js +13 -5
  297. package/es/components/TreeView/TreeNode.js +361 -500
  298. package/es/components/TreeView/TreeView.js +164 -237
  299. package/es/components/UIShell/Content.js +23 -30
  300. package/es/components/UIShell/Header.js +25 -29
  301. package/es/components/UIShell/HeaderContainer.js +31 -40
  302. package/es/components/UIShell/HeaderGlobalAction.js +65 -90
  303. package/es/components/UIShell/HeaderGlobalBar.js +16 -9
  304. package/es/components/UIShell/HeaderMenu.js +141 -215
  305. package/es/components/UIShell/HeaderMenuButton.js +43 -66
  306. package/es/components/UIShell/HeaderMenuItem.js +49 -76
  307. package/es/components/UIShell/HeaderName.js +32 -44
  308. package/es/components/UIShell/HeaderNavigation.js +32 -37
  309. package/es/components/UIShell/HeaderPanel.js +74 -97
  310. package/es/components/UIShell/HeaderSideNavItems.js +27 -33
  311. package/es/components/UIShell/Link.js +29 -50
  312. package/es/components/UIShell/SideNav.js +132 -241
  313. package/es/components/UIShell/SideNavContext.js +21 -15
  314. package/es/components/UIShell/SideNavDetails.js +29 -34
  315. package/es/components/UIShell/SideNavDivider.js +21 -21
  316. package/es/components/UIShell/SideNavFooter.js +43 -52
  317. package/es/components/UIShell/SideNavHeader.js +26 -35
  318. package/es/components/UIShell/SideNavIcon.js +28 -33
  319. package/es/components/UIShell/SideNavItem.js +28 -33
  320. package/es/components/UIShell/SideNavItems.js +31 -40
  321. package/es/components/UIShell/SideNavLink.js +52 -79
  322. package/es/components/UIShell/SideNavLinkText.js +24 -25
  323. package/es/components/UIShell/SideNavMenu.js +102 -143
  324. package/es/components/UIShell/SideNavMenuItem.js +40 -52
  325. package/es/components/UIShell/SideNavSwitcher.js +59 -68
  326. package/es/components/UIShell/SkipToContent.js +28 -36
  327. package/es/components/UIShell/Switcher.js +69 -99
  328. package/es/components/UIShell/SwitcherDivider.js +16 -24
  329. package/es/components/UIShell/SwitcherItem.js +74 -114
  330. package/es/components/UnorderedList/UnorderedList.js +28 -37
  331. package/es/feature-flags.js +19 -10
  332. package/es/index.js +249 -242
  333. package/es/internal/FloatingMenu.js +246 -292
  334. package/es/internal/OptimizedResize.js +35 -46
  335. package/es/internal/Selection.js +99 -132
  336. package/es/internal/clamp.js +12 -4
  337. package/es/internal/defaultItemToString.js +15 -9
  338. package/es/internal/deprecateFieldOnObject.js +22 -14
  339. package/es/internal/environment.js +15 -7
  340. package/es/internal/getAnnouncement.js +16 -13
  341. package/es/internal/keyboard/keys.js +48 -48
  342. package/es/internal/keyboard/match.js +25 -42
  343. package/es/internal/keyboard/navigation.js +22 -27
  344. package/es/internal/noopFn.js +10 -2
  345. package/es/internal/useAttachedMenu.js +43 -51
  346. package/es/internal/useControllableState.js +43 -48
  347. package/es/internal/useDelayedState.js +30 -35
  348. package/es/internal/useEvent.js +39 -35
  349. package/es/internal/useId.js +51 -87
  350. package/es/internal/useIdPrefix.js +13 -5
  351. package/es/internal/useIsomorphicEffect.js +12 -4
  352. package/es/internal/useMatchMedia.js +29 -21
  353. package/es/internal/useMergedRefs.js +26 -22
  354. package/es/internal/useNoInteractiveChildren.js +70 -99
  355. package/es/internal/useNormalizedInputProps.js +47 -51
  356. package/es/internal/useOutsideClick.js +21 -24
  357. package/es/internal/useOverflowItems.js +89 -90
  358. package/es/internal/usePrefix.js +13 -5
  359. package/es/internal/usePresence.js +51 -54
  360. package/es/internal/usePresenceContext.js +35 -35
  361. package/es/internal/usePreviousValue.js +26 -18
  362. package/es/internal/useResizeObserver.js +57 -66
  363. package/es/internal/useSavedCallback.js +24 -17
  364. package/es/internal/utils.js +17 -9
  365. package/es/internal/warning.js +17 -22
  366. package/es/internal/wrapFocus.js +77 -98
  367. package/es/prop-types/AriaPropTypes.js +14 -6
  368. package/es/prop-types/deprecate.js +30 -27
  369. package/es/prop-types/deprecateComponent.js +17 -8
  370. package/es/prop-types/deprecateValuesWithin.js +18 -21
  371. package/es/prop-types/isRequiredOneOf.js +21 -24
  372. package/es/prop-types/requiredIfGivenPropIsTruthy.js +14 -14
  373. package/es/tools/events.js +17 -21
  374. package/es/tools/mapPopoverAlign.js +19 -18
  375. package/es/tools/mergeRefs.js +14 -17
  376. package/es/tools/setupGetInstanceId.js +16 -8
  377. package/es/tools/toggleClass.js +17 -9
  378. package/es/tools/wrapComponent.js +34 -39
  379. package/icons/index.d.ts +2 -1
  380. package/icons/index.esm.js +2 -2
  381. package/icons/index.js +7 -10
  382. package/lib/_virtual/_rolldown/runtime.js +50 -0
  383. package/lib/components/AILabel/index.d.ts +29 -2
  384. package/lib/components/AILabel/index.js +118 -171
  385. package/lib/components/AISkeleton/AISkeletonIcon.js +27 -31
  386. package/lib/components/AISkeleton/AISkeletonPlaceholder.js +29 -31
  387. package/lib/components/AISkeleton/AISkeletonText.js +30 -43
  388. package/lib/components/Accordion/Accordion.Skeleton.js +59 -84
  389. package/lib/components/Accordion/Accordion.js +47 -65
  390. package/lib/components/Accordion/AccordionItem.js +106 -160
  391. package/lib/components/Accordion/AccordionProvider.js +20 -17
  392. package/lib/components/AspectRatio/AspectRatio.js +45 -51
  393. package/lib/components/BadgeIndicator/index.js +33 -39
  394. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +43 -55
  395. package/lib/components/Breadcrumb/Breadcrumb.js +43 -55
  396. package/lib/components/Breadcrumb/BreadcrumbItem.js +84 -87
  397. package/lib/components/Button/Button.Skeleton.js +53 -63
  398. package/lib/components/Button/Button.d.ts +1 -1
  399. package/lib/components/Button/Button.js +149 -244
  400. package/lib/components/Button/ButtonBase.js +85 -108
  401. package/lib/components/Button/index.js +13 -15
  402. package/lib/components/ButtonSet/ButtonSet.js +78 -102
  403. package/lib/components/ButtonSet/index.js +12 -9
  404. package/lib/components/ChatButton/ChatButton.Skeleton.js +31 -31
  405. package/lib/components/ChatButton/ChatButton.js +68 -83
  406. package/lib/components/Checkbox/Checkbox.Skeleton.js +30 -30
  407. package/lib/components/Checkbox/Checkbox.js +119 -198
  408. package/lib/components/Checkbox/index.js +13 -11
  409. package/lib/components/CheckboxGroup/CheckboxGroup.js +104 -152
  410. package/lib/components/ClassPrefix/index.js +24 -19
  411. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +49 -47
  412. package/lib/components/CodeSnippet/CodeSnippet.js +215 -303
  413. package/lib/components/ComboBox/ComboBox.js +626 -974
  414. package/lib/components/ComboBox/index.js +12 -9
  415. package/lib/components/ComboButton/index.js +176 -210
  416. package/lib/components/ComposedModal/ComposedModal.js +315 -454
  417. package/lib/components/ComposedModal/ComposedModalPresence.js +49 -44
  418. package/lib/components/ComposedModal/ModalFooter.js +131 -209
  419. package/lib/components/ComposedModal/ModalHeader.js +75 -103
  420. package/lib/components/ComposedModal/useComposedModalState.js +22 -17
  421. package/lib/components/ContainedList/ContainedList.js +77 -106
  422. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +59 -71
  423. package/lib/components/ContainedList/ContainedListItem/index.js +12 -9
  424. package/lib/components/ContainedList/index.js +18 -15
  425. package/lib/components/ContentSwitcher/ContentSwitcher.js +112 -142
  426. package/lib/components/ContextMenu/useContextMenu.js +42 -40
  427. package/lib/components/Copy/Copy.js +101 -121
  428. package/lib/components/Copy/index.js +12 -9
  429. package/lib/components/CopyButton/CopyButton.js +85 -98
  430. package/lib/components/CopyButton/index.js +12 -9
  431. package/lib/components/DangerButton/DangerButton.js +19 -13
  432. package/lib/components/DataTable/DataTable.d.ts +11 -11
  433. package/lib/components/DataTable/DataTable.js +474 -655
  434. package/lib/components/DataTable/Table.js +115 -161
  435. package/lib/components/DataTable/TableActionList.js +15 -11
  436. package/lib/components/DataTable/TableBatchAction.js +28 -38
  437. package/lib/components/DataTable/TableBatchActions.js +82 -117
  438. package/lib/components/DataTable/TableBody.js +29 -23
  439. package/lib/components/DataTable/TableCell.js +35 -50
  440. package/lib/components/DataTable/TableContainer.js +79 -86
  441. package/lib/components/DataTable/TableContext.js +15 -8
  442. package/lib/components/DataTable/TableDecoratorRow.js +34 -40
  443. package/lib/components/DataTable/TableExpandHeader.js +57 -94
  444. package/lib/components/DataTable/TableExpandRow.js +86 -123
  445. package/lib/components/DataTable/TableExpandedRow.js +49 -55
  446. package/lib/components/DataTable/TableHead.js +8 -10
  447. package/lib/components/DataTable/TableHeader.js +142 -185
  448. package/lib/components/DataTable/TableRow.d.ts +1 -1
  449. package/lib/components/DataTable/TableRow.js +46 -80
  450. package/lib/components/DataTable/TableSelectAll.js +46 -74
  451. package/lib/components/DataTable/TableSelectRow.js +67 -102
  452. package/lib/components/DataTable/TableSlugRow.js +39 -47
  453. package/lib/components/DataTable/TableToolbar.js +37 -49
  454. package/lib/components/DataTable/TableToolbarAction.js +28 -24
  455. package/lib/components/DataTable/TableToolbarContent.js +15 -11
  456. package/lib/components/DataTable/TableToolbarMenu.js +39 -50
  457. package/lib/components/DataTable/TableToolbarSearch.js +101 -191
  458. package/lib/components/DataTable/state/getDerivedStateFromProps.js +38 -47
  459. package/lib/components/DataTable/state/sortStates.js +11 -10
  460. package/lib/components/DataTable/state/sorting.js +54 -76
  461. package/lib/components/DataTable/tools/cells.js +15 -8
  462. package/lib/components/DataTable/tools/denormalize.js +27 -22
  463. package/lib/components/DataTable/tools/filter.js +21 -23
  464. package/lib/components/DataTable/tools/normalize.js +57 -76
  465. package/lib/components/DataTable/tools/sorting.js +50 -75
  466. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +70 -98
  467. package/lib/components/DatePicker/DatePicker.Skeleton.js +48 -56
  468. package/lib/components/DatePicker/DatePicker.js +491 -756
  469. package/lib/components/DatePicker/DatePickerLocales.js +75 -127
  470. package/lib/components/DatePicker/index.js +13 -11
  471. package/lib/components/DatePicker/plugins/appendToPlugin.js +31 -46
  472. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +127 -175
  473. package/lib/components/DatePicker/plugins/rangePlugin.js +42 -50
  474. package/lib/components/DatePicker/utils.js +11 -4
  475. package/lib/components/DatePickerInput/DatePickerInput.js +183 -293
  476. package/lib/components/DatePickerInput/index.js +12 -9
  477. package/lib/components/Dialog/Dialog.js +307 -576
  478. package/lib/components/Dialog/index.js +21 -13
  479. package/lib/components/Dropdown/Dropdown.Skeleton.js +30 -43
  480. package/lib/components/Dropdown/Dropdown.js +348 -539
  481. package/lib/components/Dropdown/index.js +13 -11
  482. package/lib/components/ErrorBoundary/ErrorBoundary.js +39 -62
  483. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +15 -11
  484. package/lib/components/ExpandableSearch/ExpandableSearch.js +63 -73
  485. package/lib/components/ExpandableSearch/index.js +12 -9
  486. package/lib/components/FeatureFlags/index.d.ts +11 -2
  487. package/lib/components/FeatureFlags/index.js +82 -79
  488. package/lib/components/FileUploader/FileUploader.Skeleton.js +39 -35
  489. package/lib/components/FileUploader/FileUploader.js +273 -347
  490. package/lib/components/FileUploader/FileUploaderButton.js +114 -164
  491. package/lib/components/FileUploader/FileUploaderDropContainer.js +148 -225
  492. package/lib/components/FileUploader/FileUploaderItem.js +142 -161
  493. package/lib/components/FileUploader/Filename.d.ts +1 -1
  494. package/lib/components/FileUploader/Filename.js +56 -76
  495. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +30 -32
  496. package/lib/components/FluidComboBox/FluidComboBox.js +58 -109
  497. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +60 -57
  498. package/lib/components/FluidDatePicker/FluidDatePicker.js +50 -72
  499. package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +25 -20
  500. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +30 -32
  501. package/lib/components/FluidDropdown/FluidDropdown.js +59 -115
  502. package/lib/components/FluidForm/FluidForm.js +33 -35
  503. package/lib/components/FluidForm/FormContext.js +13 -8
  504. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +30 -32
  505. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +71 -201
  506. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +31 -34
  507. package/lib/components/FluidNumberInput/FluidNumberInput.js +67 -151
  508. package/lib/components/FluidSearch/FluidSearch.Skeleton.js +31 -34
  509. package/lib/components/FluidSearch/FluidSearch.js +45 -88
  510. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +30 -32
  511. package/lib/components/FluidSelect/FluidSelect.js +44 -80
  512. package/lib/components/FluidSelect/index.js +13 -11
  513. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +31 -34
  514. package/lib/components/FluidTextArea/FluidTextArea.js +52 -116
  515. package/lib/components/FluidTextInput/FluidPasswordInput.js +48 -103
  516. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +31 -34
  517. package/lib/components/FluidTextInput/FluidTextInput.js +53 -108
  518. package/lib/components/FluidTextInput/index.js +14 -13
  519. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +34 -37
  520. package/lib/components/FluidTimePicker/FluidTimePicker.js +72 -119
  521. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +31 -51
  522. package/lib/components/Form/Form.js +27 -29
  523. package/lib/components/FormGroup/FormGroup.js +49 -71
  524. package/lib/components/FormItem/FormItem.js +27 -29
  525. package/lib/components/FormLabel/FormLabel.js +32 -38
  526. package/lib/components/Grid/CSSGrid.d.ts +1 -1
  527. package/lib/components/Grid/CSSGrid.js +89 -129
  528. package/lib/components/Grid/Column.js +196 -328
  529. package/lib/components/Grid/ColumnHang.js +32 -38
  530. package/lib/components/Grid/FlexGrid.js +44 -62
  531. package/lib/components/Grid/Grid.js +32 -44
  532. package/lib/components/Grid/GridContext.js +39 -44
  533. package/lib/components/Grid/Row.js +35 -53
  534. package/lib/components/Heading/index.js +39 -53
  535. package/lib/components/Icon/Icon.Skeleton.js +25 -23
  536. package/lib/components/IconButton/index.js +121 -180
  537. package/lib/components/IconIndicator/index.d.ts +1 -1
  538. package/lib/components/IconIndicator/index.js +63 -63
  539. package/lib/components/IdPrefix/index.js +24 -19
  540. package/lib/components/InlineCheckbox/InlineCheckbox.js +72 -117
  541. package/lib/components/InlineCheckbox/index.js +12 -9
  542. package/lib/components/InlineLoading/InlineLoading.js +87 -104
  543. package/lib/components/InlineLoading/index.js +12 -9
  544. package/lib/components/Layer/LayerContext.js +14 -6
  545. package/lib/components/Layer/LayerLevel.js +20 -6
  546. package/lib/components/Layer/index.js +58 -68
  547. package/lib/components/Layout/index.js +81 -111
  548. package/lib/components/LayoutDirection/LayoutDirection.d.ts +1 -1
  549. package/lib/components/LayoutDirection/LayoutDirection.js +36 -40
  550. package/lib/components/LayoutDirection/LayoutDirectionContext.js +14 -8
  551. package/lib/components/LayoutDirection/useLayoutDirection.js +16 -9
  552. package/lib/components/Link/Link.js +67 -112
  553. package/lib/components/Link/index.js +12 -9
  554. package/lib/components/ListBox/ListBox.js +82 -130
  555. package/lib/components/ListBox/ListBoxField.js +33 -47
  556. package/lib/components/ListBox/ListBoxMenu.js +39 -46
  557. package/lib/components/ListBox/ListBoxMenuIcon.js +43 -44
  558. package/lib/components/ListBox/ListBoxMenuItem.js +71 -92
  559. package/lib/components/ListBox/ListBoxPropTypes.js +21 -9
  560. package/lib/components/ListBox/ListBoxSelection.js +75 -100
  561. package/lib/components/ListBox/index.js +17 -21
  562. package/lib/components/ListBox/next/ListBoxSelection.js +83 -121
  563. package/lib/components/ListBox/next/ListBoxTrigger.js +48 -52
  564. package/lib/components/ListItem/ListItem.js +29 -32
  565. package/lib/components/Loading/Loading.js +68 -77
  566. package/lib/components/Loading/index.js +12 -9
  567. package/lib/components/Menu/Menu.js +224 -365
  568. package/lib/components/Menu/MenuContext.d.ts +1 -1
  569. package/lib/components/Menu/MenuContext.js +42 -40
  570. package/lib/components/Menu/MenuItem.js +286 -415
  571. package/lib/components/MenuButton/index.js +138 -197
  572. package/lib/components/Modal/Modal.js +504 -665
  573. package/lib/components/Modal/ModalPresence.js +41 -39
  574. package/lib/components/Modal/index.js +13 -10
  575. package/lib/components/ModalWrapper/ModalWrapper.d.ts +2 -2
  576. package/lib/components/ModalWrapper/ModalWrapper.js +112 -134
  577. package/lib/components/MultiSelect/FilterableMultiSelect.js +611 -920
  578. package/lib/components/MultiSelect/MultiSelect.js +459 -718
  579. package/lib/components/MultiSelect/MultiSelectPropTypes.js +15 -32
  580. package/lib/components/MultiSelect/filter.js +14 -10
  581. package/lib/components/MultiSelect/tools/sorting.js +21 -35
  582. package/lib/components/Notification/Notification.js +514 -787
  583. package/lib/components/NumberInput/NumberFormatPropTypes.js +72 -33
  584. package/lib/components/NumberInput/NumberInput.Skeleton.js +33 -37
  585. package/lib/components/NumberInput/NumberInput.js +571 -950
  586. package/lib/components/OrderedList/OrderedList.js +35 -48
  587. package/lib/components/OverflowMenu/OverflowMenu.js +341 -454
  588. package/lib/components/OverflowMenu/index.js +27 -21
  589. package/lib/components/OverflowMenu/next/index.js +158 -188
  590. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +104 -164
  591. package/lib/components/OverflowMenuItem/index.js +12 -9
  592. package/lib/components/OverflowMenuV2/index.js +25 -15
  593. package/lib/components/PageHeader/PageHeader.js +301 -444
  594. package/lib/components/PageHeader/index.js +27 -19
  595. package/lib/components/Pagination/Pagination.Skeleton.js +38 -37
  596. package/lib/components/Pagination/Pagination.d.ts +1 -1
  597. package/lib/components/Pagination/Pagination.js +256 -360
  598. package/lib/components/Pagination/experimental/PageSelector.js +48 -58
  599. package/lib/components/Pagination/experimental/Pagination-story.d.ts +114 -0
  600. package/lib/components/Pagination/experimental/Pagination.js +148 -200
  601. package/lib/components/PaginationNav/PaginationNav.js +324 -430
  602. package/lib/components/Popover/index.js +323 -440
  603. package/lib/components/PrimaryButton/PrimaryButton.js +19 -13
  604. package/lib/components/ProgressBar/ProgressBar.js +121 -147
  605. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +46 -43
  606. package/lib/components/ProgressIndicator/ProgressIndicator.js +150 -245
  607. package/lib/components/RadioButton/RadioButton.Skeleton.js +27 -27
  608. package/lib/components/RadioButton/RadioButton.js +105 -178
  609. package/lib/components/RadioButton/index.js +12 -9
  610. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +139 -211
  611. package/lib/components/RadioTile/RadioTile.js +108 -172
  612. package/lib/components/RadioTile/index.js +12 -9
  613. package/lib/components/Search/Search.Skeleton.js +32 -38
  614. package/lib/components/Search/Search.js +185 -281
  615. package/lib/components/Search/index.js +13 -11
  616. package/lib/components/Search/utils.js +11 -4
  617. package/lib/components/SecondaryButton/SecondaryButton.js +19 -13
  618. package/lib/components/Select/Select.Skeleton.js +31 -35
  619. package/lib/components/Select/Select.js +182 -261
  620. package/lib/components/Select/index.js +13 -11
  621. package/lib/components/SelectItem/SelectItem.js +37 -52
  622. package/lib/components/SelectItem/index.js +12 -9
  623. package/lib/components/SelectItemGroup/SelectItemGroup.js +31 -41
  624. package/lib/components/ShapeIndicator/index.d.ts +1 -1
  625. package/lib/components/ShapeIndicator/index.js +78 -83
  626. package/lib/components/SkeletonIcon/SkeletonIcon.js +25 -28
  627. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +25 -28
  628. package/lib/components/SkeletonText/SkeletonText.js +71 -85
  629. package/lib/components/SkeletonText/index.js +12 -9
  630. package/lib/components/Slider/Slider.Skeleton.js +72 -95
  631. package/lib/components/Slider/Slider.js +868 -1319
  632. package/lib/components/Slider/SliderHandles.js +75 -68
  633. package/lib/components/Stack/HStack.js +22 -14
  634. package/lib/components/Stack/Stack.js +60 -82
  635. package/lib/components/Stack/VStack.js +22 -14
  636. package/lib/components/StructuredList/StructuredList.Skeleton.js +59 -52
  637. package/lib/components/StructuredList/StructuredList.js +182 -319
  638. package/lib/components/Switch/IconSwitch.js +103 -149
  639. package/lib/components/Switch/Switch.js +70 -103
  640. package/lib/components/TabContent/TabContent.js +32 -38
  641. package/lib/components/Tabs/Tabs.Skeleton.js +45 -41
  642. package/lib/components/Tabs/Tabs.js +738 -1153
  643. package/lib/components/Tabs/usePressable.js +98 -114
  644. package/lib/components/Tag/DismissibleTag.js +123 -160
  645. package/lib/components/Tag/OperationalTag.js +95 -115
  646. package/lib/components/Tag/SelectableTag.js +98 -133
  647. package/lib/components/Tag/Tag.Skeleton.js +30 -32
  648. package/lib/components/Tag/Tag.js +156 -204
  649. package/lib/components/Tag/isEllipsisActive.js +13 -9
  650. package/lib/components/Text/Text.js +69 -81
  651. package/lib/components/Text/TextDirection.js +39 -39
  652. package/lib/components/Text/TextDirectionContext.js +15 -10
  653. package/lib/components/Text/createTextComponent.js +29 -22
  654. package/lib/components/TextArea/TextArea.Skeleton.js +29 -34
  655. package/lib/components/TextArea/TextArea.js +319 -426
  656. package/lib/components/TextArea/index.js +13 -11
  657. package/lib/components/TextInput/ControlledPasswordInput.js +137 -202
  658. package/lib/components/TextInput/PasswordInput.js +200 -307
  659. package/lib/components/TextInput/TextInput.Skeleton.js +28 -33
  660. package/lib/components/TextInput/TextInput.js +223 -321
  661. package/lib/components/TextInput/index.js +13 -11
  662. package/lib/components/TextInput/util.js +21 -26
  663. package/lib/components/Theme/index.js +83 -97
  664. package/lib/components/Tile/Tile.js +398 -595
  665. package/lib/components/TileGroup/TileGroup.js +73 -113
  666. package/lib/components/TimePicker/TimePicker.d.ts +1 -1
  667. package/lib/components/TimePicker/TimePicker.js +152 -251
  668. package/lib/components/TimePickerSelect/TimePickerSelect.js +47 -62
  669. package/lib/components/Toggle/Toggle.Skeleton.js +28 -24
  670. package/lib/components/Toggle/Toggle.js +106 -176
  671. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +50 -53
  672. package/lib/components/Toggletip/index.d.ts +2 -2
  673. package/lib/components/Toggletip/index.js +174 -258
  674. package/lib/components/Tooltip/DefinitionTooltip.js +102 -140
  675. package/lib/components/Tooltip/Tooltip.js +192 -265
  676. package/lib/components/TreeView/TreeContext.js +14 -7
  677. package/lib/components/TreeView/TreeNode.js +365 -504
  678. package/lib/components/TreeView/TreeView.js +169 -242
  679. package/lib/components/UIShell/Content.js +27 -34
  680. package/lib/components/UIShell/Header.js +29 -33
  681. package/lib/components/UIShell/HeaderContainer.js +34 -44
  682. package/lib/components/UIShell/HeaderGlobalAction.js +69 -94
  683. package/lib/components/UIShell/HeaderGlobalBar.js +17 -14
  684. package/lib/components/UIShell/HeaderMenu.js +146 -221
  685. package/lib/components/UIShell/HeaderMenuButton.js +47 -70
  686. package/lib/components/UIShell/HeaderMenuItem.js +53 -80
  687. package/lib/components/UIShell/HeaderName.js +36 -48
  688. package/lib/components/UIShell/HeaderNavigation.js +36 -41
  689. package/lib/components/UIShell/HeaderPanel.js +78 -101
  690. package/lib/components/UIShell/HeaderSideNavItems.js +31 -37
  691. package/lib/components/UIShell/Link.js +32 -54
  692. package/lib/components/UIShell/SideNav.js +136 -245
  693. package/lib/components/UIShell/SideNavContext.js +23 -17
  694. package/lib/components/UIShell/SideNavDetails.js +33 -38
  695. package/lib/components/UIShell/SideNavDivider.js +25 -25
  696. package/lib/components/UIShell/SideNavFooter.js +47 -56
  697. package/lib/components/UIShell/SideNavHeader.js +30 -39
  698. package/lib/components/UIShell/SideNavIcon.js +32 -37
  699. package/lib/components/UIShell/SideNavItem.js +32 -37
  700. package/lib/components/UIShell/SideNavItems.js +35 -44
  701. package/lib/components/UIShell/SideNavLink.js +56 -83
  702. package/lib/components/UIShell/SideNavLinkText.js +28 -29
  703. package/lib/components/UIShell/SideNavMenu.js +106 -148
  704. package/lib/components/UIShell/SideNavMenuItem.js +44 -56
  705. package/lib/components/UIShell/SideNavSwitcher.js +63 -72
  706. package/lib/components/UIShell/SkipToContent.js +32 -40
  707. package/lib/components/UIShell/Switcher.js +73 -103
  708. package/lib/components/UIShell/SwitcherDivider.js +26 -28
  709. package/lib/components/UIShell/SwitcherItem.js +78 -118
  710. package/lib/components/UnorderedList/UnorderedList.js +32 -41
  711. package/lib/feature-flags.js +21 -13
  712. package/lib/index.js +622 -602
  713. package/lib/internal/FloatingMenu.js +249 -296
  714. package/lib/internal/OptimizedResize.js +35 -47
  715. package/lib/internal/Selection.js +102 -134
  716. package/lib/internal/clamp.js +12 -5
  717. package/lib/internal/defaultItemToString.js +15 -10
  718. package/lib/internal/deprecateFieldOnObject.js +23 -16
  719. package/lib/internal/environment.js +15 -8
  720. package/lib/internal/getAnnouncement.js +16 -14
  721. package/lib/internal/keyboard/keys.js +48 -49
  722. package/lib/internal/keyboard/match.js +25 -43
  723. package/lib/internal/keyboard/navigation.js +22 -29
  724. package/lib/internal/noopFn.js +10 -3
  725. package/lib/internal/useAttachedMenu.js +44 -53
  726. package/lib/internal/useControllableState.js +44 -50
  727. package/lib/internal/useDelayedState.js +31 -37
  728. package/lib/internal/useEvent.js +40 -37
  729. package/lib/internal/useId.js +54 -91
  730. package/lib/internal/useIdPrefix.js +15 -7
  731. package/lib/internal/useIsomorphicEffect.js +13 -8
  732. package/lib/internal/useMatchMedia.js +30 -23
  733. package/lib/internal/useMergedRefs.js +27 -24
  734. package/lib/internal/useNoInteractiveChildren.js +73 -101
  735. package/lib/internal/useNormalizedInputProps.js +55 -53
  736. package/lib/internal/useOutsideClick.js +22 -26
  737. package/lib/internal/useOverflowItems.js +90 -94
  738. package/lib/internal/usePrefix.js +15 -7
  739. package/lib/internal/usePresence.js +52 -56
  740. package/lib/internal/usePresenceContext.js +36 -37
  741. package/lib/internal/usePreviousValue.js +27 -20
  742. package/lib/internal/useResizeObserver.js +58 -68
  743. package/lib/internal/useSavedCallback.js +25 -19
  744. package/lib/internal/utils.js +18 -11
  745. package/lib/internal/warning.js +24 -23
  746. package/lib/internal/wrapFocus.js +78 -100
  747. package/lib/prop-types/AriaPropTypes.js +17 -9
  748. package/lib/prop-types/deprecate.js +30 -29
  749. package/lib/prop-types/deprecateComponent.js +17 -10
  750. package/lib/prop-types/deprecateValuesWithin.js +18 -23
  751. package/lib/prop-types/isRequiredOneOf.js +21 -25
  752. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +14 -15
  753. package/lib/tools/events.js +17 -22
  754. package/lib/tools/mapPopoverAlign.js +19 -19
  755. package/lib/tools/mergeRefs.js +14 -18
  756. package/lib/tools/setupGetInstanceId.js +16 -9
  757. package/lib/tools/toggleClass.js +17 -10
  758. package/lib/tools/wrapComponent.js +38 -43
  759. package/package.json +10 -16
  760. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -40
  761. package/es/components/DataTable/stories/examples/TableToolbarFilter.d.ts +0 -54
  762. package/es/node_modules/es-toolkit/dist/compat/function/debounce.js +0 -55
  763. package/es/node_modules/es-toolkit/dist/compat/function/throttle.js +0 -23
  764. package/es/node_modules/es-toolkit/dist/function/debounce.js +0 -70
  765. package/lib/_virtual/_rollupPluginBabelHelpers.js +0 -45
  766. package/lib/components/DataTable/stories/examples/TableToolbarFilter.d.ts +0 -54
  767. package/lib/node_modules/es-toolkit/dist/compat/function/debounce.js +0 -57
  768. package/lib/node_modules/es-toolkit/dist/compat/function/throttle.js +0 -25
  769. package/lib/node_modules/es-toolkit/dist/function/debounce.js +0 -72
@@ -1,825 +1,548 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2026
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import PropTypes from 'prop-types';
10
- import React, { useState, useRef, useEffect } from 'react';
11
- import { deprecate } from '../../prop-types/deprecate.js';
12
- import cx from 'classnames';
13
- import { Close, InformationSquareFilled, InformationFilled, WarningAltFilled, WarningFilled, CheckmarkFilled, ErrorFilled } from '@carbon/icons-react';
14
- import { Text } from '../Text/Text.js';
15
- import '../Text/TextDirection.js';
16
- import Button from '../Button/Button.js';
17
- import '../Button/Button.Skeleton.js';
18
- import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
19
- import { useInteractiveChildrenNeedDescription, useNoInteractiveChildren } from '../../internal/useNoInteractiveChildren.js';
20
- import { Tab, Escape } from '../../internal/keyboard/keys.js';
21
- import { match, matches } from '../../internal/keyboard/match.js';
22
- import { usePrefix } from '../../internal/usePrefix.js';
23
- import { useId } from '../../internal/useId.js';
24
- import { noopFn } from '../../internal/noopFn.js';
25
- import { wrapFocusWithoutSentinels, wrapFocus } from '../../internal/wrapFocus.js';
26
- import { useFeatureFlag } from '../FeatureFlags/index.js';
27
- import { warning } from '../../internal/warning.js';
28
- import { deprecateValuesWithin } from '../../prop-types/deprecateValuesWithin.js';
8
+ import { usePrefix } from "../../internal/usePrefix.js";
9
+ import { Text } from "../Text/Text.js";
10
+ import { Escape, Tab } from "../../internal/keyboard/keys.js";
11
+ import { match, matches } from "../../internal/keyboard/match.js";
12
+ import useIsomorphicEffect from "../../internal/useIsomorphicEffect.js";
13
+ import { useId } from "../../internal/useId.js";
14
+ import { noopFn } from "../../internal/noopFn.js";
15
+ import { warning } from "../../internal/warning.js";
16
+ import { deprecate } from "../../prop-types/deprecate.js";
17
+ import { deprecateValuesWithin } from "../../prop-types/deprecateValuesWithin.js";
18
+ import { useFeatureFlag } from "../FeatureFlags/index.js";
19
+ import { useInteractiveChildrenNeedDescription, useNoInteractiveChildren } from "../../internal/useNoInteractiveChildren.js";
20
+ import Button_default from "../Button/index.js";
21
+ import { wrapFocus, wrapFocusWithoutSentinels } from "../../internal/wrapFocus.js";
22
+ import classNames from "classnames";
23
+ import React, { useEffect, useRef, useState } from "react";
24
+ import PropTypes from "prop-types";
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ import { CheckmarkFilled, Close, ErrorFilled, InformationFilled, InformationSquareFilled, WarningAltFilled, WarningFilled } from "@carbon/icons-react";
29
27
 
28
+ //#region src/components/Notification/Notification.tsx
30
29
  /**
31
- * Conditionally call a callback when the escape key is pressed
32
- * @param {node} ref - ref of the container element to scope the functionality to
33
- * @param {func} callback - function to be called
34
- * @param {bool} override - escape hatch to conditionally call the callback
35
- */
30
+ * Copyright IBM Corp. 2016, 2026
31
+ *
32
+ * This source code is licensed under the Apache-2.0 license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */
35
+ /**
36
+ * Conditionally call a callback when the escape key is pressed
37
+ * @param {node} ref - ref of the container element to scope the functionality to
38
+ * @param {func} callback - function to be called
39
+ * @param {bool} override - escape hatch to conditionally call the callback
40
+ */
36
41
  function useEscapeToClose(ref, callback, override = true) {
37
- const handleKeyDown = event => {
38
- // The callback should only be called when focus is on or within the container
39
- const elementContainsFocus = ref.current && document.activeElement === ref.current || ref.current?.contains(document.activeElement);
40
- if (matches(event, [Escape]) && override && elementContainsFocus) {
41
- callback(event);
42
- }
43
- };
44
- useIsomorphicEffect(() => {
45
- if (ref.current !== null) {
46
- document.addEventListener('keydown', handleKeyDown, false);
47
- }
48
- return () => document.removeEventListener('keydown', handleKeyDown, false);
49
- });
42
+ const handleKeyDown = (event) => {
43
+ const elementContainsFocus = ref.current && document.activeElement === ref.current || ref.current?.contains(document.activeElement);
44
+ if (matches(event, [Escape]) && override && elementContainsFocus) callback(event);
45
+ };
46
+ useIsomorphicEffect(() => {
47
+ if (ref.current !== null) document.addEventListener("keydown", handleKeyDown, false);
48
+ return () => document.removeEventListener("keydown", handleKeyDown, false);
49
+ });
50
50
  }
51
- function NotificationActionButton({
52
- children,
53
- className: customClassName,
54
- onClick,
55
- inline,
56
- ...rest
57
- }) {
58
- const prefix = usePrefix();
59
- const className = cx(customClassName, {
60
- [`${prefix}--actionable-notification__action-button`]: true
61
- });
62
- return /*#__PURE__*/React.createElement(Button, _extends({
63
- className: className,
64
- kind: inline ? 'ghost' : 'tertiary',
65
- onClick: onClick,
66
- size: "sm"
67
- }, rest), children);
51
+ function NotificationActionButton({ children, className: customClassName, onClick, inline, ...rest }) {
52
+ return /* @__PURE__ */ jsx(Button_default, {
53
+ className: classNames(customClassName, { [`${usePrefix()}--actionable-notification__action-button`]: true }),
54
+ kind: inline ? "ghost" : "tertiary",
55
+ onClick,
56
+ size: "sm",
57
+ ...rest,
58
+ children
59
+ });
68
60
  }
69
61
  NotificationActionButton.propTypes = {
70
- /**
71
- * Specify the content of the notification action button.
72
- */
73
- children: PropTypes.node,
74
- /**
75
- * Specify an optional className to be applied to the notification action button
76
- */
77
- className: PropTypes.string,
78
- /**
79
- * Specify if the visual treatment of the button should be for an inline notification
80
- */
81
- inline: PropTypes.bool,
82
- /**
83
- * Optionally specify a click handler for the notification action button.
84
- */
85
- onClick: PropTypes.func
62
+ children: PropTypes.node,
63
+ className: PropTypes.string,
64
+ inline: PropTypes.bool,
65
+ onClick: PropTypes.func
86
66
  };
87
-
88
- /**
89
- * NotificationButton
90
- * ==================
91
- */
92
-
93
- function NotificationButton({
94
- 'aria-label': ariaLabel = 'close notification',
95
- ariaLabel: deprecatedAriaLabel,
96
- className,
97
- type = 'button',
98
- renderIcon: IconTag = Close,
99
- name,
100
- notificationType = 'toast',
101
- ...rest
102
- }) {
103
- const prefix = usePrefix();
104
- const buttonClassName = cx(className, {
105
- [`${prefix}--${notificationType}-notification__close-button`]: notificationType
106
- });
107
- const iconClassName = cx({
108
- [`${prefix}--${notificationType}-notification__close-icon`]: notificationType
109
- });
110
- return /*#__PURE__*/React.createElement("button", _extends({}, rest, {
111
- type: type,
112
- "aria-label": deprecatedAriaLabel || ariaLabel,
113
- title: deprecatedAriaLabel || ariaLabel,
114
- className: buttonClassName
115
- }), IconTag && /*#__PURE__*/React.createElement(IconTag, {
116
- className: iconClassName,
117
- name: name
118
- }));
67
+ function NotificationButton({ "aria-label": ariaLabel = "close notification", ariaLabel: deprecatedAriaLabel, className, type = "button", renderIcon: IconTag = Close, name, notificationType = "toast", ...rest }) {
68
+ const prefix = usePrefix();
69
+ const buttonClassName = classNames(className, { [`${prefix}--${notificationType}-notification__close-button`]: notificationType });
70
+ const iconClassName = classNames({ [`${prefix}--${notificationType}-notification__close-icon`]: notificationType });
71
+ return /* @__PURE__ */ jsx("button", {
72
+ ...rest,
73
+ type,
74
+ "aria-label": deprecatedAriaLabel || ariaLabel,
75
+ title: deprecatedAriaLabel || ariaLabel,
76
+ className: buttonClassName,
77
+ children: IconTag && /* @__PURE__ */ jsx(IconTag, {
78
+ className: iconClassName,
79
+ name
80
+ })
81
+ });
119
82
  }
120
83
  NotificationButton.propTypes = {
121
- /**
122
- * Specify a label to be read by screen readers on the container node
123
- */
124
- ['aria-label']: PropTypes.string,
125
- /**
126
- * Deprecated, please use `aria-label` instead.
127
- * Specify a label to be read by screen readers on the container note.
128
- */
129
- ariaLabel: deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
130
- /**
131
- * Specify an optional className to be applied to the notification button
132
- */
133
- className: PropTypes.string,
134
- /**
135
- * Specify an optional icon for the Button through a string,
136
- * if something but regular "close" icon is desirable
137
- */
138
- name: PropTypes.string,
139
- /**
140
- * Specify the notification type
141
- */
142
- notificationType: PropTypes.oneOf(['toast', 'inline', 'actionable']),
143
- /**
144
- * A component used to render an icon.
145
- */
146
- renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
147
- /**
148
- * Optional prop to specify the type of the Button
149
- */
150
- type: PropTypes.string
84
+ ["aria-label"]: PropTypes.string,
85
+ ariaLabel: deprecate(PropTypes.string, "This prop syntax has been deprecated. Please use the new `aria-label`."),
86
+ className: PropTypes.string,
87
+ name: PropTypes.string,
88
+ notificationType: PropTypes.oneOf([
89
+ "toast",
90
+ "inline",
91
+ "actionable"
92
+ ]),
93
+ renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
94
+ type: PropTypes.string
151
95
  };
152
-
153
96
  /**
154
- * NotificationIcon
155
- * ================
156
- */
157
-
97
+ * NotificationIcon
98
+ * ================
99
+ */
158
100
  const iconTypes = {
159
- error: ErrorFilled,
160
- success: CheckmarkFilled,
161
- warning: WarningFilled,
162
- ['warning-alt']: WarningAltFilled,
163
- info: InformationFilled,
164
- ['info-square']: InformationSquareFilled
101
+ error: ErrorFilled,
102
+ success: CheckmarkFilled,
103
+ warning: WarningFilled,
104
+ ["warning-alt"]: WarningAltFilled,
105
+ info: InformationFilled,
106
+ ["info-square"]: InformationSquareFilled
165
107
  };
166
- function NotificationIcon({
167
- iconDescription,
168
- kind,
169
- notificationType
170
- }) {
171
- const prefix = usePrefix();
172
- const IconForKind = iconTypes[kind];
173
- if (!IconForKind) {
174
- return null;
175
- }
176
- return /*#__PURE__*/React.createElement(IconForKind, {
177
- className: `${prefix}--${notificationType}-notification__icon`,
178
- size: 20
179
- }, /*#__PURE__*/React.createElement("title", null, iconDescription));
108
+ function NotificationIcon({ iconDescription, kind, notificationType }) {
109
+ const prefix = usePrefix();
110
+ const IconForKind = iconTypes[kind];
111
+ if (!IconForKind) return null;
112
+ return /* @__PURE__ */ jsx(IconForKind, {
113
+ className: `${prefix}--${notificationType}-notification__icon`,
114
+ size: 20,
115
+ children: /* @__PURE__ */ jsx("title", { children: iconDescription })
116
+ });
180
117
  }
181
118
  NotificationIcon.propTypes = {
182
- iconDescription: PropTypes.string.isRequired,
183
- kind: PropTypes.oneOf(['error', 'success', 'warning', 'warning-alt', 'info', 'info-square']).isRequired,
184
- notificationType: PropTypes.oneOf(['inline', 'toast']).isRequired
119
+ iconDescription: PropTypes.string.isRequired,
120
+ kind: PropTypes.oneOf([
121
+ "error",
122
+ "success",
123
+ "warning",
124
+ "warning-alt",
125
+ "info",
126
+ "info-square"
127
+ ]).isRequired,
128
+ notificationType: PropTypes.oneOf(["inline", "toast"]).isRequired
185
129
  };
186
-
187
- /**
188
- * ToastNotification
189
- * =================
190
- */
191
-
192
- function ToastNotification({
193
- ['aria-label']: ariaLabel,
194
- // @ts-expect-error: deprecated prop
195
- ariaLabel: deprecatedAriaLabel,
196
- role = 'status',
197
- onClose,
198
- onCloseButtonClick = noopFn,
199
- statusIconDescription,
200
- className,
201
- children,
202
- kind = 'error',
203
- lowContrast,
204
- hideCloseButton = false,
205
- timeout = 0,
206
- title,
207
- caption,
208
- subtitle,
209
- ...rest
210
- }) {
211
- const [isOpen, setIsOpen] = useState(true);
212
- const prefix = usePrefix();
213
- const containerClassName = cx(className, {
214
- [`${prefix}--toast-notification`]: true,
215
- [`${prefix}--toast-notification--low-contrast`]: lowContrast,
216
- [`${prefix}--toast-notification--${kind}`]: kind
217
- });
218
- const contentRef = useRef(null);
219
- useNoInteractiveChildren(contentRef);
220
- const handleClose = evt => {
221
- if (!onClose || onClose(evt) !== false) {
222
- setIsOpen(false);
223
- }
224
- };
225
- const ref = useRef(null);
226
- function handleCloseButtonClick(event) {
227
- onCloseButtonClick(event);
228
- handleClose(event);
229
- }
230
- const savedOnClose = useRef(onClose);
231
- useEffect(() => {
232
- savedOnClose.current = onClose;
233
- });
234
- useEffect(() => {
235
- if (!timeout) {
236
- return;
237
- }
238
- const timeoutId = window.setTimeout(event => {
239
- setIsOpen(false);
240
- if (savedOnClose.current) {
241
- savedOnClose.current(event);
242
- }
243
- }, timeout);
244
- return () => {
245
- window.clearTimeout(timeoutId);
246
- };
247
- }, [timeout]);
248
- if (!isOpen) {
249
- return null;
250
- }
251
- return /*#__PURE__*/React.createElement("div", _extends({
252
- ref: ref
253
- }, rest, {
254
- role: role,
255
- className: containerClassName
256
- }), /*#__PURE__*/React.createElement(NotificationIcon, {
257
- notificationType: "toast",
258
- kind: kind,
259
- iconDescription: statusIconDescription || `${kind} icon`
260
- }), /*#__PURE__*/React.createElement("div", {
261
- ref: contentRef,
262
- className: `${prefix}--toast-notification__details`
263
- }, title && /*#__PURE__*/React.createElement(Text, {
264
- as: "div",
265
- className: `${prefix}--toast-notification__title`
266
- }, title), subtitle && /*#__PURE__*/React.createElement(Text, {
267
- as: "div",
268
- className: `${prefix}--toast-notification__subtitle`
269
- }, subtitle), caption && /*#__PURE__*/React.createElement(Text, {
270
- as: "div",
271
- className: `${prefix}--toast-notification__caption`
272
- }, caption), children), !hideCloseButton && /*#__PURE__*/React.createElement(NotificationButton, {
273
- notificationType: "toast",
274
- onClick: handleCloseButtonClick,
275
- "aria-label": deprecatedAriaLabel || ariaLabel
276
- }));
130
+ function ToastNotification({ ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, role = "status", onClose, onCloseButtonClick = noopFn, statusIconDescription, className, children, kind = "error", lowContrast, hideCloseButton = false, timeout = 0, title, caption, subtitle, ...rest }) {
131
+ const [isOpen, setIsOpen] = useState(true);
132
+ const prefix = usePrefix();
133
+ const containerClassName = classNames(className, {
134
+ [`${prefix}--toast-notification`]: true,
135
+ [`${prefix}--toast-notification--low-contrast`]: lowContrast,
136
+ [`${prefix}--toast-notification--${kind}`]: kind
137
+ });
138
+ const contentRef = useRef(null);
139
+ useNoInteractiveChildren(contentRef);
140
+ const handleClose = (evt) => {
141
+ if (!onClose || onClose(evt) !== false) setIsOpen(false);
142
+ };
143
+ const ref = useRef(null);
144
+ function handleCloseButtonClick(event) {
145
+ onCloseButtonClick(event);
146
+ handleClose(event);
147
+ }
148
+ const savedOnClose = useRef(onClose);
149
+ useEffect(() => {
150
+ savedOnClose.current = onClose;
151
+ });
152
+ useEffect(() => {
153
+ if (!timeout) return;
154
+ const timeoutId = window.setTimeout((event) => {
155
+ setIsOpen(false);
156
+ if (savedOnClose.current) savedOnClose.current(event);
157
+ }, timeout);
158
+ return () => {
159
+ window.clearTimeout(timeoutId);
160
+ };
161
+ }, [timeout]);
162
+ if (!isOpen) return null;
163
+ return /* @__PURE__ */ jsxs("div", {
164
+ ref,
165
+ ...rest,
166
+ role,
167
+ className: containerClassName,
168
+ children: [
169
+ /* @__PURE__ */ jsx(NotificationIcon, {
170
+ notificationType: "toast",
171
+ kind,
172
+ iconDescription: statusIconDescription || `${kind} icon`
173
+ }),
174
+ /* @__PURE__ */ jsxs("div", {
175
+ ref: contentRef,
176
+ className: `${prefix}--toast-notification__details`,
177
+ children: [
178
+ title && /* @__PURE__ */ jsx(Text, {
179
+ as: "div",
180
+ className: `${prefix}--toast-notification__title`,
181
+ children: title
182
+ }),
183
+ subtitle && /* @__PURE__ */ jsx(Text, {
184
+ as: "div",
185
+ className: `${prefix}--toast-notification__subtitle`,
186
+ children: subtitle
187
+ }),
188
+ caption && /* @__PURE__ */ jsx(Text, {
189
+ as: "div",
190
+ className: `${prefix}--toast-notification__caption`,
191
+ children: caption
192
+ }),
193
+ children
194
+ ]
195
+ }),
196
+ !hideCloseButton && /* @__PURE__ */ jsx(NotificationButton, {
197
+ notificationType: "toast",
198
+ onClick: handleCloseButtonClick,
199
+ "aria-label": deprecatedAriaLabel || ariaLabel
200
+ })
201
+ ]
202
+ });
277
203
  }
278
204
  ToastNotification.propTypes = {
279
- /**
280
- * Provide a description for "close" icon button that can be read by screen readers
281
- */
282
- ['aria-label']: PropTypes.string,
283
- /**
284
- * Deprecated, please use `aria-label` instead.
285
- * Provide a description for "close" icon button that can be read by screen readers
286
- */
287
- ariaLabel: deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
288
- /**
289
- * Specify the caption
290
- */
291
- caption: PropTypes.string,
292
- /**
293
- * Specify the content
294
- */
295
- children: PropTypes.node,
296
- /**
297
- * Specify an optional className to be applied to the notification box
298
- */
299
- className: PropTypes.string,
300
- /**
301
- * Specify the close button should be disabled, or not
302
- */
303
- hideCloseButton: PropTypes.bool,
304
- /**
305
- * Specify what state the notification represents
306
- */
307
- kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
308
- /**
309
- * Specify whether you are using the low contrast variant of the ToastNotification.
310
- */
311
- lowContrast: PropTypes.bool,
312
- /**
313
- * Provide a function that is called when menu is closed
314
- */
315
- onClose: PropTypes.func,
316
- /**
317
- * Provide a function that is called when the close button is clicked
318
- */
319
- onCloseButtonClick: PropTypes.func,
320
- /**
321
- * By default, this value is "status". You can also provide an alternate
322
- * role if it makes sense from the accessibility-side
323
- */
324
- role: PropTypes.oneOf(['alert', 'log', 'status']),
325
- /**
326
- * Provide a description for "status" icon that can be read by screen readers
327
- */
328
- statusIconDescription: PropTypes.string,
329
- /**
330
- * Specify the subtitle
331
- */
332
- subtitle: PropTypes.string,
333
- /**
334
- * Specify an optional duration the notification should be closed in
335
- */
336
- timeout: PropTypes.number,
337
- /**
338
- * Specify the title
339
- */
340
- title: PropTypes.string
205
+ ["aria-label"]: PropTypes.string,
206
+ ariaLabel: deprecate(PropTypes.string, "This prop syntax has been deprecated. Please use the new `aria-label`."),
207
+ caption: PropTypes.string,
208
+ children: PropTypes.node,
209
+ className: PropTypes.string,
210
+ hideCloseButton: PropTypes.bool,
211
+ kind: PropTypes.oneOf([
212
+ "error",
213
+ "info",
214
+ "info-square",
215
+ "success",
216
+ "warning",
217
+ "warning-alt"
218
+ ]),
219
+ lowContrast: PropTypes.bool,
220
+ onClose: PropTypes.func,
221
+ onCloseButtonClick: PropTypes.func,
222
+ role: PropTypes.oneOf([
223
+ "alert",
224
+ "log",
225
+ "status"
226
+ ]),
227
+ statusIconDescription: PropTypes.string,
228
+ subtitle: PropTypes.string,
229
+ timeout: PropTypes.number,
230
+ title: PropTypes.string
341
231
  };
342
-
343
- /**
344
- * InlineNotification
345
- * ==================
346
- */
347
-
348
- function InlineNotification({
349
- ['aria-label']: ariaLabel,
350
- children,
351
- title,
352
- subtitle,
353
- role = 'status',
354
- onClose,
355
- onCloseButtonClick = noopFn,
356
- statusIconDescription,
357
- className,
358
- kind = 'error',
359
- lowContrast,
360
- hideCloseButton = false,
361
- ...rest
362
- }) {
363
- const [isOpen, setIsOpen] = useState(true);
364
- const prefix = usePrefix();
365
- const containerClassName = cx(className, {
366
- [`${prefix}--inline-notification`]: true,
367
- [`${prefix}--inline-notification--low-contrast`]: lowContrast,
368
- [`${prefix}--inline-notification--${kind}`]: kind,
369
- [`${prefix}--inline-notification--hide-close-button`]: hideCloseButton
370
- });
371
- const contentRef = useRef(null);
372
- useNoInteractiveChildren(contentRef);
373
- const handleClose = evt => {
374
- if (!onClose || onClose(evt) !== false) {
375
- setIsOpen(false);
376
- }
377
- };
378
- const ref = useRef(null);
379
- function handleCloseButtonClick(event) {
380
- onCloseButtonClick(event);
381
- handleClose(event);
382
- }
383
- if (!isOpen) {
384
- return null;
385
- }
386
- return /*#__PURE__*/React.createElement("div", _extends({
387
- ref: ref
388
- }, rest, {
389
- role: role,
390
- className: containerClassName
391
- }), /*#__PURE__*/React.createElement("div", {
392
- className: `${prefix}--inline-notification__details`
393
- }, /*#__PURE__*/React.createElement(NotificationIcon, {
394
- notificationType: "inline",
395
- kind: kind,
396
- iconDescription: statusIconDescription || `${kind} icon`
397
- }), /*#__PURE__*/React.createElement("div", {
398
- ref: contentRef,
399
- className: `${prefix}--inline-notification__text-wrapper`
400
- }, title && /*#__PURE__*/React.createElement(Text, {
401
- as: "div",
402
- className: `${prefix}--inline-notification__title`
403
- }, title), subtitle && /*#__PURE__*/React.createElement(Text, {
404
- as: "div",
405
- className: `${prefix}--inline-notification__subtitle`
406
- }, subtitle), children)), !hideCloseButton && /*#__PURE__*/React.createElement(NotificationButton, {
407
- notificationType: "inline",
408
- onClick: handleCloseButtonClick,
409
- "aria-label": ariaLabel
410
- }));
232
+ function InlineNotification({ ["aria-label"]: ariaLabel, children, title, subtitle, role = "status", onClose, onCloseButtonClick = noopFn, statusIconDescription, className, kind = "error", lowContrast, hideCloseButton = false, ...rest }) {
233
+ const [isOpen, setIsOpen] = useState(true);
234
+ const prefix = usePrefix();
235
+ const containerClassName = classNames(className, {
236
+ [`${prefix}--inline-notification`]: true,
237
+ [`${prefix}--inline-notification--low-contrast`]: lowContrast,
238
+ [`${prefix}--inline-notification--${kind}`]: kind,
239
+ [`${prefix}--inline-notification--hide-close-button`]: hideCloseButton
240
+ });
241
+ const contentRef = useRef(null);
242
+ useNoInteractiveChildren(contentRef);
243
+ const handleClose = (evt) => {
244
+ if (!onClose || onClose(evt) !== false) setIsOpen(false);
245
+ };
246
+ const ref = useRef(null);
247
+ function handleCloseButtonClick(event) {
248
+ onCloseButtonClick(event);
249
+ handleClose(event);
250
+ }
251
+ if (!isOpen) return null;
252
+ return /* @__PURE__ */ jsxs("div", {
253
+ ref,
254
+ ...rest,
255
+ role,
256
+ className: containerClassName,
257
+ children: [/* @__PURE__ */ jsxs("div", {
258
+ className: `${prefix}--inline-notification__details`,
259
+ children: [/* @__PURE__ */ jsx(NotificationIcon, {
260
+ notificationType: "inline",
261
+ kind,
262
+ iconDescription: statusIconDescription || `${kind} icon`
263
+ }), /* @__PURE__ */ jsxs("div", {
264
+ ref: contentRef,
265
+ className: `${prefix}--inline-notification__text-wrapper`,
266
+ children: [
267
+ title && /* @__PURE__ */ jsx(Text, {
268
+ as: "div",
269
+ className: `${prefix}--inline-notification__title`,
270
+ children: title
271
+ }),
272
+ subtitle && /* @__PURE__ */ jsx(Text, {
273
+ as: "div",
274
+ className: `${prefix}--inline-notification__subtitle`,
275
+ children: subtitle
276
+ }),
277
+ children
278
+ ]
279
+ })]
280
+ }), !hideCloseButton && /* @__PURE__ */ jsx(NotificationButton, {
281
+ notificationType: "inline",
282
+ onClick: handleCloseButtonClick,
283
+ "aria-label": ariaLabel
284
+ })]
285
+ });
411
286
  }
412
287
  InlineNotification.propTypes = {
413
- /**
414
- * Provide a description for "close" icon button that can be read by screen readers
415
- */
416
- ['aria-label']: PropTypes.string,
417
- /**
418
- * Specify the content
419
- */
420
- children: PropTypes.node,
421
- /**
422
- * Specify an optional className to be applied to the notification box
423
- */
424
- className: PropTypes.string,
425
- /**
426
- * Specify the close button should be disabled, or not
427
- */
428
- hideCloseButton: PropTypes.bool,
429
- /**
430
- * Specify what state the notification represents
431
- */
432
- kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
433
- /**
434
- * Specify whether you are using the low contrast variant of the InlineNotification.
435
- */
436
- lowContrast: PropTypes.bool,
437
- /**
438
- * Provide a function that is called when menu is closed
439
- */
440
- onClose: PropTypes.func,
441
- /**
442
- * Provide a function that is called when the close button is clicked
443
- */
444
- onCloseButtonClick: PropTypes.func,
445
- /**
446
- * By default, this value is "status". You can also provide an alternate
447
- * role if it makes sense from the accessibility-side.
448
- */
449
- role: PropTypes.oneOf(['alert', 'log', 'status']),
450
- /**
451
- * Provide a description for "status" icon that can be read by screen readers
452
- */
453
- statusIconDescription: PropTypes.string,
454
- /**
455
- * Specify the subtitle
456
- */
457
- subtitle: PropTypes.string,
458
- /**
459
- * Specify the title
460
- */
461
- title: PropTypes.string
288
+ ["aria-label"]: PropTypes.string,
289
+ children: PropTypes.node,
290
+ className: PropTypes.string,
291
+ hideCloseButton: PropTypes.bool,
292
+ kind: PropTypes.oneOf([
293
+ "error",
294
+ "info",
295
+ "info-square",
296
+ "success",
297
+ "warning",
298
+ "warning-alt"
299
+ ]),
300
+ lowContrast: PropTypes.bool,
301
+ onClose: PropTypes.func,
302
+ onCloseButtonClick: PropTypes.func,
303
+ role: PropTypes.oneOf([
304
+ "alert",
305
+ "log",
306
+ "status"
307
+ ]),
308
+ statusIconDescription: PropTypes.string,
309
+ subtitle: PropTypes.string,
310
+ title: PropTypes.string
462
311
  };
463
-
464
- /**
465
- * ActionableNotification
466
- * ======================
467
- */
468
-
469
- function ActionableNotification({
470
- actionButtonLabel,
471
- ['aria-label']: ariaLabel,
472
- // @ts-expect-error: deprecated prop
473
- ariaLabel: deprecatedAriaLabel,
474
- caption,
475
- children,
476
- role = 'alertdialog',
477
- onActionButtonClick,
478
- onClose,
479
- onCloseButtonClick = noopFn,
480
- statusIconDescription,
481
- className,
482
- inline = false,
483
- kind = 'error',
484
- lowContrast,
485
- hideCloseButton = false,
486
- hasFocus = true,
487
- closeOnEscape = true,
488
- title,
489
- subtitle,
490
- ...rest
491
- }) {
492
- const [isOpen, setIsOpen] = useState(true);
493
- const prefix = usePrefix();
494
- const id = useId('actionable-notification');
495
- const subtitleId = useId('actionable-notification-subtitle');
496
- const containerClassName = cx(className, {
497
- [`${prefix}--actionable-notification`]: true,
498
- [`${prefix}--actionable-notification--toast`]: !inline,
499
- [`${prefix}--actionable-notification--low-contrast`]: lowContrast,
500
- [`${prefix}--actionable-notification--${kind}`]: kind,
501
- [`${prefix}--actionable-notification--hide-close-button`]: hideCloseButton
502
- });
503
- const innerModal = useRef(null);
504
- const startTrap = useRef(null);
505
- const endTrap = useRef(null);
506
- const ref = useRef(null);
507
- const deprecatedFlag = useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
508
- const focusTrapWithoutSentinelsFlag = useFeatureFlag('enable-focus-wrap-without-sentinels');
509
- const focusTrapWithoutSentinels = focusTrapWithoutSentinelsFlag || deprecatedFlag;
510
- useIsomorphicEffect(() => {
511
- if (hasFocus && role === 'alertdialog') {
512
- const button = document.querySelector(`button.${prefix}--actionable-notification__action-button`);
513
- button?.focus();
514
- }
515
- });
516
- function handleBlur({
517
- target: oldActiveNode,
518
- relatedTarget: currentActiveNode
519
- }) {
520
- if (isOpen && currentActiveNode && oldActiveNode && role === 'alertdialog') {
521
- const {
522
- current: bodyNode
523
- } = innerModal;
524
- const {
525
- current: startTrapNode
526
- } = startTrap;
527
- const {
528
- current: endTrapNode
529
- } = endTrap;
530
- wrapFocus({
531
- bodyNode,
532
- startTrapNode,
533
- endTrapNode,
534
- currentActiveNode,
535
- oldActiveNode,
536
- prefix
537
- });
538
- }
539
- }
540
- function handleKeyDown(event) {
541
- if (isOpen && match(event, Tab) && ref.current && role === 'alertdialog') {
542
- wrapFocusWithoutSentinels({
543
- containerNode: ref.current,
544
- currentActiveNode: event.target,
545
- event
546
- });
547
- }
548
- }
549
- const handleClose = evt => {
550
- if (!onClose || onClose(evt) !== false) {
551
- setIsOpen(false);
552
- }
553
- };
554
- useEscapeToClose(ref, handleCloseButtonClick, closeOnEscape);
555
- function handleCloseButtonClick(event) {
556
- onCloseButtonClick(event);
557
- handleClose(event);
558
- }
559
- if (!isOpen) {
560
- return null;
561
- }
562
- return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
563
- ref: ref,
564
- role: role,
565
- className: containerClassName,
566
- "aria-labelledby": title ? id : subtitleId,
567
- onBlur: !focusTrapWithoutSentinels ? handleBlur : () => {},
568
- onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : () => {}
569
- }), !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
570
- ref: startTrap,
571
- tabIndex: 0,
572
- role: "link",
573
- className: `${prefix}--visually-hidden`
574
- }, "Focus sentinel"), /*#__PURE__*/React.createElement("div", {
575
- ref: innerModal,
576
- className: `${prefix}--actionable-notification__focus-wrapper`
577
- }, /*#__PURE__*/React.createElement("div", {
578
- className: `${prefix}--actionable-notification__details`
579
- }, /*#__PURE__*/React.createElement(NotificationIcon, {
580
- notificationType: inline ? 'inline' : 'toast',
581
- kind: kind,
582
- iconDescription: statusIconDescription || `${kind} icon`
583
- }), /*#__PURE__*/React.createElement("div", {
584
- className: `${prefix}--actionable-notification__text-wrapper`
585
- }, /*#__PURE__*/React.createElement("div", {
586
- className: `${prefix}--actionable-notification__content`
587
- }, title && /*#__PURE__*/React.createElement(Text, {
588
- as: "div",
589
- className: `${prefix}--actionable-notification__title`,
590
- id: id
591
- }, title), subtitle && /*#__PURE__*/React.createElement(Text, {
592
- as: "div",
593
- className: `${prefix}--actionable-notification__subtitle`,
594
- id: subtitleId
595
- }, subtitle), caption && /*#__PURE__*/React.createElement(Text, {
596
- as: "div",
597
- className: `${prefix}--actionable-notification__caption`
598
- }, caption), children))), /*#__PURE__*/React.createElement("div", {
599
- className: `${prefix}--actionable-notification__button-wrapper`
600
- }, actionButtonLabel && /*#__PURE__*/React.createElement(NotificationActionButton, {
601
- onClick: onActionButtonClick,
602
- inline: inline
603
- }, actionButtonLabel), !hideCloseButton && /*#__PURE__*/React.createElement(NotificationButton, {
604
- "aria-label": deprecatedAriaLabel || ariaLabel,
605
- notificationType: "actionable",
606
- onClick: handleCloseButtonClick
607
- }))), !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
608
- ref: endTrap,
609
- tabIndex: 0,
610
- role: "link",
611
- className: `${prefix}--visually-hidden`
612
- }, "Focus sentinel"));
312
+ function ActionableNotification({ actionButtonLabel, ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, caption, children, role = "alertdialog", onActionButtonClick, onClose, onCloseButtonClick = noopFn, statusIconDescription, className, inline = false, kind = "error", lowContrast, hideCloseButton = false, hasFocus = true, closeOnEscape = true, title, subtitle, ...rest }) {
313
+ const [isOpen, setIsOpen] = useState(true);
314
+ const prefix = usePrefix();
315
+ const id = useId("actionable-notification");
316
+ const subtitleId = useId("actionable-notification-subtitle");
317
+ const containerClassName = classNames(className, {
318
+ [`${prefix}--actionable-notification`]: true,
319
+ [`${prefix}--actionable-notification--toast`]: !inline,
320
+ [`${prefix}--actionable-notification--low-contrast`]: lowContrast,
321
+ [`${prefix}--actionable-notification--${kind}`]: kind,
322
+ [`${prefix}--actionable-notification--hide-close-button`]: hideCloseButton
323
+ });
324
+ const innerModal = useRef(null);
325
+ const startTrap = useRef(null);
326
+ const endTrap = useRef(null);
327
+ const ref = useRef(null);
328
+ const deprecatedFlag = useFeatureFlag("enable-experimental-focus-wrap-without-sentinels");
329
+ const focusTrapWithoutSentinels = useFeatureFlag("enable-focus-wrap-without-sentinels") || deprecatedFlag;
330
+ useIsomorphicEffect(() => {
331
+ if (hasFocus && role === "alertdialog") document.querySelector(`button.${prefix}--actionable-notification__action-button`)?.focus();
332
+ });
333
+ function handleBlur({ target: oldActiveNode, relatedTarget: currentActiveNode }) {
334
+ if (isOpen && currentActiveNode && oldActiveNode && role === "alertdialog") {
335
+ const { current: bodyNode } = innerModal;
336
+ const { current: startTrapNode } = startTrap;
337
+ const { current: endTrapNode } = endTrap;
338
+ wrapFocus({
339
+ bodyNode,
340
+ startTrapNode,
341
+ endTrapNode,
342
+ currentActiveNode,
343
+ oldActiveNode,
344
+ prefix
345
+ });
346
+ }
347
+ }
348
+ function handleKeyDown(event) {
349
+ if (isOpen && match(event, Tab) && ref.current && role === "alertdialog") wrapFocusWithoutSentinels({
350
+ containerNode: ref.current,
351
+ currentActiveNode: event.target,
352
+ event
353
+ });
354
+ }
355
+ const handleClose = (evt) => {
356
+ if (!onClose || onClose(evt) !== false) setIsOpen(false);
357
+ };
358
+ useEscapeToClose(ref, handleCloseButtonClick, closeOnEscape);
359
+ function handleCloseButtonClick(event) {
360
+ onCloseButtonClick(event);
361
+ handleClose(event);
362
+ }
363
+ if (!isOpen) return null;
364
+ return /* @__PURE__ */ jsxs("div", {
365
+ ...rest,
366
+ ref,
367
+ role,
368
+ className: containerClassName,
369
+ "aria-labelledby": title ? id : subtitleId,
370
+ onBlur: !focusTrapWithoutSentinels ? handleBlur : () => {},
371
+ onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : () => {},
372
+ children: [
373
+ !focusTrapWithoutSentinels && /* @__PURE__ */ jsx("span", {
374
+ ref: startTrap,
375
+ tabIndex: 0,
376
+ role: "link",
377
+ className: `${prefix}--visually-hidden`,
378
+ children: "Focus sentinel"
379
+ }),
380
+ /* @__PURE__ */ jsxs("div", {
381
+ ref: innerModal,
382
+ className: `${prefix}--actionable-notification__focus-wrapper`,
383
+ children: [/* @__PURE__ */ jsxs("div", {
384
+ className: `${prefix}--actionable-notification__details`,
385
+ children: [/* @__PURE__ */ jsx(NotificationIcon, {
386
+ notificationType: inline ? "inline" : "toast",
387
+ kind,
388
+ iconDescription: statusIconDescription || `${kind} icon`
389
+ }), /* @__PURE__ */ jsx("div", {
390
+ className: `${prefix}--actionable-notification__text-wrapper`,
391
+ children: /* @__PURE__ */ jsxs("div", {
392
+ className: `${prefix}--actionable-notification__content`,
393
+ children: [
394
+ title && /* @__PURE__ */ jsx(Text, {
395
+ as: "div",
396
+ className: `${prefix}--actionable-notification__title`,
397
+ id,
398
+ children: title
399
+ }),
400
+ subtitle && /* @__PURE__ */ jsx(Text, {
401
+ as: "div",
402
+ className: `${prefix}--actionable-notification__subtitle`,
403
+ id: subtitleId,
404
+ children: subtitle
405
+ }),
406
+ caption && /* @__PURE__ */ jsx(Text, {
407
+ as: "div",
408
+ className: `${prefix}--actionable-notification__caption`,
409
+ children: caption
410
+ }),
411
+ children
412
+ ]
413
+ })
414
+ })]
415
+ }), /* @__PURE__ */ jsxs("div", {
416
+ className: `${prefix}--actionable-notification__button-wrapper`,
417
+ children: [actionButtonLabel && /* @__PURE__ */ jsx(NotificationActionButton, {
418
+ onClick: onActionButtonClick,
419
+ inline,
420
+ children: actionButtonLabel
421
+ }), !hideCloseButton && /* @__PURE__ */ jsx(NotificationButton, {
422
+ "aria-label": deprecatedAriaLabel || ariaLabel,
423
+ notificationType: "actionable",
424
+ onClick: handleCloseButtonClick
425
+ })]
426
+ })]
427
+ }),
428
+ !focusTrapWithoutSentinels && /* @__PURE__ */ jsx("span", {
429
+ ref: endTrap,
430
+ tabIndex: 0,
431
+ role: "link",
432
+ className: `${prefix}--visually-hidden`,
433
+ children: "Focus sentinel"
434
+ })
435
+ ]
436
+ });
613
437
  }
614
438
  ActionableNotification.propTypes = {
615
- /**
616
- * Pass in the action button label that will be rendered within the ActionableNotification.
617
- */
618
- actionButtonLabel: PropTypes.string,
619
- /**
620
- * Provide a description for "close" icon button that can be read by screen readers
621
- */
622
- ['aria-label']: PropTypes.string,
623
- /**
624
- * Deprecated, please use `aria-label` instead.
625
- * Provide a description for "close" icon button that can be read by screen readers
626
- */
627
- ariaLabel: deprecate(PropTypes.string, 'This prop syntax has been deprecated. Please use the new `aria-label`.'),
628
- /**
629
- * Specify the caption
630
- */
631
- caption: PropTypes.string,
632
- /**
633
- * Specify the content
634
- */
635
- children: PropTypes.node,
636
- /**
637
- * Specify an optional className to be applied to the notification box
638
- */
639
- className: PropTypes.string,
640
- /**
641
- * Specify if pressing the escape key should close notifications
642
- */
643
- closeOnEscape: PropTypes.bool,
644
- /**
645
- * Specify if focus should be moved to the component when the notification contains actions
646
- */
647
- hasFocus: deprecate(PropTypes.bool, 'hasFocus is deprecated. To conform to accessibility requirements hasFocus ' + 'should always be `true` for ActionableNotification. If you were ' + 'setting this prop to `false`, consider using the Callout component instead.'),
648
- /**
649
- * Specify the close button should be disabled, or not
650
- */
651
- hideCloseButton: PropTypes.bool,
652
- /*
653
- * Specify if the notification should have inline styling applied instead of toast
654
- */
655
- inline: PropTypes.bool,
656
- /**
657
- * Specify what state the notification represents
658
- */
659
- kind: PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
660
- /**
661
- * Specify whether you are using the low contrast variant of the ActionableNotification.
662
- */
663
- lowContrast: PropTypes.bool,
664
- /**
665
- * Provide a function that is called when the action is clicked
666
- */
667
- onActionButtonClick: PropTypes.func,
668
- /**
669
- * Provide a function that is called when menu is closed
670
- */
671
- onClose: PropTypes.func,
672
- /**
673
- * Provide a function that is called when the close button is clicked
674
- */
675
- onCloseButtonClick: PropTypes.func,
676
- /**
677
- * Provide an accessible role to be used. Defaults to `alertdialog`. Any other
678
- * value will disable the wrapping of focus. To remain accessible, additional
679
- * work is required. See the storybook docs for more info:
680
- * https://react.carbondesignsystem.com/?path=/docs/components-notifications-actionable--overview#using-the-role-prop
681
- */
682
- role: PropTypes.string,
683
- /**
684
- * Provide a description for "status" icon that can be read by screen readers
685
- */
686
- statusIconDescription: PropTypes.string,
687
- /**
688
- * Specify the subtitle
689
- */
690
- subtitle: PropTypes.node,
691
- /**
692
- * Specify the title
693
- */
694
- title: PropTypes.string
439
+ actionButtonLabel: PropTypes.string,
440
+ ["aria-label"]: PropTypes.string,
441
+ ariaLabel: deprecate(PropTypes.string, "This prop syntax has been deprecated. Please use the new `aria-label`."),
442
+ caption: PropTypes.string,
443
+ children: PropTypes.node,
444
+ className: PropTypes.string,
445
+ closeOnEscape: PropTypes.bool,
446
+ hasFocus: deprecate(PropTypes.bool, "hasFocus is deprecated. To conform to accessibility requirements hasFocus should always be `true` for ActionableNotification. If you were setting this prop to `false`, consider using the Callout component instead."),
447
+ hideCloseButton: PropTypes.bool,
448
+ inline: PropTypes.bool,
449
+ kind: PropTypes.oneOf([
450
+ "error",
451
+ "info",
452
+ "info-square",
453
+ "success",
454
+ "warning",
455
+ "warning-alt"
456
+ ]),
457
+ lowContrast: PropTypes.bool,
458
+ onActionButtonClick: PropTypes.func,
459
+ onClose: PropTypes.func,
460
+ onCloseButtonClick: PropTypes.func,
461
+ role: PropTypes.string,
462
+ statusIconDescription: PropTypes.string,
463
+ subtitle: PropTypes.node,
464
+ title: PropTypes.string
695
465
  };
696
-
697
- /**
698
- * Callout
699
- * ==================
700
- */
701
-
702
- /**
703
- * Deprecated callout kind values.
704
- * @deprecated Use NewKindProps instead.
705
- */
706
-
707
466
  const mapping = {
708
- error: 'warning',
709
- // only redirect error -> warning
710
- success: 'info' // only redirect success -> info
467
+ error: "warning",
468
+ success: "info"
711
469
  };
712
- const propMappingFunction = deprecatedValue => {
713
- return mapping[deprecatedValue];
470
+ const propMappingFunction = (deprecatedValue) => {
471
+ return mapping[deprecatedValue];
714
472
  };
715
- function Callout({
716
- actionButtonLabel,
717
- children,
718
- onActionButtonClick,
719
- title,
720
- titleId,
721
- subtitle,
722
- statusIconDescription,
723
- className,
724
- kind = 'info',
725
- lowContrast,
726
- ...rest
727
- }) {
728
- const prefix = usePrefix();
729
- const containerClassName = cx(className, {
730
- [`${prefix}--actionable-notification`]: true,
731
- [`${prefix}--actionable-notification--low-contrast`]: lowContrast,
732
- [`${prefix}--actionable-notification--${kind}`]: kind,
733
- [`${prefix}--actionable-notification--hide-close-button`]: true
734
- });
735
- const childrenContainer = useRef(null);
736
- useInteractiveChildrenNeedDescription(childrenContainer, `interactive child node(s) should have an \`aria-describedby\` property with a value matching the value of \`titleId\``);
737
- return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
738
- className: containerClassName
739
- }), /*#__PURE__*/React.createElement("div", {
740
- className: `${prefix}--actionable-notification__details`
741
- }, /*#__PURE__*/React.createElement(NotificationIcon, {
742
- notificationType: "inline",
743
- kind: kind,
744
- iconDescription: statusIconDescription || `${kind} icon`
745
- }), /*#__PURE__*/React.createElement("div", {
746
- ref: childrenContainer,
747
- className: `${prefix}--actionable-notification__text-wrapper`
748
- }, title && /*#__PURE__*/React.createElement(Text, {
749
- as: "div",
750
- id: titleId,
751
- className: `${prefix}--actionable-notification__title`
752
- }, title), subtitle && /*#__PURE__*/React.createElement(Text, {
753
- as: "div",
754
- className: `${prefix}--actionable-notification__subtitle`
755
- }, subtitle), children)), /*#__PURE__*/React.createElement("div", {
756
- className: `${prefix}--actionable-notification__button-wrapper`
757
- }, actionButtonLabel && /*#__PURE__*/React.createElement(NotificationActionButton, {
758
- onClick: onActionButtonClick,
759
- "aria-describedby": titleId,
760
- inline: true
761
- }, actionButtonLabel)));
473
+ function Callout({ actionButtonLabel, children, onActionButtonClick, title, titleId, subtitle, statusIconDescription, className, kind = "info", lowContrast, ...rest }) {
474
+ const prefix = usePrefix();
475
+ const containerClassName = classNames(className, {
476
+ [`${prefix}--actionable-notification`]: true,
477
+ [`${prefix}--actionable-notification--low-contrast`]: lowContrast,
478
+ [`${prefix}--actionable-notification--${kind}`]: kind,
479
+ [`${prefix}--actionable-notification--hide-close-button`]: true
480
+ });
481
+ const childrenContainer = useRef(null);
482
+ useInteractiveChildrenNeedDescription(childrenContainer, `interactive child node(s) should have an \`aria-describedby\` property with a value matching the value of \`titleId\``);
483
+ return /* @__PURE__ */ jsxs("div", {
484
+ ...rest,
485
+ className: containerClassName,
486
+ children: [/* @__PURE__ */ jsxs("div", {
487
+ className: `${prefix}--actionable-notification__details`,
488
+ children: [/* @__PURE__ */ jsx(NotificationIcon, {
489
+ notificationType: "inline",
490
+ kind,
491
+ iconDescription: statusIconDescription || `${kind} icon`
492
+ }), /* @__PURE__ */ jsxs("div", {
493
+ ref: childrenContainer,
494
+ className: `${prefix}--actionable-notification__text-wrapper`,
495
+ children: [
496
+ title && /* @__PURE__ */ jsx(Text, {
497
+ as: "div",
498
+ id: titleId,
499
+ className: `${prefix}--actionable-notification__title`,
500
+ children: title
501
+ }),
502
+ subtitle && /* @__PURE__ */ jsx(Text, {
503
+ as: "div",
504
+ className: `${prefix}--actionable-notification__subtitle`,
505
+ children: subtitle
506
+ }),
507
+ children
508
+ ]
509
+ })]
510
+ }), /* @__PURE__ */ jsx("div", {
511
+ className: `${prefix}--actionable-notification__button-wrapper`,
512
+ children: actionButtonLabel && /* @__PURE__ */ jsx(NotificationActionButton, {
513
+ onClick: onActionButtonClick,
514
+ "aria-describedby": titleId,
515
+ inline: true,
516
+ children: actionButtonLabel
517
+ })
518
+ })]
519
+ });
762
520
  }
763
521
  Callout.propTypes = {
764
- /**
765
- * Pass in the action button label that will be rendered within the ActionableNotification.
766
- */
767
- actionButtonLabel: PropTypes.string,
768
- /**
769
- * Specify the content
770
- */
771
- children: PropTypes.node,
772
- /**
773
- * Specify an optional className to be applied to the notification box
774
- */
775
- className: PropTypes.string,
776
- /**
777
- * Specify what state the notification represents
778
- */
779
- kind: deprecateValuesWithin(PropTypes.oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']), ['warning', 'info'], propMappingFunction),
780
- /**
781
- * Specify whether you are using the low contrast variant of the Callout.
782
- */
783
- lowContrast: PropTypes.bool,
784
- /**
785
- * Provide a function that is called when the action is clicked
786
- */
787
- onActionButtonClick: PropTypes.func,
788
- /**
789
- * Provide a description for "status" icon that can be read by screen readers
790
- */
791
- statusIconDescription: PropTypes.string,
792
- /**
793
- * Specify the subtitle
794
- */
795
- subtitle: PropTypes.node,
796
- /**
797
- * Specify the title
798
- */
799
- title: PropTypes.string,
800
- /**
801
- * Specify the id for the element containing the title
802
- */
803
- titleId: PropTypes.string
522
+ actionButtonLabel: PropTypes.string,
523
+ children: PropTypes.node,
524
+ className: PropTypes.string,
525
+ kind: deprecateValuesWithin(PropTypes.oneOf([
526
+ "error",
527
+ "info",
528
+ "info-square",
529
+ "success",
530
+ "warning",
531
+ "warning-alt"
532
+ ]), ["warning", "info"], propMappingFunction),
533
+ lowContrast: PropTypes.bool,
534
+ onActionButtonClick: PropTypes.func,
535
+ statusIconDescription: PropTypes.string,
536
+ subtitle: PropTypes.node,
537
+ title: PropTypes.string,
538
+ titleId: PropTypes.string
804
539
  };
805
-
806
- // In renaming StaticNotification to Callout, the legacy StaticNotification
807
- // export and it's types should remain usable until Callout is moved to stable.
808
- // The StaticNotification component below forwards props to Callout and inherits
809
- // CalloutProps to ensure consumer usage is not impacted, while providing them
810
- // a deprecation warning.
811
- // TODO: remove this when Callout moves to stable OR in v12, whichever is first
812
- /**
813
- * @deprecated Use `CalloutProps` instead.
814
- */
815
-
816
540
  let didWarnAboutDeprecation = false;
817
- const StaticNotification = props => {
818
- if (process.env.NODE_ENV !== 'production') {
819
- process.env.NODE_ENV !== "production" ? warning(didWarnAboutDeprecation, '`StaticNotification` has been renamed to `Callout`.' + 'Run the following codemod to automatically update usages in your' + 'project: `npx @carbon/upgrade migrate refactor-to-callout --write`') : void 0;
820
- didWarnAboutDeprecation = true;
821
- }
822
- return /*#__PURE__*/React.createElement(Callout, props);
541
+ const StaticNotification = (props) => {
542
+ warning(didWarnAboutDeprecation, "`StaticNotification` has been renamed to `Callout`.Run the following codemod to automatically update usages in yourproject: `npx @carbon/upgrade migrate refactor-to-callout --write`");
543
+ didWarnAboutDeprecation = true;
544
+ return /* @__PURE__ */ jsx(Callout, { ...props });
823
545
  };
824
546
 
825
- export { ActionableNotification, Callout, InlineNotification, NotificationActionButton, NotificationButton, StaticNotification, ToastNotification };
547
+ //#endregion
548
+ export { ActionableNotification, Callout, InlineNotification, NotificationActionButton, NotificationButton, StaticNotification, ToastNotification };