@carbon/react 1.106.0-rc.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 +1006 -971
- 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/DatePickerInput/DatePickerInput.js +9 -2
- 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/DatePickerInput/DatePickerInput.js +9 -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 +8 -8
- package/telemetry.yml +1 -0
|
@@ -10,6 +10,7 @@ import { Text } from "../Text/Text.js";
|
|
|
10
10
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
11
11
|
import { isComponentElement } from "../../internal/utils.js";
|
|
12
12
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
13
|
+
import { hasHelperText } from "../../internal/hasHelperText.js";
|
|
13
14
|
import { useNormalizedInputProps } from "../../internal/useNormalizedInputProps.js";
|
|
14
15
|
import { AILabel } from "../AILabel/index.js";
|
|
15
16
|
import { FormContext } from "../FluidForm/FormContext.js";
|
|
@@ -75,7 +76,7 @@ const TextInput = forwardRef(({ className, decorator, disabled = false, helperTe
|
|
|
75
76
|
title: placeholder,
|
|
76
77
|
disabled: normalizedProps.disabled,
|
|
77
78
|
readOnly,
|
|
78
|
-
["aria-describedby"]: helperText && normalizedProps.helperId,
|
|
79
|
+
["aria-describedby"]: hasHelperText(helperText) && !normalizedProps.invalid ? normalizedProps.helperId : void 0,
|
|
79
80
|
...rest
|
|
80
81
|
};
|
|
81
82
|
if (enableCounter) sharedTextInputProps.maxLength = maxCount;
|
|
@@ -124,7 +125,7 @@ const TextInput = forwardRef(({ className, decorator, disabled = false, helperTe
|
|
|
124
125
|
className: `${prefix}--text-input__label-wrapper`,
|
|
125
126
|
children: [label, counter]
|
|
126
127
|
});
|
|
127
|
-
const helper =
|
|
128
|
+
const helper = hasHelperText(helperText) && /* @__PURE__ */ jsx(Text, {
|
|
128
129
|
as: "div",
|
|
129
130
|
id: normalizedProps.helperId,
|
|
130
131
|
className: helperTextClasses,
|
|
@@ -163,34 +164,41 @@ const TextInput = forwardRef(({ className, decorator, disabled = false, helperTe
|
|
|
163
164
|
const normalizedDecorator = isComponentElement(candidate, AILabel) ? cloneElement(candidate, { size: "mini" }) : candidate;
|
|
164
165
|
return /* @__PURE__ */ jsxs("div", {
|
|
165
166
|
className: inputWrapperClasses,
|
|
166
|
-
children: [
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
className:
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
className:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
167
|
+
children: [
|
|
168
|
+
!inline ? labelWrapper : /* @__PURE__ */ jsx("div", {
|
|
169
|
+
className: `${prefix}--text-input__label-helper-wrapper`,
|
|
170
|
+
children: labelWrapper
|
|
171
|
+
}),
|
|
172
|
+
/* @__PURE__ */ jsxs("div", {
|
|
173
|
+
className: fieldOuterWrapperClasses,
|
|
174
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
175
|
+
className: fieldWrapperClasses,
|
|
176
|
+
"data-invalid": normalizedProps.invalid || null,
|
|
177
|
+
children: [
|
|
178
|
+
input,
|
|
179
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: iconClasses }),
|
|
180
|
+
slug ? normalizedDecorator : decorator ? /* @__PURE__ */ jsx("div", {
|
|
181
|
+
className: `${prefix}--text-input__field-inner-wrapper--decorator`,
|
|
182
|
+
children: normalizedDecorator
|
|
183
|
+
}) : "",
|
|
184
|
+
/* @__PURE__ */ jsx("span", {
|
|
185
|
+
className: `${prefix}--text-input__counter-alert`,
|
|
186
|
+
role: "alert",
|
|
187
|
+
"aria-live": "assertive",
|
|
188
|
+
"aria-atomic": "true",
|
|
189
|
+
ref: announcerRef,
|
|
190
|
+
children: ariaAnnouncement
|
|
191
|
+
}),
|
|
192
|
+
isFluid && /* @__PURE__ */ jsx("hr", { className: `${prefix}--text-input__divider` }),
|
|
193
|
+
isFluid && !inline && normalizedProps.validation
|
|
194
|
+
]
|
|
195
|
+
}), !isFluid && !inline && (normalizedProps.validation || helper)]
|
|
196
|
+
}),
|
|
197
|
+
inline && !isFluid && /* @__PURE__ */ jsx("div", {
|
|
198
|
+
className: `${prefix}--text-input__label-helper-wrapper`,
|
|
199
|
+
children: normalizedProps.validation || helper
|
|
200
|
+
})
|
|
201
|
+
]
|
|
194
202
|
});
|
|
195
203
|
});
|
|
196
204
|
TextInput.displayName = "TextInput";
|
|
@@ -214,6 +222,7 @@ TextInput.propTypes = {
|
|
|
214
222
|
placeholder: PropTypes.string,
|
|
215
223
|
readOnly: PropTypes.bool,
|
|
216
224
|
size: PropTypes.oneOf([
|
|
225
|
+
"xs",
|
|
217
226
|
"sm",
|
|
218
227
|
"md",
|
|
219
228
|
"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';
|
|
@@ -9,12 +9,12 @@ import { usePrefix } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { LayerContext } from "../Layer/LayerContext.js";
|
|
10
10
|
import { useMatchMedia } from "../../internal/useMatchMedia.js";
|
|
11
11
|
import classNames from "classnames";
|
|
12
|
-
import React, { useMemo } from "react";
|
|
12
|
+
import React, { cloneElement, isValidElement, useMemo } from "react";
|
|
13
13
|
import PropTypes from "prop-types";
|
|
14
14
|
import { jsx } from "react/jsx-runtime";
|
|
15
15
|
//#region src/components/Theme/index.tsx
|
|
16
16
|
/**
|
|
17
|
-
* Copyright IBM Corp. 2016,
|
|
17
|
+
* Copyright IBM Corp. 2016, 2026
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -24,7 +24,7 @@ const GlobalTheme = React.forwardRef(({ children, theme }, ref) => {
|
|
|
24
24
|
const value = useMemo(() => {
|
|
25
25
|
return { theme };
|
|
26
26
|
}, [theme]);
|
|
27
|
-
const childrenWithProps =
|
|
27
|
+
const childrenWithProps = isValidElement(children) ? cloneElement(children, { ref }) : children;
|
|
28
28
|
return /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
29
29
|
value,
|
|
30
30
|
children: childrenWithProps
|
|
@@ -20,7 +20,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
20
20
|
* LICENSE file in the root directory of this source tree.
|
|
21
21
|
*/
|
|
22
22
|
const TimePicker = forwardRef((props, ref) => {
|
|
23
|
-
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;
|
|
23
|
+
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;
|
|
24
24
|
const prefix = usePrefix();
|
|
25
25
|
function handleOnClick(evt) {
|
|
26
26
|
if (!disabled) onClick(evt);
|
|
@@ -89,6 +89,7 @@ const TimePicker = forwardRef((props, ref) => {
|
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
const readOnlyProps = { readOnly };
|
|
92
|
+
const describedBy = [normalizedProps.invalid ? normalizedProps.invalidId : normalizedProps.warn ? normalizedProps.warnId : null, ariaDescribedBy].filter(Boolean).join(" ") || void 0;
|
|
92
93
|
return /* @__PURE__ */ jsxs("div", {
|
|
93
94
|
className: classNames(`${prefix}--form-item`, className),
|
|
94
95
|
children: [
|
|
@@ -112,7 +113,9 @@ const TimePicker = forwardRef((props, ref) => {
|
|
|
112
113
|
type,
|
|
113
114
|
value,
|
|
114
115
|
...rest,
|
|
115
|
-
...readOnlyProps
|
|
116
|
+
...readOnlyProps,
|
|
117
|
+
"aria-describedby": describedBy,
|
|
118
|
+
"aria-invalid": normalizedProps.invalid ? true : void 0
|
|
116
119
|
}), (normalizedProps.invalid || normalizedProps.warn) && normalizedProps.icon && /* @__PURE__ */ jsx("div", {
|
|
117
120
|
className: `${prefix}--time-picker__error__icon`,
|
|
118
121
|
children: React.createElement(normalizedProps.icon, {
|
|
@@ -15,7 +15,7 @@ import { IconButton } from "../IconButton/index.js";
|
|
|
15
15
|
import { useControllableState } from "../../internal/useControllableState.js";
|
|
16
16
|
import { DepthContext, TreeContext } from "./TreeContext.js";
|
|
17
17
|
import classNames from "classnames";
|
|
18
|
-
import React, { useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
18
|
+
import React, { isValidElement, useCallback, useContext, useEffect, useRef, useState } from "react";
|
|
19
19
|
import PropTypes from "prop-types";
|
|
20
20
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
21
21
|
import { CaretDown } from "@carbon/icons-react";
|
|
@@ -32,7 +32,7 @@ const extractTextContent = (node) => {
|
|
|
32
32
|
if (typeof node === "number") return String(node);
|
|
33
33
|
if (typeof node === "boolean") return String(node);
|
|
34
34
|
if (Array.isArray(node)) return node.map(extractTextContent).join("");
|
|
35
|
-
if (
|
|
35
|
+
if (isValidElement(node)) {
|
|
36
36
|
const children = node.props.children;
|
|
37
37
|
return extractTextContent(children);
|
|
38
38
|
}
|
|
@@ -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;
|
|
@@ -9,11 +9,13 @@ import { PrefixContext } from "../../internal/usePrefix.js";
|
|
|
9
9
|
import { Enter, Escape, Space } from "../../internal/keyboard/keys.js";
|
|
10
10
|
import { matches } from "../../internal/keyboard/match.js";
|
|
11
11
|
import { deprecate } from "../../prop-types/deprecate.js";
|
|
12
|
+
import { isComponentElement } from "../../internal/utils.js";
|
|
12
13
|
import { useMergedRefs } from "../../internal/useMergedRefs.js";
|
|
13
14
|
import { composeEventHandlers } from "../../tools/events.js";
|
|
14
15
|
import { AriaLabelPropType } from "../../prop-types/AriaPropTypes.js";
|
|
16
|
+
import HeaderMenuItem from "./HeaderMenuItem.js";
|
|
15
17
|
import classNames from "classnames";
|
|
16
|
-
import { Children, cloneElement, forwardRef,
|
|
18
|
+
import { Children, cloneElement, forwardRef, useContext, useRef, useState } from "react";
|
|
17
19
|
import PropTypes from "prop-types";
|
|
18
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
19
21
|
import { ChevronDown } from "@carbon/icons-react";
|
|
@@ -73,7 +75,7 @@ const HeaderMenu = forwardRef((props, ref) => {
|
|
|
73
75
|
}
|
|
74
76
|
};
|
|
75
77
|
const hasActiveDescendant = (childrenArg) => Children.toArray(childrenArg).some((child) => {
|
|
76
|
-
if (!
|
|
78
|
+
if (!isComponentElement(child, HeaderMenuItem)) return false;
|
|
77
79
|
const { isActive, isCurrentPage, children } = child.props;
|
|
78
80
|
return isActive || isCurrentPage || Array.isArray(children) && hasActiveDescendant(children);
|
|
79
81
|
});
|
|
@@ -84,7 +86,7 @@ const HeaderMenu = forwardRef((props, ref) => {
|
|
|
84
86
|
* sequence when they might not want to go through all the items.
|
|
85
87
|
*/
|
|
86
88
|
const renderMenuItem = (item, index) => {
|
|
87
|
-
if (
|
|
89
|
+
if (isComponentElement(item, HeaderMenuItem)) return cloneElement(item, { ref: handleItemRef(index) });
|
|
88
90
|
return item;
|
|
89
91
|
};
|
|
90
92
|
const accessibilityLabel = {
|
package/es/index.js
CHANGED
|
@@ -181,9 +181,9 @@ import Header from "./components/UIShell/Header.js";
|
|
|
181
181
|
import HeaderContainer from "./components/UIShell/HeaderContainer.js";
|
|
182
182
|
import HeaderGlobalAction from "./components/UIShell/HeaderGlobalAction.js";
|
|
183
183
|
import HeaderGlobalBar from "./components/UIShell/HeaderGlobalBar.js";
|
|
184
|
+
import HeaderMenuItem from "./components/UIShell/HeaderMenuItem.js";
|
|
184
185
|
import HeaderMenu from "./components/UIShell/HeaderMenu.js";
|
|
185
186
|
import HeaderMenuButton from "./components/UIShell/HeaderMenuButton.js";
|
|
186
|
-
import HeaderMenuItem from "./components/UIShell/HeaderMenuItem.js";
|
|
187
187
|
import HeaderName from "./components/UIShell/HeaderName.js";
|
|
188
188
|
import HeaderNavigation from "./components/UIShell/HeaderNavigation.js";
|
|
189
189
|
import SwitcherItem from "./components/UIShell/SwitcherItem.js";
|
|
@@ -226,9 +226,9 @@ import FluidPasswordInput from "./components/FluidTextInput/FluidPasswordInput.j
|
|
|
226
226
|
import FluidTextInputSkeleton from "./components/FluidTextInput/FluidTextInput.Skeleton.js";
|
|
227
227
|
import FluidNumberInput from "./components/FluidNumberInput/FluidNumberInput.js";
|
|
228
228
|
import FluidNumberInputSkeleton from "./components/FluidNumberInput/FluidNumberInput.Skeleton.js";
|
|
229
|
+
import FluidTimePickerSelect from "./components/FluidTimePickerSelect/FluidTimePickerSelect.js";
|
|
229
230
|
import FluidTimePicker from "./components/FluidTimePicker/FluidTimePicker.js";
|
|
230
231
|
import FluidTimePickerSkeleton from "./components/FluidTimePicker/FluidTimePicker.Skeleton.js";
|
|
231
|
-
import FluidTimePickerSelect from "./components/FluidTimePickerSelect/FluidTimePickerSelect.js";
|
|
232
232
|
import { OverflowMenuV2 } from "./components/OverflowMenuV2/index.js";
|
|
233
233
|
import Pagination$1 from "./components/Pagination/experimental/Pagination.js";
|
|
234
234
|
import PageSelector from "./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
|
+
export { 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;
|
|
@@ -11,7 +11,7 @@ import React from "react";
|
|
|
11
11
|
import PropTypes from "prop-types";
|
|
12
12
|
//#region src/tools/wrapComponent.ts
|
|
13
13
|
/**
|
|
14
|
-
* Copyright IBM Corp. 2016,
|
|
14
|
+
* Copyright IBM Corp. 2016, 2026
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -38,12 +38,12 @@ export interface AccordionItemProps {
|
|
|
38
38
|
* removed in the next major release of Carbon. Use the
|
|
39
39
|
* `renderToggle` prop instead.
|
|
40
40
|
*/
|
|
41
|
-
renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement
|
|
41
|
+
renderExpando?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement;
|
|
42
42
|
/**
|
|
43
43
|
* The callback function to render the expand button.
|
|
44
44
|
* Can be a React component class.
|
|
45
45
|
*/
|
|
46
|
-
renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement
|
|
46
|
+
renderToggle?: (props: PropsWithChildren<AccordionToggleProps>) => ReactElement;
|
|
47
47
|
/**
|
|
48
48
|
* The accordion title.
|
|
49
49
|
*/
|
|
@@ -12,6 +12,7 @@ const require_useId = require("../../internal/useId.js");
|
|
|
12
12
|
const require_noopFn = require("../../internal/noopFn.js");
|
|
13
13
|
const require_deprecate = require("../../prop-types/deprecate.js");
|
|
14
14
|
const require_utils = require("../../internal/utils.js");
|
|
15
|
+
const require_hasHelperText = require("../../internal/hasHelperText.js");
|
|
15
16
|
const require_useNormalizedInputProps = require("../../internal/useNormalizedInputProps.js");
|
|
16
17
|
const require_index = require("../AILabel/index.js");
|
|
17
18
|
let classnames = require("classnames");
|
|
@@ -43,7 +44,7 @@ const Checkbox = react.default.forwardRef(({ className, decorator, helperText, i
|
|
|
43
44
|
const showWarning = normalizedProps.warn;
|
|
44
45
|
const showHelper = !normalizedProps.invalid && !normalizedProps.warn;
|
|
45
46
|
const checkboxGroupInstanceId = require_useId.useId();
|
|
46
|
-
const hasHelper =
|
|
47
|
+
const hasHelper = require_hasHelperText.hasHelperText(helperText);
|
|
47
48
|
const helperId = !hasHelper ? void 0 : `checkbox-helper-text-${checkboxGroupInstanceId}`;
|
|
48
49
|
const helper = hasHelper && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
49
50
|
id: helperId,
|
|
@@ -10,6 +10,7 @@ const require_usePrefix = require("../../internal/usePrefix.js");
|
|
|
10
10
|
const require_useId = require("../../internal/useId.js");
|
|
11
11
|
const require_deprecate = require("../../prop-types/deprecate.js");
|
|
12
12
|
const require_utils = require("../../internal/utils.js");
|
|
13
|
+
const require_hasHelperText = require("../../internal/hasHelperText.js");
|
|
13
14
|
const require_useNormalizedInputProps = require("../../internal/useNormalizedInputProps.js");
|
|
14
15
|
const require_index = require("../AILabel/index.js");
|
|
15
16
|
const require_Checkbox = require("../Checkbox/Checkbox.js");
|
|
@@ -42,7 +43,7 @@ const CheckboxGroup = ({ children, className, decorator, helperText, invalid, in
|
|
|
42
43
|
});
|
|
43
44
|
const showWarning = normalizedProps.warn;
|
|
44
45
|
const showHelper = !normalizedProps.invalid && !normalizedProps.warn;
|
|
45
|
-
const hasHelper =
|
|
46
|
+
const hasHelper = require_hasHelperText.hasHelperText(helperText);
|
|
46
47
|
const helperId = !hasHelper ? void 0 : `checkbox-group-helper-text-${checkboxGroupInstanceId}`;
|
|
47
48
|
const helper = hasHelper && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
48
49
|
id: helperId,
|
|
@@ -197,7 +197,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
197
197
|
}
|
|
198
198
|
type ComboboxComponentProps<ItemType> = PropsWithChildren<ComboBoxProps<ItemType>> & RefAttributes<HTMLInputElement>;
|
|
199
199
|
export interface ComboBoxComponent {
|
|
200
|
-
<ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement
|
|
200
|
+
<ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement | null;
|
|
201
201
|
}
|
|
202
202
|
declare const _default: ComboBoxComponent;
|
|
203
203
|
export default _default;
|
|
@@ -356,7 +356,7 @@ const ComboBox = (0, react.forwardRef)((props, ref) => {
|
|
|
356
356
|
selectedItem: newSelectedItem
|
|
357
357
|
});
|
|
358
358
|
if (isManualClearingRef.current) return;
|
|
359
|
-
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== "undefined" && !(0, react_fast_compare.default)(
|
|
359
|
+
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter || !allowCustomValue && type === InputBlur) && typeof newSelectedItem !== "undefined" && !(0, react_fast_compare.default)(currentSelectedItem, newSelectedItem)) {
|
|
360
360
|
if (items.some((item) => (0, react_fast_compare.default)(item, newSelectedItem))) committedCustomValueRef.current = "";
|
|
361
361
|
onChange({ selectedItem: newSelectedItem });
|
|
362
362
|
}
|
|
@@ -11,7 +11,7 @@ export interface ContentSwitcherProps extends Omit<HTMLAttributes<HTMLElement>,
|
|
|
11
11
|
/**
|
|
12
12
|
* Pass in Switch components to be rendered in the ContentSwitcher
|
|
13
13
|
*/
|
|
14
|
-
children?: ReactElement
|
|
14
|
+
children?: ReactElement | ReactElement[];
|
|
15
15
|
/**
|
|
16
16
|
* Specify an optional className to be added to the container node
|
|
17
17
|
*/
|
|
@@ -12,8 +12,8 @@ const require_match = require("../../internal/keyboard/match.js");
|
|
|
12
12
|
const require_navigation = require("../../internal/keyboard/navigation.js");
|
|
13
13
|
const require_deprecate = require("../../prop-types/deprecate.js");
|
|
14
14
|
const require_utils = require("../../internal/utils.js");
|
|
15
|
-
const require_events = require("../../tools/events.js");
|
|
16
15
|
const require_index = require("../Layout/index.js");
|
|
16
|
+
const require_Switch = require("../Switch/Switch.js");
|
|
17
17
|
const require_IconSwitch = require("../Switch/IconSwitch.js");
|
|
18
18
|
let classnames = require("classnames");
|
|
19
19
|
classnames = require_runtime.__toESM(classnames);
|
|
@@ -48,25 +48,25 @@ const ContentSwitcher = ({ children, className, light, lowContrast, selectedInde
|
|
|
48
48
|
const ref = switchRefs.current[index];
|
|
49
49
|
if (ref) ref.focus();
|
|
50
50
|
};
|
|
51
|
-
const
|
|
51
|
+
const hasKey = (event) => typeof event === "object" && event !== null && "key" in event;
|
|
52
52
|
const handleChildChange = (event) => {
|
|
53
53
|
if (typeof event.index === "undefined") return;
|
|
54
54
|
const { index } = event;
|
|
55
|
-
if (
|
|
55
|
+
if (hasKey(event) && (require_match.match(event.key, require_keys.ArrowRight) || require_match.match(event.key, require_keys.ArrowLeft))) {
|
|
56
56
|
const nextIndex = require_navigation.getNextIndex(event.key, index, childrenArray.length);
|
|
57
57
|
if (typeof nextIndex !== "number") return;
|
|
58
58
|
focusSwitch(nextIndex);
|
|
59
59
|
if (selectionMode !== "manual") {
|
|
60
60
|
const child = childrenArray[nextIndex];
|
|
61
61
|
setSelectedIndex(nextIndex);
|
|
62
|
-
if ((
|
|
62
|
+
if (require_utils.isComponentElement(child, require_Switch.default) || require_utils.isComponentElement(child, require_IconSwitch.default)) onChange({
|
|
63
63
|
...event,
|
|
64
64
|
index: nextIndex,
|
|
65
65
|
name: child.props.name,
|
|
66
66
|
text: child.props.text
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
} else if (selectedIndex !== index && (
|
|
69
|
+
} else if (selectedIndex !== index && (hasKey(event) ? require_match.match(event.key, require_keys.Enter) || require_match.match(event.key, require_keys.Space) : true)) {
|
|
70
70
|
setSelectedIndex(index);
|
|
71
71
|
focusSwitch(index);
|
|
72
72
|
onChange(event);
|
|
@@ -92,14 +92,23 @@ const ContentSwitcher = ({ children, className, light, lowContrast, selectedInde
|
|
|
92
92
|
className: classes,
|
|
93
93
|
role: "tablist",
|
|
94
94
|
onChange: void 0,
|
|
95
|
-
children:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
95
|
+
children: react.Children.map(children, (child, index) => {
|
|
96
|
+
if (!require_utils.isComponentElement(child, require_Switch.default) && !require_utils.isComponentElement(child, require_IconSwitch.default)) return child;
|
|
97
|
+
return (0, react.cloneElement)(child, {
|
|
98
|
+
index,
|
|
99
|
+
onClick: (event) => {
|
|
100
|
+
handleChildChange(event);
|
|
101
|
+
child.props.onClick?.(event);
|
|
102
|
+
},
|
|
103
|
+
onKeyDown: (event) => {
|
|
104
|
+
handleChildChange(event);
|
|
105
|
+
child.props.onKeyDown?.(event);
|
|
106
|
+
},
|
|
107
|
+
selected: index === selectedIndex,
|
|
108
|
+
ref: handleItemRef(index),
|
|
109
|
+
...require_utils.isComponentElement(child, require_IconSwitch.default) ? { size } : {}
|
|
110
|
+
});
|
|
111
|
+
})
|
|
103
112
|
});
|
|
104
113
|
};
|
|
105
114
|
ContentSwitcher.displayName = "ContentSwitcher";
|
|
@@ -255,7 +255,7 @@ export declare const DataTable: {
|
|
|
255
255
|
tabIndex: PropTypes.Requireable<number>;
|
|
256
256
|
};
|
|
257
257
|
};
|
|
258
|
-
TableActionList: (props: import("react").HTMLAttributes<"div">) =>
|
|
258
|
+
TableActionList: (props: import("react").HTMLAttributes<"div">) => ReactElement;
|
|
259
259
|
TableBatchAction: {
|
|
260
260
|
({ renderIcon, iconDescription, ...props }: import("./TableBatchAction").TableBatchActionProps): import("react/jsx-runtime").JSX.Element;
|
|
261
261
|
propTypes: {
|
|
@@ -332,7 +332,7 @@ export declare const DataTable: {
|
|
|
332
332
|
colSpan: PropTypes.Validator<number>;
|
|
333
333
|
};
|
|
334
334
|
};
|
|
335
|
-
TableHead: (props: import("react").HTMLAttributes<"thead">) =>
|
|
335
|
+
TableHead: (props: import("react").HTMLAttributes<"thead">) => ReactElement;
|
|
336
336
|
TableHeader: import("react").ForwardRefExoticComponent<import("./TableHeader").TableHeaderProps & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
337
337
|
TableRow: import("react").ForwardRefExoticComponent<import("./TableRow").TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
338
338
|
TableSelectAll: {
|
|
@@ -382,7 +382,7 @@ export declare const DataTable: {
|
|
|
382
382
|
};
|
|
383
383
|
};
|
|
384
384
|
TableToolbarAction: import("react").ForwardRefExoticComponent<import("./TableToolbarAction").TableToolbarActionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
385
|
-
TableToolbarContent: (props: import("react").HTMLAttributes<"div">) =>
|
|
385
|
+
TableToolbarContent: (props: import("react").HTMLAttributes<"div">) => ReactElement;
|
|
386
386
|
TableToolbarSearch: {
|
|
387
387
|
({ className, searchContainerClass, onChange: onChangeProp, onClear, translateWithId: t, placeholder, labelText, expanded: expandedProp, defaultExpanded, defaultValue, disabled, onExpand, persistent, id, onBlur, onFocus, size, tabIndex, ...rest }: import("./TableToolbarSearch").TableToolbarSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
388
388
|
propTypes: {
|
|
@@ -4,5 +4,5 @@
|
|
|
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
|
-
declare const TableActionList: (props: import("react").HTMLAttributes<"div">) =>
|
|
7
|
+
declare const TableActionList: (props: import("react").HTMLAttributes<"div">) => import("react").ReactElement;
|
|
8
8
|
export default TableActionList;
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { ThHTMLAttributes } from 'react';
|
|
8
8
|
export type TableHeadProps = ThHTMLAttributes<HTMLTableSectionElement>;
|
|
9
|
-
declare const TableHead: (props: import("react").HTMLAttributes<"thead">) =>
|
|
9
|
+
declare const TableHead: (props: import("react").HTMLAttributes<"thead">) => import("react").ReactElement;
|
|
10
10
|
export default TableHead;
|
|
@@ -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 { ReactNode } from 'react';
|
|
8
|
+
import { type ReactNode } from 'react';
|
|
9
9
|
export interface TableSlugRowProps {
|
|
10
10
|
/**
|
|
11
11
|
* The CSS class names of the cell that wraps the underlying input control
|
|
@@ -17,7 +17,7 @@ prop_types = require_runtime.__toESM(prop_types);
|
|
|
17
17
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
18
18
|
//#region src/components/DataTable/TableSlugRow.tsx
|
|
19
19
|
/**
|
|
20
|
-
* Copyright IBM Corp. 2016,
|
|
20
|
+
* Copyright IBM Corp. 2016, 2026
|
|
21
21
|
*
|
|
22
22
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
23
23
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -27,16 +27,13 @@ const TableSlugRow = ({ className, slug }) => {
|
|
|
27
27
|
require_deprecateComponent.deprecateComponent("TableSlugRow", "The `TableSlugRow` component has been deprecated and will be removed in the next major version. Use the TableDecoratorRow component instead.");
|
|
28
28
|
}, []);
|
|
29
29
|
const prefix = require_usePrefix.usePrefix();
|
|
30
|
-
const TableSlugRowClasses = (0, classnames.default)({
|
|
31
|
-
...className && { [className]: true },
|
|
32
|
-
[`${prefix}--table-column-slug`]: true,
|
|
33
|
-
[`${prefix}--table-column-slug--active`]: slug
|
|
34
|
-
});
|
|
35
|
-
let normalizedSlug;
|
|
36
|
-
if (slug) normalizedSlug = react.default.cloneElement(slug, { size: "mini" });
|
|
37
30
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("td", {
|
|
38
|
-
className:
|
|
39
|
-
|
|
31
|
+
className: (0, classnames.default)({
|
|
32
|
+
...className && { [className]: true },
|
|
33
|
+
[`${prefix}--table-column-slug`]: true,
|
|
34
|
+
[`${prefix}--table-column-slug--active`]: slug
|
|
35
|
+
}),
|
|
36
|
+
children: (0, react.isValidElement)(slug) ? (0, react.cloneElement)(slug, { size: "mini" }) : void 0
|
|
40
37
|
});
|
|
41
38
|
};
|
|
42
39
|
TableSlugRow.displayName = "TableSlugRow";
|
|
@@ -4,5 +4,5 @@
|
|
|
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
|
-
declare const TableToolbarContent: (props: import("react").HTMLAttributes<"div">) =>
|
|
7
|
+
declare const TableToolbarContent: (props: import("react").HTMLAttributes<"div">) => import("react").ReactElement;
|
|
8
8
|
export default TableToolbarContent;
|