@leafygreen-ui/combobox 1.2.2 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/Chip.d.ts.map +1 -1
- package/dist/Combobox.d.ts.map +1 -1
- package/dist/Combobox.styles.d.ts +39 -39
- package/dist/Combobox.styles.d.ts.map +1 -1
- package/dist/Combobox.types.d.ts +5 -0
- package/dist/Combobox.types.d.ts.map +1 -1
- package/dist/ComboboxContext.d.ts +5 -1
- package/dist/ComboboxContext.d.ts.map +1 -1
- package/dist/ComboboxGroup.d.ts.map +1 -1
- package/dist/ComboboxMenu/ComboboxMenu.d.ts +10 -0
- package/dist/ComboboxMenu/ComboboxMenu.d.ts.map +1 -0
- package/dist/ComboboxMenu/Menu.styles.d.ts +25 -0
- package/dist/ComboboxMenu/Menu.styles.d.ts.map +1 -0
- package/dist/ComboboxOption.d.ts.map +1 -1
- package/dist/ComboboxTestUtils.d.ts.map +1 -1
- package/dist/Menu.styles.d.ts +21 -0
- package/dist/Menu.styles.d.ts.map +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/wrapJSX.d.ts.map +1 -1
- package/package.json +12 -9
- package/src/Chip.tsx +125 -91
- package/src/Combobox.spec.tsx +3 -1
- package/src/Combobox.story.tsx +4 -2
- package/src/Combobox.styles.ts +250 -299
- package/src/Combobox.tsx +162 -190
- package/src/Combobox.types.ts +7 -0
- package/src/ComboboxContext.tsx +16 -1
- package/src/ComboboxGroup.tsx +27 -17
- package/src/ComboboxMenu/ComboboxMenu.tsx +161 -0
- package/src/ComboboxMenu/Menu.styles.ts +131 -0
- package/src/ComboboxOption.tsx +120 -32
- package/src/ComboboxTestUtils.tsx +3 -2
- package/src/Menu.styles.ts +110 -0
- package/src/utils/ComboboxUtils.spec.tsx +23 -0
- package/src/utils/wrapJSX.tsx +3 -1
- package/tsconfig.json +0 -3
- package/tsconfig.tsbuildinfo +1 -1
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
!function(e,o){"object"==typeof exports&&"undefined"!=typeof module?o(exports,require("react"),require("lodash"),require("@leafygreen-ui/typography"),require("@leafygreen-ui/popover"),require("@leafygreen-ui/hooks"),require("@leafygreen-ui/icon"),require("@leafygreen-ui/icon-button"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette"),require("@leafygreen-ui/lib"),require("@leafygreen-ui/checkbox"),require("@emotion/react"),require("lodash/kebabCase"),require("@leafygreen-ui/tokens"),require("@leafygreen-ui/inline-definition")):"function"==typeof define&&define.amd?define(["exports","react","lodash","@leafygreen-ui/typography","@leafygreen-ui/popover","@leafygreen-ui/hooks","@leafygreen-ui/icon","@leafygreen-ui/icon-button","@leafygreen-ui/emotion","@leafygreen-ui/palette","@leafygreen-ui/lib","@leafygreen-ui/checkbox","@emotion/react","lodash/kebabCase","@leafygreen-ui/tokens","@leafygreen-ui/inline-definition"],o):o((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/combobox"]={},e.React,e._,e["@leafygreen-ui/typography"],e["@leafygreen-ui/popover"],e["@leafygreen-ui/hooks"],e["@leafygreen-ui/icon"],e["@leafygreen-ui/icon-button"],e["@leafygreen-ui/emotion"],e["@leafygreen-ui/palette"],e["@leafygreen-ui/lib"],e["@leafygreen-ui/checkbox"],e.react,e.kebabCase,e["@leafygreen-ui/tokens"],e["@leafygreen-ui/inline-definition"])}(this,(function(e,o,n,r,t,i,l,a,c,s,u,d,b,f,p,g){"use strict";function m(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var x=m(o),h=m(t),v=m(l),y=m(a),w=m(d),k=m(f),C=m(g);function j(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);o&&(r=r.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,r)}return n}function O(e){return O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},O(e)}function N(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function S(){return S=Object.assign||function(e){for(var o=1;o<arguments.length;o++){var n=arguments[o];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},S.apply(this,arguments)}function M(e,o){if(null==e)return{};var n,r,t=function(e,o){if(null==e)return{};var n,r,t={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],o.indexOf(n)>=0||(t[n]=e[n]);return t}(e,o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],o.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}function z(e,o){return o||(o=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(o)}}))}function E(e,o){return function(e){if(Array.isArray(e))return e}(e)||function(e,o){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,t,i=[],l=!0,a=!1;try{for(n=n.call(e);!(l=(r=n.next()).done)&&(i.push(r.value),!o||i.length!==o);l=!0);}catch(e){a=!0,t=e}finally{try{l||null==n.return||n.return()}finally{if(a)throw t}}return i}(e,o)||I(e,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function D(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||I(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function I(e,o){if(e){if("string"==typeof e)return A(e,o);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?A(e,o):void 0}}function A(e,o){(null==o||o>e.length)&&(o=e.length);for(var n=0,r=new Array(o);n<o;n++)r[n]=e[n];return r}var T="Input",P="ClearButton",F="FirstChip",L="LastChip",R="MiddleChip",q="Combobox",G="Menu",U="default",W="large";var H,K,V,B,X,Z,_,Y,$,J,Q,ee,oe,ne,re,te,ie,le,ae,ce,se,ue,de,be,fe,pe,ge,me,xe,he,ve,ye,we,ke=o.createContext({multiselect:!1,darkMode:!1,size:U,withIcons:!1,disabled:!1}),Ce=function(e,o,n){if(o&&n){var r=new RegExp(o,"gi"),t=e.matchAll(r);if(t){for(var i=e.split(""),l=0,a=Array.from(t);l<a.length;l++){var c,s=a[l],u=null!==(c=s.index)&&void 0!==c?c:-1,d=s[0],f=d.length,p=u+d+f,g=new Array(f).fill("");g[0]=x.default.createElement(n,{key:p},d),i.splice.apply(i,[u,f].concat(D(g)))}return b.jsx(x.default.Fragment,null,i)}return b.jsx(x.default.Fragment,null,e)}return b.jsx(x.default.Fragment,null,e)},je=function(e){var o,n=e.value,r=e.displayName;return{value:null!=n?n:k.default(r),displayName:null!==(o=null!=r?r:n)&&void 0!==o?o:""}},Oe=function(e,o){if(e)return o.find((function(o){return o.value===e}))},Ne=function(e,o){var n,r;return e?null!==(n=null===(r=Oe(e,o))||void 0===r?void 0:r.displayName)&&void 0!==n?n:e:""},Se=function e(o){return x.default.Children.toArray(o).reduce((function(o,n){if(u.isComponentType(n,"ComboboxOption")){var r=je(n.props),t=r.value,i=r.displayName,l=n.props,a=l.glyph,c=l.disabled;return[].concat(D(o),[{value:t,displayName:i,isDisabled:!!c,hasGlyph:!!a}])}if(u.isComponentType(n,"ComboboxGroup")){var s=n.props.children;if(s)return[].concat(D(o),D(e(s)))}}),[])},Me=c.css(H||(H=z(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n list-style: none;\n color: inherit;\n cursor: pointer;\n overflow: hidden;\n font-family: ",";\n font-size: var(--lg-combobox-item-font-size);\n line-height: var(--lg-combobox-item-line-height);\n padding: var(--lg-combobox-item-padding-y) var(--lg-combobox-item-padding-x);\n\n // Left wedge\n &:before {\n content: '';\n position: absolute;\n left: 0;\n width: 3px;\n height: var(--lg-combobox-item-wedge-height);\n background-color: transparent;\n border-radius: 0 2px 2px 0;\n transform: scaleY(0.3);\n transition: 150ms ease-in-out;\n transition-property: transform, background-color;\n }\n\n &:hover {\n outline: none;\n background-color: var(--lg-combobox-item-hover-color);\n }\n\n &[aria-selected='true'] {\n outline: none;\n background-color: var(--lg-combobox-item-active-color);\n\n &:before {\n background-color: var(--lg-combobox-item-wedge-color);\n transform: scaleY(1);\n }\n }\n"])),p.fontFamilies.legacy),ze=c.css(K||(K=z(["\n cursor: not-allowed;\n color: ",";\n\n &:hover {\n background-color: inherit;\n }\n"])),s.uiColors.gray.base),Ee=c.css(V||(V=z(["\n display: inline-flex;\n gap: 8px;\n justify-content: start;\n align-items: inherit;\n overflow-wrap: anywhere;\n"]))),De=c.css(B||(B=z(["\n pointer-events: none;\n"]))),Ie=function(e){return c.css(X||(X=z(["\n font-weight: ",";\n"])),e?"bold":"normal")},Ae=x.default.forwardRef((function(e,n){var r=e.displayName,t=e.glyph,a=e.isSelected,d=e.isFocused,f=e.disabled,p=e.setSelected,g=e.className,m=o.useContext(ke),h=m.multiselect,y=m.darkMode,k=m.withIcons,C=m.inputValue,j=i.useIdAllocator({prefix:"combobox-option-text"}),O=i.useForwardedRef(n,null),S=o.useCallback((function(e){e.stopPropagation(),f||e.target!==O.current&&"INPUT"!==e.target.tagName||p()}),[f,O,p]),M=o.useMemo((function(){if(t){if(l.isComponentGlyph(t)||u.isComponentType(t,"Icon"))return t;console.error("`ComboboxOption` instance did not render icon because it is not a known glyph element.",t)}}),[t]),z=o.useMemo((function(){if(h){var e=b.jsx(w.default,{label:"","aria-labelledby":j,checked:a,tabIndex:-1,animate:!1,disabled:f});return b.jsx(x.default.Fragment,null,b.jsx("span",{className:c.cx(Ee,De)},k?M:e,b.jsx("span",{id:j,className:Ie(a)},Ce(r,C,"strong"))),k&&e)}return b.jsx(x.default.Fragment,null,b.jsx("span",{className:c.cx(Ee,De)},M,b.jsx("span",{className:Ie(a)},Ce(r,C,"strong"))),a&&b.jsx(v.default,{glyph:"Checkmark",color:y?s.uiColors.blue.light1:s.uiColors.blue.base}))}),[h,M,a,r,C,y,j,f,k]);return b.jsx("li",{ref:O,role:"option","aria-selected":d,"aria-label":r,tabIndex:-1,className:c.cx(Me,N({},ze,f),g),onClick:S,onKeyDown:S},z)}));function Te(e){throw Error("`ComboboxOption` must be a child of a `Combobox` instance")}Ae.displayName="ComboboxOption",Te.displayName="ComboboxOption";var Pe,Fe,Le,Re,qe,Ge,Ue,We,He,Ke=(N(Z={},U,p.typeScales.body1.fontSize),N(Z,W,p.typeScales.body2.fontSize),Z),Ve=u.createUniqueClassName("combobox-chip"),Be=c.css(_||(_=z(["\n font-family: ",";\n font-size: var(--lg-combobox-font-size);\n line-height: var(--lg-combobox-line-height);\n"])),p.fontFamilies.legacy),Xe=function(e){var o=e.darkMode,n=e.size,r=e.overflow;return c.cx(function(e){return e?c.css(Y||(Y=z([""]))):c.css($||($=z(["\n --lg-combobox-color-error: ",";\n --lg-combobox-text-color: ",";\n --lg-combobox-text-color-disabled: ",";\n\n --lg-combobox-background-color: ",";\n --lg-combobox-background-color-focus: ",";\n --lg-combobox-background-color-disabled: ",";\n\n --lg-combobox-border-color: ",";\n --lg-combobox-border-color-disabled: ",";\n --lg-combobox-border-color-error: ",";\n\n --lg-combobox-shadow: 0px 1px 2px rgba(6, 22, 33, 0.3);\n --lg-combobox-shadow-focus: 0px 4px 4px rgba(6, 22, 33, 0.3);\n "])),s.uiColors.red.base,s.uiColors.gray.dark3,s.uiColors.gray.dark1,s.uiColors.gray.light3,s.uiColors.white,s.uiColors.gray.light2,s.uiColors.gray.base,s.uiColors.gray.light1,s.uiColors.red.base)}(o),function(e){switch(e){case U:return c.css(J||(J=z(["\n --lg-combobox-padding-y: 5px;\n --lg-combobox-padding-x: 7px;\n --lg-combobox-height: calc(\n 36px - 2px - 2 * var(--lg-combobox-padding-y)\n );\n --lg-combobox-font-size: ","px; // TODO: update this for redesign\n --lg-combobox-line-height: ","px;\n "])),p.typeScales.body1.fontSize+1,p.typeScales.body1.lineHeight+1);case W:return c.css(Q||(Q=z(["\n --lg-combobox-padding-y: 9px;\n --lg-combobox-padding-x: 11px;\n --lg-combobox-height: calc(\n 48px - 2px - 2 * var(--lg-combobox-padding-y)\n );\n --lg-combobox-font-size: ","px;\n --lg-combobox-line-height: ","px;\n "])),p.typeScales.body2.fontSize,p.typeScales.body2.lineHeight)}}(n),c.css(ee||(ee=z(["\n --lg-combobox-icon-height: 16px;\n --lg-combobox-border-radius: 3px;\n --lg-combobox-width: ",";\n --lg-combobox-padding: var(--lg-combobox-padding-y)\n var(--lg-combobox-padding-x) var(--lg-combobox-padding-y)\n ",";\n width: var(--lg-combobox-width);\n // TODO: Clean this up 🤮\n min-width: calc(\n ","px + var(--lg-combobox-padding-x) * 2 + 2px +\n var(--lg-combobox-icon-height)\n );\n "])),"expand-x"===r?"unset":"100%","scroll-x"===r?"0":"var(--lg-combobox-padding-x)",Ke[n]))},Ze=c.css(oe||(oe=z(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n padding: var(--lg-combobox-padding);\n color: var(--lg-combobox-text-color);\n background-color: var(--lg-combobox-background-color);\n box-shadow: var(--lg-combobox-shadow);\n border: 1px solid var(--lg-combobox-border-color);\n border-radius: var(--lg-combobox-border-radius);\n width: var(--lg-combobox-width);\n cursor: text;\n transition: 150ms ease-in-out;\n transition-property: background-color, box-shadow, border-color;\n\n &[data-disabled='true'] {\n color: var(--lg-combobox-text-color-disabled);\n background-color: var(--lg-combobox-background-color-disabled);\n border-color: var(--lg-combobox-border-color-disabled);\n box-shadow: unset;\n cursor: not-allowed;\n }\n\n &[data-state='error'] {\n border-color: var(--lg-combobox-border-color-error);\n }\n"]))),_e=c.css(ne||(ne=z(["\n &:focus-within {\n border-color: transparent;\n background-color: var(--lg-combobox-background-color-focus);\n // TODO: Remove for UI refresh & Darkmode\n box-shadow: 0 0 0 3px ",", var(--lg-combobox-shadow-focus);\n }\n"])),s.uiColors.focus),Ye=function(e){var o,r=e.overflow,t=e.isOpen,i=e.selection,l=e.size,a=e.value,s=n.isArray(i)&&i.length>0,u=null!==(o=null==a?void 0:a.length)&&void 0!==o?o:0,d=c.css(re||(re=z(["\n flex-grow: 1;\n width: var(--lg-combobox-width);\n\n --lg-combobox-input-width: ",";\n --lg-combobox-input-min-width: ","px;\n "])),s?"".concat(u*Ke[l],"px"):"100%",Ke[l]);switch(r){case"scroll-x":return c.css(te||(te=z(["\n ","\n display: block;\n height: var(--lg-combobox-height);\n white-space: nowrap;\n overflow-x: scroll;\n padding-left: var(--lg-combobox-padding-x);\n scroll-behavior: smooth;\n scrollbar-width: none;\n /*\n * Immediate transition in, slow transition out. \n * '-in' transition is handled by `scroll-behavior` \n */\n --lg-combobox-input-transition: width ease-in-out\n ",";\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n & > ."," {\n margin-inline: 2px;\n\n &:first-child {\n margin-inline-start: 0;\n }\n\n &:last-child {\n margin-inline-end: 0;\n }\n }\n "],["\n ","\n display: block;\n height: var(--lg-combobox-height);\n white-space: nowrap;\n overflow-x: scroll;\n padding-left: var(--lg-combobox-padding-x);\n scroll-behavior: smooth;\n scrollbar-width: none;\n /*\n * Immediate transition in, slow transition out. \n * '-in' transition is handled by \\`scroll-behavior\\` \n */\n --lg-combobox-input-transition: width ease-in-out\n ",";\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n & > ."," {\n margin-inline: 2px;\n\n &:first-child {\n margin-inline-start: 0;\n }\n\n &:last-child {\n margin-inline-end: 0;\n }\n }\n "])),d,t?"0":"100ms",Ve);case"expand-x":return c.css(ie||(ie=z(["\n ","\n display: flex;\n gap: 4px;\n flex-wrap: nowrap;\n white-space: nowrap;\n height: var(--lg-combobox-height);\n --lg-combobox-input-transition: none;\n "])),d);case"expand-y":return c.css(le||(le=z(["\n ","\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n overflow-x: visible;\n min-height: var(--lg-combobox-height);\n "])),d)}},$e=c.css(ae||(ae=z(["\n border: none;\n cursor: inherit;\n background-color: inherit;\n box-sizing: content-box;\n padding: 0;\n margin: 0;\n text-overflow: ellipsis;\n font-size: var(--lg-combobox-font-size);\n line-height: var(--lg-combobox-line-height);\n height: var(--lg-combobox-height);\n width: var(--lg-combobox-input-width, 0);\n min-width: var(--lg-combobox-input-min-width);\n transition: var(--lg-combobox-input-transition);\n\n &:focus {\n outline: none;\n }\n"]))),Je=c.css(ce||(ce=z(["\n // Add a negative margin so the button takes up the same space as the regular icons\n margin-block: calc(var(--lg-combobox-icon-height) / 2 - 100%);\n"]))),Qe=c.css(se||(se=z(["\n &:focus {\n box-shadow: unset;\n &::before {\n background-color: ",";\n }\n }\n"])),s.uiColors.blue.light2),eo=c.css(ue||(ue=z(["\n font-size: var(--lg-combobox-font-size);\n line-height: var(--lg-combobox-line-height);\n color: var(--lg-combobox-color-error);\n padding-top: var(--lg-combobox-padding-y);\n"]))),oo=c.css(de||(de=z(["\n margin-inline-end: calc(var(--lg-combobox-padding-x) / 2);\n"]))),no=c.keyframes(be||(be=z(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),ro=c.css(fe||(fe=z(["\n animation: "," 1.5s linear infinite;\n"])),no),to=function(e){var o,n,r=e.darkMode,t=e.size,i=e.width,l=void 0===i?384:i;switch(o=r?c.css(pe||(pe=z([""]))):c.css(ge||(ge=z(["\n --lg-combobox-menu-color: ",";\n --lg-combobox-menu-message-color: ",";\n --lg-combobox-menu-background-color: ",";\n --lg-combobox-menu-shadow: 0px 3px 7px rgba(0, 0, 0, 0.25);\n --lg-combobox-item-hover-color: ",";\n --lg-combobox-item-active-color: ",";\n --lg-combobox-item-wedge-color: ",";\n "])),s.uiColors.gray.dark3,s.uiColors.gray.dark1,s.uiColors.white,s.uiColors.gray.light2,s.uiColors.blue.light3,s.uiColors.blue.base),t){case U:n=c.css(me||(me=z(["\n --lg-combobox-menu-border-radius: 4px;\n --lg-combobox-item-height: 36px;\n --lg-combobox-item-padding-y: 8px;\n --lg-combobox-item-padding-x: 12px;\n --lg-combobox-item-font-size: ","px; // TODO: update this\n --lg-combobox-item-line-height: ","px; // TODO: update this\n --lg-combobox-item-wedge-height: 22px;\n "])),p.typeScales.body1.fontSize+1,p.typeScales.body1.lineHeight+1);break;case W:n=c.css(xe||(xe=z(["\n --lg-combobox-menu-border-radius: 4px;\n --lg-combobox-item-height: 36px;\n --lg-combobox-item-padding-y: 8px;\n --lg-combobox-item-padding-x: 12px;\n --lg-combobox-item-font-size: ","px; // TODO: update this\n --lg-combobox-item-line-height: ","px; // TODO: update this\n --lg-combobox-item-wedge-height: 22px;\n "])),p.typeScales.body2.fontSize+1,p.typeScales.body2.lineHeight+1)}return c.cx(o,n,c.css(he||(he=z(["\n width: ","px;\n border-radius: var(--lg-combobox-menu-border-radius);\n\n & > * {\n border-radius: inherit;\n }\n "])),l))},io=c.css(ve||(ve=z(["\n position: relative;\n width: 100%;\n margin: 0;\n padding: 0;\n font-family: ",";\n color: var(--lg-combobox-menu-color);\n background-color: var(--lg-combobox-menu-background-color);\n box-shadow: var(--lg-combobox-menu-shadow);\n border-radius: inherit;\n overflow: auto;\n min-height: var(--lg-combobox-item-height);\n scroll-behavior: smooth;\n"])),p.fontFamilies.default),lo=c.css(ye||(ye=z(["\n position: relative;\n margin: 0;\n padding: 0;\n"]))),ao=c.css(we||(we=z(["\n display: inline-flex;\n align-items: center;\n gap: 8px;\n font-size: var(--lg-combobox-item-font-size);\n color: var(--lg-combobox-menu-message-color);\n padding: var(--lg-combobox-item-padding-y) var(--lg-combobox-item-padding-x);\n\n & > svg {\n width: 1em;\n height: 1em;\n }\n"]))),co=function(e){var o,n,r=e.darkMode,t=e.size;switch(o=r?c.css(Pe||(Pe=z([""]))):c.css(Fe||(Fe=z(["\n --lg-combobox-chip-text-color: ",";\n --lg-combobox-chip-icon-color: ",";\n --lg-combobox-chip-background-color: ",";\n --lg-combobox-chip-hover-color: ",";\n --lg-combobox-chip-focus-color: ",";\n "])),s.uiColors.gray.dark3,s.uiColors.gray.dark2,s.uiColors.gray.light2,s.uiColors.gray.light1,s.uiColors.blue.light2),t){case U:n=c.css(Le||(Le=z(["\n --lg-combobox-chip-height: 24px;\n --lg-combobox-chip-border-radius: 4px;\n --lg-combobox-chip-font-size: 14px;\n --lg-combobox-chip-line-height: 20px;\n --lg-combobox-chip-padding-x: 6px;\n "])));break;case W:n=c.css(Re||(Re=z(["\n --lg-combobox-chip-height: 28px;\n --lg-combobox-chip-border-radius: 4px;\n --lg-combobox-chip-font-size: ","px;\n --lg-combobox-chip-line-height: ","px;\n --lg-combobox-chip-padding-x: 6px;\n "])),p.typeScales.body2.fontSize,p.typeScales.body2.lineHeight)}return c.cx(o,n,c.css(qe||(qe=z(["\n display: inline-flex;\n align-items: center;\n overflow: hidden;\n white-space: nowrap;\n height: var(--lg-combobox-chip-height);\n font-size: var(--lg-combobox-chip-font-size);\n line-height: var(--lg-combobox-chip-line-height);\n border-radius: var(--lg-combobox-chip-border-radius);\n color: var(--lg-combobox-chip-text-color);\n background-color: var(--lg-combobox-chip-background-color);\n\n // TODO - refine these styles\n /* &:focus, */\n &:focus-within {\n background-color: var(--lg-combobox-chip-focus-color);\n }\n "]))))},so=c.css(Ge||(Ge=z(["\n padding-inline: var(--lg-combobox-chip-padding-x);\n"]))),uo=c.css(Ue||(Ue=z(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n outline: none;\n border: none;\n background-color: transparent;\n color: var(--lg-combobox-chip-icon-color);\n cursor: pointer;\n transition: background-color 100ms ease-in-out;\n\n &:before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n width: 1px;\n background-color: var(--lg-combobox-chip-hover-color);\n }\n\n &:hover {\n background-color: var(--lg-combobox-chip-hover-color);\n }\n"]))),bo=x.default.forwardRef((function(e,n){var r=e.displayName,t=e.isFocused,i=e.onRemove,l=e.onFocus,a=o.useContext(ke),s=a.darkMode,d=a.size,f=a.disabled,p=a.chipTruncationLocation,g=void 0===p?"end":p,m=a.chipCharacterLimit,x=void 0===m?12:m,h=!!x&&!!g&&"none"!==g&&r.length>x,y=o.useRef(null),w=o.useMemo((function(){if(h){var e=x-3;switch(g){case"start":return"…"+r.substring(r.length-e).trim();case"middle":return r.substring(0,e/2).trim()+"…"+r.substring(r.length-e/2).trim();case"end":return r.substring(0,e).trim()+"…";default:return r}}return!1}),[x,g,r,h]);o.useEffect((function(){var e;t&&!f&&(null==y||null===(e=y.current)||void 0===e||e.focus())}),[f,n,t]);return b.jsx("span",{role:"option","aria-selected":t,"data-testid":"lg-combobox-chip",ref:n,className:c.cx(Ve,co({darkMode:s,size:d})),onClick:function(e){var o;null!==(o=y.current)&&void 0!==o&&o.contains(e.target)||l()},onKeyDown:function(e){f||e.keyCode!==u.keyMap.Delete&&e.keyCode!==u.keyMap.Backspace&&e.keyCode!==u.keyMap.Enter&&e.keyCode!==u.keyMap.Space||i()},tabIndex:-1},b.jsx("span",{className:so},w?b.jsx(C.default,{definition:r,align:"bottom"},w):r),b.jsx("button",{"aria-label":"Deselect ".concat(r),"aria-disabled":f,disabled:f,ref:y,className:uo,onClick:function(){f||i()}},b.jsx(v.default,{glyph:"X"})))}));bo.displayName="Chip";var fo,po=function(e){return c.css(We||(We=z(["\n --lg-combobox-group-label-color: ",";\n --lg-combobox-group-border-color: ",";\n padding-top: 8px;\n border-bottom: 1px solid var(--lg-combobox-group-border-color);\n"])),e?s.uiColors.gray.light1:s.uiColors.gray.dark1,e?s.uiColors.gray.dark1:s.uiColors.gray.light1)},go=c.css(He||(He=z(["\n cursor: default;\n width: 100%;\n padding: 0 12px 2px;\n outline: none;\n overflow-wrap: anywhere;\n font-size: 12px;\n line-height: 16px;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 0.4px;\n color: var(--lg-combobox-group-label-color);\n"])));function mo(e){var n=e.label,r=e.className,t=e.children,l=o.useContext(ke).darkMode,a=i.useIdAllocator({prefix:"combobox-group"});return x.default.Children.count(t)>0?b.jsx("div",{className:c.cx(po(l),r)},b.jsx("div",{className:go,id:a},n),b.jsx("div",{role:"group","aria-labelledby":a},t)):b.jsx(x.default.Fragment,null)}function xo(e){throw Error("`ComboboxGroup` must be a child of a `Combobox` instance")}xo.displayName="ComboboxGroup";var ho=["children","label","description","placeholder","aria-label","disabled","size","darkMode","state","errorMessage","searchState","searchEmptyMessage","searchErrorMessage","searchLoadingMessage","filteredOptions","onFilter","clearable","onClear","overflow","multiselect","initialValue","onChange","value","chipTruncationLocation","chipCharacterLimit","className","usePortal","portalClassName","portalContainer","scrollContainer","popoverZIndex"];e.Combobox=function(e){var t=e.children,l=e.label,a=e.description,d=e.placeholder,f=void 0===d?"Select":d,p=e["aria-label"],g=e.disabled,m=void 0!==g&&g,w=e.size,k=void 0===w?U:w,C=e.darkMode,D=void 0!==C&&C,I=e.state,A=void 0===I?"none":I,W=e.errorMessage,H=e.searchState,K=void 0===H?"unset":H,V=e.searchEmptyMessage,B=void 0===V?"No results found":V,X=e.searchErrorMessage,Z=void 0===X?"Could not get results!":X,_=e.searchLoadingMessage,Y=void 0===_?"Loading results...":_,$=e.filteredOptions,J=e.onFilter,Q=e.clearable,ee=void 0===Q||Q,oe=e.onClear,ne=e.overflow,re=void 0===ne?"expand-y":ne,te=e.multiselect,ie=void 0!==te&&te,le=e.initialValue,ae=e.onChange,ce=e.value,se=e.chipTruncationLocation,ue=e.chipCharacterLimit,de=void 0===ue?12:ue,be=e.className,fe=e.usePortal,pe=void 0===fe||fe,ge=e.portalClassName,me=e.portalContainer,xe=e.scrollContainer,he=e.popoverZIndex,ve=M(e,ho),ye=i.useDynamicRefs({prefix:"option"}),we=i.useDynamicRefs({prefix:"chip"}),Ce=i.useIdAllocator({prefix:"combobox-input"}),Me=i.useIdAllocator({prefix:"combobox-label"}),ze=i.useIdAllocator({prefix:"combobox-menu"}),Ee=o.useRef(null),De=o.useRef(null),Ie=o.useRef(null),Te=o.useRef(null),Pe=o.useRef(null),Fe=E(o.useState(!1),2),Le=Fe[0],Re=Fe[1],qe=i.usePrevious(Le),Ge=E(o.useState(null),2),Ue=Ge[0],We=Ge[1],He=E(o.useState(null),2),Ke=He[0],Ve=He[1],no=i.usePrevious(Ke),co=E(o.useState(""),2),so=co[0],uo=co[1],po=i.usePrevious(so),go=E(o.useState(null),2),xo=go[0],vo=go[1],yo=!n.isNull(Ke)&&(n.isArray(Ke)&&Ke.length>0||n.isString(Ke)),wo=ie&&n.isArray(Ke)&&Ke.length>0?void 0:f,ko=function(){return Re(!1)},Co=function(){return Re(!0)},jo=o.useMemo((function(){return Se(t)}),[t]),Oo=o.useCallback((function(e){return!ie||"string"!=typeof e&&"number"!=typeof e?!ie&&n.isArray(e)&&u.consoleOnce.error("Error in Combobox: multiselect is set to `false`, but recieved an Array value"):u.consoleOnce.error("Error in Combobox: multiselect is set to `true`, but recieved a ".concat(O(e),' value: "').concat(e,'"')),ie&&n.isArray(e)}),[ie]),No=o.useCallback((function(e){!m&&Te&&Te.current&&(Te.current.focus(),n.isUndefined(e)||Te.current.setSelectionRange(e,e))}),[m]),So=o.useCallback((function(e){if(Oo(Ke)){var o=n.clone(Ke);n.isNull(e)?o.length=0:Ke.includes(e)?o.splice(o.indexOf(e),1):(o.push(e),uo("")),Ve(o),null==ae||ae(o)}else{var r=e;Ve(r),null==ae||ae(r)}}),[Oo,ae,Ke]),Mo=o.useCallback((function(e){return Oo(Ke)?Ke.includes(e):e===Ke}),[Oo,Ke]),zo=o.useCallback((function(e){var o,n,r,t,i=(n=jo,(o=e)?null!==(r=null===(t=n.find((function(e){return e.displayName===o})))||void 0===t?void 0:t.value)&&void 0!==r?r:o:"");return Mo(i)}),[jo,Mo]),Eo=o.useCallback((function(e){var o="string"==typeof e?e:e.value;return $&&$.length>0?$.includes(o):!!zo(so)||("string"==typeof e?Ne(o,jo):e.displayName).toLowerCase().includes(so.toLowerCase())}),[$,zo,so,jo]),Do=o.useMemo((function(){return jo.filter(Eo)}),[jo,Eo]),Io=o.useCallback((function(e){return!!e&&!!jo.find((function(o){return o.value===e}))}),[jo]),Ao=o.useCallback((function(e){return Do?Do.findIndex((function(o){return o.value===e})):-1}),[Do]),To=o.useCallback((function(e){if(Do&&Do.length>=e){var o=Do[e];return o?o.value:void 0}}),[Do]),Po=o.useCallback((function(){return Oo(Ke)?Ke.findIndex((function(e){var o,n;return null===(o=we(e))||void 0===o||null===(n=o.current)||void 0===n?void 0:n.contains(document.activeElement)})):-1}),[we,Oo,Ke]),Fo=E(o.useState(),2),Lo=Fo[0],Ro=Fo[1],qo=o.useCallback((function(e){var o,n=null!==(o=null==Do?void 0:Do.length)&&void 0!==o?o:0,r=n-1>0?n-1:0,t=Ao(Ue);switch(e&&Le&&(vo(null),No()),e){case"next":var i=To(t+1<n?t+1:0);We(null!=i?i:null);break;case"prev":var l=To(t-1>=0?t-1:r);We(null!=l?l:null);break;case"last":var a=To(r);We(null!=a?a:null);break;default:var c=To(0);We(null!=c?c:null)}}),[Ue,Ao,To,Le,No,null==Do?void 0:Do.length]),Go=o.useCallback((function(e,o){if(Oo(Ke))switch(e){case"next":var n=null!=o?o:Po(),r=n+1<Ke.length?n+1:Ke.length-1,t=Ke[r];vo(t);break;case"prev":var i=null!=o?o:Po(),l=i>0?i-1:i<0?Ke.length-1:0,a=Ke[l];vo(a);break;case"first":var c=Ke[0];vo(c);break;case"last":var s=Ke[Ke.length-1];vo(s);break;default:vo(null)}}),[Po,Oo,Ke]),Uo=o.useCallback((function(e,o){switch(e&&We(null),e){case"right":switch(Lo){case T:var n,r,t;if((null===(n=Te.current)||void 0===n?void 0:n.selectionEnd)===(null===(r=Te.current)||void 0===r?void 0:r.value.length))null===(t=De.current)||void 0===t||t.focus();break;case F:case R:case L:if(Lo===L||1===(null==Ke?void 0:Ke.length)){No(0),Go(null),o.preventDefault();break}Go("next")}break;case"left":switch(Lo){case P:var i;o.preventDefault(),No(null==Te||null===(i=Te.current)||void 0===i?void 0:i.value.length);break;case T:case R:case L:if(Oo(Ke)){var l;if(Lo===T&&0!==(null===(l=Te.current)||void 0===l?void 0:l.selectionStart))break;Go("prev")}}break;default:Go(null)}}),[Lo,Oo,Ke,No,Go]);o.useEffect((function(){so!==po&&qo("first")}),[so,Le,po,qo]),o.useEffect((function(){if(Ue){var e=ye(Ue);if(e&&e.current&&Pe.current){var o=e.current.offsetTop,n=Pe.current,r=n.scrollTop;(o>n.offsetHeight||o<r)&&(Pe.current.scrollTop=o)}}}),[Ue,ye]);var Wo=o.useCallback((function(e){return x.default.Children.map(e,(function(e){if(u.isComponentType(e,"ComboboxOption")){var o=je(e.props),n=o.value,r=o.displayName;if(Eo(n)){var t=e.props,i=t.className,l=t.glyph,a=t.disabled,c=jo.findIndex((function(e){return e.value===n})),s=Ue===n,d=Oo(Ke)?Ke.includes(n):Ke===n,f=ye(n);return b.jsx(Ae,{value:n,displayName:r,isFocused:s,isSelected:d,disabled:a,setSelected:function(){We(n),So(n),No(),n===Ke&&ko()},glyph:l,className:i,index:c,ref:f})}}else if(u.isComponentType(e,"ComboboxGroup")){var p=Wo(e.props.children);if(p&&(null==p?void 0:p.length)>0)return b.jsx(mo,{label:e.props.label,className:e.props.className},Wo(p))}}))}),[jo,Ue,ye,Oo,Eo,Ke,No,So]),Ho=o.useMemo((function(){return Wo(t)}),[t,Wo]),Ko=o.useMemo((function(){if(Oo(Ke))return Ke.filter(Io).map((function(e,o){var n=Ne(e,jo),r=xo===e,t=we(e),i=o>=Ke.length-1;return b.jsx(bo,{key:e,displayName:n,isFocused:r,onRemove:function(){i?(No(),Go(null)):Go("next",o),So(e)},onFocus:function(){vo(e)},ref:t})}))}),[Oo,Ke,Io,jo,xo,we,So,No,Go]),Vo=o.useMemo((function(){return b.jsx(x.default.Fragment,null,ee&&yo&&b.jsx(y.default,{"aria-label":"Clear selection","aria-disabled":m,disabled:m,ref:De,onClick:function(e){m||(So(null),null==oe||oe(e),null==J||J(""),Le||Co())},onFocus:on,className:c.cx(Je,Qe)},b.jsx(v.default,{glyph:"XWithCircle"})),"error"===A?b.jsx(v.default,{glyph:"Warning",color:s.uiColors.red.base,className:oo}):b.jsx(v.default,{glyph:"CaretDown",className:oo}))}),[ee,yo,m,A,So,oe,J,Le]),Bo=o.useMemo((function(){return jo.some((function(e){return e.hasGlyph}))}),[jo]),Xo=o.useCallback((function(){if(!Oo(Ke)&&Ke===no){var e=Do.find((function(e){return e.displayName===so||e.value===so}));if(e&&!ce)Ve(e.value);else{var o,n=null!==(o=Ne(Ke,jo))&&void 0!==o?o:"";uo(n)}}}),[jo,so,Oo,no,Ke,ce,Do]),Zo=o.useCallback((function(){if(yo){if(Oo(Ke))tn();else if(!Oo(Ke)){var e,o=null!==(e=Ne(Ke,jo))&&void 0!==e?e:"";uo(o),ko()}}else uo("")}),[yo,jo,Oo,Ke]);o.useEffect((function(){if(le)if(n.isArray(le)){var e,o=null!==(e=le.filter((function(e){return Io(e)})))&&void 0!==e?e:[];Ve(o)}else Io(le)&&Ve(le);else Ve(function(e){return e?[]:null}(ie))}),[]),o.useEffect((function(){if(!n.isUndefined(ce)&&ce!==po)if(n.isNull(ce))Ve(null);else if(Oo(ce)){var e=ce.filter(Io);Ve(e)}else Ve(Io(ce)?ce:null)}),[Oo,Io,po,ce]),o.useEffect((function(){n.isEqual(Ke,no)||Zo()}),[Zo,no,Ke]),o.useEffect((function(){!Le&&qe&&Xo()}),[Le,qe,Xo]);var _o=E(o.useState(0),2),Yo=_o[0],$o=_o[1];o.useEffect((function(){var e,o;$o(null!==(e=null===(o=Ee.current)||void 0===o?void 0:o.clientWidth)&&void 0!==e?e:0)}),[Ee,Le,Ue,Ke]);var Jo=o.useMemo((function(){switch(K){case"loading":return b.jsx("span",{className:ao},b.jsx(v.default,{glyph:"Refresh",color:s.uiColors.blue.base,className:ro}),Y);case"error":return b.jsx("span",{className:ao},b.jsx(v.default,{glyph:"Warning",color:s.uiColors.red.base}),Z);default:return Ho&&Ho.length>0?b.jsx("ul",{className:lo},Ho):b.jsx("span",{className:ao},B)}}),[Ho,B,Z,Y,K]),Qo=i.useAvailableSpace(Ee),en=n.isUndefined(Qo)?"unset":"".concat(Math.min(Qo,256),"px"),on=function(){We(null)};i.useEventListener("mousedown",(function(e){rn(e)||(e.preventDefault(),e.stopPropagation())}),{enabled:Le}),i.useEventListener("click",(function(e){rn(e)||(e.stopPropagation(),ko())}),{options:{capture:!0},enabled:Le});var nn=function(e){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?j(Object(n),!0).forEach((function(o){N(e,o,n[o])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))}))}return e}({popoverZIndex:he},pe?{usePortal:pe,portalClassName:ge,portalContainer:me,scrollContainer:xe}:{usePortal:pe});return b.jsx(ke.Provider,{value:{multiselect:ie,darkMode:D,size:k,withIcons:Bo,disabled:m,chipTruncationLocation:se,chipCharacterLimit:de,inputValue:so}},b.jsx("div",S({className:c.cx(Xe({darkMode:D,size:k,overflow:re}),be)},ve),b.jsx("div",null,l&&b.jsx(r.Label,{id:Me,htmlFor:Ce,className:Be},l),a&&b.jsx(r.Description,{className:Be},a)),b.jsx("div",{ref:Ee,role:"combobox","aria-expanded":Le,"aria-controls":ze,"aria-owns":ze,tabIndex:-1,className:c.cx(Ze,N({},_e,Lo===T)),onMouseDown:function(e){m&&e.preventDefault()},onClick:function(e){if(e.target!==Te.current){var o=0;if(Te.current)o=e.nativeEvent.offsetX>Te.current.offsetLeft+Te.current.clientWidth?so.length:0;No(o)}},onFocus:function(e){tn(),Co(),Ro(function(e){var o,n,r,t;if(!e)return;if(null!==(o=Te.current)&&void 0!==o&&o.contains(e))return T;if(null!==(n=De.current)&&void 0!==n&&n.contains(e))return P;var i=Oo(Ke)?Ke.findIndex((function(o){var n,r;return null===(n=we(o))||void 0===n||null===(r=n.current)||void 0===r?void 0:r.contains(e)})):-1;if(Oo(Ke)){if(0===i)return F;if(i===Ke.length-1)return L;if(i>0)return R}if(null!==(r=Pe.current)&&void 0!==r&&r.contains(e))return G;if(null!==(t=Ee.current)&&void 0!==t&&t.contains(e))return q}(e.target))},onKeyDown:function(e){var o,r,t=null===(o=Pe.current)||void 0===o?void 0:o.contains(document.activeElement);if((null===(r=Ee.current)||void 0===r?void 0:r.contains(document.activeElement))||t){if(e.ctrlKey||e.shiftKey||e.altKey)return;switch(e.keyCode){case u.keyMap.Tab:switch(Lo){case"Input":yo||(ko(),qo("first"),Go(null));break;case"LastChip":Go(null)}break;case u.keyMap.Escape:ko(),qo("first");break;case u.keyMap.Enter:!Le||Lo!==T||n.isNull(Ue)||function(e){if("string"==typeof e){var o=Oe(e,jo);return!(null==o||!o.isDisabled)}return!!e.isDisabled}(Ue)?Lo===P&&(So(null),No()):So(Ue);break;case u.keyMap.Backspace:var i;if(Oo(Ke))"Input"===Lo&&0===(null===(i=Te.current)||void 0===i?void 0:i.selectionStart)&&Go("last");Co();break;case u.keyMap.ArrowDown:Le?(e.preventDefault(),qo("next")):Co();break;case u.keyMap.ArrowUp:Le?(e.preventDefault(),qo("prev")):Co();break;case u.keyMap.ArrowRight:Uo("right",e);break;case u.keyMap.ArrowLeft:Uo("left",e);break;default:Le||Co()}}},onTransitionEnd:function(){var e,o;$o(null!==(e=null===(o=Ee.current)||void 0===o?void 0:o.clientWidth)&&void 0!==e?e:0)},"data-disabled":m,"data-state":A},b.jsx("div",{ref:Ie,className:Ye({overflow:re,isOpen:Le,selection:Ke,size:k,value:so})},Ko,b.jsx("input",{"aria-label":null!=p?p:l,"aria-autocomplete":"list","aria-controls":ze,"aria-labelledby":Me,ref:Te,id:Ce,className:$e,placeholder:wo,disabled:null!=m?m:void 0,onChange:function(e){var o=e.target.value;uo(o),null==J||J(o)},value:so,autoComplete:"off"})),Vo),"error"===A&&W&&b.jsx("div",{className:eo},W),b.jsx(h.default,S({active:Le&&!m,spacing:4,align:"bottom",justify:"middle",refEl:Ee,adjustOnMutation:!0,className:to({darkMode:D,size:k,width:Yo})},nn),b.jsx("div",{id:ze,role:"listbox","aria-labelledby":Me,"aria-expanded":Le,ref:Pe,className:c.cx(io,c.css(fo||(fo=z(["\n max-height: ",";\n "])),en)),onMouseDownCapture:function(e){return e.preventDefault()}},Jo))));function rn(e){var o,n,r=e.target;return(null===(o=Pe.current)||void 0===o?void 0:o.contains(r))||(null===(n=Ee.current)||void 0===n?void 0:n.contains(r))||!1}function tn(){Ie&&Ie.current&&(Ie.current.scrollLeft=Ie.current.scrollWidth)}},e.ComboboxGroup=xo,e.ComboboxOption=Te,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
1
|
+
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("lodash/clone"),require("lodash/isArray"),require("lodash/isEqual"),require("lodash/isNull"),require("lodash/isString"),require("lodash/isUndefined"),require("react"),require("@leafygreen-ui/typography"),require("@leafygreen-ui/hooks"),require("@leafygreen-ui/icon"),require("@leafygreen-ui/icon-button"),require("@leafygreen-ui/emotion"),require("@leafygreen-ui/palette"),require("@leafygreen-ui/lib"),require("lodash/escapeRegExp"),require("@emotion/react"),require("lodash/kebabCase"),require("@leafygreen-ui/checkbox"),require("@leafygreen-ui/tokens"),require("polished"),require("@leafygreen-ui/inline-definition"),require("@leafygreen-ui/popover")):"function"==typeof define&&define.amd?define(["exports","lodash/clone","lodash/isArray","lodash/isEqual","lodash/isNull","lodash/isString","lodash/isUndefined","react","@leafygreen-ui/typography","@leafygreen-ui/hooks","@leafygreen-ui/icon","@leafygreen-ui/icon-button","@leafygreen-ui/emotion","@leafygreen-ui/palette","@leafygreen-ui/lib","lodash/escapeRegExp","@emotion/react","lodash/kebabCase","@leafygreen-ui/checkbox","@leafygreen-ui/tokens","polished","@leafygreen-ui/inline-definition","@leafygreen-ui/popover"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self)["@leafygreen-ui/combobox"]={},e.clone,e.isArray,e.isEqual,e.isNull,e.isString,e.isUndefined,e.React,e["@leafygreen-ui/typography"],e["@leafygreen-ui/hooks"],e["@leafygreen-ui/icon"],e["@leafygreen-ui/icon-button"],e["@leafygreen-ui/emotion"],e["@leafygreen-ui/palette"],e["@leafygreen-ui/lib"],e.escapeRegExp,e.react,e.kebabCase,e["@leafygreen-ui/checkbox"],e["@leafygreen-ui/tokens"],e.polished,e["@leafygreen-ui/inline-definition"],e["@leafygreen-ui/popover"])}(this,(function(e,n,t,r,a,o,l,i,s,c,u,d,p,f,g,b,h,y,x,v,m,k,w){"use strict";function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var S=C(n),j=C(t),N=C(r),M=C(a),O=C(o),E=C(l),z=C(i),I=C(u),D=C(d),A=C(b),R=C(y),q=C(x),P=C(k),F=C(w);function L(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function H(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function W(){return W=Object.assign||function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},W.apply(this,arguments)}function G(e,n){if(null==e)return{};var t,r,a=function(e,n){if(null==e)return{};var t,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||(a[t]=e[t]);return a}(e,n);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)t=o[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(a[t]=e[t])}return a}function U(e,n){return n||(n=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(n)}}))}function K(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==t)return;var r,a,o=[],l=!0,i=!1;try{for(t=t.call(e);!(l=(r=t.next()).done)&&(o.push(r.value),!n||o.length!==n);l=!0);}catch(e){i=!0,a=e}finally{try{l||null==t.return||t.return()}finally{if(i)throw a}}return o}(e,n)||B(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e){return function(e){if(Array.isArray(e))return X(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||B(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e,n){if(e){if("string"==typeof e)return X(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?X(e,n):void 0}}function X(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}var Z="dark",_="light",Y="Input",$="ClearButton",J="FirstChip",Q="LastChip",ee="MiddleChip",ne="Combobox",te="Menu",re="default",ae="large",oe="expand-y",le="expand-x",ie="scroll-x",se="error",ce="none";var ue,de,pe,fe,ge,be,he,ye,xe,ve,me,ke,we,Ce,Se,je,Ne,Me,Oe,Ee,ze,Ie,De,Ae,Re,qe,Pe,Fe,Le,Te,He,We,Ge,Ue=function(e,n,t){if(n&&t){var r=A.default(n),a=new RegExp(r,"gi"),o=e.matchAll(a);if(o){for(var l=e.split(""),i=0,s=Array.from(o);i<s.length;i++){var c,u=s[i],d=null!==(c=u.index)&&void 0!==c?c:-1,p=u[0],f=p.length,g=d+p+f,b=new Array(f).fill("");b[0]=z.default.createElement(t,{key:g},p),l.splice.apply(l,[d,f].concat(V(b)))}return h.jsx(z.default.Fragment,null,l)}return h.jsx(z.default.Fragment,null,e)}return h.jsx(z.default.Fragment,null,e)},Ke=function(e){var n,t=e.value,r=e.displayName;return{value:null!=t?t:R.default(r),displayName:null!==(n=null!=r?r:t)&&void 0!==n?n:""}},Ve=function(e,n){if(e)return n.find((function(n){return n.value===e}))},Be=function(e,n){var t,r;return e?null!==(t=null===(r=Ve(e,n))||void 0===r?void 0:r.displayName)&&void 0!==t?t:e:""},Xe=function e(n){return z.default.Children.toArray(n).reduce((function(n,t){if(g.isComponentType(t,"ComboboxOption")){var r=Ke(t.props),a=r.value,o=r.displayName,l=t.props,i=l.glyph,s=l.disabled;return[].concat(V(n),[{value:a,displayName:o,isDisabled:!!s,hasGlyph:!!i}])}if(g.isComponentType(t,"ComboboxGroup")){var c=t.props.children;if(c)return[].concat(V(n),V(e(c)))}}),[])},Ze=i.createContext({multiselect:!1,darkMode:!1,size:re,withIcons:!1,disabled:!1,isOpen:!1,state:ce,searchState:"unset"}),_e=function(e){return e?Z:_},Ye=(H(pe={},_,p.css(ue||(ue=U(["\n padding-top: 8px;\n "])))),H(pe,Z,p.css(de||(de=U(["\n padding-top: 8px;\n "])))),pe),$e=p.css(fe||(fe=U(["\n cursor: default;\n width: 100%;\n padding: 0 12px 2px;\n outline: none;\n overflow-wrap: anywhere;\n font-size: 12px;\n line-height: 16px;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 0.4px;\n"]))),Je=(H(he={},_,p.css(ge||(ge=U(["\n color: ",";\n "])),f.palette.gray.dark1)),H(he,Z,p.css(be||(be=U(["\n color: ",";\n "])),f.palette.gray.light1)),he);function Qe(e){var n=e.label,t=e.className,r=e.children,a=i.useContext(Ze).darkMode,o=_e(a),l=c.useIdAllocator({prefix:"combobox-group"});return z.default.Children.count(r)>0?h.jsx("div",{className:p.cx(Ye[o],t)},h.jsx("div",{className:p.cx($e,Je[o]),id:l},n),h.jsx("div",{role:"group","aria-labelledby":l},r)):h.jsx(z.default.Fragment,null)}function en(e){throw Error("`ComboboxGroup` must be a child of a `Combobox` instance")}en.displayName="ComboboxGroup";var nn=(H(ye={},re,{x:12,y:8}),H(ye,ae,{x:12,y:8}),ye),tn=(H(xe={},re,v.typeScales.body1.lineHeight+2*nn[re].y),H(xe,ae,v.typeScales.body2.lineHeight+2*nn[ae].y),xe),rn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:384;return p.css(ve||(ve=U(["\n width: ","px;\n overflow: hidden;\n border-radius: 12px;\n border: 1px solid;\n"])),e)},an=(H(we={},_,p.css(me||(me=U(["\n box-shadow: 0px 4px 7px ",";\n border-color: ",";\n "])),m.transparentize(.85,f.palette.black),f.palette.gray.light2)),H(we,Z,p.css(ke||(ke=U(["\n box-shadow: 0px 4px 7px ",";\n border-color: ",";\n "])),m.transparentize(.85,f.palette.black),f.palette.gray.dark3)),we),on=p.css(Ce||(Ce=U(["\n position: relative;\n width: 100%;\n margin: 0;\n padding: ","px 0;\n font-family: ",";\n border-radius: inherit;\n overflow-y: auto;\n scroll-behavior: smooth;\n"])),v.spacing[2],v.fontFamilies.default),ln=(H(Ne={},_,p.css(Se||(Se=U(["\n color: ",";\n background-color: ",";\n "])),f.palette.black,f.palette.white)),H(Ne,Z,p.css(je||(je=U(["\n color: ",";\n background-color: ",";\n "])),f.palette.gray.light1,f.palette.gray.dark3)),Ne);H(Ee={},re,p.css(Me||(Me=U(["\n min-height: ","px;\n "])),tn[re])),H(Ee,ae,p.css(Oe||(Oe=U(["\n min-height: ","px;\n "])),tn[ae]));var sn=p.css(ze||(ze=U(["\n position: relative;\n margin: 0;\n padding: 0;\n"]))),cn=p.css(Ie||(Ie=U(["\n font-family: inherit;\n display: inline-flex;\n align-items: center;\n gap: 8px;\n"]))),un=(H(Re={},_,p.css(De||(De=U(["\n color: ",";\n "])),f.palette.gray.dark3)),H(Re,Z,p.css(Ae||(Ae=U(["\n color: ",";\n "])),f.palette.gray.light3)),Re),dn=(H(Fe={},re,p.css(qe||(qe=U(["\n font-size: ","px;\n line-height: ","px;\n padding: ","px\n ","px;\n "])),v.typeScales.body1.fontSize,v.typeScales.body1.lineHeight,nn[re].y,nn[re].x)),H(Fe,ae,p.css(Pe||(Pe=U(["\n font-size: ","px;\n line-height: ","px;\n padding: ","px\n ","px;\n "])),v.typeScales.body2.fontSize,v.typeScales.body2.lineHeight,nn[ae].y,nn[ae].x)),Fe);H(He={},re,p.css(Le||(Le=U(["\n height: ","px;\n width: ","px;\n "])),v.typeScales.body1.fontSize,v.typeScales.body1.fontSize)),H(He,ae,p.css(Te||(Te=U(["\n height: ","px;\n width: ","px;\n "])),v.typeScales.body2.fontSize,v.typeScales.body2.fontSize));var pn,fn,gn,bn,hn,yn,xn,vn,mn,kn,wn,Cn,Sn,jn,Nn,Mn,On,En,zn,In,Dn,An,Rn,qn,Pn,Fn,Ln,Tn,Hn,Wn,Gn,Un,Kn,Vn,Bn,Xn,Zn,_n,Yn,$n,Jn,Qn,et,nt,tt,rt,at,ot,lt,it,st,ct,ut,dt,pt,ft,gt,bt,ht,yt,xt,vt,mt,kt,wt,Ct,St=p.keyframes(We||(We=U(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),jt=p.css(Ge||(Ge=U(["\n animation: "," 1.5s linear infinite;\n"])),St),Nt=p.css(pn||(pn=U(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: space-between;\n list-style: none;\n color: inherit;\n cursor: pointer;\n overflow: hidden;\n font-family: ",";\n\n // Left wedge\n &:before {\n content: '';\n position: absolute;\n left: 0;\n width: 4px;\n height: calc(100% - 14px);\n background-color: rgba(255, 255, 255, 0);\n border-radius: 0 6px 6px 0;\n transform: scale3d(0, 0.3, 0);\n transition: 200ms ease-in-out;\n transition-property: transform, background-color;\n }\n"])),v.fontFamilies.default),Mt=(H(bn={},_,p.css(fn||(fn=U(["\n &:hover {\n outline: none;\n background-color: ",";\n }\n "])),f.palette.gray.light2)),H(bn,Z,p.css(gn||(gn=U(["\n &:hover {\n outline: none;\n background-color: ",";\n }\n "])),f.palette.gray.dark4)),bn),Ot=(H(xn={},re,p.css(hn||(hn=U(["\n font-size: ","px;\n line-height: ","px;\n min-height: ","px;\n padding: ","px\n ","px;\n gap: ","px;\n\n &:before {\n max-height: ","px;\n }\n "])),v.typeScales.body1.fontSize,v.typeScales.body1.lineHeight,tn[re],nn[re].y,nn[re].x,v.spacing[1],tn[re])),H(xn,ae,p.css(yn||(yn=U(["\n font-size: ","px;\n line-height: ","px;\n min-height: ","px;\n padding: ","px\n ","px;\n gap: ","px;\n\n &:before {\n max-height: ","px;\n }\n "])),v.typeScales.body2.fontSize,v.typeScales.body2.lineHeight,tn[ae],nn[ae].y,nn[ae].x,v.spacing[2],tn[ae])),xn),Et=p.css(vn||(vn=U(["\n outline: none;\n\n &:before {\n transform: scaleY(1);\n }\n"]))),zt=(H(wn={},_,p.css(mn||(mn=U(["\n ",";\n background-color: ",";\n\n &:before {\n background-color: ",";\n }\n "])),Et,f.palette.blue.light3,f.palette.blue.base)),H(wn,Z,p.css(kn||(kn=U(["\n ",";\n background-color: ",";\n\n &:before {\n background-color: ",";\n }\n "])),Et,f.palette.blue.dark3,f.palette.blue.light1)),wn),It=p.css(Cn||(Cn=U(["\n cursor: not-allowed;\n\n &:hover {\n background-color: inherit;\n }\n\n &:before {\n content: unset;\n }\n"]))),Dt=(H(Nn={},_,p.css(Sn||(Sn=U(["\n ",";\n color: ",";\n "])),It,f.palette.gray.light1)),H(Nn,Z,p.css(jn||(jn=U(["\n ",";\n color: ",";\n "])),It,f.palette.gray.dark1)),Nn),At=(H(En={},re,p.css(Mn||(Mn=U(["\n min-width: ","px;\n "])),v.spacing[3])),H(En,ae,p.css(On||(On=U(["\n min-width: ","px;\n "])),v.spacing[4])),En),Rt=p.css(zn||(zn=U(["\n display: inline-flex;\n gap: 8px;\n justify-content: start;\n align-items: inherit;\n overflow-wrap: anywhere;\n"]))),qt=p.css(In||(In=U(["\n pointer-events: none;\n"]))),Pt=function(e){return p.css(Dn||(Dn=U(["\n font-weight: ",";\n"])),e?"bold":"normal")},Ft=z.default.forwardRef((function(e,n){var t,r=e.displayName,a=e.glyph,o=e.isSelected,l=e.isFocused,s=e.disabled,d=e.setSelected,b=e.className,y=i.useContext(Ze),x=y.multiselect,v=y.darkMode,m=y.withIcons,k=y.inputValue,w=y.size,C=_e(v),S=c.useIdAllocator({prefix:"combobox-option-text"}),j=c.useForwardedRef(n,null),N=i.useCallback((function(e){e.stopPropagation(),s||e.target!==j.current&&"INPUT"!==e.target.tagName||d()}),[s,j,d]),M=i.useMemo((function(){if(a){if(u.isComponentGlyph(a)||g.isComponentType(a,"Icon"))return a;console.error("`ComboboxOption` instance did not render icon because it is not a known glyph element.",a)}}),[a]),O=i.useMemo((function(){if(x){var e=h.jsx(q.default,{"aria-labelledby":S,checked:o,tabIndex:-1,disabled:s,darkMode:v,className:p.css(An||(An=U(["\n // TODO: Remove when this is resolved:\n // https://jira.mongodb.org/browse/PD-2171\n & > label > div {\n margin-top: 0;\n }\n "])))});return h.jsx(z.default.Fragment,null,h.jsx("span",{className:p.cx(Rt,qt)},m?M:e,h.jsx("span",{id:S,className:Pt(o)},Ue(r,k,"strong"))),m&&e)}return h.jsx(z.default.Fragment,null,h.jsx("span",{className:p.cx(Rt,qt)},M,h.jsx("span",{className:Pt(o)},Ue(r,k,"strong"))),o&&h.jsx(I.default,{glyph:"Checkmark",className:At[w],color:v?f.palette.blue.light1:f.palette.blue.base}))}),[x,M,o,r,k,w,v,S,s,m]);return h.jsx("li",{ref:j,role:"option","aria-selected":l,"aria-label":r,tabIndex:-1,className:p.cx(Nt,Ot[w],Mt[C],(t={},H(t,zt[C],l),H(t,Dt[C],s),t),b),onClick:N,onKeyDown:N},O)}));function Lt(e){throw Error("`ComboboxOption` must be a child of a `Combobox` instance")}Ft.displayName="ComboboxOption",Lt.displayName="ComboboxOption";var Tt,Ht,Wt,Gt,Ut,Kt,Vt,Bt,Xt,Zt,_t,Yt,$t,Jt,Qt,er,nr,tr,rr,ar,or,lr=(H(Rn={},re,v.typeScales.body1.fontSize),H(Rn,ae,v.typeScales.body2.fontSize),Rn),ir=(H(qn={},re,2),H(qn,ae,4),qn),sr=(H(Pn={},re,v.typeScales.body1.lineHeight+2*ir[re]),H(Pn,ae,v.typeScales.body2.lineHeight+2*ir[ae]),Pn),cr=(H(Fn={},re,{y:(36-sr[re]-2)/2,x:v.spacing[2]-1}),H(Fn,ae,{y:(48-sr[ae]-2)/2,x:v.spacing[2]-1}),Fn),ur=v.spacing[3],dr=(H(Ln={},re,lr[re]+2*cr[re].x+ur+2),H(Ln,ae,lr[ae]+2*cr[ae].x+ur+2),Ln),pr=g.createUniqueClassName("combobox-chip"),fr=function(e,n){return p.cx(p.css(Tn||(Tn=U(["\n font-family: ",";\n width: 100%;\n min-width: ","px;\n "])),v.fontFamilies.default,dr[e]),H({},p.css(Hn||(Hn=U(["\n width: unset;\n "]))),n===le))},gr=p.css(Wn||(Wn=U(["\n display: flex;\n flex-wrap: nowrap;\n align-items: center;\n cursor: text;\n transition: 150ms ease-in-out;\n transition-property: background-color, box-shadow, border-color;\n border: 1px solid;\n width: inherit;\n border-radius: 6px;\n"]))),br=(H(Kn={},_,p.css(Gn||(Gn=U(["\n color: ",";\n background-color: ",";\n border-color: ",";\n\n &:hover {\n box-shadow: ",";\n }\n "])),f.palette.gray.dark3,f.palette.white,f.palette.gray.base,v.hoverRing[_].gray)),H(Kn,Z,p.css(Un||(Un=U(["\n color: ",";\n background-color: ",";\n border-color: ",";\n\n &:hover {\n box-shadow: ",";\n }\n "])),f.palette.gray.light2,f.palette.gray.dark4,f.palette.gray.base,v.hoverRing[Z].gray)),Kn),hr=function(e){return p.css(Vn||(Vn=U(["\n padding: ","px ","px;\n"])),cr[e].y,cr[e].x)},yr=(H(Zn={},_,p.css(Bn||(Bn=U(["\n cursor: not-allowed;\n color: ",";\n background-color: ",";\n border-color: ",";\n "])),f.palette.gray.dark1,f.palette.gray.light2,f.palette.gray.light1)),H(Zn,Z,p.css(Xn||(Xn=U(["\n cursor: not-allowed;\n color: ",";\n background-color: ",";\n border-color: ",";\n "])),f.palette.gray.dark1,f.palette.gray.dark3,f.palette.gray.dark2)),Zn),xr=(H($n={},_,p.css(_n||(_n=U(["\n border-color: ",";\n "])),f.palette.red.base)),H($n,Z,p.css(Yn||(Yn=U(["\n border-color: ",";\n "])),f.palette.red.light1)),$n),vr=(H(et={},_,p.css(Jn||(Jn=U(["\n &:focus-within {\n border-color: transparent;\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.palette.white,v.focusRing[_].input)),H(et,Z,p.css(Qn||(Qn=U(["\n &:focus-within {\n border-color: transparent;\n background-color: ",";\n box-shadow: ",";\n }\n "])),f.palette.gray.dark4,v.focusRing[Z].input)),et),mr=function(e){var n=e.overflow,t=e.size,r=p.css(nt||(nt=U(["\n flex-grow: 1;\n width: inherit;\n "])));switch(n){case ie:return p.css(tt||(tt=U(["\n ","\n display: block;\n height: ","px;\n padding-left: ","px;\n white-space: nowrap;\n overflow-x: scroll;\n scroll-behavior: smooth;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n\n & > ."," {\n margin-inline: 2px;\n\n &:first-child {\n margin-inline-start: 0;\n }\n\n &:last-child {\n margin-inline-end: 0;\n }\n }\n "])),r,sr[t],cr[t].x,pr);case le:return p.css(rt||(rt=U(["\n ","\n display: flex;\n gap: 4px;\n flex-wrap: nowrap;\n white-space: nowrap;\n height: ","px;\n "])),r,sr[t]);case oe:return p.css(at||(at=U(["\n ","\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n overflow-x: visible;\n min-height: ","px;\n "])),r,sr[t])}},kr=p.css(ot||(ot=U(["\n font-family: ",";\n width: 100%;\n border: none;\n cursor: inherit;\n background-color: inherit;\n color: inherit;\n box-sizing: content-box;\n padding: 0;\n margin: 0;\n text-overflow: ellipsis;\n\n &:placeholder-shown {\n min-width: 100%;\n }\n &:focus {\n outline: none;\n }\n"])),v.fontFamilies.default),wr=(H(st={},_,p.css(lt||(lt=U(["\n &::placeholder {\n color: ",";\n }\n "])),f.palette.gray.dark1)),H(st,Z,p.css(it||(it=U(["\n &::placeholder {\n color: ",";\n }\n "])),f.palette.gray.light1)),st),Cr=(H(dt={},re,p.css(ct||(ct=U(["\n height: ","px;\n font-size: ","px;\n line-height: ","px;\n min-width: ","px;\n padding-left: 4px;\n "])),sr[re],v.typeScales.body1.fontSize,v.typeScales.body1.lineHeight,lr[re])),H(dt,ae,p.css(ut||(ut=U(["\n height: ","px;\n font-size: ","px;\n line-height: ","px;\n min-width: ","px;\n padding-left: 6px;\n "])),sr[ae],v.typeScales.body2.fontSize,v.typeScales.body2.lineHeight,lr[ae])),dt),Sr=function(e,n){return p.cx(H({},p.css(pt||(pt=U(["\n /*\n * Immediate transition in, slow transition out. \n * '-in' transition is handled by `scroll-behavior` \n */\n transition: width ease-in-out ",";\n "],["\n /*\n * Immediate transition in, slow transition out. \n * '-in' transition is handled by \\`scroll-behavior\\` \n */\n transition: width ease-in-out ",";\n "])),e?"0s":"100ms"),n!==le))},jr=function(e,n){var t,r=null!==(t=null==n?void 0:n.length)&&void 0!==t?t:0;return p.css(ft||(ft=U(["\n max-width: 100%;\n width: ","px;\n // TODO: This doesn't quite work. Fix this\n max-width: calc(100% - ","px);\n "])),r*lr[e],2*ur)},Nr=function(e){return"object"===T(e)&&!M.default(e)&&e.length>0?p.css(gt||(gt=U(["\n padding-left: 0px;\n "]))):""},Mr=p.css(bt||(bt=U(["\n // Add a negative margin so the button takes up the same space as the regular icons\n margin-block: calc(","px - 100%);\n"])),ur/2),Or=function(e){return p.css(ht||(ht=U(["\n height: ","px;\n width: ","px;\n margin-inline-end: calc(","px / 2);\n"])),ur,ur,cr[e].x)},Er=(H(vt={},_,p.css(yt||(yt=U(["\n color: ",";\n "])),f.palette.red.base)),H(vt,Z,p.css(xt||(xt=U(["\n color: ",";\n "])),f.palette.red.light1)),vt),zr=(H(wt={},re,p.css(mt||(mt=U(["\n font-size: ","px;\n line-height: ","px;\n padding-top: ","px;\n "])),v.typeScales.body1.fontSize,v.typeScales.body1.lineHeight,cr[re].y)),H(wt,ae,p.css(kt||(kt=U(["\n font-size: ","px;\n line-height: ","px;\n padding-top: ","px;\n "])),v.typeScales.body2.fontSize,v.typeScales.body2.lineHeight,cr[ae].y)),wt),Ir=p.css(Ct||(Ct=U(["\n margin-bottom: 2px;\n"]))),Dr=p.css(Tt||(Tt=U(["\n display: inline-flex;\n align-items: center;\n overflow: hidden;\n white-space: nowrap;\n box-sizing: border-box;\n"]))),Ar=(H(Gt={},re,p.css(Ht||(Ht=U(["\n font-size: ","px;\n line-height: ","px;\n border-radius: 4px;\n "])),v.typeScales.body1.fontSize,v.typeScales.body1.lineHeight)),H(Gt,ae,p.css(Wt||(Wt=U(["\n font-size: ","px;\n line-height: ","px;\n border-radius: 4px;\n "])),v.typeScales.body2.fontSize,v.typeScales.body2.lineHeight)),Gt),Rr=(H(Vt={},_,p.css(Ut||(Ut=U(["\n color: ",";\n background-color: ",";\n\n // TODO: - refine these styles with Design\n &:focus-within {\n background-color: ",";\n }\n "])),f.palette.black,f.palette.gray.light2,f.palette.blue.light2)),H(Vt,Z,p.css(Kt||(Kt=U(["\n color: ",";\n background-color: ",";\n\n &:focus-within {\n background-color: ",";\n }\n "])),f.palette.gray.light2,f.palette.gray.dark2,f.palette.blue.dark2)),Vt),qr=(H(Zt={},_,p.css(Bt||(Bt=U(["\n cursor: not-allowed;\n color: ",";\n background-color: ",";\n "])),f.palette.gray.base,f.palette.gray.light3)),H(Zt,Z,p.css(Xt||(Xt=U(["\n cursor: not-allowed;\n color: ",";\n background-color: ",";\n box-shadow: inset 0 0 1px 1px ","; ;\n "])),f.palette.gray.dark2,f.palette.gray.dark4,f.palette.gray.dark2)),Zt),Pr=(H($t={},re,p.css(_t||(_t=U(["\n padding-inline: 6px;\n padding-block: ","px;\n "])),ir[re])),H($t,ae,p.css(Yt||(Yt=U(["\n padding-inline: 10px;\n padding-block: ","px;\n "])),ir[ae])),$t),Fr=p.css(Jt||(Jt=U(["\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n outline: none;\n border: none;\n background-color: transparent;\n cursor: pointer;\n transition: background-color 100ms ease-in-out;\n"]))),Lr=(H(nr={},_,p.css(Qt||(Qt=U(["\n color: ",";\n\n &:hover {\n color: ",";\n background-color: ",";\n }\n "])),f.palette.gray.dark2,f.palette.black,f.palette.gray.light1)),H(nr,Z,p.css(er||(er=U(["\n color: ",";\n\n &:hover {\n color: ",";\n background-color: ",";\n }\n "])),f.palette.gray.light1,f.palette.gray.light3,f.palette.gray.dark1)),nr),Tr=(H(ar={},_,p.css(tr||(tr=U(["\n cursor: not-allowed;\n color: ",";\n &:hover {\n color: inherit;\n background-color: unset;\n }\n "])),f.palette.gray.dark2)),H(ar,Z,p.css(rr||(rr=U(["\n cursor: not-allowed;\n color: ",";\n &:hover {\n color: inherit;\n background-color: unset;\n }\n "])),f.palette.gray.dark2)),ar),Hr=z.default.forwardRef((function(e,n){var t=e.displayName,r=e.isFocused,a=e.onRemove,o=e.onFocus,l=i.useContext(Ze),s=l.darkMode,c=l.size,u=l.disabled,d=l.chipTruncationLocation,f=void 0===d?"end":d,b=l.chipCharacterLimit,y=void 0===b?12:b,x=_e(s),v=!!y&&!!f&&"none"!==f&&t.length>y,m=i.useRef(null),k=i.useMemo((function(){if(v){var e=y-3;switch(f){case"start":return"…"+t.substring(t.length-e).trim();case"middle":return t.substring(0,e/2).trim()+"…"+t.substring(t.length-e/2).trim();case"end":return t.substring(0,e).trim()+"…";default:return t}}return!1}),[y,f,t,v]);i.useEffect((function(){var e;r&&!u&&(null==m||null===(e=m.current)||void 0===e||e.focus())}),[u,n,r]);return h.jsx("span",{role:"option","aria-selected":r,"data-testid":"lg-combobox-chip",ref:n,className:p.cx(pr,Dr,Rr[x],Ar[c],H({},qr[x],u)),onClick:function(e){var n;null!==(n=m.current)&&void 0!==n&&n.contains(e.target)||o()},onKeyDown:function(e){u||e.keyCode!==g.keyMap.Delete&&e.keyCode!==g.keyMap.Backspace&&e.keyCode!==g.keyMap.Enter&&e.keyCode!==g.keyMap.Space||a()},tabIndex:-1},h.jsx("span",{className:p.cx(Pr[c])},k?h.jsx(P.default,{darkMode:s,definition:t,align:"bottom"},k):t),h.jsx("button",{"aria-label":"Deselect ".concat(t),"aria-disabled":u,disabled:u,ref:m,className:p.cx(Fr,Lr[x],H({},Tr[x],u)),onClick:function(){u||a()}},h.jsx(I.default,{glyph:"X"})))}));Hr.displayName="Chip";var Wr=["children","id","refEl","labelId","menuWidth","searchLoadingMessage","searchErrorMessage","searchEmptyMessage"],Gr=z.default.forwardRef((function(e,n){var t=e.children,r=e.id,a=e.refEl,o=e.labelId,l=e.menuWidth,s=e.searchLoadingMessage,u=e.searchErrorMessage,d=e.searchEmptyMessage,g=G(e,Wr),b=i.useContext(Ze),y=b.disabled,x=b.darkMode,v=b.size,m=b.isOpen,k=b.searchState,w=c.useForwardedRef(n,null),C=_e(x),S=c.useAvailableSpace(a),j=E.default(S)?"unset":"".concat(Math.min(S,256),"px"),N=i.useMemo((function(){var e=p.cx(cn,un[C],dn[v]);switch(k){case"loading":return h.jsx("span",{className:e},h.jsx(I.default,{glyph:"Refresh",color:x?f.palette.blue.light1:f.palette.blue.base,className:jt}),s);case"error":return h.jsx("span",{className:e},h.jsx(I.default,{glyph:"Warning",color:x?f.palette.red.light1:f.palette.red.base}),u);default:return t&&"object"===T(t)&&"length"in t&&t.length>0?h.jsx("ul",{className:sn},t):h.jsx("span",{className:e},d)}}),[C,v,k,x,s,u,t,d]);return h.jsx(F.default,W({active:m&&!y,spacing:4,align:"bottom",justify:"middle",refEl:a,adjustOnMutation:!0,className:p.cx(rn(l),an[C])},g),h.jsx("div",{ref:w,id:r,role:"listbox","aria-labelledby":o,"aria-expanded":m,className:p.cx(on,ln[C],p.css(or||(or=U(["\n max-height: ",";\n "])),j)),onMouseDownCapture:function(e){return e.preventDefault()}},N))}));Gr.displayName="ComboboxMenu";var Ur=["children","label","description","placeholder","aria-label","disabled","size","darkMode","state","errorMessage","searchState","searchEmptyMessage","searchErrorMessage","searchLoadingMessage","filteredOptions","onFilter","clearable","onClear","overflow","multiselect","initialValue","onChange","value","chipTruncationLocation","chipCharacterLimit","className","usePortal","portalClassName","portalContainer","scrollContainer","popoverZIndex"];e.Combobox=function(e){var n,t,r=e.children,a=e.label,o=e.description,l=e.placeholder,u=void 0===l?"Select":l,d=e["aria-label"],b=e.disabled,y=void 0!==b&&b,x=e.size,v=void 0===x?re:x,m=e.darkMode,k=void 0!==m&&m,w=e.state,C=void 0===w?"none":w,A=e.errorMessage,R=e.searchState,q=void 0===R?"unset":R,P=e.searchEmptyMessage,F=void 0===P?"No results found":P,U=e.searchErrorMessage,V=void 0===U?"Could not get results!":U,B=e.searchLoadingMessage,X=void 0===B?"Loading results...":B,Z=e.filteredOptions,_=e.onFilter,ae=e.clearable,oe=void 0===ae||ae,le=e.onClear,ie=e.overflow,ce=void 0===ie?"expand-y":ie,ue=e.multiselect,de=void 0!==ue&&ue,pe=e.initialValue,fe=e.onChange,ge=e.value,be=e.chipTruncationLocation,he=e.chipCharacterLimit,ye=void 0===he?12:he,xe=e.className,ve=e.usePortal,me=void 0===ve||ve,ke=e.portalClassName,we=e.portalContainer,Ce=e.scrollContainer,Se=e.popoverZIndex,je=G(e,Ur),Ne=_e(k),Me=c.useDynamicRefs({prefix:"option"}),Oe=c.useDynamicRefs({prefix:"chip"}),Ee=c.useIdAllocator({prefix:"combobox-input"}),ze=c.useIdAllocator({prefix:"combobox-label"}),Ie=c.useIdAllocator({prefix:"combobox-menu"}),De=i.useRef(null),Ae=i.useRef(null),Re=i.useRef(null),qe=i.useRef(null),Pe=i.useRef(null),Fe=K(i.useState(!1),2),Le=Fe[0],Te=Fe[1],He=c.usePrevious(Le),We=K(i.useState(null),2),Ge=We[0],Ue=We[1],Ye=K(i.useState(null),2),$e=Ye[0],Je=Ye[1],en=c.usePrevious($e),nn=K(i.useState(""),2),tn=nn[0],rn=nn[1],an=c.usePrevious(tn),on=K(i.useState(null),2),ln=on[0],sn=on[1],cn=!M.default($e)&&(j.default($e)&&$e.length>0||O.default($e)),un=de&&j.default($e)&&$e.length>0?void 0:u,dn=function(){return Te(!1)},pn=function(){return Te(!0)},fn=i.useMemo((function(){return Xe(r)}),[r]),gn=i.useCallback((function(e){return!de||"string"!=typeof e&&"number"!=typeof e?!de&&j.default(e)&&g.consoleOnce.error("Error in Combobox: multiselect is set to `false`, but recieved an Array value"):g.consoleOnce.error("Error in Combobox: multiselect is set to `true`, but recieved a ".concat(T(e),' value: "').concat(e,'"')),de&&j.default(e)}),[de]),bn=i.useCallback((function(e){!y&&qe&&qe.current&&(qe.current.focus(),E.default(e)||qe.current.setSelectionRange(e,e))}),[y]),hn=i.useCallback((function(e){if(gn($e)){var n=S.default($e);M.default(e)?n.length=0:$e.includes(e)?n.splice(n.indexOf(e),1):(n.push(e),rn("")),Je(n),null==fe||fe(n)}else{var t=e;Je(t),null==fe||fe(t)}}),[gn,fe,$e]),yn=i.useCallback((function(e){return gn($e)?$e.includes(e):e===$e}),[gn,$e]),xn=i.useCallback((function(e){var n,t,r,a,o=(t=fn,(n=e)?null!==(r=null===(a=t.find((function(e){return e.displayName===n})))||void 0===a?void 0:a.value)&&void 0!==r?r:n:"");return yn(o)}),[fn,yn]),vn=i.useCallback((function(e){var n="string"==typeof e?e:e.value;return Z&&Z.length>0?Z.includes(n):!!xn(tn)||("string"==typeof e?Be(n,fn):e.displayName).toLowerCase().includes(tn.toLowerCase())}),[Z,xn,tn,fn]),mn=i.useMemo((function(){return fn.filter(vn)}),[fn,vn]),kn=i.useCallback((function(e){return!!e&&!!fn.find((function(n){return n.value===e}))}),[fn]),wn=i.useCallback((function(e){return mn?mn.findIndex((function(n){return n.value===e})):-1}),[mn]),Cn=i.useCallback((function(e){if(mn&&mn.length>=e){var n=mn[e];return n?n.value:void 0}}),[mn]),Sn=i.useCallback((function(){return gn($e)?$e.findIndex((function(e){var n,t;return null===(n=Oe(e))||void 0===n||null===(t=n.current)||void 0===t?void 0:t.contains(document.activeElement)})):-1}),[Oe,gn,$e]),jn=K(i.useState(),2),Nn=jn[0],Mn=jn[1],On=i.useCallback((function(e){var n,t=null!==(n=null==mn?void 0:mn.length)&&void 0!==n?n:0,r=t-1>0?t-1:0,a=wn(Ge);switch(e&&Le&&(sn(null),bn()),e){case"next":var o=Cn(a+1<t?a+1:0);Ue(null!=o?o:null);break;case"prev":var l=Cn(a-1>=0?a-1:r);Ue(null!=l?l:null);break;case"last":var i=Cn(r);Ue(null!=i?i:null);break;default:var s=Cn(0);Ue(null!=s?s:null)}}),[Ge,wn,Cn,Le,bn,null==mn?void 0:mn.length]),En=i.useCallback((function(e,n){if(gn($e))switch(e){case"next":var t=null!=n?n:Sn(),r=t+1<$e.length?t+1:$e.length-1,a=$e[r];sn(a);break;case"prev":var o=null!=n?n:Sn(),l=o>0?o-1:o<0?$e.length-1:0,i=$e[l];sn(i);break;case"first":var s=$e[0];sn(s);break;case"last":var c=$e[$e.length-1];sn(c);break;default:sn(null)}}),[Sn,gn,$e]),zn=i.useCallback((function(e,n){switch(e&&Ue(null),e){case"right":switch(Nn){case Y:var t,r,a;if((null===(t=qe.current)||void 0===t?void 0:t.selectionEnd)===(null===(r=qe.current)||void 0===r?void 0:r.value.length))null===(a=Ae.current)||void 0===a||a.focus();break;case J:case ee:case Q:if(Nn===Q||1===(null==$e?void 0:$e.length)){bn(0),En(null),n.preventDefault();break}En("next")}break;case"left":switch(Nn){case $:var o;n.preventDefault(),bn(null==qe||null===(o=qe.current)||void 0===o?void 0:o.value.length);break;case Y:case ee:case Q:if(gn($e)){var l;if(Nn===Y&&0!==(null===(l=qe.current)||void 0===l?void 0:l.selectionStart))break;En("prev")}}break;default:En(null)}}),[Nn,gn,$e,bn,En]);i.useEffect((function(){tn!==an&&On("first")}),[tn,Le,an,On]),i.useEffect((function(){if(Ge){var e=Me(Ge);if(e&&e.current&&Pe.current){var n=e.current.offsetTop,t=Pe.current,r=t.scrollTop;(n>t.offsetHeight||n<r)&&(Pe.current.scrollTop=n)}}}),[Ge,Me]);var In=i.useCallback((function(e){if(g.isComponentType(e,"ComboboxOption")){var n=Ke(e.props),t=n.value,r=n.displayName;if(vn(t)){var a=e.props,o=a.className,l=a.glyph,i=a.disabled,s=fn.findIndex((function(e){return e.value===t})),c=Ge===t,u=gn($e)?$e.includes(t):$e===t,d=Me(t);return h.jsx(Ft,{value:t,displayName:r,isFocused:c,isSelected:u,disabled:i,setSelected:function(){Ue(t),hn(t),bn(),t===$e&&dn()},glyph:l,className:o,index:s,ref:d})}}else if(g.isComponentType(e,"ComboboxGroup")){var p=z.default.Children.map(e.props.children,In);if(p&&(null==p?void 0:p.length)>0)return h.jsx(Qe,{label:e.props.label,className:e.props.className},z.default.Children.map(p,In))}}),[fn,Me,Ge,gn,$e,bn,vn,hn]),Dn=i.useMemo((function(){return z.default.Children.map(r,In)}),[r,In]),An=i.useMemo((function(){if(gn($e))return $e.filter(kn).map((function(e,n){var t=Be(e,fn),r=ln===e,a=Oe(e),o=n>=$e.length-1;return h.jsx(Hr,{key:e,displayName:t,isFocused:r,onRemove:function(){o?(bn(),En(null)):En("next",n),hn(e)},onFocus:function(){sn(e)},ref:a})}))}),[gn,$e,kn,fn,ln,Oe,hn,bn,En]),Rn=i.useMemo((function(){return h.jsx(z.default.Fragment,null,oe&&cn&&h.jsx(D.default,{"aria-label":"Clear selection","aria-disabled":y,disabled:y,ref:Ae,onClick:function(e){y||(hn(null),null==le||le(e),null==_||_(""),Le||pn())},onFocus:Wn,className:p.cx(Mr),darkMode:k},h.jsx(I.default,{glyph:"XWithCircle"})),"error"===C?h.jsx(I.default,{glyph:"Warning",color:k?f.palette.red.light1:f.palette.red.base,className:Or(v)}):h.jsx(I.default,{glyph:"CaretDown",className:Or(v)}))}),[oe,cn,y,C,k,v,hn,le,_,Le]),qn=i.useMemo((function(){return fn.some((function(e){return e.hasGlyph}))}),[fn]),Pn=i.useCallback((function(){if(!gn($e)&&$e===en){var e=mn.find((function(e){return e.displayName===tn||e.value===tn}));if(e&&!ge)Je(e.value);else{var n,t=null!==(n=Be($e,fn))&&void 0!==n?n:"";rn(t)}}}),[fn,tn,gn,en,$e,ge,mn]),Fn=i.useCallback((function(){if(cn){if(gn($e))Vn();else if(!gn($e)){var e,n=null!==(e=Be($e,fn))&&void 0!==e?e:"";rn(n),dn()}}else rn("")}),[cn,fn,gn,$e]);i.useEffect((function(){if(pe)if(j.default(pe)){var e,n=null!==(e=pe.filter((function(e){return kn(e)})))&&void 0!==e?e:[];Je(n)}else kn(pe)&&Je(pe);else Je(function(e){return e?[]:null}(de))}),[]),i.useEffect((function(){if(!E.default(ge)&&ge!==an)if(M.default(ge))Je(null);else if(gn(ge)){var e=ge.filter(kn);Je(e)}else Je(kn(ge)?ge:null)}),[gn,kn,an,ge]),i.useEffect((function(){N.default($e,en)||Fn()}),[Fn,en,$e]),i.useEffect((function(){!Le&&He&&Pn()}),[Le,He,Pn]);var Ln=K(i.useState(0),2),Tn=Ln[0],Hn=Ln[1];i.useEffect((function(){var e,n;Hn(null!==(e=null===(n=De.current)||void 0===n?void 0:n.clientWidth)&&void 0!==e?e:0)}),[De,Le,Ge,$e]);var Wn=function(){Ue(null)};c.useEventListener("mousedown",(function(e){Kn(e)||(e.preventDefault(),e.stopPropagation())}),{enabled:Le}),c.useEventListener("click",(function(e){Kn(e)||(e.stopPropagation(),dn())}),{options:{capture:!0},enabled:Le});var Gn,Un=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{};n%2?L(Object(t),!0).forEach((function(n){H(e,n,t[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}))}return e}({popoverZIndex:Se},me?{usePortal:me,portalClassName:ke,portalContainer:we,scrollContainer:Ce}:{usePortal:me});return h.jsx(Ze.Provider,{value:{multiselect:de,darkMode:k,size:v,withIcons:qn,disabled:y,isOpen:Le,state:C,searchState:q,chipTruncationLocation:be,chipCharacterLimit:ye,inputValue:tn}},h.jsx("div",W({className:p.cx(fr(v,ce),xe)},je),h.jsx("div",{className:Ir},a&&h.jsx(s.Label,{id:ze,htmlFor:Ee,darkMode:k},a),o&&h.jsx(s.Description,{darkMode:k},o)),h.jsx("div",{ref:De,role:"combobox","aria-expanded":Le,"aria-controls":Ie,"aria-owns":Ie,tabIndex:-1,onMouseDown:function(e){y&&e.preventDefault()},onClick:function(e){if(e.target!==qe.current){var n=0;if(qe.current)n=e.nativeEvent.offsetX>qe.current.offsetLeft+qe.current.clientWidth?tn.length:0;bn(n)}},onFocus:function(e){Vn(),pn(),Mn(function(e){var n,t,r,a;if(!e)return;if(null!==(n=qe.current)&&void 0!==n&&n.contains(e))return Y;if(null!==(t=Ae.current)&&void 0!==t&&t.contains(e))return $;var o=gn($e)?$e.findIndex((function(n){var t,r;return null===(t=Oe(n))||void 0===t||null===(r=t.current)||void 0===r?void 0:r.contains(e)})):-1;if(gn($e)){if(0===o)return J;if(o===$e.length-1)return Q;if(o>0)return ee}if(null!==(r=Pe.current)&&void 0!==r&&r.contains(e))return te;if(null!==(a=De.current)&&void 0!==a&&a.contains(e))return ne}(e.target))},onKeyDown:function(e){var n,t,r=null===(n=Pe.current)||void 0===n?void 0:n.contains(document.activeElement);if((null===(t=De.current)||void 0===t?void 0:t.contains(document.activeElement))||r){if(e.ctrlKey||e.shiftKey||e.altKey)return;switch(e.keyCode){case g.keyMap.Tab:switch(Nn){case"Input":cn||(dn(),On("first"),En(null));break;case"LastChip":En(null)}break;case g.keyMap.Escape:dn(),On("first");break;case g.keyMap.Enter:!Le||Nn!==Y||M.default(Ge)||function(e){if("string"==typeof e){var n=Ve(e,fn);return!(null==n||!n.isDisabled)}return!!e.isDisabled}(Ge)?Nn===$&&(hn(null),bn()):hn(Ge);break;case g.keyMap.Backspace:var a;if(gn($e))"Input"===Nn&&0===(null===(a=qe.current)||void 0===a?void 0:a.selectionStart)&&En("last");pn();break;case g.keyMap.ArrowDown:Le?(e.preventDefault(),On("next")):pn();break;case g.keyMap.ArrowUp:Le?(e.preventDefault(),On("prev")):pn();break;case g.keyMap.ArrowRight:zn("right",e);break;case g.keyMap.ArrowLeft:zn("left",e);break;default:Le||pn()}}},onTransitionEnd:function(){var e,n;Hn(null!==(e=null===(n=De.current)||void 0===n?void 0:n.clientWidth)&&void 0!==e?e:0)},className:p.cx(gr,br[Ne],hr(v),(n={},H(n,yr[Ne],y),H(n,xr[Ne],C===se),H(n,vr[Ne],(Gn=Y,Gn===Nn)),n))},h.jsx("div",{ref:Re,className:mr({size:v,overflow:ce})},An,h.jsx("input",{"aria-label":null!=d?d:a,"aria-autocomplete":"list","aria-controls":Ie,"aria-labelledby":ze,ref:qe,id:Ee,className:p.cx(kr,Cr[v],wr[Ne],Sr(Le,ce),(t={},H(t,jr(v,tn),gn($e)),H(t,Nr($e),gn($e)),t)),placeholder:un,disabled:null!=y?y:void 0,onChange:function(e){var n=e.target.value;rn(n),null==_||_(n)},value:tn,autoComplete:"off"})),Rn),"error"===C&&A&&h.jsx("div",{className:p.cx(Er[Ne],zr[v])},A),h.jsx(Gr,W({id:Ie,labelId:ze,refEl:De,ref:Pe,menuWidth:Tn,searchLoadingMessage:X,searchErrorMessage:V,searchEmptyMessage:F},Un),Dn)));function Kn(e){var n,t,r=e.target;return(null===(n=Pe.current)||void 0===n?void 0:n.contains(r))||(null===(t=De.current)||void 0===t?void 0:t.contains(r))||!1}function Vn(){Re&&Re.current&&(Re.current.scrollLeft=Re.current.scrollWidth)}},e.ComboboxGroup=en,e.ComboboxOption=Lt,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
2
|
//# sourceMappingURL=index.js.map
|