@carbon/react 1.76.0 → 1.77.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 (188) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +810 -775
  2. package/es/components/Button/Button.d.ts +9 -1
  3. package/es/components/Button/Button.js +8 -0
  4. package/es/components/CodeSnippet/CodeSnippet.d.ts +2 -2
  5. package/es/components/ComboBox/ComboBox.d.ts +2 -2
  6. package/es/components/ComboBox/ComboBox.js +34 -12
  7. package/es/components/ComboButton/index.js +1 -2
  8. package/es/components/ComposedModal/ComposedModal.js +1 -1
  9. package/es/components/ContentSwitcher/index.d.ts +0 -1
  10. package/es/components/ContextMenu/useContextMenu.d.ts +0 -1
  11. package/es/components/Copy/Copy.js +1 -1
  12. package/es/components/DataTable/DataTable.d.ts +12 -20
  13. package/es/components/DataTable/DataTable.js +1 -9
  14. package/es/components/DataTable/Table.js +1 -1
  15. package/es/components/DataTable/TableActionList.d.ts +1 -1
  16. package/es/components/DataTable/TableBody.js +1 -1
  17. package/es/components/DataTable/TableContext.d.ts +0 -1
  18. package/es/components/DataTable/TableHead.d.ts +1 -1
  19. package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
  20. package/es/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
  21. package/es/components/DatePickerInput/DatePickerInput.js +1 -1
  22. package/es/components/Dropdown/Dropdown.js +1 -2
  23. package/es/components/FluidForm/FormContext.d.ts +0 -1
  24. package/es/components/Grid/CSSGrid.js +1 -1
  25. package/es/components/Grid/Grid.js +1 -1
  26. package/es/components/Grid/GridTypes.d.ts +0 -1
  27. package/es/components/Heading/index.d.ts +1 -1
  28. package/es/components/IconButton/index.d.ts +17 -1
  29. package/es/components/IconButton/index.js +20 -1
  30. package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
  31. package/es/components/InlineLoading/InlineLoading.d.ts +1 -1
  32. package/es/components/InlineLoading/InlineLoading.js +21 -7
  33. package/es/components/Menu/Menu.js +2 -2
  34. package/es/components/Menu/MenuContext.d.ts +1 -1
  35. package/es/components/MenuButton/index.d.ts +1 -1
  36. package/es/components/MenuButton/index.js +1 -2
  37. package/es/components/Modal/Modal.js +1 -1
  38. package/es/components/Modal/next/index.d.ts +175 -0
  39. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
  40. package/es/components/MultiSelect/FilterableMultiSelect.js +12 -5
  41. package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
  42. package/es/components/MultiSelect/MultiSelect.js +1 -2
  43. package/es/components/Pagination/Pagination.js +2 -2
  44. package/es/components/Popover/index.js +2 -3
  45. package/es/components/PrimaryButton/PrimaryButton.d.ts +1 -1
  46. package/es/components/RadioTile/RadioTile.d.ts +1 -1
  47. package/es/components/SecondaryButton/SecondaryButton.d.ts +1 -1
  48. package/es/components/Slider/Slider.d.ts +1 -1
  49. package/es/components/Slider/Slider.js +1 -1
  50. package/es/components/Slider/index.d.ts +0 -1
  51. package/es/components/Tabs/Tabs.d.ts +3 -3
  52. package/es/components/Tabs/Tabs.js +4 -4
  53. package/es/components/Tag/DismissibleTag.d.ts +2 -2
  54. package/es/components/Tag/OperationalTag.d.ts +1 -1
  55. package/es/components/Tag/SelectableTag.d.ts +2 -2
  56. package/es/components/Text/index.d.ts +2 -2
  57. package/es/components/TextInput/PasswordInput.d.ts +1 -1
  58. package/es/components/Theme/index.d.ts +1 -1
  59. package/es/components/Tile/Tile.d.ts +1 -1
  60. package/es/components/Tile/Tile.js +1 -1
  61. package/es/components/Toggletip/index.d.ts +3 -3
  62. package/es/components/Toggletip/index.js +5 -4
  63. package/es/components/Tooltip/Tooltip.d.ts +17 -1
  64. package/es/components/Tooltip/Tooltip.js +12 -2
  65. package/es/components/TreeView/TreeNode.d.ts +27 -19
  66. package/es/components/TreeView/TreeNode.js +100 -31
  67. package/es/components/TreeView/TreeView.js +1 -1
  68. package/es/components/UIShell/Content.d.ts +9 -9
  69. package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  70. package/es/components/UIShell/HeaderMenu.d.ts +69 -25
  71. package/es/components/UIShell/HeaderMenuButton.d.ts +69 -27
  72. package/es/components/UIShell/HeaderMenuItem.d.ts +4 -3
  73. package/es/components/UIShell/HeaderMenuItem.js +1 -1
  74. package/es/components/UIShell/HeaderName.js +1 -1
  75. package/es/components/UIShell/HeaderNavigation.d.ts +69 -25
  76. package/es/components/UIShell/Link.d.ts +14 -11
  77. package/es/components/UIShell/Link.js +5 -6
  78. package/es/components/UIShell/SideNav.js +3 -3
  79. package/es/components/UIShell/SideNavLink.js +1 -1
  80. package/es/components/UIShell/SideNavMenuItem.d.ts +51 -3
  81. package/es/components/UIShell/SideNavMenuItem.js +6 -6
  82. package/es/components/UIShell/SwitcherItem.d.ts +2 -2
  83. package/es/components/UIShell/SwitcherItem.js +1 -1
  84. package/es/internal/PolymorphicProps.d.ts +0 -1
  85. package/es/internal/Selection.d.ts +38 -0
  86. package/es/internal/Selection.js +26 -113
  87. package/es/node_modules/es-toolkit/dist/compat/function/debounce.mjs.js +55 -0
  88. package/es/node_modules/es-toolkit/dist/compat/function/throttle.mjs.js +23 -0
  89. package/es/node_modules/es-toolkit/dist/function/debounce.mjs.js +70 -0
  90. package/es/tools/wrapComponent.d.ts +1 -1
  91. package/lib/components/Button/Button.d.ts +9 -1
  92. package/lib/components/Button/Button.js +8 -0
  93. package/lib/components/CodeSnippet/CodeSnippet.d.ts +2 -2
  94. package/lib/components/ComboBox/ComboBox.d.ts +2 -2
  95. package/lib/components/ComboBox/ComboBox.js +34 -12
  96. package/lib/components/ComboButton/index.js +1 -2
  97. package/lib/components/ComposedModal/ComposedModal.js +2 -2
  98. package/lib/components/ContentSwitcher/index.d.ts +0 -1
  99. package/lib/components/ContextMenu/useContextMenu.d.ts +0 -1
  100. package/lib/components/Copy/Copy.js +2 -2
  101. package/lib/components/DataTable/DataTable.d.ts +12 -20
  102. package/lib/components/DataTable/DataTable.js +1 -9
  103. package/lib/components/DataTable/Table.js +3 -3
  104. package/lib/components/DataTable/TableActionList.d.ts +1 -1
  105. package/lib/components/DataTable/TableBody.js +1 -1
  106. package/lib/components/DataTable/TableContext.d.ts +0 -1
  107. package/lib/components/DataTable/TableHead.d.ts +1 -1
  108. package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
  109. package/lib/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
  110. package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
  111. package/lib/components/Dropdown/Dropdown.js +1 -2
  112. package/lib/components/FluidForm/FormContext.d.ts +0 -1
  113. package/lib/components/Grid/CSSGrid.js +1 -1
  114. package/lib/components/Grid/Grid.js +1 -1
  115. package/lib/components/Grid/GridTypes.d.ts +0 -1
  116. package/lib/components/Heading/index.d.ts +1 -1
  117. package/lib/components/IconButton/index.d.ts +17 -1
  118. package/lib/components/IconButton/index.js +20 -1
  119. package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
  120. package/lib/components/InlineLoading/InlineLoading.d.ts +1 -1
  121. package/lib/components/InlineLoading/InlineLoading.js +20 -6
  122. package/lib/components/Menu/Menu.js +2 -2
  123. package/lib/components/Menu/MenuContext.d.ts +1 -1
  124. package/lib/components/MenuButton/index.d.ts +1 -1
  125. package/lib/components/MenuButton/index.js +1 -2
  126. package/lib/components/Modal/Modal.js +2 -2
  127. package/lib/components/Modal/next/index.d.ts +175 -0
  128. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
  129. package/lib/components/MultiSelect/FilterableMultiSelect.js +11 -4
  130. package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
  131. package/lib/components/MultiSelect/MultiSelect.js +1 -2
  132. package/lib/components/Pagination/Pagination.js +3 -2
  133. package/lib/components/Popover/index.js +2 -3
  134. package/lib/components/PrimaryButton/PrimaryButton.d.ts +1 -1
  135. package/lib/components/RadioTile/RadioTile.d.ts +1 -1
  136. package/lib/components/SecondaryButton/SecondaryButton.d.ts +1 -1
  137. package/lib/components/Slider/Slider.d.ts +1 -1
  138. package/lib/components/Slider/Slider.js +2 -2
  139. package/lib/components/Slider/index.d.ts +0 -1
  140. package/lib/components/Tabs/Tabs.d.ts +3 -3
  141. package/lib/components/Tabs/Tabs.js +6 -6
  142. package/lib/components/Tag/DismissibleTag.d.ts +2 -2
  143. package/lib/components/Tag/OperationalTag.d.ts +1 -1
  144. package/lib/components/Tag/SelectableTag.d.ts +2 -2
  145. package/lib/components/Text/index.d.ts +2 -2
  146. package/lib/components/TextInput/PasswordInput.d.ts +1 -1
  147. package/lib/components/Theme/index.d.ts +1 -1
  148. package/lib/components/Tile/Tile.d.ts +1 -1
  149. package/lib/components/Tile/Tile.js +1 -1
  150. package/lib/components/Toggletip/index.d.ts +3 -3
  151. package/lib/components/Toggletip/index.js +5 -4
  152. package/lib/components/Tooltip/Tooltip.d.ts +17 -1
  153. package/lib/components/Tooltip/Tooltip.js +12 -2
  154. package/lib/components/TreeView/TreeNode.d.ts +27 -19
  155. package/lib/components/TreeView/TreeNode.js +100 -31
  156. package/lib/components/TreeView/TreeView.js +1 -1
  157. package/lib/components/UIShell/Content.d.ts +9 -9
  158. package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
  159. package/lib/components/UIShell/HeaderMenu.d.ts +69 -25
  160. package/lib/components/UIShell/HeaderMenuButton.d.ts +69 -27
  161. package/lib/components/UIShell/HeaderMenuItem.d.ts +4 -3
  162. package/lib/components/UIShell/HeaderMenuItem.js +1 -1
  163. package/lib/components/UIShell/HeaderName.js +1 -1
  164. package/lib/components/UIShell/HeaderNavigation.d.ts +69 -25
  165. package/lib/components/UIShell/Link.d.ts +14 -11
  166. package/lib/components/UIShell/Link.js +4 -4
  167. package/lib/components/UIShell/SideNav.js +3 -3
  168. package/lib/components/UIShell/SideNavLink.js +1 -1
  169. package/lib/components/UIShell/SideNavMenuItem.d.ts +51 -3
  170. package/lib/components/UIShell/SideNavMenuItem.js +6 -6
  171. package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
  172. package/lib/components/UIShell/SwitcherItem.js +1 -1
  173. package/lib/internal/PolymorphicProps.d.ts +0 -1
  174. package/lib/internal/Selection.d.ts +38 -0
  175. package/lib/internal/Selection.js +24 -114
  176. package/lib/node_modules/es-toolkit/dist/compat/function/debounce.mjs.js +59 -0
  177. package/lib/node_modules/es-toolkit/dist/compat/function/throttle.mjs.js +27 -0
  178. package/lib/node_modules/es-toolkit/dist/function/debounce.mjs.js +74 -0
  179. package/lib/tools/wrapComponent.d.ts +1 -1
  180. package/package.json +10 -9
  181. package/es/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -896
  182. package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -76
  183. package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -139
  184. package/es/tools/array.js +0 -29
  185. package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -909
  186. package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -80
  187. package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -163
  188. package/lib/tools/array.js +0 -33
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference types="react" />
8
7
  import { ContentSwitcherProps } from './ContentSwitcher';
