@carbon/react 1.6.0 → 1.8.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.
Files changed (80) hide show
  1. package/es/components/ComposedModal/ComposedModal.js +1 -1
  2. package/es/components/ComposedModal/index.js +4 -4
  3. package/es/components/DataTable/DataTable.js +1 -1
  4. package/es/components/DataTable/Table.js +10 -2
  5. package/es/components/DataTable/TableContainer.js +20 -5
  6. package/es/components/DataTable/TableContext.js +15 -0
  7. package/es/components/DataTable/TableSelectRow.js +1 -1
  8. package/es/components/FileUploader/FileUploader.js +8 -1
  9. package/es/components/FileUploader/FileUploaderButton.js +3 -1
  10. package/es/components/FileUploader/FileUploaderDropContainer.js +3 -1
  11. package/es/components/FileUploader/FileUploaderItem.js +3 -1
  12. package/es/components/Form/Form.js +1 -1
  13. package/es/components/FormGroup/FormGroup.js +4 -4
  14. package/es/components/FormItem/FormItem.js +5 -6
  15. package/es/components/InlineLoading/InlineLoading.js +9 -5
  16. package/es/components/Loading/Loading.js +7 -18
  17. package/es/components/MultiSelect/FilterableMultiSelect.js +345 -386
  18. package/es/components/MultiSelect/index.js +4 -8
  19. package/es/components/Notification/Notification.js +322 -189
  20. package/es/components/Popover/index.js +137 -8
  21. package/es/components/ProgressBar/ProgressBar.js +6 -3
  22. package/es/components/RadioButton/RadioButton.js +58 -99
  23. package/es/components/RadioButton/index.js +2 -8
  24. package/es/components/RadioButtonGroup/RadioButtonGroup.js +72 -121
  25. package/es/components/RadioButtonGroup/index.js +2 -8
  26. package/es/components/Select/Select.js +14 -7
  27. package/es/components/Slider/Slider.js +2 -1
  28. package/es/components/Switch/Switch.js +0 -1
  29. package/es/components/TreeView/TreeView.js +19 -11
  30. package/es/components/UIShell/HeaderMenu.js +1 -1
  31. package/es/components/UIShell/HeaderMenuButton.js +4 -0
  32. package/es/components/UIShell/SideNavDetails.js +8 -3
  33. package/es/components/UIShell/SideNavLink.js +6 -9
  34. package/es/index.js +7 -6
  35. package/es/internal/createClassWrapper.js +2 -5
  36. package/lib/components/ComposedModal/index.js +7 -7
  37. package/lib/components/DataTable/DataTable.js +5 -5
  38. package/lib/components/DataTable/Table.js +9 -1
  39. package/lib/components/DataTable/TableContainer.js +19 -4
  40. package/lib/components/DataTable/TableContext.js +19 -0
  41. package/lib/components/DataTable/TableSelectRow.js +2 -2
  42. package/lib/components/FileUploader/FileUploader.js +8 -1
  43. package/lib/components/FileUploader/FileUploaderButton.js +3 -1
  44. package/lib/components/FileUploader/FileUploaderDropContainer.js +3 -1
  45. package/lib/components/FileUploader/FileUploaderItem.js +3 -1
  46. package/lib/components/Form/Form.js +1 -1
  47. package/lib/components/FormGroup/FormGroup.js +4 -4
  48. package/lib/components/FormItem/FormItem.js +5 -6
  49. package/lib/components/InlineLoading/InlineLoading.js +9 -5
  50. package/lib/components/Loading/Loading.js +6 -17
  51. package/lib/components/MultiSelect/FilterableMultiSelect.js +341 -382
  52. package/lib/components/MultiSelect/index.js +5 -28
  53. package/lib/components/Notification/Notification.js +321 -188
  54. package/lib/components/Popover/index.js +135 -6
  55. package/lib/components/ProgressBar/ProgressBar.js +6 -3
  56. package/lib/components/RadioButton/RadioButton.js +57 -99
  57. package/lib/components/RadioButton/index.js +2 -25
  58. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +68 -117
  59. package/lib/components/RadioButtonGroup/index.js +2 -25
  60. package/lib/components/Select/Select.js +14 -7
  61. package/lib/components/Slider/Slider.js +2 -1
  62. package/lib/components/Switch/Switch.js +0 -1
  63. package/lib/components/TreeView/TreeView.js +18 -10
  64. package/lib/components/UIShell/HeaderMenu.js +1 -0
  65. package/lib/components/UIShell/HeaderMenuButton.js +4 -0
  66. package/lib/components/UIShell/SideNavDetails.js +8 -3
  67. package/lib/components/UIShell/SideNavLink.js +6 -9
  68. package/lib/index.js +83 -83
  69. package/lib/internal/createClassWrapper.js +2 -5
  70. package/package.json +8 -8
  71. package/es/components/MultiSelect/next/FilterableMultiSelect.js +0 -542
  72. package/es/components/Notification/index.js +0 -42
  73. package/es/components/Notification/next/Notification.js +0 -663
  74. package/es/components/RadioButton/next/RadioButton.js +0 -130
  75. package/es/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -141
  76. package/lib/components/MultiSelect/next/FilterableMultiSelect.js +0 -554
  77. package/lib/components/Notification/index.js +0 -51
  78. package/lib/components/Notification/next/Notification.js +0 -677
  79. package/lib/components/RadioButton/next/RadioButton.js +0 -140
  80. package/lib/components/RadioButtonGroup/next/RadioButtonGroup.js +0 -151
