@carbon/react 1.106.0 → 1.107.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 +1038 -1003
- package/es/components/Accordion/AccordionItem.d.ts +2 -2
- package/es/components/Button/Button.js +1 -1
- package/es/components/Checkbox/Checkbox.js +2 -1
- package/es/components/CheckboxGroup/CheckboxGroup.js +2 -1
- package/es/components/ComboBox/ComboBox.d.ts +1 -1
- package/es/components/ComboBox/ComboBox.js +1 -1
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/es/components/ContentSwitcher/ContentSwitcher.js +24 -15
- package/es/components/DataTable/DataTable.d.ts +3 -3
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableSlugRow.d.ts +2 -2
- package/es/components/DataTable/TableSlugRow.js +8 -11
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +5 -1
- package/es/components/DatePicker/DatePicker.js +15 -13
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +2 -3
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/FluidTimePicker/FluidTimePicker.d.ts +1 -1
- package/es/components/FluidTimePicker/FluidTimePicker.js +6 -4
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.d.ts +4 -0
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +2 -1
- package/es/components/FluidTimePickerSelect/index.js +18 -0
- package/es/components/Grid/CSSGrid.js +11 -6
- package/es/components/Grid/Column.d.ts +2 -2
- package/es/components/Grid/ColumnHang.d.ts +3 -3
- package/es/components/Grid/ColumnHang.js +1 -1
- package/es/components/Grid/FlexGrid.js +5 -3
- package/es/components/Grid/Grid.js +2 -1
- package/es/components/Grid/GridTypes.d.ts +5 -0
- package/es/components/Grid/Row.d.ts +3 -3
- package/es/components/Grid/Row.js +1 -1
- package/es/components/Menu/Menu.js +1 -1
- package/es/components/Menu/MenuItem.js +4 -0
- package/es/components/Modal/Modal.js +3 -0
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +11 -12
- package/es/components/Pagination/Pagination.d.ts +1 -1
- package/es/components/Pagination/Pagination.js +2 -0
- package/es/components/Popover/index.js +14 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +8 -6
- package/es/components/Search/Search.Skeleton.d.ts +12 -3
- package/es/components/Search/Search.Skeleton.js +16 -8
- package/es/components/Search/Search.d.ts +1 -1
- package/es/components/Search/Search.js +4 -4
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +7 -6
- package/es/components/Slider/Slider.js +46 -62
- package/es/components/Tabs/Tabs.js +2 -2
- package/es/components/TextArea/TextArea.js +5 -2
- package/es/components/TextInput/ControlledPasswordInput.js +2 -1
- package/es/components/TextInput/PasswordInput.d.ts +2 -2
- package/es/components/TextInput/PasswordInput.js +33 -21
- package/es/components/TextInput/TextInput.Skeleton.d.ts +10 -2
- package/es/components/TextInput/TextInput.Skeleton.js +10 -4
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +39 -30
- package/es/components/TextInput/util.d.ts +1 -0
- package/es/components/TextInput/util.js +1 -1
- package/es/components/Theme/index.d.ts +2 -2
- package/es/components/Theme/index.js +3 -3
- package/es/components/TimePicker/TimePicker.js +5 -2
- package/es/components/TreeView/TreeNode.js +2 -2
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.js +5 -3
- package/es/index.js +2 -2
- package/es/internal/FloatingMenu.d.ts +5 -1
- package/es/internal/hasHelperText.d.ts +8 -0
- package/es/internal/hasHelperText.js +11 -0
- package/es/tools/wrapComponent.d.ts +3 -3
- package/es/tools/wrapComponent.js +1 -1
- package/lib/components/Accordion/AccordionItem.d.ts +2 -2
- package/lib/components/Button/Button.js +1 -1
- package/lib/components/Checkbox/Checkbox.js +2 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +2 -1
- package/lib/components/ComboBox/ComboBox.d.ts +1 -1
- package/lib/components/ComboBox/ComboBox.js +1 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +1 -1
- package/lib/components/ContentSwitcher/ContentSwitcher.js +22 -13
- package/lib/components/DataTable/DataTable.d.ts +3 -3
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableSlugRow.d.ts +2 -2
- package/lib/components/DataTable/TableSlugRow.js +7 -10
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +5 -1
- package/lib/components/DatePicker/DatePicker.js +15 -13
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +1 -2
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/FluidTimePicker/FluidTimePicker.d.ts +1 -1
- package/lib/components/FluidTimePicker/FluidTimePicker.js +5 -3
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.d.ts +4 -0
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +2 -1
- package/lib/components/FluidTimePickerSelect/index.js +17 -0
- package/lib/components/Grid/CSSGrid.js +11 -6
- package/lib/components/Grid/Column.d.ts +2 -2
- package/lib/components/Grid/ColumnHang.d.ts +3 -3
- package/lib/components/Grid/ColumnHang.js +1 -1
- package/lib/components/Grid/FlexGrid.js +5 -3
- package/lib/components/Grid/Grid.js +2 -1
- package/lib/components/Grid/GridTypes.d.ts +5 -0
- package/lib/components/Grid/Row.d.ts +3 -3
- package/lib/components/Grid/Row.js +1 -1
- package/lib/components/Menu/Menu.js +1 -1
- package/lib/components/Menu/MenuItem.js +4 -0
- package/lib/components/Modal/Modal.js +3 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/FilterableMultiSelect.js +3 -2
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +10 -11
- package/lib/components/Pagination/Pagination.d.ts +1 -1
- package/lib/components/Pagination/Pagination.js +2 -0
- package/lib/components/Popover/index.js +14 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +7 -5
- package/lib/components/Search/Search.Skeleton.d.ts +12 -3
- package/lib/components/Search/Search.Skeleton.js +15 -7
- package/lib/components/Search/Search.d.ts +1 -1
- package/lib/components/Search/Search.js +4 -4
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/Select/Select.js +7 -6
- package/lib/components/Slider/Slider.js +46 -62
- package/lib/components/Tabs/Tabs.js +2 -2
- package/lib/components/TextArea/TextArea.js +5 -2
- package/lib/components/TextInput/ControlledPasswordInput.js +2 -1
- package/lib/components/TextInput/PasswordInput.d.ts +2 -2
- package/lib/components/TextInput/PasswordInput.js +33 -21
- package/lib/components/TextInput/TextInput.Skeleton.d.ts +10 -2
- package/lib/components/TextInput/TextInput.Skeleton.js +10 -4
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.js +39 -30
- package/lib/components/TextInput/util.d.ts +1 -0
- package/lib/components/TextInput/util.js +1 -1
- package/lib/components/Theme/index.d.ts +2 -2
- package/lib/components/Theme/index.js +2 -2
- package/lib/components/TimePicker/TimePicker.js +5 -2
- package/lib/components/TreeView/TreeNode.js +1 -1
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.js +5 -3
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.d.ts +5 -1
- package/lib/internal/hasHelperText.d.ts +8 -0
- package/lib/internal/hasHelperText.js +11 -0
- package/lib/tools/wrapComponent.d.ts +3 -3
- package/lib/tools/wrapComponent.js +1 -1
- package/package.json +5 -5
- package/telemetry.yml +1 -0
|
@@ -9,6 +9,7 @@ const require_runtime = require("../../_virtual/_rolldown/runtime.js");
|
|
|
9
9
|
const require_usePrefix = require("../../internal/usePrefix.js");
|
|
10
10
|
const require_deprecate = require("../../prop-types/deprecate.js");
|
|
11
11
|
const require_Tooltip = require("../Tooltip/Tooltip.js");
|
|
12
|
+
const require_hasHelperText = require("../../internal/hasHelperText.js");
|
|
12
13
|
const require_useNormalizedInputProps = require("../../internal/useNormalizedInputProps.js");
|
|
13
14
|
const require_FormContext = require("../FluidForm/FormContext.js");
|
|
14
15
|
const require_util = require("./util.js");
|
|
@@ -27,7 +28,7 @@ let _carbon_icons_react = require("@carbon/icons-react");
|
|
|
27
28
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
28
29
|
* LICENSE file in the root directory of this source tree.
|
|
29
30
|
*/
|
|
30
|
-
const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, helperText, hideLabel, hidePasswordLabel = "Hide password", id, inline, invalid = false, invalidText, labelText, light, onChange = () => {}, onClick = () => {}, onTogglePasswordVisibility, placeholder, readOnly, size
|
|
31
|
+
const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, helperText, hideLabel, hidePasswordLabel = "Hide password", id, inline, invalid = false, invalidText, labelText, light, onChange = () => {}, onClick = () => {}, onTogglePasswordVisibility, placeholder, readOnly, size, showPasswordLabel = "Show password", tooltipPosition = "bottom", tooltipAlignment = "end", type = "password", warn = false, warnText, ...rest }, ref) => {
|
|
31
32
|
const [inputType, setInputType] = (0, react.useState)(type);
|
|
32
33
|
const prefix = require_usePrefix.usePrefix();
|
|
33
34
|
const normalizedProps = require_useNormalizedInputProps.useNormalizedInputProps({
|
|
@@ -58,8 +59,7 @@ const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, help
|
|
|
58
59
|
[`${prefix}--text-input--light`]: light,
|
|
59
60
|
[`${prefix}--text-input--invalid`]: normalizedProps.invalid,
|
|
60
61
|
[`${prefix}--text-input--warning`]: normalizedProps.warn,
|
|
61
|
-
[`${prefix}--text-input--${size}`]: size
|
|
62
|
-
[`${prefix}--layout--size-${size}`]: size
|
|
62
|
+
[`${prefix}--text-input--${size}`]: size
|
|
63
63
|
}),
|
|
64
64
|
readOnly,
|
|
65
65
|
ref,
|
|
@@ -69,6 +69,7 @@ const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, help
|
|
|
69
69
|
[`${prefix}--text-input-wrapper--readonly`]: readOnly,
|
|
70
70
|
[`${prefix}--text-input-wrapper--light`]: light,
|
|
71
71
|
[`${prefix}--text-input-wrapper--inline`]: inline,
|
|
72
|
+
[`${prefix}--text-input-wrapper--inline--invalid`]: inline && normalizedProps.invalid,
|
|
72
73
|
[`${prefix}--text-input--fluid`]: isFluid
|
|
73
74
|
});
|
|
74
75
|
const labelClasses = (0, classnames.default)(`${prefix}--label`, {
|
|
@@ -82,7 +83,10 @@ const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, help
|
|
|
82
83
|
[`${prefix}--form__helper-text--inline`]: inline
|
|
83
84
|
});
|
|
84
85
|
const fieldOuterWrapperClasses = (0, classnames.default)(`${prefix}--text-input__field-outer-wrapper`, { [`${prefix}--text-input__field-outer-wrapper--inline`]: inline });
|
|
85
|
-
const fieldWrapperClasses = (0, classnames.default)(`${prefix}--text-input__field-wrapper`, {
|
|
86
|
+
const fieldWrapperClasses = (0, classnames.default)(`${prefix}--text-input__field-wrapper`, {
|
|
87
|
+
[`${prefix}--text-input__field-wrapper--warning`]: normalizedProps.warn,
|
|
88
|
+
[`${prefix}--layout--size-${size}`]: size
|
|
89
|
+
});
|
|
86
90
|
const iconClasses = (0, classnames.default)({
|
|
87
91
|
[`${prefix}--text-input__invalid-icon`]: normalizedProps.invalid || normalizedProps.warn,
|
|
88
92
|
[`${prefix}--text-input__invalid-icon--warning`]: normalizedProps.warn
|
|
@@ -92,7 +96,7 @@ const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, help
|
|
|
92
96
|
className: labelClasses,
|
|
93
97
|
children: labelText
|
|
94
98
|
});
|
|
95
|
-
const helper =
|
|
99
|
+
const helper = require_hasHelperText.hasHelperText(helperText) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
96
100
|
id: normalizedProps.helperId,
|
|
97
101
|
className: helperTextClasses,
|
|
98
102
|
children: helperText
|
|
@@ -121,7 +125,7 @@ const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, help
|
|
|
121
125
|
invalidId: normalizedProps.invalidId,
|
|
122
126
|
warn: normalizedProps.warn,
|
|
123
127
|
warnId: normalizedProps.warnId,
|
|
124
|
-
hasHelper:
|
|
128
|
+
hasHelper: require_hasHelperText.hasHelperText(helperText) && !isFluid && (inline || !inline && !normalizedProps.validation),
|
|
125
129
|
helperId: normalizedProps.helperId
|
|
126
130
|
}),
|
|
127
131
|
disabled,
|
|
@@ -147,21 +151,28 @@ const PasswordInput = (0, react.forwardRef)(({ className, disabled = false, help
|
|
|
147
151
|
const Icon = normalizedProps.icon;
|
|
148
152
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
149
153
|
className: inputWrapperClasses,
|
|
150
|
-
children: [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
className:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
154
|
+
children: [
|
|
155
|
+
!inline ? label : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
156
|
+
className: `${prefix}--text-input__label-helper-wrapper`,
|
|
157
|
+
children: label
|
|
158
|
+
}),
|
|
159
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
160
|
+
className: fieldOuterWrapperClasses,
|
|
161
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
162
|
+
className: fieldWrapperClasses,
|
|
163
|
+
"data-invalid": normalizedProps.invalid || null,
|
|
164
|
+
children: [
|
|
165
|
+
Icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: iconClasses }),
|
|
166
|
+
input,
|
|
167
|
+
isFluid && !inline && normalizedProps.validation
|
|
168
|
+
]
|
|
169
|
+
}), !isFluid && !inline && (normalizedProps.validation || helper)]
|
|
170
|
+
}),
|
|
171
|
+
inline && !isFluid && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
172
|
+
className: `${prefix}--text-input__label-helper-wrapper`,
|
|
173
|
+
children: normalizedProps.validation || helper
|
|
174
|
+
})
|
|
175
|
+
]
|
|
165
176
|
});
|
|
166
177
|
});
|
|
167
178
|
PasswordInput.displayName = "PasswordInput";
|
|
@@ -185,6 +196,7 @@ PasswordInput.propTypes = {
|
|
|
185
196
|
placeholder: prop_types.default.string,
|
|
186
197
|
showPasswordLabel: prop_types.default.string,
|
|
187
198
|
size: prop_types.default.oneOf([
|
|
199
|
+
"xs",
|
|
188
200
|
"sm",
|
|
189
201
|
"md",
|
|
190
202
|
"lg"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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.
|
|
@@ -15,9 +15,13 @@ export interface TextInputSkeletonProps extends React.HTMLAttributes<HTMLDivElem
|
|
|
15
15
|
* Specify whether the label should be hidden or not.
|
|
16
16
|
*/
|
|
17
17
|
hideLabel?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Specify the size of the TextInputSkeleton
|
|
20
|
+
*/
|
|
21
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
18
22
|
}
|
|
19
23
|
declare const TextInputSkeleton: {
|
|
20
|
-
({ hideLabel, className, ...rest }: TextInputSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
({ hideLabel, className, size, ...rest }: TextInputSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
21
25
|
propTypes: {
|
|
22
26
|
/**
|
|
23
27
|
* Specify an optional className to add to the form item wrapper.
|
|
@@ -27,6 +31,10 @@ declare const TextInputSkeleton: {
|
|
|
27
31
|
* Specify whether the label should be hidden, or not
|
|
28
32
|
*/
|
|
29
33
|
hideLabel: PropTypes.Requireable<boolean>;
|
|
34
|
+
/**
|
|
35
|
+
* Specify the size of the TextInputSkeleton
|
|
36
|
+
*/
|
|
37
|
+
size: PropTypes.Requireable<string>;
|
|
30
38
|
};
|
|
31
39
|
};
|
|
32
40
|
export default TextInputSkeleton;
|
|
@@ -16,22 +16,28 @@ prop_types = require_runtime.__toESM(prop_types);
|
|
|
16
16
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
17
17
|
//#region src/components/TextInput/TextInput.Skeleton.tsx
|
|
18
18
|
/**
|
|
19
|
-
* Copyright IBM Corp. 2016,
|
|
19
|
+
* Copyright IBM Corp. 2016, 2026
|
|
20
20
|
*
|
|
21
21
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
22
22
|
* LICENSE file in the root directory of this source tree.
|
|
23
23
|
*/
|
|
24
|
-
const TextInputSkeleton = ({ hideLabel, className, ...rest }) => {
|
|
24
|
+
const TextInputSkeleton = ({ hideLabel, className, size, ...rest }) => {
|
|
25
25
|
const prefix = require_usePrefix.usePrefix();
|
|
26
26
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
27
|
-
className: (0, classnames.default)(`${prefix}--form-item`, className),
|
|
27
|
+
className: (0, classnames.default)(`${prefix}--form-item`, className, { [`${prefix}--layout--size-${size}`]: size }),
|
|
28
28
|
...rest,
|
|
29
29
|
children: [!hideLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: `${prefix}--label ${prefix}--skeleton` }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: `${prefix}--skeleton ${prefix}--text-input` })]
|
|
30
30
|
});
|
|
31
31
|
};
|
|
32
32
|
TextInputSkeleton.propTypes = {
|
|
33
33
|
className: prop_types.default.string,
|
|
34
|
-
hideLabel: prop_types.default.bool
|
|
34
|
+
hideLabel: prop_types.default.bool,
|
|
35
|
+
size: prop_types.default.oneOf([
|
|
36
|
+
"xs",
|
|
37
|
+
"sm",
|
|
38
|
+
"md",
|
|
39
|
+
"lg"
|
|
40
|
+
])
|
|
35
41
|
};
|
|
36
42
|
//#endregion
|
|
37
43
|
exports.default = TextInputSkeleton;
|
|
@@ -88,7 +88,7 @@ export interface TextInputProps extends Omit<React.InputHTMLAttributes<HTMLInput
|
|
|
88
88
|
/**
|
|
89
89
|
* Specify the size of the Text Input. Currently supports the following:
|
|
90
90
|
*/
|
|
91
|
-
size?: '
|
|
91
|
+
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
92
92
|
/**
|
|
93
93
|
* @deprecated please use `decorator` instead.
|
|
94
94
|
* **Experimental**: Provide a `Slug` component to be rendered inside the `TextInput` component
|
|
@@ -11,6 +11,7 @@ const require_Text = require("../Text/Text.js");
|
|
|
11
11
|
const require_deprecate = require("../../prop-types/deprecate.js");
|
|
12
12
|
const require_utils = require("../../internal/utils.js");
|
|
13
13
|
const require_useMergedRefs = require("../../internal/useMergedRefs.js");
|
|
14
|
+
const require_hasHelperText = require("../../internal/hasHelperText.js");
|
|
14
15
|
const require_useNormalizedInputProps = require("../../internal/useNormalizedInputProps.js");
|
|
15
16
|
const require_index = require("../AILabel/index.js");
|
|
16
17
|
const require_FormContext = require("../FluidForm/FormContext.js");
|
|
@@ -79,7 +80,7 @@ const TextInput = (0, react.forwardRef)(({ className, decorator, disabled = fals
|
|
|
79
80
|
title: placeholder,
|
|
80
81
|
disabled: normalizedProps.disabled,
|
|
81
82
|
readOnly,
|
|
82
|
-
["aria-describedby"]: helperText && normalizedProps.helperId,
|
|
83
|
+
["aria-describedby"]: require_hasHelperText.hasHelperText(helperText) && !normalizedProps.invalid ? normalizedProps.helperId : void 0,
|
|
83
84
|
...rest
|
|
84
85
|
};
|
|
85
86
|
if (enableCounter) sharedTextInputProps.maxLength = maxCount;
|
|
@@ -128,7 +129,7 @@ const TextInput = (0, react.forwardRef)(({ className, decorator, disabled = fals
|
|
|
128
129
|
className: `${prefix}--text-input__label-wrapper`,
|
|
129
130
|
children: [label, counter]
|
|
130
131
|
});
|
|
131
|
-
const helper =
|
|
132
|
+
const helper = require_hasHelperText.hasHelperText(helperText) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Text.Text, {
|
|
132
133
|
as: "div",
|
|
133
134
|
id: normalizedProps.helperId,
|
|
134
135
|
className: helperTextClasses,
|
|
@@ -167,34 +168,41 @@ const TextInput = (0, react.forwardRef)(({ className, decorator, disabled = fals
|
|
|
167
168
|
const normalizedDecorator = require_utils.isComponentElement(candidate, require_index.AILabel) ? (0, react.cloneElement)(candidate, { size: "mini" }) : candidate;
|
|
168
169
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
169
170
|
className: inputWrapperClasses,
|
|
170
|
-
children: [
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
className:
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
className:
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
171
|
+
children: [
|
|
172
|
+
!inline ? labelWrapper : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
173
|
+
className: `${prefix}--text-input__label-helper-wrapper`,
|
|
174
|
+
children: labelWrapper
|
|
175
|
+
}),
|
|
176
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
177
|
+
className: fieldOuterWrapperClasses,
|
|
178
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
179
|
+
className: fieldWrapperClasses,
|
|
180
|
+
"data-invalid": normalizedProps.invalid || null,
|
|
181
|
+
children: [
|
|
182
|
+
input,
|
|
183
|
+
Icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Icon, { className: iconClasses }),
|
|
184
|
+
slug ? normalizedDecorator : decorator ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
185
|
+
className: `${prefix}--text-input__field-inner-wrapper--decorator`,
|
|
186
|
+
children: normalizedDecorator
|
|
187
|
+
}) : "",
|
|
188
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
189
|
+
className: `${prefix}--text-input__counter-alert`,
|
|
190
|
+
role: "alert",
|
|
191
|
+
"aria-live": "assertive",
|
|
192
|
+
"aria-atomic": "true",
|
|
193
|
+
ref: announcerRef,
|
|
194
|
+
children: ariaAnnouncement
|
|
195
|
+
}),
|
|
196
|
+
isFluid && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("hr", { className: `${prefix}--text-input__divider` }),
|
|
197
|
+
isFluid && !inline && normalizedProps.validation
|
|
198
|
+
]
|
|
199
|
+
}), !isFluid && !inline && (normalizedProps.validation || helper)]
|
|
200
|
+
}),
|
|
201
|
+
inline && !isFluid && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
202
|
+
className: `${prefix}--text-input__label-helper-wrapper`,
|
|
203
|
+
children: normalizedProps.validation || helper
|
|
204
|
+
})
|
|
205
|
+
]
|
|
198
206
|
});
|
|
199
207
|
});
|
|
200
208
|
TextInput.displayName = "TextInput";
|
|
@@ -218,6 +226,7 @@ TextInput.propTypes = {
|
|
|
218
226
|
placeholder: prop_types.default.string,
|
|
219
227
|
readOnly: prop_types.default.bool,
|
|
220
228
|
size: prop_types.default.oneOf([
|
|
229
|
+
"xs",
|
|
221
230
|
"sm",
|
|
222
231
|
"md",
|
|
223
232
|
"lg"
|
|
@@ -17,5 +17,6 @@ export declare const getTextInputProps: ({ sharedTextInputProps, invalid, invali
|
|
|
17
17
|
'aria-describedby'?: string | undefined;
|
|
18
18
|
'data-invalid'?: boolean | undefined;
|
|
19
19
|
'aria-invalid'?: boolean | undefined;
|
|
20
|
+
'aria-errormessage'?: string | undefined;
|
|
20
21
|
};
|
|
21
22
|
export {};
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
const invalidProps = (invalidId) => ({
|
|
16
16
|
"data-invalid": true,
|
|
17
17
|
"aria-invalid": true,
|
|
18
|
-
"aria-
|
|
18
|
+
"aria-errormessage": invalidId
|
|
19
19
|
});
|
|
20
20
|
const warnProps = (warnId) => ({ "aria-describedby": warnId });
|
|
21
21
|
const helperProps = (helperId) => ({ "aria-describedby": helperId });
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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 PropTypes from 'prop-types';
|
|
8
|
-
import React, { ElementType } from 'react';
|
|
8
|
+
import React, { type ElementType } from 'react';
|
|
9
9
|
import { PolymorphicProps } from '../../types/common';
|
|
10
10
|
export interface GlobalThemeProps {
|
|
11
11
|
theme?: 'white' | 'g10' | 'g90' | 'g100';
|
|
@@ -18,7 +18,7 @@ prop_types = require_runtime.__toESM(prop_types);
|
|
|
18
18
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
19
19
|
//#region src/components/Theme/index.tsx
|
|
20
20
|
/**
|
|
21
|
-
* Copyright IBM Corp. 2016,
|
|
21
|
+
* Copyright IBM Corp. 2016, 2026
|
|
22
22
|
*
|
|
23
23
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -28,7 +28,7 @@ const GlobalTheme = react.default.forwardRef(({ children, theme }, ref) => {
|
|
|
28
28
|
const value = (0, react.useMemo)(() => {
|
|
29
29
|
return { theme };
|
|
30
30
|
}, [theme]);
|
|
31
|
-
const childrenWithProps = react.
|
|
31
|
+
const childrenWithProps = (0, react.isValidElement)(children) ? (0, react.cloneElement)(children, { ref }) : children;
|
|
32
32
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
|
|
33
33
|
value,
|
|
34
34
|
children: childrenWithProps
|
|
@@ -24,7 +24,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
24
24
|
* LICENSE file in the root directory of this source tree.
|
|
25
25
|
*/
|
|
26
26
|
const TimePicker = (0, react.forwardRef)((props, ref) => {
|
|
27
|
-
const { children, className, inputClassName, pickerClassName, disabled = false, hideLabel, id, invalidText = "Error message goes here", invalid = false, warningText = "Warning message goes here", warning = false, labelText, light = false, maxLength = 5, onChange = () => {}, onClick = () => {}, onBlur = () => {}, pattern = "(1[012]|[1-9]):[0-5][0-9](\\s)?", placeholder = "hh:mm", readOnly, size = "md", type = "text", value, ...rest } = props;
|
|
27
|
+
const { ["aria-describedby"]: ariaDescribedBy, children, className, inputClassName, pickerClassName, disabled = false, hideLabel, id, invalidText = "Error message goes here", invalid = false, warningText = "Warning message goes here", warning = false, labelText, light = false, maxLength = 5, onChange = () => {}, onClick = () => {}, onBlur = () => {}, pattern = "(1[012]|[1-9]):[0-5][0-9](\\s)?", placeholder = "hh:mm", readOnly, size = "md", type = "text", value, ...rest } = props;
|
|
28
28
|
const prefix = require_usePrefix.usePrefix();
|
|
29
29
|
function handleOnClick(evt) {
|
|
30
30
|
if (!disabled) onClick(evt);
|
|
@@ -93,6 +93,7 @@ const TimePicker = (0, react.forwardRef)((props, ref) => {
|
|
|
93
93
|
});
|
|
94
94
|
}
|
|
95
95
|
const readOnlyProps = { readOnly };
|
|
96
|
+
const describedBy = [normalizedProps.invalid ? normalizedProps.invalidId : normalizedProps.warn ? normalizedProps.warnId : null, ariaDescribedBy].filter(Boolean).join(" ") || void 0;
|
|
96
97
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
97
98
|
className: (0, classnames.default)(`${prefix}--form-item`, className),
|
|
98
99
|
children: [
|
|
@@ -116,7 +117,9 @@ const TimePicker = (0, react.forwardRef)((props, ref) => {
|
|
|
116
117
|
type,
|
|
117
118
|
value,
|
|
118
119
|
...rest,
|
|
119
|
-
...readOnlyProps
|
|
120
|
+
...readOnlyProps,
|
|
121
|
+
"aria-describedby": describedBy,
|
|
122
|
+
"aria-invalid": normalizedProps.invalid ? true : void 0
|
|
120
123
|
}), (normalizedProps.invalid || normalizedProps.warn) && normalizedProps.icon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
121
124
|
className: `${prefix}--time-picker__error__icon`,
|
|
122
125
|
children: react.default.createElement(normalizedProps.icon, {
|
|
@@ -36,7 +36,7 @@ const extractTextContent = (node) => {
|
|
|
36
36
|
if (typeof node === "number") return String(node);
|
|
37
37
|
if (typeof node === "boolean") return String(node);
|
|
38
38
|
if (Array.isArray(node)) return node.map(extractTextContent).join("");
|
|
39
|
-
if (react.
|
|
39
|
+
if ((0, react.isValidElement)(node)) {
|
|
40
40
|
const children = node.props.children;
|
|
41
41
|
return extractTextContent(children);
|
|
42
42
|
}
|
|
@@ -7,5 +7,5 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Generic container for `HeaderGlobalAction` components
|
|
9
9
|
*/
|
|
10
|
-
declare const HeaderGlobalBar: (props: import("react").HTMLAttributes<"div">) =>
|
|
10
|
+
declare const HeaderGlobalBar: (props: import("react").HTMLAttributes<"div">) => import("react").ReactElement;
|
|
11
11
|
export default HeaderGlobalBar;
|
|
@@ -10,9 +10,11 @@ const require_usePrefix = require("../../internal/usePrefix.js");
|
|
|
10
10
|
const require_keys = require("../../internal/keyboard/keys.js");
|
|
11
11
|
const require_match = require("../../internal/keyboard/match.js");
|
|
12
12
|
const require_deprecate = require("../../prop-types/deprecate.js");
|
|
13
|
+
const require_utils = require("../../internal/utils.js");
|
|
13
14
|
const require_useMergedRefs = require("../../internal/useMergedRefs.js");
|
|
14
15
|
const require_events = require("../../tools/events.js");
|
|
15
16
|
const require_AriaPropTypes = require("../../prop-types/AriaPropTypes.js");
|
|
17
|
+
const require_HeaderMenuItem = require("./HeaderMenuItem.js");
|
|
16
18
|
let classnames = require("classnames");
|
|
17
19
|
classnames = require_runtime.__toESM(classnames);
|
|
18
20
|
let react = require("react");
|
|
@@ -23,7 +25,7 @@ let react_jsx_runtime = require("react/jsx-runtime");
|
|
|
23
25
|
let _carbon_icons_react = require("@carbon/icons-react");
|
|
24
26
|
//#region src/components/UIShell/HeaderMenu.tsx
|
|
25
27
|
/**
|
|
26
|
-
* Copyright IBM Corp. 2016,
|
|
28
|
+
* Copyright IBM Corp. 2016, 2026
|
|
27
29
|
*
|
|
28
30
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
29
31
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -85,7 +87,7 @@ const HeaderMenu = frFn((props, ref) => {
|
|
|
85
87
|
}
|
|
86
88
|
};
|
|
87
89
|
const hasActiveDescendant = (childrenArg) => react.Children.toArray(childrenArg).some((child) => {
|
|
88
|
-
if (!(
|
|
90
|
+
if (!require_utils.isComponentElement(child, require_HeaderMenuItem.default)) return false;
|
|
89
91
|
const { isActive, isCurrentPage, children } = child.props;
|
|
90
92
|
return isActive || isCurrentPage || Array.isArray(children) && hasActiveDescendant(children);
|
|
91
93
|
});
|
|
@@ -96,7 +98,7 @@ const HeaderMenu = frFn((props, ref) => {
|
|
|
96
98
|
* sequence when they might not want to go through all the items.
|
|
97
99
|
*/
|
|
98
100
|
const renderMenuItem = (item, index) => {
|
|
99
|
-
if ((
|
|
101
|
+
if (require_utils.isComponentElement(item, require_HeaderMenuItem.default)) return (0, react.cloneElement)(item, { ref: handleItemRef(index) });
|
|
100
102
|
return item;
|
|
101
103
|
};
|
|
102
104
|
const accessibilityLabel = {
|
package/lib/index.js
CHANGED
|
@@ -182,9 +182,9 @@ const require_Header = require("./components/UIShell/Header.js");
|
|
|
182
182
|
const require_HeaderContainer = require("./components/UIShell/HeaderContainer.js");
|
|
183
183
|
const require_HeaderGlobalAction = require("./components/UIShell/HeaderGlobalAction.js");
|
|
184
184
|
const require_HeaderGlobalBar = require("./components/UIShell/HeaderGlobalBar.js");
|
|
185
|
+
const require_HeaderMenuItem = require("./components/UIShell/HeaderMenuItem.js");
|
|
185
186
|
const require_HeaderMenu = require("./components/UIShell/HeaderMenu.js");
|
|
186
187
|
const require_HeaderMenuButton = require("./components/UIShell/HeaderMenuButton.js");
|
|
187
|
-
const require_HeaderMenuItem = require("./components/UIShell/HeaderMenuItem.js");
|
|
188
188
|
const require_HeaderName = require("./components/UIShell/HeaderName.js");
|
|
189
189
|
const require_HeaderNavigation = require("./components/UIShell/HeaderNavigation.js");
|
|
190
190
|
const require_SwitcherItem = require("./components/UIShell/SwitcherItem.js");
|
|
@@ -227,9 +227,9 @@ const require_FluidPasswordInput = require("./components/FluidTextInput/FluidPas
|
|
|
227
227
|
const require_FluidTextInput_Skeleton = require("./components/FluidTextInput/FluidTextInput.Skeleton.js");
|
|
228
228
|
const require_FluidNumberInput = require("./components/FluidNumberInput/FluidNumberInput.js");
|
|
229
229
|
const require_FluidNumberInput_Skeleton = require("./components/FluidNumberInput/FluidNumberInput.Skeleton.js");
|
|
230
|
+
const require_FluidTimePickerSelect = require("./components/FluidTimePickerSelect/FluidTimePickerSelect.js");
|
|
230
231
|
const require_FluidTimePicker = require("./components/FluidTimePicker/FluidTimePicker.js");
|
|
231
232
|
const require_FluidTimePicker_Skeleton = require("./components/FluidTimePicker/FluidTimePicker.Skeleton.js");
|
|
232
|
-
const require_FluidTimePickerSelect = require("./components/FluidTimePickerSelect/FluidTimePickerSelect.js");
|
|
233
233
|
const require_index$16 = require("./components/OverflowMenuV2/index.js");
|
|
234
234
|
const require_Pagination$1 = require("./components/Pagination/experimental/Pagination.js");
|
|
235
235
|
const require_PageSelector = require("./components/Pagination/experimental/PageSelector.js");
|
|
@@ -17,13 +17,17 @@ interface Container {
|
|
|
17
17
|
rect: DOMRect;
|
|
18
18
|
position: string;
|
|
19
19
|
}
|
|
20
|
+
type FloatingMenuChildProps = {
|
|
21
|
+
ref?: (node: HTMLElement | null) => void;
|
|
22
|
+
style?: CSSProperties;
|
|
23
|
+
};
|
|
20
24
|
export type MenuDirection = typeof DIRECTION_LEFT | typeof DIRECTION_TOP | typeof DIRECTION_RIGHT | typeof DIRECTION_BOTTOM;
|
|
21
25
|
export type MenuOffset = Offset | ((menuBody: HTMLElement, menuDirection: MenuDirection, triggerEl?: HTMLElement | null, flipped?: boolean) => Offset);
|
|
22
26
|
interface FloatingMenuProps {
|
|
23
27
|
/**
|
|
24
28
|
* Contents of the floating menu.
|
|
25
29
|
*/
|
|
26
|
-
children: ReactElement
|
|
30
|
+
children: ReactElement<FloatingMenuChildProps>;
|
|
27
31
|
/**
|
|
28
32
|
* Whether the menu alignment should be flipped.
|
|
29
33
|
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2026
|
|
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 { ReactNode } from 'react';
|
|
8
|
+
export declare const hasHelperText: (helperText: ReactNode) => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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
|
+
|
|
8
|
+
//#region src/internal/hasHelperText.ts
|
|
9
|
+
const hasHelperText = (helperText) => typeof helperText !== "undefined" && helperText !== null && helperText !== "";
|
|
10
|
+
//#endregion
|
|
11
|
+
exports.hasHelperText = hasHelperText;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
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
|
|
7
|
+
import { type HTMLAttributes, type ReactElement } from 'react';
|
|
8
8
|
type HTMLTagName = keyof HTMLElementTagNameMap;
|
|
9
9
|
type WrapComponentArgs<T extends HTMLTagName> = {
|
|
10
10
|
name: string;
|
|
@@ -15,5 +15,5 @@ type WrapComponentArgs<T extends HTMLTagName> = {
|
|
|
15
15
|
* @param {{ name: string, type: string, className?: string | (prefix: string) => string }} props
|
|
16
16
|
* @returns
|
|
17
17
|
*/
|
|
18
|
-
declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props: HTMLAttributes<T>) =>
|
|
18
|
+
declare const wrapComponent: <T extends HTMLTagName>({ name, className: getClassName, type, }: WrapComponentArgs<T>) => ((props: HTMLAttributes<T>) => ReactElement);
|
|
19
19
|
export default wrapComponent;
|
|
@@ -15,7 +15,7 @@ let prop_types = require("prop-types");
|
|
|
15
15
|
prop_types = require_runtime.__toESM(prop_types);
|
|
16
16
|
//#region src/tools/wrapComponent.ts
|
|
17
17
|
/**
|
|
18
|
-
* Copyright IBM Corp. 2016,
|
|
18
|
+
* Copyright IBM Corp. 2016, 2026
|
|
19
19
|
*
|
|
20
20
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
21
21
|
* LICENSE file in the root directory of this source tree.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.107.0-rc.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@babel/runtime": "^7.27.3",
|
|
55
55
|
"@carbon/feature-flags": "^1.3.0",
|
|
56
|
-
"@carbon/icons-react": "^11.
|
|
56
|
+
"@carbon/icons-react": "^11.80.0-rc.0",
|
|
57
57
|
"@carbon/layout": "^11.52.0",
|
|
58
|
-
"@carbon/styles": "^1.
|
|
58
|
+
"@carbon/styles": "^1.106.0-rc.0",
|
|
59
59
|
"@carbon/utilities": "^0.19.0",
|
|
60
60
|
"@floating-ui/react": "^0.27.4",
|
|
61
61
|
"@ibm/telemetry-js": "^1.5.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@babel/preset-react": "^7.27.1",
|
|
80
80
|
"@babel/preset-typescript": "^7.27.1",
|
|
81
81
|
"@carbon/test-utils": "^10.41.0",
|
|
82
|
-
"@carbon/themes": "^11.
|
|
82
|
+
"@carbon/themes": "^11.73.0-rc.0",
|
|
83
83
|
"@figma/code-connect": "^1.4.2",
|
|
84
84
|
"@stackblitz/sdk": "^1.11.0",
|
|
85
85
|
"@storybook/addon-a11y": "^9.1.8",
|
|
@@ -125,5 +125,5 @@
|
|
|
125
125
|
"**/*.scss",
|
|
126
126
|
"**/*.css"
|
|
127
127
|
],
|
|
128
|
-
"gitHead": "
|
|
128
|
+
"gitHead": "32de263c201d0424d86bc47d97d1c085abecb24e"
|
|
129
129
|
}
|