@carbon/react 1.80.0 → 1.81.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 (263) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +869 -869
  2. package/es/components/Accordion/AccordionItem.d.ts +2 -2
  3. package/es/components/AspectRatio/AspectRatio.d.ts +2 -2
  4. package/es/components/Button/Button.js +3 -0
  5. package/es/components/Button/ButtonBase.d.ts +2 -2
  6. package/es/components/ChatButton/ChatButton.js +5 -3
  7. package/es/components/CodeSnippet/CodeSnippet.js +2 -0
  8. package/es/components/ComboBox/ComboBox.d.ts +1 -1
  9. package/es/components/ComposedModal/ComposedModal.d.ts +1 -1
  10. package/es/components/ComposedModal/ComposedModal.js +17 -10
  11. package/es/components/ComposedModal/ModalFooter.js +0 -1
  12. package/es/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
  13. package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
  14. package/es/components/ContextMenu/useContextMenu.d.ts +1 -1
  15. package/es/components/DataTable/DataTable.d.ts +5 -5
  16. package/es/components/DataTable/DataTable.js +1 -1
  17. package/es/components/DataTable/TableActionList.d.ts +1 -1
  18. package/es/components/DataTable/TableExpandHeader.d.ts +1 -1
  19. package/es/components/DataTable/TableHead.d.ts +1 -1
  20. package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
  21. package/es/components/DataTable/TableToolbarSearch.d.ts +1 -1
  22. package/es/components/DatePickerInput/DatePickerInput.d.ts +2 -2
  23. package/es/components/Dropdown/Dropdown.d.ts +1 -1
  24. package/es/components/FeatureFlags/index.d.ts +1 -1
  25. package/es/components/FileUploader/FileUploader.d.ts +6 -1
  26. package/es/components/FileUploader/FileUploader.js +3 -1
  27. package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
  28. package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  29. package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
  30. package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
  31. package/es/components/FluidMultiSelect/FluidMultiSelect.js +6 -4
  32. package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.js +40 -0
  33. package/es/components/FluidNumberInput/FluidNumberInput.js +123 -0
  34. package/es/components/FluidTextInput/FluidTextInput.js +2 -2
  35. package/es/components/Grid/Column.js +1 -1
  36. package/es/components/Grid/GridTypes.d.ts +6 -1
  37. package/es/components/Layer/LayerLevel.d.ts +3 -3
  38. package/es/components/Layer/LayerLevel.js +4 -3
  39. package/es/components/Layer/index.d.ts +4 -2
  40. package/es/components/Layer/index.js +3 -2
  41. package/es/components/Link/Link.js +3 -1
  42. package/es/components/Menu/Menu.d.ts +1 -1
  43. package/es/components/Menu/MenuContext.d.ts +1 -1
  44. package/es/components/Modal/Modal.js +22 -7
  45. package/es/components/ModalWrapper/ModalWrapper.d.ts +2 -2
  46. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
  47. package/es/components/MultiSelect/FilterableMultiSelect.js +4 -3
  48. package/es/components/MultiSelect/MultiSelect.d.ts +2 -6
  49. package/es/components/MultiSelect/MultiSelect.js +18 -3
  50. package/es/components/MultiSelect/index.d.ts +2 -4
  51. package/es/components/NumberInput/NumberInput.js +2 -1
  52. package/es/components/OverflowMenu/OverflowMenu.d.ts +7 -1
  53. package/es/components/OverflowMenu/OverflowMenu.js +69 -17
  54. package/es/components/OverflowMenu/index.d.ts +3 -5
  55. package/es/components/OverflowMenu/index.js +9 -4
  56. package/es/components/OverflowMenu/next/index.js +0 -1
  57. package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
  58. package/es/components/PageHeader/PageHeader.js +1 -1
  59. package/es/components/PaginationNav/PaginationNav.d.ts +1 -1
  60. package/es/components/PaginationNav/PaginationNav.js +2 -1
  61. package/es/components/Popover/index.d.ts +3 -2
  62. package/es/components/Popover/index.js +10 -5
  63. package/es/components/Portal/index.d.ts +1 -1
  64. package/es/components/Search/Search.js +0 -1
  65. package/es/components/SkeletonText/SkeletonText.js +3 -1
  66. package/es/components/Slider/Slider.d.ts +3 -13
  67. package/es/components/Slider/Slider.js +2 -14
  68. package/es/components/Tabs/Tabs.d.ts +2 -2
  69. package/es/components/Tabs/Tabs.js +8 -6
  70. package/es/components/Tabs/usePressable.js +1 -1
  71. package/es/components/Tag/Tag.js +9 -2
  72. package/es/components/Text/Text.js +3 -2
  73. package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  74. package/es/components/TextInput/ControlledPasswordInput.js +0 -6
  75. package/es/components/TextInput/TextInput.d.ts +1 -1
  76. package/es/components/TextInput/TextInput.js +0 -4
  77. package/es/components/TextInput/index.d.ts +6 -0
  78. package/es/components/TextInput/index.js +0 -8
  79. package/es/components/Tile/Tile.js +0 -1
  80. package/es/components/Toggle/Toggle.d.ts +1 -1
  81. package/es/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
  82. package/es/components/ToggleSmall/ToggleSmall.Skeleton.js +37 -41
  83. package/es/components/Toggletip/index.js +11 -8
  84. package/es/components/Tooltip/Tooltip.d.ts +1 -1
  85. package/es/components/TreeView/TreeView.d.ts +1 -1
  86. package/es/components/UIShell/Content.d.ts +14 -1
  87. package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  88. package/es/components/UIShell/HeaderMenu.d.ts +2 -99
  89. package/es/components/UIShell/HeaderMenu.js +10 -3
  90. package/es/components/UIShell/HeaderMenuButton.d.ts +1 -98
  91. package/es/components/UIShell/HeaderMenuItem.d.ts +3 -4
  92. package/es/components/UIShell/HeaderMenuItem.js +3 -3
  93. package/es/components/UIShell/HeaderName.js +1 -1
  94. package/es/components/UIShell/HeaderNavigation.d.ts +0 -97
  95. package/es/components/UIShell/Link.d.ts +8 -8
  96. package/es/components/UIShell/Link.js +8 -5
  97. package/es/components/UIShell/SideNav.d.ts +3 -3
  98. package/es/components/UIShell/SideNav.js +1 -1
  99. package/es/components/UIShell/SideNavHeader.js +0 -1
  100. package/es/components/UIShell/SideNavLink.d.ts +3 -4
  101. package/es/components/UIShell/SideNavLink.js +8 -3
  102. package/es/components/UIShell/SideNavMenu.js +0 -1
  103. package/es/components/UIShell/SideNavMenuItem.d.ts +1 -49
  104. package/es/components/UIShell/SideNavMenuItem.js +1 -1
  105. package/es/components/UIShell/SideNavSwitcher.js +0 -1
  106. package/es/components/UIShell/SwitcherItem.d.ts +2 -2
  107. package/es/components/UIShell/SwitcherItem.js +1 -1
  108. package/es/index.d.ts +2 -2
  109. package/es/index.js +7 -7
  110. package/es/internal/FloatingMenu.js +2 -1
  111. package/es/internal/clamp.d.ts +10 -0
  112. package/es/internal/clamp.js +13 -0
  113. package/es/internal/useEvent.d.ts +9 -0
  114. package/es/internal/useEvent.js +8 -49
  115. package/es/internal/useId.js +1 -1
  116. package/es/internal/useMatchMedia.d.ts +7 -2
  117. package/es/internal/useMatchMedia.js +9 -10
  118. package/es/internal/useNoInteractiveChildren.js +4 -2
  119. package/es/internal/useOutsideClick.d.ts +1 -1
  120. package/es/prop-types/AriaPropTypes.js +1 -1
  121. package/es/prop-types/isRequiredOneOf.d.ts +16 -0
  122. package/es/prop-types/isRequiredOneOf.js +11 -9
  123. package/es/tools/setupGetInstanceId.d.ts +12 -0
  124. package/es/tools/setupGetInstanceId.js +7 -8
  125. package/es/tools/toggleClass.d.ts +14 -0
  126. package/es/tools/toggleClass.js +9 -10
  127. package/es/tools/wrapComponent.d.ts +1 -1
  128. package/es/types/common.d.ts +1 -6
  129. package/lib/components/Accordion/AccordionItem.d.ts +2 -2
  130. package/lib/components/AspectRatio/AspectRatio.d.ts +2 -2
  131. package/lib/components/Button/Button.js +3 -0
  132. package/lib/components/Button/ButtonBase.d.ts +2 -2
  133. package/lib/components/ChatButton/ChatButton.js +5 -3
  134. package/lib/components/CodeSnippet/CodeSnippet.js +2 -0
  135. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  136. package/lib/components/ComposedModal/ComposedModal.d.ts +1 -1
  137. package/lib/components/ComposedModal/ComposedModal.js +16 -9
  138. package/lib/components/ComposedModal/ModalFooter.js +0 -1
  139. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +0 -1
  140. package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
  141. package/lib/components/ContextMenu/useContextMenu.d.ts +1 -1
  142. package/lib/components/DataTable/DataTable.d.ts +5 -5
  143. package/lib/components/DataTable/DataTable.js +1 -1
  144. package/lib/components/DataTable/TableActionList.d.ts +1 -1
  145. package/lib/components/DataTable/TableExpandHeader.d.ts +1 -1
  146. package/lib/components/DataTable/TableHead.d.ts +1 -1
  147. package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
  148. package/lib/components/DataTable/TableToolbarSearch.d.ts +1 -1
  149. package/lib/components/DatePickerInput/DatePickerInput.d.ts +2 -2
  150. package/lib/components/Dropdown/Dropdown.d.ts +1 -1
  151. package/lib/components/FeatureFlags/index.d.ts +1 -1
  152. package/lib/components/FileUploader/FileUploader.d.ts +6 -1
  153. package/lib/components/FileUploader/FileUploader.js +3 -1
  154. package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
  155. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  156. package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -3
  157. package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +2 -2
  158. package/lib/components/FluidMultiSelect/FluidMultiSelect.js +7 -5
  159. package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.js +50 -0
  160. package/lib/components/FluidNumberInput/FluidNumberInput.js +133 -0
  161. package/lib/components/FluidTextInput/FluidTextInput.js +2 -2
  162. package/lib/components/Grid/Column.js +1 -1
  163. package/lib/components/Grid/GridTypes.d.ts +6 -1
  164. package/lib/components/Layer/LayerLevel.d.ts +3 -3
  165. package/lib/components/Layer/LayerLevel.js +4 -2
  166. package/lib/components/Layer/index.d.ts +4 -2
  167. package/lib/components/Layer/index.js +2 -1
  168. package/lib/components/Link/Link.js +3 -1
  169. package/lib/components/Menu/Menu.d.ts +1 -1
  170. package/lib/components/Menu/MenuContext.d.ts +1 -1
  171. package/lib/components/Modal/Modal.js +21 -6
  172. package/lib/components/ModalWrapper/ModalWrapper.d.ts +2 -2
  173. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -3
  174. package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -2
  175. package/lib/components/MultiSelect/MultiSelect.d.ts +2 -6
  176. package/lib/components/MultiSelect/MultiSelect.js +17 -2
  177. package/lib/components/MultiSelect/index.d.ts +2 -4
  178. package/lib/components/NumberInput/NumberInput.js +2 -1
  179. package/lib/components/OverflowMenu/OverflowMenu.d.ts +7 -1
  180. package/lib/components/OverflowMenu/OverflowMenu.js +69 -17
  181. package/lib/components/OverflowMenu/index.d.ts +3 -5
  182. package/lib/components/OverflowMenu/index.js +8 -3
  183. package/lib/components/OverflowMenu/next/index.js +0 -1
  184. package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +4 -0
  185. package/lib/components/PageHeader/PageHeader.js +1 -1
  186. package/lib/components/PaginationNav/PaginationNav.d.ts +1 -1
  187. package/lib/components/PaginationNav/PaginationNav.js +2 -1
  188. package/lib/components/Popover/index.d.ts +3 -2
  189. package/lib/components/Popover/index.js +10 -5
  190. package/lib/components/Portal/index.d.ts +1 -1
  191. package/lib/components/Search/Search.js +0 -1
  192. package/lib/components/SkeletonText/SkeletonText.js +3 -1
  193. package/lib/components/Slider/Slider.d.ts +3 -13
  194. package/lib/components/Slider/Slider.js +2 -14
  195. package/lib/components/Tabs/Tabs.d.ts +2 -2
  196. package/lib/components/Tabs/Tabs.js +7 -5
  197. package/lib/components/Tabs/usePressable.js +1 -1
  198. package/lib/components/Tag/Tag.js +9 -2
  199. package/lib/components/Text/Text.js +2 -1
  200. package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
  201. package/lib/components/TextInput/ControlledPasswordInput.js +0 -6
  202. package/lib/components/TextInput/TextInput.d.ts +1 -1
  203. package/lib/components/TextInput/TextInput.js +0 -4
  204. package/lib/components/TextInput/index.d.ts +6 -0
  205. package/lib/components/TextInput/index.js +1 -7
  206. package/lib/components/Tile/Tile.js +0 -1
  207. package/lib/components/Toggle/Toggle.d.ts +1 -1
  208. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.d.ts +9 -14
  209. package/lib/components/ToggleSmall/ToggleSmall.Skeleton.js +34 -39
  210. package/lib/components/Toggletip/index.js +11 -8
  211. package/lib/components/Tooltip/Tooltip.d.ts +1 -1
  212. package/lib/components/TreeView/TreeView.d.ts +1 -1
  213. package/lib/components/UIShell/Content.d.ts +14 -1
  214. package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  215. package/lib/components/UIShell/HeaderMenu.d.ts +2 -99
  216. package/lib/components/UIShell/HeaderMenu.js +10 -3
  217. package/lib/components/UIShell/HeaderMenuButton.d.ts +1 -98
  218. package/lib/components/UIShell/HeaderMenuItem.d.ts +3 -4
  219. package/lib/components/UIShell/HeaderMenuItem.js +3 -3
  220. package/lib/components/UIShell/HeaderName.js +1 -1
  221. package/lib/components/UIShell/HeaderNavigation.d.ts +0 -97
  222. package/lib/components/UIShell/Link.d.ts +8 -8
  223. package/lib/components/UIShell/Link.js +7 -5
  224. package/lib/components/UIShell/SideNav.d.ts +3 -3
  225. package/lib/components/UIShell/SideNav.js +1 -1
  226. package/lib/components/UIShell/SideNavHeader.js +0 -1
  227. package/lib/components/UIShell/SideNavLink.d.ts +3 -4
  228. package/lib/components/UIShell/SideNavLink.js +8 -3
  229. package/lib/components/UIShell/SideNavMenu.js +0 -1
  230. package/lib/components/UIShell/SideNavMenuItem.d.ts +1 -49
  231. package/lib/components/UIShell/SideNavMenuItem.js +1 -1
  232. package/lib/components/UIShell/SideNavSwitcher.js +0 -1
  233. package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
  234. package/lib/components/UIShell/SwitcherItem.js +1 -1
  235. package/lib/index.d.ts +2 -2
  236. package/lib/index.js +13 -11
  237. package/lib/internal/FloatingMenu.js +2 -1
  238. package/lib/internal/clamp.d.ts +10 -0
  239. package/lib/internal/clamp.js +17 -0
  240. package/lib/internal/useEvent.d.ts +9 -0
  241. package/lib/internal/useEvent.js +8 -49
  242. package/lib/internal/useId.js +1 -1
  243. package/lib/internal/useMatchMedia.d.ts +7 -2
  244. package/lib/internal/useMatchMedia.js +9 -10
  245. package/lib/internal/useNoInteractiveChildren.js +4 -2
  246. package/lib/internal/useOutsideClick.d.ts +1 -1
  247. package/lib/prop-types/AriaPropTypes.js +1 -1
  248. package/lib/prop-types/isRequiredOneOf.d.ts +16 -0
  249. package/lib/prop-types/isRequiredOneOf.js +11 -9
  250. package/lib/tools/setupGetInstanceId.d.ts +12 -0
  251. package/lib/tools/setupGetInstanceId.js +7 -8
  252. package/lib/tools/toggleClass.d.ts +14 -0
  253. package/lib/tools/toggleClass.js +9 -10
  254. package/lib/tools/wrapComponent.d.ts +1 -1
  255. package/lib/types/common.d.ts +1 -6
  256. package/package.json +14 -14
  257. package/telemetry.yml +11 -12
  258. package/es/components/MultiSelect/index.js +0 -13
  259. package/es/internal/ClickListener.d.ts +0 -13
  260. package/es/internal/ClickListener.js +0 -47
  261. package/lib/components/MultiSelect/index.js +0 -19
  262. package/lib/internal/ClickListener.d.ts +0 -13
  263. package/lib/internal/ClickListener.js +0 -51
