@carbon/react 1.81.0 → 1.82.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 (202) hide show
  1. package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +902 -902
  2. package/es/components/AILabel/index.d.ts +1 -1
  3. package/es/components/AILabel/index.js +2 -9
  4. package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -3
  5. package/es/components/Breadcrumb/Breadcrumb.js +4 -4
  6. package/es/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
  7. package/es/components/Breadcrumb/BreadcrumbItem.js +5 -4
  8. package/es/components/Button/Button.js +2 -10
  9. package/es/components/ButtonSet/ButtonSet.d.ts +2 -3
  10. package/es/components/ButtonSet/ButtonSet.js +4 -4
  11. package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
  12. package/es/components/CodeSnippet/CodeSnippet.js +3 -19
  13. package/es/components/ComboBox/ComboBox.d.ts +1 -1
  14. package/es/components/ComboBox/ComboBox.js +2 -2
  15. package/es/components/ComboButton/index.d.ts +1 -1
  16. package/es/components/ComboButton/index.js +2 -18
  17. package/es/components/ComposedModal/ComposedModal.js +5 -3
  18. package/es/components/Copy/Copy.d.ts +1 -1
  19. package/es/components/Copy/Copy.js +2 -18
  20. package/es/components/CopyButton/CopyButton.d.ts +1 -1
  21. package/es/components/CopyButton/CopyButton.js +2 -18
  22. package/es/components/DataTable/DataTable.d.ts +7 -12
  23. package/es/components/DataTable/DataTable.js +0 -5
  24. package/es/components/DataTable/TableToolbarAction.d.ts +2 -4
  25. package/es/components/DataTable/TableToolbarAction.js +5 -4
  26. package/es/components/DataTable/tools/sorting.d.ts +42 -0
  27. package/es/components/DataTable/tools/sorting.js +24 -53
  28. package/es/components/DatePicker/DatePicker.d.ts +1 -1
  29. package/es/components/DatePicker/DatePicker.js +18 -18
  30. package/es/components/Dialog/index.d.ts +1 -1
  31. package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
  32. package/es/components/Dropdown/Dropdown.Skeleton.js +2 -2
  33. package/es/components/Dropdown/Dropdown.d.ts +7 -6
  34. package/es/components/Dropdown/Dropdown.js +7 -3
  35. package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
  36. package/es/components/FileUploader/FileUploaderButton.js +1 -1
  37. package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
  38. package/es/components/FileUploader/FileUploaderItem.js +1 -1
  39. package/es/components/FluidDropdown/FluidDropdown.d.ts +1 -1
  40. package/es/components/FluidSearch/FluidSearch.d.ts +3 -6
  41. package/es/components/IconButton/index.d.ts +1 -1
  42. package/es/components/IconButton/index.js +2 -18
  43. package/es/components/ListBox/ListBox.d.ts +4 -5
  44. package/es/components/ListBox/ListBox.js +8 -7
  45. package/es/components/ListBox/ListBoxMenu.d.ts +4 -4
  46. package/es/components/ListBox/ListBoxMenu.js +4 -2
  47. package/es/components/ListBox/ListBoxMenuItem.d.ts +9 -8
  48. package/es/components/ListBox/ListBoxPropTypes.d.ts +3 -3
  49. package/es/components/ListBox/ListBoxPropTypes.js +3 -3
  50. package/es/components/ListBox/index.d.ts +7 -5
  51. package/es/components/ListBox/index.js +1 -1
  52. package/es/components/Menu/Menu.js +5 -0
  53. package/es/components/Modal/Modal.js +9 -9
  54. package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
  55. package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
  56. package/es/components/MultiSelect/MultiSelect.d.ts +8 -2
  57. package/es/components/MultiSelect/MultiSelect.js +3 -3
  58. package/es/components/Notification/Notification.js +1 -1
  59. package/es/components/OverflowMenu/OverflowMenu.js +2 -21
  60. package/es/components/OverflowMenu/next/index.js +2 -18
  61. package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
  62. package/es/components/OverflowMenuItem/OverflowMenuItem.js +5 -4
  63. package/es/components/PageHeader/PageHeader.d.ts +153 -8
  64. package/es/components/PageHeader/PageHeader.js +143 -21
  65. package/es/components/PageHeader/index.d.ts +2 -2
  66. package/es/components/PageHeader/index.js +1 -1
  67. package/es/components/Popover/index.js +4 -21
  68. package/es/components/Search/Search.d.ts +2 -5
  69. package/es/components/Search/Search.js +24 -8
  70. package/es/components/Stack/HStack.d.ts +2 -3
  71. package/es/components/Stack/HStack.js +4 -7
  72. package/es/components/Stack/Stack.d.ts +3 -4
  73. package/es/components/Stack/Stack.js +3 -6
  74. package/es/components/Stack/VStack.d.ts +2 -3
  75. package/es/components/Stack/VStack.js +3 -2
  76. package/es/components/Stack/index.d.ts +4 -4
  77. package/es/components/TextArea/TextArea.js +3 -5
  78. package/es/components/TimePicker/TimePicker.d.ts +3 -4
  79. package/es/components/TimePicker/TimePicker.js +5 -4
  80. package/es/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
  81. package/es/components/TimePickerSelect/TimePickerSelect.js +5 -4
  82. package/es/components/TreeView/TreeNode.js +13 -1
  83. package/es/components/TreeView/TreeView.js +1 -1
  84. package/es/index.js +1 -1
  85. package/es/internal/FloatingMenu.js +9 -5
  86. package/es/internal/environment.js +7 -0
  87. package/es/internal/keyboard/navigation.d.ts +0 -10
  88. package/es/internal/keyboard/navigation.js +1 -13
  89. package/es/internal/useId.js +1 -1
  90. package/es/internal/useNoInteractiveChildren.js +7 -0
  91. package/es/internal/useOutsideClick.js +3 -0
  92. package/es/internal/wrapFocus.d.ts +49 -0
  93. package/es/internal/wrapFocus.js +64 -51
  94. package/es/tools/events.d.ts +17 -0
  95. package/es/tools/events.js +10 -13
  96. package/es/tools/mapPopoverAlign.d.ts +15 -0
  97. package/es/tools/mapPopoverAlign.js +28 -0
  98. package/es/tools/uniqueId.d.ts +7 -0
  99. package/es/tools/uniqueId.js +3 -3
  100. package/es/types/common.d.ts +0 -2
  101. package/lib/components/AILabel/index.d.ts +1 -1
  102. package/lib/components/AILabel/index.js +2 -9
  103. package/lib/components/Breadcrumb/Breadcrumb.d.ts +2 -3
  104. package/lib/components/Breadcrumb/Breadcrumb.js +3 -3
  105. package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
  106. package/lib/components/Breadcrumb/BreadcrumbItem.js +4 -3
  107. package/lib/components/Button/Button.js +1 -9
  108. package/lib/components/ButtonSet/ButtonSet.d.ts +2 -3
  109. package/lib/components/ButtonSet/ButtonSet.js +3 -3
  110. package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
  111. package/lib/components/CodeSnippet/CodeSnippet.js +3 -19
  112. package/lib/components/ComboBox/ComboBox.d.ts +1 -1
  113. package/lib/components/ComboBox/ComboBox.js +1 -1
  114. package/lib/components/ComboButton/index.d.ts +1 -1
  115. package/lib/components/ComboButton/index.js +2 -18
  116. package/lib/components/ComposedModal/ComposedModal.js +5 -3
  117. package/lib/components/Copy/Copy.d.ts +1 -1
  118. package/lib/components/Copy/Copy.js +2 -18
  119. package/lib/components/CopyButton/CopyButton.d.ts +1 -1
  120. package/lib/components/CopyButton/CopyButton.js +2 -18
  121. package/lib/components/DataTable/DataTable.d.ts +7 -12
  122. package/lib/components/DataTable/DataTable.js +0 -5
  123. package/lib/components/DataTable/TableToolbarAction.d.ts +2 -4
  124. package/lib/components/DataTable/TableToolbarAction.js +4 -3
  125. package/lib/components/DataTable/tools/sorting.d.ts +42 -0
  126. package/lib/components/DataTable/tools/sorting.js +23 -53
  127. package/lib/components/DatePicker/DatePicker.d.ts +1 -1
  128. package/lib/components/DatePicker/DatePicker.js +18 -18
  129. package/lib/components/Dialog/index.d.ts +1 -1
  130. package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
  131. package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -1
  132. package/lib/components/Dropdown/Dropdown.d.ts +7 -6
  133. package/lib/components/Dropdown/Dropdown.js +6 -2
  134. package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
  135. package/lib/components/FileUploader/FileUploaderButton.js +1 -1
  136. package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
  137. package/lib/components/FileUploader/FileUploaderItem.js +1 -1
  138. package/lib/components/FluidDropdown/FluidDropdown.d.ts +1 -1
  139. package/lib/components/FluidSearch/FluidSearch.d.ts +3 -6
  140. package/lib/components/IconButton/index.d.ts +1 -1
  141. package/lib/components/IconButton/index.js +2 -18
  142. package/lib/components/ListBox/ListBox.d.ts +4 -5
  143. package/lib/components/ListBox/ListBox.js +7 -6
  144. package/lib/components/ListBox/ListBoxMenu.d.ts +4 -4
  145. package/lib/components/ListBox/ListBoxMenu.js +3 -1
  146. package/lib/components/ListBox/ListBoxMenuItem.d.ts +9 -8
  147. package/lib/components/ListBox/ListBoxPropTypes.d.ts +3 -3
  148. package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
  149. package/lib/components/ListBox/index.d.ts +7 -5
  150. package/lib/components/ListBox/index.js +2 -2
  151. package/lib/components/Menu/Menu.js +5 -0
  152. package/lib/components/Modal/Modal.js +9 -9
  153. package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
  154. package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -1
  155. package/lib/components/MultiSelect/MultiSelect.d.ts +8 -2
  156. package/lib/components/MultiSelect/MultiSelect.js +2 -2
  157. package/lib/components/Notification/Notification.js +1 -1
  158. package/lib/components/OverflowMenu/OverflowMenu.js +2 -21
  159. package/lib/components/OverflowMenu/next/index.js +2 -18
  160. package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
  161. package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
  162. package/lib/components/PageHeader/PageHeader.d.ts +153 -8
  163. package/lib/components/PageHeader/PageHeader.js +145 -19
  164. package/lib/components/PageHeader/index.d.ts +2 -2
  165. package/lib/components/PageHeader/index.js +4 -0
  166. package/lib/components/Popover/index.js +4 -21
  167. package/lib/components/Search/Search.d.ts +2 -5
  168. package/lib/components/Search/Search.js +24 -8
  169. package/lib/components/Stack/HStack.d.ts +2 -3
  170. package/lib/components/Stack/HStack.js +3 -6
  171. package/lib/components/Stack/Stack.d.ts +3 -4
  172. package/lib/components/Stack/Stack.js +2 -5
  173. package/lib/components/Stack/VStack.d.ts +2 -3
  174. package/lib/components/Stack/VStack.js +2 -1
  175. package/lib/components/Stack/index.d.ts +4 -4
  176. package/lib/components/TextArea/TextArea.js +2 -4
  177. package/lib/components/TimePicker/TimePicker.d.ts +3 -4
  178. package/lib/components/TimePicker/TimePicker.js +4 -3
  179. package/lib/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
  180. package/lib/components/TimePickerSelect/TimePickerSelect.js +4 -3
  181. package/lib/components/TreeView/TreeNode.js +13 -1
  182. package/lib/components/TreeView/TreeView.js +1 -1
  183. package/lib/index.js +2 -2
  184. package/lib/internal/FloatingMenu.js +9 -5
  185. package/lib/internal/environment.js +7 -0
  186. package/lib/internal/keyboard/navigation.d.ts +0 -10
  187. package/lib/internal/keyboard/navigation.js +0 -14
  188. package/lib/internal/useNoInteractiveChildren.js +7 -0
  189. package/lib/internal/useOutsideClick.js +3 -0
  190. package/lib/internal/wrapFocus.d.ts +49 -0
  191. package/lib/internal/wrapFocus.js +66 -53
  192. package/lib/tools/events.d.ts +17 -0
  193. package/lib/tools/events.js +10 -13
  194. package/lib/tools/mapPopoverAlign.d.ts +15 -0
  195. package/lib/tools/mapPopoverAlign.js +32 -0
  196. package/lib/tools/uniqueId.d.ts +7 -0
  197. package/lib/tools/uniqueId.js +3 -3
  198. package/lib/types/common.d.ts +0 -2
  199. package/package.json +7 -7
  200. package/telemetry.yml +3 -1
  201. package/es/tools/createPropAdapter.js +0 -40
  202. package/lib/tools/createPropAdapter.js +0 -44
