@carbon/react 1.78.2 → 1.79.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 (249) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +835 -835
  2. package/es/components/Accordion/AccordionItem.js +2 -2
  3. package/es/components/Button/Button.d.ts +2 -3
  4. package/es/components/Button/Button.js +29 -19
  5. package/es/components/Button/ButtonBase.js +3 -1
  6. package/es/components/ChatButton/ChatButton.d.ts +2 -3
  7. package/es/components/ChatButton/ChatButton.js +1 -2
  8. package/es/components/ComboBox/ComboBox.js +34 -24
  9. package/es/components/ComposedModal/ComposedModal.js +65 -51
  10. package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
  11. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
  12. package/es/components/ContentSwitcher/ContentSwitcher.js +3 -3
  13. package/es/components/DataTable/TableBatchAction.d.ts +3 -3
  14. package/es/components/DataTable/TableBatchAction.js +1 -1
  15. package/es/components/DataTable/TableContainer.d.ts +1 -1
  16. package/es/components/DataTable/TableContainer.js +5 -4
  17. package/es/components/DataTable/TableExpandHeader.d.ts +6 -5
  18. package/es/components/DataTable/TableToolbarMenu.d.ts +2 -2
  19. package/es/components/DataTable/TableToolbarMenu.js +1 -1
  20. package/es/components/DatePicker/DatePicker.js +2 -2
  21. package/es/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
  22. package/es/components/Dialog/index.d.ts +42 -4
  23. package/es/components/Dialog/index.js +177 -0
  24. package/es/components/ExpandableSearch/ExpandableSearch.js +2 -2
  25. package/es/components/FeatureFlags/index.d.ts +3 -1
  26. package/es/components/FeatureFlags/index.js +3 -0
  27. package/es/components/FileUploader/FileUploader.d.ts +1 -1
  28. package/es/components/FileUploader/FileUploader.js +2 -2
  29. package/es/components/FileUploader/FileUploaderButton.js +2 -2
  30. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  31. package/es/components/FileUploader/FileUploaderDropContainer.js +6 -4
  32. package/es/components/FileUploader/FileUploaderItem.d.ts +1 -1
  33. package/es/components/FileUploader/FileUploaderItem.js +2 -2
  34. package/es/components/Grid/CSSGrid.js +18 -14
  35. package/es/components/Grid/Column.d.ts +2 -2
  36. package/es/components/Grid/Column.js +7 -8
  37. package/es/components/Grid/FlexGrid.js +7 -6
  38. package/es/components/Grid/GridTypes.d.ts +5 -3
  39. package/es/components/IconButton/index.d.ts +2 -2
  40. package/es/components/IconButton/index.js +4 -4
  41. package/es/components/Layer/index.d.ts +4 -6
  42. package/es/components/Layer/index.js +5 -6
  43. package/es/components/Link/Link.d.ts +2 -3
  44. package/es/components/Link/Link.js +1 -2
  45. package/es/components/ListBox/ListBoxMenuItem.d.ts +3 -3
  46. package/es/components/ListBox/ListBoxMenuItem.js +37 -15
  47. package/es/components/Menu/Menu.js +2 -2
  48. package/es/components/Menu/MenuItem.d.ts +2 -2
  49. package/es/components/Menu/MenuItem.js +3 -3
  50. package/es/components/Modal/Modal.js +121 -49
  51. package/es/components/ModalWrapper/ModalWrapper.js +1 -1
  52. package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
  53. package/es/components/MultiSelect/MultiSelect.js +2 -2
  54. package/es/components/MultiSelect/index.d.ts +1 -1
  55. package/es/components/MultiSelect/index.js +1 -8
  56. package/es/components/Notification/Notification.d.ts +5 -13
  57. package/es/components/Notification/Notification.js +3 -4
  58. package/es/components/OverflowMenu/OverflowMenu.d.ts +22 -201
  59. package/es/components/OverflowMenu/OverflowMenu.js +269 -338
  60. package/es/components/OverflowMenu/index.d.ts +5 -5
  61. package/es/components/OverflowMenu/index.js +2 -2
  62. package/es/components/OverflowMenu/next/index.d.ts +4 -4
  63. package/es/components/OverflowMenu/next/index.js +1 -1
  64. package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  65. package/es/components/ProgressIndicator/ProgressIndicator.js +2 -2
  66. package/es/components/RadioTile/RadioTile.js +2 -2
  67. package/es/components/Search/Search.d.ts +2 -3
  68. package/es/components/Search/Search.js +4 -6
  69. package/es/components/Slider/Slider.d.ts +39 -44
  70. package/es/components/Slider/Slider.js +57 -59
  71. package/es/components/Tabs/Tabs.d.ts +3 -6
  72. package/es/components/Tabs/Tabs.js +16 -18
  73. package/es/components/Tag/DismissibleTag.d.ts +3 -5
  74. package/es/components/Tag/DismissibleTag.js +1 -2
  75. package/es/components/Tag/OperationalTag.d.ts +2 -3
  76. package/es/components/Tag/OperationalTag.js +1 -2
  77. package/es/components/Tag/SelectableTag.d.ts +3 -5
  78. package/es/components/Tag/SelectableTag.js +1 -2
  79. package/es/components/Tag/Tag.d.ts +2 -3
  80. package/es/components/Tag/Tag.js +1 -2
  81. package/es/components/Tile/Tile.d.ts +3 -5
  82. package/es/components/Tile/Tile.js +16 -10
  83. package/es/components/Toggletip/index.js +2 -2
  84. package/es/components/Tooltip/DefinitionTooltip.js +2 -2
  85. package/es/components/Tooltip/Tooltip.d.ts +1 -1
  86. package/es/components/Tooltip/Tooltip.js +2 -2
  87. package/es/components/TreeView/TreeNode.d.ts +3 -5
  88. package/es/components/TreeView/TreeNode.js +3 -4
  89. package/es/components/TreeView/TreeView.js +2 -2
  90. package/es/components/UIShell/HeaderContainer.js +2 -2
  91. package/es/components/UIShell/HeaderMenu.js +2 -2
  92. package/es/components/UIShell/HeaderPanel.js +2 -2
  93. package/es/components/UIShell/SideNav.d.ts +1 -1
  94. package/es/components/UIShell/SideNav.js +2 -2
  95. package/es/components/UIShell/SideNavHeader.d.ts +2 -3
  96. package/es/components/UIShell/SideNavHeader.js +1 -2
  97. package/es/components/UIShell/SideNavLink.d.ts +2 -2
  98. package/es/components/UIShell/SideNavLink.js +1 -1
  99. package/es/components/UIShell/SideNavMenu.d.ts +2 -2
  100. package/es/components/UIShell/SideNavMenu.js +3 -3
  101. package/es/components/UIShell/SwitcherItem.js +2 -2
  102. package/es/index.js +1 -1
  103. package/es/internal/FloatingMenu.d.ts +2 -2
  104. package/es/internal/FloatingMenu.js +8 -5
  105. package/es/internal/OptimizedResize.d.ts +18 -0
  106. package/es/internal/OptimizedResize.js +21 -24
  107. package/es/internal/createClassWrapper.d.ts +3 -3
  108. package/es/internal/createClassWrapper.js +4 -4
  109. package/es/internal/keyboard/index.d.ts +9 -0
  110. package/es/internal/keyboard/keys.d.ts +23 -0
  111. package/es/internal/keyboard/keys.js +2 -2
  112. package/es/internal/keyboard/match.d.ts +26 -0
  113. package/es/internal/keyboard/match.js +17 -41
  114. package/es/internal/keyboard/navigation.d.ts +37 -0
  115. package/es/internal/keyboard/navigation.js +15 -27
  116. package/es/internal/useMatchMedia.d.ts +8 -0
  117. package/es/internal/useMatchMedia.js +10 -20
  118. package/es/internal/useMergedRefs.js +3 -0
  119. package/es/internal/useNormalizedInputProps.d.ts +52 -0
  120. package/es/internal/useNormalizedInputProps.js +9 -36
  121. package/lib/components/Accordion/AccordionItem.js +2 -2
  122. package/lib/components/Button/Button.d.ts +2 -3
  123. package/lib/components/Button/Button.js +29 -19
  124. package/lib/components/Button/ButtonBase.js +3 -1
  125. package/lib/components/ChatButton/ChatButton.d.ts +2 -3
  126. package/lib/components/ChatButton/ChatButton.js +1 -2
  127. package/lib/components/ComboBox/ComboBox.js +34 -24
  128. package/lib/components/ComposedModal/ComposedModal.js +64 -50
  129. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
  130. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
  131. package/lib/components/ContentSwitcher/ContentSwitcher.js +3 -3
  132. package/lib/components/DataTable/TableBatchAction.d.ts +3 -3
  133. package/lib/components/DataTable/TableBatchAction.js +1 -1
  134. package/lib/components/DataTable/TableContainer.d.ts +1 -1
  135. package/lib/components/DataTable/TableContainer.js +5 -4
  136. package/lib/components/DataTable/TableExpandHeader.d.ts +6 -5
  137. package/lib/components/DataTable/TableToolbarMenu.d.ts +2 -2
  138. package/lib/components/DataTable/TableToolbarMenu.js +1 -1
  139. package/lib/components/DatePicker/DatePicker.js +2 -2
  140. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
  141. package/lib/components/Dialog/index.d.ts +42 -4
  142. package/lib/components/Dialog/index.js +190 -0
  143. package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
  144. package/lib/components/FeatureFlags/index.d.ts +3 -1
  145. package/lib/components/FeatureFlags/index.js +3 -0
  146. package/lib/components/FileUploader/FileUploader.d.ts +1 -1
  147. package/lib/components/FileUploader/FileUploader.js +2 -2
  148. package/lib/components/FileUploader/FileUploaderButton.js +2 -2
  149. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  150. package/lib/components/FileUploader/FileUploaderDropContainer.js +6 -4
  151. package/lib/components/FileUploader/FileUploaderItem.d.ts +1 -1
  152. package/lib/components/FileUploader/FileUploaderItem.js +2 -2
  153. package/lib/components/Grid/CSSGrid.js +18 -14
  154. package/lib/components/Grid/Column.d.ts +2 -2
  155. package/lib/components/Grid/Column.js +7 -8
  156. package/lib/components/Grid/FlexGrid.js +7 -6
  157. package/lib/components/Grid/GridTypes.d.ts +5 -3
  158. package/lib/components/IconButton/index.d.ts +2 -2
  159. package/lib/components/IconButton/index.js +4 -4
  160. package/lib/components/Layer/index.d.ts +4 -6
  161. package/lib/components/Layer/index.js +5 -6
  162. package/lib/components/Link/Link.d.ts +2 -3
  163. package/lib/components/Link/Link.js +1 -2
  164. package/lib/components/ListBox/ListBoxMenuItem.d.ts +3 -3
  165. package/lib/components/ListBox/ListBoxMenuItem.js +36 -14
  166. package/lib/components/Menu/Menu.js +2 -2
  167. package/lib/components/Menu/MenuItem.d.ts +2 -2
  168. package/lib/components/Menu/MenuItem.js +3 -3
  169. package/lib/components/Modal/Modal.js +123 -51
  170. package/lib/components/ModalWrapper/ModalWrapper.js +1 -1
  171. package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -3
  172. package/lib/components/MultiSelect/MultiSelect.js +2 -2
  173. package/lib/components/MultiSelect/index.d.ts +1 -1
  174. package/lib/components/MultiSelect/index.js +1 -8
  175. package/lib/components/Notification/Notification.d.ts +5 -13
  176. package/lib/components/Notification/Notification.js +3 -4
  177. package/lib/components/OverflowMenu/OverflowMenu.d.ts +22 -201
  178. package/lib/components/OverflowMenu/OverflowMenu.js +268 -336
  179. package/lib/components/OverflowMenu/index.d.ts +5 -5
  180. package/lib/components/OverflowMenu/index.js +2 -2
  181. package/lib/components/OverflowMenu/next/index.d.ts +4 -4
  182. package/lib/components/OverflowMenu/next/index.js +1 -1
  183. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  184. package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
  185. package/lib/components/RadioTile/RadioTile.js +2 -2
  186. package/lib/components/Search/Search.d.ts +2 -3
  187. package/lib/components/Search/Search.js +4 -6
  188. package/lib/components/Slider/Slider.d.ts +39 -44
  189. package/lib/components/Slider/Slider.js +57 -59
  190. package/lib/components/Tabs/Tabs.d.ts +3 -6
  191. package/lib/components/Tabs/Tabs.js +16 -18
  192. package/lib/components/Tag/DismissibleTag.d.ts +3 -5
  193. package/lib/components/Tag/DismissibleTag.js +1 -2
  194. package/lib/components/Tag/OperationalTag.d.ts +2 -3
  195. package/lib/components/Tag/OperationalTag.js +1 -2
  196. package/lib/components/Tag/SelectableTag.d.ts +3 -5
  197. package/lib/components/Tag/SelectableTag.js +1 -2
  198. package/lib/components/Tag/Tag.d.ts +2 -3
  199. package/lib/components/Tag/Tag.js +1 -2
  200. package/lib/components/Tile/Tile.d.ts +3 -5
  201. package/lib/components/Tile/Tile.js +16 -10
  202. package/lib/components/Toggletip/index.js +2 -2
  203. package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
  204. package/lib/components/Tooltip/Tooltip.d.ts +1 -1
  205. package/lib/components/Tooltip/Tooltip.js +2 -2
  206. package/lib/components/TreeView/TreeNode.d.ts +3 -5
  207. package/lib/components/TreeView/TreeNode.js +3 -4
  208. package/lib/components/TreeView/TreeView.js +2 -2
  209. package/lib/components/UIShell/HeaderContainer.js +2 -2
  210. package/lib/components/UIShell/HeaderMenu.js +2 -2
  211. package/lib/components/UIShell/HeaderPanel.js +2 -2
  212. package/lib/components/UIShell/SideNav.d.ts +1 -1
  213. package/lib/components/UIShell/SideNav.js +2 -2
  214. package/lib/components/UIShell/SideNavHeader.d.ts +2 -3
  215. package/lib/components/UIShell/SideNavHeader.js +1 -2
  216. package/lib/components/UIShell/SideNavLink.d.ts +2 -2
  217. package/lib/components/UIShell/SideNavLink.js +1 -1
  218. package/lib/components/UIShell/SideNavMenu.d.ts +2 -2
  219. package/lib/components/UIShell/SideNavMenu.js +3 -3
  220. package/lib/components/UIShell/SwitcherItem.js +2 -2
  221. package/lib/index.js +2 -2
  222. package/lib/internal/FloatingMenu.d.ts +2 -2
  223. package/lib/internal/FloatingMenu.js +9 -6
  224. package/lib/internal/OptimizedResize.d.ts +18 -0
  225. package/lib/internal/OptimizedResize.js +21 -24
  226. package/lib/internal/createClassWrapper.d.ts +3 -3
  227. package/lib/internal/createClassWrapper.js +4 -4
  228. package/lib/internal/keyboard/index.d.ts +9 -0
  229. package/lib/internal/keyboard/keys.d.ts +23 -0
  230. package/lib/internal/keyboard/keys.js +2 -2
  231. package/lib/internal/keyboard/match.d.ts +26 -0
  232. package/lib/internal/keyboard/match.js +17 -41
  233. package/lib/internal/keyboard/navigation.d.ts +37 -0
  234. package/lib/internal/keyboard/navigation.js +15 -27
  235. package/lib/internal/useMatchMedia.d.ts +8 -0
  236. package/lib/internal/useMatchMedia.js +10 -20
  237. package/lib/internal/useMergedRefs.js +3 -0
  238. package/lib/internal/useNormalizedInputProps.d.ts +52 -0
  239. package/lib/internal/useNormalizedInputProps.js +9 -36
  240. package/package.json +6 -6
  241. package/scss/components/dialog/_dialog.scss +9 -0
  242. package/scss/components/dialog/_index.scss +9 -0
  243. package/telemetry.yml +1 -0
  244. package/es/components/Modal/next/index.d.ts +0 -171
  245. package/es/internal/focus/index.js +0 -15
  246. package/es/internal/useEffectOnce.js +0 -30
  247. package/lib/components/Modal/next/index.d.ts +0 -171
  248. package/lib/internal/focus/index.js +0 -19
  249. package/lib/internal/useEffectOnce.js +0 -34
