@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
|
@@ -150,7 +150,7 @@ function StructuredListRow(props) {
|
|
|
150
150
|
...other
|
|
151
151
|
} = props;
|
|
152
152
|
const [hasFocusWithin, setHasFocusWithin] = useState(false);
|
|
153
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
153
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
154
154
|
const rowId = id ?? useId('grid-input');
|
|
155
155
|
const selectedRow = React.useContext(GridSelectedRowStateContext);
|
|
156
156
|
const setSelectedRow = React.useContext(GridSelectedRowDispatchContext);
|
|
@@ -184,7 +184,7 @@ function StructuredListRow(props) {
|
|
|
184
184
|
ref: itemRef,
|
|
185
185
|
onClick: event => {
|
|
186
186
|
setSelectedRow?.(rowId);
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
187
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
188
188
|
onClick && onClick(event);
|
|
189
189
|
if (selection) {
|
|
190
190
|
// focus items only when selection is enabled
|
|
@@ -264,7 +264,7 @@ function StructuredListInput(props) {
|
|
|
264
264
|
value: row?.id ?? '',
|
|
265
265
|
onChange: event => {
|
|
266
266
|
setSelectedRow?.(event.target.value);
|
|
267
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
267
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
268
268
|
onChange && onChange(event);
|
|
269
269
|
},
|
|
270
270
|
id: id ?? defaultId,
|
|
@@ -78,7 +78,7 @@ function Tabs({
|
|
|
78
78
|
}) {
|
|
79
79
|
const baseId = useId('ccs');
|
|
80
80
|
if (dismissable && !onTabCloseRequest) {
|
|
81
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
81
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
82
82
|
console.error('dismissable property specified without also providing an onTabCloseRequest property.');
|
|
83
83
|
}
|
|
84
84
|
// The active index is used to track the element which has focus in our tablist
|
|
@@ -273,7 +273,7 @@ function TabList({
|
|
|
273
273
|
let hasSecondaryLabelTabs = false;
|
|
274
274
|
if (contained) {
|
|
275
275
|
hasSecondaryLabelTabs = React.Children.toArray(children).some(child => {
|
|
276
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
276
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
277
277
|
const _child = child;
|
|
278
278
|
return /*#__PURE__*/React.isValidElement(child) && !!_child.props.secondaryLabel;
|
|
279
279
|
});
|
|
@@ -387,7 +387,7 @@ function TabList({
|
|
|
387
387
|
inline: 'nearest'
|
|
388
388
|
});
|
|
389
389
|
}
|
|
390
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
390
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
391
391
|
}, []);
|
|
392
392
|
useEffect(() => {
|
|
393
393
|
//adding 1 in calculation for firefox support
|
|
@@ -408,7 +408,7 @@ function TabList({
|
|
|
408
408
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
411
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
412
412
|
}, []);
|
|
413
413
|
useIsomorphicEffect(() => {
|
|
414
414
|
if (ref.current) {
|
|
@@ -496,7 +496,7 @@ function TabList({
|
|
|
496
496
|
contained
|
|
497
497
|
}
|
|
498
498
|
}, /*#__PURE__*/React.cloneElement(
|
|
499
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
499
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
500
500
|
child, {
|
|
501
501
|
ref: node => {
|
|
502
502
|
tabs.current[index] = node;
|
|
@@ -631,7 +631,7 @@ function TabListVertical({
|
|
|
631
631
|
setSelectedIndex(tabs.current.indexOf(tab));
|
|
632
632
|
}
|
|
633
633
|
}
|
|
634
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
634
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
635
635
|
}, []);
|
|
636
636
|
useEffect(() => {
|
|
637
637
|
function handler() {
|
|
@@ -642,7 +642,7 @@ function TabListVertical({
|
|
|
642
642
|
if (containerTop && containerHeight) {
|
|
643
643
|
// scrolls so selected tab is in view
|
|
644
644
|
if (selectedPositionTop - halfTabHeight < containerTop || selectedPositionTop - containerTop + verticalTabHeight + halfTabHeight > containerHeight) {
|
|
645
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
645
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
646
646
|
ref.current && ref.current.scrollTo({
|
|
647
647
|
top: (selectedIndex - 1) * verticalTabHeight,
|
|
648
648
|
behavior: 'smooth'
|
|
@@ -698,7 +698,7 @@ function TabListVertical({
|
|
|
698
698
|
hasSecondaryLabel: false
|
|
699
699
|
}
|
|
700
700
|
}, /*#__PURE__*/React.cloneElement(
|
|
701
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
701
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
702
702
|
child, {
|
|
703
703
|
ref: node => {
|
|
704
704
|
tabs.current[index] = node;
|
|
@@ -775,7 +775,7 @@ function createLongPressBehavior(ref, direction, setScrollLeft) {
|
|
|
775
775
|
* Tab
|
|
776
776
|
*/
|
|
777
777
|
|
|
778
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
778
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
779
779
|
const Tab = /*#__PURE__*/forwardRef(({
|
|
780
780
|
as = 'button',
|
|
781
781
|
children,
|
|
@@ -811,7 +811,7 @@ const Tab = /*#__PURE__*/forwardRef(({
|
|
|
811
811
|
const panelId = `${baseId}-tabpanel-${index}`;
|
|
812
812
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
813
813
|
|
|
814
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
814
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
815
815
|
const isEllipsisActive = element => {
|
|
816
816
|
setIsEllipsisApplied(element.offsetHeight < element.scrollHeight);
|
|
817
817
|
return element.offsetHeight < element.scrollHeight;
|
|
@@ -1031,7 +1031,7 @@ Tab.propTypes = {
|
|
|
1031
1031
|
*/
|
|
1032
1032
|
|
|
1033
1033
|
const IconTabContext = /*#__PURE__*/createContext(false);
|
|
1034
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
1034
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
1035
1035
|
const IconTab = /*#__PURE__*/React.forwardRef(({
|
|
1036
1036
|
badgeIndicator,
|
|
1037
1037
|
children,
|
|
@@ -1103,7 +1103,7 @@ IconTab.propTypes = {
|
|
|
1103
1103
|
* TabPanel
|
|
1104
1104
|
*/
|
|
1105
1105
|
|
|
1106
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
1106
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
1107
1107
|
const TabPanel = /*#__PURE__*/React.forwardRef(({
|
|
1108
1108
|
children,
|
|
1109
1109
|
className: customClassName,
|
|
@@ -24,7 +24,7 @@ import { AILabel } from '../AILabel/index.js';
|
|
|
24
24
|
import { isComponentElement } from '../../internal/utils.js';
|
|
25
25
|
|
|
26
26
|
var _Close;
|
|
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 DismissibleTag = /*#__PURE__*/forwardRef(({
|
|
29
29
|
className,
|
|
30
30
|
decorator,
|
|
@@ -44,7 +44,7 @@ const DismissibleTag = /*#__PURE__*/forwardRef(({
|
|
|
44
44
|
}, forwardRef) => {
|
|
45
45
|
const prefix = usePrefix();
|
|
46
46
|
const tagLabelRef = useRef(null);
|
|
47
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
47
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
48
48
|
const tagId = id || `tag-${useId()}`;
|
|
49
49
|
const tagClasses = cx(`${prefix}--tag--filter`, className);
|
|
50
50
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
@@ -64,7 +64,7 @@ const DismissibleTag = /*#__PURE__*/forwardRef(({
|
|
|
64
64
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
|
|
65
65
|
size: 'sm',
|
|
66
66
|
kind: 'inline'
|
|
67
|
-
}) :
|
|
67
|
+
}) : candidate;
|
|
68
68
|
const tooltipClasses = cx(`${prefix}--icon-tooltip`, `${prefix}--tag-label-tooltip`);
|
|
69
69
|
|
|
70
70
|
// Removing onClick from the spread operator
|
|
@@ -31,7 +31,7 @@ const TYPES = {
|
|
|
31
31
|
'cool-gray': 'Cool-Gray',
|
|
32
32
|
'warm-gray': 'Warm-Gray'
|
|
33
33
|
};
|
|
34
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
34
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
35
35
|
const OperationalTag = /*#__PURE__*/forwardRef(({
|
|
36
36
|
className,
|
|
37
37
|
disabled,
|
|
@@ -44,7 +44,7 @@ const OperationalTag = /*#__PURE__*/forwardRef(({
|
|
|
44
44
|
}, forwardRef) => {
|
|
45
45
|
const prefix = usePrefix();
|
|
46
46
|
const tagRef = useRef(null);
|
|
47
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
47
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
48
48
|
const tagId = id || `tag-${useId()}`;
|
|
49
49
|
const tagClasses = cx(`${prefix}--tag--operational`, className);
|
|
50
50
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
@@ -20,7 +20,7 @@ import { isEllipsisActive } from './isEllipsisActive.js';
|
|
|
20
20
|
import { mergeRefs } from '../../tools/mergeRefs.js';
|
|
21
21
|
import { useControllableState } from '../../internal/useControllableState.js';
|
|
22
22
|
|
|
23
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
23
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
24
24
|
const SelectableTag = /*#__PURE__*/forwardRef(({
|
|
25
25
|
className,
|
|
26
26
|
disabled,
|
|
@@ -36,7 +36,7 @@ const SelectableTag = /*#__PURE__*/forwardRef(({
|
|
|
36
36
|
}, forwardRef) => {
|
|
37
37
|
const prefix = usePrefix();
|
|
38
38
|
const tagRef = useRef(null);
|
|
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
|
const tagId = id || `tag-${useId()}`;
|
|
41
41
|
const [selectedTag, setSelectedTag] = useControllableState({
|
|
42
42
|
value: selected,
|
package/es/components/Tag/Tag.js
CHANGED
|
@@ -42,7 +42,7 @@ const SIZES = {
|
|
|
42
42
|
md: 'md',
|
|
43
43
|
lg: 'lg'
|
|
44
44
|
};
|
|
45
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
45
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
46
46
|
const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
47
47
|
children,
|
|
48
48
|
className,
|
|
@@ -65,15 +65,15 @@ const TagBase = /*#__PURE__*/React.forwardRef(({
|
|
|
65
65
|
const prefix = usePrefix();
|
|
66
66
|
const tagRef = useRef(null);
|
|
67
67
|
if (filter) {
|
|
68
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
68
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
69
69
|
console.warn('The `filter` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
70
70
|
}
|
|
71
71
|
if (onClose) {
|
|
72
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
72
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
73
73
|
console.warn('The `onClose` prop for Tag has been deprecated and will be removed in the next major version. Use DismissibleTag instead.');
|
|
74
74
|
}
|
|
75
75
|
const ref = useMergedRefs([forwardRef, tagRef]);
|
|
76
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
76
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
77
77
|
const tagId = id || `tag-${useId()}`;
|
|
78
78
|
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
79
79
|
useLayoutEffect(() => {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
9
9
|
const isEllipsisActive = element => {
|
|
10
10
|
if (element) {
|
|
11
11
|
return element?.offsetWidth < element?.scrollWidth;
|
|
@@ -10,7 +10,7 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React, { useContext, Children } from 'react';
|
|
11
11
|
import { TextDirectionContext } from './TextDirectionContext.js';
|
|
12
12
|
|
|
13
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
13
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
14
14
|
const TextBase = /*#__PURE__*/React.forwardRef(({
|
|
15
15
|
as,
|
|
16
16
|
children,
|
|
@@ -287,7 +287,7 @@ const TextArea = frFn((props, forwardRef) => {
|
|
|
287
287
|
const candidateIsAILabel = isComponentElement(candidate, AILabel);
|
|
288
288
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
|
|
289
289
|
size: 'mini'
|
|
290
|
-
}) :
|
|
290
|
+
}) : candidate;
|
|
291
291
|
return /*#__PURE__*/React.createElement("div", {
|
|
292
292
|
className: formItemClasses
|
|
293
293
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -61,7 +61,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
61
61
|
} = useContext(FormContext);
|
|
62
62
|
const handleTogglePasswordVisibility = event => {
|
|
63
63
|
setInputType(inputType === 'password' ? 'text' : 'password');
|
|
64
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
64
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
65
65
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
66
66
|
};
|
|
67
67
|
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
@@ -151,10 +151,10 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
151
151
|
align = tooltipPosition;
|
|
152
152
|
}
|
|
153
153
|
if (!hidePasswordLabel || hidePasswordLabel.trim() === '') {
|
|
154
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
154
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
155
155
|
console.warn('Warning: The "hidePasswordLabel" should not be blank.');
|
|
156
156
|
} else if (!showPasswordLabel || showPasswordLabel.trim() === '') {
|
|
157
|
-
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/
|
|
157
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
158
158
|
console.warn('Warning: The "showPasswordLabel" should not be blank.');
|
|
159
159
|
}
|
|
160
160
|
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, getTextInputProps({
|
|
@@ -184,7 +184,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
|
184
184
|
setInputType(type);
|
|
185
185
|
}, [type]);
|
|
186
186
|
|
|
187
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
187
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
188
188
|
const Icon = normalizedProps.icon;
|
|
189
189
|
return /*#__PURE__*/React.createElement("div", {
|
|
190
190
|
className: inputWrapperClasses
|
|
@@ -60,7 +60,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
60
60
|
const [textCount, setTextCount] = useState(getInitialTextCount());
|
|
61
61
|
useEffect(() => {
|
|
62
62
|
setTextCount(getInitialTextCount());
|
|
63
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
63
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
64
64
|
}, [value, defaultValue, enableCounter]);
|
|
65
65
|
const normalizedProps = useNormalizedInputProps({
|
|
66
66
|
id,
|
|
@@ -189,7 +189,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
191
|
}, [ariaAnnouncement, prevAnnouncement]);
|
|
192
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
193
193
|
const Icon = normalizedProps.icon;
|
|
194
194
|
|
|
195
195
|
// AILabel is always size `mini`
|
|
@@ -197,7 +197,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
|
197
197
|
const candidateIsAILabel = isComponentElement(candidate, AILabel);
|
|
198
198
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
|
|
199
199
|
size: 'mini'
|
|
200
|
-
}) :
|
|
200
|
+
}) : candidate;
|
|
201
201
|
return /*#__PURE__*/React.createElement("div", {
|
|
202
202
|
className: inputWrapperClasses
|
|
203
203
|
}, !inline ? labelWrapper : /*#__PURE__*/React.createElement("div", {
|
|
@@ -17,7 +17,7 @@ const ThemeContext = /*#__PURE__*/React.createContext({
|
|
|
17
17
|
theme: 'white'
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
20
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
21
21
|
const GlobalTheme = /*#__PURE__*/React.forwardRef(({
|
|
22
22
|
children,
|
|
23
23
|
theme
|
|
@@ -28,7 +28,7 @@ const GlobalTheme = /*#__PURE__*/React.forwardRef(({
|
|
|
28
28
|
};
|
|
29
29
|
}, [theme]);
|
|
30
30
|
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
32
32
|
children, {
|
|
33
33
|
ref: ref
|
|
34
34
|
});
|
|
@@ -71,7 +71,7 @@ function Theme({
|
|
|
71
71
|
isDark
|
|
72
72
|
};
|
|
73
73
|
}, [theme]);
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
75
75
|
const BaseComponentAsAny = BaseComponent;
|
|
76
76
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
77
77
|
value: value
|
|
@@ -205,7 +205,7 @@ ClickableTile.propTypes = {
|
|
|
205
205
|
*/
|
|
206
206
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
207
207
|
};
|
|
208
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
208
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
209
209
|
const SelectableTile = /*#__PURE__*/React.forwardRef(({
|
|
210
210
|
children,
|
|
211
211
|
className,
|
|
@@ -274,7 +274,7 @@ const SelectableTile = /*#__PURE__*/React.forwardRef(({
|
|
|
274
274
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
|
|
275
275
|
size: 'xs',
|
|
276
276
|
ref: decoratorRef
|
|
277
|
-
}) :
|
|
277
|
+
}) : candidate;
|
|
278
278
|
return (
|
|
279
279
|
/*#__PURE__*/
|
|
280
280
|
// eslint-disable-next-line jsx-a11y/interactive-supports-focus
|
|
@@ -501,7 +501,7 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(({
|
|
|
501
501
|
const candidateIsAILabel = isComponentElement(candidate, AILabel);
|
|
502
502
|
const normalizedDecorator = candidateIsAILabel ? /*#__PURE__*/cloneElement(candidate, {
|
|
503
503
|
size: 'xs'
|
|
504
|
-
}) :
|
|
504
|
+
}) : candidate;
|
|
505
505
|
return interactive ? /*#__PURE__*/React.createElement("div", _extends({
|
|
506
506
|
ref: ref,
|
|
507
507
|
className: interactiveClassNames
|
|
@@ -112,7 +112,7 @@ const TimePicker = frFn((props, ref) => {
|
|
|
112
112
|
}
|
|
113
113
|
};
|
|
114
114
|
const mappedChildren = React.Children.map(children, pickerSelect => {
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
116
116
|
const item = pickerSelect;
|
|
117
117
|
if (item) {
|
|
118
118
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
@@ -27,7 +27,7 @@ function ToggletipLabel({
|
|
|
27
27
|
}) {
|
|
28
28
|
const prefix = usePrefix();
|
|
29
29
|
const className = cx(`${prefix}--toggletip-label`, customClassName);
|
|
30
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
31
31
|
const BaseComponentAsAny = BaseComponent;
|
|
32
32
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _extends({
|
|
33
33
|
className: className
|
|
@@ -134,7 +134,7 @@ function Toggletip({
|
|
|
134
134
|
const eventType = 'PointerEvent' in window ? 'pointerdown' : 'mousedown';
|
|
135
135
|
const handleOutsideClick = event => {
|
|
136
136
|
const node = event.target;
|
|
137
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
138
138
|
if (open && node && !ref.current.contains(node)) {
|
|
139
139
|
setOpen(false);
|
|
140
140
|
}
|
|
@@ -167,7 +167,7 @@ function Toggletip({
|
|
|
167
167
|
// Get all the properties from Popover except for "open".
|
|
168
168
|
// The Typescript types for PropTypes are really messed up so we need lots of
|
|
169
169
|
// casting. It will be great when we can finally get rid of PropTypes altogether.
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
170
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
171
171
|
const {
|
|
172
172
|
open,
|
|
173
173
|
...popoverNonOpenPropTypes
|
|
@@ -195,7 +195,7 @@ const ToggletipButton = /*#__PURE__*/React.forwardRef(function ToggletipButton({
|
|
|
195
195
|
const toggletip = useToggletip();
|
|
196
196
|
const prefix = usePrefix();
|
|
197
197
|
const className = cx(`${prefix}--toggletip-button`, customClassName);
|
|
198
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
199
199
|
const ComponentToggle = BaseComponent ?? 'button';
|
|
200
200
|
if (ComponentToggle !== 'button') {
|
|
201
201
|
return /*#__PURE__*/React.createElement(ComponentToggle, _extends({}, toggletip?.onClick, {
|
|
@@ -48,7 +48,7 @@ const DefinitionTooltip = ({
|
|
|
48
48
|
setOpen(false);
|
|
49
49
|
},
|
|
50
50
|
onMouseEnter: () => {
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
52
52
|
openOnHover ? setOpen(true) : null;
|
|
53
53
|
},
|
|
54
54
|
onFocus: () => {
|
|
@@ -22,7 +22,7 @@ import useIsomorphicEffect from '../../internal/useIsomorphicEffect.js';
|
|
|
22
22
|
* Event types that trigger a "drag" to stop.
|
|
23
23
|
*/
|
|
24
24
|
const DRAG_STOP_EVENT_TYPES = new Set(['mouseup', 'touchend', 'touchcancel']);
|
|
25
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/
|
|
25
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
26
26
|
const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
27
27
|
as,
|
|
28
28
|
align = 'top',
|
|
@@ -70,7 +70,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
70
70
|
'aria-describedby': describedBy
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
74
74
|
function getChildEventHandlers(childProps) {
|
|
75
75
|
const eventHandlerFunctions = Object.keys(triggerProps).filter(prop => prop.startsWith('on'));
|
|
76
76
|
const eventHandlers = {};
|
|
@@ -159,7 +159,7 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
159
159
|
}, [isDragging, onDragStop]);
|
|
160
160
|
return (
|
|
161
161
|
/*#__PURE__*/
|
|
162
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
163
163
|
React.createElement(Popover, _extends({
|
|
164
164
|
as: as,
|
|
165
165
|
ref: ref
|
|
@@ -72,11 +72,11 @@ const useEllipsisCheck = (label, detailsWrapperRef) => {
|
|
|
72
72
|
cancelAnimationFrame(animationFrameId);
|
|
73
73
|
if (resizeObserver) {
|
|
74
74
|
if (labelTextRef.current) {
|
|
75
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
75
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
76
76
|
resizeObserver.unobserve(labelTextRef.current);
|
|
77
77
|
}
|
|
78
78
|
if (detailsWrapperRef.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(detailsWrapperRef.current);
|
|
81
81
|
}
|
|
82
82
|
resizeObserver.disconnect();
|
|
@@ -128,7 +128,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
128
128
|
} = useEllipsisCheck(label, detailsWrapperRef);
|
|
129
129
|
const enableTreeviewControllable = useFeatureFlag('enable-treeview-controllable');
|
|
130
130
|
|
|
131
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
131
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
132
132
|
const {
|
|
133
133
|
current: id
|
|
134
134
|
} = useRef(nodeId || useId());
|
|
@@ -373,7 +373,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
373
373
|
ref: currentNodeLabel
|
|
374
374
|
}, children &&
|
|
375
375
|
/*#__PURE__*/
|
|
376
|
-
// 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/
|
|
376
|
+
// 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
|
|
377
377
|
React.createElement("span", {
|
|
378
378
|
className: `${prefix}--tree-parent-node__toggle`,
|
|
379
379
|
onClick: handleToggleClick
|
|
@@ -474,14 +474,14 @@ TreeNode.propTypes = {
|
|
|
474
474
|
/**
|
|
475
475
|
* A component used to render an icon.
|
|
476
476
|
*/
|
|
477
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
477
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
478
478
|
// @ts-ignore
|
|
479
479
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
480
480
|
/**
|
|
481
481
|
* **Note:** this is controlled by the parent TreeView component, do not set manually.
|
|
482
482
|
* Array containing all selected node IDs in the tree
|
|
483
483
|
*/
|
|
484
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
484
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
485
485
|
// @ts-ignore
|
|
486
486
|
selected: 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.'),
|
|
487
487
|
/**
|
|
@@ -33,13 +33,13 @@ const TreeView = ({
|
|
|
33
33
|
}) => {
|
|
34
34
|
const enableTreeviewControllable = useFeatureFlag('enable-treeview-controllable');
|
|
35
35
|
|
|
36
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/
|
|
36
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
37
37
|
const {
|
|
38
38
|
current: treeId
|
|
39
39
|
} = useRef(rest.id || useId());
|
|
40
40
|
const prefix = usePrefix();
|
|
41
41
|
const treeClasses = cx(className, `${prefix}--tree`, {
|
|
42
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
43
43
|
// @ts-ignore - will always be false according to prop types
|
|
44
44
|
|
|
45
45
|
[`${prefix}--tree--${size}`]: size !== 'default'
|
|
@@ -66,7 +66,7 @@ const TreeView = ({
|
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
70
70
|
function handleTreeSelect(event, node) {
|
|
71
71
|
const nodeId = node.id;
|
|
72
72
|
if (nodeId) {
|
|
@@ -115,7 +115,7 @@ const TreeView = ({
|
|
|
115
115
|
if (match(event, ArrowDown)) {
|
|
116
116
|
nextFocusNode = treeWalker.current.nextNode();
|
|
117
117
|
}
|
|
118
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
119
119
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
120
120
|
if (matches(event, [Home, End, {
|
|
121
121
|
code: 'KeyA'
|
|
@@ -132,7 +132,7 @@ const TreeView = ({
|
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
136
136
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
137
137
|
if (match(event, {
|
|
138
138
|
code: 'KeyA'
|
|
@@ -28,7 +28,7 @@ function HeaderContainer({
|
|
|
28
28
|
setIsSideNavExpandedState(prevIsSideNavExpanded => !prevIsSideNavExpanded);
|
|
29
29
|
}, [setIsSideNavExpandedState]);
|
|
30
30
|
return /*#__PURE__*/React.createElement(Children
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
32
32
|
, _extends({}, rest, {
|
|
33
33
|
isSideNavExpanded: isSideNavExpandedState,
|
|
34
34
|
onClickSideNavExpand: handleHeaderMenuButtonClick
|
|
@@ -120,7 +120,7 @@ const HeaderMenu = frFn((props, ref) => {
|
|
|
120
120
|
*/
|
|
121
121
|
const renderMenuItem = (item, index) => {
|
|
122
122
|
if (/*#__PURE__*/isValidElement(item)) {
|
|
123
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
124
124
|
return /*#__PURE__*/cloneElement(item, {
|
|
125
125
|
ref: handleItemRef(index)
|
|
126
126
|
});
|
|
@@ -17,11 +17,11 @@ const LinkBase = ({
|
|
|
17
17
|
as: BaseComponent,
|
|
18
18
|
// Captured here to prevent it from being passed into the created element.
|
|
19
19
|
// See https://github.com/carbon-design-system/carbon/issues/3970
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
21
21
|
isSideNavExpanded: _isSideNavExpanded,
|
|
22
22
|
...rest
|
|
23
23
|
}, ref) => {
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
25
25
|
const BaseComponentAsAny = BaseComponent ?? element ?? 'a';
|
|
26
26
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _extends({
|
|
27
27
|
ref: ref
|
|
@@ -21,7 +21,7 @@ const SideNavItems = ({
|
|
|
21
21
|
const childrenWithExpandedState = React.Children.map(children, child => {
|
|
22
22
|
if (/*#__PURE__*/React.isValidElement(child)) {
|
|
23
23
|
// avoid spreading `isSideNavExpanded` to non-Carbon UI Shell children
|
|
24
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
25
25
|
const childDisplayName = child.type?.displayName;
|
|
26
26
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
27
27
|
...(CARBON_SIDENAV_ITEMS.includes(childDisplayName) ? {
|
|
@@ -55,7 +55,7 @@ const Switcher = /*#__PURE__*/forwardRef((props, forwardRef) => {
|
|
|
55
55
|
if (direction === 1) {
|
|
56
56
|
return enabledIndices[1];
|
|
57
57
|
}
|
|
58
|
-
// eslint-disable-next-line no-fallthrough -- https://github.com/carbon-design-system/carbon/issues/
|
|
58
|
+
// eslint-disable-next-line no-fallthrough -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
59
59
|
default:
|
|
60
60
|
return enabledIndices[nextIndex];
|
|
61
61
|
}
|
|
@@ -69,7 +69,7 @@ const SwitcherItem = /*#__PURE__*/forwardRef((props, forwardRef) => {
|
|
|
69
69
|
href: href,
|
|
70
70
|
target: target,
|
|
71
71
|
rel: rel
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
73
73
|
,
|
|
74
74
|
ref: forwardRef
|
|
75
75
|
}, rest, {
|