@carbon/react 1.63.2 → 1.64.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 +1562 -1193
- package/es/components/{Slug → AILabel}/index.js +47 -35
- package/es/components/{AiSkeleton/AiSkeletonIcon.d.ts → AISkeleton/AISkeletonIcon.d.ts} +4 -4
- package/es/components/{AiSkeleton/AiSkeletonIcon.js → AISkeleton/AISkeletonIcon.js} +5 -5
- package/es/components/{AiSkeleton/AiSkeletonPlaceholder.d.ts → AISkeleton/AISkeletonPlaceholder.d.ts} +4 -4
- package/es/components/{AiSkeleton/AiSkeletonPlaceholder.js → AISkeleton/AISkeletonPlaceholder.js} +5 -5
- package/es/components/{AiSkeleton/AiSkeletonText.d.ts → AISkeleton/AISkeletonText.d.ts} +4 -4
- package/es/components/{AiSkeleton/AiSkeletonText.js → AISkeleton/AISkeletonText.js} +3 -3
- package/es/components/AISkeleton/index.d.ts +10 -0
- package/es/components/Accordion/AccordionItem.js +1 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/es/components/ComboBox/ComboBox.js +4 -4
- package/es/components/ComposedModal/ComposedModal.js +1 -1
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DatePicker/DatePicker.js +16 -1
- package/es/components/DatePickerInput/DatePickerInput.js +1 -1
- package/es/components/Dropdown/Dropdown.js +12 -6
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +4 -2
- package/es/components/Menu/MenuItem.js +45 -63
- package/es/components/Modal/Modal.js +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +44 -23
- package/es/components/MultiSelect/MultiSelect.js +6 -4
- package/es/components/NumberInput/NumberInput.js +12 -4
- package/es/components/OverflowMenu/OverflowMenu.js +2 -1
- package/es/components/OverflowMenu/next/index.js +2 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es/components/RadioTile/RadioTile.js +1 -1
- package/es/components/Select/Select.js +1 -1
- package/es/components/Tabs/Tabs.js +3 -3
- package/es/components/Tag/DismissibleTag.js +1 -1
- package/es/components/Tag/OperationalTag.js +1 -1
- package/es/components/Tag/SelectableTag.js +3 -1
- package/es/components/Tag/Tag.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextInput/PasswordInput.js +5 -0
- package/es/components/TextInput/TextInput.js +1 -1
- package/es/components/Tile/Tile.js +2 -2
- package/es/components/TreeView/TreeNode.d.ts +150 -0
- package/es/components/TreeView/TreeNode.js +22 -15
- package/es/components/TreeView/TreeView.d.ts +59 -0
- package/es/components/TreeView/TreeView.js +37 -23
- package/es/components/TreeView/index.d.ts +11 -0
- package/es/components/UIShell/SwitcherItem.d.ts +4 -0
- package/es/components/UIShell/SwitcherItem.js +7 -1
- package/es/index.d.ts +4 -2
- package/es/index.js +6 -6
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +143 -0
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +39 -0
- package/lib/components/{Slug → AILabel}/index.js +49 -37
- package/lib/components/{AiSkeleton/AiSkeletonIcon.d.ts → AISkeleton/AISkeletonIcon.d.ts} +4 -4
- package/lib/components/{AiSkeleton/AiSkeletonIcon.js → AISkeleton/AISkeletonIcon.js} +5 -5
- package/lib/components/{AiSkeleton/AiSkeletonPlaceholder.d.ts → AISkeleton/AISkeletonPlaceholder.d.ts} +4 -4
- package/lib/components/{AiSkeleton/AiSkeletonPlaceholder.js → AISkeleton/AISkeletonPlaceholder.js} +5 -5
- package/lib/components/{AiSkeleton/AiSkeletonText.d.ts → AISkeleton/AISkeletonText.d.ts} +4 -4
- package/lib/components/{AiSkeleton/AiSkeletonText.js → AISkeleton/AISkeletonText.js} +3 -3
- package/lib/components/AISkeleton/index.d.ts +10 -0
- package/lib/components/Accordion/AccordionItem.js +1 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/lib/components/ComboBox/ComboBox.js +4 -4
- package/lib/components/ComposedModal/ComposedModal.js +1 -1
- package/lib/components/DataTable/DataTable.js +2 -2
- package/lib/components/DatePicker/DatePicker.js +15 -0
- package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +12 -6
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +4 -2
- package/lib/components/Menu/MenuItem.js +44 -62
- package/lib/components/Modal/Modal.js +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +43 -22
- package/lib/components/MultiSelect/MultiSelect.js +6 -4
- package/lib/components/NumberInput/NumberInput.js +12 -4
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -1
- package/lib/components/OverflowMenu/next/index.js +2 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/components/RadioTile/RadioTile.js +1 -1
- package/lib/components/Select/Select.js +1 -1
- package/lib/components/Tabs/Tabs.js +2 -2
- package/lib/components/Tag/DismissibleTag.js +1 -1
- package/lib/components/Tag/OperationalTag.js +1 -1
- package/lib/components/Tag/SelectableTag.js +3 -1
- package/lib/components/Tag/Tag.js +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextInput/PasswordInput.js +5 -0
- package/lib/components/TextInput/TextInput.js +1 -1
- package/lib/components/Tile/Tile.js +2 -2
- package/lib/components/TreeView/TreeNode.d.ts +150 -0
- package/lib/components/TreeView/TreeNode.js +24 -17
- package/lib/components/TreeView/TreeView.d.ts +59 -0
- package/lib/components/TreeView/TreeView.js +39 -25
- package/lib/components/TreeView/index.d.ts +11 -0
- package/lib/components/UIShell/SwitcherItem.d.ts +4 -0
- package/lib/components/UIShell/SwitcherItem.js +7 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.js +20 -14
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +148 -0
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +47 -0
- package/package.json +5 -5
- package/scss/components/ai-label/_ai-label.scss +9 -0
- package/scss/components/ai-label/_index.scss +9 -0
- package/es/components/AiSkeleton/index.d.ts +0 -10
- package/es/components/DataTable/tools/instanceId.js +0 -20
- package/lib/components/AiSkeleton/index.d.ts +0 -10
- package/lib/components/DataTable/tools/instanceId.js +0 -24
|
@@ -14,26 +14,26 @@ import { ToggletipContent, ToggletipActions, Toggletip, ToggletipButton } from '
|
|
|
14
14
|
import { IconButton } from '../IconButton/index.js';
|
|
15
15
|
import { Undo } from '@carbon/icons-react';
|
|
16
16
|
import { useId } from '../../internal/useId.js';
|
|
17
|
+
import deprecate from '../../prop-types/deprecate.js';
|
|
17
18
|
|
|
18
19
|
var _Undo;
|
|
19
|
-
const
|
|
20
|
+
const AILabelContent = /*#__PURE__*/React__default.forwardRef(function AILabelContent(_ref, ref) {
|
|
20
21
|
let {
|
|
21
22
|
children,
|
|
22
23
|
className
|
|
23
24
|
} = _ref;
|
|
24
25
|
const prefix = usePrefix();
|
|
25
|
-
const
|
|
26
|
-
const
|
|
26
|
+
const hasAILabelActions = React__default.Children.toArray(children).some(child => child.type?.displayName === 'AILabelActions');
|
|
27
|
+
const aiLabelContentClasses = cx(className, {
|
|
27
28
|
[`${prefix}--slug-content`]: true,
|
|
28
|
-
[`${prefix}--slug-content--with-actions`]:
|
|
29
|
+
[`${prefix}--slug-content--with-actions`]: hasAILabelActions
|
|
29
30
|
});
|
|
30
31
|
return /*#__PURE__*/React__default.createElement(ToggletipContent, {
|
|
31
|
-
className:
|
|
32
|
-
ref: ref
|
|
32
|
+
className: aiLabelContentClasses
|
|
33
33
|
}, children);
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
AILabelContent.displayName = 'AILabelContent';
|
|
36
|
+
AILabelContent.propTypes = {
|
|
37
37
|
/**
|
|
38
38
|
* Specify the content you want rendered inside the slug ToggleTip
|
|
39
39
|
*/
|
|
@@ -43,22 +43,22 @@ SlugContent.propTypes = {
|
|
|
43
43
|
*/
|
|
44
44
|
className: PropTypes.string
|
|
45
45
|
};
|
|
46
|
-
const
|
|
46
|
+
const AILabelActions = /*#__PURE__*/React__default.forwardRef(function AILabelActions(_ref2, ref) {
|
|
47
47
|
let {
|
|
48
48
|
children,
|
|
49
49
|
className
|
|
50
50
|
} = _ref2;
|
|
51
51
|
const prefix = usePrefix();
|
|
52
|
-
const
|
|
52
|
+
const aiLabelActionsClasses = cx(className, {
|
|
53
53
|
[`${prefix}--slug-actions`]: true
|
|
54
54
|
});
|
|
55
55
|
return /*#__PURE__*/React__default.createElement(ToggletipActions, {
|
|
56
|
-
className:
|
|
56
|
+
className: aiLabelActionsClasses,
|
|
57
57
|
ref: ref
|
|
58
58
|
}, children);
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
AILabelActions.displayName = 'AILabelActions';
|
|
61
|
+
AILabelActions.propTypes = {
|
|
62
62
|
/**
|
|
63
63
|
* Specify the content you want rendered inside the slug callout toolbar
|
|
64
64
|
*/
|
|
@@ -68,10 +68,11 @@ SlugActions.propTypes = {
|
|
|
68
68
|
*/
|
|
69
69
|
className: PropTypes.string
|
|
70
70
|
};
|
|
71
|
-
const
|
|
71
|
+
const AILabel = /*#__PURE__*/React__default.forwardRef(function AILabel(_ref3, ref) {
|
|
72
72
|
let {
|
|
73
73
|
aiText = 'AI',
|
|
74
74
|
aiTextLabel,
|
|
75
|
+
textLabel,
|
|
75
76
|
align,
|
|
76
77
|
autoAlign = true,
|
|
77
78
|
children,
|
|
@@ -81,29 +82,30 @@ const Slug = /*#__PURE__*/React__default.forwardRef(function Slug(_ref3, ref) {
|
|
|
81
82
|
revertActive,
|
|
82
83
|
revertLabel = 'Revert to AI input',
|
|
83
84
|
slugLabel = 'Show information',
|
|
85
|
+
['aria-label']: ariaLabel = 'Show information',
|
|
84
86
|
size = 'xs',
|
|
85
87
|
...rest
|
|
86
88
|
} = _ref3;
|
|
87
89
|
const prefix = usePrefix();
|
|
88
|
-
const id = useId('
|
|
89
|
-
const
|
|
90
|
+
const id = useId('AILabel');
|
|
91
|
+
const aiLabelClasses = cx(className, {
|
|
90
92
|
[`${prefix}--slug`]: true,
|
|
91
93
|
[`${prefix}--slug--revert`]: revertActive
|
|
92
94
|
});
|
|
93
|
-
const
|
|
95
|
+
const aiLabelButtonClasses = cx({
|
|
94
96
|
[`${prefix}--slug__button`]: true,
|
|
95
97
|
[`${prefix}--slug__button--${size}`]: size,
|
|
96
98
|
[`${prefix}--slug__button--${kind}`]: kind,
|
|
97
|
-
[`${prefix}--slug__button--inline-with-content`]: kind === 'inline' && aiTextLabel
|
|
99
|
+
[`${prefix}--slug__button--inline-with-content`]: kind === 'inline' && (aiTextLabel || textLabel)
|
|
98
100
|
});
|
|
99
101
|
const handleOnRevertClick = evt => {
|
|
100
102
|
if (onRevertClick) {
|
|
101
103
|
onRevertClick(evt);
|
|
102
104
|
}
|
|
103
105
|
};
|
|
104
|
-
const
|
|
106
|
+
const ariaLabelText = !aiTextLabel && !textLabel ? `${aiText} - ${slugLabel || ariaLabel}` : `${aiText} - ${aiTextLabel || textLabel}`;
|
|
105
107
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
106
|
-
className:
|
|
108
|
+
className: aiLabelClasses,
|
|
107
109
|
ref: ref,
|
|
108
110
|
id: id
|
|
109
111
|
}, revertActive ? /*#__PURE__*/React__default.createElement(IconButton, _extends({
|
|
@@ -115,24 +117,29 @@ const Slug = /*#__PURE__*/React__default.forwardRef(function Slug(_ref3, ref) {
|
|
|
115
117
|
align: align,
|
|
116
118
|
autoAlign: autoAlign
|
|
117
119
|
}, rest), /*#__PURE__*/React__default.createElement(ToggletipButton, {
|
|
118
|
-
className:
|
|
119
|
-
label:
|
|
120
|
+
className: aiLabelButtonClasses,
|
|
121
|
+
label: ariaLabelText
|
|
120
122
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
121
123
|
className: `${prefix}--slug__text`
|
|
122
|
-
}, aiText), aiTextLabel && /*#__PURE__*/React__default.createElement("span", {
|
|
124
|
+
}, aiText), kind === 'inline' && (aiTextLabel || textLabel) && /*#__PURE__*/React__default.createElement("span", {
|
|
123
125
|
className: `${prefix}--slug__additional-text`
|
|
124
|
-
}, aiTextLabel)), children));
|
|
126
|
+
}, aiTextLabel || textLabel)), children));
|
|
125
127
|
});
|
|
126
|
-
|
|
127
|
-
|
|
128
|
+
AILabel.displayName = 'AILabel';
|
|
129
|
+
AILabel.propTypes = {
|
|
130
|
+
/**
|
|
131
|
+
* Specify the content you want rendered inside the `AILabel` ToggleTip
|
|
132
|
+
*/
|
|
133
|
+
AILabelContent: PropTypes.node,
|
|
128
134
|
/**
|
|
129
135
|
* Specify the correct translation of the AI text
|
|
130
136
|
*/
|
|
131
137
|
aiText: PropTypes.string,
|
|
132
138
|
/**
|
|
139
|
+
* @deprecated
|
|
133
140
|
* Specify additional text to be rendered next to the AI label in the inline variant
|
|
134
141
|
*/
|
|
135
|
-
aiTextLabel: PropTypes.string,
|
|
142
|
+
aiTextLabel: deprecate(PropTypes.string, '`aiTextLabel` on `AILabel` has been deprecated - Please use the `textLabel` prop instead'),
|
|
136
143
|
/**
|
|
137
144
|
* Specify how the popover should align with the button
|
|
138
145
|
*/
|
|
@@ -153,20 +160,24 @@ Slug.propTypes = {
|
|
|
153
160
|
'right-end', 'right-top',
|
|
154
161
|
// deprecated use right-start instead
|
|
155
162
|
'right-start']),
|
|
163
|
+
/**
|
|
164
|
+
* Specify the text that will be provided to the aria-label of the `AILabel` button
|
|
165
|
+
*/
|
|
166
|
+
'aria-label': PropTypes.string,
|
|
156
167
|
/**
|
|
157
168
|
* Will auto-align the popover. This prop is currently experimental and is subject to future changes.
|
|
158
169
|
*/
|
|
159
170
|
autoAlign: PropTypes.bool,
|
|
160
171
|
/**
|
|
161
|
-
* Specify the content you want rendered inside the
|
|
172
|
+
* Specify the content you want rendered inside the `AILabel` ToggleTip
|
|
162
173
|
*/
|
|
163
174
|
children: PropTypes.node,
|
|
164
175
|
/**
|
|
165
|
-
* Specify an optional className to be added to the
|
|
176
|
+
* Specify an optional className to be added to the `AILabel`
|
|
166
177
|
*/
|
|
167
178
|
className: PropTypes.string,
|
|
168
179
|
/**
|
|
169
|
-
* Specify the type of
|
|
180
|
+
* Specify the type of `AILabel`, from the following list of types:
|
|
170
181
|
*/
|
|
171
182
|
kind: PropTypes.oneOf(['default', 'inline']),
|
|
172
183
|
/**
|
|
@@ -186,13 +197,14 @@ Slug.propTypes = {
|
|
|
186
197
|
*/
|
|
187
198
|
size: PropTypes.oneOf(['mini', '2xs', 'xs', 'sm', 'md', 'lg', 'xl']),
|
|
188
199
|
/**
|
|
189
|
-
*
|
|
200
|
+
* @deprecated
|
|
201
|
+
* Specify the text that will be provided to the aria-label of the `AILabel` button
|
|
190
202
|
*/
|
|
191
|
-
|
|
203
|
+
slugLabel: deprecate(PropTypes.string, '`slugLabel` on `AILabel` has been deprecated - Please use the `ariaLabel` prop instead'),
|
|
192
204
|
/**
|
|
193
|
-
* Specify
|
|
205
|
+
* Specify additional text to be rendered next to the AI label in the inline variant
|
|
194
206
|
*/
|
|
195
|
-
|
|
207
|
+
textLabel: PropTypes.string
|
|
196
208
|
};
|
|
197
209
|
|
|
198
|
-
export {
|
|
210
|
+
export { AILabel, AILabelActions, AILabelContent };
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import React from 'react';
|
|
9
|
-
interface
|
|
9
|
+
interface AISkeletonIconProps {
|
|
10
10
|
/**
|
|
11
11
|
* Specify an optional className to add.
|
|
12
12
|
*/
|
|
@@ -16,8 +16,8 @@ interface AiSkeletonIconProps {
|
|
|
16
16
|
*/
|
|
17
17
|
style?: React.CSSProperties;
|
|
18
18
|
}
|
|
19
|
-
declare const
|
|
20
|
-
({ className, ...rest }:
|
|
19
|
+
declare const AISkeletonIcon: {
|
|
20
|
+
({ className, ...rest }: AISkeletonIconProps): import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
propTypes: {
|
|
22
22
|
/**
|
|
23
23
|
* Specify an optional className to add.
|
|
@@ -29,4 +29,4 @@ declare const AiSkeletonIcon: {
|
|
|
29
29
|
style: PropTypes.Requireable<object>;
|
|
30
30
|
};
|
|
31
31
|
};
|
|
32
|
-
export default
|
|
32
|
+
export default AISkeletonIcon;
|
|
@@ -12,20 +12,20 @@ import cx from 'classnames';
|
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import SkeletonIcon from '../SkeletonIcon/SkeletonIcon.js';
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const AISkeletonIcon = _ref => {
|
|
16
16
|
let {
|
|
17
17
|
className,
|
|
18
18
|
...rest
|
|
19
19
|
} = _ref;
|
|
20
20
|
const prefix = usePrefix();
|
|
21
|
-
const
|
|
21
|
+
const AISkeletonIconClasses = cx(className, {
|
|
22
22
|
[`${prefix}--skeleton__icon--ai`]: true
|
|
23
23
|
});
|
|
24
24
|
return /*#__PURE__*/React__default.createElement(SkeletonIcon, _extends({
|
|
25
|
-
className:
|
|
25
|
+
className: AISkeletonIconClasses
|
|
26
26
|
}, rest));
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
AISkeletonIcon.propTypes = {
|
|
29
29
|
/**
|
|
30
30
|
* Specify an optional className to add.
|
|
31
31
|
*/
|
|
@@ -36,4 +36,4 @@ AiSkeletonIcon.propTypes = {
|
|
|
36
36
|
style: PropTypes.object
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
export {
|
|
39
|
+
export { AISkeletonIcon as default };
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
-
export interface
|
|
8
|
+
export interface AISkeletonPlaceholderProps {
|
|
9
9
|
/**
|
|
10
10
|
* Add a custom class to the component to set the height and width
|
|
11
11
|
*/
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
declare const
|
|
15
|
-
({ className, ...other }:
|
|
14
|
+
declare const AISkeletonPlaceholder: {
|
|
15
|
+
({ className, ...other }: AISkeletonPlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
propTypes: {
|
|
17
17
|
/**
|
|
18
18
|
* Add a custom class to the component
|
|
@@ -21,4 +21,4 @@ declare const AiSkeletonPlaceholder: {
|
|
|
21
21
|
className: PropTypes.Requireable<string>;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
export default
|
|
24
|
+
export default AISkeletonPlaceholder;
|
package/es/components/{AiSkeleton/AiSkeletonPlaceholder.js → AISkeleton/AISkeletonPlaceholder.js}
RENAMED
|
@@ -12,21 +12,21 @@ import cx from 'classnames';
|
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import SkeletonPlaceholder from '../SkeletonPlaceholder/SkeletonPlaceholder.js';
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const AISkeletonPlaceholder = _ref => {
|
|
16
16
|
let {
|
|
17
17
|
className,
|
|
18
18
|
...other
|
|
19
19
|
} = _ref;
|
|
20
20
|
const prefix = usePrefix();
|
|
21
|
-
const
|
|
21
|
+
const AISkeletonPlaceholderClasses = cx({
|
|
22
22
|
className,
|
|
23
23
|
[`${prefix}--skeleton__placeholder--ai`]: true
|
|
24
24
|
}, className);
|
|
25
25
|
return /*#__PURE__*/React__default.createElement(SkeletonPlaceholder, _extends({
|
|
26
|
-
className:
|
|
26
|
+
className: AISkeletonPlaceholderClasses
|
|
27
27
|
}, other));
|
|
28
28
|
};
|
|
29
|
-
|
|
29
|
+
AISkeletonPlaceholder.propTypes = {
|
|
30
30
|
/**
|
|
31
31
|
* Add a custom class to the component
|
|
32
32
|
* to set the height and width
|
|
@@ -34,4 +34,4 @@ AiSkeletonPlaceholder.propTypes = {
|
|
|
34
34
|
className: PropTypes.string
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
export {
|
|
37
|
+
export { AISkeletonPlaceholder as default };
|
|
@@ -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
|
-
interface
|
|
8
|
+
interface AISkeletonTextProps {
|
|
9
9
|
/**
|
|
10
10
|
* Specify an optional className to be applied to the container node.
|
|
11
11
|
*/
|
|
@@ -27,8 +27,8 @@ interface AiSkeletonTextProps {
|
|
|
27
27
|
*/
|
|
28
28
|
width?: string;
|
|
29
29
|
}
|
|
30
|
-
declare const
|
|
31
|
-
({ className, ...rest }:
|
|
30
|
+
declare const AISkeletonText: {
|
|
31
|
+
({ className, ...rest }: AISkeletonTextProps): import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
propTypes: {
|
|
33
33
|
/**
|
|
34
34
|
* Specify an optional className to be applied to the container node
|
|
@@ -52,4 +52,4 @@ declare const AiSkeletonText: {
|
|
|
52
52
|
width: PropTypes.Requireable<string>;
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
export default
|
|
55
|
+
export default AISkeletonText;
|
|
@@ -12,7 +12,7 @@ import cx from 'classnames';
|
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
import SkeletonText from '../SkeletonText/SkeletonText.js';
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const AISkeletonText = _ref => {
|
|
16
16
|
let {
|
|
17
17
|
className,
|
|
18
18
|
...rest
|
|
@@ -25,7 +25,7 @@ const AiSkeletonText = _ref => {
|
|
|
25
25
|
className: aiSkeletonTextClasses
|
|
26
26
|
}, rest));
|
|
27
27
|
};
|
|
28
|
-
|
|
28
|
+
AISkeletonText.propTypes = {
|
|
29
29
|
/**
|
|
30
30
|
* Specify an optional className to be applied to the container node
|
|
31
31
|
*/
|
|
@@ -48,4 +48,4 @@ AiSkeletonText.propTypes = {
|
|
|
48
48
|
width: PropTypes.string
|
|
49
49
|
};
|
|
50
50
|
|
|
51
|
-
export {
|
|
51
|
+
export { AISkeletonText as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2024
|
|
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 AISkeletonPlaceholder from './AISkeletonPlaceholder';
|
|
8
|
+
import AISkeletonIcon from './AISkeletonIcon';
|
|
9
|
+
import AISkeletonText from './AISkeletonText';
|
|
10
|
+
export { AISkeletonText, AISkeletonIcon, AISkeletonPlaceholder };
|
|
@@ -108,6 +108,7 @@ function AccordionItem(_ref) {
|
|
|
108
108
|
className: `${prefix}--accordion__title`
|
|
109
109
|
}, title)), /*#__PURE__*/React__default.createElement("div", {
|
|
110
110
|
ref: content,
|
|
111
|
+
hidden: !isOpen,
|
|
111
112
|
className: `${prefix}--accordion__wrapper`,
|
|
112
113
|
onTransitionEnd: onAnimationEnd
|
|
113
114
|
}, /*#__PURE__*/React__default.createElement("div", {
|
|
@@ -48,7 +48,7 @@ const CheckboxGroup = _ref => {
|
|
|
48
48
|
|
|
49
49
|
// Slug is always size `mini`
|
|
50
50
|
let normalizedSlug;
|
|
51
|
-
if ( /*#__PURE__*/React__default.isValidElement(slug) && slug['type']?.displayName === '
|
|
51
|
+
if ( /*#__PURE__*/React__default.isValidElement(slug) && slug['type']?.displayName === 'AILabel') {
|
|
52
52
|
normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
|
|
53
53
|
size: 'mini',
|
|
54
54
|
kind: 'default'
|
|
@@ -243,8 +243,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
243
243
|
case ToggleButtonClick:
|
|
244
244
|
if (changes.isOpen && !changes.selectedItem) {
|
|
245
245
|
return {
|
|
246
|
-
...changes
|
|
247
|
-
highlightedIndex: 0
|
|
246
|
+
...changes
|
|
248
247
|
};
|
|
249
248
|
}
|
|
250
249
|
return changes;
|
|
@@ -284,6 +283,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
284
283
|
};
|
|
285
284
|
const showWarning = !invalid && warn;
|
|
286
285
|
const className = cx(`${prefix}--combo-box`, {
|
|
286
|
+
[`${prefix}--combo-box--invalid--focused`]: invalid && isFocused,
|
|
287
287
|
[`${prefix}--list-box--up`]: direction === 'top',
|
|
288
288
|
[`${prefix}--combo-box--warning`]: showWarning,
|
|
289
289
|
[`${prefix}--combo-box--readonly`]: readOnly
|
|
@@ -304,7 +304,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
304
304
|
}]);
|
|
305
305
|
const inputClasses = cx(`${prefix}--text-input`, {
|
|
306
306
|
[`${prefix}--text-input--empty`]: !inputValue,
|
|
307
|
-
[`${prefix}--combo-box--input--focus`]: isFocused
|
|
307
|
+
[`${prefix}--combo-box--input--focus`]: isFocused
|
|
308
308
|
});
|
|
309
309
|
|
|
310
310
|
// needs to be Capitalized for react to render it correctly
|
|
@@ -312,7 +312,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
312
312
|
|
|
313
313
|
// Slug is always size `mini`
|
|
314
314
|
let normalizedSlug;
|
|
315
|
-
if (slug && slug['type']?.displayName === '
|
|
315
|
+
if (slug && slug['type']?.displayName === 'AILabel') {
|
|
316
316
|
normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
|
|
317
317
|
size: 'mini'
|
|
318
318
|
});
|
|
@@ -246,7 +246,7 @@ const ComposedModal = /*#__PURE__*/React__default.forwardRef(function ComposedMo
|
|
|
246
246
|
|
|
247
247
|
// Slug is always size `sm`
|
|
248
248
|
let normalizedSlug;
|
|
249
|
-
if (slug && slug['type']?.displayName === '
|
|
249
|
+
if (slug && slug['type']?.displayName === 'AILabel') {
|
|
250
250
|
normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
|
|
251
251
|
size: 'sm'
|
|
252
252
|
});
|
|
@@ -15,7 +15,7 @@ import { getCellId } from './tools/cells.js';
|
|
|
15
15
|
import denormalize from './tools/denormalize.js';
|
|
16
16
|
import { composeEventHandlers } from '../../tools/events.js';
|
|
17
17
|
import { defaultFilterRows } from './tools/filter.js';
|
|
18
|
-
import setupGetInstanceId from '
|
|
18
|
+
import setupGetInstanceId from '../../tools/setupGetInstanceId.js';
|
|
19
19
|
import { Table } from './Table.js';
|
|
20
20
|
import TableActionList from './TableActionList.js';
|
|
21
21
|
import TableBatchAction from './TableBatchAction.js';
|
|
@@ -22,7 +22,7 @@ import '../FluidForm/FluidForm.js';
|
|
|
22
22
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
23
23
|
import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
|
|
24
24
|
import { match } from '../../internal/keyboard/match.js';
|
|
25
|
-
import { Escape, ArrowDown } from '../../internal/keyboard/keys.js';
|
|
25
|
+
import { Escape, ArrowDown, Tab } from '../../internal/keyboard/keys.js';
|
|
26
26
|
|
|
27
27
|
// Weekdays shorthand for english locale
|
|
28
28
|
l10n.en.weekdays.shorthand.forEach((_day, index) => {
|
|
@@ -550,6 +550,21 @@ const DatePicker = /*#__PURE__*/React__default.forwardRef(function DatePicker(_r
|
|
|
550
550
|
}
|
|
551
551
|
}, [value, prefix]); //eslint-disable-line react-hooks/exhaustive-deps
|
|
552
552
|
|
|
553
|
+
useEffect(() => {
|
|
554
|
+
if (!calendarRef.current || !startInputField.current) return;
|
|
555
|
+
const handleKeyDown = event => {
|
|
556
|
+
if (match(event, Tab) && !event.shiftKey && document.activeElement === endInputField.current && calendarRef.current.isOpen) {
|
|
557
|
+
calendarRef.current.close();
|
|
558
|
+
// Remove focus from endDate calendar input
|
|
559
|
+
document.activeElement instanceof HTMLElement &&
|
|
560
|
+
// this is to fix the TS warning
|
|
561
|
+
document?.activeElement?.blur();
|
|
562
|
+
onCalendarClose(calendarRef.current.selectedDates, '', calendarRef.current, event);
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
document.addEventListener('keydown', handleKeyDown, true);
|
|
566
|
+
return () => document.removeEventListener('keydown', handleKeyDown, true);
|
|
567
|
+
}, [calendarRef, startInputField, endInputField, onCalendarClose]);
|
|
553
568
|
let fluidError;
|
|
554
569
|
if (isFluid) {
|
|
555
570
|
if (invalid) {
|
|
@@ -97,7 +97,7 @@ const DatePickerInput = /*#__PURE__*/React__default.forwardRef(function DatePick
|
|
|
97
97
|
|
|
98
98
|
// Slug is always size `mini`
|
|
99
99
|
let normalizedSlug;
|
|
100
|
-
if (slug && slug['type']?.displayName === '
|
|
100
|
+
if (slug && slug['type']?.displayName === 'AILabel') {
|
|
101
101
|
normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
|
|
102
102
|
size: 'mini'
|
|
103
103
|
});
|
|
@@ -19,6 +19,7 @@ import '../FluidForm/FluidForm.js';
|
|
|
19
19
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
20
20
|
import { useId } from '../../internal/useId.js';
|
|
21
21
|
import { useFloating, size, flip, autoUpdate } from '@floating-ui/react';
|
|
22
|
+
import { hide } from '../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js';
|
|
22
23
|
import { ListBoxSize, ListBoxType } from '../ListBox/ListBoxPropTypes.js';
|
|
23
24
|
|
|
24
25
|
const {
|
|
@@ -72,7 +73,8 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
72
73
|
} = _ref;
|
|
73
74
|
const {
|
|
74
75
|
refs,
|
|
75
|
-
floatingStyles
|
|
76
|
+
floatingStyles,
|
|
77
|
+
middlewareData
|
|
76
78
|
} = useFloating(autoAlign ? {
|
|
77
79
|
placement: direction,
|
|
78
80
|
// The floating element is positioned relative to its nearest
|
|
@@ -91,15 +93,19 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
91
93
|
width: `${rects.reference.width}px`
|
|
92
94
|
});
|
|
93
95
|
}
|
|
94
|
-
}), flip()],
|
|
96
|
+
}), flip(), hide()],
|
|
95
97
|
whileElementsMounted: autoUpdate
|
|
96
98
|
} : {} // When autoAlign is turned off, floating-ui will not be used
|
|
97
99
|
);
|
|
98
100
|
useEffect(() => {
|
|
99
101
|
if (autoAlign) {
|
|
100
|
-
|
|
102
|
+
const updatedFloatingStyles = {
|
|
103
|
+
...floatingStyles,
|
|
104
|
+
visibility: middlewareData.hide?.referenceHidden ? 'hidden' : 'visible'
|
|
105
|
+
};
|
|
106
|
+
Object.keys(updatedFloatingStyles).forEach(style => {
|
|
101
107
|
if (refs.floating.current) {
|
|
102
|
-
refs.floating.current.style[style] =
|
|
108
|
+
refs.floating.current.style[style] = updatedFloatingStyles[style];
|
|
103
109
|
}
|
|
104
110
|
});
|
|
105
111
|
}
|
|
@@ -260,11 +266,11 @@ const Dropdown = /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
|
260
266
|
};
|
|
261
267
|
const menuProps = useMemo(() => getMenuProps({
|
|
262
268
|
ref: autoAlign ? refs.setFloating : null
|
|
263
|
-
}), [autoAlign]);
|
|
269
|
+
}), [autoAlign, getMenuProps, refs.setFloating]);
|
|
264
270
|
|
|
265
271
|
// Slug is always size `mini`
|
|
266
272
|
let normalizedSlug;
|
|
267
|
-
if (slug && slug['type']?.displayName === '
|
|
273
|
+
if (slug && slug['type']?.displayName === 'AILabel') {
|
|
268
274
|
normalizedSlug = /*#__PURE__*/React__default.cloneElement(slug, {
|
|
269
275
|
size: 'mini'
|
|
270
276
|
});
|
|
@@ -53,7 +53,8 @@ FluidMultiSelect.propTypes = {
|
|
|
53
53
|
clearSelectionText: PropTypes.string,
|
|
54
54
|
/**
|
|
55
55
|
* Provide a compare function that is used to determine the ordering of
|
|
56
|
-
* options. See 'sortItems' for more control.
|
|
56
|
+
* options. See 'sortItems' for more control. Consider declaring function
|
|
57
|
+
* with `useCallback` to prevent unnecessary re-renders.
|
|
57
58
|
*/
|
|
58
59
|
compareItems: PropTypes.func,
|
|
59
60
|
/**
|
|
@@ -106,7 +107,8 @@ FluidMultiSelect.propTypes = {
|
|
|
106
107
|
/**
|
|
107
108
|
* Helper function passed to downshift that allows the library to render a
|
|
108
109
|
* given item to a string label. By default, it extracts the `label` field
|
|
109
|
-
* from a given item to serve as the item label in the list.
|
|
110
|
+
* from a given item to serve as the item label in the list. Consider
|
|
111
|
+
* declaring function with `useCallback` to prevent unnecessary re-renders.
|
|
110
112
|
*/
|
|
111
113
|
itemToString: PropTypes.func,
|
|
112
114
|
/**
|