@carbon/react 1.99.0 → 1.100.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 +978 -978
- 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 +6 -7
- package/es/components/ComboBox/ComboBox.js +22 -10
- 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/Dropdown/Dropdown.d.ts +3 -4
- package/es/components/Dropdown/Dropdown.js +16 -13
- 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/FluidComboBox/FluidComboBox.d.ts +2 -7
- package/es/components/FluidComboBox/FluidComboBox.js +1 -2
- 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/FluidDropdown/FluidDropdown.d.ts +1 -6
- package/es/components/FluidDropdown/FluidDropdown.js +1 -2
- 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/FluidMultiSelect/FluidMultiSelect.d.ts +1 -6
- package/es/components/FluidMultiSelect/FluidMultiSelect.js +1 -2
- 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/InlineLoading/InlineLoading.js +5 -11
- 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.d.ts +3 -4
- package/es/components/MultiSelect/MultiSelect.js +24 -22
- package/es/components/Notification/Notification.d.ts +8 -7
- package/es/components/Notification/Notification.js +4 -4
- 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/TextArea/TextArea.js +1 -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/Tile/Tile.d.ts +1 -1
- package/es/components/Tile/Tile.js +37 -69
- 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 -4
- package/es/components/UIShell/SideNav.js +37 -27
- 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 +6 -7
- package/lib/components/ComboBox/ComboBox.js +22 -10
- 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/Dropdown/Dropdown.d.ts +3 -4
- package/lib/components/Dropdown/Dropdown.js +16 -13
- 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/FluidComboBox/FluidComboBox.d.ts +2 -7
- package/lib/components/FluidComboBox/FluidComboBox.js +1 -2
- 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/FluidDropdown/FluidDropdown.d.ts +1 -6
- package/lib/components/FluidDropdown/FluidDropdown.js +1 -2
- 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/FluidMultiSelect/FluidMultiSelect.d.ts +1 -6
- package/lib/components/FluidMultiSelect/FluidMultiSelect.js +1 -2
- 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/InlineLoading/InlineLoading.js +5 -11
- 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.d.ts +3 -4
- package/lib/components/MultiSelect/MultiSelect.js +24 -22
- package/lib/components/Notification/Notification.d.ts +8 -7
- package/lib/components/Notification/Notification.js +4 -4
- 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/TextArea/TextArea.js +1 -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/Tile/Tile.d.ts +1 -1
- package/lib/components/Tile/Tile.js +35 -67
- 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 -4
- package/lib/components/UIShell/SideNav.js +36 -26
- 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 +7 -7
- 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
|
@@ -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,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { ChevronDown } from '@carbon/icons-react';
|
|
9
9
|
import cx from 'classnames';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
-
import React, { useContext, useState } from 'react';
|
|
11
|
+
import React, { forwardRef, useContext, useState } from 'react';
|
|
12
12
|
import SideNavIcon from './SideNavIcon.js';
|
|
13
13
|
import { Escape } from '../../internal/keyboard/keys.js';
|
|
14
14
|
import { match } from '../../internal/keyboard/match.js';
|
|
@@ -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__*/
|
|
19
|
+
const SideNavMenu = /*#__PURE__*/forwardRef(({
|
|
20
20
|
className: customClassName,
|
|
21
21
|
children,
|
|
22
22
|
defaultExpanded = false,
|
|
@@ -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, {
|
|
7
|
+
import React, { type ComponentProps, type ElementType } from 'react';
|
|
8
8
|
import Link from './Link';
|
|
9
9
|
export type SideNavMenuItemProps = ComponentProps<typeof Link> & {
|
|
10
10
|
/**
|
|
@@ -8,12 +8,12 @@
|
|
|
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 from 'react';
|
|
11
|
+
import React, { forwardRef } from 'react';
|
|
12
12
|
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__*/
|
|
16
|
+
const SideNavMenuItem = /*#__PURE__*/forwardRef((props, ref) => {
|
|
17
17
|
const prefix = usePrefix();
|
|
18
18
|
const {
|
|
19
19
|
children,
|
|
@@ -4,12 +4,20 @@
|
|
|
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 SwitcherDividerProps {
|
|
9
9
|
/**
|
|
10
10
|
* Optionally provide a custom class to apply to the underlying `<li>` node
|
|
11
11
|
*/
|
|
12
12
|
className?: string;
|
|
13
13
|
}
|
|
14
|
-
declare const SwitcherDivider:
|
|
14
|
+
declare const SwitcherDivider: {
|
|
15
|
+
({ className: customClassName, ...other }: SwitcherDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
propTypes: {
|
|
17
|
+
/**
|
|
18
|
+
* Optionally provide a custom class to apply to the underlying `<li>` node
|
|
19
|
+
*/
|
|
20
|
+
className: PropTypes.Requireable<string>;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
15
23
|
export default SwitcherDivider;
|
|
@@ -153,8 +153,6 @@ const FloatingMenu = ({
|
|
|
153
153
|
// Re-check after setting the position if not already adjusting.
|
|
154
154
|
if (!isAdjustment) {
|
|
155
155
|
const newMenuSize = menuBody.getBoundingClientRect();
|
|
156
|
-
// TODO: Was there a bug in the old code? How could one `DOMRect` be
|
|
157
|
-
// compared to another using `!==`?
|
|
158
156
|
if (newMenuSize.width !== menuSize.width || newMenuSize.height !== menuSize.height) {
|
|
159
157
|
updateMenuPosition(true);
|
|
160
158
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2025
|
|
2
|
+
* Copyright IBM Corp. 2025, 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.
|
|
@@ -8,9 +8,9 @@ type AsProp<C extends React.ElementType> = {
|
|
|
8
8
|
as?: C;
|
|
9
9
|
};
|
|
10
10
|
type PropsToOmit<C extends React.ElementType, P> = keyof (AsProp<C> & P);
|
|
11
|
-
export type PolymorphicComponentProp<C extends React.ElementType, Props =
|
|
11
|
+
export type PolymorphicComponentProp<C extends React.ElementType, Props = Record<string, never>> = React.PropsWithChildren<Props & AsProp<C>> & Omit<React.ComponentPropsWithoutRef<C>, PropsToOmit<C, Props>>;
|
|
12
12
|
export type PolymorphicRef<C extends React.ElementType> = React.ComponentPropsWithRef<C>['ref'];
|
|
13
|
-
export type PolymorphicComponentPropWithRef<C extends React.ElementType, Props =
|
|
13
|
+
export type PolymorphicComponentPropWithRef<C extends React.ElementType, Props = Record<string, never>> = PolymorphicComponentProp<C, Props> & {
|
|
14
14
|
ref?: PolymorphicRef<C>;
|
|
15
15
|
};
|
|
16
16
|
export {};
|
|
@@ -8,13 +8,12 @@
|
|
|
8
8
|
import { useEffect } from 'react';
|
|
9
9
|
|
|
10
10
|
const useNoInteractiveChildren = (ref, message = 'component should have no interactive child nodes') => {
|
|
11
|
-
// TODO: Why can't the condition go inside the hook?
|
|
12
11
|
if (process.env.NODE_ENV !== 'production') {
|
|
13
|
-
//
|
|
14
|
-
|
|
12
|
+
// This hook is intentionally called conditionally because it is
|
|
13
|
+
// stripped from production builds. In development it runs once
|
|
14
|
+
// to enforce accessibility constraints.
|
|
15
|
+
//
|
|
15
16
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
16
|
-
*/
|
|
17
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
18
17
|
useEffect(() => {
|
|
19
18
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
20
19
|
if (node) {
|
|
@@ -28,13 +27,12 @@ const useNoInteractiveChildren = (ref, message = 'component should have no inter
|
|
|
28
27
|
}
|
|
29
28
|
};
|
|
30
29
|
const useInteractiveChildrenNeedDescription = (ref, message = `interactive child node(s) should have an \`aria-describedby\` property`) => {
|
|
31
|
-
// TODO: Why can't the condition go inside the hook?
|
|
32
30
|
if (process.env.NODE_ENV !== 'production') {
|
|
33
|
-
//
|
|
34
|
-
|
|
31
|
+
// This hook is intentionally called conditionally because it is
|
|
32
|
+
// stripped from production builds. In development it runs once
|
|
33
|
+
// to enforce accessibility constraints.
|
|
34
|
+
//
|
|
35
35
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36
|
-
*/
|
|
37
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
38
36
|
useEffect(() => {
|
|
39
37
|
const node = ref.current ? getInteractiveContent(ref.current) : false;
|
|
40
38
|
if (node && !node.hasAttribute('aria-describedby')) {
|
|
@@ -19,11 +19,7 @@ const useOutsideClick = (ref, callback) => {
|
|
|
19
19
|
// treated as a constant as it will be false when executed in a Node.js
|
|
20
20
|
// environment and true when executed in the browser
|
|
21
21
|
if (canUseDOM) {
|
|
22
|
-
// TODO: https://github.com/carbon-design-system/carbon/issues/19005
|
|
23
|
-
/*
|
|
24
22
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
25
|
-
*/
|
|
26
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
27
23
|
useWindowEvent('click', event => {
|
|
28
24
|
const {
|
|
29
25
|
target
|
|
@@ -15,11 +15,13 @@ var React = require('react');
|
|
|
15
15
|
var cx = require('classnames');
|
|
16
16
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
const frFn = React.forwardRef;
|
|
19
|
+
const BadgeIndicator = frFn((props, ref) => {
|
|
20
|
+
const {
|
|
21
|
+
className: customClassName,
|
|
22
|
+
count,
|
|
23
|
+
...rest
|
|
24
|
+
} = props;
|
|
23
25
|
const prefix = usePrefix.usePrefix();
|
|
24
26
|
const classNames = cx(`${prefix}--badge-indicator`, customClassName, {
|
|
25
27
|
[`${prefix}--badge-indicator--count`]: count
|
|
@@ -37,10 +37,9 @@ const BreadcrumbItem = frFn((props, ref) => {
|
|
|
37
37
|
[`${prefix}--breadcrumb-item--current`]: isCurrentPage && ariaCurrent !== 'page',
|
|
38
38
|
[customClassName]: !!customClassName
|
|
39
39
|
});
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
if (child.type && child.type.displayName !== undefined && child.type.displayName.includes('OverflowMenu')) {
|
|
40
|
+
const child = /*#__PURE__*/React.isValidElement(children) ? children : null;
|
|
41
|
+
const childType = child?.type;
|
|
42
|
+
if (child && typeof child.type !== 'string' && childType?.displayName?.includes('OverflowMenu')) {
|
|
44
43
|
const horizontalOverflowIcon = /*#__PURE__*/React.createElement(iconsReact.OverflowMenuHorizontal, {
|
|
45
44
|
className: `${prefix}--overflow-menu__icon`
|
|
46
45
|
});
|
|
@@ -70,10 +69,10 @@ const BreadcrumbItem = frFn((props, ref) => {
|
|
|
70
69
|
return /*#__PURE__*/React.createElement("li", _rollupPluginBabelHelpers.extends({
|
|
71
70
|
className: className,
|
|
72
71
|
ref: ref
|
|
73
|
-
}, rest), /*#__PURE__*/React.cloneElement(child, {
|
|
72
|
+
}, rest), child ? /*#__PURE__*/React.cloneElement(child, {
|
|
74
73
|
'aria-current': ariaCurrent,
|
|
75
74
|
className: cx(`${prefix}--link`, child.props.className)
|
|
76
|
-
}));
|
|
75
|
+
}) : children);
|
|
77
76
|
});
|
|
78
77
|
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
79
78
|
BreadcrumbItem.propTypes = {
|
|
@@ -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
|
import { ButtonSize } from './Button';
|
|
9
10
|
export interface ButtonSkeletonProps extends React.HTMLAttributes<HTMLElement> {
|
|
@@ -23,6 +24,31 @@ export interface ButtonSkeletonProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
23
24
|
*/
|
|
24
25
|
small?: boolean;
|
|
25
26
|
}
|
|
26
|
-
declare const ButtonSkeleton:
|
|
27
|
+
declare const ButtonSkeleton: {
|
|
28
|
+
({ className, small, href, size, ...rest }: ButtonSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
propTypes: {
|
|
30
|
+
/**
|
|
31
|
+
* Specify an optional className to add.
|
|
32
|
+
*/
|
|
33
|
+
className: PropTypes.Requireable<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Optionally specify an href for your Button to become an `<a>` element
|
|
36
|
+
*/
|
|
37
|
+
href: PropTypes.Requireable<string>;
|
|
38
|
+
/**
|
|
39
|
+
* Specify the size of the button, from a list of available sizes.
|
|
40
|
+
* For `default` buttons, this prop can remain unspecified or use `default`.
|
|
41
|
+
* In the next major release of Carbon, `default`, `field`, and `small` will be removed
|
|
42
|
+
*/
|
|
43
|
+
size: PropTypes.Requireable<string>;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated This property will be removed in the next major Carbon version,
|
|
46
|
+
* use size={sm} instead.
|
|
47
|
+
*
|
|
48
|
+
* Specify whether the Button should be a small variant
|
|
49
|
+
*/
|
|
50
|
+
small: PropTypes.Requireable<boolean>;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
27
53
|
export default ButtonSkeleton;
|
|
28
54
|
export { ButtonSkeleton };
|
|
@@ -25,8 +25,6 @@ function isIconOnlyButton(hasIconOnly, _kind) {
|
|
|
25
25
|
}
|
|
26
26
|
return false;
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
30
28
|
const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
31
29
|
const {
|
|
32
30
|
as,
|
|
@@ -108,7 +106,10 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
108
106
|
);
|
|
109
107
|
}
|
|
110
108
|
});
|
|
109
|
+
|
|
110
|
+
// @ts-expect-error - `displayName` isn't typed.
|
|
111
111
|
Button.displayName = 'Button';
|
|
112
|
+
// @ts-expect-error - `propTypes` isn't typed.
|
|
112
113
|
Button.propTypes = {
|
|
113
114
|
/**
|
|
114
115
|
* Specify how the button itself should be rendered.
|
|
@@ -4,7 +4,8 @@
|
|
|
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 ComponentProps } from 'react';
|
|
8
|
+
import Button from '../Button';
|
|
8
9
|
export type ChatButtonKind = 'primary' | 'secondary' | 'danger' | 'ghost' | 'tertiary';
|
|
9
10
|
export type ChatButtonSize = 'sm' | 'md' | 'lg';
|
|
10
11
|
export interface ChatButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
@@ -35,7 +36,7 @@ export interface ChatButtonProps extends React.ButtonHTMLAttributes<HTMLButtonEl
|
|
|
35
36
|
/**
|
|
36
37
|
* A component used to render an icon.
|
|
37
38
|
*/
|
|
38
|
-
renderIcon?:
|
|
39
|
+
renderIcon?: ComponentProps<typeof Button>['renderIcon'];
|
|
39
40
|
/**
|
|
40
41
|
* Specify the size of the `ChatButton`, from the following list of sizes:
|
|
41
42
|
*/
|
|
@@ -4,7 +4,8 @@
|
|
|
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 { type ReactNode } from 'react';
|
|
8
9
|
export interface CheckboxGroupProps {
|
|
9
10
|
children?: ReactNode;
|
|
10
11
|
className?: string;
|
|
@@ -28,5 +29,62 @@ export interface CustomType {
|
|
|
28
29
|
size: string;
|
|
29
30
|
kind: string;
|
|
30
31
|
}
|
|
31
|
-
declare const CheckboxGroup:
|
|
32
|
+
declare const CheckboxGroup: {
|
|
33
|
+
({ children, className, decorator, helperText, invalid, invalidText, legendId, legendText, readOnly, warn, warnText, slug, orientation, ...rest }: CheckboxGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
propTypes: {
|
|
35
|
+
/**
|
|
36
|
+
* Provide the children form elements to be rendered inside of the <fieldset>
|
|
37
|
+
*/
|
|
38
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
39
|
+
/**
|
|
40
|
+
* Provide a custom className to be applied to the containing <fieldset> node
|
|
41
|
+
*/
|
|
42
|
+
className: PropTypes.Requireable<string>;
|
|
43
|
+
/**
|
|
44
|
+
* **Experimental**: Provide a decorator component to be rendered inside the `CheckboxGroup` component
|
|
45
|
+
*/
|
|
46
|
+
decorator: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
47
|
+
/**
|
|
48
|
+
* Provide text for the form group for additional help
|
|
49
|
+
*/
|
|
50
|
+
helperText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
51
|
+
/**
|
|
52
|
+
* Specify whether the form group is currently invalid
|
|
53
|
+
*/
|
|
54
|
+
invalid: PropTypes.Requireable<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Provide the text that is displayed when the form group is in an invalid state
|
|
57
|
+
*/
|
|
58
|
+
invalidText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
59
|
+
/**
|
|
60
|
+
* Provide id for the fieldset <legend> which corresponds to the fieldset
|
|
61
|
+
* `aria-labelledby`
|
|
62
|
+
*/
|
|
63
|
+
legendId: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
64
|
+
/**
|
|
65
|
+
* Provide the text to be rendered inside of the fieldset <legend>
|
|
66
|
+
*/
|
|
67
|
+
legendText: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
68
|
+
/**
|
|
69
|
+
* Provide the orientation for how the checkbox should be displayed
|
|
70
|
+
*/
|
|
71
|
+
orientation: PropTypes.Requireable<string>;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the CheckboxGroup should be read-only
|
|
74
|
+
*/
|
|
75
|
+
readOnly: PropTypes.Requireable<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* **Experimental**: Provide a `Slug` component to be rendered inside the `CheckboxGroup` component
|
|
78
|
+
*/
|
|
79
|
+
slug: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
80
|
+
/**
|
|
81
|
+
* Specify whether the form group is currently in warning state
|
|
82
|
+
*/
|
|
83
|
+
warn: PropTypes.Requireable<boolean>;
|
|
84
|
+
/**
|
|
85
|
+
* Provide the text that is displayed when the form group is in warning state
|
|
86
|
+
*/
|
|
87
|
+
warnText: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
32
90
|
export default CheckboxGroup;
|
|
@@ -1,11 +1,11 @@
|
|
|
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
7
|
import { UseComboboxProps, UseComboboxActions } from 'downshift';
|
|
8
|
-
import
|
|
8
|
+
import { type InputHTMLAttributes, type MouseEvent, type PropsWithChildren, type ReactElement, type ReactNode, type RefAttributes, type RefObject } from 'react';
|
|
9
9
|
import { type ListBoxMenuIconTranslationKey, type ListBoxSelectionTranslationKey, type ListBoxSize } from '../ListBox';
|
|
10
10
|
import type { TranslateWithId } from '../../types/common';
|
|
11
11
|
type ExcludedAttributes = 'id' | 'onChange' | 'onClick' | 'type' | 'size';
|
|
@@ -74,7 +74,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
74
74
|
* cases they can not be shimmed by Carbon to shield you from potentially breaking
|
|
75
75
|
* changes.
|
|
76
76
|
*/
|
|
77
|
-
downshiftActions?:
|
|
77
|
+
downshiftActions?: RefObject<UseComboboxActions<ItemType> | undefined>;
|
|
78
78
|
/**
|
|
79
79
|
* Provide helper text that is used alongside the control label for
|
|
80
80
|
* additional help
|
|
@@ -98,10 +98,9 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
98
98
|
*/
|
|
99
99
|
invalidText?: ReactNode;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
102
|
-
* Defaults to null and is overridden by a getter
|
|
101
|
+
* Renders an item as a custom React node instead of a string.
|
|
103
102
|
*/
|
|
104
|
-
itemToElement?:
|
|
103
|
+
itemToElement?: ((item: ItemType) => ReactNode) | null;
|
|
105
104
|
/**
|
|
106
105
|
* Helper function passed to downshift that allows the library to render a
|
|
107
106
|
* given item to a string label. By default, it extracts the `label` field
|
|
@@ -196,7 +195,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
196
195
|
*/
|
|
197
196
|
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
198
197
|
}
|
|
199
|
-
type ComboboxComponentProps<ItemType> =
|
|
198
|
+
type ComboboxComponentProps<ItemType> = PropsWithChildren<ComboBoxProps<ItemType>> & RefAttributes<HTMLInputElement>;
|
|
200
199
|
export interface ComboBoxComponent {
|
|
201
200
|
<ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement<any> | null;
|
|
202
201
|
}
|