react-dropdown-aria
Advanced tools
Comparing version 2.0.3 to 2.0.4
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ /// <reference types="react" /> |
@@ -0,0 +0,0 @@ import React from 'react'; |
@@ -0,0 +0,0 @@ import Dropdown from './components/Dropdown'; |
@@ -16,1 +16,2 @@ import e,{useCallback as t,useState as r,useRef as n,useMemo as o,useEffect as a}from"react"; | ||
***************************************************************************** */var i=function(){return(i=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var c={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function s(e){function t(e,t,n){var o=t.trim().split(h);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var c=0;for(e=0===i?"":e[0]+" ";c<a;++c)t[c]=r(e,t[c],n).trim();break;default:var s=c=0;for(t=[];c<a;++c)for(var l=0;l<i;++l)t[s++]=r(e[l]+" ",o[c],n).trim()}return t}function r(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(b,"$1"+e.trim());case 58:return e.trim()+t.replace(b,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(b,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function n(e,t,r,a){var i=e+";",c=2*t+3*r+4*a;if(944===c){e=i.indexOf(":",9)+1;var s=i.substring(e,i.length-1).trim();return s=i.substring(0,e).trim()+s+";",1===_||2===_&&o(s,1)?"-webkit-"+s+s:s}if(0===_||2===_&&!o(i,1))return i;switch(c){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(A,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(s=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+s+i;case 1005:return p.test(i)?i.replace(d,":-webkit-")+i.replace(d,":-moz-")+i:i;case 1e3:switch(t=(s=i.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=i.replace(w,"tb");break;case 232:s=i.replace(w,"tb-rl");break;case 220:s=i.replace(w,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+s+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,c=(s=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:i=i.replace(s,"-webkit-"+s)+";"+i;break;case 207:case 102:i=i.replace(s,"-webkit-"+(102<c?"inline-":"")+"box")+";"+i.replace(s,"-webkit-"+s)+";"+i.replace(s,"-ms-"+s+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return s=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+s+"-ms-flex-"+s+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(x,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(x,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===y.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?n(e.replace("stretch","fill-available"),t,r,a).replace(":fill-available",":stretch"):i.replace(s,"-webkit-"+s)+i.replace(s,"-moz-"+s.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===r+a&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+i}return i}function o(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),P(2!==t?n:n.replace(E,"$1"),r,t)}function a(e,t){var r=n(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(C," or ($1)").substring(4):"("+t+")"}function i(e,t,r,n,o,a,i,c,l,u){for(var d,p=0,f=t;p<T;++p)switch(d=D[p].call(s,e,f,r,n,o,a,i,c,l,u)){case void 0:case!1:case!0:case null:break;default:f=d}if(f!==t)return f}function c(e){return void 0!==(e=e.prefix)&&(P=null,e?"function"!=typeof e?_=1:(_=2,P=e):_=0),c}function s(e,r){var c=e;if(33>c.charCodeAt(0)&&(c=c.trim()),c=[c],0<T){var s=i(-1,r,c,c,N,O,0,0,0,0);void 0!==s&&"string"==typeof s&&(r=s)}var d=function e(r,c,s,d,p){for(var f,h,b,w,C,x=0,E=0,y=0,A=0,D=0,P=0,W=b=f=0,j=0,G=0,z=0,L=0,V=s.length,$=V-1,B="",F="",U="",H="";j<V;){if(h=s.charCodeAt(j),j===$&&0!==E+A+y+x&&(0!==E&&(h=47===E?10:47),A=y=x=0,V++,$++),0===E+A+y+x){if(j===$&&(0<G&&(B=B.replace(u,"")),0<B.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:B+=s.charAt(j)}h=59}switch(h){case 123:for(f=(B=B.trim()).charCodeAt(0),b=1,L=++j;j<V;){switch(h=s.charCodeAt(j)){case 123:b++;break;case 125:b--;break;case 47:switch(h=s.charCodeAt(j+1)){case 42:case 47:e:{for(W=j+1;W<$;++W)switch(s.charCodeAt(W)){case 47:if(42===h&&42===s.charCodeAt(W-1)&&j+2!==W){j=W+1;break e}break;case 10:if(47===h){j=W+1;break e}}j=W}}break;case 91:h++;case 40:h++;case 34:case 39:for(;j++<$&&s.charCodeAt(j)!==h;);}if(0===b)break;j++}switch(b=s.substring(L,j),0===f&&(f=(B=B.replace(l,"").trim()).charCodeAt(0)),f){case 64:switch(0<G&&(B=B.replace(u,"")),h=B.charCodeAt(1)){case 100:case 109:case 115:case 45:G=c;break;default:G=R}if(L=(b=e(c,G,b,h,p+1)).length,0<T&&(C=i(3,b,G=t(R,B,z),c,N,O,L,h,p,d),B=G.join(""),void 0!==C&&0===(L=(b=C.trim()).length)&&(h=0,b="")),0<L)switch(h){case 115:B=B.replace(k,a);case 100:case 109:case 45:b=B+"{"+b+"}";break;case 107:b=(B=B.replace(m,"$1 $2"))+"{"+b+"}",b=1===_||2===_&&o("@"+b,3)?"@-webkit-"+b+"@"+b:"@"+b;break;default:b=B+b,112===d&&(F+=b,b="")}else b="";break;default:b=e(c,t(c,B,z),b,d,p+1)}U+=b,b=z=G=W=f=0,B="",h=s.charCodeAt(++j);break;case 125:case 59:if(1<(L=(B=(0<G?B.replace(u,""):B).trim()).length))switch(0===W&&(f=B.charCodeAt(0),45===f||96<f&&123>f)&&(L=(B=B.replace(" ",":")).length),0<T&&void 0!==(C=i(1,B,c,r,N,O,F.length,d,p,d))&&0===(L=(B=C.trim()).length)&&(B="\0\0"),f=B.charCodeAt(0),h=B.charCodeAt(1),f){case 0:break;case 64:if(105===h||99===h){H+=B+s.charAt(j);break}default:58!==B.charCodeAt(L-1)&&(F+=n(B,f,h,B.charCodeAt(2)))}z=G=W=f=0,B="",h=s.charCodeAt(++j)}}switch(h){case 13:case 10:47===E?E=0:0===1+f&&107!==d&&0<B.length&&(G=1,B+="\0"),0<T*I&&i(0,B,c,r,N,O,F.length,d,p,d),O=1,N++;break;case 59:case 125:if(0===E+A+y+x){O++;break}default:switch(O++,w=s.charAt(j),h){case 9:case 32:if(0===A+x+E)switch(D){case 44:case 58:case 9:case 32:w="";break;default:32!==h&&(w=" ")}break;case 0:w="\\0";break;case 12:w="\\f";break;case 11:w="\\v";break;case 38:0===A+E+x&&(G=z=1,w="\f"+w);break;case 108:if(0===A+E+x+S&&0<W)switch(j-W){case 2:112===D&&58===s.charCodeAt(j-3)&&(S=D);case 8:111===P&&(S=P)}break;case 58:0===A+E+x&&(W=j);break;case 44:0===E+y+A+x&&(G=1,w+="\r");break;case 34:case 39:0===E&&(A=A===h?0:0===A?h:A);break;case 91:0===A+E+y&&x++;break;case 93:0===A+E+y&&x--;break;case 41:0===A+E+x&&y--;break;case 40:if(0===A+E+x){if(0===f)switch(2*D+3*P){case 533:break;default:f=1}y++}break;case 64:0===E+y+A+x+W+b&&(b=1);break;case 42:case 47:if(!(0<A+x+y))switch(E){case 0:switch(2*h+3*s.charCodeAt(j+1)){case 235:E=47;break;case 220:L=j,E=42}break;case 42:47===h&&42===D&&L+2!==j&&(33===s.charCodeAt(L+2)&&(F+=s.substring(L,j+1)),w="",E=0)}}0===E&&(B+=w)}P=D,D=h,j++}if(0<(L=F.length)){if(G=c,0<T&&(void 0!==(C=i(2,F,G,r,N,O,L,d,p,d))&&0===(F=C).length))return H+F+U;if(F=G.join(",")+"{"+F+"}",0!=_*S){switch(2!==_||o(F,2)||(S=0),S){case 111:F=F.replace(v,":-moz-$1")+F;break;case 112:F=F.replace(g,"::-webkit-input-$1")+F.replace(g,"::-moz-$1")+F.replace(g,":-ms-input-$1")+F}S=0}}return H+F+U}(R,c,r,0,0);return 0<T&&(void 0!==(s=i(-2,d,c,c,N,O,d.length,0,0,0))&&(d=s)),"",S=0,O=N=1,d}var l=/^\0+/g,u=/[\0\r\f]/g,d=/: */g,p=/zoo|gra/,f=/([,: ])(transform)/g,h=/,\r+?/g,b=/([\t\r\n ])*\f?&/g,m=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,v=/:(read-only)/g,w=/[svh]\w+-[tblr]{2}/,k=/\(\s*(.*)\s*\)/g,C=/([\s\S]*?);/g,x=/-self|flex-/g,E=/[^]*?(:[rp][el]a[\w-]+)[^]*/,y=/stretch|:\s*\w+\-(?:conte|avail)/,A=/([^-])(image-set\()/,O=1,N=1,S=0,_=1,R=[],D=[],T=0,P=null,I=0;return s.use=function e(t){switch(t){case void 0:case null:T=D.length=0;break;default:switch(t.constructor){case Array:for(var r=0,n=t.length;r<n;++r)e(t[r]);break;case Function:D[T++]=t;break;case Boolean:I=0|!!t}}return e},s.set=c,void 0!==e&&c(e),s}var l,u,d=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,o,a,i,c,s,l,u,d){switch(r){case 1:if(0===u&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===l)return n+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+n),"";default:return n+(0===d?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}})),p=/[A-Z]|^ms/g,f=(l=function(e){return e.replace(p,"-$&").toLowerCase()},u={},function(e){return void 0===u[e]&&(u[e]=l(e)),u[e]}),h=function(e,t){return null==t||"boolean"==typeof t?"":1===c[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var b=/(attr|calc|counters?|url)\(/,m=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],g=h;h=function(e,t){return"content"===e&&("string"!=typeof t||-1===m.indexOf(t)&&!b.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`"),g(e,t)}}var v=function e(t){for(var r=t.length,n=0,o="";n<r;n++){var a=t[n];if(null!=a){var i=void 0;switch(typeof a){case"boolean":break;case"function":"production"!==process.env.NODE_ENV&&console.error("Passing functions to cx is deprecated and will be removed in the next major version of Emotion.\nPlease call the function before passing it to cx."),i=e([a()]);break;case"object":if(Array.isArray(a))i=e(a);else for(var c in i="",a)a[c]&&c&&(i&&(i+=" "),i+=c);break;default:i=a}i&&(o&&(o+=" "),o+=i)}}return o},w="undefined"!=typeof document;function k(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),(void 0!==e.container?e.container:document.head).appendChild(t),t}var C=function(){function e(e){this.isSpeedy="production"===process.env.NODE_ENV,this.tags=[],this.ctr=0,this.opts=e}var t=e.prototype;return t.inject=function(){if(this.injected)throw new Error("already injected!");this.tags[0]=k(this.opts),this.injected=!0},t.speedy=function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e},t.insert=function(e,t){if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(this.tags[this.tags.length-1]);try{r.insertRule(e,r.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn("illegal rule",e)}}else{var n=k(this.opts);this.tags.push(n),n.appendChild(document.createTextNode(e+(t||"")))}this.ctr++,this.ctr%65e3==0&&this.tags.push(k(this.opts))},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0,this.injected=!1},e}();var x,E,y=function(e,t){if(void 0!==e.__SECRET_EMOTION__)return e.__SECRET_EMOTION__;void 0===t&&(t={});var r,n=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(n))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+n+'" was passed');var o,a=d((function(e){r+=e,w&&c.insert(e,u)}));void 0!==t.prefix&&(o={prefix:t.prefix});var i={registered:{},inserted:{},nonce:t.nonce,key:n},c=new C(t);w&&c.inject();var l=new s(o);l.use(t.stylisPlugins)(a);var u="";function p(e,t){if(null==e)return"";switch(typeof e){case"boolean":return"";case"function":if(void 0!==e.__emotion_styles){var r=e.toString();if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with babel-plugin-emotion.");return r}return void 0===this&&"production"!==process.env.NODE_ENV&&console.error("Interpolating functions in css calls is deprecated and will be removed in the next major version of Emotion.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"),p.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return k.call(this,e);default:var n=i.registered[e];return!1===t&&void 0!==n?n:e}}var b,m,g=new WeakMap;function k(e){if(g.has(e))return g.get(e);var t="";return Array.isArray(e)?e.forEach((function(e){t+=p.call(this,e,!1)}),this):Object.keys(e).forEach((function(r){if("object"!=typeof e[r])void 0!==i.registered[e[r]]?t+=r+"{"+i.registered[e[r]]+"}":t+=f(r)+":"+h(r,e[r])+";";else{if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with babel-plugin-emotion.");Array.isArray(e[r])&&"string"==typeof e[r][0]&&void 0===i.registered[e[r][0]]?e[r].forEach((function(e){t+=f(r)+":"+h(r,e)+";"})):t+=r+"{"+p.call(this,e[r],!1)+"}"}}),this),g.set(e,t),t}var x=/label:\s*([^\s;\n{]+)\s*;/g,E=function(e,t){return function(e){for(var t,r=e.length,n=r^r,o=0;r>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)}(e+t)+t};if("production"!==process.env.NODE_ENV){var y=E,A=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;E=function(e,t){return y(e.replace(A,(function(e){return u=e,""})),t)}}var O=function(e){var t=!0,r="",n="";null==e||void 0===e.raw?(t=!1,r+=p.call(this,e,!1)):r+=e[0];for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return a.forEach((function(n,o){r+=p.call(this,n,46===r.charCodeAt(r.length-1)),!0===t&&void 0!==e[o+1]&&(r+=e[o+1])}),this),m=r,r=r.replace(x,(function(e,t){return n+="-"+t,""})),b=E(r,n),r};if("production"!==process.env.NODE_ENV){var N=l;l=function(e,t){N(e,t),u=""}}function S(e,t){void 0===i.inserted[b]&&(r="",l(e,t),i.inserted[b]=r)}var _=function(){var e=O.apply(this,arguments),t=n+"-"+b;return void 0===i.registered[t]&&(i.registered[t]=m),S("."+t,e),t};function R(e,t){var r="";return t.split(" ").forEach((function(t){void 0!==i.registered[t]?e.push(t):r+=t+" "})),r}function D(e,t){var r=[],n=R(r,e);return r.length<2?e:n+_(r,t)}function T(e){i.inserted[e]=!0}if(w){var P=document.querySelectorAll("[data-emotion-"+n+"]");Array.prototype.forEach.call(P,(function(e){c.tags[0].parentNode.insertBefore(e,c.tags[0]),e.getAttribute("data-emotion-"+n).split(" ").forEach(T)}))}var I={flush:function(){w&&(c.flush(),c.inject()),i.inserted={},i.registered={}},hydrate:function(e){e.forEach(T)},cx:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return D(v(t))},merge:D,getRegisteredStyles:R,injectGlobal:function(){var e=O.apply(this,arguments);S("",e)},keyframes:function(){var e=O.apply(this,arguments),t="animation-"+b;return S("","@keyframes "+t+"{"+e+"}"),t},css:_,sheet:c,caches:i};return e.__SECRET_EMOTION__=I,I}("undefined"!=typeof global?global:{}),A=(y.flush,y.hydrate,y.cx),O=(y.merge,y.getRegisteredStyles,y.injectGlobal,y.keyframes,y.css);y.sheet,y.caches;!function(e){e.Arrow="Arrow",e.DropdownSelector="DropdownSelector",e.DropdownWrapper="DropdownWrapper",e.SelectorSearch="SelectorSearch",e.SelectedValue="SelectedValue",e.Placeholder="Placeholder",e.GroupContainer="GroupContainer",e.GroupDivider="GroupDivider",e.GroupHeading="GroupHeading",e.OptionContainer="OptionContainer",e.OptionItem="OptionItem"}(x||(x={})),function(e){e[e.DOWN_ARROW=40]="DOWN_ARROW",e[e.ENTER=13]="ENTER",e[e.ESCAPE=27]="ESCAPE",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.PAGE_UP=33]="PAGE_UP",e[e.TAB=9]="TAB",e[e.UP_ARROW=38]="UP_ARROW"}(E||(E={}));var N=[E.ESCAPE,E.UP_ARROW,E.DOWN_ARROW,E.PAGE_UP,E.PAGE_DOWN],S={base:"#808080",dark:"#7C7C7C",darker:"#6e6d6d",light:"#CECECE",lighter:"#e0e0e0",lightest:"#f5f5f5"},_={disabled:"#ededed",focused:"#0080bc"},R=e.memo((function(r){var n=r.onOptionClicked,o=r.option,a=r.optionClass,i=r.itemRenderer,c=r.index,s=t((function(e){e.stopPropagation(),n(o,!0)}),[n,o]),l=e.createElement(e.Fragment,null,o.iconClass&&e.createElement("i",{className:o.iconClass+" dropdown-option-icon"}),o.value);return i&&(l=i(r,c)),e.createElement("div",{"aria-label":o.ariaLabel,className:"dropdown-option "+a,onClick:s,tabIndex:-1,title:o.title},l)}));function D(e){return void 0!==e.groupOptions}var T=function(e,t){return D(t)?e.concat(t.groupOptions):e.concat(t)},P=function(e,t){return i(i({},e),{groupOptions:e.groupOptions.filter((function(e){return e.value.toLowerCase().includes(t)}))})},I=function(t){var r=t.children,n=t.className,o=t.dim,a=void 0===o?24:o;return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather "+n},r)},W=function(){return e.createElement(I,{className:"feather-inbox"},e.createElement("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),e.createElement("path",{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}))},j=function(){return e.createElement(I,{className:"feather-chevron-down",dim:16},e.createElement("polyline",{points:"6 9 12 15 18 9"}))},G=function(){return e.createElement(I,{className:"feather-search",dim:16},e.createElement("circle",{cx:"11",cy:"11",r:"8"}),e.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))};function z(t){var r=t.selectedOption,n=t.options,o=t.focusedIndex,a=t.onOptionClicked,i=t.getStyle,c=t.optionItemRenderer;if(t.empty)return e.createElement("div",{className:"dropdown-selector-content--empty"},e.createElement(W,null),"No data");var s=c?function(e,t){return c(e,i,t)}:void 0,l=0,u=n.map((function(t){if(D(t)){var n=t.groupOptions,c=t.label,u=n.map((function(t){var n=t.value===r,c=l===o,u=A(t.className,i(x.OptionItem,{selected:n,focused:c}));return l+=1,e.createElement(R,{key:t.value,optionClass:u,onOptionClicked:a,option:t,itemRenderer:s,index:l-1})}));return u.length?e.createElement("div",{className:i(x.GroupContainer),key:t.label},e.createElement("div",{className:i(x.GroupHeading)},e.createElement("span",null,c.toUpperCase()," | "),e.createElement("span",null,n.length)),u,e.createElement("div",{className:i(x.GroupDivider)})):null}var d=t.value,p=t.className,f=l===o,h=d===r,b=A(p,i(x.OptionItem,{selected:h,focused:f}));return l+=1,e.createElement(R,{key:d,optionClass:b,onOptionClicked:a,option:t,itemRenderer:s,index:l-1})}));return e.createElement(e.Fragment,null,u)}var L=function(e){return{bottom:0,left:"11px",lineHeight:"30px",overflow:"hidden",position:"absolute",right:"25px",textAlign:e.centerText?"center":"left",textOverflow:"ellipsis",top:0,whiteSpace:"nowrap"}},V={Arrow:function(){return{alignItems:"center",bottom:0,color:S.base,display:"flex",position:"absolute",right:"10px",top:0}},DropdownSelector:function(e,t){return{alignItems:"center",boxSizing:"border-box",cursor:t.open&&e.searchable?"text":"inherit",display:"flex",height:"32px",padding:"0 11px",position:"relative",width:"100%",input:{backgroundColor:"inherit",border:"none",fontSize:"inherit",height:"30px",outline:"none",width:"100%"}}},DropdownWrapper:function(e,t){var r=e.width,n=e.height,o=e.disabled,a=t.open,i=t.dropdownFocused;return{backgroundColor:o?S.light:S.lightest,border:"2px solid "+(a||i?_.focused:S.dark),borderRadius:"7",cursor:o?"not-allowed":"pointer",display:"flex",flexDirection:"column",fontSize:"1em",height:n,position:"relative",width:r,"&:hover":{border:"2px solid "+(a||i?_.focused:S.darker)},"&:disabled":{backgroundColor:_.disabled,cursor:"unset"}}},GroupContainer:function(){return{padding:"1em 0 0 0"}},GroupDivider:function(){return{borderBottom:"1px solid "+S.dark,margin:"auto",paddingTop:10,width:"85%"}},GroupHeading:function(){return{color:"grey",display:"flex",flexDirection:"row",fontSize:"0.9em",padding:"0 10px 3px 5px"}},OptionContainer:function(e,t){var r=e.openUp,n=e.maxContentHeight,o=t.open;return{backgroundColor:S.lightest,border:"2px solid "+S.darker,borderRadius:"4px",bottom:r?"105%":void 0,boxShadow:"0px "+(r?"-4px":"4px")+" 4px rgba(0, 0, 0, 0.25)",boxSizing:"border-box",color:"black",display:o?"block":"none",left:"0",listStyleType:"none",margin:"0",maxHeight:n||"175px",overflowX:"hidden",overflowY:"auto",padding:"2px 0",position:"absolute",top:r?void 0:"100%",width:"100%",zIndex:9999,".dropdown-selector-content--empty":{alignItems:"center",color:S.base,display:"flex",flexDirection:"column",justifyContent:"center",padding:"4px 0"},"&::-webkit-scrollbar":{width:"5px"},"&::-webkit-scrollbar-track":{background:"#ddd"},"&::-webkit-scrollbar-thumb":{background:"#666"}}},OptionItem:function(e,t,r){var n=r.selected,o=r.focused,a=S.lightest,i="inherit";return o&&n?(a=S.dark,i=S.lightest):o?a=S.lighter:n&&(a=S.light),{backgroundColor:a,border:"none",color:i,cursor:"pointer",fontSize:"0.95em",overflow:"hidden",padding:"5px 10px",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",display:"flex",alignItems:"center","&:hover":{backgroundColor:n?S.dark:S.light,color:n?S.lightest:void 0},".option-icon":{paddingRight:"5px"}}},Placeholder:function(e){return i({color:S.base},L(e))},SelectedValue:function(e,t){var r=t.open;return i({color:e.value&&!r?"black":S.base},L(e))},SelectorSearch:function(){return{bottom:0,left:"11px",position:"absolute",right:"25px",top:0}}},$={height:0,width:0,overflow:"hidden"},B=function(t,r,n){var o=t.map((function(t,o){return e.createElement("div",{role:"option",id:n+"_list_"+o,key:n+"_list_"+o,"aria-selected":o===r})}));return e.createElement("div",{role:"listbox",id:n+"_list",style:$},o)},F=function(e,n,a){var i=r(""),c=i[0],s=i[1],l=o((function(){return a&&c.trim()?function(e,t){for(var r=[],n=t.toLowerCase(),o=0,a=e;o<a.length;o++){var i=a[o];if(D(i)){var c=P(i,n);c.groupOptions.length>=0&&r.push(c)}else i.value.toLowerCase().includes(n)&&r.push(i)}return r}(n,c):n}),[n,c]),u=t((function(t){s(t),e(0)}),[e,s]);return{searchTerm:c,setSearchTerm:u,filteredOptions:l}},U=function(e,i){var c=e.style,s=e.options,l=e.searchable,u=e.onChange,d=e.disabled,p=e.ariaDescribedBy,f=e.ariaLabel,h=e.ariaLabelledBy,b=e.value,m=e.defaultOpen,g=r(0),v=g[0],w=g[1],k=r(m),C=k[0],x=k[1],E=n(null),y=n(null),A=n(null),N=r(!1),S=N[0],_=N[1],R=F(w,s,l),D=R.searchTerm,P=R.setSearchTerm,I=R.filteredOptions,W=o((function(){return I.reduce(T,[])}),[I]),j=t((function(t,r){var n={focusedIndex:v,open:C,dropdownFocused:S},o=V[t](e,n,r||{}),a=c[t];return O(a?a(o,n,r):o)}),[c,v,C,e,S]),G=t((function(e){void 0===e&&(e=!1),P(""),x(!1),w(0),e&&y.current&&y.current.focus()}),[y.current,P,x,w]),z=t((function(e,t){void 0===t&&(t=!1),e&&(u(e),P("")),t&&G(!0)}),[u,G,P]);!function(e,t){var r=function(r){t.current&&!t.current.contains(r.target)&&e()};a((function(){return document.addEventListener("mouseup",r,!1),document.addEventListener("touchend",r,!1),function(){document.removeEventListener("mouseup",r),document.removeEventListener("touchend",r)}}),[])}(G,E),function(e,t){a((function(){if(t.current&&e>=0){var r=t.current.childNodes;if(r.length){var n=r[e],o=n.getBoundingClientRect().height,a=t.current.getBoundingClientRect().height,i=t.current.scrollTop,c=n.offsetTop<=i;n.offsetTop>=i&&n.offsetTop+o<=i+a||(c?t.current.scrollTo({top:n.offsetTop}):t.current.scrollTo({top:n.offsetTop-a+o+8}))}}}),[e])}(v,A);var L=o((function(){return W.map((function(e){return e.value})).indexOf(b)}),[W,b]),$=o((function(){return{"aria-hidden":d,"aria-expanded":C,"aria-haspopup":"listbox","aria-activedescendant":i+"_list_"+v,"aria-controls":i+"_list","aria-label":f,"aria-labelledby":h,"aria-describedby":p}}),[d,C,i,v,f,h,p]);return{focusedIndex:v,setFocusedIndex:w,open:C,setOpen:x,searchTerm:D,setSearchTerm:P,dropdownFocused:S,setDropdownFocused:_,setValue:z,filteredOptions:I,getStyle:j,closeDropdown:G,flattenedOptions:W,container:E,inputRef:y,listWrapper:A,ariaProps:$,ariaList:B(W,L,i)}},H="undefined"!=typeof window&&window.document&&window.document.documentElement,M="test"!==process.env.NODE_ENV&&H,q=0,K=function(r){var n,a=r.arrowRenderer,c=r.contentClassName,s=r.className,l=r.disabled,u=r.hideArrow,d=r.id,p=r.optionItemRenderer,f=r.pageKeyTraverseSize,h=r.placeholder,b=r.searchable,m=r.value,g=r.selectedValueClassName,v=o((function(){return n||(M?(e=q,q+=1):e="test_or_ssr","react_dropdown_aria_"+e);var e}),[n=d]),w=U(r,v),k=w.getStyle,C=w.open,y=w.setOpen,O=w.focusedIndex,S=w.setFocusedIndex,_=w.setDropdownFocused,R=w.setValue,D=w.closeDropdown,T=w.searchTerm,P=w.setSearchTerm,I=w.filteredOptions,W=w.flattenedOptions,L=w.container,V=w.inputRef,$=w.listWrapper,B=w.ariaProps,F=w.ariaList,H=t((function(){V.current&&V.current.focus()}),[V.current]),K=t((function(){H(),l||C&&b||(S(0),y((function(e){return!e})))}),[C,l,b,y,S]),Y=t((function(e){switch(e){case E.UP_ARROW:S((function(e){return 0===e?W.length-1:e-1}));break;case E.DOWN_ARROW:S((function(e){return(e+1)%W.length}));break;case E.PAGE_UP:S((function(e){return e-f<0&&0!==e?0:e-f<0?W.length-1:e-f}));break;case E.PAGE_DOWN:S((function(e){return e===W.length-1?0:e+f>W.length-1?W.length-1:(e+f)%W.length}));break;case E.ESCAPE:D(!0)}}),[S,W,f,D]),X=t((function(e){var t=e.keyCode;-1!==N.indexOf(t)?(e.preventDefault(),e.stopPropagation(),Y(t)):t!==E.ENTER||C?t!==E.TAB||b?(t===E.TAB||t===E.ENTER)&&W.length>0&&O>=0&&C&&(e.stopPropagation(),e.preventDefault(),R(W[O],!0)):D():y(!0)}),[W,R,O,C,Y,y,b,D]),Z=t((function(e){P(e.target.value)}),[P]),J=t((function(){return _(!0)}),[_]),Q=t((function(){return _(!1)}),[_]),ee=A("dropdown",s,k(x.DropdownWrapper)),te=A("dropdown-selector",k(x.DropdownSelector)),re=A("dropdown-selector-search",k(x.SelectorSearch)),ne=A("dropdown-selector-placeholder",k(x.Placeholder)),oe=A("dropdown-selector-value",g,k(x.SelectedValue)),ae=A("dropdown-selector-content",c,k(x.OptionContainer)),ie=A("dropdown-arrow",k(x.Arrow)),ce=o((function(){if(u)return null;if(a)return e.createElement("div",{className:ie},a(C));var t=C&&b;return e.createElement("div",{className:ie},t&&e.createElement(G,null),!t&&e.createElement(j,null))}),[C,a,ie,b,u]);return e.createElement("div",{id:d,ref:L,className:ee,onFocus:H,onClick:K},e.createElement("div",{className:te},e.createElement("span",{className:re},e.createElement("input",i({id:v,ref:V,value:T,onChange:Z,onKeyDown:X,onFocus:J,onBlur:Q,readOnly:!C||!b,disabled:l,autoComplete:"off",role:"combobox"},B))),!m&&!T&&e.createElement("span",{className:ne},h),m&&!T&&e.createElement("span",{className:oe},m),ce),F,e.createElement("ul",{className:ae,ref:$},e.createElement(z,{selectedOption:m,options:I,focusedIndex:O,onOptionClicked:R,optionItemRenderer:p,getStyle:k,empty:0===W.length})))};K.defaultProps={ariaDescribedBy:null,ariaLabel:null,ariaLabelledBy:null,arrowRenderer:void 0,centerText:!1,className:void 0,contentClassName:null,defaultOpen:!1,disabled:!1,height:null,hideArrow:!1,id:null,maxContentHeight:150,openUp:!1,optionItemRenderer:void 0,options:[],pageKeyTraverseSize:10,placeholder:"Select ...",searchable:!1,selectedValueClassName:null,style:{},value:void 0,width:null};export default K;export{x as StyleKeys}; | ||
//# sourceMappingURL=index.es.js.map |
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("react"),r=(e=t)&&"object"==typeof e&&"default"in e?e.default:e,n=function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};var o={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function a(e){function t(e,t,n){var o=t.trim().split(h);t=o;var a=o.length,i=e.length;switch(i){case 0:case 1:var c=0;for(e=0===i?"":e[0]+" ";c<a;++c)t[c]=r(e,t[c],n).trim();break;default:var s=c=0;for(t=[];c<a;++c)for(var l=0;l<i;++l)t[s++]=r(e[l]+" ",o[c],n).trim()}return t}function r(e,t,r){var n=t.charCodeAt(0);switch(33>n&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(b,"$1"+e.trim());case 58:return e.trim()+t.replace(b,"$1"+e.trim());default:if(0<1*r&&0<t.indexOf("\f"))return t.replace(b,(58===e.charCodeAt(0)?"":"$1")+e.trim())}return e+t}function n(e,t,r,a){var i=e+";",c=2*t+3*r+4*a;if(944===c){e=i.indexOf(":",9)+1;var s=i.substring(e,i.length-1).trim();return s=i.substring(0,e).trim()+s+";",1===_||2===_&&o(s,1)?"-webkit-"+s+s:s}if(0===_||2===_&&!o(i,1))return i;switch(c){case 1015:return 97===i.charCodeAt(10)?"-webkit-"+i+i:i;case 951:return 116===i.charCodeAt(3)?"-webkit-"+i+i:i;case 963:return 110===i.charCodeAt(5)?"-webkit-"+i+i:i;case 1009:if(100!==i.charCodeAt(4))break;case 969:case 942:return"-webkit-"+i+i;case 978:return"-webkit-"+i+"-moz-"+i+i;case 1019:case 983:return"-webkit-"+i+"-moz-"+i+"-ms-"+i+i;case 883:if(45===i.charCodeAt(8))return"-webkit-"+i+i;if(0<i.indexOf("image-set(",11))return i.replace(A,"$1-webkit-$2")+i;break;case 932:if(45===i.charCodeAt(4))switch(i.charCodeAt(5)){case 103:return"-webkit-box-"+i.replace("-grow","")+"-webkit-"+i+"-ms-"+i.replace("grow","positive")+i;case 115:return"-webkit-"+i+"-ms-"+i.replace("shrink","negative")+i;case 98:return"-webkit-"+i+"-ms-"+i.replace("basis","preferred-size")+i}return"-webkit-"+i+"-ms-"+i+i;case 964:return"-webkit-"+i+"-ms-flex-"+i+i;case 1023:if(99!==i.charCodeAt(8))break;return"-webkit-box-pack"+(s=i.substring(i.indexOf(":",15)).replace("flex-","").replace("space-between","justify"))+"-webkit-"+i+"-ms-flex-pack"+s+i;case 1005:return p.test(i)?i.replace(d,":-webkit-")+i.replace(d,":-moz-")+i:i;case 1e3:switch(t=(s=i.substring(13).trim()).indexOf("-")+1,s.charCodeAt(0)+s.charCodeAt(t)){case 226:s=i.replace(w,"tb");break;case 232:s=i.replace(w,"tb-rl");break;case 220:s=i.replace(w,"lr");break;default:return i}return"-webkit-"+i+"-ms-"+s+i;case 1017:if(-1===i.indexOf("sticky",9))break;case 975:switch(t=(i=e).length-10,c=(s=(33===i.charCodeAt(t)?i.substring(0,t):i).substring(e.indexOf(":",7)+1).trim()).charCodeAt(0)+(0|s.charCodeAt(7))){case 203:if(111>s.charCodeAt(8))break;case 115:i=i.replace(s,"-webkit-"+s)+";"+i;break;case 207:case 102:i=i.replace(s,"-webkit-"+(102<c?"inline-":"")+"box")+";"+i.replace(s,"-webkit-"+s)+";"+i.replace(s,"-ms-"+s+"box")+";"+i}return i+";";case 938:if(45===i.charCodeAt(5))switch(i.charCodeAt(6)){case 105:return s=i.replace("-items",""),"-webkit-"+i+"-webkit-box-"+s+"-ms-flex-"+s+i;case 115:return"-webkit-"+i+"-ms-flex-item-"+i.replace(x,"")+i;default:return"-webkit-"+i+"-ms-flex-line-pack"+i.replace("align-content","").replace(x,"")+i}break;case 973:case 989:if(45!==i.charCodeAt(3)||122===i.charCodeAt(4))break;case 931:case 953:if(!0===E.test(e))return 115===(s=e.substring(e.indexOf(":")+1)).charCodeAt(0)?n(e.replace("stretch","fill-available"),t,r,a).replace(":fill-available",":stretch"):i.replace(s,"-webkit-"+s)+i.replace(s,"-moz-"+s.replace("fill-",""))+i;break;case 962:if(i="-webkit-"+i+(102===i.charCodeAt(5)?"-ms-"+i:"")+i,211===r+a&&105===i.charCodeAt(13)&&0<i.indexOf("transform",10))return i.substring(0,i.indexOf(";",27)+1).replace(f,"$1-webkit-$2")+i}return i}function o(e,t){var r=e.indexOf(1===t?":":"{"),n=e.substring(0,3!==t?r:10);return r=e.substring(r+1,e.length-1),P(2!==t?n:n.replace(C,"$1"),r,t)}function a(e,t){var r=n(t,t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2));return r!==t+";"?r.replace(y," or ($1)").substring(4):"("+t+")"}function i(e,t,r,n,o,a,i,c,l,u){for(var d,p=0,f=t;p<T;++p)switch(d=D[p].call(s,e,f,r,n,o,a,i,c,l,u)){case void 0:case!1:case!0:case null:break;default:f=d}if(f!==t)return f}function c(e){return void 0!==(e=e.prefix)&&(P=null,e?"function"!=typeof e?_=1:(_=2,P=e):_=0),c}function s(e,r){var c=e;if(33>c.charCodeAt(0)&&(c=c.trim()),c=[c],0<T){var s=i(-1,r,c,c,S,O,0,0,0,0);void 0!==s&&"string"==typeof s&&(r=s)}var d=function e(r,c,s,d,p){for(var f,h,b,w,y,x=0,C=0,E=0,A=0,D=0,P=0,W=b=f=0,j=0,G=0,z=0,L=0,V=s.length,$=V-1,K="",M="",B="",F="";j<V;){if(h=s.charCodeAt(j),j===$&&0!==C+A+E+x&&(0!==C&&(h=47===C?10:47),A=E=x=0,V++,$++),0===C+A+E+x){if(j===$&&(0<G&&(K=K.replace(u,"")),0<K.trim().length)){switch(h){case 32:case 9:case 59:case 13:case 10:break;default:K+=s.charAt(j)}h=59}switch(h){case 123:for(f=(K=K.trim()).charCodeAt(0),b=1,L=++j;j<V;){switch(h=s.charCodeAt(j)){case 123:b++;break;case 125:b--;break;case 47:switch(h=s.charCodeAt(j+1)){case 42:case 47:e:{for(W=j+1;W<$;++W)switch(s.charCodeAt(W)){case 47:if(42===h&&42===s.charCodeAt(W-1)&&j+2!==W){j=W+1;break e}break;case 10:if(47===h){j=W+1;break e}}j=W}}break;case 91:h++;case 40:h++;case 34:case 39:for(;j++<$&&s.charCodeAt(j)!==h;);}if(0===b)break;j++}switch(b=s.substring(L,j),0===f&&(f=(K=K.replace(l,"").trim()).charCodeAt(0)),f){case 64:switch(0<G&&(K=K.replace(u,"")),h=K.charCodeAt(1)){case 100:case 109:case 115:case 45:G=c;break;default:G=R}if(L=(b=e(c,G,b,h,p+1)).length,0<T&&(y=i(3,b,G=t(R,K,z),c,S,O,L,h,p,d),K=G.join(""),void 0!==y&&0===(L=(b=y.trim()).length)&&(h=0,b="")),0<L)switch(h){case 115:K=K.replace(k,a);case 100:case 109:case 45:b=K+"{"+b+"}";break;case 107:b=(K=K.replace(m,"$1 $2"))+"{"+b+"}",b=1===_||2===_&&o("@"+b,3)?"@-webkit-"+b+"@"+b:"@"+b;break;default:b=K+b,112===d&&(M+=b,b="")}else b="";break;default:b=e(c,t(c,K,z),b,d,p+1)}B+=b,b=z=G=W=f=0,K="",h=s.charCodeAt(++j);break;case 125:case 59:if(1<(L=(K=(0<G?K.replace(u,""):K).trim()).length))switch(0===W&&(f=K.charCodeAt(0),45===f||96<f&&123>f)&&(L=(K=K.replace(" ",":")).length),0<T&&void 0!==(y=i(1,K,c,r,S,O,M.length,d,p,d))&&0===(L=(K=y.trim()).length)&&(K="\0\0"),f=K.charCodeAt(0),h=K.charCodeAt(1),f){case 0:break;case 64:if(105===h||99===h){F+=K+s.charAt(j);break}default:58!==K.charCodeAt(L-1)&&(M+=n(K,f,h,K.charCodeAt(2)))}z=G=W=f=0,K="",h=s.charCodeAt(++j)}}switch(h){case 13:case 10:47===C?C=0:0===1+f&&107!==d&&0<K.length&&(G=1,K+="\0"),0<T*I&&i(0,K,c,r,S,O,M.length,d,p,d),O=1,S++;break;case 59:case 125:if(0===C+A+E+x){O++;break}default:switch(O++,w=s.charAt(j),h){case 9:case 32:if(0===A+x+C)switch(D){case 44:case 58:case 9:case 32:w="";break;default:32!==h&&(w=" ")}break;case 0:w="\\0";break;case 12:w="\\f";break;case 11:w="\\v";break;case 38:0===A+C+x&&(G=z=1,w="\f"+w);break;case 108:if(0===A+C+x+N&&0<W)switch(j-W){case 2:112===D&&58===s.charCodeAt(j-3)&&(N=D);case 8:111===P&&(N=P)}break;case 58:0===A+C+x&&(W=j);break;case 44:0===C+E+A+x&&(G=1,w+="\r");break;case 34:case 39:0===C&&(A=A===h?0:0===A?h:A);break;case 91:0===A+C+E&&x++;break;case 93:0===A+C+E&&x--;break;case 41:0===A+C+x&&E--;break;case 40:if(0===A+C+x){if(0===f)switch(2*D+3*P){case 533:break;default:f=1}E++}break;case 64:0===C+E+A+x+W+b&&(b=1);break;case 42:case 47:if(!(0<A+x+E))switch(C){case 0:switch(2*h+3*s.charCodeAt(j+1)){case 235:C=47;break;case 220:L=j,C=42}break;case 42:47===h&&42===D&&L+2!==j&&(33===s.charCodeAt(L+2)&&(M+=s.substring(L,j+1)),w="",C=0)}}0===C&&(K+=w)}P=D,D=h,j++}if(0<(L=M.length)){if(G=c,0<T&&(void 0!==(y=i(2,M,G,r,S,O,L,d,p,d))&&0===(M=y).length))return F+M+B;if(M=G.join(",")+"{"+M+"}",0!=_*N){switch(2!==_||o(M,2)||(N=0),N){case 111:M=M.replace(v,":-moz-$1")+M;break;case 112:M=M.replace(g,"::-webkit-input-$1")+M.replace(g,"::-moz-$1")+M.replace(g,":-ms-input-$1")+M}N=0}}return F+M+B}(R,c,r,0,0);return 0<T&&(void 0!==(s=i(-2,d,c,c,S,O,d.length,0,0,0))&&(d=s)),"",N=0,O=S=1,d}var l=/^\0+/g,u=/[\0\r\f]/g,d=/: */g,p=/zoo|gra/,f=/([,: ])(transform)/g,h=/,\r+?/g,b=/([\t\r\n ])*\f?&/g,m=/@(k\w+)\s*(\S*)\s*/,g=/::(place)/g,v=/:(read-only)/g,w=/[svh]\w+-[tblr]{2}/,k=/\(\s*(.*)\s*\)/g,y=/([\s\S]*?);/g,x=/-self|flex-/g,C=/[^]*?(:[rp][el]a[\w-]+)[^]*/,E=/stretch|:\s*\w+\-(?:conte|avail)/,A=/([^-])(image-set\()/,O=1,S=1,N=0,_=1,R=[],D=[],T=0,P=null,I=0;return s.use=function e(t){switch(t){case void 0:case null:T=D.length=0;break;default:switch(t.constructor){case Array:for(var r=0,n=t.length;r<n;++r)e(t[r]);break;case Function:D[T++]=t;break;case Boolean:I=0|!!t}}return e},s.set=c,void 0!==e&&c(e),s}var i,c,s=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,o,a,i,c,s,l,u,d){switch(r){case 1:if(0===u&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===l)return n+"/*|*/";break;case 3:switch(l){case 102:case 112:return e(o[0]+n),"";default:return n+(0===d?"/*|*/":"")}case-2:n.split("/*|*/}").forEach(t)}}}})),l=/[A-Z]|^ms/g,u=(i=function(e){return e.replace(l,"-$&").toLowerCase()},c={},function(e){return void 0===c[e]&&(c[e]=i(e)),c[e]}),d=function(e,t){return null==t||"boolean"==typeof t?"":1===o[e]||45===e.charCodeAt(1)||isNaN(t)||0===t?t:t+"px"};if("production"!==process.env.NODE_ENV){var p=/(attr|calc|counters?|url)\(/,f=["normal","none","counter","open-quote","close-quote","no-open-quote","no-close-quote","initial","inherit","unset"],h=d;d=function(e,t){return"content"===e&&("string"!=typeof t||-1===f.indexOf(t)&&!p.test(t)&&(t.charAt(0)!==t.charAt(t.length-1)||'"'!==t.charAt(0)&&"'"!==t.charAt(0)))&&console.error("You seem to be using a value for 'content' without quotes, try replacing it with `content: '\""+t+"\"'`"),h(e,t)}}var b=function e(t){for(var r=t.length,n=0,o="";n<r;n++){var a=t[n];if(null!=a){var i=void 0;switch(typeof a){case"boolean":break;case"function":"production"!==process.env.NODE_ENV&&console.error("Passing functions to cx is deprecated and will be removed in the next major version of Emotion.\nPlease call the function before passing it to cx."),i=e([a()]);break;case"object":if(Array.isArray(a))i=e(a);else for(var c in i="",a)a[c]&&c&&(i&&(i+=" "),i+=c);break;default:i=a}i&&(o&&(o+=" "),o+=i)}}return o},m="undefined"!=typeof document;function g(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key||""),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),(void 0!==e.container?e.container:document.head).appendChild(t),t}var v=function(){function e(e){this.isSpeedy="production"===process.env.NODE_ENV,this.tags=[],this.ctr=0,this.opts=e}var t=e.prototype;return t.inject=function(){if(this.injected)throw new Error("already injected!");this.tags[0]=g(this.opts),this.injected=!0},t.speedy=function(e){if(0!==this.ctr)throw new Error("cannot change speedy now");this.isSpeedy=!!e},t.insert=function(e,t){if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(this.tags[this.tags.length-1]);try{r.insertRule(e,r.cssRules.length)}catch(t){"production"!==process.env.NODE_ENV&&console.warn("illegal rule",e)}}else{var n=g(this.opts);this.tags.push(n),n.appendChild(document.createTextNode(e+(t||"")))}this.ctr++,this.ctr%65e3==0&&this.tags.push(g(this.opts))},t.flush=function(){this.tags.forEach((function(e){return e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0,this.injected=!1},e}();var w,k,y=function(e,t){if(void 0!==e.__SECRET_EMOTION__)return e.__SECRET_EMOTION__;void 0===t&&(t={});var r,n=t.key||"css";if("production"!==process.env.NODE_ENV&&/[^a-z-]/.test(n))throw new Error('Emotion key must only contain lower case alphabetical characters and - but "'+n+'" was passed');var o,i=s((function(e){r+=e,m&&l.insert(e,f)}));void 0!==t.prefix&&(o={prefix:t.prefix});var c={registered:{},inserted:{},nonce:t.nonce,key:n},l=new v(t);m&&l.inject();var p=new a(o);p.use(t.stylisPlugins)(i);var f="";function h(e,t){if(null==e)return"";switch(typeof e){case"boolean":return"";case"function":if(void 0!==e.__emotion_styles){var r=e.toString();if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with babel-plugin-emotion.");return r}return void 0===this&&"production"!==process.env.NODE_ENV&&console.error("Interpolating functions in css calls is deprecated and will be removed in the next major version of Emotion.\nIf you want to have a css call based on props, create a function that returns a css call like this\nlet dynamicStyle = (props) => css`color: ${props.color}`\nIt can be called directly with props or interpolated in a styled call like this\nlet SomeComponent = styled('div')`${dynamicStyle}`"),h.call(this,void 0===this?e():e(this.mergedProps,this.context),t);case"object":return y.call(this,e);default:var n=c.registered[e];return!1===t&&void 0!==n?n:e}}var g,w,k=new WeakMap;function y(e){if(k.has(e))return k.get(e);var t="";return Array.isArray(e)?e.forEach((function(e){t+=h.call(this,e,!1)}),this):Object.keys(e).forEach((function(r){if("object"!=typeof e[r])void 0!==c.registered[e[r]]?t+=r+"{"+c.registered[e[r]]+"}":t+=u(r)+":"+d(r,e[r])+";";else{if("NO_COMPONENT_SELECTOR"===r&&"production"!==process.env.NODE_ENV)throw new Error("Component selectors can only be used in conjunction with babel-plugin-emotion.");Array.isArray(e[r])&&"string"==typeof e[r][0]&&void 0===c.registered[e[r][0]]?e[r].forEach((function(e){t+=u(r)+":"+d(r,e)+";"})):t+=r+"{"+h.call(this,e[r],!1)+"}"}}),this),k.set(e,t),t}var x=/label:\s*([^\s;\n{]+)\s*;/g,C=function(e,t){return function(e){for(var t,r=e.length,n=r^r,o=0;r>=4;)t=1540483477*(65535&(t=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(t>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(t=1540483477*(65535&(t^=t>>>24))+((1540483477*(t>>>16)&65535)<<16)),r-=4,++o;switch(r){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),((n^=n>>>15)>>>0).toString(36)}(e+t)+t};if("production"!==process.env.NODE_ENV){var E=C,A=/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g;C=function(e,t){return E(e.replace(A,(function(e){return f=e,""})),t)}}var O=function(e){var t=!0,r="",n="";null==e||void 0===e.raw?(t=!1,r+=h.call(this,e,!1)):r+=e[0];for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return a.forEach((function(n,o){r+=h.call(this,n,46===r.charCodeAt(r.length-1)),!0===t&&void 0!==e[o+1]&&(r+=e[o+1])}),this),w=r,r=r.replace(x,(function(e,t){return n+="-"+t,""})),g=C(r,n),r};if("production"!==process.env.NODE_ENV){var S=p;p=function(e,t){S(e,t),f=""}}function N(e,t){void 0===c.inserted[g]&&(r="",p(e,t),c.inserted[g]=r)}var _=function(){var e=O.apply(this,arguments),t=n+"-"+g;return void 0===c.registered[t]&&(c.registered[t]=w),N("."+t,e),t};function R(e,t){var r="";return t.split(" ").forEach((function(t){void 0!==c.registered[t]?e.push(t):r+=t+" "})),r}function D(e,t){var r=[],n=R(r,e);return r.length<2?e:n+_(r,t)}function T(e){c.inserted[e]=!0}if(m){var P=document.querySelectorAll("[data-emotion-"+n+"]");Array.prototype.forEach.call(P,(function(e){l.tags[0].parentNode.insertBefore(e,l.tags[0]),e.getAttribute("data-emotion-"+n).split(" ").forEach(T)}))}var I={flush:function(){m&&(l.flush(),l.inject()),c.inserted={},c.registered={}},hydrate:function(e){e.forEach(T)},cx:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return D(b(t))},merge:D,getRegisteredStyles:R,injectGlobal:function(){var e=O.apply(this,arguments);N("",e)},keyframes:function(){var e=O.apply(this,arguments),t="animation-"+g;return N("","@keyframes "+t+"{"+e+"}"),t},css:_,sheet:l,caches:c};return e.__SECRET_EMOTION__=I,I}("undefined"!=typeof global?global:{}),x=(y.flush,y.hydrate,y.cx),C=(y.merge,y.getRegisteredStyles,y.injectGlobal,y.keyframes,y.css);y.sheet,y.caches;(w=exports.StyleKeys||(exports.StyleKeys={})).Arrow="Arrow",w.DropdownSelector="DropdownSelector",w.DropdownWrapper="DropdownWrapper",w.SelectorSearch="SelectorSearch",w.SelectedValue="SelectedValue",w.Placeholder="Placeholder",w.GroupContainer="GroupContainer",w.GroupDivider="GroupDivider",w.GroupHeading="GroupHeading",w.OptionContainer="OptionContainer",w.OptionItem="OptionItem",function(e){e[e.DOWN_ARROW=40]="DOWN_ARROW",e[e.ENTER=13]="ENTER",e[e.ESCAPE=27]="ESCAPE",e[e.PAGE_DOWN=34]="PAGE_DOWN",e[e.PAGE_UP=33]="PAGE_UP",e[e.TAB=9]="TAB",e[e.UP_ARROW=38]="UP_ARROW"}(k||(k={}));var E=[k.ESCAPE,k.UP_ARROW,k.DOWN_ARROW,k.PAGE_UP,k.PAGE_DOWN],A={base:"#808080",dark:"#7C7C7C",darker:"#6e6d6d",light:"#CECECE",lighter:"#e0e0e0",lightest:"#f5f5f5"},O={disabled:"#ededed",focused:"#0080bc"},S=r.memo((function(e){var n=e.onOptionClicked,o=e.option,a=e.optionClass,i=e.itemRenderer,c=e.index,s=t.useCallback((function(e){e.stopPropagation(),n(o,!0)}),[n,o]),l=r.createElement(r.Fragment,null,o.iconClass&&r.createElement("i",{className:o.iconClass+" dropdown-option-icon"}),o.value);return i&&(l=i(e,c)),r.createElement("div",{"aria-label":o.ariaLabel,className:"dropdown-option "+a,onClick:s,tabIndex:-1,title:o.title},l)}));function N(e){return void 0!==e.groupOptions}var _=function(e,t){return N(t)?e.concat(t.groupOptions):e.concat(t)},R=function(e,t){return n(n({},e),{groupOptions:e.groupOptions.filter((function(e){return e.value.toLowerCase().includes(t)}))})},D=function(e){var t=e.children,n=e.className,o=e.dim,a=void 0===o?24:o;return r.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:a,height:a,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather "+n},t)},T=function(){return r.createElement(D,{className:"feather-inbox"},r.createElement("polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12"}),r.createElement("path",{d:"M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"}))},P=function(){return r.createElement(D,{className:"feather-chevron-down",dim:16},r.createElement("polyline",{points:"6 9 12 15 18 9"}))},I=function(){return r.createElement(D,{className:"feather-search",dim:16},r.createElement("circle",{cx:"11",cy:"11",r:"8"}),r.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))};function W(e){var t=e.selectedOption,n=e.options,o=e.focusedIndex,a=e.onOptionClicked,i=e.getStyle,c=e.optionItemRenderer;if(e.empty)return r.createElement("div",{className:"dropdown-selector-content--empty"},r.createElement(T,null),"No data");var s=c?function(e,t){return c(e,i,t)}:void 0,l=0,u=n.map((function(e){if(N(e)){var n=e.groupOptions,c=e.label,u=n.map((function(e){var n=e.value===t,c=l===o,u=x(e.className,i(exports.StyleKeys.OptionItem,{selected:n,focused:c}));return l+=1,r.createElement(S,{key:e.value,optionClass:u,onOptionClicked:a,option:e,itemRenderer:s,index:l-1})}));return u.length?r.createElement("div",{className:i(exports.StyleKeys.GroupContainer),key:e.label},r.createElement("div",{className:i(exports.StyleKeys.GroupHeading)},r.createElement("span",null,c.toUpperCase()," | "),r.createElement("span",null,n.length)),u,r.createElement("div",{className:i(exports.StyleKeys.GroupDivider)})):null}var d=e.value,p=e.className,f=l===o,h=d===t,b=x(p,i(exports.StyleKeys.OptionItem,{selected:h,focused:f}));return l+=1,r.createElement(S,{key:d,optionClass:b,onOptionClicked:a,option:e,itemRenderer:s,index:l-1})}));return r.createElement(r.Fragment,null,u)}var j=function(e){return{bottom:0,left:"11px",lineHeight:"30px",overflow:"hidden",position:"absolute",right:"25px",textAlign:e.centerText?"center":"left",textOverflow:"ellipsis",top:0,whiteSpace:"nowrap"}},G={Arrow:function(){return{alignItems:"center",bottom:0,color:A.base,display:"flex",position:"absolute",right:"10px",top:0}},DropdownSelector:function(e,t){return{alignItems:"center",boxSizing:"border-box",cursor:t.open&&e.searchable?"text":"inherit",display:"flex",height:"32px",padding:"0 11px",position:"relative",width:"100%",input:{backgroundColor:"inherit",border:"none",fontSize:"inherit",height:"30px",outline:"none",width:"100%"}}},DropdownWrapper:function(e,t){var r=e.width,n=e.height,o=e.disabled,a=t.open,i=t.dropdownFocused;return{backgroundColor:o?A.light:A.lightest,border:"2px solid "+(a||i?O.focused:A.dark),borderRadius:"7",cursor:o?"not-allowed":"pointer",display:"flex",flexDirection:"column",fontSize:"1em",height:n,position:"relative",width:r,"&:hover":{border:"2px solid "+(a||i?O.focused:A.darker)},"&:disabled":{backgroundColor:O.disabled,cursor:"unset"}}},GroupContainer:function(){return{padding:"1em 0 0 0"}},GroupDivider:function(){return{borderBottom:"1px solid "+A.dark,margin:"auto",paddingTop:10,width:"85%"}},GroupHeading:function(){return{color:"grey",display:"flex",flexDirection:"row",fontSize:"0.9em",padding:"0 10px 3px 5px"}},OptionContainer:function(e,t){var r=e.openUp,n=e.maxContentHeight,o=t.open;return{backgroundColor:A.lightest,border:"2px solid "+A.darker,borderRadius:"4px",bottom:r?"105%":void 0,boxShadow:"0px "+(r?"-4px":"4px")+" 4px rgba(0, 0, 0, 0.25)",boxSizing:"border-box",color:"black",display:o?"block":"none",left:"0",listStyleType:"none",margin:"0",maxHeight:n||"175px",overflowX:"hidden",overflowY:"auto",padding:"2px 0",position:"absolute",top:r?void 0:"100%",width:"100%",zIndex:9999,".dropdown-selector-content--empty":{alignItems:"center",color:A.base,display:"flex",flexDirection:"column",justifyContent:"center",padding:"4px 0"},"&::-webkit-scrollbar":{width:"5px"},"&::-webkit-scrollbar-track":{background:"#ddd"},"&::-webkit-scrollbar-thumb":{background:"#666"}}},OptionItem:function(e,t,r){var n=r.selected,o=r.focused,a=A.lightest,i="inherit";return o&&n?(a=A.dark,i=A.lightest):o?a=A.lighter:n&&(a=A.light),{backgroundColor:a,border:"none",color:i,cursor:"pointer",fontSize:"0.95em",overflow:"hidden",padding:"5px 10px",textOverflow:"ellipsis",whiteSpace:"nowrap",width:"100%",display:"flex",alignItems:"center","&:hover":{backgroundColor:n?A.dark:A.light,color:n?A.lightest:void 0},".option-icon":{paddingRight:"5px"}}},Placeholder:function(e){return n({color:A.base},j(e))},SelectedValue:function(e,t){var r=t.open;return n({color:e.value&&!r?"black":A.base},j(e))},SelectorSearch:function(){return{bottom:0,left:"11px",position:"absolute",right:"25px",top:0}}},z={height:0,width:0,overflow:"hidden"},L=function(e,t,n){var o=e.map((function(e,o){return r.createElement("div",{role:"option",id:n+"_list_"+o,key:n+"_list_"+o,"aria-selected":o===t})}));return r.createElement("div",{role:"listbox",id:n+"_list",style:z},o)},V=function(e,r,n){var o=t.useState(""),a=o[0],i=o[1],c=t.useMemo((function(){return n&&a.trim()?function(e,t){for(var r=[],n=t.toLowerCase(),o=0,a=e;o<a.length;o++){var i=a[o];if(N(i)){var c=R(i,n);c.groupOptions.length>=0&&r.push(c)}else i.value.toLowerCase().includes(n)&&r.push(i)}return r}(r,a):r}),[r,a]),s=t.useCallback((function(t){i(t),e(0)}),[e,i]);return{searchTerm:a,setSearchTerm:s,filteredOptions:c}},$=function(e,r){var n=e.style,o=e.options,a=e.searchable,i=e.onChange,c=e.disabled,s=e.ariaDescribedBy,l=e.ariaLabel,u=e.ariaLabelledBy,d=e.value,p=e.defaultOpen,f=t.useState(0),h=f[0],b=f[1],m=t.useState(p),g=m[0],v=m[1],w=t.useRef(null),k=t.useRef(null),y=t.useRef(null),x=t.useState(!1),E=x[0],A=x[1],O=V(b,o,a),S=O.searchTerm,N=O.setSearchTerm,R=O.filteredOptions,D=t.useMemo((function(){return R.reduce(_,[])}),[R]),T=t.useCallback((function(t,r){var o={focusedIndex:h,open:g,dropdownFocused:E},a=G[t](e,o,r||{}),i=n[t];return C(i?i(a,o,r):a)}),[n,h,g,e,E]),P=t.useCallback((function(e){void 0===e&&(e=!1),N(""),v(!1),b(0),e&&k.current&&k.current.focus()}),[k.current,N,v,b]),I=t.useCallback((function(e,t){void 0===t&&(t=!1),e&&(i(e),N("")),t&&P(!0)}),[i,P,N]);!function(e,r){var n=function(t){r.current&&!r.current.contains(t.target)&&e()};t.useEffect((function(){return document.addEventListener("mouseup",n,!1),document.addEventListener("touchend",n,!1),function(){document.removeEventListener("mouseup",n),document.removeEventListener("touchend",n)}}),[])}(P,w),function(e,r){t.useEffect((function(){if(r.current&&e>=0){var t=r.current.childNodes;if(t.length){var n=t[e],o=n.getBoundingClientRect().height,a=r.current.getBoundingClientRect().height,i=r.current.scrollTop,c=n.offsetTop<=i;n.offsetTop>=i&&n.offsetTop+o<=i+a||(c?r.current.scrollTo({top:n.offsetTop}):r.current.scrollTo({top:n.offsetTop-a+o+8}))}}}),[e])}(h,y);var W=t.useMemo((function(){return D.map((function(e){return e.value})).indexOf(d)}),[D,d]),j=t.useMemo((function(){return{"aria-hidden":c,"aria-expanded":g,"aria-haspopup":"listbox","aria-activedescendant":r+"_list_"+h,"aria-controls":r+"_list","aria-label":l,"aria-labelledby":u,"aria-describedby":s}}),[c,g,r,h,l,u,s]);return{focusedIndex:h,setFocusedIndex:b,open:g,setOpen:v,searchTerm:S,setSearchTerm:N,dropdownFocused:E,setDropdownFocused:A,setValue:I,filteredOptions:R,getStyle:T,closeDropdown:P,flattenedOptions:D,container:w,inputRef:k,listWrapper:y,ariaProps:j,ariaList:L(D,W,r)}},K="undefined"!=typeof window&&window.document&&window.document.documentElement,M="test"!==process.env.NODE_ENV&&K,B=0,F=function(e){var o,a=e.arrowRenderer,i=e.contentClassName,c=e.className,s=e.disabled,l=e.hideArrow,u=e.id,d=e.optionItemRenderer,p=e.pageKeyTraverseSize,f=e.placeholder,h=e.searchable,b=e.value,m=e.selectedValueClassName,g=(o=u,t.useMemo((function(){return o||(M?(e=B,B+=1):e="test_or_ssr","react_dropdown_aria_"+e);var e}),[o])),v=$(e,g),w=v.getStyle,y=v.open,C=v.setOpen,A=v.focusedIndex,O=v.setFocusedIndex,S=v.setDropdownFocused,N=v.setValue,_=v.closeDropdown,R=v.searchTerm,D=v.setSearchTerm,T=v.filteredOptions,j=v.flattenedOptions,G=v.container,z=v.inputRef,L=v.listWrapper,V=v.ariaProps,K=v.ariaList,F=t.useCallback((function(){z.current&&z.current.focus()}),[z.current]),U=t.useCallback((function(){F(),s||y&&h||(O(0),C((function(e){return!e})))}),[y,s,h,C,O]),H=t.useCallback((function(e){switch(e){case k.UP_ARROW:O((function(e){return 0===e?j.length-1:e-1}));break;case k.DOWN_ARROW:O((function(e){return(e+1)%j.length}));break;case k.PAGE_UP:O((function(e){return e-p<0&&0!==e?0:e-p<0?j.length-1:e-p}));break;case k.PAGE_DOWN:O((function(e){return e===j.length-1?0:e+p>j.length-1?j.length-1:(e+p)%j.length}));break;case k.ESCAPE:_(!0)}}),[O,j,p,_]),q=t.useCallback((function(e){var t=e.keyCode;-1!==E.indexOf(t)?(e.preventDefault(),e.stopPropagation(),H(t)):t!==k.ENTER||y?t!==k.TAB||h?(t===k.TAB||t===k.ENTER)&&j.length>0&&A>=0&&y&&(e.stopPropagation(),e.preventDefault(),N(j[A],!0)):_():C(!0)}),[j,N,A,y,H,C,h,_]),Y=t.useCallback((function(e){D(e.target.value)}),[D]),X=t.useCallback((function(){return S(!0)}),[S]),Z=t.useCallback((function(){return S(!1)}),[S]),J=x("dropdown",c,w(exports.StyleKeys.DropdownWrapper)),Q=x("dropdown-selector",w(exports.StyleKeys.DropdownSelector)),ee=x("dropdown-selector-search",w(exports.StyleKeys.SelectorSearch)),te=x("dropdown-selector-placeholder",w(exports.StyleKeys.Placeholder)),re=x("dropdown-selector-value",m,w(exports.StyleKeys.SelectedValue)),ne=x("dropdown-selector-content",i,w(exports.StyleKeys.OptionContainer)),oe=x("dropdown-arrow",w(exports.StyleKeys.Arrow)),ae=t.useMemo((function(){if(l)return null;if(a)return r.createElement("div",{className:oe},a(y));var e=y&&h;return r.createElement("div",{className:oe},e&&r.createElement(I,null),!e&&r.createElement(P,null))}),[y,a,oe,h,l]);return r.createElement("div",{id:u,ref:G,className:J,onFocus:F,onClick:U},r.createElement("div",{className:Q},r.createElement("span",{className:ee},r.createElement("input",n({id:g,ref:z,value:R,onChange:Y,onKeyDown:q,onFocus:X,onBlur:Z,readOnly:!y||!h,disabled:s,autoComplete:"off",role:"combobox"},V))),!b&&!R&&r.createElement("span",{className:te},f),b&&!R&&r.createElement("span",{className:re},b),ae),K,r.createElement("ul",{className:ne,ref:L},r.createElement(W,{selectedOption:b,options:T,focusedIndex:A,onOptionClicked:N,optionItemRenderer:d,getStyle:w,empty:0===j.length})))};F.defaultProps={ariaDescribedBy:null,ariaLabel:null,ariaLabelledBy:null,arrowRenderer:void 0,centerText:!1,className:void 0,contentClassName:null,defaultOpen:!1,disabled:!1,height:null,hideArrow:!1,id:null,maxContentHeight:150,openUp:!1,optionItemRenderer:void 0,options:[],pageKeyTraverseSize:10,placeholder:"Select ...",searchable:!1,selectedValueClassName:null,style:{},value:void 0,width:null},exports.default=F; | ||
//# sourceMappingURL=index.js.map |
@@ -0,0 +0,0 @@ import { CSSObject } from 'create-emotion'; |
@@ -0,0 +0,0 @@ export declare enum StyleKeys { |
import React from "react"; | ||
import { DropdownProps, StyleKey, ExtraState, Option, DropdownOption } from './types'; | ||
import { DropdownProps, ExtraState, Option, DropdownOption } from './types'; | ||
export declare const useDropdownHooks: (props: DropdownProps, mergedId: string) => { | ||
@@ -14,3 +14,3 @@ focusedIndex: number; | ||
filteredOptions: DropdownOption[]; | ||
getStyle: (key: StyleKey, extraState?: ExtraState | undefined) => string; | ||
getStyle: (key: "Arrow" | "DropdownSelector" | "DropdownWrapper" | "SelectorSearch" | "SelectedValue" | "Placeholder" | "GroupContainer" | "GroupDivider" | "GroupHeading" | "OptionContainer" | "OptionItem", extraState?: ExtraState | undefined) => string; | ||
closeDropdown: (focus?: any) => void; | ||
@@ -17,0 +17,0 @@ flattenedOptions: Option[]; |
@@ -0,0 +0,0 @@ import { Option, OptionGroup, DropdownOption } from './types'; |
{ | ||
"name": "react-dropdown-aria", | ||
"version": "2.0.3", | ||
"version": "2.0.4", | ||
"description": "Simple and accessible React dropdown component", | ||
@@ -12,2 +12,4 @@ "main": "dist/index.js", | ||
"build": "rollup -c --environment NODE_ENV:production", | ||
"postbuild": "yarn types", | ||
"types": "yarn tsc --emitDeclarationOnly", | ||
"lint": "eslint . --ext .ts,.tsx", | ||
@@ -14,0 +16,0 @@ "test": "jest", |
@@ -11,3 +11,3 @@ [![CircleCI](https://circleci.com/gh/jfangrad/react-dropdown-aria.svg?style=svg&circle-token=c8db79d70dddf853273a5964b860ec0bf53f5163)](https://circleci.com/gh/jfangrad/react-dropdown-aria/tree/master) [![npm](https://img.shields.io/npm/v/react-dropdown-aria.svg)](https://www.npmjs.com/package/react-dropdown-aria) | ||
## **Upgrading to v2** | ||
Please take note when upgrading from v1 to v2 there are breaking changes. Be sure to carefully read the [changelog entry for v2.0.0](./packages/react-dropdown-aria/CHANGELOG.md#200). | ||
Please take note when upgrading from v1 to v2 there are breaking changes. Be sure to carefully read the [changelog entry for v2.0.0](https://github.com/jfangrad/react-dropdown-aria/blob/master/packages/react-dropdown-aria/CHANGELOG.md#200). | ||
@@ -14,0 +14,0 @@ ## Features |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
300487
17
459