@carbon/react 1.76.0 → 1.77.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 +810 -775
- package/es/components/Button/Button.d.ts +9 -1
- package/es/components/Button/Button.js +8 -0
- package/es/components/CodeSnippet/CodeSnippet.d.ts +2 -2
- package/es/components/ComboBox/ComboBox.d.ts +2 -2
- package/es/components/ComboBox/ComboBox.js +34 -12
- package/es/components/ComboButton/index.js +1 -2
- package/es/components/ComposedModal/ComposedModal.js +1 -1
- package/es/components/ContentSwitcher/index.d.ts +0 -1
- package/es/components/ContextMenu/useContextMenu.d.ts +0 -1
- package/es/components/Copy/Copy.js +1 -1
- package/es/components/DataTable/DataTable.d.ts +12 -20
- package/es/components/DataTable/DataTable.js +1 -9
- package/es/components/DataTable/Table.js +1 -1
- package/es/components/DataTable/TableActionList.d.ts +1 -1
- package/es/components/DataTable/TableBody.js +1 -1
- package/es/components/DataTable/TableContext.d.ts +0 -1
- package/es/components/DataTable/TableHead.d.ts +1 -1
- package/es/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
- package/es/components/DatePickerInput/DatePickerInput.js +1 -1
- package/es/components/Dropdown/Dropdown.js +1 -2
- package/es/components/FluidForm/FormContext.d.ts +0 -1
- package/es/components/Grid/CSSGrid.js +1 -1
- package/es/components/Grid/Grid.js +1 -1
- package/es/components/Grid/GridTypes.d.ts +0 -1
- package/es/components/Heading/index.d.ts +1 -1
- package/es/components/IconButton/index.d.ts +17 -1
- package/es/components/IconButton/index.js +20 -1
- package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/es/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/es/components/InlineLoading/InlineLoading.js +21 -7
- package/es/components/Menu/Menu.js +2 -2
- package/es/components/Menu/MenuContext.d.ts +1 -1
- package/es/components/MenuButton/index.d.ts +1 -1
- package/es/components/MenuButton/index.js +1 -2
- package/es/components/Modal/Modal.js +1 -1
- package/es/components/Modal/next/index.d.ts +175 -0
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +12 -5
- package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/MultiSelect.js +1 -2
- package/es/components/Pagination/Pagination.js +2 -2
- package/es/components/Popover/index.js +2 -3
- package/es/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/es/components/RadioTile/RadioTile.d.ts +1 -1
- package/es/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/es/components/Slider/Slider.d.ts +1 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Slider/index.d.ts +0 -1
- package/es/components/Tabs/Tabs.d.ts +3 -3
- package/es/components/Tabs/Tabs.js +4 -4
- package/es/components/Tag/DismissibleTag.d.ts +2 -2
- package/es/components/Tag/OperationalTag.d.ts +1 -1
- package/es/components/Tag/SelectableTag.d.ts +2 -2
- package/es/components/Text/index.d.ts +2 -2
- package/es/components/TextInput/PasswordInput.d.ts +1 -1
- package/es/components/Theme/index.d.ts +1 -1
- package/es/components/Tile/Tile.d.ts +1 -1
- package/es/components/Tile/Tile.js +1 -1
- package/es/components/Toggletip/index.d.ts +3 -3
- package/es/components/Toggletip/index.js +5 -4
- package/es/components/Tooltip/Tooltip.d.ts +17 -1
- package/es/components/Tooltip/Tooltip.js +12 -2
- package/es/components/TreeView/TreeNode.d.ts +27 -19
- package/es/components/TreeView/TreeNode.js +100 -31
- package/es/components/TreeView/TreeView.js +1 -1
- package/es/components/UIShell/Content.d.ts +9 -9
- package/es/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/es/components/UIShell/HeaderMenu.d.ts +69 -25
- package/es/components/UIShell/HeaderMenuButton.d.ts +69 -27
- package/es/components/UIShell/HeaderMenuItem.d.ts +4 -3
- package/es/components/UIShell/HeaderMenuItem.js +1 -1
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/HeaderNavigation.d.ts +69 -25
- package/es/components/UIShell/Link.d.ts +14 -11
- package/es/components/UIShell/Link.js +5 -6
- package/es/components/UIShell/SideNav.js +3 -3
- package/es/components/UIShell/SideNavLink.js +1 -1
- package/es/components/UIShell/SideNavMenuItem.d.ts +51 -3
- package/es/components/UIShell/SideNavMenuItem.js +6 -6
- package/es/components/UIShell/SwitcherItem.d.ts +2 -2
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/internal/PolymorphicProps.d.ts +0 -1
- package/es/internal/Selection.d.ts +38 -0
- package/es/internal/Selection.js +26 -113
- package/es/node_modules/es-toolkit/dist/compat/function/debounce.mjs.js +55 -0
- package/es/node_modules/es-toolkit/dist/compat/function/throttle.mjs.js +23 -0
- package/es/node_modules/es-toolkit/dist/function/debounce.mjs.js +70 -0
- package/es/tools/wrapComponent.d.ts +1 -1
- package/lib/components/Button/Button.d.ts +9 -1
- package/lib/components/Button/Button.js +8 -0
- package/lib/components/CodeSnippet/CodeSnippet.d.ts +2 -2
- package/lib/components/ComboBox/ComboBox.d.ts +2 -2
- package/lib/components/ComboBox/ComboBox.js +34 -12
- package/lib/components/ComboButton/index.js +1 -2
- package/lib/components/ComposedModal/ComposedModal.js +2 -2
- package/lib/components/ContentSwitcher/index.d.ts +0 -1
- package/lib/components/ContextMenu/useContextMenu.d.ts +0 -1
- package/lib/components/Copy/Copy.js +2 -2
- package/lib/components/DataTable/DataTable.d.ts +12 -20
- package/lib/components/DataTable/DataTable.js +1 -9
- package/lib/components/DataTable/Table.js +3 -3
- package/lib/components/DataTable/TableActionList.d.ts +1 -1
- package/lib/components/DataTable/TableBody.js +1 -1
- package/lib/components/DataTable/TableContext.d.ts +0 -1
- package/lib/components/DataTable/TableHead.d.ts +1 -1
- package/lib/components/DataTable/TableToolbarContent.d.ts +1 -1
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +2 -2
- package/lib/components/DatePickerInput/DatePickerInput.js +1 -1
- package/lib/components/Dropdown/Dropdown.js +1 -2
- package/lib/components/FluidForm/FormContext.d.ts +0 -1
- package/lib/components/Grid/CSSGrid.js +1 -1
- package/lib/components/Grid/Grid.js +1 -1
- package/lib/components/Grid/GridTypes.d.ts +0 -1
- package/lib/components/Heading/index.d.ts +1 -1
- package/lib/components/IconButton/index.d.ts +17 -1
- package/lib/components/IconButton/index.js +20 -1
- package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/lib/components/InlineLoading/InlineLoading.d.ts +1 -1
- package/lib/components/InlineLoading/InlineLoading.js +20 -6
- package/lib/components/Menu/Menu.js +2 -2
- package/lib/components/Menu/MenuContext.d.ts +1 -1
- package/lib/components/MenuButton/index.d.ts +1 -1
- package/lib/components/MenuButton/index.js +1 -2
- package/lib/components/Modal/Modal.js +2 -2
- package/lib/components/Modal/next/index.d.ts +175 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +11 -4
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelect.js +1 -2
- package/lib/components/Pagination/Pagination.js +3 -2
- package/lib/components/Popover/index.js +2 -3
- package/lib/components/PrimaryButton/PrimaryButton.d.ts +1 -1
- package/lib/components/RadioTile/RadioTile.d.ts +1 -1
- package/lib/components/SecondaryButton/SecondaryButton.d.ts +1 -1
- package/lib/components/Slider/Slider.d.ts +1 -1
- package/lib/components/Slider/Slider.js +2 -2
- package/lib/components/Slider/index.d.ts +0 -1
- package/lib/components/Tabs/Tabs.d.ts +3 -3
- package/lib/components/Tabs/Tabs.js +6 -6
- package/lib/components/Tag/DismissibleTag.d.ts +2 -2
- package/lib/components/Tag/OperationalTag.d.ts +1 -1
- package/lib/components/Tag/SelectableTag.d.ts +2 -2
- package/lib/components/Text/index.d.ts +2 -2
- package/lib/components/TextInput/PasswordInput.d.ts +1 -1
- package/lib/components/Theme/index.d.ts +1 -1
- package/lib/components/Tile/Tile.d.ts +1 -1
- package/lib/components/Tile/Tile.js +1 -1
- package/lib/components/Toggletip/index.d.ts +3 -3
- package/lib/components/Toggletip/index.js +5 -4
- package/lib/components/Tooltip/Tooltip.d.ts +17 -1
- package/lib/components/Tooltip/Tooltip.js +12 -2
- package/lib/components/TreeView/TreeNode.d.ts +27 -19
- package/lib/components/TreeView/TreeNode.js +100 -31
- package/lib/components/TreeView/TreeView.js +1 -1
- package/lib/components/UIShell/Content.d.ts +9 -9
- package/lib/components/UIShell/HeaderGlobalBar.d.ts +1 -1
- package/lib/components/UIShell/HeaderMenu.d.ts +69 -25
- package/lib/components/UIShell/HeaderMenuButton.d.ts +69 -27
- package/lib/components/UIShell/HeaderMenuItem.d.ts +4 -3
- package/lib/components/UIShell/HeaderMenuItem.js +1 -1
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/HeaderNavigation.d.ts +69 -25
- package/lib/components/UIShell/Link.d.ts +14 -11
- package/lib/components/UIShell/Link.js +4 -4
- package/lib/components/UIShell/SideNav.js +3 -3
- package/lib/components/UIShell/SideNavLink.js +1 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +51 -3
- package/lib/components/UIShell/SideNavMenuItem.js +6 -6
- package/lib/components/UIShell/SwitcherItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/internal/PolymorphicProps.d.ts +0 -1
- package/lib/internal/Selection.d.ts +38 -0
- package/lib/internal/Selection.js +24 -114
- package/lib/node_modules/es-toolkit/dist/compat/function/debounce.mjs.js +59 -0
- package/lib/node_modules/es-toolkit/dist/compat/function/throttle.mjs.js +27 -0
- package/lib/node_modules/es-toolkit/dist/function/debounce.mjs.js +74 -0
- package/lib/tools/wrapComponent.d.ts +1 -1
- package/package.json +10 -9
- package/es/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -896
- package/es/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -76
- package/es/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -139
- package/es/tools/array.js +0 -29
- package/lib/node_modules/@floating-ui/core/dist/floating-ui.core.mjs.js +0 -909
- package/lib/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js +0 -80
- package/lib/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs.js +0 -163
- package/lib/tools/array.js +0 -33
|
@@ -38,7 +38,9 @@ const IconButton = /*#__PURE__*/React__default.forwardRef(function IconButton(_r
|
|
|
38
38
|
closeOnActivation = true,
|
|
39
39
|
defaultOpen = false,
|
|
40
40
|
disabled,
|
|
41
|
+
dropShadow = false,
|
|
41
42
|
enterDelayMs = 100,
|
|
43
|
+
highContrast = true,
|
|
42
44
|
kind,
|
|
43
45
|
label,
|
|
44
46
|
leaveDelayMs = 100,
|
|
@@ -57,7 +59,9 @@ const IconButton = /*#__PURE__*/React__default.forwardRef(function IconButton(_r
|
|
|
57
59
|
closeOnActivation: closeOnActivation,
|
|
58
60
|
className: tooltipClasses,
|
|
59
61
|
defaultOpen: defaultOpen,
|
|
62
|
+
dropShadow: dropShadow,
|
|
60
63
|
enterDelayMs: enterDelayMs,
|
|
64
|
+
highContrast: highContrast,
|
|
61
65
|
label: label,
|
|
62
66
|
leaveDelayMs: leaveDelayMs
|
|
63
67
|
}, /*#__PURE__*/React__default.createElement(ButtonBase, _extends({}, rest, {
|
|
@@ -124,6 +128,10 @@ IconButton.propTypes = {
|
|
|
124
128
|
* Specify whether the tooltip should be open when it first renders
|
|
125
129
|
*/
|
|
126
130
|
defaultOpen: PropTypes.bool,
|
|
131
|
+
/**
|
|
132
|
+
* Specify whether a drop shadow should be rendered on the tooltip
|
|
133
|
+
*/
|
|
134
|
+
dropShadow: PropTypes.bool,
|
|
127
135
|
/**
|
|
128
136
|
* Specify whether the Button should be disabled, or not
|
|
129
137
|
*/
|
|
@@ -135,8 +143,11 @@ IconButton.propTypes = {
|
|
|
135
143
|
/**
|
|
136
144
|
* Specify whether the IconButton is currently selected
|
|
137
145
|
*/
|
|
138
|
-
|
|
139
146
|
isSelected: PropTypes.bool,
|
|
147
|
+
/**
|
|
148
|
+
* Render the tooltip using the high-contrast theme
|
|
149
|
+
*/
|
|
150
|
+
highContrast: PropTypes.bool,
|
|
140
151
|
/**
|
|
141
152
|
* Specify the type of button to be used as the base for the IconButton
|
|
142
153
|
*/
|
|
@@ -152,10 +163,18 @@ IconButton.propTypes = {
|
|
|
152
163
|
* Specify the duration in milliseconds to delay before hiding the tooltip
|
|
153
164
|
*/
|
|
154
165
|
leaveDelayMs: PropTypes.number,
|
|
166
|
+
/**
|
|
167
|
+
* Optionally specify a `rel` when using an `<a>` element.
|
|
168
|
+
*/
|
|
169
|
+
rel: PropTypes.string,
|
|
155
170
|
/**
|
|
156
171
|
* Specify the size of the Button. Defaults to `md`.
|
|
157
172
|
*/
|
|
158
173
|
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
174
|
+
/**
|
|
175
|
+
* Optionally specify a `target` when using an `<a>` element.
|
|
176
|
+
*/
|
|
177
|
+
target: PropTypes.string,
|
|
159
178
|
/**
|
|
160
179
|
* Specify an optional className to be added to your Tooltip wrapper
|
|
161
180
|
*/
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React__default from 'react';
|
|
9
|
+
import React__default, { useRef, useEffect } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { ErrorFilled, CheckmarkFilled } from '@carbon/icons-react';
|
|
@@ -25,6 +25,22 @@ const InlineLoading = _ref => {
|
|
|
25
25
|
} = _ref;
|
|
26
26
|
const prefix = usePrefix();
|
|
27
27
|
const loadingClasses = cx(`${prefix}--inline-loading`, className);
|
|
28
|
+
const timerRef = useRef(null);
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (status === 'finished') {
|
|
31
|
+
timerRef.current = setTimeout(() => {
|
|
32
|
+
if (onSuccess) {
|
|
33
|
+
onSuccess();
|
|
34
|
+
}
|
|
35
|
+
}, successDelay);
|
|
36
|
+
}
|
|
37
|
+
return () => {
|
|
38
|
+
if (timerRef.current) {
|
|
39
|
+
clearTimeout(timerRef.current);
|
|
40
|
+
timerRef.current = null;
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}, [status, onSuccess, successDelay]);
|
|
28
44
|
const getLoading = () => {
|
|
29
45
|
let iconLabel = iconDescription ? iconDescription : status;
|
|
30
46
|
if (status === 'error') {
|
|
@@ -33,11 +49,6 @@ const InlineLoading = _ref => {
|
|
|
33
49
|
}, /*#__PURE__*/React__default.createElement("title", null, iconLabel));
|
|
34
50
|
}
|
|
35
51
|
if (status === 'finished') {
|
|
36
|
-
setTimeout(() => {
|
|
37
|
-
if (onSuccess) {
|
|
38
|
-
onSuccess();
|
|
39
|
-
}
|
|
40
|
-
}, successDelay);
|
|
41
52
|
return /*#__PURE__*/React__default.createElement(CheckmarkFilled, {
|
|
42
53
|
className: `${prefix}--inline-loading__checkmark-container`
|
|
43
54
|
}, /*#__PURE__*/React__default.createElement("title", null, iconLabel));
|
|
@@ -55,6 +66,9 @@ const InlineLoading = _ref => {
|
|
|
55
66
|
}
|
|
56
67
|
return undefined;
|
|
57
68
|
};
|
|
69
|
+
|
|
70
|
+
// TODO: Should this element only be constructed, similar to
|
|
71
|
+
// `loadingAnimation`, if `description` is specified?
|
|
58
72
|
const loadingText = /*#__PURE__*/React__default.createElement("div", {
|
|
59
73
|
className: `${prefix}--inline-loading__text`
|
|
60
74
|
}, description);
|
|
@@ -65,7 +79,7 @@ const InlineLoading = _ref => {
|
|
|
65
79
|
return /*#__PURE__*/React__default.createElement("div", _extends({
|
|
66
80
|
className: loadingClasses
|
|
67
81
|
}, rest, {
|
|
68
|
-
"aria-live": 'assertive'
|
|
82
|
+
"aria-live": rest['aria-live'] ?? 'assertive'
|
|
69
83
|
}), loadingAnimation, description && loadingText);
|
|
70
84
|
};
|
|
71
85
|
InlineLoading.propTypes = {
|
|
@@ -191,7 +191,7 @@ const Menu = /*#__PURE__*/forwardRef(function Menu(_ref, forwardRef) {
|
|
|
191
191
|
}
|
|
192
192
|
};
|
|
193
193
|
|
|
194
|
-
// Avoid that the Menu render incorrectly when the
|
|
194
|
+
// Avoid that the Menu render incorrectly when the position is set in the right side of the screen
|
|
195
195
|
if (actionButtonWidth && actionButtonWidth < axes.x.size && (menuAlignment === 'bottom' || menuAlignment === 'top')) {
|
|
196
196
|
axes.x.size = actionButtonWidth;
|
|
197
197
|
}
|
|
@@ -219,7 +219,7 @@ const Menu = /*#__PURE__*/forwardRef(function Menu(_ref, forwardRef) {
|
|
|
219
219
|
max - spacing - size];
|
|
220
220
|
const topAlignment = menuAlignment === 'top' || menuAlignment === 'top-end' || menuAlignment === 'top-start';
|
|
221
221
|
|
|
222
|
-
// If the tooltip is not visible in the top, switch to the
|
|
222
|
+
// If the tooltip is not visible in the top, switch to the bottom
|
|
223
223
|
if (typeof options[0] === 'number' && topAlignment && options[0] >= 0 && !options[1] && axis === 'y') {
|
|
224
224
|
menu.current.style.transform = 'translate(0)';
|
|
225
225
|
} else if (topAlignment && !options[0] && axis === 'y') {
|
|
@@ -21,7 +21,7 @@ declare function menuReducer(state: StateType, action: ActionType): {
|
|
|
21
21
|
hasIcons: boolean;
|
|
22
22
|
isRoot: boolean;
|
|
23
23
|
mode: "full" | "basic";
|
|
24
|
-
size: "
|
|
24
|
+
size: "xs" | "sm" | "md" | "lg" | null;
|
|
25
25
|
items: any[];
|
|
26
26
|
requestCloseRoot: (e: Pick<KeyboardEvent<HTMLUListElement>, "type">) => void;
|
|
27
27
|
};
|
|
@@ -30,7 +30,7 @@ export interface MenuButtonProps extends ComponentProps<'div'> {
|
|
|
30
30
|
/**
|
|
31
31
|
* Experimental property. Specify how the menu should align with the button element
|
|
32
32
|
*/
|
|
33
|
-
menuAlignment
|
|
33
|
+
menuAlignment?: MenuAlignment;
|
|
34
34
|
/**
|
|
35
35
|
* Specify the size of the button and menu.
|
|
36
36
|
*/
|
|
@@ -152,13 +152,12 @@ MenuButton.propTypes = {
|
|
|
152
152
|
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
153
153
|
kind: PropTypes.oneOf(validButtonKinds),
|
|
154
154
|
/**
|
|
155
|
-
* Provide the label to be
|
|
155
|
+
* Provide the label to be rendered on the trigger button.
|
|
156
156
|
*/
|
|
157
157
|
label: PropTypes.string.isRequired,
|
|
158
158
|
/**
|
|
159
159
|
* Experimental property. Specify how the menu should align with the button element
|
|
160
160
|
*/
|
|
161
|
-
// @ts-ignore-next-line -- avoid spurious (?) TS2322 error
|
|
162
161
|
menuAlignment: PropTypes.oneOf(['top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end']),
|
|
163
162
|
/**
|
|
164
163
|
* Specify the size of the button and menu.
|
|
@@ -18,7 +18,6 @@ import InlineLoading from '../InlineLoading/InlineLoading.js';
|
|
|
18
18
|
import { Layer } from '../Layer/index.js';
|
|
19
19
|
import requiredIfGivenPropIsTruthy from '../../prop-types/requiredIfGivenPropIsTruthy.js';
|
|
20
20
|
import wrapFocus, { wrapFocusWithoutSentinels, elementOrParentIsFloatingMenu } from '../../internal/wrapFocus.js';
|
|
21
|
-
import { debounce } from 'es-toolkit/compat';
|
|
22
21
|
import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
23
22
|
import { useId } from '../../internal/useId.js';
|
|
24
23
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
@@ -28,6 +27,7 @@ import '../Text/index.js';
|
|
|
28
27
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
29
28
|
import { composeEventHandlers } from '../../tools/events.js';
|
|
30
29
|
import deprecate from '../../prop-types/deprecate.js';
|
|
30
|
+
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js';
|
|
31
31
|
import { Text } from '../Text/Text.js';
|
|
32
32
|
import { match } from '../../internal/keyboard/match.js';
|
|
33
33
|
import { Escape, Enter, Tab } from '../../internal/keyboard/keys.js';
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
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 React, { ReactNode } from 'react';
|
|
8
|
+
import { ReactAttr } from '../../../types/common';
|
|
9
|
+
import { InlineLoadingStatus } from '../../InlineLoading/InlineLoading';
|
|
10
|
+
export declare const ModalSizes: readonly ["xs", "sm", "md", "lg"];
|
|
11
|
+
export type ModalSize = (typeof ModalSizes)[number];
|
|
12
|
+
export interface ModalSecondaryButton {
|
|
13
|
+
buttonText?: string | ReactNode;
|
|
14
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
15
|
+
}
|
|
16
|
+
export interface BaseModalProps extends ReactAttr<HTMLDivElement> {
|
|
17
|
+
/**
|
|
18
|
+
* Required props for the accessibility label of the header
|
|
19
|
+
*/
|
|
20
|
+
'aria-label'?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Provide the contents of your Modal
|
|
23
|
+
*/
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
/**
|
|
26
|
+
* Specify an optional className to be applied to the modal root node
|
|
27
|
+
*/
|
|
28
|
+
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* Specify an label for the close button of the modal; defaults to close
|
|
31
|
+
*/
|
|
32
|
+
closeButtonLabel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Specify whether the Modal is for dangerous actions
|
|
35
|
+
*/
|
|
36
|
+
danger?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* **Experimental**: Provide a decorator component to be rendered inside the `Modal` component
|
|
39
|
+
*/
|
|
40
|
+
decorator?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Specify whether the modal contains scrolling content
|
|
43
|
+
*/
|
|
44
|
+
hasScrollingContent?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Specify the DOM element ID of the top-level node.
|
|
47
|
+
*/
|
|
48
|
+
id?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Specify whether or not the Modal content should have any inner padding.
|
|
51
|
+
*/
|
|
52
|
+
isFullWidth?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Provide a ref to return focus to once the modal is closed.
|
|
55
|
+
*/
|
|
56
|
+
launcherButtonRef?: any;
|
|
57
|
+
/**
|
|
58
|
+
* Specify the description for the loading text
|
|
59
|
+
*/
|
|
60
|
+
loadingDescription?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Specify the description for the loading text
|
|
63
|
+
*/
|
|
64
|
+
loadingIconDescription?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Specify loading status
|
|
67
|
+
*/
|
|
68
|
+
loadingStatus?: InlineLoadingStatus;
|
|
69
|
+
/**
|
|
70
|
+
* Specify a label to be read by screen readers on the modal root node
|
|
71
|
+
*/
|
|
72
|
+
modalAriaLabel?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Specify the content of the modal header title.
|
|
75
|
+
*/
|
|
76
|
+
modalHeading?: ReactNode;
|
|
77
|
+
/**
|
|
78
|
+
* Specify the content of the modal header label.
|
|
79
|
+
*/
|
|
80
|
+
modalLabel?: ReactNode;
|
|
81
|
+
/**
|
|
82
|
+
* Specify a handler for keypresses.
|
|
83
|
+
* @deprecated this property is unused
|
|
84
|
+
*/
|
|
85
|
+
onKeyDown?: React.KeyboardEventHandler<HTMLElement>;
|
|
86
|
+
/**
|
|
87
|
+
* Specify an optional handler to be invoked when loading is
|
|
88
|
+
* successful
|
|
89
|
+
*/
|
|
90
|
+
onLoadingSuccess?: () => void;
|
|
91
|
+
/**
|
|
92
|
+
* Specify a handler for closing modal.
|
|
93
|
+
* The handler should care of closing modal, e.g. changing `open` prop.
|
|
94
|
+
*/
|
|
95
|
+
onRequestClose?: React.ReactEventHandler<HTMLElement>;
|
|
96
|
+
/**
|
|
97
|
+
* Specify a handler for "submitting" modal.
|
|
98
|
+
* The handler should care of closing modal, e.g. changing `open` prop, if necessary.
|
|
99
|
+
*/
|
|
100
|
+
onRequestSubmit?: React.ReactEventHandler<HTMLElement>;
|
|
101
|
+
/**
|
|
102
|
+
* Specify a handler for the secondary button.
|
|
103
|
+
* Useful if separate handler from `onRequestClose` is desirable
|
|
104
|
+
*/
|
|
105
|
+
onSecondarySubmit?: React.ReactEventHandler<HTMLElement>;
|
|
106
|
+
/**
|
|
107
|
+
* Specify whether the Modal is currently open
|
|
108
|
+
*/
|
|
109
|
+
open?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Prevent closing on click outside of modal
|
|
112
|
+
*/
|
|
113
|
+
preventCloseOnClickOutside?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Specify whether the Button should be disabled, or not
|
|
116
|
+
*/
|
|
117
|
+
primaryButtonDisabled?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Specify the text for the primary button
|
|
120
|
+
*/
|
|
121
|
+
primaryButtonText?: ReactNode;
|
|
122
|
+
/**
|
|
123
|
+
* Specify the text for the secondary button
|
|
124
|
+
*/
|
|
125
|
+
secondaryButtonText?: ReactNode;
|
|
126
|
+
/**
|
|
127
|
+
* Specify an array of config objects for secondary buttons
|
|
128
|
+
*/
|
|
129
|
+
secondaryButtons?: ModalSecondaryButton[];
|
|
130
|
+
/**
|
|
131
|
+
* Specify a CSS selector that matches the DOM element that should
|
|
132
|
+
* be focused when the Modal opens
|
|
133
|
+
*/
|
|
134
|
+
selectorPrimaryFocus?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Specify CSS selectors that match DOM elements working as floating menus.
|
|
137
|
+
* Focusing on those elements won't trigger "focus-wrap" behavior
|
|
138
|
+
*/
|
|
139
|
+
selectorsFloatingMenus?: string[];
|
|
140
|
+
/**
|
|
141
|
+
* Specify if Enter key should be used as "submit" action
|
|
142
|
+
*/
|
|
143
|
+
shouldSubmitOnEnter?: boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Specify the size variant.
|
|
146
|
+
*/
|
|
147
|
+
size?: ModalSize;
|
|
148
|
+
}
|
|
149
|
+
interface PassiveModal extends BaseModalProps {
|
|
150
|
+
/**
|
|
151
|
+
* Specify whether the modal should be button-less
|
|
152
|
+
*/
|
|
153
|
+
passiveModal?: true;
|
|
154
|
+
/**
|
|
155
|
+
* Specify whether the Modal is displaying an alert, error or warning. Should
|
|
156
|
+
* go hand in hand with the `danger` prop. This changes the `role` to
|
|
157
|
+
* `alertdialog` and cannot be used with passive modals.
|
|
158
|
+
*/
|
|
159
|
+
alert?: never;
|
|
160
|
+
}
|
|
161
|
+
interface NonPassiveModal extends BaseModalProps {
|
|
162
|
+
/**
|
|
163
|
+
* Specify whether the modal should be button-less
|
|
164
|
+
*/
|
|
165
|
+
passiveModal?: false;
|
|
166
|
+
/**
|
|
167
|
+
* Specify whether the Modal is displaying an alert, error or warning. Should
|
|
168
|
+
* go hand in hand with the `danger` prop. This changes the `role` to
|
|
169
|
+
* `alertdialog` and cannot be used with passive modals.
|
|
170
|
+
*/
|
|
171
|
+
alert?: boolean;
|
|
172
|
+
}
|
|
173
|
+
export type ModalProps = PassiveModal | NonPassiveModal;
|
|
174
|
+
declare const Modal: React.ForwardRefExoticComponent<ModalProps & React.RefAttributes<HTMLDivElement>>;
|
|
175
|
+
export default Modal;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -63,7 +63,7 @@ export interface FilterableMultiSelectProps<ItemType> extends MultiSelectSorting
|
|
|
63
63
|
/**
|
|
64
64
|
* Default sorter is assigned if not provided.
|
|
65
65
|
*/
|
|
66
|
-
filterItems(items: readonly ItemType[], extra: {
|
|
66
|
+
filterItems?(items: readonly ItemType[], extra: {
|
|
67
67
|
inputValue: string | null;
|
|
68
68
|
itemToString: NonNullable<UseComboboxProps<ItemType>['itemToString']>;
|
|
69
69
|
}): ItemType[];
|
|
@@ -11,7 +11,7 @@ import cx from 'classnames';
|
|
|
11
11
|
import Downshift, { useCombobox, useMultipleSelection } from 'downshift';
|
|
12
12
|
import isEqual from 'react-fast-compare';
|
|
13
13
|
import PropTypes from 'prop-types';
|
|
14
|
-
import React__default, { useContext, useState, useLayoutEffect,
|
|
14
|
+
import React__default, { useContext, useRef, useState, useLayoutEffect, useMemo, useEffect } from 'react';
|
|
15
15
|
import { defaultFilterItems } from '../ComboBox/tools/filter.js';
|
|
16
16
|
import { sortingPropTypes } from './MultiSelectPropTypes.js';
|
|
17
17
|
import ListBox from '../ListBox/index.js';
|
|
@@ -26,8 +26,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
26
26
|
import '../FluidForm/FluidForm.js';
|
|
27
27
|
import { FormContext } from '../FluidForm/FormContext.js';
|
|
28
28
|
import { useSelection } from '../../internal/Selection.js';
|
|
29
|
-
import { useFloating, flip, size, autoUpdate } from '@floating-ui/react';
|
|
30
|
-
import { hide } from '../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js';
|
|
29
|
+
import { useFloating, flip, size, hide, autoUpdate } from '@floating-ui/react';
|
|
31
30
|
import { match } from '../../internal/keyboard/match.js';
|
|
32
31
|
import { ListBoxSize } from '../ListBox/ListBoxPropTypes.js';
|
|
33
32
|
import { Escape, Space, Enter, Delete, Tab, Home, End } from '../../internal/keyboard/keys.js';
|
|
@@ -107,6 +106,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Fi
|
|
|
107
106
|
const {
|
|
108
107
|
isFluid
|
|
109
108
|
} = useContext(FormContext);
|
|
109
|
+
const isFirstRender = useRef(true);
|
|
110
110
|
const [isFocused, setIsFocused] = useState(false);
|
|
111
111
|
const [isOpen, setIsOpen] = useState(!!open);
|
|
112
112
|
const [prevOpen, setPrevOpen] = useState(!!open);
|
|
@@ -241,8 +241,15 @@ const FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function Fi
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
useEffect(() => {
|
|
244
|
-
|
|
245
|
-
|
|
244
|
+
if (isFirstRender.current) {
|
|
245
|
+
isFirstRender.current = false;
|
|
246
|
+
if (open) {
|
|
247
|
+
onMenuChange?.(isOpen);
|
|
248
|
+
}
|
|
249
|
+
} else {
|
|
250
|
+
onMenuChange?.(isOpen);
|
|
251
|
+
}
|
|
252
|
+
}, [isOpen, onMenuChange, open]);
|
|
246
253
|
const {
|
|
247
254
|
getToggleButtonProps,
|
|
248
255
|
getLabelProps,
|
|
@@ -25,8 +25,7 @@ import { FormContext } from '../FluidForm/FormContext.js';
|
|
|
25
25
|
import Checkbox from '../Checkbox/Checkbox.js';
|
|
26
26
|
import '../Checkbox/Checkbox.Skeleton.js';
|
|
27
27
|
import { noopFn } from '../../internal/noopFn.js';
|
|
28
|
-
import { useFloating, flip, size, autoUpdate } from '@floating-ui/react';
|
|
29
|
-
import { hide } from '../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js';
|
|
28
|
+
import { useFloating, flip, size, hide, autoUpdate } from '@floating-ui/react';
|
|
30
29
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
31
30
|
import { match } from '../../internal/keyboard/match.js';
|
|
32
31
|
import { ListBoxSize } from '../ListBox/ListBoxPropTypes.js';
|
|
@@ -13,10 +13,10 @@ import React__default, { useRef, useState } from 'react';
|
|
|
13
13
|
import Select from '../Select/Select.js';
|
|
14
14
|
import '../Select/Select.Skeleton.js';
|
|
15
15
|
import SelectItem from '../SelectItem/SelectItem.js';
|
|
16
|
-
import { equals } from '../../tools/array.js';
|
|
17
16
|
import { useFallbackId } from '../../internal/useId.js';
|
|
18
17
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
19
18
|
import { IconButton } from '../IconButton/index.js';
|
|
19
|
+
import isEqual from 'react-fast-compare';
|
|
20
20
|
|
|
21
21
|
var _CaretLeft, _CaretRight;
|
|
22
22
|
function mapPageSizesToObject(sizes) {
|
|
@@ -117,7 +117,7 @@ const Pagination = /*#__PURE__*/React__default.forwardRef(function Pagination(_r
|
|
|
117
117
|
setPageSize(getPageSize(pageSizes, controlledPageSize));
|
|
118
118
|
setPrevControlledPageSize(controlledPageSize);
|
|
119
119
|
}
|
|
120
|
-
if (!
|
|
120
|
+
if (!isEqual(controlledPageSizes, prevPageSizes)) {
|
|
121
121
|
const pageSizes = mapPageSizesToObject(controlledPageSizes);
|
|
122
122
|
const hasPageSize = pageSizes.find(size => {
|
|
123
123
|
return size.value === pageSize;
|
|
@@ -15,8 +15,7 @@ import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
16
|
import { useWindowEvent } from '../../internal/useEvent.js';
|
|
17
17
|
import { mapPopoverAlignProp } from '../../tools/createPropAdapter.js';
|
|
18
|
-
import { useFloating, offset, flip, arrow, autoUpdate } from '@floating-ui/react';
|
|
19
|
-
import { hide } from '../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs.js';
|
|
18
|
+
import { useFloating, offset, flip, arrow, hide, autoUpdate } from '@floating-ui/react';
|
|
20
19
|
import { useFeatureFlag } from '../FeatureFlags/index.js';
|
|
21
20
|
|
|
22
21
|
const PopoverContext = /*#__PURE__*/React__default.createContext({
|
|
@@ -235,7 +234,7 @@ const Popover = /*#__PURE__*/React__default.forwardRef(function PopoverRenderFun
|
|
|
235
234
|
// For a popover, there isn't an explicit trigger component, it's just the first child that's
|
|
236
235
|
// passed in which should *not* be PopoverContent.
|
|
237
236
|
// For a toggletip there is a specific trigger component, ToggletipButton.
|
|
238
|
-
// In either of these
|
|
237
|
+
// In either of these cases we want to set this as the reference node for floating-ui autoAlign
|
|
239
238
|
// positioning.
|
|
240
239
|
if (enableFloatingStyles && item?.type?.displayName !== 'PopoverContent' || enableFloatingStyles && item?.type?.displayName === 'ToggletipButton') {
|
|
241
240
|
// Set the reference element for floating-ui
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const PrimaryButton: <T extends React.ElementType
|
|
9
|
+
declare const PrimaryButton: <T extends React.ElementType>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default PrimaryButton;
|
|
@@ -53,7 +53,7 @@ export interface RadioTileProps {
|
|
|
53
53
|
onChange?: (value: string | number, name: string | undefined, event: React.ChangeEvent<HTMLInputElement> | React.KeyboardEvent<HTMLInputElement>) => void;
|
|
54
54
|
/**
|
|
55
55
|
* @deprecated please use `decorator` instead.
|
|
56
|
-
* **Experimental**: Provide a `Slug` component to be rendered inside the `
|
|
56
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `RadioTile` component
|
|
57
57
|
*/
|
|
58
58
|
slug?: React.ReactNode;
|
|
59
59
|
/**
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import { ButtonProps } from '../Button';
|
|
9
|
-
declare const SecondaryButton: <T extends React.ElementType
|
|
9
|
+
declare const SecondaryButton: <T extends React.ElementType>(props: ButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default SecondaryButton;
|
|
@@ -387,7 +387,7 @@ declare class Slider extends PureComponent<SliderProps> {
|
|
|
387
387
|
* Throttles calls to `this._onDrag` by limiting events to being processed at
|
|
388
388
|
* most once every `EVENT_THROTTLE` milliseconds.
|
|
389
389
|
*/
|
|
390
|
-
onDrag: import("es-toolkit/
|
|
390
|
+
onDrag: import("es-toolkit/compat").DebouncedFunc<(evt: any, activeHandle?: HandlePosition | null) => void>;
|
|
391
391
|
/**
|
|
392
392
|
* Handles a `keydown` event by recalculating the value/thumb and setting
|
|
393
393
|
* state accordingly.
|
|
@@ -9,7 +9,6 @@ import { defineProperty as _defineProperty, extends as _extends } from '../../_v
|
|
|
9
9
|
import React__default, { PureComponent } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import { throttle } from 'es-toolkit/compat';
|
|
13
12
|
import { ArrowDown, ArrowLeft, ArrowUp, ArrowRight, Enter } from '../../internal/keyboard/keys.js';
|
|
14
13
|
import { PrefixContext } from '../../internal/usePrefix.js';
|
|
15
14
|
import deprecate from '../../prop-types/deprecate.js';
|
|
@@ -19,6 +18,7 @@ import '../Text/index.js';
|
|
|
19
18
|
import '../Tooltip/DefinitionTooltip.js';
|
|
20
19
|
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
21
20
|
import { LowerHandle, LowerHandleFocus, UpperHandle, UpperHandleFocus } from './SliderHandles.js';
|
|
21
|
+
import { throttle } from '../../node_modules/es-toolkit/dist/compat/function/throttle.mjs.js';
|
|
22
22
|
import { matches } from '../../internal/keyboard/match.js';
|
|
23
23
|
import { Text } from '../Text/Text.js';
|
|
24
24
|
|
|
@@ -4,7 +4,6 @@
|
|
|
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
|
-
/// <reference types="react" />
|
|
8
7
|
declare const Slider: import("react").FunctionComponent<import("./Slider").SliderProps>;
|
|
9
8
|
export { default as SliderSkeleton } from './Slider.Skeleton';
|
|
10
9
|
export default Slider;
|
|
@@ -265,7 +265,7 @@ export interface TabListVerticalProps extends DivAttributes {
|
|
|
265
265
|
* Provide an accessible label to be read when a user interacts with this
|
|
266
266
|
* component
|
|
267
267
|
*/
|
|
268
|
-
'aria-label'
|
|
268
|
+
'aria-label'?: string;
|
|
269
269
|
/**
|
|
270
270
|
* Provide child elements to be rendered inside `ContentTabs`.
|
|
271
271
|
* These elements should render a `ContentTab`
|
|
@@ -293,7 +293,7 @@ declare namespace TabListVertical {
|
|
|
293
293
|
* Provide an accessible label to be read when a user interacts with this
|
|
294
294
|
* component
|
|
295
295
|
*/
|
|
296
|
-
'aria-label': PropTypes.
|
|
296
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
297
297
|
/**
|
|
298
298
|
* Provide child elements to be rendered inside `ContentTabs`.
|
|
299
299
|
* These elements should render a `ContentTab`
|
|
@@ -348,7 +348,7 @@ export interface TabProps extends HTMLAttributes<HTMLElement> {
|
|
|
348
348
|
}>;
|
|
349
349
|
/**
|
|
350
350
|
* An optional label to render under the primary tab label.
|
|
351
|
-
* Only useful for
|
|
351
|
+
* Only useful for contained tabs.
|
|
352
352
|
*/
|
|
353
353
|
secondaryLabel?: string;
|
|
354
354
|
}
|
|
@@ -9,7 +9,6 @@ import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js
|
|
|
9
9
|
import { ChevronLeft, ChevronRight, Close } from '@carbon/icons-react';
|
|
10
10
|
import { breakpoints } from '@carbon/layout';
|
|
11
11
|
import cx from 'classnames';
|
|
12
|
-
import { debounce } from 'es-toolkit/compat';
|
|
13
12
|
import PropTypes from 'prop-types';
|
|
14
13
|
import React__default, { useState, useRef, useCallback, useEffect, forwardRef } from 'react';
|
|
15
14
|
import '../Grid/FlexGrid.js';
|
|
@@ -33,6 +32,7 @@ import deprecate from '../../prop-types/deprecate.js';
|
|
|
33
32
|
import { useEvent } from '../../internal/useEvent.js';
|
|
34
33
|
import { useMatchMedia } from '../../internal/useMatchMedia.js';
|
|
35
34
|
import '../Text/index.js';
|
|
35
|
+
import { debounce } from '../../node_modules/es-toolkit/dist/compat/function/debounce.mjs.js';
|
|
36
36
|
import { Text } from '../Text/Text.js';
|
|
37
37
|
import { matches, match } from '../../internal/keyboard/match.js';
|
|
38
38
|
import { ArrowRight, ArrowLeft, Home, End, ArrowDown, ArrowUp, Delete } from '../../internal/keyboard/keys.js';
|
|
@@ -716,7 +716,7 @@ TabListVertical.propTypes = {
|
|
|
716
716
|
* Provide an accessible label to be read when a user interacts with this
|
|
717
717
|
* component
|
|
718
718
|
*/
|
|
719
|
-
'aria-label': PropTypes.string
|
|
719
|
+
'aria-label': PropTypes.string,
|
|
720
720
|
/**
|
|
721
721
|
* Provide child elements to be rendered inside `ContentTabs`.
|
|
722
722
|
* These elements should render a `ContentTab`
|
|
@@ -899,7 +899,7 @@ const Tab = /*#__PURE__*/forwardRef(function Tab(_ref10, forwardRef) {
|
|
|
899
899
|
})));
|
|
900
900
|
const hasIcon = Icon ?? dismissable;
|
|
901
901
|
|
|
902
|
-
// should only happen for vertical variation, so no
|
|
902
|
+
// should only happen for vertical variation, so no dismissable icon is needed here
|
|
903
903
|
if (isEllipsisApplied) {
|
|
904
904
|
return /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
905
905
|
label: children,
|
|
@@ -1017,7 +1017,7 @@ Tab.propTypes = {
|
|
|
1017
1017
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
1018
1018
|
/*
|
|
1019
1019
|
* An optional label to render under the primary tab label.
|
|
1020
|
-
/* This prop is only useful for
|
|
1020
|
+
/* This prop is only useful for contained tabs
|
|
1021
1021
|
**/
|
|
1022
1022
|
secondaryLabel: PropTypes.string
|
|
1023
1023
|
};
|