UNPKG

69 kBJavaScriptView Raw
1import _objectSpread from '@babel/runtime/helpers/esm/objectSpread2';
2import _extends from '@babel/runtime/helpers/esm/extends';
3import { jsx, keyframes, css as css$2 } from '@emotion/react';
4import _slicedToArray from '@babel/runtime/helpers/esm/slicedToArray';
5import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
6import _typeof from '@babel/runtime/helpers/esm/typeof';
7import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
8import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
9import { useContext, useRef, useState, useMemo, useCallback, createContext } from 'react';
10import { createPortal } from 'react-dom';
11import { autoUpdate } from '@floating-ui/dom';
12import useLayoutEffect from 'use-isomorphic-layout-effect';
13
14var _excluded$4 = ["className", "clearValue", "cx", "getStyles", "getClassNames", "getValue", "hasValue", "isMulti", "isRtl", "options", "selectOption", "selectProps", "setValue", "theme"];
15// ==============================
16// NO OP
17// ==============================
18
19var noop = function noop() {};
20
21// ==============================
22// Class Name Prefixer
23// ==============================
24
25/**
26 String representation of component state for styling with class names.
27
28 Expects an array of strings OR a string/object pair:
29 - className(['comp', 'comp-arg', 'comp-arg-2'])
30 @returns 'react-select__comp react-select__comp-arg react-select__comp-arg-2'
31 - className('comp', { some: true, state: false })
32 @returns 'react-select__comp react-select__comp--some'
33*/
34function applyPrefixToName(prefix, name) {
35 if (!name) {
36 return prefix;
37 } else if (name[0] === '-') {
38 return prefix + name;
39 } else {
40 return prefix + '__' + name;
41 }
42}
43function classNames(prefix, state) {
44 for (var _len = arguments.length, classNameList = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
45 classNameList[_key - 2] = arguments[_key];
46 }
47 var arr = [].concat(classNameList);
48 if (state && prefix) {
49 for (var key in state) {
50 if (state.hasOwnProperty(key) && state[key]) {
51 arr.push("".concat(applyPrefixToName(prefix, key)));
52 }
53 }
54 }
55 return arr.filter(function (i) {
56 return i;
57 }).map(function (i) {
58 return String(i).trim();
59 }).join(' ');
60}
61// ==============================
62// Clean Value
63// ==============================
64
65var cleanValue = function cleanValue(value) {
66 if (isArray(value)) return value.filter(Boolean);
67 if (_typeof(value) === 'object' && value !== null) return [value];
68 return [];
69};
70
71// ==============================
72// Clean Common Props
73// ==============================
74
75var cleanCommonProps = function cleanCommonProps(props) {
76 //className
77 props.className;
78 props.clearValue;
79 props.cx;
80 props.getStyles;
81 props.getClassNames;
82 props.getValue;
83 props.hasValue;
84 props.isMulti;
85 props.isRtl;
86 props.options;
87 props.selectOption;
88 props.selectProps;
89 props.setValue;
90 props.theme;
91 var innerProps = _objectWithoutProperties(props, _excluded$4);
92 return _objectSpread({}, innerProps);
93};
94
95// ==============================
96// Get Style Props
97// ==============================
98
99var getStyleProps = function getStyleProps(props, name, classNamesState) {
100 var cx = props.cx,
101 getStyles = props.getStyles,
102 getClassNames = props.getClassNames,
103 className = props.className;
104 return {
105 css: getStyles(name, props),
106 className: cx(classNamesState !== null && classNamesState !== void 0 ? classNamesState : {}, getClassNames(name, props), className)
107 };
108};
109
110// ==============================
111// Handle Input Change
112// ==============================
113
114function handleInputChange(inputValue, actionMeta, onInputChange) {
115 if (onInputChange) {
116 var _newValue = onInputChange(inputValue, actionMeta);
117 if (typeof _newValue === 'string') return _newValue;
118 }
119 return inputValue;
120}
121
122// ==============================
123// Scroll Helpers
124// ==============================
125
126function isDocumentElement(el) {
127 return [document.documentElement, document.body, window].indexOf(el) > -1;
128}
129
130// Normalized Scroll Top
131// ------------------------------
132
133function normalizedHeight(el) {
134 if (isDocumentElement(el)) {
135 return window.innerHeight;
136 }
137 return el.clientHeight;
138}
139
140// Normalized scrollTo & scrollTop
141// ------------------------------
142
143function getScrollTop(el) {
144 if (isDocumentElement(el)) {
145 return window.pageYOffset;
146 }
147 return el.scrollTop;
148}
149function scrollTo(el, top) {
150 // with a scroll distance, we perform scroll on the element
151 if (isDocumentElement(el)) {
152 window.scrollTo(0, top);
153 return;
154 }
155 el.scrollTop = top;
156}
157
158// Get Scroll Parent
159// ------------------------------
160
161function getScrollParent(element) {
162 var style = getComputedStyle(element);
163 var excludeStaticParent = style.position === 'absolute';
164 var overflowRx = /(auto|scroll)/;
165 if (style.position === 'fixed') return document.documentElement;
166 for (var parent = element; parent = parent.parentElement;) {
167 style = getComputedStyle(parent);
168 if (excludeStaticParent && style.position === 'static') {
169 continue;
170 }
171 if (overflowRx.test(style.overflow + style.overflowY + style.overflowX)) {
172 return parent;
173 }
174 }
175 return document.documentElement;
176}
177
178// Animated Scroll To
179// ------------------------------
180
181/**
182 @param t: time (elapsed)
183 @param b: initial value
184 @param c: amount of change
185 @param d: duration
186*/
187function easeOutCubic(t, b, c, d) {
188 return c * ((t = t / d - 1) * t * t + 1) + b;
189}
190function animatedScrollTo(element, to) {
191 var duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 200;
192 var callback = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : noop;
193 var start = getScrollTop(element);
194 var change = to - start;
195 var increment = 10;
196 var currentTime = 0;
197 function animateScroll() {
198 currentTime += increment;
199 var val = easeOutCubic(currentTime, start, change, duration);
200 scrollTo(element, val);
201 if (currentTime < duration) {
202 window.requestAnimationFrame(animateScroll);
203 } else {
204 callback(element);
205 }
206 }
207 animateScroll();
208}
209
210// Scroll Into View
211// ------------------------------
212
213function scrollIntoView(menuEl, focusedEl) {
214 var menuRect = menuEl.getBoundingClientRect();
215 var focusedRect = focusedEl.getBoundingClientRect();
216 var overScroll = focusedEl.offsetHeight / 3;
217 if (focusedRect.bottom + overScroll > menuRect.bottom) {
218 scrollTo(menuEl, Math.min(focusedEl.offsetTop + focusedEl.clientHeight - menuEl.offsetHeight + overScroll, menuEl.scrollHeight));
219 } else if (focusedRect.top - overScroll < menuRect.top) {
220 scrollTo(menuEl, Math.max(focusedEl.offsetTop - overScroll, 0));
221 }
222}
223
224// ==============================
225// Get bounding client object
226// ==============================
227
228// cannot get keys using array notation with DOMRect
229function getBoundingClientObj(element) {
230 var rect = element.getBoundingClientRect();
231 return {
232 bottom: rect.bottom,
233 height: rect.height,
234 left: rect.left,
235 right: rect.right,
236 top: rect.top,
237 width: rect.width
238 };
239}
240
241// ==============================
242// Touch Capability Detector
243// ==============================
244
245function isTouchCapable() {
246 try {
247 document.createEvent('TouchEvent');
248 return true;
249 } catch (e) {
250 return false;
251 }
252}
253
254// ==============================
255// Mobile Device Detector
256// ==============================
257
258function isMobileDevice() {
259 try {
260 return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
261 } catch (e) {
262 return false;
263 }
264}
265
266// ==============================
267// Passive Event Detector
268// ==============================
269
270// https://github.com/rafgraph/detect-it/blob/main/src/index.ts#L19-L36
271var passiveOptionAccessed = false;
272var options = {
273 get passive() {
274 return passiveOptionAccessed = true;
275 }
276};
277// check for SSR
278var w = typeof window !== 'undefined' ? window : {};
279if (w.addEventListener && w.removeEventListener) {
280 w.addEventListener('p', noop, options);
281 w.removeEventListener('p', noop, false);
282}
283var supportsPassiveEvents = passiveOptionAccessed;
284function notNullish(item) {
285 return item != null;
286}
287function isArray(arg) {
288 return Array.isArray(arg);
289}
290function valueTernary(isMulti, multiValue, singleValue) {
291 return isMulti ? multiValue : singleValue;
292}
293function singleValueAsValue(singleValue) {
294 return singleValue;
295}
296function multiValueAsValue(multiValue) {
297 return multiValue;
298}
299var removeProps = function removeProps(propsObj) {
300 for (var _len2 = arguments.length, properties = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
301 properties[_key2 - 1] = arguments[_key2];
302 }
303 var propsMap = Object.entries(propsObj).filter(function (_ref) {
304 var _ref2 = _slicedToArray(_ref, 1),
305 key = _ref2[0];
306 return !properties.includes(key);
307 });
308 return propsMap.reduce(function (newProps, _ref3) {
309 var _ref4 = _slicedToArray(_ref3, 2),
310 key = _ref4[0],
311 val = _ref4[1];
312 newProps[key] = val;
313 return newProps;
314 }, {});
315};
316
317var _excluded$3 = ["children", "innerProps"],
318 _excluded2$1 = ["children", "innerProps"];
319function getMenuPlacement(_ref) {
320 var preferredMaxHeight = _ref.maxHeight,
321 menuEl = _ref.menuEl,
322 minHeight = _ref.minHeight,
323 preferredPlacement = _ref.placement,
324 shouldScroll = _ref.shouldScroll,
325 isFixedPosition = _ref.isFixedPosition,
326 controlHeight = _ref.controlHeight;
327 var scrollParent = getScrollParent(menuEl);
328 var defaultState = {
329 placement: 'bottom',
330 maxHeight: preferredMaxHeight
331 };
332
333 // something went wrong, return default state
334 if (!menuEl || !menuEl.offsetParent) return defaultState;
335
336 // we can't trust `scrollParent.scrollHeight` --> it may increase when
337 // the menu is rendered
338 var _scrollParent$getBoun = scrollParent.getBoundingClientRect(),
339 scrollHeight = _scrollParent$getBoun.height;
340 var _menuEl$getBoundingCl = menuEl.getBoundingClientRect(),
341 menuBottom = _menuEl$getBoundingCl.bottom,
342 menuHeight = _menuEl$getBoundingCl.height,
343 menuTop = _menuEl$getBoundingCl.top;
344 var _menuEl$offsetParent$ = menuEl.offsetParent.getBoundingClientRect(),
345 containerTop = _menuEl$offsetParent$.top;
346 var viewHeight = isFixedPosition ? window.innerHeight : normalizedHeight(scrollParent);
347 var scrollTop = getScrollTop(scrollParent);
348 var marginBottom = parseInt(getComputedStyle(menuEl).marginBottom, 10);
349 var marginTop = parseInt(getComputedStyle(menuEl).marginTop, 10);
350 var viewSpaceAbove = containerTop - marginTop;
351 var viewSpaceBelow = viewHeight - menuTop;
352 var scrollSpaceAbove = viewSpaceAbove + scrollTop;
353 var scrollSpaceBelow = scrollHeight - scrollTop - menuTop;
354 var scrollDown = menuBottom - viewHeight + scrollTop + marginBottom;
355 var scrollUp = scrollTop + menuTop - marginTop;
356 var scrollDuration = 160;
357 switch (preferredPlacement) {
358 case 'auto':
359 case 'bottom':
360 // 1: the menu will fit, do nothing
361 if (viewSpaceBelow >= menuHeight) {
362 return {
363 placement: 'bottom',
364 maxHeight: preferredMaxHeight
365 };
366 }
367
368 // 2: the menu will fit, if scrolled
369 if (scrollSpaceBelow >= menuHeight && !isFixedPosition) {
370 if (shouldScroll) {
371 animatedScrollTo(scrollParent, scrollDown, scrollDuration);
372 }
373 return {
374 placement: 'bottom',
375 maxHeight: preferredMaxHeight
376 };
377 }
378
379 // 3: the menu will fit, if constrained
380 if (!isFixedPosition && scrollSpaceBelow >= minHeight || isFixedPosition && viewSpaceBelow >= minHeight) {
381 if (shouldScroll) {
382 animatedScrollTo(scrollParent, scrollDown, scrollDuration);
383 }
384
385 // we want to provide as much of the menu as possible to the user,
386 // so give them whatever is available below rather than the minHeight.
387 var constrainedHeight = isFixedPosition ? viewSpaceBelow - marginBottom : scrollSpaceBelow - marginBottom;
388 return {
389 placement: 'bottom',
390 maxHeight: constrainedHeight
391 };
392 }
393
394 // 4. Forked beviour when there isn't enough space below
395
396 // AUTO: flip the menu, render above
397 if (preferredPlacement === 'auto' || isFixedPosition) {
398 // may need to be constrained after flipping
399 var _constrainedHeight = preferredMaxHeight;
400 var spaceAbove = isFixedPosition ? viewSpaceAbove : scrollSpaceAbove;
401 if (spaceAbove >= minHeight) {
402 _constrainedHeight = Math.min(spaceAbove - marginBottom - controlHeight, preferredMaxHeight);
403 }
404 return {
405 placement: 'top',
406 maxHeight: _constrainedHeight
407 };
408 }
409
410 // BOTTOM: allow browser to increase scrollable area and immediately set scroll
411 if (preferredPlacement === 'bottom') {
412 if (shouldScroll) {
413 scrollTo(scrollParent, scrollDown);
414 }
415 return {
416 placement: 'bottom',
417 maxHeight: preferredMaxHeight
418 };
419 }
420 break;
421 case 'top':
422 // 1: the menu will fit, do nothing
423 if (viewSpaceAbove >= menuHeight) {
424 return {
425 placement: 'top',
426 maxHeight: preferredMaxHeight
427 };
428 }
429
430 // 2: the menu will fit, if scrolled
431 if (scrollSpaceAbove >= menuHeight && !isFixedPosition) {
432 if (shouldScroll) {
433 animatedScrollTo(scrollParent, scrollUp, scrollDuration);
434 }
435 return {
436 placement: 'top',
437 maxHeight: preferredMaxHeight
438 };
439 }
440
441 // 3: the menu will fit, if constrained
442 if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
443 var _constrainedHeight2 = preferredMaxHeight;
444
445 // we want to provide as much of the menu as possible to the user,
446 // so give them whatever is available below rather than the minHeight.
447 if (!isFixedPosition && scrollSpaceAbove >= minHeight || isFixedPosition && viewSpaceAbove >= minHeight) {
448 _constrainedHeight2 = isFixedPosition ? viewSpaceAbove - marginTop : scrollSpaceAbove - marginTop;
449 }
450 if (shouldScroll) {
451 animatedScrollTo(scrollParent, scrollUp, scrollDuration);
452 }
453 return {
454 placement: 'top',
455 maxHeight: _constrainedHeight2
456 };
457 }
458
459 // 4. not enough space, the browser WILL NOT increase scrollable area when
460 // absolutely positioned element rendered above the viewport (only below).
461 // Flip the menu, render below
462 return {
463 placement: 'bottom',
464 maxHeight: preferredMaxHeight
465 };
466 default:
467 throw new Error("Invalid placement provided \"".concat(preferredPlacement, "\"."));
468 }
469 return defaultState;
470}
471
472// Menu Component
473// ------------------------------
474
475function alignToControl(placement) {
476 var placementToCSSProp = {
477 bottom: 'top',
478 top: 'bottom'
479 };
480 return placement ? placementToCSSProp[placement] : 'bottom';
481}
482var coercePlacement = function coercePlacement(p) {
483 return p === 'auto' ? 'bottom' : p;
484};
485var menuCSS = function menuCSS(_ref2, unstyled) {
486 var _objectSpread2;
487 var placement = _ref2.placement,
488 _ref2$theme = _ref2.theme,
489 borderRadius = _ref2$theme.borderRadius,
490 spacing = _ref2$theme.spacing,
491 colors = _ref2$theme.colors;
492 return _objectSpread((_objectSpread2 = {
493 label: 'menu'
494 }, _defineProperty(_objectSpread2, alignToControl(placement), '100%'), _defineProperty(_objectSpread2, "position", 'absolute'), _defineProperty(_objectSpread2, "width", '100%'), _defineProperty(_objectSpread2, "zIndex", 1), _objectSpread2), unstyled ? {} : {
495 backgroundColor: colors.neutral0,
496 borderRadius: borderRadius,
497 boxShadow: '0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)',
498 marginBottom: spacing.menuGutter,
499 marginTop: spacing.menuGutter
500 });
501};
502var PortalPlacementContext = /*#__PURE__*/createContext(null);
503
504// NOTE: internal only
505var MenuPlacer = function MenuPlacer(props) {
506 var children = props.children,
507 minMenuHeight = props.minMenuHeight,
508 maxMenuHeight = props.maxMenuHeight,
509 menuPlacement = props.menuPlacement,
510 menuPosition = props.menuPosition,
511 menuShouldScrollIntoView = props.menuShouldScrollIntoView,
512 theme = props.theme;
513 var _ref3 = useContext(PortalPlacementContext) || {},
514 setPortalPlacement = _ref3.setPortalPlacement;
515 var ref = useRef(null);
516 var _useState = useState(maxMenuHeight),
517 _useState2 = _slicedToArray(_useState, 2),
518 maxHeight = _useState2[0],
519 setMaxHeight = _useState2[1];
520 var _useState3 = useState(null),
521 _useState4 = _slicedToArray(_useState3, 2),
522 placement = _useState4[0],
523 setPlacement = _useState4[1];
524 var controlHeight = theme.spacing.controlHeight;
525 useLayoutEffect(function () {
526 var menuEl = ref.current;
527 if (!menuEl) return;
528
529 // DO NOT scroll if position is fixed
530 var isFixedPosition = menuPosition === 'fixed';
531 var shouldScroll = menuShouldScrollIntoView && !isFixedPosition;
532 var state = getMenuPlacement({
533 maxHeight: maxMenuHeight,
534 menuEl: menuEl,
535 minHeight: minMenuHeight,
536 placement: menuPlacement,
537 shouldScroll: shouldScroll,
538 isFixedPosition: isFixedPosition,
539 controlHeight: controlHeight
540 });
541 setMaxHeight(state.maxHeight);
542 setPlacement(state.placement);
543 setPortalPlacement === null || setPortalPlacement === void 0 ? void 0 : setPortalPlacement(state.placement);
544 }, [maxMenuHeight, menuPlacement, menuPosition, menuShouldScrollIntoView, minMenuHeight, setPortalPlacement, controlHeight]);
545 return children({
546 ref: ref,
547 placerProps: _objectSpread(_objectSpread({}, props), {}, {
548 placement: placement || coercePlacement(menuPlacement),
549 maxHeight: maxHeight
550 })
551 });
552};
553var Menu = function Menu(props) {
554 var children = props.children,
555 innerRef = props.innerRef,
556 innerProps = props.innerProps;
557 return jsx("div", _extends({}, getStyleProps(props, 'menu', {
558 menu: true
559 }), {
560 ref: innerRef
561 }, innerProps), children);
562};
563var Menu$1 = Menu;
564
565// ==============================
566// Menu List
567// ==============================
568
569var menuListCSS = function menuListCSS(_ref4, unstyled) {
570 var maxHeight = _ref4.maxHeight,
571 baseUnit = _ref4.theme.spacing.baseUnit;
572 return _objectSpread({
573 maxHeight: maxHeight,
574 overflowY: 'auto',
575 position: 'relative',
576 // required for offset[Height, Top] > keyboard scroll
577 WebkitOverflowScrolling: 'touch'
578 }, unstyled ? {} : {
579 paddingBottom: baseUnit,
580 paddingTop: baseUnit
581 });
582};
583var MenuList = function MenuList(props) {
584 var children = props.children,
585 innerProps = props.innerProps,
586 innerRef = props.innerRef,
587 isMulti = props.isMulti;
588 return jsx("div", _extends({}, getStyleProps(props, 'menuList', {
589 'menu-list': true,
590 'menu-list--is-multi': isMulti
591 }), {
592 ref: innerRef
593 }, innerProps), children);
594};
595
596// ==============================
597// Menu Notices
598// ==============================
599
600var noticeCSS = function noticeCSS(_ref5, unstyled) {
601 var _ref5$theme = _ref5.theme,
602 baseUnit = _ref5$theme.spacing.baseUnit,
603 colors = _ref5$theme.colors;
604 return _objectSpread({
605 textAlign: 'center'
606 }, unstyled ? {} : {
607 color: colors.neutral40,
608 padding: "".concat(baseUnit * 2, "px ").concat(baseUnit * 3, "px")
609 });
610};
611var noOptionsMessageCSS = noticeCSS;
612var loadingMessageCSS = noticeCSS;
613var NoOptionsMessage = function NoOptionsMessage(_ref6) {
614 var _ref6$children = _ref6.children,
615 children = _ref6$children === void 0 ? 'No options' : _ref6$children,
616 innerProps = _ref6.innerProps,
617 restProps = _objectWithoutProperties(_ref6, _excluded$3);
618 return jsx("div", _extends({}, getStyleProps(_objectSpread(_objectSpread({}, restProps), {}, {
619 children: children,
620 innerProps: innerProps
621 }), 'noOptionsMessage', {
622 'menu-notice': true,
623 'menu-notice--no-options': true
624 }), innerProps), children);
625};
626var LoadingMessage = function LoadingMessage(_ref7) {
627 var _ref7$children = _ref7.children,
628 children = _ref7$children === void 0 ? 'Loading...' : _ref7$children,
629 innerProps = _ref7.innerProps,
630 restProps = _objectWithoutProperties(_ref7, _excluded2$1);
631 return jsx("div", _extends({}, getStyleProps(_objectSpread(_objectSpread({}, restProps), {}, {
632 children: children,
633 innerProps: innerProps
634 }), 'loadingMessage', {
635 'menu-notice': true,
636 'menu-notice--loading': true
637 }), innerProps), children);
638};
639
640// ==============================
641// Menu Portal
642// ==============================
643
644var menuPortalCSS = function menuPortalCSS(_ref8) {
645 var rect = _ref8.rect,
646 offset = _ref8.offset,
647 position = _ref8.position;
648 return {
649 left: rect.left,
650 position: position,
651 top: offset,
652 width: rect.width,
653 zIndex: 1
654 };
655};
656var MenuPortal = function MenuPortal(props) {
657 var appendTo = props.appendTo,
658 children = props.children,
659 controlElement = props.controlElement,
660 innerProps = props.innerProps,
661 menuPlacement = props.menuPlacement,
662 menuPosition = props.menuPosition;
663 var menuPortalRef = useRef(null);
664 var cleanupRef = useRef(null);
665 var _useState5 = useState(coercePlacement(menuPlacement)),
666 _useState6 = _slicedToArray(_useState5, 2),
667 placement = _useState6[0],
668 setPortalPlacement = _useState6[1];
669 var portalPlacementContext = useMemo(function () {
670 return {
671 setPortalPlacement: setPortalPlacement
672 };
673 }, []);
674 var _useState7 = useState(null),
675 _useState8 = _slicedToArray(_useState7, 2),
676 computedPosition = _useState8[0],
677 setComputedPosition = _useState8[1];
678 var updateComputedPosition = useCallback(function () {
679 if (!controlElement) return;
680 var rect = getBoundingClientObj(controlElement);
681 var scrollDistance = menuPosition === 'fixed' ? 0 : window.pageYOffset;
682 var offset = rect[placement] + scrollDistance;
683 if (offset !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset) || rect.left !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left) || rect.width !== (computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width)) {
684 setComputedPosition({
685 offset: offset,
686 rect: rect
687 });
688 }
689 }, [controlElement, menuPosition, placement, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.offset, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.left, computedPosition === null || computedPosition === void 0 ? void 0 : computedPosition.rect.width]);
690 useLayoutEffect(function () {
691 updateComputedPosition();
692 }, [updateComputedPosition]);
693 var runAutoUpdate = useCallback(function () {
694 if (typeof cleanupRef.current === 'function') {
695 cleanupRef.current();
696 cleanupRef.current = null;
697 }
698 if (controlElement && menuPortalRef.current) {
699 cleanupRef.current = autoUpdate(controlElement, menuPortalRef.current, updateComputedPosition, {
700 elementResize: 'ResizeObserver' in window
701 });
702 }
703 }, [controlElement, updateComputedPosition]);
704 useLayoutEffect(function () {
705 runAutoUpdate();
706 }, [runAutoUpdate]);
707 var setMenuPortalElement = useCallback(function (menuPortalElement) {
708 menuPortalRef.current = menuPortalElement;
709 runAutoUpdate();
710 }, [runAutoUpdate]);
711
712 // bail early if required elements aren't present
713 if (!appendTo && menuPosition !== 'fixed' || !computedPosition) return null;
714
715 // same wrapper element whether fixed or portalled
716 var menuWrapper = jsx("div", _extends({
717 ref: setMenuPortalElement
718 }, getStyleProps(_objectSpread(_objectSpread({}, props), {}, {
719 offset: computedPosition.offset,
720 position: menuPosition,
721 rect: computedPosition.rect
722 }), 'menuPortal', {
723 'menu-portal': true
724 }), innerProps), children);
725 return jsx(PortalPlacementContext.Provider, {
726 value: portalPlacementContext
727 }, appendTo ? /*#__PURE__*/createPortal(menuWrapper, appendTo) : menuWrapper);
728};
729
730// ==============================
731// Root Container
732// ==============================
733
734var containerCSS = function containerCSS(_ref) {
735 var isDisabled = _ref.isDisabled,
736 isRtl = _ref.isRtl;
737 return {
738 label: 'container',
739 direction: isRtl ? 'rtl' : undefined,
740 pointerEvents: isDisabled ? 'none' : undefined,
741 // cancel mouse events when disabled
742 position: 'relative'
743 };
744};
745var SelectContainer = function SelectContainer(props) {
746 var children = props.children,
747 innerProps = props.innerProps,
748 isDisabled = props.isDisabled,
749 isRtl = props.isRtl;
750 return jsx("div", _extends({}, getStyleProps(props, 'container', {
751 '--is-disabled': isDisabled,
752 '--is-rtl': isRtl
753 }), innerProps), children);
754};
755
756// ==============================
757// Value Container
758// ==============================
759
760var valueContainerCSS = function valueContainerCSS(_ref2, unstyled) {
761 var spacing = _ref2.theme.spacing,
762 isMulti = _ref2.isMulti,
763 hasValue = _ref2.hasValue,
764 controlShouldRenderValue = _ref2.selectProps.controlShouldRenderValue;
765 return _objectSpread({
766 alignItems: 'center',
767 display: isMulti && hasValue && controlShouldRenderValue ? 'flex' : 'grid',
768 flex: 1,
769 flexWrap: 'wrap',
770 WebkitOverflowScrolling: 'touch',
771 position: 'relative',
772 overflow: 'hidden'
773 }, unstyled ? {} : {
774 padding: "".concat(spacing.baseUnit / 2, "px ").concat(spacing.baseUnit * 2, "px")
775 });
776};
777var ValueContainer = function ValueContainer(props) {
778 var children = props.children,
779 innerProps = props.innerProps,
780 isMulti = props.isMulti,
781 hasValue = props.hasValue;
782 return jsx("div", _extends({}, getStyleProps(props, 'valueContainer', {
783 'value-container': true,
784 'value-container--is-multi': isMulti,
785 'value-container--has-value': hasValue
786 }), innerProps), children);
787};
788
789// ==============================
790// Indicator Container
791// ==============================
792
793var indicatorsContainerCSS = function indicatorsContainerCSS() {
794 return {
795 alignItems: 'center',
796 alignSelf: 'stretch',
797 display: 'flex',
798 flexShrink: 0
799 };
800};
801var IndicatorsContainer = function IndicatorsContainer(props) {
802 var children = props.children,
803 innerProps = props.innerProps;
804 return jsx("div", _extends({}, getStyleProps(props, 'indicatorsContainer', {
805 indicators: true
806 }), innerProps), children);
807};
808
809var _templateObject;
810var _excluded$2 = ["size"],
811 _excluded2 = ["innerProps", "isRtl", "size"];
812function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
813
814// ==============================
815// Dropdown & Clear Icons
816// ==============================
817var _ref2 = process.env.NODE_ENV === "production" ? {
818 name: "8mmkcg",
819 styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"
820} : {
821 name: "tj5bde-Svg",
822 styles: "display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0;label:Svg;",
823 map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXlCSSIsImZpbGUiOiJpbmRpY2F0b3JzLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKiBAanN4IGpzeCAqL1xuaW1wb3J0IHsgUmVhY3ROb2RlIH0gZnJvbSAncmVhY3QnO1xuaW1wb3J0IHsganN4LCBrZXlmcmFtZXMgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCc7XG5cbmltcG9ydCB7XG4gIENvbW1vblByb3BzQW5kQ2xhc3NOYW1lLFxuICBDU1NPYmplY3RXaXRoTGFiZWwsXG4gIEdyb3VwQmFzZSxcbn0gZnJvbSAnLi4vdHlwZXMnO1xuaW1wb3J0IHsgZ2V0U3R5bGVQcm9wcyB9IGZyb20gJy4uL3V0aWxzJztcblxuLy8gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09XG4vLyBEcm9wZG93biAmIENsZWFyIEljb25zXG4vLyA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT1cblxuY29uc3QgU3ZnID0gKHtcbiAgc2l6ZSxcbiAgLi4ucHJvcHNcbn06IEpTWC5JbnRyaW5zaWNFbGVtZW50c1snc3ZnJ10gJiB7IHNpemU6IG51bWJlciB9KSA9PiAoXG4gIDxzdmdcbiAgICBoZWlnaHQ9e3NpemV9XG4gICAgd2lkdGg9e3NpemV9XG4gICAgdmlld0JveD1cIjAgMCAyMCAyMFwiXG4gICAgYXJpYS1oaW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wPikgPT4ge1xuICByZXR1cm4gKFxuICAgIDxkaXZcbiAgICAgIHsuLi5nZXRTdHlsZVByb3BzKFxuICAgICAgICB7IC4uLnJlc3RQcm9wcywgaW5uZXJQcm9wcywgaXNSdGwsIHNpemUgfSxcbiAgICAgICAgJ2xvYWRpbmdJbmRpY2F0b3InLFxuICAgICAgICB7XG4gICAgICAgICAgaW5kaWNhdG9yOiB0cnVlLFxuICAgICAgICAgICdsb2FkaW5nLWluZGljYXRvcic6IHRydWUsXG4gICAgICAgIH1cbiAgICAgICl9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */",
824 toString: _EMOTION_STRINGIFIED_CSS_ERROR__
825};
826var Svg = function Svg(_ref) {
827 var size = _ref.size,
828 props = _objectWithoutProperties(_ref, _excluded$2);
829 return jsx("svg", _extends({
830 height: size,
831 width: size,
832 viewBox: "0 0 20 20",
833 "aria-hidden": "true",
834 focusable: "false",
835 css: _ref2
836 }, props));
837};
838var CrossIcon = function CrossIcon(props) {
839 return jsx(Svg, _extends({
840 size: 20
841 }, props), jsx("path", {
842 d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"
843 }));
844};
845var DownChevron = function DownChevron(props) {
846 return jsx(Svg, _extends({
847 size: 20
848 }, props), jsx("path", {
849 d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"
850 }));
851};
852
853// ==============================
854// Dropdown & Clear Buttons
855// ==============================
856
857var baseCSS = function baseCSS(_ref3, unstyled) {
858 var isFocused = _ref3.isFocused,
859 _ref3$theme = _ref3.theme,
860 baseUnit = _ref3$theme.spacing.baseUnit,
861 colors = _ref3$theme.colors;
862 return _objectSpread({
863 label: 'indicatorContainer',
864 display: 'flex',
865 transition: 'color 150ms'
866 }, unstyled ? {} : {
867 color: isFocused ? colors.neutral60 : colors.neutral20,
868 padding: baseUnit * 2,
869 ':hover': {
870 color: isFocused ? colors.neutral80 : colors.neutral40
871 }
872 });
873};
874var dropdownIndicatorCSS = baseCSS;
875var DropdownIndicator = function DropdownIndicator(props) {
876 var children = props.children,
877 innerProps = props.innerProps;
878 return jsx("div", _extends({}, getStyleProps(props, 'dropdownIndicator', {
879 indicator: true,
880 'dropdown-indicator': true
881 }), innerProps), children || jsx(DownChevron, null));
882};
883var clearIndicatorCSS = baseCSS;
884var ClearIndicator = function ClearIndicator(props) {
885 var children = props.children,
886 innerProps = props.innerProps;
887 return jsx("div", _extends({}, getStyleProps(props, 'clearIndicator', {
888 indicator: true,
889 'clear-indicator': true
890 }), innerProps), children || jsx(CrossIcon, null));
891};
892
893// ==============================
894// Separator
895// ==============================
896
897var indicatorSeparatorCSS = function indicatorSeparatorCSS(_ref4, unstyled) {
898 var isDisabled = _ref4.isDisabled,
899 _ref4$theme = _ref4.theme,
900 baseUnit = _ref4$theme.spacing.baseUnit,
901 colors = _ref4$theme.colors;
902 return _objectSpread({
903 label: 'indicatorSeparator',
904 alignSelf: 'stretch',
905 width: 1
906 }, unstyled ? {} : {
907 backgroundColor: isDisabled ? colors.neutral10 : colors.neutral20,
908 marginBottom: baseUnit * 2,
909 marginTop: baseUnit * 2
910 });
911};
912var IndicatorSeparator = function IndicatorSeparator(props) {
913 var innerProps = props.innerProps;
914 return jsx("span", _extends({}, innerProps, getStyleProps(props, 'indicatorSeparator', {
915 'indicator-separator': true
916 })));
917};
918
919// ==============================
920// Loading
921// ==============================
922
923var loadingDotAnimations = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0%, 80%, 100% { opacity: 0; }\n 40% { opacity: 1; }\n"])));
924var loadingIndicatorCSS = function loadingIndicatorCSS(_ref5, unstyled) {
925 var isFocused = _ref5.isFocused,
926 size = _ref5.size,
927 _ref5$theme = _ref5.theme,
928 colors = _ref5$theme.colors,
929 baseUnit = _ref5$theme.spacing.baseUnit;
930 return _objectSpread({
931 label: 'loadingIndicator',
932 display: 'flex',
933 transition: 'color 150ms',
934 alignSelf: 'center',
935 fontSize: size,
936 lineHeight: 1,
937 marginRight: size,
938 textAlign: 'center',
939 verticalAlign: 'middle'
940 }, unstyled ? {} : {
941 color: isFocused ? colors.neutral60 : colors.neutral20,
942 padding: baseUnit * 2
943 });
944};
945var LoadingDot = function LoadingDot(_ref6) {
946 var delay = _ref6.delay,
947 offset = _ref6.offset;
948 return jsx("span", {
949 css: /*#__PURE__*/css$2({
950 animation: "".concat(loadingDotAnimations, " 1s ease-in-out ").concat(delay, "ms infinite;"),
951 backgroundColor: 'currentColor',
952 borderRadius: '1em',
953 display: 'inline-block',
954 marginLeft: offset ? '1em' : undefined,
955 height: '1em',
956 verticalAlign: 'top',
957 width: '1em'
958 }, process.env.NODE_ENV === "production" ? "" : ";label:LoadingDot;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGljYXRvcnMudHN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l9XG4gICAgICB7Li4uaW5uZXJQcm9wc31cbiAgICA+XG4gICAgICA8TG9hZGluZ0RvdCBkZWxheT17MH0gb2Zmc2V0PXtpc1J0bH0gLz5cbiAgICAgIDxMb2FkaW5nRG90IGRlbGF5PXsxNjB9IG9mZnNldCAvPlxuICAgICAgPExvYWRpbmdEb3QgZGVsYXk9ezMyMH0gb2Zmc2V0PXshaXNSdGx9IC8+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuIl19 */")
959 });
960};
961var LoadingIndicator = function LoadingIndicator(_ref7) {
962 var innerProps = _ref7.innerProps,
963 isRtl = _ref7.isRtl,
964 _ref7$size = _ref7.size,
965 size = _ref7$size === void 0 ? 4 : _ref7$size,
966 restProps = _objectWithoutProperties(_ref7, _excluded2);
967 return jsx("div", _extends({}, getStyleProps(_objectSpread(_objectSpread({}, restProps), {}, {
968 innerProps: innerProps,
969 isRtl: isRtl,
970 size: size
971 }), 'loadingIndicator', {
972 indicator: true,
973 'loading-indicator': true
974 }), innerProps), jsx(LoadingDot, {
975 delay: 0,
976 offset: isRtl
977 }), jsx(LoadingDot, {
978 delay: 160,
979 offset: true
980 }), jsx(LoadingDot, {
981 delay: 320,
982 offset: !isRtl
983 }));
984};
985
986var css$1 = function css(_ref, unstyled) {
987 var isDisabled = _ref.isDisabled,
988 isFocused = _ref.isFocused,
989 _ref$theme = _ref.theme,
990 colors = _ref$theme.colors,
991 borderRadius = _ref$theme.borderRadius,
992 spacing = _ref$theme.spacing;
993 return _objectSpread({
994 label: 'control',
995 alignItems: 'center',
996 cursor: 'default',
997 display: 'flex',
998 flexWrap: 'wrap',
999 justifyContent: 'space-between',
1000 minHeight: spacing.controlHeight,
1001 outline: '0 !important',
1002 position: 'relative',
1003 transition: 'all 100ms'
1004 }, unstyled ? {} : {
1005 backgroundColor: isDisabled ? colors.neutral5 : colors.neutral0,
1006 borderColor: isDisabled ? colors.neutral10 : isFocused ? colors.primary : colors.neutral20,
1007 borderRadius: borderRadius,
1008 borderStyle: 'solid',
1009 borderWidth: 1,
1010 boxShadow: isFocused ? "0 0 0 1px ".concat(colors.primary) : undefined,
1011 '&:hover': {
1012 borderColor: isFocused ? colors.primary : colors.neutral30
1013 }
1014 });
1015};
1016var Control = function Control(props) {
1017 var children = props.children,
1018 isDisabled = props.isDisabled,
1019 isFocused = props.isFocused,
1020 innerRef = props.innerRef,
1021 innerProps = props.innerProps,
1022 menuIsOpen = props.menuIsOpen;
1023 return jsx("div", _extends({
1024 ref: innerRef
1025 }, getStyleProps(props, 'control', {
1026 control: true,
1027 'control--is-disabled': isDisabled,
1028 'control--is-focused': isFocused,
1029 'control--menu-is-open': menuIsOpen
1030 }), innerProps, {
1031 "aria-disabled": isDisabled || undefined
1032 }), children);
1033};
1034var Control$1 = Control;
1035
1036var _excluded$1 = ["data"];
1037var groupCSS = function groupCSS(_ref, unstyled) {
1038 var spacing = _ref.theme.spacing;
1039 return unstyled ? {} : {
1040 paddingBottom: spacing.baseUnit * 2,
1041 paddingTop: spacing.baseUnit * 2
1042 };
1043};
1044var Group = function Group(props) {
1045 var children = props.children,
1046 cx = props.cx,
1047 getStyles = props.getStyles,
1048 getClassNames = props.getClassNames,
1049 Heading = props.Heading,
1050 headingProps = props.headingProps,
1051 innerProps = props.innerProps,
1052 label = props.label,
1053 theme = props.theme,
1054 selectProps = props.selectProps;
1055 return jsx("div", _extends({}, getStyleProps(props, 'group', {
1056 group: true
1057 }), innerProps), jsx(Heading, _extends({}, headingProps, {
1058 selectProps: selectProps,
1059 theme: theme,
1060 getStyles: getStyles,
1061 getClassNames: getClassNames,
1062 cx: cx
1063 }), label), jsx("div", null, children));
1064};
1065var groupHeadingCSS = function groupHeadingCSS(_ref2, unstyled) {
1066 var _ref2$theme = _ref2.theme,
1067 colors = _ref2$theme.colors,
1068 spacing = _ref2$theme.spacing;
1069 return _objectSpread({
1070 label: 'group',
1071 cursor: 'default',
1072 display: 'block'
1073 }, unstyled ? {} : {
1074 color: colors.neutral40,
1075 fontSize: '75%',
1076 fontWeight: 500,
1077 marginBottom: '0.25em',
1078 paddingLeft: spacing.baseUnit * 3,
1079 paddingRight: spacing.baseUnit * 3,
1080 textTransform: 'uppercase'
1081 });
1082};
1083var GroupHeading = function GroupHeading(props) {
1084 var _cleanCommonProps = cleanCommonProps(props);
1085 _cleanCommonProps.data;
1086 var innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded$1);
1087 return jsx("div", _extends({}, getStyleProps(props, 'groupHeading', {
1088 'group-heading': true
1089 }), innerProps));
1090};
1091var Group$1 = Group;
1092
1093var _excluded = ["innerRef", "isDisabled", "isHidden", "inputClassName"];
1094var inputCSS = function inputCSS(_ref, unstyled) {
1095 var isDisabled = _ref.isDisabled,
1096 value = _ref.value,
1097 _ref$theme = _ref.theme,
1098 spacing = _ref$theme.spacing,
1099 colors = _ref$theme.colors;
1100 return _objectSpread(_objectSpread({
1101 visibility: isDisabled ? 'hidden' : 'visible',
1102 // force css to recompute when value change due to @emotion bug.
1103 // We can remove it whenever the bug is fixed.
1104 transform: value ? 'translateZ(0)' : ''
1105 }, containerStyle), unstyled ? {} : {
1106 margin: spacing.baseUnit / 2,
1107 paddingBottom: spacing.baseUnit / 2,
1108 paddingTop: spacing.baseUnit / 2,
1109 color: colors.neutral80
1110 });
1111};
1112var spacingStyle = {
1113 gridArea: '1 / 2',
1114 font: 'inherit',
1115 minWidth: '2px',
1116 border: 0,
1117 margin: 0,
1118 outline: 0,
1119 padding: 0
1120};
1121var containerStyle = {
1122 flex: '1 1 auto',
1123 display: 'inline-grid',
1124 gridArea: '1 / 1 / 2 / 3',
1125 gridTemplateColumns: '0 min-content',
1126 '&:after': _objectSpread({
1127 content: 'attr(data-value) " "',
1128 visibility: 'hidden',
1129 whiteSpace: 'pre'
1130 }, spacingStyle)
1131};
1132var inputStyle = function inputStyle(isHidden) {
1133 return _objectSpread({
1134 label: 'input',
1135 color: 'inherit',
1136 background: 0,
1137 opacity: isHidden ? 0 : 1,
1138 width: '100%'
1139 }, spacingStyle);
1140};
1141var Input = function Input(props) {
1142 var cx = props.cx,
1143 value = props.value;
1144 var _cleanCommonProps = cleanCommonProps(props),
1145 innerRef = _cleanCommonProps.innerRef,
1146 isDisabled = _cleanCommonProps.isDisabled,
1147 isHidden = _cleanCommonProps.isHidden,
1148 inputClassName = _cleanCommonProps.inputClassName,
1149 innerProps = _objectWithoutProperties(_cleanCommonProps, _excluded);
1150 return jsx("div", _extends({}, getStyleProps(props, 'input', {
1151 'input-container': true
1152 }), {
1153 "data-value": value || ''
1154 }), jsx("input", _extends({
1155 className: cx({
1156 input: true
1157 }, inputClassName),
1158 ref: innerRef,
1159 style: inputStyle(isHidden),
1160 disabled: isDisabled
1161 }, innerProps)));
1162};
1163var Input$1 = Input;
1164
1165var multiValueCSS = function multiValueCSS(_ref, unstyled) {
1166 var _ref$theme = _ref.theme,
1167 spacing = _ref$theme.spacing,
1168 borderRadius = _ref$theme.borderRadius,
1169 colors = _ref$theme.colors;
1170 return _objectSpread({
1171 label: 'multiValue',
1172 display: 'flex',
1173 minWidth: 0
1174 }, unstyled ? {} : {
1175 backgroundColor: colors.neutral10,
1176 borderRadius: borderRadius / 2,
1177 margin: spacing.baseUnit / 2
1178 });
1179};
1180var multiValueLabelCSS = function multiValueLabelCSS(_ref2, unstyled) {
1181 var _ref2$theme = _ref2.theme,
1182 borderRadius = _ref2$theme.borderRadius,
1183 colors = _ref2$theme.colors,
1184 cropWithEllipsis = _ref2.cropWithEllipsis;
1185 return _objectSpread({
1186 overflow: 'hidden',
1187 textOverflow: cropWithEllipsis || cropWithEllipsis === undefined ? 'ellipsis' : undefined,
1188 whiteSpace: 'nowrap'
1189 }, unstyled ? {} : {
1190 borderRadius: borderRadius / 2,
1191 color: colors.neutral80,
1192 fontSize: '85%',
1193 padding: 3,
1194 paddingLeft: 6
1195 });
1196};
1197var multiValueRemoveCSS = function multiValueRemoveCSS(_ref3, unstyled) {
1198 var _ref3$theme = _ref3.theme,
1199 spacing = _ref3$theme.spacing,
1200 borderRadius = _ref3$theme.borderRadius,
1201 colors = _ref3$theme.colors,
1202 isFocused = _ref3.isFocused;
1203 return _objectSpread({
1204 alignItems: 'center',
1205 display: 'flex'
1206 }, unstyled ? {} : {
1207 borderRadius: borderRadius / 2,
1208 backgroundColor: isFocused ? colors.dangerLight : undefined,
1209 paddingLeft: spacing.baseUnit,
1210 paddingRight: spacing.baseUnit,
1211 ':hover': {
1212 backgroundColor: colors.dangerLight,
1213 color: colors.danger
1214 }
1215 });
1216};
1217var MultiValueGeneric = function MultiValueGeneric(_ref4) {
1218 var children = _ref4.children,
1219 innerProps = _ref4.innerProps;
1220 return jsx("div", innerProps, children);
1221};
1222var MultiValueContainer = MultiValueGeneric;
1223var MultiValueLabel = MultiValueGeneric;
1224function MultiValueRemove(_ref5) {
1225 var children = _ref5.children,
1226 innerProps = _ref5.innerProps;
1227 return jsx("div", _extends({
1228 role: "button"
1229 }, innerProps), children || jsx(CrossIcon, {
1230 size: 14
1231 }));
1232}
1233var MultiValue = function MultiValue(props) {
1234 var children = props.children,
1235 components = props.components,
1236 data = props.data,
1237 innerProps = props.innerProps,
1238 isDisabled = props.isDisabled,
1239 removeProps = props.removeProps,
1240 selectProps = props.selectProps;
1241 var Container = components.Container,
1242 Label = components.Label,
1243 Remove = components.Remove;
1244 return jsx(Container, {
1245 data: data,
1246 innerProps: _objectSpread(_objectSpread({}, getStyleProps(props, 'multiValue', {
1247 'multi-value': true,
1248 'multi-value--is-disabled': isDisabled
1249 })), innerProps),
1250 selectProps: selectProps
1251 }, jsx(Label, {
1252 data: data,
1253 innerProps: _objectSpread({}, getStyleProps(props, 'multiValueLabel', {
1254 'multi-value__label': true
1255 })),
1256 selectProps: selectProps
1257 }, children), jsx(Remove, {
1258 data: data,
1259 innerProps: _objectSpread(_objectSpread({}, getStyleProps(props, 'multiValueRemove', {
1260 'multi-value__remove': true
1261 })), {}, {
1262 'aria-label': "Remove ".concat(children || 'option')
1263 }, removeProps),
1264 selectProps: selectProps
1265 }));
1266};
1267var MultiValue$1 = MultiValue;
1268
1269var optionCSS = function optionCSS(_ref, unstyled) {
1270 var isDisabled = _ref.isDisabled,
1271 isFocused = _ref.isFocused,
1272 isSelected = _ref.isSelected,
1273 _ref$theme = _ref.theme,
1274 spacing = _ref$theme.spacing,
1275 colors = _ref$theme.colors;
1276 return _objectSpread({
1277 label: 'option',
1278 cursor: 'default',
1279 display: 'block',
1280 fontSize: 'inherit',
1281 width: '100%',
1282 userSelect: 'none',
1283 WebkitTapHighlightColor: 'rgba(0, 0, 0, 0)'
1284 }, unstyled ? {} : {
1285 backgroundColor: isSelected ? colors.primary : isFocused ? colors.primary25 : 'transparent',
1286 color: isDisabled ? colors.neutral20 : isSelected ? colors.neutral0 : 'inherit',
1287 padding: "".concat(spacing.baseUnit * 2, "px ").concat(spacing.baseUnit * 3, "px"),
1288 // provide some affordance on touch devices
1289 ':active': {
1290 backgroundColor: !isDisabled ? isSelected ? colors.primary : colors.primary50 : undefined
1291 }
1292 });
1293};
1294var Option = function Option(props) {
1295 var children = props.children,
1296 isDisabled = props.isDisabled,
1297 isFocused = props.isFocused,
1298 isSelected = props.isSelected,
1299 innerRef = props.innerRef,
1300 innerProps = props.innerProps;
1301 return jsx("div", _extends({}, getStyleProps(props, 'option', {
1302 option: true,
1303 'option--is-disabled': isDisabled,
1304 'option--is-focused': isFocused,
1305 'option--is-selected': isSelected
1306 }), {
1307 ref: innerRef,
1308 "aria-disabled": isDisabled
1309 }, innerProps), children);
1310};
1311var Option$1 = Option;
1312
1313var placeholderCSS = function placeholderCSS(_ref, unstyled) {
1314 var _ref$theme = _ref.theme,
1315 spacing = _ref$theme.spacing,
1316 colors = _ref$theme.colors;
1317 return _objectSpread({
1318 label: 'placeholder',
1319 gridArea: '1 / 1 / 2 / 3'
1320 }, unstyled ? {} : {
1321 color: colors.neutral50,
1322 marginLeft: spacing.baseUnit / 2,
1323 marginRight: spacing.baseUnit / 2
1324 });
1325};
1326var Placeholder = function Placeholder(props) {
1327 var children = props.children,
1328 innerProps = props.innerProps;
1329 return jsx("div", _extends({}, getStyleProps(props, 'placeholder', {
1330 placeholder: true
1331 }), innerProps), children);
1332};
1333var Placeholder$1 = Placeholder;
1334
1335var css = function css(_ref, unstyled) {
1336 var isDisabled = _ref.isDisabled,
1337 _ref$theme = _ref.theme,
1338 spacing = _ref$theme.spacing,
1339 colors = _ref$theme.colors;
1340 return _objectSpread({
1341 label: 'singleValue',
1342 gridArea: '1 / 1 / 2 / 3',
1343 maxWidth: '100%',
1344 overflow: 'hidden',
1345 textOverflow: 'ellipsis',
1346 whiteSpace: 'nowrap'
1347 }, unstyled ? {} : {
1348 color: isDisabled ? colors.neutral40 : colors.neutral80,
1349 marginLeft: spacing.baseUnit / 2,
1350 marginRight: spacing.baseUnit / 2
1351 });
1352};
1353var SingleValue = function SingleValue(props) {
1354 var children = props.children,
1355 isDisabled = props.isDisabled,
1356 innerProps = props.innerProps;
1357 return jsx("div", _extends({}, getStyleProps(props, 'singleValue', {
1358 'single-value': true,
1359 'single-value--is-disabled': isDisabled
1360 }), innerProps), children);
1361};
1362var SingleValue$1 = SingleValue;
1363
1364var components = {
1365 ClearIndicator: ClearIndicator,
1366 Control: Control$1,
1367 DropdownIndicator: DropdownIndicator,
1368 DownChevron: DownChevron,
1369 CrossIcon: CrossIcon,
1370 Group: Group$1,
1371 GroupHeading: GroupHeading,
1372 IndicatorsContainer: IndicatorsContainer,
1373 IndicatorSeparator: IndicatorSeparator,
1374 Input: Input$1,
1375 LoadingIndicator: LoadingIndicator,
1376 Menu: Menu$1,
1377 MenuList: MenuList,
1378 MenuPortal: MenuPortal,
1379 LoadingMessage: LoadingMessage,
1380 NoOptionsMessage: NoOptionsMessage,
1381 MultiValue: MultiValue$1,
1382 MultiValueContainer: MultiValueContainer,
1383 MultiValueLabel: MultiValueLabel,
1384 MultiValueRemove: MultiValueRemove,
1385 Option: Option$1,
1386 Placeholder: Placeholder$1,
1387 SelectContainer: SelectContainer,
1388 SingleValue: SingleValue$1,
1389 ValueContainer: ValueContainer
1390};
1391var defaultComponents = function defaultComponents(props) {
1392 return _objectSpread(_objectSpread({}, components), props.components);
1393};
1394
1395export { isMobileDevice as A, multiValueAsValue as B, singleValueAsValue as C, valueTernary as D, classNames as E, defaultComponents as F, isDocumentElement as G, cleanValue as H, scrollIntoView as I, noop as J, notNullish as K, handleInputChange as L, MenuPlacer as M, clearIndicatorCSS as a, containerCSS as b, components as c, css$1 as d, dropdownIndicatorCSS as e, groupHeadingCSS as f, groupCSS as g, indicatorSeparatorCSS as h, indicatorsContainerCSS as i, inputCSS as j, loadingMessageCSS as k, loadingIndicatorCSS as l, menuCSS as m, menuListCSS as n, menuPortalCSS as o, multiValueCSS as p, multiValueLabelCSS as q, removeProps as r, supportsPassiveEvents as s, multiValueRemoveCSS as t, noOptionsMessageCSS as u, optionCSS as v, placeholderCSS as w, css as x, valueContainerCSS as y, isTouchCapable as z };