@carbon/react 1.78.0 → 1.78.1

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 (217) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +883 -883
  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 +1 -2
  5. package/es/components/Button/ButtonBase.js +1 -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 +3 -3
  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/FlexGrid.js +7 -6
  36. package/es/components/Grid/GridTypes.d.ts +5 -3
  37. package/es/components/IconButton/index.js +3 -3
  38. package/es/components/Layer/index.d.ts +4 -6
  39. package/es/components/Layer/index.js +5 -6
  40. package/es/components/Link/Link.d.ts +2 -3
  41. package/es/components/Link/Link.js +1 -2
  42. package/es/components/ListBox/ListBoxMenuItem.d.ts +3 -3
  43. package/es/components/ListBox/ListBoxMenuItem.js +37 -15
  44. package/es/components/Menu/Menu.js +2 -2
  45. package/es/components/Menu/MenuItem.d.ts +2 -2
  46. package/es/components/Menu/MenuItem.js +3 -3
  47. package/es/components/Modal/Modal.js +121 -49
  48. package/es/components/ModalWrapper/ModalWrapper.js +1 -1
  49. package/es/components/MultiSelect/FilterableMultiSelect.js +3 -3
  50. package/es/components/MultiSelect/MultiSelect.js +2 -2
  51. package/es/components/Notification/Notification.d.ts +5 -13
  52. package/es/components/Notification/Notification.js +3 -4
  53. package/es/components/OverflowMenu/OverflowMenu.d.ts +4 -8
  54. package/es/components/OverflowMenu/OverflowMenu.js +3 -3
  55. package/es/components/OverflowMenu/next/index.d.ts +2 -2
  56. package/es/components/OverflowMenu/next/index.js +1 -1
  57. package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  58. package/es/components/ProgressIndicator/ProgressIndicator.js +2 -2
  59. package/es/components/RadioTile/RadioTile.js +2 -2
  60. package/es/components/Search/Search.d.ts +2 -3
  61. package/es/components/Search/Search.js +4 -6
  62. package/es/components/Slider/Slider.d.ts +16 -15
  63. package/es/components/Slider/Slider.js +22 -22
  64. package/es/components/Tabs/Tabs.d.ts +3 -6
  65. package/es/components/Tabs/Tabs.js +8 -9
  66. package/es/components/Tag/DismissibleTag.d.ts +3 -5
  67. package/es/components/Tag/DismissibleTag.js +1 -2
  68. package/es/components/Tag/OperationalTag.d.ts +2 -3
  69. package/es/components/Tag/OperationalTag.js +1 -2
  70. package/es/components/Tag/SelectableTag.d.ts +3 -5
  71. package/es/components/Tag/SelectableTag.js +1 -2
  72. package/es/components/Tag/Tag.d.ts +2 -3
  73. package/es/components/Tag/Tag.js +1 -2
  74. package/es/components/Tile/Tile.d.ts +3 -5
  75. package/es/components/Tile/Tile.js +8 -6
  76. package/es/components/Toggletip/index.js +2 -2
  77. package/es/components/Tooltip/DefinitionTooltip.js +2 -2
  78. package/es/components/Tooltip/Tooltip.d.ts +1 -1
  79. package/es/components/Tooltip/Tooltip.js +2 -2
  80. package/es/components/TreeView/TreeNode.d.ts +3 -5
  81. package/es/components/TreeView/TreeNode.js +3 -4
  82. package/es/components/TreeView/TreeView.js +2 -2
  83. package/es/components/UIShell/HeaderContainer.js +2 -2
  84. package/es/components/UIShell/HeaderMenu.js +2 -2
  85. package/es/components/UIShell/HeaderPanel.js +2 -2
  86. package/es/components/UIShell/SideNav.d.ts +1 -1
  87. package/es/components/UIShell/SideNav.js +2 -2
  88. package/es/components/UIShell/SideNavHeader.d.ts +2 -3
  89. package/es/components/UIShell/SideNavHeader.js +1 -2
  90. package/es/components/UIShell/SideNavLink.d.ts +2 -2
  91. package/es/components/UIShell/SideNavLink.js +1 -1
  92. package/es/components/UIShell/SideNavMenu.d.ts +2 -2
  93. package/es/components/UIShell/SideNavMenu.js +3 -3
  94. package/es/components/UIShell/SwitcherItem.js +2 -2
  95. package/es/internal/FloatingMenu.js +4 -4
  96. package/es/internal/OptimizedResize.d.ts +18 -0
  97. package/es/internal/OptimizedResize.js +21 -24
  98. package/es/internal/keyboard/index.d.ts +9 -0
  99. package/es/internal/keyboard/keys.d.ts +23 -0
  100. package/es/internal/keyboard/keys.js +2 -2
  101. package/es/internal/keyboard/match.d.ts +26 -0
  102. package/es/internal/keyboard/match.js +17 -41
  103. package/es/internal/keyboard/navigation.d.ts +37 -0
  104. package/es/internal/keyboard/navigation.js +15 -27
  105. package/es/internal/useMergedRefs.js +3 -0
  106. package/lib/components/Accordion/AccordionItem.js +2 -2
  107. package/lib/components/Button/Button.d.ts +2 -3
  108. package/lib/components/Button/Button.js +1 -2
  109. package/lib/components/Button/ButtonBase.js +1 -1
  110. package/lib/components/ChatButton/ChatButton.d.ts +2 -3
  111. package/lib/components/ChatButton/ChatButton.js +1 -2
  112. package/lib/components/ComboBox/ComboBox.js +34 -24
  113. package/lib/components/ComposedModal/ComposedModal.js +64 -50
  114. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +2 -2
  115. package/lib/components/ContainedList/ContainedListItem/ContainedListItem.js +1 -1
  116. package/lib/components/ContentSwitcher/ContentSwitcher.js +3 -3
  117. package/lib/components/DataTable/TableBatchAction.d.ts +3 -3
  118. package/lib/components/DataTable/TableBatchAction.js +1 -1
  119. package/lib/components/DataTable/TableContainer.d.ts +1 -1
  120. package/lib/components/DataTable/TableContainer.js +3 -3
  121. package/lib/components/DataTable/TableExpandHeader.d.ts +6 -5
  122. package/lib/components/DataTable/TableToolbarMenu.d.ts +2 -2
  123. package/lib/components/DataTable/TableToolbarMenu.js +1 -1
  124. package/lib/components/DatePicker/DatePicker.js +2 -2
  125. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -1
  126. package/lib/components/Dialog/index.d.ts +42 -4
  127. package/lib/components/Dialog/index.js +190 -0
  128. package/lib/components/ExpandableSearch/ExpandableSearch.js +2 -2
  129. package/lib/components/FeatureFlags/index.d.ts +3 -1
  130. package/lib/components/FeatureFlags/index.js +3 -0
  131. package/lib/components/FileUploader/FileUploader.d.ts +1 -1
  132. package/lib/components/FileUploader/FileUploader.js +2 -2
  133. package/lib/components/FileUploader/FileUploaderButton.js +2 -2
  134. package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
  135. package/lib/components/FileUploader/FileUploaderDropContainer.js +6 -4
  136. package/lib/components/FileUploader/FileUploaderItem.d.ts +1 -1
  137. package/lib/components/FileUploader/FileUploaderItem.js +2 -2
  138. package/lib/components/Grid/CSSGrid.js +18 -14
  139. package/lib/components/Grid/FlexGrid.js +7 -6
  140. package/lib/components/Grid/GridTypes.d.ts +5 -3
  141. package/lib/components/IconButton/index.js +3 -3
  142. package/lib/components/Layer/index.d.ts +4 -6
  143. package/lib/components/Layer/index.js +5 -6
  144. package/lib/components/Link/Link.d.ts +2 -3
  145. package/lib/components/Link/Link.js +1 -2
  146. package/lib/components/ListBox/ListBoxMenuItem.d.ts +3 -3
  147. package/lib/components/ListBox/ListBoxMenuItem.js +36 -14
  148. package/lib/components/Menu/Menu.js +2 -2
  149. package/lib/components/Menu/MenuItem.d.ts +2 -2
  150. package/lib/components/Menu/MenuItem.js +3 -3
  151. package/lib/components/Modal/Modal.js +123 -51
  152. package/lib/components/ModalWrapper/ModalWrapper.js +1 -1
  153. package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -3
  154. package/lib/components/MultiSelect/MultiSelect.js +2 -2
  155. package/lib/components/Notification/Notification.d.ts +5 -13
  156. package/lib/components/Notification/Notification.js +3 -4
  157. package/lib/components/OverflowMenu/OverflowMenu.d.ts +4 -8
  158. package/lib/components/OverflowMenu/OverflowMenu.js +3 -3
  159. package/lib/components/OverflowMenu/next/index.d.ts +2 -2
  160. package/lib/components/OverflowMenu/next/index.js +1 -1
  161. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
  162. package/lib/components/ProgressIndicator/ProgressIndicator.js +2 -2
  163. package/lib/components/RadioTile/RadioTile.js +2 -2
  164. package/lib/components/Search/Search.d.ts +2 -3
  165. package/lib/components/Search/Search.js +4 -6
  166. package/lib/components/Slider/Slider.d.ts +16 -15
  167. package/lib/components/Slider/Slider.js +22 -22
  168. package/lib/components/Tabs/Tabs.d.ts +3 -6
  169. package/lib/components/Tabs/Tabs.js +8 -9
  170. package/lib/components/Tag/DismissibleTag.d.ts +3 -5
  171. package/lib/components/Tag/DismissibleTag.js +1 -2
  172. package/lib/components/Tag/OperationalTag.d.ts +2 -3
  173. package/lib/components/Tag/OperationalTag.js +1 -2
  174. package/lib/components/Tag/SelectableTag.d.ts +3 -5
  175. package/lib/components/Tag/SelectableTag.js +1 -2
  176. package/lib/components/Tag/Tag.d.ts +2 -3
  177. package/lib/components/Tag/Tag.js +1 -2
  178. package/lib/components/Tile/Tile.d.ts +3 -5
  179. package/lib/components/Tile/Tile.js +8 -6
  180. package/lib/components/Toggletip/index.js +2 -2
  181. package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
  182. package/lib/components/Tooltip/Tooltip.d.ts +1 -1
  183. package/lib/components/Tooltip/Tooltip.js +2 -2
  184. package/lib/components/TreeView/TreeNode.d.ts +3 -5
  185. package/lib/components/TreeView/TreeNode.js +3 -4
  186. package/lib/components/TreeView/TreeView.js +2 -2
  187. package/lib/components/UIShell/HeaderContainer.js +2 -2
  188. package/lib/components/UIShell/HeaderMenu.js +2 -2
  189. package/lib/components/UIShell/HeaderPanel.js +2 -2
  190. package/lib/components/UIShell/SideNav.d.ts +1 -1
  191. package/lib/components/UIShell/SideNav.js +2 -2
  192. package/lib/components/UIShell/SideNavHeader.d.ts +2 -3
  193. package/lib/components/UIShell/SideNavHeader.js +1 -2
  194. package/lib/components/UIShell/SideNavLink.d.ts +2 -2
  195. package/lib/components/UIShell/SideNavLink.js +1 -1
  196. package/lib/components/UIShell/SideNavMenu.d.ts +2 -2
  197. package/lib/components/UIShell/SideNavMenu.js +3 -3
  198. package/lib/components/UIShell/SwitcherItem.js +2 -2
  199. package/lib/internal/FloatingMenu.js +5 -5
  200. package/lib/internal/OptimizedResize.d.ts +18 -0
  201. package/lib/internal/OptimizedResize.js +21 -24
  202. package/lib/internal/keyboard/index.d.ts +9 -0
  203. package/lib/internal/keyboard/keys.d.ts +23 -0
  204. package/lib/internal/keyboard/keys.js +2 -2
  205. package/lib/internal/keyboard/match.d.ts +26 -0
  206. package/lib/internal/keyboard/match.js +17 -41
  207. package/lib/internal/keyboard/navigation.d.ts +37 -0
  208. package/lib/internal/keyboard/navigation.js +15 -27
  209. package/lib/internal/useMergedRefs.js +3 -0
  210. package/package.json +6 -6
  211. package/scss/components/dialog/_dialog.scss +9 -0
  212. package/scss/components/dialog/_index.scss +9 -0
  213. package/telemetry.yml +1 -0
  214. package/es/components/Modal/next/index.d.ts +0 -171
  215. package/es/internal/focus/index.js +0 -15
  216. package/lib/components/Modal/next/index.d.ts +0 -171
  217. package/lib/internal/focus/index.js +0 -19
