@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
@@ -112,7 +112,6 @@ SideNavMenu.propTypes = {
112
112
  /**
113
113
  * A component used to render an icon.
114
114
  */
115
- // @ts-expect-error - PropTypes are unable to cover this case.
116
115
  renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
117
116
  /**
118
117
  * Optional prop to specify the tabIndex of the button. If undefined, it will be applied default validation
@@ -30,53 +30,5 @@ export type SideNavMenuItemProps = ComponentProps<typeof Link> & {
30
30
  */
31
31
  as?: ElementType;
32
32
  };
33
- declare const SideNavMenuItem: React.ForwardRefExoticComponent<((import("./HeaderMenuItem").HeaderMenuItemBaseProps & {
34
- /**
35
- * Specify the children to be rendered inside of the `SideNavMenuItem`
36
- */
37
- children?: React.ReactNode;
38
- /**
39
- * Provide an optional class to be applied to the containing node
40
- */
41
- className?: string;
42
- /**
43
- * Optionally specify whether the link is "active". An active link is one that
44
- * has an href that is the same as the current page. Can also pass in
45
- * `aria-current="page"`, as well.
46
- */
47
- isActive?: boolean;
48
- /**
49
- * Optionally provide an href for the underlying li`
50
- */
51
- href?: string;
52
- /**
53
- * Optional component to render instead of default Link
54
- */
55
- as?: ElementType;
56
- }) | Omit<import("./Link").LinkBaseProps & Omit<any, "as"> & {
57
- as?: React.ElementType | undefined;
58
- } & {
59
- /**
60
- * Specify the children to be rendered inside of the `SideNavMenuItem`
61
- */
62
- children?: React.ReactNode;
63
- /**
64
- * Provide an optional class to be applied to the containing node
65
- */
66
- className?: string;
67
- /**
68
- * Optionally specify whether the link is "active". An active link is one that
69
- * has an href that is the same as the current page. Can also pass in
70
- * `aria-current="page"`, as well.
71
- */
72
- isActive?: boolean;
73
- /**
74
- * Optionally provide an href for the underlying li`
75
- */
76
- href?: string;
77
- /**
78
- * Optional component to render instead of default Link
79
- */
80
- as?: ElementType;
81
- }, "ref">) & React.RefAttributes<HTMLElement>>;
33
+ declare const SideNavMenuItem: React.ForwardRefExoticComponent<Omit<SideNavMenuItemProps, "ref"> & React.RefAttributes<HTMLElement>>;
82
34
  export default SideNavMenuItem;
@@ -10,7 +10,7 @@ import cx from 'classnames';
10
10
  import PropTypes from 'prop-types';
11
11
  import React__default from 'react';
12
12
  import SideNavLinkText from './SideNavLinkText.js';
13
- import { Link } from './Link.js';
13
+ import Link from './Link.js';
14
14
  import { usePrefix } from '../../internal/usePrefix.js';
15
15
 
