@carbon/react 1.72.0 → 1.73.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +899 -899
- package/es/components/AILabel/index.js +4 -2
- package/es/components/ComposedModal/ComposedModal.js +1 -1
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/TableRow.js +12 -5
- package/es/components/Modal/Modal.js +1 -1
- package/es/components/Popover/index.js +6 -2
- package/es/components/Search/Search.js +1 -1
- package/es/components/Slider/Slider.Skeleton.d.ts +17 -1
- package/es/components/Slider/Slider.Skeleton.js +20 -3
- package/es/components/Slider/Slider.d.ts +1 -1
- package/es/components/Slider/Slider.js +20 -4
- package/es/components/Slider/SliderHandles.d.ts +4 -4
- package/es/components/Slider/SliderHandles.js +9 -8
- package/es/components/Stack/Stack.js +3 -1
- package/es/components/Tabs/Tabs.js +1 -1
- package/es/components/Toggletip/index.d.ts +16 -11
- package/es/components/Toggletip/index.js +5 -0
- package/lib/components/AILabel/index.js +4 -2
- package/lib/components/ComposedModal/ComposedModal.js +2 -3
- package/lib/components/Copy/Copy.js +2 -3
- package/lib/components/DataTable/Table.js +3 -4
- package/lib/components/DataTable/TableRow.js +12 -6
- package/lib/components/Modal/Modal.js +2 -3
- package/lib/components/Popover/index.js +6 -2
- package/lib/components/Search/Search.js +1 -1
- package/lib/components/Slider/Slider.Skeleton.d.ts +17 -1
- package/lib/components/Slider/Slider.Skeleton.js +20 -3
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/Slider.js +21 -6
- package/lib/components/Slider/SliderHandles.d.ts +4 -4
- package/lib/components/Slider/SliderHandles.js +9 -8
- package/lib/components/Stack/Stack.js +3 -1
- package/lib/components/Tabs/Tabs.js +3 -4
- package/lib/components/Toggletip/index.d.ts +16 -11
- package/lib/components/Toggletip/index.js +5 -0
- package/package.json +6 -8
|
@@ -118,7 +118,8 @@ const AILabel = /*#__PURE__*/React__default.forwardRef(function AILabel(_ref3, r
|
|
|
118
118
|
onRevertClick(evt);
|
|
119
119
|
}
|
|
120
120
|
};
|
|
121
|
-
const ariaLabelText = !aiTextLabel && !textLabel ? `${aiText}
|
|
121
|
+
const ariaLabelText = !aiTextLabel && !textLabel ? `${aiText} ${slugLabel || ariaLabel}` : `${aiText} ${aiTextLabel || textLabel}`;
|
|
122
|
+
const isSmallIcon = ['xs', '2xs', 'mini'].includes(size);
|
|
122
123
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
123
124
|
className: aiLabelClasses,
|
|
124
125
|
ref: ref,
|
|
@@ -130,7 +131,8 @@ const AILabel = /*#__PURE__*/React__default.forwardRef(function AILabel(_ref3, r
|
|
|
130
131
|
label: revertLabel
|
|
131
132
|
}, rest), _Undo || (_Undo = /*#__PURE__*/React__default.createElement(Undo, null))) : /*#__PURE__*/React__default.createElement(Toggletip, _extends({
|
|
132
133
|
align: align,
|
|
133
|
-
autoAlign: autoAlign
|
|
134
|
+
autoAlign: autoAlign,
|
|
135
|
+
alignmentAxisOffset: isSmallIcon ? -24 : 0
|
|
134
136
|
}, rest), /*#__PURE__*/React__default.createElement(ToggletipButton, {
|
|
135
137
|
className: aiLabelButtonClasses,
|
|
136
138
|
label: ariaLabelText
|
|
@@ -12,7 +12,7 @@ import PropTypes from 'prop-types';
|
|
|
12
12
|
import { Layer } from '../Layer/index.js';
|
|
13
13
|
import { ModalHeader } from './ModalHeader.js';
|
|
14
14
|
import { ModalFooter } from './ModalFooter.js';
|
|
15
|
-
import debounce from '
|
|
15
|
+
import { debounce } from 'es-toolkit/compat';
|
|
16
16
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
17
17
|
import mergeRefs from '../../tools/mergeRefs.js';
|
|
18
18
|
import cx from 'classnames';
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import React__default, { useState, useCallback, useEffect } from 'react';
|
|
11
|
-
import debounce from '
|
|
11
|
+
import { debounce } from 'es-toolkit/compat';
|
|
12
12
|
import cx from 'classnames';
|
|
13
13
|
import { composeEventHandlers } from '../../tools/events.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import React__default, { useContext, useState, useRef, useCallback } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import debounce from '
|
|
12
|
+
import { debounce } from 'es-toolkit/compat';
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
import { TableContext } from './TableContext.js';
|
|
15
15
|
import { useWindowEvent } from '../../internal/useEvent.js';
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
import React__default from 'react';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import omit from 'lodash.omit';
|
|
11
10
|
import cx from 'classnames';
|
|
12
11
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
12
|
|
|
@@ -29,10 +28,18 @@ const TableRow = props => {
|
|
|
29
28
|
[`${prefix}--data-table--selected`]: props.isSelected,
|
|
30
29
|
[`${prefix}--data-table--slug-row`]: rowHasSlug
|
|
31
30
|
});
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
const {
|
|
32
|
+
ariaLabel,
|
|
33
|
+
'aria-label': ariaLabelAlt,
|
|
34
|
+
'aria-controls': ariaControls,
|
|
35
|
+
onExpand,
|
|
36
|
+
isExpanded,
|
|
37
|
+
isSelected,
|
|
38
|
+
...cleanProps
|
|
39
|
+
} = props;
|
|
40
|
+
if (className) {
|
|
41
|
+
cleanProps.className = className;
|
|
42
|
+
}
|
|
36
43
|
return /*#__PURE__*/React__default.createElement("tr", cleanProps);
|
|
37
44
|
};
|
|
38
45
|
TableRow.propTypes = {
|
|
@@ -18,7 +18,7 @@ import InlineLoading from '../InlineLoading/InlineLoading.js';
|
|
|
18
18
|
import { Layer } from '../Layer/index.js';
|
|
19
19
|
import requiredIfGivenPropIsTruthy from '../../prop-types/requiredIfGivenPropIsTruthy.js';
|
|
20
20
|
import wrapFocus, { wrapFocusWithoutSentinels, elementOrParentIsFloatingMenu } from '../../internal/wrapFocus.js';
|
|
21
|
-
import debounce from '
|
|
21
|
+
import { debounce } from 'es-toolkit/compat';
|
|
22
22
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
23
23
|
import { useId } from '../../internal/useId.js';
|
|
24
24
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
@@ -61,6 +61,7 @@ const Popover = /*#__PURE__*/React__default.forwardRef(function PopoverRenderFun
|
|
|
61
61
|
highContrast = false,
|
|
62
62
|
onRequestClose,
|
|
63
63
|
open,
|
|
64
|
+
alignmentAxisOffset,
|
|
64
65
|
...rest
|
|
65
66
|
} = _ref;
|
|
66
67
|
const prefix = usePrefix();
|
|
@@ -86,7 +87,7 @@ const Popover = /*#__PURE__*/React__default.forwardRef(function PopoverRenderFun
|
|
|
86
87
|
// needs to be placed 1px further outside the popover content. To do so,
|
|
87
88
|
// we look to see if any of the children has a className containing "slug"
|
|
88
89
|
const initialCaretHeight = React__default.Children.toArray(children).some(x => {
|
|
89
|
-
return x?.props?.className?.includes('slug');
|
|
90
|
+
return x?.props?.className?.includes('slug') || x?.props?.className?.includes('ai-label');
|
|
90
91
|
}) ? 7 : 6;
|
|
91
92
|
// These defaults match the defaults defined in packages/styles/scss/components/popover/_popover.scss
|
|
92
93
|
const popoverDimensions = useRef({
|
|
@@ -128,7 +129,10 @@ const Popover = /*#__PURE__*/React__default.forwardRef(function PopoverRenderFun
|
|
|
128
129
|
// https://floating-ui.com/docs/misc#clipping
|
|
129
130
|
strategy: 'fixed',
|
|
130
131
|
// Middleware order matters, arrow should be last
|
|
131
|
-
middleware: [offset(!isTabTip ?
|
|
132
|
+
middleware: [offset(!isTabTip ? {
|
|
133
|
+
alignmentAxis: alignmentAxisOffset,
|
|
134
|
+
mainAxis: popoverDimensions?.current?.offset
|
|
135
|
+
} : 0), autoAlign && flip({
|
|
132
136
|
fallbackPlacements: align.includes('bottom') ? ['bottom', 'bottom-start', 'bottom-end', 'right', 'right-start', 'right-end', 'left', 'left-start', 'left-end', 'top', 'top-start', 'top-end'] : ['top', 'top-start', 'top-end', 'left', 'left-start', 'left-end', 'right', 'right-start', 'right-end', 'bottom', 'bottom-start', 'bottom-end'],
|
|
133
137
|
fallbackStrategy: 'initialPlacement',
|
|
134
138
|
fallbackAxisSideDirection: 'start',
|
|
@@ -121,7 +121,7 @@ const Search = /*#__PURE__*/React__default.forwardRef(function Search(_ref, forw
|
|
|
121
121
|
className: searchClasses
|
|
122
122
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
123
123
|
"aria-label": onExpand ? 'button' : undefined,
|
|
124
|
-
"aria-labelledby": onExpand ?
|
|
124
|
+
"aria-labelledby": onExpand ? searchId : undefined,
|
|
125
125
|
role: onExpand ? 'button' : undefined,
|
|
126
126
|
className: `${prefix}--search-magnifier`,
|
|
127
127
|
onClick: onExpand,
|
|
@@ -7,6 +7,14 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { HTMLAttributes } from 'react';
|
|
9
9
|
export interface SliderSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
/**
|
|
11
|
+
* The `ariaLabel` for the handle icon.
|
|
12
|
+
*/
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The `ariaLabel` for the upper bound slider handle when there are two handles.
|
|
16
|
+
*/
|
|
17
|
+
unstable_ariaLabelHandleUpper?: string;
|
|
10
18
|
/**
|
|
11
19
|
* Specify an optional className to add to the form item wrapper.
|
|
12
20
|
*/
|
|
@@ -21,8 +29,16 @@ export interface SliderSkeletonProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
21
29
|
twoHandles?: boolean;
|
|
22
30
|
}
|
|
23
31
|
declare const SliderSkeleton: {
|
|
24
|
-
({ hideLabel, className, twoHandles, ...rest }: SliderSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
({ ariaLabel, unstable_ariaLabelHandleUpper: ariaLabelHandleUpper, hideLabel, className, twoHandles, ...rest }: SliderSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
25
33
|
propTypes: {
|
|
34
|
+
/**
|
|
35
|
+
* The `ariaLabel` for the handle icon.
|
|
36
|
+
*/
|
|
37
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
38
|
+
/**
|
|
39
|
+
* The `ariaLabel` for the upper bound slider handle when there are two handles.
|
|
40
|
+
*/
|
|
41
|
+
unstable_ariaLabelHandleUpper: PropTypes.Requireable<string>;
|
|
26
42
|
/**
|
|
27
43
|
* Specify an optional className to add to the form item wrapper.
|
|
28
44
|
*/
|
|
@@ -13,9 +13,10 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
13
13
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
14
14
|
import { LowerHandle, UpperHandle } from './SliderHandles.js';
|
|
15
15
|
|
|
16
|
-
var _LowerHandle, _UpperHandle, _UpperHandle2, _LowerHandle2;
|
|
17
16
|
const SliderSkeleton = _ref => {
|
|
18
17
|
let {
|
|
18
|
+
ariaLabel = 'slider handle',
|
|
19
|
+
unstable_ariaLabelHandleUpper: ariaLabelHandleUpper = 'upper slider handle',
|
|
19
20
|
hideLabel,
|
|
20
21
|
className,
|
|
21
22
|
twoHandles,
|
|
@@ -60,15 +61,31 @@ const SliderSkeleton = _ref => {
|
|
|
60
61
|
className: lowerThumbWrapperClasses
|
|
61
62
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
62
63
|
className: lowerThumbClasses
|
|
63
|
-
}, twoHandles && !isRtl ?
|
|
64
|
+
}, twoHandles && !isRtl ? /*#__PURE__*/React__default.createElement(LowerHandle, {
|
|
65
|
+
"aria-label": ariaLabel
|
|
66
|
+
}) : twoHandles && isRtl ? /*#__PURE__*/React__default.createElement(UpperHandle, {
|
|
67
|
+
"aria-label": ariaLabelHandleUpper
|
|
68
|
+
}) : undefined)), twoHandles ? /*#__PURE__*/React__default.createElement("div", {
|
|
64
69
|
className: upperThumbWrapperClasses
|
|
65
70
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
66
71
|
className: upperThumbClasses
|
|
67
|
-
}, twoHandles && !isRtl ?
|
|
72
|
+
}, twoHandles && !isRtl ? /*#__PURE__*/React__default.createElement(UpperHandle, {
|
|
73
|
+
"aria-label": ariaLabelHandleUpper
|
|
74
|
+
}) : twoHandles && isRtl ? /*#__PURE__*/React__default.createElement(LowerHandle, {
|
|
75
|
+
"aria-label": ariaLabel
|
|
76
|
+
}) : undefined)) : undefined), /*#__PURE__*/React__default.createElement("span", {
|
|
68
77
|
className: `${prefix}--slider__range-label`
|
|
69
78
|
})));
|
|
70
79
|
};
|
|
71
80
|
SliderSkeleton.propTypes = {
|
|
81
|
+
/**
|
|
82
|
+
* The `ariaLabel` for the handle icon.
|
|
83
|
+
*/
|
|
84
|
+
ariaLabel: PropTypes.string,
|
|
85
|
+
/**
|
|
86
|
+
* The `ariaLabel` for the upper bound slider handle when there are two handles.
|
|
87
|
+
*/
|
|
88
|
+
unstable_ariaLabelHandleUpper: PropTypes.string,
|
|
72
89
|
/**
|
|
73
90
|
* Specify an optional className to add to the form item wrapper.
|
|
74
91
|
*/
|
|
@@ -387,7 +387,7 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
387
387
|
* Throttles calls to `this._onDrag` by limiting events to being processed at
|
|
388
388
|
* most once every `EVENT_THROTTLE` milliseconds.
|
|
389
389
|
*/
|
|
390
|
-
onDrag: any
|
|
390
|
+
onDrag: import("es-toolkit/dist/compat/function/debounce").DebouncedFunction<(evt: any, activeHandle?: HandlePosition | null) => void>;
|
|
391
391
|
/**
|
|
392
392
|
* Handles a `keydown` event by recalculating the value/thumb and setting
|
|
393
393
|
* state accordingly.
|
|
@@ -9,7 +9,7 @@ import { defineProperty as _defineProperty, extends as _extends } from '../../_v
|
|
|
9
9
|
import React__default, { PureComponent } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import throttle from '
|
|
12
|
+
import { throttle } from 'es-toolkit/compat';
|
|
13
13
|
import { ArrowDown, ArrowLeft, ArrowUp, ArrowRight, Enter } from '../../internal/keyboard/keys.js';
|
|
14
14
|
import { PrefixContext } from '../../internal/usePrefix.js';
|
|
15
15
|
import deprecate from '../../prop-types/deprecate.js';
|
|
@@ -22,7 +22,6 @@ import { LowerHandle, LowerHandleFocus, UpperHandle, UpperHandleFocus } from './
|
|
|
22
22
|
import { matches } from '../../internal/keyboard/match.js';
|
|
23
23
|
import { Text } from '../Text/Text.js';
|
|
24
24
|
|
|
25
|
-
var _LowerHandle, _LowerHandleFocus, _UpperHandle, _UpperHandleFocus, _UpperHandle2, _UpperHandleFocus2, _LowerHandle2, _LowerHandleFocus2;
|
|
26
25
|
const ThumbWrapper = _ref => {
|
|
27
26
|
let {
|
|
28
27
|
hasTooltip = false,
|
|
@@ -947,6 +946,7 @@ class Slider extends PureComponent {
|
|
|
947
946
|
return Object.entries(derivedState).length > 0 ? derivedState : null;
|
|
948
947
|
}
|
|
949
948
|
render() {
|
|
949
|
+
var _LowerHandle, _LowerHandleFocus, _UpperHandle, _UpperHandleFocus, _UpperHandle2, _UpperHandleFocus2, _LowerHandle2, _LowerHandleFocus2;
|
|
950
950
|
const {
|
|
951
951
|
ariaLabelInput,
|
|
952
952
|
unstable_ariaLabelInputUpper: ariaLabelInputUpper,
|
|
@@ -1114,7 +1114,15 @@ class Slider extends PureComponent {
|
|
|
1114
1114
|
onFocus: () => this.setState({
|
|
1115
1115
|
activeHandle: HandlePosition.LOWER
|
|
1116
1116
|
})
|
|
1117
|
-
}, twoHandles && !isRtl ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _LowerHandle || (_LowerHandle = /*#__PURE__*/React__default.createElement(LowerHandle,
|
|
1117
|
+
}, twoHandles && !isRtl ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _LowerHandle || (_LowerHandle = /*#__PURE__*/React__default.createElement(LowerHandle, {
|
|
1118
|
+
"aria-label": ariaLabelInput
|
|
1119
|
+
})), _LowerHandleFocus || (_LowerHandleFocus = /*#__PURE__*/React__default.createElement(LowerHandleFocus, {
|
|
1120
|
+
"aria-label": ariaLabelInput
|
|
1121
|
+
}))) : twoHandles && isRtl ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _UpperHandle || (_UpperHandle = /*#__PURE__*/React__default.createElement(UpperHandle, {
|
|
1122
|
+
"aria-label": ariaLabelInputUpper
|
|
1123
|
+
})), _UpperHandleFocus || (_UpperHandleFocus = /*#__PURE__*/React__default.createElement(UpperHandleFocus, {
|
|
1124
|
+
"aria-label": ariaLabelInputUpper
|
|
1125
|
+
}))) : undefined)), twoHandles ? /*#__PURE__*/React__default.createElement(ThumbWrapper, _extends({
|
|
1118
1126
|
hasTooltip: hideTextInput,
|
|
1119
1127
|
className: upperThumbWrapperClasses,
|
|
1120
1128
|
label: `${formatLabel(valueUpper || 0, '')}`,
|
|
@@ -1131,7 +1139,15 @@ class Slider extends PureComponent {
|
|
|
1131
1139
|
onFocus: () => this.setState({
|
|
1132
1140
|
activeHandle: HandlePosition.UPPER
|
|
1133
1141
|
})
|
|
1134
|
-
}, twoHandles && !isRtl ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _UpperHandle2 || (_UpperHandle2 = /*#__PURE__*/React__default.createElement(UpperHandle,
|
|
1142
|
+
}, twoHandles && !isRtl ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _UpperHandle2 || (_UpperHandle2 = /*#__PURE__*/React__default.createElement(UpperHandle, {
|
|
1143
|
+
"aria-label": ariaLabelInputUpper
|
|
1144
|
+
})), _UpperHandleFocus2 || (_UpperHandleFocus2 = /*#__PURE__*/React__default.createElement(UpperHandleFocus, {
|
|
1145
|
+
"aria-label": ariaLabelInputUpper
|
|
1146
|
+
}))) : twoHandles && isRtl ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, _LowerHandle2 || (_LowerHandle2 = /*#__PURE__*/React__default.createElement(LowerHandle, {
|
|
1147
|
+
"aria-label": ariaLabelInput
|
|
1148
|
+
})), _LowerHandleFocus2 || (_LowerHandleFocus2 = /*#__PURE__*/React__default.createElement(LowerHandleFocus, {
|
|
1149
|
+
"aria-label": ariaLabelInput
|
|
1150
|
+
}))) : undefined)) : null, /*#__PURE__*/React__default.createElement("div", {
|
|
1135
1151
|
className: `${prefix}--slider__track`,
|
|
1136
1152
|
ref: node => {
|
|
1137
1153
|
this.track = node;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const LowerHandle: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
-
export declare const LowerHandleFocus: () => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export declare const UpperHandle: () => import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
export declare const UpperHandleFocus: () => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare const LowerHandle: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const LowerHandleFocus: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const UpperHandle: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const UpperHandleFocus: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,25 +5,26 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
8
9
|
import { PrefixContext } from '../../internal/usePrefix.js';
|
|
9
10
|
import React__default from 'react';
|
|
10
11
|
|
|
11
12
|
var _path, _path2, _path3, _path4, _path5, _path6, _path7, _path8, _path9, _path10, _path11, _path12, _path13, _path14;
|
|
12
|
-
const LowerHandle =
|
|
13
|
+
const LowerHandle = props => /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, prefix => /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
13
14
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
15
|
viewBox: "0 0 16 24",
|
|
15
16
|
className: `${prefix}--slider__thumb-icon ${prefix}--slider__thumb-icon--lower`
|
|
16
|
-
}, _path || (_path = /*#__PURE__*/React__default.createElement("path", {
|
|
17
|
+
}, props), _path || (_path = /*#__PURE__*/React__default.createElement("path", {
|
|
17
18
|
d: "M15.08 6.46H16v11.08h-.92zM4.46 17.54c-.25 0-.46-.21-.46-.46V6.92a.465.465 0 0 1 .69-.4l8.77 5.08a.46.46 0 0 1 0 .8l-8.77 5.08c-.07.04-.15.06-.23.06Z"
|
|
18
19
|
})), _path2 || (_path2 = /*#__PURE__*/React__default.createElement("path", {
|
|
19
20
|
fill: "none",
|
|
20
21
|
d: "M-4 0h24v24H-4z"
|
|
21
22
|
}))));
|
|
22
|
-
const LowerHandleFocus =
|
|
23
|
+
const LowerHandleFocus = props => /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, prefix => /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
23
24
|
xmlns: "http://www.w3.org/2000/svg",
|
|
24
25
|
viewBox: "0 0 16 24",
|
|
25
26
|
className: `${prefix}--slider__thumb-icon ${prefix}--slider__thumb-icon--lower ${prefix}--slider__thumb-icon--focus`
|
|
26
|
-
}, _path3 || (_path3 = /*#__PURE__*/React__default.createElement("path", {
|
|
27
|
+
}, props), _path3 || (_path3 = /*#__PURE__*/React__default.createElement("path", {
|
|
27
28
|
d: "M15.08 6.46H16v11.08h-.92zM4.46 17.54c-.25 0-.46-.21-.46-.46V6.92a.465.465 0 0 1 .69-.4l8.77 5.08a.46.46 0 0 1 0 .8l-8.77 5.08c-.07.04-.15.06-.23.06Z"
|
|
28
29
|
})), _path4 || (_path4 = /*#__PURE__*/React__default.createElement("path", {
|
|
29
30
|
fill: "none",
|
|
@@ -35,21 +36,21 @@ const LowerHandleFocus = () => /*#__PURE__*/React__default.createElement(PrefixC
|
|
|
35
36
|
})), _path7 || (_path7 = /*#__PURE__*/React__default.createElement("path", {
|
|
36
37
|
d: "M0 .92V0h16v.92zM0 24v-.92h16V24z"
|
|
37
38
|
}))));
|
|
38
|
-
const UpperHandle =
|
|
39
|
+
const UpperHandle = props => /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, prefix => /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
39
40
|
xmlns: "http://www.w3.org/2000/svg",
|
|
40
41
|
viewBox: "0 0 16 24",
|
|
41
42
|
className: `${prefix}--slider__thumb-icon ${prefix}--slider__thumb-icon--upper`
|
|
42
|
-
}, _path8 || (_path8 = /*#__PURE__*/React__default.createElement("path", {
|
|
43
|
+
}, props), _path8 || (_path8 = /*#__PURE__*/React__default.createElement("path", {
|
|
43
44
|
d: "M0 6.46h.92v11.08H0zM11.54 6.46c.25 0 .46.21.46.46v10.15a.465.465 0 0 1-.69.4L2.54 12.4a.46.46 0 0 1 0-.8l8.77-5.08c.07-.04.15-.06.23-.06Z"
|
|
44
45
|
})), _path9 || (_path9 = /*#__PURE__*/React__default.createElement("path", {
|
|
45
46
|
fill: "none",
|
|
46
47
|
d: "M-4 0h24v24H-4z"
|
|
47
48
|
}))));
|
|
48
|
-
const UpperHandleFocus =
|
|
49
|
+
const UpperHandleFocus = props => /*#__PURE__*/React__default.createElement(PrefixContext.Consumer, null, prefix => /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
49
50
|
xmlns: "http://www.w3.org/2000/svg",
|
|
50
51
|
viewBox: "0 0 16 24",
|
|
51
52
|
className: `${prefix}--slider__thumb-icon ${prefix}--slider__thumb-icon--upper ${prefix}--slider__thumb-icon--focus`
|
|
52
|
-
}, _path10 || (_path10 = /*#__PURE__*/React__default.createElement("path", {
|
|
53
|
+
}, props), _path10 || (_path10 = /*#__PURE__*/React__default.createElement("path", {
|
|
53
54
|
d: "M0 6.46h.92v11.08H0zM11.54 6.46c.25 0 .46.21.46.46v10.15a.465.465 0 0 1-.69.4L2.54 12.4a.46.46 0 0 1 0-.8l8.77-5.08c.07-.04.15-.06.23-.06Z"
|
|
54
55
|
})), _path11 || (_path11 = /*#__PURE__*/React__default.createElement("path", {
|
|
55
56
|
fill: "none",
|
|
@@ -52,7 +52,9 @@ const Stack = /*#__PURE__*/React__default.forwardRef(function Stack(props, ref)
|
|
|
52
52
|
[`${prefix}--stack-${orientation}`]: true,
|
|
53
53
|
[`${prefix}--stack-scale-${gap}`]: typeof gap === 'number'
|
|
54
54
|
});
|
|
55
|
-
const style = {
|
|
55
|
+
const style = {
|
|
56
|
+
...rest.style
|
|
57
|
+
};
|
|
56
58
|
if (typeof gap === 'string') {
|
|
57
59
|
style[`--${prefix}-stack-gap`] = gap;
|
|
58
60
|
}
|
|
@@ -9,7 +9,7 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import { ChevronLeft, ChevronRight, Close } from '@carbon/icons-react';
|
|
10
10
|
import { breakpoints } from '@carbon/layout';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import debounce from '
|
|
12
|
+
import { debounce } from 'es-toolkit/compat';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
14
|
import React__default, { useState, useRef, useCallback, useEffect, forwardRef } from 'react';
|
|
15
15
|
import '../Grid/FlexGrid.js';
|
|
@@ -9,9 +9,9 @@ import React, { type ElementType, type ReactNode } from 'react';
|
|
|
9
9
|
import { type PopoverAlignment } from '../Popover';
|
|
10
10
|
import { PolymorphicProps } from '../../types/common';
|
|
11
11
|
type ToggletipLabelProps<E extends ElementType> = {
|
|
12
|
-
as?: E
|
|
12
|
+
as?: E;
|
|
13
13
|
children?: ReactNode;
|
|
14
|
-
className?: string
|
|
14
|
+
className?: string;
|
|
15
15
|
};
|
|
16
16
|
/**
|
|
17
17
|
* Used to render the label for a Toggletip
|
|
@@ -36,12 +36,13 @@ export declare namespace ToggletipLabel {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
interface ToggletipProps<E extends ElementType> {
|
|
39
|
-
align?: PopoverAlignment
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
align?: PopoverAlignment;
|
|
40
|
+
alignmentAxisOffset?: number;
|
|
41
|
+
as?: E;
|
|
42
|
+
autoAlign?: boolean;
|
|
43
|
+
className?: string;
|
|
43
44
|
children?: ReactNode;
|
|
44
|
-
defaultOpen?: boolean
|
|
45
|
+
defaultOpen?: boolean;
|
|
45
46
|
}
|
|
46
47
|
/**
|
|
47
48
|
* Used as a container for the button and content of a toggletip. This component
|
|
@@ -55,6 +56,10 @@ export declare namespace Toggletip {
|
|
|
55
56
|
* Specify how the toggletip should align with the button
|
|
56
57
|
*/
|
|
57
58
|
align: PropTypes.Requireable<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Provide an offset value for alignment axis.
|
|
61
|
+
*/
|
|
62
|
+
alignmentAxisOffset: PropTypes.Requireable<number>;
|
|
58
63
|
/**
|
|
59
64
|
* Provide a custom element or component to render the top-level node for the
|
|
60
65
|
* component.
|
|
@@ -81,8 +86,8 @@ export declare namespace Toggletip {
|
|
|
81
86
|
}
|
|
82
87
|
interface ToggletipButtonBaseProps {
|
|
83
88
|
children?: ReactNode;
|
|
84
|
-
className?: string
|
|
85
|
-
label?: string
|
|
89
|
+
className?: string;
|
|
90
|
+
label?: string;
|
|
86
91
|
}
|
|
87
92
|
export type ToggleTipButtonProps<T extends React.ElementType> = PolymorphicProps<T, ToggletipButtonBaseProps>;
|
|
88
93
|
/**
|
|
@@ -92,7 +97,7 @@ export type ToggleTipButtonProps<T extends React.ElementType> = PolymorphicProps
|
|
|
92
97
|
export declare const ToggletipButton: React.ForwardRefExoticComponent<Omit<ToggleTipButtonProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<unknown>>;
|
|
93
98
|
interface ToggletipContentProps {
|
|
94
99
|
children?: ReactNode;
|
|
95
|
-
className?: string
|
|
100
|
+
className?: string;
|
|
96
101
|
}
|
|
97
102
|
/**
|
|
98
103
|
* `ToggletipContent` is a wrapper around `PopoverContent`. It places the
|
|
@@ -103,7 +108,7 @@ declare const ToggletipContent: React.ForwardRefExoticComponent<ToggletipContent
|
|
|
103
108
|
export { ToggletipContent };
|
|
104
109
|
interface ToggleTipActionsProps {
|
|
105
110
|
children?: ReactNode;
|
|
106
|
-
className?: string
|
|
111
|
+
className?: string;
|
|
107
112
|
}
|
|
108
113
|
/**
|
|
109
114
|
* `ToggletipActions` is a container for one or two actions present at the base
|
|
@@ -173,6 +173,10 @@ Toggletip.propTypes = {
|
|
|
173
173
|
|
|
174
174
|
// new values to match floating-ui
|
|
175
175
|
'top-start', 'top-end', 'bottom-start', 'bottom-end', 'left-end', 'left-start', 'right-end', 'right-start']),
|
|
176
|
+
/**
|
|
177
|
+
* Provide an offset value for alignment axis.
|
|
178
|
+
*/
|
|
179
|
+
alignmentAxisOffset: PropTypes.number,
|
|
176
180
|
/**
|
|
177
181
|
* Provide a custom element or component to render the top-level node for the
|
|
178
182
|
* component.
|
|
@@ -200,6 +204,7 @@ Toggletip.propTypes = {
|
|
|
200
204
|
* `ToggletipButton` controls the visibility of the Toggletip through mouse
|
|
201
205
|
* clicks and keyboard interactions.
|
|
202
206
|
*/
|
|
207
|
+
|
|
203
208
|
const ToggletipButton = /*#__PURE__*/React__default.forwardRef(function ToggletipButton(_ref3, ref) {
|
|
204
209
|
let {
|
|
205
210
|
children,
|
|
@@ -128,7 +128,8 @@ const AILabel = /*#__PURE__*/React__default["default"].forwardRef(function AILab
|
|
|
128
128
|
onRevertClick(evt);
|
|
129
129
|
}
|
|
130
130
|
};
|
|
131
|
-
const ariaLabelText = !aiTextLabel && !textLabel ? `${aiText}
|
|
131
|
+
const ariaLabelText = !aiTextLabel && !textLabel ? `${aiText} ${slugLabel || ariaLabel}` : `${aiText} ${aiTextLabel || textLabel}`;
|
|
132
|
+
const isSmallIcon = ['xs', '2xs', 'mini'].includes(size);
|
|
132
133
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
133
134
|
className: aiLabelClasses,
|
|
134
135
|
ref: ref,
|
|
@@ -140,7 +141,8 @@ const AILabel = /*#__PURE__*/React__default["default"].forwardRef(function AILab
|
|
|
140
141
|
label: revertLabel
|
|
141
142
|
}, rest), _Undo || (_Undo = /*#__PURE__*/React__default["default"].createElement(iconsReact.Undo, null))) : /*#__PURE__*/React__default["default"].createElement(index.Toggletip, _rollupPluginBabelHelpers["extends"]({
|
|
142
143
|
align: align,
|
|
143
|
-
autoAlign: autoAlign
|
|
144
|
+
autoAlign: autoAlign,
|
|
145
|
+
alignmentAxisOffset: isSmallIcon ? -24 : 0
|
|
144
146
|
}, rest), /*#__PURE__*/React__default["default"].createElement(index.ToggletipButton, {
|
|
145
147
|
className: aiLabelButtonClasses,
|
|
146
148
|
label: ariaLabelText
|
|
@@ -16,7 +16,7 @@ var PropTypes = require('prop-types');
|
|
|
16
16
|
var index = require('../Layer/index.js');
|
|
17
17
|
var ModalHeader = require('./ModalHeader.js');
|
|
18
18
|
var ModalFooter = require('./ModalFooter.js');
|
|
19
|
-
var
|
|
19
|
+
var compat = require('es-toolkit/compat');
|
|
20
20
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
21
21
|
var mergeRefs = require('../../tools/mergeRefs.js');
|
|
22
22
|
var cx = require('classnames');
|
|
@@ -34,7 +34,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
34
34
|
|
|
35
35
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
36
36
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
37
|
-
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
38
37
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
39
38
|
|
|
40
39
|
const ModalBody = /*#__PURE__*/React__default["default"].forwardRef(function ModalBody(_ref, ref) {
|
|
@@ -62,7 +61,7 @@ const ModalBody = /*#__PURE__*/React__default["default"].forwardRef(function Mod
|
|
|
62
61
|
setIsScrollable(contentRef.current.scrollHeight > contentRef.current.clientHeight);
|
|
63
62
|
}
|
|
64
63
|
}
|
|
65
|
-
const debouncedHandler =
|
|
64
|
+
const debouncedHandler = compat.debounce(handler, 200);
|
|
66
65
|
window.addEventListener('resize', debouncedHandler);
|
|
67
66
|
return () => {
|
|
68
67
|
debouncedHandler.cancel();
|
|
@@ -12,7 +12,7 @@ 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
|
|
15
|
+
var compat = require('es-toolkit/compat');
|
|
16
16
|
var cx = require('classnames');
|
|
17
17
|
var events = require('../../tools/events.js');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
@@ -24,7 +24,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
24
24
|
|
|
25
25
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
26
26
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
27
|
-
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
28
27
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
29
28
|
|
|
30
29
|
const propMappingFunction = deprecatedValue => {
|
|
@@ -59,7 +58,7 @@ function Copy(_ref) {
|
|
|
59
58
|
[`${prefix}--copy-btn--${animation}`]: animation
|
|
60
59
|
});
|
|
61
60
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
62
|
-
const handleFadeOut = React.useCallback(
|
|
61
|
+
const handleFadeOut = React.useCallback(compat.debounce(() => {
|
|
63
62
|
setAnimation('fade-out');
|
|
64
63
|
}, feedbackTimeout), [feedbackTimeout]);
|
|
65
64
|
const handleClick = React.useCallback(() => {
|
|
@@ -13,7 +13,7 @@ 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
|
|
16
|
+
var compat = require('es-toolkit/compat');
|
|
17
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
18
|
var TableContext = require('./TableContext.js');
|
|
19
19
|
var useEvent = require('../../internal/useEvent.js');
|
|
@@ -24,7 +24,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
24
24
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
25
25
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
26
26
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
27
|
-
var debounce__default = /*#__PURE__*/_interopDefaultLegacy(debounce);
|
|
28
27
|
|
|
29
28
|
const isElementWrappingContent = (element, context) => {
|
|
30
29
|
if (element.children.length > 0) {
|
|
@@ -109,7 +108,7 @@ const Table = _ref => {
|
|
|
109
108
|
toggleTableHeaderAlignmentClass(false);
|
|
110
109
|
}
|
|
111
110
|
}, [experimentalAutoAlign, toggleTableBodyAlignmentClass, toggleTableHeaderAlignmentClass, prefix]);
|
|
112
|
-
const debouncedSetTableAlignment =
|
|
111
|
+
const debouncedSetTableAlignment = compat.debounce(setTableAlignment, 100);
|
|
113
112
|
useEvent.useWindowEvent('resize', debouncedSetTableAlignment);
|
|
114
113
|
|
|
115
114
|
// Used to set a tabIndex when the Table is horizontally scrollable
|
|
@@ -122,7 +121,7 @@ const Table = _ref => {
|
|
|
122
121
|
setIsScrollable(false);
|
|
123
122
|
}
|
|
124
123
|
}, []);
|
|
125
|
-
const debouncedSetTabIndex =
|
|
124
|
+
const debouncedSetTabIndex = compat.debounce(setTabIndex, 100);
|
|
126
125
|
useEvent.useWindowEvent('resize', debouncedSetTabIndex);
|
|
127
126
|
useIsomorphicEffect["default"](() => {
|
|
128
127
|
setTabIndex();
|
|
@@ -11,7 +11,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var PropTypes = require('prop-types');
|
|
14
|
-
var omit = require('lodash.omit');
|
|
15
14
|
var cx = require('classnames');
|
|
16
15
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
16
|
|
|
@@ -19,7 +18,6 @@ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'defau
|
|
|
19
18
|
|
|
20
19
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
21
20
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
22
|
-
var omit__default = /*#__PURE__*/_interopDefaultLegacy(omit);
|
|
23
21
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
24
22
|
|
|
25
23
|
const TableRow = props => {
|
|
@@ -40,10 +38,18 @@ const TableRow = props => {
|
|
|
40
38
|
[`${prefix}--data-table--selected`]: props.isSelected,
|
|
41
39
|
[`${prefix}--data-table--slug-row`]: rowHasSlug
|
|
42
40
|
});
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
const {
|
|
42
|
+
ariaLabel,
|
|
43
|
+
'aria-label': ariaLabelAlt,
|
|
44
|
+
'aria-controls': ariaControls,
|
|
45
|
+
onExpand,
|
|
46
|
+
isExpanded,
|
|
47
|
+
isSelected,
|
|
48
|
+
...cleanProps
|
|
49
|
+
} = props;
|
|
50
|
+
if (className) {
|
|
51
|
+
cleanProps.className = className;
|
|
52
|
+
}
|
|
47
53
|
return /*#__PURE__*/React__default["default"].createElement("tr", cleanProps);
|
|
48
54
|
};
|
|
49
55
|
TableRow.propTypes = {
|