@carbon/react 1.89.0 → 1.90.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 +877 -877
- package/README.md +2 -2
- package/es/components/AILabel/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/es/components/Button/Button.js +3 -0
- package/es/components/ChatButton/ChatButton.js +1 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
- package/es/components/ComboBox/ComboBox.js +17 -1
- package/es/components/ComboButton/index.js +1 -0
- package/es/components/ComposedModal/ComposedModal.js +18 -4
- package/es/components/DataTable/DataTable.d.ts +3 -8
- package/es/components/DataTable/DataTable.js +14 -0
- package/es/components/DataTable/Table.js +3 -3
- package/es/components/DataTable/TableExpandHeader.js +5 -1
- package/es/components/DataTable/TableExpandRow.d.ts +33 -5
- package/es/components/DataTable/TableExpandRow.js +5 -2
- package/es/components/DataTable/TableHeader.d.ts +1 -2
- package/es/components/DataTable/TableHeader.js +3 -2
- package/es/components/DataTable/TableRow.d.ts +3 -6
- package/es/components/DataTable/TableRow.js +40 -22
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +57 -14
- package/es/components/DataTable/state/sorting.js +42 -50
- package/es/components/DataTable/tools/sorting.js +5 -0
- package/es/components/DatePicker/DatePicker.js +14 -3
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/Dialog/Dialog.js +10 -2
- package/es/components/Dropdown/Dropdown.js +16 -4
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/es/components/FileUploader/FileUploader.js +9 -2
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -2
- package/es/components/FluidTextInput/FluidTextInput.js +3 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/es/components/Grid/CSSGrid.js +5 -0
- package/es/components/Grid/Column.js +3 -0
- package/es/components/Grid/ColumnHang.js +1 -0
- package/es/components/Grid/FlexGrid.js +1 -0
- package/es/components/Grid/Row.js +1 -0
- package/es/components/Heading/index.js +3 -1
- package/es/components/IconButton/index.js +4 -2
- package/es/components/IconIndicator/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/es/components/Layout/index.js +6 -4
- package/es/components/LayoutDirection/LayoutDirection.js +2 -0
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxMenuItem.js +4 -1
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/es/components/Menu/Menu.js +6 -9
- package/es/components/Menu/MenuContext.js +1 -0
- package/es/components/Menu/MenuItem.js +5 -13
- package/es/components/MenuButton/index.js +7 -2
- package/es/components/Modal/Modal.js +15 -6
- package/es/components/ModalWrapper/ModalWrapper.js +2 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/es/components/MultiSelect/MultiSelect.js +21 -5
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/NumberInput/NumberInput.js +18 -7
- package/es/components/OverflowMenu/OverflowMenu.js +2 -0
- package/es/components/OverflowMenu/next/index.js +3 -2
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/PageHeader/PageHeader.js +22 -8
- package/es/components/Pagination/Pagination.js +6 -2
- package/es/components/PaginationNav/PaginationNav.js +2 -5
- package/es/components/Popover/index.js +20 -6
- package/es/components/ProgressBar/ProgressBar.js +4 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.js +2 -2
- package/es/components/Select/Select.js +2 -3
- package/es/components/ShapeIndicator/index.js +4 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/es/components/SkeletonText/SkeletonText.js +0 -2
- package/es/components/Slider/Slider.js +11 -16
- package/es/components/Stack/HStack.js +1 -0
- package/es/components/Stack/Stack.js +6 -9
- package/es/components/Stack/VStack.js +1 -0
- package/es/components/StructuredList/StructuredList.js +3 -0
- package/es/components/Switch/Switch.js +1 -1
- package/es/components/Tabs/Tabs.js +28 -17
- package/es/components/Tag/DismissibleTag.d.ts +5 -0
- package/es/components/Tag/DismissibleTag.js +8 -1
- package/es/components/Tag/OperationalTag.js +2 -0
- package/es/components/Tag/SelectableTag.js +2 -0
- package/es/components/Tag/Tag.js +4 -0
- package/es/components/Tag/isEllipsisActive.js +1 -0
- package/es/components/Text/Text.js +1 -0
- package/es/components/TextInput/ControlledPasswordInput.js +2 -4
- package/es/components/TextInput/PasswordInput.js +7 -2
- package/es/components/TextInput/TextInput.js +4 -2
- package/es/components/Theme/index.js +8 -3
- package/es/components/Tile/Tile.js +14 -17
- package/es/components/TimePicker/TimePicker.js +1 -0
- package/es/components/Toggle/Toggle.js +1 -1
- package/es/components/Toggletip/index.js +23 -8
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.d.ts +28 -0
- package/es/components/TreeView/TreeNode.js +19 -10
- package/es/components/TreeView/TreeView.js +7 -0
- package/es/components/UIShell/HeaderContainer.js +3 -1
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +3 -3
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/Link.js +2 -0
- package/es/components/UIShell/SideNavItems.js +1 -0
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +1 -1
- package/es/components/UIShell/Switcher.js +2 -1
- package/es/components/UIShell/SwitcherItem.js +4 -2
- package/es/internal/FloatingMenu.js +7 -1
- package/es/internal/Selection.js +12 -3
- package/es/internal/useMergedRefs.js +1 -0
- package/es/internal/useNoInteractiveChildren.js +4 -0
- package/es/internal/useOutsideClick.js +1 -0
- package/es/internal/useOverflowItems.js +6 -0
- package/es/internal/useResizeObserver.js +4 -0
- package/es/internal/useSavedCallback.js +1 -0
- package/es/internal/warning.js +1 -0
- package/es/prop-types/isRequiredOneOf.js +4 -1
- package/es/tools/events.js +3 -1
- package/es/tools/wrapComponent.js +1 -0
- package/lib/components/AILabel/index.js +8 -6
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/ChatButton/ChatButton.js +1 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
- package/lib/components/ComboBox/ComboBox.js +17 -1
- package/lib/components/ComboButton/index.js +1 -0
- package/lib/components/ComposedModal/ComposedModal.js +18 -4
- package/lib/components/DataTable/DataTable.d.ts +3 -8
- package/lib/components/DataTable/DataTable.js +14 -0
- package/lib/components/DataTable/Table.js +3 -3
- package/lib/components/DataTable/TableExpandHeader.js +5 -1
- package/lib/components/DataTable/TableExpandRow.d.ts +33 -5
- package/lib/components/DataTable/TableExpandRow.js +5 -2
- package/lib/components/DataTable/TableHeader.d.ts +1 -2
- package/lib/components/DataTable/TableHeader.js +3 -2
- package/lib/components/DataTable/TableRow.d.ts +3 -6
- package/lib/components/DataTable/TableRow.js +39 -21
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +57 -14
- package/lib/components/DataTable/state/sorting.js +41 -50
- package/lib/components/DataTable/tools/sorting.js +5 -0
- package/lib/components/DatePicker/DatePicker.js +14 -3
- package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
- package/lib/components/Dialog/Dialog.js +10 -2
- package/lib/components/Dropdown/Dropdown.js +16 -4
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/lib/components/FileUploader/FileUploader.js +9 -2
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/lib/components/FluidSearch/FluidSearch.js +3 -2
- package/lib/components/FluidSelect/FluidSelect.js +3 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/lib/components/Grid/CSSGrid.js +5 -0
- package/lib/components/Grid/Column.js +3 -0
- package/lib/components/Grid/ColumnHang.js +1 -0
- package/lib/components/Grid/FlexGrid.js +1 -0
- package/lib/components/Grid/Row.js +1 -0
- package/lib/components/Heading/index.js +3 -1
- package/lib/components/IconButton/index.js +4 -2
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/lib/components/Layout/index.js +6 -4
- package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/lib/components/Menu/Menu.js +6 -9
- package/lib/components/Menu/MenuContext.js +1 -0
- package/lib/components/Menu/MenuItem.js +5 -13
- package/lib/components/MenuButton/index.js +7 -2
- package/lib/components/Modal/Modal.js +15 -6
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/lib/components/MultiSelect/MultiSelect.js +21 -5
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/NumberInput/NumberInput.js +17 -6
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -0
- package/lib/components/OverflowMenu/next/index.js +3 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/PageHeader/PageHeader.js +22 -8
- package/lib/components/Pagination/Pagination.js +6 -2
- package/lib/components/PaginationNav/PaginationNav.js +2 -5
- package/lib/components/Popover/index.js +20 -6
- package/lib/components/ProgressBar/ProgressBar.js +4 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.js +2 -2
- package/lib/components/Select/Select.js +2 -3
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/lib/components/SkeletonText/SkeletonText.js +0 -2
- package/lib/components/Slider/Slider.js +11 -16
- package/lib/components/Stack/HStack.js +1 -0
- package/lib/components/Stack/Stack.js +6 -9
- package/lib/components/Stack/VStack.js +1 -0
- package/lib/components/StructuredList/StructuredList.js +3 -0
- package/lib/components/Switch/Switch.js +1 -1
- package/lib/components/Tabs/Tabs.js +28 -17
- package/lib/components/Tag/DismissibleTag.d.ts +5 -0
- package/lib/components/Tag/DismissibleTag.js +8 -1
- package/lib/components/Tag/OperationalTag.js +2 -0
- package/lib/components/Tag/SelectableTag.js +2 -0
- package/lib/components/Tag/Tag.js +4 -0
- package/lib/components/Tag/isEllipsisActive.js +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextInput/ControlledPasswordInput.js +2 -4
- package/lib/components/TextInput/PasswordInput.js +7 -2
- package/lib/components/TextInput/TextInput.js +4 -2
- package/lib/components/Theme/index.js +8 -3
- package/lib/components/Tile/Tile.js +14 -17
- package/lib/components/TimePicker/TimePicker.js +1 -0
- package/lib/components/Toggle/Toggle.js +1 -1
- package/lib/components/Toggletip/index.js +22 -7
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.d.ts +28 -0
- package/lib/components/TreeView/TreeNode.js +19 -10
- package/lib/components/TreeView/TreeView.js +7 -0
- package/lib/components/UIShell/HeaderContainer.js +3 -1
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -3
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/Link.js +2 -0
- package/lib/components/UIShell/SideNavItems.js +1 -0
- package/lib/components/UIShell/SideNavMenu.js +2 -2
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +1 -1
- package/lib/components/UIShell/Switcher.js +2 -1
- package/lib/components/UIShell/SwitcherItem.js +4 -2
- package/lib/internal/FloatingMenu.js +7 -1
- package/lib/internal/Selection.js +12 -3
- package/lib/internal/useMergedRefs.js +1 -0
- package/lib/internal/useNoInteractiveChildren.js +4 -0
- package/lib/internal/useOutsideClick.js +1 -0
- package/lib/internal/useOverflowItems.js +6 -0
- package/lib/internal/useResizeObserver.js +4 -0
- package/lib/internal/useSavedCallback.js +1 -0
- package/lib/internal/warning.js +1 -0
- package/lib/prop-types/isRequiredOneOf.js +4 -1
- package/lib/tools/events.js +3 -1
- package/lib/tools/wrapComponent.js +1 -0
- package/package.json +11 -11
- package/telemetry.yml +14 -0
|
@@ -44,11 +44,11 @@ var Text = require('../Text/Text.js');
|
|
|
44
44
|
* ----------
|
|
45
45
|
*/
|
|
46
46
|
|
|
47
|
-
const PageHeader = /*#__PURE__*/React.forwardRef(
|
|
47
|
+
const PageHeader = /*#__PURE__*/React.forwardRef(({
|
|
48
48
|
className,
|
|
49
49
|
children,
|
|
50
50
|
...other
|
|
51
|
-
}, ref) {
|
|
51
|
+
}, ref) => {
|
|
52
52
|
const prefix = usePrefix.usePrefix();
|
|
53
53
|
const classNames = cx({
|
|
54
54
|
[`${prefix}--page-header`]: true
|
|
@@ -66,7 +66,7 @@ PageHeader.displayName = 'PageHeader';
|
|
|
66
66
|
* -----------------------
|
|
67
67
|
*/
|
|
68
68
|
|
|
69
|
-
const PageHeaderBreadcrumbBar = /*#__PURE__*/React.forwardRef(
|
|
69
|
+
const PageHeaderBreadcrumbBar = /*#__PURE__*/React.forwardRef(({
|
|
70
70
|
border = true,
|
|
71
71
|
className,
|
|
72
72
|
children,
|
|
@@ -76,7 +76,7 @@ const PageHeaderBreadcrumbBar = /*#__PURE__*/React.forwardRef(function PageHeade
|
|
|
76
76
|
pageActions,
|
|
77
77
|
pageActionsFlush,
|
|
78
78
|
...other
|
|
79
|
-
}, ref) {
|
|
79
|
+
}, ref) => {
|
|
80
80
|
const prefix = usePrefix.usePrefix();
|
|
81
81
|
const classNames = cx({
|
|
82
82
|
[`${prefix}--page-header__breadcrumb-bar`]: true,
|
|
@@ -113,7 +113,7 @@ PageHeaderBreadcrumbBar.displayName = 'PageHeaderBreadcrumbBar';
|
|
|
113
113
|
* -----------------
|
|
114
114
|
*/
|
|
115
115
|
|
|
116
|
-
const PageHeaderContent = /*#__PURE__*/React.forwardRef(
|
|
116
|
+
const PageHeaderContent = /*#__PURE__*/React.forwardRef(({
|
|
117
117
|
className,
|
|
118
118
|
children,
|
|
119
119
|
title,
|
|
@@ -121,7 +121,7 @@ const PageHeaderContent = /*#__PURE__*/React.forwardRef(function PageHeaderConte
|
|
|
121
121
|
contextualActions,
|
|
122
122
|
pageActions,
|
|
123
123
|
...other
|
|
124
|
-
}, ref) {
|
|
124
|
+
}, ref) => {
|
|
125
125
|
const prefix = usePrefix.usePrefix();
|
|
126
126
|
const classNames = cx({
|
|
127
127
|
[`${prefix}--page-header__content`]: true
|
|
@@ -133,6 +133,7 @@ const PageHeaderContent = /*#__PURE__*/React.forwardRef(function PageHeaderConte
|
|
|
133
133
|
return element.offsetHeight < element.scrollHeight;
|
|
134
134
|
};
|
|
135
135
|
React.useLayoutEffect(() => {
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
136
137
|
titleRef.current && isEllipsisActive(titleRef.current);
|
|
137
138
|
}, [title]);
|
|
138
139
|
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
@@ -204,6 +205,7 @@ PageHeaderContent.propTypes = {
|
|
|
204
205
|
|
|
205
206
|
const PageHeaderContentPageActions = ({
|
|
206
207
|
className,
|
|
208
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
207
209
|
children,
|
|
208
210
|
menuButtonLabel = 'Actions',
|
|
209
211
|
actions,
|
|
@@ -239,6 +241,7 @@ const PageHeaderContentPageActions = ({
|
|
|
239
241
|
}
|
|
240
242
|
}
|
|
241
243
|
});
|
|
244
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
242
245
|
}, []);
|
|
243
246
|
return /*#__PURE__*/React.createElement("div", _rollupPluginBabelHelpers.extends({
|
|
244
247
|
className: classNames,
|
|
@@ -361,12 +364,12 @@ PageHeaderHeroImage.propTypes = {
|
|
|
361
364
|
* ----------------
|
|
362
365
|
*/
|
|
363
366
|
|
|
364
|
-
const PageHeaderTabBar = /*#__PURE__*/React.forwardRef(
|
|
367
|
+
const PageHeaderTabBar = /*#__PURE__*/React.forwardRef(({
|
|
365
368
|
className,
|
|
366
369
|
children,
|
|
367
370
|
tags = [],
|
|
368
371
|
...other
|
|
369
|
-
}, ref) {
|
|
372
|
+
}, ref) => {
|
|
370
373
|
const prefix = usePrefix.usePrefix();
|
|
371
374
|
const classNames = cx({
|
|
372
375
|
[`${prefix}--page-header__tab-bar`]: true
|
|
@@ -382,18 +385,26 @@ const PageHeaderTabBar = /*#__PURE__*/React.forwardRef(function PageHeaderTabBar
|
|
|
382
385
|
sm: 4
|
|
383
386
|
}, children)));
|
|
384
387
|
}
|
|
388
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
385
389
|
const [openPopover, setOpenPopover] = React.useState(false);
|
|
386
390
|
const tagSize = tags[0]?.size || 'md';
|
|
391
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
387
392
|
const instanceId = useId.useId('PageHeaderTabBar');
|
|
393
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
388
394
|
const tagsWithIds = React.useMemo(() => {
|
|
389
395
|
return tags.map((tag, index) => ({
|
|
390
396
|
...tag,
|
|
391
397
|
id: tag.id || `tag-${index}-${instanceId}`
|
|
392
398
|
}));
|
|
399
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
393
400
|
}, [tags]);
|
|
401
|
+
|
|
402
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
394
403
|
const tagsContainerRef = React.useRef(null);
|
|
404
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
395
405
|
const offsetRef = React.useRef(null);
|
|
396
406
|
// To close popover when window resizes
|
|
407
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
397
408
|
React.useEffect(() => {
|
|
398
409
|
const handleResize = () => {
|
|
399
410
|
// Close the popover when window resizes to prevent unwanted opens
|
|
@@ -410,11 +421,14 @@ const PageHeaderTabBar = /*#__PURE__*/React.forwardRef(function PageHeaderTabBar
|
|
|
410
421
|
visibleItems = [],
|
|
411
422
|
hiddenItems = [],
|
|
412
423
|
itemRefHandler = () => {}
|
|
424
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
413
425
|
} = useOverflowItems.default(tagsWithIds, tagsContainerRef, offsetRef) || {
|
|
414
426
|
visibleItems: [],
|
|
415
427
|
hiddenItems: [],
|
|
416
428
|
itemRefHandler: () => {}
|
|
417
429
|
};
|
|
430
|
+
|
|
431
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
418
432
|
const handleOverflowClick = React.useCallback(event => {
|
|
419
433
|
event.stopPropagation();
|
|
420
434
|
setOpenPopover(prev => !prev);
|
|
@@ -53,7 +53,9 @@ function getPageSize(pageSizes, pageSize) {
|
|
|
53
53
|
}
|
|
54
54
|
return pageSizes[0].value;
|
|
55
55
|
}
|
|
56
|
-
|
|
56
|
+
|
|
57
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
58
|
+
const Pagination = /*#__PURE__*/React.forwardRef(({
|
|
57
59
|
backwardText = 'Previous page',
|
|
58
60
|
className: customClassName = '',
|
|
59
61
|
disabled = false,
|
|
@@ -64,6 +66,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
|
|
|
64
66
|
itemRangeText = (min, max, total) => `${min}–${max} of ${total} items`,
|
|
65
67
|
itemsPerPageText = 'Items per page:',
|
|
66
68
|
onChange,
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
67
70
|
pageNumberText: _pageNumberText = 'Page Number',
|
|
68
71
|
pageRangeText = (_current, total) => `of ${total} ${total === 1 ? 'page' : 'pages'}`,
|
|
69
72
|
page: controlledPage = 1,
|
|
@@ -76,7 +79,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
|
|
|
76
79
|
size = 'md',
|
|
77
80
|
totalItems,
|
|
78
81
|
...rest
|
|
79
|
-
}, ref) {
|
|
82
|
+
}, ref) => {
|
|
80
83
|
const prefix = usePrefix.usePrefix();
|
|
81
84
|
const inputId = useId.useFallbackId(id?.toString());
|
|
82
85
|
const backBtnRef = React.useRef(null);
|
|
@@ -126,6 +129,7 @@ const Pagination = /*#__PURE__*/React.forwardRef(function Pagination({
|
|
|
126
129
|
handleFocus(focusTarget);
|
|
127
130
|
setFocusTarget(null);
|
|
128
131
|
}
|
|
132
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
129
133
|
}, [focusTarget]);
|
|
130
134
|
|
|
131
135
|
// Sync state with props
|
|
@@ -111,7 +111,6 @@ function PaginationOverflow({
|
|
|
111
111
|
fromIndex = NaN,
|
|
112
112
|
count = NaN,
|
|
113
113
|
onSelect,
|
|
114
|
-
// eslint-disable-next-line react/prop-types
|
|
115
114
|
disableOverflow,
|
|
116
115
|
translateWithId: t = translateWithId
|
|
117
116
|
}) {
|
|
@@ -169,7 +168,7 @@ function PaginationOverflow({
|
|
|
169
168
|
}
|
|
170
169
|
return null;
|
|
171
170
|
}
|
|
172
|
-
const PaginationNav = /*#__PURE__*/React.forwardRef(
|
|
171
|
+
const PaginationNav = /*#__PURE__*/React.forwardRef(({
|
|
173
172
|
className,
|
|
174
173
|
onChange = () => {},
|
|
175
174
|
totalItems = NaN,
|
|
@@ -180,7 +179,7 @@ const PaginationNav = /*#__PURE__*/React.forwardRef(function PaginationNav({
|
|
|
180
179
|
size = 'lg',
|
|
181
180
|
translateWithId: t = translateWithId,
|
|
182
181
|
...rest
|
|
183
|
-
}, ref) {
|
|
182
|
+
}, ref) => {
|
|
184
183
|
const smMediaQuery = `(max-width: ${layout.breakpoints.sm.width})`;
|
|
185
184
|
const isSm = useMatchMedia.useMatchMedia(smMediaQuery);
|
|
186
185
|
let numberOfPages;
|
|
@@ -400,8 +399,6 @@ PaginationNav.propTypes = {
|
|
|
400
399
|
* Set this to true if you are having performance problems with large data sets.
|
|
401
400
|
*/
|
|
402
401
|
disableOverflow: PropTypes.bool,
|
|
403
|
-
// eslint-disable-line react/prop-types
|
|
404
|
-
|
|
405
402
|
/**
|
|
406
403
|
* The number of items to be shown (minimum of 4 unless props.items < 4).
|
|
407
404
|
*/
|
|
@@ -50,8 +50,10 @@ const Popover = /*#__PURE__*/React.forwardRef(function PopoverRenderFunction({
|
|
|
50
50
|
open,
|
|
51
51
|
alignmentAxisOffset,
|
|
52
52
|
...rest
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
53
54
|
},
|
|
54
55
|
//this is a workaround, have to come back and fix this.
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
55
57
|
forwardRef) {
|
|
56
58
|
const prefix = usePrefix.usePrefix();
|
|
57
59
|
const floating = React.useRef(null);
|
|
@@ -63,8 +65,12 @@ forwardRef) {
|
|
|
63
65
|
// The `Popover` should close whenever it and its children loses focus
|
|
64
66
|
useEvent.useEvent(popover, 'focusout', event => {
|
|
65
67
|
const relatedTarget = event.relatedTarget;
|
|
66
|
-
|
|
67
|
-
|
|
68
|
+
if (isTabTip) {
|
|
69
|
+
if (relatedTarget && !popover.current?.contains(relatedTarget)) {
|
|
70
|
+
onRequestClose?.();
|
|
71
|
+
}
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
68
74
|
if (!relatedTarget) {
|
|
69
75
|
onRequestClose?.();
|
|
70
76
|
return;
|
|
@@ -89,7 +95,12 @@ forwardRef) {
|
|
|
89
95
|
// needs to be placed 1px further outside the popover content. To do so,
|
|
90
96
|
// we look to see if any of the children has a className containing "slug"
|
|
91
97
|
const initialCaretHeight = React.Children.toArray(children).some(x => {
|
|
92
|
-
return
|
|
98
|
+
return (
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
100
|
+
x?.props?.className?.includes('slug') ||
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
102
|
+
x?.props?.className?.includes('ai-label')
|
|
103
|
+
);
|
|
93
104
|
}) ? 7 : 6;
|
|
94
105
|
// These defaults match the defaults defined in packages/styles/scss/components/popover/_popover.scss
|
|
95
106
|
const popoverDimensions = React.useRef({
|
|
@@ -208,6 +219,7 @@ forwardRef) {
|
|
|
208
219
|
[`${prefix}--popover--tab-tip`]: isTabTip
|
|
209
220
|
}, customClassName);
|
|
210
221
|
const mappedChildren = React.Children.map(children, child => {
|
|
222
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
211
223
|
const item = child;
|
|
212
224
|
const displayName = item?.type?.displayName;
|
|
213
225
|
|
|
@@ -222,9 +234,13 @@ forwardRef) {
|
|
|
222
234
|
const isTriggerComponent = enableFloatingStyles && displayName && ['ToggletipButton'].includes(displayName);
|
|
223
235
|
const isAllowedTriggerComponent = enableFloatingStyles && !['ToggletipContent', 'PopoverContent'].includes(displayName);
|
|
224
236
|
if (/*#__PURE__*/React.isValidElement(item) && (isTriggerElement || isTriggerComponent || isAllowedTriggerComponent)) {
|
|
237
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
225
238
|
const className = item?.props?.className;
|
|
239
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
226
240
|
const ref = (item?.props).ref;
|
|
227
241
|
const tabTipClasses = cx(`${prefix}--popover--tab-tip__button`, className);
|
|
242
|
+
|
|
243
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
228
244
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
229
245
|
className: isTabTip && item?.type === 'button' ? tabTipClasses : className || '',
|
|
230
246
|
// With cloneElement, if you pass a `ref`, it overrides the original ref.
|
|
@@ -356,9 +372,7 @@ Popover.propTypes = {
|
|
|
356
372
|
*/
|
|
357
373
|
open: PropTypes.bool.isRequired
|
|
358
374
|
};
|
|
359
|
-
function PopoverContentRenderFunction(
|
|
360
|
-
// eslint-disable-next-line react/prop-types
|
|
361
|
-
{
|
|
375
|
+
function PopoverContentRenderFunction({
|
|
362
376
|
className,
|
|
363
377
|
children,
|
|
364
378
|
...rest
|
|
@@ -59,14 +59,16 @@ function ProgressBar({
|
|
|
59
59
|
});
|
|
60
60
|
let StatusIcon = null;
|
|
61
61
|
if (isError) {
|
|
62
|
-
|
|
62
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
63
|
+
StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
63
64
|
return /*#__PURE__*/React.createElement(iconsReact.ErrorFilled, _rollupPluginBabelHelpers.extends({
|
|
64
65
|
ref: ref,
|
|
65
66
|
size: 16
|
|
66
67
|
}, props));
|
|
67
68
|
});
|
|
68
69
|
} else if (isFinished) {
|
|
69
|
-
|
|
70
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
71
|
+
StatusIcon = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
70
72
|
return /*#__PURE__*/React.createElement(iconsReact.CheckmarkFilled, _rollupPluginBabelHelpers.extends({
|
|
71
73
|
ref: ref,
|
|
72
74
|
size: 16
|
|
@@ -27,7 +27,7 @@ var utils = require('../../internal/utils.js');
|
|
|
27
27
|
var Text = require('../Text/Text.js');
|
|
28
28
|
|
|
29
29
|
var _RadioButtonChecked, _RadioButton, _CheckmarkFilled;
|
|
30
|
-
const RadioTile = /*#__PURE__*/React.forwardRef(
|
|
30
|
+
const RadioTile = /*#__PURE__*/React.forwardRef(({
|
|
31
31
|
children,
|
|
32
32
|
className: customClassName,
|
|
33
33
|
decorator,
|
|
@@ -43,7 +43,7 @@ const RadioTile = /*#__PURE__*/React.forwardRef(function RadioTile({
|
|
|
43
43
|
slug,
|
|
44
44
|
required,
|
|
45
45
|
...rest
|
|
46
|
-
}, ref) {
|
|
46
|
+
}, ref) => {
|
|
47
47
|
const prefix = usePrefix.usePrefix();
|
|
48
48
|
const inputId = useId.useFallbackId(id);
|
|
49
49
|
const className = cx(customClassName, `${prefix}--tile`, `${prefix}--tile--selectable`, `${prefix}--tile--radio`, {
|
|
@@ -26,7 +26,7 @@ var FormContext = require('../FluidForm/FormContext.js');
|
|
|
26
26
|
var noopFn = require('../../internal/noopFn.js');
|
|
27
27
|
|
|
28
28
|
var _Close;
|
|
29
|
-
const Search = /*#__PURE__*/React.forwardRef(
|
|
29
|
+
const Search = /*#__PURE__*/React.forwardRef(({
|
|
30
30
|
autoComplete = 'off',
|
|
31
31
|
className,
|
|
32
32
|
closeButtonLabelText = 'Clear search input',
|
|
@@ -48,7 +48,7 @@ const Search = /*#__PURE__*/React.forwardRef(function Search({
|
|
|
48
48
|
type = 'text',
|
|
49
49
|
value,
|
|
50
50
|
...rest
|
|
51
|
-
}, forwardRef) {
|
|
51
|
+
}, forwardRef) => {
|
|
52
52
|
const hasPropValue = value || defaultValue ? true : false;
|
|
53
53
|
const prefix = usePrefix.usePrefix();
|
|
54
54
|
const {
|
|
@@ -25,7 +25,7 @@ var index = require('../AILabel/index.js');
|
|
|
25
25
|
var utils = require('../../internal/utils.js');
|
|
26
26
|
var Text = require('../Text/Text.js');
|
|
27
27
|
|
|
28
|
-
const Select = /*#__PURE__*/React.forwardRef(
|
|
28
|
+
const Select = /*#__PURE__*/React.forwardRef(({
|
|
29
29
|
className,
|
|
30
30
|
decorator,
|
|
31
31
|
id,
|
|
@@ -35,7 +35,6 @@ const Select = /*#__PURE__*/React.forwardRef(function Select({
|
|
|
35
35
|
children,
|
|
36
36
|
// reserved for use with Pagination component
|
|
37
37
|
noLabel = false,
|
|
38
|
-
// eslint-disable-next-line no-unused-vars
|
|
39
38
|
hideLabel = false,
|
|
40
39
|
invalid = false,
|
|
41
40
|
invalidText = '',
|
|
@@ -48,7 +47,7 @@ const Select = /*#__PURE__*/React.forwardRef(function Select({
|
|
|
48
47
|
onChange,
|
|
49
48
|
slug,
|
|
50
49
|
...other
|
|
51
|
-
}, ref) {
|
|
50
|
+
}, ref) => {
|
|
52
51
|
const prefix = usePrefix.usePrefix();
|
|
53
52
|
const {
|
|
54
53
|
isFluid
|
|
@@ -50,13 +50,15 @@ const shapeTypes = {
|
|
|
50
50
|
incomplete: incompleteIcon,
|
|
51
51
|
draft: iconsReact.CircleStroke
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
54
|
+
const ShapeIndicator = /*#__PURE__*/React.forwardRef(({
|
|
54
55
|
className: customClassName,
|
|
55
56
|
kind,
|
|
56
57
|
label,
|
|
57
58
|
textSize = 12,
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
58
60
|
...rest
|
|
59
|
-
}, ref) {
|
|
61
|
+
}, ref) => {
|
|
60
62
|
const prefix = usePrefix.usePrefix();
|
|
61
63
|
const classNames = cx(`${prefix}--shape-indicator`, customClassName, {
|
|
62
64
|
[`${prefix}--shape-indicator--14`]: textSize == 14
|
|
@@ -1,11 +1,12 @@
|
|
|
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.
|
|
6
6
|
*/
|
|
7
|
+
import { type HTMLAttributes } from 'react';
|
|
7
8
|
import PropTypes from 'prop-types';
|
|
8
|
-
export interface SkeletonPlaceholderProps {
|
|
9
|
+
export interface SkeletonPlaceholderProps extends HTMLAttributes<HTMLDivElement> {
|
|
9
10
|
/**
|
|
10
11
|
* Add a custom class to the component to set the height and width
|
|
11
12
|
*/
|
|
@@ -15,8 +16,7 @@ declare const SkeletonPlaceholder: {
|
|
|
15
16
|
({ className, ...other }: SkeletonPlaceholderProps): import("react/jsx-runtime").JSX.Element;
|
|
16
17
|
propTypes: {
|
|
17
18
|
/**
|
|
18
|
-
* Add a custom class to the component
|
|
19
|
-
* to set the height and width
|
|
19
|
+
* Add a custom class to the component to set the height and width
|
|
20
20
|
*/
|
|
21
21
|
className: PropTypes.Requireable<string>;
|
|
22
22
|
};
|
|
@@ -29,8 +29,7 @@ const SkeletonPlaceholder = ({
|
|
|
29
29
|
};
|
|
30
30
|
SkeletonPlaceholder.propTypes = {
|
|
31
31
|
/**
|
|
32
|
-
* Add a custom class to the component
|
|
33
|
-
* to set the height and width
|
|
32
|
+
* Add a custom class to the component to set the height and width
|
|
34
33
|
*/
|
|
35
34
|
className: PropTypes.string
|
|
36
35
|
};
|
|
@@ -70,8 +70,6 @@ const SkeletonText = ({
|
|
|
70
70
|
if (lineCountNumber !== 1) {
|
|
71
71
|
return /*#__PURE__*/React.createElement("div", null, lines);
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
75
73
|
return /*#__PURE__*/React.createElement(React.Fragment, null, lines);
|
|
76
74
|
};
|
|
77
75
|
SkeletonText.propTypes = {
|
|
@@ -35,23 +35,15 @@ const ThumbWrapper = ({
|
|
|
35
35
|
...rest
|
|
36
36
|
}) => {
|
|
37
37
|
if (hasTooltip) {
|
|
38
|
-
return (
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
className: className,
|
|
43
|
-
style: style
|
|
44
|
-
}, rest), children)
|
|
45
|
-
);
|
|
38
|
+
return /*#__PURE__*/React.createElement(Tooltip.Tooltip, _rollupPluginBabelHelpers.extends({
|
|
39
|
+
className: className,
|
|
40
|
+
style: style
|
|
41
|
+
}, rest), children);
|
|
46
42
|
} else {
|
|
47
|
-
return (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
className: className,
|
|
52
|
-
style: style
|
|
53
|
-
}, children)
|
|
54
|
-
);
|
|
43
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: className,
|
|
45
|
+
style: style
|
|
46
|
+
}, children);
|
|
55
47
|
}
|
|
56
48
|
};
|
|
57
49
|
const translationIds = {
|
|
@@ -887,6 +879,7 @@ class Slider extends React.PureComponent {
|
|
|
887
879
|
hideLabel,
|
|
888
880
|
step = 1,
|
|
889
881
|
// TODO: Other properties are deleted below. Why isn't this one?
|
|
882
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
890
883
|
stepMultiplier: _stepMultiplier,
|
|
891
884
|
inputType = 'number',
|
|
892
885
|
invalidText,
|
|
@@ -916,9 +909,11 @@ class Slider extends React.PureComponent {
|
|
|
916
909
|
} = this.state;
|
|
917
910
|
const showWarning = !readOnly && warn ||
|
|
918
911
|
// TODO: https://github.com/carbon-design-system/carbon/issues/18991#issuecomment-2795709637
|
|
912
|
+
// eslint-disable-next-line valid-typeof , no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
919
913
|
typeof correctedValue !== null && correctedPosition === HandlePosition.LOWER && isValid;
|
|
920
914
|
const showWarningUpper = !readOnly && warn ||
|
|
921
915
|
// TODO: https://github.com/carbon-design-system/carbon/issues/18991#issuecomment-2795709637
|
|
916
|
+
// eslint-disable-next-line valid-typeof, no-constant-binary-expression -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
922
917
|
typeof correctedValue !== null && correctedPosition === (twoHandles ? HandlePosition.UPPER : HandlePosition.LOWER) && (twoHandles ? isValidUpper : isValid);
|
|
923
918
|
return /*#__PURE__*/React.createElement(usePrefix.PrefixContext.Consumer, null, prefix => {
|
|
924
919
|
const labelId = `${id}-label`;
|
|
@@ -11,6 +11,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var Stack = require('./Stack.js');
|
|
13
13
|
|
|
14
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
14
15
|
const HStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
16
|
return /*#__PURE__*/React.createElement(Stack.Stack, _rollupPluginBabelHelpers.extends({}, props, {
|
|
16
17
|
ref: ref,
|
|
@@ -37,6 +37,7 @@ const SPACING_STEPS = Array.from({
|
|
|
37
37
|
* - https://paste.twilio.design/layout/stack/
|
|
38
38
|
* - https://github.com/Workday/canvas-kit/blob/f2f599654876700f483a1d8c5de82a41315c76f1/modules/labs-react/layout/lib/Stack.tsx
|
|
39
39
|
*/
|
|
40
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
40
41
|
const Stack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
41
42
|
const {
|
|
42
43
|
as: BaseComponent = 'div',
|
|
@@ -57,15 +58,11 @@ const Stack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
57
58
|
if (typeof gap === 'string') {
|
|
58
59
|
style[`--${prefix}-stack-gap`] = gap;
|
|
59
60
|
}
|
|
60
|
-
return (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
className: className,
|
|
66
|
-
style: style
|
|
67
|
-
}), children)
|
|
68
|
-
);
|
|
61
|
+
return /*#__PURE__*/React.createElement(BaseComponent, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
62
|
+
ref: ref,
|
|
63
|
+
className: className,
|
|
64
|
+
style: style
|
|
65
|
+
}), children);
|
|
69
66
|
});
|
|
70
67
|
Stack.propTypes = {
|
|
71
68
|
/**
|
|
@@ -11,6 +11,7 @@ var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelper
|
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var Stack = require('./Stack.js');
|
|
13
13
|
|
|
14
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
14
15
|
const VStack = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
15
16
|
return /*#__PURE__*/React.createElement(Stack.Stack, _rollupPluginBabelHelpers.extends({}, props, {
|
|
16
17
|
ref: ref,
|
|
@@ -152,6 +152,7 @@ function StructuredListRow(props) {
|
|
|
152
152
|
...other
|
|
153
153
|
} = props;
|
|
154
154
|
const [hasFocusWithin, setHasFocusWithin] = React.useState(false);
|
|
155
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
155
156
|
const rowId = id ?? useId.useId('grid-input');
|
|
156
157
|
const selectedRow = React.useContext(GridSelectedRowStateContext);
|
|
157
158
|
const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
|
|
@@ -185,6 +186,7 @@ function StructuredListRow(props) {
|
|
|
185
186
|
ref: itemRef,
|
|
186
187
|
onClick: event => {
|
|
187
188
|
setSelectedRow?.(rowId);
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
188
190
|
onClick && onClick(event);
|
|
189
191
|
if (selection) {
|
|
190
192
|
// focus items only when selection is enabled
|
|
@@ -264,6 +266,7 @@ function StructuredListInput(props) {
|
|
|
264
266
|
value: row?.id ?? '',
|
|
265
267
|
onChange: event => {
|
|
266
268
|
setSelectedRow?.(event.target.value);
|
|
269
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
267
270
|
onChange && onChange(event);
|
|
268
271
|
},
|
|
269
272
|
id: id ?? defaultId,
|
|
@@ -16,7 +16,7 @@ var cx = require('classnames');
|
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
var noopFn = require('../../internal/noopFn.js');
|
|
18
18
|
|
|
19
|
-
const Switch = /*#__PURE__*/React.forwardRef(
|
|
19
|
+
const Switch = /*#__PURE__*/React.forwardRef((props, tabRef) => {
|
|
20
20
|
const {
|
|
21
21
|
children,
|
|
22
22
|
className,
|