16
16
  const SideNavMenuItem = /*#__PURE__*/React__default.forwardRef(function SideNavMenuItem(props, ref) {
@@ -73,7 +73,6 @@ SideNavSwitcher.propTypes = {
73
73
  * `<option>`. The text value will be what is displayed to the user and is set
74
74
  * as the `value` prop for each `<option>`.
75
75
  */
76
- // @ts-expect-error
77
76
  options: PropTypes.arrayOf(PropTypes.string).isRequired
78
77
  };
79
78
 
@@ -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, { HTMLAttributeAnchorTarget, KeyboardEvent } from 'react';
7
+ import React, { HTMLAttributeAnchorTarget, KeyboardEvent, MouseEvent } from 'react';
8
8
  export interface BaseSwitcherItemProps {
9
9
  /**
10
10
  * Specify the text content for the link
@@ -32,7 +32,7 @@ export interface BaseSwitcherItemProps {
32
32
  /**
33
33
  * event handlers
34
34
  */
35
- onClick?: (event: MouseEvent) => void;
35
+ onClick?: (event: MouseEvent<HTMLAnchorElement>) => void;
36
36
  /**
37
37
  * Specify the tab index of the Link
38
38
  */
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
9
9
  import React__default, { forwardRef } from 'react';
10
10
  import cx from 'classnames';
11
11
  import PropTypes from 'prop-types';
12
- import { Link } from './Link.js';
12
+ import Link from './Link.js';
13
13
  import { usePrefix } from '../../internal/usePrefix.js';
14
14
  import { ArrowDown, ArrowUp } from '../../internal/keyboard/keys.js';
15
15
  import { match } from '../../internal/keyboard/match.js';
package/es/index.d.ts CHANGED
@@ -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.
@@ -35,7 +35,6 @@ export { FeatureFlags, useFeatureFlag, useFeatureFlags, FeatureFlags as unstable
35
35
  useFeatureFlag as unstable_useFeatureFlag, // this export can be removed in v12
36
36
  useFeatureFlags as unstable_useFeatureFlags, } from './components/FeatureFlags';
37
37
  export * from './components/FileUploader';
38
- export * from './components/FilterableMultiSelect';
39
38
  export * from './components/FluidForm';
40
39
  export * from './components/Form';
41
40
  export * from './components/FormGroup';
@@ -108,6 +107,7 @@ export { FluidSelect as unstable__FluidSelect, FluidSelectSkeleton as unstable__
108
107
  export { FluidSearch as unstable__FluidSearch, FluidSearchSkeleton as unstable__FluidSearchSkeleton, } from './components/FluidSearch';
109
108
  export { FluidTextArea as unstable__FluidTextArea, FluidTextAreaSkeleton as unstable__FluidTextAreaSkeleton, } from './components/FluidTextArea';
110
109
  export { FluidTextInput as unstable__FluidTextInput, FluidTextInputSkeleton as unstable__FluidTextInputSkeleton, } from './components/FluidTextInput';
110
+ export { FluidNumberInput as unstable__FluidNumberInput, FluidNumberInputSkeleton as unstable__FluidNumberInputSkeleton, } from './components/FluidNumberInput';
111
111
  export { FluidTimePicker as unstable__FluidTimePicker, FluidTimePickerSkeleton as unstable__FluidTimePickerSkeleton, } from './components/FluidTimePicker';
112
112
  export { FluidTimePickerSelect as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect';
113
113
  export * from './components/Heading';
package/es/index.js CHANGED
@@ -73,7 +73,8 @@ export { MenuItem, MenuItemDivider, MenuItemGroup, MenuItemRadioGroup, MenuItemS
73
73
  export { MenuButton } from './components/MenuButton/index.js';
74
74
  export { default as Modal } from './components/Modal/Modal.js';
75
75
  export { default as ModalWrapper } from './components/ModalWrapper/ModalWrapper.js';
76
- import './components/MultiSelect/index.js';
76
+ export { FilterableMultiSelect } from './components/MultiSelect/FilterableMultiSelect.js';
77
+ export { MultiSelect } from './components/MultiSelect/MultiSelect.js';
77
78
  export { ActionableNotification, Callout, InlineNotification, NotificationActionButton, NotificationButton, StaticNotification, ToastNotification } from './components/Notification/Notification.js';
78
79
  export { default as NumberInputSkeleton } from './components/NumberInput/NumberInput.Skeleton.js';
79
80
  export { NumberInput } from './components/NumberInput/NumberInput.js';
@@ -122,14 +123,15 @@ export { default as SelectableTag } from './components/Tag/SelectableTag.js';
122
123
  export { default as TagSkeleton } from './components/Tag/Tag.Skeleton.js';
123
124
  export { default as TextArea } from './components/TextArea/TextArea.js';
124
125
  export { default as TextAreaSkeleton } from './components/TextArea/TextArea.Skeleton.js';
125
- import './components/TextInput/index.js';
126
+ export { default as TextInput } from './components/TextInput/TextInput.js';
127
+ export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
126
128
  export { ClickableTile, ExpandableTile, SelectableTile, Tile, TileAboveTheFoldContent, TileBelowTheFoldContent } from './components/Tile/Tile.js';
127
129
  export { default as TileGroup } from './components/TileGroup/TileGroup.js';
128
130
  export { default as TimePicker } from './components/TimePicker/TimePicker.js';
129
131
  export { default as TimePickerSelect } from './components/TimePickerSelect/TimePickerSelect.js';
130
132
  export { Toggle } from './components/Toggle/Toggle.js';
131
133
  export { default as ToggleSkeleton } from './components/Toggle/Toggle.Skeleton.js';
132
- export { default as ToggleSmallSkeleton } from './components/ToggleSmall/ToggleSmall.Skeleton.js';
134
+ export { ToggleSmallSkeleton } from './components/ToggleSmall/ToggleSmall.Skeleton.js';
133
135
  export { Toggletip, ToggletipActions, ToggletipButton, ToggletipContent, ToggletipLabel } from './components/Toggletip/index.js';
134
136
  export { default as TreeNode } from './components/TreeView/TreeNode.js';
135
137
  export { default as TreeView } from './components/TreeView/TreeView.js';
@@ -181,6 +183,8 @@ export { default as unstable__FluidTextAreaSkeleton } from './components/FluidTe
181
183
  export { default as unstable__FluidTextInput } from './components/FluidTextInput/FluidTextInput.js';
182
184
  import './components/FluidTextInput/FluidPasswordInput.js';
183
185
  export { default as unstable__FluidTextInputSkeleton } from './components/FluidTextInput/FluidTextInput.Skeleton.js';
186
+ export { default as unstable__FluidNumberInput } from './components/FluidNumberInput/FluidNumberInput.js';
187
+ export { default as unstable__FluidNumberInputSkeleton } from './components/FluidNumberInput/FluidNumberInput.Skeleton.js';
184
188
  export { default as unstable__FluidTimePicker } from './components/FluidTimePicker/FluidTimePicker.js';
185
189
  export { default as unstable__FluidTimePickerSkeleton } from './components/FluidTimePicker/FluidTimePicker.Skeleton.js';
186
190
  export { default as unstable__FluidTimePickerSelect } from './components/FluidTimePickerSelect/FluidTimePickerSelect.js';
@@ -209,10 +213,7 @@ export { default as unstable_PageSelector } from './components/Pagination/experi
209
213
  export { default as unstable_Pagination } from './components/Pagination/experimental/Pagination.js';
210
214
  export { default as ContainedListItem } from './components/ContainedList/ContainedListItem/ContainedListItem.js';
211
215
  export { default as ContainedList } from './components/ContainedList/ContainedList.js';
212
- export { default as MultiSelect } from './components/MultiSelect/MultiSelect.js';
213
216
  export { default as SliderSkeleton } from './components/Slider/Slider.Skeleton.js';
214
- export { default as TextInputSkeleton } from './components/TextInput/TextInput.Skeleton.js';
215
- export { default as TextInput } from './components/TextInput/TextInput.js';
216
217
  export { LayoutDirection as unstable_LayoutDirection } from './components/LayoutDirection/LayoutDirection.js';
217
218
  export { useLayoutDirection as unstable_useLayoutDirection } from './components/LayoutDirection/useLayoutDirection.js';
218
219
  export { Text as unstable_Text } from './components/Text/Text.js';
@@ -240,4 +241,3 @@ export { default as TableToolbarAction } from './components/DataTable/TableToolb
240
241
  export { default as TableToolbarContent } from './components/DataTable/TableToolbarContent.js';
241
242
  export { default as TableToolbarSearch } from './components/DataTable/TableToolbarSearch.js';
242
243
  export { default as TableToolbarMenu } from './components/DataTable/TableToolbarMenu.js';
243
- export { default as FilterableMultiSelect } from './components/MultiSelect/FilterableMultiSelect.js';
@@ -230,7 +230,8 @@ const FloatingMenu = _ref2 => {
230
230
  visibility: 'hidden',
231
231
  top: '0px'
232
232
  };
233
- return /*#__PURE__*/cloneElement(children, {
233
+ const child = children;
234
+ return /*#__PURE__*/cloneElement(child, {
234
235
  ref: handleMenuRef,
235
236
  style: {
236
237
  ...styles,
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 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
+ * Clamps a number between a minimum and maximum value (inclusive).
9
+ */
10
+ export declare const clamp: <T extends number>(num: number, min: T, max: T) => T;
@@ -0,0 +1,13 @@
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
+ /**
9
+ * Clamps a number between a minimum and maximum value (inclusive).
10
+ */
11
+ const clamp = (num, min, max) => Math.min(max, Math.max(min, num));
12
+
13
+ export { clamp };
@@ -0,0 +1,9 @@
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
+ 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;
9
+ export declare const useWindowEvent: <E extends keyof WindowEventMap>(eventName: E, callback: (event: WindowEventMap[E]) => void) => void;
@@ -7,81 +7,40 @@
7
7
 
8
8
  import { useRef, useEffect } from 'react';
9
9
 
10
- // @ts-check
11
-
12
- /**
13
- * @template {keyof GlobalEventHandlersEventMap} E
14
- * @typedef {(event: GlobalEventHandlersEventMap[E]) => void} GlobalEventCallback
15
- */
16
-
17
- /**
18
- * @template T
19
- * @typedef {import('react').MutableRefObject<T>} MutableRefObject<T>
20
- */
21
-
22
- /**
23
- * @template {keyof GlobalEventHandlersEventMap} E
24
- * @param {HTMLElement | MutableRefObject<HTMLElement | null>} elementOrRef
25
- * @param {E} eventName
26
- * @param {GlobalEventCallback<E>} callback
27
- */
28
- function useEvent(elementOrRef, eventName, callback) {
29
- /**
30
- * @type {MutableRefObject<GlobalEventCallback<E> | null>}
31
- */
10
+ const useEvent = (elementOrRef, eventName, callback) => {
32
11
  const savedCallback = useRef(null);
33
12
  useEffect(() => {
34
13
  savedCallback.current = callback;
35
14
  }, [callback]);
36
15
  useEffect(() => {
37
- /**
38
- * @type {GlobalEventCallback<E>}
39
- */
40
16
  const handler = event => {
41
17
  if (savedCallback.current) {
42
18
  savedCallback.current(event);
43
19
  }
44
20
  };
45
21
  const element = 'current' in elementOrRef ? elementOrRef.current : elementOrRef;
46
- element?.addEventListener?.(eventName, handler);
22
+ element?.addEventListener(eventName, handler);
47
23
  return () => {
48
- element?.removeEventListener?.(eventName, handler);
24
+ element?.removeEventListener(eventName, handler);
49
25
  };
50
26
  }, [elementOrRef, eventName]);
51
- }
52
-
53
- /**
54
- * @template {keyof WindowEventMap} E
55
- * @typedef {(event: WindowEventMap[E]) => void} WindowEventCallback
56
- */
57
-
58
- /**
59
- * @template {keyof WindowEventMap} E
60
- * @param {E} eventName
61
- * @param {WindowEventCallback<E>} callback
62
- */
63
- function useWindowEvent(eventName, callback) {
64
- /**
65
- * @type {MutableRefObject<WindowEventCallback<E> | null>}
66
- */
27
+ };
28
+ const useWindowEvent = (eventName, callback) => {
67
29
  const savedCallback = useRef(null);
68
30
  useEffect(() => {
69
31
  savedCallback.current = callback;
70
32
  }, [callback]);
71
33
  useEffect(() => {
72
- /**
73
- * @type {WindowEventCallback<E>}
74
- */
75
- function handler(event) {
34
+ const handler = event => {
76
35
  if (savedCallback.current) {
77
36
  savedCallback.current(event);
78
37
  }
79
- }
38
+ };
80
39
  window.addEventListener(eventName, handler);
81
40
  return () => {
82
41
  window.removeEventListener(eventName, handler);
83
42
  };
84
43
  }, [eventName]);
85
- }
44
+ };
86
45
 
87
46
  export { useEvent, useWindowEvent };
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import React__default, { useState, useEffect, useLayoutEffect } from 'react';
9
- import setupGetInstanceId from '../tools/setupGetInstanceId.js';
9
+ import { setupGetInstanceId } from '../tools/setupGetInstanceId.js';
10
10
  import { canUseDOM } from './environment.js';
11
11
  import { useIdPrefix } from './useIdPrefix.js';
12
12
 
@@ -4,5 +4,10 @@
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
- /** Listens to changes in a media query and returns whether it matches. */
8
- export declare const useMatchMedia: (mediaQuery: string) => boolean;
7
+ /**
8
+ * Listens to changes in a media query and returns whether it matches.
9
+ * @param mediaQuery - The media query to listen to. For example, `(min-width: 600px)`.
10
+ * @param defaultState - The initial state to return before the media query is evaluated. Defaults to `false`.
11
+ * @returns Whether the media query matches.
12
+ */
13
+ export declare const useMatchMedia: (mediaQuery: string, defaultState?: boolean) => boolean;
@@ -6,17 +6,16 @@
6
6
  */
7
7
 
8
8
  import { useState, useEffect } from 'react';
9
- import { canUseDOM } from './environment.js';
10
9
 
11
- /** Listens to changes in a media query and returns whether it matches. */
12
- const useMatchMedia = mediaQuery => {
13
- const [matches, setMatches] = useState(() => {
14
- if (canUseDOM) {
15
- const mediaQueryList = window.matchMedia(mediaQuery);
16
- return mediaQueryList.matches;
17
- }
18
- return false;
19
- });
10
+ /**
11
+ * Listens to changes in a media query and returns whether it matches.
12
+ * @param mediaQuery - The media query to listen to. For example, `(min-width: 600px)`.
13
+ * @param defaultState - The initial state to return before the media query is evaluated. Defaults to `false`.
14
+ * @returns Whether the media query matches.
15
+ */
16
+ const useMatchMedia = function (mediaQuery) {
17
+ let defaultState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
18
+ const [matches, setMatches] = useState(defaultState);
20
19
  useEffect(() => {
21
20
  const listener = event => {
22
21
  setMatches(event.matches);
@@ -14,9 +14,11 @@ function useNoInteractiveChildren(ref) {
14
14
  useEffect(() => {
15
15
  const node = ref.current ? getInteractiveContent(ref.current) : false;
16
16
  if (node) {
17
- throw new Error(`Error: ${message}.\n\nInstead found: ${node.outerHTML}`);
17
+ const errorMessage = `Error: ${message}.\n\nInstead found: ${node.outerHTML}`;
18
+ console.error(errorMessage);
19
+ throw new Error(errorMessage);
18
20
  }
19
- });
21
+ }, []);
20
22
  }
21
23
  }
22
24
  function useInteractiveChildrenNeedDescription(ref) {
@@ -5,4 +5,4 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import { type RefObject } from 'react';
8
- export declare const useOutsideClick: <T extends HTMLElement>(ref: RefObject<T>, callback: (event: MouseEvent) => void) => void;
8
+ export declare const useOutsideClick: <T extends HTMLElement | null>(ref: RefObject<T>, callback: (event: MouseEvent) => void) => void;
@@ -6,7 +6,7 @@
6
6
  */
7
7
 
8
8
  import PropTypes from 'prop-types';
9
- import isRequiredOneOf from './isRequiredOneOf.js';
9
+ import { isRequiredOneOf } from './isRequiredOneOf.js';
10
10
 
11
11
  const AriaLabelPropType = isRequiredOneOf({
12
12
  'aria-label': PropTypes.string,
@@ -0,0 +1,16 @@
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
+ import type { Validator, ValidationMap } from 'prop-types';
8
+ /**
9
+ * Returns a set of prop-type validators that enforce at least one of the
10
+ * specified props must be provided.
11
+ *
12
+ * @param propTypes - An object of prop-type validators. The keys of the object
13
+ * are the names of the props, and the values are the prop-type validators.
14
+ * @returns A new object of wrapped prop-type validators.
15
+ */
16
+ export declare const isRequiredOneOf: <T extends Record<string, Validator<any>>>(propTypes: T) => ValidationMap<any>;
@@ -6,12 +6,14 @@
6
6
  */
7
7
 
8
8
  /**
9
- * @param {[key: string]: Function)} propTypes The list of type checkers, keyed by prop names.
10
- * @returns {[key: string]: Function}
11
- * The new prop type checkers that checks if one of the given props exist,
12
- * in addition to the original type checkings.
9
+ * Returns a set of prop-type validators that enforce at least one of the
10
+ * specified props must be provided.
11
+ *
12
+ * @param propTypes - An object of prop-type validators. The keys of the object
13
+ * are the names of the props, and the values are the prop-type validators.
14
+ * @returns A new object of wrapped prop-type validators.
13
15
  */
14
- function isRequiredOneOf(propTypes) {
16
+ const isRequiredOneOf = propTypes => {
15
17
  const names = Object.keys(propTypes);
16
18
  const checker = propType => function (props, propName, componentName) {
17
19
  if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
@@ -22,10 +24,10 @@ function isRequiredOneOf(propTypes) {
22
24
  }
23
25
  return propType(props, propName, componentName, ...rest);
24
26
  };
25
- return names.reduce((o, name) => ({
26
- ...o,
27
+ return names.reduce((acc, name) => ({
28
+ ...acc,
27
29
  [name]: checker(propTypes[name])
28
30
  }), {});
29
- }
31
+ };
30
32
 
31
- export { isRequiredOneOf as default };
33
+ export { isRequiredOneOf };
@@ -0,0 +1,12 @@
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
+ * Creates an instance ID generator.
9
+ *
10
+ * @returns A function that returns a unique sequential ID on each call.
11
+ */
12
+ export declare const setupGetInstanceId: () => () => number;
@@ -6,14 +6,13 @@
6
6
  */
7
7
 
8
8
  /**
9
- * Generic utility to initialize a method that will return a unique instance id
10
- * for a component.
9
+ * Creates an instance ID generator.
10
+ *
11
+ * @returns A function that returns a unique sequential ID on each call.
11
12
  */
12
- function setupGetInstanceId() {
13
+ const setupGetInstanceId = () => {
13
14
  let instanceId = 0;
14
- return function getInstanceId() {
15
- return ++instanceId;
16
- };
17
- }
15
+ return () => ++instanceId;
16
+ };
18
17
 
19
- export { setupGetInstanceId as default };
18
+ export { setupGetInstanceId };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright IBM Corp. 2019, 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
+ * Toggles a class on an element.
9
+ *
10
+ * @param element - The target element.
11
+ * @param className - The class to toggle.
12
+ * @param add - `true` to add the class, `false` to remove it.
13
+ */
14
+ export declare const toggleClass: (element: Element, className: string, add: boolean) => void;
@@ -6,15 +6,14 @@
6
6
  */
7
7
 
8
8
  /**
9
- * Adds or removes a CSS class to an element.
10
- * @param {Element} element An element.
11
- * @param {string} name A CSS class name.
12
- * @param {boolean} add `true` to add the given CSS class to given the element. Otherwise to remove.
9
+ * Toggles a class on an element.
10
+ *
11
+ * @param element - The target element.
12
+ * @param className - The class to toggle.
13
+ * @param add - `true` to add the class, `false` to remove it.
13
14
  */
14
- function toggleClass(element, name, add) {
15
- if (element.classList.contains(name) === !add) {
16
- element.classList[add ? 'add' : 'remove'](name);
17
- }
18
- }
15
+ const toggleClass = (element, className, add) => {
16
+ element.classList.toggle(className, add);
17
+ };
19
18
 
20
- export { toggleClass as default };
19
+ export { toggleClass };
@@ -16,5 +16,5 @@ type WrapComponentArgs<T extends HTMLTagName> = {
16
16
  * @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
17
17
  * @returns
18
18
  */
19
- declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props: ReactAttr<T>) => React.ReactElement);
19
+ declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props: ReactAttr<T>) => React.ReactElement<any>);
20
20
  export default wrapComponent;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2023, 2024
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.
@@ -22,8 +22,3 @@ export interface TranslateWithId<MID = string, ARGS = Record<string, unknown>> {
22
22
  */
23
23
  translateWithId?(messageId: MID, args?: ARGS): string;
24
24
  }
25
- /**
26
- * Alias of TranslateWithId. Will be removed in v12
27
- * @deprecated Use TranslateWithId instead
28
- */
29
- export type InternationalProps<MID = string, ARGS = Record<string, unknown>> = TranslateWithId<MID, ARGS>;
@@ -33,12 +33,12 @@ export interface AccordionItemProps {
33
33
  * removed in the next major release of Carbon. Use the
34
34
  * `renderToggle` prop instead.
35
35
  */
36
- renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement;
36
+ renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement<any>;
37
37
  /**
38
38
  * The callback function to render the expand button.
39
39
  * Can be a React component class.
40
40
  */
41
- renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement;
41
+ renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement<any>;
42
42
  /**
43
43
  * The accordion title.
44
44
  */
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
- import { PropsWithChildren, ReactHTML } from 'react';
8
+ import { PropsWithChildren, HTMLElementType } from 'react';
9
9
  export interface AspectRatioProps {
10
10
  /**
11
11
  * Provide a custom component or string to be rendered as
@@ -17,7 +17,7 @@ export interface AspectRatioProps {
17
17
  * <AspectRatio as="article">My content</AspectRatio>
18
18
  * ```
19
19
  */
20
- as?: keyof ReactHTML;
20
+ as?: HTMLElementType;
21
21
  /**
22
22
  * Specify a class name for the outermost node
23
23
  * of the component.
@@ -53,6 +53,9 @@ const Button = /*#__PURE__*/React__default["default"].forwardRef((props, ref) =>
53
53
  tooltipPosition = 'top',
54
54
  ...rest
55
55
  } = props;
56
+ if (ButtonImageElement && !children && !iconDescription) {
57
+ console.error('Button: renderIcon property specified without also providing an iconDescription property. ' + 'This may impact accessibility for screen reader users.');
58
+ }
56
59
  const handleClick = evt => {
57
60
  // Prevent clicks on the tooltip from triggering the button click event
58
61
  if (evt.target === tooltipRef.current) {
@@ -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 from 'react';
7
+ import React, { type JSX } from 'react';
8
8
  import { ButtonProps } from './Button';
9
- declare const ButtonBase: React.ForwardRefExoticComponent<Omit<ButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
9
+ declare const ButtonBase: React.ForwardRefExoticComponent<Omit<ButtonProps<React.ElementType<any, keyof JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
10
10
  export default ButtonBase;