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