@carbon/react 1.99.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 +953 -953
- 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/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/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 +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
|
@@ -7,15 +7,17 @@
|
|
|
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 cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const frFn = forwardRef;
|
|
15
|
+
const BadgeIndicator = frFn((props, ref) => {
|
|
16
|
+
const {
|
|
17
|
+
className: customClassName,
|
|
18
|
+
count,
|
|
19
|
+
...rest
|
|
20
|
+
} = props;
|
|
19
21
|
const prefix = usePrefix();
|
|
20
22
|
const classNames = cx(`${prefix}--badge-indicator`, customClassName, {
|
|
21
23
|
[`${prefix}--badge-indicator--count`]: count
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
|
-
import React, { forwardRef } from 'react';
|
|
10
|
+
import React, { forwardRef, cloneElement, isValidElement } from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import Link from '../Link/Link.js';
|
|
13
13
|
import { OverflowMenuHorizontal } from '@carbon/icons-react';
|
|
@@ -33,10 +33,9 @@ const BreadcrumbItem = frFn((props, ref) => {
|
|
|
33
33
|
[`${prefix}--breadcrumb-item--current`]: isCurrentPage && ariaCurrent !== 'page',
|
|
34
34
|
[customClassName]: !!customClassName
|
|
35
35
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
if (child.type && child.type.displayName !== undefined && child.type.displayName.includes('OverflowMenu')) {
|
|
36
|
+
const child = /*#__PURE__*/isValidElement(children) ? children : null;
|
|
37
|
+
const childType = child?.type;
|
|
38
|
+
if (child && typeof child.type !== 'string' && childType?.displayName?.includes('OverflowMenu')) {
|
|
40
39
|
const horizontalOverflowIcon = /*#__PURE__*/React.createElement(OverflowMenuHorizontal, {
|
|
41
40
|
className: `${prefix}--overflow-menu__icon`
|
|
42
41
|
});
|
|
@@ -66,10 +65,10 @@ const BreadcrumbItem = frFn((props, ref) => {
|
|
|
66
65
|
return /*#__PURE__*/React.createElement("li", _extends({
|
|
67
66
|
className: className,
|
|
68
67
|
ref: ref
|
|
69
|
-
}, rest), /*#__PURE__*/
|
|
68
|
+
}, rest), child ? /*#__PURE__*/cloneElement(child, {
|
|
70
69
|
'aria-current': ariaCurrent,
|
|
71
70
|
className: cx(`${prefix}--link`, child.props.className)
|
|
72
|
-
}));
|
|
71
|
+
}) : children);
|
|
73
72
|
});
|
|
74
73
|
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
75
74
|
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 };
|
|
@@ -21,8 +21,6 @@ function isIconOnlyButton(hasIconOnly, _kind) {
|
|
|
21
21
|
}
|
|
22
22
|
return false;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
// eslint-disable-next-line react/display-name -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
26
24
|
const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
27
25
|
const {
|
|
28
26
|
as,
|
|
@@ -104,7 +102,10 @@ const Button = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
104
102
|
);
|
|
105
103
|
}
|
|
106
104
|
});
|
|
105
|
+
|
|
106
|
+
// @ts-expect-error - `displayName` isn't typed.
|
|
107
107
|
Button.displayName = 'Button';
|
|
108
|
+
// @ts-expect-error - `propTypes` isn't typed.
|
|
108
109
|
Button.propTypes = {
|
|
109
110
|
/**
|
|
110
111
|
* 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 ComponentType, 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
|
|
@@ -196,7 +196,7 @@ export interface ComboBoxProps<ItemType> extends Omit<InputHTMLAttributes<HTMLIn
|
|
|
196
196
|
*/
|
|
197
197
|
inputProps?: InputHTMLAttributes<HTMLInputElement>;
|
|
198
198
|
}
|
|
199
|
-
type ComboboxComponentProps<ItemType> =
|
|
199
|
+
type ComboboxComponentProps<ItemType> = PropsWithChildren<ComboBoxProps<ItemType>> & RefAttributes<HTMLInputElement>;
|
|
200
200
|
export interface ComboBoxComponent {
|
|
201
201
|
<ItemType>(props: ComboboxComponentProps<ItemType>): ReactElement<any> | null;
|
|
202
202
|
}
|
|
@@ -193,6 +193,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
193
193
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
194
194
|
}, [typeahead, inputValue, items, itemToString, autocompleteCustomFilter]);
|
|
195
195
|
const isManualClearingRef = useRef(false);
|
|
196
|
+
const committedCustomValueRef = useRef('');
|
|
196
197
|
const [isClearing, setIsClearing] = useState(false);
|
|
197
198
|
const prefix = usePrefix();
|
|
198
199
|
const {
|
|
@@ -282,11 +283,13 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
282
283
|
return changes;
|
|
283
284
|
}
|
|
284
285
|
const nextSelectedItem = items.find(item => itemToString(item) === inputValue) ?? inputValue;
|
|
286
|
+
const isCustomSelection = typeof nextSelectedItem === 'string' && !items.some(item => isEqual(item, nextSelectedItem));
|
|
285
287
|
if (!isEqual(currentSelectedItem, nextSelectedItem) && onChange) {
|
|
286
288
|
onChange({
|
|
287
289
|
selectedItem: nextSelectedItem,
|
|
288
290
|
inputValue
|
|
289
291
|
});
|
|
292
|
+
committedCustomValueRef.current = isCustomSelection ? inputValue : '';
|
|
290
293
|
}
|
|
291
294
|
return {
|
|
292
295
|
...changes,
|
|
@@ -525,6 +528,9 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
525
528
|
return;
|
|
526
529
|
}
|
|
527
530
|
if ((type === ItemClick || type === FunctionSelectItem || type === InputKeyDownEnter) && typeof newSelectedItem !== 'undefined' && !isEqual(selectedItemProp, newSelectedItem)) {
|
|
531
|
+
if (items.some(item => isEqual(item, newSelectedItem))) {
|
|
532
|
+
committedCustomValueRef.current = '';
|
|
533
|
+
}
|
|
528
534
|
onChange({
|
|
529
535
|
selectedItem: newSelectedItem
|
|
530
536
|
});
|
|
@@ -534,7 +540,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
534
540
|
|
|
535
541
|
// Keep the dropdown highlight in sync with either the controlled value or
|
|
536
542
|
// Downshift's own selection when uncontrolled.
|
|
537
|
-
const
|
|
543
|
+
const currentSelectedItem = typeof selectedItemProp !== 'undefined' ? selectedItemProp : selectedItem;
|
|
538
544
|
useEffect(() => {
|
|
539
545
|
// Used to expose the downshift actions to consumers for use with downshiftProps
|
|
540
546
|
// An odd pattern, here we mutate the value stored in the ref provided from the consumer.
|
|
@@ -649,8 +655,18 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
649
655
|
...inputProps,
|
|
650
656
|
onChange: e => {
|
|
651
657
|
const newValue = e.target.value;
|
|
658
|
+
const shouldClearSelection = allowCustomValue && committedCustomValueRef.current && inputValue === committedCustomValueRef.current && newValue === '';
|
|
652
659
|
setInputValue(newValue);
|
|
653
660
|
downshiftSetInputValue(newValue);
|
|
661
|
+
if (shouldClearSelection) {
|
|
662
|
+
setIsClearing(true);
|
|
663
|
+
onChange({
|
|
664
|
+
selectedItem: null,
|
|
665
|
+
inputValue: ''
|
|
666
|
+
});
|
|
667
|
+
selectItem(null);
|
|
668
|
+
committedCustomValueRef.current = '';
|
|
669
|
+
}
|
|
654
670
|
},
|
|
655
671
|
ref: mergeRefs(textInput, ref, inputRef),
|
|
656
672
|
onKeyDown: event => {
|
|
@@ -667,6 +683,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
667
683
|
// manually fire it when `allowCustomValue` is provided, the menu is closing,
|
|
668
684
|
// and there is a value.
|
|
669
685
|
if (allowCustomValue && isOpen && inputValue && highlightedIndex === -1) {
|
|
686
|
+
committedCustomValueRef.current = inputValue;
|
|
670
687
|
onChange({
|
|
671
688
|
selectedItem: null,
|
|
672
689
|
inputValue
|
|
@@ -731,6 +748,7 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
731
748
|
selectedItem: null
|
|
732
749
|
});
|
|
733
750
|
selectItem(null);
|
|
751
|
+
committedCustomValueRef.current = '';
|
|
734
752
|
handleSelectionClear();
|
|
735
753
|
},
|
|
736
754
|
translateWithId: translateWithId,
|
|
@@ -762,13 +780,13 @@ const ComboBox = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
762
780
|
} = itemProps;
|
|
763
781
|
return /*#__PURE__*/React.createElement(ListBox.MenuItem, _extends({
|
|
764
782
|
key: itemProps.id,
|
|
765
|
-
isActive: isEqual(
|
|
783
|
+
isActive: isEqual(currentSelectedItem, item),
|
|
766
784
|
isHighlighted: highlightedIndex === index,
|
|
767
785
|
title: title,
|
|
768
786
|
disabled: disabled
|
|
769
787
|
}, modifiedItemProps), ItemToElement ? /*#__PURE__*/React.createElement(ItemToElement, _extends({
|
|
770
788
|
key: itemProps.id
|
|
771
|
-
}, item)) : itemToString(item), isEqual(
|
|
789
|
+
}, item)) : itemToString(item), isEqual(currentSelectedItem, item) && /*#__PURE__*/React.createElement(Checkmark, {
|
|
772
790
|
className: `${prefix}--list-box__menu-item__selected-icon`
|
|
773
791
|
}));
|
|
774
792
|
}) : null)), helperText && !invalid && !warn && !isFluid && /*#__PURE__*/React.createElement(Text, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Copyright IBM Corp. 2023,
|
|
2
|
+
* Copyright IBM Corp. 2023, 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.
|
|
@@ -61,7 +61,7 @@ export interface ComposedModalProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
61
61
|
* Specify an optional handler for closing modal.
|
|
62
62
|
* Returning `false` here prevents closing modal.
|
|
63
63
|
*/
|
|
64
|
-
onClose
|
|
64
|
+
onClose?: ((event: MouseEvent) => boolean) | ((event: MouseEvent) => void);
|
|
65
65
|
/**
|
|
66
66
|
* Called for all `onKeyDown` events that do not close the modal
|
|
67
67
|
*/
|
|
@@ -4,12 +4,9 @@
|
|
|
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
|
|
8
|
-
import
|
|
7
|
+
import { ReactNode } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
9
9
|
declare const variants: readonly ["on-page", "disclosed"];
|
|
10
|
-
export type ContainedListType = React.FC<ContainedListProps> & {
|
|
11
|
-
ContainedListItem: typeof ContainedListItem;
|
|
12
|
-
};
|
|
13
10
|
export type Variants = (typeof variants)[number];
|
|
14
11
|
export interface ContainedListProps {
|
|
15
12
|
/**
|
|
@@ -41,5 +38,37 @@ export interface ContainedListProps {
|
|
|
41
38
|
*/
|
|
42
39
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
43
40
|
}
|
|
44
|
-
declare const ContainedList:
|
|
41
|
+
declare const ContainedList: {
|
|
42
|
+
({ action, children, className, isInset, kind, label, size, ...rest }: ContainedListProps): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
propTypes: {
|
|
44
|
+
/**
|
|
45
|
+
* A slot for a possible interactive element to render.
|
|
46
|
+
*/
|
|
47
|
+
action: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
48
|
+
/**
|
|
49
|
+
* A collection of ContainedListItems to be rendered in the ContainedList
|
|
50
|
+
*/
|
|
51
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
52
|
+
/**
|
|
53
|
+
* Additional CSS class names.
|
|
54
|
+
*/
|
|
55
|
+
className: PropTypes.Requireable<string>;
|
|
56
|
+
/**
|
|
57
|
+
* Specify whether the dividing lines in between list items should be inset.
|
|
58
|
+
*/
|
|
59
|
+
isInset: PropTypes.Requireable<boolean>;
|
|
60
|
+
/**
|
|
61
|
+
* The kind of ContainedList you want to display
|
|
62
|
+
*/
|
|
63
|
+
kind: PropTypes.Requireable<"on-page" | "disclosed">;
|
|
64
|
+
/**
|
|
65
|
+
* A label describing the contained list.
|
|
66
|
+
*/
|
|
67
|
+
label: PropTypes.Requireable<NonNullable<PropTypes.ReactNodeLike>>;
|
|
68
|
+
/**
|
|
69
|
+
* Specify the size of the contained list.
|
|
70
|
+
*/
|
|
71
|
+
size: PropTypes.Requireable<string>;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
45
74
|
export default ContainedList;
|
|
@@ -132,6 +132,8 @@ ContainedList.propTypes = {
|
|
|
132
132
|
*/
|
|
133
133
|
size: PropTypes.oneOf(['sm', 'md', 'lg', 'xl'])
|
|
134
134
|
};
|
|
135
|
-
ContainedList
|
|
135
|
+
Object.assign(ContainedList, {
|
|
136
|
+
ContainedListItem
|
|
137
|
+
});
|
|
136
138
|
|
|
137
139
|
export { ContainedList as default };
|
|
@@ -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 { type ElementType, type ReactNode } from 'react';
|
|
8
|
+
import PropTypes from 'prop-types';
|
|
8
9
|
interface ContainedListItemProps {
|
|
9
10
|
/**
|
|
10
11
|
* A slot for a possible interactive element to render within the item.
|
|
@@ -29,7 +30,35 @@ interface ContainedListItemProps {
|
|
|
29
30
|
/**
|
|
30
31
|
* A component used to render an icon.
|
|
31
32
|
*/
|
|
32
|
-
renderIcon?:
|
|
33
|
+
renderIcon?: ElementType;
|
|
33
34
|
}
|
|
34
|
-
declare const ContainedListItem:
|
|
35
|
+
declare const ContainedListItem: {
|
|
36
|
+
({ action, children, className, disabled, onClick, renderIcon: IconElement, ...rest }: ContainedListItemProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
propTypes: {
|
|
38
|
+
/**
|
|
39
|
+
* A slot for a possible interactive element to render within the item.
|
|
40
|
+
*/
|
|
41
|
+
action: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
42
|
+
/**
|
|
43
|
+
* The content of this item. Must not contain any interactive elements. Use props.action to include those.
|
|
44
|
+
*/
|
|
45
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
46
|
+
/**
|
|
47
|
+
* Additional CSS class names.
|
|
48
|
+
*/
|
|
49
|
+
className: PropTypes.Requireable<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether this item is disabled.
|
|
52
|
+
*/
|
|
53
|
+
disabled: PropTypes.Requireable<boolean>;
|
|
54
|
+
/**
|
|
55
|
+
* Provide an optional function to be called when the item is clicked.
|
|
56
|
+
*/
|
|
57
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
58
|
+
/**
|
|
59
|
+
* A component used to render an icon.
|
|
60
|
+
*/
|
|
61
|
+
renderIcon: PropTypes.Requireable<object>;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
35
64
|
export default ContainedListItem;
|
|
@@ -9,8 +9,11 @@ import { deprecateFieldOnObject } from '../../internal/deprecateFieldOnObject.js
|
|
|
9
9
|
import ContainedList from './ContainedList.js';
|
|
10
10
|
import ContainedListItem from './ContainedListItem/ContainedListItem.js';
|
|
11
11
|
|
|
12
|
-
ContainedList.ContainedListItem = ContainedListItem;
|
|
13
12
|
if (process.env.NODE_ENV !== 'production') {
|
|
13
|
+
// @ts-expect-error - This component did not have a `displayName` before it
|
|
14
|
+
// was properly typed. After adding proper typing, a type error appears here.
|
|
15
|
+
// The warning logged to the console includes `undefined` because no
|
|
16
|
+
// `displayName` is set.
|
|
14
17
|
deprecateFieldOnObject(ContainedList, 'ContainedListItem', ContainedListItem);
|
|
15
18
|
}
|
|
16
19
|
|
|
@@ -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.
|
|
@@ -140,7 +140,7 @@ export interface DataTableRenderProps<RowType, ColTypes extends any[]> {
|
|
|
140
140
|
[key: string]: unknown;
|
|
141
141
|
}) => {
|
|
142
142
|
onCancel: () => void;
|
|
143
|
-
onSelectAll?: () => void
|
|
143
|
+
onSelectAll?: () => void;
|
|
144
144
|
shouldShowBatchActions: boolean;
|
|
145
145
|
totalCount: number;
|
|
146
146
|
totalSelected: number;
|
|
@@ -367,7 +367,15 @@ export declare const DataTable: {
|
|
|
367
367
|
slug: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
368
368
|
};
|
|
369
369
|
};
|
|
370
|
-
TableToolbar:
|
|
370
|
+
TableToolbar: {
|
|
371
|
+
({ ["aria-label"]: ariaLabel, ariaLabel: deprecatedAriaLabel, children, size, ...rest }: import("./TableToolbar").TableToolbarProps): import("react/jsx-runtime").JSX.Element;
|
|
372
|
+
propTypes: {
|
|
373
|
+
"aria-label": PropTypes.Requireable<string>;
|
|
374
|
+
ariaLabel: (props: Record<string, any>, propName: string, componentName: string, ...rest: any[]) => any;
|
|
375
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
376
|
+
size: PropTypes.Requireable<string>;
|
|
377
|
+
};
|
|
378
|
+
};
|
|
371
379
|
TableToolbarAction: React.ForwardRefExoticComponent<import("./TableToolbarAction").TableToolbarActionProps & React.RefAttributes<HTMLDivElement>>;
|
|
372
380
|
TableToolbarContent: (props: React.HTMLAttributes<"div">) => React.ReactElement<any>;
|
|
373
381
|
TableToolbarSearch: {
|
|
@@ -394,12 +402,21 @@ export declare const DataTable: {
|
|
|
394
402
|
translateWithId: PropTypes.Requireable<(...args: any[]) => any>;
|
|
395
403
|
};
|
|
396
404
|
};
|
|
397
|
-
TableToolbarMenu:
|
|
405
|
+
TableToolbarMenu: {
|
|
406
|
+
({ className, renderIcon, iconDescription, children, menuOptionsClass, ...rest }: import("./TableToolbarMenu").TableToolbarMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
407
|
+
propTypes: {
|
|
408
|
+
children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
|
|
409
|
+
className: PropTypes.Requireable<string>;
|
|
410
|
+
iconDescription: PropTypes.Requireable<string>;
|
|
411
|
+
menuOptionsClass: PropTypes.Requireable<string>;
|
|
412
|
+
renderIcon: PropTypes.Requireable<object>;
|
|
413
|
+
};
|
|
414
|
+
};
|
|
398
415
|
propTypes: {
|
|
399
416
|
/**
|
|
400
417
|
* Pass in the children that will be rendered within the Table
|
|
401
418
|
*/
|
|
402
|
-
children: PropTypes.Requireable<
|
|
419
|
+
children: PropTypes.Requireable<(...args: any[]) => any>;
|
|
403
420
|
/**
|
|
404
421
|
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
|
|
405
422
|
*/
|
|
@@ -582,7 +582,7 @@ DataTable.propTypes = {
|
|
|
582
582
|
/**
|
|
583
583
|
* Pass in the children that will be rendered within the Table
|
|
584
584
|
*/
|
|
585
|
-
children: PropTypes.
|
|
585
|
+
children: PropTypes.func,
|
|
586
586
|
/**
|
|
587
587
|
* Experimental property. Allows table to align cell contents to the top if there is text wrapping in the content. Might have performance issues, intended for smaller tables
|
|
588
588
|
*/
|
|
@@ -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, { Children, isValidElement } from 'react';
|
|
11
|
+
import React, { forwardRef, Children, isValidElement } from 'react';
|
|
12
12
|
import { ChevronRight } from '@carbon/icons-react';
|
|
13
13
|
import TableCell from './TableCell.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
@@ -19,7 +19,7 @@ import { isComponentElement } from '../../internal/utils.js';
|
|
|
19
19
|
|
|
20
20
|
/** Props shared between `TableRow` and `TableExpandRow`. */
|
|
21
21
|
|
|
22
|
-
const TableExpandRow = /*#__PURE__*/
|
|
22
|
+
const TableExpandRow = /*#__PURE__*/forwardRef(({
|
|
23
23
|
['aria-controls']: ariaControls,
|
|
24
24
|
['aria-label']: ariaLabel,
|
|
25
25
|
ariaLabel: deprecatedAriaLabel,
|