@carbon/react 1.24.0 → 1.25.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/es/components/CodeSnippet/CodeSnippet.js +13 -115
- package/es/components/ComboBox/ComboBox.d.ts +6 -0
- package/es/components/ComboBox/ComboBox.js +19 -172
- package/es/components/ComboButton/index.js +164 -0
- package/es/components/ComposedModal/ComposedModal.js +1 -2
- package/es/components/DataTable/TableToolbar.d.ts +19 -0
- package/es/components/DataTable/TableToolbar.js +1 -1
- package/es/components/DataTable/TableToolbarAction.d.ts +21 -0
- package/es/components/DataTable/TableToolbarContent.d.ts +21 -0
- package/es/components/DataTable/TableToolbarMenu.d.ts +24 -0
- package/es/components/DataTable/TableToolbarMenu.js +3 -3
- package/es/components/DataTable/tools/sorting.js +2 -1
- package/es/components/DataTableSkeleton/DataTableSkeleton.d.ts +107 -0
- package/es/components/Dropdown/Dropdown.d.ts +6 -0
- package/es/components/Dropdown/Dropdown.js +8 -145
- package/es/components/FileUploader/FileUploader.js +1 -1
- package/es/components/FileUploader/FileUploaderDropContainer.js +30 -18
- package/es/components/FileUploader/FileUploaderItem.js +2 -1
- package/es/components/FileUploader/Filename.js +8 -2
- package/es/components/FluidTextArea/FluidTextArea.js +12 -1
- package/es/components/IconButton/index.js +1 -0
- package/es/components/ListBox/ListBoxSelection.js +4 -23
- package/es/components/ListBox/next/ListBoxSelection.js +2 -23
- package/es/components/Menu/Menu.js +50 -29
- package/es/components/Menu/MenuItem.js +1 -0
- package/es/components/MenuButton/index.js +127 -0
- package/es/components/Modal/Modal.js +4 -3
- package/es/components/MultiSelect/FilterableMultiSelect.js +31 -137
- package/es/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/es/components/MultiSelect/MultiSelect.js +48 -26
- package/es/components/Notification/Notification.js +27 -264
- package/es/components/OverflowMenu/OverflowMenu.js +13 -139
- package/es/components/OverflowMenuItem/OverflowMenuItem.d.ts +58 -0
- package/es/components/OverflowMenuItem/OverflowMenuItem.js +12 -7
- package/es/components/OverflowMenuV2/index.js +15 -51
- package/es/components/Popover/index.d.ts +5 -1
- package/es/components/Popover/index.js +37 -9
- package/es/components/RadioButtonGroup/RadioButtonGroup.js +7 -4
- package/es/components/RadioTile/RadioTile.js +6 -6
- package/es/components/Select/Select.d.ts +89 -0
- package/es/components/SelectItem/SelectItem.d.ts +62 -0
- package/es/components/SelectItem/SelectItem.js +2 -4
- package/es/components/SelectItemGroup/SelectItemGroup.d.ts +52 -0
- package/es/components/SkeletonText/SkeletonText.js +1 -1
- package/es/components/StructuredList/StructuredList.js +10 -38
- package/es/components/Tabs/Tabs.js +3 -1
- package/es/components/TextArea/TextArea.Skeleton.d.ts +33 -0
- package/es/components/TextArea/TextArea.Skeleton.js +5 -5
- package/es/components/TextArea/TextArea.d.ts +9 -2
- package/es/components/TextArea/TextArea.js +31 -8
- package/es/components/TextArea/index.js +1 -0
- package/es/components/Toggle/Toggle.js +8 -19
- package/es/components/Tooltip/DefinitionTooltip.d.ts +52 -0
- package/es/components/Tooltip/DefinitionTooltip.js +2 -2
- package/es/components/Tooltip/Tooltip.d.ts +117 -0
- package/es/components/Tooltip/Tooltip.js +6 -4
- package/es/components/Tooltip/index.d.ts +9 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +5 -3
- package/es/internal/ClickListener.js +1 -2
- package/es/internal/keyboard/match.js +1 -1
- package/es/internal/useAttachedMenu.js +85 -0
- package/es/internal/useDelayedState.d.ts +19 -0
- package/es/internal/useDelayedState.js +7 -3
- package/es/internal/useId.js +1 -1
- package/lib/components/CodeSnippet/CodeSnippet.js +13 -115
- package/lib/components/ComboBox/ComboBox.d.ts +6 -0
- package/lib/components/ComboBox/ComboBox.js +18 -171
- package/lib/components/ComboButton/index.js +174 -0
- package/lib/components/ComposedModal/ComposedModal.js +1 -2
- package/lib/components/DataTable/TableToolbar.d.ts +19 -0
- package/lib/components/DataTable/TableToolbar.js +1 -1
- package/lib/components/DataTable/TableToolbarAction.d.ts +21 -0
- package/lib/components/DataTable/TableToolbarContent.d.ts +21 -0
- package/lib/components/DataTable/TableToolbarMenu.d.ts +24 -0
- package/lib/components/DataTable/TableToolbarMenu.js +3 -3
- package/lib/components/DataTable/tools/sorting.js +2 -1
- package/lib/components/DataTableSkeleton/DataTableSkeleton.d.ts +107 -0
- package/lib/components/Dropdown/Dropdown.d.ts +6 -0
- package/lib/components/Dropdown/Dropdown.js +7 -144
- package/lib/components/FileUploader/FileUploader.js +1 -1
- package/lib/components/FileUploader/FileUploaderDropContainer.js +30 -18
- package/lib/components/FileUploader/FileUploaderItem.js +2 -1
- package/lib/components/FileUploader/Filename.js +8 -2
- package/lib/components/FluidTextArea/FluidTextArea.js +12 -1
- package/lib/components/IconButton/index.js +1 -0
- package/lib/components/ListBox/ListBoxSelection.js +4 -23
- package/lib/components/ListBox/next/ListBoxSelection.js +2 -23
- package/lib/components/Menu/Menu.js +50 -29
- package/lib/components/Menu/MenuItem.js +1 -0
- package/lib/components/MenuButton/index.js +137 -0
- package/lib/components/Modal/Modal.js +4 -3
- package/lib/components/MultiSelect/FilterableMultiSelect.js +29 -135
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelect.js +47 -25
- package/lib/components/Notification/Notification.js +27 -264
- package/lib/components/OverflowMenu/OverflowMenu.js +13 -139
- package/lib/components/OverflowMenuItem/OverflowMenuItem.d.ts +58 -0
- package/lib/components/OverflowMenuItem/OverflowMenuItem.js +12 -7
- package/lib/components/OverflowMenuV2/index.js +13 -49
- package/lib/components/Popover/index.d.ts +5 -1
- package/lib/components/Popover/index.js +37 -9
- package/lib/components/RadioButtonGroup/RadioButtonGroup.js +6 -3
- package/lib/components/RadioTile/RadioTile.js +6 -6
- package/lib/components/Select/Select.d.ts +89 -0
- package/lib/components/SelectItem/SelectItem.d.ts +62 -0
- package/lib/components/SelectItem/SelectItem.js +1 -3
- package/lib/components/SelectItemGroup/SelectItemGroup.d.ts +52 -0
- package/lib/components/SkeletonText/SkeletonText.js +1 -1
- package/lib/components/StructuredList/StructuredList.js +10 -38
- package/lib/components/Tabs/Tabs.js +3 -1
- package/lib/components/TextArea/TextArea.Skeleton.d.ts +33 -0
- package/lib/components/TextArea/TextArea.Skeleton.js +5 -5
- package/lib/components/TextArea/TextArea.d.ts +9 -2
- package/lib/components/TextArea/TextArea.js +30 -7
- package/lib/components/TextArea/index.js +2 -0
- package/lib/components/Toggle/Toggle.js +8 -19
- package/lib/components/Tooltip/DefinitionTooltip.d.ts +52 -0
- package/lib/components/Tooltip/DefinitionTooltip.js +2 -2
- package/lib/components/Tooltip/Tooltip.d.ts +117 -0
- package/lib/components/Tooltip/Tooltip.js +6 -4
- package/lib/components/Tooltip/index.d.ts +9 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +50 -46
- package/lib/internal/ClickListener.js +1 -2
- package/lib/internal/keyboard/match.js +1 -1
- package/lib/internal/useAttachedMenu.js +89 -0
- package/lib/internal/useDelayedState.d.ts +19 -0
- package/lib/internal/useDelayedState.js +7 -3
- package/lib/internal/useId.js +1 -1
- package/package.json +3 -3
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
12
12
|
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
13
13
|
var PropTypes = require('prop-types');
|
|
14
14
|
var React = require('react');
|
|
15
|
+
var deprecate = require('../../prop-types/deprecate.js');
|
|
15
16
|
var cx = require('classnames');
|
|
16
17
|
var iconsReact = require('@carbon/icons-react');
|
|
17
18
|
var Button = require('../Button/Button.js');
|
|
@@ -28,13 +29,13 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
28
29
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
29
30
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
30
31
|
|
|
31
|
-
var _iconTypes;
|
|
32
|
+
var _NotificationButton$p, _NotificationButton$d, _iconTypes, _ToastNotification$pr, _InlineNotification$p, _ActionableNotificati;
|
|
32
33
|
|
|
33
34
|
var _excluded = ["children", "className", "onClick", "inline"],
|
|
34
|
-
_excluded2 = ["ariaLabel", "className", "type", "renderIcon", "name", "notificationType"],
|
|
35
|
-
_excluded3 = ["role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "children", "kind", "lowContrast", "hideCloseButton", "timeout", "title", "caption", "subtitle"],
|
|
36
|
-
_excluded4 = ["children", "title", "subtitle", "role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "kind", "lowContrast", "hideCloseButton"],
|
|
37
|
-
_excluded5 = ["actionButtonLabel", "ariaLabel", "children", "role", "onActionButtonClick", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "inline", "kind", "lowContrast", "hideCloseButton", "hasFocus", "closeOnEscape", "title", "subtitle"];
|
|
35
|
+
_excluded2 = ["aria-label", "ariaLabel", "className", "type", "renderIcon", "name", "notificationType"],
|
|
36
|
+
_excluded3 = ["aria-label", "ariaLabel", "role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "children", "kind", "lowContrast", "hideCloseButton", "timeout", "title", "caption", "subtitle"],
|
|
37
|
+
_excluded4 = ["aria-label", "children", "title", "subtitle", "role", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "kind", "lowContrast", "hideCloseButton"],
|
|
38
|
+
_excluded5 = ["actionButtonLabel", "aria-label", "ariaLabel", "children", "role", "onActionButtonClick", "onClose", "onCloseButtonClick", "statusIconDescription", "className", "inline", "kind", "lowContrast", "hideCloseButton", "hasFocus", "closeOnEscape", "title", "subtitle"];
|
|
38
39
|
/**
|
|
39
40
|
* Conditionally call a callback when the escape key is pressed
|
|
40
41
|
* @param {node} ref - ref of the container element to scope the functionality to
|
|
@@ -100,7 +101,8 @@ NotificationActionButton.propTypes = {
|
|
|
100
101
|
onClick: PropTypes__default["default"].func
|
|
101
102
|
};
|
|
102
103
|
function NotificationButton(_ref2) {
|
|
103
|
-
var ariaLabel = _ref2
|
|
104
|
+
var ariaLabel = _ref2['aria-label'],
|
|
105
|
+
deprecatedAriaLabel = _ref2.ariaLabel,
|
|
104
106
|
className = _ref2.className,
|
|
105
107
|
type = _ref2.type,
|
|
106
108
|
IconTag = _ref2.renderIcon,
|
|
@@ -114,53 +116,16 @@ function NotificationButton(_ref2) {
|
|
|
114
116
|
return /*#__PURE__*/React__default["default"].createElement("button", _rollupPluginBabelHelpers["extends"]({}, rest, {
|
|
115
117
|
// eslint-disable-next-line react/button-has-type
|
|
116
118
|
type: type,
|
|
117
|
-
"aria-label": ariaLabel,
|
|
118
|
-
title: ariaLabel,
|
|
119
|
+
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
120
|
+
title: deprecatedAriaLabel || ariaLabel,
|
|
119
121
|
className: buttonClassName
|
|
120
122
|
}), IconTag && /*#__PURE__*/React__default["default"].createElement(IconTag, {
|
|
121
123
|
className: iconClassName,
|
|
122
124
|
name: name
|
|
123
125
|
}));
|
|
124
126
|
}
|
|
125
|
-
NotificationButton.propTypes = {
|
|
126
|
-
|
|
127
|
-
* Specify a label to be read by screen readers on the notification button
|
|
128
|
-
*/
|
|
129
|
-
ariaLabel: PropTypes__default["default"].string,
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Specify an optional className to be applied to the notification button
|
|
133
|
-
*/
|
|
134
|
-
className: PropTypes__default["default"].string,
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Specify an optional icon for the Button through a string,
|
|
138
|
-
* if something but regular "close" icon is desirable
|
|
139
|
-
*/
|
|
140
|
-
name: PropTypes__default["default"].string,
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* Specify the notification type
|
|
144
|
-
*/
|
|
145
|
-
notificationType: PropTypes__default["default"].oneOf(['toast', 'inline', 'actionable']),
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Optional prop to allow overriding the icon rendering.
|
|
149
|
-
* Can be a React component class
|
|
150
|
-
*/
|
|
151
|
-
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Optional prop to specify the type of the Button
|
|
155
|
-
*/
|
|
156
|
-
type: PropTypes__default["default"].string
|
|
157
|
-
};
|
|
158
|
-
NotificationButton.defaultProps = {
|
|
159
|
-
ariaLabel: 'close notification',
|
|
160
|
-
notificationType: 'toast',
|
|
161
|
-
type: 'button',
|
|
162
|
-
renderIcon: iconsReact.Close
|
|
163
|
-
};
|
|
127
|
+
NotificationButton.propTypes = (_NotificationButton$p = {}, _rollupPluginBabelHelpers.defineProperty(_NotificationButton$p, 'aria-label', PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$p, "ariaLabel", deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.')), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$p, "className", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$p, "name", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$p, "notificationType", PropTypes__default["default"].oneOf(['toast', 'inline', 'actionable'])), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$p, "renderIcon", PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object])), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$p, "type", PropTypes__default["default"].string), _NotificationButton$p);
|
|
128
|
+
NotificationButton.defaultProps = (_NotificationButton$d = {}, _rollupPluginBabelHelpers.defineProperty(_NotificationButton$d, 'aria-label', 'close notification'), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$d, "notificationType", 'toast'), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$d, "type", 'button'), _rollupPluginBabelHelpers.defineProperty(_NotificationButton$d, "renderIcon", iconsReact.Close), _NotificationButton$d);
|
|
164
129
|
var iconTypes = (_iconTypes = {
|
|
165
130
|
error: iconsReact.ErrorFilled,
|
|
166
131
|
success: iconsReact.CheckmarkFilled,
|
|
@@ -192,7 +157,9 @@ NotificationIcon.propTypes = {
|
|
|
192
157
|
function ToastNotification(_ref4) {
|
|
193
158
|
var _cx4;
|
|
194
159
|
|
|
195
|
-
var
|
|
160
|
+
var ariaLabel = _ref4['aria-label'],
|
|
161
|
+
deprecatedAriaLabel = _ref4.ariaLabel,
|
|
162
|
+
role = _ref4.role,
|
|
196
163
|
onClose = _ref4.onClose,
|
|
197
164
|
onCloseButtonClick = _ref4.onCloseButtonClick,
|
|
198
165
|
statusIconDescription = _ref4.statusIconDescription,
|
|
@@ -277,81 +244,11 @@ function ToastNotification(_ref4) {
|
|
|
277
244
|
notificationType: "toast",
|
|
278
245
|
onClick: handleCloseButtonClick,
|
|
279
246
|
"aria-hidden": "true",
|
|
247
|
+
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
280
248
|
tabIndex: "-1"
|
|
281
249
|
}));
|
|
282
250
|
}
|
|
283
|
-
ToastNotification.propTypes = {
|
|
284
|
-
/**
|
|
285
|
-
* Provide a description for "close" icon button that can be read by screen readers
|
|
286
|
-
*/
|
|
287
|
-
ariaLabel: PropTypes__default["default"].string,
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
* Specify the caption
|
|
291
|
-
*/
|
|
292
|
-
caption: PropTypes__default["default"].string,
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Specify the content
|
|
296
|
-
*/
|
|
297
|
-
children: PropTypes__default["default"].node,
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Specify an optional className to be applied to the notification box
|
|
301
|
-
*/
|
|
302
|
-
className: PropTypes__default["default"].string,
|
|
303
|
-
|
|
304
|
-
/**
|
|
305
|
-
* Specify the close button should be disabled, or not
|
|
306
|
-
*/
|
|
307
|
-
hideCloseButton: PropTypes__default["default"].bool,
|
|
308
|
-
|
|
309
|
-
/**
|
|
310
|
-
* Specify what state the notification represents
|
|
311
|
-
*/
|
|
312
|
-
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
313
|
-
|
|
314
|
-
/**
|
|
315
|
-
* Specify whether you are using the low contrast variant of the ToastNotification.
|
|
316
|
-
*/
|
|
317
|
-
lowContrast: PropTypes__default["default"].bool,
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Provide a function that is called when menu is closed
|
|
321
|
-
*/
|
|
322
|
-
onClose: PropTypes__default["default"].func,
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Provide a function that is called when the close button is clicked
|
|
326
|
-
*/
|
|
327
|
-
onCloseButtonClick: PropTypes__default["default"].func,
|
|
328
|
-
|
|
329
|
-
/**
|
|
330
|
-
* By default, this value is "status". You can also provide an alternate
|
|
331
|
-
* role if it makes sense from the accessibility-side
|
|
332
|
-
*/
|
|
333
|
-
role: PropTypes__default["default"].oneOf(['alert', 'log', 'status']),
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Provide a description for "status" icon that can be read by screen readers
|
|
337
|
-
*/
|
|
338
|
-
statusIconDescription: PropTypes__default["default"].string,
|
|
339
|
-
|
|
340
|
-
/**
|
|
341
|
-
* Specify the sub-title
|
|
342
|
-
*/
|
|
343
|
-
subtitle: PropTypes__default["default"].string,
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Specify an optional duration the notification should be closed in
|
|
347
|
-
*/
|
|
348
|
-
timeout: PropTypes__default["default"].number,
|
|
349
|
-
|
|
350
|
-
/**
|
|
351
|
-
* Specify the title
|
|
352
|
-
*/
|
|
353
|
-
title: PropTypes__default["default"].string
|
|
354
|
-
};
|
|
251
|
+
ToastNotification.propTypes = (_ToastNotification$pr = {}, _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, 'aria-label', PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "ariaLabel", deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.')), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "caption", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "children", PropTypes__default["default"].node), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "className", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "hideCloseButton", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "kind", PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt'])), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "lowContrast", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "onClose", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "onCloseButtonClick", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "role", PropTypes__default["default"].oneOf(['alert', 'log', 'status'])), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "statusIconDescription", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "subtitle", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "timeout", PropTypes__default["default"].number), _rollupPluginBabelHelpers.defineProperty(_ToastNotification$pr, "title", PropTypes__default["default"].string), _ToastNotification$pr);
|
|
355
252
|
ToastNotification.defaultProps = {
|
|
356
253
|
kind: 'error',
|
|
357
254
|
role: 'status',
|
|
@@ -362,7 +259,8 @@ ToastNotification.defaultProps = {
|
|
|
362
259
|
function InlineNotification(_ref5) {
|
|
363
260
|
var _cx5;
|
|
364
261
|
|
|
365
|
-
var
|
|
262
|
+
var ariaLabel = _ref5['aria-label'],
|
|
263
|
+
children = _ref5.children,
|
|
366
264
|
title = _ref5.title,
|
|
367
265
|
subtitle = _ref5.subtitle,
|
|
368
266
|
role = _ref5.role,
|
|
@@ -424,66 +322,11 @@ function InlineNotification(_ref5) {
|
|
|
424
322
|
notificationType: "inline",
|
|
425
323
|
onClick: handleCloseButtonClick,
|
|
426
324
|
"aria-hidden": "true",
|
|
325
|
+
"aria-label": ariaLabel,
|
|
427
326
|
tabIndex: "-1"
|
|
428
327
|
}));
|
|
429
328
|
}
|
|
430
|
-
InlineNotification.propTypes = {
|
|
431
|
-
/**
|
|
432
|
-
* Specify the content
|
|
433
|
-
*/
|
|
434
|
-
children: PropTypes__default["default"].node,
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Specify an optional className to be applied to the notification box
|
|
438
|
-
*/
|
|
439
|
-
className: PropTypes__default["default"].string,
|
|
440
|
-
|
|
441
|
-
/**
|
|
442
|
-
* Specify the close button should be disabled, or not
|
|
443
|
-
*/
|
|
444
|
-
hideCloseButton: PropTypes__default["default"].bool,
|
|
445
|
-
|
|
446
|
-
/**
|
|
447
|
-
* Specify what state the notification represents
|
|
448
|
-
*/
|
|
449
|
-
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']),
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* Specify whether you are using the low contrast variant of the InlineNotification.
|
|
453
|
-
*/
|
|
454
|
-
lowContrast: PropTypes__default["default"].bool,
|
|
455
|
-
|
|
456
|
-
/**
|
|
457
|
-
* Provide a function that is called when menu is closed
|
|
458
|
-
*/
|
|
459
|
-
onClose: PropTypes__default["default"].func,
|
|
460
|
-
|
|
461
|
-
/**
|
|
462
|
-
* Provide a function that is called when the close button is clicked
|
|
463
|
-
*/
|
|
464
|
-
onCloseButtonClick: PropTypes__default["default"].func,
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* By default, this value is "status". You can also provide an alternate
|
|
468
|
-
* role if it makes sense from the accessibility-side.
|
|
469
|
-
*/
|
|
470
|
-
role: PropTypes__default["default"].oneOf(['alert', 'log', 'status']),
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Provide a description for "status" icon that can be read by screen readers
|
|
474
|
-
*/
|
|
475
|
-
statusIconDescription: PropTypes__default["default"].string,
|
|
476
|
-
|
|
477
|
-
/**
|
|
478
|
-
* Specify the sub-title
|
|
479
|
-
*/
|
|
480
|
-
subtitle: PropTypes__default["default"].string,
|
|
481
|
-
|
|
482
|
-
/**
|
|
483
|
-
* Specify the title
|
|
484
|
-
*/
|
|
485
|
-
title: PropTypes__default["default"].string
|
|
486
|
-
};
|
|
329
|
+
InlineNotification.propTypes = (_InlineNotification$p = {}, _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, 'aria-label', PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "children", PropTypes__default["default"].node), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "className", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "hideCloseButton", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "kind", PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt'])), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "lowContrast", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "onClose", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "onCloseButtonClick", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "role", PropTypes__default["default"].oneOf(['alert', 'log', 'status'])), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "statusIconDescription", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "subtitle", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_InlineNotification$p, "title", PropTypes__default["default"].string), _InlineNotification$p);
|
|
487
330
|
InlineNotification.defaultProps = {
|
|
488
331
|
kind: 'error',
|
|
489
332
|
role: 'status',
|
|
@@ -494,7 +337,8 @@ function ActionableNotification(_ref6) {
|
|
|
494
337
|
var _cx6;
|
|
495
338
|
|
|
496
339
|
var actionButtonLabel = _ref6.actionButtonLabel,
|
|
497
|
-
ariaLabel = _ref6
|
|
340
|
+
ariaLabel = _ref6['aria-label'],
|
|
341
|
+
deprecatedAriaLabel = _ref6.ariaLabel,
|
|
498
342
|
children = _ref6.children,
|
|
499
343
|
role = _ref6.role,
|
|
500
344
|
onActionButtonClick = _ref6.onActionButtonClick,
|
|
@@ -568,98 +412,17 @@ function ActionableNotification(_ref6) {
|
|
|
568
412
|
onClick: onActionButtonClick,
|
|
569
413
|
inline: inline
|
|
570
414
|
}, actionButtonLabel), !hideCloseButton && /*#__PURE__*/React__default["default"].createElement(NotificationButton, {
|
|
571
|
-
"aria-label": ariaLabel,
|
|
415
|
+
"aria-label": deprecatedAriaLabel || ariaLabel,
|
|
572
416
|
notificationType: "actionable",
|
|
573
417
|
onClick: handleCloseButtonClick
|
|
574
418
|
}));
|
|
575
419
|
}
|
|
576
|
-
ActionableNotification.propTypes = {
|
|
420
|
+
ActionableNotification.propTypes = (_ActionableNotificati = {
|
|
577
421
|
/**
|
|
578
422
|
* Pass in the action button label that will be rendered within the ActionableNotification.
|
|
579
423
|
*/
|
|
580
|
-
actionButtonLabel: PropTypes__default["default"].string.isRequired
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* Provide a description for "close" icon button that can be read by screen readers
|
|
584
|
-
*/
|
|
585
|
-
ariaLabel: PropTypes__default["default"].string,
|
|
586
|
-
|
|
587
|
-
/**
|
|
588
|
-
* Specify the content
|
|
589
|
-
*/
|
|
590
|
-
children: PropTypes__default["default"].node,
|
|
591
|
-
|
|
592
|
-
/**
|
|
593
|
-
* Specify an optional className to be applied to the notification box
|
|
594
|
-
*/
|
|
595
|
-
className: PropTypes__default["default"].string,
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* Specify if pressing the escape key should close notifications
|
|
599
|
-
*/
|
|
600
|
-
closeOnEscape: PropTypes__default["default"].bool,
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Specify if focus should be moved to the component when the notification contains actions
|
|
604
|
-
*/
|
|
605
|
-
hasFocus: PropTypes__default["default"].bool,
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Specify the close button should be disabled, or not
|
|
609
|
-
*/
|
|
610
|
-
hideCloseButton: PropTypes__default["default"].bool,
|
|
611
|
-
|
|
612
|
-
/*
|
|
613
|
-
* Specify if the notification should have inline styling applied instead of toast
|
|
614
|
-
*/
|
|
615
|
-
inline: PropTypes__default["default"].bool,
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Specify what state the notification represents
|
|
619
|
-
*/
|
|
620
|
-
kind: PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']).isRequired,
|
|
621
|
-
|
|
622
|
-
/**
|
|
623
|
-
* Specify whether you are using the low contrast variant of the ActionableNotification.
|
|
624
|
-
*/
|
|
625
|
-
lowContrast: PropTypes__default["default"].bool,
|
|
626
|
-
|
|
627
|
-
/**
|
|
628
|
-
* Provide a function that is called when the action is clicked
|
|
629
|
-
*/
|
|
630
|
-
onActionButtonClick: PropTypes__default["default"].func,
|
|
631
|
-
|
|
632
|
-
/**
|
|
633
|
-
* Provide a function that is called when menu is closed
|
|
634
|
-
*/
|
|
635
|
-
onClose: PropTypes__default["default"].func,
|
|
636
|
-
|
|
637
|
-
/**
|
|
638
|
-
* Provide a function that is called when the close button is clicked
|
|
639
|
-
*/
|
|
640
|
-
onCloseButtonClick: PropTypes__default["default"].func,
|
|
641
|
-
|
|
642
|
-
/**
|
|
643
|
-
* By default, this value is "alertdialog". You can also provide an alternate
|
|
644
|
-
* role if it makes sense from the accessibility-side.
|
|
645
|
-
*/
|
|
646
|
-
role: PropTypes__default["default"].string,
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Provide a description for "status" icon that can be read by screen readers
|
|
650
|
-
*/
|
|
651
|
-
statusIconDescription: PropTypes__default["default"].string,
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* Specify the sub-title
|
|
655
|
-
*/
|
|
656
|
-
subtitle: PropTypes__default["default"].string,
|
|
657
|
-
|
|
658
|
-
/**
|
|
659
|
-
* Specify the title
|
|
660
|
-
*/
|
|
661
|
-
title: PropTypes__default["default"].string
|
|
662
|
-
};
|
|
424
|
+
actionButtonLabel: PropTypes__default["default"].string.isRequired
|
|
425
|
+
}, _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, 'aria-label', PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "ariaLabel", deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.')), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "children", PropTypes__default["default"].node), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "className", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "closeOnEscape", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "hasFocus", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "hideCloseButton", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "inline", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "kind", PropTypes__default["default"].oneOf(['error', 'info', 'info-square', 'success', 'warning', 'warning-alt']).isRequired), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "lowContrast", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "onActionButtonClick", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "onClose", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "onCloseButtonClick", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "role", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "statusIconDescription", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "subtitle", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_ActionableNotificati, "title", PropTypes__default["default"].string), _ActionableNotificati);
|
|
663
426
|
ActionableNotification.defaultProps = {
|
|
664
427
|
kind: 'error',
|
|
665
428
|
role: 'alertdialog',
|
|
@@ -31,9 +31,9 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
31
31
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
32
32
|
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
|
|
33
33
|
|
|
34
|
-
var _excluded = ["id", "ariaLabel", "children", "iconDescription", "direction", "flipped", "focusTrap", "menuOffset", "menuOffsetFlip", "iconClass", "onClick", "onOpen", "selectorPrimaryFocus", "renderIcon", "innerRef", "menuOptionsClass", "light", "size"];
|
|
34
|
+
var _excluded = ["id", "aria-label", "ariaLabel", "children", "iconDescription", "direction", "flipped", "focusTrap", "menuOffset", "menuOffsetFlip", "iconClass", "onClick", "onOpen", "selectorPrimaryFocus", "renderIcon", "innerRef", "menuOptionsClass", "light", "size"];
|
|
35
35
|
|
|
36
|
-
var _triggerButtonPositio, _triggerButtonPositio2;
|
|
36
|
+
var _triggerButtonPositio, _triggerButtonPositio2, _defineProperty2, _defineProperty3;
|
|
37
37
|
|
|
38
38
|
var on = function on(element) {
|
|
39
39
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -299,7 +299,8 @@ var OverflowMenu = /*#__PURE__*/function (_Component) {
|
|
|
299
299
|
|
|
300
300
|
var _this$props = this.props,
|
|
301
301
|
id = _this$props.id,
|
|
302
|
-
ariaLabel = _this$props
|
|
302
|
+
ariaLabel = _this$props['aria-label'],
|
|
303
|
+
deprecatedAriaLabel = _this$props.ariaLabel,
|
|
303
304
|
children = _this$props.children,
|
|
304
305
|
iconDescription = _this$props.iconDescription,
|
|
305
306
|
direction = _this$props.direction,
|
|
@@ -339,7 +340,7 @@ var OverflowMenu = /*#__PURE__*/function (_Component) {
|
|
|
339
340
|
className: overflowMenuOptionsClasses,
|
|
340
341
|
tabIndex: "-1",
|
|
341
342
|
role: "menu",
|
|
342
|
-
"aria-label": ariaLabel,
|
|
343
|
+
"aria-label": ariaLabel || deprecatedAriaLabel,
|
|
343
344
|
onKeyDown: this.handleKeyPress
|
|
344
345
|
}, childrenWithProps);
|
|
345
346
|
var wrappedMenuBody = /*#__PURE__*/React__default["default"].createElement(FloatingMenu["default"], {
|
|
@@ -389,144 +390,17 @@ var OverflowMenu = /*#__PURE__*/function (_Component) {
|
|
|
389
390
|
return OverflowMenu;
|
|
390
391
|
}(React.Component);
|
|
391
392
|
|
|
392
|
-
_rollupPluginBabelHelpers.defineProperty(OverflowMenu, "propTypes", {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
* The child nodes.
|
|
400
|
-
*/
|
|
401
|
-
children: PropTypes__default["default"].node,
|
|
402
|
-
|
|
403
|
-
/**
|
|
404
|
-
* The CSS class names.
|
|
405
|
-
*/
|
|
406
|
-
className: PropTypes__default["default"].string,
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* The menu direction.
|
|
410
|
-
*/
|
|
411
|
-
direction: PropTypes__default["default"].oneOf([FloatingMenu.DIRECTION_TOP, FloatingMenu.DIRECTION_BOTTOM]),
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* `true` if the menu alignment should be flipped.
|
|
415
|
-
*/
|
|
416
|
-
flipped: PropTypes__default["default"].bool,
|
|
417
|
-
|
|
418
|
-
/**
|
|
419
|
-
* Enable or disable focus trap behavior
|
|
420
|
-
*/
|
|
421
|
-
focusTrap: PropTypes__default["default"].bool,
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* The CSS class for the icon.
|
|
425
|
-
*/
|
|
426
|
-
iconClass: PropTypes__default["default"].string,
|
|
427
|
-
|
|
428
|
-
/**
|
|
429
|
-
* The icon description.
|
|
430
|
-
*/
|
|
431
|
-
iconDescription: PropTypes__default["default"].string.isRequired,
|
|
432
|
-
|
|
433
|
-
/**
|
|
434
|
-
* The element ID.
|
|
435
|
-
*/
|
|
436
|
-
id: PropTypes__default["default"].string,
|
|
437
|
-
|
|
438
|
-
/**
|
|
439
|
-
* `true` to use the light version. For use on $ui-01 backgrounds only.
|
|
440
|
-
* Don't use this to make OverflowMenu background color same as container background color.
|
|
441
|
-
*/
|
|
442
|
-
light: deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `OverflowMenu` is no longer needed and has been deprecated. It will be removed in the next major release. Use the Layer component instead.'),
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* The adjustment in position applied to the floating menu.
|
|
446
|
-
*/
|
|
447
|
-
menuOffset: PropTypes__default["default"].oneOfType([PropTypes__default["default"].shape({
|
|
448
|
-
top: PropTypes__default["default"].number,
|
|
449
|
-
left: PropTypes__default["default"].number
|
|
450
|
-
}), PropTypes__default["default"].func]),
|
|
451
|
-
|
|
452
|
-
/**
|
|
453
|
-
* The adjustment in position applied to the floating menu.
|
|
454
|
-
*/
|
|
455
|
-
menuOffsetFlip: PropTypes__default["default"].oneOfType([PropTypes__default["default"].shape({
|
|
456
|
-
top: PropTypes__default["default"].number,
|
|
457
|
-
left: PropTypes__default["default"].number
|
|
458
|
-
}), PropTypes__default["default"].func]),
|
|
459
|
-
|
|
460
|
-
/**
|
|
461
|
-
* The class to apply to the menu options
|
|
462
|
-
*/
|
|
463
|
-
menuOptionsClass: PropTypes__default["default"].string,
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* The event handler for the `click` event.
|
|
467
|
-
*/
|
|
468
|
-
onClick: PropTypes__default["default"].func,
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Function called when menu is closed
|
|
472
|
-
*/
|
|
473
|
-
onClose: PropTypes__default["default"].func,
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* The event handler for the `focus` event.
|
|
477
|
-
*/
|
|
478
|
-
onFocus: PropTypes__default["default"].func,
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* The event handler for the `keydown` event.
|
|
482
|
-
*/
|
|
483
|
-
onKeyDown: PropTypes__default["default"].func,
|
|
484
|
-
|
|
485
|
-
/**
|
|
486
|
-
* Function called when menu is opened
|
|
487
|
-
*/
|
|
488
|
-
onOpen: PropTypes__default["default"].func,
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* `true` if the menu should be open.
|
|
492
|
-
*/
|
|
493
|
-
open: PropTypes__default["default"].bool,
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
* Function called to override icon rendering.
|
|
497
|
-
*/
|
|
498
|
-
renderIcon: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object]),
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Specify a CSS selector that matches the DOM element that should
|
|
502
|
-
* be focused when the OverflowMenu opens
|
|
503
|
-
*/
|
|
504
|
-
selectorPrimaryFocus: PropTypes__default["default"].string,
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Specify the size of the OverflowMenu. Currently supports either `sm`, 'md' (default) or 'lg` as an option.
|
|
508
|
-
*/
|
|
509
|
-
size: PropTypes__default["default"].oneOf(['sm', 'md', 'lg'])
|
|
510
|
-
});
|
|
393
|
+
_rollupPluginBabelHelpers.defineProperty(OverflowMenu, "propTypes", (_defineProperty2 = {}, _rollupPluginBabelHelpers.defineProperty(_defineProperty2, 'aria-label', PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "ariaLabel", deprecate["default"](PropTypes__default["default"].string, 'This prop syntax has been deprecated. Please use the new `aria-label`.')), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "children", PropTypes__default["default"].node), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "className", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "direction", PropTypes__default["default"].oneOf([FloatingMenu.DIRECTION_TOP, FloatingMenu.DIRECTION_BOTTOM])), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "flipped", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "focusTrap", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "iconClass", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "iconDescription", PropTypes__default["default"].string.isRequired), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "id", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "light", deprecate["default"](PropTypes__default["default"].bool, 'The `light` prop for `OverflowMenu` is no longer needed and has been deprecated. It will be removed in the next major release. Use the Layer component instead.')), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "menuOffset", PropTypes__default["default"].oneOfType([PropTypes__default["default"].shape({
|
|
394
|
+
top: PropTypes__default["default"].number,
|
|
395
|
+
left: PropTypes__default["default"].number
|
|
396
|
+
}), PropTypes__default["default"].func])), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "menuOffsetFlip", PropTypes__default["default"].oneOfType([PropTypes__default["default"].shape({
|
|
397
|
+
top: PropTypes__default["default"].number,
|
|
398
|
+
left: PropTypes__default["default"].number
|
|
399
|
+
}), PropTypes__default["default"].func])), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "menuOptionsClass", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "onClick", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "onClose", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "onFocus", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "onKeyDown", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "onOpen", PropTypes__default["default"].func), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "open", PropTypes__default["default"].bool), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "renderIcon", PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].object])), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "selectorPrimaryFocus", PropTypes__default["default"].string), _rollupPluginBabelHelpers.defineProperty(_defineProperty2, "size", PropTypes__default["default"].oneOf(['sm', 'md', 'lg'])), _defineProperty2));
|
|
511
400
|
|
|
512
401
|
_rollupPluginBabelHelpers.defineProperty(OverflowMenu, "contextType", usePrefix.PrefixContext);
|
|
513
402
|
|
|
514
|
-
_rollupPluginBabelHelpers.defineProperty(OverflowMenu, "defaultProps", {
|
|
515
|
-
ariaLabel: null,
|
|
516
|
-
iconDescription: 'Options',
|
|
517
|
-
open: false,
|
|
518
|
-
direction: FloatingMenu.DIRECTION_BOTTOM,
|
|
519
|
-
flipped: false,
|
|
520
|
-
focusTrap: true,
|
|
521
|
-
renderIcon: iconsReact.OverflowMenuVertical,
|
|
522
|
-
onClick: function onClick() {},
|
|
523
|
-
onKeyDown: function onKeyDown() {},
|
|
524
|
-
onClose: function onClose() {},
|
|
525
|
-
onOpen: function onOpen() {},
|
|
526
|
-
menuOffset: getMenuOffset,
|
|
527
|
-
menuOffsetFlip: getMenuOffset,
|
|
528
|
-
selectorPrimaryFocus: '[data-overflow-menu-primary-focus]'
|
|
529
|
-
});
|
|
403
|
+
_rollupPluginBabelHelpers.defineProperty(OverflowMenu, "defaultProps", (_defineProperty3 = {}, _rollupPluginBabelHelpers.defineProperty(_defineProperty3, 'aria-label', null), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "iconDescription", 'Options'), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "open", false), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "direction", FloatingMenu.DIRECTION_BOTTOM), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "flipped", false), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "focusTrap", true), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "renderIcon", iconsReact.OverflowMenuVertical), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "onClick", function onClick() {}), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "onKeyDown", function onKeyDown() {}), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "onClose", function onClose() {}), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "onOpen", function onOpen() {}), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "menuOffset", getMenuOffset), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "menuOffsetFlip", getMenuOffset), _rollupPluginBabelHelpers.defineProperty(_defineProperty3, "selectorPrimaryFocus", '[data-overflow-menu-primary-focus]'), _defineProperty3));
|
|
530
404
|
((function () {
|
|
531
405
|
var forwardRef = function forwardRef(props, ref) {
|
|
532
406
|
return /*#__PURE__*/React__default["default"].createElement(OverflowMenu, _rollupPluginBabelHelpers["extends"]({}, props, {
|
|
@@ -0,0 +1,58 @@
|
|
|
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 React from 'react';
|
|
8
|
+
import { ForwardRefReturn } from '../../types/common';
|
|
9
|
+
export interface OverflowMenuItemProps extends React.HTMLAttributes<HTMLElement> {
|
|
10
|
+
/**
|
|
11
|
+
* The CSS class name to be placed on the button element
|
|
12
|
+
*/
|
|
13
|
+
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* A callback to tell the parent menu component that the menu should be closed.
|
|
16
|
+
*/
|
|
17
|
+
closeMenu?: () => void;
|
|
18
|
+
/**
|
|
19
|
+
* `true` to make this menu item disabled.
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
handleOverflowMenuItemFocus?: (options: {
|
|
23
|
+
currentIndex?: number;
|
|
24
|
+
direction: number;
|
|
25
|
+
}) => void;
|
|
26
|
+
/**
|
|
27
|
+
* `true` to make this menu item a divider.
|
|
28
|
+
*/
|
|
29
|
+
hasDivider?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* If given, overflow item will render as a link with the given href
|
|
32
|
+
*/
|
|
33
|
+
href?: string;
|
|
34
|
+
index?: number;
|
|
35
|
+
/**
|
|
36
|
+
* The text to show for the menu item
|
|
37
|
+
*/
|
|
38
|
+
itemText?: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* `true` to make this menu item a danger button.
|
|
41
|
+
*/
|
|
42
|
+
isDelete?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* `true` to require the title attribute.
|
|
45
|
+
*/
|
|
46
|
+
requireTitle?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* The title attribute.
|
|
49
|
+
*/
|
|
50
|
+
title?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The CSS class name to be placed on the wrapper element
|
|
53
|
+
*/
|
|
54
|
+
wrapperClassName?: string;
|
|
55
|
+
}
|
|
56
|
+
export type OverflowMenuItemComponent = ForwardRefReturn<HTMLElement, OverflowMenuItemProps>;
|
|
57
|
+
declare const OverflowMenuItem: OverflowMenuItemComponent;
|
|
58
|
+
export default OverflowMenuItem;
|