@@ -1,542 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2016, 2022
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
-
8
- import { slicedToArray as _slicedToArray, defineProperty as _defineProperty, extends as _extends, objectSpread2 as _objectSpread2 } from '../../../_virtual/_rollupPluginBabelHelpers.js';
9
- import { WarningFilled, WarningAltFilled } from '@carbon/icons-react';
10
- import cx from 'classnames';
11
- import Downshift from 'downshift';
12
- import isEqual from 'lodash.isequal';
13
- import PropTypes from 'prop-types';
14
- import React__default, { useState, useRef } from 'react';
15
- import { defaultFilterItems } from '../../ComboBox/tools/filter.js';
16
- import { sortingPropTypes } from '../MultiSelectPropTypes.js';
17
- import '../../ListBox/index.js';
18
- import Selection from '../../../internal/Selection.js';
19
- import { defaultItemToString } from '../tools/itemToString.js';
20
- import mergeRefs from '../../../tools/mergeRefs.js';
21
- import { useId } from '../../../internal/useId.js';
22
- import { defaultCompareItems, defaultSortItems } from '../tools/sorting.js';
23
- import { useFeatureFlag } from '../../FeatureFlags/index.js';
24
- import { usePrefix } from '../../../internal/usePrefix.js';
25
- import { match } from '../../../internal/keyboard/match.js';
26
- import ListBoxSelection from '../../ListBox/next/ListBoxSelection.js';
27
- import ListBoxTrigger from '../../ListBox/next/ListBoxTrigger.js';
28
- import ListBox from '../../ListBox/ListBox.js';
29
- import { ListBoxSize } from '../../ListBox/ListBoxPropTypes.js';
30
- import { Space } from '../../../internal/keyboard/keys.js';
31
-
32
- var FilterableMultiSelect = /*#__PURE__*/React__default.forwardRef(function FilterableMultiSelect(_ref, ref) {
33
- var _cx, _cx2, _cx3, _cx4;
34
-
35
- var ariaLabel = _ref.ariaLabel,
36
- containerClassName = _ref.className,
37
- compareItems = _ref.compareItems,
38
- direction = _ref.direction,
39
- disabled = _ref.disabled,
40
- downshiftProps = _ref.downshiftProps,
41
- filterItems = _ref.filterItems,
42
- helperText = _ref.helperText,
43
- hideLabel = _ref.hideLabel,
44
- id = _ref.id,
45
- initialSelectedItems = _ref.initialSelectedItems,
46
- invalid = _ref.invalid,
47
- invalidText = _ref.invalidText,
48
- items = _ref.items,
49
- ItemToElement = _ref.itemToElement,
50
- itemToString = _ref.itemToString,
51
- light = _ref.light,
52
- locale = _ref.locale,
53
- onInputValueChange = _ref.onInputValueChange,
54
- open = _ref.open,
55
- onChange = _ref.onChange,
56
- onMenuChange = _ref.onMenuChange,
57
- placeholder = _ref.placeholder,
58
- titleText = _ref.titleText,
59
- type = _ref.type,
60
- selectionFeedback = _ref.selectionFeedback,
61
- size = _ref.size,
62
- sortItems = _ref.sortItems,
63
- translateWithId = _ref.translateWithId,
64
- useTitleInItem = _ref.useTitleInItem,
65
- warn = _ref.warn,
66
- warnText = _ref.warnText;
67
-
68
- var _useState = useState(open),
69
- _useState2 = _slicedToArray(_useState, 2),
70
- isOpen = _useState2[0],
71
- setIsOpen = _useState2[1];
72
-
73
- var _useState3 = useState(open),
74
- _useState4 = _slicedToArray(_useState3, 2),
75
- prevOpen = _useState4[0],
76
- setPrevOpen = _useState4[1];
77
-
78
- var _useState5 = useState(''),
79
- _useState6 = _slicedToArray(_useState5, 2),
80
- inputValue = _useState6[0],
81
- setInputValue = _useState6[1];
82
-
83
- var _useState7 = useState([]),
84
- _useState8 = _slicedToArray(_useState7, 2),
85
- topItems = _useState8[0],
86
- setTopItems = _useState8[1];
87
-
88
- var _useState9 = useState(false),
89
- _useState10 = _slicedToArray(_useState9, 2),
90
- inputFocused = _useState10[0],
91
- setInputFocused = _useState10[1];
92
-
93
- var _useState11 = useState(null),
94
- _useState12 = _slicedToArray(_useState11, 2),
95
- highlightedIndex = _useState12[0],
96
- setHighlightedIndex = _useState12[1];
97
-
98
- var textInput = useRef();
99
- var filterableMultiSelectInstanceId = useId();
100
- var enabled = useFeatureFlag('enable-v11-release');
101
- var prefix = usePrefix();
102
-
103
- if (prevOpen !== open) {
104
- setIsOpen(open);
105
- setPrevOpen(open);
106
- }
107
-
108
- var inline = type === 'inline';
109
- var showWarning = !invalid && warn;
110
- var wrapperClasses = cx("".concat(prefix, "--multi-select__wrapper"), "".concat(prefix, "--list-box__wrapper"), [enabled ? containerClassName : null], (_cx = {}, _defineProperty(_cx, "".concat(prefix, "--multi-select__wrapper--inline"), inline), _defineProperty(_cx, "".concat(prefix, "--list-box__wrapper--inline"), inline), _defineProperty(_cx, "".concat(prefix, "--multi-select__wrapper--inline--invalid"), inline && invalid), _defineProperty(_cx, "".concat(prefix, "--list-box__wrapper--inline--invalid"), inline && invalid), _defineProperty(_cx, "".concat(prefix, "--list-box--up"), direction === 'top'), _cx));
111
- var helperId = !helperText ? undefined : "filterablemultiselect-helper-text-".concat(filterableMultiSelectInstanceId);
112
- var labelId = "".concat(id, "-label");
113
- var titleClasses = cx((_cx2 = {}, _defineProperty(_cx2, "".concat(prefix, "--label"), true), _defineProperty(_cx2, "".concat(prefix, "--label--disabled"), disabled), _defineProperty(_cx2, "".concat(prefix, "--visually-hidden"), hideLabel), _cx2));
114
- var helperClasses = cx((_cx3 = {}, _defineProperty(_cx3, "".concat(prefix, "--form__helper-text"), true), _defineProperty(_cx3, "".concat(prefix, "--form__helper-text--disabled"), disabled), _cx3));
115
- var inputClasses = cx((_cx4 = {}, _defineProperty(_cx4, "".concat(prefix, "--text-input"), true), _defineProperty(_cx4, "".concat(prefix, "--text-input--empty"), !inputValue), _defineProperty(_cx4, "".concat(prefix, "--text-input--light"), light), _cx4));
116
- var helper = helperText ? /*#__PURE__*/React__default.createElement("div", {
117
- id: helperId,
118
- className: helperClasses
119
- }, helperText) : null;
120
- var menuId = "".concat(id, "__menu");
121
- var inputId = "".concat(id, "-input");
122
-
123
- function handleOnChange(changes) {
124
- if (onChange) {
125
- onChange(changes);
126
- }
127
- }
128
-
129
- function handleOnMenuChange(forceIsOpen) {
130
- var nextIsOpen = forceIsOpen !== null && forceIsOpen !== void 0 ? forceIsOpen : !isOpen;
131
- setIsOpen(nextIsOpen);
132
-
133
- if (onMenuChange) {
134
- onMenuChange(nextIsOpen);
135
- }
136
- }
137
-
138
- function handleOnOuterClick() {
139
- handleOnMenuChange(false);
140
- }
141
-
142
- function handleOnStateChange(changes, downshift) {
143
- if (changes.isOpen && !isOpen) {
144
- setTopItems(downshift.selectedItem);
145
- }
146
-
147
- var type = changes.type;
148
- var stateChangeTypes = Downshift.stateChangeTypes;
149
-
150
- switch (type) {
151
- case stateChangeTypes.keyDownArrowDown:
152
- case stateChangeTypes.keyDownArrowUp:
153
- case stateChangeTypes.keyDownHome:
154
- case stateChangeTypes.keyDownEnd:
155
- setHighlightedIndex(changes.highlightedIndex !== undefined ? changes.highlightedIndex : null);
156
-
157
- if (stateChangeTypes.keyDownArrowDown === type && !isOpen) {
158
- handleOnMenuChange(true);
159
- }
160
-
161
- break;
162
-
163
- case stateChangeTypes.keyDownEscape:
164
- handleOnMenuChange(false);
165
- break;
166
- }
167
- }
168
-
169
- function handleOnInputValueChange(inputValue, _ref2) {
170
- var type = _ref2.type;
171
-
172
- if (onInputValueChange) {
173
- onInputValueChange(inputValue);
174
- }
175
-
176
- if (type !== Downshift.stateChangeTypes.changeInput) {
177
- return;
178
- }
179
-
180
- if (Array.isArray(inputValue)) {
181
- clearInputValue();
182
- } else {
183
- setInputValue(inputValue);
184
- }
185
-
186
- if (inputValue && !isOpen) {
187
- handleOnMenuChange(true);
188
- } else if (!inputValue && isOpen) {
189
- handleOnMenuChange(false);
190
- }
191
- }
192
-
193
- function clearInputValue() {
194
- setInputValue('');
195
-
196
- if (textInput.current) {
197
- textInput.current.focus();
198
- }
199
- }
200
-
201
- return /*#__PURE__*/React__default.createElement(Selection, {
202
- disabled: disabled,
203
- onChange: handleOnChange,
204
- initialSelectedItems: initialSelectedItems,
205
- render: function render(_ref3) {
206
- var selectedItems = _ref3.selectedItems,
207
- onItemChange = _ref3.onItemChange,
208
- _clearSelection = _ref3.clearSelection;
209
- return /*#__PURE__*/React__default.createElement(Downshift, _extends({}, downshiftProps, {
210
- highlightedIndex: highlightedIndex,
211
- id: id,
212
- isOpen: isOpen,
213
- inputValue: inputValue,
214
- onInputValueChange: handleOnInputValueChange,
215
- onChange: function onChange(selectedItem) {
216
- if (selectedItem !== null) {
217
- onItemChange(selectedItem);
218
- }
219
- },
220
- itemToString: itemToString,
221
- onStateChange: handleOnStateChange,
222
- onOuterClick: handleOnOuterClick,
223
- selectedItem: selectedItems,
224
- labelId: labelId,
225
- menuId: menuId,
226
- inputId: inputId
227
- }), function (_ref4) {
228
- var _cx5;
229
-
230
- var getInputProps = _ref4.getInputProps,
231
- getItemProps = _ref4.getItemProps,
232
- getLabelProps = _ref4.getLabelProps,
233
- getMenuProps = _ref4.getMenuProps,
234
- getRootProps = _ref4.getRootProps,
235
- getToggleButtonProps = _ref4.getToggleButtonProps,
236
- isOpen = _ref4.isOpen,
237
- inputValue = _ref4.inputValue,
238
- selectedItem = _ref4.selectedItem;
239
- var className = cx("".concat(prefix, "--multi-select"), "".concat(prefix, "--combo-box"), "".concat(prefix, "--multi-select--filterable"), [enabled ? null : containerClassName], (_cx5 = {}, _defineProperty(_cx5, "".concat(prefix, "--multi-select--invalid"), invalid), _defineProperty(_cx5, "".concat(prefix, "--multi-select--open"), isOpen), _defineProperty(_cx5, "".concat(prefix, "--multi-select--inline"), inline), _defineProperty(_cx5, "".concat(prefix, "--multi-select--selected"), selectedItem.length > 0), _defineProperty(_cx5, "".concat(prefix, "--multi-select--filterable--input-focused"), inputFocused), _cx5));
240
- var rootProps = getRootProps({}, {
241
- suppressRefError: true
242
- });
243
- var labelProps = getLabelProps();
244
- var buttonProps = getToggleButtonProps({
245
- disabled: disabled,
246
- onClick: function onClick() {
247
- handleOnMenuChange(!isOpen);
248
-
249
- if (textInput.current) {
250
- textInput.current.focus();
251
- }
252
- },
253
- // When we moved the "root node" of Downshift to the <input> for
254
- // ARIA 1.2 compliance, we unfortunately hit this branch for the
255
- // "mouseup" event that downshift listens to:
256
- // https://github.com/downshift-js/downshift/blob/v5.2.1/src/downshift.js#L1051-L1065
257
- //
258
- // As a result, it will reset the state of the component and so we
259
- // stop the event from propagating to prevent this. This allows the
260
- // toggleMenu behavior for the toggleButton to correctly open and
261
- // close the menu.
262
- onMouseUp: function onMouseUp(event) {
263
- event.stopPropagation();
264
- }
265
- });
266
- var inputProps = getInputProps({
267
- 'aria-controls': isOpen ? menuId : null,
268
- 'aria-describedby': helperText ? helperId : null,
269
- // Remove excess aria `aria-labelledby`. HTML <label for>
270
- // provides this aria information.
271
- 'aria-labelledby': null,
272
- disabled: disabled,
273
- placeholder: placeholder,
274
- onClick: function onClick() {
275
- handleOnMenuChange(true);
276
- },
277
- onKeyDown: function onKeyDown(event) {
278
- if (match(event, Space)) {
279
- event.stopPropagation();
280
- }
281
- },
282
- onFocus: function onFocus() {
283
- setInputFocused(true);
284
- },
285
- onBlur: function onBlur() {
286
- setInputFocused(false);
287
- }
288
- });
289
- var menuProps = getMenuProps({
290
- 'aria-label': ariaLabel
291
- }, {
292
- suppressRefError: true
293
- });
294
- return /*#__PURE__*/React__default.createElement("div", {
295
- className: wrapperClasses
296
- }, titleText ? /*#__PURE__*/React__default.createElement("label", _extends({
297
- className: titleClasses
298
- }, labelProps), titleText) : null, /*#__PURE__*/React__default.createElement(ListBox, {
299
- className: className,
300
- disabled: disabled,
301
- light: light,
302
- ref: ref,
303
- invalid: invalid,
304
- invalidText: invalidText,
305
- warn: warn,
306
- warnText: warnText,
307
- isOpen: isOpen,
308
- size: size
309
- }, /*#__PURE__*/React__default.createElement("div", {
310
- className: "".concat(prefix, "--list-box__field")
311
- }, selectedItem.length > 0 && /*#__PURE__*/React__default.createElement(ListBoxSelection, {
312
- clearSelection: function clearSelection() {
313
- _clearSelection();
314
-
315
- if (textInput.current) {
316
- textInput.current.focus();
317
- }
318
- },
319
- selectionCount: selectedItem.length,
320
- translateWithId: translateWithId,
321
- disabled: disabled
322
- }), /*#__PURE__*/React__default.createElement("input", _extends({
323
- className: inputClasses
324
- }, rootProps, inputProps, {
325
- ref: mergeRefs(textInput, rootProps.ref)
326
- })), invalid && /*#__PURE__*/React__default.createElement(WarningFilled, {
327
- className: "".concat(prefix, "--list-box__invalid-icon")
328
- }), showWarning && /*#__PURE__*/React__default.createElement(WarningAltFilled, {
329
- className: "".concat(prefix, "--list-box__invalid-icon ").concat(prefix, "--list-box__invalid-icon--warning")
330
- }), inputValue && /*#__PURE__*/React__default.createElement(ListBoxSelection, {
331
- clearSelection: clearInputValue,
332
- disabled: disabled,
333
- translateWithId: translateWithId,
334
- onMouseUp: function onMouseUp(event) {
335
- // If we do not stop this event from propagating,
336
- // it seems like Downshift takes our event and
337
- // prevents us from getting `onClick` /
338
- // `clearSelection` from the underlying <button> in
339
- // ListBoxSelection
340
- event.stopPropagation();
341
- }
342
- }), /*#__PURE__*/React__default.createElement(ListBoxTrigger, _extends({}, buttonProps, {
343
- isOpen: isOpen,
344
- translateWithId: translateWithId
345
- }))), isOpen ? /*#__PURE__*/React__default.createElement(ListBox.Menu, menuProps, sortItems(filterItems(items, {
346
- itemToString: itemToString,
347
- inputValue: inputValue
348
- }), {
349
- selectedItems: {
350
- top: selectedItems,
351
- fixed: [],
352
- 'top-after-reopen': topItems
353
- }[selectionFeedback],
354
- itemToString: itemToString,
355
- compareItems: compareItems,
356
- locale: locale
357
- }).map(function (item, index) {
358
- var itemProps = getItemProps({
359
- item: item,
360
- disabled: item.disabled
361
- });
362
- var itemText = itemToString(item);
363
- var isChecked = selectedItem.filter(function (selected) {
364
- return isEqual(selected, item);
365
- }).length > 0;
366
- return /*#__PURE__*/React__default.createElement(ListBox.MenuItem, _extends({
367
- key: itemProps.id,
368
- "aria-label": itemText,
369
- isActive: isChecked,
370
- isHighlighted: highlightedIndex === index,
371
- title: itemText
372
- }, itemProps), /*#__PURE__*/React__default.createElement("div", {
373
- className: "".concat(prefix, "--checkbox-wrapper")
374
- }, /*#__PURE__*/React__default.createElement("span", {
375
- title: useTitleInItem ? itemText : null,
376
- className: "".concat(prefix, "--checkbox-label"),
377
- "data-contained-checkbox-state": isChecked,
378
- id: "".concat(itemProps.id, "-item")
379
- }, ItemToElement ? /*#__PURE__*/React__default.createElement(ItemToElement, _extends({
380
- key: itemProps.id
381
- }, item)) : itemText)));
382
- })) : null), !inline && !invalid && !warn ? helper : null);
383
- });
384
- }
385
- });
386
- });
387
- FilterableMultiSelect.propTypes = _objectSpread2(_objectSpread2({
388
- /**
389
- * 'aria-label' of the ListBox component.
390
- */
391
- ariaLabel: PropTypes.string,
392
-
393
- /**
394
- * Specify the direction of the multiselect dropdown. Can be either top or bottom.
395
- */
396
- direction: PropTypes.oneOf(['top', 'bottom']),
397
-
398
- /**
399
- * Disable the control
400
- */
401
- disabled: PropTypes.bool,
402
-
403
- /**
404
- * Additional props passed to Downshift
405
- */
406
- downshiftProps: PropTypes.shape(Downshift.propTypes),
407
-
408
- /**
409
- * Specify whether the title text should be hidden or not
410
- */
411
- hideLabel: PropTypes.bool,
412
-
413
- /**
414
- * Specify a custom `id`
415
- */
416
- id: PropTypes.string.isRequired,
417
-
418
- /**
419
- * Allow users to pass in arbitrary items from their collection that are
420
- * pre-selected
421
- */
422
- initialSelectedItems: PropTypes.array,
423
-
424
- /**
425
- * Is the current selection invalid?
426
- */
427
- invalid: PropTypes.bool,
428
-
429
- /**
430
- * If invalid, what is the error?
431
- */
432
- invalidText: PropTypes.node,
433
-
434
- /**
435
- * Function to render items as custom components instead of strings.
436
- * Defaults to null and is overridden by a getter
437
- */
438
- itemToElement: PropTypes.func,
439
-
440
- /**
441
- * Helper function passed to downshift that allows the library to render a
442
- * given item to a string label. By default, it extracts the `label` field
443
- * from a given item to serve as the item label in the list.
444
- */
445
- itemToString: PropTypes.func,
446
-
447
- /**
448
- * We try to stay as generic as possible here to allow individuals to pass
449
- * in a collection of whatever kind of data structure they prefer
450
- */
451
- items: PropTypes.array.isRequired,
452
-
453
- /**
454
- * `true` to use the light version.
455
- */
456
- light: PropTypes.bool,
457
-
458
- /**
459
- * Specify the locale of the control. Used for the default `compareItems`
460
- * used for sorting the list of items in the control.
461
- */
462
- locale: PropTypes.string,
463
-
464
- /**
465
- * `onChange` is a utility for this controlled component to communicate to a
466
- * consuming component what kind of internal state changes are occurring.
467
- */
468
- onChange: PropTypes.func,
469
-
470
- /**
471
- * `onInputValueChange` is a utility for this controlled component to communicate to
472
- * the currently typed input.
473
- */
474
- onInputValueChange: PropTypes.func,
475
-
476
- /**
477
- * `onMenuChange` is a utility for this controlled component to communicate to a
478
- * consuming component that the menu was opened(`true`)/closed(`false`).
479
- */
480
- onMenuChange: PropTypes.func,
481
-
482
- /**
483
- * Initialize the component with an open(`true`)/closed(`false`) menu.
484
- */
485
- open: PropTypes.bool,
486
-
487
- /**
488
- * Generic `placeholder` that will be used as the textual representation of
489
- * what this field is for
490
- */
491
- placeholder: PropTypes.string,
492
-
493
- /**
494
- * Specify feedback (mode) of the selection.
495
- * `top`: selected item jumps to top
496
- * `fixed`: selected item stays at it's position
497
- * `top-after-reopen`: selected item jump to top after reopen dropdown
498
- */
499
- selectionFeedback: PropTypes.oneOf(['top', 'fixed', 'top-after-reopen']),
500
-
501
- /**
502
- * Specify the size of the ListBox. Currently supports either `sm`, `md` or `lg` as an option.
503
- */
504
- size: ListBoxSize
505
- }, sortingPropTypes), {}, {
506
- /**
507
- * Callback function for translating ListBoxMenuIcon SVG title
508
- */
509
- translateWithId: PropTypes.func,
510
-
511
- /**
512
- * Specify title to show title on hover
513
- */
514
- useTitleInItem: PropTypes.bool,
515
-
516
- /**
517
- * Specify whether the control is currently in warning state
518
- */
519
- warn: PropTypes.bool,
520
-
521
- /**
522
- * Provide the text that is displayed when the control is in warning state
523
- */
524
- warnText: PropTypes.node
525
- });
526
- FilterableMultiSelect.defaultProps = {
527
- ariaLabel: 'Choose an item',
528
- compareItems: defaultCompareItems,
529
- direction: 'bottom',
530
- disabled: false,
531
- filterItems: defaultFilterItems,
532
- initialSelectedItems: [],
533
- itemToString: defaultItemToString,
534
- locale: 'en',
535
- sortItems: defaultSortItems,
536
- light: false,
537
- open: false,
538
- selectionFeedback: 'top-after-reopen'
539
- };
540
- var FilterableMultiSelectNext = FilterableMultiSelect;
541
-
542
- export { FilterableMultiSelectNext as default };
@@ -1,42 +0,0 @@
1
- /**
2
- * Copyright IBM Corp. 2016, 2022
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
-
8
- import { NotificationActionButton as NotificationActionButton$1, NotificationButton as NotificationButton$1, ToastNotification as ToastNotification$1, InlineNotification as InlineNotification$1, ActionableNotification as ActionableNotification$1 } from './next/Notification.js';
9
- import { NotificationActionButton as NotificationActionButton$2, NotificationTextDetails as NotificationTextDetails$1, NotificationButton as NotificationButton$2, ToastNotification as ToastNotification$2, InlineNotification as InlineNotification$2 } from './Notification.js';
10
- import { createComponentToggle } from '../../internal/ComponentToggle.js';
11
-
12
- var NotificationActionButton = createComponentToggle({
13
- name: 'NotificationActionButton',
14
- next: NotificationActionButton$1,
15
- classic: NotificationActionButton$2
16
- });
17
- var NotificationTextDetails = createComponentToggle({
18
- name: 'NotificationTextDetails',
19
- classic: NotificationTextDetails$1
20
- });
21
- var NotificationButton = createComponentToggle({
22
- name: 'NotificationButton',
23
- next: NotificationButton$1,
24
- classic: NotificationButton$2
25
- });
26
- var ToastNotification = createComponentToggle({
27
- name: 'ToastNotification',
28
- next: ToastNotification$1,
29
- classic: ToastNotification$2
30
- });
31
- var InlineNotification = createComponentToggle({
32
- name: 'InlineNotification',
33
- next: InlineNotification$1,
34
- classic: InlineNotification$2
35
- });
36
- var ActionableNotification = createComponentToggle({
37
- name: 'ActionableNotification',
38
- next: ActionableNotification$1,
39
- classic: null
40
- });
41
-
42
- export { ActionableNotification, InlineNotification, NotificationActionButton, NotificationButton, NotificationTextDetails, ToastNotification };