@zendeskgarden/react-dropdowns 8.57.0 → 8.58.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 (3) hide show
  1. package/dist/index.cjs.js +844 -1123
  2. package/dist/index.esm.js +844 -1123
  3. package/package.json +4 -4
package/dist/index.esm.js CHANGED
@@ -20,202 +20,63 @@ import mergeRefs from 'react-merge-refs';
20
20
  import { useSelection } from '@zendeskgarden/container-selection';
21
21
  import { createPortal } from 'react-dom';
22
22
 
23
- function ownKeys(object, enumerableOnly) {
24
- var keys = Object.keys(object);
25
-
26
- if (Object.getOwnPropertySymbols) {
27
- var symbols = Object.getOwnPropertySymbols(object);
28
- enumerableOnly && (symbols = symbols.filter(function (sym) {
29
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
30
- })), keys.push.apply(keys, symbols);
31
- }
32
-
33
- return keys;
34
- }
35
-
36
- function _objectSpread2(target) {
37
- for (var i = 1; i < arguments.length; i++) {
38
- var source = null != arguments[i] ? arguments[i] : {};
39
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
40
- _defineProperty(target, key, source[key]);
41
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
42
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
43
- });
44
- }
45
-
46
- return target;
47
- }
48
-
49
- function _defineProperty(obj, key, value) {
50
- if (key in obj) {
51
- Object.defineProperty(obj, key, {
52
- value: value,
53
- enumerable: true,
54
- configurable: true,
55
- writable: true
56
- });
57
- } else {
58
- obj[key] = value;
59
- }
60
-
61
- return obj;
62
- }
63
-
64
23
  function _extends$5() {
65
24
  _extends$5 = Object.assign ? Object.assign.bind() : function (target) {
66
25
  for (var i = 1; i < arguments.length; i++) {
67
26
  var source = arguments[i];
68
-
69
27
  for (var key in source) {
70
28
  if (Object.prototype.hasOwnProperty.call(source, key)) {
71
29
  target[key] = source[key];
72
30
  }
73
31
  }
74
32
  }
75
-
76
33
  return target;
77
34
  };
78
35
  return _extends$5.apply(this, arguments);
79
36
  }
80
37
 
