@carbon/react 1.86.0 → 1.87.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 (506) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +871 -871
  2. package/es/_virtual/_rollupPluginBabelHelpers.js +4 -4
  3. package/es/components/Button/Button.Skeleton.js +2 -1
  4. package/es/components/Button/Button.d.ts +1 -1
  5. package/es/components/Button/Button.js +3 -3
  6. package/es/components/Button/ButtonBase.js +2 -0
  7. package/es/components/Button/index.js +5 -1
  8. package/es/components/ButtonSet/index.js +4 -1
  9. package/es/components/Checkbox/index.js +4 -1
  10. package/es/components/CodeSnippet/CodeSnippet.js +1 -0
  11. package/es/components/ComboBox/ComboBox.d.ts +7 -0
  12. package/es/components/ComboBox/ComboBox.js +11 -2
  13. package/es/components/ComboBox/index.js +4 -1
  14. package/es/components/ComposedModal/ComposedModal.js +18 -8
  15. package/es/components/ContainedList/ContainedList.d.ts +1 -1
  16. package/es/components/ContainedList/ContainedList.js +3 -3
  17. package/es/components/ContainedList/ContainedListItem/index.js +4 -1
  18. package/es/components/ContainedList/index.js +2 -2
  19. package/es/components/Copy/Copy.js +1 -1
  20. package/es/components/Copy/index.js +4 -1
  21. package/es/components/CopyButton/index.js +4 -1
  22. package/es/components/DataTable/Table.js +1 -1
  23. package/es/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
  24. package/es/components/DataTable/state/getDerivedStateFromProps.js +1 -2
  25. package/es/components/DataTable/state/sorting.d.ts +15 -0
  26. package/es/components/DataTable/state/sorting.js +1 -2
  27. package/es/components/DataTable/tools/denormalize.d.ts +22 -0
  28. package/es/components/DataTable/tools/denormalize.js +1 -2
  29. package/es/components/DataTable/tools/normalize.d.ts +9 -0
  30. package/es/components/DataTable/tools/normalize.js +1 -2
  31. package/es/components/DatePicker/DatePicker.js +18 -11
  32. package/es/components/DatePicker/index.js +4 -1
  33. package/es/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
  34. package/es/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
  35. package/es/components/DatePickerInput/DatePickerInput.js +6 -0
  36. package/es/components/DatePickerInput/index.js +4 -1
  37. package/es/components/Dialog/index.js +2 -2
  38. package/es/components/Dropdown/Dropdown.Skeleton.js +4 -4
  39. package/es/components/Dropdown/Dropdown.js +2 -2
  40. package/es/components/Dropdown/index.js +4 -1
  41. package/es/components/FeatureFlags/index.js +2 -2
  42. package/es/components/FluidNumberInput/FluidNumberInput.d.ts +3 -2
  43. package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
  44. package/es/components/FluidSelect/index.js +4 -1
  45. package/es/components/FluidTextInput/index.js +4 -1
  46. package/es/components/IconButton/index.d.ts +1 -1
  47. package/es/components/IconIndicator/index.js +1 -1
  48. package/es/components/InlineCheckbox/index.js +4 -1
  49. package/es/components/InlineLoading/index.js +4 -1
  50. package/es/components/LayoutDirection/LayoutDirection.js +1 -2
  51. package/es/components/Link/index.js +4 -1
  52. package/es/components/ListBox/ListBox.js +1 -1
  53. package/es/components/Loading/index.js +4 -1
  54. package/es/components/Menu/Menu.d.ts +3 -1
  55. package/es/components/Menu/Menu.js +3 -1
  56. package/es/components/Menu/MenuItem.js +1 -1
  57. package/es/components/Modal/Modal.js +16 -5
  58. package/es/components/Modal/index.js +4 -1
  59. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +7 -0
  60. package/es/components/MultiSelect/FilterableMultiSelect.js +20 -10
  61. package/es/components/MultiSelect/MultiSelect.js +2 -2
  62. package/es/components/MultiSelect/filter.js +0 -4
  63. package/es/components/MultiSelect/tools/itemToString.d.ts +1 -0
  64. package/es/components/MultiSelect/tools/sorting.d.ts +9 -0
  65. package/es/components/Notification/Notification.js +2 -2
  66. package/es/components/NumberInput/NumberInput.d.ts +3 -2
  67. package/es/components/NumberInput/NumberInput.js +5 -4
  68. package/es/components/OverflowMenu/next/index.js +1 -1
  69. package/es/components/OverflowMenuItem/index.js +4 -1
  70. package/es/components/OverflowMenuV2/index.d.ts +1 -0
  71. package/es/components/PageHeader/PageHeader.js +1 -1
  72. package/es/components/Pagination/experimental/PageSelector.d.ts +19 -0
  73. package/es/components/Pagination/experimental/Pagination.d.ts +43 -0
  74. package/es/components/Pagination/experimental/index.d.ts +3 -0
  75. package/es/components/Popover/index.js +26 -8
  76. package/es/components/RadioButton/index.js +4 -1
  77. package/es/components/RadioTile/index.js +4 -1
  78. package/es/components/Search/Search.js +1 -1
  79. package/es/components/Search/index.js +4 -1
  80. package/es/components/Select/index.js +4 -1
  81. package/es/components/SelectItem/index.js +4 -1
  82. package/es/components/ShapeIndicator/index.js +1 -1
  83. package/es/components/SkeletonText/index.js +4 -1
  84. package/es/components/Slider/Slider.js +1 -1
  85. package/es/components/Switch/IconSwitch.d.ts +3 -0
  86. package/es/components/Switch/IconSwitch.js +1 -2
  87. package/es/components/TabContent/TabContent.js +2 -22
  88. package/es/components/Tabs/Tabs.js +5 -5
  89. package/es/components/Tag/DismissibleTag.js +1 -1
  90. package/es/components/TextArea/TextArea.js +1 -1
  91. package/es/components/TextArea/index.js +4 -1
  92. package/es/components/TextInput/index.js +4 -1
  93. package/es/components/TextInput/util.d.ts +9 -0
  94. package/es/components/Toggletip/index.d.ts +1 -1
  95. package/es/components/Toggletip/index.js +3 -3
  96. package/es/components/UIShell/HeaderMenu.js +2 -2
  97. package/es/components/UIShell/SideNav.js +1 -1
  98. package/es/components/UIShell/_utils.d.ts +7 -0
  99. package/es/feature-flags.d.ts +1 -0
  100. package/es/internal/FloatingMenu.js +1 -1
  101. package/es/internal/deprecateFieldOnObject.js +1 -1
  102. package/es/internal/useEvent.d.ts +2 -2
  103. package/es/internal/useEvent.js +4 -3
  104. package/es/internal/useId.d.ts +21 -0
  105. package/es/internal/useId.js +27 -1
  106. package/es/internal/useOverflowItems.js +0 -6
  107. package/es/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -1
  108. package/es/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -1
  109. package/es/prop-types/deprecateComponent.d.ts +1 -0
  110. package/es/prop-types/deprecateComponent.js +1 -4
  111. package/es/prop-types/deprecateValuesWithin.d.ts +1 -0
  112. package/es/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
  113. package/es/tools/mergeRefs.d.ts +12 -0
  114. package/es/tools/mergeRefs.js +1 -2
  115. package/icons/index.js +1 -3
  116. package/lib/_virtual/_rollupPluginBabelHelpers.js +5 -7
  117. package/lib/components/AILabel/index.js +35 -43
  118. package/lib/components/AISkeleton/AISkeletonIcon.js +5 -11
  119. package/lib/components/AISkeleton/AISkeletonPlaceholder.js +4 -10
  120. package/lib/components/AISkeleton/AISkeletonText.js +8 -14
  121. package/lib/components/Accordion/Accordion.Skeleton.js +21 -27
  122. package/lib/components/Accordion/Accordion.js +11 -17
  123. package/lib/components/Accordion/AccordionItem.js +19 -25
  124. package/lib/components/Accordion/AccordionProvider.js +1 -7
  125. package/lib/components/AspectRatio/AspectRatio.js +7 -13
  126. package/lib/components/BadgeIndicator/index.js +7 -13
  127. package/lib/components/Breadcrumb/Breadcrumb.Skeleton.js +7 -13
  128. package/lib/components/Breadcrumb/Breadcrumb.js +9 -15
  129. package/lib/components/Breadcrumb/BreadcrumbItem.js +16 -22
  130. package/lib/components/Button/Button.Skeleton.js +9 -14
  131. package/lib/components/Button/Button.d.ts +1 -1
  132. package/lib/components/Button/Button.js +32 -37
  133. package/lib/components/Button/ButtonBase.js +8 -11
  134. package/lib/components/Button/index.js +3 -3
  135. package/lib/components/ButtonSet/ButtonSet.js +6 -12
  136. package/lib/components/ButtonSet/index.js +2 -2
  137. package/lib/components/ChatButton/ChatButton.Skeleton.js +5 -11
  138. package/lib/components/ChatButton/ChatButton.js +12 -18
  139. package/lib/components/Checkbox/Checkbox.Skeleton.js +6 -12
  140. package/lib/components/Checkbox/Checkbox.js +33 -39
  141. package/lib/components/Checkbox/index.js +3 -3
  142. package/lib/components/CheckboxGroup/CheckboxGroup.js +24 -30
  143. package/lib/components/ClassPrefix/index.js +3 -10
  144. package/lib/components/CodeSnippet/CodeSnippet.Skeleton.js +10 -16
  145. package/lib/components/CodeSnippet/CodeSnippet.js +40 -46
  146. package/lib/components/ComboBox/ComboBox.d.ts +7 -0
  147. package/lib/components/ComboBox/ComboBox.js +65 -63
  148. package/lib/components/ComboBox/index.js +2 -2
  149. package/lib/components/ComboButton/index.js +20 -28
  150. package/lib/components/ComposedModal/ComposedModal.js +61 -57
  151. package/lib/components/ComposedModal/ModalFooter.js +37 -45
  152. package/lib/components/ComposedModal/ModalHeader.js +23 -31
  153. package/lib/components/ContainedList/ContainedList.d.ts +1 -1
  154. package/lib/components/ContainedList/ContainedList.js +19 -25
  155. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +14 -20
  156. package/lib/components/ContainedList/ContainedListItem/index.js +2 -2
  157. package/lib/components/ContainedList/index.js +5 -5
  158. package/lib/components/ContentSwitcher/ContentSwitcher.js +11 -19
  159. package/lib/components/ContextMenu/useContextMenu.js +1 -1
  160. package/lib/components/Copy/Copy.js +12 -18
  161. package/lib/components/Copy/index.js +2 -2
  162. package/lib/components/CopyButton/CopyButton.js +12 -18
  163. package/lib/components/CopyButton/index.js +2 -2
  164. package/lib/components/DangerButton/DangerButton.js +2 -6
  165. package/lib/components/DataTable/DataTable.js +48 -55
  166. package/lib/components/DataTable/Table.js +18 -24
  167. package/lib/components/DataTable/TableActionList.js +2 -2
  168. package/lib/components/DataTable/TableBatchAction.js +4 -9
  169. package/lib/components/DataTable/TableBatchActions.js +19 -25
  170. package/lib/components/DataTable/TableBody.js +5 -10
  171. package/lib/components/DataTable/TableCell.js +8 -14
  172. package/lib/components/DataTable/TableContainer.js +14 -20
  173. package/lib/components/DataTable/TableContext.js +0 -2
  174. package/lib/components/DataTable/TableDecoratorRow.js +5 -11
  175. package/lib/components/DataTable/TableExpandHeader.js +16 -22
  176. package/lib/components/DataTable/TableExpandRow.js +20 -26
  177. package/lib/components/DataTable/TableExpandedRow.js +8 -14
  178. package/lib/components/DataTable/TableHead.js +2 -2
  179. package/lib/components/DataTable/TableHeader.js +26 -32
  180. package/lib/components/DataTable/TableRow.js +8 -14
  181. package/lib/components/DataTable/TableSelectAll.js +13 -19
  182. package/lib/components/DataTable/TableSelectRow.js +15 -21
  183. package/lib/components/DataTable/TableSlugRow.js +7 -13
  184. package/lib/components/DataTable/TableToolbar.js +7 -13
  185. package/lib/components/DataTable/TableToolbarAction.js +5 -10
  186. package/lib/components/DataTable/TableToolbarContent.js +2 -2
  187. package/lib/components/DataTable/TableToolbarMenu.js +9 -15
  188. package/lib/components/DataTable/TableToolbarSearch.js +22 -28
  189. package/lib/components/DataTable/state/getDerivedStateFromProps.d.ts +19 -0
  190. package/lib/components/DataTable/state/getDerivedStateFromProps.js +2 -3
  191. package/lib/components/DataTable/state/sortStates.js +0 -2
  192. package/lib/components/DataTable/state/sorting.d.ts +15 -0
  193. package/lib/components/DataTable/state/sorting.js +0 -2
  194. package/lib/components/DataTable/tools/cells.js +0 -2
  195. package/lib/components/DataTable/tools/denormalize.d.ts +22 -0
  196. package/lib/components/DataTable/tools/denormalize.js +1 -2
  197. package/lib/components/DataTable/tools/filter.js +0 -2
  198. package/lib/components/DataTable/tools/normalize.d.ts +9 -0
  199. package/lib/components/DataTable/tools/normalize.js +1 -2
  200. package/lib/components/DataTable/tools/sorting.js +0 -2
  201. package/lib/components/DataTableSkeleton/DataTableSkeleton.js +25 -31
  202. package/lib/components/DatePicker/DatePicker.Skeleton.js +14 -20
  203. package/lib/components/DatePicker/DatePicker.js +65 -66
  204. package/lib/components/DatePicker/index.js +3 -3
  205. package/lib/components/DatePicker/plugins/appendToPlugin.js +0 -2
  206. package/lib/components/DatePicker/plugins/fixEventsPlugin.d.ts +2 -0
  207. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
  208. package/lib/components/DatePicker/plugins/rangePlugin.d.ts +2 -0
  209. package/lib/components/DatePicker/plugins/rangePlugin.js +2 -6
  210. package/lib/components/DatePickerInput/DatePickerInput.js +49 -49
  211. package/lib/components/DatePickerInput/index.js +2 -2
  212. package/lib/components/Dialog/index.js +72 -80
  213. package/lib/components/Dropdown/Dropdown.Skeleton.js +10 -16
  214. package/lib/components/Dropdown/Dropdown.js +49 -55
  215. package/lib/components/Dropdown/index.js +3 -3
  216. package/lib/components/ErrorBoundary/ErrorBoundary.js +4 -9
  217. package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +0 -2
  218. package/lib/components/ExpandableSearch/ExpandableSearch.js +6 -11
  219. package/lib/components/FeatureFlags/index.js +10 -17
  220. package/lib/components/FileUploader/FileUploader.Skeleton.js +7 -13
  221. package/lib/components/FileUploader/FileUploader.js +30 -36
  222. package/lib/components/FileUploader/FileUploaderButton.js +19 -25
  223. package/lib/components/FileUploader/FileUploaderDropContainer.js +18 -24
  224. package/lib/components/FileUploader/FileUploaderItem.js +23 -29
  225. package/lib/components/FileUploader/Filename.js +13 -18
  226. package/lib/components/FluidComboBox/FluidComboBox.Skeleton.js +7 -13
  227. package/lib/components/FluidComboBox/FluidComboBox.js +24 -30
  228. package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.js +14 -20
  229. package/lib/components/FluidDatePicker/FluidDatePicker.js +12 -18
  230. package/lib/components/FluidDatePickerInput/FluidDatePickerInput.js +4 -8
  231. package/lib/components/FluidDropdown/FluidDropdown.Skeleton.js +7 -13
  232. package/lib/components/FluidDropdown/FluidDropdown.js +24 -30
  233. package/lib/components/FluidForm/FluidForm.js +6 -12
  234. package/lib/components/FluidForm/FormContext.js +0 -2
  235. package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.js +7 -13
  236. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +36 -42
  237. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +7 -13
  238. package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +3 -2
  239. package/lib/components/FluidNumberInput/FluidNumberInput.js +33 -38
  240. package/lib/components/FluidSearch/FluidSearch.Skeleton.js +7 -13
  241. package/lib/components/FluidSearch/FluidSearch.js +19 -25
  242. package/lib/components/FluidSelect/FluidSelect.Skeleton.js +7 -13
  243. package/lib/components/FluidSelect/FluidSelect.js +17 -23
  244. package/lib/components/FluidSelect/index.js +3 -3
  245. package/lib/components/FluidTextArea/FluidTextArea.Skeleton.js +7 -13
  246. package/lib/components/FluidTextArea/FluidTextArea.js +25 -31
  247. package/lib/components/FluidTextInput/FluidPasswordInput.js +18 -22
  248. package/lib/components/FluidTextInput/FluidTextInput.Skeleton.js +7 -13
  249. package/lib/components/FluidTextInput/FluidTextInput.js +23 -29
  250. package/lib/components/FluidTextInput/index.js +3 -3
  251. package/lib/components/FluidTimePicker/FluidTimePicker.Skeleton.js +6 -12
  252. package/lib/components/FluidTimePicker/FluidTimePicker.js +23 -29
  253. package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +10 -15
  254. package/lib/components/Form/Form.js +5 -11
  255. package/lib/components/FormGroup/FormGroup.js +13 -19
  256. package/lib/components/FormItem/FormItem.js +5 -11
  257. package/lib/components/FormLabel/FormLabel.js +6 -12
  258. package/lib/components/Grid/CSSGrid.js +20 -28
  259. package/lib/components/Grid/Column.js +31 -37
  260. package/lib/components/Grid/ColumnHang.js +5 -13
  261. package/lib/components/Grid/FlexGrid.js +10 -18
  262. package/lib/components/Grid/Grid.js +9 -16
  263. package/lib/components/Grid/GridContext.js +7 -14
  264. package/lib/components/Grid/Row.js +8 -14
  265. package/lib/components/Heading/index.js +14 -21
  266. package/lib/components/Icon/Icon.Skeleton.js +4 -10
  267. package/lib/components/IconButton/index.d.ts +1 -1
  268. package/lib/components/IconButton/index.js +25 -33
  269. package/lib/components/IconIndicator/index.js +9 -15
  270. package/lib/components/IdPrefix/index.js +3 -10
  271. package/lib/components/InlineCheckbox/InlineCheckbox.js +17 -22
  272. package/lib/components/InlineCheckbox/index.js +2 -2
  273. package/lib/components/InlineLoading/InlineLoading.js +17 -23
  274. package/lib/components/InlineLoading/index.js +2 -2
  275. package/lib/components/Layer/LayerContext.js +1 -7
  276. package/lib/components/Layer/LayerLevel.js +0 -2
  277. package/lib/components/Layer/index.js +11 -19
  278. package/lib/components/Layout/index.js +22 -30
  279. package/lib/components/LayoutDirection/LayoutDirection.js +6 -13
  280. package/lib/components/LayoutDirection/LayoutDirectionContext.js +1 -7
  281. package/lib/components/LayoutDirection/useLayoutDirection.js +0 -2
  282. package/lib/components/Link/Link.js +15 -21
  283. package/lib/components/Link/index.js +2 -2
  284. package/lib/components/ListBox/ListBox.js +17 -23
  285. package/lib/components/ListBox/ListBoxField.js +7 -12
  286. package/lib/components/ListBox/ListBoxMenu.js +7 -12
  287. package/lib/components/ListBox/ListBoxMenuIcon.js +7 -13
  288. package/lib/components/ListBox/ListBoxMenuItem.js +9 -15
  289. package/lib/components/ListBox/ListBoxPropTypes.js +2 -8
  290. package/lib/components/ListBox/ListBoxSelection.js +14 -20
  291. package/lib/components/ListBox/index.js +7 -7
  292. package/lib/components/ListBox/next/ListBoxSelection.js +18 -24
  293. package/lib/components/ListBox/next/ListBoxTrigger.js +7 -13
  294. package/lib/components/ListItem/ListItem.js +5 -11
  295. package/lib/components/Loading/Loading.js +14 -20
  296. package/lib/components/Loading/index.js +2 -2
  297. package/lib/components/Menu/Menu.d.ts +3 -1
  298. package/lib/components/Menu/Menu.js +18 -24
  299. package/lib/components/Menu/MenuContext.js +0 -2
  300. package/lib/components/Menu/MenuItem.js +44 -52
  301. package/lib/components/MenuButton/index.js +16 -24
  302. package/lib/components/Modal/Modal.js +91 -86
  303. package/lib/components/Modal/index.js +2 -2
  304. package/lib/components/ModalWrapper/ModalWrapper.js +30 -35
  305. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +7 -0
  306. package/lib/components/MultiSelect/FilterableMultiSelect.js +71 -71
  307. package/lib/components/MultiSelect/MultiSelect.js +61 -70
  308. package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -8
  309. package/lib/components/MultiSelect/filter.js +0 -6
  310. package/lib/components/MultiSelect/tools/itemToString.d.ts +1 -0
  311. package/lib/components/MultiSelect/tools/itemToString.js +1 -7
  312. package/lib/components/MultiSelect/tools/sorting.d.ts +9 -0
  313. package/lib/components/MultiSelect/tools/sorting.js +0 -2
  314. package/lib/components/Notification/Notification.js +118 -126
  315. package/lib/components/NumberInput/NumberFormatPropTypes.js +21 -27
  316. package/lib/components/NumberInput/NumberInput.Skeleton.js +8 -14
  317. package/lib/components/NumberInput/NumberInput.d.ts +3 -2
  318. package/lib/components/NumberInput/NumberInput.js +70 -77
  319. package/lib/components/OrderedList/OrderedList.js +8 -14
  320. package/lib/components/OverflowMenu/OverflowMenu.js +42 -49
  321. package/lib/components/OverflowMenu/index.js +3 -7
  322. package/lib/components/OverflowMenu/next/index.js +18 -26
  323. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +27 -33
  324. package/lib/components/OverflowMenuItem/index.js +2 -2
  325. package/lib/components/OverflowMenuV2/index.d.ts +1 -0
  326. package/lib/components/OverflowMenuV2/index.js +2 -8
  327. package/lib/components/PageHeader/PageHeader.js +70 -78
  328. package/lib/components/PageHeader/index.js +0 -2
  329. package/lib/components/Pagination/Pagination.Skeleton.js +10 -16
  330. package/lib/components/Pagination/Pagination.js +44 -51
  331. package/lib/components/Pagination/experimental/PageSelector.d.ts +19 -0
  332. package/lib/components/Pagination/experimental/PageSelector.js +9 -15
  333. package/lib/components/Pagination/experimental/Pagination.d.ts +43 -0
  334. package/lib/components/Pagination/experimental/Pagination.js +34 -40
  335. package/lib/components/Pagination/experimental/index.d.ts +3 -0
  336. package/lib/components/PaginationNav/PaginationNav.js +54 -60
  337. package/lib/components/Popover/index.js +60 -50
  338. package/lib/components/PrimaryButton/PrimaryButton.js +2 -6
  339. package/lib/components/ProgressBar/ProgressBar.js +25 -31
  340. package/lib/components/ProgressIndicator/ProgressIndicator.Skeleton.js +10 -16
  341. package/lib/components/ProgressIndicator/ProgressIndicator.js +41 -49
  342. package/lib/components/RadioButton/RadioButton.Skeleton.js +6 -12
  343. package/lib/components/RadioButton/RadioButton.js +26 -32
  344. package/lib/components/RadioButton/index.js +2 -2
  345. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +37 -43
  346. package/lib/components/RadioTile/RadioTile.js +25 -31
  347. package/lib/components/RadioTile/index.js +2 -2
  348. package/lib/components/Search/Search.Skeleton.js +7 -13
  349. package/lib/components/Search/Search.js +33 -39
  350. package/lib/components/Search/index.js +3 -3
  351. package/lib/components/SecondaryButton/SecondaryButton.js +2 -6
  352. package/lib/components/Select/Select.Skeleton.js +8 -14
  353. package/lib/components/Select/Select.js +42 -48
  354. package/lib/components/Select/index.js +3 -3
  355. package/lib/components/SelectItem/SelectItem.js +8 -14
  356. package/lib/components/SelectItem/index.js +2 -2
  357. package/lib/components/SelectItemGroup/SelectItemGroup.js +7 -13
  358. package/lib/components/ShapeIndicator/index.js +12 -18
  359. package/lib/components/SkeletonIcon/SkeletonIcon.js +4 -10
  360. package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +4 -10
  361. package/lib/components/SkeletonText/SkeletonText.js +11 -17
  362. package/lib/components/SkeletonText/index.js +2 -2
  363. package/lib/components/Slider/Slider.Skeleton.js +29 -35
  364. package/lib/components/Slider/Slider.js +84 -90
  365. package/lib/components/Slider/SliderHandles.js +18 -24
  366. package/lib/components/Slider/index.js +3 -3
  367. package/lib/components/Stack/HStack.js +1 -7
  368. package/lib/components/Stack/Stack.js +7 -15
  369. package/lib/components/Stack/VStack.js +1 -7
  370. package/lib/components/StructuredList/StructuredList.Skeleton.js +15 -21
  371. package/lib/components/StructuredList/StructuredList.js +60 -68
  372. package/lib/components/Switch/IconSwitch.d.ts +3 -0
  373. package/lib/components/Switch/IconSwitch.js +18 -25
  374. package/lib/components/Switch/Switch.js +14 -20
  375. package/lib/components/TabContent/TabContent.js +7 -33
  376. package/lib/components/Tabs/Tabs.Skeleton.js +10 -16
  377. package/lib/components/Tabs/Tabs.js +121 -129
  378. package/lib/components/Tabs/usePressable.js +0 -2
  379. package/lib/components/Tag/DismissibleTag.js +24 -30
  380. package/lib/components/Tag/OperationalTag.js +16 -22
  381. package/lib/components/Tag/SelectableTag.js +19 -25
  382. package/lib/components/Tag/Tag.Skeleton.js +5 -11
  383. package/lib/components/Tag/Tag.js +28 -34
  384. package/lib/components/Tag/isEllipsisActive.js +0 -2
  385. package/lib/components/Text/Text.js +6 -13
  386. package/lib/components/Text/TextDirection.js +4 -11
  387. package/lib/components/Text/TextDirectionContext.js +0 -2
  388. package/lib/components/Text/createTextComponent.js +1 -7
  389. package/lib/components/Text/index.js +0 -2
  390. package/lib/components/TextArea/TextArea.Skeleton.js +7 -13
  391. package/lib/components/TextArea/TextArea.js +49 -55
  392. package/lib/components/TextArea/index.js +3 -3
  393. package/lib/components/TextInput/ControlledPasswordInput.js +36 -42
  394. package/lib/components/TextInput/PasswordInput.js +48 -54
  395. package/lib/components/TextInput/TextInput.Skeleton.js +7 -13
  396. package/lib/components/TextInput/TextInput.js +47 -53
  397. package/lib/components/TextInput/index.js +3 -3
  398. package/lib/components/TextInput/util.d.ts +9 -0
  399. package/lib/components/TextInput/util.js +0 -2
  400. package/lib/components/Theme/index.js +16 -24
  401. package/lib/components/Tile/Tile.js +92 -100
  402. package/lib/components/TileGroup/TileGroup.js +15 -22
  403. package/lib/components/TimePicker/TimePicker.js +39 -45
  404. package/lib/components/TimePickerSelect/TimePickerSelect.js +10 -16
  405. package/lib/components/Toggle/Toggle.Skeleton.js +7 -13
  406. package/lib/components/Toggle/Toggle.js +28 -34
  407. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +12 -20
  408. package/lib/components/Toggletip/index.d.ts +1 -1
  409. package/lib/components/Toggletip/index.js +33 -41
  410. package/lib/components/Tooltip/DefinitionTooltip.js +14 -22
  411. package/lib/components/Tooltip/Tooltip.js +19 -27
  412. package/lib/components/TreeView/TreeContext.js +0 -2
  413. package/lib/components/TreeView/TreeNode.js +41 -47
  414. package/lib/components/TreeView/TreeView.js +17 -23
  415. package/lib/components/UIShell/Content.js +6 -12
  416. package/lib/components/UIShell/Header.js +4 -10
  417. package/lib/components/UIShell/HeaderContainer.js +4 -9
  418. package/lib/components/UIShell/HeaderGlobalAction.js +11 -17
  419. package/lib/components/UIShell/HeaderGlobalBar.js +2 -2
  420. package/lib/components/UIShell/HeaderMenu.js +17 -23
  421. package/lib/components/UIShell/HeaderMenuButton.js +9 -15
  422. package/lib/components/UIShell/HeaderMenuItem.js +11 -17
  423. package/lib/components/UIShell/HeaderName.js +8 -14
  424. package/lib/components/UIShell/HeaderNavigation.js +6 -12
  425. package/lib/components/UIShell/HeaderPanel.js +11 -17
  426. package/lib/components/UIShell/HeaderSideNavItems.js +6 -12
  427. package/lib/components/UIShell/Link.js +6 -11
  428. package/lib/components/UIShell/SideNav.js +23 -29
  429. package/lib/components/UIShell/SideNavDetails.js +7 -13
  430. package/lib/components/UIShell/SideNavDivider.js +5 -11
  431. package/lib/components/UIShell/SideNavFooter.js +12 -18
  432. package/lib/components/UIShell/SideNavHeader.js +8 -14
  433. package/lib/components/UIShell/SideNavIcon.js +6 -12
  434. package/lib/components/UIShell/SideNavItem.js +6 -12
  435. package/lib/components/UIShell/SideNavItems.js +9 -15
  436. package/lib/components/UIShell/SideNavLink.js +13 -19
  437. package/lib/components/UIShell/SideNavLinkText.js +5 -11
  438. package/lib/components/UIShell/SideNavMenu.js +20 -26
  439. package/lib/components/UIShell/SideNavMenuItem.js +13 -19
  440. package/lib/components/UIShell/SideNavSwitcher.js +13 -19
  441. package/lib/components/UIShell/SkipToContent.js +7 -13
  442. package/lib/components/UIShell/Switcher.js +9 -15
  443. package/lib/components/UIShell/SwitcherDivider.js +4 -10
  444. package/lib/components/UIShell/SwitcherItem.js +15 -21
  445. package/lib/components/UIShell/_utils.d.ts +7 -0
  446. package/lib/components/UIShell/_utils.js +0 -2
  447. package/lib/components/UnorderedList/UnorderedList.js +7 -13
  448. package/lib/feature-flags.d.ts +1 -0
  449. package/lib/feature-flags.js +3 -4
  450. package/lib/index.js +180 -182
  451. package/lib/internal/FloatingMenu.js +10 -18
  452. package/lib/internal/OptimizedResize.js +2 -8
  453. package/lib/internal/Selection.js +1 -7
  454. package/lib/internal/clamp.js +0 -2
  455. package/lib/internal/createClassWrapper.js +1 -7
  456. package/lib/internal/deprecateFieldOnObject.js +1 -3
  457. package/lib/internal/environment.js +0 -2
  458. package/lib/internal/getAnnouncement.js +0 -2
  459. package/lib/internal/keyboard/keys.js +0 -2
  460. package/lib/internal/keyboard/match.js +0 -2
  461. package/lib/internal/keyboard/navigation.js +0 -2
  462. package/lib/internal/noopFn.js +0 -2
  463. package/lib/internal/useAttachedMenu.js +0 -2
  464. package/lib/internal/useControllableState.js +0 -2
  465. package/lib/internal/useDelayedState.js +0 -2
  466. package/lib/internal/useEvent.d.ts +2 -2
  467. package/lib/internal/useEvent.js +4 -5
  468. package/lib/internal/useId.d.ts +21 -0
  469. package/lib/internal/useId.js +27 -7
  470. package/lib/internal/useIdPrefix.js +2 -8
  471. package/lib/internal/useIsomorphicEffect.js +1 -1
  472. package/lib/internal/useMatchMedia.js +0 -2
  473. package/lib/internal/useMergedRefs.js +0 -2
  474. package/lib/internal/useNoInteractiveChildren.js +0 -2
  475. package/lib/internal/useNormalizedInputProps.js +2 -8
  476. package/lib/internal/useOutsideClick.js +0 -2
  477. package/lib/internal/useOverflowItems.js +1 -7
  478. package/lib/internal/usePrefix.js +2 -8
  479. package/lib/internal/usePreviousValue.js +0 -2
  480. package/lib/internal/useResizeObserver.js +0 -2
  481. package/lib/internal/useSavedCallback.js +0 -2
  482. package/lib/internal/utils.js +0 -2
  483. package/lib/internal/warning.js +0 -2
  484. package/lib/internal/wrapFocus.js +0 -2
  485. package/lib/node_modules/es-toolkit/dist/compat/function/{debounce.mjs.js → debounce.js} +1 -3
  486. package/lib/node_modules/es-toolkit/dist/compat/function/{throttle.mjs.js → throttle.js} +1 -3
  487. package/lib/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -2
  488. package/lib/prop-types/AriaPropTypes.js +2 -8
  489. package/lib/prop-types/deprecate.js +0 -2
  490. package/lib/prop-types/deprecateComponent.d.ts +1 -0
  491. package/lib/prop-types/deprecateComponent.js +2 -5
  492. package/lib/prop-types/deprecateValuesWithin.d.ts +1 -0
  493. package/lib/prop-types/deprecateValuesWithin.js +1 -1
  494. package/lib/prop-types/isRequiredOneOf.js +0 -2
  495. package/lib/prop-types/requiredIfGivenPropIsTruthy.d.ts +14 -0
  496. package/lib/prop-types/requiredIfGivenPropIsTruthy.js +1 -1
  497. package/lib/tools/events.js +0 -2
  498. package/lib/tools/mapPopoverAlign.js +0 -2
  499. package/lib/tools/mergeRefs.d.ts +12 -0
  500. package/lib/tools/mergeRefs.js +1 -2
  501. package/lib/tools/setupGetInstanceId.js +0 -2
  502. package/lib/tools/toggleClass.js +0 -2
  503. package/lib/tools/wrapComponent.js +4 -10
  504. package/package.json +12 -12
  505. package/telemetry.yml +1 -0
  506. /package/es/node_modules/es-toolkit/dist/function/{debounce.mjs.js → debounce.js} +0 -0
