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