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