@carbon/react 1.90.0-rc.0 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.playwright/INTERNAL_AVT_REPORT_DO_NOT_USE.json +743 -784
- package/es/components/AILabel/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/es/components/Button/Button.js +3 -0
- package/es/components/ChatButton/ChatButton.js +1 -0
- package/es/components/CheckboxGroup/CheckboxGroup.js +21 -2
- package/es/components/ComboBox/ComboBox.js +17 -1
- package/es/components/ComboButton/index.js +1 -0
- package/es/components/ComposedModal/ComposedModal.js +4 -1
- package/es/components/DataTable/DataTable.js +14 -0
- package/es/components/DataTable/Table.js +3 -3
- package/es/components/DataTable/TableExpandHeader.js +5 -1
- package/es/components/DataTable/TableExpandRow.js +1 -0
- package/es/components/DataTable/TableHeader.js +2 -0
- package/es/components/DataTable/TableRow.js +5 -0
- package/es/components/DataTable/TableSlugRow.js +1 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -0
- package/es/components/DataTable/state/sorting.d.ts +3 -1
- package/es/components/DataTable/state/sorting.js +2 -0
- package/es/components/DataTable/tools/sorting.js +1 -0
- package/es/components/DatePicker/DatePicker.js +14 -3
- package/es/components/DatePickerInput/DatePickerInput.js +6 -0
- package/es/components/Dialog/Dialog.js +10 -2
- package/es/components/Dropdown/Dropdown.js +16 -4
- package/es/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/es/components/FileUploader/FileUploader.js +9 -2
- package/es/components/FileUploader/FileUploaderButton.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/es/components/FileUploader/FileUploaderItem.js +3 -0
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/es/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/es/components/FluidSearch/FluidSearch.js +3 -2
- package/es/components/FluidSelect/FluidSelect.js +3 -2
- package/es/components/FluidTextInput/FluidTextInput.js +3 -2
- package/es/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/es/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/es/components/Grid/CSSGrid.js +5 -0
- package/es/components/Grid/Column.js +3 -0
- package/es/components/Grid/ColumnHang.js +1 -0
- package/es/components/Grid/FlexGrid.js +1 -0
- package/es/components/Grid/Row.js +1 -0
- package/es/components/Heading/index.js +3 -1
- package/es/components/IconButton/index.js +4 -2
- package/es/components/IconIndicator/index.js +4 -2
- package/es/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/es/components/Layout/index.js +6 -4
- package/es/components/LayoutDirection/LayoutDirection.js +2 -0
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxMenuItem.js +4 -1
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/es/components/Menu/Menu.js +6 -9
- package/es/components/Menu/MenuContext.js +1 -0
- package/es/components/Menu/MenuItem.js +5 -13
- package/es/components/MenuButton/index.js +7 -2
- package/es/components/Modal/Modal.js +3 -0
- package/es/components/ModalWrapper/ModalWrapper.js +2 -0
- package/es/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/es/components/MultiSelect/MultiSelect.js +21 -5
- package/es/components/Notification/Notification.js +1 -1
- package/es/components/NumberInput/NumberInput.js +7 -1
- package/es/components/OverflowMenu/OverflowMenu.js +2 -0
- package/es/components/OverflowMenu/next/index.js +3 -2
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/PageHeader/PageHeader.js +22 -8
- package/es/components/Pagination/Pagination.js +6 -2
- package/es/components/PaginationNav/PaginationNav.js +2 -5
- package/es/components/Popover/index.js +14 -4
- package/es/components/ProgressBar/ProgressBar.js +4 -2
- package/es/components/RadioTile/RadioTile.js +2 -2
- package/es/components/Search/Search.js +2 -2
- package/es/components/Select/Select.js +2 -3
- package/es/components/ShapeIndicator/index.js +4 -2
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/es/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/es/components/SkeletonText/SkeletonText.js +0 -2
- package/es/components/Slider/Slider.js +11 -16
- package/es/components/Stack/HStack.js +1 -0
- package/es/components/Stack/Stack.js +6 -9
- package/es/components/Stack/VStack.js +1 -0
- package/es/components/StructuredList/StructuredList.js +3 -0
- package/es/components/Switch/Switch.js +1 -1
- package/es/components/Tabs/Tabs.js +28 -17
- package/es/components/Tag/DismissibleTag.js +2 -0
- package/es/components/Tag/OperationalTag.js +2 -0
- package/es/components/Tag/SelectableTag.js +2 -0
- package/es/components/Tag/Tag.js +4 -0
- package/es/components/Tag/isEllipsisActive.js +1 -0
- package/es/components/Text/Text.js +1 -0
- package/es/components/TextInput/ControlledPasswordInput.js +2 -4
- package/es/components/TextInput/PasswordInput.js +7 -2
- package/es/components/TextInput/TextInput.js +4 -2
- package/es/components/Theme/index.js +8 -3
- package/es/components/Tile/Tile.js +14 -17
- package/es/components/TimePicker/TimePicker.js +1 -0
- package/es/components/Toggle/Toggle.js +1 -1
- package/es/components/Toggletip/index.js +4 -0
- package/es/components/Tooltip/DefinitionTooltip.js +1 -0
- package/es/components/Tooltip/Tooltip.js +30 -23
- package/es/components/TreeView/TreeNode.js +13 -5
- package/es/components/TreeView/TreeView.js +7 -0
- package/es/components/UIShell/HeaderContainer.js +3 -1
- package/es/components/UIShell/HeaderGlobalAction.js +2 -2
- package/es/components/UIShell/HeaderMenu.js +3 -3
- package/es/components/UIShell/HeaderPanel.js +2 -2
- package/es/components/UIShell/Link.js +2 -0
- package/es/components/UIShell/SideNavItems.js +1 -0
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +1 -1
- package/es/components/UIShell/SideNavSwitcher.js +1 -1
- package/es/components/UIShell/Switcher.js +2 -1
- package/es/components/UIShell/SwitcherItem.js +4 -2
- package/es/internal/FloatingMenu.js +7 -1
- package/es/internal/Selection.js +12 -3
- package/es/internal/useMergedRefs.js +1 -0
- package/es/internal/useNoInteractiveChildren.js +4 -0
- package/es/internal/useOutsideClick.js +1 -0
- package/es/internal/useOverflowItems.js +6 -0
- package/es/internal/useResizeObserver.js +4 -0
- package/es/internal/useSavedCallback.js +1 -0
- package/es/internal/warning.js +1 -0
- package/es/prop-types/isRequiredOneOf.js +4 -1
- package/es/tools/events.js +3 -1
- package/es/tools/wrapComponent.js +1 -0
- package/lib/components/AILabel/index.js +8 -6
- package/lib/components/Breadcrumb/BreadcrumbItem.js +2 -0
- package/lib/components/Button/Button.js +3 -0
- package/lib/components/ChatButton/ChatButton.js +1 -0
- package/lib/components/CheckboxGroup/CheckboxGroup.js +20 -1
- package/lib/components/ComboBox/ComboBox.js +17 -1
- package/lib/components/ComboButton/index.js +1 -0
- package/lib/components/ComposedModal/ComposedModal.js +4 -1
- package/lib/components/DataTable/DataTable.js +14 -0
- package/lib/components/DataTable/Table.js +3 -3
- package/lib/components/DataTable/TableExpandHeader.js +5 -1
- package/lib/components/DataTable/TableExpandRow.js +1 -0
- package/lib/components/DataTable/TableHeader.js +2 -0
- package/lib/components/DataTable/TableRow.js +5 -0
- package/lib/components/DataTable/TableSlugRow.js +1 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -0
- package/lib/components/DataTable/state/sorting.d.ts +3 -1
- package/lib/components/DataTable/state/sorting.js +2 -0
- package/lib/components/DataTable/tools/sorting.js +1 -0
- package/lib/components/DatePicker/DatePicker.js +14 -3
- package/lib/components/DatePickerInput/DatePickerInput.js +6 -0
- package/lib/components/Dialog/Dialog.js +10 -2
- package/lib/components/Dropdown/Dropdown.js +16 -4
- package/lib/components/ErrorBoundary/ErrorBoundaryContext.js +1 -0
- package/lib/components/FileUploader/FileUploader.js +9 -2
- package/lib/components/FileUploader/FileUploaderButton.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +1 -1
- package/lib/components/FileUploader/FileUploaderItem.js +3 -0
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +2 -0
- package/lib/components/FluidNumberInput/FluidNumberInput.js +3 -2
- package/lib/components/FluidSearch/FluidSearch.js +3 -2
- package/lib/components/FluidSelect/FluidSelect.js +3 -2
- package/lib/components/FluidTextInput/FluidTextInput.js +3 -2
- package/lib/components/FluidTimePicker/FluidTimePicker.js +11 -4
- package/lib/components/FluidTimePickerSelect/FluidTimePickerSelect.js +3 -2
- package/lib/components/Grid/CSSGrid.js +5 -0
- package/lib/components/Grid/Column.js +3 -0
- package/lib/components/Grid/ColumnHang.js +1 -0
- package/lib/components/Grid/FlexGrid.js +1 -0
- package/lib/components/Grid/Row.js +1 -0
- package/lib/components/Heading/index.js +3 -1
- package/lib/components/IconButton/index.js +4 -2
- package/lib/components/IconIndicator/index.js +4 -2
- package/lib/components/InlineCheckbox/InlineCheckbox.js +3 -2
- package/lib/components/Layout/index.js +6 -4
- package/lib/components/LayoutDirection/LayoutDirection.js +2 -0
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -1
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -2
- package/lib/components/Menu/Menu.js +6 -9
- package/lib/components/Menu/MenuContext.js +1 -0
- package/lib/components/Menu/MenuItem.js +5 -13
- package/lib/components/MenuButton/index.js +7 -2
- package/lib/components/Modal/Modal.js +3 -0
- package/lib/components/ModalWrapper/ModalWrapper.js +2 -0
- package/lib/components/MultiSelect/FilterableMultiSelect.js +24 -5
- package/lib/components/MultiSelect/MultiSelect.js +21 -5
- package/lib/components/Notification/Notification.js +1 -1
- package/lib/components/NumberInput/NumberInput.js +7 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +2 -0
- package/lib/components/OverflowMenu/next/index.js +3 -2
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +2 -0
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/PageHeader/PageHeader.js +22 -8
- package/lib/components/Pagination/Pagination.js +6 -2
- package/lib/components/PaginationNav/PaginationNav.js +2 -5
- package/lib/components/Popover/index.js +14 -4
- package/lib/components/ProgressBar/ProgressBar.js +4 -2
- package/lib/components/RadioTile/RadioTile.js +2 -2
- package/lib/components/Search/Search.js +2 -2
- package/lib/components/Select/Select.js +2 -3
- package/lib/components/ShapeIndicator/index.js +4 -2
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.d.ts +4 -4
- package/lib/components/SkeletonPlaceholder/SkeletonPlaceholder.js +1 -2
- package/lib/components/SkeletonText/SkeletonText.js +0 -2
- package/lib/components/Slider/Slider.js +11 -16
- package/lib/components/Stack/HStack.js +1 -0
- package/lib/components/Stack/Stack.js +6 -9
- package/lib/components/Stack/VStack.js +1 -0
- package/lib/components/StructuredList/StructuredList.js +3 -0
- package/lib/components/Switch/Switch.js +1 -1
- package/lib/components/Tabs/Tabs.js +28 -17
- package/lib/components/Tag/DismissibleTag.js +2 -0
- package/lib/components/Tag/OperationalTag.js +2 -0
- package/lib/components/Tag/SelectableTag.js +2 -0
- package/lib/components/Tag/Tag.js +4 -0
- package/lib/components/Tag/isEllipsisActive.js +1 -0
- package/lib/components/Text/Text.js +1 -0
- package/lib/components/TextInput/ControlledPasswordInput.js +2 -4
- package/lib/components/TextInput/PasswordInput.js +7 -2
- package/lib/components/TextInput/TextInput.js +4 -2
- package/lib/components/Theme/index.js +8 -3
- package/lib/components/Tile/Tile.js +14 -17
- package/lib/components/TimePicker/TimePicker.js +1 -0
- package/lib/components/Toggle/Toggle.js +1 -1
- package/lib/components/Toggletip/index.js +4 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +1 -0
- package/lib/components/Tooltip/Tooltip.js +30 -23
- package/lib/components/TreeView/TreeNode.js +13 -5
- package/lib/components/TreeView/TreeView.js +7 -0
- package/lib/components/UIShell/HeaderContainer.js +3 -1
- package/lib/components/UIShell/HeaderGlobalAction.js +2 -2
- package/lib/components/UIShell/HeaderMenu.js +3 -3
- package/lib/components/UIShell/HeaderPanel.js +2 -2
- package/lib/components/UIShell/Link.js +2 -0
- package/lib/components/UIShell/SideNavItems.js +1 -0
- package/lib/components/UIShell/SideNavMenu.js +2 -2
- package/lib/components/UIShell/SideNavMenuItem.js +1 -1
- package/lib/components/UIShell/SideNavSwitcher.js +1 -1
- package/lib/components/UIShell/Switcher.js +2 -1
- package/lib/components/UIShell/SwitcherItem.js +4 -2
- package/lib/internal/FloatingMenu.js +7 -1
- package/lib/internal/Selection.js +12 -3
- package/lib/internal/useMergedRefs.js +1 -0
- package/lib/internal/useNoInteractiveChildren.js +4 -0
- package/lib/internal/useOutsideClick.js +1 -0
- package/lib/internal/useOverflowItems.js +6 -0
- package/lib/internal/useResizeObserver.js +4 -0
- package/lib/internal/useSavedCallback.js +1 -0
- package/lib/internal/warning.js +1 -0
- package/lib/prop-types/isRequiredOneOf.js +4 -1
- package/lib/tools/events.js +3 -1
- package/lib/tools/wrapComponent.js +1 -0
- package/package.json +9 -9
|
@@ -16,7 +16,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
16
16
|
import { useId } from '../../internal/useId.js';
|
|
17
17
|
import { noopFn } from '../../internal/noopFn.js';
|
|
18
18
|
|
|
19
|
-
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(
|
|
19
|
+
const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
20
20
|
labelText,
|
|
21
21
|
className,
|
|
22
22
|
id,
|
|
@@ -29,9 +29,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function Controlle
|
|
|
29
29
|
invalidText = '',
|
|
30
30
|
helperText = '',
|
|
31
31
|
light,
|
|
32
|
-
// eslint-disable-next-line react/prop-types
|
|
33
32
|
type = 'password',
|
|
34
|
-
// eslint-disable-next-line react/prop-types
|
|
35
33
|
togglePasswordVisibility,
|
|
36
34
|
tooltipPosition = 'bottom',
|
|
37
35
|
tooltipAlignment = 'center',
|
|
@@ -39,7 +37,7 @@ const ControlledPasswordInput = /*#__PURE__*/React.forwardRef(function Controlle
|
|
|
39
37
|
showPasswordLabel = 'Show password',
|
|
40
38
|
size = undefined,
|
|
41
39
|
...other
|
|
42
|
-
}, ref) {
|
|
40
|
+
}, ref) => {
|
|
43
41
|
const prefix = usePrefix();
|
|
44
42
|
const controlledPasswordInstanceId = useId();
|
|
45
43
|
const errorId = id + '-error-msg';
|
|
@@ -19,7 +19,7 @@ import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
|
19
19
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
20
20
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
21
21
|
|
|
22
|
-
const PasswordInput = /*#__PURE__*/React.forwardRef(
|
|
22
|
+
const PasswordInput = /*#__PURE__*/React.forwardRef(({
|
|
23
23
|
className,
|
|
24
24
|
disabled = false,
|
|
25
25
|
helperText,
|
|
@@ -44,7 +44,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
44
44
|
warn = false,
|
|
45
45
|
warnText,
|
|
46
46
|
...rest
|
|
47
|
-
}, ref) {
|
|
47
|
+
}, ref) => {
|
|
48
48
|
const [inputType, setInputType] = useState(type);
|
|
49
49
|
const prefix = usePrefix();
|
|
50
50
|
const normalizedProps = useNormalizedInputProps({
|
|
@@ -61,6 +61,7 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
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/20071
|
|
64
65
|
onTogglePasswordVisibility && onTogglePasswordVisibility(event);
|
|
65
66
|
};
|
|
66
67
|
const textInputClasses = cx(`${prefix}--text-input`, `${prefix}--password-input`, className, {
|
|
@@ -150,8 +151,10 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
150
151
|
align = tooltipPosition;
|
|
151
152
|
}
|
|
152
153
|
if (!hidePasswordLabel || hidePasswordLabel.trim() === '') {
|
|
154
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
153
155
|
console.warn('Warning: The "hidePasswordLabel" should not be blank.');
|
|
154
156
|
} else if (!showPasswordLabel || showPasswordLabel.trim() === '') {
|
|
157
|
+
// eslint-disable-next-line no-console -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
155
158
|
console.warn('Warning: The "showPasswordLabel" should not be blank.');
|
|
156
159
|
}
|
|
157
160
|
const input = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("input", _extends({}, textInputProps({
|
|
@@ -180,6 +183,8 @@ const PasswordInput = /*#__PURE__*/React.forwardRef(function PasswordInput({
|
|
|
180
183
|
useEffect(() => {
|
|
181
184
|
setInputType(type);
|
|
182
185
|
}, [type]);
|
|
186
|
+
|
|
187
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
183
188
|
const Icon = normalizedProps.icon;
|
|
184
189
|
return /*#__PURE__*/React.createElement("div", {
|
|
185
190
|
className: inputWrapperClasses
|
|
@@ -21,7 +21,7 @@ import { AILabel } from '../AILabel/index.js';
|
|
|
21
21
|
import { isComponentElement } from '../../internal/utils.js';
|
|
22
22
|
import { Text } from '../Text/Text.js';
|
|
23
23
|
|
|
24
|
-
const TextInput = /*#__PURE__*/React.forwardRef(
|
|
24
|
+
const TextInput = /*#__PURE__*/React.forwardRef(({
|
|
25
25
|
className,
|
|
26
26
|
decorator,
|
|
27
27
|
disabled = false,
|
|
@@ -45,7 +45,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
45
45
|
maxCount,
|
|
46
46
|
slug,
|
|
47
47
|
...rest
|
|
48
|
-
}, ref) {
|
|
48
|
+
}, ref) => {
|
|
49
49
|
const prefix = usePrefix();
|
|
50
50
|
const {
|
|
51
51
|
defaultValue,
|
|
@@ -60,6 +60,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
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/20071
|
|
63
64
|
}, [value, defaultValue, enableCounter]);
|
|
64
65
|
const normalizedProps = useNormalizedInputProps({
|
|
65
66
|
id,
|
|
@@ -188,6 +189,7 @@ const TextInput = /*#__PURE__*/React.forwardRef(function TextInput({
|
|
|
188
189
|
}
|
|
189
190
|
}
|
|
190
191
|
}, [ariaAnnouncement, prevAnnouncement]);
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
191
193
|
const Icon = normalizedProps.icon;
|
|
192
194
|
|
|
193
195
|
// AILabel is always size `mini`
|
|
@@ -16,16 +16,20 @@ import { useMatchMedia } from '../../internal/useMatchMedia.js';
|
|
|
16
16
|
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/20071
|
|
21
|
+
const GlobalTheme = /*#__PURE__*/React.forwardRef(({
|
|
20
22
|
children,
|
|
21
23
|
theme
|
|
22
|
-
}, ref) {
|
|
24
|
+
}, ref) => {
|
|
23
25
|
const value = useMemo(() => {
|
|
24
26
|
return {
|
|
25
27
|
theme
|
|
26
28
|
};
|
|
27
29
|
}, [theme]);
|
|
28
|
-
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
30
|
+
const childrenWithProps = /*#__PURE__*/React.cloneElement(
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
32
|
+
children, {
|
|
29
33
|
ref: ref
|
|
30
34
|
});
|
|
31
35
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
@@ -67,6 +71,7 @@ function Theme({
|
|
|
67
71
|
isDark
|
|
68
72
|
};
|
|
69
73
|
}, [theme]);
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
70
75
|
const BaseComponentAsAny = BaseComponent;
|
|
71
76
|
return /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
72
77
|
value: value
|
|
@@ -27,7 +27,7 @@ import { isComponentElement } from '../../internal/utils.js';
|
|
|
27
27
|
import { Text } from '../Text/Text.js';
|
|
28
28
|
|
|
29
29
|
var _CheckboxCheckedFille, _Checkbox, _ChevronDown, _ChevronDown2;
|
|
30
|
-
const Tile = /*#__PURE__*/React.forwardRef(
|
|
30
|
+
const Tile = /*#__PURE__*/React.forwardRef(({
|
|
31
31
|
children,
|
|
32
32
|
className,
|
|
33
33
|
decorator,
|
|
@@ -35,7 +35,7 @@ const Tile = /*#__PURE__*/React.forwardRef(function Tile({
|
|
|
35
35
|
slug,
|
|
36
36
|
hasRoundedCorners = false,
|
|
37
37
|
...rest
|
|
38
|
-
}, ref) {
|
|
38
|
+
}, ref) => {
|
|
39
39
|
const prefix = usePrefix();
|
|
40
40
|
const tileClasses = cx(`${prefix}--tile`, {
|
|
41
41
|
[`${prefix}--tile--light`]: light,
|
|
@@ -82,7 +82,7 @@ Tile.propTypes = {
|
|
|
82
82
|
*/
|
|
83
83
|
slug: deprecate(PropTypes.node, 'The `slug` prop for `Tile` has ' + 'been deprecated in favor of the new `decorator` prop. It will be removed in the next major release.')
|
|
84
84
|
};
|
|
85
|
-
const ClickableTile = /*#__PURE__*/React.forwardRef(
|
|
85
|
+
const ClickableTile = /*#__PURE__*/React.forwardRef(({
|
|
86
86
|
children,
|
|
87
87
|
className,
|
|
88
88
|
clicked = false,
|
|
@@ -96,7 +96,7 @@ const ClickableTile = /*#__PURE__*/React.forwardRef(function ClickableTile({
|
|
|
96
96
|
hasRoundedCorners,
|
|
97
97
|
slug,
|
|
98
98
|
...rest
|
|
99
|
-
}, ref) {
|
|
99
|
+
}, ref) => {
|
|
100
100
|
const prefix = usePrefix();
|
|
101
101
|
const classes = cx(`${prefix}--tile`, `${prefix}--tile--clickable`, {
|
|
102
102
|
[`${prefix}--tile--is-clicked`]: clicked,
|
|
@@ -205,7 +205,8 @@ ClickableTile.propTypes = {
|
|
|
205
205
|
*/
|
|
206
206
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object])
|
|
207
207
|
};
|
|
208
|
-
|
|
208
|
+
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
209
|
+
const SelectableTile = /*#__PURE__*/React.forwardRef(({
|
|
209
210
|
children,
|
|
210
211
|
className,
|
|
211
212
|
decorator,
|
|
@@ -221,7 +222,7 @@ const SelectableTile = /*#__PURE__*/React.forwardRef(function SelectableTile({
|
|
|
221
222
|
slug,
|
|
222
223
|
hasRoundedCorners,
|
|
223
224
|
...rest
|
|
224
|
-
}, ref) {
|
|
225
|
+
}, ref) => {
|
|
225
226
|
const prefix = usePrefix();
|
|
226
227
|
const clickHandler = onClick;
|
|
227
228
|
const keyDownHandler = onKeyDown;
|
|
@@ -282,9 +283,7 @@ const SelectableTile = /*#__PURE__*/React.forwardRef(function SelectableTile({
|
|
|
282
283
|
onClick: !disabled ? handleClick : undefined,
|
|
283
284
|
role: "checkbox",
|
|
284
285
|
"aria-checked": isSelected,
|
|
285
|
-
onKeyDown: !disabled ? handleKeyDown : undefined
|
|
286
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
287
|
-
,
|
|
286
|
+
onKeyDown: !disabled ? handleKeyDown : undefined,
|
|
288
287
|
tabIndex: !disabled ? tabIndex : undefined,
|
|
289
288
|
ref: ref,
|
|
290
289
|
id: id,
|
|
@@ -364,16 +363,14 @@ SelectableTile.propTypes = {
|
|
|
364
363
|
*/
|
|
365
364
|
value: deprecate(PropTypes.oneOfType([PropTypes.string, PropTypes.number]), 'The `value` property is no longer used. It will be removed in the next major release.`')
|
|
366
365
|
};
|
|
367
|
-
const ExpandableTile = /*#__PURE__*/React.forwardRef(
|
|
366
|
+
const ExpandableTile = /*#__PURE__*/React.forwardRef(({
|
|
368
367
|
tabIndex = 0,
|
|
369
368
|
className,
|
|
370
369
|
children,
|
|
371
370
|
decorator,
|
|
372
371
|
expanded = false,
|
|
373
372
|
tileMaxHeight = 0,
|
|
374
|
-
// eslint-disable-line
|
|
375
373
|
tilePadding = 0,
|
|
376
|
-
// eslint-disable-line
|
|
377
374
|
onClick,
|
|
378
375
|
onKeyUp,
|
|
379
376
|
tileCollapsedIconText = 'Interact to expand Tile',
|
|
@@ -384,7 +381,7 @@ const ExpandableTile = /*#__PURE__*/React.forwardRef(function ExpandableTile({
|
|
|
384
381
|
slug,
|
|
385
382
|
hasRoundedCorners,
|
|
386
383
|
...rest
|
|
387
|
-
}, forwardRef) {
|
|
384
|
+
}, forwardRef) => {
|
|
388
385
|
const [isTileMaxHeight, setIsTileMaxHeight] = useState(tileMaxHeight);
|
|
389
386
|
const [isTilePadding, setIsTilePadding] = useState(tilePadding);
|
|
390
387
|
const [prevExpanded, setPrevExpanded] = useState(expanded);
|
|
@@ -609,9 +606,9 @@ ExpandableTile.propTypes = {
|
|
|
609
606
|
tileExpandedLabel: PropTypes.string
|
|
610
607
|
};
|
|
611
608
|
ExpandableTile.displayName = 'ExpandableTile';
|
|
612
|
-
const TileAboveTheFoldContent = /*#__PURE__*/React.forwardRef(
|
|
609
|
+
const TileAboveTheFoldContent = /*#__PURE__*/React.forwardRef(({
|
|
613
610
|
children
|
|
614
|
-
}, ref) {
|
|
611
|
+
}, ref) => {
|
|
615
612
|
const prefix = usePrefix();
|
|
616
613
|
return /*#__PURE__*/React.createElement("div", {
|
|
617
614
|
ref: ref,
|
|
@@ -625,9 +622,9 @@ TileAboveTheFoldContent.propTypes = {
|
|
|
625
622
|
children: PropTypes.node
|
|
626
623
|
};
|
|
627
624
|
TileAboveTheFoldContent.displayName = 'TileAboveTheFoldContent';
|
|
628
|
-
const TileBelowTheFoldContent = /*#__PURE__*/React.forwardRef(
|
|
625
|
+
const TileBelowTheFoldContent = /*#__PURE__*/React.forwardRef(({
|
|
629
626
|
children
|
|
630
|
-
}, ref) {
|
|
627
|
+
}, ref) => {
|
|
631
628
|
const prefix = usePrefix();
|
|
632
629
|
return /*#__PURE__*/React.createElement("div", {
|
|
633
630
|
ref: ref,
|
|
@@ -112,6 +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/20071
|
|
115
116
|
const item = pickerSelect;
|
|
116
117
|
if (item) {
|
|
117
118
|
return /*#__PURE__*/React.cloneElement(item, {
|
|
@@ -67,7 +67,7 @@ function Toggle({
|
|
|
67
67
|
const labelId = `${id}_label`;
|
|
68
68
|
return (
|
|
69
69
|
/*#__PURE__*/
|
|
70
|
-
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
70
|
+
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
71
71
|
React.createElement("div", {
|
|
72
72
|
className: wrapperClasses,
|
|
73
73
|
onClick: !labelText ? e => {
|
|
@@ -27,6 +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/20071
|
|
30
31
|
const BaseComponentAsAny = BaseComponent;
|
|
31
32
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _extends({
|
|
32
33
|
className: className
|
|
@@ -133,6 +134,7 @@ function Toggletip({
|
|
|
133
134
|
const eventType = 'PointerEvent' in window ? 'pointerdown' : 'mousedown';
|
|
134
135
|
const handleOutsideClick = event => {
|
|
135
136
|
const node = event.target;
|
|
137
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
136
138
|
if (open && node && !ref.current.contains(node)) {
|
|
137
139
|
setOpen(false);
|
|
138
140
|
}
|
|
@@ -165,6 +167,7 @@ function Toggletip({
|
|
|
165
167
|
// Get all the properties from Popover except for "open".
|
|
166
168
|
// The Typescript types for PropTypes are really messed up so we need lots of
|
|
167
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/20071
|
|
168
171
|
const {
|
|
169
172
|
open,
|
|
170
173
|
...popoverNonOpenPropTypes
|
|
@@ -192,6 +195,7 @@ const ToggletipButton = /*#__PURE__*/React.forwardRef(function ToggletipButton({
|
|
|
192
195
|
const toggletip = useToggletip();
|
|
193
196
|
const prefix = usePrefix();
|
|
194
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/20071
|
|
195
199
|
const ComponentToggle = BaseComponent ?? 'button';
|
|
196
200
|
if (ComponentToggle !== 'button') {
|
|
197
201
|
return /*#__PURE__*/React.createElement(ComponentToggle, _extends({}, toggletip?.onClick, {
|
|
@@ -48,6 +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/20071
|
|
51
52
|
openOnHover ? setOpen(true) : null;
|
|
52
53
|
},
|
|
53
54
|
onFocus: () => {
|
|
@@ -22,6 +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/20071
|
|
25
26
|
const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
26
27
|
as,
|
|
27
28
|
align = 'top',
|
|
@@ -68,6 +69,8 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
68
69
|
'aria-labelledby': labelledBy,
|
|
69
70
|
'aria-describedby': describedBy
|
|
70
71
|
};
|
|
72
|
+
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
71
74
|
function getChildEventHandlers(childProps) {
|
|
72
75
|
const eventHandlerFunctions = Object.keys(triggerProps).filter(prop => prop.startsWith('on'));
|
|
73
76
|
const eventHandlers = {};
|
|
@@ -154,29 +157,33 @@ const Tooltip = /*#__PURE__*/React.forwardRef(({
|
|
|
154
157
|
});
|
|
155
158
|
};
|
|
156
159
|
}, [isDragging, onDragStop]);
|
|
157
|
-
return
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
160
|
+
return (
|
|
161
|
+
/*#__PURE__*/
|
|
162
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
163
|
+
React.createElement(Popover, _extends({
|
|
164
|
+
as: as,
|
|
165
|
+
ref: ref
|
|
166
|
+
}, rest, {
|
|
167
|
+
align: align,
|
|
168
|
+
className: cx(`${prefix}--tooltip`, customClassName),
|
|
169
|
+
dropShadow: dropShadow,
|
|
170
|
+
highContrast: highContrast,
|
|
171
|
+
onKeyDown: onKeyDown,
|
|
172
|
+
onMouseLeave: onMouseLeave,
|
|
173
|
+
open: open
|
|
174
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
175
|
+
className: `${prefix}--tooltip-trigger__wrapper`
|
|
176
|
+
}, typeof child !== 'undefined' ? /*#__PURE__*/React.cloneElement(child, {
|
|
177
|
+
...triggerProps,
|
|
178
|
+
...getChildEventHandlers(child.props)
|
|
179
|
+
}) : null), /*#__PURE__*/React.createElement(PopoverContent, {
|
|
180
|
+
"aria-hidden": open ? 'false' : 'true',
|
|
181
|
+
className: `${prefix}--tooltip-content`,
|
|
182
|
+
id: id,
|
|
183
|
+
onMouseEnter: onMouseEnter,
|
|
184
|
+
role: "tooltip"
|
|
185
|
+
}, label || description))
|
|
186
|
+
);
|
|
180
187
|
});
|
|
181
188
|
Tooltip.propTypes = {
|
|
182
189
|
/**
|
|
@@ -57,8 +57,7 @@ const useEllipsisCheck = (label, detailsWrapperRef) => {
|
|
|
57
57
|
}
|
|
58
58
|
}, [detailsWrapperRef]);
|
|
59
59
|
useEffect(() => {
|
|
60
|
-
|
|
61
|
-
animationFrameId = requestAnimationFrame(checkEllipsis);
|
|
60
|
+
const animationFrameId = requestAnimationFrame(checkEllipsis);
|
|
62
61
|
let resizeObserver;
|
|
63
62
|
if (typeof window !== 'undefined' && typeof window.ResizeObserver !== 'undefined' && labelTextRef.current) {
|
|
64
63
|
resizeObserver = new window.ResizeObserver(() => {
|
|
@@ -73,9 +72,11 @@ const useEllipsisCheck = (label, detailsWrapperRef) => {
|
|
|
73
72
|
cancelAnimationFrame(animationFrameId);
|
|
74
73
|
if (resizeObserver) {
|
|
75
74
|
if (labelTextRef.current) {
|
|
75
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
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/20071
|
|
79
80
|
resizeObserver.unobserve(detailsWrapperRef.current);
|
|
80
81
|
}
|
|
81
82
|
resizeObserver.disconnect();
|
|
@@ -126,6 +127,8 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
126
127
|
tooltipText
|
|
127
128
|
} = useEllipsisCheck(label, detailsWrapperRef);
|
|
128
129
|
const enableTreeviewControllable = useFeatureFlag('enable-treeview-controllable');
|
|
130
|
+
|
|
131
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
129
132
|
const {
|
|
130
133
|
current: id
|
|
131
134
|
} = useRef(nodeId || useId());
|
|
@@ -368,7 +371,10 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
368
371
|
const nodeContent = /*#__PURE__*/React.createElement("div", {
|
|
369
372
|
className: `${prefix}--tree-node__label`,
|
|
370
373
|
ref: currentNodeLabel
|
|
371
|
-
}, children &&
|
|
374
|
+
}, children &&
|
|
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/20071
|
|
377
|
+
React.createElement("span", {
|
|
372
378
|
className: `${prefix}--tree-parent-node__toggle`,
|
|
373
379
|
onClick: handleToggleClick
|
|
374
380
|
}, /*#__PURE__*/React.createElement(CaretDown, {
|
|
@@ -396,7 +402,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
396
402
|
value: depth + 1
|
|
397
403
|
}, children)));
|
|
398
404
|
}
|
|
399
|
-
return /*#__PURE__*/React.createElement("li", _extends({}, treeNodeProps, {
|
|
405
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("li", _extends({}, treeNodeProps, {
|
|
400
406
|
"aria-expanded": children ? !!expanded : undefined,
|
|
401
407
|
ref: setRefs
|
|
402
408
|
}), nodeContent, children && /*#__PURE__*/React.createElement("ul", {
|
|
@@ -407,7 +413,7 @@ const TreeNode = /*#__PURE__*/React.forwardRef(({
|
|
|
407
413
|
})
|
|
408
414
|
}, /*#__PURE__*/React.createElement(DepthContext.Provider, {
|
|
409
415
|
value: depth + 1
|
|
410
|
-
}, children)));
|
|
416
|
+
}, children))));
|
|
411
417
|
});
|
|
412
418
|
TreeNode.propTypes = {
|
|
413
419
|
/**
|
|
@@ -468,12 +474,14 @@ TreeNode.propTypes = {
|
|
|
468
474
|
/**
|
|
469
475
|
* A component used to render an icon.
|
|
470
476
|
*/
|
|
477
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
471
478
|
// @ts-ignore
|
|
472
479
|
renderIcon: PropTypes.oneOfType([PropTypes.func, PropTypes.object]),
|
|
473
480
|
/**
|
|
474
481
|
* **Note:** this is controlled by the parent TreeView component, do not set manually.
|
|
475
482
|
* Array containing all selected node IDs in the tree
|
|
476
483
|
*/
|
|
484
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
477
485
|
// @ts-ignore
|
|
478
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.'),
|
|
479
487
|
/**
|
|
@@ -32,11 +32,14 @@ const TreeView = ({
|
|
|
32
32
|
...rest
|
|
33
33
|
}) => {
|
|
34
34
|
const enableTreeviewControllable = useFeatureFlag('enable-treeview-controllable');
|
|
35
|
+
|
|
36
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
35
37
|
const {
|
|
36
38
|
current: treeId
|
|
37
39
|
} = useRef(rest.id || useId());
|
|
38
40
|
const prefix = usePrefix();
|
|
39
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/20071
|
|
40
43
|
// @ts-ignore - will always be false according to prop types
|
|
41
44
|
|
|
42
45
|
[`${prefix}--tree--${size}`]: size !== 'default'
|
|
@@ -62,6 +65,8 @@ const TreeView = ({
|
|
|
62
65
|
item.tabIndex = -1;
|
|
63
66
|
});
|
|
64
67
|
}
|
|
68
|
+
|
|
69
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
65
70
|
function handleTreeSelect(event, node) {
|
|
66
71
|
const nodeId = node.id;
|
|
67
72
|
if (nodeId) {
|
|
@@ -110,6 +115,7 @@ const TreeView = ({
|
|
|
110
115
|
if (match(event, ArrowDown)) {
|
|
111
116
|
nextFocusNode = treeWalker.current.nextNode();
|
|
112
117
|
}
|
|
118
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
113
119
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
114
120
|
if (matches(event, [Home, End, {
|
|
115
121
|
code: 'KeyA'
|
|
@@ -126,6 +132,7 @@ const TreeView = ({
|
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
134
|
}
|
|
135
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
129
136
|
// @ts-ignore - `matches` doesn't like the object syntax without missing properties
|
|
130
137
|
if (match(event, {
|
|
131
138
|
code: 'KeyA'
|
|
@@ -27,7 +27,9 @@ function HeaderContainer({
|
|
|
27
27
|
const handleHeaderMenuButtonClick = useCallback(() => {
|
|
28
28
|
setIsSideNavExpandedState(prevIsSideNavExpanded => !prevIsSideNavExpanded);
|
|
29
29
|
}, [setIsSideNavExpandedState]);
|
|
30
|
-
return /*#__PURE__*/React.createElement(Children
|
|
30
|
+
return /*#__PURE__*/React.createElement(Children
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
32
|
+
, _extends({}, rest, {
|
|
31
33
|
isSideNavExpanded: isSideNavExpandedState,
|
|
32
34
|
onClickSideNavExpand: handleHeaderMenuButtonClick
|
|
33
35
|
}));
|
|
@@ -22,7 +22,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
22
22
|
*
|
|
23
23
|
* Note: children passed to this component should be an Icon.
|
|
24
24
|
*/
|
|
25
|
-
const HeaderGlobalAction = /*#__PURE__*/React.forwardRef(
|
|
25
|
+
const HeaderGlobalAction = /*#__PURE__*/React.forwardRef(({
|
|
26
26
|
'aria-label': ariaLabel,
|
|
27
27
|
'aria-labelledby': ariaLabelledBy,
|
|
28
28
|
children,
|
|
@@ -33,7 +33,7 @@ const HeaderGlobalAction = /*#__PURE__*/React.forwardRef(function HeaderGlobalAc
|
|
|
33
33
|
isActive,
|
|
34
34
|
tooltipAlignment,
|
|
35
35
|
...rest
|
|
36
|
-
}, ref) {
|
|
36
|
+
}, ref) => {
|
|
37
37
|
const prefix = usePrefix();
|
|
38
38
|
const className = cx({
|
|
39
39
|
[customClassName]: !!customClassName,
|
|
@@ -120,6 +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/20071
|
|
123
124
|
return /*#__PURE__*/cloneElement(item, {
|
|
124
125
|
ref: handleItemRef(index)
|
|
125
126
|
});
|
|
@@ -157,9 +158,8 @@ const HeaderMenu = frFn((props, ref) => {
|
|
|
157
158
|
onBlur: composeEventHandlers([onBlur, handleOnBlur]),
|
|
158
159
|
ref: ref
|
|
159
160
|
}), /*#__PURE__*/React.createElement("a", _extends({
|
|
160
|
-
// eslint-disable-line jsx-a11y/
|
|
161
|
-
"aria-haspopup": "menu"
|
|
162
|
-
,
|
|
161
|
+
// eslint-disable-line jsx-a11y/anchor-is-valid
|
|
162
|
+
"aria-haspopup": "menu",
|
|
163
163
|
"aria-expanded": expanded,
|
|
164
164
|
className: linkClassName,
|
|
165
165
|
href: "#",
|
|
@@ -17,7 +17,7 @@ import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
|
17
17
|
import Switcher from './Switcher.js';
|
|
18
18
|
import { noopFn } from '../../internal/noopFn.js';
|
|
19
19
|
|
|
20
|
-
const HeaderPanel = /*#__PURE__*/React.forwardRef(
|
|
20
|
+
const HeaderPanel = /*#__PURE__*/React.forwardRef(({
|
|
21
21
|
children,
|
|
22
22
|
className: customClassName,
|
|
23
23
|
expanded,
|
|
@@ -25,7 +25,7 @@ const HeaderPanel = /*#__PURE__*/React.forwardRef(function HeaderPanel({
|
|
|
25
25
|
onHeaderPanelFocus = noopFn,
|
|
26
26
|
href,
|
|
27
27
|
...rest
|
|
28
|
-
}, ref) {
|
|
28
|
+
}, ref) => {
|
|
29
29
|
const prefix = usePrefix();
|
|
30
30
|
const headerPanelReference = useRef(null);
|
|
31
31
|
const headerPanelRef = useMergedRefs([headerPanelReference, ref]);
|
|
@@ -17,9 +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/20071
|
|
20
21
|
isSideNavExpanded: _isSideNavExpanded,
|
|
21
22
|
...rest
|
|
22
23
|
}, ref) => {
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
23
25
|
const BaseComponentAsAny = BaseComponent ?? element ?? 'a';
|
|
24
26
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _extends({
|
|
25
27
|
ref: ref
|
|
@@ -21,6 +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/20071
|
|
24
25
|
const childDisplayName = child.type?.displayName;
|
|
25
26
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
26
27
|
...(CARBON_SIDENAV_ITEMS.includes(childDisplayName) ? {
|
|
@@ -16,7 +16,7 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
16
16
|
import { SideNavContext } from './SideNav.js';
|
|
17
17
|
|
|
18
18
|
var _ChevronDown;
|
|
19
|
-
const SideNavMenu = /*#__PURE__*/React.forwardRef(
|
|
19
|
+
const SideNavMenu = /*#__PURE__*/React.forwardRef(({
|
|
20
20
|
className: customClassName,
|
|
21
21
|
children,
|
|
22
22
|
defaultExpanded = false,
|
|
@@ -26,7 +26,7 @@ const SideNavMenu = /*#__PURE__*/React.forwardRef(function SideNavMenu({
|
|
|
26
26
|
isSideNavExpanded,
|
|
27
27
|
tabIndex,
|
|
28
28
|
title
|
|
29
|
-
}, ref) {
|
|
29
|
+
}, ref) => {
|
|
30
30
|
const {
|
|
31
31
|
isRail
|
|
32
32
|
} = useContext(SideNavContext);
|
|
@@ -13,7 +13,7 @@ import SideNavLinkText from './SideNavLinkText.js';
|
|
|
13
13
|
import Link from './Link.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
15
|
|
|
16
|
-
const SideNavMenuItem = /*#__PURE__*/React.forwardRef(
|
|
16
|
+
const SideNavMenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
17
17
|
const prefix = usePrefix();
|
|
18
18
|
const {
|
|
19
19
|
children,
|
|
@@ -13,7 +13,7 @@ import { useId } from '../../internal/useId.js';
|
|
|
13
13
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
14
14
|
|
|
15
15
|
var _ChevronDown;
|
|
16
|
-
const SideNavSwitcher = /*#__PURE__*/forwardRef(
|
|
16
|
+
const SideNavSwitcher = /*#__PURE__*/forwardRef((props, ref) => {
|
|
17
17
|
const id = useId('side-nav-switcher');
|
|
18
18
|
const prefix = usePrefix();
|
|
19
19
|
const {
|
|
@@ -41,7 +41,7 @@ import './SideNavMenu.js';
|
|
|
41
41
|
import './SideNavMenuItem.js';
|
|
42
42
|
import './SideNavSwitcher.js';
|
|
43
43
|
|
|
44
|
-
const Switcher = /*#__PURE__*/forwardRef(
|
|
44
|
+
const Switcher = /*#__PURE__*/forwardRef((props, forwardRef) => {
|
|
45
45
|
const switcherRef = useRef(null);
|
|
46
46
|
const ref = useMergedRefs([switcherRef, forwardRef]);
|
|
47
47
|
const prefix = usePrefix();
|
|
@@ -81,6 +81,7 @@ const Switcher = /*#__PURE__*/forwardRef(function Switcher(props, forwardRef) {
|
|
|
81
81
|
if (direction === 1) {
|
|
82
82
|
return enabledIndices[1];
|
|
83
83
|
}
|
|
84
|
+
// eslint-disable-next-line no-fallthrough -- https://github.com/carbon-design-system/carbon/issues/20071
|
|
84
85
|
default:
|
|
85
86
|
return enabledIndices[nextIndex];
|
|
86
87
|
}
|