@carbon/react 1.40.0 → 1.41.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 +1564 -872
- 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 -5
- 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 +4 -7
- 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/TableExpandHeader.d.ts +1 -1
- package/es/components/DataTable/TableHeader.js +3 -8
- package/es/components/DataTable/TableSelectAll.d.ts +0 -3
- package/es/components/DataTable/TableSelectAll.js +1 -4
- 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.d.ts +1 -1
- 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 +0 -4
- package/es/components/FileUploader/FileUploaderItem.js +12 -9
- package/es/components/FileUploader/Filename.d.ts +6 -10
- package/es/components/FileUploader/Filename.js +7 -11
- 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.d.ts +137 -0
- package/es/components/Modal/Modal.js +39 -45
- package/es/components/Modal/index.d.ts +9 -0
- 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/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 +5 -3
- package/es/components/TileGroup/TileGroup.js +5 -4
- package/es/components/Toggle/Toggle.js +4 -2
- package/es/components/Toggletip/index.d.ts +6 -1
- package/es/components/Toggletip/index.js +7 -1
- 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/SideNavSwitcher.d.ts +31 -0
- package/es/components/UIShell/SideNavSwitcher.js +6 -5
- package/es/index.js +2 -2
- 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/es/internal/wrapFocus.js +5 -5
- package/es/prop-types/requiredIfGivenPropIsTruthy.js +2 -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 -5
- 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 +3 -6
- 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/TableExpandHeader.d.ts +1 -1
- package/lib/components/DataTable/TableHeader.js +3 -8
- package/lib/components/DataTable/TableSelectAll.d.ts +0 -3
- package/lib/components/DataTable/TableSelectAll.js +1 -4
- 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.d.ts +1 -1
- 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 +0 -4
- package/lib/components/FileUploader/FileUploaderItem.js +12 -9
- package/lib/components/FileUploader/Filename.d.ts +6 -10
- package/lib/components/FileUploader/Filename.js +7 -11
- 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.d.ts +137 -0
- package/lib/components/Modal/Modal.js +40 -45
- package/lib/components/Modal/index.d.ts +9 -0
- 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/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 +5 -3
- package/lib/components/TileGroup/TileGroup.js +5 -4
- package/lib/components/Toggle/Toggle.js +4 -2
- package/lib/components/Toggletip/index.d.ts +6 -1
- package/lib/components/Toggletip/index.js +7 -1
- 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/SideNavSwitcher.d.ts +31 -0
- package/lib/components/UIShell/SideNavSwitcher.js +5 -4
- package/lib/index.js +4 -4
- 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/lib/internal/wrapFocus.js +5 -5
- package/lib/prop-types/requiredIfGivenPropIsTruthy.js +2 -2
- package/package.json +9 -9
- package/scss/components/slug/_index.scss +9 -0
- package/scss/components/slug/_slug.scss +9 -0
|
@@ -17,6 +17,7 @@ var Button = require('../Button/Button.js');
|
|
|
17
17
|
require('../Button/Button.Skeleton.js');
|
|
18
18
|
var types = require('../../prop-types/types.js');
|
|
19
19
|
var warning = require('../../internal/warning.js');
|
|
20
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
20
21
|
|
|
21
22
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
23
|
|
|
@@ -66,19 +67,21 @@ class ModalWrapper extends React__default["default"].Component {
|
|
|
66
67
|
render() {
|
|
67
68
|
const {
|
|
68
69
|
children,
|
|
69
|
-
onKeyDown,
|
|
70
|
+
onKeyDown = noopFn.noopFn,
|
|
70
71
|
buttonTriggerText,
|
|
71
72
|
buttonTriggerClassName,
|
|
72
73
|
renderTriggerButtonIcon,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
primaryButtonText = 'Save',
|
|
75
|
+
secondaryButtonText = 'Cancel',
|
|
76
|
+
triggerButtonIconDescription = 'Provide icon description if icon is used',
|
|
77
|
+
triggerButtonKind = 'primary',
|
|
78
|
+
disabled = false,
|
|
76
79
|
handleSubmit,
|
|
77
80
|
// eslint-disable-line no-unused-vars
|
|
78
|
-
shouldCloseAfterSubmit,
|
|
81
|
+
shouldCloseAfterSubmit = true,
|
|
79
82
|
// eslint-disable-line no-unused-vars
|
|
80
|
-
selectorPrimaryFocus,
|
|
81
|
-
preventCloseOnClickOutside,
|
|
83
|
+
selectorPrimaryFocus = '[data-modal-primary-focus]',
|
|
84
|
+
preventCloseOnClickOutside = false,
|
|
82
85
|
// eslint-disable-line no-unused-vars
|
|
83
86
|
...other
|
|
84
87
|
} = this.props;
|
|
@@ -106,7 +109,9 @@ class ModalWrapper extends React__default["default"].Component {
|
|
|
106
109
|
onClick: this.handleOpen,
|
|
107
110
|
ref: this.triggerButton
|
|
108
111
|
}, buttonTriggerText), /*#__PURE__*/React__default["default"].createElement(Modal["default"], _rollupPluginBabelHelpers["extends"]({
|
|
109
|
-
ref: this.modal
|
|
112
|
+
ref: this.modal,
|
|
113
|
+
primaryButtonText: primaryButtonText,
|
|
114
|
+
secondaryButtonText: secondaryButtonText
|
|
110
115
|
}, props), children));
|
|
111
116
|
}
|
|
112
117
|
}
|
|
@@ -135,16 +140,5 @@ _rollupPluginBabelHelpers.defineProperty(ModalWrapper, "propTypes", {
|
|
|
135
140
|
triggerButtonKind: PropTypes__default["default"].oneOf(types.ButtonKinds),
|
|
136
141
|
withHeader: PropTypes__default["default"].bool
|
|
137
142
|
});
|
|
138
|
-
_rollupPluginBabelHelpers.defineProperty(ModalWrapper, "defaultProps", {
|
|
139
|
-
shouldCloseAfterSubmit: true,
|
|
140
|
-
primaryButtonText: 'Save',
|
|
141
|
-
secondaryButtonText: 'Cancel',
|
|
142
|
-
triggerButtonIconDescription: 'Provide icon description if icon is used',
|
|
143
|
-
triggerButtonKind: 'primary',
|
|
144
|
-
disabled: false,
|
|
145
|
-
preventCloseOnClickOutside: false,
|
|
146
|
-
selectorPrimaryFocus: '[data-modal-primary-focus]',
|
|
147
|
-
onKeyDown: () => {}
|
|
148
|
-
});
|
|
149
143
|
|
|
150
144
|
exports["default"] = ModalWrapper;
|
|
@@ -45,35 +45,35 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
45
45
|
const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(function FilterableMultiSelect(_ref, ref) {
|
|
46
46
|
let {
|
|
47
47
|
className: containerClassName,
|
|
48
|
-
clearSelectionDescription,
|
|
49
|
-
clearSelectionText,
|
|
50
|
-
compareItems,
|
|
51
|
-
direction,
|
|
52
|
-
disabled,
|
|
48
|
+
clearSelectionDescription = 'Total items selected: ',
|
|
49
|
+
clearSelectionText = 'To clear selection, press Delete or Backspace',
|
|
50
|
+
compareItems = sorting.defaultCompareItems,
|
|
51
|
+
direction = 'bottom',
|
|
52
|
+
disabled = false,
|
|
53
53
|
downshiftProps,
|
|
54
|
-
filterItems,
|
|
54
|
+
filterItems = filter.defaultFilterItems,
|
|
55
55
|
helperText,
|
|
56
56
|
hideLabel,
|
|
57
57
|
id,
|
|
58
|
-
initialSelectedItems,
|
|
58
|
+
initialSelectedItems = [],
|
|
59
59
|
invalid,
|
|
60
60
|
invalidText,
|
|
61
61
|
items,
|
|
62
62
|
itemToElement: ItemToElement,
|
|
63
63
|
// needs to be capitalized for react to render it correctly
|
|
64
|
-
itemToString,
|
|
64
|
+
itemToString: itemToString$1 = itemToString.defaultItemToString,
|
|
65
65
|
light,
|
|
66
|
-
locale,
|
|
66
|
+
locale = 'en',
|
|
67
67
|
onInputValueChange,
|
|
68
|
-
open,
|
|
68
|
+
open = false,
|
|
69
69
|
onChange,
|
|
70
70
|
onMenuChange,
|
|
71
71
|
placeholder,
|
|
72
72
|
titleText,
|
|
73
73
|
type,
|
|
74
|
-
selectionFeedback,
|
|
74
|
+
selectionFeedback = 'top-after-reopen',
|
|
75
75
|
size,
|
|
76
|
-
sortItems,
|
|
76
|
+
sortItems = sorting.defaultSortItems,
|
|
77
77
|
translateWithId,
|
|
78
78
|
useTitleInItem,
|
|
79
79
|
warn,
|
|
@@ -221,7 +221,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
221
221
|
onItemChange(selectedItem);
|
|
222
222
|
}
|
|
223
223
|
},
|
|
224
|
-
itemToString: itemToString,
|
|
224
|
+
itemToString: itemToString$1,
|
|
225
225
|
onStateChange: handleOnStateChange,
|
|
226
226
|
onOuterClick: handleOnOuterClick,
|
|
227
227
|
selectedItem: selectedItems,
|
|
@@ -309,10 +309,10 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
309
309
|
if (match.match(event, keys.Tab)) {
|
|
310
310
|
handleOnMenuChange(false);
|
|
311
311
|
}
|
|
312
|
-
if (match.match(event, keys.Home)) {
|
|
312
|
+
if (match.match(event, keys.Home) && event.code !== 'Numpad7') {
|
|
313
313
|
event.target.setSelectionRange(0, 0);
|
|
314
314
|
}
|
|
315
|
-
if (match.match(event, keys.End)) {
|
|
315
|
+
if (match.match(event, keys.End) && event.code !== 'Numpad1') {
|
|
316
316
|
event.target.setSelectionRange(event.target.value.length, event.target.value.length);
|
|
317
317
|
}
|
|
318
318
|
},
|
|
@@ -394,7 +394,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
394
394
|
isOpen: isOpen,
|
|
395
395
|
translateWithId: translateWithId
|
|
396
396
|
}))), isOpen ? /*#__PURE__*/React__default["default"].createElement(index["default"].Menu, menuProps, sortItems(filterItems(items, {
|
|
397
|
-
itemToString,
|
|
397
|
+
itemToString: itemToString$1,
|
|
398
398
|
inputValue
|
|
399
399
|
}), {
|
|
400
400
|
selectedItems: {
|
|
@@ -402,7 +402,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
402
402
|
fixed: [],
|
|
403
403
|
'top-after-reopen': topItems
|
|
404
404
|
}[selectionFeedback],
|
|
405
|
-
itemToString,
|
|
405
|
+
itemToString: itemToString$1,
|
|
406
406
|
compareItems,
|
|
407
407
|
locale
|
|
408
408
|
}).map((item, index$1) => {
|
|
@@ -412,7 +412,7 @@ const FilterableMultiSelect = /*#__PURE__*/React__default["default"].forwardRef(
|
|
|
412
412
|
disabled: item.disabled,
|
|
413
413
|
['aria-selected']: isChecked
|
|
414
414
|
});
|
|
415
|
-
const itemText = itemToString(item);
|
|
415
|
+
const itemText = itemToString$1(item);
|
|
416
416
|
return /*#__PURE__*/React__default["default"].createElement(index["default"].MenuItem, _rollupPluginBabelHelpers["extends"]({
|
|
417
417
|
key: itemProps.id,
|
|
418
418
|
"aria-label": itemText,
|
|
@@ -564,20 +564,6 @@ FilterableMultiSelect.propTypes = {
|
|
|
564
564
|
*/
|
|
565
565
|
warnText: PropTypes__default["default"].node
|
|
566
566
|
};
|
|
567
|
-
FilterableMultiSelect.defaultProps = {
|
|
568
|
-
compareItems: sorting.defaultCompareItems,
|
|
569
|
-
direction: 'bottom',
|
|
570
|
-
disabled: false,
|
|
571
|
-
filterItems: filter.defaultFilterItems,
|
|
572
|
-
initialSelectedItems: [],
|
|
573
|
-
itemToString: itemToString.defaultItemToString,
|
|
574
|
-
locale: 'en',
|
|
575
|
-
sortItems: sorting.defaultSortItems,
|
|
576
|
-
open: false,
|
|
577
|
-
selectionFeedback: 'top-after-reopen',
|
|
578
|
-
clearSelectionText: 'To clear selection, press Delete or Backspace,',
|
|
579
|
-
clearSelectionDescription: 'Total items selected: '
|
|
580
|
-
};
|
|
581
567
|
var FilterableMultiSelect$1 = FilterableMultiSelect;
|
|
582
568
|
|
|
583
569
|
exports["default"] = FilterableMultiSelect$1;
|
|
@@ -26,6 +26,7 @@ var deprecate = require('../../prop-types/deprecate.js');
|
|
|
26
26
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
27
27
|
require('../FluidForm/FluidForm.js');
|
|
28
28
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
29
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
29
30
|
var match = require('../../internal/keyboard/match.js');
|
|
30
31
|
var ListBoxPropTypes = require('../ListBox/ListBoxPropTypes.js');
|
|
31
32
|
var keys = require('../../internal/keyboard/keys.js');
|
|
@@ -37,7 +38,6 @@ var isEqual__default = /*#__PURE__*/_interopDefaultLegacy(isEqual);
|
|
|
37
38
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
38
39
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
39
40
|
|
|
40
|
-
const noop = () => {};
|
|
41
41
|
const getInstanceId = setupGetInstanceId["default"]();
|
|
42
42
|
const {
|
|
43
43
|
ItemClick,
|
|
@@ -71,18 +71,18 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
71
71
|
items,
|
|
72
72
|
itemToElement,
|
|
73
73
|
itemToString = defaultItemToString,
|
|
74
|
-
titleText,
|
|
74
|
+
titleText = false,
|
|
75
75
|
hideLabel,
|
|
76
76
|
helperText,
|
|
77
77
|
label,
|
|
78
|
-
type,
|
|
78
|
+
type = 'default',
|
|
79
79
|
size,
|
|
80
|
-
disabled,
|
|
81
|
-
initialSelectedItems,
|
|
82
|
-
sortItems,
|
|
83
|
-
compareItems,
|
|
84
|
-
clearSelectionText,
|
|
85
|
-
clearSelectionDescription,
|
|
80
|
+
disabled = false,
|
|
81
|
+
initialSelectedItems = [],
|
|
82
|
+
sortItems = sorting.defaultSortItems,
|
|
83
|
+
compareItems = sorting.defaultCompareItems,
|
|
84
|
+
clearSelectionText = 'To clear selection, press Delete or Backspace',
|
|
85
|
+
clearSelectionDescription = 'Total items selected: ',
|
|
86
86
|
light,
|
|
87
87
|
invalid,
|
|
88
88
|
invalidText,
|
|
@@ -91,14 +91,14 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
91
91
|
useTitleInItem,
|
|
92
92
|
translateWithId,
|
|
93
93
|
downshiftProps,
|
|
94
|
-
open,
|
|
95
|
-
selectionFeedback,
|
|
94
|
+
open = false,
|
|
95
|
+
selectionFeedback = 'top-after-reopen',
|
|
96
96
|
onChange,
|
|
97
97
|
onMenuChange,
|
|
98
|
-
direction,
|
|
98
|
+
direction = 'bottom',
|
|
99
99
|
selectedItems: selected,
|
|
100
100
|
readOnly,
|
|
101
|
-
locale
|
|
101
|
+
locale = 'en'
|
|
102
102
|
} = _ref;
|
|
103
103
|
const prefix = usePrefix.usePrefix();
|
|
104
104
|
const {
|
|
@@ -332,7 +332,7 @@ const MultiSelect = /*#__PURE__*/React__default["default"].forwardRef((_ref, ref
|
|
|
332
332
|
className: multiSelectFieldWrapperClasses
|
|
333
333
|
}, selectedItems.length > 0 && /*#__PURE__*/React__default["default"].createElement(index["default"].Selection, {
|
|
334
334
|
readOnly: readOnly,
|
|
335
|
-
clearSelection: !disabled && !readOnly ? clearSelection :
|
|
335
|
+
clearSelection: !disabled && !readOnly ? clearSelection : noopFn.noopFn,
|
|
336
336
|
selectionCount: selectedItems.length
|
|
337
337
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
338
338
|
,
|
|
@@ -405,7 +405,7 @@ MultiSelect.propTypes = {
|
|
|
405
405
|
* Provide a compare function that is used to determine the ordering of
|
|
406
406
|
* options. See 'sortItems' for more control.
|
|
407
407
|
*/
|
|
408
|
-
compareItems: PropTypes__default["default"].func
|
|
408
|
+
compareItems: PropTypes__default["default"].func,
|
|
409
409
|
/**
|
|
410
410
|
* Specify the direction of the multiselect dropdown. Can be either top or bottom.
|
|
411
411
|
*/
|
|
@@ -527,7 +527,7 @@ MultiSelect.propTypes = {
|
|
|
527
527
|
* locale: string,
|
|
528
528
|
* }) => Array<Item>
|
|
529
529
|
*/
|
|
530
|
-
sortItems: PropTypes__default["default"].func
|
|
530
|
+
sortItems: PropTypes__default["default"].func,
|
|
531
531
|
/**
|
|
532
532
|
* Provide text to be used in a `<label>` element that is tied to the
|
|
533
533
|
* multiselect via ARIA attributes.
|
|
@@ -554,22 +554,6 @@ MultiSelect.propTypes = {
|
|
|
554
554
|
*/
|
|
555
555
|
warnText: PropTypes__default["default"].node
|
|
556
556
|
};
|
|
557
|
-
MultiSelect.defaultProps = {
|
|
558
|
-
compareItems: sorting.defaultCompareItems,
|
|
559
|
-
disabled: false,
|
|
560
|
-
locale: 'en',
|
|
561
|
-
itemToString: defaultItemToString,
|
|
562
|
-
initialSelectedItems: [],
|
|
563
|
-
sortItems: sorting.defaultSortItems,
|
|
564
|
-
type: 'default',
|
|
565
|
-
titleText: false,
|
|
566
|
-
open: false,
|
|
567
|
-
selectionFeedback: 'top-after-reopen',
|
|
568
|
-
direction: 'bottom',
|
|
569
|
-
clearSelectionText: 'To clear selection, press Delete or Backspace,',
|
|
570
|
-
clearSelectionDescription: 'Total items selected: ',
|
|
571
|
-
selectedItems: undefined
|
|
572
|
-
};
|
|
573
557
|
var MultiSelect$1 = MultiSelect;
|
|
574
558
|
|
|
575
559
|
exports["default"] = MultiSelect$1;
|
|
@@ -23,7 +23,7 @@ const sortingPropTypes = {
|
|
|
23
23
|
* compareFunction :
|
|
24
24
|
* (itemA: string, itemB: string, { locale: string }) => number
|
|
25
25
|
*/
|
|
26
|
-
compareItems: PropTypes__default["default"].func
|
|
26
|
+
compareItems: PropTypes__default["default"].func,
|
|
27
27
|
/**
|
|
28
28
|
* Provide a method that sorts all options in the control. Overriding this
|
|
29
29
|
* prop means that you also have to handle the sort logic for selected versus
|
|
@@ -42,7 +42,7 @@ const sortingPropTypes = {
|
|
|
42
42
|
* locale: string,
|
|
43
43
|
* }) => Array<Item>
|
|
44
44
|
*/
|
|
45
|
-
sortItems: PropTypes__default["default"].func
|
|
45
|
+
sortItems: PropTypes__default["default"].func
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
exports.sortingPropTypes = sortingPropTypes;
|
|
@@ -13,8 +13,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
13
13
|
* Use the local `localCompare` with the `numeric` option to sort two,
|
|
14
14
|
* potentially alpha-numeric, strings in a list of items.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
16
|
+
* @param {ItemType} itemA
|
|
17
|
+
* @param {ItemType} itemB
|
|
18
18
|
* @param {object} options
|
|
19
19
|
* @param {string} options.locale
|
|
20
20
|
* @returns {number}
|
|
@@ -51,6 +51,16 @@ export declare namespace NotificationActionButton {
|
|
|
51
51
|
* ==================
|
|
52
52
|
*/
|
|
53
53
|
export interface NotificationButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
54
|
+
/**
|
|
55
|
+
* Specify a label to be read by screen readers on the container node
|
|
56
|
+
* 'aria-label' of the NotificationButton component.
|
|
57
|
+
*/
|
|
58
|
+
['aria-label']?: string;
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated please use `aria-label` instead.
|
|
61
|
+
* 'aria-label' of the NotificationButton component.
|
|
62
|
+
*/
|
|
63
|
+
ariaLabel?: string;
|
|
54
64
|
/**
|
|
55
65
|
* Specify an optional icon for the Button through a string,
|
|
56
66
|
* if provided. However, regular "close" icon is preferred.
|
|
@@ -107,12 +117,6 @@ export declare namespace NotificationButton {
|
|
|
107
117
|
*/
|
|
108
118
|
type: PropTypes.Requireable<string>;
|
|
109
119
|
};
|
|
110
|
-
var defaultProps: {
|
|
111
|
-
"aria-label": string;
|
|
112
|
-
notificationType: string;
|
|
113
|
-
type: string;
|
|
114
|
-
renderIcon: any;
|
|
115
|
-
};
|
|
116
120
|
}
|
|
117
121
|
export interface NotificationIconProps {
|
|
118
122
|
iconDescription: string;
|
|
@@ -248,13 +252,6 @@ export declare namespace ToastNotification {
|
|
|
248
252
|
*/
|
|
249
253
|
title: PropTypes.Requireable<string>;
|
|
250
254
|
};
|
|
251
|
-
var defaultProps: {
|
|
252
|
-
kind: string;
|
|
253
|
-
role: string;
|
|
254
|
-
onCloseButtonClick: () => void;
|
|
255
|
-
hideCloseButton: boolean;
|
|
256
|
-
timeout: number;
|
|
257
|
-
};
|
|
258
255
|
}
|
|
259
256
|
/**
|
|
260
257
|
* InlineNotification
|
|
@@ -364,12 +361,6 @@ export declare namespace InlineNotification {
|
|
|
364
361
|
*/
|
|
365
362
|
title: PropTypes.Requireable<string>;
|
|
366
363
|
};
|
|
367
|
-
var defaultProps: {
|
|
368
|
-
kind: string;
|
|
369
|
-
role: string;
|
|
370
|
-
onCloseButtonClick: () => void;
|
|
371
|
-
hideCloseButton: boolean;
|
|
372
|
-
};
|
|
373
364
|
}
|
|
374
365
|
/**
|
|
375
366
|
* ActionableNotification
|
|
@@ -484,7 +475,7 @@ export declare namespace ActionableNotification {
|
|
|
484
475
|
/**
|
|
485
476
|
* Specify what state the notification represents
|
|
486
477
|
*/
|
|
487
|
-
kind: PropTypes.
|
|
478
|
+
kind: PropTypes.Requireable<string>;
|
|
488
479
|
/**
|
|
489
480
|
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
490
481
|
*/
|
|
@@ -519,13 +510,4 @@ export declare namespace ActionableNotification {
|
|
|
519
510
|
*/
|
|
520
511
|
title: PropTypes.Requireable<string>;
|
|
521
512
|
};
|
|
522
|
-
var defaultProps: {
|
|
523
|
-
kind: string;
|
|
524
|
-
role: string;
|
|
525
|
-
onCloseButtonClick: () => void;
|
|
526
|
-
hideCloseButton: boolean;
|
|
527
|
-
hasFocus: boolean;
|
|
528
|
-
closeOnEscape: boolean;
|
|
529
|
-
inline: boolean;
|
|
530
|
-
};
|
|
531
513
|
}
|
|
@@ -15,12 +15,15 @@ var React = require('react');
|
|
|
15
15
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
16
16
|
var cx = require('classnames');
|
|
17
17
|
var iconsReact = require('@carbon/icons-react');
|
|
18
|
+
require('../Text/index.js');
|
|
18
19
|
var Button = require('../Button/Button.js');
|
|
19
20
|
require('../Button/Button.Skeleton.js');
|
|
20
21
|
var useIsomorphicEffect = require('../../internal/useIsomorphicEffect.js');
|
|
21
22
|
var useNoInteractiveChildren = require('../../internal/useNoInteractiveChildren.js');
|
|
22
23
|
var usePrefix = require('../../internal/usePrefix.js');
|
|
23
24
|
var useId = require('../../internal/useId.js');
|
|
25
|
+
var noopFn = require('../../internal/noopFn.js');
|
|
26
|
+
var Text = require('../Text/Text.js');
|
|
24
27
|
var match = require('../../internal/keyboard/match.js');
|
|
25
28
|
var keys = require('../../internal/keyboard/keys.js');
|
|
26
29
|
|
|
@@ -95,14 +98,13 @@ NotificationActionButton.propTypes = {
|
|
|
95
98
|
|
|
96
99
|
function NotificationButton(_ref2) {
|
|
97
100
|
let {
|
|
98
|
-
'aria-label': ariaLabel,
|
|
99
|
-
// @ts-expect-error: deprecated prop
|
|
101
|
+
'aria-label': ariaLabel = 'close notification',
|
|
100
102
|
ariaLabel: deprecatedAriaLabel,
|
|
101
103
|
className,
|
|
102
|
-
type,
|
|
103
|
-
renderIcon: IconTag,
|
|
104
|
+
type = 'button',
|
|
105
|
+
renderIcon: IconTag = iconsReact.Close,
|
|
104
106
|
name,
|
|
105
|
-
notificationType,
|
|
107
|
+
notificationType = 'toast',
|
|
106
108
|
...rest
|
|
107
109
|
} = _ref2;
|
|
108
110
|
const prefix = usePrefix.usePrefix();
|
|
@@ -156,12 +158,6 @@ NotificationButton.propTypes = {
|
|
|
156
158
|
*/
|
|
157
159
|
type: PropTypes__default["default"].string
|
|
158
160
|
};
|
|
159
|
-
NotificationButton.defaultProps = {
|
|
160
|
-
['aria-label']: 'close notification',
|
|
161
|
-
notificationType: 'toast',
|
|
162
|
-
type: 'button',
|
|
163
|
-
renderIcon: iconsReact.Close
|
|
164
|
-
};
|
|
165
161
|
|
|
166
162
|
/**
|
|
167
163
|
* NotificationIcon
|
|
@@ -208,16 +204,16 @@ function ToastNotification(_ref4) {
|
|
|
208
204
|
['aria-label']: ariaLabel,
|
|
209
205
|
// @ts-expect-error: deprecated prop
|
|
210
206
|
ariaLabel: deprecatedAriaLabel,
|
|
211
|
-
role,
|
|
207
|
+
role = 'status',
|
|
212
208
|
onClose,
|
|
213
|
-
onCloseButtonClick,
|
|
209
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
214
210
|
statusIconDescription,
|
|
215
211
|
className,
|
|
216
212
|
children,
|
|
217
|
-
kind,
|
|
213
|
+
kind = 'error',
|
|
218
214
|
lowContrast,
|
|
219
|
-
hideCloseButton,
|
|
220
|
-
timeout,
|
|
215
|
+
hideCloseButton = false,
|
|
216
|
+
timeout = 0,
|
|
221
217
|
title,
|
|
222
218
|
caption,
|
|
223
219
|
subtitle,
|
|
@@ -275,11 +271,14 @@ function ToastNotification(_ref4) {
|
|
|
275
271
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
276
272
|
ref: contentRef,
|
|
277
273
|
className: `${prefix}--toast-notification__details`
|
|
278
|
-
}, title && /*#__PURE__*/React__default["default"].createElement(
|
|
274
|
+
}, title && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
275
|
+
as: "div",
|
|
279
276
|
className: `${prefix}--toast-notification__title`
|
|
280
|
-
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(
|
|
277
|
+
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
278
|
+
as: "div",
|
|
281
279
|
className: `${prefix}--toast-notification__subtitle`
|
|
282
|
-
}, subtitle), caption && /*#__PURE__*/React__default["default"].createElement(
|
|
280
|
+
}, subtitle), caption && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
281
|
+
as: "div",
|
|
283
282
|
className: `${prefix}--toast-notification__caption`
|
|
284
283
|
}, caption), children), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
285
284
|
notificationType: "toast",
|
|
@@ -353,13 +352,6 @@ ToastNotification.propTypes = {
|
|
|
353
352
|
*/
|
|
354
353
|
title: PropTypes__default["default"].string
|
|
355
354
|
};
|
|
356
|
-
ToastNotification.defaultProps = {
|
|
357
|
-
kind: 'error',
|
|
358
|
-
role: 'status',
|
|
359
|
-
onCloseButtonClick: () => {},
|
|
360
|
-
hideCloseButton: false,
|
|
361
|
-
timeout: 0
|
|
362
|
-
};
|
|
363
355
|
|
|
364
356
|
/**
|
|
365
357
|
* InlineNotification
|
|
@@ -372,14 +364,14 @@ function InlineNotification(_ref5) {
|
|
|
372
364
|
children,
|
|
373
365
|
title,
|
|
374
366
|
subtitle,
|
|
375
|
-
role,
|
|
367
|
+
role = 'status',
|
|
376
368
|
onClose,
|
|
377
|
-
onCloseButtonClick,
|
|
369
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
378
370
|
statusIconDescription,
|
|
379
371
|
className,
|
|
380
|
-
kind,
|
|
372
|
+
kind = 'error',
|
|
381
373
|
lowContrast,
|
|
382
|
-
hideCloseButton,
|
|
374
|
+
hideCloseButton = false,
|
|
383
375
|
...rest
|
|
384
376
|
} = _ref5;
|
|
385
377
|
const [isOpen, setIsOpen] = React.useState(true);
|
|
@@ -419,9 +411,11 @@ function InlineNotification(_ref5) {
|
|
|
419
411
|
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
420
412
|
ref: contentRef,
|
|
421
413
|
className: `${prefix}--inline-notification__text-wrapper`
|
|
422
|
-
}, title && /*#__PURE__*/React__default["default"].createElement(
|
|
414
|
+
}, title && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
415
|
+
as: "div",
|
|
423
416
|
className: `${prefix}--inline-notification__title`
|
|
424
|
-
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(
|
|
417
|
+
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
418
|
+
as: "div",
|
|
425
419
|
className: `${prefix}--inline-notification__subtitle`
|
|
426
420
|
}, subtitle), children)), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
427
421
|
notificationType: "inline",
|
|
@@ -482,12 +476,6 @@ InlineNotification.propTypes = {
|
|
|
482
476
|
*/
|
|
483
477
|
title: PropTypes__default["default"].string
|
|
484
478
|
};
|
|
485
|
-
InlineNotification.defaultProps = {
|
|
486
|
-
kind: 'error',
|
|
487
|
-
role: 'status',
|
|
488
|
-
onCloseButtonClick: () => {},
|
|
489
|
-
hideCloseButton: false
|
|
490
|
-
};
|
|
491
479
|
|
|
492
480
|
/**
|
|
493
481
|
* ActionableNotification
|
|
@@ -501,18 +489,18 @@ function ActionableNotification(_ref6) {
|
|
|
501
489
|
// @ts-expect-error: deprecated prop
|
|
502
490
|
ariaLabel: deprecatedAriaLabel,
|
|
503
491
|
children,
|
|
504
|
-
role,
|
|
492
|
+
role = 'alertdialog',
|
|
505
493
|
onActionButtonClick,
|
|
506
494
|
onClose,
|
|
507
|
-
onCloseButtonClick,
|
|
495
|
+
onCloseButtonClick = noopFn.noopFn,
|
|
508
496
|
statusIconDescription,
|
|
509
497
|
className,
|
|
510
|
-
inline,
|
|
511
|
-
kind,
|
|
498
|
+
inline = false,
|
|
499
|
+
kind = 'error',
|
|
512
500
|
lowContrast,
|
|
513
|
-
hideCloseButton,
|
|
514
|
-
hasFocus,
|
|
515
|
-
closeOnEscape,
|
|
501
|
+
hideCloseButton = false,
|
|
502
|
+
hasFocus = true,
|
|
503
|
+
closeOnEscape = true,
|
|
516
504
|
title,
|
|
517
505
|
subtitle,
|
|
518
506
|
...rest
|
|
@@ -562,10 +550,12 @@ function ActionableNotification(_ref6) {
|
|
|
562
550
|
className: `${prefix}--actionable-notification__text-wrapper`
|
|
563
551
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
564
552
|
className: `${prefix}--actionable-notification__content`
|
|
565
|
-
}, title && /*#__PURE__*/React__default["default"].createElement(
|
|
553
|
+
}, title && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
554
|
+
as: "div",
|
|
566
555
|
className: `${prefix}--actionable-notification__title`,
|
|
567
556
|
id: id
|
|
568
|
-
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(
|
|
557
|
+
}, title), subtitle && /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
558
|
+
as: "div",
|
|
569
559
|
className: `${prefix}--actionable-notification__subtitle`,
|
|
570
560
|
id: subtitleId
|
|
571
561
|
}, subtitle), children))), actionButtonLabel && /*#__PURE__*/React__default["default"].createElement(NotificationActionButton, {
|
|
@@ -618,7 +608,7 @@ ActionableNotification.propTypes = {
|
|
|
618
608
|
/**
|
|
619
609
|
* Specify what state the notification represents
|
|
620
610
|
*/
|
|
621
|
-
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt'])
|
|
611
|
+
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
622
612
|
/**
|
|
623
613
|
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
624
614
|
*/
|
|
@@ -653,15 +643,6 @@ ActionableNotification.propTypes = {
|
|
|
653
643
|
*/
|
|
654
644
|
title: PropTypes__default["default"].string
|
|
655
645
|
};
|
|
656
|
-
ActionableNotification.defaultProps = {
|
|
657
|
-
kind: 'error',
|
|
658
|
-
role: 'alertdialog',
|
|
659
|
-
onCloseButtonClick: () => {},
|
|
660
|
-
hideCloseButton: false,
|
|
661
|
-
hasFocus: true,
|
|
662
|
-
closeOnEscape: true,
|
|
663
|
-
inline: false
|
|
664
|
-
};
|
|
665
646
|
|
|
666
647
|
exports.ActionableNotification = ActionableNotification;
|
|
667
648
|
exports.InlineNotification = InlineNotification;
|
|
@@ -20,6 +20,8 @@ var usePrefix = require('../../internal/usePrefix.js');
|
|
|
20
20
|
var deprecate = require('../../prop-types/deprecate.js');
|
|
21
21
|
require('../FluidForm/FluidForm.js');
|
|
22
22
|
var FormContext = require('../FluidForm/FormContext.js');
|
|
23
|
+
require('../Text/index.js');
|
|
24
|
+
var Text = require('../Text/Text.js');
|
|
23
25
|
|
|
24
26
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
27
|
|
|
@@ -381,7 +383,8 @@ function Label(_ref) {
|
|
|
381
383
|
[`${prefix}--visually-hidden`]: hideLabel
|
|
382
384
|
});
|
|
383
385
|
if (label) {
|
|
384
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
386
|
+
return /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
387
|
+
as: "label",
|
|
385
388
|
htmlFor: id,
|
|
386
389
|
className: className
|
|
387
390
|
}, label);
|
|
@@ -405,7 +408,8 @@ function HelperText(_ref2) {
|
|
|
405
408
|
[`${prefix}--form__helper-text--disabled`]: disabled
|
|
406
409
|
});
|
|
407
410
|
if (description) {
|
|
408
|
-
return /*#__PURE__*/React__default["default"].createElement(
|
|
411
|
+
return /*#__PURE__*/React__default["default"].createElement(Text.Text, {
|
|
412
|
+
as: "div",
|
|
409
413
|
id: id,
|
|
410
414
|
className: className
|
|
411
415
|
}, description);
|