9
8
  declare const ContentSwitcher: import("react").FunctionComponent<ContentSwitcherProps>;
10
9
  export default ContentSwitcher;
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference types="react" />
8
7
  type TriggerType = Element | Document | Window | React.RefObject<Element>;
9
8
  export interface ContextMenuProps {
10
9
  open: boolean;
@@ -12,13 +12,13 @@ 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 compat = require('es-toolkit/compat');
16
15
  var cx = require('classnames');
17
16
  var events = require('../../tools/events.js');
18
17
  var usePrefix = require('../../internal/usePrefix.js');
19
18
  var index = require('../IconButton/index.js');
20
19
  var noopFn = require('../../internal/noopFn.js');
21
20
  var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
21
+ var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
22
22
 
23
23
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
24
24
 
@@ -58,7 +58,7 @@ function Copy(_ref) {
58
58
  [`${prefix}--copy-btn--${animation}`]: animation
59
59
  });
60
60
  // eslint-disable-next-line react-hooks/exhaustive-deps
61
- const handleFadeOut = React.useCallback(compat.debounce(() => {
61
+ const handleFadeOut = React.useCallback(debounce.debounce(() => {
62
62
  setAnimation('fade-out');
63
63
  }, feedbackTimeout), [feedbackTimeout]);
64
64
  const handleClick = React.useCallback(() => {
@@ -6,7 +6,6 @@
6
6
  */
7
7
  import PropTypes from 'prop-types';
8
8
  import React from 'react';
9
- import type { MouseEvent } from 'react';
10
9
  import type { DataTableSortState } from './state/sortStates';
11
10
  import Table from './Table';
12
11
  import TableActionList from './TableActionList';
@@ -100,7 +99,6 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
100
99
  onExpand?: (e: React.MouseEvent<HTMLButtonElement>) => void;
101
100
  [key: string]: unknown;
102
101
  }) => {
103
- ariaLabel: string;
104
102
  ['aria-label']: string;
105
103
  isExpanded: boolean;
106
104
  onExpand: (e: React.MouseEvent<HTMLButtonElement>) => void;
@@ -111,7 +109,6 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
111
109
  row: DataTableRow<ColTypes>;
112
110
  [key: string]: unknown;
113
111
  }) => {
114
- ariaLabel: string;
115
112
  ['aria-label']: string;
116
113
  disabled: boolean | undefined;
117
114
  isExpanded?: boolean;
@@ -132,7 +129,6 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
132
129
  row: DataTableRow<ColTypes>;
133
130
  [key: string]: unknown;
134
131
  }) => {
135
- ariaLabel: string;
136
132
  'aria-label': string;
137
133
  checked?: boolean | undefined;
138
134
  disabled?: boolean | undefined;
@@ -349,13 +345,13 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
349
345
  * @returns {object}
350
346
  */
351
347
  getHeaderProps: ({ header, onClick, isSortable, ...rest }: {
352
- [key: string]: unknown;
353
348
  header: DataTableHeader;
354
- onClick?: ((e: React.MouseEvent<HTMLButtonElement>, sortState: {
349
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>, sortState: {
355
350
  sortHeaderKey: string;
356
351
  sortDirection: DataTableSortState;
357
- }) => void) | undefined;
358
- isSortable?: boolean | undefined;
352
+ }) => void;
353
+ isSortable?: boolean;
354
+ [key: string]: unknown;
359
355
  }) => {
360
356
  key: string;
361
357
  sortDirection: DataTableSortState;
@@ -375,12 +371,11 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
375
371
  */
376
372
  getExpandHeaderProps: ({ onClick, onExpand, ...rest }?: {
377
373
  [key: string]: unknown;
378
- onClick?: ((e: React.MouseEvent<HTMLButtonElement>, expandState: {
374
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>, expandState: {
379
375
  isExpanded: boolean;
380
- }) => void) | undefined;
381
- onExpand?: ((e: React.MouseEvent<HTMLButtonElement>) => void) | undefined;
376
+ }) => void;
377
+ onExpand?: (e: React.MouseEvent<HTMLButtonElement>) => void;
382
378
  }) => {
383
- ariaLabel: any;
384
379
  'aria-label': any;
385
380
  'aria-controls': string;
386
381
  isExpanded: boolean;
@@ -411,14 +406,13 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
411
406
  * @returns {object}
412
407
  */
413
408
  getRowProps: ({ row, onClick, ...rest }: {
414
- [key: string]: unknown;
415
- onClick?: ((e: React.MouseEvent<HTMLButtonElement>) => void) | undefined;
409
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
416
410
  row: DataTableRow<ColTypes>;
411
+ [key: string]: unknown;
417
412
  }) => {
418
413
  key: string;
419
414
  onExpand: any;
420
415
  isExpanded: boolean | undefined;
421
- ariaLabel: any;
422
416
  'aria-label': any;
423
417
  'aria-controls': string;
424
418
  isSelected: boolean | undefined;
@@ -432,8 +426,8 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
432
426
  * @returns {object}
433
427
  */
434
428
  getExpandedRowProps: ({ row, ...rest }: {
435
- [key: string]: unknown;
436
429
  row: DataTableRow<ColTypes>;
430
+ [key: string]: unknown;
437
431
  }) => {
438
432
  id: string;
439
433
  };
@@ -449,19 +443,17 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
449
443
  */
450
444
  getSelectionProps: ({ onClick, row, ...rest }?: {
451
445
  [key: string]: unknown;
452
- onClick?: ((e: React.MouseEvent<HTMLButtonElement>) => void) | undefined;
446
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
453
447
  row: DataTableRow<ColTypes>;
454
448
  }) => {
455
449
  checked: boolean | undefined;
456
450
  onSelect: any;
457
451
  id: string;
458
452
  name: string;
459
- ariaLabel: any;
460
453
  'aria-label': any;
461
454
  disabled: boolean | undefined;
462
455
  radio: boolean | undefined;
463
456
  } | {
464
- ariaLabel: any;
465
457
  'aria-label': any;
466
458
  checked: boolean;
467
459
  id: string;
@@ -470,8 +462,8 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
470
462
  onSelect: any;
471
463
  };
472
464
  getToolbarProps: (props?: {}) => {
465
+ size: "sm" | undefined;
473
466
  [key: string]: unknown;
474
- size: 'sm' | undefined;
475
467
  };
476
468
  getBatchActionProps: (props?: {}) => {
477
469
  shouldShowBatchActions: boolean;
@@ -160,8 +160,6 @@ class DataTable extends React__default["default"].Component {
160
160
  const translationKey = isExpanded ? translationKeys.collapseAll : translationKeys.expandAll;
161
161
  return {
162
162
  ...rest,
163
- ariaLabel: t(translationKey),
164
- // TODO: remove in v12
165
163
  'aria-label': t(translationKey),
166
164
  // Provide a string of all the expanded row id's, separated by a space.
167
165
  'aria-controls': rowIds.map(id => `expanded-row-${id}`).join(' '),
@@ -218,8 +216,6 @@ class DataTable extends React__default["default"].Component {
218
216
  // handler
219
217
  onExpand: events.composeEventHandlers([this.handleOnExpandRow(row.id), onClick]),
220
218
  isExpanded: row.isExpanded,
221
- ariaLabel: t(translationKey),
222
- // TODO remove in v12
223
219
  'aria-label': t(translationKey),
224
220
  'aria-controls': `expanded-row-${row.id}`,
225
221
  isSelected: row.isSelected,
@@ -272,8 +268,6 @@ class DataTable extends React__default["default"].Component {
272
268
  onSelect: events.composeEventHandlers([_this.handleOnSelectRow(row.id), onClick]),
273
269
  id: `${_this.getTablePrefix()}__select-row-${row.id}`,
274
270
  name: `select-row-${_this.instanceId}`,
275
- ariaLabel: t(translationKey),
276
- // TODO remove in v12
277
271
  'aria-label': t(translationKey),
278
272
  disabled: row.disabled,
279
273
  radio: _this.props.radio
@@ -289,13 +283,11 @@ class DataTable extends React__default["default"].Component {
289
283
  const translationKey = checked || indeterminate ? translationKeys.unselectAll : translationKeys.selectAll;
290
284
  return {
291
285
  ...rest,
292
- ariaLabel: t(translationKey),
293
- // TODO remove in v12
294
286
  'aria-label': t(translationKey),
295
287
  checked,
296
288
  id: `${_this.getTablePrefix()}__select-all`,
297
289
  indeterminate,
298
- name: 'select-all',
290
+ name: `select-all-${_this.instanceId}`,
299
291
  onSelect: events.composeEventHandlers([_this.handleSelectAll, onClick])
300
292
  };
301
293
  });
@@ -13,11 +13,11 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
13
13
  var React = require('react');
14
14
  var PropTypes = require('prop-types');
15
15
  var cx = require('classnames');
16
- var compat = require('es-toolkit/compat');
17
16
  var usePrefix = require('../../internal/usePrefix.js');
18
17
  var TableContext = require('./TableContext.js');
19
18
  var useEvent = require('../../internal/useEvent.js');
20
19
  var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
20
+ var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
21
21
 
22
22
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
23
23
 
@@ -108,7 +108,7 @@ const Table = _ref => {
108
108
  toggleTableHeaderAlignmentClass(false);
109
109
  }
110
110
  }, [experimentalAutoAlign, toggleTableBodyAlignmentClass, toggleTableHeaderAlignmentClass, prefix]);
111
- const debouncedSetTableAlignment = compat.debounce(setTableAlignment, 100);
111
+ const debouncedSetTableAlignment = debounce.debounce(setTableAlignment, 100);
112
112
  useEvent.useWindowEvent('resize', debouncedSetTableAlignment);
113
113
 
114
114
  // Used to set a tabIndex when the Table is horizontally scrollable
@@ -121,7 +121,7 @@ const Table = _ref => {
121
121
  setIsScrollable(false);
122
122
  }
123
123
  }, []);
124
- const debouncedSetTabIndex = compat.debounce(setTabIndex, 100);
124
+ const debouncedSetTabIndex = debounce.debounce(setTabIndex, 100);
125
125
  useEvent.useWindowEvent('resize', debouncedSetTabIndex);
126
126
  useIsomorphicEffect["default"](() => {
127
127
  setTabIndex();
@@ -4,5 +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
- declare const TableActionList: (props: import("../../types/common").ReactAttr<"div">) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ declare const TableActionList: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement;
8
8
  export default TableActionList;
@@ -25,7 +25,7 @@ const TableBody = _ref => {
25
25
  ...rest
26
26
  } = _ref;
27
27
  return /*#__PURE__*/React__default["default"].createElement("tbody", _rollupPluginBabelHelpers["extends"]({
28
- "aria-live": 'polite' ,
28
+ "aria-live": rest['aria-live'] ?? 'polite',
29
29
  className: className
30
30
  }, rest), children);
31
31
  };
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference types="react" />
8
7
  interface TableContextType {
9
8
  titleId?: string;
10
9
  descriptionId?: string;
@@ -6,5 +6,5 @@
6
6
  */
7
7
  import { ThHTMLAttributes } from 'react';
8
8
  export type TableHeadProps = ThHTMLAttributes<HTMLTableSectionElement>;
9
- declare const TableHead: (props: import("../../types/common").ReactAttr<"thead">) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
9
+ declare const TableHead: (props: import("../../types/common").ReactAttr<"thead">) => React.ReactElement;
10
10
  export default TableHead;
@@ -4,5 +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
- declare const TableToolbarContent: (props: import("../../types/common").ReactAttr<"div">) => import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
7
+ declare const TableToolbarContent: (props: import("../../types/common").ReactAttr<"div">) => React.ReactElement;
8
8
  export default TableToolbarContent;
@@ -85,7 +85,7 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
85
85
  const currentValueToDate = withoutTime(parseDateWithFormat(inputTo.value));
86
86
 
87
87
  // The date should only be set if both dates are valid dates, and they don't match.
88
- // When they don't match, this indiciates that the date selected in the calendar is stale,
88
+ // When they don't match, this indicates that the date selected in the calendar is stale,
89
89
  // and the current value in the input should be set for the calendar to update.
90
90
  if (selectedToDate && currentValueToDate && selectedToDate !== currentValueToDate) {
91
91
  // Update the calendar with the value of the `to` date input
@@ -93,7 +93,7 @@ var carbonFlatpickrFixEventsPlugin = config => fp => {
93
93
  }
94
94
  }
95
95
  const isValidDate = date => date?.toString() !== 'Invalid Date';
96
- // save end date in calendar inmediately after it's been written down
96
+ // save end date in calendar immediately after it's been written down
97
97
  if (inputTo === target && fp.selectedDates.length === 1 && inputTo.value) {
98
98
  if (isValidDate(parseDateWithFormat(inputTo.value))) {
99
99
  fp.setDate([inputFrom.value, inputTo.value], true, fp.config.dateFormat);
@@ -94,7 +94,7 @@ const DatePickerInput = /*#__PURE__*/React__default["default"].forwardRef(functi
94
94
  [`${prefix}--date-picker--fluid--invalid`]: isFluid && invalid,
95
95
  [`${prefix}--date-picker--fluid--warn`]: isFluid && warn
96
96
  });
97
- const datePickerInputHelperId = !helperText ? undefined : `detepicker-input-helper-text-${datePickerInputInstanceId}`;
97
+ const datePickerInputHelperId = !helperText ? undefined : `datepicker-input-helper-text-${datePickerInputInstanceId}`;
98
98
  const inputProps = {
99
99
  ...rest,
100
100
  ...datePickerInputProps,
@@ -23,7 +23,6 @@ require('../FluidForm/FluidForm.js');
23
23
  var FormContext = require('../FluidForm/FormContext.js');
24
24
  var useId = require('../../internal/useId.js');
25
25
  var react = require('@floating-ui/react');
26
- var floatingUi_dom = require('../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js');
27
26
  var index = require('../FeatureFlags/index.js');
28
27
  var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
29
28
 
@@ -142,7 +141,7 @@ const Dropdown = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) =
142
141
  width: `${rects.reference.width}px`
143
142
  });
144
143
  }
145
- }), autoAlign && react.flip(), autoAlign && floatingUi_dom.hide()],
144
+ }), autoAlign && react.flip(), autoAlign && react.hide()],
146
145
  whileElementsMounted: react.autoUpdate
