@carbon/react 1.90.0-rc.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 +743 -784
- 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 +4 -1
- 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.js +1 -0
- package/es/components/DataTable/TableHeader.js +2 -0
- package/es/components/DataTable/TableRow.js +5 -0
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +3 -1
- package/es/components/DataTable/state/sorting.js +2 -0
- package/es/components/DataTable/tools/sorting.js +1 -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 +3 -0
- 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 +7 -1
- 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 +14 -4
- 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.js +2 -0
- 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 +4 -0
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.js +13 -5
- 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 +4 -1
- 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.js +1 -0
- package/lib/components/DataTable/TableHeader.js +2 -0
- package/lib/components/DataTable/TableRow.js +5 -0
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +3 -1
- package/lib/components/DataTable/state/sorting.js +2 -0
- package/lib/components/DataTable/tools/sorting.js +1 -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 +3 -0
- 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 +7 -1
- 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 +14 -4
- 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.js +2 -0
- 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 +4 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.js +13 -5
- 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 +9 -9
|
@@ -61,8 +61,7 @@ const useEllipsisCheck = (label, detailsWrapperRef) => {
|
|
|
61
61
|
}
|
|
62
62
|
}, [detailsWrapperRef]);
|
|
63
63
|
React.useEffect(() => {
|
|
64
|
-
|
|
65
|
-
animationFrameId = requestAnimationFrame(checkEllipsis);
|
|
64
|
+
const animationFrameId = requestAnimationFrame(checkEllipsis);
|
|
66
65
|
let resizeObserver;
|
|
67
66
|
if (typeof window !== 'undefined' && typeof window.ResizeObserver !== 'undefined' && labelTextRef.current) {
|
|
68
67
|
resizeObserver = new window.ResizeObserver(() => {
|
|
@@ -77,9 +76,11 @@ const useEllipsisCheck = (label, detailsWrapperRef) => {
|
|
|
77
76
|
cancelAnimationFrame(animationFrameId);
|
|
78
77
|
if (resizeObserver) {
|
|
79
78
|
if (labelTextRef.current) {
|
|
79
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
80
80
|
resizeObserver.unobserve(labelTextRef.current);
|
|
81
81
|
}
|
|
82
82
|
if (detailsWrapperRef.current) {
|
|
83
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
83
84
|
resizeObserver.unobserve(detailsWrapperRef.current);
|
|
84
85
|
}
|
|
85
86
|
resizeObserver.disconnect();
|
|
@@ -130,6 +131,8 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
130
131
|
tooltipText
|
|
131
132
|
} = useEllipsisCheck(label, detailsWrapperRef);
|
|
132
133
|
const enableTreeviewControllable = index.useFeatureFlag('enable-treeview-controllable');
|
|
134
|
+
|
|
135
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
133
136
|
const {
|
|
134
137
|
current: id
|
|
135
138
|
} = React.useRef(nodeId || useId.useId());
|
|
@@ -372,7 +375,10 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
372
375
|
const nodeContent = /*#__PURE__*/React.createElement("div", {
|
|
373
376
|
className: `${prefix}--tree-node__label`,
|
|
374
377
|
ref: currentNodeLabel
|
|
375
|
-
}, children &&
|
|
378
|
+
}, children &&
|
|
379
|
+
/*#__PURE__*/
|
|
380
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions , jsx-a11y/click-events-have-key-events -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
381
|
+
React.createElement("span", {
|
|
376
382
|
className: `${prefix}--tree-parent-node__toggle`,
|
|
377
383
|
onClick: handleToggleClick
|
|
378
384
|
}, /*#__PURE__*/React.createElement(iconsReact.CaretDown, {
|
|
@@ -400,7 +406,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
400
406
|
value: depth + 1
|
|
401
407
|
}, children)));
|
|
402
408
|
}
|
|
403
|
-
return /*#__PURE__*/React.createElement("li", _rollupPluginBabelHelpers.extends({}, treeNodeProps, {
|
|
409
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("li", _rollupPluginBabelHelpers.extends({}, treeNodeProps, {
|
|
404
410
|
"aria-expanded": children ? !!expanded : undefined,
|
|
405
411
|
ref: setRefs
|
|
406
412
|
}), nodeContent, children && /*#__PURE__*/React.createElement("ul", {
|
|
@@ -411,7 +417,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
411
417
|
})
|
|
412
418
|
}, /*#__PURE__*/React.createElement(TreeContext.DepthContext.Provider, {
|
|
413
419
|
value: depth + 1
|
|
414
|
-
}, children)));
|
|
420
|
+
}, children))));
|
|
415
421
|
});
|
|
416
422
|
TreeNode.propTypes = {
|
|
417
423
|
/**
|
|
@@ -472,12 +478,14 @@ TreeNode.propTypes = {
|
|
|
472
478
|
/**
|
|
473
479
|
* A component used to render an icon.
|
|
474
480
|
*/
|
|
481
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
475
482
|
// @ts-ignore
|
|
476
483
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
477
484
|
/**
|
|
478
485
|
* **Note:** this is controlled by the parent TreeView component, do not set manually.
|
|
479
486
|
* Array containing all selected node IDs in the tree
|
|
480
487
|
*/
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
481
489
|
// @ts-ignore
|
|
482
490
|
selected: deprecate.deprecate(PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])), 'The `selected` prop for `TreeNode` is no longer needed and has ' + 'been deprecated. It will be removed in the next major release.'),
|
|
483
491
|
/**
|
|
@@ -36,11 +36,14 @@ const TreeView = ({
|
|
|
36
36
|
...rest
|
|
37
37
|
}) => {
|
|
38
38
|
const enableTreeviewControllable = index.useFeatureFlag('enable-treeview-controllable');
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
39
41
|
const {
|
|
40
42
|
current: treeId
|
|
41
43
|
} = React.useRef(rest.id || useId.useId());
|
|
42
44
|
const prefix = usePrefix.usePrefix();
|
|
43
45
|
const treeClasses = cx(className, `${prefix}--tree`, {
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
44
47
|
// @ts-ignore - will always be false according to prop types
|
|
45
48
|
|
|
46
49
|
[`${prefix}--tree--${size}`]: size !== 'default'
|
|
@@ -66,6 +69,8 @@ const TreeView = ({
|
|
|
66
69
|
item.tabIndex = -1;
|
|
67
70
|
});
|
|
68
71
|
}
|
|
72
|
+
|
|
73
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
69
74
|
function handleTreeSelect(event, node) {
|
|
70
75
|
const nodeId = node.id;
|
|
71
76
|
if (nodeId) {
|
|
@@ -114,6 +119,7 @@ const TreeView = ({
|
|
|
114
119
|
if (match.match(event, keys.ArrowDown)) {
|
|
115
120
|
nextFocusNode = treeWalker.current.nextNode();
|
|
116
121
|
}
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
117
123
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
118
124
|
if (match.matches(event, [keys.Home, keys.End, {
|
|
119
125
|
code: 'KeyA'
|
|
@@ -130,6 +136,7 @@ const TreeView = ({
|
|
|
130
136
|
}
|
|
131
137
|
}
|
|
132
138
|
}
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
133
140
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
134
141
|
if (match.match(event, {
|
|
135
142
|
code: 'KeyA'
|
|
@@ -31,7 +31,9 @@ function HeaderContainer({
|
|
|
31
31
|
const handleHeaderMenuButtonClick = React.useCallback(() => {
|
|
32
32
|
setIsSideNavExpandedState(prevIsSideNavExpanded => !prevIsSideNavExpanded);
|
|
33
33
|
}, [setIsSideNavExpandedState]);
|
|
34
|
-
return /*#__PURE__*/React.createElement(Children
|
|
34
|
+
return /*#__PURE__*/React.createElement(Children
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
36
|
+
, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
35
37
|
isSideNavExpanded: isSideNavExpandedState,
|
|
36
38
|
onClickSideNavExpand: handleHeaderMenuButtonClick
|
|
37
39
|
}));
|
|
@@ -26,7 +26,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
26
26
|
*
|
|
27
27
|
* Note: children passed to this component should be an Icon.
|
|
28
28
|
*/
|
|
29
|
-
const HeaderGlobalAction = /*#__PURE__*/React.forwardRef(
|
|
29
|
+
const HeaderGlobalAction = /*#__PURE__*/React.forwardRef(({
|
|
30
30
|
'aria-label': ariaLabel,
|
|
31
31
|
'aria-labelledby': ariaLabelledBy,
|
|
32
32
|
children,
|
|
@@ -37,7 +37,7 @@ const HeaderGlobalAction = /*#__PURE__*/React.forwardRef(function HeaderGlobalAc
|
|
|
37
37
|
isActive,
|
|
38
38
|
tooltipAlignment,
|
|
39
39
|
...rest
|
|
40
|
-
}, ref) {
|
|
40
|
+
}, ref) => {
|
|
41
41
|
const prefix = usePrefix.usePrefix();
|
|
42
42
|
const className = cx({
|
|
43
43
|
[customClassName]: !!customClassName,
|
|
@@ -124,6 +124,7 @@ const HeaderMenu = frFn((props, ref) => {
|
|
|
124
124
|
*/
|
|
125
125
|
const renderMenuItem = (item, index) => {
|
|
126
126
|
if (/*#__PURE__*/React.isValidElement(item)) {
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
127
128
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
128
129
|
ref: handleItemRef(index)
|
|
129
130
|
});
|
|
@@ -161,9 +162,8 @@ const HeaderMenu = frFn((props, ref) => {
|
|
|
161
162
|
onBlur: events.composeEventHandlers([onBlur, handleOnBlur]),
|
|
162
163
|
ref: ref
|
|
163
164
|
}), /*#__PURE__*/React.createElement("a", _rollupPluginBabelHelpers.extends({
|
|
164
|
-
// eslint-disable-line jsx-a11y/
|
|
165
|
-
"aria-haspopup": "menu"
|
|
166
|
-
,
|
|
165
|
+
// eslint-disable-line jsx-a11y/anchor-is-valid
|
|
166
|
+
"aria-haspopup": "menu",
|
|
167
167
|
"aria-expanded": expanded,
|
|
168
168
|
className: linkClassName,
|
|
169
169
|
href: "#",
|
|
@@ -21,7 +21,7 @@ var useMergedRefs = require('../../internal/useMergedRefs.js');
|
|
|
21
21
|
var Switcher = require('./Switcher.js');
|
|
22
22
|
var noopFn = require('../../internal/noopFn.js');
|
|
23
23
|
|
|
24
|
-
const HeaderPanel = /*#__PURE__*/React.forwardRef(
|
|
24
|
+
const HeaderPanel = /*#__PURE__*/React.forwardRef(({
|
|
25
25
|
children,
|
|
26
26
|
className: customClassName,
|
|
27
27
|
expanded,
|
|
@@ -29,7 +29,7 @@ const HeaderPanel = /*#__PURE__*/React.forwardRef(function HeaderPanel({
|
|
|
29
29
|
onHeaderPanelFocus = noopFn.noopFn,
|
|
30
30
|
href,
|
|
31
31
|
...rest
|
|
32
|
-
}, ref) {
|
|
32
|
+
}, ref) => {
|
|
33
33
|
const prefix = usePrefix.usePrefix();
|
|
34
34
|
const headerPanelReference = React.useRef(null);
|
|
35
35
|
const headerPanelRef = useMergedRefs.useMergedRefs([headerPanelReference, ref]);
|
|
@@ -21,9 +21,11 @@ const LinkBase = ({
|
|
|
21
21
|
as: BaseComponent,
|
|
22
22
|
// Captured here to prevent it from being passed into the created element.
|
|
23
23
|
// See https://github.com/carbon-design-system/carbon/issues/3970
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
24
25
|
isSideNavExpanded: _isSideNavExpanded,
|
|
25
26
|
...rest
|
|
26
27
|
}, ref) => {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
27
29
|
const BaseComponentAsAny = BaseComponent ?? element ?? 'a';
|
|
28
30
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({
|
|
29
31
|
ref: ref
|
|
@@ -25,6 +25,7 @@ const SideNavItems = ({
|
|
|
25
25
|
const childrenWithExpandedState = React.Children.map(children, child => {
|
|
26
26
|
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
27
27
|
// avoid spreading `isSideNavExpanded` to non-Carbon UI Shell children
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
28
29
|
const childDisplayName = child.type?.displayName;
|
|
29
30
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
30
31
|
...(_utils.CARBON_SIDENAV_ITEMS.includes(childDisplayName) ? {
|
|
@@ -20,7 +20,7 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var SideNav = require('./SideNav.js');
|
|
21
21
|
|
|
22
22
|
var _ChevronDown;
|
|
23
|
-
const SideNavMenu = /*#__PURE__*/React.forwardRef(
|
|
23
|
+
const SideNavMenu = /*#__PURE__*/React.forwardRef(({
|
|
24
24
|
className: customClassName,
|
|
25
25
|
children,
|
|
26
26
|
defaultExpanded = false,
|
|
@@ -30,7 +30,7 @@ const SideNavMenu = /*#__PURE__*/React.forwardRef(function SideNavMenu({
|
|
|
30
30
|
isSideNavExpanded,
|
|
31
31
|
tabIndex,
|
|
32
32
|
title
|
|
33
|
-
}, ref) {
|
|
33
|
+
}, ref) => {
|
|
34
34
|
const {
|
|
35
35
|
isRail
|
|
36
36
|
} = React.useContext(SideNav.SideNavContext);
|
|
@@ -17,7 +17,7 @@ var SideNavLinkText = require('./SideNavLinkText.js');
|
|
|
17
17
|
var Link = require('./Link.js');
|
|
18
18
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
19
19
|
|
|
20
|
-
const SideNavMenuItem = /*#__PURE__*/React.forwardRef(
|
|
20
|
+
const SideNavMenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21
21
|
const prefix = usePrefix.usePrefix();
|
|
22
22
|
const {
|
|
23
23
|
children,
|
|
@@ -17,7 +17,7 @@ var useId = require('../../internal/useId.js');
|
|
|
17
17
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
18
18
|
|
|
19
19
|
var _ChevronDown;
|
|
20
|
-
const SideNavSwitcher = /*#__PURE__*/React.forwardRef(
|
|
20
|
+
const SideNavSwitcher = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21
21
|
const id = useId.useId('side-nav-switcher');
|
|
22
22
|
const prefix = usePrefix.usePrefix();
|
|
23
23
|
const {
|
|
@@ -45,7 +45,7 @@ require('./SideNavMenu.js');
|
|
|
45
45
|
require('./SideNavMenuItem.js');
|
|
46
46
|
require('./SideNavSwitcher.js');
|
|
47
47
|
|
|
48
|
-
const Switcher = /*#__PURE__*/React.forwardRef(
|
|
48
|
+
const Switcher = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
49
49
|
const switcherRef = React.useRef(null);
|
|
50
50
|
const ref = useMergedRefs.useMergedRefs([switcherRef, forwardRef]);
|
|
51
51
|
const prefix = usePrefix.usePrefix();
|
|
@@ -85,6 +85,7 @@ const Switcher = /*#__PURE__*/React.forwardRef(function Switcher(props, forwardR
|
|
|
85
85
|
if (direction === 1) {
|
|
86
86
|
return enabledIndices[1];
|
|
87
87
|
}
|
|
88
|
+
// eslint-disable-next-line no-fallthrough -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
88
89
|
default:
|
|
89
90
|
return enabledIndices[nextIndex];
|
|
90
91
|
}
|
|
@@ -19,7 +19,7 @@ var keys = require('../../internal/keyboard/keys.js');
|
|
|
19
19
|
var match = require('../../internal/keyboard/match.js');
|
|
20
20
|
var AriaPropTypes = require('../../prop-types/AriaPropTypes.js');
|
|
21
21
|
|
|
22
|
-
const SwitcherItem = /*#__PURE__*/React.forwardRef(
|
|
22
|
+
const SwitcherItem = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
23
23
|
const {
|
|
24
24
|
'aria-label': ariaLabel,
|
|
25
25
|
'aria-labelledby': ariaLabelledBy,
|
|
@@ -72,7 +72,9 @@ const SwitcherItem = /*#__PURE__*/React.forwardRef(function SwitcherItem(props,
|
|
|
72
72
|
},
|
|
73
73
|
href: href,
|
|
74
74
|
target: target,
|
|
75
|
-
rel: rel
|
|
75
|
+
rel: rel
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
77
|
+
,
|
|
76
78
|
ref: forwardRef
|
|
77
79
|
}, rest, {
|
|
78
80
|
className: linkClassName,
|
|
@@ -219,6 +219,7 @@ const FloatingMenu = ({
|
|
|
219
219
|
}
|
|
220
220
|
placeInProgressRef.current = false;
|
|
221
221
|
}
|
|
222
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
222
223
|
}, [floatingPosition, onPlace]);
|
|
223
224
|
|
|
224
225
|
// Attach a resize listener.
|
|
@@ -229,11 +230,13 @@ const FloatingMenu = ({
|
|
|
229
230
|
return () => {
|
|
230
231
|
resizeHandler.remove();
|
|
231
232
|
};
|
|
233
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
232
234
|
}, [triggerRef, menuOffset, menuDirection, flipped, target, updateOrientation]);
|
|
233
235
|
|
|
234
236
|
// Update menu position when key props change.
|
|
235
237
|
React.useEffect(() => {
|
|
236
238
|
updateMenuPosition();
|
|
239
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
237
240
|
}, [menuOffset, menuDirection, flipped, triggerRef, target, updateOrientation]);
|
|
238
241
|
|
|
239
242
|
/**
|
|
@@ -295,7 +298,10 @@ const FloatingMenu = ({
|
|
|
295
298
|
const focusTrapWithoutSentinels = FeatureFlags__namespace.enabled('enable-experimental-focus-wrap-without-sentinels');
|
|
296
299
|
if (typeof document !== 'undefined') {
|
|
297
300
|
const portalTarget = target ? target() : document.body;
|
|
298
|
-
return /*#__PURE__*/ReactDOM.createPortal(
|
|
301
|
+
return /*#__PURE__*/ReactDOM.createPortal(
|
|
302
|
+
/*#__PURE__*/
|
|
303
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
304
|
+
React.createElement("div", {
|
|
299
305
|
onBlur: focusTrap && !focusTrapWithoutSentinels ? handleBlur : undefined,
|
|
300
306
|
onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : undefined
|
|
301
307
|
}, !focusTrapWithoutSentinels && /*#__PURE__*/React.createElement("span", {
|
|
@@ -44,21 +44,28 @@ const useSelection = ({
|
|
|
44
44
|
const savedOnChange = React.useRef(onChange);
|
|
45
45
|
const [uncontrolledItems, setUncontrolledItems] = React.useState(initialSelectedItems);
|
|
46
46
|
const isControlled = !!controlledItems;
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
47
48
|
const selectedItems = isControlled ? controlledItems : uncontrolledItems;
|
|
48
49
|
const onItemChange = React.useCallback(item => {
|
|
49
50
|
if (disabled) return;
|
|
50
51
|
|
|
51
52
|
// Assert special properties (e.g., `disabled`, `isSelectAll`, etc.) are
|
|
52
53
|
// `any` since those properties aren’t part of the generic type.
|
|
53
|
-
const allSelectableItems = filteredItems.filter(
|
|
54
|
-
|
|
54
|
+
const allSelectableItems = filteredItems.filter(
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
56
|
+
item => !item?.disabled && !item?.isSelectAll);
|
|
57
|
+
const disabledItemCount = filteredItems.filter(
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
59
|
+
item => item?.disabled).length;
|
|
55
60
|
let newSelectedItems;
|
|
56
61
|
|
|
57
62
|
// deselect all on click to All/indeterminate option
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
58
64
|
if (item?.isSelectAll && selectedItems.length > 0) {
|
|
59
65
|
newSelectedItems = [];
|
|
60
66
|
}
|
|
61
67
|
// select all options
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
62
69
|
else if (item?.isSelectAll && selectedItems.length === 0) {
|
|
63
70
|
newSelectedItems = allSelectableItems;
|
|
64
71
|
} else {
|
|
@@ -71,7 +78,9 @@ const useSelection = ({
|
|
|
71
78
|
}
|
|
72
79
|
} else {
|
|
73
80
|
newSelectedItems = removeAtIndex(selectedItems, selectedIndex);
|
|
74
|
-
newSelectedItems = newSelectedItems.filter(
|
|
81
|
+
newSelectedItems = newSelectedItems.filter(
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
83
|
+
item => !item?.isSelectAll);
|
|
75
84
|
}
|
|
76
85
|
}
|
|
77
86
|
callOnChangeHandler({
|
|
@@ -18,6 +18,7 @@ var React = require('react');
|
|
|
18
18
|
* node, assigns that node to every ref in the array.
|
|
19
19
|
*/
|
|
20
20
|
const useMergedRefs = refs => {
|
|
21
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
21
22
|
const memoizedRefs = React.useMemo(() => refs, refs);
|
|
22
23
|
return React.useCallback(node => {
|
|
23
24
|
memoizedRefs.forEach(ref => {
|
|
@@ -16,13 +16,16 @@ const useNoInteractiveChildren = (ref, message = 'component should have no inter
|
|
|
16
16
|
/*
|
|
17
17
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
18
18
|
*/
|
|
19
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
19
20
|
React.useEffect(() => {
|
|
20
21
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
21
22
|
if (node) {
|
|
22
23
|
const errorMessage = `Error: ${message}.\n\nInstead found: ${node.outerHTML}`;
|
|
24
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
23
25
|
console.error(errorMessage);
|
|
24
26
|
throw new Error(errorMessage);
|
|
25
27
|
}
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
26
29
|
}, []);
|
|
27
30
|
}
|
|
28
31
|
};
|
|
@@ -33,6 +36,7 @@ const useInteractiveChildrenNeedDescription = (ref, message = `interactive child
|
|
|
33
36
|
/*
|
|
34
37
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
35
38
|
*/
|
|
39
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
36
40
|
React.useEffect(() => {
|
|
37
41
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
38
42
|
if (node && !node.hasAttribute('aria-describedby')) {
|
|
@@ -25,6 +25,7 @@ const useOutsideClick = (ref, callback) => {
|
|
|
25
25
|
/*
|
|
26
26
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
27
27
|
*/
|
|
28
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
28
29
|
useEvent.useWindowEvent('click', event => {
|
|
29
30
|
const {
|
|
30
31
|
target
|
|
@@ -40,6 +40,7 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
40
40
|
setMaxWidth(newMax);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
43
44
|
useResizeObserver.useResizeObserver({
|
|
44
45
|
ref: containerRef,
|
|
45
46
|
onResize: handleResize
|
|
@@ -89,14 +90,17 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
89
90
|
};
|
|
90
91
|
|
|
91
92
|
// Memoize visible items calculation to avoid recalculating on every render
|
|
93
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
92
94
|
const visibleItems = React.useMemo(() => {
|
|
93
95
|
if (!Array.isArray(items)) {
|
|
94
96
|
return [];
|
|
95
97
|
}
|
|
96
98
|
return getVisibleItems();
|
|
99
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
97
100
|
}, [items, maxWidth, maxItems]);
|
|
98
101
|
|
|
99
102
|
// Memoize hidden items calculation
|
|
103
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
100
104
|
const hiddenItems = React.useMemo(() => {
|
|
101
105
|
if (!Array.isArray(items)) {
|
|
102
106
|
return [];
|
|
@@ -105,9 +109,11 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
105
109
|
}, [items, visibleItems]);
|
|
106
110
|
|
|
107
111
|
// Use previous value to compare and only call onChange when needed
|
|
112
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
108
113
|
const previousHiddenItems = usePreviousValue.usePreviousValue(hiddenItems);
|
|
109
114
|
|
|
110
115
|
// Only call onChange if hidden items actually changed
|
|
116
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
111
117
|
React.useEffect(() => {
|
|
112
118
|
}, [hiddenItems, previousHiddenItems, onChange]);
|
|
113
119
|
return {
|
|
@@ -37,6 +37,7 @@ const useResizeObserver = ({
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
getInitialSize();
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
40
41
|
}, [width, height]);
|
|
41
42
|
React.useLayoutEffect(() => {
|
|
42
43
|
if (!ref?.current) {
|
|
@@ -49,6 +50,8 @@ const useResizeObserver = ({
|
|
|
49
50
|
const entry = entriesToHandle.current[0];
|
|
50
51
|
setWidth(entry.contentRect.width);
|
|
51
52
|
setHeight(entry.contentRect.height);
|
|
53
|
+
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
52
55
|
cb.current && cb.current(entry.contentRect);
|
|
53
56
|
};
|
|
54
57
|
const observer = new ResizeObserver(entries => {
|
|
@@ -65,6 +68,7 @@ const useResizeObserver = ({
|
|
|
65
68
|
return () => {
|
|
66
69
|
observer.disconnect();
|
|
67
70
|
};
|
|
71
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
68
72
|
}, []);
|
|
69
73
|
return {
|
|
70
74
|
width,
|
|
@@ -17,6 +17,7 @@ var React = require('react');
|
|
|
17
17
|
*
|
|
18
18
|
* @param callback - The callback to track.
|
|
19
19
|
*/
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
20
21
|
const useSavedCallback = callback => {
|
|
21
22
|
const savedCallback = React.useRef(callback);
|
|
22
23
|
React.useEffect(() => {
|
package/lib/internal/warning.js
CHANGED
|
@@ -24,6 +24,7 @@ const warning = process.env.NODE_ENV !== 'production' ? (condition, message) =>
|
|
|
24
24
|
throw new Error('`warning(condition, message)` requires a warning ' + 'format argument');
|
|
25
25
|
}
|
|
26
26
|
if (!condition) {
|
|
27
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
27
28
|
console.warn('Warning: ' + message);
|
|
28
29
|
}
|
|
29
30
|
} : noopFn.noopFn;
|
|
@@ -15,9 +15,12 @@
|
|
|
15
15
|
* are the names of the props, and the values are the prop-type validators.
|
|
16
16
|
* @returns A new object of wrapped prop-type validators.
|
|
17
17
|
*/
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
18
19
|
const isRequiredOneOf = propTypes => {
|
|
19
20
|
const names = Object.keys(propTypes);
|
|
20
|
-
const checker = propType =>
|
|
21
|
+
const checker = propType =>
|
|
22
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
23
|
+
(props, propName, componentName, ...rest) => {
|
|
21
24
|
if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
|
|
22
25
|
return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
|
|
23
26
|
}
|
package/lib/tools/events.js
CHANGED
|
@@ -16,7 +16,9 @@
|
|
|
16
16
|
* @param handlers - An array of event handler functions.
|
|
17
17
|
* @returns A composite event handler.
|
|
18
18
|
*/
|
|
19
|
-
const composeEventHandlers = handlers =>
|
|
19
|
+
const composeEventHandlers = handlers =>
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
21
|
+
(event, ...args) => {
|
|
20
22
|
for (const handler of handlers) {
|
|
21
23
|
if (event.defaultPrevented) {
|
|
22
24
|
break;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.90.0
|
|
4
|
+
"version": "1.90.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -53,10 +53,10 @@
|
|
|
53
53
|
"dependencies": {
|
|
54
54
|
"@babel/runtime": "^7.27.3",
|
|
55
55
|
"@carbon/feature-flags": "^0.30.0",
|
|
56
|
-
"@carbon/icons-react": "^11.66.0
|
|
57
|
-
"@carbon/layout": "^11.40.0
|
|
58
|
-
"@carbon/styles": "^1.89.0
|
|
59
|
-
"@carbon/utilities": "^0.
|
|
56
|
+
"@carbon/icons-react": "^11.66.0",
|
|
57
|
+
"@carbon/layout": "^11.40.0",
|
|
58
|
+
"@carbon/styles": "^1.89.0",
|
|
59
|
+
"@carbon/utilities": "^0.9.0",
|
|
60
60
|
"@floating-ui/react": "^0.27.4",
|
|
61
61
|
"@ibm/telemetry-js": "^1.5.0",
|
|
62
62
|
"classnames": "2.5.1",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"@babel/preset-env": "^7.27.2",
|
|
80
80
|
"@babel/preset-react": "^7.27.1",
|
|
81
81
|
"@babel/preset-typescript": "^7.27.1",
|
|
82
|
-
"@carbon/test-utils": "^10.38.0
|
|
83
|
-
"@carbon/themes": "^11.59.0
|
|
82
|
+
"@carbon/test-utils": "^10.38.0",
|
|
83
|
+
"@carbon/themes": "^11.59.0",
|
|
84
84
|
"@figma/code-connect": "^1.3.2",
|
|
85
85
|
"@rollup/plugin-babel": "^6.0.0",
|
|
86
86
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"storybook": "^9.0.5",
|
|
123
123
|
"stream-browserify": "^3.0.0",
|
|
124
124
|
"style-loader": "^4.0.0",
|
|
125
|
-
"typescript-config-carbon": "^0.
|
|
125
|
+
"typescript-config-carbon": "^0.7.0",
|
|
126
126
|
"use-sync-external-store": "^1.5.0",
|
|
127
127
|
"webpack": "^5.65.0",
|
|
128
128
|
"webpack-dev-server": "^5.0.0"
|
|
@@ -138,5 +138,5 @@
|
|
|
138
138
|
"**/*.scss",
|
|
139
139
|
"**/*.css"
|
|
140
140
|
],
|
|
141
|
-
"gitHead": "
|
|
141
|
+
"gitHead": "7c8548ba752bea350cc1c6a4955b1b5184429015"
|
|
142
142
|
}
|