@@ -13,12 +13,12 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
13
13
  var cx = require('classnames');
14
14
  var PropTypes = require('prop-types');
15
15
  var React = require('react');
16
+ var keys = require('../../internal/keyboard/keys.js');
17
+ var match = require('../../internal/keyboard/match.js');
16
18
  var iconsReact = require('@carbon/icons-react');
17
19
  var usePrefix = require('../../internal/usePrefix.js');
18
20
  require('../Text/index.js');
19
- var match = require('../../internal/keyboard/match.js');
20
21
  var Text = require('../Text/Text.js');
21
- var keys = require('../../internal/keyboard/keys.js');
22
22
 
23
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
24
24
 
@@ -14,15 +14,15 @@ var iconsReact = require('@carbon/icons-react');
14
14
  var cx = require('classnames');
15
15
  var PropTypes = require('prop-types');
16
16
  var React = require('react');
17
+ var keys = require('../../internal/keyboard/keys.js');
18
+ var match = require('../../internal/keyboard/match.js');
17
19
  var useId = require('../../internal/useId.js');
18
20
  var usePrefix = require('../../internal/usePrefix.js');
19
21
  var deprecate = require('../../prop-types/deprecate.js');
20
22
  var noopFn = require('../../internal/noopFn.js');
21
23
  require('../Text/index.js');