147
146
  } : {}
148
147
  // When autoAlign is turned off & the `enable-v12-dynamic-floating-styles` feature flag is not
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference types="react" />
8
7
  export interface FormContextProps {
9
8
  isFluid?: boolean;
10
9
  }
@@ -73,7 +73,7 @@ function CSSGrid(_ref) {
73
73
  }
74
74
  CSSGrid.propTypes = {
75
75
  /**
76
- * Specify grid aligment. Default is center
76
+ * Specify grid alignment. Default is center
77
77
  */
78
78
  align: PropTypes__default["default"].oneOf(['start', 'center', 'end']),
79
79
  /**
@@ -29,7 +29,7 @@ function Grid(props) {
29
29
  }
30
30
  Grid.propTypes = {
31
31
  /**
32
- * Specify grid aligment. Default is center
32
+ * Specify grid alignment. Default is center
33
33
  */
34
34
  align: PropTypes__default["default"].oneOf(['start', 'center', 'end']),
35
35
  /**
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /// <reference types="react" />
8
7
  import { PolymorphicProps } from '../../types/common';
9
8
  export interface GridBaseProps {
10
9
  /**
@@ -11,6 +11,6 @@ type SectionBaseProps = {
11
11
  level?: HeadingLevel;
12
12
  };
13
13
  export type SectionProps<E extends ElementType> = PolymorphicProps<E, SectionBaseProps>;
14
- export declare const Section: React.ForwardRefExoticComponent<Omit<SectionProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
14
+ export declare const Section: React.ForwardRefExoticComponent<Omit<SectionProps<React.ElementType>, "ref"> & React.RefAttributes<unknown>>;
15
15
  export declare const Heading: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
16
16
  export {};
@@ -23,7 +23,7 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
23
23
  /**
24
24
  * Optionally specify an href for your IconButton to become an `<a>` element
25
25
  */
26
- href?: string;
26
+ href?: React.AnchorHTMLAttributes<HTMLAnchorElement>['href'];
27
27
  /**
28
28
  * Provide an icon or asset to be rendered inside of the IconButton
29
29
  */
@@ -44,10 +44,18 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
44
44
  * Specify whether the Button should be disabled, or not
45
45
  */
46
46
  disabled?: boolean;
47
+ /**
48
+ * Specify whether a drop shadow should be rendered on the tooltip
49
+ */
50
+ dropShadow?: boolean;
47
51
  /**
48
52
  * Specify the duration in milliseconds to delay before displaying the tooltip
49
53
  */
50
54
  enterDelayMs?: number;
55
+ /**
56
+ * Render the tooltip using the high-contrast theme
57
+ */
58
+ highContrast?: boolean;
51
59
  /**
52
60
  * Specify whether the IconButton is currently selected
53
61
  */
@@ -67,10 +75,18 @@ export interface IconButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
67
75
  * Specify the duration in milliseconds to delay before hiding the tooltip
68
76
  */
69
77
  leaveDelayMs?: number;
78
+ /**
79
+ * Optionally specify a `rel` when using an `<a>` element.
80
+ */
81
+ rel?: React.AnchorHTMLAttributes<HTMLAnchorElement>['rel'];
70
82
  /**
71
83
  * Specify the size of the Button. Defaults to `md`.
72
84
  */
73
85
  size?: ButtonSize;
86
+ /**
87
+ * Optionally specify a `target` when using an `<a>` element.
88
+ */
89
+ target?: React.AnchorHTMLAttributes<HTMLAnchorElement>['target'];
74
90
  /**
75
91
  * Specify an optional className to be added to your Tooltip wrapper
76
92
  */
@@ -48,7 +48,9 @@ const IconButton = /*#__PURE__*/React__default["default"].forwardRef(function Ic
48
48
  closeOnActivation = true,
49
49
  defaultOpen = false,
50
50
  disabled,
51
+ dropShadow = false,
51
52
  enterDelayMs = 100,
53
+ highContrast = true,
52
54
  kind,
53
55
  label,
54
56
  leaveDelayMs = 100,
@@ -67,7 +69,9 @@ const IconButton = /*#__PURE__*/React__default["default"].forwardRef(function Ic
67
69
  closeOnActivation: closeOnActivation,
68
70
  className: tooltipClasses,
69
71
  defaultOpen: defaultOpen,
72
+ dropShadow: dropShadow,
70
73
  enterDelayMs: enterDelayMs,
74
+ highContrast: highContrast,
71
75
  label: label,
72
76
  leaveDelayMs: leaveDelayMs
73
77
  }, /*#__PURE__*/React__default["default"].createElement(ButtonBase["default"], _rollupPluginBabelHelpers["extends"]({}, rest, {
@@ -134,6 +138,10 @@ IconButton.propTypes = {
134
138
  * Specify whether the tooltip should be open when it first renders
135
139
  */
136
140
  defaultOpen: PropTypes__default["default"].bool,
141
+ /**
142
+ * Specify whether a drop shadow should be rendered on the tooltip
143
+ */
144
+ dropShadow: PropTypes__default["default"].bool,
137
145
  /**
138
146
  * Specify whether the Button should be disabled, or not
139
147
  */
@@ -145,8 +153,11 @@ IconButton.propTypes = {
145
153
  /**
146
154
  * Specify whether the IconButton is currently selected
147
155
  */
148
-
149
156
  isSelected: PropTypes__default["default"].bool,
157
+ /**
158
+ * Render the tooltip using the high-contrast theme
159
+ */
160
+ highContrast: PropTypes__default["default"].bool,
150
161
  /**
151
162
  * Specify the type of button to be used as the base for the IconButton
152
163
  */
@@ -162,10 +173,18 @@ IconButton.propTypes = {
162
173
  * Specify the duration in milliseconds to delay before hiding the tooltip
163
174
  */
164
175
  leaveDelayMs: PropTypes__default["default"].number,
176
+ /**
177
+ * Optionally specify a `rel` when using an `<a>` element.
178
+ */
179
+ rel: PropTypes__default["default"].string,
165
180
  /**
166
181
  * Specify the size of the Button. Defaults to `md`.
167
182
  */
168
183
  size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg']),
184
+ /**
185
+ * Optionally specify a `target` when using an `<a>` element.
186
+ */
187
+ target: PropTypes__default["default"].string,
169
188
  /**
170
189
  * Specify an optional className to be added to your Tooltip wrapper
171
190
  */
@@ -104,7 +104,7 @@ InlineCheckbox.propTypes = {
104
104
  */
105
105
  id: PropTypes__default["default"].string.isRequired,
106
106
  /**
107
- * Specify whether the control is in an indterminate state
107
+ * Specify whether the control is in an indeterminate state
108
108
  */
109
109
  indeterminate: PropTypes__default["default"].bool,
110
110
  /**
@@ -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,6 +35,22 @@ const InlineLoading = _ref => {
35
35
  } = _ref;
36
36
  const prefix = usePrefix.usePrefix();
37
37
  const loadingClasses = cx__default["default"](`${prefix}--inline-loading`, className);
38
+ const timerRef = React.useRef(null);
39
+ React.useEffect(() => {
40
+ if (status === 'finished') {
41
+ timerRef.current = setTimeout(() => {
42
+ if (onSuccess) {
43
+ onSuccess();
44
+ }
45
+ }, successDelay);
46
+ }
47
+ return () => {
48
+ if (timerRef.current) {
49
+ clearTimeout(timerRef.current);
50
+ timerRef.current = null;
51
+ }
52
+ };
53
+ }, [status, onSuccess, successDelay]);
38
54
  const getLoading = () => {
39
55
  let iconLabel = iconDescription ? iconDescription : status;
40
56
  if (status === 'error') {
@@ -43,11 +59,6 @@ const InlineLoading = _ref => {
43
59
  }, /*#__PURE__*/React__default["default"].createElement("title", null, iconLabel));
44
60
  }
45
61
  if (status === 'finished') {
46
- setTimeout(() => {
47
- if (onSuccess) {
48
- onSuccess();
49
- }
50
- }, successDelay);
51
62
  return /*#__PURE__*/React__default["default"].createElement(iconsReact.CheckmarkFilled, {
52
63
  className: `${prefix}--inline-loading__checkmark-container`
53
64
  }, /*#__PURE__*/React__default["default"].createElement("title", null, iconLabel));
@@ -65,6 +76,9 @@ const InlineLoading = _ref => {
65
76
  }
66
77
  return undefined;
67
78
  };
79
+
80
+ // TODO: Should this element only be constructed, similar to
81
+ // `loadingAnimation`, if `description` is specified?
68
82
  const loadingText = /*#__PURE__*/React__default["default"].createElement("div", {
69
83
  className: `${prefix}--inline-loading__text`
70
84
  }, description);
@@ -75,7 +89,7 @@ const InlineLoading = _ref => {
75
89
  return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
76
90
  className: loadingClasses
77
91
  }, rest, {
78
- "aria-live": 'assertive'
92
+ "aria-live": rest['aria-live'] ?? 'assertive'
79
93
  }), loadingAnimation, description && loadingText);
80
94
  };
81
95
  InlineLoading.propTypes = {
@@ -201,7 +201,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(_ref, forwardRef) {
201
201
  }
202
202
  };
203
203
 
204
- // Avoid that the Menu render incorrectly when the postion is set in the right side of the screen
204
+ // Avoid that the Menu render incorrectly when the position is set in the right side of the screen
205
205
  if (actionButtonWidth && actionButtonWidth < axes.x.size && (menuAlignment === 'bottom' || menuAlignment === 'top')) {
206
206
  axes.x.size = actionButtonWidth;
207
207
  }
@@ -229,7 +229,7 @@ const Menu = /*#__PURE__*/React.forwardRef(function Menu(_ref, forwardRef) {
229
229
  max - spacing - size];
230
230
  const topAlignment = menuAlignment === 'top' || menuAlignment === 'top-end' || menuAlignment === 'top-start';
231
231
 
232
- // If the tooltip is not visible in the top, switch to the bototm
232
+ // If the tooltip is not visible in the top, switch to the bottom
233
233
  if (typeof options[0] === 'number' && topAlignment && options[0] >= 0 && !options[1] && axis === 'y') {
234
234
  menu.current.style.transform = 'translate(0)';
235
235
  } else if (topAlignment && !options[0] && axis === 'y') {
@@ -21,7 +21,7 @@ declare function menuReducer(state: StateType, action: ActionType): {
21
21
  hasIcons: boolean;
22
22
  isRoot: boolean;
23
23
  mode: "full" | "basic";
24
- size: "sm" | "md" | "lg" | "xs" | null;
24
+ size: "xs" | "sm" | "md" | "lg" | null;
25
25
  items: any[];
26
26
  requestCloseRoot: (e: Pick<KeyboardEvent<HTMLUListElement>, "type">) => void;
27
27
  };
@@ -30,7 +30,7 @@ export interface MenuButtonProps extends ComponentProps<'div'> {
30
30
  /**
31
31
  * Experimental property. Specify how the menu should align with the button element
32
32
  */
33
- menuAlignment: MenuAlignment;
33
+ menuAlignment?: MenuAlignment;
34
34
  /**
35
35
  * Specify the size of the button and menu.
36
36
  */
@@ -162,13 +162,12 @@ MenuButton.propTypes = {
162
162
  // @ts-ignore-next-line -- avoid spurious (?) TS2322 error
163
163
  kind: PropTypes__default["default"].oneOf(validButtonKinds),
164
164
  /**
165
- * Provide the label to be renderd on the trigger button.
165
+ * Provide the label to be rendered on the trigger button.
166
166
  */
167
167
  label: PropTypes__default["default"].string.isRequired,
168
168
  /**
169
169
  * Experimental property. Specify how the menu should align with the button element
170
170
  */
171
- // @ts-ignore-next-line -- avoid spurious (?) TS2322 error
172
171
  menuAlignment: PropTypes__default["default"].oneOf(['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end']),
173
172
  /**
174
173
  * Specify the size of the button and menu.
@@ -22,7 +22,6 @@ var InlineLoading = require('../InlineLoading/InlineLoading.js');
22
22
  var index$1 = require('../Layer/index.js');
23
23
  var requiredIfGivenPropIsTruthy = require('../../prop-types/requiredIfGivenPropIsTruthy.js');
24
24
  var wrapFocus = require('../../internal/wrapFocus.js');
25
- var compat = require('es-toolkit/compat');
26
25
  var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
27
26
  var useId = require('../../internal/useId.js');
28
27
  var usePrefix = require('../../internal/usePrefix.js');
@@ -32,6 +31,7 @@ require('../Text/index.js');
32
31
  var index = require('../FeatureFlags/index.js');
33
32
  var events = require('../../tools/events.js');
34
33
  var deprecate = require('../../prop-types/deprecate.js');
34
+ var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
35
35
  var Text = require('../Text/Text.js');
36
36
  var match = require('../../internal/keyboard/match.js');
37
37
  var keys = require('../../internal/keyboard/keys.js');
@@ -232,7 +232,7 @@ const Modal = /*#__PURE__*/React__default["default"].forwardRef(function Modal(_
232
232
  setIsScrollable(contentRef.current.scrollHeight > contentRef.current.clientHeight);
233
233
  }
234
234
  }
235
- const debouncedHandler = compat.debounce(handler, 200);
235
+ const debouncedHandler = debounce.debounce(handler, 200);
236
236
  window.addEventListener('resize', debouncedHandler);
237
237
  return () => {
238
238
  debouncedHandler.cancel();