@carbon/react 1.99.0-rc.0 → 1.100.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 +942 -942
- package/es/components/BadgeIndicator/index.d.ts +1 -1
- package/es/components/BadgeIndicator/index.js +8 -6
- package/es/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/es/components/Breadcrumb/BreadcrumbItem.js +6 -7
- package/es/components/Button/Button.Skeleton.d.ts +28 -2
- package/es/components/Button/Button.js +3 -2
- package/es/components/ChatButton/ChatButton.d.ts +3 -2
- package/es/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
- package/es/components/ComboBox/ComboBox.d.ts +4 -4
- package/es/components/ComboBox/ComboBox.js +21 -3
- package/es/components/ComposedModal/ComposedModal.d.ts +2 -2
- package/es/components/ContainedList/ContainedList.d.ts +35 -6
- package/es/components/ContainedList/ContainedList.js +3 -1
- package/es/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
- package/es/components/ContainedList/index.d.ts +1 -1
- package/es/components/ContainedList/index.js +4 -1
- package/es/components/DangerButton/DangerButton.d.ts +1 -1
- package/es/components/DataTable/DataTable.d.ts +22 -5
- package/es/components/DataTable/DataTable.js +1 -1
- package/es/components/DataTable/TableExpandRow.d.ts +1 -1
- package/es/components/DataTable/TableExpandRow.js +2 -2
- package/es/components/DataTable/TableHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +18 -16
- package/es/components/DataTable/TableToolbar.d.ts +25 -1
- package/es/components/DataTable/TableToolbarMenu.d.ts +25 -5
- package/es/components/DataTable/TableToolbarMenu.js +0 -3
- package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
- package/es/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
- package/es/components/DatePicker/DatePicker.d.ts +2 -2
- package/es/components/DatePicker/DatePicker.js +38 -53
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
- package/es/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/es/components/DatePickerInput/DatePickerInput.js +3 -2
- package/es/components/Dialog/Dialog.d.ts +1 -1
- package/es/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
- package/es/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/es/components/ExpandableSearch/ExpandableSearch.js +14 -12
- package/es/components/FileUploader/FileUploader.d.ts +1 -1
- package/es/components/FileUploader/FileUploader.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +28 -10
- package/es/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
- package/es/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
- package/es/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
- package/es/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
- package/es/components/FluidForm/FluidForm.d.ts +15 -2
- package/es/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
- package/es/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
- package/es/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
- package/es/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
- package/es/components/FluidSearch/FluidSearch.d.ts +1 -1
- package/es/components/FluidSearch/FluidSearch.js +3 -3
- package/es/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
- package/es/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
- package/es/components/FluidTextArea/FluidTextArea.d.ts +95 -1
- package/es/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
- package/es/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
- package/es/components/Grid/GridContext.d.ts +19 -1
- package/es/components/IconButton/index.d.ts +1 -1
- package/es/components/IconButton/index.js +2 -2
- package/es/components/Link/Link.js +3 -0
- package/es/components/ListBox/ListBoxField.d.ts +35 -2
- package/es/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
- package/es/components/ListBox/ListBoxMenuItem.d.ts +1 -1
- package/es/components/ListBox/ListBoxSelection.d.ts +34 -3
- package/es/components/Menu/MenuItem.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/es/components/MultiSelect/FilterableMultiSelect.js +22 -13
- package/es/components/MultiSelect/MultiSelect.js +22 -13
- package/es/components/Notification/Notification.d.ts +8 -7
- package/es/components/Notification/Notification.js +0 -1
- package/es/components/NumberInput/NumberInput.d.ts +9 -0
- package/es/components/NumberInput/NumberInput.js +206 -38
- package/es/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/es/components/OverflowMenu/OverflowMenu.js +0 -1
- package/es/components/OverflowMenu/index.d.ts +1 -1
- package/es/components/PageHeader/PageHeader.d.ts +3 -3
- package/es/components/Popover/index.js +21 -12
- package/es/components/Search/Search.d.ts +2 -2
- package/es/components/Select/Select.d.ts +1 -1
- package/es/components/Select/Select.js +2 -2
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
- package/es/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/es/components/Tag/Tag.d.ts +1 -1
- package/es/components/Tag/Tag.js +2 -0
- package/es/components/Text/Text.d.ts +1 -1
- package/es/components/Text/Text.js +4 -3
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/Text/TextDirection.js +1 -3
- package/es/components/Text/TextDirectionContext.d.ts +3 -3
- package/es/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/es/components/TextInput/ControlledPasswordInput.js +2 -2
- package/es/components/TextInput/PasswordInput.d.ts +1 -1
- package/es/components/TextInput/PasswordInput.js +2 -2
- package/es/components/TextInput/TextInput.d.ts +1 -1
- package/es/components/TextInput/TextInput.js +2 -2
- package/es/components/Toggle/Toggle.Skeleton.d.ts +9 -3
- package/es/components/Toggletip/index.d.ts +1 -1
- package/es/components/Toggletip/index.js +9 -7
- package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -1
- package/es/components/Tooltip/Tooltip.js +2 -0
- package/es/components/TreeView/TreeNode.d.ts +4 -4
- package/es/components/UIShell/Header.d.ts +20 -3
- package/es/components/UIShell/HeaderGlobalAction.d.ts +2 -2
- package/es/components/UIShell/HeaderName.js +1 -1
- package/es/components/UIShell/Link.d.ts +1 -1
- package/es/components/UIShell/Link.js +14 -14
- package/es/components/UIShell/SideNav.d.ts +3 -3
- package/es/components/UIShell/SideNav.js +26 -25
- package/es/components/UIShell/SideNavDivider.d.ts +11 -3
- package/es/components/UIShell/SideNavHeader.d.ts +24 -1
- package/es/components/UIShell/SideNavIcon.d.ts +20 -2
- package/es/components/UIShell/SideNavItem.d.ts +20 -2
- package/es/components/UIShell/SideNavItems.d.ts +22 -2
- package/es/components/UIShell/SideNavLink.d.ts +1 -1
- package/es/components/UIShell/SideNavLink.js +14 -14
- package/es/components/UIShell/SideNavMenu.d.ts +1 -1
- package/es/components/UIShell/SideNavMenu.js +2 -2
- package/es/components/UIShell/SideNavMenuItem.d.ts +2 -2
- package/es/components/UIShell/SideNavMenuItem.js +2 -2
- package/es/components/UIShell/SwitcherDivider.d.ts +10 -2
- package/es/internal/FloatingMenu.d.ts +1 -1
- package/es/internal/FloatingMenu.js +0 -2
- package/es/internal/PolymorphicProps.d.ts +3 -3
- package/es/internal/useNoInteractiveChildren.d.ts +1 -1
- package/es/internal/useNoInteractiveChildren.js +8 -10
- package/es/internal/useOutsideClick.d.ts +1 -1
- package/es/internal/useOutsideClick.js +0 -4
- package/lib/components/BadgeIndicator/index.d.ts +1 -1
- package/lib/components/BadgeIndicator/index.js +7 -5
- package/lib/components/Breadcrumb/BreadcrumbItem.d.ts +1 -1
- package/lib/components/Breadcrumb/BreadcrumbItem.js +5 -6
- package/lib/components/Button/Button.Skeleton.d.ts +28 -2
- package/lib/components/Button/Button.js +3 -2
- package/lib/components/ChatButton/ChatButton.d.ts +3 -2
- package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +60 -2
- package/lib/components/ComboBox/ComboBox.d.ts +4 -4
- package/lib/components/ComboBox/ComboBox.js +21 -3
- package/lib/components/ComposedModal/ComposedModal.d.ts +2 -2
- package/lib/components/ContainedList/ContainedList.d.ts +35 -6
- package/lib/components/ContainedList/ContainedList.js +3 -1
- package/lib/components/ContainedList/ContainedListItem/ContainedListItem.d.ts +32 -3
- package/lib/components/ContainedList/index.d.ts +1 -1
- package/lib/components/ContainedList/index.js +4 -1
- package/lib/components/DangerButton/DangerButton.d.ts +1 -1
- package/lib/components/DataTable/DataTable.d.ts +22 -5
- package/lib/components/DataTable/DataTable.js +1 -1
- package/lib/components/DataTable/TableExpandRow.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +17 -15
- package/lib/components/DataTable/TableToolbar.d.ts +25 -1
- package/lib/components/DataTable/TableToolbarMenu.d.ts +25 -5
- package/lib/components/DataTable/TableToolbarMenu.js +0 -3
- package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +51 -2
- package/lib/components/DataTableSkeleton/DataTableSkeleton.js +6 -0
- package/lib/components/DatePicker/DatePicker.d.ts +2 -2
- package/lib/components/DatePicker/DatePicker.js +37 -52
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +28 -2
- package/lib/components/DatePickerInput/DatePickerInput.d.ts +1 -1
- package/lib/components/DatePickerInput/DatePickerInput.js +2 -1
- package/lib/components/Dialog/Dialog.d.ts +1 -1
- package/lib/components/Dropdown/Dropdown.Skeleton.d.ts +19 -2
- package/lib/components/ExpandableSearch/ExpandableSearch.d.ts +1 -1
- package/lib/components/ExpandableSearch/ExpandableSearch.js +13 -11
- package/lib/components/FileUploader/FileUploader.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +28 -10
- package/lib/components/FluidComboBox/FluidComboBox.Skeleton.d.ts +11 -3
- package/lib/components/FluidDatePicker/FluidDatePicker.Skeleton.d.ts +15 -3
- package/lib/components/FluidDatePicker/FluidDatePicker.d.ts +2 -2
- package/lib/components/FluidDropdown/FluidDropdown.Skeleton.d.ts +11 -3
- package/lib/components/FluidForm/FluidForm.d.ts +15 -2
- package/lib/components/FluidMultiSelect/FluidFilterableMultiSelect.d.ts +2 -2
- package/lib/components/FluidMultiSelect/FluidMultiSelect.Skeleton.d.ts +11 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.Skeleton.d.ts +11 -3
- package/lib/components/FluidNumberInput/FluidNumberInput.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.Skeleton.d.ts +11 -3
- package/lib/components/FluidSearch/FluidSearch.d.ts +1 -1
- package/lib/components/FluidSearch/FluidSearch.js +2 -2
- package/lib/components/FluidSelect/FluidSelect.Skeleton.d.ts +11 -3
- package/lib/components/FluidTextArea/FluidTextArea.Skeleton.d.ts +11 -3
- package/lib/components/FluidTextArea/FluidTextArea.d.ts +95 -1
- package/lib/components/FluidTextInput/FluidPasswordInput.d.ts +83 -2
- package/lib/components/FluidTextInput/FluidTextInput.Skeleton.d.ts +11 -3
- package/lib/components/Grid/GridContext.d.ts +19 -1
- package/lib/components/IconButton/index.d.ts +1 -1
- package/lib/components/Link/Link.js +3 -0
- package/lib/components/ListBox/ListBoxField.d.ts +35 -2
- package/lib/components/ListBox/ListBoxMenuIcon.d.ts +16 -3
- package/lib/components/ListBox/ListBoxMenuItem.d.ts +1 -1
- package/lib/components/ListBox/ListBoxSelection.d.ts +34 -3
- package/lib/components/Menu/MenuItem.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.d.ts +2 -2
- package/lib/components/MultiSelect/FilterableMultiSelect.js +22 -13
- package/lib/components/MultiSelect/MultiSelect.js +22 -13
- package/lib/components/Notification/Notification.d.ts +8 -7
- package/lib/components/Notification/Notification.js +0 -1
- package/lib/components/NumberInput/NumberInput.d.ts +9 -0
- package/lib/components/NumberInput/NumberInput.js +206 -37
- package/lib/components/OverflowMenu/OverflowMenu.d.ts +1 -1
- package/lib/components/OverflowMenu/OverflowMenu.js +0 -1
- package/lib/components/OverflowMenu/index.d.ts +1 -1
- package/lib/components/PageHeader/PageHeader.d.ts +3 -3
- package/lib/components/Popover/index.js +19 -10
- package/lib/components/Search/Search.d.ts +2 -2
- package/lib/components/Select/Select.d.ts +1 -1
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +16 -2
- package/lib/components/SkeletonText/SkeletonText.d.ts +1 -1
- package/lib/components/Tag/Tag.d.ts +1 -1
- package/lib/components/Tag/Tag.js +2 -0
- package/lib/components/Text/Text.d.ts +1 -1
- package/lib/components/Text/Text.js +3 -2
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/Text/TextDirection.js +1 -3
- package/lib/components/Text/TextDirectionContext.d.ts +3 -3
- package/lib/components/TextInput/ControlledPasswordInput.d.ts +1 -1
- package/lib/components/TextInput/PasswordInput.d.ts +1 -1
- package/lib/components/TextInput/TextInput.d.ts +1 -1
- package/lib/components/Toggle/Toggle.Skeleton.d.ts +9 -3
- package/lib/components/Toggletip/index.d.ts +1 -1
- package/lib/components/Toggletip/index.js +7 -5
- package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -1
- package/lib/components/Tooltip/Tooltip.js +2 -0
- package/lib/components/TreeView/TreeNode.d.ts +4 -4
- package/lib/components/UIShell/Header.d.ts +20 -3
- package/lib/components/UIShell/HeaderGlobalAction.d.ts +2 -2
- package/lib/components/UIShell/HeaderName.js +1 -1
- package/lib/components/UIShell/Link.d.ts +1 -1
- package/lib/components/UIShell/Link.js +13 -13
- package/lib/components/UIShell/SideNav.d.ts +3 -3
- package/lib/components/UIShell/SideNav.js +25 -24
- package/lib/components/UIShell/SideNavDivider.d.ts +11 -3
- package/lib/components/UIShell/SideNavHeader.d.ts +24 -1
- package/lib/components/UIShell/SideNavIcon.d.ts +20 -2
- package/lib/components/UIShell/SideNavItem.d.ts +20 -2
- package/lib/components/UIShell/SideNavItems.d.ts +22 -2
- package/lib/components/UIShell/SideNavLink.d.ts +1 -1
- package/lib/components/UIShell/SideNavLink.js +14 -14
- package/lib/components/UIShell/SideNavMenu.d.ts +1 -1
- package/lib/components/UIShell/SideNavMenuItem.d.ts +2 -2
- package/lib/components/UIShell/SwitcherDivider.d.ts +10 -2
- package/lib/internal/FloatingMenu.d.ts +1 -1
- package/lib/internal/FloatingMenu.js +0 -2
- package/lib/internal/PolymorphicProps.d.ts +3 -3
- package/lib/internal/useNoInteractiveChildren.d.ts +1 -1
- package/lib/internal/useNoInteractiveChildren.js +8 -10
- package/lib/internal/useOutsideClick.d.ts +1 -1
- package/lib/internal/useOutsideClick.js +0 -4
- package/package.json +8 -8
- package/scss/_carbon-utilities.scss +9 -0
- package/telemetry.yml +0 -1
- package/es/internal/createClassWrapper.d.ts +0 -12
- package/lib/internal/createClassWrapper.d.ts +0 -12
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
|
-
import React, { useRef, useState, useEffect, useContext, cloneElement } from 'react';
|
|
9
|
+
import React, { forwardRef, useRef, useState, useEffect, useContext, cloneElement } from 'react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import { useNormalizedInputProps } from '../../internal/useNormalizedInputProps.js';
|
|
12
12
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
@@ -21,7 +21,7 @@ import '../Text/TextDirection.js';
|
|
|
21
21
|
import { AILabel } from '../AILabel/index.js';
|
|
22
22
|
import { isComponentElement } from '../../internal/utils.js';
|
|
23
23
|
|
|
24
|
-
const TextInput = /*#__PURE__*/
|
|
24
|
+
const TextInput = /*#__PURE__*/forwardRef(({
|
|
25
25
|
className,
|
|
26
26
|
decorator,
|
|
27
27
|
disabled = false,
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
8
|
export interface ToggleSkeletonProps {
|
|
9
9
|
'aria-label'?: string;
|
|
10
10
|
className?: string;
|
|
11
11
|
}
|
|
12
|
-
declare const ToggleSkeleton:
|
|
12
|
+
declare const ToggleSkeleton: {
|
|
13
|
+
({ className, ...rest }: ToggleSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
propTypes: {
|
|
15
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
16
|
+
className: PropTypes.Requireable<string>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
13
19
|
export default ToggleSkeleton;
|
|
14
20
|
export { ToggleSkeleton };
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import React, { useContext, useRef, useState, useEffect } from 'react';
|
|
11
|
+
import React, { forwardRef, useContext, useRef, useState, useEffect } from 'react';
|
|
12
12
|
import { Popover, PopoverContent } from '../Popover/index.js';
|
|
13
13
|
import { Escape } from '../../internal/keyboard/keys.js';
|
|
14
14
|
import { match } from '../../internal/keyboard/match.js';
|
|
@@ -184,8 +184,7 @@ Toggletip.propTypes = {
|
|
|
184
184
|
* `ToggletipButton` controls the visibility of the Toggletip through mouse
|
|
185
185
|
* clicks and keyboard interactions.
|
|
186
186
|
*/
|
|
187
|
-
|
|
188
|
-
const ToggletipButton = /*#__PURE__*/React.forwardRef(function ToggletipButton({
|
|
187
|
+
const ToggletipButton = /*#__PURE__*/forwardRef(function ToggletipButton({
|
|
189
188
|
children,
|
|
190
189
|
className: customClassName,
|
|
191
190
|
label = 'Show information',
|
|
@@ -225,15 +224,18 @@ ToggletipButton.propTypes = {
|
|
|
225
224
|
label: PropTypes.string
|
|
226
225
|
};
|
|
227
226
|
ToggletipButton.displayName = 'ToggletipButton';
|
|
227
|
+
const frFn = forwardRef;
|
|
228
|
+
|
|
228
229
|
/**
|
|
229
230
|
* `ToggletipContent` is a wrapper around `PopoverContent`. It places the
|
|
230
231
|
* `children` passed in as a prop inside of `PopoverContent` so that they will
|
|
231
232
|
* be rendered inside of the popover for this component.
|
|
232
233
|
*/
|
|
233
|
-
const ToggletipContent =
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
234
|
+
const ToggletipContent = frFn((props, ref) => {
|
|
235
|
+
const {
|
|
236
|
+
children,
|
|
237
|
+
className: customClassName
|
|
238
|
+
} = props;
|
|
237
239
|
const toggletip = useToggletip();
|
|
238
240
|
const prefix = usePrefix();
|
|
239
241
|
return /*#__PURE__*/React.createElement(PopoverContent, _extends({
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
import { PopoverAlignment } from '../Popover';
|
|
9
10
|
export interface DefinitionTooltipProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'id' | 'classname' | 'children' | 'type'> {
|
|
@@ -54,5 +55,55 @@ export interface DefinitionTooltipProps extends Omit<React.ButtonHTMLAttributes<
|
|
|
54
55
|
*/
|
|
55
56
|
triggerClassName?: string;
|
|
56
57
|
}
|
|
57
|
-
declare const DefinitionTooltip:
|
|
58
|
+
declare const DefinitionTooltip: {
|
|
59
|
+
({ align, autoAlign, className, children, definition, defaultOpen, id, openOnHover, tooltipText, triggerClassName, ...rest }: DefinitionTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
propTypes: {
|
|
61
|
+
/**
|
|
62
|
+
* Specify how the trigger should align with the tooltip
|
|
63
|
+
*/
|
|
64
|
+
align: PropTypes.Requireable<string>;
|
|
65
|
+
/**
|
|
66
|
+
* Will auto-align the popover. This prop is currently experimental and is
|
|
67
|
+
* subject to future changes. Requires React v17+
|
|
68
|
+
* @see https://github.com/carbon-design-system/carbon/issues/18714
|
|
69
|
+
*/
|
|
70
|
+
autoAlign: PropTypes.Requireable<boolean>;
|
|
71
|
+
/**
|
|
72
|
+
* The `children` prop will be used as the value that is being defined
|
|
73
|
+
*/
|
|
74
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
75
|
+
/**
|
|
76
|
+
* Specify an optional className to be applied to the container node
|
|
77
|
+
*/
|
|
78
|
+
className: PropTypes.Requireable<string>;
|
|
79
|
+
/**
|
|
80
|
+
* Specify whether the tooltip should be open when it first renders
|
|
81
|
+
*/
|
|
82
|
+
defaultOpen: PropTypes.Requireable<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* The `definition` prop is used as the content inside of the tooltip that
|
|
85
|
+
* appears when a user interacts with the element rendered by the `children`
|
|
86
|
+
* prop
|
|
87
|
+
*/
|
|
88
|
+
definition: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
89
|
+
/**
|
|
90
|
+
* Provide a value that will be assigned as the id of the tooltip
|
|
91
|
+
*/
|
|
92
|
+
id: PropTypes.Requireable<string>;
|
|
93
|
+
/**
|
|
94
|
+
* Specifies whether or not the `DefinitionTooltip` should open on hover or not
|
|
95
|
+
*/
|
|
96
|
+
openOnHover: PropTypes.Requireable<boolean>;
|
|
97
|
+
/**
|
|
98
|
+
* [Deprecated in v11] Please use the `definition` prop instead.
|
|
99
|
+
*
|
|
100
|
+
* Provide the text that will be displayed in the tooltip when it is rendered.
|
|
101
|
+
*/
|
|
102
|
+
tooltipText: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
103
|
+
/**
|
|
104
|
+
* The CSS class name of the trigger element
|
|
105
|
+
*/
|
|
106
|
+
triggerClassName: PropTypes.Requireable<string>;
|
|
107
|
+
};
|
|
108
|
+
};
|
|
58
109
|
export { DefinitionTooltip };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import React, { type
|
|
7
|
+
import React, { type ElementType } from 'react';
|
|
8
8
|
type UncontrolledOnToggle = (event: React.MouseEvent | React.KeyboardEvent, node: Pick<TreeNodeProps, 'id' | 'label' | 'value' | 'isExpanded'>) => void;
|
|
9
9
|
type ControlledOnToggle = (isExpanded: TreeNodeProps['isExpanded']) => void;
|
|
10
10
|
export type TreeNodeProps = {
|
|
@@ -78,7 +78,7 @@ export type TreeNodeProps = {
|
|
|
78
78
|
/**
|
|
79
79
|
* A component used to render an icon.
|
|
80
80
|
*/
|
|
81
|
-
renderIcon?:
|
|
81
|
+
renderIcon?: ElementType;
|
|
82
82
|
/**
|
|
83
83
|
* **Note:** this is controlled by the parent TreeView component, do not set manually.
|
|
84
84
|
* Array containing all selected node IDs in the tree
|
|
@@ -178,7 +178,7 @@ declare const TreeNode: React.ForwardRefExoticComponent<{
|
|
|
178
178
|
/**
|
|
179
179
|
* A component used to render an icon.
|
|
180
180
|
*/
|
|
181
|
-
renderIcon?:
|
|
181
|
+
renderIcon?: ElementType;
|
|
182
182
|
/**
|
|
183
183
|
* **Note:** this is controlled by the parent TreeView component, do not set manually.
|
|
184
184
|
* Array containing all selected node IDs in the tree
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import { ReactNode } from 'react';
|
|
8
9
|
export interface HeaderProps {
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
/**
|
|
@@ -20,5 +21,21 @@ export interface HeaderProps {
|
|
|
20
21
|
*/
|
|
21
22
|
className?: string;
|
|
22
23
|
}
|
|
23
|
-
declare const Header:
|
|
24
|
+
declare const Header: {
|
|
25
|
+
({ className: customClassName, children, ...rest }: HeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
propTypes: {
|
|
27
|
+
/**
|
|
28
|
+
* Optionally provide aria-label
|
|
29
|
+
*/
|
|
30
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
31
|
+
/**
|
|
32
|
+
* Optionally provide aria-labelledby
|
|
33
|
+
*/
|
|
34
|
+
'aria-labelledby': PropTypes.Requireable<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Optionally provide a custom class name that is applied to the underlying header
|
|
37
|
+
*/
|
|
38
|
+
className: PropTypes.Requireable<string>;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
24
41
|
export default Header;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -55,5 +55,5 @@ export interface HeaderGlobalActionProps {
|
|
|
55
55
|
*
|
|
56
56
|
* Note: children passed to this component should be an Icon.
|
|
57
57
|
*/
|
|
58
|
-
declare const HeaderGlobalAction: React.
|
|
58
|
+
declare const HeaderGlobalAction: React.ForwardRefExoticComponent<HeaderGlobalActionProps & React.RefAttributes<HTMLButtonElement>>;
|
|
59
59
|
export default HeaderGlobalAction;
|
|
@@ -24,7 +24,7 @@ function HeaderName({
|
|
|
24
24
|
className: className
|
|
25
25
|
}), prefix && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
26
26
|
className: `${selectorPrefix}--header__name--prefix`
|
|
27
|
-
}, prefix), "\xA0"), children);
|
|
27
|
+
}, prefix), "\xA0"), /*#__PURE__*/React.createElement("span", null, children));
|
|
28
28
|
}
|
|
29
29
|
HeaderName.propTypes = {
|
|
30
30
|
/**
|
|
@@ -7,29 +7,29 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React from 'react';
|
|
10
|
+
import React, { forwardRef } from 'react';
|
|
11
11
|
import { deprecate } from '../../prop-types/deprecate.js';
|
|
12
12
|
|
|
13
13
|
// First define the component without generics
|
|
14
14
|
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const frFn = forwardRef;
|
|
16
|
+
const Link = frFn((props, ref) => {
|
|
17
|
+
const {
|
|
18
|
+
element,
|
|
19
|
+
as: BaseComponent,
|
|
20
|
+
// Captured here to prevent it from being passed into the created element.
|
|
21
|
+
// See https://github.com/carbon-design-system/carbon/issues/3970
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
23
|
+
isSideNavExpanded: _isSideNavExpanded,
|
|
24
|
+
...rest
|
|
25
|
+
} = props;
|
|
26
|
+
|
|
24
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
25
28
|
const BaseComponentAsAny = BaseComponent ?? element ?? 'a';
|
|
26
29
|
return /*#__PURE__*/React.createElement(BaseComponentAsAny, _extends({
|
|
27
30
|
ref: ref
|
|
28
31
|
}, rest));
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
// Use forwardRef with the non-generic function
|
|
32
|
-
const Link = /*#__PURE__*/React.forwardRef(LinkBase);
|
|
32
|
+
});
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Link is a custom component that allows us to supporting rendering elements
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2026
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
@@ -9,7 +9,7 @@ export interface SideNavProps {
|
|
|
9
9
|
expanded?: boolean | undefined;
|
|
10
10
|
defaultExpanded?: boolean | undefined;
|
|
11
11
|
isChildOfHeader?: boolean | undefined;
|
|
12
|
-
onToggle?: (event: FocusEvent<HTMLElement> | KeyboardEvent<HTMLElement> | boolean, value: boolean) => void
|
|
12
|
+
onToggle?: (event: FocusEvent<HTMLElement> | KeyboardEvent<HTMLElement> | boolean, value: boolean) => void;
|
|
13
13
|
href?: string | undefined;
|
|
14
14
|
isFixedNav?: boolean | undefined;
|
|
15
15
|
isRail?: boolean | undefined;
|
|
@@ -17,7 +17,7 @@ export interface SideNavProps {
|
|
|
17
17
|
addFocusListeners?: boolean | undefined;
|
|
18
18
|
addMouseListeners?: boolean | undefined;
|
|
19
19
|
onOverlayClick?: MouseEventHandler<HTMLDivElement> | undefined;
|
|
20
|
-
onSideNavBlur?: () => void
|
|
20
|
+
onSideNavBlur?: () => void;
|
|
21
21
|
enterDelayMs?: number;
|
|
22
22
|
inert?: boolean;
|
|
23
23
|
}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
|
-
import React, { useRef, isValidElement, createContext } from 'react';
|
|
9
|
+
import React, { forwardRef, useRef, isValidElement, createContext } from 'react';
|
|
10
10
|
import cx from 'classnames';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import { AriaLabelPropType } from '../../prop-types/AriaPropTypes.js';
|
|
@@ -24,28 +24,30 @@ import { useMatchMedia } from '../../internal/useMatchMedia.js';
|
|
|
24
24
|
// import SideNavFooter from './SideNavFooter';
|
|
25
25
|
|
|
26
26
|
const SideNavContext = /*#__PURE__*/createContext({});
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
27
|
+
const frFn = forwardRef;
|
|
28
|
+
const SideNav = frFn((props, ref) => {
|
|
29
|
+
const {
|
|
30
|
+
expanded: expandedProp,
|
|
31
|
+
defaultExpanded = false,
|
|
32
|
+
isChildOfHeader = true,
|
|
33
|
+
'aria-label': ariaLabel,
|
|
34
|
+
'aria-labelledby': ariaLabelledBy,
|
|
35
|
+
children,
|
|
36
|
+
onToggle,
|
|
37
|
+
className: customClassName,
|
|
38
|
+
// TO-DO: comment back in when footer is added for rails
|
|
39
|
+
// translateById: t = (id) => translations[id],
|
|
40
|
+
href,
|
|
41
|
+
isFixedNav = false,
|
|
42
|
+
isRail,
|
|
43
|
+
isPersistent = true,
|
|
44
|
+
addFocusListeners = true,
|
|
45
|
+
addMouseListeners = true,
|
|
46
|
+
onOverlayClick,
|
|
47
|
+
onSideNavBlur,
|
|
48
|
+
enterDelayMs = 100,
|
|
49
|
+
...other
|
|
50
|
+
} = props;
|
|
49
51
|
const prefix = usePrefix();
|
|
50
52
|
const {
|
|
51
53
|
current: controlled
|
|
@@ -171,8 +173,7 @@ function SideNavRenderFunction({
|
|
|
171
173
|
className: `${prefix}--side-nav__navigation ${className}`,
|
|
172
174
|
inert: !isRail ? !(expanded || isLg) : undefined
|
|
173
175
|
}, accessibilityLabel, eventHandlers, other), childrenToRender));
|
|
174
|
-
}
|
|
175
|
-
const SideNav = /*#__PURE__*/React.forwardRef(SideNavRenderFunction);
|
|
176
|
+
});
|
|
176
177
|
SideNav.displayName = 'SideNav';
|
|
177
178
|
SideNav.propTypes = {
|
|
178
179
|
/**
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2021
|
|
2
|
+
* Copyright IBM Corp. 2021, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
-
import
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
8
|
interface SideNavDividerProps {
|
|
9
9
|
/**
|
|
10
10
|
* Provide an optional class to be applied to the containing node
|
|
11
11
|
*/
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
declare const SideNavDivider:
|
|
14
|
+
declare const SideNavDivider: {
|
|
15
|
+
({ className }: SideNavDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
propTypes: {
|
|
17
|
+
/**
|
|
18
|
+
* Provide an optional class to be applied to the containing node
|
|
19
|
+
*/
|
|
20
|
+
className: PropTypes.Requireable<string>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
15
23
|
export default SideNavDivider;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
export interface SideNavHeaderProps {
|
|
9
10
|
/**
|
|
@@ -24,5 +25,27 @@ export interface SideNavHeaderProps {
|
|
|
24
25
|
*/
|
|
25
26
|
renderIcon: React.ComponentType;
|
|
26
27
|
}
|
|
27
|
-
declare const SideNavHeader:
|
|
28
|
+
declare const SideNavHeader: {
|
|
29
|
+
({ children, className: customClassName, renderIcon: IconElement, }: SideNavHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
displayName: string;
|
|
31
|
+
propTypes: {
|
|
32
|
+
/**
|
|
33
|
+
* The child nodes to be rendered
|
|
34
|
+
*/
|
|
35
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
36
|
+
/**
|
|
37
|
+
* Provide an optional class to be applied to the containing node
|
|
38
|
+
*/
|
|
39
|
+
className: PropTypes.Requireable<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Property to indicate if the side nav container is open (or not). Use to
|
|
42
|
+
* keep local state and styling in step with the SideNav expansion state.
|
|
43
|
+
*/
|
|
44
|
+
isSideNavExpanded: PropTypes.Requireable<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* A component used to render an icon.
|
|
47
|
+
*/
|
|
48
|
+
renderIcon: PropTypes.Validator<object>;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
28
51
|
export default SideNavHeader;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
export interface SideNavIconProps {
|
|
9
10
|
/**
|
|
@@ -21,5 +22,22 @@ export interface SideNavIconProps {
|
|
|
21
22
|
*/
|
|
22
23
|
small?: boolean;
|
|
23
24
|
}
|
|
24
|
-
declare const SideNavIcon:
|
|
25
|
+
declare const SideNavIcon: {
|
|
26
|
+
({ children, className: customClassName, small, }: SideNavIconProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
propTypes: {
|
|
28
|
+
/**
|
|
29
|
+
* Provide a single icon as the child to `SideNavIcon` to render in the
|
|
30
|
+
* container
|
|
31
|
+
*/
|
|
32
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
33
|
+
/**
|
|
34
|
+
* Provide an optional class to be applied to the containing node
|
|
35
|
+
*/
|
|
36
|
+
className: PropTypes.Requireable<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Specify whether the icon should be placed in a smaller bounding box
|
|
39
|
+
*/
|
|
40
|
+
small: PropTypes.Requireable<boolean>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
25
43
|
export default SideNavIcon;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
export interface SideNavItemProps {
|
|
9
10
|
/**
|
|
@@ -20,5 +21,22 @@ export interface SideNavItemProps {
|
|
|
20
21
|
*/
|
|
21
22
|
large?: boolean;
|
|
22
23
|
}
|
|
23
|
-
declare const SideNavItem:
|
|
24
|
+
declare const SideNavItem: {
|
|
25
|
+
({ className: customClassName, children, large, }: SideNavItemProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
propTypes: {
|
|
27
|
+
/**
|
|
28
|
+
* Provide a single icon as the child to `SideNavItem` to render in the
|
|
29
|
+
* container
|
|
30
|
+
*/
|
|
31
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
32
|
+
/**
|
|
33
|
+
* Provide an optional class to be applied to the containing node
|
|
34
|
+
*/
|
|
35
|
+
className: PropTypes.Requireable<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Specify if this is a large variation of the SideNavItem
|
|
38
|
+
*/
|
|
39
|
+
large: PropTypes.Requireable<boolean>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
24
42
|
export default SideNavItem;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2016,
|
|
2
|
+
* Copyright IBM Corp. 2016, 2025
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
export interface SideNavItemsProps {
|
|
9
10
|
/**
|
|
@@ -21,5 +22,24 @@ export interface SideNavItemsProps {
|
|
|
21
22
|
*/
|
|
22
23
|
isSideNavExpanded?: boolean;
|
|
23
24
|
}
|
|
24
|
-
declare const SideNavItems:
|
|
25
|
+
declare const SideNavItems: {
|
|
26
|
+
({ className: customClassName, children, isSideNavExpanded, }: SideNavItemsProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
propTypes: {
|
|
29
|
+
/**
|
|
30
|
+
* Provide a single icon as the child to `SideNavIcon` to render in the
|
|
31
|
+
* container
|
|
32
|
+
*/
|
|
33
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
34
|
+
/**
|
|
35
|
+
* Provide an optional class to be applied to the containing node
|
|
36
|
+
*/
|
|
37
|
+
className: PropTypes.Requireable<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Property to indicate if the side nav container is open (or not). Use to
|
|
40
|
+
* keep local state and styling in step with the SideNav expansion state.
|
|
41
|
+
*/
|
|
42
|
+
isSideNavExpanded: PropTypes.Requireable<boolean>;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
25
45
|
export default SideNavItems;
|
|
@@ -18,16 +18,18 @@ import { SideNavContext } from './SideNav.js';
|
|
|
18
18
|
|
|
19
19
|
// First define a non-generic base component to work with forwardRef
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
const frFn = forwardRef;
|
|
22
|
+
const SideNavLink = frFn((props, ref) => {
|
|
23
|
+
const {
|
|
24
|
+
children,
|
|
25
|
+
className: customClassName,
|
|
26
|
+
renderIcon: IconElement,
|
|
27
|
+
isActive,
|
|
28
|
+
isSideNavExpanded,
|
|
29
|
+
large = false,
|
|
30
|
+
tabIndex,
|
|
31
|
+
...rest
|
|
32
|
+
} = props;
|
|
31
33
|
const isRail = useContext(SideNavContext);
|
|
32
34
|
const prefix = usePrefix();
|
|
33
35
|
const className = cx({
|
|
@@ -44,10 +46,8 @@ const SideNavLinkBase = ({
|
|
|
44
46
|
}), IconElement && /*#__PURE__*/React.createElement(SideNavIcon, {
|
|
45
47
|
small: true
|
|
46
48
|
}, /*#__PURE__*/React.createElement(IconElement, null)), /*#__PURE__*/React.createElement(SideNavLinkText, null, children)));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// Use forwardRef with the non-generic function and cast to the generic component type
|
|
50
|
-
const SideNavLink = /*#__PURE__*/forwardRef(SideNavLinkBase);
|
|
49
|
+
// Cast preserves the generic call signature for consumers after forwardRef.
|
|
50
|
+
});
|
|
51
51
|
SideNavLink.displayName = 'SideNavLink';
|
|
52
52
|
SideNavLink.propTypes = {
|
|
53
53
|
...LinkPropTypes,
|