@@ -119,8 +119,7 @@ DismissibleTag.propTypes = {
119
119
  */
120
120
  onClose: PropTypes.func,
121
121
  /**
122
- * Optional prop to render a custom icon.
123
- * Can be a React component class
122
+ * A component used to render an icon.
124
123
  */
125
124
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
126
125
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -33,8 +33,7 @@ export interface OperationalTagBaseProps {
33
33
  */
34
34
  id?: string;
35
35
  /**
36
- * Optional prop to render a custom icon.
37
- * Can be a React component class
36
+ * A component used to render an icon.
38
37
  */
39
38
  renderIcon?: React.ElementType;
40
39
  onClick?: MouseEventHandler;
@@ -101,8 +101,7 @@ OperationalTag.propTypes = {
101
101
  */
102
102
  id: PropTypes.string,
103
103
  /**
104
- * Optional prop to render a custom icon.
105
- * Can be a React component class
104
+ * A component used to render an icon.
106
105
  */
107
106
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
108
107
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -22,8 +22,7 @@ export interface SelectableTagBaseProps {
22
22
  */
23
23
  id?: string;
24
24
  /**
25
- * Optional prop to render a custom icon.
26
- * Can be a React component class
25
+ * A component used to render an icon.
27
26
  */
28
27
  renderIcon?: React.ElementType;
29
28
  /**
@@ -65,8 +64,7 @@ declare const SelectableTag: {
65
64
  */
66
65
  id: PropTypes.Requireable<string>;
67
66
  /**
68
- * Optional prop to render a custom icon.
69
- * Can be a React component class
67
+ * A component used to render an icon.
70
68
  */
71
69
  renderIcon: PropTypes.Requireable<object>;
72
70
  /**
@@ -98,8 +98,7 @@ SelectableTag.propTypes = {
98
98
  */
99
99
  id: PropTypes.string,
100
100
  /**
101
- * Optional prop to render a custom icon.
102
- * Can be a React component class
101
+ * A component used to render an icon.
103
102
  */
104
103
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
105
104
  /**
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -58,8 +58,7 @@ export interface TagBaseProps {
58
58
  */
59
59
  onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
60
60
  /**
61
- * Optional prop to render a custom icon.
62
- * Can be a React component class
61
+ * A component used to render an icon.
63
62
  */
64
63
  renderIcon?: React.ElementType;
65
64
  /**
@@ -176,8 +176,7 @@ Tag.propTypes = {
176
176
  */
177
177
  onClose: deprecate(PropTypes.func, 'The `onClose` prop has been deprecated and will be removed in the next major version. Use DismissibleTag instead.'),
178
178
  /**
179
- * Optional prop to render a custom icon.
180
- * Can be a React component class
179
+ * A component used to render an icon.
181
180
  */
182
181
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
183
182
  /**
@@ -4,7 +4,7 @@
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 React, { type ReactNode, type MouseEvent, type KeyboardEvent, type HTMLAttributes, type ChangeEvent, type ComponentType } from 'react';
7
+ import React, { type ReactNode, type MouseEvent, type KeyboardEvent, type HTMLAttributes, type ChangeEvent } from 'react';
8
8
  export interface TileProps extends HTMLAttributes<HTMLDivElement> {
9
9
  children?: ReactNode;
10
10
  className?: string;
@@ -53,11 +53,9 @@ export interface ClickableTileProps extends HTMLAttributes<HTMLAnchorElement> {
53
53
  */
54
54
  href?: string;
55
55
  /**
56
- * Optional prop to allow overriding the icon rendering.
56
+ * A component used to render an icon.
57
57
  */
58
- renderIcon?: ComponentType<{
59
- className?: string;
60
- }>;
58
+ renderIcon?: React.ElementType;
61
59
  /**
62
60
  * Specify the function to run when the ClickableTile is clicked
63
61
  */
@@ -11,6 +11,8 @@ import PropTypes from 'prop-types';
11
11
  import cx from 'classnames';
12
12
  import { AiLabel, CheckboxCheckedFilled, Checkbox, ChevronDown, ArrowRight, Error } from '@carbon/icons-react';
13
13
  import Link from '../Link/Link.js';
14
+ import { Enter, Space } from '../../internal/keyboard/keys.js';
15
+ import { matches } from '../../internal/keyboard/match.js';
14
16
  import deprecate from '../../prop-types/deprecate.js';
15
17
  import { composeEventHandlers } from '../../tools/events.js';
16
18
  import { usePrefix } from '../../internal/usePrefix.js';
@@ -20,9 +22,7 @@ import { useMergedRefs } from '../../internal/useMergedRefs.js';
20
22
  import { useFeatureFlag } from '../FeatureFlags/index.js';
21
23
  import { useId } from '../../internal/useId.js';
22
24
  import '../Text/index.js';
23
- import { matches } from '../../internal/keyboard/match.js';
24
25
  import { Text } from '../Text/Text.js';
25
- import { Enter, Space } from '../../internal/keyboard/keys.js';
26
26
 
27
27
  var _CheckboxCheckedFille, _Checkbox, _ChevronDown, _ChevronDown2;
28
28
  const Tile = /*#__PURE__*/React__default.forwardRef(function Tile(_ref, ref) {
@@ -201,8 +201,7 @@ ClickableTile.propTypes = {
201
201
  */
202
202
  rel: PropTypes.string,
203
203
  /**
204
- * Optional prop to allow overriding the icon rendering.
205
- * Can be a React component class
204
+ * A component used to render an icon.
206
205
  */
207
206
  // @ts-expect-error: Invalid derived prop type, seemingly no real solution.
208
207
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
@@ -245,22 +244,29 @@ const SelectableTile = /*#__PURE__*/React__default.forwardRef(function Selectabl
245
244
  if (normalizedDecorator && decoratorRef.current && decoratorRef.current.contains(evt.target)) {
246
245
  return;
247
246
  }
248
- setIsSelected(!isSelected);
247
+ setIsSelected(prevSelected => {
248
+ const newSelected = !prevSelected;
249
+ onChange(evt, newSelected, id);
250
+ return newSelected;
251
+ });
249
252
  clickHandler(evt);
250
- onChange(evt, isSelected, id);
251
253
  }
252
254
  function handleKeyDown(evt) {
253
255
  evt?.persist?.();
254
256
  if (matches(evt, [Enter, Space])) {
255
257
  evt.preventDefault();
256
- setIsSelected(!isSelected);
257
- onChange(evt, isSelected, id);
258
+ setIsSelected(prevSelected => {
259
+ const newSelected = !prevSelected;
260
+ onChange(evt, newSelected, id);
261
+ return newSelected;
262
+ });
258
263
  }
259
264
  keyDownHandler(evt);
260
265
  }
261
266
  function handleChange(event) {
262
- setIsSelected(event.target.checked);
263
- onChange(event, isSelected, id);
267
+ const newSelected = event.target.checked;
268
+ setIsSelected(newSelected);
269
+ onChange(event, newSelected, id);
264
270
  }
265
271
  if (selected !== prevSelected) {
266
272
  setIsSelected(selected);
@@ -10,11 +10,11 @@ import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default, { useRef, useState, useContext } from 'react';
12
12
  import { Popover, PopoverContent } from '../Popover/index.js';
13
+ import { Escape } from '../../internal/keyboard/keys.js';
14
+ import { match } from '../../internal/keyboard/match.js';
13
15
  import { useWindowEvent } from '../../internal/useEvent.js';
14
16
  import { useId } from '../../internal/useId.js';
15
17
  import { usePrefix } from '../../internal/usePrefix.js';
16
- import { match } from '../../internal/keyboard/match.js';
17
- import { Escape } from '../../internal/keyboard/keys.js';
18
18
 
19
19
  /**
20
20
  * Used to render the label for a Toggletip
@@ -10,11 +10,11 @@ import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default, { useState } from 'react';
12
12
  import { Popover, PopoverContent } from '../Popover/index.js';
13
+ import { Escape } from '../../internal/keyboard/keys.js';
14
+ import { match } from '../../internal/keyboard/match.js';
13
15
  import { useFallbackId } from '../../internal/useId.js';
14
16
  import { usePrefix } from '../../internal/usePrefix.js';
15
17
  import deprecate from '../../prop-types/deprecate.js';
16
- import { match } from '../../internal/keyboard/match.js';
17
- import { Escape } from '../../internal/keyboard/keys.js';
18
18
 
19
19
  const DefinitionTooltip = _ref => {
20
20
  let {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -10,13 +10,13 @@ import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default, { useRef, useState, useCallback, useEffect } from 'react';
12
12
  import { Popover, PopoverContent } from '../Popover/index.js';
13
+ import { Escape, Enter, Space } from '../../internal/keyboard/keys.js';
14
+ import { match } from '../../internal/keyboard/match.js';
13
15
  import { useDelayedState } from '../../internal/useDelayedState.js';
14
16
  import { useId } from '../../internal/useId.js';
15
17
  import { useNoInteractiveChildren } from '../../internal/useNoInteractiveChildren.js';
16
18
  import { usePrefix } from '../../internal/usePrefix.js';
17
19
  import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
18
- import { match } from '../../internal/keyboard/match.js';
19
- import { Escape, Enter, Space } from '../../internal/keyboard/keys.js';
20
20
 
21
21
  /**
22
22
  * Event types that trigger a "drag" to stop.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -62,8 +62,7 @@ export type TreeNodeProps = {
62
62
  */
63
63
  onTreeSelect?: (event: React.MouseEvent, node?: TreeNodeProps) => void;
64
64
  /**
65
- * Optional prop to allow each node to have an associated icon.
66
- * Can be a React component class
65
+ * A component used to render an icon.
67
66
  */
68
67
  renderIcon?: ComponentType | FunctionComponent;
69
68
  /**
@@ -137,8 +136,7 @@ declare const TreeNode: React.ForwardRefExoticComponent<{
137
136
  */
138
137
  onTreeSelect?: (event: React.MouseEvent, node?: TreeNodeProps) => void;
139
138
  /**
140
- * Optional prop to allow each node to have an associated icon.
141
- * Can be a React component class
139
+ * A component used to render an icon.
142
140
  */
143
141
  renderIcon?: ComponentType | FunctionComponent;
144
142
  /**
@@ -10,12 +10,12 @@ import { CaretDown } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import React__default, { useRef, useState, useEffect } from 'react';
13
+ import { ArrowLeft, ArrowRight, Enter, Space } from '../../internal/keyboard/keys.js';
14
+ import { matches, match } from '../../internal/keyboard/match.js';
13
15
  import { useControllableState } from '../../internal/useControllableState.js';
14
16
  import { usePrefix } from '../../internal/usePrefix.js';
15
17
  import uniqueId from '../../tools/uniqueId.js';
16
18
  import { useFeatureFlag } from '../FeatureFlags/index.js';
17
- import { matches, match } from '../../internal/keyboard/match.js';
18
- import { ArrowLeft, ArrowRight, Enter, Space } from '../../internal/keyboard/keys.js';
19
19
 
20
20
  const TreeNode = /*#__PURE__*/React__default.forwardRef((_ref, forwardedRef) => {
21
21
  let {
@@ -400,8 +400,7 @@ TreeNode.propTypes = {
400
400
  */
401
401
  onTreeSelect: PropTypes.func,
402
402
  /**
403
- * Optional prop to allow each node to have an associated icon.
404
- * Can be a React component class
403
+ * A component used to render an icon.
405
404
  */
406
405
  // @ts-ignore
407
406
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
@@ -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 React__default, { useRef, useState, useEffect } from 'react';
12
+ import { ArrowUp, ArrowDown, Home, End } from '../../internal/keyboard/keys.js';
13
+ import { matches, match } from '../../internal/keyboard/match.js';
12
14
  import { useControllableState } from '../../internal/useControllableState.js';
13
15
  import { usePrefix } from '../../internal/usePrefix.js';
14
16
  import uniqueId from '../../tools/uniqueId.js';
15
17
  import { useFeatureFlag } from '../FeatureFlags/index.js';
16
18
  import TreeNode from './TreeNode.js';
17
- import { matches, match } from '../../internal/keyboard/match.js';
18
- import { ArrowUp, ArrowDown, Home, End } from '../../internal/keyboard/keys.js';
19
19
 
20
20
  const TreeView = _ref => {
21
21
  let {
@@ -8,9 +8,9 @@
8
8
  import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
9
9
  import PropTypes from 'prop-types';
10
10
  import React__default, { useState, useCallback } from 'react';
11
- import { useWindowEvent } from '../../internal/useEvent.js';
12
- import { match } from '../../internal/keyboard/match.js';
13
11
  import { Escape } from '../../internal/keyboard/keys.js';
12
+ import { match } from '../../internal/keyboard/match.js';
13
+ import { useWindowEvent } from '../../internal/useEvent.js';
14
14
 
15
15
  function HeaderContainer(_ref) {
16
16
  let {
@@ -10,12 +10,12 @@ import { ChevronDown } from '@carbon/icons-react';
10
10
  import cx from 'classnames';
11
11
  import React__default from 'react';
12
12
  import PropTypes from 'prop-types';
13
+ import { Enter, Space, Escape } from '../../internal/keyboard/keys.js';
14
+ import { matches } from '../../internal/keyboard/match.js';
13
15
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
14
16
  import { PrefixContext } from '../../internal/usePrefix.js';
15
17
  import deprecate from '../../prop-types/deprecate.js';
16
18
  import { composeEventHandlers } from '../../tools/events.js';
17
- import { matches } from '../../internal/keyboard/match.js';
18
- import { Enter, Space, Escape } from '../../internal/keyboard/keys.js';
19
19
 
20
20
  /**
21
21
  * `HeaderMenu` is used to render submenu's in the `Header`. Most often children
@@ -10,10 +10,10 @@ import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default, { useRef, useState } from 'react';
12
12
  import { usePrefix } from '../../internal/usePrefix.js';
13
+ import { Escape } from '../../internal/keyboard/keys.js';
14
+ import { match } from '../../internal/keyboard/match.js';
13
15
  import { useWindowEvent } from '../../internal/useEvent.js';
14
16
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
15
- import { match } from '../../internal/keyboard/match.js';
16
- import { Escape } from '../../internal/keyboard/keys.js';
17
17
 
18
18
  const noopFn = () => {};
19
19
  const HeaderPanel = /*#__PURE__*/React__default.forwardRef(function HeaderPanel(_ref, ref) {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -12,13 +12,13 @@ import PropTypes from 'prop-types';
12
12
  import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
13
13
  import { CARBON_SIDENAV_ITEMS } from './_utils.js';
14
14
  import { usePrefix } from '../../internal/usePrefix.js';
15
+ import { Tab, Escape } from '../../internal/keyboard/keys.js';
16
+ import { match } from '../../internal/keyboard/match.js';
15
17
  import { useMergedRefs } from '../../internal/useMergedRefs.js';
16
18
  import { useWindowEvent } from '../../internal/useEvent.js';
17
19
  import { useDelayedState } from '../../internal/useDelayedState.js';
18
20
  import { breakpoints } from '@carbon/layout';
19
21
  import { useMatchMedia } from '../../internal/useMatchMedia.js';
20
- import { match } from '../../internal/keyboard/match.js';
21
- import { Tab, Escape } from '../../internal/keyboard/keys.js';
22
22
 
23
23
  // TO-DO: comment back in when footer is added for rails
24
24
  // import SideNavFooter from './SideNavFooter';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -20,8 +20,7 @@ export interface SideNavHeaderProps {
20
20
  */
21
21
  isSideNavExpanded?: boolean;
22
22
  /**
23
- * Provide an icon to render in the header of the side navigation. Should be
24
- * a React class.
23
+ * A component used to render an icon.
25
24
  */
26
25
  renderIcon: React.ComponentType;
27
26
  }
@@ -39,8 +39,7 @@ SideNavHeader.propTypes = {
39
39
  */
40
40
  isSideNavExpanded: PropTypes.bool,
41
41
  /**
42
- * Provide an icon to render in the header of the side navigation. Should be
43
- * a React class.
42
+ * A component used to render an icon.
44
43
  */
45
44
  // @ts-expect-error - PropTypes are unable to cover this case.
46
45
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]).isRequired
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -37,7 +37,7 @@ export type SideNavLinkProps<E extends ElementType> = LinkProps<E> & {
37
37
  */
38
38
  large?: boolean;
39
39
  /**
40
- * Provide an icon to render in the side navigation link. Should be a React class.
40
+ * A component used to render an icon.
41
41
  */
42
42
  renderIcon?: ComponentType;
43
43
  /**
@@ -69,7 +69,7 @@ SideNavLink.propTypes = {
69
69
  */
70
70
  large: PropTypes.bool,
71
71
  /**
72
- * Provide an icon to render in the side navigation link. Should be a React class.
72
+ * A component used to render an icon.
73
73
  */
74
74
  // @ts-expect-error - PropTypes are unable to cover this case.
75
75
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
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.
@@ -27,7 +27,7 @@ export interface SideNavMenuProps {
27
27
  */
28
28
  large?: boolean;
29
29
  /**
30
- * A custom icon to render next to the SideNavMenu title. This can be a function returning JSX or JSX itself.
30
+ * A component used to render an icon.
31
31
  */
32
32
  renderIcon?: React.ComponentType;
33
33
  /**
@@ -10,10 +10,10 @@ import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default, { useContext, useState } from 'react';
12
12
  import SideNavIcon from './SideNavIcon.js';
13
+ import { Escape } from '../../internal/keyboard/keys.js';
14
+ import { match } from '../../internal/keyboard/match.js';
13
15
  import { usePrefix } from '../../internal/usePrefix.js';
14
16
  import { SideNavContext } from './SideNav.js';
15
- import { match } from '../../internal/keyboard/match.js';
16
- import { Escape } from '../../internal/keyboard/keys.js';
17
17
 
18
18
  var _ChevronDown;
19
19
  const SideNavMenu = /*#__PURE__*/React__default.forwardRef(function SideNavMenu(_ref, ref) {
@@ -110,7 +110,7 @@ SideNavMenu.propTypes = {
110
110
  */
111
111
  large: PropTypes.bool,
112
112
  /**
113
- * Pass in a custom icon to render next to the `SideNavMenu` title
113
+ * A component used to render an icon.
114
114
  */
115
115
  // @ts-expect-error - PropTypes are unable to cover this case.
116
116
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
@@ -11,9 +11,9 @@ import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
12
  import { Link } from './Link.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
- import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
15
- import { match } from '../../internal/keyboard/match.js';
16
14
  import { ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
15
+ import { match } from '../../internal/keyboard/match.js';
16
+ import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
17
17
 
18
18
  const SwitcherItem = /*#__PURE__*/forwardRef(function SwitcherItem(props, forwardRef) {
19
19
  const {
package/es/index.js CHANGED
@@ -207,6 +207,7 @@ export { default as unstable_PageSelector } from './components/Pagination/experi
207
207
  export { default as unstable_Pagination } from './components/Pagination/experimental/Pagination.js';
208
208
  export { default as ContainedListItem } from './components/ContainedList/ContainedListItem/ContainedListItem.js';
209
209
  export { default as ContainedList } from './components/ContainedList/ContainedList.js';
210
+ export { default as MultiSelect } from './components/MultiSelect/MultiSelect.js';
210
211
  export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
211
212
  export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
212
213
  export { default as TextInput } from './components/TextInput/TextInput.js';
@@ -238,4 +239,3 @@ export { default as TableToolbarContent } from './components/DataTable/TableTool
238
239
  export { default as TableToolbarSearch } from './components/DataTable/TableToolbarSearch.js';
239
240
  export { default as TableToolbarMenu } from './components/DataTable/TableToolbarMenu.js';
240
241
  export { default as FilterableMultiSelect } from './components/MultiSelect/FilterableMultiSelect.js';
241
- export { default as MultiSelect } from './components/MultiSelect/MultiSelect.js';
@@ -10,8 +10,8 @@ export declare const DIRECTION_TOP = "top";
10
10
  export declare const DIRECTION_RIGHT = "right";
11
11
  export declare const DIRECTION_BOTTOM = "bottom";
12
12
  export interface Offset {
13
- top?: number;
14
- left?: number;
13
+ top: number;
14
+ left: number;
15
15
  }
16
16
  interface Container {
17
17
  rect: DOMRect;
@@ -9,13 +9,13 @@ import React__default, { useContext, useState, useRef, useCallback, useEffect, c
9
9
  import * as FeatureFlags from '@carbon/feature-flags';
10
10
  import ReactDOM from 'react-dom';
11
11
  import window from 'window-or-global';
12
- import OptimizedResize from './OptimizedResize.js';
12
+ import { Tab } from './keyboard/keys.js';
13
+ import { match } from './keyboard/match.js';
13
14
  import { selectorTabbable, selectorFocusable } from './keyboard/navigation.js';
15
+ import { OptimizedResize } from './OptimizedResize.js';
14
16
  import { PrefixContext } from './usePrefix.js';
15
17
  import { warning } from './warning.js';
16
18
  import wrapFocus, { wrapFocusWithoutSentinels } from './wrapFocus.js';
17
- import { match } from './keyboard/match.js';
18
- import { Tab } from './keyboard/keys.js';
19
19
 
20
20
  const DIRECTION_LEFT = 'left';
21
21
  const DIRECTION_TOP = 'top';
@@ -83,7 +83,10 @@ const FloatingMenu = _ref2 => {
83
83
  flipped,
84
84
  focusTrap,
85
85
  menuDirection = DIRECTION_BOTTOM,
86
- menuOffset = {},
86
+ menuOffset = {
87
+ top: 0,
88
+ left: 0
89
+ },
87
90
  menuRef: externalMenuRef,
88
91
  onPlace,
89
92
  selectorPrimaryFocus,
@@ -205,7 +208,7 @@ const FloatingMenu = _ref2 => {
205
208
  updateMenuPosition();
206
209
  });
207
210
  return () => {
208
- resizeHandler.release();
211
+ resizeHandler.remove();
209
212
  };
210
213
  }, [triggerRef, menuOffset, menuDirection, flipped, target, updateOrientation]);
211
214
 
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Copyright IBM Corp. 2016, 2025
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
+ * A callback function to be executed on `resize`.
9
+ */
10
+ type Callback = () => void;
11
+ export declare const OptimizedResize: {
12
+ /** Adds a callback function to be executed on window `resize`. */
13
+ add: (callback: Callback) => {
14
+ /** Removes the callback. */
15
+ remove: () => void;
16
+ };
17
+ };
18
+ export {};