@@ -1,11 +1,11 @@
1
1
  /**
2
- * Copyright IBM Corp. 2023
2
+ * Copyright IBM Corp. 2023, 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.
6
6
  */
7
7
  export declare const levels: readonly ["one", "two", "three"];
8
- export declare const MIN_LEVEL = 0;
9
- export declare const MAX_LEVEL: number;
10
8
  export declare const LayerLevels: readonly [0, 1, 2];
9
+ export declare const MIN_LEVEL: 0;
10
+ export declare const MAX_LEVEL: 0 | 1 | 2;
11
11
  export type LayerLevel = (typeof LayerLevels)[number];
@@ -10,9 +10,11 @@
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
12
  const levels = ['one', 'two', 'three'];
13
- const MIN_LEVEL = 0;
14
- const MAX_LEVEL = levels.length - 1;
13
+ const LayerLevels = [0, 1, 2];
14
+ const MIN_LEVEL = LayerLevels[0];
15
+ const MAX_LEVEL = LayerLevels[LayerLevels.length - 1];
15
16
 
17
+ exports.LayerLevels = LayerLevels;
16
18
  exports.MAX_LEVEL = MAX_LEVEL;
17
19
  exports.MIN_LEVEL = MIN_LEVEL;
18
20
  exports.levels = levels;