22
24
  var index = require('../FeatureFlags/index.js');
23
- var match = require('../../internal/keyboard/match.js');
24
25
  var Text = require('../Text/Text.js');
25
- var keys = require('../../internal/keyboard/keys.js');
26
26
 
27
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
28
28
 
@@ -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 interface SearchProps extends InputPropsBase {
62
62
  */
63
63
  placeholder?: string;
64
64
  /**
65
- * Rendered icon for the Search.
66
- * Can be a React component class
65
+ * A component used to render an icon.
67
66
  */
68
67
  renderIcon?: ComponentType | FunctionComponent;
69
68
  /**
@@ -14,7 +14,8 @@ var iconsReact = require('@carbon/icons-react');
14
14
  var cx = require('classnames');
15
15
  var PropTypes = require('prop-types');
16
16
  var React = require('react');
17
- var index = require('../../internal/focus/index.js');
17
+ var keys = require('../../internal/keyboard/keys.js');
18
+ var match = require('../../internal/keyboard/match.js');
18
19
  var useId = require('../../internal/useId.js');
19
20
  var usePrefix = require('../../internal/usePrefix.js');
20
21
  var events = require('../../tools/events.js');
@@ -22,8 +23,6 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
22
23
  var deprecate = require('../../prop-types/deprecate.js');
23
24
  require('../FluidForm/FluidForm.js');
24
25
  var FormContext = require('../FluidForm/FormContext.js');
25
- var match = require('../../internal/keyboard/match.js');
26
- var keys = require('../../internal/keyboard/keys.js');
27
26
 
28
27
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
29
28
 
@@ -100,7 +99,7 @@ const Search = /*#__PURE__*/React__default["default"].forwardRef(function Search
100
99
  onChange(clearedEvt);
101
100
  onClear();
102
101
  setHasContent(false);
103
- index.focus(inputRef);
102
+ inputRef.current?.focus();
104
103
  }
105
104
  function handleChange(event) {
106
105
  setHasContent(event.target.value !== '');
@@ -231,8 +230,7 @@ Search.propTypes = {
231
230
  */
232
231
  placeholder: PropTypes__default["default"].string,
233
232
  /**
234
- * Rendered icon for the Search.
235
- * Can be a React component class
233
+ * A component used to render an icon.
236
234
  */
237
235
  // @ts-expect-error: PropTypes are not expressive enough to cover this case
238
236
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].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.
@@ -355,11 +355,13 @@ declare class Slider extends PureComponent<SliderProps> {
355
355
  */
356
356
  clamp(val: any, min: any, max: any): number;
357
357
  /**
358
- * Takes a value and ensures it fits to the steps of the range
359
- * @param value
360
- * @returns value of the nearest step
358
+ * Rounds a given value to the nearest step defined by the slider's `step`
359
+ * prop.
360
+ *
361
+ * @param value - The value to adjust to the nearest step. Defaults to `0`.
362
+ * @returns The value rounded to the precision determined by the step.
361
363
  */
362
- nearestStepValue(value: any): number;
364
+ nearestStepValue(value?: number): number;
363
365
  /**
364
366
  * Sets up "drag" event handlers and calls `this.onDrag` in case dragging
365
367
  * started on somewhere other than the thumb without a corresponding "move"
@@ -442,17 +444,16 @@ declare class Slider extends PureComponent<SliderProps> {
442
444
  };
443
445
  calcDistanceToHandle: (handle: HandlePosition, clientX: any) => number;
444
446
  /**
445
- * Given the current value, delta and step, calculate the new value.
447
+ * Calculates a new slider value based on the current value, a change delta,
448
+ * and a step.
446
449
  *
447
- * @param {number} currentValue
448
- * Current value user is moving from.
449
- * @param {number} delta
450
- * Movement from the current value. Can be positive or negative.
451
- * @param {number} step
452
- * A value determining how much the value should increase/decrease by moving
453
- * the thumb by mouse.
454
- */
455
- calcValueForDelta: (currentValue: any, delta: any, step?: number) => any;
450
+ * @param currentValue - The starting value from which the slider is moving.
451
+ * @param delta - The amount to adjust the current value by.
452
+ * @param step - The step. Defaults to `1`.
453
+ * @returns The new slider value, rounded to the same number of decimal places
454
+ * as the step.
455
+ */
456
+ calcValueForDelta: (currentValue: number, delta: number, step?: number) => number;
456
457
  /**
457
458
  * Sets state relevant to the given handle position.
458
459
  *
@@ -14,6 +14,7 @@ var React = require('react');
14
14
  var PropTypes = require('prop-types');
15
15
  var cx = require('classnames');
16
16
  var keys = require('../../internal/keyboard/keys.js');
17
+ var match = require('../../internal/keyboard/match.js');
17
18
  var usePrefix = require('../../internal/usePrefix.js');
18
19
  var deprecate = require('../../prop-types/deprecate.js');
19
20
  var index = require('../FeatureFlags/index.js');
@@ -23,7 +24,6 @@ require('../Tooltip/DefinitionTooltip.js');
23
24
  var Tooltip = require('../Tooltip/Tooltip.js');
24
25
  var SliderHandles = require('./SliderHandles.js');
25
26
  var throttle = require('../../node_modules/es-toolkit/dist/compat/function/throttle.mjs.js');
26
- var match = require('../../internal/keyboard/match.js');
27
27
  var Text = require('../Text/Text.js');
28
28
 
29
29
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -326,7 +326,7 @@ class Slider extends React.PureComponent {
326
326
  value,
327
327
  left
328
328
  } = this.calcValue({
329
- value: this.calcValueForDelta(currentValue, delta, this.props.step)
329
+ value: this.calcValueForDelta(currentValue ?? this.props.min, delta, this.props.step)
330
330
  });
331
331
  this.setValueLeftForHandle(this.state.activeHandle, {
332
332
  value: this.nearestStepValue(value),
@@ -603,19 +603,21 @@ class Slider extends React.PureComponent {
603
603
  return Math.abs(handleX - clientX);
604
604
  });
605
605
  /**
606
- * Given the current value, delta and step, calculate the new value.
606
+ * Calculates a new slider value based on the current value, a change delta,
607
+ * and a step.
607
608
  *
608
- * @param {number} currentValue
609
- * Current value user is moving from.
610
- * @param {number} delta
611
- * Movement from the current value. Can be positive or negative.
612
- * @param {number} step
613
- * A value determining how much the value should increase/decrease by moving
614
- * the thumb by mouse.
609
+ * @param currentValue - The starting value from which the slider is moving.
610
+ * @param delta - The amount to adjust the current value by.
611
+ * @param step - The step. Defaults to `1`.
612
+ * @returns The new slider value, rounded to the same number of decimal places
613
+ * as the step.
615
614
  */
616
615
  _rollupPluginBabelHelpers.defineProperty(this, "calcValueForDelta", function (currentValue, delta) {
617
616
  let step = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
618
- return (delta > 0 ? Math.floor(currentValue / step) * step : currentValue) + delta;
617
+ const base = delta > 0 ? Math.floor(currentValue / step) * step : currentValue;
618
+ const newValue = base + delta;
619
+ const decimals = (step.toString().split('.')[1] || '').length;
620
+ return Number(newValue.toFixed(decimals));
619
621
  });
620
622
  /**
621
623
  * Sets state relevant to the given handle position.
@@ -879,18 +881,16 @@ class Slider extends React.PureComponent {
879
881
  }
880
882
 
881
883
  /**
882
- * Takes a value and ensures it fits to the steps of the range
883
- * @param value
884
- * @returns value of the nearest step
884
+ * Rounds a given value to the nearest step defined by the slider's `step`
885
+ * prop.
886
+ *
887
+ * @param value - The value to adjust to the nearest step. Defaults to `0`.
888
+ * @returns The value rounded to the precision determined by the step.
885
889
  */
886
- nearestStepValue(value) {
887
- const tempInput = document.createElement('input');
888
- tempInput.type = 'range';
889
- tempInput.min = `${this.props.min}`;
890
- tempInput.max = `${this.props.max}`;
891
- tempInput.step = `${this.props.step}`;
892
- tempInput.value = `${value}`;
893
- return parseFloat(tempInput.value);
890
+ nearestStepValue() {
891
+ let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
892
+ const decimals = (this.props.step?.toString().split('.')[1] || '').length;
893
+ return Number(value.toFixed(decimals));
894
894
  }
895
895
  getClientXFromEvent(event) {
896
896
  let clientX;
@@ -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.
@@ -340,12 +340,9 @@ export interface TabProps extends HTMLAttributes<HTMLElement> {
340
340
  */
341
341
  renderButton?(): ReactNode;
342
342
  /**
343
- * Optional prop to render an icon next to the label.
344
- * Can be a React component class
343
+ * A component used to render an icon.
345
344
  */
346
- renderIcon?: ComponentType<{
347
- size: number;
348
- }>;
345
+ renderIcon?: React.ElementType;
349
346
  /**
350
347
  * An optional label to render under the primary tab label.
351
348
  * Only useful for contained tabs.
@@ -31,6 +31,8 @@ var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
31
31
  var useMergedRefs = require('../../internal/useMergedRefs.js');
32
32
  var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
33
33
  var usePrefix = require('../../internal/usePrefix.js');
34
+ var keys = require('../../internal/keyboard/keys.js');
35
+ var match = require('../../internal/keyboard/match.js');
34
36
  var usePressable = require('./usePressable.js');
35
37
  var deprecate = require('../../prop-types/deprecate.js');
36
38
  var useEvent = require('../../internal/useEvent.js');
@@ -38,9 +40,7 @@ var useMatchMedia = require('../../internal/useMatchMedia.js');
38
40
  require('../Text/index.js');
39
41
  var index = require('../BadgeIndicator/index.js');
40
42
  var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
41
- var match = require('../../internal/keyboard/match.js');
42
43
  var Text = require('../Text/Text.js');
43
- var keys = require('../../internal/keyboard/keys.js');
44
44
 
45
45
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
46
46
 
@@ -1017,22 +1017,21 @@ Tab.propTypes = {
1017
1017
  * Provide a handler that is invoked on the key down event for the control
1018
1018
  */
1019
1019
  onKeyDown: PropTypes__default["default"].func,
1020
- /*
1020
+ /**
1021
1021
  * An optional parameter to allow overriding the anchor rendering.
1022
1022
  * Useful for using Tab along with react-router or other client
1023
1023
  * side router libraries.
1024
- **/
1024
+ */
1025
1025
  renderButton: PropTypes__default["default"].func,
1026
1026
  /**
1027
- * Optional prop to render an icon next to the label.
1028
- * Can be a React component class
1027
+ * A component used to render an icon.
1029
1028
  */
1030
1029
  // @ts-expect-error: Invalid prop type derivation
1031
1030
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
1032
- /*
1031
+ /**
1033
1032
  * An optional label to render under the primary tab label.
1034
- /* This prop is only useful for contained tabs
1035
- **/
1033
+ * Only useful for contained tabs.
1034
+ */
1036
1035
  secondaryLabel: PropTypes__default["default"].string
1037
1036
  };
1038
1037
 
@@ -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.
@@ -30,8 +30,7 @@ export interface DismissibleTagBaseProps {
30
30
  */
31
31
  onClose?: (event: React.MouseEvent<HTMLButtonElement>) => void;
32
32
  /**
33
- * Optional prop to render a custom icon.
34
- * Can be a React component class
33
+ * A component used to render an icon.
35
34
  */
36
35
  renderIcon?: React.ElementType;
37
36
  /**
@@ -86,8 +85,7 @@ declare const DismissibleTag: {
86
85
  */
87
86
  onClose: PropTypes.Requireable<(...args: any[]) => any>;
88
87
  /**
89
- * Optional prop to render a custom icon.
90
- * Can be a React component class
88
+ * A component used to render an icon.
91
89
  */
92
90
  renderIcon: PropTypes.Requireable<object>;
93
91
  /**
@@ -129,8 +129,7 @@ DismissibleTag.propTypes = {
129
129
  */
130
130
  onClose: PropTypes__default["default"].func,
131
131
  /**
132
- * Optional prop to render a custom icon.
133
- * Can be a React component class
132
+ * A component used to render an icon.
134
133
  */
135
134
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
136
135
  /**
@@ -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;
@@ -111,8 +111,7 @@ OperationalTag.propTypes = {
111
111
  */
112
112
  id: PropTypes__default["default"].string,
113
113
  /**
114
- * Optional prop to render a custom icon.
115
- * Can be a React component class
114
+ * A component used to render an icon.
116
115
  */
117
116
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
118
117
  /**
@@ -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
  /**
@@ -108,8 +108,7 @@ SelectableTag.propTypes = {
108
108
  */
109
109
  id: PropTypes__default["default"].string,
110
110
  /**
111
- * Optional prop to render a custom icon.
112
- * Can be a React component class
111
+ * A component used to render an icon.
113
112
  */
114
113
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
115
114
  /**
@@ -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
  /**
@@ -186,8 +186,7 @@ Tag.propTypes = {
186
186
  */
187
187
  onClose: deprecate["default"](PropTypes__default["default"].func, 'The `onClose` prop has been deprecated and will be removed in the next major version. Use DismissibleTag instead.'),
188
188
  /**
189
- * Optional prop to render a custom icon.
190
- * Can be a React component class
189
+ * A component used to render an icon.
191
190
  */
192
191
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
193
192
  /**
@@ -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
  */
@@ -15,6 +15,8 @@ var PropTypes = require('prop-types');
15
15
  var cx = require('classnames');
16
16
  var iconsReact = require('@carbon/icons-react');
17
17
  var Link = require('../Link/Link.js');
18
+ var keys = require('../../internal/keyboard/keys.js');
19
+ var match = require('../../internal/keyboard/match.js');
18
20
  var deprecate = require('../../prop-types/deprecate.js');
19
21
  var events = require('../../tools/events.js');
20
22
  var usePrefix = require('../../internal/usePrefix.js');
@@ -24,9 +26,7 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
24
26
  var index = require('../FeatureFlags/index.js');
25
27
  var useId = require('../../internal/useId.js');
26
28
  require('../Text/index.js');
27
- var match = require('../../internal/keyboard/match.js');
28
29
  var Text = require('../Text/Text.js');
29
- var keys = require('../../internal/keyboard/keys.js');
30
30
 
31
31
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
32
32
 
@@ -211,8 +211,7 @@ ClickableTile.propTypes = {
211
211
  */
212
212
  rel: PropTypes__default["default"].string,
213
213
  /**
214
- * Optional prop to allow overriding the icon rendering.
215
- * Can be a React component class
214
+ * A component used to render an icon.
216
215
  */
217
216
  // @ts-expect-error: Invalid derived prop type, seemingly no real solution.
218
217
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object])
@@ -255,9 +254,12 @@ const SelectableTile = /*#__PURE__*/React__default["default"].forwardRef(functio
255
254
  if (normalizedDecorator && decoratorRef.current && decoratorRef.current.contains(evt.target)) {
256
255
  return;
257
256
  }
258
- setIsSelected(!isSelected);
257
+ setIsSelected(prevSelected => {
258
+ const newSelected = !prevSelected;
259
+ onChange(evt, newSelected, id);
260
+ return newSelected;
261
+ });
259
262
  clickHandler(evt);
260
- onChange(evt, isSelected, id);
261
263
  }
262
264
  function handleKeyDown(evt) {
263
265
  evt?.persist?.();
@@ -14,11 +14,11 @@ var cx = require('classnames');
14
14
  var PropTypes = require('prop-types');
15
15
  var React = require('react');
16
16
  var index = require('../Popover/index.js');
17
+ var keys = require('../../internal/keyboard/keys.js');
18
+ var match = require('../../internal/keyboard/match.js');
17
19
  var useEvent = require('../../internal/useEvent.js');
18
20
  var useId = require('../../internal/useId.js');
19
21
  var usePrefix = require('../../internal/usePrefix.js');
20
- var match = require('../../internal/keyboard/match.js');
21
- var keys = require('../../internal/keyboard/keys.js');
22
22
 
23
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
24
24
 
@@ -14,11 +14,11 @@ var cx = require('classnames');
14
14
  var PropTypes = require('prop-types');
15
15
  var React = require('react');
16
16
  var index = require('../Popover/index.js');
17
+ var keys = require('../../internal/keyboard/keys.js');
18
+ var match = require('../../internal/keyboard/match.js');
17
19
  var useId = require('../../internal/useId.js');
18
20
  var usePrefix = require('../../internal/usePrefix.js');
19
21
  var deprecate = require('../../prop-types/deprecate.js');
20
- var match = require('../../internal/keyboard/match.js');
21
- var keys = require('../../internal/keyboard/keys.js');
22
22
 
23
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
24
24
 
@@ -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.
@@ -14,13 +14,13 @@ var cx = require('classnames');
14
14
  var PropTypes = require('prop-types');
15
15
  var React = require('react');
16
16
  var index = require('../Popover/index.js');
17
+ var keys = require('../../internal/keyboard/keys.js');
18
+ var match = require('../../internal/keyboard/match.js');
17
19
  var useDelayedState = require('../../internal/useDelayedState.js');
18
20
  var useId = require('../../internal/useId.js');
19
21
  var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
20
22
  var usePrefix = require('../../internal/usePrefix.js');
21
23
  var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
22
- var match = require('../../internal/keyboard/match.js');
23
- var keys = require('../../internal/keyboard/keys.js');
24
24
 
25
25
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
26
26
 
@@ -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
  /**
@@ -14,12 +14,12 @@ var iconsReact = require('@carbon/icons-react');
14
14
  var cx = require('classnames');
15
15
  var PropTypes = require('prop-types');
16
16
  var React = require('react');
17
+ var keys = require('../../internal/keyboard/keys.js');
18
+ var match = require('../../internal/keyboard/match.js');
17
19
  var useControllableState = require('../../internal/useControllableState.js');
18
20
  var usePrefix = require('../../internal/usePrefix.js');
19
21
  var uniqueId = require('../../tools/uniqueId.js');
20
22
  var index = require('../FeatureFlags/index.js');
21
- var match = require('../../internal/keyboard/match.js');
22
- var keys = require('../../internal/keyboard/keys.js');
23
23
 
24
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
25
 
@@ -410,8 +410,7 @@ TreeNode.propTypes = {
410
410
  */
411
411
  onTreeSelect: PropTypes__default["default"].func,
412
412
  /**
413
- * Optional prop to allow each node to have an associated icon.
414
- * Can be a React component class
413
+ * A component used to render an icon.
415
414
  */
416
415
  // @ts-ignore
417
416
  renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
@@ -13,13 +13,13 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
13
13
  var cx = require('classnames');
14
14
  var PropTypes = require('prop-types');
15
15
  var React = require('react');
16
+ var keys = require('../../internal/keyboard/keys.js');
17
+ var match = require('../../internal/keyboard/match.js');
16
18
  var useControllableState = require('../../internal/useControllableState.js');
17
19
  var usePrefix = require('../../internal/usePrefix.js');
18
20
  var uniqueId = require('../../tools/uniqueId.js');
19
21
  var index = require('../FeatureFlags/index.js');
20
22
  var TreeNode = require('./TreeNode.js');
21
- var match = require('../../internal/keyboard/match.js');
22
- var keys = require('../../internal/keyboard/keys.js');
23
23
 
24
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
25
25
 
@@ -12,9 +12,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
12
12
  var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
13
13
  var PropTypes = require('prop-types');
14
14
  var React = require('react');
15
- var useEvent = require('../../internal/useEvent.js');
16
- var match = require('../../internal/keyboard/match.js');
17
15
  var keys = require('../../internal/keyboard/keys.js');
16
+ var match = require('../../internal/keyboard/match.js');
17
+ var useEvent = require('../../internal/useEvent.js');
18
18
 
19
19
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
20