@@ -21,15 +21,15 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
21
21
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
22
22
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
23
23
 
24
- const Breadcrumb = /*#__PURE__*/React__default["default"].forwardRef(function Breadcrumb(_ref, ref) {
25
- let {
24
+ const Breadcrumb = /*#__PURE__*/React.forwardRef((props, ref) => {
25
+ const {
26
26
  'aria-label': ariaLabel,
27
27
  children,
28
28
  className: customClassNameNav,
29
29
  noTrailingSlash,
30
30
  size,
31
31
  ...rest
32
- } = _ref;
32
+ } = props;
33
33
  const prefix = usePrefix.usePrefix();
34
34
  const className = cx__default["default"]({
35
35
  [`${prefix}--breadcrumb`]: true,
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- import React, { AriaAttributes } from 'react';
8
- import { ForwardRefReturn } from '../../types/common';
7
+ import React, { type AriaAttributes } from 'react';
9
8
  export interface BreadcrumbItemProps extends React.HTMLAttributes<HTMLLIElement> {
10
9
  'aria-current'?: AriaAttributes['aria-current'];
11
10
  /**
@@ -21,5 +20,5 @@ export interface BreadcrumbItemProps extends React.HTMLAttributes<HTMLLIElement>
21
20
  */
22
21
  isCurrentPage?: boolean;
23
22
  }
24
- declare const BreadcrumbItem: ForwardRefReturn<HTMLLIElement, BreadcrumbItemProps>;
23
+ declare const BreadcrumbItem: React.ForwardRefExoticComponent<BreadcrumbItemProps & React.RefAttributes<HTMLLIElement>>;
25
24
  export default BreadcrumbItem;
@@ -25,15 +25,16 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
25
25
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
26
26
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
27
27
 
28
- const BreadcrumbItem = /*#__PURE__*/React__default["default"].forwardRef(function BreadcrumbItem(_ref, ref) {
29
- let {
28
+ const frFn = React.forwardRef;
29
+ const BreadcrumbItem = frFn((props, ref) => {
30
+ const {
30
31
  'aria-current': ariaCurrent,
31
32
  children,
32
33
  className: customClassName = '',
33
34
  href,
34
35
  isCurrentPage,
35
36
  ...rest
36
- } = _ref;
37
+ } = props;
37
38
  const prefix = usePrefix.usePrefix();
38
39
  const className = cx__default["default"]({
39
40
  [`${prefix}--breadcrumb-item`]: true,
@@ -13,7 +13,6 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
13
13
  var PropTypes = require('prop-types');
14
14
  var React = require('react');
15
15
  var index = require('../IconButton/index.js');
16
- var events = require('../../tools/events.js');
17
16
  var ButtonBase = require('./ButtonBase.js');
18
17
 
19
18
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -32,7 +31,6 @@ function isIconOnlyButton(hasIconOnly, _kind) {
32
31
  return false;
33
32
  }
34
33
  const Button = /*#__PURE__*/React__default["default"].forwardRef((props, ref) => {
35
- const tooltipRef = React.useRef(null);
36
34
  const {
37
35
  as,
38
36
  autoAlign = false,
@@ -56,12 +54,6 @@ const Button = /*#__PURE__*/React__default["default"].forwardRef((props, ref) =>
56
54
  if (ButtonImageElement && !children && !iconDescription) {
57
55
  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 => {
60
- // Prevent clicks on the tooltip from triggering the button click event
61
- if (evt.target === tooltipRef.current) {
62
- evt.preventDefault();
63
- }
64
- };
65
57
  const iconOnlyImage = !ButtonImageElement ? null : /*#__PURE__*/React__default["default"].createElement(ButtonImageElement, null);
66
58
  if (!isIconOnlyButton(hasIconOnly)) {
67
59
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -112,7 +104,7 @@ const Button = /*#__PURE__*/React__default["default"].forwardRef((props, ref) =>
112
104
  onFocus: onFocus,
113
105
  onBlur: onBlur,
114
106
  autoAlign: autoAlign,
115
- onClick: events.composeEventHandlers([onClick, handleClick]),
107
+ onClick: onClick,
116
108
  renderIcon: iconOnlyImage ? null : ButtonImageElement // avoid doubling the icon.
117
109
  }), iconOnlyImage ?? children)
118
110
  );
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
- import { ForwardRefReturn } from '../../types/common';
9
8
  export interface ButtonSetProps extends React.HTMLAttributes<HTMLDivElement> {
10
9
  /**
11
10
  * Specify the button arrangement of the set (vertically stacked or
@@ -13,5 +12,5 @@ export interface ButtonSetProps extends React.HTMLAttributes<HTMLDivElement> {
13
12
  */
14
13
  stacked?: boolean;
15
14
  }
16
- declare const ButtonSet: ForwardRefReturn<HTMLDivElement, ButtonSetProps>;
15
+ declare const ButtonSet: React.ForwardRefExoticComponent<ButtonSetProps & React.RefAttributes<HTMLDivElement>>;
17
16
  export default ButtonSet;
@@ -21,13 +21,13 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
21
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
22
22
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
23
23
 
24
- const ButtonSet = /*#__PURE__*/React__default["default"].forwardRef(function ButtonSet(_ref, ref) {
25
- let {
24
+ const ButtonSet = /*#__PURE__*/React.forwardRef((props, ref) => {
25
+ const {
26
26
  children,
27
27
  className,
28
28
  stacked,
29
29
  ...rest
30
- } = _ref;
30
+ } = props;
31
31
  const prefix = usePrefix.usePrefix();
32
32
  const buttonSetClasses = cx__default["default"](className, `${prefix}--btn-set`, {
33
33
  [`${prefix}--btn-set--stacked`]: stacked
@@ -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.
@@ -24,6 +24,7 @@ var copy = require('copy-to-clipboard');
24
24
  var deprecate = require('../../prop-types/deprecate.js');
25
25
  var usePrefix = require('../../internal/usePrefix.js');
26
26
  var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
27
+ var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
27
28
 
28
29
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
29
30
 
@@ -38,19 +39,6 @@ const defaultMaxCollapsedNumberOfRows = 15;
38
39
  const defaultMaxExpandedNumberOfRows = 0;
39
40
  const defaultMinCollapsedNumberOfRows = 3;
40
41
  const defaultMinExpandedNumberOfRows = 16;
41
- const propMappingFunction = deprecatedValue => {
42
- const mapping = {
43
- 'top-left': 'top-start',
44
- 'top-right': 'top-end',
45
- 'bottom-left': 'bottom-start',
46
- 'bottom-right': 'bottom-end',
47
- 'left-bottom': 'left-end',
48
- 'left-top': 'left-start',
49
- 'right-bottom': 'right-end',
50
- 'right-top': 'right-start'
51
- };
52
- return mapping[deprecatedValue];
53
- };
54
42
  function CodeSnippet(_ref) {
55
43
  let {
56
44
  align = 'bottom',
@@ -81,7 +69,7 @@ function CodeSnippet(_ref) {
81
69
  const [shouldShowMoreLessBtn, setShouldShowMoreLessBtn] = React.useState(false);
82
70
  const {
83
71
  current: uid
84
- } = React.useRef(uniqueId["default"]());
72
+ } = React.useRef(uniqueId.uniqueId());
85
73
  const codeContentRef = React.useRef(null);
86
74
  const codeContainerRef = React.useRef(null);
87
75
  const innerCodeRef = React.useRef(null);
@@ -281,11 +269,7 @@ CodeSnippet.propTypes = {
281
269
  // deprecated use right-start instead
282
270
 
283
271
  // new values to match floating-ui
284
- 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
285
- //allowed prop values
286
- ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
287
- //optional mapper function
288
- propMappingFunction),
272
+ 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
289
273
  /**
290
274
  * Specify a label to be read by screen readers on the containing textbox
291
275
  * node
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import { UseComboboxProps, UseComboboxActions } from 'downshift';
8
8
  import React, { type ReactNode, type ComponentType, type ReactElement, type RefAttributes, type PropsWithChildren, type PropsWithRef, type InputHTMLAttributes, type MouseEvent } from 'react';
9
- import { ListBoxSize } from '../ListBox';
9
+ import { type ListBoxSize } from '../ListBox';
10
10
  import { TranslateWithId } from '../../types/common';
11
11
  type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type' | 'size';
12
12
  export interface OnChangeData<ItemType> {
@@ -917,7 +917,7 @@ ComboBox.propTypes = {
917
917
  /**
918
918
  * Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
919
919
  */
920
- size: ListBoxPropTypes.ListBoxSize,
920
+ size: ListBoxPropTypes.ListBoxSizePropType,
921
921
  slug: deprecate["default"](PropTypes__default["default"].node, 'The `slug` prop has been deprecated and will be removed in the next major version. Use the decorator prop instead.'),
922
922
  /**
923
923
  * Provide text to be used in a `<label>` element that is tied to the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright IBM Corp. 2023
2
+ * Copyright IBM Corp. 2023, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
@@ -26,6 +26,7 @@ var react = require('@floating-ui/react');
26
26
  var index = require('../FeatureFlags/index.js');
27
27
  var mergeRefs = require('../../tools/mergeRefs.js');
28
28
  var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
29
+ var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
29
30
 
30
31
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
32
 
@@ -42,19 +43,6 @@ const defaultTranslations = {
42
43
  * Message ids that will be passed to translateWithId().
43
44
  */
44
45
 
45
- const propMappingFunction = deprecatedValue => {
46
- const mapping = {
47
- 'top-left': 'top-start',
48
- 'top-right': 'top-end',
49
- 'bottom-left': 'bottom-start',
50
- 'bottom-right': 'bottom-end',
51
- 'left-bottom': 'left-end',
52
- 'left-top': 'left-start',
53
- 'right-bottom': 'right-end',
54
- 'right-top': 'right-start'
55
- };
56
- return mapping[deprecatedValue];
57
- };
58
46
  function defaultTranslateWithId(messageId) {
59
47
  return defaultTranslations[messageId];
60
48
  }
@@ -234,11 +222,7 @@ ComboButton.propTypes = {
234
222
  // deprecated use right-start instead
235
223
 
236
224
  // new values to match floating-ui
237
- 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
238
- //allowed prop values
239
- ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
240
- //optional mapper function
241
- propMappingFunction),
225
+ 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
242
226
  /**
243
227
  * Optional method that takes in a message id and returns an
244
228
  * internationalized string.
@@ -175,10 +175,12 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
175
175
  onMouseDownTarget.current = target;
176
176
  }
177
177
  function handleOnClick(evt) {
178
- const target = evt.target;
178
+ const {
179
+ target
180
+ } = evt;
179
181
  const mouseDownTarget = onMouseDownTarget.current;
180
182
  evt.stopPropagation();
181
- if (!preventCloseOnClickOutside && !wrapFocus.elementOrParentIsFloatingMenu(target, selectorsFloatingMenus) && innerModal.current && !innerModal.current.contains(target) && !innerModal.current.contains(mouseDownTarget)) {
183
+ if (!preventCloseOnClickOutside && target instanceof Node && !wrapFocus.elementOrParentIsFloatingMenu(target, selectorsFloatingMenus) && innerModal.current && !innerModal.current.contains(target) && !innerModal.current.contains(mouseDownTarget)) {
182
184
  closeModal(evt);
183
185
  }
184
186
  }
@@ -197,7 +199,7 @@ const ComposedModal = /*#__PURE__*/React__default["default"].forwardRef(function
197
199
  const {
198
200
  current: endSentinelNode
199
201
  } = endSentinel;
200
- wrapFocus["default"]({
202
+ wrapFocus.wrapFocus({
201
203
  bodyNode,
202
204
  startTrapNode: startSentinelNode,
203
205
  endTrapNode: endSentinelNode,
@@ -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.
@@ -18,6 +18,7 @@ var usePrefix = require('../../internal/usePrefix.js');
18
18
  var index = require('../IconButton/index.js');
19
19
  var noopFn = require('../../internal/noopFn.js');
20
20
  var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
21
+ var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
21
22
  var debounce = require('../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js');
22
23
 
23
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -26,19 +27,6 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
26
27
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
27
28
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
28
29
 
29
- const propMappingFunction = deprecatedValue => {
30
- const mapping = {
31
- 'top-left': 'top-start',
32
- 'top-right': 'top-end',
33
- 'bottom-left': 'bottom-start',
34
- 'bottom-right': 'bottom-end',
35
- 'left-bottom': 'left-end',
36
- 'left-top': 'left-start',
37
- 'right-bottom': 'right-end',
38
- 'right-top': 'right-start'
39
- };
40
- return mapping[deprecatedValue];
41
- };
42
30
  function Copy(_ref) {
43
31
  let {
44
32
  align = 'bottom',
@@ -111,11 +99,7 @@ Copy.propTypes = {
111
99
  // deprecated use right-start instead
112
100
 
113
101
  // new values to match floating-ui
114
- 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
115
- //allowed prop values
116
- ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
117
- //optional mapper function
118
- propMappingFunction),
102
+ 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
119
103
  /**
120
104
  * **Experimental**: Will attempt to automatically align the tooltip
121
105
  */
@@ -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.
@@ -19,6 +19,7 @@ var index = require('../Layout/index.js');
19
19
  var usePrefix = require('../../internal/usePrefix.js');
20
20
  var noopFn = require('../../internal/noopFn.js');
21
21
  var deprecateValuesWithin = require('../../prop-types/deprecateValuesWithin.js');
22
+ var mapPopoverAlign = require('../../tools/mapPopoverAlign.js');
22
23
 
23
24
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
24
25
 
@@ -26,19 +27,6 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
26
27
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
27
28
  var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
28
29
 
29
- const propMappingFunction = deprecatedValue => {
30
- const mapping = {
31
- 'top-left': 'top-start',
32
- 'top-right': 'top-end',
33
- 'bottom-left': 'bottom-start',
34
- 'bottom-right': 'bottom-end',
35
- 'left-bottom': 'left-end',
36
- 'left-top': 'left-start',
37
- 'right-bottom': 'right-end',
38
- 'right-top': 'right-start'
39
- };
40
- return mapping[deprecatedValue];
41
- };
42
30
  function CopyButton(_ref) {
43
31
  let {
44
32
  align = 'bottom',
@@ -93,11 +81,7 @@ CopyButton.propTypes = {
93
81
  // deprecated use right-start instead
94
82
 
95
83
  // new values to match floating-ui
96
- 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
97
- //allowed prop values
98
- ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'],
99
- //optional mapper function
100
- propMappingFunction),
84
+ 'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']), ['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end'], mapPopoverAlign.mapPopoverAlign),
101
85
  /**
102
86
  * **Experimental**: Will attempt to automatically align the tooltip
103
87
  */
@@ -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 React from 'react';
8
+ import React, { type MouseEvent } from 'react';
9
9
  import type { DataTableSortState } from './state/sortStates';
10
10
  import Table from './Table';
11
11
  import TableActionList from './TableActionList';
@@ -125,7 +125,7 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
125
125
  [key: string]: unknown;
126
126
  };
127
127
  getSelectionProps: (getSelectionPropsArgs?: {
128
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
128
+ onClick?: (e: MouseEvent<HTMLInputElement, globalThis.MouseEvent>) => void;
129
129
  row: DataTableRow<ColTypes>;
130
130
  [key: string]: unknown;
131
131
  }) => {
@@ -381,7 +381,7 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
381
381
  'aria-label': any;
382
382
  'aria-controls': string;
383
383
  isExpanded: boolean;
384
- onExpand: any;
384
+ onExpand: (event: React.MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, ...args: any[]) => void;
385
385
  };
386
386
  /**
387
387
  * Decorate consumer's `onClick` event handler with sort parameters
@@ -413,7 +413,7 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
413
413
  [key: string]: unknown;
414
414
  }) => {
415
415
  key: string;
416
- onExpand: any;
416
+ onExpand: (event: React.MouseEvent<HTMLButtonElement, globalThis.MouseEvent>, ...args: any[]) => void;
417
417
  isExpanded: boolean | undefined;
418
418
  'aria-label': any;
419
419
  'aria-controls': string;
@@ -437,19 +437,14 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
437
437
  * Gets the props associated with selection for a header or a row, where
438
438
  * applicable. Most often used to indicate selection status of the table or
439
439
  * for a specific row.
440
- *
441
- * @param {object} [row] an optional row that we want to access the props for
442
- * @param {Function} row.onClick
443
- * @param {object} row.row
444
- * @returns {object}
445
440
  */
446
441
  getSelectionProps: ({ onClick, row, ...rest }?: {
447
442
  [key: string]: unknown;
448
- onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
443
+ onClick?: (e: MouseEvent<HTMLInputElement, globalThis.MouseEvent>) => void;
449
444
  row: DataTableRow<ColTypes>;
450
445
  }) => {
451
446
  checked: boolean | undefined;
452
- onSelect: any;
447
+ onSelect: (event: React.MouseEvent<HTMLInputElement, globalThis.MouseEvent>, ...args: any[]) => void;
453
448
  id: string;
454
449
  name: string;
455
450
  'aria-label': any;
@@ -461,7 +456,7 @@ declare class DataTable<RowType, ColTypes extends any[]> extends React.Component
461
456
  id: string;
462
457
  indeterminate: boolean;
463
458
  name: string;
464
- onSelect: any;
459
+ onSelect: (event: React.MouseEvent<HTMLInputElement, globalThis.MouseEvent>, ...args: any[]) => void;
465
460
  };
466
461
  getToolbarProps: (props?: {}) => {
467
462
  size: "sm" | undefined;
@@ -243,11 +243,6 @@ class DataTable extends React__default["default"].Component {
243
243
  * Gets the props associated with selection for a header or a row, where
244
244
  * applicable. Most often used to indicate selection status of the table or
245
245
  * for a specific row.
246
- *
247
- * @param {object} [row] an optional row that we want to access the props for
248
- * @param {Function} row.onClick
249
- * @param {object} row.row
250
- * @returns {object}
251
246
  */
252
247
  _rollupPluginBabelHelpers.defineProperty(this, "getSelectionProps", function () {
253
248
  let {
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Copyright IBM Corp. 2016, 2023
2
+ * Copyright IBM Corp. 2016, 2025
3
3
  *
4
4
  * This source code is licensed under the Apache-2.0 license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
7
  import React from 'react';
8
- import { ForwardRefReturn } from '../../types/common';
9
8
  export interface TableToolbarActionProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onClick'> {
10
9
  /**
11
10
  * Pass in the children that will be rendered inside the TableToolbarAction
@@ -16,6 +15,5 @@ export interface TableToolbarActionProps extends Omit<React.HTMLAttributes<HTMLD
16
15
  */
17
16
  onClick: (event: React.MouseEvent<HTMLDivElement>) => void;
18
17
  }
19
- export type TableToolbarActionComponent = ForwardRefReturn<HTMLDivElement, TableToolbarActionProps>;
20
- declare const TableToolbarAction: TableToolbarActionComponent;
18
+ declare const TableToolbarAction: React.ForwardRefExoticComponent<TableToolbarActionProps & React.RefAttributes<HTMLDivElement>>;
21
19
  export default TableToolbarAction;
@@ -19,11 +19,12 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
19
19
  var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
20
20
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
21
21
 
22
- const TableToolbarAction = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref) => {
23
- let {
22
+ const frFn = React.forwardRef;
23
+ const TableToolbarAction = frFn((props, ref) => {
24
+ const {
24
25
  children,
25
26
  ...rest
26
- } = _ref;
27
+ } = props;
27
28
  return /*#__PURE__*/React__default["default"].createElement(OverflowMenuItem["default"], _rollupPluginBabelHelpers["extends"]({
28
29
  ref: ref,
29
30
  itemText: children
@@ -0,0 +1,42 @@
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 DataTableSortState } from '../state/sortStates';
8
+ /**
9
+ * Compare two values to determine their order. If both values have the same
10
+ * type, the default sort algorithm will be used for those types. Otherwise, the
11
+ * values will be converted to strings for comparison.
12
+ */
13
+ export declare const compare: (a: any, b: any, locale?: string) => number;
14
+ interface Cell {
15
+ id: string;
16
+ value: any;
17
+ }
18
+ interface SortRowParams {
19
+ key: string;
20
+ sortDirection: DataTableSortState;
21
+ sortStates: Record<DataTableSortState, DataTableSortState>;
22
+ locale: string;
23
+ compare: typeof compare;
24
+ rowIds: string[];
25
+ }
26
+ interface SortRowsConfig {
27
+ rowIds: string[];
28
+ cellsById: Record<string, Cell>;
29
+ key: string;
30
+ sortDirection: DataTableSortState;
31
+ locale?: string;
32
+ sortRow?: (cellA: any, cellB: any, params: SortRowParams) => number;
33
+ }
34
+ /**
35
+ * Sorts table rows based on the provided column key and direction.
36
+ */
37
+ export declare const sortRows: ({ rowIds, cellsById, sortDirection, key, locale, sortRow, }: SortRowsConfig) => string[];
38
+ /**
39
+ * Sorts table rows based on the sort direction.
40
+ */
41
+ export declare const defaultSortRow: (cellA: any, cellB: any, { sortDirection, sortStates, locale, }: Pick<SortRowParams, "locale" | "sortDirection" | "sortStates">) => number;
42
+ export {};