@@ -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.
@@ -31,5 +31,7 @@ export interface LayerBaseProps {
31
31
  level?: LayerLevel;
32
32
  }
33
33
  export type LayerProps<T extends React.ElementType> = PolymorphicComponentPropWithRef<T, LayerBaseProps>;
34
- declare const Layer: React.ForwardRefExoticComponent<Omit<LayerProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
34
+ declare const Layer: React.ForwardRefExoticComponent<LayerBaseProps & {
35
+ as?: React.ElementType;
36
+ } & React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<any>>;
35
37
  export { Layer };
@@ -16,6 +16,7 @@ var cx = require('classnames');
16
16
  var usePrefix = require('../../internal/usePrefix.js');
17
17
  var LayerContext = require('./LayerContext.js');
18
18
  var LayerLevel = require('./LayerLevel.js');
19
+ var clamp = require('../../internal/clamp.js');
19
20
 
20
21
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
21
22
 
@@ -47,7 +48,7 @@ const Layer = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
47
48
  const prefix = usePrefix.usePrefix();
48
49
  const className = cx__default["default"](`${prefix}--layer-${LayerLevel.levels[level]}`, customClassName);
49
50
  // The level should be between MIN_LEVEL and MAX_LEVEL
50
- const value = Math.max(LayerLevel.MIN_LEVEL, Math.min(level + 1, LayerLevel.MAX_LEVEL));
51
+ const value = clamp.clamp(level + 1, LayerLevel.MIN_LEVEL, LayerLevel.MAX_LEVEL);
51
52
  const BaseComponent = as || 'div';
