@carbon/react 1.92.0 → 1.93.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +1011 -970
- package/es/components/AILabel/index.js +4 -4
- package/es/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/es/components/Button/Button.js +2 -2
- package/es/components/ChatButton/ChatButton.js +1 -1
- package/es/components/Checkbox/Checkbox.js +1 -1
- package/es/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/es/components/ComboBox/ComboBox.d.ts +3 -11
- package/es/components/ComboBox/ComboBox.js +15 -25
- package/es/components/ComboButton/index.d.ts +5 -8
- package/es/components/ComboButton/index.js +9 -12
- package/es/components/ComposedModal/ComposedModal.js +22 -36
- package/es/components/DataTable/DataTable.d.ts +25 -16
- package/es/components/DataTable/DataTable.js +33 -34
- package/es/components/DataTable/Table.js +2 -2
- package/es/components/DataTable/TableBatchActions.d.ts +49 -10
- package/es/components/DataTable/TableBatchActions.js +26 -21
- package/es/components/DataTable/TableExpandHeader.js +2 -2
- package/es/components/DataTable/TableExpandRow.js +1 -1
- package/es/components/DataTable/TableHeader.d.ts +8 -10
- package/es/components/DataTable/TableHeader.js +11 -13
- package/es/components/DataTable/TableRow.js +5 -5
- package/es/components/DataTable/TableSlugRow.js +1 -1
- package/es/components/DataTable/TableToolbarMenu.js +1 -1
- package/es/components/DataTable/TableToolbarSearch.d.ts +8 -7
- package/es/components/DataTable/TableToolbarSearch.js +11 -11
- package/es/components/DataTable/index.d.ts +2 -2
- package/es/components/DataTable/state/sorting.d.ts +2 -2
- package/es/components/DataTable/state/sorting.js +1 -1
- package/es/components/DataTable/tools/sorting.js +1 -1
- package/es/components/DatePicker/DatePicker.js +9 -9
- package/es/components/DatePickerInput/DatePickerInput.js +5 -5
- package/es/components/Dialog/Dialog.js +6 -6
- package/es/components/Dropdown/Dropdown.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.js +8 -8
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
- package/es/components/FileUploader/FileUploader.js +4 -4
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +2 -2
- package/es/components/FluidComboBox/FluidComboBox.d.ts +4 -7
- package/es/components/FluidComboBox/FluidComboBox.js +1 -1
- package/es/components/FluidDropdown/FluidDropdown.d.ts +4 -8
- package/es/components/FluidDropdown/FluidDropdown.js +1 -1
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
- package/es/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
- package/es/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/es/components/FluidSearch/FluidSearch.js +1 -1
- package/es/components/FluidSelect/FluidSelect.js +1 -1
- package/es/components/FluidTextInput/FluidTextInput.js +1 -1
- package/es/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
- package/es/components/Grid/CSSGrid.js +3 -3
- package/es/components/Grid/Column.js +2 -2
- package/es/components/Grid/ColumnHang.js +1 -1
- package/es/components/Grid/FlexGrid.js +1 -1
- package/es/components/Grid/Row.js +1 -1
- package/es/components/Heading/index.js +2 -2
- package/es/components/IconButton/index.js +2 -2
- package/es/components/IconIndicator/index.js +2 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/es/components/Layout/index.js +2 -2
- package/es/components/LayoutDirection/LayoutDirection.js +1 -1
- package/es/components/Link/Link.js +2 -2
- package/es/components/ListBox/ListBoxField.d.ts +0 -1
- package/es/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
- package/es/components/ListBox/ListBoxMenuIcon.js +10 -6
- package/es/components/ListBox/ListBoxMenuItem.js +2 -2
- package/es/components/ListBox/ListBoxSelection.d.ts +3 -6
- package/es/components/ListBox/ListBoxSelection.js +5 -10
- package/es/components/ListBox/index.d.ts +5 -3
- package/es/components/ListBox/next/ListBoxSelection.d.ts +6 -13
- package/es/components/ListBox/next/ListBoxSelection.js +16 -8
- package/es/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
- package/es/components/ListBox/next/ListBoxTrigger.js +6 -6
- package/es/components/Menu/MenuContext.js +1 -1
- package/es/components/Menu/MenuItem.js +1 -1
- package/es/components/MenuButton/index.js +5 -5
- package/es/components/Modal/Modal.js +20 -36
- package/es/components/ModalWrapper/ModalWrapper.js +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
- package/es/components/MultiSelect/FilterableMultiSelect.js +18 -27
- package/es/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/es/components/MultiSelect/MultiSelect.js +12 -12
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/NumberInput/NumberInput.d.ts +2 -5
- package/es/components/NumberInput/NumberInput.js +13 -18
- package/es/components/OverflowMenu/OverflowMenu.d.ts +2 -2
- package/es/components/OverflowMenu/OverflowMenu.js +4 -4
- package/es/components/OverflowMenu/next/index.d.ts +1 -1
- package/es/components/OverflowMenu/next/index.js +2 -2
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/es/components/PageHeader/PageHeader.js +12 -12
- package/es/components/Pagination/Pagination.js +3 -3
- package/es/components/PaginationNav/PaginationNav.d.ts +6 -9
- package/es/components/PaginationNav/PaginationNav.js +21 -22
- package/es/components/Popover/index.js +8 -8
- package/es/components/ProgressBar/ProgressBar.js +2 -2
- package/es/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
- package/es/components/ProgressIndicator/ProgressIndicator.js +15 -15
- package/es/components/RadioButton/RadioButton.js +1 -1
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/es/components/RadioTile/RadioTile.js +1 -1
- package/es/components/Select/Select.js +7 -5
- package/es/components/ShapeIndicator/index.js +2 -2
- package/es/components/Slider/Slider.d.ts +7 -9
- package/es/components/Slider/Slider.js +16 -20
- package/es/components/Stack/HStack.js +1 -1
- package/es/components/Stack/Stack.js +1 -1
- package/es/components/Stack/VStack.js +1 -1
- package/es/components/StructuredList/StructuredList.js +3 -3
- package/es/components/Tabs/Tabs.js +12 -12
- package/es/components/Tag/DismissibleTag.js +3 -3
- package/es/components/Tag/OperationalTag.js +2 -2
- package/es/components/Tag/SelectableTag.js +2 -2
- package/es/components/Tag/Tag.js +4 -4
- package/es/components/Tag/isEllipsisActive.js +1 -1
- package/es/components/Text/Text.js +1 -1
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/TextInput/PasswordInput.js +4 -4
- package/es/components/TextInput/TextInput.js +3 -3
- package/es/components/Theme/index.js +3 -3
- package/es/components/Tile/Tile.js +3 -3
- package/es/components/TimePicker/TimePicker.js +1 -1
- package/es/components/Toggletip/index.js +4 -4
- package/es/components/Tooltip/DefinitionTooltip.js +1 -1
- package/es/components/Tooltip/Tooltip.js +3 -3
- package/es/components/TreeView/TreeNode.js +6 -6
- package/es/components/TreeView/TreeView.js +5 -5
- package/es/components/UIShell/HeaderContainer.js +1 -1
- package/es/components/UIShell/HeaderMenu.js +1 -1
- package/es/components/UIShell/Link.js +2 -2
- package/es/components/UIShell/SideNavItems.js +1 -1
- package/es/components/UIShell/Switcher.js +1 -1
- package/es/components/UIShell/SwitcherItem.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/internal/FloatingMenu.js +4 -4
- package/es/internal/Selection.js +6 -6
- package/es/internal/useMergedRefs.js +1 -1
- package/es/internal/useNoInteractiveChildren.js +4 -4
- package/es/internal/useOutsideClick.js +1 -1
- package/es/internal/useOverflowItems.js +6 -6
- package/es/internal/useResizeObserver.js +3 -3
- package/es/internal/useSavedCallback.js +1 -1
- package/es/internal/warning.js +1 -1
- package/es/prop-types/isRequiredOneOf.js +2 -2
- package/es/tools/events.js +1 -1
- package/es/tools/wrapComponent.js +1 -1
- package/es/types/common.d.ts +6 -2
- package/lib/components/AILabel/index.js +4 -4
- package/lib/components/Breadcrumb/BreadcrumbItem.js +1 -1
- package/lib/components/Button/Button.js +2 -2
- package/lib/components/ChatButton/ChatButton.js +1 -1
- package/lib/components/Checkbox/Checkbox.js +1 -1
- package/lib/components/CheckboxGroup/CheckboxGroup.js +1 -1
- package/lib/components/ComboBox/ComboBox.d.ts +3 -11
- package/lib/components/ComboBox/ComboBox.js +15 -25
- package/lib/components/ComboButton/index.d.ts +5 -8
- package/lib/components/ComboButton/index.js +9 -12
- package/lib/components/ComposedModal/ComposedModal.js +21 -35
- package/lib/components/DataTable/DataTable.d.ts +25 -16
- package/lib/components/DataTable/DataTable.js +33 -34
- package/lib/components/DataTable/Table.js +2 -2
- package/lib/components/DataTable/TableBatchActions.d.ts +49 -10
- package/lib/components/DataTable/TableBatchActions.js +26 -21
- package/lib/components/DataTable/TableExpandHeader.js +2 -2
- package/lib/components/DataTable/TableExpandRow.js +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +8 -10
- package/lib/components/DataTable/TableHeader.js +11 -13
- package/lib/components/DataTable/TableRow.js +5 -5
- package/lib/components/DataTable/TableSlugRow.js +1 -1
- package/lib/components/DataTable/TableToolbarMenu.js +1 -1
- package/lib/components/DataTable/TableToolbarSearch.d.ts +8 -7
- package/lib/components/DataTable/TableToolbarSearch.js +11 -11
- package/lib/components/DataTable/index.d.ts +2 -2
- package/lib/components/DataTable/state/sorting.d.ts +2 -2
- package/lib/components/DataTable/state/sorting.js +1 -1
- package/lib/components/DataTable/tools/sorting.js +1 -1
- package/lib/components/DatePicker/DatePicker.js +9 -9
- package/lib/components/DatePickerInput/DatePickerInput.js +5 -5
- package/lib/components/Dialog/Dialog.js +6 -6
- package/lib/components/Dropdown/Dropdown.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.js +8 -8
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -1
- package/lib/components/FileUploader/FileUploader.js +4 -4
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +2 -2
- package/lib/components/FluidComboBox/FluidComboBox.d.ts +4 -7
- package/lib/components/FluidComboBox/FluidComboBox.js +1 -1
- package/lib/components/FluidDropdown/FluidDropdown.d.ts +4 -8
- package/lib/components/FluidDropdown/FluidDropdown.js +1 -1
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +3 -7
- package/lib/components/FluidMultiSelect/FluidMultiSelect.d.ts +3 -7
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +3 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +4 -7
- package/lib/components/FluidNumberInput/FluidNumberInput.js +2 -2
- package/lib/components/FluidSearch/FluidSearch.js +1 -1
- package/lib/components/FluidSelect/FluidSelect.js +1 -1
- package/lib/components/FluidTextInput/FluidTextInput.js +1 -1
- package/lib/components/FluidTimePicker/FluidTimePicker.js +3 -3
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +1 -1
- package/lib/components/Grid/CSSGrid.js +3 -3
- package/lib/components/Grid/Column.js +2 -2
- package/lib/components/Grid/ColumnHang.js +1 -1
- package/lib/components/Grid/FlexGrid.js +1 -1
- package/lib/components/Grid/Row.js +1 -1
- package/lib/components/Heading/index.js +2 -2
- package/lib/components/IconButton/index.js +2 -2
- package/lib/components/IconIndicator/index.js +2 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +1 -1
- package/lib/components/Layout/index.js +2 -2
- package/lib/components/LayoutDirection/LayoutDirection.js +1 -1
- package/lib/components/Link/Link.js +2 -2
- package/lib/components/ListBox/ListBoxField.d.ts +0 -1
- package/lib/components/ListBox/ListBoxMenuIcon.d.ts +8 -4
- package/lib/components/ListBox/ListBoxMenuIcon.js +10 -6
- package/lib/components/ListBox/ListBoxMenuItem.js +2 -2
- package/lib/components/ListBox/ListBoxSelection.d.ts +3 -6
- package/lib/components/ListBox/ListBoxSelection.js +4 -10
- package/lib/components/ListBox/index.d.ts +5 -3
- package/lib/components/ListBox/next/ListBoxSelection.d.ts +6 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +16 -8
- package/lib/components/ListBox/next/ListBoxTrigger.d.ts +5 -10
- package/lib/components/ListBox/next/ListBoxTrigger.js +5 -6
- package/lib/components/Menu/MenuContext.js +1 -1
- package/lib/components/Menu/MenuItem.js +1 -1
- package/lib/components/MenuButton/index.js +5 -5
- package/lib/components/Modal/Modal.js +19 -35
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +3 -12
- package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -27
- package/lib/components/MultiSelect/MultiSelect.d.ts +2 -2
- package/lib/components/MultiSelect/MultiSelect.js +12 -12
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/NumberInput/NumberInput.d.ts +2 -5
- package/lib/components/NumberInput/NumberInput.js +12 -18
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +2 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +4 -4
- package/lib/components/OverflowMenu/next/index.d.ts +1 -1
- package/lib/components/OverflowMenu/next/index.js +2 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -2
- package/lib/components/PageHeader/PageHeader.js +12 -12
- package/lib/components/Pagination/Pagination.js +3 -3
- package/lib/components/PaginationNav/PaginationNav.d.ts +6 -9
- package/lib/components/PaginationNav/PaginationNav.js +21 -22
- package/lib/components/Popover/index.js +8 -8
- package/lib/components/ProgressBar/ProgressBar.js +2 -2
- package/lib/components/ProgressIndicator/ProgressIndicator.d.ts +11 -15
- package/lib/components/ProgressIndicator/ProgressIndicator.js +15 -15
- package/lib/components/RadioButton/RadioButton.js +1 -1
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +1 -1
- package/lib/components/RadioTile/RadioTile.js +1 -1
- package/lib/components/Select/Select.js +7 -5
- package/lib/components/ShapeIndicator/index.js +2 -2
- package/lib/components/Slider/Slider.d.ts +7 -9
- package/lib/components/Slider/Slider.js +16 -20
- package/lib/components/Stack/HStack.js +1 -1
- package/lib/components/Stack/Stack.js +1 -1
- package/lib/components/Stack/VStack.js +1 -1
- package/lib/components/StructuredList/StructuredList.js +3 -3
- package/lib/components/Tabs/Tabs.js +12 -12
- package/lib/components/Tag/DismissibleTag.js +3 -3
- package/lib/components/Tag/OperationalTag.js +2 -2
- package/lib/components/Tag/SelectableTag.js +2 -2
- package/lib/components/Tag/Tag.js +4 -4
- package/lib/components/Tag/isEllipsisActive.js +1 -1
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/TextArea/TextArea.js +1 -1
- package/lib/components/TextInput/PasswordInput.js +4 -4
- package/lib/components/TextInput/TextInput.js +3 -3
- package/lib/components/Theme/index.js +3 -3
- package/lib/components/Tile/Tile.js +3 -3
- package/lib/components/TimePicker/TimePicker.js +1 -1
- package/lib/components/Toggletip/index.js +4 -4
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -1
- package/lib/components/Tooltip/Tooltip.js +3 -3
- package/lib/components/TreeView/TreeNode.js +6 -6
- package/lib/components/TreeView/TreeView.js +5 -5
- package/lib/components/UIShell/HeaderContainer.js +1 -1
- package/lib/components/UIShell/HeaderMenu.js +1 -1
- package/lib/components/UIShell/Link.js +2 -2
- package/lib/components/UIShell/SideNavItems.js +1 -1
- package/lib/components/UIShell/Switcher.js +1 -1
- package/lib/components/UIShell/SwitcherItem.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/internal/FloatingMenu.js +4 -4
- package/lib/internal/Selection.js +6 -6
- package/lib/internal/useMergedRefs.js +1 -1
- package/lib/internal/useNoInteractiveChildren.js +4 -4
- package/lib/internal/useOutsideClick.js +1 -1
- package/lib/internal/useOverflowItems.js +6 -6
- package/lib/internal/useResizeObserver.js +3 -3
- package/lib/internal/useSavedCallback.js +1 -1
- package/lib/internal/warning.js +1 -1
- package/lib/prop-types/isRequiredOneOf.js +2 -2
- package/lib/tools/events.js +1 -1
- package/lib/tools/wrapComponent.js +1 -1
- package/lib/types/common.d.ts +6 -2
- package/package.json +9 -9
|
@@ -24,7 +24,7 @@ var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
|
24
24
|
* Event types that trigger a "drag" to stop.
|
|
25
25
|
*/
|
|
26
26
|
const DRAG_STOP_EVENT_TYPES = new Set(['mouseup', 'touchend', 'touchcancel']);
|
|
27
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
27
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
28
28
|
const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
29
29
|
as,
|
|
30
30
|
align = 'top',
|
|
@@ -72,7 +72,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
72
72
|
'aria-describedby': describedBy
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
76
76
|
function getChildEventHandlers(childProps) {
|
|
77
77
|
const eventHandlerFunctions = Object.keys(triggerProps).filter(prop => prop.startsWith('on'));
|
|
78
78
|
const eventHandlers = {};
|
|
@@ -161,7 +161,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
161
161
|
}, [isDragging, onDragStop]);
|
|
162
162
|
return (
|
|
163
163
|
/*#__PURE__*/
|
|
164
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
164
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
165
165
|
React.createElement(index.Popover, _rollupPluginBabelHelpers.extends({
|
|
166
166
|
as: as,
|
|
167
167
|
ref: ref
|
|
@@ -76,11 +76,11 @@ const useEllipsisCheck = (label, detailsWrapperRef) => {
|
|
|
76
76
|
cancelAnimationFrame(animationFrameId);
|
|
77
77
|
if (resizeObserver) {
|
|
78
78
|
if (labelTextRef.current) {
|
|
79
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
79
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
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/
|
|
83
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
84
84
|
resizeObserver.unobserve(detailsWrapperRef.current);
|
|
85
85
|
}
|
|
86
86
|
resizeObserver.disconnect();
|
|
@@ -132,7 +132,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
132
132
|
} = useEllipsisCheck(label, detailsWrapperRef);
|
|
133
133
|
const enableTreeviewControllable = index.useFeatureFlag('enable-treeview-controllable');
|
|
134
134
|
|
|
135
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
135
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
136
136
|
const {
|
|
137
137
|
current: id
|
|
138
138
|
} = React.useRef(nodeId || useId.useId());
|
|
@@ -377,7 +377,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
377
377
|
ref: currentNodeLabel
|
|
378
378
|
}, children &&
|
|
379
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/
|
|
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/20452
|
|
381
381
|
React.createElement("span", {
|
|
382
382
|
className: `${prefix}--tree-parent-node__toggle`,
|
|
383
383
|
onClick: handleToggleClick
|
|
@@ -478,14 +478,14 @@ TreeNode.propTypes = {
|
|
|
478
478
|
/**
|
|
479
479
|
* A component used to render an icon.
|
|
480
480
|
*/
|
|
481
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
481
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
482
482
|
// @ts-ignore
|
|
483
483
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
484
484
|
/**
|
|
485
485
|
* **Note:** this is controlled by the parent TreeView component, do not set manually.
|
|
486
486
|
* Array containing all selected node IDs in the tree
|
|
487
487
|
*/
|
|
488
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
488
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
489
489
|
// @ts-ignore
|
|
490
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.'),
|
|
491
491
|
/**
|
|
@@ -37,13 +37,13 @@ const TreeView = ({
|
|
|
37
37
|
}) => {
|
|
38
38
|
const enableTreeviewControllable = index.useFeatureFlag('enable-treeview-controllable');
|
|
39
39
|
|
|
40
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
40
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
41
41
|
const {
|
|
42
42
|
current: treeId
|
|
43
43
|
} = React.useRef(rest.id || useId.useId());
|
|
44
44
|
const prefix = usePrefix.usePrefix();
|
|
45
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/
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
47
47
|
// @ts-ignore - will always be false according to prop types
|
|
48
48
|
|
|
49
49
|
[`${prefix}--tree--${size}`]: size !== 'default'
|
|
@@ -70,7 +70,7 @@ const TreeView = ({
|
|
|
70
70
|
});
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
73
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
74
74
|
function handleTreeSelect(event, node) {
|
|
75
75
|
const nodeId = node.id;
|
|
76
76
|
if (nodeId) {
|
|
@@ -119,7 +119,7 @@ const TreeView = ({
|
|
|
119
119
|
if (match.match(event, keys.ArrowDown)) {
|
|
120
120
|
nextFocusNode = treeWalker.current.nextNode();
|
|
121
121
|
}
|
|
122
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
123
123
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
124
124
|
if (match.matches(event, [keys.Home, keys.End, {
|
|
125
125
|
code: 'KeyA'
|
|
@@ -136,7 +136,7 @@ const TreeView = ({
|
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
139
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
140
140
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
141
141
|
if (match.match(event, {
|
|
142
142
|
code: 'KeyA'
|
|
@@ -32,7 +32,7 @@ function HeaderContainer({
|
|
|
32
32
|
setIsSideNavExpandedState(prevIsSideNavExpanded => !prevIsSideNavExpanded);
|
|
33
33
|
}, [setIsSideNavExpandedState]);
|
|
34
34
|
return /*#__PURE__*/React.createElement(Children
|
|
35
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
35
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
36
36
|
, _rollupPluginBabelHelpers.extends({}, rest, {
|
|
37
37
|
isSideNavExpanded: isSideNavExpandedState,
|
|
38
38
|
onClickSideNavExpand: handleHeaderMenuButtonClick
|
|
@@ -124,7 +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/
|
|
127
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
128
128
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
129
129
|
ref: handleItemRef(index)
|
|
130
130
|
});
|
|
@@ -21,11 +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/
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
25
25
|
isSideNavExpanded: _isSideNavExpanded,
|
|
26
26
|
...rest
|
|
27
27
|
}, ref) => {
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
29
29
|
const BaseComponentAsAny = BaseComponent ?? element ?? 'a';
|
|
30
30
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _rollupPluginBabelHelpers.extends({
|
|
31
31
|
ref: ref
|
|
@@ -25,7 +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/
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
29
29
|
const childDisplayName = child.type?.displayName;
|
|
30
30
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
31
31
|
...(_utils.CARBON_SIDENAV_ITEMS.includes(childDisplayName) ? {
|
|
@@ -59,7 +59,7 @@ const Switcher = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
59
59
|
if (direction === 1) {
|
|
60
60
|
return enabledIndices[1];
|
|
61
61
|
}
|
|
62
|
-
// eslint-disable-next-line no-fallthrough -- https://github.com/carbon-design-system/carbon/issues/
|
|
62
|
+
// eslint-disable-next-line no-fallthrough -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
63
63
|
default:
|
|
64
64
|
return enabledIndices[nextIndex];
|
|
65
65
|
}
|
|
@@ -73,7 +73,7 @@ const SwitcherItem = /*#__PURE__*/React.forwardRef((props, forwardRef) => {
|
|
|
73
73
|
href: href,
|
|
74
74
|
target: target,
|
|
75
75
|
rel: rel
|
|
76
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
76
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
77
77
|
,
|
|
78
78
|
ref: forwardRef
|
|
79
79
|
}, rest, {
|
package/lib/index.d.ts
CHANGED
|
@@ -245,7 +245,7 @@ export type { ListBoxFieldProps } from './components/ListBox/ListBoxField';
|
|
|
245
245
|
export type { ListBoxMenuProps } from './components/ListBox/ListBoxMenu';
|
|
246
246
|
export type { ListBoxMenuItemProps } from './components/ListBox/ListBoxMenuItem';
|
|
247
247
|
export type { ListBoxMenuIconProps } from './components/ListBox/ListBoxMenuIcon';
|
|
248
|
-
export type { ListBoxMenuIconTranslationKey } from './components/ListBox
|
|
248
|
+
export type { ListBoxMenuIconTranslationKey, ListBoxSelectionTranslationKey, } from './components/ListBox';
|
|
249
249
|
export type { ListBoxMenuIconComponent } from './components/ListBox/ListBoxMenuIcon';
|
|
250
250
|
export type { ListBoxSelectionProps } from './components/ListBox/ListBoxSelection';
|
|
251
251
|
export type { ListItemProps } from './components/ListItem/ListItem';
|
|
@@ -219,7 +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/
|
|
222
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
223
223
|
}, [floatingPosition, onPlace]);
|
|
224
224
|
|
|
225
225
|
// Attach a resize listener.
|
|
@@ -230,13 +230,13 @@ const FloatingMenu = ({
|
|
|
230
230
|
return () => {
|
|
231
231
|
resizeHandler.remove();
|
|
232
232
|
};
|
|
233
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
233
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
234
234
|
}, [triggerRef, menuOffset, menuDirection, flipped, target, updateOrientation]);
|
|
235
235
|
|
|
236
236
|
// Update menu position when key props change.
|
|
237
237
|
React.useEffect(() => {
|
|
238
238
|
updateMenuPosition();
|
|
239
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
239
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
240
240
|
}, [menuOffset, menuDirection, flipped, triggerRef, target, updateOrientation]);
|
|
241
241
|
|
|
242
242
|
/**
|
|
@@ -300,7 +300,7 @@ const FloatingMenu = ({
|
|
|
300
300
|
const portalTarget = target ? target() : document.body;
|
|
301
301
|
return /*#__PURE__*/ReactDOM.createPortal(
|
|
302
302
|
/*#__PURE__*/
|
|
303
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- https://github.com/carbon-design-system/carbon/issues/
|
|
303
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
304
304
|
React.createElement("div", {
|
|
305
305
|
onBlur: focusTrap && !focusTrapWithoutSentinels ? handleBlur : undefined,
|
|
306
306
|
onKeyDown: focusTrapWithoutSentinels ? handleKeyDown : undefined
|
|
@@ -44,7 +44,7 @@ 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/
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
48
48
|
const selectedItems = isControlled ? controlledItems : uncontrolledItems;
|
|
49
49
|
const onItemChange = React.useCallback(item => {
|
|
50
50
|
if (disabled) return;
|
|
@@ -52,20 +52,20 @@ const useSelection = ({
|
|
|
52
52
|
// Assert special properties (e.g., `disabled`, `isSelectAll`, etc.) are
|
|
53
53
|
// `any` since those properties aren’t part of the generic type.
|
|
54
54
|
const allSelectableItems = filteredItems.filter(
|
|
55
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
55
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
56
56
|
item => !item?.disabled && !item?.isSelectAll);
|
|
57
57
|
const disabledItemCount = filteredItems.filter(
|
|
58
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
58
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
59
59
|
item => item?.disabled).length;
|
|
60
60
|
let newSelectedItems;
|
|
61
61
|
|
|
62
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/
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
64
64
|
if (item?.isSelectAll && selectedItems.length > 0) {
|
|
65
65
|
newSelectedItems = [];
|
|
66
66
|
}
|
|
67
67
|
// select all options
|
|
68
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
69
69
|
else if (item?.isSelectAll && selectedItems.length === 0) {
|
|
70
70
|
newSelectedItems = allSelectableItems;
|
|
71
71
|
} else {
|
|
@@ -79,7 +79,7 @@ const useSelection = ({
|
|
|
79
79
|
} else {
|
|
80
80
|
newSelectedItems = removeAtIndex(selectedItems, selectedIndex);
|
|
81
81
|
newSelectedItems = newSelectedItems.filter(
|
|
82
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
83
83
|
item => !item?.isSelectAll);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -18,7 +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/
|
|
21
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
22
22
|
const memoizedRefs = React.useMemo(() => refs, refs);
|
|
23
23
|
return React.useCallback(node => {
|
|
24
24
|
memoizedRefs.forEach(ref => {
|
|
@@ -16,16 +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/
|
|
19
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
20
20
|
React.useEffect(() => {
|
|
21
21
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
22
22
|
if (node) {
|
|
23
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/
|
|
24
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
25
25
|
console.error(errorMessage);
|
|
26
26
|
throw new Error(errorMessage);
|
|
27
27
|
}
|
|
28
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
28
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
29
29
|
}, []);
|
|
30
30
|
}
|
|
31
31
|
};
|
|
@@ -36,7 +36,7 @@ const useInteractiveChildrenNeedDescription = (ref, message = `interactive child
|
|
|
36
36
|
/*
|
|
37
37
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
38
38
|
*/
|
|
39
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
39
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
40
40
|
React.useEffect(() => {
|
|
41
41
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
42
42
|
if (node && !node.hasAttribute('aria-describedby')) {
|
|
@@ -25,7 +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/
|
|
28
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
29
29
|
useEvent.useWindowEvent('click', event => {
|
|
30
30
|
const {
|
|
31
31
|
target
|
|
@@ -40,7 +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/
|
|
43
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
44
44
|
useResizeObserver.useResizeObserver({
|
|
45
45
|
ref: containerRef,
|
|
46
46
|
onResize: handleResize
|
|
@@ -90,17 +90,17 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
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/
|
|
93
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
94
94
|
const visibleItems = React.useMemo(() => {
|
|
95
95
|
if (!Array.isArray(items)) {
|
|
96
96
|
return [];
|
|
97
97
|
}
|
|
98
98
|
return getVisibleItems();
|
|
99
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
99
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
100
100
|
}, [items, maxWidth, maxItems]);
|
|
101
101
|
|
|
102
102
|
// Memoize hidden items calculation
|
|
103
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
103
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
104
104
|
const hiddenItems = React.useMemo(() => {
|
|
105
105
|
if (!Array.isArray(items)) {
|
|
106
106
|
return [];
|
|
@@ -109,11 +109,11 @@ const useOverflowItems = (items, containerRef, offsetRef, maxItems, onChange) =>
|
|
|
109
109
|
}, [items, visibleItems]);
|
|
110
110
|
|
|
111
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/
|
|
112
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
113
113
|
const previousHiddenItems = usePreviousValue.usePreviousValue(hiddenItems);
|
|
114
114
|
|
|
115
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/
|
|
116
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
117
117
|
React.useEffect(() => {
|
|
118
118
|
}, [hiddenItems, previousHiddenItems, onChange]);
|
|
119
119
|
return {
|
|
@@ -37,7 +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/
|
|
40
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
41
41
|
}, [width, height]);
|
|
42
42
|
React.useLayoutEffect(() => {
|
|
43
43
|
if (!ref?.current) {
|
|
@@ -51,7 +51,7 @@ const useResizeObserver = ({
|
|
|
51
51
|
setWidth(entry.contentRect.width);
|
|
52
52
|
setHeight(entry.contentRect.height);
|
|
53
53
|
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
55
55
|
cb.current && cb.current(entry.contentRect);
|
|
56
56
|
};
|
|
57
57
|
const observer = new ResizeObserver(entries => {
|
|
@@ -68,7 +68,7 @@ const useResizeObserver = ({
|
|
|
68
68
|
return () => {
|
|
69
69
|
observer.disconnect();
|
|
70
70
|
};
|
|
71
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
71
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
72
72
|
}, []);
|
|
73
73
|
return {
|
|
74
74
|
width,
|
|
@@ -17,7 +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/
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
21
21
|
const useSavedCallback = callback => {
|
|
22
22
|
const savedCallback = React.useRef(callback);
|
|
23
23
|
React.useEffect(() => {
|
package/lib/internal/warning.js
CHANGED
|
@@ -24,7 +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/
|
|
27
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
28
28
|
console.warn('Warning: ' + message);
|
|
29
29
|
}
|
|
30
30
|
} : noopFn.noopFn;
|
|
@@ -15,11 +15,11 @@
|
|
|
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/
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
19
19
|
const isRequiredOneOf = propTypes => {
|
|
20
20
|
const names = Object.keys(propTypes);
|
|
21
21
|
const checker = propType =>
|
|
22
|
-
// eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
22
|
+
// eslint-disable-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
23
23
|
(props, propName, componentName, ...rest) => {
|
|
24
24
|
if (process.env.NODE_ENV !== 'production' && names.every(name => typeof props[name] === 'undefined')) {
|
|
25
25
|
return new Error(`${componentName} requires one of the following props: ${names.join(', ')}`);
|
package/lib/tools/events.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
* @returns A composite event handler.
|
|
18
18
|
*/
|
|
19
19
|
const composeEventHandlers = handlers =>
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
21
21
|
(event, ...args) => {
|
|
22
22
|
for (const handler of handlers) {
|
|
23
23
|
if (event.defaultPrevented) {
|
|
@@ -46,7 +46,7 @@ const wrapComponent = ({
|
|
|
46
46
|
Component.propTypes = {
|
|
47
47
|
className: PropTypes.string
|
|
48
48
|
};
|
|
49
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
49
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
50
50
|
return Component;
|
|
51
51
|
};
|
|
52
52
|
|
package/lib/types/common.d.ts
CHANGED
|
@@ -13,8 +13,12 @@ export type PolymorphicProps<Element extends React.ElementType, Props> = Props &
|
|
|
13
13
|
};
|
|
14
14
|
export interface TranslateWithId<MID = string, ARGS = Record<string, unknown>> {
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
16
|
+
* Translates component strings using your i18n tool.
|
|
17
|
+
*
|
|
18
|
+
* @param messageId - The translation ID for the string to translate.
|
|
19
|
+
* @param [args] - Arguments for string interpolation.
|
|
20
|
+
* @returns The translated string.
|
|
18
21
|
*/
|
|
19
22
|
translateWithId?(messageId: MID, args?: ARGS): string;
|
|
20
23
|
}
|
|
24
|
+
export type TFunc<K, A = Record<string, unknown>> = NonNullable<TranslateWithId<K, A>['translateWithId']>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carbon/react",
|
|
3
3
|
"description": "React components for the Carbon Design System",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.93.0-rc.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.31.0",
|
|
56
|
-
"@carbon/icons-react": "^11.
|
|
57
|
-
"@carbon/layout": "^11.
|
|
58
|
-
"@carbon/styles": "^1.
|
|
59
|
-
"@carbon/utilities": "^0.
|
|
56
|
+
"@carbon/icons-react": "^11.69.0-rc.0",
|
|
57
|
+
"@carbon/layout": "^11.43.0-rc.0",
|
|
58
|
+
"@carbon/styles": "^1.92.0-rc.0",
|
|
59
|
+
"@carbon/utilities": "^0.11.0-rc.0",
|
|
60
60
|
"@floating-ui/react": "^0.27.4",
|
|
61
61
|
"@ibm/telemetry-js": "^1.5.0",
|
|
62
62
|
"classnames": "2.5.1",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
"@babel/preset-react": "^7.27.1",
|
|
81
81
|
"@babel/preset-typescript": "^7.27.1",
|
|
82
82
|
"@carbon/test-utils": "^10.38.0",
|
|
83
|
-
"@carbon/themes": "^11.
|
|
84
|
-
"@figma/code-connect": "^1.3.
|
|
83
|
+
"@carbon/themes": "^11.62.0-rc.0",
|
|
84
|
+
"@figma/code-connect": "^1.3.5",
|
|
85
85
|
"@rollup/plugin-babel": "^6.0.0",
|
|
86
86
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
87
87
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"storybook": "^9.0.5",
|
|
124
124
|
"stream-browserify": "^3.0.0",
|
|
125
125
|
"style-loader": "^4.0.0",
|
|
126
|
-
"typescript-config-carbon": "^0.
|
|
126
|
+
"typescript-config-carbon": "^0.8.0-rc.0",
|
|
127
127
|
"use-sync-external-store": "^1.5.0",
|
|
128
128
|
"webpack": "^5.65.0",
|
|
129
129
|
"webpack-dev-server": "^5.0.0"
|
|
@@ -139,5 +139,5 @@
|
|
|
139
139
|
"**/*.scss",
|
|
140
140
|
"**/*.css"
|
|
141
141
|
],
|
|
142
|
-
"gitHead": "
|
|
142
|
+
"gitHead": "0d9497f77c917c567c8be19157e3da42d7a02c04"
|
|
143
143
|
}
|