@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.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +902 -902
- package/es/components/AILabel/index.d.ts +1 -1
- package/es/components/AILabel/index.js +2 -9
- package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/es/components/Breadcrumb/Breadcrumb.js +4 -4
- package/es/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/es/components/Breadcrumb/BreadcrumbItem.js +5 -4
- package/es/components/Button/Button.js +2 -10
- package/es/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/es/components/ButtonSet/ButtonSet.js +4 -4
- package/es/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/es/components/CodeSnippet/CodeSnippet.js +3 -19
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +2 -2
- package/es/components/ComboButton/index.d.ts +1 -1
- package/es/components/ComboButton/index.js +2 -18
- package/es/components/ComposedModal/ComposedModal.js +5 -3
- package/es/components/Copy/Copy.d.ts +1 -1
- package/es/components/Copy/Copy.js +2 -18
- package/es/components/CopyButton/CopyButton.d.ts +1 -1
- package/es/components/CopyButton/CopyButton.js +2 -18
- package/es/components/DataTable/DataTable.d.ts +7 -12
- package/es/components/DataTable/DataTable.js +0 -5
- package/es/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/es/components/DataTable/TableToolbarAction.js +5 -4
- package/es/components/DataTable/tools/sorting.d.ts +42 -0
- package/es/components/DataTable/tools/sorting.js +24 -53
- package/es/components/DatePicker/DatePicker.d.ts +1 -1
- package/es/components/DatePicker/DatePicker.js +18 -18
- package/es/components/Dialog/index.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/es/components/Dropdown/Dropdown.Skeleton.js +2 -2
- package/es/components/Dropdown/Dropdown.d.ts +7 -6
- package/es/components/Dropdown/Dropdown.js +7 -3
- package/es/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +1 -1
- package/es/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +2 -18
- package/es/components/ListBox/ListBox.d.ts +4 -5
- package/es/components/ListBox/ListBox.js +8 -7
- package/es/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/es/components/ListBox/ListBoxMenu.js +4 -2
- package/es/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/es/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/es/components/ListBox/ListBoxPropTypes.js +3 -3
- package/es/components/ListBox/index.d.ts +7 -5
- package/es/components/ListBox/index.js +1 -1
- package/es/components/Menu/Menu.js +5 -0
- package/es/components/Modal/Modal.js +9 -9
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/es/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/es/components/MultiSelect/MultiSelect.js +3 -3
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +2 -21
- package/es/components/OverflowMenu/next/index.js +2 -18
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +5 -4
- package/es/components/PageHeader/PageHeader.d.ts +153 -8
- package/es/components/PageHeader/PageHeader.js +143 -21
- package/es/components/PageHeader/index.d.ts +2 -2
- package/es/components/PageHeader/index.js +1 -1
- package/es/components/Popover/index.js +4 -21
- package/es/components/Search/Search.d.ts +2 -5
- package/es/components/Search/Search.js +24 -8
- package/es/components/Stack/HStack.d.ts +2 -3
- package/es/components/Stack/HStack.js +4 -7
- package/es/components/Stack/Stack.d.ts +3 -4
- package/es/components/Stack/Stack.js +3 -6
- package/es/components/Stack/VStack.d.ts +2 -3
- package/es/components/Stack/VStack.js +3 -2
- package/es/components/Stack/index.d.ts +4 -4
- package/es/components/TextArea/TextArea.js +3 -5
- package/es/components/TimePicker/TimePicker.d.ts +3 -4
- package/es/components/TimePicker/TimePicker.js +5 -4
- package/es/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/es/components/TimePickerSelect/TimePickerSelect.js +5 -4
- package/es/components/TreeView/TreeNode.js +13 -1
- package/es/components/TreeView/TreeView.js +1 -1
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +9 -5
- package/es/internal/environment.js +7 -0
- package/es/internal/keyboard/navigation.d.ts +0 -10
- package/es/internal/keyboard/navigation.js +1 -13
- package/es/internal/useId.js +1 -1
- package/es/internal/useNoInteractiveChildren.js +7 -0
- package/es/internal/useOutsideClick.js +3 -0
- package/es/internal/wrapFocus.d.ts +49 -0
- package/es/internal/wrapFocus.js +64 -51
- package/es/tools/events.d.ts +17 -0
- package/es/tools/events.js +10 -13
- package/es/tools/mapPopoverAlign.d.ts +15 -0
- package/es/tools/mapPopoverAlign.js +28 -0
- package/es/tools/uniqueId.d.ts +7 -0
- package/es/tools/uniqueId.js +3 -3
- package/es/types/common.d.ts +0 -2
- package/lib/components/AILabel/index.d.ts +1 -1
- package/lib/components/AILabel/index.js +2 -9
- package/lib/components/Breadcrumb/Breadcrumb.d.ts +2 -3
- package/lib/components/Breadcrumb/Breadcrumb.js +3 -3
- package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +3 -4
- package/lib/components/Breadcrumb/BreadcrumbItem.js +4 -3
- package/lib/components/Button/Button.js +1 -9
- package/lib/components/ButtonSet/ButtonSet.d.ts +2 -3
- package/lib/components/ButtonSet/ButtonSet.js +3 -3
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +3 -19
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +1 -1
- package/lib/components/ComboButton/index.d.ts +1 -1
- package/lib/components/ComboButton/index.js +2 -18
- package/lib/components/ComposedModal/ComposedModal.js +5 -3
- package/lib/components/Copy/Copy.d.ts +1 -1
- package/lib/components/Copy/Copy.js +2 -18
- package/lib/components/CopyButton/CopyButton.d.ts +1 -1
- package/lib/components/CopyButton/CopyButton.js +2 -18
- package/lib/components/DataTable/DataTable.d.ts +7 -12
- package/lib/components/DataTable/DataTable.js +0 -5
- package/lib/components/DataTable/TableToolbarAction.d.ts +2 -4
- package/lib/components/DataTable/TableToolbarAction.js +4 -3
- package/lib/components/DataTable/tools/sorting.d.ts +42 -0
- package/lib/components/DataTable/tools/sorting.js +23 -53
- package/lib/components/DatePicker/DatePicker.d.ts +1 -1
- package/lib/components/DatePicker/DatePicker.js +18 -18
- package/lib/components/Dialog/index.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +2 -2
- package/lib/components/Dropdown/Dropdown.Skeleton.js +1 -1
- package/lib/components/Dropdown/Dropdown.d.ts +7 -6
- package/lib/components/Dropdown/Dropdown.js +6 -2
- package/lib/components/FileUploader/FileUploaderButton.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +1 -1
- package/lib/components/FluidDropdown/FluidDropdown.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.d.ts +3 -6
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/IconButton/index.js +2 -18
- package/lib/components/ListBox/ListBox.d.ts +4 -5
- package/lib/components/ListBox/ListBox.js +7 -6
- package/lib/components/ListBox/ListBoxMenu.d.ts +4 -4
- package/lib/components/ListBox/ListBoxMenu.js +3 -1
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +9 -8
- package/lib/components/ListBox/ListBoxPropTypes.d.ts +3 -3
- package/lib/components/ListBox/ListBoxPropTypes.js +4 -4
- package/lib/components/ListBox/index.d.ts +7 -5
- package/lib/components/ListBox/index.js +2 -2
- package/lib/components/Menu/Menu.js +5 -0
- package/lib/components/Modal/Modal.js +9 -9
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +2 -1
- package/lib/components/MultiSelect/MultiSelect.d.ts +8 -2
- package/lib/components/MultiSelect/MultiSelect.js +2 -2
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -21
- package/lib/components/OverflowMenu/next/index.js +2 -18
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +2 -4
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -3
- package/lib/components/PageHeader/PageHeader.d.ts +153 -8
- package/lib/components/PageHeader/PageHeader.js +145 -19
- package/lib/components/PageHeader/index.d.ts +2 -2
- package/lib/components/PageHeader/index.js +4 -0
- package/lib/components/Popover/index.js +4 -21
- package/lib/components/Search/Search.d.ts +2 -5
- package/lib/components/Search/Search.js +24 -8
- package/lib/components/Stack/HStack.d.ts +2 -3
- package/lib/components/Stack/HStack.js +3 -6
- package/lib/components/Stack/Stack.d.ts +3 -4
- package/lib/components/Stack/Stack.js +2 -5
- package/lib/components/Stack/VStack.d.ts +2 -3
- package/lib/components/Stack/VStack.js +2 -1
- package/lib/components/Stack/index.d.ts +4 -4
- package/lib/components/TextArea/TextArea.js +2 -4
- package/lib/components/TimePicker/TimePicker.d.ts +3 -4
- package/lib/components/TimePicker/TimePicker.js +4 -3
- package/lib/components/TimePickerSelect/TimePickerSelect.d.ts +23 -4
- package/lib/components/TimePickerSelect/TimePickerSelect.js +4 -3
- package/lib/components/TreeView/TreeNode.js +13 -1
- package/lib/components/TreeView/TreeView.js +1 -1
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +9 -5
- package/lib/internal/environment.js +7 -0
- package/lib/internal/keyboard/navigation.d.ts +0 -10
- package/lib/internal/keyboard/navigation.js +0 -14
- package/lib/internal/useNoInteractiveChildren.js +7 -0
- package/lib/internal/useOutsideClick.js +3 -0
- package/lib/internal/wrapFocus.d.ts +49 -0
- package/lib/internal/wrapFocus.js +66 -53
- package/lib/tools/events.d.ts +17 -0
- package/lib/tools/events.js +10 -13
- package/lib/tools/mapPopoverAlign.d.ts +15 -0
- package/lib/tools/mapPopoverAlign.js +32 -0
- package/lib/tools/uniqueId.d.ts +7 -0
- package/lib/tools/uniqueId.js +3 -3
- package/lib/types/common.d.ts +0 -2
- package/package.json +7 -7
- package/telemetry.yml +3 -1
- package/es/tools/createPropAdapter.js +0 -40
- 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__*/
|
|
25
|
-
|
|
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
|
-
} =
|
|
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,
|
|
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:
|
|
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
|
|
29
|
-
|
|
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
|
-
} =
|
|
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:
|
|
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,
|
|
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:
|
|
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__*/
|
|
25
|
-
|
|
24
|
+
const ButtonSet = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
25
|
+
const {
|
|
26
26
|
children,
|
|
27
27
|
className,
|
|
28
28
|
stacked,
|
|
29
29
|
...rest
|
|
30
|
-
} =
|
|
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
|
|
@@ -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
|
|
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.
|
|
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
|
|
@@ -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
|
|
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
|
|
202
|
+
wrapFocus.wrapFocus({
|
|
201
203
|
bodyNode,
|
|
202
204
|
startTrapNode: startSentinelNode,
|
|
203
205
|
endTrapNode: endSentinelNode,
|
|
@@ -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
|
*/
|
|
@@ -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:
|
|
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:
|
|
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,
|
|
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
|
-
|
|
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
|
|
23
|
-
|
|
22
|
+
const frFn = React.forwardRef;
|
|
23
|
+
const TableToolbarAction = frFn((props, ref) => {
|
|
24
|
+
const {
|
|
24
25
|
children,
|
|
25
26
|
...rest
|
|
26
|
-
} =
|
|
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 {};
|