52
53
  return /*#__PURE__*/React__default["default"].createElement(LayerContext.LayerContext.Provider, {
53
54
  value: value
@@ -21,7 +21,8 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
21
21
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
22
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
23
23
 
24
- const Link = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
24
+ // First create the component with basic types
25
+ const LinkBase = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
25
26
  let {
26
27
  as: BaseComponent,
27
28
  children,
@@ -64,6 +65,7 @@ const Link = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
64
65
  className: `${prefix}--link__icon`
65
66
  }, /*#__PURE__*/React__default["default"].createElement(Icon, null)));
66
67
  });
68
+ const Link = LinkBase;
67
69
  Link.displayName = 'Link';
68
70
  Link.propTypes = {
69
71
  /**
@@ -9,7 +9,7 @@ export interface MenuProps extends React.HTMLAttributes<HTMLUListElement> {
9
9
  /**
10
10
  * The ref of the containing element, used for positioning and alignment of the menu
11
11
  */
12
- containerRef?: RefObject<HTMLDivElement>;
12
+ containerRef?: RefObject<HTMLDivElement | null>;
13
13
  /**
14
14
  * A collection of MenuItems to be rendered within this Menu.
15
15
  */
@@ -28,7 +28,7 @@ declare function menuReducer(state: StateType, action: ActionType): {
28
28
  type DispatchFuncProps = {
29
29
  type: ActionType['type'];
30
30
  payload: {
31
- ref: RefObject<HTMLLIElement>;
31
+ ref: RefObject<HTMLLIElement | null>;
32
32
  disabled: boolean;
33
33
  };
34
34
  };
@@ -34,6 +34,7 @@ var index = require('../FeatureFlags/index.js');
34
34
  var events = require('../../tools/events.js');
35
35
  var deprecate = require('../../prop-types/deprecate.js');
36
36
  var index$1 = require('../Dialog/index.js');
37
+ var warning = require('../../internal/warning.js');
37
38
  var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
38
39
  var Text = require('../Text/Text.js');
39
40
 
@@ -97,19 +98,33 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
97
98
  [`${prefix}--btn--loading`]: loadingStatus !== 'inactive'
98
99
  });
99
100
  const loadingActive = loadingStatus !== 'inactive';
100
- const enableDialogElement = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels') || index.useFeatureFlag('enable-dialog-element');
101
+ const focusTrapWithoutSentinels = index.useFeatureFlag('enable-experimental-focus-wrap-without-sentinels');
102
+ const enableDialogElement = index.useFeatureFlag('enable-dialog-element');
103
+ process.env.NODE_ENV !== "production" ? warning.warning(!(focusTrapWithoutSentinels && enableDialogElement), '`<Modal>` detected both `focusTrapWithoutSentinels` and ' + '`enableDialogElement` feature flags are enabled. The native dialog ' + 'element handles focus, so `enableDialogElement` must be off for ' + '`focusTrapWithoutSentinels` to have any effect.') : void 0;
101
104
  function isCloseButton(element) {
102
105
  return !onSecondarySubmit && element === secondaryButton.current || element.classList.contains(modalCloseButtonClass);
103
106
  }
