@carbon/react 1.39.0 → 1.41.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 +2755 -901
- package/es/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/es/components/Accordion/Accordion.Skeleton.js +0 -5
- package/es/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/es/components/Checkbox/Checkbox.js +3 -6
- package/es/components/CodeSnippet/CodeSnippet.js +5 -12
- package/es/components/ComboBox/ComboBox.d.ts +1 -5
- package/es/components/ComboBox/ComboBox.js +6 -20
- package/es/components/ComposedModal/ComposedModal.js +1 -4
- package/es/components/ComposedModal/ModalFooter.js +4 -9
- package/es/components/ComposedModal/ModalHeader.js +1 -4
- package/es/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/es/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/es/components/Copy/Copy.js +4 -8
- package/es/components/CopyButton/CopyButton.js +8 -7
- package/es/components/DataTable/DataTable.d.ts +3 -39
- package/es/components/DataTable/DataTable.js +10 -18
- package/es/components/DataTable/Table.d.ts +0 -4
- package/es/components/DataTable/Table.js +0 -4
- package/es/components/DataTable/TableBatchAction.js +12 -5
- package/es/components/DataTable/TableBatchActions.js +1 -6
- package/es/components/DataTable/TableBody.d.ts +0 -3
- package/es/components/DataTable/TableBody.js +1 -3
- package/es/components/DataTable/TableHeader.js +3 -8
- package/es/components/DataTable/TableSelectAll.d.ts +0 -3
- package/es/components/DataTable/TableSelectAll.js +2 -4
- package/es/components/DataTable/TableSelectRow.js +2 -1
- package/es/components/DataTable/TableToolbar.d.ts +10 -0
- package/es/components/DataTable/TableToolbar.js +15 -7
- package/es/components/DataTable/TableToolbarMenu.js +2 -6
- package/es/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/es/components/DataTable/TableToolbarSearch.js +6 -11
- package/es/components/DataTable/tools/sorting.js +2 -2
- package/es/components/DatePicker/DatePicker.d.ts +4 -4
- package/es/components/DatePicker/DatePicker.js +9 -4
- package/es/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/es/components/DatePickerInput/DatePickerInput.js +12 -6
- package/es/components/Dropdown/Dropdown.js +6 -15
- package/es/components/FileUploader/FileUploader.d.ts +2 -11
- package/es/components/FileUploader/FileUploader.js +15 -19
- package/es/components/FileUploader/FileUploaderButton.js +2 -2
- package/es/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/es/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/es/components/FileUploader/FileUploaderItem.d.ts +4 -4
- package/es/components/FileUploader/FileUploaderItem.js +42 -12
- package/es/components/FileUploader/Filename.d.ts +6 -10
- package/es/components/FileUploader/Filename.js +9 -12
- package/es/components/FormGroup/FormGroup.d.ts +0 -5
- package/es/components/FormGroup/FormGroup.js +3 -8
- package/es/components/FormItem/FormItem.d.ts +32 -0
- package/es/components/FormItem/index.d.ts +9 -0
- package/es/components/FormLabel/FormLabel.js +4 -1
- package/es/components/ListBox/ListBox.js +4 -8
- package/es/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/es/components/ListBox/ListBoxMenuItem.js +4 -8
- package/es/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/es/components/ListBox/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxSelection.js +12 -13
- package/es/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/es/components/ListItem/ListItem.d.ts +1 -1
- package/es/components/ListItem/ListItem.js +6 -2
- package/es/components/Menu/MenuItem.js +4 -1
- package/es/components/Modal/Modal.js +16 -27
- package/es/components/ModalWrapper/ModalWrapper.js +13 -19
- package/es/components/MultiSelect/FilterableMultiSelect.js +14 -28
- package/es/components/MultiSelect/MultiSelect.js +17 -33
- package/es/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/es/components/MultiSelect/tools/sorting.js +2 -2
- package/es/components/Notification/Notification.d.ts +11 -29
- package/es/components/Notification/Notification.js +38 -57
- package/es/components/NumberInput/NumberInput.js +6 -2
- package/es/components/OverflowMenu/OverflowMenu.js +27 -33
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/es/components/Pagination/experimental/PageSelector.js +3 -8
- package/es/components/Pagination/experimental/Pagination.js +16 -34
- package/es/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/es/components/RadioTile/RadioTile.js +6 -7
- package/es/components/Search/Search.Skeleton.d.ts +0 -3
- package/es/components/Search/Search.Skeleton.js +1 -4
- package/es/components/Search/Search.js +1 -1
- package/es/components/Select/Select.d.ts +2 -2
- package/es/components/Select/Select.js +13 -16
- package/es/components/SelectItem/SelectItem.d.ts +0 -6
- package/es/components/SelectItem/SelectItem.js +4 -10
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/es/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/es/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/es/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/es/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/es/components/SkeletonText/SkeletonText.js +0 -6
- package/es/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/es/components/Slider/Slider.Skeleton.js +20 -4
- package/es/components/Slider/Slider.d.ts +137 -25
- package/es/components/Slider/Slider.js +779 -186
- package/es/components/StructuredList/StructuredList.js +5 -2
- package/es/components/Switch/Switch.js +3 -7
- package/es/components/Tabs/Tabs.js +5 -2
- package/es/components/Tag/Tag.js +4 -2
- package/es/components/Text/Text.js +1 -1
- package/es/components/Text/TextDirection.d.ts +1 -1
- package/es/components/TextArea/TextArea.js +30 -34
- package/es/components/TextInput/ControlledPasswordInput.js +12 -19
- package/es/components/TextInput/TextInput.js +8 -3
- package/es/components/Tile/Tile.js +4 -2
- package/es/components/TileGroup/TileGroup.js +5 -4
- package/es/components/Toggle/Toggle.js +4 -2
- package/es/components/UIShell/Content.js +1 -4
- package/es/components/UIShell/SideNav.d.ts +1 -1
- package/es/components/UIShell/SideNavDetails.d.ts +32 -0
- package/es/components/UIShell/SideNavDetails.js +1 -2
- package/es/components/UIShell/SideNavDivider.d.ts +15 -0
- package/es/components/UIShell/SideNavDivider.js +2 -2
- package/es/components/UIShell/SideNavFooter.js +2 -5
- package/es/components/UIShell/SideNavIcon.d.ts +25 -0
- package/es/components/UIShell/SideNavIcon.js +4 -7
- package/es/components/UIShell/SideNavLinkText.d.ts +26 -0
- package/es/components/UIShell/SideNavLinkText.js +1 -1
- package/es/components/UIShell/SideNavMenu.d.ts +46 -0
- package/es/components/UIShell/SideNavMenu.js +23 -13
- package/es/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/es/components/UIShell/SideNavSwitcher.js +6 -5
- package/es/index.js +1 -1
- package/es/internal/FloatingMenu.js +2 -7
- package/es/internal/Selection.js +0 -3
- package/es/internal/noopFn.d.ts +7 -0
- package/es/internal/noopFn.js +10 -0
- package/es/internal/useNormalizedInputProps.js +6 -2
- package/lib/components/Accordion/Accordion.Skeleton.d.ts +0 -5
- package/lib/components/Accordion/Accordion.Skeleton.js +0 -5
- package/lib/components/Breadcrumb/BreadcrumbItem.js +3 -1
- package/lib/components/Checkbox/Checkbox.js +3 -6
- package/lib/components/CodeSnippet/CodeSnippet.js +5 -12
- package/lib/components/ComboBox/ComboBox.d.ts +1 -5
- package/lib/components/ComboBox/ComboBox.js +5 -19
- package/lib/components/ComposedModal/ComposedModal.js +1 -4
- package/lib/components/ComposedModal/ModalFooter.js +4 -9
- package/lib/components/ComposedModal/ModalHeader.js +1 -4
- package/lib/components/ContentSwitcher/ContentSwitcher.d.ts +3 -8
- package/lib/components/ContentSwitcher/ContentSwitcher.js +7 -11
- package/lib/components/Copy/Copy.js +4 -8
- package/lib/components/CopyButton/CopyButton.js +8 -7
- package/lib/components/DataTable/DataTable.d.ts +3 -39
- package/lib/components/DataTable/DataTable.js +13 -21
- package/lib/components/DataTable/Table.d.ts +0 -4
- package/lib/components/DataTable/Table.js +0 -4
- package/lib/components/DataTable/TableBatchAction.js +12 -5
- package/lib/components/DataTable/TableBatchActions.js +1 -6
- package/lib/components/DataTable/TableBody.d.ts +0 -3
- package/lib/components/DataTable/TableBody.js +1 -3
- package/lib/components/DataTable/TableHeader.js +3 -8
- package/lib/components/DataTable/TableSelectAll.d.ts +0 -3
- package/lib/components/DataTable/TableSelectAll.js +2 -4
- package/lib/components/DataTable/TableSelectRow.js +2 -1
- package/lib/components/DataTable/TableToolbar.d.ts +10 -0
- package/lib/components/DataTable/TableToolbar.js +15 -7
- package/lib/components/DataTable/TableToolbarMenu.js +2 -6
- package/lib/components/DataTable/TableToolbarSearch.d.ts +2 -8
- package/lib/components/DataTable/TableToolbarSearch.js +6 -11
- package/lib/components/DataTable/tools/sorting.js +2 -2
- package/lib/components/DatePicker/DatePicker.d.ts +4 -4
- package/lib/components/DatePicker/DatePicker.js +9 -4
- package/lib/components/DatePicker/plugins/fixEventsPlugin.js +6 -0
- package/lib/components/DatePickerInput/DatePickerInput.js +12 -6
- package/lib/components/Dropdown/Dropdown.js +6 -15
- package/lib/components/FileUploader/FileUploader.d.ts +2 -11
- package/lib/components/FileUploader/FileUploader.js +15 -19
- package/lib/components/FileUploader/FileUploaderButton.js +2 -2
- package/lib/components/FileUploader/FileUploaderDropContainer.d.ts +0 -7
- package/lib/components/FileUploader/FileUploaderDropContainer.js +2 -8
- package/lib/components/FileUploader/FileUploaderItem.d.ts +4 -4
- package/lib/components/FileUploader/FileUploaderItem.js +41 -11
- package/lib/components/FileUploader/Filename.d.ts +6 -10
- package/lib/components/FileUploader/Filename.js +9 -12
- package/lib/components/FormGroup/FormGroup.d.ts +0 -5
- package/lib/components/FormGroup/FormGroup.js +3 -8
- package/lib/components/FormItem/FormItem.d.ts +32 -0
- package/lib/components/FormItem/index.d.ts +9 -0
- package/lib/components/FormLabel/FormLabel.js +4 -1
- package/lib/components/ListBox/ListBox.js +4 -8
- package/lib/components/ListBox/ListBoxMenuIcon.js +1 -4
- package/lib/components/ListBox/ListBoxMenuItem.js +4 -8
- package/lib/components/ListBox/ListBoxSelection.d.ts +5 -5
- package/lib/components/ListBox/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxSelection.js +12 -13
- package/lib/components/ListBox/next/ListBoxTrigger.js +3 -5
- package/lib/components/ListItem/ListItem.d.ts +1 -1
- package/lib/components/ListItem/ListItem.js +6 -2
- package/lib/components/Menu/MenuItem.js +4 -1
- package/lib/components/Modal/Modal.js +16 -27
- package/lib/components/ModalWrapper/ModalWrapper.js +13 -19
- package/lib/components/MultiSelect/FilterableMultiSelect.js +18 -32
- package/lib/components/MultiSelect/MultiSelect.js +16 -32
- package/lib/components/MultiSelect/MultiSelectPropTypes.js +2 -2
- package/lib/components/MultiSelect/tools/sorting.js +2 -2
- package/lib/components/Notification/Notification.d.ts +11 -29
- package/lib/components/Notification/Notification.js +38 -57
- package/lib/components/NumberInput/NumberInput.js +6 -2
- package/lib/components/OverflowMenu/OverflowMenu.js +27 -33
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +4 -1
- package/lib/components/Pagination/experimental/PageSelector.js +3 -8
- package/lib/components/Pagination/experimental/Pagination.js +16 -34
- package/lib/components/ProgressIndicator/ProgressIndicator.js +7 -6
- package/lib/components/RadioTile/RadioTile.js +6 -7
- package/lib/components/Search/Search.Skeleton.d.ts +0 -3
- package/lib/components/Search/Search.Skeleton.js +1 -4
- package/lib/components/Search/Search.js +1 -1
- package/lib/components/Select/Select.d.ts +2 -2
- package/lib/components/Select/Select.js +13 -16
- package/lib/components/SelectItem/SelectItem.d.ts +0 -6
- package/lib/components/SelectItem/SelectItem.js +4 -10
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +0 -3
- package/lib/components/SelectItemGroup/SelectItemGroup.js +1 -4
- package/lib/components/SkeletonIcon/SkeletonIcon.d.ts +13 -0
- package/lib/components/SkeletonIcon/SkeletonIcon.js +2 -3
- package/lib/components/SkeletonText/SkeletonText.d.ts +0 -6
- package/lib/components/SkeletonText/SkeletonText.js +0 -6
- package/lib/components/Slider/Slider.Skeleton.d.ts +9 -1
- package/lib/components/Slider/Slider.Skeleton.js +20 -4
- package/lib/components/Slider/Slider.d.ts +137 -25
- package/lib/components/Slider/Slider.js +778 -185
- package/lib/components/StructuredList/StructuredList.js +5 -2
- package/lib/components/Switch/Switch.js +3 -7
- package/lib/components/Tabs/Tabs.js +5 -2
- package/lib/components/Tag/Tag.js +4 -2
- package/lib/components/Text/Text.js +1 -1
- package/lib/components/Text/TextDirection.d.ts +1 -1
- package/lib/components/TextArea/TextArea.js +30 -34
- package/lib/components/TextInput/ControlledPasswordInput.js +12 -19
- package/lib/components/TextInput/TextInput.js +8 -3
- package/lib/components/Tile/Tile.js +4 -2
- package/lib/components/TileGroup/TileGroup.js +5 -4
- package/lib/components/Toggle/Toggle.js +4 -2
- package/lib/components/UIShell/Content.js +1 -4
- package/lib/components/UIShell/SideNav.d.ts +1 -1
- package/lib/components/UIShell/SideNavDetails.d.ts +32 -0
- package/lib/components/UIShell/SideNavDetails.js +1 -2
- package/lib/components/UIShell/SideNavDivider.d.ts +15 -0
- package/lib/components/UIShell/SideNavDivider.js +2 -2
- package/lib/components/UIShell/SideNavFooter.js +2 -5
- package/lib/components/UIShell/SideNavIcon.d.ts +25 -0
- package/lib/components/UIShell/SideNavIcon.js +4 -7
- package/lib/components/UIShell/SideNavLinkText.d.ts +26 -0
- package/lib/components/UIShell/SideNavLinkText.js +2 -2
- package/lib/components/UIShell/SideNavMenu.d.ts +46 -0
- package/lib/components/UIShell/SideNavMenu.js +23 -13
- package/lib/components/UIShell/SideNavSwitcher.d.ts +31 -0
- package/lib/components/UIShell/SideNavSwitcher.js +5 -4
- package/lib/index.js +2 -2
- package/lib/internal/FloatingMenu.js +2 -7
- package/lib/internal/Selection.js +0 -3
- package/lib/internal/noopFn.d.ts +7 -0
- package/lib/internal/noopFn.js +14 -0
- package/lib/internal/useNormalizedInputProps.js +6 -2
- package/package.json +10 -9
|
@@ -8,10 +8,15 @@
|
|
|
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__default, { useRef } from 'react';
|
|
11
|
+
import React__default, { useState, useRef, useLayoutEffect } from 'react';
|
|
12
12
|
import Filename from './Filename.js';
|
|
13
13
|
import uniqueId from '../../tools/uniqueId.js';
|
|
14
14
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
15
|
+
import { noopFn } from '../../internal/noopFn.js';
|
|
16
|
+
import '../Text/index.js';
|
|
17
|
+
import '../Tooltip/DefinitionTooltip.js';
|
|
18
|
+
import { Tooltip } from '../Tooltip/Tooltip.js';
|
|
19
|
+
import { Text } from '../Text/Text.js';
|
|
15
20
|
import { matches } from '../../internal/keyboard/match.js';
|
|
16
21
|
import { Enter, Space } from '../../internal/keyboard/keys.js';
|
|
17
22
|
|
|
@@ -21,13 +26,14 @@ function FileUploaderItem(_ref) {
|
|
|
21
26
|
name,
|
|
22
27
|
status = 'uploading',
|
|
23
28
|
iconDescription,
|
|
24
|
-
onDelete =
|
|
29
|
+
onDelete = noopFn,
|
|
25
30
|
invalid,
|
|
26
31
|
errorSubject,
|
|
27
32
|
errorBody,
|
|
28
33
|
size,
|
|
29
34
|
...other
|
|
30
35
|
} = _ref;
|
|
36
|
+
const [isEllipsisApplied, setIsEllipsisApplied] = useState(false);
|
|
31
37
|
const prefix = usePrefix();
|
|
32
38
|
const {
|
|
33
39
|
current: id
|
|
@@ -37,13 +43,39 @@ function FileUploaderItem(_ref) {
|
|
|
37
43
|
[`${prefix}--file__selected-file--md`]: size === 'md',
|
|
38
44
|
[`${prefix}--file__selected-file--sm`]: size === 'sm'
|
|
39
45
|
});
|
|
46
|
+
const isInvalid = invalid ? `${prefix}--file-filename-container-wrap-invalid` : `${prefix}--file-filename-container-wrap`;
|
|
47
|
+
const isEllipsisActive = element => {
|
|
48
|
+
setIsEllipsisApplied(element.offsetWidth < element.scrollWidth);
|
|
49
|
+
return element.offsetWidth < element.scrollWidth;
|
|
50
|
+
};
|
|
51
|
+
useLayoutEffect(() => {
|
|
52
|
+
const element = document.querySelector(`[title="${name}"]`);
|
|
53
|
+
isEllipsisActive(element);
|
|
54
|
+
}, [prefix, name]);
|
|
40
55
|
return /*#__PURE__*/React__default.createElement("span", _extends({
|
|
41
56
|
className: classes
|
|
42
|
-
}, other), /*#__PURE__*/React__default.createElement("
|
|
43
|
-
className:
|
|
57
|
+
}, other), isEllipsisApplied ? /*#__PURE__*/React__default.createElement("div", {
|
|
58
|
+
className: isInvalid
|
|
59
|
+
}, /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
60
|
+
label: name,
|
|
61
|
+
align: "bottom",
|
|
62
|
+
className: `${prefix}--file-filename-tooltip`
|
|
63
|
+
}, /*#__PURE__*/React__default.createElement("button", {
|
|
64
|
+
className: `${prefix}--file-filename-button`,
|
|
65
|
+
type: "button"
|
|
66
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
67
|
+
as: "p",
|
|
44
68
|
title: name,
|
|
69
|
+
className: `${prefix}--file-filename-button`,
|
|
45
70
|
id: name
|
|
46
|
-
}, name)
|
|
71
|
+
}, name)))) : /*#__PURE__*/React__default.createElement(Text, {
|
|
72
|
+
as: "p",
|
|
73
|
+
title: name,
|
|
74
|
+
className: `${prefix}--file-filename`,
|
|
75
|
+
id: name
|
|
76
|
+
}, name), /*#__PURE__*/React__default.createElement("div", {
|
|
77
|
+
className: `${prefix}--file-container-item`
|
|
78
|
+
}, /*#__PURE__*/React__default.createElement("span", {
|
|
47
79
|
className: `${prefix}--file__state-container`
|
|
48
80
|
}, /*#__PURE__*/React__default.createElement(Filename, {
|
|
49
81
|
name: name,
|
|
@@ -68,13 +100,15 @@ function FileUploaderItem(_ref) {
|
|
|
68
100
|
});
|
|
69
101
|
}
|
|
70
102
|
}
|
|
71
|
-
})), invalid && errorSubject && /*#__PURE__*/React__default.createElement("div", {
|
|
103
|
+
}))), invalid && errorSubject && /*#__PURE__*/React__default.createElement("div", {
|
|
72
104
|
className: `${prefix}--form-requirement`,
|
|
73
105
|
role: "alert",
|
|
74
106
|
id: `${name}-id-error`
|
|
75
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
107
|
+
}, /*#__PURE__*/React__default.createElement(Text, {
|
|
108
|
+
as: "div",
|
|
76
109
|
className: `${prefix}--form-requirement__title`
|
|
77
|
-
}, errorSubject), errorBody && /*#__PURE__*/React__default.createElement(
|
|
110
|
+
}, errorSubject), errorBody && /*#__PURE__*/React__default.createElement(Text, {
|
|
111
|
+
as: "p",
|
|
78
112
|
className: `${prefix}--form-requirement__supplement`
|
|
79
113
|
}, errorBody)));
|
|
80
114
|
}
|
|
@@ -118,9 +152,5 @@ FileUploaderItem.propTypes = {
|
|
|
118
152
|
*/
|
|
119
153
|
uuid: PropTypes.string
|
|
120
154
|
};
|
|
121
|
-
FileUploaderItem.defaultProps = {
|
|
122
|
-
status: 'uploading',
|
|
123
|
-
onDelete: () => {}
|
|
124
|
-
};
|
|
125
155
|
|
|
126
156
|
export { FileUploaderItem as default };
|
|
@@ -4,11 +4,12 @@
|
|
|
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
|
-
/// <reference types="react" />
|
|
8
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import React from 'react';
|
|
9
9
|
import { ReactAttr } from '../../types/common';
|
|
10
10
|
export type FilenameStatus = 'edit' | 'complete' | 'uploading';
|
|
11
|
-
|
|
11
|
+
type SVGAttr = React.SVGAttributes<React.ReactSVGElement>;
|
|
12
|
+
export interface FilenameProps extends Omit<ReactAttr & SVGAttr, 'tabIndex' | 'type'> {
|
|
12
13
|
/**
|
|
13
14
|
* Specify an id that describes the error to be read by screen readers when the filename is invalid
|
|
14
15
|
*/
|
|
@@ -32,9 +33,9 @@ export interface FilenameProps extends Omit<ReactAttr<HTMLElement>, 'tabIndex'>
|
|
|
32
33
|
/**
|
|
33
34
|
* Provide a custom tabIndex value for the `<Filename>`
|
|
34
35
|
*/
|
|
35
|
-
tabIndex?: number
|
|
36
|
+
tabIndex?: number;
|
|
36
37
|
}
|
|
37
|
-
declare function Filename({ iconDescription, status, invalid, name, ['aria-describedby']: ariaDescribedBy, ...rest }: FilenameProps): JSX.Element | null;
|
|
38
|
+
declare function Filename({ iconDescription, status, invalid, name, tabIndex, ['aria-describedby']: ariaDescribedBy, ...rest }: FilenameProps): JSX.Element | null;
|
|
38
39
|
declare namespace Filename {
|
|
39
40
|
var propTypes: {
|
|
40
41
|
/**
|
|
@@ -60,12 +61,7 @@ declare namespace Filename {
|
|
|
60
61
|
/**
|
|
61
62
|
* Provide a custom tabIndex value for the `<Filename>`
|
|
62
63
|
*/
|
|
63
|
-
tabIndex: PropTypes.Requireable<
|
|
64
|
-
};
|
|
65
|
-
var defaultProps: {
|
|
66
|
-
iconDescription: string;
|
|
67
|
-
status: string;
|
|
68
|
-
tabIndex: string;
|
|
64
|
+
tabIndex: PropTypes.Requireable<number>;
|
|
69
65
|
};
|
|
70
66
|
}
|
|
71
67
|
export default Filename;
|
|
@@ -15,10 +15,11 @@ import { usePrefix } from '../../internal/usePrefix.js';
|
|
|
15
15
|
var _Close;
|
|
16
16
|
function Filename(_ref) {
|
|
17
17
|
let {
|
|
18
|
-
iconDescription,
|
|
19
|
-
status,
|
|
18
|
+
iconDescription = 'Uploading file',
|
|
19
|
+
status = 'uploading',
|
|
20
20
|
invalid,
|
|
21
21
|
name,
|
|
22
|
+
tabIndex = 0,
|
|
22
23
|
['aria-describedby']: ariaDescribedBy,
|
|
23
24
|
...rest
|
|
24
25
|
} = _ref;
|
|
@@ -28,7 +29,8 @@ function Filename(_ref) {
|
|
|
28
29
|
return /*#__PURE__*/React__default.createElement(Loading, {
|
|
29
30
|
description: iconDescription,
|
|
30
31
|
small: true,
|
|
31
|
-
withOverlay: false
|
|
32
|
+
withOverlay: false,
|
|
33
|
+
className: `${prefix}--file-loading`
|
|
32
34
|
});
|
|
33
35
|
case 'edit':
|
|
34
36
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, invalid && /*#__PURE__*/React__default.createElement(WarningFilled, {
|
|
@@ -36,9 +38,9 @@ function Filename(_ref) {
|
|
|
36
38
|
}), /*#__PURE__*/React__default.createElement("button", _extends({
|
|
37
39
|
"aria-label": `${iconDescription} - ${name}`,
|
|
38
40
|
className: `${prefix}--file-close`,
|
|
39
|
-
type: "button"
|
|
41
|
+
type: "button",
|
|
42
|
+
tabIndex: tabIndex
|
|
40
43
|
}, rest, {
|
|
41
|
-
tabIndex: rest.tabIndex !== undefined ? parseInt(rest.tabIndex, 10) : undefined,
|
|
42
44
|
"aria-describedby": invalid ? ariaDescribedBy : undefined
|
|
43
45
|
}), _Close || (_Close = /*#__PURE__*/React__default.createElement(Close, null))));
|
|
44
46
|
case 'complete':
|
|
@@ -46,7 +48,7 @@ function Filename(_ref) {
|
|
|
46
48
|
"aria-label": iconDescription,
|
|
47
49
|
className: `${prefix}--file-complete`
|
|
48
50
|
}, rest, {
|
|
49
|
-
tabIndex:
|
|
51
|
+
tabIndex: -1
|
|
50
52
|
}), iconDescription && /*#__PURE__*/React__default.createElement("title", null, iconDescription));
|
|
51
53
|
default:
|
|
52
54
|
return null;
|
|
@@ -76,12 +78,7 @@ Filename.propTypes = {
|
|
|
76
78
|
/**
|
|
77
79
|
* Provide a custom tabIndex value for the `<Filename>`
|
|
78
80
|
*/
|
|
79
|
-
tabIndex: PropTypes.
|
|
80
|
-
};
|
|
81
|
-
Filename.defaultProps = {
|
|
82
|
-
iconDescription: 'Uploading file',
|
|
83
|
-
status: 'uploading',
|
|
84
|
-
tabIndex: '0'
|
|
81
|
+
tabIndex: PropTypes.number
|
|
85
82
|
};
|
|
86
83
|
|
|
87
84
|
export { Filename as default };
|
|
@@ -15,11 +15,11 @@ const FormGroup = _ref => {
|
|
|
15
15
|
let {
|
|
16
16
|
legendId,
|
|
17
17
|
legendText,
|
|
18
|
-
invalid,
|
|
18
|
+
invalid = false,
|
|
19
19
|
children,
|
|
20
20
|
className,
|
|
21
|
-
message,
|
|
22
|
-
messageText,
|
|
21
|
+
message = false,
|
|
22
|
+
messageText = '',
|
|
23
23
|
...rest
|
|
24
24
|
} = _ref;
|
|
25
25
|
const prefix = usePrefix();
|
|
@@ -68,10 +68,5 @@ FormGroup.propTypes = {
|
|
|
68
68
|
*/
|
|
69
69
|
messageText: PropTypes.string
|
|
70
70
|
};
|
|
71
|
-
FormGroup.defaultProps = {
|
|
72
|
-
invalid: false,
|
|
73
|
-
message: false,
|
|
74
|
-
messageText: ''
|
|
75
|
-
};
|
|
76
71
|
|
|
77
72
|
export { FormGroup as default };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import PropTypes from 'prop-types';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
type FormItemProps = {
|
|
10
|
+
/**
|
|
11
|
+
* Provide content to be rendered in the form item
|
|
12
|
+
*/
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* Provide a custom className to be applied to the containing node
|
|
16
|
+
*/
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
declare function FormItem({ className, children, ...rest }: FormItemProps): JSX.Element;
|
|
20
|
+
declare namespace FormItem {
|
|
21
|
+
var propTypes: {
|
|
22
|
+
/**
|
|
23
|
+
* Provide content to be rendered in the form item
|
|
24
|
+
*/
|
|
25
|
+
children: PropTypes.Requireable<PropTypes.ReactNodeLike>;
|
|
26
|
+
/**
|
|
27
|
+
* Provide a custom className to be applied to the containing node
|
|
28
|
+
*/
|
|
29
|
+
className: PropTypes.Requireable<string>;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export default FormItem;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2016, 2023
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
import FormItem from './FormItem';
|
|
8
|
+
export default FormItem;
|
|
9
|
+
export { FormItem };
|
|
@@ -10,6 +10,8 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import '../Text/index.js';
|
|
14
|
+
import { Text } from '../Text/Text.js';
|
|
13
15
|
|
|
14
16
|
function FormLabel(_ref) {
|
|
15
17
|
let {
|
|
@@ -20,7 +22,8 @@ function FormLabel(_ref) {
|
|
|
20
22
|
} = _ref;
|
|
21
23
|
const prefix = usePrefix();
|
|
22
24
|
const className = cx(`${prefix}--label`, `${prefix}--label--no-margin`, customClassName);
|
|
23
|
-
return /*#__PURE__*/React__default.createElement(
|
|
25
|
+
return /*#__PURE__*/React__default.createElement(Text, _extends({
|
|
26
|
+
as: "label",
|
|
24
27
|
htmlFor: id,
|
|
25
28
|
className: className
|
|
26
29
|
}, rest), children);
|
|
@@ -32,8 +32,8 @@ const ListBox = /*#__PURE__*/React__default.forwardRef(function ListBox(_ref, re
|
|
|
32
32
|
let {
|
|
33
33
|
children,
|
|
34
34
|
className: containerClassName,
|
|
35
|
-
disabled,
|
|
36
|
-
type,
|
|
35
|
+
disabled = false,
|
|
36
|
+
type = 'default',
|
|
37
37
|
size,
|
|
38
38
|
invalid,
|
|
39
39
|
invalidText,
|
|
@@ -88,7 +88,7 @@ ListBox.propTypes = {
|
|
|
88
88
|
/**
|
|
89
89
|
* Specify whether the ListBox is currently disabled
|
|
90
90
|
*/
|
|
91
|
-
disabled: PropTypes.bool
|
|
91
|
+
disabled: PropTypes.bool,
|
|
92
92
|
/**
|
|
93
93
|
* Specify whether the control is currently invalid
|
|
94
94
|
*/
|
|
@@ -114,7 +114,7 @@ ListBox.propTypes = {
|
|
|
114
114
|
* Specify the "type" of the ListBox. Currently supports either `default` or
|
|
115
115
|
* `inline` as an option.
|
|
116
116
|
*/
|
|
117
|
-
type: ListBoxType
|
|
117
|
+
type: ListBoxType,
|
|
118
118
|
/**
|
|
119
119
|
* Specify whether the control is currently in warning state
|
|
120
120
|
*/
|
|
@@ -124,9 +124,5 @@ ListBox.propTypes = {
|
|
|
124
124
|
*/
|
|
125
125
|
warnText: PropTypes.node
|
|
126
126
|
};
|
|
127
|
-
ListBox.defaultProps = {
|
|
128
|
-
disabled: false,
|
|
129
|
-
type: 'default'
|
|
130
|
-
};
|
|
131
127
|
|
|
132
128
|
export { ListBox as default };
|
|
@@ -52,10 +52,7 @@ ListBoxMenuIcon.propTypes = {
|
|
|
52
52
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
53
53
|
* return a string message for that given message id.
|
|
54
54
|
*/
|
|
55
|
-
translateWithId: PropTypes.func
|
|
56
|
-
};
|
|
57
|
-
ListBoxMenuIcon.defaultProps = {
|
|
58
|
-
translateWithId: defaultTranslateWithId
|
|
55
|
+
translateWithId: PropTypes.func
|
|
59
56
|
};
|
|
60
57
|
|
|
61
58
|
export { ListBoxMenuIcon as default, translationIds };
|
|
@@ -31,8 +31,8 @@ function useIsTruncated(ref) {
|
|
|
31
31
|
const ListBoxMenuItem = /*#__PURE__*/React__default.forwardRef(function ListBoxMenuItem(_ref, forwardedRef) {
|
|
32
32
|
let {
|
|
33
33
|
children,
|
|
34
|
-
isActive,
|
|
35
|
-
isHighlighted,
|
|
34
|
+
isActive = false,
|
|
35
|
+
isHighlighted = false,
|
|
36
36
|
title,
|
|
37
37
|
...rest
|
|
38
38
|
} = _ref;
|
|
@@ -65,19 +65,15 @@ ListBoxMenuItem.propTypes = {
|
|
|
65
65
|
/**
|
|
66
66
|
* Specify whether the current menu item is "active".
|
|
67
67
|
*/
|
|
68
|
-
isActive: PropTypes.bool
|
|
68
|
+
isActive: PropTypes.bool,
|
|
69
69
|
/**
|
|
70
70
|
* Specify whether the current menu item is "highlighted".
|
|
71
71
|
*/
|
|
72
|
-
isHighlighted: PropTypes.bool
|
|
72
|
+
isHighlighted: PropTypes.bool,
|
|
73
73
|
/**
|
|
74
74
|
* Provide an optional tooltip for the ListBoxMenuItem
|
|
75
75
|
*/
|
|
76
76
|
title: PropTypes.string
|
|
77
77
|
};
|
|
78
|
-
ListBoxMenuItem.defaultProps = {
|
|
79
|
-
isActive: false,
|
|
80
|
-
isHighlighted: false
|
|
81
|
-
};
|
|
82
78
|
|
|
83
79
|
export { ListBoxMenuItem as default };
|
|
@@ -35,17 +35,17 @@ export interface ListBoxSelectionProps {
|
|
|
35
35
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
36
36
|
* return a string message for that given message id.
|
|
37
37
|
*/
|
|
38
|
-
translateWithId(messageId: string, args?: Record<string, unknown>): string;
|
|
38
|
+
translateWithId?(messageId: string, args?: Record<string, unknown>): string;
|
|
39
39
|
}
|
|
40
40
|
export type ListBoxSelectionComponent = React.FC<ListBoxSelectionProps>;
|
|
41
|
+
export declare const translationIds: {
|
|
42
|
+
'clear.all': string;
|
|
43
|
+
'clear.selection': string;
|
|
44
|
+
};
|
|
41
45
|
/**
|
|
42
46
|
* `ListBoxSelection` is used to provide controls for clearing a selection, in
|
|
43
47
|
* addition to conditionally rendering a badge if the control has more than one
|
|
44
48
|
* selection.
|
|
45
49
|
*/
|
|
46
50
|
declare const ListBoxSelection: ListBoxSelectionComponent;
|
|
47
|
-
export declare const translationIds: {
|
|
48
|
-
'clear.all': string;
|
|
49
|
-
'clear.selection': string;
|
|
50
|
-
};
|
|
51
51
|
export default ListBoxSelection;
|
|
@@ -12,6 +12,16 @@ import { Close } from '@carbon/icons-react';
|
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
13
|
|
|
14
14
|
var _Close, _Close2;
|
|
15
|
+
const translationIds = {
|
|
16
|
+
'clear.all': 'clear.all',
|
|
17
|
+
'clear.selection': 'clear.selection'
|
|
18
|
+
};
|
|
19
|
+
const defaultTranslations = {
|
|
20
|
+
[translationIds['clear.all']]: 'Clear all selected items',
|
|
21
|
+
[translationIds['clear.selection']]: 'Clear selected item'
|
|
22
|
+
};
|
|
23
|
+
const defaultTranslateWithId = id => defaultTranslations[id];
|
|
24
|
+
|
|
15
25
|
/**
|
|
16
26
|
* `ListBoxSelection` is used to provide controls for clearing a selection, in
|
|
17
27
|
* addition to conditionally rendering a badge if the control has more than one
|
|
@@ -21,7 +31,7 @@ const ListBoxSelection = _ref => {
|
|
|
21
31
|
let {
|
|
22
32
|
clearSelection,
|
|
23
33
|
selectionCount,
|
|
24
|
-
translateWithId: t,
|
|
34
|
+
translateWithId: t = defaultTranslateWithId,
|
|
25
35
|
disabled,
|
|
26
36
|
onClearSelection,
|
|
27
37
|
readOnly
|
|
@@ -69,14 +79,6 @@ const ListBoxSelection = _ref => {
|
|
|
69
79
|
title: description
|
|
70
80
|
}, selectionCount, _Close2 || (_Close2 = /*#__PURE__*/React__default.createElement(Close, null)));
|
|
71
81
|
};
|
|
72
|
-
const translationIds = {
|
|
73
|
-
'clear.all': 'clear.all',
|
|
74
|
-
'clear.selection': 'clear.selection'
|
|
75
|
-
};
|
|
76
|
-
const defaultTranslations = {
|
|
77
|
-
[translationIds['clear.all']]: 'Clear all selected items',
|
|
78
|
-
[translationIds['clear.selection']]: 'Clear selected item'
|
|
79
|
-
};
|
|
80
82
|
ListBoxSelection.propTypes = {
|
|
81
83
|
/**
|
|
82
84
|
* Specify a function to be invoked when a user interacts with the clear
|
|
@@ -106,10 +108,7 @@ ListBoxSelection.propTypes = {
|
|
|
106
108
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
107
109
|
* return a string message for that given message id.
|
|
108
110
|
*/
|
|
109
|
-
translateWithId: PropTypes.func
|
|
110
|
-
};
|
|
111
|
-
ListBoxSelection.defaultProps = {
|
|
112
|
-
translateWithId: id => defaultTranslations[id]
|
|
111
|
+
translateWithId: PropTypes.func
|
|
113
112
|
};
|
|
114
113
|
|
|
115
114
|
export { ListBoxSelection as default, translationIds };
|
|
@@ -19,11 +19,21 @@ var _Close, _Close2;
|
|
|
19
19
|
* addition to conditionally rendering a badge if the control has more than one
|
|
20
20
|
* selection.
|
|
21
21
|
*/
|
|
22
|
+
|
|
23
|
+
const translationIds = {
|
|
24
|
+
'clear.all': 'clear.all',
|
|
25
|
+
'clear.selection': 'clear.selection'
|
|
26
|
+
};
|
|
27
|
+
const defaultTranslations = {
|
|
28
|
+
[translationIds['clear.all']]: 'Clear all selected items',
|
|
29
|
+
[translationIds['clear.selection']]: 'Clear selected item'
|
|
30
|
+
};
|
|
31
|
+
const defaultTranslateWithId = id => defaultTranslations[id];
|
|
22
32
|
function ListBoxSelection(_ref) {
|
|
23
33
|
let {
|
|
24
34
|
clearSelection,
|
|
25
35
|
selectionCount,
|
|
26
|
-
translateWithId: t,
|
|
36
|
+
translateWithId: t = defaultTranslateWithId,
|
|
27
37
|
disabled,
|
|
28
38
|
onClearSelection,
|
|
29
39
|
...rest
|
|
@@ -73,14 +83,6 @@ function ListBoxSelection(_ref) {
|
|
|
73
83
|
type: "button"
|
|
74
84
|
}), _Close2 || (_Close2 = /*#__PURE__*/React__default.createElement(Close, null)));
|
|
75
85
|
}
|
|
76
|
-
const translationIds = {
|
|
77
|
-
'clear.all': 'clear.all',
|
|
78
|
-
'clear.selection': 'clear.selection'
|
|
79
|
-
};
|
|
80
|
-
const defaultTranslations = {
|
|
81
|
-
[translationIds['clear.all']]: 'Clear all selected items',
|
|
82
|
-
[translationIds['clear.selection']]: 'Clear selected item'
|
|
83
|
-
};
|
|
84
86
|
ListBoxSelection.propTypes = {
|
|
85
87
|
/**
|
|
86
88
|
* Specify a function to be invoked when a user interacts with the clear
|
|
@@ -116,10 +118,7 @@ ListBoxSelection.propTypes = {
|
|
|
116
118
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
117
119
|
* return a string message for that given message id.
|
|
118
120
|
*/
|
|
119
|
-
translateWithId: PropTypes.func
|
|
120
|
-
};
|
|
121
|
-
ListBoxSelection.defaultProps = {
|
|
122
|
-
translateWithId: id => defaultTranslations[id]
|
|
121
|
+
translateWithId: PropTypes.func
|
|
123
122
|
};
|
|
124
123
|
|
|
125
124
|
export { ListBoxSelection as default, translationIds };
|
|
@@ -21,6 +21,7 @@ const defaultTranslations = {
|
|
|
21
21
|
[translationIds['close.menu']]: 'Close',
|
|
22
22
|
[translationIds['open.menu']]: 'Open'
|
|
23
23
|
};
|
|
24
|
+
const defaultTranslateWithId = id => defaultTranslations[id];
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* `ListBoxTrigger` is used to orient the icon up or down depending on the
|
|
@@ -29,7 +30,7 @@ const defaultTranslations = {
|
|
|
29
30
|
const ListBoxTrigger = _ref => {
|
|
30
31
|
let {
|
|
31
32
|
isOpen,
|
|
32
|
-
translateWithId: t,
|
|
33
|
+
translateWithId: t = defaultTranslateWithId,
|
|
33
34
|
...rest
|
|
34
35
|
} = _ref;
|
|
35
36
|
const prefix = usePrefix();
|
|
@@ -57,10 +58,7 @@ ListBoxTrigger.propTypes = {
|
|
|
57
58
|
* icon. This function takes in an id defined in `translationIds` and should
|
|
58
59
|
* return a string message for that given message id.
|
|
59
60
|
*/
|
|
60
|
-
translateWithId: PropTypes.func
|
|
61
|
-
};
|
|
62
|
-
ListBoxTrigger.defaultProps = {
|
|
63
|
-
translateWithId: id => defaultTranslations[id]
|
|
61
|
+
translateWithId: PropTypes.func
|
|
64
62
|
};
|
|
65
63
|
var ListBoxTrigger$1 = ListBoxTrigger;
|
|
66
64
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
8
|
import { type ComponentProps } from 'react';
|
|
9
9
|
type ListItemProps = ComponentProps<'li'>;
|
|
10
|
-
declare function ListItem({ className, ...other }: ListItemProps): JSX.Element;
|
|
10
|
+
declare function ListItem({ className, children, ...other }: ListItemProps): JSX.Element;
|
|
11
11
|
declare namespace ListItem {
|
|
12
12
|
var propTypes: {
|
|
13
13
|
/**
|
|
@@ -10,17 +10,21 @@ import PropTypes from 'prop-types';
|
|
|
10
10
|
import React__default from 'react';
|
|
11
11
|
import cx from 'classnames';
|
|
12
12
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
13
|
+
import '../Text/index.js';
|
|
14
|
+
import { Text } from '../Text/Text.js';
|
|
13
15
|
|
|
14
16
|
function ListItem(_ref) {
|
|
15
17
|
let {
|
|
16
18
|
className,
|
|
19
|
+
children,
|
|
17
20
|
...other
|
|
18
21
|
} = _ref;
|
|
19
22
|
const prefix = usePrefix();
|
|
20
23
|
const classNames = cx(`${prefix}--list__item`, className);
|
|
21
|
-
return /*#__PURE__*/React__default.createElement(
|
|
24
|
+
return /*#__PURE__*/React__default.createElement(Text, _extends({
|
|
25
|
+
as: "li",
|
|
22
26
|
className: classNames
|
|
23
|
-
}, other));
|
|
27
|
+
}, other), children);
|
|
24
28
|
}
|
|
25
29
|
ListItem.propTypes = {
|
|
26
30
|
/**
|
|
@@ -15,7 +15,9 @@ import { useMergedRefs } from '../../internal/useMergedRefs.js';
|
|
|
15
15
|
import { usePrefix } from '../../internal/usePrefix.js';
|
|
16
16
|
import { Menu } from './Menu.js';
|
|
17
17
|
import { MenuContext } from './MenuContext.js';
|
|
18
|
+
import '../Text/index.js';
|
|
18
19
|
import { useLayoutDirection } from '../LayoutDirection/useLayoutDirection.js';
|
|
20
|
+
import { Text } from '../Text/Text.js';
|
|
19
21
|
import { match } from '../../internal/keyboard/match.js';
|
|
20
22
|
import { ArrowRight, Enter, Space } from '../../internal/keyboard/keys.js';
|
|
21
23
|
|
|
@@ -156,7 +158,8 @@ const MenuItem = /*#__PURE__*/React__default.forwardRef(function MenuItem(_ref,
|
|
|
156
158
|
onKeyDown: handleKeyDown
|
|
157
159
|
}), /*#__PURE__*/React__default.createElement("div", {
|
|
158
160
|
className: `${prefix}--menu-item__icon`
|
|
159
|
-
}, IconElement && /*#__PURE__*/React__default.createElement(IconElement, null)), /*#__PURE__*/React__default.createElement(
|
|
161
|
+
}, IconElement && /*#__PURE__*/React__default.createElement(IconElement, null)), /*#__PURE__*/React__default.createElement(Text, {
|
|
162
|
+
as: "div",
|
|
160
163
|
className: `${prefix}--menu-item__label`
|
|
161
164
|
}, label), shortcut && !hasChildren && /*#__PURE__*/React__default.createElement("div", {
|
|
162
165
|
className: `${prefix}--menu-item__shortcut`
|