@@ -9,13 +9,13 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import deprecateValuesWithin from '../../prop-types/deprecateValuesWithin.js';
12
- import React, { useRef, useMemo, useEffect } from 'react';
12
+ import React, { useRef, useEffect, useMemo } from 'react';
13
13
  import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
14
14
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
15
15
  import { usePrefix } from '../../internal/usePrefix.js';
16
- import { useWindowEvent } from '../../internal/useEvent.js';
16
+ import { useEvent, useWindowEvent } from '../../internal/useEvent.js';
17
17
  import { mapPopoverAlign } from '../../tools/mapPopoverAlign.js';
18
- import { useFloating, offset, flip, arrow, hide, autoUpdate } from '@floating-ui/react';
18
+ import { useFloating, autoUpdate, offset, flip, arrow, hide } from '@floating-ui/react';
19
19
  import { useFeatureFlag } from '../FeatureFlags/index.js';
20
20
  import { ToggletipButton } from '../Toggletip/index.js';
21
21
 
@@ -59,9 +59,10 @@ forwardRef) {
59
59
  const enableFloatingStyles = useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
60
60
  let align = mapPopoverAlign(initialAlign);
61
61
 
62
- // If the `Popover` is the last focusable item in the tab order, it should also close when the browser window loses focus (#12922)
63
- useWindowEvent('blur', () => {
64
- if (open) {
62
+ // The `Popover` should close whenever it and its children loses focus
63
+ useEvent(popover, 'focusout', event => {
64
+ const relatedTarget = event.relatedTarget;
65
+ if (!popover.current?.contains(relatedTarget)) {
65
66
  onRequestClose?.();
66
67
  }
67
68
  });
@@ -350,12 +351,29 @@ function PopoverContentRenderFunction(
350
351
  caretRef,
351
352
  autoAlign
352
353
  } = React.useContext(PopoverContext);
353
- const ref = useMergedRefs([setFloating, forwardRef]);
354
+ const textRef = useRef(null);
355
+ const [isMultiLine, setIsMultiLine] = React.useState(false);
356
+ const ref = useMergedRefs([setFloating, textRef, forwardRef]);
354
357
  const enableFloatingStyles = useFeatureFlag('enable-v12-dynamic-floating-styles') || autoAlign;
358
+ useEffect(() => {
359
+ checkIfMultiLine();
360
+ }, [children]);
361
+ const checkIfMultiLine = () => {
362
+ const el = textRef.current;
363
+ if (el) {
364
+ const style = getComputedStyle(el);
365
+ const lineHeight = parseFloat(style.lineHeight);
366
+ const height = el.offsetHeight;
367
+ const lines = Math.floor(height / lineHeight);
368
+ setIsMultiLine(lines > 1);
369
+ }
370
+ };
355
371
  return /*#__PURE__*/React.createElement("span", _extends({}, rest, {
356
372
  className: `${prefix}--popover`
357
373
  }), /*#__PURE__*/React.createElement("span", {
358
- className: cx(`${prefix}--popover-content`, className),
374
+ className: cx(`${prefix}--popover-content`, className, {
375
+ [`${prefix}--tooltip-content--multiline`]: isMultiLine
376
+ }),
359
377
  ref: ref
360
378
  }, children, enableFloatingStyles && /*#__PURE__*/React.createElement("span", {
361
379
  className: cx({
@@ -6,4 +6,7 @@
6
6
  */
7
7
 
8
8
  import RadioButton from './RadioButton.js';
9
- export { default as RadioButton, default } from './RadioButton.js';
9
+
10
+
11
+
12
+ export { RadioButton, RadioButton as default };
@@ -6,4 +6,7 @@
6
6
  */
7
7
 
8
8
  import RadioTile from './RadioTile.js';
9
- export { default as RadioTile, default } from './RadioTile.js';
9
+
10
+
11
+
12
+ export { RadioTile, RadioTile as default };
@@ -10,7 +10,7 @@ import { Close, Search as Search$1 } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import React, { useContext, useRef, useState } from 'react';
13
- import { Escape, Enter, Space } from '../../internal/keyboard/keys.js';
13
+ import { Enter, Space, Escape } from '../../internal/keyboard/keys.js';
14
14
  import { match } from '../../internal/keyboard/match.js';
15
15
  import { useId } from '../../internal/useId.js';
16
16
  import { usePrefix } from '../../internal/usePrefix.js';
@@ -6,5 +6,8 @@
6
6
  */
7
7
 
8
8
  import Search from './Search.js';
9
- export { default as Search, default } from './Search.js';
10
9
  export { default as SearchSkeleton } from './Search.Skeleton.js';
10
+
11
+
12
+
13
+ export { Search, Search as default };
@@ -6,5 +6,8 @@
6
6
  */
7
7
 
8
8
  import Select from './Select.js';
9
- export { default as Select, default } from './Select.js';
10
9
  export { default as SelectSkeleton } from './Select.Skeleton.js';
10
+
11
+
12
+
13
+ export { Select, Select as default };
@@ -6,4 +6,7 @@
6
6
  */
7
7
 
8
8
  import SelectItem from './SelectItem.js';
9
- export { default as SelectItem, default } from './SelectItem.js';
9
+
10
+
11
+
12
+ export { SelectItem, SelectItem as default };
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
10
10
  import React from 'react';
11
11
  import cx from 'classnames';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
- import { Critical, CriticalSeverity, Caution, DiamondFill, LowSeverity, CircleFill, CircleStroke } from '@carbon/icons-react';
13
+ import { CircleStroke, LowSeverity, CircleFill, DiamondFill, Caution, CriticalSeverity, Critical } from '@carbon/icons-react';
14
14
 
15
15
  var _path;
16
16
  const ShapeIndicatorKinds = ['failed', 'critical', 'high', 'medium', 'low', 'cautious', 'undefined', 'stable', 'informative', 'incomplete', 'draft'];
@@ -6,4 +6,7 @@
6
6
  */
7
7
 
8
8
  import SkeletonText from './SkeletonText.js';
9
- export { default as SkeletonText, default } from './SkeletonText.js';
9
+
10
+
11
+
12
+ export { SkeletonText, SkeletonText as default };
@@ -20,7 +20,7 @@ import '../Tooltip/DefinitionTooltip.js';
20
20
  import { Tooltip } from '../Tooltip/Tooltip.js';
21
21
  import { LowerHandle, LowerHandleFocus, UpperHandle, UpperHandleFocus } from './SliderHandles.js';
22
22
  import { clamp } from '../../internal/clamp.js';
23
- import { throttle } from '../../node_modules/es-toolkit/dist/compat/function/throttle.mjs.js';
23
+ import { throttle } from '../../node_modules/es-toolkit/dist/compat/function/throttle.js';
24
24
  import { Text } from '../Text/Text.js';
25
25
 
26
26
  const ThumbWrapper = ({
@@ -0,0 +1,3 @@
1
+ export default IconSwitch;
2
+ declare const IconSwitch: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
+ import React from 'react';
@@ -145,6 +145,5 @@ IconSwitch.propTypes = {
145
145
  */
146
146
  text: PropTypes.string
147
147
  };
148
- var IconSwitch$1 = IconSwitch;
149
148
 
150
- export { IconSwitch$1 as default };
149
+ export { IconSwitch as default };
@@ -7,26 +7,10 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React, { useRef, useState } from 'react';
10
+ import React from 'react';
11
11
  import cx from 'classnames';
12
- import { selectorTabbable } from '../../internal/keyboard/navigation.js';
13
- import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
14
12
  import { usePrefix } from '../../internal/usePrefix.js';
15
13
 
16
- /**
17
- * Determine if the node within the provided ref contains content that is tabbable.
18
- */
19
- function useTabbableContent(ref) {
20
- const [hasTabbableContent, setHasTabbableContent] = useState(false);
21
-
22
- // eslint-disable-next-line react-hooks/exhaustive-deps
23
- useIsomorphicEffect(() => {
24
- if (ref.current) {
25
- setHasTabbableContent(!!ref.current.querySelector(selectorTabbable));
26
- }
27
- });
28
- return hasTabbableContent;
29
- }
30
14
  function TabContent(props) {
31
15
  const {
32
16
  className,
@@ -36,16 +20,12 @@ function TabContent(props) {
36
20
  } = props;
37
21
  const prefix = usePrefix();
38
22
  const tabContentClasses = cx(`${prefix}--tab-content`, className);
39
- const ref = useRef(null);
40
- const hasTabbableContent = useTabbableContent(ref);
41
23
  return /*#__PURE__*/React.createElement("div", _extends({
42
24
  role: "tabpanel"
43
25
  }, other, {
44
26
  className: tabContentClasses,
45
27
  selected: selected,
46
- hidden: !selected,
47
- ref: ref,
48
- tabIndex: hasTabbableContent ? undefined : 0
28
+ hidden: !selected
49
29
  }), children);
50
30
  }
51
31
  TabContent.propTypes = {
@@ -6,11 +6,11 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import { ChevronLeft, ChevronRight, Close } from '@carbon/icons-react';
9
+ import { Close, ChevronLeft, ChevronRight } from '@carbon/icons-react';
10
10
  import { breakpoints } from '@carbon/layout';
11
11
  import cx from 'classnames';
12
12
  import PropTypes from 'prop-types';
13
- import React, { useState, useRef, useCallback, useEffect, forwardRef, createContext, useMemo, isValidElement } from 'react';
13
+ import React, { forwardRef, createContext, useRef, useState, useMemo, isValidElement, useEffect, useCallback } from 'react';
14
14
  import '../Grid/FlexGrid.js';
15
15
  import { Grid as GridAsGridComponent } from '../Grid/Grid.js';
16
16
  import '../Grid/Row.js';
@@ -26,15 +26,15 @@ import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
26
26
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
27
27
  import { getInteractiveContent } from '../../internal/useNoInteractiveChildren.js';
28
28
  import { usePrefix } from '../../internal/usePrefix.js';
29
- import { ArrowRight, ArrowLeft, Home, End, ArrowDown, ArrowUp, Delete } from '../../internal/keyboard/keys.js';
30
- import { matches, match } from '../../internal/keyboard/match.js';
29
+ import { Delete, ArrowRight, ArrowLeft, Home, End, ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
30
+ import { match, matches } from '../../internal/keyboard/match.js';
31
31
  import { usePressable } from './usePressable.js';
32
32
  import { deprecate } from '../../prop-types/deprecate.js';
33
33
  import { useEvent } from '../../internal/useEvent.js';
34
34
  import { useMatchMedia } from '../../internal/useMatchMedia.js';
35
35
  import '../Text/index.js';
36
36
  import { BadgeIndicator } from '../BadgeIndicator/index.js';
37
- import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js';
37
+ import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.js';
38
38
  import { Text } from '../Text/Text.js';
39
39
 
40
40
  var _ChevronLeft, _ChevronRight, _BadgeIndicator;
@@ -12,7 +12,7 @@ import cx from 'classnames';
12
12
  import { useId } from '../../internal/useId.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
14
  import { deprecate } from '../../prop-types/deprecate.js';
15
- import Tag, { SIZES, TYPES } from './Tag.js';
15
+ import Tag, { TYPES, SIZES } from './Tag.js';
16
16
  import { Close } from '@carbon/icons-react';
17
17
  import '../Tooltip/DefinitionTooltip.js';
18
18
  import { Tooltip } from '../Tooltip/Tooltip.js';
@@ -7,7 +7,7 @@
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
- import React, { useContext, useRef, useState, useEffect, forwardRef, cloneElement } from 'react';
10
+ import React, { forwardRef, useContext, useRef, useState, useEffect, cloneElement } from 'react';
11
11
  import cx from 'classnames';
12
12
  import { deprecate } from '../../prop-types/deprecate.js';
13
13
  import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
@@ -6,5 +6,8 @@
6
6
  */
7
7
 
8
8
  import TextArea from './TextArea.js';
9
- export { default as TextArea, default } from './TextArea.js';
10
9
  export { default as TextAreaSkeleton } from './TextArea.Skeleton.js';
10
+
11
+
12
+
13
+ export { TextArea, TextArea as default };
@@ -6,5 +6,8 @@
6
6
  */
7
7
 
8
8
  import TextInput from './TextInput.js';
9
- export { default as TextInput, default } from './TextInput.js';
10
9
  export { default as TextInputSkeleton } from './TextInput.Skeleton.js';
10
+
11
+
12
+
13
+ export { TextInput, TextInput as default };
@@ -0,0 +1,9 @@
1
+ export function textInputProps({ sharedTextInputProps, invalid, invalidId, warn, warnId, hasHelper, helperId, }: {
2
+ sharedTextInputProps: object;
3
+ invalid?: boolean;
4
+ invalidId?: string;
5
+ warn?: boolean;
6
+ warnId?: string;
7
+ hasHelper?: boolean;
8
+ helperId?: string;
9
+ }): object;
@@ -58,7 +58,7 @@ export declare namespace Toggletip {
58
58
  */
59
59
  align: PropTypes.Requireable<string>;
60
60
  /**
61
- * Provide an offset value for alignment axis.
61
+ * **Experimental:** Provide an offset value for alignment axis. Only takes effect when `autoalign` is enabled.
62
62
  */
63
63
  alignmentAxisOffset: PropTypes.Requireable<number>;
64
64
  /**
@@ -8,8 +8,8 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
- import React, { useRef, useState, useContext } from 'react';
12
- import { Popover, PopoverContent } from '../Popover/index.js';
11
+ import React, { useContext, useRef, useState } from 'react';
12
+ import { PopoverContent, Popover } from '../Popover/index.js';
13
13
  import { Escape } from '../../internal/keyboard/keys.js';
14
14
  import { match } from '../../internal/keyboard/match.js';
15
15
  import { useWindowEvent } from '../../internal/useEvent.js';
@@ -176,7 +176,7 @@ Toggletip.propTypes = {
176
176
  // new values to match floating-ui
177
177
  'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
178
178
  /**
179
- * Provide an offset value for alignment axis.
179
+ * **Experimental:** Provide an offset value for alignment axis. Only takes effect when `autoalign` is enabled.
180
180
  */
181
181
  alignmentAxisOffset: PropTypes.number,
182
182
  /**
@@ -8,9 +8,9 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import { ChevronDown } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
- import React, { useContext, useState, useRef, Children, forwardRef, isValidElement, cloneElement } from 'react';
11
+ import React, { forwardRef, useContext, useState, useRef, Children, isValidElement, cloneElement } from 'react';
12
12
  import PropTypes from 'prop-types';
13
- import { Enter, Space, Escape } from '../../internal/keyboard/keys.js';
13
+ import { Escape, Enter, Space } from '../../internal/keyboard/keys.js';
14
14
  import { matches } from '../../internal/keyboard/match.js';
15
15
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
16
16
  import { PrefixContext } from '../../internal/usePrefix.js';
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
- import React, { createContext, useRef, isValidElement } from 'react';
9
+ import React, { useRef, isValidElement, createContext } from 'react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright IBM Corp. 2021, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ export const CARBON_SIDENAV_ITEMS: string[];
@@ -0,0 +1 @@
1
+ export {};
@@ -15,7 +15,7 @@ import { selectorTabbable, selectorFocusable } from './keyboard/navigation.js';
15
15
  import { OptimizedResize } from './OptimizedResize.js';
16
16
  import { PrefixContext } from './usePrefix.js';
17
17
  import { warning } from './warning.js';
18
- import { wrapFocus, wrapFocusWithoutSentinels } from './wrapFocus.js';
18
+ import { wrapFocusWithoutSentinels, wrapFocus } from './wrapFocus.js';
19
19
 
20
20
  const DIRECTION_LEFT = 'left';
21
21
  const DIRECTION_TOP = 'top';
@@ -13,7 +13,7 @@ const deprecateFieldOnObject = (object, field, Component, message) => {
13
13
  enumerable: true,
14
14
  get: () => {
15
15
  if (!didWarnAboutDeprecation[field]) {
16
- process.env.NODE_ENV !== "production" ? warning(false, message || `The ${field} field has been deprecated on the ${object.displayName} object. ` + `Please import and use ${Component.displayName || Component.name || 'the field'} directly.`) : void 0;
16
+ process.env.NODE_ENV !== "production" ? warning(false, `The ${field} field has been deprecated on the ${object.displayName} object. ` + `Please import and use ${Component.displayName || Component.name || 'the field'} directly.`) : void 0;
17
17
  didWarnAboutDeprecation[field] = true;
18
18
  }
19
19
  return Component;
@@ -4,6 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import { type MutableRefObject } from 'react';
8
- export declare const useEvent: <E extends keyof GlobalEventHandlersEventMap>(elementOrRef: HTMLElement | MutableRefObject<HTMLElement | null>, eventName: E, callback: (event: GlobalEventHandlersEventMap[E]) => void) => void;
7
+ import { RefObject } from 'react';
8
+ export declare const useEvent: <E extends keyof GlobalEventHandlersEventMap>(elementOrRef: HTMLElement | RefObject<Element | null>, eventName: E, callback: (event: GlobalEventHandlersEventMap[E]) => void) => void;
9
9
  export declare const useWindowEvent: <E extends keyof WindowEventMap>(eventName: E, callback: (event: WindowEventMap[E]) => void) => void;
@@ -13,15 +13,16 @@ const useEvent = (elementOrRef, eventName, callback) => {
13
13
  savedCallback.current = callback;
14
14
  }, [callback]);
15
15
  useEffect(() => {
16
+ const element = 'current' in elementOrRef ? elementOrRef.current : elementOrRef;
17
+ if (!element) return;
16
18
  const handler = event => {
17
19
  if (savedCallback.current) {
18
20
  savedCallback.current(event);
19
21
  }
20
22
  };
21
- const element = 'current' in elementOrRef ? elementOrRef.current : elementOrRef;
22
- element?.addEventListener(eventName, handler);
23
+ element.addEventListener(eventName, handler);
23
24
  return () => {
24
- element?.removeEventListener(eventName, handler);
25
+ element.removeEventListener(eventName, handler);
25
26
  };
26
27
  }, [elementOrRef, eventName]);
27
28
  };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Generate a unique ID for React <=17 with an optional prefix prepended to it.
3
+ * This is an internal utility, not intended for public usage.
4
+ * @param {string} [prefix]
5
+ * @returns {string}
6
+ */
7
+ export function useCompatibleId(prefix?: string): string;
8
+ /**
9
+ * Generate a unique id if a given `id` is not provided
10
+ * This is an internal utility, not intended for public usage.
11
+ * @param {string|undefined} id
12
+ * @returns {string}
13
+ */
14
+ export function useFallbackId(id: string | undefined): string;
15
+ /**
16
+ * Generate a unique ID for React >=18 with an optional prefix prepended to it.
17
+ * This is an internal utility, not intended for public usage.
18
+ * @param {string} [prefix]
19
+ * @returns {string}
20
+ */
21
+ export function useId(prefix?: string): string;
@@ -5,12 +5,38 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import React, { useState, useEffect, useLayoutEffect } from 'react';
8
+ import React, { useState, useLayoutEffect, useEffect } from 'react';
9
9
  import { setupGetInstanceId } from '../tools/setupGetInstanceId.js';
10
10
  import { canUseDOM } from './environment.js';
11
11
  import { useIdPrefix } from './useIdPrefix.js';
12
12
 
13
13
  // This file was heavily inspired by:
14
+ //
15
+ // 1. Reach UI and their work on their auto-id package:
16
+ // https://github.com/reach/reach-ui/blob/86a046f54d53b6420e392b3fa56dd991d9d4e458/packages/auto-id/src/index.ts
17
+ //
18
+ // 2. Floating UI and their work on react >=18 compatibility
19
+ // https://github.com/floating-ui/floating-ui/blob/%40floating-ui/utils%400.2.5/packages/react/src/hooks/useId.ts
20
+ //
21
+ // The problem that this solves is an id mismatch when auto-generating
22
+ // ids on both the server and the client. When using server-side rendering,
23
+ // there can be the chance of a mismatch between what the server renders and
24
+ // what the client renders when the id value is auto-generated.
25
+ //
26
+ // To get around this, we set the initial value of the `id` to `null` and then
27
+ // conditionally use `useLayoutEffect` on the client and `useEffect` on the
28
+ // server. On the client, `useLayoutEffect` will patch up the id to the correct
29
+ // value. On the server, `useEffect` will not run.
30
+ //
31
+ // This ensures that we won't encounter a mismatch in ids between server and
32
+ // client, at the cost of runtime patching of the id value in
33
+ // `useLayoutEffect`
34
+ //
35
+ // React 18 introduced a new hook called `useId` that takes care of hydration
36
+ // mismatches. If the user is running React 18 or higher, the native hook is
37
+ // used via the `useReactId` function. If the user is running React 17 or
38
+ // lower, `useCompatibleId` is used.
39
+
14
40
 
15
41
  // This tricks bundlers so they can't statically analyze this and produce
16
42
  // compilation warnings/errors.
@@ -105,12 +105,6 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
105
105
 
106
106
  // Only call onChange if hidden items actually changed
107
107
  useEffect(() => {
108
- if (previousHiddenItems && onChange) {
109
- const hasChanged = hiddenItems.length !== previousHiddenItems.length || hiddenItems.some((item, index) => item !== previousHiddenItems[index]);
110
- if (hasChanged) {
111
- onChange(hiddenItems);
112
- }
113
- }
114
108
  }, [hiddenItems, previousHiddenItems, onChange]);
115
109
  return {
116
110
  visibleItems,
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { debounce as debounce$1 } from '../../function/debounce.mjs.js';
8
+ import { debounce as debounce$1 } from '../../function/debounce.js';
9
9
 
10
10
  function debounce(func, debounceMs = 0, options = {}) {
11
11
  if (typeof options !== 'object') {
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
 
8
- import { debounce } from './debounce.mjs.js';
8
+ import { debounce } from './debounce.js';
9
9
 
10
10
  function throttle(func, throttleMs = 0, options = {}) {
11
11
  if (typeof options !== 'object') {
@@ -0,0 +1 @@
1
+ export default function deprecateComponent(componentName: any, message: any): any;
@@ -9,12 +9,9 @@ import { warning } from '../internal/warning.js';
9
9
 
10
10
  const didWarnAboutDeprecation = {};
11
11
  function deprecateComponent(componentName, message) {
12
- if (!componentName) {
13
- return;
14
- }
15
12
  if (!didWarnAboutDeprecation[componentName]) {
16
13
  didWarnAboutDeprecation[componentName] = true;
17
- process.env.NODE_ENV !== "production" ? warning(false, message || `The ${componentName} component has been deprecated and will be removed in the next major release.`) : void 0;
14
+ process.env.NODE_ENV !== "production" ? warning(false, message) : void 0;
18
15
  }
19
16
  return componentName;
20
17
  }
@@ -0,0 +1 @@
1
+ export default function deprecateValuesWithin(propType: any, allowedValues: any, propMappingFunction: any): (props: any, propName: any, componentName: any, ...rest: any[]) => any;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2023
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /**
8
+ * @param {string} name The name of the prop that must exist to validate
9
+ * the current prop.
10
+ * @param {React.Validator} propType The original prop type checker.
11
+ * @returns {React.Validator} The new prop type checker for the current prop that
12
+ * becomes required if the prop corresponding to the provided prop name exists.
13
+ */
14
+ export default function requiredIfGivenPropIsTruthy(name: string, propType: React.Validator): React.Validator;
@@ -0,0 +1,12 @@
1
+ export default mergeRefs;
2
+ /**
3
+ * Copyright IBM Corp. 2016, 2023
4
+ *
5
+ * This source code is licensed under the Apache-2.0 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+ /**
9
+ * @param {...Ref<Element>} refs List of React refs to merge.
10
+ * @returns {Ref<Element>} Merged React ref.
11
+ */
12
+ declare function mergeRefs(...refs: Ref<Element>[]): Ref<Element>;
@@ -19,6 +19,5 @@ const mergeRefs = (...refs) => el => {
19
19
  }
20
20
  });
21
21
  };
22
- var mergeRefs$1 = mergeRefs;
23
22
 
24
- export { mergeRefs$1 as default };
23
+ export { mergeRefs as default };
package/icons/index.js CHANGED
@@ -7,14 +7,12 @@
7
7
 
8
8
  'use strict';
9
9
 
10
- Object.defineProperty(exports, '__esModule', { value: true });
11
-
12
10
  var iconsReact = require('@carbon/icons-react');
13
11
 
14
12
 
15
13
 
16
14
  Object.keys(iconsReact).forEach(function (k) {
17
- if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
15
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
18
16
  enumerable: true,
19
17
  get: function () { return iconsReact[k]; }
20
18
  });
@@ -7,14 +7,12 @@
7
7
 
8
8
  'use strict';
9
9
 
10
- Object.defineProperty(exports, '__esModule', { value: true });
11
-
12
10
  function _defineProperty(e, r, t) {
13
11
  return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
14
12
  value: t,
15
- enumerable: !0,
16
- configurable: !0,
17
- writable: !0
13
+ enumerable: true,
14
+ configurable: true,
15
+ writable: true
18
16
  }) : e[r] = t, e;
19
17
  }
20
18
  function _extends() {
@@ -30,7 +28,7 @@ function _toPrimitive(t, r) {
30
28
  if ("object" != typeof t || !t) return t;
31
29
  var e = t[Symbol.toPrimitive];
32
30
  if (void 0 !== e) {
33
- var i = e.call(t, r || "default");
31
+ var i = e.call(t, r);
34
32
  if ("object" != typeof i) return i;
35
33
  throw new TypeError("@@toPrimitive must return a primitive value.");
36
34
  }
@@ -42,6 +40,6 @@ function _toPropertyKey(t) {
42
40
  }
43
41
 
44
42
  exports.defineProperty = _defineProperty;
45
- exports["extends"] = _extends;
43
+ exports.extends = _extends;
46
44
  exports.toPrimitive = _toPrimitive;
47
45
  exports.toPropertyKey = _toPropertyKey;