104
107
  function handleKeyDown(evt) {
108
+ const {
109
+ target
110
+ } = evt;
105
111
  evt.stopPropagation();
106
112
  if (open) {
107
113
  if (match.match(evt, keys.Escape)) {
108
114
  onRequestClose(evt);
109
115
  }
110
- if (match.match(evt, keys.Enter) && shouldSubmitOnEnter && !isCloseButton(evt.target)) {
116
+ if (match.match(evt, keys.Enter) && shouldSubmitOnEnter && target instanceof Element && !isCloseButton(target) && document.activeElement !== button.current) {
111
117
  onRequestSubmit(evt);
112
118
  }
119
+ if (focusTrapWithoutSentinels && !enableDialogElement && match.match(evt, keys.Tab) && innerModal.current) {
120
+ wrapFocus.wrapFocusWithoutSentinels({
121
+ containerNode: innerModal.current,
122
+ currentActiveNode: evt.target,
123
+ // TODO: Delete type assertion following util rewrite.
124
+ // https://github.com/carbon-design-system/carbon/pull/18913
125
+ event: evt
126
+ });
127
+ }
113
128
  }
114
129
  }
115
130
  function handleOnClick(evt) {
@@ -186,13 +201,13 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
186
201
  React.useEffect(() => {
187
202
  return () => {
188
203
  if (!enableDialogElement) {
189
- toggleClass["default"](document.body, `${prefix}--body--with-modal-open`, false);
204
+ toggleClass.toggleClass(document.body, `${prefix}--body--with-modal-open`, false);
190
205
  }
191
206
  };
192
207
  }, [prefix, enableDialogElement]);
193
208
  React.useEffect(() => {
194
209
  if (!enableDialogElement) {
195
- toggleClass["default"](document.body, `${prefix}--body--with-modal-open`, open ?? false);
210
+ toggleClass.toggleClass(document.body, `${prefix}--body--with-modal-open`, open ?? false);
196
211
  }
197
212
  }, [open, prefix, enableDialogElement]);
198
213
  React.useEffect(() => {
@@ -336,7 +351,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
336
351
  iconDescription: loadingIconDescription,
337
352
  className: `${prefix}--inline-loading--btn`,
338
353
  onSuccess: onLoadingSuccess
339
- })))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !enableDialogElement && /*#__PURE__*/React__default["default"].createElement("span", {
354
+ })))) : /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, !enableDialogElement && !focusTrapWithoutSentinels && /*#__PURE__*/React__default["default"].createElement("span", {
340
355
  ref: startTrap,
341
356
  tabIndex: 0,
342
357
  role: "link",
@@ -395,7 +410,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
395
410
  iconDescription: loadingIconDescription,
396
411
  className: `${prefix}--inline-loading--btn`,
397
412
  onSuccess: onLoadingSuccess
398
- })))), !enableDialogElement && /*#__PURE__*/React__default["default"].createElement("span", {
413
+ })))), !enableDialogElement && !focusTrapWithoutSentinels && /*#__PURE__*/React__default["default"].createElement("span", {
399
414
  ref: endTrap,
400
415
  tabIndex: 0,
401
416
  role: "link",
@@ -62,8 +62,8 @@ export default class ModalWrapper extends React.Component<ModalWrapperProps, Mod
62
62
  triggerButtonKind: PropTypes.Requireable<"primary" | "secondary" | "danger" | "ghost" | "danger--primary" | "danger--ghost" | "danger--tertiary" | "tertiary">;
63
63
  withHeader: PropTypes.Requireable<boolean>;
64
64
  };
65
- triggerButton: React.RefObject<HTMLButtonElement>;
66
- modal: React.RefObject<HTMLDivElement>;
65
+ triggerButton: React.RefObject<HTMLButtonElement | null>;
66
+ modal: React.RefObject<HTMLDivElement | null>;
67
67
  state: {
68
68
  isOpen: boolean;
69
69
  };
@@ -191,11 +191,11 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
191
191
  */
192
192
  warnText?: ReactNode;
193
193
  }
194
- declare const FilterableMultiSelect: {
195
- <ItemType>(props: FilterableMultiSelectProps<ItemType>): ReactElement;
194
+ export declare const FilterableMultiSelect: {
195
+ <ItemType>(props: FilterableMultiSelectProps<ItemType>): ReactElement<any>;
196
196
  propTypes?: any;
197
197
  contextTypes?: any;
198
198
  defaultProps?: any;
199
199
  displayName?: any;
200
200
  };
201
- export default FilterableMultiSelect;
201
+ export {};
@@ -73,7 +73,7 @@ const {
73
73
  * ends up just being defined as "string".)
74
74
  */
75
75
 
76
- const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(function FilterableMultiSelect(_ref, ref) {
76
+ const FilterableMultiSelect = /*#__PURE__*/React.forwardRef(function FilterableMultiSelect(_ref, ref) {
77
77
  let {
78
78
  autoAlign = false,
79
79
  className: containerClassName,
@@ -659,6 +659,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
659
659
  }, item)) : itemText)));
660
660
  }) : null)), !inline && !invalid && !warn ? helper : null);
661
661
  });
662
+ FilterableMultiSelect.displayName = 'FilterableMultiSelect';
662
663
  FilterableMultiSelect.propTypes = {
663
664
  /**
664
665
  * Deprecated, aria-label is no longer needed
@@ -812,4 +813,4 @@ FilterableMultiSelect.propTypes = {
812
813
  warnText: PropTypes__default["default"].node
813
814
  };
814
815
 
815
- exports["default"] = FilterableMultiSelect;
816
+ exports.FilterableMultiSelect = FilterableMultiSelect;
@@ -173,9 +173,5 @@ export interface MultiSelectProps<ItemType> extends MultiSelectSortingProps<Item
173
173
  */
174
174
  warnText?: ReactNode;
175
175
  }
176
- type MultiSelectComponentProps<ItemType> = React.PropsWithChildren<MultiSelectProps<ItemType>> & React.RefAttributes<HTMLButtonElement>;
177
- interface MultiSelectComponent {
178
- <ItemType>(props: MultiSelectComponentProps<ItemType>): React.ReactElement | null;
179
- }
180
- declare const _default: MultiSelectComponent;
181
- export default _default;
176
+ export declare const MultiSelect: React.ForwardRefExoticComponent<MultiSelectProps<unknown> & React.RefAttributes<HTMLButtonElement>>;
177
+ export {};
@@ -436,6 +436,16 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
436
436
  ref: enableFloatingStyles ? refs.setFloating : null
