@vacano/ui 1.15.8 → 1.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";const o=require("./X-CI1qRJDP.cjs"),p=require("react"),Te=require("react-dom"),t=require("./keyboard-Cexig8lu.cjs"),lt=require("@emotion/react"),I=require("./tooling-Dflq0Y98.cjs");function mr(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:()=>e[i]})}}return r.default=e,Object.freeze(r)}const Le=mr(p);function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},dt.apply(null,arguments)}var jr=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Pr=o.memoize(function(e){return jr.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Nr=Pr,zr=function(r){return r!=="theme"},ft=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?Nr:zr},xt=function(r,i,n){var l;if(i){var s=i.shouldForwardProp;l=r.__emotion_forwardProp&&s?function(u){return r.__emotion_forwardProp(u)&&s(u)}:s}return typeof l!="function"&&n&&(l=r.__emotion_forwardProp),l},Dr=function(r){var i=r.cache,n=r.serialized,l=r.isStringTag;return o.registerStyles(i,n,l),o.useInsertionEffectAlwaysWithSyncFallback(function(){return o.insertStyles(i,n,l)}),null},Tr=function e(r,i){var n=r.__emotion_real===r,l=n&&r.__emotion_base||r,s,u;i!==void 0&&(s=i.label,u=i.target);var d=xt(r,i,n),g=d||ft(l),h=!g("as");return function(){var f=arguments,b=n&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(s!==void 0&&b.push("label:"+s+";"),f[0]==null||f[0].raw===void 0)b.push.apply(b,f);else{var m=f[0];b.push(m[0]);for(var k=f.length,R=1;R<k;R++)b.push(f[R],m[R])}var C=lt.withEmotionCache(function(L,j,y){var $=h&&L.as||l,c="",D=[],E=L;if(L.theme==null){E={};for(var z in L)E[z]=L[z];E.theme=Le.useContext(lt.ThemeContext)}typeof L.className=="string"?c=o.getRegisteredStyles(j.registered,D,L.className):L.className!=null&&(c=L.className+" ");var M=o.serializeStyles(b.concat(D),j.registered,E);c+=j.key+"-"+M.name,u!==void 0&&(c+=" "+u);var V=h&&d===void 0?ft($):g,_={};for(var F in L)h&&F==="as"||V(F)&&(_[F]=L[F]);return _.className=c,y&&(_.ref=y),Le.createElement(Le.Fragment,null,Le.createElement(Dr,{cache:j,serialized:M,isStringTag:typeof $=="string"}),Le.createElement($,_))});return C.displayName=s!==void 0?s:"Styled("+(typeof l=="string"?l:l.displayName||l.name||"Component")+")",C.defaultProps=r.defaultProps,C.__emotion_real=C,C.__emotion_base=l,C.__emotion_styles=b,C.__emotion_forwardProp=d,Object.defineProperty(C,"toString",{value:function(){return"."+u}}),C.withComponent=function(L,j){var y=e(L,dt({},i,j,{shouldForwardProp:xt(C,j,!0)}));return y.apply(void 0,b)},C}},Er=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],a=Tr.bind(null);Er.forEach(function(e){a[e]=a(e)});const Ir=a.span`
1
+ "use strict";const o=require("./X-CI1qRJDP.cjs"),p=require("react"),Te=require("react-dom"),t=require("./keyboard-Ce6jVywF.cjs"),lt=require("@emotion/react"),I=require("./tooling-Dflq0Y98.cjs");function mr(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const n=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:()=>e[i]})}}return r.default=e,Object.freeze(r)}const Le=mr(p);function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},dt.apply(null,arguments)}var jr=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Pr=o.memoize(function(e){return jr.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Nr=Pr,zr=function(r){return r!=="theme"},ft=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?Nr:zr},xt=function(r,i,n){var l;if(i){var s=i.shouldForwardProp;l=r.__emotion_forwardProp&&s?function(u){return r.__emotion_forwardProp(u)&&s(u)}:s}return typeof l!="function"&&n&&(l=r.__emotion_forwardProp),l},Dr=function(r){var i=r.cache,n=r.serialized,l=r.isStringTag;return o.registerStyles(i,n,l),o.useInsertionEffectAlwaysWithSyncFallback(function(){return o.insertStyles(i,n,l)}),null},Tr=function e(r,i){var n=r.__emotion_real===r,l=n&&r.__emotion_base||r,s,u;i!==void 0&&(s=i.label,u=i.target);var d=xt(r,i,n),g=d||ft(l),h=!g("as");return function(){var f=arguments,b=n&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(s!==void 0&&b.push("label:"+s+";"),f[0]==null||f[0].raw===void 0)b.push.apply(b,f);else{var m=f[0];b.push(m[0]);for(var k=f.length,R=1;R<k;R++)b.push(f[R],m[R])}var C=lt.withEmotionCache(function(L,j,y){var $=h&&L.as||l,c="",D=[],E=L;if(L.theme==null){E={};for(var z in L)E[z]=L[z];E.theme=Le.useContext(lt.ThemeContext)}typeof L.className=="string"?c=o.getRegisteredStyles(j.registered,D,L.className):L.className!=null&&(c=L.className+" ");var M=o.serializeStyles(b.concat(D),j.registered,E);c+=j.key+"-"+M.name,u!==void 0&&(c+=" "+u);var V=h&&d===void 0?ft($):g,_={};for(var F in L)h&&F==="as"||V(F)&&(_[F]=L[F]);return _.className=c,y&&(_.ref=y),Le.createElement(Le.Fragment,null,Le.createElement(Dr,{cache:j,serialized:M,isStringTag:typeof $=="string"}),Le.createElement($,_))});return C.displayName=s!==void 0?s:"Styled("+(typeof l=="string"?l:l.displayName||l.name||"Component")+")",C.defaultProps=r.defaultProps,C.__emotion_real=C,C.__emotion_base=l,C.__emotion_styles=b,C.__emotion_forwardProp=d,Object.defineProperty(C,"toString",{value:function(){return"."+u}}),C.withComponent=function(L,j){var y=e(L,dt({},i,j,{shouldForwardProp:xt(C,j,!0)}));return y.apply(void 0,b)},C}},Er=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],a=Tr.bind(null);Er.forEach(function(e){a[e]=a(e)});const Ir=a.span`
2
2
  font-size: 12px;
3
3
  font-weight: 500;
4
4
  color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
@@ -144,7 +144,7 @@
144
144
  border-top-color: ${St.indicator};
145
145
  border-radius: 50%;
146
146
  animation: ${Qr} 0.8s linear infinite;
147
- `,to=I.newClassNameGetter("spinner"),qt=({"aria-label":e="Loading",className:r,ref:i,size:n="md",...l})=>o.jsx(eo,{...l,ref:i,className:to("container",r),role:"status","aria-label":e,$size:n}),ge=I.newClassNameGetter("autocomplete"),ro=4,oo=({className:e,classnames:r,disabled:i,fullWidth:n,label:l,ref:s,message:u,portalRenderNode:d,size:g="default",variant:h="normal",value:f,onChange:b,onSearch:m,debounceMs:k=300,minChars:R=1,noResultsMessage:C="No results found",...L})=>{const[j,y]=p.useState((f==null?void 0:f.value)??""),[$,c]=p.useState([]),[D,E]=p.useState(!1),[z,M]=p.useState(!1),[V,_]=p.useState(!1),[F,W]=p.useState({top:0,left:0,width:0}),v=p.useRef(null),O=p.useRef(null),T=p.useRef(null);p.useEffect(()=>{(f==null?void 0:f.value)!==void 0&&y(f.value)},[f==null?void 0:f.value]);const w=p.useCallback(async N=>{if(N.length<R){c([]),_(!1);return}E(!0),_(!0);try{const H=await m(N);c(H),M(!0)}catch{c([])}finally{E(!1)}},[m,R]),G=p.useCallback(N=>{const H=N.target.value;y(H),b==null||b({value:H,image_url:null}),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{w(H)},k)},[b,w,k]),X=p.useCallback(N=>{y(N.value),c([]),M(!1),_(!1),b==null||b({value:N.value,image_url:N.image_url})},[b]),K=p.useCallback(()=>{setTimeout(()=>{M(!1)},150)},[]),re=p.useCallback(()=>{$.length>0&&M(!0)},[$.length]),S=p.useCallback(()=>{if(!v.current)return;const N=v.current.getBoundingClientRect();W({top:N.bottom+ro,left:N.left,width:N.width})},[]);p.useLayoutEffect(()=>{z&&d&&S()},[z,d,S]),p.useEffect(()=>{if(!z||!d)return;const N=()=>S(),H=()=>S();return window.addEventListener("scroll",N,!0),window.addEventListener("resize",H),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",H)}},[z,d,S]),p.useEffect(()=>{if(!z||!d)return;const N=H=>{const ue=H.target,Xe=v.current&&!v.current.contains(ue),be=O.current&&!O.current.contains(ue);Xe&&be&&M(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[z,d]),p.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const P=z&&V&&!D,Y=o.jsx(o.Fragment,{children:$.length>0?$.map(N=>o.jsxs(Xr,{onClick:()=>X(N),className:ge("item",r==null?void 0:r.item),children:[N.image_url&&o.jsx(Zr,{src:N.image_url,alt:N.value}),o.jsx(qr,{children:N.value})]},N.id)):!D&&o.jsx(Jr,{children:C})}),B=d?Te.createPortal(o.jsx(Ur,{ref:O,$open:P,className:ge("dropdown",r==null?void 0:r.dropdown),style:{top:F.top,left:F.left,width:F.width},children:Y}),d):o.jsx(Kr,{ref:O,$open:P,className:ge("dropdown",r==null?void 0:r.dropdown),children:Y});return o.jsxs(Yr,{ref:v,className:ge("container",e),$fullWidth:!!n,children:[l&&o.jsx(Gr,{variant:h,className:ge("label",r==null?void 0:r.label),children:l}),o.jsxs(Br,{children:[o.jsx(Wr,{...L,ref:s,type:"text",value:j,onChange:G,onBlur:K,onFocus:re,disabled:i,$size:g,$variant:h,className:ge("input",r==null?void 0:r.input)}),D&&o.jsx(Hr,{children:o.jsx(qt,{size:"xs"})})]}),u&&o.jsx(Vr,{variant:h,children:u}),B]})},Ct={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},yt={normal:{background:{static:t.COLORS["steel-blue"],hover:t.alpha(t.COLORS["steel-blue"],90),active:t.alpha(t.COLORS["steel-blue"],80),disabled:t.alpha(t.COLORS["steel-blue"],50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},system:{background:{static:t.COLORS.black,hover:t.alpha(t.COLORS.black,90),active:t.alpha(t.COLORS.black,80),disabled:t.alpha(t.COLORS.black,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},success:{background:{static:t.COLORS.green,hover:t.alpha(t.COLORS.green,90),active:t.alpha(t.COLORS.green,80),disabled:t.alpha(t.COLORS.green,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},warning:{background:{static:t.COLORS.yellow,hover:t.alpha(t.COLORS.yellow,90),active:t.alpha(t.COLORS.yellow,80),disabled:t.alpha(t.COLORS.yellow,50)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.COLORS.black},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},danger:{background:{static:t.COLORS.red,hover:t.alpha(t.COLORS.red,90),active:t.alpha(t.COLORS.red,80),disabled:t.alpha(t.COLORS.red,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},transparent:{background:{static:t.alpha(t.COLORS["iron-grey"],1),hover:t.alpha(t.COLORS["iron-grey"],5),active:t.alpha(t.COLORS["iron-grey"],10),disabled:t.alpha(t.COLORS["iron-grey"],5)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:t.alpha(t.COLORS["iron-grey"],20),hover:t.alpha(t.COLORS["iron-grey"],20),active:t.alpha(t.COLORS["iron-grey"],20),disabled:t.alpha(t.COLORS["iron-grey"],10)}}},q=e=>{const r=yt[e];return r||yt.normal},te=e=>{const r=Ct[e];return r||Ct.default},io=e=>e?"auto":"fit-content",ao=a.button`
147
+ `,to=I.newClassNameGetter("spinner"),qt=({"aria-label":e="Loading",className:r,ref:i,size:n="md",...l})=>o.jsx(eo,{...l,ref:i,className:to("container",r),role:"status","aria-label":e,$size:n}),ge=I.newClassNameGetter("autocomplete"),ro=4,oo=({className:e,classnames:r,disabled:i,fullWidth:n,label:l,ref:s,message:u,portalRenderNode:d,size:g="default",variant:h="normal",value:f,onChange:b,onSearch:m,debounceMs:k=300,minChars:R=1,noResultsMessage:C="No results found",...L})=>{const[j,y]=p.useState((f==null?void 0:f.value)??""),[$,c]=p.useState([]),[D,E]=p.useState(!1),[z,M]=p.useState(!1),[V,_]=p.useState(!1),[F,W]=p.useState({top:0,left:0,width:0}),v=p.useRef(null),O=p.useRef(null),T=p.useRef(null);p.useEffect(()=>{(f==null?void 0:f.value)!==void 0&&y(f.value)},[f==null?void 0:f.value]);const w=p.useCallback(async N=>{if(N.length<R){c([]),_(!1);return}E(!0),_(!0);try{const H=await m(N);c(H),M(!0)}catch{c([])}finally{E(!1)}},[m,R]),G=p.useCallback(N=>{const H=N.target.value;y(H),b==null||b({value:H,image_url:null}),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{w(H)},k)},[b,w,k]),X=p.useCallback(N=>{y(N.value),c([]),M(!1),_(!1),b==null||b({value:N.value,image_url:N.image_url})},[b]),K=p.useCallback(()=>{setTimeout(()=>{M(!1)},150)},[]),re=p.useCallback(()=>{$.length>0&&M(!0)},[$.length]),S=p.useCallback(()=>{if(!v.current)return;const N=v.current.getBoundingClientRect();W({top:N.bottom+ro,left:N.left,width:N.width})},[]);p.useLayoutEffect(()=>{z&&d&&S()},[z,d,S]),p.useEffect(()=>{if(!z||!d)return;const N=()=>S(),H=()=>S();return window.addEventListener("scroll",N,!0),window.addEventListener("resize",H),()=>{window.removeEventListener("scroll",N,!0),window.removeEventListener("resize",H)}},[z,d,S]),p.useEffect(()=>{if(!z||!d)return;const N=H=>{const ue=H.target,Xe=v.current&&!v.current.contains(ue),be=O.current&&!O.current.contains(ue);Xe&&be&&M(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[z,d]),p.useEffect(()=>()=>{T.current&&clearTimeout(T.current)},[]);const P=z&&V&&!D,Y=o.jsx(o.Fragment,{children:$.length>0?$.map(N=>o.jsxs(Xr,{onClick:()=>X(N),className:ge("item",r==null?void 0:r.item),children:[N.image_url&&o.jsx(Zr,{src:N.image_url,alt:N.value}),o.jsx(qr,{children:N.value})]},N.id)):!D&&o.jsx(Jr,{children:C})}),B=d?Te.createPortal(o.jsx(Ur,{ref:O,$open:P,className:ge("dropdown",r==null?void 0:r.dropdown),style:{top:F.top,left:F.left,width:F.width},children:Y}),d):o.jsx(Kr,{ref:O,$open:P,className:ge("dropdown",r==null?void 0:r.dropdown),children:Y});return o.jsxs(Yr,{ref:v,className:ge("container",e),$fullWidth:!!n,children:[l&&o.jsx(Gr,{variant:h,className:ge("label",r==null?void 0:r.label),children:l}),o.jsxs(Br,{children:[o.jsx(Wr,{...L,ref:s,type:"text",value:j,onChange:G,onBlur:K,onFocus:re,disabled:i,$size:g,$variant:h,className:ge("input",r==null?void 0:r.input)}),D&&o.jsx(Hr,{children:o.jsx(qt,{size:"xs"})})]}),u&&o.jsx(Vr,{variant:h,children:u}),B]})},Ct={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},yt={normal:{background:{static:t.COLORS["steel-blue"],hover:t.alpha(t.COLORS["steel-blue"],90),active:t.alpha(t.COLORS["steel-blue"],80),disabled:t.alpha(t.COLORS["steel-blue"],50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},system:{background:{static:t.COLORS.black,hover:t.alpha(t.COLORS.black,90),active:t.alpha(t.COLORS.black,80),disabled:t.alpha(t.COLORS.black,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},success:{background:{static:t.COLORS.green,hover:t.alpha(t.COLORS.green,90),active:t.alpha(t.COLORS.green,80),disabled:t.alpha(t.COLORS.green,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},warning:{background:{static:t.COLORS.yellow,hover:t.alpha(t.COLORS.yellow,90),active:t.alpha(t.COLORS.yellow,80),disabled:t.alpha(t.COLORS.yellow,50)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.COLORS.black},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},danger:{background:{static:t.COLORS.red,hover:t.alpha(t.COLORS.red,90),active:t.alpha(t.COLORS.red,80),disabled:t.alpha(t.COLORS.red,50)},color:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.COLORS.white},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}},transparent:{background:{static:t.alpha(t.COLORS["iron-grey"],1),hover:t.alpha(t.COLORS["iron-grey"],5),active:t.alpha(t.COLORS["iron-grey"],10),disabled:t.alpha(t.COLORS["iron-grey"],5)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:t.alpha(t.COLORS["iron-grey"],20),hover:t.alpha(t.COLORS["iron-grey"],20),active:t.alpha(t.COLORS["iron-grey"],20),disabled:t.alpha(t.COLORS["iron-grey"],10)}},ghost:{background:{static:t.alpha(t.COLORS["iron-grey"],6),hover:t.alpha(t.COLORS["iron-grey"],10),active:t.alpha(t.COLORS["iron-grey"],14),disabled:t.alpha(t.COLORS["iron-grey"],4)},color:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,30)},borderColor:{static:"transparent",hover:"transparent",active:"transparent",disabled:"transparent"}}},q=e=>{const r=yt[e];return r||yt.normal},te=e=>{const r=Ct[e];return r||Ct.default},io=e=>e?"auto":"fit-content",ao=a.button`
148
148
  display: flex;
149
149
  gap: 6px;
150
150
  text-decoration: none;
@@ -1303,4 +1303,4 @@
1303
1303
  flex-direction: column;
1304
1304
  gap: 12px;
1305
1305
  `,nt=I.newClassNameGetter("toggle-group"),Ta=({className:e,classnames:r,disabled:i,label:n,onChange:l,options:s,ref:u,value:d,variant:g="normal",...h})=>{const f=(b,m)=>{l(m?[...d,b]:d.filter(k=>k!==b))};return o.jsxs(Na,{...h,ref:u,className:nt("container",e),children:[n&&o.jsx(za,{className:nt("label",r==null?void 0:r.label),$disabled:i,children:n}),o.jsx(Da,{className:nt("options",r==null?void 0:r.options),children:s.map(b=>o.jsx(ht,{className:r==null?void 0:r.toggle,checked:d.includes(b.value),label:b.label,disabled:i,variant:g,onChange:m=>f(b.value,m.target.checked)},b.value))})]})};exports.Autocomplete=oo;exports.Button=er;exports.Checkbox=Ke;exports.CheckboxCard=ko;exports.CheckboxGroup=wo;exports.Chip=He;exports.DatePicker=ai;exports.FieldLabel=ie;exports.FieldMessage=ae;exports.Input=ir;exports.KeySymbol=Jt;exports.KeysBindings=Qt;exports.Modal=ar;exports.MultiSelect=vi;exports.OtpCode=zi;exports.Radio=pt;exports.RadioCard=Vi;exports.RadioGroup=Ki;exports.Select=ia;exports.Spinner=qt;exports.Tags=ha;exports.Textarea=$a;exports.Toggle=ht;exports.ToggleCard=Pa;exports.ToggleGroup=Ta;exports.formatDateGo=tr;exports.styled=a;
1306
- //# sourceMappingURL=ToggleGroup-DXq3FgdQ.cjs.map
1306
+ //# sourceMappingURL=ToggleGroup-FYyi3zCW.cjs.map