81
- function _objectWithoutPropertiesLoose(source, excluded) {
82
- if (source == null) return {};
83
- var target = {};
84
- var sourceKeys = Object.keys(source);
85
- var key, i;
86
-
87
- for (i = 0; i < sourceKeys.length; i++) {
88
- key = sourceKeys[i];
89
- if (excluded.indexOf(key) >= 0) continue;
90
- target[key] = source[key];
91
- }
92
-
93
- return target;
94
- }
95
-
96
- function _objectWithoutProperties(source, excluded) {
97
- if (source == null) return {};
98
-
99
- var target = _objectWithoutPropertiesLoose(source, excluded);
100
-
101
- var key, i;
102
-
103
- if (Object.getOwnPropertySymbols) {
104
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
105
-
106
- for (i = 0; i < sourceSymbolKeys.length; i++) {
107
- key = sourceSymbolKeys[i];
108
- if (excluded.indexOf(key) >= 0) continue;
109
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
110
- target[key] = source[key];
111
- }
112
- }
113
-
114
- return target;
115
- }
116
-
117
- function _slicedToArray(arr, i) {
118
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
119
- }
120
-
121
- function _arrayWithHoles(arr) {
122
- if (Array.isArray(arr)) return arr;
123
- }
124
-
125
- function _iterableToArrayLimit(arr, i) {
126
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
127
-
128
- if (_i == null) return;
129
- var _arr = [];
130
- var _n = true;
131
- var _d = false;
132
-
133
- var _s, _e;
134
-
135
- try {
136
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
137
- _arr.push(_s.value);
138
-
139
- if (i && _arr.length === i) break;
140
- }
141
- } catch (err) {
142
- _d = true;
143
- _e = err;
144
- } finally {
145
- try {
146
- if (!_n && _i["return"] != null) _i["return"]();
147
- } finally {
148
- if (_d) throw _e;
149
- }
150
- }
151
-
152
- return _arr;
153
- }
154
-
155
- function _unsupportedIterableToArray(o, minLen) {
156
- if (!o) return;
157
- if (typeof o === "string") return _arrayLikeToArray(o, minLen);
158
- var n = Object.prototype.toString.call(o).slice(8, -1);
159
- if (n === "Object" && o.constructor) n = o.constructor.name;
160
- if (n === "Map" || n === "Set") return Array.from(o);
161
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
162
- }
163
-
164
- function _arrayLikeToArray(arr, len) {
165
- if (len == null || len > arr.length) len = arr.length;
166
-
167
- for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
168
-
169
- return arr2;
170
- }
171
-
172
- function _nonIterableRest() {
173
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
174
- }
175
-
176
- var DropdownContext = React__default.createContext(undefined);
177
- var useDropdownContext = function useDropdownContext() {
178
- var dropdownContext = useContext(DropdownContext);
38
+ const DropdownContext = React__default.createContext(undefined);
39
+ const useDropdownContext = () => {
40
+ const dropdownContext = useContext(DropdownContext);
179
41
  if (!dropdownContext) {
180
42
  throw new Error('This component must be rendered within a `Dropdown` component.');
181
43
  }
182
44
  return dropdownContext;
183
45
  };
184
46
 
185
- var _excluded$c = ["onKeyDown"],
186
- _excluded2$6 = ["getInputProps", "getToggleButtonProps"];
187
- var REMOVE_ITEM_STATE_TYPE = 'REMOVE_ITEM';
188
- var Dropdown = function Dropdown(props) {
189
- var children = props.children,
190
- isOpen = props.isOpen,
191
- selectedItem = props.selectedItem,
192
- selectedItems = props.selectedItems,
193
- highlightedIndex = props.highlightedIndex,
194
- inputValue = props.inputValue,
195
- onSelect = props.onSelect,
196
- _onStateChange = props.onStateChange,
197
- _onInputValueChange = props.onInputValueChange,
198
- downshiftProps = props.downshiftProps;
199
- var itemIndexRef = useRef(0);
200
- var previousItemRef = useRef(undefined);
201
- var previousIndexRef = useRef(undefined);
202
- var nextItemsHashRef = useRef({});
203
- var containsMultiselectRef = useRef(false);
204
- var itemSearchRegistry = useRef([]);
205
- var _useState = useState(''),
206
- _useState2 = _slicedToArray(_useState, 2),
207
- dropdownType = _useState2[0],
208
- setDropdownType = _useState2[1];
209
- var themeContext = useContext(ThemeContext);
210
- var hasMenuRef = useRef(false);
211
- var popperReferenceElementRef = useRef(null);
212
- var customGetInputProps = function customGetInputProps(_ref, downshift, rtl) {
213
- var onKeyDown = _ref.onKeyDown,
214
- other = _objectWithoutProperties(_ref, _excluded$c);
215
- return _objectSpread2({
216
- onKeyDown: composeEventHandlers(onKeyDown, function (e) {
217
- var PREVIOUS_KEY = rtl ? KEY_CODES.RIGHT : KEY_CODES.LEFT;
218
- var NEXT_KEY = rtl ? KEY_CODES.LEFT : KEY_CODES.RIGHT;
47
+ const REMOVE_ITEM_STATE_TYPE = 'REMOVE_ITEM';
48
+ const Dropdown = props => {
49
+ const {
50
+ children,
51
+ isOpen,
52
+ selectedItem,
53
+ selectedItems,
54
+ highlightedIndex,
55
+ inputValue,
56
+ onSelect,
57
+ onStateChange,
58
+ onInputValueChange,
59
+ downshiftProps
60
+ } = props;
61
+ const itemIndexRef = useRef(0);
62
+ const previousItemRef = useRef(undefined);
63
+ const previousIndexRef = useRef(undefined);
64
+ const nextItemsHashRef = useRef({});
65
+ const containsMultiselectRef = useRef(false);
66
+ const itemSearchRegistry = useRef([]);
67
+ const [dropdownType, setDropdownType] = useState('');
68
+ const themeContext = useContext(ThemeContext);
69
+ const hasMenuRef = useRef(false);
70
+ const popperReferenceElementRef = useRef(null);
71
+ const customGetInputProps = (_ref, downshift, rtl) => {
72
+ let {
73
+ onKeyDown,
74
+ ...other
75
+ } = _ref;
76
+ return {
77
+ onKeyDown: composeEventHandlers(onKeyDown, e => {
78
+ const PREVIOUS_KEY = rtl ? KEY_CODES.RIGHT : KEY_CODES.LEFT;
79
+ const NEXT_KEY = rtl ? KEY_CODES.LEFT : KEY_CODES.RIGHT;
219
80
  if (downshift.isOpen) {
220
81
  if (e.keyCode === PREVIOUS_KEY && previousIndexRef.current !== null && previousIndexRef.current !== undefined && !downshift.inputValue) {
221
82
  e.preventDefault();
@@ -223,7 +84,7 @@ var Dropdown = function Dropdown(props) {
223
84
  downshift.selectItemAtIndex(previousIndexRef.current);
224
85
  }
225
86
  if (e.keyCode === NEXT_KEY) {
226
- var nextItemIndexes = Object.values(nextItemsHashRef.current);
87
+ const nextItemIndexes = Object.values(nextItemsHashRef.current);
227
88
  if (nextItemIndexes.includes(downshift.highlightedIndex)) {
228
89
  e.preventDefault();
229
90
  e.stopPropagation();
@@ -235,23 +96,24 @@ var Dropdown = function Dropdown(props) {
235
96
  e.stopPropagation();
236
97
  downshift.openMenu();
237
98
  }
238
- })
239
- }, other);
99
+ }),
100
+ ...other
101
+ };
240
102
  };
241
- var transformDownshift = function transformDownshift(_ref2) {
242
- var _getInputProps = _ref2.getInputProps,
243
- _getToggleButtonProps = _ref2.getToggleButtonProps,
244
- downshift = _objectWithoutProperties(_ref2, _excluded2$6);
245
- return _objectSpread2({
246
- getInputProps: function getInputProps(p) {
247
- return _getInputProps(customGetInputProps(p, downshift, themeContext.rtl));
248
- },
249
- getToggleButtonProps: function getToggleButtonProps(p) {
250
- return _getToggleButtonProps(_objectSpread2({
251
- 'aria-label': undefined
252
- }, p));
253
- }
254
- }, downshift);
103
+ const transformDownshift = _ref2 => {
104
+ let {
105
+ getInputProps,
106
+ getToggleButtonProps,
107
+ ...downshift
108
+ } = _ref2;
109
+ return {
110
+ getInputProps: p => getInputProps(customGetInputProps(p, downshift, themeContext.rtl)),
111
+ getToggleButtonProps: p => getToggleButtonProps({
112
+ 'aria-label': undefined,
113
+ ...p
114
+ }),
115
+ ...downshift
116
+ };
255
117
  };
256
118
  return React__default.createElement(Manager, null, React__default.createElement(Downshift, _extends$5({
257
119
  suppressRefError: true
@@ -261,26 +123,28 @@ var Dropdown = function Dropdown(props) {
261
123
  selectedItem: selectedItem || null
262
124
  ,
263
125
  inputValue: inputValue,
264
- onInputValueChange: function onInputValueChange(inputVal, stateAndHelpers) {
265
- if (_onInputValueChange) {
126
+ onInputValueChange: (inputVal, stateAndHelpers) => {
127
+ if (onInputValueChange) {
266
128
  if (stateAndHelpers.isOpen) {
267
- _onInputValueChange(inputVal, stateAndHelpers);
129
+ onInputValueChange(inputVal, stateAndHelpers);
268
130
  } else if (dropdownType === 'multiselect') {
269
- _onInputValueChange('', stateAndHelpers);
131
+ onInputValueChange('', stateAndHelpers);
270
132
  }
271
133
  }
272
134
  },
273
- onStateChange: function onStateChange(changes, stateAndHelpers) {
135
+ onStateChange: (changes, stateAndHelpers) => {
274
136
  if (dropdownType === 'autocomplete' && changes.isOpen === false && !changes.selectedItem) {
275
137
  onSelect && onSelect(selectedItem, stateAndHelpers);
276
138
  }
277
139
  if (Object.prototype.hasOwnProperty.call(changes, 'selectedItem') && changes.selectedItem !== null) {
278
140
  if (selectedItems) {
279
- var itemToString = stateAndHelpers.itemToString;
280
- var existingItemIndex = selectedItems.findIndex(function (item) {
141
+ const {
142
+ itemToString
143
+ } = stateAndHelpers;
144
+ const existingItemIndex = selectedItems.findIndex(item => {
281
145
  return itemToString(item) === itemToString(changes.selectedItem);
282
146
  });
283
- var updatedSelectedItems = Array.from(selectedItems);
147
+ const updatedSelectedItems = Array.from(selectedItems);
284
148
  if (existingItemIndex === -1) {
285
149
  updatedSelectedItems.splice(updatedSelectedItems.length, 0, changes.selectedItem);
286
150
  } else {
@@ -298,38 +162,37 @@ var Dropdown = function Dropdown(props) {
298
162
  });
299
163
  }
300
164
  }
301
- _onStateChange && _onStateChange(changes, stateAndHelpers);
165
+ onStateChange && onStateChange(changes, stateAndHelpers);
302
166
  },
303
- stateReducer: function stateReducer(_state, changes) {
167
+ stateReducer: (_state, changes) => {
304
168
  switch (changes.type) {
305
169
  case Downshift.stateChangeTypes.changeInput:
306
170
  if (changes.inputValue === '' && dropdownType === 'combobox') {
307
- return _objectSpread2(_objectSpread2({}, changes), {}, {
171
+ return {
172
+ ...changes,
308
173
  isOpen: false
309
- });
174
+ };
310
175
  }
311
176
  return changes;
312
177
  default:
313
178
  return changes;
314
179
  }
315
180
  }
316
- }, downshiftProps), function (downshift) {
317
- return React__default.createElement(DropdownContext.Provider, {
318
- value: {
319
- hasMenuRef: hasMenuRef,
320
- itemIndexRef: itemIndexRef,
321
- previousItemRef: previousItemRef,
322
- previousIndexRef: previousIndexRef,
323
- nextItemsHashRef: nextItemsHashRef,
324
- popperReferenceElementRef: popperReferenceElementRef,
325
- selectedItems: selectedItems,
326
- downshift: transformDownshift(downshift),
327
- containsMultiselectRef: containsMultiselectRef,
328
- itemSearchRegistry: itemSearchRegistry,
329
- setDropdownType: setDropdownType
330
- }
331
- }, children);
332
- }));
181
+ }, downshiftProps), downshift => React__default.createElement(DropdownContext.Provider, {
182
+ value: {
183
+ hasMenuRef,
184
+ itemIndexRef,
185
+ previousItemRef,
186
+ previousIndexRef,
187
+ nextItemsHashRef,
188
+ popperReferenceElementRef,
189
+ selectedItems,
190
+ downshift: transformDownshift(downshift),
191
+ containsMultiselectRef,
192
+ itemSearchRegistry,
193
+ setDropdownType
194
+ }
195
+ }, children)));
333
196
  };
334
197
  Dropdown.propTypes = {
335
198
  isOpen: PropTypes.bool,
@@ -361,7 +224,7 @@ function getPopperPlacement(gardenPlacement) {
361
224
  }
362
225
  }
363
226
  function getRtlPopperPlacement(gardenPlacement) {
364
- var popperPlacement = getPopperPlacement(gardenPlacement);
227
+ const popperPlacement = getPopperPlacement(gardenPlacement);
365
228
  switch (popperPlacement) {
366
229
  case 'left':
367
230
  return 'right';
@@ -388,7 +251,7 @@ function getRtlPopperPlacement(gardenPlacement) {
388
251
  }
389
252
  }
390
253
  function getArrowPosition(popperPlacement) {
391
- var arrowPositionMappings = {
254
+ const arrowPositionMappings = {
392
255
  auto: 'top',
393
256
  top: 'bottom',
394
257
  'top-start': 'bottom-left',
@@ -412,85 +275,65 @@ function getMenuPosition(popperPlacement) {
412
275
  return popperPlacement ? popperPlacement.split('-')[0] : 'bottom';
413
276
  }
414
277
 
415
- var COMPONENT_ID$m = 'dropdowns.menu';
416
- var StyledMenu = styled.ul.attrs(function (props) {
417
- return {
418
- 'data-garden-id': COMPONENT_ID$m,
419
- 'data-garden-version': '8.57.0',
420
- className: props.isAnimated && 'is-animated'
421
- };
422
- }).withConfig({
278
+ const COMPONENT_ID$m = 'dropdowns.menu';
279
+ const StyledMenu = styled.ul.attrs(props => ({
280
+ 'data-garden-id': COMPONENT_ID$m,
281
+ 'data-garden-version': '8.58.0',
282
+ className: props.isAnimated && 'is-animated'
283
+ })).withConfig({
423
284
  displayName: "StyledMenu",
424
285
  componentId: "sc-1vpttfd-0"
425
- })(["position:static !important;max-height:", ";overflow-y:auto;", ";", ";"], function (props) {
426
- return props.maxHeight;
427
- }, function (props) {
428
- return props.hasArrow && arrowStyles(getArrowPosition(props.placement), {
429
- size: "".concat(props.theme.space.base * 2, "px"),
430
- inset: '2px',
431
- animationModifier: props.isAnimated ? '.is-animated' : undefined
432
- });
433
- }, function (props) {
434
- return retrieveComponentStyles(COMPONENT_ID$m, props);
435
- });
286
+ })(["position:static !important;max-height:", ";overflow-y:auto;", ";", ";"], props => props.maxHeight, props => props.hasArrow && arrowStyles(getArrowPosition(props.placement), {
287
+ size: `${props.theme.space.base * 2}px`,
288
+ inset: '2px',
289
+ animationModifier: props.isAnimated ? '.is-animated' : undefined
290
+ }), props => retrieveComponentStyles(COMPONENT_ID$m, props));
436
291
  StyledMenu.defaultProps = {
437
292
  theme: DEFAULT_THEME
438
293
  };
439
294
 
440
- var COMPONENT_ID$l = 'dropdowns.menu_wrapper';
441
- var StyledMenuWrapper = styled.div.attrs(function (props) {
442
- return {
443
- 'data-garden-id': COMPONENT_ID$l,
444
- 'data-garden-version': '8.57.0',
445
- className: props.isAnimated && 'is-animated'
446
- };
447
- }).withConfig({
295
+ const COMPONENT_ID$l = 'dropdowns.menu_wrapper';
296
+ const StyledMenuWrapper = styled.div.attrs(props => ({
297
+ 'data-garden-id': COMPONENT_ID$l,
298
+ 'data-garden-version': '8.58.0',
299
+ className: props.isAnimated && 'is-animated'
300
+ })).withConfig({
448
301
  displayName: "StyledMenuWrapper",
449
302
  componentId: "sc-tiwdxz-0"
450
- })(["", ";", ";"], function (props) {
451
- return menuStyles(getMenuPosition(props.placement), {
452
- theme: props.theme,
453
- hidden: props.isHidden,
454
- margin: "".concat(props.theme.space.base * (props.hasArrow ? 2 : 1), "px"),
455
- zIndex: props.zIndex,
456
- animationModifier: props.isAnimated ? '.is-animated' : undefined
457
- });
458
- }, function (props) {
459
- return retrieveComponentStyles(COMPONENT_ID$l, props);
460
- });
303
+ })(["", ";", ";"], props => menuStyles(getMenuPosition(props.placement), {
304
+ theme: props.theme,
305
+ hidden: props.isHidden,
306
+ margin: `${props.theme.space.base * (props.hasArrow ? 2 : 1)}px`,
307
+ zIndex: props.zIndex,
308
+ animationModifier: props.isAnimated ? '.is-animated' : undefined
309
+ }), props => retrieveComponentStyles(COMPONENT_ID$l, props));
461
310
  StyledMenuWrapper.defaultProps = {
462
311
  theme: DEFAULT_THEME
463
312
  };
464
313
 
465
- var COMPONENT_ID$k = 'dropdowns.separator';
466
- var StyledSeparator = styled.li.attrs({
314
+ const COMPONENT_ID$k = 'dropdowns.separator';
315
+ const StyledSeparator = styled.li.attrs({
467
316
  'data-garden-id': COMPONENT_ID$k,
468
- 'data-garden-version': '8.57.0',
317
+ 'data-garden-version': '8.58.0',
469
318
  role: 'separator'
470
319
  }).withConfig({
471
320
  displayName: "StyledSeparator",
472
321
  componentId: "sc-1mrnp18-0"
473
- })(["display:block;margin:", "px 0;border-bottom:", ";", ";"], function (props) {
474
- return props.theme.space.base;
475
- }, function (props) {
476
- return "".concat(props.theme.borders.sm, " ").concat(getColor('neutralHue', 200, props.theme));
477
- }, function (props) {
478
- return retrieveComponentStyles(COMPONENT_ID$k, props);
479
- });
322
+ })(["display:block;margin:", "px 0;border-bottom:", ";", ";"], props => props.theme.space.base, props => `${props.theme.borders.sm} ${getColor('neutralHue', 200, props.theme)}`, props => retrieveComponentStyles(COMPONENT_ID$k, props));
480
323
  StyledSeparator.defaultProps = {
481
324
  theme: DEFAULT_THEME
482
325
  };
483
326
 
484
- var COMPONENT_ID$j = 'dropdowns.item';
485
- var getItemPaddingVertical = function getItemPaddingVertical(props) {
327
+ const COMPONENT_ID$j = 'dropdowns.item';
328
+ const getItemPaddingVertical = props => {
486
329
  if (props.isCompact) {
487
- return "".concat(props.theme.space.base, "px");
330
+ return `${props.theme.space.base}px`;
488
331
  }
489
- return "".concat(props.theme.space.base * 2, "px");
332
+ return `${props.theme.space.base * 2}px`;
490
333
  };
491
- var getColorStyles = function getColorStyles(props) {
492
- var foregroundColor;
493
- var backgroundColor;
334
+ const getColorStyles = props => {
335
+ let foregroundColor;
336
+ let backgroundColor;
494
337
  if (props.disabled) {
495
338
  foregroundColor = getColor('neutralHue', 400, props.theme);
496
339
  } else if (props.isDanger) {
@@ -502,115 +345,65 @@ var getColorStyles = function getColorStyles(props) {
502
345
  }
503
346
  return css(["background-color:", ";color:", ";& a,& a:hover,& a:focus,& a:active{color:inherit;}"], backgroundColor, foregroundColor);
504
347
  };
505
- var StyledItem = styled.li.attrs(function (props) {
506
- return {
507
- 'data-garden-id': COMPONENT_ID$j,
508
- 'data-garden-version': '8.57.0',
509
- 'aria-disabled': props.disabled
510
- };
511
- }).withConfig({
348
+ const StyledItem = styled.li.attrs(props => ({
349
+ 'data-garden-id': COMPONENT_ID$j,
350
+ 'data-garden-version': '8.58.0',
351
+ 'aria-disabled': props.disabled
352
+ })).withConfig({
512
353
  displayName: "StyledItem",
513
354
  componentId: "sc-1xeog7q-0"
514
- })(["display:block;position:relative;z-index:0;cursor:", ";padding:", " ", "px;text-decoration:none;line-height:", "px;word-wrap:break-word;user-select:none;&:first-child{margin-top:", "px;}&:last-child{margin-bottom:", "px;}&:focus{outline:none;}& a,& a:hover,& a:focus,& a:active{text-decoration:none;}", ";", ";"], function (props) {
515
- return props.disabled ? 'default' : 'pointer';
516
- }, function (props) {
517
- return getItemPaddingVertical(props);
518
- }, function (props) {
519
- return props.theme.space.base * 9;
520
- }, function (props) {
521
- return props.theme.space.base * 5;
522
- }, function (props) {
523
- return props.theme.space.base;
524
- }, function (props) {
525
- return props.theme.space.base;
526
- }, function (props) {
527
- return getColorStyles(props);
528
- }, function (props) {
529
- return retrieveComponentStyles(COMPONENT_ID$j, props);
530
- });
355
+ })(["display:block;position:relative;z-index:0;cursor:", ";padding:", " ", "px;text-decoration:none;line-height:", "px;word-wrap:break-word;user-select:none;&:first-child{margin-top:", "px;}&:last-child{margin-bottom:", "px;}&:focus{outline:none;}& a,& a:hover,& a:focus,& a:active{text-decoration:none;}", ";", ";"], props => props.disabled ? 'default' : 'pointer', props => getItemPaddingVertical(props), props => props.theme.space.base * 9, props => props.theme.space.base * 5, props => props.theme.space.base, props => props.theme.space.base, props => getColorStyles(props), props => retrieveComponentStyles(COMPONENT_ID$j, props));
531
356
  StyledItem.defaultProps = {
532
357
  theme: DEFAULT_THEME
533
358
  };
534
359
 
535
- var COMPONENT_ID$i = 'dropdowns.add_item';
536
- var StyledAddItem = styled(StyledItem).attrs({
360
+ const COMPONENT_ID$i = 'dropdowns.add_item';
361
+ const StyledAddItem = styled(StyledItem).attrs({
537
362
  'data-garden-id': COMPONENT_ID$i,
538
- 'data-garden-version': '8.57.0'
363
+ 'data-garden-version': '8.58.0'
539
364
  }).withConfig({
540
365
  displayName: "StyledAddItem",
541
366
  componentId: "sc-ekqk50-0"
542
- })(["color:", ";", ";"], function (props) {
543
- return !props.disabled && getColor('primaryHue', 600, props.theme);
544
- }, function (props) {
545
- return retrieveComponentStyles(COMPONENT_ID$i, props);
546
- });
367
+ })(["color:", ";", ";"], props => !props.disabled && getColor('primaryHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$i, props));
547
368
  StyledAddItem.defaultProps = {
548
369
  theme: DEFAULT_THEME
549
370
  };
550
371
 
551
- var COMPONENT_ID$h = 'dropdowns.item_meta';
552
- var StyledItemMeta = styled.span.attrs({
372
+ const COMPONENT_ID$h = 'dropdowns.item_meta';
373
+ const StyledItemMeta = styled.span.attrs({
553
374
  'data-garden-id': COMPONENT_ID$h,
554
- 'data-garden-version': '8.57.0'
375
+ 'data-garden-version': '8.58.0'
555
376
  }).withConfig({
556
377
  displayName: "StyledItemMeta",
557
378
  componentId: "sc-k6xy28-0"
558
- })(["display:block;line-height:", "px;color:", ";font-size:", ";", ";"], function (props) {
559
- return props.theme.space.base * (props.isCompact ? 3 : 4);
560
- }, function (props) {
561
- return getColor('neutralHue', props.isDisabled ? 400 : 600, props.theme);
562
- }, function (props) {
563
- return props.theme.fontSizes.sm;
564
- }, function (props) {
565
- return retrieveComponentStyles(COMPONENT_ID$h, props);
566
- });
379
+ })(["display:block;line-height:", "px;color:", ";font-size:", ";", ";"], props => props.theme.space.base * (props.isCompact ? 3 : 4), props => getColor('neutralHue', props.isDisabled ? 400 : 600, props.theme), props => props.theme.fontSizes.sm, props => retrieveComponentStyles(COMPONENT_ID$h, props));
567
380
  StyledItemMeta.defaultProps = {
568
381
  theme: DEFAULT_THEME
569
382
  };
570
383
 
571
- var COMPONENT_ID$g = 'dropdowns.item_icon';
572
- var getSizeStyles = function getSizeStyles(props) {
573
- return css(["width:", ";height:calc(", "px + ", ");"], props.theme.iconSizes.md, props.theme.space.base * 5, math("".concat(getItemPaddingVertical(props), " * 2")));
384
+ const COMPONENT_ID$g = 'dropdowns.item_icon';
385
+ const getSizeStyles = props => {
386
+ return css(["width:", ";height:calc(", "px + ", ");"], props.theme.iconSizes.md, props.theme.space.base * 5, math(`${getItemPaddingVertical(props)} * 2`));
574
387
  };
575
- var StyledItemIcon = styled.div.attrs({
388
+ const StyledItemIcon = styled.div.attrs({
576
389
  'data-garden-id': COMPONENT_ID$g,
577
- 'data-garden-version': '8.57.0'
390
+ 'data-garden-version': '8.58.0'
578
391
  }).withConfig({
579
392
  displayName: "StyledItemIcon",
580
393
  componentId: "sc-1v0ty11-0"
581
- })(["display:flex;position:absolute;top:0;", ":", "px;align-items:center;justify-content:center;transition:opacity 0.1s ease-in-out;opacity:", ";color:", ";", ";& > *{width:", ";height:", ";}"], function (props) {
582
- return props.theme.rtl ? 'right' : 'left';
583
- }, function (props) {
584
- return props.theme.space.base * 3;
585
- }, function (props) {
586
- return props.isVisible ? '1' : '0';
587
- }, function (props) {
588
- return props.isDisabled ? 'inherit' : getColor('primaryHue', 600, props.theme);
589
- }, function (props) {
590
- return getSizeStyles(props);
591
- }, function (props) {
592
- return props.theme.iconSizes.md;
593
- }, function (props) {
594
- return props.theme.iconSizes.md;
595
- });
394
+ })(["display:flex;position:absolute;top:0;", ":", "px;align-items:center;justify-content:center;transition:opacity 0.1s ease-in-out;opacity:", ";color:", ";", ";& > *{width:", ";height:", ";}"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 3, props => props.isVisible ? '1' : '0', props => props.isDisabled ? 'inherit' : getColor('primaryHue', 600, props.theme), props => getSizeStyles(props), props => props.theme.iconSizes.md, props => props.theme.iconSizes.md);
596
395
  StyledItemIcon.defaultProps = {
597
396
  theme: DEFAULT_THEME
598
397
  };
599
398
 
600
- var COMPONENT_ID$f = 'dropdowns.next_item';
601
- var StyledNextItem = styled(StyledItem).attrs({
399
+ const COMPONENT_ID$f = 'dropdowns.next_item';
400
+ const StyledNextItem = styled(StyledItem).attrs({
602
401
  'data-garden-id': COMPONENT_ID$f,
603
- 'data-garden-version': '8.57.0'
402
+ 'data-garden-version': '8.58.0'
604
403
  }).withConfig({
605
404
  displayName: "StyledNextItem",
606
405
  componentId: "sc-1bcygn5-0"
607
- })(["", "{right:", ";left:", ";}", ";"], StyledItemIcon, function (props) {
608
- return props.theme.rtl ? 'auto' : "".concat(props.theme.space.base * 3, "px");
609
- }, function (props) {
610
- return props.theme.rtl ? "".concat(props.theme.space.base * 3, "px") : 'auto';
611
- }, function (props) {
612
- return retrieveComponentStyles(COMPONENT_ID$f, props);
613
- });
406
+ })(["", "{right:", ";left:", ";}", ";"], StyledItemIcon, props => props.theme.rtl ? 'auto' : `${props.theme.space.base * 3}px`, props => props.theme.rtl ? `${props.theme.space.base * 3}px` : 'auto', props => retrieveComponentStyles(COMPONENT_ID$f, props));
614
407
  StyledNextItem.defaultProps = {
615
408
  theme: DEFAULT_THEME
616
409
  };
@@ -626,48 +419,41 @@ var SvgChevronRightStroke = function SvgChevronRightStroke(props) {
626
419
  height: 16,
627
420
  focusable: "false",
628
421
  viewBox: "0 0 16 16",
629
- "aria-hidden": "true"
422
+ "aria-hidden": "true",
423
+ role: "img"
630
424
  }, props), _path$4 || (_path$4 = /*#__PURE__*/React.createElement("path", {
631
425
  fill: "currentColor",
632
426
  d: "M5.61 3.312a.5.5 0 01.718-.69l.062.066 4 5a.5.5 0 01.054.542l-.054.082-4 5a.5.5 0 01-.83-.55l.05-.074L9.359 8l-3.75-4.688z"
633
427
  })));
634
428
  };
635
429
 
636
- var COMPONENT_ID$e = 'dropdowns.next_item_icon';
637
- var NextIconComponent = function NextIconComponent(_ref) {
638
- var className = _ref.className;
430
+ const COMPONENT_ID$e = 'dropdowns.next_item_icon';
431
+ const NextIconComponent = _ref => {
432
+ let {
433
+ className
434
+ } = _ref;
639
435
  return React__default.createElement(SvgChevronRightStroke, {
640
436
  "data-garden-id": COMPONENT_ID$e,
641
- "data-garden-version": '8.57.0',
437
+ "data-garden-version": '8.58.0',
642
438
  className: className
643
439
  });
644
440
  };
645
- var StyledNextIcon = styled(NextIconComponent).withConfig({
441
+ const StyledNextIcon = styled(NextIconComponent).withConfig({
646
442
  displayName: "StyledNextIcon",
647
443
  componentId: "sc-1rinki2-0"
648
- })(["transform:", ";color:", ";", ";"], function (props) {
649
- return props.theme.rtl && 'rotate(180deg)';
650
- }, function (props) {
651
- return props.isDisabled ? 'inherit' : getColor('neutralHue', 600, props.theme);
652
- }, function (props) {
653
- return retrieveComponentStyles(COMPONENT_ID$e, props);
654
- });
444
+ })(["transform:", ";color:", ";", ";"], props => props.theme.rtl && 'rotate(180deg)', props => props.isDisabled ? 'inherit' : getColor('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$e, props));
655
445
  StyledNextIcon.defaultProps = {
656
446
  theme: DEFAULT_THEME
657
447
  };
658
448
 
659
- var COMPONENT_ID$d = 'dropdowns.previous_item';
660
- var StyledPreviousItem = styled(StyledItem).attrs({
449
+ const COMPONENT_ID$d = 'dropdowns.previous_item';
450
+ const StyledPreviousItem = styled(StyledItem).attrs({
661
451
  'data-garden-id': COMPONENT_ID$d,
662
- 'data-garden-version': '8.57.0'
452
+ 'data-garden-version': '8.58.0'
663
453
  }).withConfig({
664
454
  displayName: "StyledPreviousItem",
665
455
  componentId: "sc-1nmdds9-0"
666
- })(["font-weight:", ";", ";"], function (props) {
667
- return props.theme.fontWeights.semibold;
668
- }, function (props) {
669
- return retrieveComponentStyles(COMPONENT_ID$d, props);
670
- });
456
+ })(["font-weight:", ";", ";"], props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID$d, props));
671
457
  StyledPreviousItem.defaultProps = {
672
458
  theme: DEFAULT_THEME
673
459
  };
@@ -683,326 +469,245 @@ var SvgChevronLeftStroke = function SvgChevronLeftStroke(props) {
683
469
  height: 16,
684
470
  focusable: "false",
685
471
  viewBox: "0 0 16 16",
686
- "aria-hidden": "true"
472
+ "aria-hidden": "true",
473
+ role: "img"
687
474
  }, props), _path$3 || (_path$3 = /*#__PURE__*/React.createElement("path", {
688
475
  fill: "currentColor",
689
476
  d: "M10.39 12.688a.5.5 0 01-.718.69l-.062-.066-4-5a.5.5 0 01-.054-.542l.054-.082 4-5a.5.5 0 01.83.55l-.05.074L6.641 8l3.75 4.688z"
690
477
  })));
691
478
  };
692
479
 
693
- var COMPONENT_ID$c = 'dropdowns.previous_item_icon';
694
- var PreviousIconComponent = function PreviousIconComponent(_ref) {
695
- var className = _ref.className;
480
+ const COMPONENT_ID$c = 'dropdowns.previous_item_icon';
481
+ const PreviousIconComponent = _ref => {
482
+ let {
483
+ className
484
+ } = _ref;
696
485
  return React__default.createElement(SvgChevronLeftStroke, {
697
486
  "data-garden-id": COMPONENT_ID$c,
698
- "data-garden-version": '8.57.0',
487
+ "data-garden-version": '8.58.0',
699
488
  className: className
700
489
  });
701
490
  };
702
- var StyledPreviousIcon = styled(PreviousIconComponent).withConfig({
491
+ const StyledPreviousIcon = styled(PreviousIconComponent).withConfig({
703
492
  displayName: "StyledPreviousIcon",
704
493
  componentId: "sc-czfwj7-0"
705
- })(["transform:", ";color:", ";", ";"], function (props) {
706
- return props.theme.rtl && 'rotate(180deg)';
707
- }, function (props) {
708
- return props.isDisabled ? 'inherit' : getColor('neutralHue', 600, props.theme);
709
- }, function (props) {
710
- return retrieveComponentStyles(COMPONENT_ID$c, props);
711
- });
494
+ })(["transform:", ";color:", ";", ";"], props => props.theme.rtl && 'rotate(180deg)', props => props.isDisabled ? 'inherit' : getColor('neutralHue', 600, props.theme), props => retrieveComponentStyles(COMPONENT_ID$c, props));
712
495
  StyledPreviousIcon.defaultProps = {
713
496
  theme: DEFAULT_THEME
714
497
  };
715
498
 
716
- var COMPONENT_ID$b = 'dropdowns.header_icon';
717
- var StyledHeaderIcon = styled.div.attrs({
499
+ const COMPONENT_ID$b = 'dropdowns.header_icon';
500
+ const StyledHeaderIcon = styled.div.attrs({
718
501
  'data-garden-id': COMPONENT_ID$b,
719
- 'data-garden-version': '8.57.0'
502
+ 'data-garden-version': '8.58.0'
720
503
  }).withConfig({
721
504
  displayName: "StyledHeaderIcon",
722
505
  componentId: "sc-1fl6nsz-0"
723
- })(["display:flex;position:absolute;top:0;bottom:0;align-items:center;justify-content:center;", ":", "px;color:", ";& > *{width:", ";height:", ";}", ";"], function (props) {
724
- return props.theme.rtl ? 'right' : 'left';
725
- }, function (props) {
726
- return props.theme.space.base * 3;
727
- }, function (props) {
728
- return getColor('neutralHue', 600, props.theme);
729
- }, function (props) {
730
- return props.theme.iconSizes.md;
731
- }, function (props) {
732
- return props.theme.iconSizes.md;
733
- }, function (props) {
734
- return retrieveComponentStyles(COMPONENT_ID$b, props);
735
- });
506
+ })(["display:flex;position:absolute;top:0;bottom:0;align-items:center;justify-content:center;", ":", "px;color:", ";& > *{width:", ";height:", ";}", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 3, props => getColor('neutralHue', 600, props.theme), props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => retrieveComponentStyles(COMPONENT_ID$b, props));
736
507
  StyledHeaderIcon.defaultProps = {
737
508
  theme: DEFAULT_THEME
738
509
  };
739
510
 
740
- var COMPONENT_ID$a = 'dropdowns.header_item';
741
- var getHorizontalPadding = function getHorizontalPadding(props) {
511
+ const COMPONENT_ID$a = 'dropdowns.header_item';
512
+ const getHorizontalPadding = props => {
742
513
  if (props.hasIcon) {
743
514
  return undefined;
744
515
  }
745
- return "".concat(props.theme.space.base * 3, "px");
516
+ return `${props.theme.space.base * 3}px`;
746
517
  };
747
- var StyledHeaderItem = styled(StyledItem).attrs({
518
+ const StyledHeaderItem = styled(StyledItem).attrs({
748
519
  'data-garden-id': COMPONENT_ID$a,
749
- 'data-garden-version': '8.57.0'
520
+ 'data-garden-version': '8.58.0'
750
521
  }).withConfig({
751
522
  displayName: "StyledHeaderItem",
752
523
  componentId: "sc-137filx-0"
753
- })(["cursor:default;padding-right:", ";padding-left:", ";font-weight:", ";", ";"], function (props) {
754
- return getHorizontalPadding(props);
755
- }, function (props) {
756
- return getHorizontalPadding(props);
757
- }, function (props) {
758
- return props.theme.fontWeights.semibold;
759
- }, function (props) {
760
- return retrieveComponentStyles(COMPONENT_ID$a, props);
761
- });
524
+ })(["cursor:default;padding-right:", ";padding-left:", ";font-weight:", ";", ";"], props => getHorizontalPadding(props), props => getHorizontalPadding(props), props => props.theme.fontWeights.semibold, props => retrieveComponentStyles(COMPONENT_ID$a, props));
762
525
  StyledHeaderItem.defaultProps = {
763
526
  theme: DEFAULT_THEME
764
527
  };
765
528
 
766
- var COMPONENT_ID$9 = 'dropdowns.media_body';
767
- var StyledMediaBody = styled.div.attrs({
529
+ const COMPONENT_ID$9 = 'dropdowns.media_body';
530
+ const StyledMediaBody = styled.div.attrs({
768
531
  'data-garden-id': COMPONENT_ID$9,
769
- 'data-garden-version': '8.57.0'
532
+ 'data-garden-version': '8.58.0'
770
533
  }).withConfig({
771
534
  displayName: "StyledMediaBody",
772
535
  componentId: "sc-36j7ef-0"
773
- })(["display:block;overflow:hidden;padding-", ":", "px;", ";"], function (props) {
774
- return props.theme.rtl ? 'right' : 'left';
775
- }, function (props) {
776
- return props.theme.space.base * 2;
777
- }, function (props) {
778
- return retrieveComponentStyles(COMPONENT_ID$9, props);
779
- });
536
+ })(["display:block;overflow:hidden;padding-", ":", "px;", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 2, props => retrieveComponentStyles(COMPONENT_ID$9, props));
780
537
  StyledMediaBody.defaultProps = {
781
538
  theme: DEFAULT_THEME
782
539
  };
783
540
 
784
- var _excluded$b = ["children", "isCompact", "theme"];
785
- var COMPONENT_ID$8 = 'dropdowns.media_figure';
786
- var StyledMediaFigure = styled(
787
- function (_ref) {
788
- var children = _ref.children;
789
- _ref.isCompact;
790
- _ref.theme;
791
- var props = _objectWithoutProperties(_ref, _excluded$b);
541
+ const COMPONENT_ID$8 = 'dropdowns.media_figure';
542
+ const StyledMediaFigure = styled(
543
+ _ref => {
544
+ let {
545
+ children,
546
+ isCompact,
547
+ theme,
548
+ ...props
549
+ } = _ref;
792
550
  return (
793
551
  React__default.cloneElement(Children.only(children), props)
794
552
  );
795
553
  }).attrs({
796
554
  'data-garden-id': COMPONENT_ID$8,
797
- 'data-garden-version': '8.57.0'
555
+ 'data-garden-version': '8.58.0'
798
556
  }).withConfig({
799
557
  displayName: "StyledMediaFigure",
800
558
  componentId: "sc-2f2x8x-0"
801
- })(["float:", ";margin-top:", "px !important;width:", ";height:", ";", ";"], function (props) {
802
- return props.theme.rtl ? 'right' : 'left';
803
- }, function (props) {
804
- return props.theme.space.base * 0.5;
805
- }, function (props) {
806
- return props.theme.iconSizes.md;
807
- }, function (props) {
808
- return props.theme.iconSizes.md;
809
- }, function (props) {
810
- return retrieveComponentStyles(COMPONENT_ID$8, props);
811
- });
559
+ })(["float:", ";margin-top:", "px !important;width:", ";height:", ";", ";"], props => props.theme.rtl ? 'right' : 'left', props => props.theme.space.base * 0.5, props => props.theme.iconSizes.md, props => props.theme.iconSizes.md, props => retrieveComponentStyles(COMPONENT_ID$8, props));
812
560
  StyledMediaFigure.defaultProps = {
813
561
  theme: DEFAULT_THEME
814
562
  };
815
563
 
816
- var COMPONENT_ID$7 = 'dropdowns.media_item';
817
- var StyledMediaItem = styled(StyledItem).attrs({
564
+ const COMPONENT_ID$7 = 'dropdowns.media_item';
565
+ const StyledMediaItem = styled(StyledItem).attrs({
818
566
  'data-garden-id': COMPONENT_ID$7,
819
- 'data-garden-version': '8.57.0'
567
+ 'data-garden-version': '8.58.0'
820
568
  }).withConfig({
821
569
  displayName: "StyledMediaItem",
822
570
  componentId: "sc-ikwshz-0"
823
- })(["", ";"], function (props) {
824
- return retrieveComponentStyles(COMPONENT_ID$7, props);
825
- });
571
+ })(["", ";"], props => retrieveComponentStyles(COMPONENT_ID$7, props));
826
572
  StyledMediaItem.defaultProps = {
827
573
  theme: DEFAULT_THEME
828
574
  };
829
575
 
830
- var COMPONENT_ID$6 = 'dropdowns.faux_input';
831
- var StyledFauxInput = styled(FauxInput).attrs(function (props) {
832
- return {
833
- 'data-garden-id': COMPONENT_ID$6,
834
- 'data-garden-version': '8.57.0',
835
- mediaLayout: true,
836
- theme: props.theme
837
- };
838
- }).withConfig({
576
+ const COMPONENT_ID$6 = 'dropdowns.faux_input';
577
+ const StyledFauxInput = styled(FauxInput).attrs(props => ({
578
+ 'data-garden-id': COMPONENT_ID$6,
579
+ 'data-garden-version': '8.58.0',
580
+ mediaLayout: true,
581
+ theme: props.theme
582
+ })).withConfig({
839
583
  displayName: "StyledFauxInput",
840
584
  componentId: "sc-1l592ed-0"
841
- })(["cursor:", ";min-width:", "px;", ";"], function (props) {
842
- return !props.disabled && 'pointer';
843
- }, function (props) {
844
- return props.theme.space.base * (props.isCompact ? 25 : 36);
845
- }, function (props) {
846
- return retrieveComponentStyles(COMPONENT_ID$6, props);
847
- });
585
+ })(["cursor:", ";min-width:", "px;", ";"], props => !props.disabled && 'pointer', props => props.theme.space.base * (props.isCompact ? 25 : 36), props => retrieveComponentStyles(COMPONENT_ID$6, props));
848
586
  StyledFauxInput.defaultProps = {
849
587
  theme: DEFAULT_THEME
850
588
  };
851
589
 
852
- var COMPONENT_ID$5 = 'dropdowns.input';
853
- var hiddenStyling = css(["position:fixed;border:0;clip:rect(1px,1px,1px,1px);padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
854
- var StyledInput = styled(Input).attrs({
590
+ const COMPONENT_ID$5 = 'dropdowns.input';
591
+ const hiddenStyling = css(["position:fixed;border:0;clip:rect(1px,1px,1px,1px);padding:0;width:1px;height:1px;overflow:hidden;white-space:nowrap;"]);
592
+ const StyledInput = styled(Input).attrs({
855
593
  'data-garden-id': COMPONENT_ID$5,
856
- 'data-garden-version': '8.57.0',
594
+ 'data-garden-version': '8.58.0',
857
595
  isBare: true
858
596
  }).withConfig({
859
597
  displayName: "StyledInput",
860
598
  componentId: "sc-hzhvmp-0"
861
- })(["", ";", ";"], function (props) {
862
- return props.isHidden && hiddenStyling;
863
- }, function (props) {
864
- return retrieveComponentStyles(COMPONENT_ID$5, props);
865
- });
599
+ })(["", ";", ";"], props => props.isHidden && hiddenStyling, props => retrieveComponentStyles(COMPONENT_ID$5, props));
866
600
  StyledInput.defaultProps = {
867
601
  theme: DEFAULT_THEME
868
602
  };
869
603
 
870
- var COMPONENT_ID$4 = 'dropdowns.select';
871
- var StyledSelect = styled.div.attrs({
604
+ const COMPONENT_ID$4 = 'dropdowns.select';
605
+ const StyledSelect = styled.div.attrs({
872
606
  'data-garden-id': COMPONENT_ID$4,
873
- 'data-garden-version': '8.57.0'
607
+ 'data-garden-version': '8.58.0'
874
608
  }).withConfig({
875
609
  displayName: "StyledSelect",
876
610
  componentId: "sc-xifmwj-0"
877
- })(["flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;", ";"], function (props) {
878
- return retrieveComponentStyles(COMPONENT_ID$4, props);
879
- });
611
+ })(["flex-grow:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;", ";"], props => retrieveComponentStyles(COMPONENT_ID$4, props));
880
612
  StyledSelect.defaultProps = {
881
613
  theme: DEFAULT_THEME
882
614
  };
883
615
 
884
- var COMPONENT_ID$3 = 'dropdowns.multiselect_input';
885
- var visibleStyling = function visibleStyling(props) {
886
- var margin = props.isVisible ? "".concat(props.theme.space.base / 2, "px") : 0;
887
- var minWidth = props.isVisible ? "".concat(props.theme.space.base * 15, "px") : 0;
888
- var height = '0';
616
+ const COMPONENT_ID$3 = 'dropdowns.multiselect_input';
617
+ const visibleStyling = props => {
618
+ const margin = props.isVisible ? `${props.theme.space.base / 2}px` : 0;
619
+ const minWidth = props.isVisible ? `${props.theme.space.base * 15}px` : 0;
620
+ let height = '0';
889
621
  if (props.isVisible) {
890
- height = "".concat(props.theme.space.base * (props.isCompact ? 5 : 8), "px");
622
+ height = `${props.theme.space.base * (props.isCompact ? 5 : 8)}px`;
891
623
  }
892
624
  return css(["opacity:", ";margin:", ";width:", ";min-width:", ";height:", ";"], !props.isVisible && 0, margin, !props.isVisible && 0, minWidth, height);
893
625
  };
894
- var StyledMultiselectInput = styled(StyledInput).attrs({
626
+ const StyledMultiselectInput = styled(StyledInput).attrs({
895
627
  'data-garden-id': COMPONENT_ID$3,
896
- 'data-garden-version': '8.57.0'
628
+ 'data-garden-version': '8.58.0'
897
629
  }).withConfig({
898
630
  displayName: "StyledMultiselectInput",
899
631
  componentId: "sc-1avnf6f-0"
900
- })(["flex-basis:", "px;flex-grow:1;align-self:center;min-height:0;", ";", ";"], function (props) {
901
- return props.theme.space.base * 15;
902
- }, function (props) {
903
- return visibleStyling(props);
904
- }, function (props) {
905
- return retrieveComponentStyles(COMPONENT_ID$3, props);
906
- });
632
+ })(["flex-basis:", "px;flex-grow:1;align-self:center;min-height:0;", ";", ";"], props => props.theme.space.base * 15, props => visibleStyling(props), props => retrieveComponentStyles(COMPONENT_ID$3, props));
907
633
  StyledMultiselectInput.defaultProps = {
908
634
  theme: DEFAULT_THEME
909
635
  };
910
636
 
911
- var COMPONENT_ID$2 = 'dropdowns.multiselect_items_container';
912
- var sizeStyles = function sizeStyles(props) {
913
- var margin;
914
- var padding;
637
+ const COMPONENT_ID$2 = 'dropdowns.multiselect_items_container';
638
+ const sizeStyles = props => {
639
+ let margin;
640
+ let padding;
915
641
  if (!props.isBare) {
916
- var marginVertical = props.isCompact ? "-".concat(props.theme.space.base * 1.5, "px") : "-".concat(props.theme.space.base * 2.5, "px");
917
- margin = "".concat(marginVertical, " 0");
918
- var paddingVertical = props.isCompact ? '3px' : '1px';
919
- var paddingEnd = "".concat(props.theme.space.base, "px");
920
- padding = "".concat(paddingVertical, " ").concat(props.theme.rtl ? 0 : paddingEnd, " ").concat(paddingVertical, " ").concat(props.theme.rtl ? paddingEnd : 0);
642
+ const marginVertical = props.isCompact ? `-${props.theme.space.base * 1.5}px` : `-${props.theme.space.base * 2.5}px`;
643
+ margin = `${marginVertical} 0`;
644
+ const paddingVertical = props.isCompact ? '3px' : '1px';
645
+ const paddingEnd = `${props.theme.space.base}px`;
646
+ padding = `${paddingVertical} ${props.theme.rtl ? 0 : paddingEnd} ${paddingVertical} ${props.theme.rtl ? paddingEnd : 0}`;
921
647
  }
922
648
  return css(["margin:", ";padding:", ";"], margin, padding);
923
649
  };
924
- var StyledMultiselectItemsContainer = styled.div.attrs({
650
+ const StyledMultiselectItemsContainer = styled.div.attrs({
925
651
  'data-garden-id': COMPONENT_ID$2,
926
- 'data-garden-version': '8.57.0'
652
+ 'data-garden-version': '8.58.0'
927
653
  }).withConfig({
928
654
  displayName: "StyledMultiselectItemsContainer",
929
655
  componentId: "sc-1jzhet8-0"
930
- })(["display:inline-flex;flex-grow:1;flex-wrap:wrap;min-width:0;", ";", ";"], function (props) {
931
- return sizeStyles(props);
932
- }, function (props) {
933
- return retrieveComponentStyles(COMPONENT_ID$2, props);
934
- });
656
+ })(["display:inline-flex;flex-grow:1;flex-wrap:wrap;min-width:0;", ";", ";"], props => sizeStyles(props), props => retrieveComponentStyles(COMPONENT_ID$2, props));
935
657
  StyledMultiselectItemsContainer.defaultProps = {
936
658
  theme: DEFAULT_THEME
937
659
  };
938
660
 
939
- var COMPONENT_ID$1 = 'dropdowns.multiselect_item_wrapper';
940
- var StyledMultiselectItemWrapper = styled.div.attrs({
661
+ const COMPONENT_ID$1 = 'dropdowns.multiselect_item_wrapper';
662
+ const StyledMultiselectItemWrapper = styled.div.attrs({
941
663
  'data-garden-id': COMPONENT_ID$1,
942
- 'data-garden-version': '8.57.0'
664
+ 'data-garden-version': '8.58.0'
943
665
  }).withConfig({
944
666
  displayName: "StyledMultiselectItemWrapper",
945
667
  componentId: "sc-1rb2bye-0"
946
- })(["display:inline-flex;align-items:center;margin:", "px;max-width:100%;", ";"], function (props) {
947
- return props.theme.space.base / 2;
948
- }, function (props) {
949
- return retrieveComponentStyles(COMPONENT_ID$1, props);
950
- });
668
+ })(["display:inline-flex;align-items:center;margin:", "px;max-width:100%;", ";"], props => props.theme.space.base / 2, props => retrieveComponentStyles(COMPONENT_ID$1, props));
951
669
  StyledMultiselectItemWrapper.defaultProps = {
952
670
  theme: DEFAULT_THEME
953
671
  };
954
672
 
955
- var COMPONENT_ID = 'dropdowns.multiselect_more_anchor';
956
- var StyledMultiselectMoreAnchor = styled.div.attrs({
673
+ const COMPONENT_ID = 'dropdowns.multiselect_more_anchor';
674
+ const StyledMultiselectMoreAnchor = styled.div.attrs({
957
675
  'data-garden-id': COMPONENT_ID,
958
- 'data-garden-version': '8.57.0'
676
+ 'data-garden-version': '8.58.0'
959
677
  }).withConfig({
960
678
  displayName: "StyledMultiselectMoreAnchor",
961
679
  componentId: "sc-1m9v46e-0"
962
- })(["display:inline-block;cursor:", ";padding:", "px 0;overflow:hidden;user-select:none;text-overflow:ellipsis;line-height:", ";white-space:nowrap;color:", ";:hover{text-decoration:", ";}", ";"], function (props) {
963
- return props.isDisabled ? 'default' : 'pointer';
964
- }, function (props) {
965
- return props.theme.space.base * (props.isCompact ? 0.75 : 1.5);
966
- }, function (props) {
967
- return props.isCompact ? '1em' : getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md);
968
- }, function (props) {
969
- return props.isDisabled ? getColor('neutralHue', 400, props.theme) : getColor('primaryHue', 600, props.theme);
970
- }, function (props) {
971
- return !props.isDisabled && 'underline';
972
- }, function (props) {
973
- return retrieveComponentStyles(COMPONENT_ID, props);
974
- });
680
+ })(["display:inline-block;cursor:", ";padding:", "px 0;overflow:hidden;user-select:none;text-overflow:ellipsis;line-height:", ";white-space:nowrap;color:", ";:hover{text-decoration:", ";}", ";"], props => props.isDisabled ? 'default' : 'pointer', props => props.theme.space.base * (props.isCompact ? 0.75 : 1.5), props => props.isCompact ? '1em' : getLineHeight(props.theme.space.base * 5, props.theme.fontSizes.md), props => props.isDisabled ? getColor('neutralHue', 400, props.theme) : getColor('primaryHue', 600, props.theme), props => !props.isDisabled && 'underline', props => retrieveComponentStyles(COMPONENT_ID, props));
975
681
  StyledMultiselectMoreAnchor.defaultProps = {
976
682
  theme: DEFAULT_THEME
977
683
  };
978
684
 
979
- var _excluded$a = ["children", "refKey"],
980
- _excluded2$5 = ["ref"];
981
- var Trigger = function Trigger(_ref) {
982
- var children = _ref.children,
983
- refKey = _ref.refKey,
984
- triggerProps = _objectWithoutProperties(_ref, _excluded$a);
985
- var _useDropdownContext = useDropdownContext(),
986
- hasMenuRef = _useDropdownContext.hasMenuRef,
987
- itemSearchRegistry = _useDropdownContext.itemSearchRegistry,
988
- _useDropdownContext$d = _useDropdownContext.downshift,
989
- getRootProps = _useDropdownContext$d.getRootProps,
990
- getToggleButtonProps = _useDropdownContext$d.getToggleButtonProps,
991
- getInputProps = _useDropdownContext$d.getInputProps,
992
- isOpen = _useDropdownContext$d.isOpen,
993
- highlightedIndex = _useDropdownContext$d.highlightedIndex,
994
- selectItemAtIndex = _useDropdownContext$d.selectItemAtIndex,
995
- setHighlightedIndex = _useDropdownContext$d.setHighlightedIndex;
996
- var hiddenInputRef = useRef(null);
997
- var triggerRef = useRef(null);
998
- var previousIsOpenRef = useRef(undefined);
999
- var _useState = useState(''),
1000
- _useState2 = _slicedToArray(_useState, 2),
1001
- searchString = _useState2[0],
1002
- setSearchString = _useState2[1];
1003
- var searchTimeoutRef = useRef();
1004
- var currentSearchIndexRef = useRef(0);
1005
- useEffect(function () {
685
+ const Trigger = _ref => {
686
+ let {
687
+ children,
688
+ refKey,
689
+ ...triggerProps
690
+ } = _ref;
691
+ const {
692
+ hasMenuRef,
693
+ itemSearchRegistry,
694
+ downshift: {
695
+ getRootProps,
696
+ getToggleButtonProps,
697
+ getInputProps,
698
+ isOpen,
699
+ highlightedIndex,
700
+ selectItemAtIndex,
701
+ setHighlightedIndex
702
+ }
703
+ } = useDropdownContext();
704
+ const hiddenInputRef = useRef(null);
705
+ const triggerRef = useRef(null);
706
+ const previousIsOpenRef = useRef(undefined);
707
+ const [searchString, setSearchString] = useState('');
708
+ const searchTimeoutRef = useRef();
709
+ const currentSearchIndexRef = useRef(0);
710
+ useEffect(() => {
1006
711
  if (hiddenInputRef.current && isOpen && !previousIsOpenRef.current) {
1007
712
  hiddenInputRef.current.focus();
1008
713
  }
@@ -1011,32 +716,32 @@ var Trigger = function Trigger(_ref) {
1011
716
  }
1012
717
  previousIsOpenRef.current = isOpen;
1013
718
  }, [isOpen, hasMenuRef]);
1014
- useEffect(function () {
719
+ useEffect(() => {
1015
720
  if (hasMenuRef.current === false) {
1016
721
  hasMenuRef.current = true;
1017
722
  }
1018
723
  }, [hasMenuRef]);
1019
- useEffect(function () {
724
+ useEffect(() => {
1020
725
  if (searchTimeoutRef.current) {
1021
726
  clearTimeout(searchTimeoutRef.current);
1022
727
  }
1023
- searchTimeoutRef.current = window.setTimeout(function () {
728
+ searchTimeoutRef.current = window.setTimeout(() => {
1024
729
  setSearchString('');
1025
730
  }, 500);
1026
- return function () {
731
+ return () => {
1027
732
  clearTimeout(searchTimeoutRef.current);
1028
733
  };
1029
734
  }, [searchString]);
1030
- var searchItems = useCallback(function (searchValue, startIndex, endIndex) {
1031
- for (var index = startIndex; index < endIndex; index++) {
1032
- var itemTextValue = itemSearchRegistry.current[index];
735
+ const searchItems = useCallback((searchValue, startIndex, endIndex) => {
736
+ for (let index = startIndex; index < endIndex; index++) {
737
+ const itemTextValue = itemSearchRegistry.current[index];
1033
738
  if (itemTextValue && itemTextValue.toUpperCase().indexOf(searchValue.toUpperCase()) === 0) {
1034
739
  return index;
1035
740
  }
1036
741
  }
1037
742
  return undefined;
1038
743
  }, [itemSearchRegistry]);
1039
- var onInputKeyDown = useCallback(function (e) {
744
+ const onInputKeyDown = useCallback(e => {
1040
745
  if (e.keyCode === KEY_CODES.SPACE) {
1041
746
  if (searchString) {
1042
747
  e.preventDefault();
@@ -1050,7 +755,7 @@ var Trigger = function Trigger(_ref) {
1050
755
  if ((e.keyCode < 48 || e.keyCode > 57) && (e.keyCode < 65 || e.keyCode > 90) && e.keyCode !== KEY_CODES.SPACE) {
1051
756
  return;
1052
757
  }
1053
- var character = String.fromCharCode(e.which || e.keyCode);
758
+ const character = String.fromCharCode(e.which || e.keyCode);
1054
759
  if (!character || character.length === 0) {
1055
760
  return;
1056
761
  }
@@ -1061,9 +766,9 @@ var Trigger = function Trigger(_ref) {
1061
766
  currentSearchIndexRef.current = highlightedIndex;
1062
767
  }
1063
768
  }
1064
- var newSearchString = searchString + character;
769
+ const newSearchString = searchString + character;
1065
770
  setSearchString(newSearchString);
1066
- var matchingIndex = searchItems(newSearchString, currentSearchIndexRef.current + 1, itemSearchRegistry.current.length);
771
+ let matchingIndex = searchItems(newSearchString, currentSearchIndexRef.current + 1, itemSearchRegistry.current.length);
1067
772
  if (matchingIndex === undefined) {
1068
773
  matchingIndex = searchItems(newSearchString, 0, currentSearchIndexRef.current);
1069
774
  }
@@ -1071,35 +776,45 @@ var Trigger = function Trigger(_ref) {
1071
776
  setHighlightedIndex(matchingIndex);
1072
777
  }
1073
778
  }, [searchString, searchItems, itemSearchRegistry, highlightedIndex, selectItemAtIndex, setHighlightedIndex]);
1074
- var renderChildren = function renderChildren(popperRef) {
1075
- var _getRootProps = getRootProps(),
1076
- rootPropsRefCallback = _getRootProps.ref,
1077
- rootProps = _objectWithoutProperties(_getRootProps, _excluded2$5);
1078
- var listboxToggleProps = getToggleButtonProps(_objectSpread2(_objectSpread2(_objectSpread2({}, rootProps), {}, {
779
+ const renderChildren = popperRef => {
780
+ const {
781
+ ref: rootPropsRefCallback,
782
+ ...rootProps
783
+ } = getRootProps();
784
+ const listboxToggleProps = getToggleButtonProps({
785
+ ...rootProps,
1079
786
  role: null,
1080
- 'aria-labelledby': undefined
1081
- }, triggerProps), children.props));
1082
- var menuToggleProps = _objectSpread2(_objectSpread2({}, listboxToggleProps), {}, {
787
+ 'aria-labelledby': undefined,
788
+ ...triggerProps,
789
+ ...children.props
790
+ });
791
+ const menuToggleProps = {
792
+ ...listboxToggleProps,
1083
793
  'aria-haspopup': 'true',
1084
794
  'aria-controls': listboxToggleProps['aria-owns'],
1085
795
  'aria-owns': null
796
+ };
797
+ const toggleButtonProps = hasMenuRef.current ? menuToggleProps : listboxToggleProps;
798
+ return React__default.cloneElement(React__default.Children.only(children), {
799
+ ...toggleButtonProps,
800
+ [refKey]: childRef => {
801
+ popperRef(childRef);
802
+ triggerRef.current = childRef;
803
+ rootPropsRefCallback(childRef);
804
+ }
1086
805
  });
1087
- var toggleButtonProps = hasMenuRef.current ? menuToggleProps : listboxToggleProps;
1088
- return React__default.cloneElement(React__default.Children.only(children), _objectSpread2(_objectSpread2({}, toggleButtonProps), {}, _defineProperty({}, refKey, function (childRef) {
1089
- popperRef(childRef);
1090
- triggerRef.current = childRef;
1091
- rootPropsRefCallback(childRef);
1092
- })));
1093
806
  };
1094
- return React__default.createElement(Reference, null, function (_ref2) {
1095
- var popperReference = _ref2.ref;
807
+ return React__default.createElement(Reference, null, _ref2 => {
808
+ let {
809
+ ref: popperReference
810
+ } = _ref2;
1096
811
  return React__default.createElement(React__default.Fragment, null, renderChildren(popperReference), React__default.createElement(StyledInput, getInputProps({
1097
812
  readOnly: true,
1098
813
  isHidden: true,
1099
814
  tabIndex: -1,
1100
815
  ref: hiddenInputRef,
1101
816
  value: '',
1102
- onClick: function onClick(e) {
817
+ onClick: e => {
1103
818
  if (isOpen) {
1104
819
  e.nativeEvent.preventDownshiftDefault = true;
1105
820
  }
@@ -1127,91 +842,88 @@ var SvgChevronDownStroke = function SvgChevronDownStroke(props) {
1127
842
  height: 16,
1128
843
  focusable: "false",
1129
844
  viewBox: "0 0 16 16",
1130
- "aria-hidden": "true"
845
+ "aria-hidden": "true",
846
+ role: "img"
1131
847
  }, props), _path$2 || (_path$2 = /*#__PURE__*/React.createElement("path", {
1132
848
  fill: "currentColor",
1133
849
  d: "M12.688 5.61a.5.5 0 01.69.718l-.066.062-5 4a.5.5 0 01-.542.054l-.082-.054-5-4a.5.5 0 01.55-.83l.074.05L8 9.359l4.688-3.75z"
1134
850
  })));
1135
851
  };
1136
852
 
1137
- var FieldContext = React__default.createContext(undefined);
1138
- var useFieldContext = function useFieldContext() {
1139
- var fieldContext = useContext(FieldContext);
853
+ const FieldContext = React__default.createContext(undefined);
854
+ const useFieldContext = () => {
855
+ const fieldContext = useContext(FieldContext);
1140
856
  if (!fieldContext) {
1141
857
  throw new Error('This component must be rendered within a `Field` component.');
1142
858
  }
1143
859
  return fieldContext;
1144
860
  };
1145
861
 
1146
- var _excluded$9 = ["children", "inputRef", "start"],
1147
- _excluded2$4 = ["type", "onKeyDown"];
1148
- var Autocomplete = forwardRef(function (_ref, _ref3) {
1149
- var children = _ref.children,
1150
- controlledInputRef = _ref.inputRef,
1151
- start = _ref.start,
1152
- props = _objectWithoutProperties(_ref, _excluded$9);
1153
- var _useDropdownContext = useDropdownContext(),
1154
- popperReferenceElementRef = _useDropdownContext.popperReferenceElementRef,
1155
- _useDropdownContext$d = _useDropdownContext.downshift,
1156
- getToggleButtonProps = _useDropdownContext$d.getToggleButtonProps,
1157
- getInputProps = _useDropdownContext$d.getInputProps,
1158
- getRootProps = _useDropdownContext$d.getRootProps,
1159
- isOpen = _useDropdownContext$d.isOpen,
1160
- setDropdownType = _useDropdownContext.setDropdownType;
1161
- var _useFieldContext = useFieldContext(),
1162
- isLabelHovered = _useFieldContext.isLabelHovered;
1163
- var inputRef = useRef();
1164
- var triggerRef = useRef();
1165
- var previousIsOpenRef = useRef(isOpen);
1166
- var _useState = useState(false),
1167
- _useState2 = _slicedToArray(_useState, 2),
1168
- isHovered = _useState2[0],
1169
- setIsHovered = _useState2[1];
1170
- var _useState3 = useState(false),
1171
- _useState4 = _slicedToArray(_useState3, 2),
1172
- isFocused = _useState4[0],
1173
- setIsFocused = _useState4[1];
1174
- useEffect(function () {
862
+ const Autocomplete = forwardRef((_ref, ref) => {
863
+ let {
864
+ children,
865
+ inputRef: controlledInputRef,
866
+ start,
867
+ ...props
868
+ } = _ref;
869
+ const {
870
+ popperReferenceElementRef,
871
+ downshift: {
872
+ getToggleButtonProps,
873
+ getInputProps,
874
+ getRootProps,
875
+ isOpen
876
+ },
877
+ setDropdownType
878
+ } = useDropdownContext();
879
+ const {
880
+ isLabelHovered
881
+ } = useFieldContext();
882
+ const inputRef = useRef();
883
+ const triggerRef = useRef();
884
+ const previousIsOpenRef = useRef(isOpen);
885
+ const [isHovered, setIsHovered] = useState(false);
886
+ const [isFocused, setIsFocused] = useState(false);
887
+ useEffect(() => {
1175
888
  if (inputRef.current && isOpen !== previousIsOpenRef.current) {
1176
889
  inputRef.current.focus();
1177
890
  }
1178
891
  previousIsOpenRef.current = isOpen;
1179
892
  }, [inputRef, isOpen]);
1180
- var _getToggleButtonProps = getToggleButtonProps(getRootProps(_objectSpread2(_objectSpread2({
1181
- role: null
1182
- }, props), {}, {
1183
- onKeyDown: function onKeyDown(e) {
893
+ const {
894
+ type,
895
+ onKeyDown,
896
+ ...selectProps
897
+ } = getToggleButtonProps(getRootProps({
898
+ role: null,
899
+ ...props,
900
+ onKeyDown: e => {
1184
901
  if (isOpen) {
1185
902
  e.nativeEvent.preventDownshiftDefault = true;
1186
903
  }
1187
904
  },
1188
- onMouseEnter: composeEventHandlers(props.onMouseEnter, function () {
1189
- return setIsHovered(true);
1190
- }),
1191
- onMouseLeave: composeEventHandlers(props.onMouseLeave, function () {
1192
- return setIsHovered(false);
1193
- })
1194
- })));
1195
- _getToggleButtonProps.type;
1196
- var onKeyDown = _getToggleButtonProps.onKeyDown,
1197
- selectProps = _objectWithoutProperties(_getToggleButtonProps, _excluded2$4);
1198
- var onSelectKeyDown = composeEventHandlers(props.onKeyDown, onKeyDown);
1199
- var isContainerHovered = isLabelHovered && !isOpen;
1200
- var isContainerFocused = isOpen || isFocused;
1201
- useEffect(function () {
905
+ onMouseEnter: composeEventHandlers(props.onMouseEnter, () => setIsHovered(true)),
906
+ onMouseLeave: composeEventHandlers(props.onMouseLeave, () => setIsHovered(false))
907
+ }));
908
+ const onSelectKeyDown = composeEventHandlers(props.onKeyDown, onKeyDown);
909
+ const isContainerHovered = isLabelHovered && !isOpen;
910
+ const isContainerFocused = isOpen || isFocused;
911
+ useEffect(() => {
1202
912
  setDropdownType('autocomplete');
1203
913
  }, [setDropdownType]);
1204
- return React__default.createElement(Reference, null, function (_ref2) {
1205
- var popperReference = _ref2.ref;
914
+ return React__default.createElement(Reference, null, _ref2 => {
915
+ let {
916
+ ref: popperReference
917
+ } = _ref2;
1206
918
  return React__default.createElement(StyledFauxInput, _extends$5({
1207
919
  isHovered: isContainerHovered,
1208
920
  isFocused: isContainerFocused,
1209
921
  tabIndex: null,
1210
922
  onKeyDown: onSelectKeyDown
1211
923
  }, selectProps, {
1212
- ref: function ref(selectRef) {
924
+ ref: selectRef => {
1213
925
  popperReference(selectRef);
1214
- mergeRefs([triggerRef, _ref3])(selectRef);
926
+ mergeRefs([triggerRef, ref])(selectRef);
1215
927
  popperReferenceElementRef.current = selectRef;
1216
928
  }
1217
929
  }), start && React__default.createElement(StyledFauxInput.StartIcon, {
@@ -1221,13 +933,13 @@ var Autocomplete = forwardRef(function (_ref, _ref3) {
1221
933
  }, start), !isOpen && React__default.createElement(StyledSelect, null, children), React__default.createElement(StyledInput, getInputProps({
1222
934
  isHidden: !isOpen,
1223
935
  disabled: props.disabled,
1224
- onFocus: function onFocus() {
936
+ onFocus: () => {
1225
937
  setIsFocused(true);
1226
938
  },
1227
- onBlur: function onBlur() {
939
+ onBlur: () => {
1228
940
  setIsFocused(false);
1229
941
  },
1230
- onClick: function onClick(e) {
942
+ onClick: e => {
1231
943
  if (isOpen) {
1232
944
  e.nativeEvent.preventDownshiftDefault = true;
1233
945
  }
@@ -1251,72 +963,76 @@ Autocomplete.propTypes = {
1251
963
  validation: PropTypes.oneOf(VALIDATION)
1252
964
  };
1253
965
 
1254
- var _excluded$8 = ["isCompact", "isBare", "disabled", "focusInset", "placeholder", "validation", "inputRef", "start", "end"];
1255
- var Combobox = forwardRef(function (_ref, ref) {
1256
- var isCompact = _ref.isCompact,
1257
- isBare = _ref.isBare,
1258
- disabled = _ref.disabled,
1259
- focusInset = _ref.focusInset,
1260
- placeholder = _ref.placeholder,
1261
- validation = _ref.validation,
1262
- _ref$inputRef = _ref.inputRef,
1263
- inputRefProp = _ref$inputRef === void 0 ? null : _ref$inputRef,
1264
- start = _ref.start,
1265
- end = _ref.end,
1266
- props = _objectWithoutProperties(_ref, _excluded$8);
1267
- var _useDropdownContext = useDropdownContext(),
1268
- popperReferenceElementRef = _useDropdownContext.popperReferenceElementRef,
1269
- _useDropdownContext$d = _useDropdownContext.downshift,
1270
- getToggleButtonProps = _useDropdownContext$d.getToggleButtonProps,
1271
- getInputProps = _useDropdownContext$d.getInputProps,
1272
- getRootProps = _useDropdownContext$d.getRootProps,
1273
- isOpen = _useDropdownContext$d.isOpen,
1274
- setDropdownType = _useDropdownContext.setDropdownType;
1275
- var wrapperRef = useRef();
1276
- var inputRef = useRef();
1277
- var isOpenRef = useRef(isOpen);
1278
- var wrapperProps = getToggleButtonProps(getRootProps(_objectSpread2(_objectSpread2({
966
+ const Combobox = forwardRef((_ref, ref) => {
967
+ let {
968
+ isCompact,
969
+ isBare,
970
+ disabled,
971
+ focusInset,
972
+ placeholder,
973
+ validation,
974
+ inputRef: inputRefProp = null,
975
+ start,
976
+ end,
977
+ ...props
978
+ } = _ref;
979
+ const {
980
+ popperReferenceElementRef,
981
+ downshift: {
982
+ getToggleButtonProps,
983
+ getInputProps,
984
+ getRootProps,
985
+ isOpen
986
+ },
987
+ setDropdownType
988
+ } = useDropdownContext();
989
+ const wrapperRef = useRef();
990
+ const inputRef = useRef();
991
+ const isOpenRef = useRef(isOpen);
992
+ const wrapperProps = getToggleButtonProps(getRootProps({
1279
993
  role: null,
1280
994
  type: null,
1281
- onClick: function onClick(event) {
995
+ onClick: event => {
1282
996
  event.nativeEvent.preventDownshiftDefault = true;
1283
- }
1284
- }, props), {}, {
1285
- onKeyDown: function onKeyDown(event) {
997
+ },
998
+ ...props,
999
+ onKeyDown: event => {
1286
1000
  event.nativeEvent.preventDownshiftDefault = true;
1287
1001
  }
1288
- })));
1289
- var inputProps = getInputProps({
1290
- isCompact: isCompact,
1291
- isBare: isBare,
1292
- disabled: disabled,
1293
- focusInset: focusInset,
1294
- placeholder: placeholder,
1295
- validation: validation,
1296
- start: start,
1297
- end: end,
1002
+ }));
1003
+ const inputProps = getInputProps({
1004
+ isCompact,
1005
+ isBare,
1006
+ disabled,
1007
+ focusInset,
1008
+ placeholder,
1009
+ validation,
1010
+ start,
1011
+ end,
1298
1012
  role: 'combobox',
1299
- onKeyDown: function onKeyDown(event) {
1013
+ onKeyDown: event => {
1300
1014
  if (event.keyCode === KEY_CODES.SPACE || !isOpen && [KEY_CODES.DOWN, KEY_CODES.UP].includes(event.keyCode)) {
1301
1015
  event.nativeEvent.preventDownshiftDefault = true;
1302
1016
  }
1303
1017
  },
1304
- onClick: function onClick(event) {
1018
+ onClick: event => {
1305
1019
  event.nativeEvent.preventDownshiftDefault = true;
1306
1020
  }
1307
1021
  });
1308
- useEffect(function () {
1022
+ useEffect(() => {
1309
1023
  if (inputRef.current && isOpen !== isOpenRef.current) {
1310
1024
  inputRef.current.focus();
1311
1025
  }
1312
1026
  isOpenRef.current = isOpen;
1313
1027
  }, [inputRef, isOpen]);
1314
- useEffect(function () {
1028
+ useEffect(() => {
1315
1029
  setDropdownType('combobox');
1316
1030
  }, [setDropdownType]);
1317
- return React__default.createElement(Reference, null, function (_ref2) {
1318
- var popperReference = _ref2.ref;
1319
- var wrapperRefProp = function wrapperRefProp(element) {
1031
+ return React__default.createElement(Reference, null, _ref2 => {
1032
+ let {
1033
+ ref: popperReference
1034
+ } = _ref2;
1035
+ const wrapperRefProp = element => {
1320
1036
  popperReference(element);
1321
1037
  mergeRefs([wrapperRef, ref])(element);
1322
1038
  popperReferenceElementRef.current = element;
@@ -1338,73 +1054,66 @@ Combobox.propTypes = {
1338
1054
  validation: PropTypes.oneOf(VALIDATION)
1339
1055
  };
1340
1056
 
1341
- var _excluded$7 = ["renderItem", "placeholder", "maxItems", "renderShowMore", "inputRef", "start", "onKeyDown"],
1342
- _excluded2$3 = ["type"];
1343
- var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
1344
- var renderItem = _ref.renderItem,
1345
- placeholder = _ref.placeholder,
1346
- maxItems = _ref.maxItems,
1347
- renderShowMore = _ref.renderShowMore,
1348
- _ref$inputRef = _ref.inputRef,
1349
- externalInputRef = _ref$inputRef === void 0 ? null : _ref$inputRef,
1350
- start = _ref.start,
1351
- onKeyDown = _ref.onKeyDown,
1352
- props = _objectWithoutProperties(_ref, _excluded$7);
1353
- var _useDropdownContext = useDropdownContext(),
1354
- popperReferenceElementRef = _useDropdownContext.popperReferenceElementRef,
1355
- _useDropdownContext$s = _useDropdownContext.selectedItems,
1356
- selectedItems = _useDropdownContext$s === void 0 ? [] : _useDropdownContext$s,
1357
- containsMultiselectRef = _useDropdownContext.containsMultiselectRef,
1358
- previousIndexRef = _useDropdownContext.previousIndexRef,
1359
- _useDropdownContext$d = _useDropdownContext.downshift,
1360
- getToggleButtonProps = _useDropdownContext$d.getToggleButtonProps,
1361
- getRootProps = _useDropdownContext$d.getRootProps,
1362
- getInputProps = _useDropdownContext$d.getInputProps,
1363
- isOpen = _useDropdownContext$d.isOpen,
1364
- closeMenu = _useDropdownContext$d.closeMenu,
1365
- inputValue = _useDropdownContext$d.inputValue,
1366
- setDownshiftState = _useDropdownContext$d.setState,
1367
- itemToString = _useDropdownContext$d.itemToString,
1368
- setDropdownType = _useDropdownContext.setDropdownType;
1369
- var _useFieldContext = useFieldContext(),
1370
- isLabelHovered = _useFieldContext.isLabelHovered;
1371
- var inputRef = useRef();
1372
- var triggerRef = useRef();
1373
- var blurTimeoutRef = useRef();
1374
- var previousIsOpenRef = useRef(undefined);
1375
- var previousIsFocusedRef = useRef(undefined);
1376
- var _useState = useState(false),
1377
- _useState2 = _slicedToArray(_useState, 2),
1378
- isHovered = _useState2[0],
1379
- setIsHovered = _useState2[1];
1380
- var _useState3 = useState(false),
1381
- _useState4 = _slicedToArray(_useState3, 2),
1382
- isFocused = _useState4[0],
1383
- setIsFocused = _useState4[1];
1384
- var _useState5 = useState(undefined),
1385
- _useState6 = _slicedToArray(_useState5, 2),
1386
- focusedItem = _useState6[0],
1387
- setFocusedItem = _useState6[1];
1388
- var themeContext = useContext(ThemeContext);
1389
- var environment = useDocument(themeContext);
1390
- var _useSelection = useSelection({
1057
+ const Multiselect = React__default.forwardRef((_ref, ref) => {
1058
+ let {
1059
+ renderItem,
1060
+ placeholder,
1061
+ maxItems,
1062
+ renderShowMore,
1063
+ inputRef: externalInputRef = null,
1064
+ start,
1065
+ onKeyDown,
1066
+ ...props
1067
+ } = _ref;
1068
+ const {
1069
+ popperReferenceElementRef,
1070
+ selectedItems = [],
1071
+ containsMultiselectRef,
1072
+ previousIndexRef,
1073
+ downshift: {
1074
+ getToggleButtonProps,
1075
+ getRootProps,
1076
+ getInputProps,
1077
+ isOpen,
1078
+ closeMenu,
1079
+ inputValue,
1080
+ setState: setDownshiftState,
1081
+ itemToString
1082
+ },
1083
+ setDropdownType
1084
+ } = useDropdownContext();
1085
+ const {
1086
+ isLabelHovered
1087
+ } = useFieldContext();
1088
+ const inputRef = useRef();
1089
+ const triggerRef = useRef();
1090
+ const blurTimeoutRef = useRef();
1091
+ const previousIsOpenRef = useRef(undefined);
1092
+ const previousIsFocusedRef = useRef(undefined);
1093
+ const [isHovered, setIsHovered] = useState(false);
1094
+ const [isFocused, setIsFocused] = useState(false);
1095
+ const [focusedItem, setFocusedItem] = useState(undefined);
1096
+ const themeContext = useContext(ThemeContext);
1097
+ const environment = useDocument(themeContext);
1098
+ const {
1099
+ getContainerProps,
1100
+ getItemProps
1101
+ } = useSelection({
1391
1102
  rtl: themeContext.rtl,
1392
- focusedItem: focusedItem,
1103
+ focusedItem,
1393
1104
  selectedItem: undefined,
1394
- onFocus: function onFocus(item) {
1105
+ onFocus: item => {
1395
1106
  setFocusedItem(item);
1396
1107
  }
1397
- }),
1398
- getContainerProps = _useSelection.getContainerProps,
1399
- getItemProps = _useSelection.getItemProps;
1400
- useEffect(function () {
1108
+ });
1109
+ useEffect(() => {
1401
1110
  containsMultiselectRef.current = true;
1402
- var tempRef = blurTimeoutRef;
1403
- return function () {
1111
+ const tempRef = blurTimeoutRef;
1112
+ return () => {
1404
1113
  clearTimeout(tempRef.current);
1405
1114
  };
1406
1115
  }, []);
1407
- useEffect(function () {
1116
+ useEffect(() => {
1408
1117
  if (inputRef.current) {
1409
1118
  if (isOpen && !previousIsOpenRef.current) {
1410
1119
  inputRef.current.focus();
@@ -1415,14 +1124,17 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
1415
1124
  previousIsOpenRef.current = isOpen;
1416
1125
  previousIsFocusedRef.current = isFocused;
1417
1126
  }, [isOpen, inputRef, isFocused, focusedItem]);
1418
- useEffect(function () {
1127
+ useEffect(() => {
1419
1128
  if (focusedItem !== undefined && isOpen) {
1420
1129
  closeMenu();
1421
1130
  }
1422
1131
  }, [focusedItem, isOpen, closeMenu]);
1423
- var _getToggleButtonProps = getToggleButtonProps(getRootProps(_objectSpread2({
1132
+ const {
1133
+ type,
1134
+ ...selectProps
1135
+ } = getToggleButtonProps(getRootProps({
1424
1136
  tabIndex: props.disabled ? undefined : -1,
1425
- onKeyDown: composeEventHandlers(onKeyDown, function (e) {
1137
+ onKeyDown: composeEventHandlers(onKeyDown, e => {
1426
1138
  if (isOpen) {
1427
1139
  e.nativeEvent.preventDownshiftDefault = true;
1428
1140
  } else if (!inputValue && e.keyCode === KEY_CODES.HOME) {
@@ -1430,92 +1142,88 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
1430
1142
  e.preventDefault();
1431
1143
  }
1432
1144
  }),
1433
- onFocus: function onFocus() {
1145
+ onFocus: () => {
1434
1146
  setIsFocused(true);
1435
1147
  },
1436
- onBlur: function onBlur(e) {
1437
- var currentTarget = e.currentTarget;
1438
- blurTimeoutRef.current = setTimeout(function () {
1148
+ onBlur: e => {
1149
+ const currentTarget = e.currentTarget;
1150
+ blurTimeoutRef.current = setTimeout(() => {
1439
1151
  if (environment && !currentTarget.contains(environment.activeElement)) {
1440
1152
  setIsFocused(false);
1441
1153
  }
1442
1154
  }, 0);
1443
1155
  },
1444
- onMouseEnter: composeEventHandlers(props.onMouseEnter, function () {
1445
- return setIsHovered(true);
1446
- }),
1447
- onMouseLeave: composeEventHandlers(props.onMouseLeave, function () {
1448
- return setIsHovered(false);
1449
- }),
1450
- role: null
1451
- }, props)));
1452
- _getToggleButtonProps.type;
1453
- var selectProps = _objectWithoutProperties(_getToggleButtonProps, _excluded2$3);
1454
- var renderSelectableItem = useCallback(function (item, index) {
1455
- var removeValue = function removeValue() {
1156
+ onMouseEnter: composeEventHandlers(props.onMouseEnter, () => setIsHovered(true)),
1157
+ onMouseLeave: composeEventHandlers(props.onMouseLeave, () => setIsHovered(false)),
1158
+ role: null,
1159
+ ...props
1160
+ }));
1161
+ const renderSelectableItem = useCallback((item, index) => {
1162
+ const removeValue = () => {
1456
1163
  setDownshiftState({
1457
1164
  type: REMOVE_ITEM_STATE_TYPE,
1458
1165
  selectedItem: item
1459
1166
  });
1460
1167
  inputRef.current && inputRef.current.focus();
1461
1168
  };
1462
- var renderedItem = renderItem({
1169
+ const renderedItem = renderItem({
1463
1170
  value: item,
1464
- removeValue: removeValue
1171
+ removeValue
1465
1172
  });
1466
- var focusRef = React__default.createRef();
1467
- var clonedChild = React__default.cloneElement(renderedItem, _objectSpread2(_objectSpread2({}, getItemProps({
1468
- item: item,
1469
- focusRef: focusRef,
1470
- onKeyDown: function onKeyDown(e) {
1471
- if (e.keyCode === KEY_CODES.DELETE || e.keyCode === KEY_CODES.BACKSPACE) {
1472
- e.preventDefault();
1473
- removeValue();
1474
- }
1475
- if (e.keyCode === KEY_CODES.END && !inputValue) {
1476
- inputRef.current && inputRef.current.focus();
1477
- e.preventDefault();
1478
- }
1479
- if (themeContext.rtl) {
1480
- if (e.keyCode === KEY_CODES.RIGHT && index === 0) {
1173
+ const focusRef = React__default.createRef();
1174
+ const clonedChild = React__default.cloneElement(renderedItem, {
1175
+ ...getItemProps({
1176
+ item,
1177
+ focusRef,
1178
+ onKeyDown: e => {
1179
+ if (e.keyCode === KEY_CODES.DELETE || e.keyCode === KEY_CODES.BACKSPACE) {
1481
1180
  e.preventDefault();
1181
+ removeValue();
1482
1182
  }
1483
- if (e.keyCode === KEY_CODES.LEFT && index === selectedItems.length - 1) {
1484
- e.preventDefault();
1183
+ if (e.keyCode === KEY_CODES.END && !inputValue) {
1485
1184
  inputRef.current && inputRef.current.focus();
1486
- }
1487
- } else {
1488
- if (e.keyCode === KEY_CODES.LEFT && index === 0) {
1489
1185
  e.preventDefault();
1490
1186
  }
1491
- if (e.keyCode === KEY_CODES.RIGHT && index === selectedItems.length - 1) {
1492
- e.preventDefault();
1493
- inputRef.current && inputRef.current.focus();
1187
+ if (themeContext.rtl) {
1188
+ if (e.keyCode === KEY_CODES.RIGHT && index === 0) {
1189
+ e.preventDefault();
1190
+ }
1191
+ if (e.keyCode === KEY_CODES.LEFT && index === selectedItems.length - 1) {
1192
+ e.preventDefault();
1193
+ inputRef.current && inputRef.current.focus();
1194
+ }
1195
+ } else {
1196
+ if (e.keyCode === KEY_CODES.LEFT && index === 0) {
1197
+ e.preventDefault();
1198
+ }
1199
+ if (e.keyCode === KEY_CODES.RIGHT && index === selectedItems.length - 1) {
1200
+ e.preventDefault();
1201
+ inputRef.current && inputRef.current.focus();
1202
+ }
1494
1203
  }
1495
- }
1496
- },
1497
- onClick: function onClick(e) {
1498
- e.nativeEvent.preventDownshiftDefault = true;
1499
- },
1500
- tabIndex: -1
1501
- })), {}, {
1204
+ },
1205
+ onClick: e => {
1206
+ e.nativeEvent.preventDownshiftDefault = true;
1207
+ },
1208
+ tabIndex: -1
1209
+ }),
1502
1210
  size: props.isCompact ? 'medium' : 'large'
1503
- }));
1504
- var key = "".concat(itemToString(item), "-").concat(index);
1211
+ });
1212
+ const key = `${itemToString(item)}-${index}`;
1505
1213
  return React__default.createElement(StyledMultiselectItemWrapper, {
1506
1214
  key: key
1507
1215
  }, clonedChild);
1508
1216
  }, [getItemProps, inputValue, renderItem, setDownshiftState, itemToString, selectedItems, props, inputRef, themeContext.rtl]);
1509
- var items = useMemo(function () {
1510
- var itemValues = selectedItems || [];
1511
- var output = [];
1512
- for (var x = 0; x < itemValues.length; x++) {
1513
- var item = itemValues[x];
1217
+ const items = useMemo(() => {
1218
+ const itemValues = selectedItems || [];
1219
+ const output = [];
1220
+ for (let x = 0; x < itemValues.length; x++) {
1221
+ const item = itemValues[x];
1514
1222
  if (x < maxItems) {
1515
1223
  if (props.disabled) {
1516
- var renderedItem = React__default.cloneElement(renderItem({
1224
+ const renderedItem = React__default.cloneElement(renderItem({
1517
1225
  value: item,
1518
- removeValue: function removeValue() {
1226
+ removeValue: () => {
1519
1227
  return undefined;
1520
1228
  }
1521
1229
  }), {
@@ -1533,7 +1241,7 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
1533
1241
  }, React__default.createElement(StyledMultiselectMoreAnchor, {
1534
1242
  isCompact: props.isCompact,
1535
1243
  isDisabled: props.disabled
1536
- }, renderShowMore ? renderShowMore(itemValues.length - x) : "+ ".concat(itemValues.length - x, " more"))));
1244
+ }, renderShowMore ? renderShowMore(itemValues.length - x) : `+ ${itemValues.length - x} more`)));
1537
1245
  break;
1538
1246
  } else {
1539
1247
  output.push(renderSelectableItem(item, x));
@@ -1541,21 +1249,24 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
1541
1249
  }
1542
1250
  return output;
1543
1251
  }, [isFocused, props.disabled, renderSelectableItem, selectedItems, renderItem, inputValue, maxItems, renderShowMore, props.isCompact]);
1544
- var isContainerHovered = isLabelHovered && !isOpen;
1545
- var isContainerFocused = isOpen || isFocused;
1546
- useEffect(function () {
1252
+ const isContainerHovered = isLabelHovered && !isOpen;
1253
+ const isContainerFocused = isOpen || isFocused;
1254
+ useEffect(() => {
1547
1255
  setDropdownType('multiselect');
1548
1256
  }, [setDropdownType]);
1549
- return React__default.createElement(Reference, null, function (_ref2) {
1550
- var popperReference = _ref2.ref;
1551
- return React__default.createElement(StyledFauxInput, getContainerProps(_objectSpread2(_objectSpread2({}, selectProps), {}, {
1257
+ return React__default.createElement(Reference, null, _ref2 => {
1258
+ let {
1259
+ ref: popperReference
1260
+ } = _ref2;
1261
+ return React__default.createElement(StyledFauxInput, getContainerProps({
1262
+ ...selectProps,
1552
1263
  isHovered: isContainerHovered,
1553
1264
  isFocused: isContainerFocused,
1554
- ref: function ref(selectRef) {
1265
+ ref: selectRef => {
1555
1266
  popperReference(selectRef);
1556
- mergeRefs([triggerRef, popperReferenceElementRef, _ref3])(selectRef);
1267
+ mergeRefs([triggerRef, popperReferenceElementRef, ref])(selectRef);
1557
1268
  }
1558
- })), start && React__default.createElement(StyledFauxInput.StartIcon, {
1269
+ }), start && React__default.createElement(StyledFauxInput.StartIcon, {
1559
1270
  isHovered: isHovered || isLabelHovered && !isOpen,
1560
1271
  isFocused: isContainerFocused,
1561
1272
  isDisabled: props.disabled
@@ -1564,15 +1275,15 @@ var Multiselect = React__default.forwardRef(function (_ref, _ref3) {
1564
1275
  isCompact: props.isCompact
1565
1276
  }, items, React__default.createElement(StyledMultiselectInput, getInputProps({
1566
1277
  disabled: props.disabled,
1567
- onFocus: function onFocus() {
1278
+ onFocus: () => {
1568
1279
  setFocusedItem(undefined);
1569
1280
  },
1570
- onClick: function onClick(e) {
1281
+ onClick: e => {
1571
1282
  if (inputValue && inputValue.length > 0 && isOpen) {
1572
1283
  e.nativeEvent.preventDownshiftDefault = true;
1573
1284
  }
1574
1285
  },
1575
- onKeyDown: function onKeyDown(e) {
1286
+ onKeyDown: e => {
1576
1287
  if (!inputValue) {
1577
1288
  if (themeContext.rtl && e.keyCode === KEY_CODES.RIGHT && selectedItems.length > 0 && previousIndexRef.current === undefined) {
1578
1289
  setFocusedItem(selectedItems[selectedItems.length - 1]);
@@ -1616,43 +1327,37 @@ Multiselect.defaultProps = {
1616
1327
  };
1617
1328
  Multiselect.displayName = 'Multiselect';
1618
1329
 
1619
- var _excluded$6 = ["children", "start"],
1620
- _excluded2$2 = ["type"];
1621
- var Select = React__default.forwardRef(function (_ref, _ref3) {
1622
- var children = _ref.children,
1623
- start = _ref.start,
1624
- props = _objectWithoutProperties(_ref, _excluded$6);
1625
- var _useDropdownContext = useDropdownContext(),
1626
- popperReferenceElementRef = _useDropdownContext.popperReferenceElementRef,
1627
- itemSearchRegistry = _useDropdownContext.itemSearchRegistry,
1628
- _useDropdownContext$d = _useDropdownContext.downshift,
1629
- getToggleButtonProps = _useDropdownContext$d.getToggleButtonProps,
1630
- getInputProps = _useDropdownContext$d.getInputProps,
1631
- isOpen = _useDropdownContext$d.isOpen,
1632
- highlightedIndex = _useDropdownContext$d.highlightedIndex,
1633
- setHighlightedIndex = _useDropdownContext$d.setHighlightedIndex,
1634
- selectItemAtIndex = _useDropdownContext$d.selectItemAtIndex,
1635
- closeMenu = _useDropdownContext$d.closeMenu;
1636
- var _useFieldContext = useFieldContext(),
1637
- isLabelHovered = _useFieldContext.isLabelHovered;
1638
- var _useState = useState(false),
1639
- _useState2 = _slicedToArray(_useState, 2),
1640
- isHovered = _useState2[0],
1641
- setIsHovered = _useState2[1];
1642
- var _useState3 = useState(false),
1643
- _useState4 = _slicedToArray(_useState3, 2),
1644
- isFocused = _useState4[0],
1645
- setIsFocused = _useState4[1];
1646
- var hiddenInputRef = useRef();
1647
- var triggerRef = useRef();
1648
- var previousIsOpenRef = useRef(undefined);
1649
- var _useState5 = useState(''),
1650
- _useState6 = _slicedToArray(_useState5, 2),
1651
- searchString = _useState6[0],
1652
- setSearchString = _useState6[1];
1653
- var searchTimeoutRef = useRef();
1654
- var currentSearchIndexRef = useRef(0);
1655
- useEffect(function () {
1330
+ const Select = React__default.forwardRef((_ref, ref) => {
1331
+ let {
1332
+ children,
1333
+ start,
1334
+ ...props
1335
+ } = _ref;
1336
+ const {
1337
+ popperReferenceElementRef,
1338
+ itemSearchRegistry,
1339
+ downshift: {
1340
+ getToggleButtonProps,
1341
+ getInputProps,
1342
+ isOpen,
1343
+ highlightedIndex,
1344
+ setHighlightedIndex,
1345
+ selectItemAtIndex,
1346
+ closeMenu
1347
+ }
1348
+ } = useDropdownContext();
1349
+ const {
1350
+ isLabelHovered
1351
+ } = useFieldContext();
1352
+ const [isHovered, setIsHovered] = useState(false);
1353
+ const [isFocused, setIsFocused] = useState(false);
1354
+ const hiddenInputRef = useRef();
1355
+ const triggerRef = useRef();
1356
+ const previousIsOpenRef = useRef(undefined);
1357
+ const [searchString, setSearchString] = useState('');
1358
+ const searchTimeoutRef = useRef();
1359
+ const currentSearchIndexRef = useRef(0);
1360
+ useEffect(() => {
1656
1361
  if (hiddenInputRef.current && isOpen && !previousIsOpenRef.current) {
1657
1362
  hiddenInputRef.current.focus();
1658
1363
  }
@@ -1661,27 +1366,27 @@ var Select = React__default.forwardRef(function (_ref, _ref3) {
1661
1366
  }
1662
1367
  previousIsOpenRef.current = isOpen;
1663
1368
  }, [isOpen, triggerRef]);
1664
- useEffect(function () {
1369
+ useEffect(() => {
1665
1370
  if (searchTimeoutRef.current) {
1666
1371
  clearTimeout(searchTimeoutRef.current);
1667
1372
  }
1668
- searchTimeoutRef.current = window.setTimeout(function () {
1373
+ searchTimeoutRef.current = window.setTimeout(() => {
1669
1374
  setSearchString('');
1670
1375
  }, 500);
1671
- return function () {
1376
+ return () => {
1672
1377
  clearTimeout(searchTimeoutRef.current);
1673
1378
  };
1674
1379
  }, [searchString]);
1675
- var searchItems = useCallback(function (searchValue, startIndex, endIndex) {
1676
- for (var index = startIndex; index < endIndex; index++) {
1677
- var itemTextValue = itemSearchRegistry.current[index];
1380
+ const searchItems = useCallback((searchValue, startIndex, endIndex) => {
1381
+ for (let index = startIndex; index < endIndex; index++) {
1382
+ const itemTextValue = itemSearchRegistry.current[index];
1678
1383
  if (itemTextValue && itemTextValue.toUpperCase().indexOf(searchValue.toUpperCase()) === 0) {
1679
1384
  return index;
1680
1385
  }
1681
1386
  }
1682
1387
  return undefined;
1683
1388
  }, [itemSearchRegistry]);
1684
- var onInputKeyDown = useCallback(function (e) {
1389
+ const onInputKeyDown = useCallback(e => {
1685
1390
  if (e.keyCode === KEY_CODES.SPACE) {
1686
1391
  if (searchString) {
1687
1392
  e.preventDefault();
@@ -1696,7 +1401,7 @@ var Select = React__default.forwardRef(function (_ref, _ref3) {
1696
1401
  if ((e.keyCode < 48 || e.keyCode > 57) && (e.keyCode < 65 || e.keyCode > 90) && e.keyCode !== KEY_CODES.SPACE) {
1697
1402
  return;
1698
1403
  }
1699
- var character = String.fromCharCode(e.which || e.keyCode);
1404
+ const character = String.fromCharCode(e.which || e.keyCode);
1700
1405
  if (!character || character.length === 0) {
1701
1406
  return;
1702
1407
  }
@@ -1707,9 +1412,9 @@ var Select = React__default.forwardRef(function (_ref, _ref3) {
1707
1412
  currentSearchIndexRef.current = highlightedIndex;
1708
1413
  }
1709
1414
  }
1710
- var newSearchString = searchString + character;
1415
+ const newSearchString = searchString + character;
1711
1416
  setSearchString(newSearchString);
1712
- var matchingIndex = searchItems(newSearchString, currentSearchIndexRef.current + 1, itemSearchRegistry.current.length);
1417
+ let matchingIndex = searchItems(newSearchString, currentSearchIndexRef.current + 1, itemSearchRegistry.current.length);
1713
1418
  if (matchingIndex === undefined) {
1714
1419
  matchingIndex = searchItems(newSearchString, 0, currentSearchIndexRef.current);
1715
1420
  }
@@ -1717,35 +1422,31 @@ var Select = React__default.forwardRef(function (_ref, _ref3) {
1717
1422
  setHighlightedIndex(matchingIndex);
1718
1423
  }
1719
1424
  }, [searchString, searchItems, itemSearchRegistry, highlightedIndex, selectItemAtIndex, closeMenu, setHighlightedIndex]);
1720
- var _getToggleButtonProps = getToggleButtonProps(_objectSpread2({
1425
+ const {
1426
+ type,
1427
+ ...selectProps
1428
+ } = getToggleButtonProps({
1721
1429
  tabIndex: props.disabled ? undefined : 0,
1722
- onMouseEnter: composeEventHandlers(props.onMouseEnter, function () {
1723
- return setIsHovered(true);
1724
- }),
1725
- onMouseLeave: composeEventHandlers(props.onMouseLeave, function () {
1726
- return setIsHovered(false);
1727
- }),
1728
- onFocus: composeEventHandlers(props.onFocus, function () {
1729
- return setIsFocused(true);
1730
- }),
1731
- onBlur: composeEventHandlers(props.onBlur, function () {
1732
- return setIsFocused(false);
1733
- })
1734
- }, props));
1735
- _getToggleButtonProps.type;
1736
- var selectProps = _objectWithoutProperties(_getToggleButtonProps, _excluded2$2);
1737
- var isContainerHovered = isLabelHovered && !isOpen;
1738
- var isContainerFocused = isFocused || isOpen;
1739
- return React__default.createElement(Reference, null, function (_ref2) {
1740
- var popperReference = _ref2.ref;
1430
+ onMouseEnter: composeEventHandlers(props.onMouseEnter, () => setIsHovered(true)),
1431
+ onMouseLeave: composeEventHandlers(props.onMouseLeave, () => setIsHovered(false)),
1432
+ onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),
1433
+ onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false)),
1434
+ ...props
1435
+ });
1436
+ const isContainerHovered = isLabelHovered && !isOpen;
1437
+ const isContainerFocused = isFocused || isOpen;
1438
+ return React__default.createElement(Reference, null, _ref2 => {
1439
+ let {
1440
+ ref: popperReference
1441
+ } = _ref2;
1741
1442
  return React__default.createElement(StyledFauxInput, _extends$5({
1742
1443
  isHovered: isContainerHovered,
1743
1444
  isFocused: isContainerFocused
1744
1445
  }, selectProps, {
1745
1446
  role: "none",
1746
- ref: function ref(selectRef) {
1447
+ ref: selectRef => {
1747
1448
  popperReference(selectRef);
1748
- mergeRefs([triggerRef, _ref3, popperReferenceElementRef])(selectRef);
1449
+ mergeRefs([triggerRef, ref, popperReferenceElementRef])(selectRef);
1749
1450
  }
1750
1451
  }), start && React__default.createElement(StyledFauxInput.StartIcon, {
1751
1452
  isHovered: isHovered || isLabelHovered && !isOpen,
@@ -1757,7 +1458,7 @@ var Select = React__default.forwardRef(function (_ref, _ref3) {
1757
1458
  tabIndex: -1,
1758
1459
  ref: hiddenInputRef,
1759
1460
  value: '',
1760
- onClick: function onClick(e) {
1461
+ onClick: e => {
1761
1462
  if (isOpen) {
1762
1463
  e.nativeEvent.preventDownshiftDefault = true;
1763
1464
  }
@@ -1781,21 +1482,20 @@ Select.propTypes = {
1781
1482
  start: PropTypes.any
1782
1483
  };
1783
1484
 
1784
- var Field = forwardRef(function (props, fieldRef) {
1785
- var _useDropdownContext = useDropdownContext(),
1786
- getRootProps = _useDropdownContext.downshift.getRootProps;
1787
- var _useState = useState(false),
1788
- _useState2 = _slicedToArray(_useState, 2),
1789
- isLabelHovered = _useState2[0],
1790
- setIsLabelHovered = _useState2[1];
1791
- var _getRootProps = getRootProps(),
1792
- ref = _getRootProps.ref;
1793
- var value = useMemo(function () {
1794
- return {
1795
- isLabelHovered: isLabelHovered,
1796
- setIsLabelHovered: setIsLabelHovered
1797
- };
1798
- }, [isLabelHovered, setIsLabelHovered]);
1485
+ const Field = forwardRef((props, fieldRef) => {
1486
+ const {
1487
+ downshift: {
1488
+ getRootProps
1489
+ }
1490
+ } = useDropdownContext();
1491
+ const [isLabelHovered, setIsLabelHovered] = useState(false);
1492
+ const {
1493
+ ref
1494
+ } = getRootProps();
1495
+ const value = useMemo(() => ({
1496
+ isLabelHovered,
1497
+ setIsLabelHovered
1498
+ }), [isLabelHovered, setIsLabelHovered]);
1799
1499
  return React__default.createElement(FieldContext.Provider, {
1800
1500
  value: value
1801
1501
  }, React__default.createElement(Field$1, _extends$5({
@@ -1804,30 +1504,34 @@ var Field = forwardRef(function (props, fieldRef) {
1804
1504
  });
1805
1505
  Field.displayName = 'Field';
1806
1506
 
1807
- var Hint = React__default.forwardRef(function (props, ref) {
1808
- return React__default.createElement(Hint$1, _extends$5({
1809
- ref: ref
1810
- }, props));
1811
- });
1507
+ const Hint = React__default.forwardRef((props, ref) => React__default.createElement(Hint$1, _extends$5({
1508
+ ref: ref
1509
+ }, props)));
1812
1510
  Hint.displayName = 'Hint';
1813
1511
 
1814
- var _excluded$5 = ["onMouseEnter", "onMouseLeave"];
1815
- var Label = React__default.forwardRef(function (_ref, ref) {
1816
- var onMouseEnter = _ref.onMouseEnter,
1817
- onMouseLeave = _ref.onMouseLeave,
1818
- other = _objectWithoutProperties(_ref, _excluded$5);
1819
- var _useDropdownContext = useDropdownContext(),
1820
- getLabelProps = _useDropdownContext.downshift.getLabelProps;
1821
- var _useFieldContext = useFieldContext(),
1822
- setIsLabelHovered = _useFieldContext.setIsLabelHovered;
1823
- var labelProps = getLabelProps(_objectSpread2({
1824
- onMouseEnter: composeEventHandlers(onMouseEnter, function () {
1512
+ const Label = React__default.forwardRef((_ref, ref) => {
1513
+ let {
1514
+ onMouseEnter,
1515
+ onMouseLeave,
1516
+ ...other
1517
+ } = _ref;
1518
+ const {
1519
+ downshift: {
1520
+ getLabelProps
1521
+ }
1522
+ } = useDropdownContext();
1523
+ const {
1524
+ setIsLabelHovered
1525
+ } = useFieldContext();
1526
+ const labelProps = getLabelProps({
1527
+ onMouseEnter: composeEventHandlers(onMouseEnter, () => {
1825
1528
  setIsLabelHovered(true);
1826
1529
  }),
1827
- onMouseLeave: composeEventHandlers(onMouseLeave, function () {
1530
+ onMouseLeave: composeEventHandlers(onMouseLeave, () => {
1828
1531
  setIsLabelHovered(false);
1829
- })
1830
- }, other));
1532
+ }),
1533
+ ...other
1534
+ });
1831
1535
  return React__default.createElement(Label$1, _extends$5({
1832
1536
  ref: ref
1833
1537
  }, labelProps));
@@ -1837,111 +1541,109 @@ Label.propTypes = {
1837
1541
  isRegular: PropTypes.bool
1838
1542
  };
1839
1543
 
1840
- var Message = React__default.forwardRef(function (props, ref) {
1841
- return React__default.createElement(Message$1, _extends$5({
1842
- ref: ref
1843
- }, props));
1844
- });
1544
+ const Message = React__default.forwardRef((props, ref) => React__default.createElement(Message$1, _extends$5({
1545
+ ref: ref
1546
+ }, props)));
1845
1547
  Message.displayName = 'Message';
1846
1548
  Message.propTypes = {
1847
1549
  validation: PropTypes.oneOf(VALIDATION)
1848
1550
  };
1849
1551
 
1850
- var SHARED_PLACEMENT = ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'];
1851
- var PLACEMENT = [].concat(SHARED_PLACEMENT, ['end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom']);
1552
+ const SHARED_PLACEMENT = ['auto', 'top', 'top-start', 'top-end', 'bottom', 'bottom-start', 'bottom-end'];
1553
+ const PLACEMENT = [...SHARED_PLACEMENT, 'end', 'end-top', 'end-bottom', 'start', 'start-top', 'start-bottom'];
1852
1554
 
1853
- var MenuContext = React__default.createContext(undefined);
1854
- var useMenuContext = function useMenuContext() {
1855
- var menuContext = useContext(MenuContext);
1555
+ const MenuContext = React__default.createContext(undefined);
1556
+ const useMenuContext = () => {
1557
+ const menuContext = useContext(MenuContext);
1856
1558
  if (!menuContext) {
1857
1559
  throw new Error('This component must be rendered within a `Menu` component.');
1858
1560
  }
1859
1561
  return menuContext;
1860
1562
  };
1861
1563
 
1862
- var _excluded$4 = ["placement", "popperModifiers", "eventsEnabled", "isAnimated", "maxHeight", "style", "zIndex", "isCompact", "children", "appendToNode"];
1863
- var Menu = forwardRef(function (props, menuRef) {
1864
- var placement = props.placement,
1865
- popperModifiers = props.popperModifiers,
1866
- eventsEnabled = props.eventsEnabled,
1867
- isAnimated = props.isAnimated,
1868
- maxHeight = props.maxHeight,
1869
- menuStyle = props.style,
1870
- zIndex = props.zIndex,
1871
- isCompact = props.isCompact,
1872
- children = props.children,
1873
- appendToNode = props.appendToNode,
1874
- otherProps = _objectWithoutProperties(props, _excluded$4);
1875
- var _useDropdownContext = useDropdownContext(),
1876
- hasMenuRef = _useDropdownContext.hasMenuRef,
1877
- itemIndexRef = _useDropdownContext.itemIndexRef,
1878
- previousIndexRef = _useDropdownContext.previousIndexRef,
1879
- nextItemsHashRef = _useDropdownContext.nextItemsHashRef,
1880
- popperReferenceElementRef = _useDropdownContext.popperReferenceElementRef,
1881
- itemSearchRegistry = _useDropdownContext.itemSearchRegistry,
1882
- _useDropdownContext$d = _useDropdownContext.downshift,
1883
- isOpen = _useDropdownContext$d.isOpen,
1884
- getMenuProps = _useDropdownContext$d.getMenuProps;
1885
- var scheduleUpdateRef = useRef(undefined);
1886
- useEffect(function () {
1564
+ const Menu = forwardRef((props, menuRef) => {
1565
+ const {
1566
+ placement,
1567
+ popperModifiers,
1568
+ eventsEnabled,
1569
+ isAnimated,
1570
+ maxHeight,
1571
+ style: menuStyle,
1572
+ zIndex,
1573
+ isCompact,
1574
+ children,
1575
+ appendToNode,
1576
+ ...otherProps
1577
+ } = props;
1578
+ const {
1579
+ hasMenuRef,
1580
+ itemIndexRef,
1581
+ previousIndexRef,
1582
+ nextItemsHashRef,
1583
+ popperReferenceElementRef,
1584
+ itemSearchRegistry,
1585
+ downshift: {
1586
+ isOpen,
1587
+ getMenuProps
1588
+ }
1589
+ } = useDropdownContext();
1590
+ const scheduleUpdateRef = useRef(undefined);
1591
+ useEffect(() => {
1887
1592
  if (scheduleUpdateRef.current && isOpen) {
1888
1593
  scheduleUpdateRef.current();
1889
1594
  }
1890
1595
  });
1891
- var _useState = useState(isOpen),
1892
- _useState2 = _slicedToArray(_useState, 2),
1893
- isVisible = _useState2[0],
1894
- setIsVisible = _useState2[1];
1895
- useEffect(function () {
1896
- var timeout;
1596
+ const [isVisible, setIsVisible] = useState(isOpen);
1597
+ useEffect(() => {
1598
+ let timeout;
1897
1599
  if (isOpen) {
1898
1600
  setIsVisible(true);
1899
1601
  } else if (isAnimated) {
1900
- timeout = setTimeout(function () {
1901
- return setIsVisible(false);
1902
- }, 200);
1602
+ timeout = setTimeout(() => setIsVisible(false), 200);
1903
1603
  } else {
1904
1604
  setIsVisible(false);
1905
1605
  }
1906
- return function () {
1907
- return clearTimeout(timeout);
1908
- };
1606
+ return () => clearTimeout(timeout);
1909
1607
  }, [isOpen, isAnimated]);
1910
- var themeContext = useContext(ThemeContext);
1608
+ const themeContext = useContext(ThemeContext);
1911
1609
  itemIndexRef.current = 0;
1912
1610
  nextItemsHashRef.current = {};
1913
1611
  previousIndexRef.current = undefined;
1914
1612
  itemSearchRegistry.current = [];
1915
- var popperPlacement = themeContext.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement);
1613
+ const popperPlacement = themeContext.rtl ? getRtlPopperPlacement(placement) : getPopperPlacement(placement);
1916
1614
  return (
1917
1615
  React__default.createElement(MenuContext.Provider, {
1918
1616
  value: {
1919
- itemIndexRef: itemIndexRef,
1920
- isCompact: isCompact
1617
+ itemIndexRef,
1618
+ isCompact
1921
1619
  }
1922
1620
  }, React__default.createElement(Popper, {
1923
1621
  placement: popperPlacement,
1924
1622
  modifiers: popperModifiers
1925
1623
  ,
1926
1624
  eventsEnabled: isOpen && eventsEnabled
1927
- }, function (_ref) {
1928
- var ref = _ref.ref,
1929
- style = _ref.style,
1930
- scheduleUpdate = _ref.scheduleUpdate,
1931
- currentPlacement = _ref.placement;
1932
- var computedStyle = menuStyle;
1625
+ }, _ref => {
1626
+ let {
1627
+ ref,
1628
+ style,
1629
+ scheduleUpdate,
1630
+ placement: currentPlacement
1631
+ } = _ref;
1632
+ let computedStyle = menuStyle;
1933
1633
  scheduleUpdateRef.current = scheduleUpdate;
1934
1634
  if ((isOpen || isVisible) && popperReferenceElementRef.current && popperReferenceElementRef.current.getBoundingClientRect) {
1935
- computedStyle = _objectSpread2({
1936
- width: popperReferenceElementRef.current.getBoundingClientRect().width
1937
- }, menuStyle);
1635
+ computedStyle = {
1636
+ width: popperReferenceElementRef.current.getBoundingClientRect().width,
1637
+ ...menuStyle
1638
+ };
1938
1639
  }
1939
- var menuProps = getMenuProps(_objectSpread2({
1640
+ const menuProps = getMenuProps({
1940
1641
  role: hasMenuRef.current ? 'menu' : 'listbox',
1941
1642
  placement: currentPlacement,
1942
- isAnimated: isAnimated && (isOpen || isVisible)
1943
- }, otherProps));
1944
- var menu = React__default.createElement(StyledMenuWrapper, {
1643
+ isAnimated: isAnimated && (isOpen || isVisible),
1644
+ ...otherProps
1645
+ });
1646
+ const menu = React__default.createElement(StyledMenuWrapper, {
1945
1647
  ref: isOpen ? ref : undefined,
1946
1648
  hasArrow: menuProps.hasArrow,
1947
1649
  placement: menuProps.placement,
@@ -1979,11 +1681,9 @@ Menu.defaultProps = {
1979
1681
  zIndex: 1000
1980
1682
  };
1981
1683
 
1982
- var Separator = React__default.forwardRef(function (props, ref) {
1983
- return React__default.createElement(StyledSeparator, _extends$5({
1984
- ref: ref
1985
- }, props));
1986
- });
1684
+ const Separator = React__default.forwardRef((props, ref) => React__default.createElement(StyledSeparator, _extends$5({
1685
+ ref: ref
1686
+ }, props)));
1987
1687
  Separator.displayName = 'Separator';
1988
1688
 
1989
1689
  var _path$1;
@@ -1997,7 +1697,8 @@ var SvgPlusStroke = function SvgPlusStroke(props) {
1997
1697
  height: 16,
1998
1698
  focusable: "false",
1999
1699
  viewBox: "0 0 16 16",
2000
- "aria-hidden": "true"
1700
+ "aria-hidden": "true",
1701
+ role: "img"
2001
1702
  }, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
2002
1703
  stroke: "currentColor",
2003
1704
  strokeLinecap: "round",
@@ -2016,7 +1717,8 @@ var SvgCheckLgStroke = function SvgCheckLgStroke(props) {
2016
1717
  height: 16,
2017
1718
  focusable: "false",
2018
1719
  viewBox: "0 0 16 16",
2019
- "aria-hidden": "true"
1720
+ "aria-hidden": "true",
1721
+ role: "img"
2020
1722
  }, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
2021
1723
  fill: "none",
2022
1724
  stroke: "currentColor",
@@ -2026,49 +1728,52 @@ var SvgCheckLgStroke = function SvgCheckLgStroke(props) {
2026
1728
  })));
2027
1729
  };
2028
1730
 
2029
- var ItemContext = React__default.createContext(undefined);
2030
- var useItemContext = function useItemContext() {
2031
- var context = useContext(ItemContext);
1731
+ const ItemContext = React__default.createContext(undefined);
1732
+ const useItemContext = () => {
1733
+ const context = useContext(ItemContext);
2032
1734
  if (!context) {
2033
1735
  throw new Error('This component must be rendered within an `Item` component.');
2034
1736
  }
2035
1737
  return context;
2036
1738
  };
2037
1739
 
2038
- var _excluded$3 = ["value", "disabled", "isDanger", "component", "children"];
2039
- var Item = React__default.forwardRef(function (_ref, forwardRef) {
2040
- var value = _ref.value,
2041
- disabled = _ref.disabled,
2042
- isDanger = _ref.isDanger,
2043
- _ref$component = _ref.component,
2044
- component = _ref$component === void 0 ? StyledItem : _ref$component,
2045
- children = _ref.children,
2046
- props = _objectWithoutProperties(_ref, _excluded$3);
2047
- var _useDropdownContext = useDropdownContext(),
2048
- selectedItems = _useDropdownContext.selectedItems,
2049
- hasMenuRef = _useDropdownContext.hasMenuRef,
2050
- itemSearchRegistry = _useDropdownContext.itemSearchRegistry,
2051
- _useDropdownContext$d = _useDropdownContext.downshift,
2052
- isOpen = _useDropdownContext$d.isOpen,
2053
- selectedItem = _useDropdownContext$d.selectedItem,
2054
- highlightedIndex = _useDropdownContext$d.highlightedIndex,
2055
- getItemProps = _useDropdownContext$d.getItemProps,
2056
- setHighlightedIndex = _useDropdownContext$d.setHighlightedIndex,
2057
- itemToString = _useDropdownContext$d.itemToString;
2058
- var _useMenuContext = useMenuContext(),
2059
- itemIndexRef = _useMenuContext.itemIndexRef,
2060
- isCompact = _useMenuContext.isCompact;
2061
- var itemRef = useRef();
2062
- var Component = component;
1740
+ const Item = React__default.forwardRef((_ref, forwardRef) => {
1741
+ let {
1742
+ value,
1743
+ disabled,
1744
+ isDanger,
1745
+ component = StyledItem,
1746
+ children,
1747
+ ...props
1748
+ } = _ref;
1749
+ const {
1750
+ selectedItems,
1751
+ hasMenuRef,
1752
+ itemSearchRegistry,
1753
+ downshift: {
1754
+ isOpen,
1755
+ selectedItem,
1756
+ highlightedIndex,
1757
+ getItemProps,
1758
+ setHighlightedIndex,
1759
+ itemToString
1760
+ }
1761
+ } = useDropdownContext();
1762
+ const {
1763
+ itemIndexRef,
1764
+ isCompact
1765
+ } = useMenuContext();
1766
+ const itemRef = useRef();
1767
+ const Component = component;
2063
1768
  if ((value === undefined || value === null) && !disabled) {
2064
1769
  throw new Error('All Item components require a `value` prop');
2065
1770
  }
2066
- var currentIndex = itemIndexRef.current;
2067
- var isFocused = highlightedIndex === currentIndex;
2068
- var isSelected;
2069
- useEffect(function () {
1771
+ const currentIndex = itemIndexRef.current;
1772
+ const isFocused = highlightedIndex === currentIndex;
1773
+ let isSelected;
1774
+ useEffect(() => {
2070
1775
  if (!disabled && itemRef.current) {
2071
- var itemTextValue = itemRef.current.innerText;
1776
+ const itemTextValue = itemRef.current.innerText;
2072
1777
  if (itemTextValue) {
2073
1778
  itemSearchRegistry.current[currentIndex] = itemTextValue;
2074
1779
  }
@@ -2076,7 +1781,7 @@ var Item = React__default.forwardRef(function (_ref, forwardRef) {
2076
1781
  });
2077
1782
  if (value) {
2078
1783
  if (selectedItems) {
2079
- isSelected = selectedItems.some(function (item) {
1784
+ isSelected = selectedItems.some(item => {
2080
1785
  return itemToString(item) === itemToString(value);
2081
1786
  });
2082
1787
  } else {
@@ -2085,17 +1790,15 @@ var Item = React__default.forwardRef(function (_ref, forwardRef) {
2085
1790
  } else {
2086
1791
  isSelected = false;
2087
1792
  }
2088
- useEffect(function () {
1793
+ useEffect(() => {
2089
1794
  if (isOpen && !disabled && !selectedItems && isSelected) {
2090
1795
  setHighlightedIndex(currentIndex);
2091
1796
  }
2092
1797
  }, [currentIndex, disabled, isOpen, isSelected, selectedItems, setHighlightedIndex]);
2093
- var contextValue = useMemo(function () {
2094
- return {
2095
- isDisabled: disabled
2096
- };
2097
- }, [disabled]);
2098
- var ref = mergeRefs([itemRef, forwardRef]);
1798
+ const contextValue = useMemo(() => ({
1799
+ isDisabled: disabled
1800
+ }), [disabled]);
1801
+ const ref = mergeRefs([itemRef, forwardRef]);
2099
1802
  if (disabled) {
2100
1803
  return React__default.createElement(ItemContext.Provider, {
2101
1804
  value: contextValue
@@ -2113,16 +1816,18 @@ var Item = React__default.forwardRef(function (_ref, forwardRef) {
2113
1816
  itemIndexRef.current++;
2114
1817
  return React__default.createElement(ItemContext.Provider, {
2115
1818
  value: contextValue
2116
- }, React__default.createElement(Component, getItemProps(_objectSpread2(_objectSpread2({
1819
+ }, React__default.createElement(Component, getItemProps({
2117
1820
  item: value,
2118
- isFocused: isFocused,
2119
- ref: ref,
2120
- isCompact: isCompact,
2121
- isDanger: isDanger
2122
- }, hasMenuRef.current && {
2123
- role: 'menuitem',
2124
- 'aria-selected': null
2125
- }), props)), isSelected && React__default.createElement(StyledItemIcon, {
1821
+ isFocused,
1822
+ ref,
1823
+ isCompact,
1824
+ isDanger,
1825
+ ...(hasMenuRef.current && {
1826
+ role: 'menuitem',
1827
+ 'aria-selected': null
1828
+ }),
1829
+ ...props
1830
+ }), isSelected && React__default.createElement(StyledItemIcon, {
2126
1831
  isCompact: isCompact,
2127
1832
  isVisible: isSelected
2128
1833
  }, React__default.createElement(SvgCheckLgStroke, null)), children));
@@ -2133,13 +1838,15 @@ Item.propTypes = {
2133
1838
  disabled: PropTypes.bool
2134
1839
  };
2135
1840
 
2136
- var _excluded$2 = ["children", "disabled"];
2137
- var AddItemComponent = React__default.forwardRef(function (_ref, ref) {
2138
- var children = _ref.children,
2139
- disabled = _ref.disabled,
2140
- props = _objectWithoutProperties(_ref, _excluded$2);
2141
- var _useMenuContext = useMenuContext(),
2142
- isCompact = _useMenuContext.isCompact;
1841
+ const AddItemComponent = React__default.forwardRef((_ref, ref) => {
1842
+ let {
1843
+ children,
1844
+ disabled,
1845
+ ...props
1846
+ } = _ref;
1847
+ const {
1848
+ isCompact
1849
+ } = useMenuContext();
2143
1850
  return React__default.createElement(StyledAddItem, _extends$5({
2144
1851
  ref: ref,
2145
1852
  disabled: disabled
@@ -2149,21 +1856,20 @@ var AddItemComponent = React__default.forwardRef(function (_ref, ref) {
2149
1856
  isDisabled: disabled
2150
1857
  }, React__default.createElement(SvgPlusStroke, null)), children);
2151
1858
  });
2152
- var AddItem = React__default.forwardRef(function (props, ref) {
2153
- return React__default.createElement(Item, _extends$5({
2154
- component: AddItemComponent,
2155
- ref: ref
2156
- }, props));
2157
- });
1859
+ const AddItem = React__default.forwardRef((props, ref) => React__default.createElement(Item, _extends$5({
1860
+ component: AddItemComponent,
1861
+ ref: ref
1862
+ }, props)));
2158
1863
  AddItem.displayName = 'AddItem';
2159
1864
  AddItem.propTypes = {
2160
1865
  value: PropTypes.any,
2161
1866
  disabled: PropTypes.bool
2162
1867
  };
2163
1868
 
2164
- var HeaderIcon = React__default.forwardRef(function (props, ref) {
2165
- var _useMenuContext = useMenuContext(),
2166
- isCompact = _useMenuContext.isCompact;
1869
+ const HeaderIcon = React__default.forwardRef((props, ref) => {
1870
+ const {
1871
+ isCompact
1872
+ } = useMenuContext();
2167
1873
  return React__default.createElement(StyledHeaderIcon, _extends$5({
2168
1874
  ref: ref,
2169
1875
  isCompact: isCompact
@@ -2171,9 +1877,10 @@ var HeaderIcon = React__default.forwardRef(function (props, ref) {
2171
1877
  });
2172
1878
  HeaderIcon.displayName = 'HeaderIcon';
2173
1879
 
2174
- var HeaderItem = React__default.forwardRef(function (props, ref) {
2175
- var _useMenuContext = useMenuContext(),
2176
- isCompact = _useMenuContext.isCompact;
1880
+ const HeaderItem = React__default.forwardRef((props, ref) => {
1881
+ const {
1882
+ isCompact
1883
+ } = useMenuContext();
2177
1884
  return React__default.createElement(StyledHeaderItem, _extends$5({
2178
1885
  ref: ref,
2179
1886
  isCompact: isCompact
@@ -2181,11 +1888,13 @@ var HeaderItem = React__default.forwardRef(function (props, ref) {
2181
1888
  });
2182
1889
  HeaderItem.displayName = 'HeaderItem';
2183
1890
 
2184
- var ItemMeta = React__default.forwardRef(function (props, ref) {
2185
- var _useMenuContext = useMenuContext(),
2186
- isCompact = _useMenuContext.isCompact;
2187
- var _useItemContext = useItemContext(),
2188
- isDisabled = _useItemContext.isDisabled;
1891
+ const ItemMeta = React__default.forwardRef((props, ref) => {
1892
+ const {
1893
+ isCompact
1894
+ } = useMenuContext();
1895
+ const {
1896
+ isDisabled
1897
+ } = useItemContext();
2189
1898
  return React__default.createElement(StyledItemMeta, _extends$5({
2190
1899
  ref: ref,
2191
1900
  isCompact: isCompact,
@@ -2194,9 +1903,10 @@ var ItemMeta = React__default.forwardRef(function (props, ref) {
2194
1903
  });
2195
1904
  ItemMeta.displayName = 'ItemMeta';
2196
1905
 
2197
- var MediaBody = React__default.forwardRef(function (props, ref) {
2198
- var _useMenuContext = useMenuContext(),
2199
- isCompact = _useMenuContext.isCompact;
1906
+ const MediaBody = React__default.forwardRef((props, ref) => {
1907
+ const {
1908
+ isCompact
1909
+ } = useMenuContext();
2200
1910
  return React__default.createElement(StyledMediaBody, _extends$5({
2201
1911
  ref: ref,
2202
1912
  isCompact: isCompact
@@ -2204,34 +1914,34 @@ var MediaBody = React__default.forwardRef(function (props, ref) {
2204
1914
  });
2205
1915
  MediaBody.displayName = 'MediaBody';
2206
1916
 
2207
- var MediaFigure = function MediaFigure(props) {
2208
- var _useMenuContext = useMenuContext(),
2209
- isCompact = _useMenuContext.isCompact;
1917
+ const MediaFigure = props => {
1918
+ const {
1919
+ isCompact
1920
+ } = useMenuContext();
2210
1921
  return React__default.createElement(StyledMediaFigure, _extends$5({
2211
1922
  isCompact: isCompact
2212
1923
  }, props));
2213
1924
  };
2214
1925
 
2215
- var MediaItem = React__default.forwardRef(function (props, ref) {
2216
- return React__default.createElement(Item, _extends$5({
2217
- component: StyledMediaItem,
2218
- ref: ref
2219
- }, props));
2220
- });
1926
+ const MediaItem = React__default.forwardRef((props, ref) => React__default.createElement(Item, _extends$5({
1927
+ component: StyledMediaItem,
1928
+ ref: ref
1929
+ }, props)));
2221
1930
  MediaItem.displayName = 'MediaItem';
2222
1931
  MediaItem.propTypes = {
2223
1932
  value: PropTypes.any,
2224
1933
  disabled: PropTypes.bool
2225
1934
  };
2226
1935
 
2227
- var _excluded$1 = ["children", "disabled"],
2228
- _excluded2$1 = ["value", "disabled"];
2229
- var NextItemComponent = React__default.forwardRef(function (_ref, ref) {
2230
- var children = _ref.children,
2231
- disabled = _ref.disabled,
2232
- props = _objectWithoutProperties(_ref, _excluded$1);
2233
- var _useMenuContext = useMenuContext(),
2234
- isCompact = _useMenuContext.isCompact;
1936
+ const NextItemComponent = React__default.forwardRef((_ref, ref) => {
1937
+ let {
1938
+ children,
1939
+ disabled,
1940
+ ...props
1941
+ } = _ref;
1942
+ const {
1943
+ isCompact
1944
+ } = useMenuContext();
2235
1945
  return React__default.createElement(StyledNextItem, _extends$5({
2236
1946
  ref: ref,
2237
1947
  disabled: disabled
@@ -2243,15 +1953,21 @@ var NextItemComponent = React__default.forwardRef(function (_ref, ref) {
2243
1953
  isDisabled: disabled
2244
1954
  })), children);
2245
1955
  });
2246
- var NextItem = React__default.forwardRef(function (_ref2, ref) {
2247
- var value = _ref2.value,
2248
- disabled = _ref2.disabled,
2249
- props = _objectWithoutProperties(_ref2, _excluded2$1);
2250
- var _useDropdownContext = useDropdownContext(),
2251
- nextItemsHashRef = _useDropdownContext.nextItemsHashRef,
2252
- itemToString = _useDropdownContext.downshift.itemToString;
2253
- var _useMenuContext2 = useMenuContext(),
2254
- itemIndexRef = _useMenuContext2.itemIndexRef;
1956
+ const NextItem = React__default.forwardRef((_ref2, ref) => {
1957
+ let {
1958
+ value,
1959
+ disabled,
1960
+ ...props
1961
+ } = _ref2;
1962
+ const {
1963
+ nextItemsHashRef,
1964
+ downshift: {
1965
+ itemToString
1966
+ }
1967
+ } = useDropdownContext();
1968
+ const {
1969
+ itemIndexRef
1970
+ } = useMenuContext();
2255
1971
  if (!disabled) {
2256
1972
  nextItemsHashRef.current[itemToString(value)] = itemIndexRef.current;
2257
1973
  }
@@ -2269,14 +1985,15 @@ NextItem.propTypes = {
2269
1985
  disabled: PropTypes.bool
2270
1986
  };
2271
1987
 
2272
- var _excluded = ["children", "disabled"],
2273
- _excluded2 = ["value", "disabled"];
2274
- var PreviousItemComponent = React__default.forwardRef(function (_ref, ref) {
2275
- var children = _ref.children,
2276
- disabled = _ref.disabled,
2277
- props = _objectWithoutProperties(_ref, _excluded);
2278
- var _useMenuContext = useMenuContext(),
2279
- isCompact = _useMenuContext.isCompact;
1988
+ const PreviousItemComponent = React__default.forwardRef((_ref, ref) => {
1989
+ let {
1990
+ children,
1991
+ disabled,
1992
+ ...props
1993
+ } = _ref;
1994
+ const {
1995
+ isCompact
1996
+ } = useMenuContext();
2280
1997
  return React__default.createElement(StyledPreviousItem, _extends$5({
2281
1998
  ref: ref,
2282
1999
  disabled: disabled
@@ -2288,14 +2005,18 @@ var PreviousItemComponent = React__default.forwardRef(function (_ref, ref) {
2288
2005
  isDisabled: disabled
2289
2006
  })), children);
2290
2007
  });
2291
- var PreviousItem = React__default.forwardRef(function (_ref2, ref) {
2292
- var value = _ref2.value,
2293
- disabled = _ref2.disabled,
2294
- props = _objectWithoutProperties(_ref2, _excluded2);
2295
- var _useDropdownContext = useDropdownContext(),
2296
- previousIndexRef = _useDropdownContext.previousIndexRef;
2297
- var _useMenuContext2 = useMenuContext(),
2298
- itemIndexRef = _useMenuContext2.itemIndexRef;
2008
+ const PreviousItem = React__default.forwardRef((_ref2, ref) => {
2009
+ let {
2010
+ value,
2011
+ disabled,
2012
+ ...props
2013
+ } = _ref2;
2014
+ const {
2015
+ previousIndexRef
2016
+ } = useDropdownContext();
2017
+ const {
2018
+ itemIndexRef
2019
+ } = useMenuContext();
2299
2020
  if (!disabled) {
2300
2021
  previousIndexRef.current = itemIndexRef.current;
2301
2022
  }