437
437
  }), [enableFloatingStyles, getMenuProps, refs.setFloating]);
438
438
  const labelProps = ! /*#__PURE__*/React.isValidElement(titleText) ? getLabelProps() : null;
439
+ const getSelectionStats = React.useCallback((selectedItems, filteredItems) => {
440
+ const hasIndividualSelections = selectedItems.some(selected => !selected.isSelectAll);
441
+ const nonSelectAllSelectedCount = selectedItems.filter(selected => !selected.isSelectAll).length;
442
+ const totalSelectableCount = filteredItems.filter(item => !item.isSelectAll && !item.disabled).length;
443
+ return {
444
+ hasIndividualSelections,
445
+ nonSelectAllSelectedCount,
446
+ totalSelectableCount
447
+ };
448
+ }, [selectedItems, filteredItems]);
439
449
  return /*#__PURE__*/React__default["default"].createElement("div", {
440
450
  className: wrapperClasses
441
451
  }, /*#__PURE__*/React__default["default"].createElement("label", _rollupPluginBabelHelpers["extends"]({
@@ -489,7 +499,12 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
489
499
  className: `${prefix}--list-box__inner-wrapper--decorator`
490
500
  }, normalizedDecorator) : ''), /*#__PURE__*/React__default["default"].createElement(index$1["default"].Menu, menuProps, isOpen && sortItems(filteredItems, sortOptions).map((item, index) => {
491
501
  const isChecked = selectedItems.filter(selected => isEqual__default["default"](selected, item)).length > 0;
492
- const isIndeterminate = selectedItems.length !== 0 && item['isSelectAll'] && !isChecked;
502
+ const {
503
+ hasIndividualSelections,
504
+ nonSelectAllSelectedCount,
505
+ totalSelectableCount
506
+ } = getSelectionStats(selectedItems, filteredItems);
507
+ const isIndeterminate = item['isSelectAll'] && hasIndividualSelections && nonSelectAllSelectedCount < totalSelectableCount;
493
508
  const itemProps = getItemProps({
494
509
  item,
495
510
  // we don't want Downshift to set aria-selected for us
@@ -712,4 +727,4 @@ MultiSelect.propTypes = {
712
727
  warnText: PropTypes__default["default"].node
713
728
  };
714
729
 
715
- exports["default"] = MultiSelect;
730
+ exports.MultiSelect = MultiSelect;
@@ -4,7 +4,5 @@
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 MultiSelect from './MultiSelect';
8
- import { default as FilterableMultiSelect } from './FilterableMultiSelect';
9
- export { FilterableMultiSelect, MultiSelect };
10
- export default MultiSelect;
7
+ export * from './FilterableMultiSelect';
8
+ export * from './MultiSelect';
@@ -21,6 +21,7 @@ var deprecate = require('../../prop-types/deprecate.js');
21
21
  require('../FluidForm/FluidForm.js');
22
22
  var FormContext = require('../FluidForm/FormContext.js');
23
23
  require('../Text/index.js');
24
+ var clamp = require('../../internal/clamp.js');
24
25
  var Text = require('../Text/Text.js');
25
26
 
26
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -183,7 +184,7 @@ const NumberInput = /*#__PURE__*/React__default["default"].forwardRef(function N
183
184
  const rawValue = direction === 'up' ? currentValue + step : currentValue - step;
184
185
  const precision = Math.max(getDecimalPlaces(currentValue), getDecimalPlaces(step));
185
186
  const floatValue = parseFloat(rawValue.toFixed(precision));
186
- const newValue = typeof min !== 'undefined' && typeof max !== 'undefined' ? Math.min(Math.max(floatValue, min), max) : floatValue;
187
+ const newValue = clamp.clamp(floatValue, min ?? -Infinity, max ?? Infinity);
187
188
  const state = {
188
189
  value: allowEmpty && inputRef.current.value === '' && step === 0 ? '' : newValue,
189
190
  direction
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import React, { type ElementType, type ReactNode, type Ref } from 'react';
8
8
  import { type MenuDirection, type MenuOffset } from '../../internal/FloatingMenu';
9
+ import { PopoverAlignment } from '../Popover';
9
10
  /**
10
11
  * Calculates the offset for the floating menu.
11
12
  *
@@ -16,6 +17,10 @@ import { type MenuDirection, type MenuOffset } from '../../internal/FloatingMenu
16
17
  */
17
18
  export declare const getMenuOffset: MenuOffset;
18
19
  export interface OverflowMenuProps {
20
+ /**
21
+ * Specify how the trigger tooltip should be aligned.
22
+ */
23
+ align?: PopoverAlignment;
19
24
  /**
20
25
  * Specify a label to be read by screen readers on the container node
21
26
  */
@@ -105,7 +110,8 @@ export interface OverflowMenuProps {
105
110
  */
106
111
  size?: 'sm' | 'md' | 'lg';
107
112
  /**
108
- * The ref to the HTML element that should receive focus when the OverflowMenu opens
113
+ * The ref to the overflow menu's trigger button element.
114
+ * @deprecated Use the standard React `ref` prop instead.
109
115
  */
110
116
  innerRef?: Ref<any>;
111
117
  }
@@ -15,7 +15,6 @@ var iconsReact = require('@carbon/icons-react');
15
15
  var cx = require('classnames');
16
16
  var invariant = require('invariant');
17
17
  var PropTypes = require('prop-types');
18
- var ClickListener = require('../../internal/ClickListener.js');
19
18
  var FloatingMenu = require('../../internal/FloatingMenu.js');
20
19
  var keys = require('../../internal/keyboard/keys.js');
21
20
  var match = require('../../internal/keyboard/match.js');
@@ -25,6 +24,8 @@ var deprecate = require('../../prop-types/deprecate.js');
25
24
  var mergeRefs = require('../../tools/mergeRefs.js');
26
25
  var setupGetInstanceId = require('../../tools/setupGetInstanceId.js');
27
26
  var index = require('../IconButton/index.js');
27
+ var useOutsideClick = require('../../internal/useOutsideClick.js');
28
+ var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
28
29
 
29
30
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
30
31
 
@@ -33,7 +34,7 @@ var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
33
34
  var invariant__default = /*#__PURE__*/_interopDefaultLegacy(invariant);
34
35
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
35
36
 
36
- const getInstanceId = setupGetInstanceId["default"]();
37
+ const getInstanceId = setupGetInstanceId.setupGetInstanceId();
37
38
  const on = function (target) {
38
39
  for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
39
40
  args[_key - 1] = arguments[_key];
@@ -100,8 +101,25 @@ const getMenuOffset = (menuBody, direction, trigger, flip) => {
100
101
  };
101
102
  }
102
103
  };
104
+
105
+ // TODO: Replace this code when align mapping is consolidated.
106
+ // https://github.com/carbon-design-system/carbon/pull/19081
107
+ const propMappingFunction = deprecatedValue => {
108
+ const mapping = {
109
+ 'top-left': 'top-start',
110
+ 'top-right': 'top-end',
111
+ 'bottom-left': 'bottom-start',
112
+ 'bottom-right': 'bottom-end',
113
+ 'left-bottom': 'left-end',
114
+ 'left-top': 'left-start',
115
+ 'right-bottom': 'right-end',
116
+ 'right-top': 'right-start'
117
+ };
118
+ return mapping[deprecatedValue];
119
+ };
103
120
  const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
104
121
  let {
122
+ align,
105
123
  ['aria-label']: ariaLabel = null,
106
124
  ariaLabel: deprecatedAriaLabel,
107
125
  children,
@@ -123,6 +141,7 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
123
141
  renderIcon: IconElement = iconsReact.OverflowMenuVertical,
124
142
  selectorPrimaryFocus = '[data-floating-menu-primary-focus]',
125
143
  size = 'md',
144
+ innerRef,
126
145
  ...other
127
146
  } = _ref;
128
147
  const prefix = React.useContext(usePrefix.PrefixContext);
@@ -138,6 +157,7 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
138
157
  const prevOpenState = React.useRef(open);
139
158
  /** The element ref of the tooltip's trigger button. */
140
159
  const triggerRef = React.useRef(null);
160
+ const wrapperRef = React.useRef(null);
141
161
 
142
162
  // Sync open prop changes.
143
163
  React.useEffect(() => {
@@ -161,6 +181,14 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
161
181
  }
162
182
  prevOpenState.current = open;
163
183
  }, [open, onClose]);
184
+ useOutsideClick.useOutsideClick(wrapperRef, _ref2 => {
185
+ let {
186
+ target
187
+ } = _ref2;
188
+ if (open && (!menuBodyRef.current || target instanceof Node && !menuBodyRef.current.contains(target))) {
189
+ closeMenu();
190
+ }
191
+ });
164
192
  const focusMenuEl = React.useCallback(() => {
165
193
  if (triggerRef.current) {
166
194
  triggerRef.current.focus();
@@ -211,23 +239,18 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
211
239
  evt.stopPropagation();
212
240
  }
213
241
  };
214
- const handleClickOutside = evt => {
215
- if (open && (!menuBodyRef.current || evt.target instanceof Node && !menuBodyRef.current.contains(evt.target))) {
216
- closeMenu();
217
- }
218
- };
219
242
 
220
243
  /**
221
244
  * Focuses the next enabled overflow menu item given the currently focused
222
245
  * item index and direction to move.
223
246
  */
224
- const handleOverflowMenuItemFocus = _ref2 => {
247
+ const handleOverflowMenuItemFocus = _ref3 => {
225
248
  let {
226
- currentIndex,
249
+ currentIndex = 0,
227
250
  direction
228
- } = _ref2;
251
+ } = _ref3;
229
252
  const enabledIndices = React.Children.toArray(children).reduce((acc, curr, i) => {
230
- if (/*#__PURE__*/React.isValidElement(curr) && !curr.props.disabled) {
253
+ if (/*#__PURE__*/React__default["default"].isValidElement(curr) && !curr.props.disabled) {
231
254
  acc.push(i);
232
255
  }
233
256
  return acc;
@@ -325,12 +348,13 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
325
348
  }, /*#__PURE__*/React.cloneElement(menuBody, {
326
349
  'data-floating-menu-direction': direction
327
350
  }));
328
- return /*#__PURE__*/React__default["default"].createElement(ClickListener.ClickListener, {
329
- onClickOutside: handleClickOutside
330
- }, /*#__PURE__*/React__default["default"].createElement("span", {
351
+ const combinedRef = innerRef ? mergeRefs["default"](triggerRef, innerRef, ref) : mergeRefs["default"](triggerRef, ref);
352
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
331
353
  className: `${prefix}--overflow-menu__wrapper`,
332
- "aria-owns": open ? menuBodyId : undefined
354
+ "aria-owns": open ? menuBodyId : undefined,
355
+ ref: wrapperRef
333
356
  }, /*#__PURE__*/React__default["default"].createElement(index.IconButton, _rollupPluginBabelHelpers["extends"]({}, other, {
357
+ align: align,
334
358
  type: "button",
335
359
  "aria-haspopup": true,
336
360
  "aria-expanded": open,
@@ -338,7 +362,7 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
338
362
  className: overflowMenuClasses,
339
363
  onClick: handleClick,
340
364
  id: id,
341
- ref: mergeRefs["default"](triggerRef, ref),
365
+ ref: combinedRef,
342
366
  size: size,
343
367
  label: iconDescription,
344
368
  kind: "ghost"
@@ -348,6 +372,35 @@ const OverflowMenu = /*#__PURE__*/React.forwardRef((_ref, ref) => {
348
372
  })), open && hasMountedTrigger && wrappedMenuBody));
349
373
  });
350
374
  OverflowMenu.propTypes = {
375
+ /**
376
+ * Specify how the trigger should align with the tooltip
377
+ */
378
+ align: deprecateValuesWithin["default"](PropTypes__default["default"].oneOf(['top', 'top-left',
379
+ // deprecated use top-start instead
380
+ 'top-right',
381
+ // deprecated use top-end instead
382
+
383
+ 'bottom', 'bottom-left',
384
+ // deprecated use bottom-start instead
385
+ 'bottom-right',
386
+ // deprecated use bottom-end instead
387
+
388
+ 'left', 'left-bottom',
389
+ // deprecated use left-end instead
390
+ 'left-top',
391
+ // deprecated use left-start instead
392
+
393
+ 'right', 'right-bottom',
394
+ // deprecated use right-end instead
395
+ 'right-top',
396
+ // deprecated use right-start instead
397
+
398
+ // new values to match floating-ui
399
+ 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
400
+ //allowed prop values
401
+ ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
402
+ //optional mapper function
403
+ propMappingFunction),
351
404
  /**
352
405
  * Specify a label to be read by screen readers on the container node
353
406
  */
@@ -439,7 +492,6 @@ OverflowMenu.propTypes = {
439
492
  /**
440
493
  * A component used to render an icon.
441
494
  */
442
- // @ts-expect-error: PropTypes are not expressive enough to cover this case
443
495
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
444
496
  /**
445
497
  * Specify a CSS selector that matches the DOM element that should
@@ -4,10 +4,8 @@
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 OverflowMenuProps } from './OverflowMenu';
8
- declare const OverflowMenu: {
9
- (props: OverflowMenuProps): import("react/jsx-runtime").JSX.Element;
10
- displayName: string;
11
- };
7
+ import React from 'react';
8
+ import type { OverflowMenuProps } from './OverflowMenu';
9
+ declare const OverflowMenu: React.ForwardRefExoticComponent<OverflowMenuProps & React.RefAttributes<HTMLDivElement>>;
12
10
  export default OverflowMenu;
13
11
  export { OverflowMenu, type OverflowMenuProps };
@@ -9,6 +9,7 @@
9
9
 
10
10
  Object.defineProperty(exports, '__esModule', { value: true });
11
11
 
12
+ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
12
13
  var React = require('react');
13
14
  var index = require('../FeatureFlags/index.js');
14
15
  var index$1 = require('./next/index.js');
@@ -20,10 +21,14 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
20
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
22
 
22
23
  const OverflowMenuV11 = createClassWrapper.createClassWrapper(OverflowMenu$1.OverflowMenu);
23
- const OverflowMenu = props => {
24
+ const OverflowMenu = /*#__PURE__*/React.forwardRef((props, ref) => {
24
25
  const enableV12OverflowMenu = index.useFeatureFlag('enable-v12-overflowmenu');
25
- return enableV12OverflowMenu ? /*#__PURE__*/React__default["default"].createElement(index$1.OverflowMenu, props) : /*#__PURE__*/React__default["default"].createElement(OverflowMenuV11, props);
26
- };
26
+ return enableV12OverflowMenu ? /*#__PURE__*/React__default["default"].createElement(index$1.OverflowMenu, _rollupPluginBabelHelpers["extends"]({}, props, {
27
+ ref: ref
28
+ })) : /*#__PURE__*/React__default["default"].createElement(OverflowMenuV11, _rollupPluginBabelHelpers["extends"]({}, props, {
29
+ ref: ref
30
+ }));
31
+ });
27
32
  OverflowMenu.displayName = 'OverflowMenu';
28
33
 
29
34
  exports.OverflowMenu = OverflowMenu;
@@ -177,7 +177,6 @@ OverflowMenu.propTypes = {
177
177
  /**
178
178
  * A component used to render an icon.
179
179
  */
180
- // @ts-expect-error: PropTypes are not expressive enough to cover this case
181
180
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
182
181
  /**
183
182
  * Specify the size of the menu, from a list of available sizes.
@@ -40,6 +40,10 @@ export interface OverflowMenuItemProps extends React.HTMLAttributes<HTMLElement>
40
40
  * `true` to make this menu item a danger button.
41
41
  */
42
42
  isDelete?: boolean;
43
+ /**
44
+ * accepts a ref to the button element
45
+ */
46
+ ref?: (element: HTMLElement) => void;
43
47
  /**
44
48
  * `true` to require the title attribute.
45
49
  */
@@ -153,7 +153,7 @@ PageHeaderContent.propTypes = {
153
153
  /**
154
154
  * Provide an optional icon to render in front of the PageHeaderContent's title.
155
155
  */
156
- // @ts-expect-error: PropTypes are not expressive enough to cover this case
156
+
157
157
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
158
158
  /**
159
159
  * The PageHeaderContent's title
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2020
2
+ * Copyright IBM Corp. 2020, 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.
@@ -18,6 +18,7 @@ var index = require('../IconButton/index.js');
18
18
  var usePrefix = require('../../internal/usePrefix.js');
19
19
  var layout = require('@carbon/layout');
20
20
  var useMatchMedia = require('../../internal/useMatchMedia.js');
21
+ var clamp = require('../../internal/clamp.js');
21
22
 
22
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
24
 
@@ -199,7 +200,7 @@ const PaginationNav = /*#__PURE__*/React__default["default"].forwardRef(function
199
200
  numberOfPages = itemsShown === 4 ? itemsShown : 5;
200
201
  break;
201
202
  case 'sm':
202
- numberOfPages = Math.max(4, Math.min(itemsShown, 7));
203
+ numberOfPages = clamp.clamp(itemsShown, 4, 7);
203
204
  break;
204
205
  default:
205
206
  numberOfPages = 4;
@@ -1,10 +1,11 @@
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.
6
6
  */
7
- import React, { type WeakValidationMap } from 'react';
7
+ import { WeakValidationMap } from 'prop-types';
8
+ import React from 'react';
8
9
  import { type Boundary } from '@floating-ui/react';
9
10
  import { PolymorphicComponentPropWithRef } from '../../internal/PolymorphicProps';
10
11
  export interface PopoverContext {