@vacano/ui 1.15.2 → 1.15.3

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,1294 +0,0 @@
1
- "use strict";const o=require("./X-CI1qRJDP.cjs"),h=require("react"),t=require("./keyboard-D8zOi0jU.cjs"),nt=require("@emotion/react"),I=require("./tooling-Dflq0Y98.cjs"),He=require("react-dom");function wr(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 Ce=wr(h);function lt(){return lt=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},lt.apply(null,arguments)}var mr=/^((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)-.*))$/,jr=o.memoize(function(e){return mr.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),Pr=jr,Nr=function(r){return r!=="theme"},gt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?Pr:Nr},ft=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},zr=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=ft(r,i,n),b=d||gt(l),p=!b("as");return function(){var f=arguments,O=n&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(s!==void 0&&O.push("label:"+s+";"),f[0]==null||f[0].raw===void 0)O.push.apply(O,f);else{var w=f[0];O.push(w[0]);for(var k=f.length,L=1;L<k;L++)O.push(f[L],w[L])}var C=nt.withEmotionCache(function(R,j,$){var S=p&&R.as||l,c="",T=[],D=R;if(R.theme==null){D={};for(var z in R)D[z]=R[z];D.theme=Ce.useContext(nt.ThemeContext)}typeof R.className=="string"?c=o.getRegisteredStyles(j.registered,T,R.className):R.className!=null&&(c=R.className+" ");var Y=o.serializeStyles(O.concat(T),j.registered,D);c+=j.key+"-"+Y.name,u!==void 0&&(c+=" "+u);var F=p&&d===void 0?gt(S):b,A={};for(var M in R)p&&M==="as"||F(M)&&(A[M]=R[M]);return A.className=c,$&&(A.ref=$),Ce.createElement(Ce.Fragment,null,Ce.createElement(zr,{cache:j,serialized:Y,isStringTag:typeof S=="string"}),Ce.createElement(S,A))});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=O,C.__emotion_forwardProp=d,Object.defineProperty(C,"toString",{value:function(){return"."+u}}),C.withComponent=function(R,j){var $=e(R,lt({},i,j,{shouldForwardProp:ft(C,j,!0)}));return $.apply(void 0,O)},C}},Dr=["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);Dr.forEach(function(e){a[e]=a(e)});const Ir=a.span`
2
- font-size: 12px;
3
- font-weight: 500;
4
- color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
5
- `,_r=I.newClassNameGetter("field-label"),te=({children:e,className:r,ref:i,required:n,variant:l="normal",...s})=>e?o.jsxs(Ir,{...s,ref:i,className:_r("container",r),$variant:l,children:[e," ",n&&"*"]}):null,Er={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},Ar=a.span`
6
- display: block;
7
- font-size: 12px;
8
- font-weight: 500;
9
- line-height: 1.4;
10
- color: ${e=>Er[e.$variant]};
11
- `,Mr=I.newClassNameGetter("field-message"),re=({children:e,className:r,ref:i,variant:n="normal",...l})=>e?o.jsx(Ar,{...l,ref:i,className:Mr("container",r),$variant:n,children:e}):null,qe={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},oe={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},Fr=a.div`
12
- position: relative;
13
- display: grid;
14
- gap: 2px;
15
- width: ${e=>e.$fullWidth?"100%":"fit-content"};
16
- `,Yr=a(te)`
17
- margin-left: 6px;
18
- `,Gr=a(re)`
19
- margin-left: 6px;
20
- `,Vr=a.div`
21
- position: relative;
22
- display: flex;
23
- align-items: center;
24
- `,Br=a.input`
25
- flex: 1;
26
- min-width: 0;
27
- width: 100%;
28
- outline: none;
29
- font-size: 14px;
30
- font-weight: 500;
31
- height: ${e=>qe[e.$size].height};
32
- padding: ${e=>qe[e.$size].padding};
33
- padding-right: 40px;
34
- border-radius: ${e=>qe[e.$size].radius};
35
-
36
- color: ${e=>oe[e.$variant].color.static};
37
- border: 1px solid ${e=>oe[e.$variant].border.static};
38
- background-color: ${e=>oe[e.$variant].background.static};
39
-
40
- &::placeholder {
41
- color: ${e=>oe[e.$variant].placeholder.static};
42
- }
43
-
44
- &:disabled {
45
- cursor: not-allowed;
46
- color: ${e=>oe[e.$variant].color.disabled};
47
- background-color: ${e=>oe[e.$variant].background.disabled};
48
- border-color: ${e=>oe[e.$variant].border.disabled};
49
-
50
- &::placeholder {
51
- color: ${e=>oe[e.$variant].placeholder.disabled};
52
- }
53
- }
54
- `,Hr=a.div`
55
- position: absolute;
56
- right: 12px;
57
- top: 50%;
58
- transform: translateY(-50%);
59
- display: flex;
60
- align-items: center;
61
- justify-content: center;
62
- `,Wr=a.div`
63
- position: absolute;
64
- top: 100%;
65
- left: 0;
66
- right: 0;
67
- z-index: 100;
68
- margin-top: 4px;
69
- max-height: 240px;
70
- overflow-y: auto;
71
- background-color: ${t.COLORS.white};
72
- border: 1px solid ${t.COLORS.gray};
73
- border-radius: 12px;
74
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
75
- opacity: ${({$open:e})=>e?1:0};
76
- visibility: ${({$open:e})=>e?"visible":"hidden"};
77
- transform: ${({$open:e})=>e?"translateY(0)":"translateY(-8px)"};
78
- transition:
79
- opacity 0.15s ease,
80
- transform 0.15s ease,
81
- visibility 0.15s;
82
- `,Kr=a.div`
83
- display: flex;
84
- align-items: center;
85
- gap: 10px;
86
- padding: 10px 14px;
87
- cursor: pointer;
88
- font-size: 14px;
89
- font-weight: 500;
90
- color: ${t.COLORS.black};
91
- transition: background-color 0.1s ease;
92
-
93
- &:first-of-type {
94
- border-radius: 12px 12px 0 0;
95
- }
96
-
97
- &:last-of-type {
98
- border-radius: 0 0 12px 12px;
99
- }
100
-
101
- &:only-child {
102
- border-radius: 12px;
103
- }
104
-
105
- &:hover {
106
- background-color: ${t.alpha(t.COLORS.black,5)};
107
- }
108
- `,Ur=a.img`
109
- width: 24px;
110
- height: 24px;
111
- border-radius: 6px;
112
- object-fit: cover;
113
- `,qr=a.span`
114
- flex: 1;
115
- overflow: hidden;
116
- text-overflow: ellipsis;
117
- white-space: nowrap;
118
- `,Xr=a.div`
119
- padding: 12px 14px;
120
- font-size: 14px;
121
- color: ${t.alpha(t.COLORS.black,50)};
122
- text-align: center;
123
- `,xt={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},St={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},Xe=e=>xt[e]??xt.md,Zr=nt.keyframes`
124
- 0% {
125
- transform: rotate(0deg);
126
- }
127
- 100% {
128
- transform: rotate(360deg);
129
- }
130
- `,Jr=a.div`
131
- display: inline-block;
132
- width: ${e=>Xe(e.$size).size};
133
- height: ${e=>Xe(e.$size).size};
134
- border: ${e=>Xe(e.$size).borderWidth} solid ${St.track};
135
- border-top-color: ${St.indicator};
136
- border-radius: 50%;
137
- animation: ${Zr} 0.8s linear infinite;
138
- `,Qr=I.newClassNameGetter("spinner"),qt=({"aria-label":e="Loading",className:r,ref:i,size:n="md",...l})=>o.jsx(Jr,{...l,ref:i,className:Qr("container",r),role:"status","aria-label":e,$size:n}),ke=I.newClassNameGetter("autocomplete"),eo=({className:e,classnames:r,disabled:i,fullWidth:n,label:l,ref:s,message:u,size:d="default",variant:b="normal",value:p,onChange:f,onSearch:O,debounceMs:w=300,minChars:k=1,noResultsMessage:L="No results found",...C})=>{const[R,j]=h.useState((p==null?void 0:p.value)??""),[$,S]=h.useState([]),[c,T]=h.useState(!1),[D,z]=h.useState(!1),[Y,F]=h.useState(!1),A=h.useRef(null),M=h.useRef(null);h.useEffect(()=>{(p==null?void 0:p.value)!==void 0&&j(p.value)},[p==null?void 0:p.value]);const G=h.useCallback(async P=>{if(P.length<k){S([]),F(!1);return}T(!0),F(!0);try{const V=await O(P);S(V),z(!0)}catch{S([])}finally{T(!1)}},[O,k]),m=h.useCallback(P=>{const V=P.target.value;j(V),f==null||f({value:V,image_url:null}),M.current&&clearTimeout(M.current),M.current=setTimeout(()=>{G(V)},w)},[f,G,w]),g=h.useCallback(P=>{j(P.value),S([]),z(!1),F(!1),f==null||f({value:P.value,image_url:P.image_url})},[f]),_=h.useCallback(()=>{setTimeout(()=>{z(!1)},150)},[]),v=h.useCallback(()=>{$.length>0&&z(!0)},[$.length]);return h.useEffect(()=>()=>{M.current&&clearTimeout(M.current)},[]),o.jsxs(Fr,{ref:A,className:ke("container",e),$fullWidth:!!n,children:[l&&o.jsx(Yr,{variant:b,className:ke("label",r==null?void 0:r.label),children:l}),o.jsxs(Vr,{children:[o.jsx(Br,{...C,ref:s,type:"text",value:R,onChange:m,onBlur:_,onFocus:v,disabled:i,$size:d,$variant:b,className:ke("input",r==null?void 0:r.input)}),c&&o.jsx(Hr,{children:o.jsx(qt,{size:"xs"})})]}),u&&o.jsx(Gr,{variant:b,children:u}),o.jsx(Wr,{$open:D&&Y&&!c,className:ke("dropdown",r==null?void 0:r.dropdown),children:$.length>0?$.map(P=>o.jsxs(Kr,{onClick:()=>g(P),className:ke("item",r==null?void 0:r.item),children:[P.image_url&&o.jsx(Ur,{src:P.image_url,alt:P.value}),o.jsx(qr,{children:P.value})]},P.id)):!c&&o.jsx(Xr,{children:L})})]})},$t={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Ct={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)}}},U=e=>{const r=Ct[e];return r||Ct.normal},Q=e=>{const r=$t[e];return r||$t.default},to=e=>e?"auto":"fit-content",ro=a.button`
139
- display: flex;
140
- gap: 6px;
141
- text-decoration: none;
142
- align-items: center;
143
- justify-content: center;
144
- width: ${e=>e.$iconOnly?Q(e.$size).height:to(!!e.$fullWidth)};
145
- color: ${e=>U(e.$variant).color.static};
146
- background-color: ${e=>U(e.$variant).background.static};
147
- height: ${e=>Q(e.$size).height};
148
- padding: ${e=>e.$iconOnly?"0":Q(e.$size).padding};
149
- border-radius: ${e=>Q(e.$size).radius};
150
- border: 1px solid ${e=>U(e.$variant).borderColor.static};
151
-
152
- &:hover:not(:disabled) {
153
- color: ${e=>U(e.$variant).color.hover};
154
- background-color: ${e=>U(e.$variant).background.hover};
155
- border-color: ${e=>U(e.$variant).borderColor.hover};
156
- }
157
-
158
- &:active:not(:disabled) {
159
- color: ${e=>U(e.$variant).color.active};
160
- background-color: ${e=>U(e.$variant).background.active};
161
- border-color: ${e=>U(e.$variant).borderColor.active};
162
- }
163
-
164
- &:disabled {
165
- cursor: not-allowed;
166
- color: ${e=>U(e.$variant).color.disabled};
167
- background-color: ${e=>U(e.$variant).background.disabled};
168
- border-color: ${e=>U(e.$variant).borderColor.disabled};
169
- }
170
- `,oo=a.div`
171
- display: grid;
172
- place-items: center;
173
- width: ${e=>Q(e.$size).iconSize};
174
- height: ${e=>Q(e.$size).iconSize};
175
-
176
- & svg {
177
- width: ${e=>Q(e.$size).iconSize};
178
- height: ${e=>Q(e.$size).iconSize};
179
- }
180
- `,io=a.span`
181
- font-weight: 600;
182
- overflow: hidden;
183
- white-space: nowrap;
184
- text-overflow: ellipsis;
185
- `,ao=a(o.LoaderCircle)`
186
- width: ${e=>Q(e.$size).iconSize};
187
- height: ${e=>Q(e.$size).iconSize};
188
- animation: ${t.KEYFRAMES.rotate} 0.8s linear infinite;
189
- `,no=a.div`
190
- display: flex;
191
- gap: 3px;
192
- `,lo=a.span`
193
- text-align: center;
194
- display: flex;
195
- justify-content: center;
196
- align-items: center;
197
- font-size: 12px;
198
- height: 18px;
199
- min-width: 18px;
200
- line-height: 1.6;
201
- padding: 2px 4px;
202
- border-radius: 4px;
203
- width: fit-content;
204
- background-color: ${e=>e.$variant==="light"?t.alpha(t.COLORS.white,25):t.alpha(t.COLORS.black,25)};
205
- `,co=I.newClassNameGetter("key-symbol"),Xt=({className:e,ref:r,symbol:i,variant:n="light",...l})=>i?o.jsx(lo,{...l,ref:r,className:co("container",e),$variant:n,children:i}):null,kt=I.newClassNameGetter("key-bindings"),Zt=({className:e,classnames:r,keys:i,ref:n,variant:l,...s})=>{const u=h.useMemo(()=>t.getKeySymbols(i),[i]);return u.length===0?null:o.jsx(no,{...s,ref:n,className:kt("container",e),children:u.map(d=>o.jsx(Xt,{symbol:d,className:kt("item",r==null?void 0:r.item),variant:l},d))})},yt=I.newClassNameGetter("button"),Jt=({children:e,className:r,classnames:i,disabled:n,fullWidth:l,icon:s,loading:u,onClick:d,ref:b=null,keyBindings:p=[],size:f="default",type:O="button",variant:w="normal",...k})=>{const L=h.useRef(null);h.useImperativeHandle(b,()=>L.current,[]),t.useKeyBinding(p,()=>{var R;(R=L.current)==null||R.click()});const C=h.useMemo(()=>{switch(O){case"link":return"button";default:return O}},[O]);return o.jsxs(ro,{...k,onClick:d,ref:L,type:C,disabled:n,className:yt("container",r),$variant:w,$size:f,$fullWidth:!!l,$iconOnly:!!s&&!(e||(p==null?void 0:p.length)>0),children:[u&&o.jsx(ao,{$size:f}),s&&!u&&o.jsx(oo,{$size:f,children:s}),e&&o.jsx(io,{className:yt("label",i==null?void 0:i.label),children:e}),o.jsx(Zt,{keys:p,variant:w==="system"?"light":"dark"})]})},Rt={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.black,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},label:t.COLORS.black,icon:t.COLORS.white},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.red,focusShadow:t.alpha(t.COLORS.red,30)},label:t.COLORS.red,icon:t.COLORS.white}},ge=e=>Rt[e]??Rt.normal,so=a.label`
206
- display: inline-flex;
207
- align-items: flex-start;
208
- gap: 8px;
209
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
210
- opacity: ${e=>e.$disabled?.5:1};
211
- `,po=a.input`
212
- position: absolute;
213
- opacity: 0;
214
- width: 0;
215
- height: 0;
216
- pointer-events: none;
217
- `,ho=a.span`
218
- display: inline-flex;
219
- align-items: center;
220
- justify-content: center;
221
- flex-shrink: 0;
222
- width: 18px;
223
- height: 18px;
224
- border-radius: 6px;
225
- border: 1.5px solid
226
- ${e=>e.$checked||e.$indeterminate?ge(e.$variant).box.borderChecked:ge(e.$variant).box.border};
227
- background-color: ${e=>e.$checked||e.$indeterminate?ge(e.$variant).box.backgroundChecked:ge(e.$variant).box.background};
228
- transition:
229
- border-color 0.15s ease,
230
- background-color 0.15s ease,
231
- box-shadow 0.15s ease;
232
- `,uo=a.span`
233
- display: inline-flex;
234
- align-items: center;
235
- justify-content: center;
236
- color: ${e=>ge(e.$variant).icon};
237
- opacity: ${e=>e.$visible?1:0};
238
- transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
239
- transition:
240
- opacity 0.15s ease,
241
- transform 0.15s ease;
242
-
243
- & svg {
244
- width: 12px;
245
- height: 12px;
246
- }
247
- `,bo=a.span`
248
- font-size: 14px;
249
- font-weight: 500;
250
- line-height: 1.3;
251
- color: ${e=>ge(e.$variant).label};
252
- user-select: none;
253
-
254
- a {
255
- color: inherit;
256
- text-decoration: underline;
257
- cursor: pointer;
258
-
259
- &:hover {
260
- text-decoration: none;
261
- }
262
- }
263
- `,ye=I.newClassNameGetter("checkbox"),We=({checked:e,className:r,classnames:i,disabled:n,indeterminate:l=!1,label:s,onChange:u,ref:d,variant:b="normal",...p})=>o.jsxs(so,{className:ye("container",r),$disabled:!!n,$variant:b,children:[o.jsx(po,{...p,ref:d,type:"checkbox",className:ye("input",i==null?void 0:i.input),checked:e,disabled:n,onChange:u}),o.jsx(ho,{className:ye("box",i==null?void 0:i.box),$checked:e,$indeterminate:l,$variant:b,children:o.jsx(uo,{className:ye("icon",i==null?void 0:i.icon),$visible:l||e,$variant:b,children:l?o.jsx(o.Minus,{}):o.jsx(o.Check,{})})}),s&&o.jsx(bo,{className:ye("label",i==null?void 0:i.label),$variant:b,children:s})]}),Lt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},de=e=>Lt[e]??Lt.normal,Oo=a.label`
264
- display: grid;
265
- grid-template-columns: auto 1fr;
266
- align-items: start;
267
- gap: 8px;
268
- padding: 12px;
269
- background-color: ${e=>{const r=de(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
270
- border: 1px solid
271
- ${e=>{const r=de(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
272
- border-radius: 12px;
273
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
274
- transition:
275
- border-color 0.15s ease,
276
- background-color 0.15s ease;
277
- width: ${e=>e.$fullWidth?"100%":"fit-content"};
278
- min-width: 0;
279
-
280
- &:hover:not([data-disabled='true']) {
281
- border-color: ${e=>{const r=de(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
282
- }
283
-
284
- .vacano_checkbox_container {
285
- pointer-events: none;
286
- }
287
- `,go=a.input`
288
- position: absolute;
289
- width: 1px;
290
- height: 1px;
291
- margin: -1px;
292
- padding: 0;
293
- overflow: hidden;
294
- clip: rect(0, 0, 0, 0);
295
- white-space: nowrap;
296
- border: 0;
297
- `,fo=a.div`
298
- display: flex;
299
- flex-direction: column;
300
- gap: 2px;
301
- min-width: 0;
302
- `,xo=a.span`
303
- font-size: 14px;
304
- font-weight: 500;
305
- line-height: 1.4;
306
- color: ${e=>de(e.$variant).label.static};
307
-
308
- label[data-disabled='true'] & {
309
- color: ${e=>de(e.$variant).label.disabled};
310
- }
311
- `,So=a.span`
312
- font-size: 12px;
313
- font-weight: 400;
314
- line-height: 1.4;
315
- color: ${e=>de(e.$variant).description.static};
316
-
317
- label[data-disabled='true'] & {
318
- color: ${e=>de(e.$variant).description.disabled};
319
- }
320
- `,Ie=I.newClassNameGetter("checkbox-card"),$o=({checked:e,className:r,classnames:i,description:n,disabled:l,fullWidth:s=!1,label:u,onChange:d,ref:b,variant:p="normal",...f})=>o.jsxs(Oo,{className:Ie("container",r),$checked:e,$disabled:!!l,$fullWidth:s,$variant:p,"data-disabled":l,children:[o.jsx(go,{...f,ref:b,type:"checkbox",checked:e,disabled:l,onChange:d}),o.jsx(We,{className:i==null?void 0:i.checkbox,checked:e,disabled:l,variant:p,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),o.jsxs(fo,{className:Ie("content",i==null?void 0:i.content),children:[o.jsx(xo,{className:Ie("label",i==null?void 0:i.label),$variant:p,children:u}),n&&o.jsx(So,{className:Ie("description",i==null?void 0:i.description),$variant:p,children:n})]})]}),vt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Co=a.div`
321
- display: flex;
322
- flex-direction: column;
323
- gap: 8px;
324
- `,ko=a.span`
325
- font-size: 13px;
326
- font-weight: 500;
327
- line-height: 1.5;
328
- color: ${e=>e.$disabled?vt.label.disabledColor:vt.label.color};
329
- margin-bottom: 4px;
330
- `,yo=a.div`
331
- display: flex;
332
- flex-direction: column;
333
- gap: 12px;
334
- `,Ze=I.newClassNameGetter("checkbox-group"),Ro=({className:e,classnames:r,disabled:i,label:n,onChange:l,options:s,ref:u,value:d,variant:b="normal",...p})=>{const f=(O,w)=>{l(w?[...d,O]:d.filter(k=>k!==O))};return o.jsxs(Co,{...p,ref:u,className:Ze("container",e),children:[n&&o.jsx(ko,{className:Ze("label",r==null?void 0:r.label),$disabled:i,children:n}),o.jsx(yo,{className:Ze("options",r==null?void 0:r.options),children:s.map(O=>o.jsx(We,{className:r==null?void 0:r.checkbox,checked:d.includes(O.value),label:O.label,disabled:i,variant:b,onChange:w=>f(O.value,w.target.checked)},O.value))})]})},wt={gray:{background:t.alpha(t.COLORS["iron-grey"],10),color:t.COLORS["iron-grey"],deleteHover:t.alpha(t.COLORS["iron-grey"],20)},red:{background:t.alpha(t.COLORS.red,10),color:t.COLORS.red,deleteHover:t.alpha(t.COLORS.red,20)},blue:{background:t.alpha(t.COLORS["steel-blue"],10),color:t.COLORS["steel-blue"],deleteHover:t.alpha(t.COLORS["steel-blue"],20)},black:{background:t.COLORS.black,color:t.COLORS.white,deleteHover:t.alpha(t.COLORS.white,20)}},dt=e=>wt[e]??wt.gray,Lo=a.span`
335
- display: inline-flex;
336
- align-items: center;
337
- gap: 6px;
338
- padding: 0 ${e=>e.$deletable?"7px":"10px"} 0 10px;
339
- border-radius: 12px;
340
- height: 24px;
341
- font-size: 12px;
342
- font-weight: 500;
343
- line-height: 1.5;
344
- background-color: ${e=>dt(e.$variant).background};
345
- color: ${e=>dt(e.$variant).color};
346
- `,vo=a.button`
347
- display: inline-flex;
348
- align-items: center;
349
- justify-content: center;
350
- padding: 0;
351
- margin: 0;
352
- margin-left: 2px;
353
- border: none;
354
- background: transparent;
355
- color: inherit;
356
- cursor: pointer;
357
- border-radius: 4px;
358
- transition: background-color 0.15s ease;
359
-
360
- &:hover {
361
- background-color: ${e=>dt(e.$variant).deleteHover};
362
- }
363
-
364
- & svg {
365
- width: 14px;
366
- height: 14px;
367
- }
368
- `,wo=a.span`
369
- display: inline-flex;
370
- align-items: center;
371
- justify-content: center;
372
- flex-shrink: 0;
373
-
374
- & svg {
375
- width: 14px;
376
- height: 14px;
377
- }
378
- `,mo=a.span`
379
- flex: 1 0 auto;
380
- text-align: center;
381
- line-height: 1.4;
382
- `,_e=I.newClassNameGetter("chip"),Be=({children:e,className:r,classnames:i,deletable:n,icon:l,onDelete:s,ref:u,variant:d="gray",...b})=>o.jsxs(Lo,{...b,ref:u,className:_e("container",r),$variant:d,$deletable:!!n,children:[l&&o.jsx(wo,{className:_e("icon",i==null?void 0:i.icon),children:l}),o.jsx(mo,{className:_e("label",i==null?void 0:i.label),children:e}),n&&o.jsx(vo,{type:"button",className:_e("delete",i==null?void 0:i.delete),$variant:d,onClick:s,children:o.jsx(o.X,{})})]}),Ve={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},Re={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},ee=36,Ke=2,jo=12,Qt=(e,r,i="en")=>{const n=e.getFullYear(),l=e.getMonth(),s=e.getDate(),u=e.getHours(),d=e.getMinutes(),b=e.getSeconds(),p=u%12||12,f=u>=12,O=new Intl.DateTimeFormat(i,{month:"long"}).format(e),w=new Intl.DateTimeFormat(i,{month:"short"}).format(e),k=new Intl.DateTimeFormat(i,{weekday:"long"}).format(e),L=new Intl.DateTimeFormat(i,{weekday:"short"}).format(e),C=c=>c.toString().padStart(2,"0"),R=c=>c.toString().padStart(2," "),j=c=>`\0${c}\0`,$=[["2006","YEARFOUR",n.toString()],["January","MONTHLONG",O],["Monday","WEEKDAYLONG",k],["Jan","MONTHSHORT",w],["Mon","WEEKDAYSHORT",L],["06","YEARTWO",n.toString().slice(-2)],["01","MONTHPAD",C(l+1)],["_2","DAYSPACE",R(s)],["02","DAYPAD",C(s)],["15","HOURTWENTYFOUR",C(u)],["03","HOURTWELVEPAD",C(p)],["04","MINUTE",C(d)],["05","SECOND",C(b)],["PM","AMPMUP",f?"PM":"AM"],["pm","AMPMLOW",f?"pm":"am"],["1","MONTH",(l+1).toString()],["2","DAY",s.toString()],["3","HOURTWELVE",p.toString()]];let S=r;for(const[c,T]of $)S=S.split(c).join(j(T));for(const[,c,T]of $)S=S.split(j(c)).join(T);return S},Po=(e,r)=>new Date(e,r+1,0).getDate(),No=(e,r)=>new Date(e,r,1).getDay(),zo=(e,r,i=1)=>{const n=Po(e,r);let s=No(e,r)-i;s<0&&(s+=7);const u=[];for(let d=0;d<s;d++)u.push(null);for(let d=1;d<=n;d++)u.push(d);for(;u.length<42;)u.push(null);return u},To=(e,r=1)=>{const i=[];for(let n=0;n<7;n++){const l=(r+n)%7,s=new Date(2024,0,7+l);i.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(s))}return i},Do=e=>{const r=[];for(let i=0;i<12;i++){const n=new Date(2024,i,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(n))}return r},mt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),jt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),Io=(e,r)=>e.getFullYear()===r.getFullYear(),Pt=(e,r,i,n,l)=>{const s=new Date(e,r,i);if(n){const u=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(s<u)return!0}if(l){const u=new Date(l.getFullYear(),l.getMonth(),l.getDate());if(s>u)return!0}return!1},Nt=(e,r,i,n)=>{if(i){const l=i.getFullYear(),s=i.getMonth();if(e<l||e===l&&r<s)return!0}if(n){const l=n.getFullYear(),s=n.getMonth();if(e>l||e===l&&r>s)return!0}return!1},zt=(e,r,i)=>!!(r&&e<r.getFullYear()||i&&e>i.getFullYear()),_o=(e,r=12)=>{const i=e-Math.floor(r/2),n=[];for(let l=0;l<r;l++)n.push(i+l);return n},Eo=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},Ao=a.div`
383
- position: relative;
384
- display: inline-flex;
385
- flex-direction: column;
386
- gap: 2px;
387
- min-width: 180px;
388
- width: ${({$fullWidth:e})=>e?"100%":"fit-content"};
389
- `,Mo=a(te)`
390
- margin-left: 6px;
391
- `,Fo=a(re)`
392
- margin-left: 6px;
393
- `,Yo=a.button`
394
- display: flex;
395
- align-items: center;
396
- justify-content: space-between;
397
- gap: 8px;
398
- width: 100%;
399
- cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
400
- outline: none;
401
- font-size: 14px;
402
- font-weight: 500;
403
- text-align: left;
404
- height: ${({$size:e})=>Ve[e].height};
405
- padding: ${({$size:e})=>Ve[e].padding};
406
- border-radius: ${({$size:e})=>Ve[e].radius};
407
- color: ${({$variant:e,$disabled:r,$hasValue:i})=>i?Re[e].color[r?"disabled":"static"]:Re[e].placeholder[r?"disabled":"static"]};
408
- border: 1px solid
409
- ${({$variant:e,$disabled:r})=>Re[e].border[r?"disabled":"static"]};
410
- background-color: ${({$variant:e,$disabled:r})=>Re[e].background[r?"disabled":"static"]};
411
-
412
- ${({$open:e,$variant:r})=>e&&`
413
- outline: 2px solid ${Re[r].focus};
414
- `}
415
- `,Go=a.span`
416
- flex: 1;
417
- overflow: hidden;
418
- text-overflow: ellipsis;
419
- white-space: nowrap;
420
- `,Vo=a.span`
421
- display: flex;
422
- align-items: center;
423
- justify-content: center;
424
- flex-shrink: 0;
425
- transition: transform 0.15s ease;
426
- transform: ${({$open:e})=>e?"rotate(180deg)":"rotate(0deg)"};
427
- `,er=`
428
- z-index: 100;
429
- background-color: ${t.COLORS.white};
430
- border: 1px solid ${t.alpha(t.COLORS.black,15)};
431
- border-radius: 12px;
432
- box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
433
- padding: ${jo}px;
434
- `,tr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Bo=a.div`
435
- position: absolute;
436
- ${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
437
- left: 0;
438
- ${er}
439
- opacity: ${({$open:e})=>e?1:0};
440
- visibility: ${({$open:e})=>e?"visible":"hidden"};
441
- transform: ${({$open:e,$position:r})=>tr(e,r)};
442
- transition:
443
- opacity 0.15s ease,
444
- transform 0.15s ease,
445
- visibility 0.15s;
446
- `,Ho=a.div`
447
- position: fixed;
448
- ${er}
449
- opacity: ${({$open:e})=>e?1:0};
450
- visibility: ${({$open:e})=>e?"visible":"hidden"};
451
- transform: ${({$open:e,$position:r})=>tr(e,r)};
452
- transition:
453
- opacity 0.15s ease,
454
- transform 0.15s ease,
455
- visibility 0.15s;
456
- `,Je=a.div`
457
- display: flex;
458
- align-items: center;
459
- justify-content: space-between;
460
- margin-bottom: 8px;
461
- `,Qe=a.button`
462
- display: flex;
463
- align-items: center;
464
- gap: 4px;
465
- padding: 4px 8px;
466
- border: none;
467
- background: transparent;
468
- border-radius: 6px;
469
- font-size: 14px;
470
- font-weight: 600;
471
- color: ${t.COLORS.black};
472
- cursor: pointer;
473
-
474
- &:hover {
475
- background-color: ${t.alpha(t.COLORS.black,5)};
476
- }
477
- `,ue=a.button`
478
- display: flex;
479
- align-items: center;
480
- justify-content: center;
481
- width: 28px;
482
- height: 28px;
483
- border: none;
484
- background: transparent;
485
- border-radius: 6px;
486
- color: ${t.COLORS.black};
487
- cursor: pointer;
488
-
489
- &:hover {
490
- background-color: ${t.alpha(t.COLORS.black,5)};
491
- }
492
-
493
- &:disabled {
494
- opacity: 0.3;
495
- cursor: not-allowed;
496
-
497
- &:hover {
498
- background: transparent;
499
- }
500
- }
501
- `,et=a.div`
502
- display: flex;
503
- gap: 4px;
504
- `,Wo=a.div`
505
- display: grid;
506
- grid-template-columns: repeat(7, ${ee}px);
507
- gap: ${Ke}px;
508
- margin-bottom: 4px;
509
- `,Ko=a.div`
510
- display: flex;
511
- align-items: center;
512
- justify-content: center;
513
- height: ${ee}px;
514
- font-size: 12px;
515
- font-weight: 500;
516
- color: ${t.alpha(t.COLORS.black,50)};
517
- text-transform: uppercase;
518
- `,Uo=a.div`
519
- display: grid;
520
- grid-template-columns: repeat(7, ${ee}px);
521
- gap: ${Ke}px;
522
- `,qo=a.button`
523
- display: flex;
524
- align-items: center;
525
- justify-content: center;
526
- width: ${ee}px;
527
- height: ${ee}px;
528
- border: none;
529
- border-radius: 8px;
530
- font-size: 13px;
531
- font-weight: ${({$selected:e,$today:r})=>e||r?600:500};
532
- cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
533
- background-color: ${({$selected:e})=>e?t.COLORS.black:"transparent"};
534
- color: ${({$selected:e,$disabled:r})=>e?t.COLORS.white:r?t.alpha(t.COLORS.black,30):t.COLORS.black};
535
-
536
- ${({$today:e,$selected:r})=>e&&!r&&`
537
- box-shadow: inset 0 0 0 1px ${t.COLORS.black};
538
- `}
539
-
540
- &:hover:not(:disabled) {
541
- background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
542
- }
543
-
544
- &:disabled {
545
- cursor: not-allowed;
546
- }
547
- `,Xo=a.div`
548
- display: grid;
549
- grid-template-columns: repeat(3, 1fr);
550
- gap: 8px;
551
- width: ${7*ee+6*Ke}px;
552
- `,Zo=a.button`
553
- display: flex;
554
- align-items: center;
555
- justify-content: center;
556
- padding: 12px 8px;
557
- border: none;
558
- border-radius: 8px;
559
- font-size: 14px;
560
- font-weight: ${({$selected:e,$current:r})=>e||r?600:400};
561
- cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
562
- background-color: ${({$selected:e})=>e?t.COLORS.black:"transparent"};
563
- color: ${({$selected:e,$disabled:r})=>e?t.COLORS.white:r?t.alpha(t.COLORS.black,30):t.COLORS.black};
564
-
565
- ${({$current:e,$selected:r})=>e&&!r&&`
566
- box-shadow: inset 0 0 0 1px ${t.COLORS.black};
567
- `}
568
-
569
- &:hover:not(:disabled) {
570
- background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
571
- }
572
- `,Jo=a.div`
573
- display: grid;
574
- grid-template-columns: repeat(3, 1fr);
575
- gap: 8px;
576
- width: ${7*ee+6*Ke}px;
577
- `,Qo=a.button`
578
- display: flex;
579
- align-items: center;
580
- justify-content: center;
581
- padding: 12px 8px;
582
- border: none;
583
- border-radius: 8px;
584
- font-size: 14px;
585
- font-weight: ${({$selected:e,$current:r})=>e||r?600:400};
586
- cursor: ${({$disabled:e})=>e?"not-allowed":"pointer"};
587
- background-color: ${({$selected:e})=>e?t.COLORS.black:"transparent"};
588
- color: ${({$selected:e,$disabled:r})=>e?t.COLORS.white:r?t.alpha(t.COLORS.black,30):t.COLORS.black};
589
-
590
- ${({$current:e,$selected:r})=>e&&!r&&`
591
- box-shadow: inset 0 0 0 1px ${t.COLORS.black};
592
- `}
593
-
594
- &:hover:not(:disabled) {
595
- background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
596
- }
597
- `,ei=a.div`
598
- width: ${ee}px;
599
- height: ${ee}px;
600
- `,W=I.newClassNameGetter("date-picker"),Ee=4,ti=300,ri=({value:e,onChange:r,mode:i="date",displayFormat:n,placeholder:l,locale:s="en",weekStartsOn:u=1,minDate:d,maxDate:b,size:p="default",variant:f="normal",disabled:O=!1,fullWidth:w=!1,label:k,message:L,portalRenderNode:C,open:R,onOpen:j,onClose:$,className:S,classnames:c,ref:T,...D})=>{const z=h.useMemo(()=>new Date,[]),[Y,F]=h.useState(!1),[A,M]=h.useState({top:0,left:0}),[G,m]=h.useState("bottom"),[g,_]=h.useState(()=>i==="year"?"years":i==="month"?"months":"days"),[v,P]=h.useState(()=>e??z),[V,Z]=h.useState(()=>((e==null?void 0:e.getFullYear())??z.getFullYear())-6),ae=h.useRef(null),y=h.useRef(null),N=h.useRef(null),B=R!==void 0,H=B?R:Y,pe=n??Eo(i),Ne=h.useMemo(()=>To(s,u),[s,u]),Ue=h.useMemo(()=>Do(s),[s]),cr=h.useMemo(()=>zo(v.getFullYear(),v.getMonth(),u),[v,u]),ze=h.useMemo(()=>_o(V+6,12),[V]),ht=h.useMemo(()=>e?Qt(e,pe,s):null,[e,pe,s]),sr=l??pe.replace(/2006|06|January|Jan|01|02/g,"__"),xe=h.useCallback(()=>{var $e;if(!y.current)return;const x=y.current.getBoundingClientRect(),E=(($e=N.current)==null?void 0:$e.offsetHeight)??ti,Se=window.innerHeight-x.bottom-Ee,Te=x.top-Ee,he=Se<E&&Te>Se?"top":"bottom";if(m(he),C){const De=he==="bottom"?x.bottom+Ee:x.top-E-Ee;M({top:De,left:x.left})}},[C]),ut=h.useCallback(()=>{if(O)return;B||F(!0),j==null||j(),_(i==="year"?"years":i==="month"?"months":"days");const x=e??z;P(x),Z(x.getFullYear()-6)},[O,B,j,i,e,z]),K=h.useCallback(()=>{B||F(!1),$==null||$()},[B,$]),pr=h.useCallback(()=>{H?K():ut()},[H,K,ut]),hr=h.useCallback(x=>{const E=new Date(v.getFullYear(),v.getMonth(),x);r==null||r(E),K()},[v,r,K]),ur=h.useCallback(x=>{if(i==="month"){const E=new Date(v.getFullYear(),x,1);r==null||r(E),K()}else P(new Date(v.getFullYear(),x,1)),_("days")},[i,v,r,K]),br=h.useCallback(x=>{if(i==="year"){const E=new Date(x,0,1);r==null||r(E),K()}else i==="month"?(P(new Date(x,v.getMonth(),1)),_("months")):(P(new Date(x,v.getMonth(),1)),_("months"))},[i,v,r,K]),Or=h.useCallback(()=>{P(x=>new Date(x.getFullYear(),x.getMonth()-1,1))},[]),gr=h.useCallback(()=>{P(x=>new Date(x.getFullYear(),x.getMonth()+1,1))},[]),fr=h.useCallback(()=>{P(x=>new Date(x.getFullYear()-1,x.getMonth(),1))},[]),xr=h.useCallback(()=>{P(x=>new Date(x.getFullYear()+1,x.getMonth(),1))},[]),Sr=h.useCallback(()=>{Z(x=>x-12)},[]),$r=h.useCallback(()=>{Z(x=>x+12)},[]),bt=h.useCallback(()=>{g==="days"?_("months"):g==="months"&&_("years")},[g]);h.useLayoutEffect(()=>{H&&xe()},[H,xe]),h.useEffect(()=>{const x=he=>{const $e=he.target,De=ae.current&&!ae.current.contains($e),vr=N.current&&!N.current.contains($e);C?De&&vr&&K():De&&K()},E=he=>{he.key==="Escape"&&K()},Se=()=>{H&&C&&xe()},Te=()=>{H&&C&&xe()};return H&&(document.addEventListener("mousedown",x),document.addEventListener("keydown",E),C&&(window.addEventListener("scroll",Se,!0),window.addEventListener("resize",Te))),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",E),window.removeEventListener("scroll",Se,!0),window.removeEventListener("resize",Te)}},[H,K,C,xe]);const Cr=Ve[p].iconSize,kr=()=>o.jsxs(o.Fragment,{children:[o.jsxs(Je,{className:W("header",c==null?void 0:c.header),children:[o.jsx(Qe,{onClick:bt,type:"button",children:new Intl.DateTimeFormat(s,{month:"long",year:"numeric"}).format(v)}),o.jsxs(et,{children:[o.jsx(ue,{onClick:Or,type:"button","aria-label":"Previous month",children:o.jsx(o.ChevronLeft,{size:16})}),o.jsx(ue,{onClick:gr,type:"button","aria-label":"Next month",children:o.jsx(o.ChevronRight,{size:16})})]})]}),o.jsx(Wo,{children:Ne.map((x,E)=>o.jsx(Ko,{children:x},E))}),o.jsx(Uo,{className:W("grid",c==null?void 0:c.grid),children:cr.map((x,E)=>x===null?o.jsx(ei,{},E):o.jsx(qo,{type:"button",className:W("cell",c==null?void 0:c.cell),$selected:e?mt(e,new Date(v.getFullYear(),v.getMonth(),x)):!1,$today:mt(z,new Date(v.getFullYear(),v.getMonth(),x)),$disabled:Pt(v.getFullYear(),v.getMonth(),x,d,b),disabled:Pt(v.getFullYear(),v.getMonth(),x,d,b),onClick:()=>hr(x),children:x},E))})]}),yr=()=>o.jsxs(o.Fragment,{children:[o.jsxs(Je,{className:W("header",c==null?void 0:c.header),children:[o.jsx(Qe,{onClick:bt,type:"button",children:v.getFullYear()}),o.jsxs(et,{children:[o.jsx(ue,{onClick:fr,type:"button","aria-label":"Previous year",children:o.jsx(o.ChevronLeft,{size:16})}),o.jsx(ue,{onClick:xr,type:"button","aria-label":"Next year",children:o.jsx(o.ChevronRight,{size:16})})]})]}),o.jsx(Xo,{className:W("grid",c==null?void 0:c.grid),children:Ue.map((x,E)=>o.jsx(Zo,{type:"button",className:W("cell",c==null?void 0:c.cell),$selected:e?jt(e,new Date(v.getFullYear(),E,1)):!1,$current:jt(z,new Date(v.getFullYear(),E,1)),$disabled:Nt(v.getFullYear(),E,d,b),disabled:Nt(v.getFullYear(),E,d,b),onClick:()=>ur(E),children:x},E))})]}),Rr=()=>o.jsxs(o.Fragment,{children:[o.jsxs(Je,{className:W("header",c==null?void 0:c.header),children:[o.jsxs(Qe,{type:"button",style:{cursor:"default"},children:[ze[0]," - ",ze[ze.length-1]]}),o.jsxs(et,{children:[o.jsx(ue,{onClick:Sr,type:"button","aria-label":"Previous years",children:o.jsx(o.ChevronLeft,{size:16})}),o.jsx(ue,{onClick:$r,type:"button","aria-label":"Next years",children:o.jsx(o.ChevronRight,{size:16})})]})]}),o.jsx(Jo,{className:W("grid",c==null?void 0:c.grid),children:ze.map(x=>o.jsx(Qo,{type:"button",className:W("cell",c==null?void 0:c.cell),$selected:e?Io(e,new Date(x,0,1)):!1,$current:z.getFullYear()===x,$disabled:zt(x,d,b),disabled:zt(x,d,b),onClick:()=>br(x),children:x},x))})]}),Ot=()=>{switch(g){case"days":return kr();case"months":return yr();case"years":return Rr()}},Lr=C?He.createPortal(o.jsx(Ho,{ref:N,$open:H,$position:G,className:W("calendar",c==null?void 0:c.calendar),style:{top:A.top,left:A.left},children:Ot()}),C):o.jsx(Bo,{ref:N,$open:H,$position:G,className:W("calendar",c==null?void 0:c.calendar),children:Ot()});return o.jsxs(Ao,{...D,ref:T??ae,$fullWidth:w,className:W("container",S),children:[k&&o.jsx(Mo,{variant:f,children:k}),o.jsxs(Yo,{ref:y,type:"button",onClick:pr,disabled:O,$size:p,$variant:f,$disabled:O,$open:H,$hasValue:!!ht,className:W("trigger",c==null?void 0:c.trigger),children:[o.jsx(Go,{children:ht??sr}),o.jsx(Vo,{$open:H,children:o.jsx(o.ChevronDown,{size:Cr})})]}),Lr,L&&o.jsx(Fo,{variant:f,children:L})]})},Tt={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},Dt={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},J=e=>Dt[e]??Dt.normal,Pe=e=>Tt[e]??Tt.default,oi=a.div`
601
- display: grid;
602
- flex-direction: column;
603
- gap: 2px;
604
- width: ${e=>e.$fullWidth?"100%":"fit-content"};
605
- `,ii=a(te)`
606
- margin-left: 6px;
607
- `,ai=a(re)`
608
- margin-left: 6px;
609
- `,ni=a.div`
610
- display: flex;
611
- align-items: stretch;
612
- border: 1px solid
613
- ${e=>J(e.$variant).border[e.$disabled?"disabled":"static"]};
614
- border-radius: ${e=>Pe(e.$size).radius};
615
- overflow: hidden;
616
- `,li=a.span`
617
- display: flex;
618
- align-items: center;
619
- flex-shrink: 0;
620
- padding: ${e=>Pe(e.$size).padding};
621
- font-size: 14px;
622
- font-weight: 500;
623
- white-space: nowrap;
624
- user-select: none;
625
- cursor: ${e=>e.$disabled?"not-allowed":"default"};
626
- color: ${e=>J(e.$variant).color[e.$disabled?"disabled":"static"]};
627
- background-color: ${e=>e.$variant==="error"?t.alpha(t.COLORS.red,8):t.alpha(t.COLORS.black,6)};
628
- border-right: 1px solid
629
- ${e=>J(e.$variant).border[e.$disabled?"disabled":"static"]};
630
- `,di=a.input`
631
- flex: 1;
632
- min-width: 0;
633
- outline: none;
634
- font-size: 14px;
635
- font-weight: 500;
636
- height: ${e=>Pe(e.$size).height};
637
- padding: ${e=>Pe(e.$size).padding};
638
- border-radius: ${e=>e.$hasPrefix?"0":Pe(e.$size).radius};
639
-
640
- color: ${e=>J(e.$variant).color.static};
641
- border: ${e=>e.$hasPrefix?"none":`1px solid ${J(e.$variant).border.static}`};
642
- background-color: ${e=>J(e.$variant).background.static};
643
-
644
- &::placeholder {
645
- color: ${e=>J(e.$variant).placeholder.static};
646
- }
647
-
648
- &:disabled {
649
- cursor: not-allowed;
650
- color: ${e=>J(e.$variant).color.disabled};
651
- background-color: ${e=>J(e.$variant).background.disabled};
652
- border-color: ${e=>e.$hasPrefix?"transparent":J(e.$variant).border.disabled};
653
-
654
- &::placeholder {
655
- color: ${e=>J(e.$variant).placeholder.disabled};
656
- }
657
- }
658
- `,Ae=I.newClassNameGetter("input"),rr=({className:e,classnames:r,disabled:i,fullWidth:n,label:l,ref:s,message:u,prefix:d,size:b="default",variant:p="normal",...f})=>{const O=d!=null,w=o.jsx(di,{...f,ref:s,disabled:i,$size:b,$variant:p,$hasPrefix:O,className:Ae("input",r==null?void 0:r.input)});return o.jsxs(oi,{className:Ae("container",e),$fullWidth:!!n,children:[o.jsx(ii,{variant:p,className:Ae("label",r==null?void 0:r.label),children:l}),O?o.jsxs(ni,{$size:b,$variant:p,$disabled:!!i,children:[o.jsx(li,{$size:b,$variant:p,$disabled:!!i,className:Ae("prefix"),children:d}),w]}):w,u&&o.jsx(ai,{variant:p,children:u})]})},ci=a.div`
659
- position: fixed;
660
- inset: 0;
661
- z-index: 1000;
662
- display: flex;
663
- align-items: center;
664
- justify-content: center;
665
- background-color: ${t.alpha(t.COLORS.black,50)};
666
- animation: ${t.KEYFRAMES.fadeIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
667
- `,si=a.div`
668
- position: relative;
669
- z-index: 1001;
670
- width: ${e=>e.$width};
671
- max-width: calc(100vw - 32px);
672
- max-height: calc(100vh - 32px);
673
- overflow: auto;
674
- background-color: ${t.COLORS.white};
675
- border-radius: 16px;
676
- box-shadow: 0 8px 32px ${t.alpha(t.COLORS.black,20)};
677
- animation: ${t.KEYFRAMES.scaleIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
678
- `,It=I.newClassNameGetter("modal"),or=({animated:e,children:r,className:i,classnames:n,open:l,ref:s,width:u="500px",...d})=>l?He.createPortal(o.jsx(ci,{className:It("overlay",n==null?void 0:n.overlay),$animated:!!e,children:o.jsx(si,{...d,ref:s,className:It("content",i,n==null?void 0:n.content),$animated:!!e,$width:u,children:r})}),document.body):null,ir={normal:{border:t.COLORS["iron-grey"],placeholder:t.COLORS["iron-grey"]},error:{border:t.COLORS.red,placeholder:t.alpha(t.COLORS.red,40)}},pi=a.div`
679
- display: flex;
680
- flex-direction: column;
681
- gap: 4px;
682
- `,hi=a(te)`
683
- margin-left: 6px;
684
- `,ui=a.div`
685
- display: flex;
686
- flex-wrap: wrap;
687
- align-items: center;
688
- gap: 6px;
689
- min-height: 44px;
690
- padding: 8px 12px;
691
- border: 1px dashed ${e=>ir[e.$variant].border};
692
- border-radius: 8px;
693
- background: ${t.COLORS.white};
694
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
695
- opacity: ${e=>e.$disabled?.5:1};
696
- transition: border-color 0.15s ease;
697
- text-align: left;
698
-
699
- &:hover {
700
- border-color: ${e=>e.$disabled?void 0:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
701
- }
702
- `,bi=a.span`
703
- color: ${e=>ir[e.$variant].placeholder};
704
- font-size: 14px;
705
- `,Oi=a.div`
706
- display: flex;
707
- flex-direction: column;
708
- padding: 20px;
709
- gap: 16px;
710
- `,gi=a.div`
711
- display: flex;
712
- align-items: center;
713
- justify-content: space-between;
714
- `,fi=a.h3`
715
- margin: 0;
716
- font-size: 18px;
717
- font-weight: 600;
718
- color: ${t.COLORS.black};
719
- `,xi=a.div`
720
- display: flex;
721
- flex-direction: column;
722
- gap: 4px;
723
- min-height: 200px;
724
- max-height: 300px;
725
- overflow-y: auto;
726
- `,Si=a.label`
727
- display: flex;
728
- align-items: center;
729
- gap: 10px;
730
- padding: 10px 12px;
731
- border-radius: 8px;
732
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
733
- opacity: ${e=>e.$disabled?.5:1};
734
- transition: background-color 0.15s ease;
735
-
736
- &:hover {
737
- background-color: ${e=>e.$disabled?"transparent":t.COLORS.gray};
738
- }
739
- `,$i=a.span`
740
- font-size: 14px;
741
- color: ${t.COLORS.black};
742
- `,Ci=a.div`
743
- display: flex;
744
- align-items: center;
745
- justify-content: center;
746
- padding: 32px 16px;
747
- color: ${t.COLORS["iron-grey"]};
748
- font-size: 14px;
749
- text-align: center;
750
- `,ki=a(re)`
751
- margin-left: 6px;
752
- `,q=I.newClassNameGetter("multi-select"),yi=({className:e,classnames:r,disabled:i=!1,emptyMessage:n="No options found",label:l,maxVisible:s=1/0,message:u,modalTitle:d="Select options",onChange:b,options:p,placeholder:f="Select...",ref:O,searchPlaceholder:w="Search...",value:k,variant:L="normal",...C})=>{const[R,j]=h.useState(!1),[$,S]=h.useState(""),c=h.useRef(null),T=h.useMemo(()=>p.filter(m=>k.includes(m.value)),[p,k]),D=h.useMemo(()=>{if(!$.trim())return p;const m=$.toLowerCase().trim();return p.filter(g=>g.label.toLowerCase().includes(m))},[p,$]),z=s===1/0?T:T.slice(0,s),Y=T.length-z.length,F=()=>{i||(j(!0),S(""))},A=h.useCallback(()=>{j(!1),S("")},[]),M=m=>{k.includes(m)?b(k.filter(g=>g!==m)):b([...k,m])},G=m=>{b(k.filter(g=>g!==m))};return h.useEffect(()=>{if(!R)return;const m=g=>{c.current&&!c.current.contains(g.target)&&A()};return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[R,A]),o.jsxs(pi,{...C,ref:O,className:q("container",e),children:[l&&o.jsx(hi,{variant:L,className:q("label",r==null?void 0:r.trigger),children:l}),o.jsx(ui,{$variant:L,$disabled:i,onClick:F,className:q("trigger",r==null?void 0:r.trigger),children:T.length===0?o.jsx(bi,{$variant:L,className:q("placeholder",r==null?void 0:r.placeholder),children:f}):o.jsxs(o.Fragment,{children:[z.map(m=>o.jsx(Be,{variant:L==="error"?"red":"gray",deletable:!0,onDelete:()=>G(m.value),onClick:g=>g.stopPropagation(),className:q("chip",r==null?void 0:r.chip),children:m.label},m.value)),Y>0&&o.jsxs(Be,{variant:L==="error"?"red":"gray",onClick:m=>m.stopPropagation(),className:q("chip",r==null?void 0:r.chip),children:["+",Y]})]})}),u&&o.jsx(ki,{variant:L,className:q("message"),children:u}),o.jsx(or,{open:R,width:"400px",animated:!0,className:q("modal",r==null?void 0:r.modal),children:o.jsxs(Oi,{ref:c,children:[o.jsxs(gi,{children:[o.jsx(fi,{children:d}),o.jsx(Jt,{variant:"transparent",size:"compact",icon:o.jsx(o.X,{}),keyBindings:["Escape"],onClick:A})]}),o.jsx(rr,{type:"text",value:$,onChange:m=>S(m.target.value),placeholder:w,autoFocus:!0,fullWidth:!0,className:q("search",r==null?void 0:r.search)}),o.jsx(xi,{className:q("options",r==null?void 0:r.options),children:D.length===0?o.jsx(Ci,{className:q("empty",r==null?void 0:r.empty),children:n}):D.map(m=>o.jsxs(Si,{$disabled:!!m.disabled,className:q("option",r==null?void 0:r.option),children:[o.jsx(We,{checked:k.includes(m.value),disabled:m.disabled,onChange:()=>M(m.value)}),o.jsx($i,{children:m.label})]},m.value))})]})})]})},_t={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},Et={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},je=e=>_t[e]??_t.default,be=e=>Et[e]??Et.normal,Ri=a.div`
753
- display: inline-flex;
754
- flex-direction: column;
755
- gap: 2px;
756
- `,Li=a(te)`
757
- margin-left: 6px;
758
- `,vi=a.div`
759
- display: flex;
760
- gap: ${e=>je(e.$size).gap};
761
- `,wi=a.input`
762
- width: ${e=>je(e.$size).width};
763
- height: ${e=>je(e.$size).height};
764
- border-radius: ${e=>je(e.$size).radius};
765
- font-size: ${e=>je(e.$size).fontSize};
766
- font-weight: 600;
767
- text-align: center;
768
- outline: none;
769
- border: 1px solid ${e=>be(e.$variant).border.static};
770
- background-color: ${e=>be(e.$variant).background.static};
771
- color: ${e=>be(e.$variant).color.static};
772
- transition:
773
- border-color 0.15s ease,
774
- box-shadow 0.15s ease;
775
-
776
- &:disabled {
777
- cursor: not-allowed;
778
- color: ${e=>be(e.$variant).color.disabled};
779
- background-color: ${e=>be(e.$variant).background.disabled};
780
- border-color: ${e=>be(e.$variant).border.disabled};
781
- }
782
-
783
- &::selection {
784
- background-color: transparent;
785
- }
786
- `,mi=a(re)`
787
- margin-left: 6px;
788
- `,Me=I.newClassNameGetter("otp-code"),ji=({autoFocus:e,className:r,classnames:i,disabled:n,label:l,length:s=6,message:u,onChange:d,ref:b,size:p="default",value:f="",variant:O="normal",...w})=>{const k=h.useRef([]);h.useEffect(()=>{e&&k.current[0]&&k.current[0].focus()},[e]);const L=h.useCallback($=>{const S=k.current[$];S&&(S.focus(),S.select())},[]),C=h.useCallback(($,S)=>{const T=S.target.value.replace(/\D/g,"").slice(-1);if(!T)return;const D=f.padEnd(s," ").split(""),z=D.findIndex(M=>M===" "||M===""),Y=z!==-1?z:$;D[Y]=T;const F=D.join("").replace(/ /g,"");d==null||d(F);const A=Y+1;A<s&&L(A)},[f,s,d,L]),R=h.useCallback(($,S)=>{if(S.key==="Backspace"){S.preventDefault();const c=f.split("");c[$]?(c[$]="",d==null||d(c.join(""))):$>0&&(c[$-1]="",d==null||d(c.join("")),L($-1))}else S.key==="ArrowLeft"&&$>0?(S.preventDefault(),L($-1)):S.key==="ArrowRight"&&$<s-1&&(S.preventDefault(),L($+1))},[f,s,d,L]),j=h.useCallback($=>{$.preventDefault();const S=$.clipboardData.getData("text").replace(/\D/g,"").slice(0,s);if(S){d==null||d(S);const c=Math.min(S.length,s-1);L(c)}},[s,d,L]);return o.jsxs(Ri,{ref:b,className:Me("container",r),...w,children:[l&&o.jsx(Li,{variant:O,className:Me("label",i==null?void 0:i.label),children:l}),o.jsx(vi,{$size:p,children:Array.from({length:s}).map(($,S)=>o.jsx(wi,{ref:c=>{k.current[S]=c},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:n,value:f[S]??"",onChange:c=>C(S,c),onKeyDown:c=>R(S,c),onPaste:j,onFocus:c=>c.target.select(),$size:p,$variant:O,className:Me("input",i==null?void 0:i.input)},S))}),u&&o.jsx(mi,{variant:O,className:Me("message"),children:u})]})},At={normal:{box:{border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS["iron-grey"],background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS["iron-grey"],30)},dot:t.COLORS.black,label:t.COLORS.black},error:{box:{border:t.COLORS.red,borderChecked:t.COLORS.red,background:t.COLORS.white,backgroundChecked:t.COLORS.white,focusShadow:t.alpha(t.COLORS.red,30)},dot:t.COLORS.red,label:t.COLORS.red}},fe=e=>At[e]??At.normal,Pi=a.label`
789
- display: inline-flex;
790
- align-items: flex-start;
791
- gap: 8px;
792
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
793
- opacity: ${e=>e.$disabled?.5:1};
794
- `,Ni=a.input`
795
- position: absolute;
796
- opacity: 0;
797
- width: 0;
798
- height: 0;
799
- pointer-events: none;
800
- `,zi=a.span`
801
- display: inline-flex;
802
- align-items: center;
803
- justify-content: center;
804
- flex-shrink: 0;
805
- width: 18px;
806
- height: 18px;
807
- border-radius: 50%;
808
- border: 1.5px solid
809
- ${e=>e.$checked?fe(e.$variant).box.borderChecked:fe(e.$variant).box.border};
810
- background-color: ${e=>e.$checked?fe(e.$variant).box.backgroundChecked:fe(e.$variant).box.background};
811
- transition:
812
- border-color 0.15s ease,
813
- background-color 0.15s ease,
814
- box-shadow 0.15s ease;
815
- `,Ti=a.span`
816
- width: 8px;
817
- height: 8px;
818
- border-radius: 50%;
819
- background-color: ${e=>fe(e.$variant).dot};
820
- opacity: ${e=>e.$visible?1:0};
821
- transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
822
- transition:
823
- opacity 0.15s ease,
824
- transform 0.15s ease;
825
- `,Di=a.span`
826
- font-size: 14px;
827
- font-weight: 500;
828
- line-height: 1.5;
829
- color: ${e=>fe(e.$variant).label};
830
- user-select: none;
831
-
832
- a {
833
- color: inherit;
834
- text-decoration: underline;
835
- cursor: pointer;
836
-
837
- &:hover {
838
- text-decoration: none;
839
- }
840
- }
841
- `,Le=I.newClassNameGetter("radio"),st=({checked:e,className:r,classnames:i,disabled:n,label:l,onChange:s,ref:u,variant:d="normal",...b})=>o.jsxs(Pi,{className:Le("container",r),$disabled:!!n,$variant:d,children:[o.jsx(Ni,{...b,ref:u,type:"radio",className:Le("input",i==null?void 0:i.input),checked:e,disabled:n,onChange:s}),o.jsx(zi,{className:Le("box",i==null?void 0:i.box),$checked:e,$variant:d,children:o.jsx(Ti,{className:Le("dot",i==null?void 0:i.dot),$visible:e,$variant:d})}),l&&o.jsx(Di,{className:Le("label",i==null?void 0:i.label),$variant:d,children:l})]}),Mt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),focusRing:t.alpha(t.COLORS.black,20),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),focusRing:t.alpha(t.COLORS.red,20),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},ce=e=>Mt[e]??Mt.normal,Ii=a.label`
842
- display: grid;
843
- grid-template-columns: auto 1fr;
844
- align-items: start;
845
- gap: 8px;
846
- padding: 12px;
847
- background-color: ${e=>{const r=ce(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
848
- border: 1px solid
849
- ${e=>{const r=ce(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
850
- border-radius: 12px;
851
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
852
- transition:
853
- border-color 0.15s ease,
854
- background-color 0.15s ease;
855
- width: ${e=>e.$fullWidth?"100%":"fit-content"};
856
- min-width: 0;
857
-
858
- &:hover:not([data-disabled='true']) {
859
- border-color: ${e=>{const r=ce(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
860
- }
861
-
862
- .vacano_radio_container {
863
- pointer-events: none;
864
- }
865
- `,_i=a.input`
866
- position: absolute;
867
- width: 1px;
868
- height: 1px;
869
- margin: -1px;
870
- padding: 0;
871
- overflow: hidden;
872
- clip: rect(0, 0, 0, 0);
873
- white-space: nowrap;
874
- border: 0;
875
- `,Ei=a.div`
876
- display: flex;
877
- flex-direction: column;
878
- gap: 2px;
879
- min-width: 0;
880
- `,Ai=a.span`
881
- font-size: 14px;
882
- font-weight: 500;
883
- line-height: 1.4;
884
- color: ${e=>ce(e.$variant).label.static};
885
-
886
- label[data-disabled='true'] & {
887
- color: ${e=>ce(e.$variant).label.disabled};
888
- }
889
- `,Mi=a.span`
890
- font-size: 12px;
891
- font-weight: 400;
892
- line-height: 1.4;
893
- color: ${e=>ce(e.$variant).description.static};
894
-
895
- label[data-disabled='true'] & {
896
- color: ${e=>ce(e.$variant).description.disabled};
897
- }
898
- `,Fe=I.newClassNameGetter("radio-card"),Fi=({checked:e,className:r,classnames:i,description:n,disabled:l,fullWidth:s=!1,label:u,onChange:d,ref:b,variant:p="normal",...f})=>o.jsxs(Ii,{className:Fe("container",r),$checked:e,$disabled:!!l,$fullWidth:s,$variant:p,"data-disabled":l,children:[o.jsx(_i,{...f,ref:b,type:"radio",checked:e,disabled:l,onChange:d}),o.jsx(st,{className:i==null?void 0:i.radio,checked:e,disabled:l,variant:p,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),o.jsxs(Ei,{className:Fe("content",i==null?void 0:i.content),children:[o.jsx(Ai,{className:Fe("label",i==null?void 0:i.label),$variant:p,children:u}),n&&o.jsx(Mi,{className:Fe("description",i==null?void 0:i.description),$variant:p,children:n})]})]}),Ft={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Yi=a.div`
899
- display: flex;
900
- flex-direction: column;
901
- gap: 8px;
902
- `,Gi=a.span`
903
- font-size: 13px;
904
- font-weight: 500;
905
- line-height: 1.5;
906
- color: ${e=>e.$disabled?Ft.label.disabledColor:Ft.label.color};
907
- margin-bottom: 4px;
908
- `,Vi=a.div`
909
- display: flex;
910
- flex-direction: column;
911
- gap: 12px;
912
- `,tt=I.newClassNameGetter("radio-group"),Bi=({className:e,classnames:r,disabled:i,label:n,name:l,onChange:s,options:u,ref:d,value:b,variant:p="normal",...f})=>o.jsxs(Yi,{...f,ref:d,className:tt("container",e),children:[n&&o.jsx(Gi,{className:tt("label",r==null?void 0:r.label),$disabled:i,children:n}),o.jsx(Vi,{className:tt("options",r==null?void 0:r.options),children:u.map(O=>o.jsx(st,{className:r==null?void 0:r.radio,name:l,checked:b===O.value,label:O.label,disabled:i,variant:p,onChange:()=>s(O.value)},O.value))})]}),rt=40,ot=2,ve=4,Yt={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},Gt={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:t.alpha(t.COLORS.black,40),focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:t.alpha(t.COLORS.red,40),focus:t.alpha(t.COLORS.red,30)}},it=e=>Yt[e]??Yt.default,ne=e=>Gt[e]??Gt.normal,Hi=a.div`
913
- position: relative;
914
- display: grid;
915
- gap: 2px;
916
- min-width: 180px;
917
- width: ${e=>e.$fullWidth?"100%":"fit-content"};
918
- `,Wi=a(te)`
919
- margin-left: 6px;
920
- `,Ki=a(re)`
921
- margin-left: 6px;
922
- `,Ui=a.button`
923
- display: flex;
924
- align-items: center;
925
- justify-content: space-between;
926
- gap: 8px;
927
- width: 100%;
928
- outline: none;
929
- font-size: 14px;
930
- font-weight: 500;
931
- text-align: left;
932
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
933
- height: ${e=>it(e.$size).height};
934
- padding: ${e=>it(e.$size).padding};
935
- border-radius: ${e=>it(e.$size).radius};
936
-
937
- color: ${e=>e.$hasValue?e.$disabled?ne(e.$variant).color.disabled:ne(e.$variant).color.static:ne(e.$variant).placeholder};
938
- border: 1px solid
939
- ${e=>e.$disabled?ne(e.$variant).border.disabled:ne(e.$variant).border.static};
940
- background-color: ${e=>e.$disabled?ne(e.$variant).background.disabled:ne(e.$variant).background.static};
941
- `,qi=a.span`
942
- flex: 1;
943
- min-width: 0;
944
- overflow: hidden;
945
- text-overflow: ellipsis;
946
- white-space: nowrap;
947
- `,Xi=a.span`
948
- display: flex;
949
- align-items: center;
950
- justify-content: center;
951
- flex-shrink: 0;
952
- transition: transform 0.2s ease;
953
- transform: rotate(${e=>e.$open?"180deg":"0deg"});
954
- `,ar=`
955
- display: grid;
956
- gap: 2px;
957
- padding: 4px;
958
- background: ${t.COLORS.white};
959
- border: 1px solid ${t.alpha(t.COLORS.black,10)};
960
- border-radius: 16px;
961
- box-shadow: 0 4px 20px ${t.alpha(t.COLORS.black,15)};
962
- z-index: 1000;
963
- `,Zi=a.div`
964
- position: absolute;
965
- left: -4px;
966
- width: calc(100% + 8px);
967
- overflow: hidden;
968
- ${ar}
969
- `,Ji=a.div`
970
- position: fixed;
971
- overflow: hidden;
972
- ${ar}
973
- `,Qi=a.button`
974
- display: flex;
975
- align-items: center;
976
- justify-content: space-between;
977
- gap: 8px;
978
- width: 100%;
979
- min-width: 0;
980
- height: 40px;
981
- padding: 0 14px;
982
- border: none;
983
- background: ${e=>e.$selected?t.alpha(t.COLORS.black,6):"transparent"};
984
- border-radius: 12px;
985
- font-size: 14px;
986
- font-weight: 500;
987
- text-align: left;
988
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
989
- color: ${e=>e.$disabled?t.alpha(t.COLORS.black,40):t.COLORS.black};
990
- transition: background-color 0.15s ease;
991
-
992
- &:hover:not(:disabled) {
993
- background: ${t.alpha(t.COLORS.black,8)};
994
- }
995
-
996
- & > span {
997
- overflow: hidden;
998
- text-overflow: ellipsis;
999
- white-space: nowrap;
1000
- min-width: 0;
1001
- }
1002
- `,ea=a.span`
1003
- display: flex;
1004
- align-items: center;
1005
- justify-content: center;
1006
- flex-shrink: 0;
1007
- color: ${t.COLORS.black};
1008
- `,Oe=I.newClassNameGetter("select"),ta=({className:e,classnames:r,disabled:i=!1,fullWidth:n=!1,label:l,message:s,onChange:u,options:d,placeholder:b="Select...",portalRenderNode:p,ref:f,size:O="default",value:w,variant:k="normal",...L})=>{const[C,R]=h.useState(!1),[j,$]=h.useState({top:0,left:0,width:0}),S=h.useRef(null),c=h.useRef(null),T=h.useRef(null),D=d.find(g=>g.value===w),z=Math.max(0,d.findIndex(g=>g.value===w)),Y=-(z*(rt+ot)+ve),F=()=>{if(!c.current||!p)return;const g=c.current.getBoundingClientRect(),_=z*(rt+ot)+ve;let v=g.top-_;const P=d.length*rt+(d.length-1)*ot+ve*2,V=8,Z=window.innerHeight-P-8;v<V&&(v=V),v>Z&&(v=Z),$({top:v,left:g.left-ve,width:g.width+ve*2})},A=g=>{var _;u==null||u(g),R(!1),(_=c.current)==null||_.focus()},M=g=>{i||d.length===0||(g.key==="Enter"||g.key===" "?(g.preventDefault(),R(_=>!_)):g.key==="Escape"&&C?(g.preventDefault(),R(!1)):g.key==="ArrowDown"&&!C&&(g.preventDefault(),R(!0)))};h.useLayoutEffect(()=>{C&&p&&F()},[C,p,z,d.length]),h.useEffect(()=>{if(!C)return;const g=P=>{const V=P.target,Z=S.current&&!S.current.contains(V),ae=T.current&&!T.current.contains(V);p?Z&&ae&&R(!1):Z&&R(!1)},_=()=>{p&&F()},v=()=>{p&&F()};return document.addEventListener("mousedown",g),p&&(window.addEventListener("scroll",_,!0),window.addEventListener("resize",v)),()=>{document.removeEventListener("mousedown",g),window.removeEventListener("scroll",_,!0),window.removeEventListener("resize",v)}},[C,p]);const G=()=>d.map(g=>o.jsxs(Qi,{type:"button",role:"option",$selected:g.value===w,$disabled:g.disabled??!1,disabled:g.disabled,"aria-selected":g.value===w,onClick:()=>A(g.value),className:Oe("option",r==null?void 0:r.option),children:[o.jsx("span",{children:g.label}),g.value===w&&o.jsx(ea,{children:o.jsx(o.Check,{size:16})})]},g.value)),m=p?He.createPortal(o.jsx(Ji,{ref:T,role:"listbox",style:{top:j.top,left:j.left,width:j.width},className:Oe("dropdown",r==null?void 0:r.dropdown),children:G()}),p):o.jsx(Zi,{ref:T,role:"listbox",style:{top:Y},className:Oe("dropdown",r==null?void 0:r.dropdown),children:G()});return o.jsxs(Hi,{...L,ref:g=>{S.current=g,typeof f=="function"?f(g):f&&(f.current=g)},$fullWidth:n,className:Oe("container",e),children:[l&&o.jsx(Wi,{variant:k==="error"?"error":"normal",className:Oe("label",r==null?void 0:r.label),children:l}),o.jsxs(Ui,{ref:c,type:"button",$size:O,$variant:k,$disabled:i,$hasValue:!!D,disabled:i,onClick:()=>!i&&d.length>0&&R(g=>!g),onKeyDown:M,"aria-haspopup":"listbox","aria-expanded":C,className:Oe("trigger",r==null?void 0:r.trigger),children:[o.jsx(qi,{children:(D==null?void 0:D.label)??b}),o.jsx(Xi,{$open:C,children:o.jsx(o.ChevronDown,{size:16})})]}),C&&m,s&&o.jsx(Ki,{variant:k,children:s})]})},ct={normal:{border:t.COLORS["iron-grey"],placeholder:t.COLORS["iron-grey"]},error:{border:t.COLORS.red,placeholder:t.alpha(t.COLORS.red,40)}},ra=a.div`
1009
- position: relative;
1010
- display: flex;
1011
- flex-direction: column;
1012
- gap: 4px;
1013
- `,oa=a(te)`
1014
- margin-left: 6px;
1015
- `,ia=a.div`
1016
- display: flex;
1017
- flex-wrap: wrap;
1018
- align-items: center;
1019
- gap: 6px;
1020
- min-height: 44px;
1021
- padding: 8px 12px;
1022
- border: 1px dashed ${e=>ct[e.$variant].border};
1023
- border-radius: 8px;
1024
- background: ${t.COLORS.white};
1025
- cursor: ${e=>e.$disabled?"not-allowed":"text"};
1026
- opacity: ${e=>e.$disabled?.5:1};
1027
- transition: border-color 0.15s ease;
1028
-
1029
- &:hover {
1030
- border-color: ${e=>e.$disabled?ct[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
1031
- }
1032
-
1033
- ${e=>e.$focused&&`
1034
- outline: 2px solid ${e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
1035
- outline-offset: 2px;
1036
- `}
1037
- `,aa=a.input`
1038
- flex: 1;
1039
- min-width: 80px;
1040
- border: none;
1041
- outline: none;
1042
- background: transparent;
1043
- font-size: 14px;
1044
- color: ${t.COLORS.black};
1045
- cursor: ${e=>e.$disabled?"not-allowed":"text"};
1046
-
1047
- &::placeholder {
1048
- color: ${e=>ct[e.$variant].placeholder};
1049
- }
1050
-
1051
- &:disabled {
1052
- cursor: not-allowed;
1053
- }
1054
- `,nr=`
1055
- z-index: 100;
1056
- background-color: ${t.COLORS.white};
1057
- border: 1px solid ${t.alpha(t.COLORS.black,15)};
1058
- border-radius: 8px;
1059
- box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
1060
- max-height: 200px;
1061
- overflow-y: auto;
1062
- `,lr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",dr=`
1063
- opacity 0.15s ease,
1064
- transform 0.15s ease,
1065
- visibility 0.15s;
1066
- `,na=a.div`
1067
- position: absolute;
1068
- left: 0;
1069
- right: 0;
1070
- ${e=>e.$position==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
1071
- ${nr}
1072
- opacity: ${e=>e.$open?1:0};
1073
- visibility: ${e=>e.$open?"visible":"hidden"};
1074
- transform: ${e=>lr(e.$open,e.$position)};
1075
- transition: ${dr};
1076
- `,la=a.div`
1077
- position: fixed;
1078
- ${nr}
1079
- opacity: ${e=>e.$open?1:0};
1080
- visibility: ${e=>e.$open?"visible":"hidden"};
1081
- transform: ${e=>lr(e.$open,e.$position)};
1082
- transition: ${dr};
1083
- `,Vt=a.button`
1084
- display: flex;
1085
- align-items: center;
1086
- width: 100%;
1087
- padding: 10px 12px;
1088
- border: none;
1089
- background: transparent;
1090
- font-size: 14px;
1091
- color: ${t.COLORS.black};
1092
- text-align: left;
1093
- cursor: pointer;
1094
- transition: background-color 0.15s ease;
1095
-
1096
- &:hover {
1097
- background-color: ${t.COLORS.gray};
1098
- }
1099
-
1100
- &:first-of-type {
1101
- border-radius: 7px 7px 0 0;
1102
- }
1103
-
1104
- &:last-of-type {
1105
- border-radius: 0 0 7px 7px;
1106
- }
1107
-
1108
- &:only-child {
1109
- border-radius: 7px;
1110
- }
1111
- `,Bt=a.div`
1112
- display: flex;
1113
- align-items: center;
1114
- justify-content: center;
1115
- padding: 16px;
1116
- color: ${t.COLORS["iron-grey"]};
1117
- font-size: 14px;
1118
- text-align: center;
1119
- `,da=a(re)`
1120
- margin-left: 6px;
1121
- `,X=I.newClassNameGetter("tags"),Ye=4,ca=({className:e,classnames:r,createKey:i="Tab",disabled:n=!1,emptyMessage:l="No options",freeSolo:s=!0,label:u,message:d,onChange:b,options:p=[],placeholder:f="Add tag...",portalRenderNode:O,ref:w,value:k,variant:L="normal",...C})=>{const R=h.useRef(null),j=h.useRef(null),$=h.useRef(null),S=h.useRef(null),[c,T]=h.useState(""),[D,z]=h.useState(!1),[Y,F]=h.useState("bottom"),[A,M]=h.useState({top:0,left:0,width:0}),G=h.useMemo(()=>{const y=p.filter(B=>!k.includes(B.value));if(!c.trim())return y;const N=c.toLowerCase().trim();return y.filter(B=>B.label.toLowerCase().includes(N))},[p,k,c]),m=D&&p.length>0,g=h.useCallback(()=>{var Ne;if(!j.current)return;const y=j.current.getBoundingClientRect(),N=((Ne=$.current)==null?void 0:Ne.offsetHeight)??200,B=window.innerHeight-y.bottom-Ye,H=y.top-Ye,pe=B<N&&H>B?"top":"bottom";if(F(pe),O){const Ue=pe==="bottom"?y.bottom+Ye:y.top-N-Ye;M({top:Ue,left:y.left,width:y.width})}},[O]);h.useEffect(()=>{if(D)return g(),window.addEventListener("scroll",g,!0),window.addEventListener("resize",g),()=>{window.removeEventListener("scroll",g,!0),window.removeEventListener("resize",g)}},[D,g]);const _=h.useCallback(y=>{const N=y.trim();return!N||k.includes(N)?!1:(b([...k,N]),T(""),!0)},[k,b]),v=y=>{if(y.key===i&&c.trim())if(y.preventDefault(),s)_(c);else{const N=G.find(B=>B.label.toLowerCase()===c.toLowerCase().trim());N&&_(N.value)}else y.key==="Backspace"&&!c&&k.length>0&&b(k.slice(0,-1))},P=y=>{var N;_(y),(N=S.current)==null||N.focus()},V=y=>{b(k.filter(N=>N!==y))},Z=()=>{var y;n||(y=S.current)==null||y.focus()},ae=y=>{const N=p.find(B=>B.value===y);return(N==null?void 0:N.label)??y};return o.jsxs(ra,{...C,ref:w,className:X("container",e),children:[u&&o.jsx(oa,{variant:L,className:X("label"),children:u}),o.jsxs("div",{ref:R,style:{position:"relative"},children:[o.jsxs(ia,{ref:j,$variant:L,$disabled:n,$focused:D,onClick:Z,className:X("trigger",r==null?void 0:r.trigger),children:[k.map(y=>o.jsx(Be,{variant:L==="error"?"red":"gray",deletable:!n,onDelete:()=>V(y),className:X("chip",r==null?void 0:r.chip),children:ae(y)},y)),o.jsx(aa,{ref:S,type:"text",value:c,onChange:y=>T(y.target.value),onFocus:()=>z(!0),onBlur:()=>setTimeout(()=>z(!1),150),onKeyDown:v,placeholder:k.length===0?f:"",disabled:n,$disabled:n,$variant:L,className:X("input",r==null?void 0:r.input)})]}),p.length>0&&(O?He.createPortal(o.jsx(la,{ref:$,$open:m,$position:Y,style:{top:A.top,left:A.left,width:A.width},className:X("dropdown",r==null?void 0:r.dropdown),children:G.length===0?o.jsx(Bt,{className:X("empty",r==null?void 0:r.empty),children:l}):G.map(y=>o.jsx(Vt,{type:"button",onMouseDown:N=>N.preventDefault(),onClick:()=>P(y.value),className:X("option",r==null?void 0:r.option),children:y.label},y.value))}),O):o.jsx(na,{ref:$,$open:m,$position:Y,className:X("dropdown",r==null?void 0:r.dropdown),children:G.length===0?o.jsx(Bt,{className:X("empty",r==null?void 0:r.empty),children:l}):G.map(y=>o.jsx(Vt,{type:"button",onMouseDown:N=>N.preventDefault(),onClick:()=>P(y.value),className:X("option",r==null?void 0:r.option),children:y.label},y.value))}))]}),d&&o.jsx(da,{variant:L,className:X("message"),children:d})]})},Ht={normal:{background:{static:t.alpha(t.COLORS.black,2),disabled:t.alpha(t.COLORS.black,10)},border:{static:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,10)},color:{static:t.COLORS.black,disabled:t.alpha(t.COLORS.black,65)},placeholder:{static:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,65)},focus:t.alpha(t.COLORS["iron-grey"],30)},error:{background:{static:t.alpha(t.COLORS.red,2),disabled:t.alpha(t.COLORS.red,10)},border:{static:t.alpha(t.COLORS.red,60),disabled:t.alpha(t.COLORS.red,10)},color:{static:t.COLORS.red,disabled:t.alpha(t.COLORS.red,65)},placeholder:{static:t.alpha(t.COLORS.red,40),disabled:t.alpha(t.COLORS.red,65)},focus:t.alpha(t.COLORS.red,30)}},ie=e=>Ht[e]??Ht.normal,sa=a.div`
1122
- display: grid;
1123
- flex-direction: column;
1124
- gap: 2px;
1125
- width: ${e=>e.$fullWidth?"100%":"fit-content"};
1126
- `,pa=a(te)`
1127
- margin-left: 6px;
1128
- `,ha=a.textarea`
1129
- flex: 1;
1130
- min-width: 0;
1131
- outline: none;
1132
- font-size: 14px;
1133
- font-weight: 500;
1134
- font-family: inherit;
1135
- padding: 10px 14px;
1136
- border-radius: 16px;
1137
- resize: vertical;
1138
-
1139
- color: ${e=>ie(e.$variant).color.static};
1140
- border: 1px solid ${e=>ie(e.$variant).border.static};
1141
- background-color: ${e=>ie(e.$variant).background.static};
1142
-
1143
- &::placeholder {
1144
- color: ${e=>ie(e.$variant).placeholder.static};
1145
- }
1146
-
1147
- &:disabled {
1148
- cursor: not-allowed;
1149
- resize: none;
1150
- color: ${e=>ie(e.$variant).color.disabled};
1151
- background-color: ${e=>ie(e.$variant).background.disabled};
1152
- border-color: ${e=>ie(e.$variant).border.disabled};
1153
-
1154
- &::placeholder {
1155
- color: ${e=>ie(e.$variant).placeholder.disabled};
1156
- }
1157
- }
1158
- `,ua=a.div`
1159
- display: flex;
1160
- align-items: flex-start;
1161
- gap: 8px;
1162
- margin: 0 6px;
1163
- `,ba=a(re)`
1164
- flex: 1;
1165
- min-width: 0;
1166
- `,Oa=a.span`
1167
- flex-shrink: 0;
1168
- margin-left: auto;
1169
- font-size: 12px;
1170
- font-weight: 500;
1171
- color: ${e=>e.$variant==="error"?t.COLORS.red:t.COLORS["iron-grey"]};
1172
- `,we=I.newClassNameGetter("textarea"),ga=({className:e,classnames:r,count:i,disabled:n,fullWidth:l,label:s,message:u,ref:d,value:b,variant:p="normal",rows:f=4,...O})=>{const w=typeof b=="string"?b.length:0,k=u||i!==void 0;return o.jsxs(sa,{className:we("container",e),$fullWidth:!!l,children:[s&&o.jsx(pa,{variant:p,className:we("label",r==null?void 0:r.label),children:s}),o.jsx(ha,{...O,ref:d,rows:f,value:b,disabled:n,$variant:p,className:we("textarea",r==null?void 0:r.textarea)}),k&&o.jsxs(ua,{children:[u&&o.jsx(ba,{variant:p,className:we("message"),children:u}),i!==void 0&&o.jsxs(Oa,{$variant:p,className:we("counter"),children:[w,"/",i]})]})]})},Wt={normal:{track:{background:t.alpha(t.COLORS["iron-grey"],20),backgroundChecked:t.COLORS.black,border:t.alpha(t.COLORS["iron-grey"],30),borderChecked:t.COLORS.black},thumb:{background:t.COLORS.white,backgroundChecked:t.COLORS.white},label:t.COLORS.black},error:{track:{background:t.alpha(t.COLORS.red,15),backgroundChecked:t.COLORS.red,border:t.COLORS.red,borderChecked:t.COLORS.red},thumb:{background:t.COLORS.white,backgroundChecked:t.COLORS.white},label:t.COLORS.red}},le=e=>Wt[e]??Wt.normal,fa=a.label`
1173
- display: inline-flex;
1174
- align-items: flex-start;
1175
- gap: 8px;
1176
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1177
- opacity: ${e=>e.$disabled?.5:1};
1178
- `,xa=a.input`
1179
- position: absolute;
1180
- opacity: 0;
1181
- width: 0;
1182
- height: 0;
1183
- pointer-events: none;
1184
- `,Sa=a.span`
1185
- position: relative;
1186
- flex-shrink: 0;
1187
- width: 36px;
1188
- height: 20px;
1189
- border-radius: 10px;
1190
- border: 1px solid
1191
- ${e=>e.$checked?le(e.$variant).track.borderChecked:le(e.$variant).track.border};
1192
- background-color: ${e=>e.$checked?le(e.$variant).track.backgroundChecked:le(e.$variant).track.background};
1193
- transition:
1194
- border-color 0.2s ease,
1195
- background-color 0.2s ease;
1196
- `,$a=a.span`
1197
- position: absolute;
1198
- top: 2px;
1199
- left: ${e=>e.$checked?"18px":"2px"};
1200
- width: 14px;
1201
- height: 14px;
1202
- border-radius: 50%;
1203
- background-color: ${e=>e.$checked?le(e.$variant).thumb.backgroundChecked:le(e.$variant).thumb.background};
1204
- box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
1205
- transition: left 0.2s ease;
1206
- `,Ca=a.span`
1207
- font-size: 14px;
1208
- font-weight: 500;
1209
- line-height: 1.3;
1210
- color: ${e=>le(e.$variant).label};
1211
- user-select: none;
1212
-
1213
- a {
1214
- color: inherit;
1215
- text-decoration: underline;
1216
- cursor: pointer;
1217
-
1218
- &:hover {
1219
- text-decoration: none;
1220
- }
1221
- }
1222
- `,me=I.newClassNameGetter("toggle"),pt=({checked:e,className:r,classnames:i,disabled:n,label:l,onChange:s,ref:u,variant:d="normal",...b})=>o.jsxs(fa,{className:me("container",r),$disabled:!!n,$variant:d,children:[o.jsx(xa,{...b,ref:u,type:"checkbox",className:me("input",i==null?void 0:i.input),checked:e,disabled:n,onChange:s}),o.jsx(Sa,{className:me("track",i==null?void 0:i.track),$checked:e,$variant:d,children:o.jsx($a,{className:me("thumb",i==null?void 0:i.thumb),$checked:e,$variant:d})}),l&&o.jsx(Ca,{className:me("label",i==null?void 0:i.label),$variant:d,children:l})]}),Kt={normal:{border:{static:t.alpha(t.COLORS.black,20),hover:t.alpha(t.COLORS.black,40),active:t.alpha(t.COLORS.black,40),disabled:t.alpha(t.COLORS.black,10)},borderChecked:t.COLORS.black,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.black,5)},backgroundChecked:t.alpha(t.COLORS.black,5),label:{static:t.COLORS.black,hover:t.COLORS.black,active:t.COLORS.black,disabled:t.alpha(t.COLORS.black,40)},description:{static:t.alpha(t.COLORS.black,60),hover:t.alpha(t.COLORS.black,60),active:t.alpha(t.COLORS.black,60),disabled:t.alpha(t.COLORS.black,30)}},error:{border:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,30)},borderChecked:t.COLORS.red,background:{static:t.COLORS.white,hover:t.COLORS.white,active:t.COLORS.white,disabled:t.alpha(t.COLORS.red,5)},backgroundChecked:t.alpha(t.COLORS.red,5),label:{static:t.COLORS.red,hover:t.COLORS.red,active:t.COLORS.red,disabled:t.alpha(t.COLORS.red,40)},description:{static:t.alpha(t.COLORS.red,70),hover:t.alpha(t.COLORS.red,70),active:t.alpha(t.COLORS.red,70),disabled:t.alpha(t.COLORS.red,40)}}},se=e=>Kt[e]??Kt.normal,ka=a.label`
1223
- display: grid;
1224
- grid-template-columns: 1fr auto;
1225
- align-items: start;
1226
- gap: 8px;
1227
- padding: 12px;
1228
- background-color: ${e=>{const r=se(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
1229
- border: 1px solid
1230
- ${e=>{const r=se(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
1231
- border-radius: 12px;
1232
- cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
1233
- transition:
1234
- border-color 0.15s ease,
1235
- background-color 0.15s ease;
1236
- width: ${e=>e.$fullWidth?"100%":"fit-content"};
1237
- min-width: 0;
1238
-
1239
- &:hover:not([data-disabled='true']) {
1240
- border-color: ${e=>{const r=se(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
1241
- }
1242
-
1243
- .vacano_toggle_container {
1244
- pointer-events: none;
1245
- }
1246
- `,ya=a.input`
1247
- position: absolute;
1248
- width: 1px;
1249
- height: 1px;
1250
- margin: -1px;
1251
- padding: 0;
1252
- overflow: hidden;
1253
- clip: rect(0, 0, 0, 0);
1254
- white-space: nowrap;
1255
- border: 0;
1256
- `,Ra=a.div`
1257
- display: flex;
1258
- flex-direction: column;
1259
- gap: 2px;
1260
- min-width: 0;
1261
- `,La=a.span`
1262
- font-size: 14px;
1263
- font-weight: 500;
1264
- line-height: 1.4;
1265
- color: ${e=>se(e.$variant).label.static};
1266
-
1267
- label[data-disabled='true'] & {
1268
- color: ${e=>se(e.$variant).label.disabled};
1269
- }
1270
- `,va=a.span`
1271
- font-size: 12px;
1272
- font-weight: 400;
1273
- line-height: 1.4;
1274
- color: ${e=>se(e.$variant).description.static};
1275
-
1276
- label[data-disabled='true'] & {
1277
- color: ${e=>se(e.$variant).description.disabled};
1278
- }
1279
- `,Ge=I.newClassNameGetter("toggle-card"),wa=({checked:e,className:r,classnames:i,description:n,disabled:l,fullWidth:s=!1,label:u,onChange:d,ref:b,variant:p="normal",...f})=>o.jsxs(ka,{className:Ge("container",r),$checked:e,$disabled:!!l,$fullWidth:s,$variant:p,"data-disabled":l,children:[o.jsx(ya,{...f,ref:b,type:"checkbox",checked:e,disabled:l,onChange:d}),o.jsxs(Ra,{className:Ge("content",i==null?void 0:i.content),children:[o.jsx(La,{className:Ge("label",i==null?void 0:i.label),$variant:p,children:u}),n&&o.jsx(va,{className:Ge("description",i==null?void 0:i.description),$variant:p,children:n})]}),o.jsx(pt,{className:i==null?void 0:i.toggle,checked:e,disabled:l,variant:p,onChange:()=>{},tabIndex:-1,"aria-hidden":!0})]}),Ut={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},ma=a.div`
1280
- display: flex;
1281
- flex-direction: column;
1282
- gap: 8px;
1283
- `,ja=a.span`
1284
- font-size: 13px;
1285
- font-weight: 500;
1286
- line-height: 1.5;
1287
- color: ${e=>e.$disabled?Ut.label.disabledColor:Ut.label.color};
1288
- margin-bottom: 4px;
1289
- `,Pa=a.div`
1290
- display: flex;
1291
- flex-direction: column;
1292
- gap: 12px;
1293
- `,at=I.newClassNameGetter("toggle-group"),Na=({className:e,classnames:r,disabled:i,label:n,onChange:l,options:s,ref:u,value:d,variant:b="normal",...p})=>{const f=(O,w)=>{l(w?[...d,O]:d.filter(k=>k!==O))};return o.jsxs(ma,{...p,ref:u,className:at("container",e),children:[n&&o.jsx(ja,{className:at("label",r==null?void 0:r.label),$disabled:i,children:n}),o.jsx(Pa,{className:at("options",r==null?void 0:r.options),children:s.map(O=>o.jsx(pt,{className:r==null?void 0:r.toggle,checked:d.includes(O.value),label:O.label,disabled:i,variant:b,onChange:w=>f(O.value,w.target.checked)},O.value))})]})};exports.Autocomplete=eo;exports.Button=Jt;exports.Checkbox=We;exports.CheckboxCard=$o;exports.CheckboxGroup=Ro;exports.Chip=Be;exports.DatePicker=ri;exports.FieldLabel=te;exports.FieldMessage=re;exports.Input=rr;exports.KeySymbol=Xt;exports.KeysBindings=Zt;exports.Modal=or;exports.MultiSelect=yi;exports.OtpCode=ji;exports.Radio=st;exports.RadioCard=Fi;exports.RadioGroup=Bi;exports.Select=ta;exports.Spinner=qt;exports.Tags=ca;exports.Textarea=ga;exports.Toggle=pt;exports.ToggleCard=wa;exports.ToggleGroup=Na;exports.formatDateGo=Qt;exports.styled=a;
1294
- //# sourceMappingURL=ToggleGroup-COFNoVg9.cjs.map