@vacano/ui 1.4.4 → 1.5.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/dist/index.cjs +371 -424
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.js +1762 -1752
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-CI1qRJDP.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./X-CI1qRJDP.cjs"),oe=require("@emotion/react"),u=require("react"),t=require("./media-OVL6YjWb.cjs"),A=require("./tooling-Dflq0Y98.cjs"),ge=require("react-dom");function ro(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(r,o,i.get?i:{enumerable:!0,get:()=>e[o]})}}return r.default=e,Object.freeze(r)}const Re=ro(u);function Ct(){return Ct=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var o=arguments[r];for(var i in o)({}).hasOwnProperty.call(o,i)&&(e[i]=o[i])}return e},Ct.apply(null,arguments)}const oo=oe.css`
|
|
2
2
|
*,
|
|
3
3
|
*::before,
|
|
4
4
|
*::after {
|
|
@@ -141,56 +141,52 @@
|
|
|
141
141
|
:focus:not(:focus-visible) {
|
|
142
142
|
outline: none;
|
|
143
143
|
}
|
|
144
|
-
`,
|
|
144
|
+
`,io=()=>a.jsx(oe.Global,{styles:oo});var no=/^((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)-.*))$/,ao=a.memoize(function(e){return no.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),lo=ao,co=function(r){return r!=="theme"},Nt=function(r){return typeof r=="string"&&r.charCodeAt(0)>96?lo:co},It=function(r,o,i){var n;if(o){var l=o.shouldForwardProp;n=r.__emotion_forwardProp&&l?function(c){return r.__emotion_forwardProp(c)&&l(c)}:l}return typeof n!="function"&&i&&(n=r.__emotion_forwardProp),n},so=function(r){var o=r.cache,i=r.serialized,n=r.isStringTag;return a.registerStyles(o,i,n),a.useInsertionEffectAlwaysWithSyncFallback(function(){return a.insertStyles(o,i,n)}),null},po=function e(r,o){var i=r.__emotion_real===r,n=i&&r.__emotion_base||r,l,c;o!==void 0&&(l=o.label,c=o.target);var d=It(r,o,i),p=d||Nt(n),h=!p("as");return function(){var g=arguments,f=i&&r.__emotion_styles!==void 0?r.__emotion_styles.slice(0):[];if(l!==void 0&&f.push("label:"+l+";"),g[0]==null||g[0].raw===void 0)f.push.apply(f,g);else{var O=g[0];f.push(O[0]);for(var m=g.length,y=1;y<m;y++)f.push(g[y],O[y])}var S=oe.withEmotionCache(function(v,x,$){var b=h&&v.as||n,L="",j=[],N=v;if(v.theme==null){N={};for(var H in v)N[H]=v[H];N.theme=Re.useContext(oe.ThemeContext)}typeof v.className=="string"?L=a.getRegisteredStyles(x.registered,j,v.className):v.className!=null&&(L=v.className+" ");var z=a.serializeStyles(f.concat(j),x.registered,N);L+=x.key+"-"+z.name,c!==void 0&&(L+=" "+c);var _=h&&d===void 0?Nt(b):p,E={};for(var w in v)h&&w==="as"||_(w)&&(E[w]=v[w]);return E.className=L,$&&(E.ref=$),Re.createElement(Re.Fragment,null,Re.createElement(so,{cache:x,serialized:z,isStringTag:typeof b=="string"}),Re.createElement(b,E))});return S.displayName=l!==void 0?l:"Styled("+(typeof n=="string"?n:n.displayName||n.name||"Component")+")",S.defaultProps=r.defaultProps,S.__emotion_real=S,S.__emotion_base=n,S.__emotion_styles=f,S.__emotion_forwardProp=d,Object.defineProperty(S,"toString",{value:function(){return"."+c}}),S.withComponent=function(v,x){var $=e(v,Ct({},o,x,{shouldForwardProp:It(S,x,!0)}));return $.apply(void 0,f)},S}},uo=["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"],s=po.bind(null);uo.forEach(function(e){s[e]=s(e)});const ho=s.span`
|
|
145
145
|
font-size: 12px;
|
|
146
146
|
font-weight: 500;
|
|
147
147
|
color: ${e=>e.$variant==="normal"?t.COLORS.black:t.COLORS.red};
|
|
148
|
-
`,
|
|
148
|
+
`,bo=A.newClassNameGetter("field-label"),ne=({children:e,className:r,ref:o,required:i,variant:n="normal",...l})=>e?a.jsxs(ho,{...l,ref:o,className:bo("container",r),$variant:n,children:[e," ",i&&"*"]}):null,it={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},ae={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)}},go=s.div`
|
|
149
149
|
position: relative;
|
|
150
150
|
display: grid;
|
|
151
151
|
gap: 2px;
|
|
152
152
|
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
153
|
-
`,
|
|
153
|
+
`,fo=s(ne)`
|
|
154
154
|
margin-left: 6px;
|
|
155
|
-
`,
|
|
155
|
+
`,xo=s.div`
|
|
156
156
|
position: relative;
|
|
157
157
|
display: flex;
|
|
158
158
|
align-items: center;
|
|
159
|
-
`,
|
|
159
|
+
`,Oo=s.input`
|
|
160
160
|
flex: 1;
|
|
161
161
|
min-width: 0;
|
|
162
162
|
width: 100%;
|
|
163
163
|
outline: none;
|
|
164
164
|
font-size: 14px;
|
|
165
165
|
font-weight: 500;
|
|
166
|
-
height: ${e=>
|
|
167
|
-
padding: ${e=>
|
|
166
|
+
height: ${e=>it[e.$size].height};
|
|
167
|
+
padding: ${e=>it[e.$size].padding};
|
|
168
168
|
padding-right: 40px;
|
|
169
|
-
border-radius: ${e=>
|
|
169
|
+
border-radius: ${e=>it[e.$size].radius};
|
|
170
170
|
|
|
171
|
-
color: ${e=>
|
|
172
|
-
border: 1px solid ${e=>
|
|
173
|
-
background-color: ${e=>
|
|
171
|
+
color: ${e=>ae[e.$variant].color.static};
|
|
172
|
+
border: 1px solid ${e=>ae[e.$variant].border.static};
|
|
173
|
+
background-color: ${e=>ae[e.$variant].background.static};
|
|
174
174
|
|
|
175
175
|
&::placeholder {
|
|
176
|
-
color: ${e=>
|
|
176
|
+
color: ${e=>ae[e.$variant].placeholder.static};
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
&:disabled {
|
|
180
180
|
cursor: not-allowed;
|
|
181
|
-
color: ${e=>
|
|
182
|
-
background-color: ${e=>
|
|
183
|
-
border-color: ${e=>
|
|
181
|
+
color: ${e=>ae[e.$variant].color.disabled};
|
|
182
|
+
background-color: ${e=>ae[e.$variant].background.disabled};
|
|
183
|
+
border-color: ${e=>ae[e.$variant].border.disabled};
|
|
184
184
|
|
|
185
185
|
&::placeholder {
|
|
186
|
-
color: ${e=>
|
|
186
|
+
color: ${e=>ae[e.$variant].placeholder.disabled};
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
-
|
|
190
|
-
&:focus-visible {
|
|
191
|
-
outline: 2px solid ${e=>oe[e.$variant].focus};
|
|
192
|
-
}
|
|
193
|
-
`,fo=s.div`
|
|
189
|
+
`,$o=s.div`
|
|
194
190
|
position: absolute;
|
|
195
191
|
right: 12px;
|
|
196
192
|
top: 50%;
|
|
@@ -198,7 +194,7 @@
|
|
|
198
194
|
display: flex;
|
|
199
195
|
align-items: center;
|
|
200
196
|
justify-content: center;
|
|
201
|
-
`,
|
|
197
|
+
`,So=s.div`
|
|
202
198
|
position: absolute;
|
|
203
199
|
top: 100%;
|
|
204
200
|
left: 0;
|
|
@@ -218,7 +214,7 @@
|
|
|
218
214
|
opacity 0.15s ease,
|
|
219
215
|
transform 0.15s ease,
|
|
220
216
|
visibility 0.15s;
|
|
221
|
-
`,
|
|
217
|
+
`,yo=s.div`
|
|
222
218
|
display: flex;
|
|
223
219
|
align-items: center;
|
|
224
220
|
gap: 10px;
|
|
@@ -244,43 +240,43 @@
|
|
|
244
240
|
&:hover {
|
|
245
241
|
background-color: ${t.alpha(t.COLORS.black,5)};
|
|
246
242
|
}
|
|
247
|
-
|
|
243
|
+
`,vo=s.img`
|
|
248
244
|
width: 24px;
|
|
249
245
|
height: 24px;
|
|
250
246
|
border-radius: 6px;
|
|
251
247
|
object-fit: cover;
|
|
252
|
-
`,
|
|
248
|
+
`,Co=s.span`
|
|
253
249
|
flex: 1;
|
|
254
250
|
overflow: hidden;
|
|
255
251
|
text-overflow: ellipsis;
|
|
256
252
|
white-space: nowrap;
|
|
257
|
-
`,
|
|
253
|
+
`,mo=s.div`
|
|
258
254
|
padding: 12px 14px;
|
|
259
255
|
font-size: 14px;
|
|
260
256
|
color: ${t.alpha(t.COLORS.black,50)};
|
|
261
257
|
text-align: center;
|
|
262
|
-
`,
|
|
258
|
+
`,At={xs:{size:"16px",borderWidth:"2px"},sm:{size:"20px",borderWidth:"2px"},md:{size:"32px",borderWidth:"3px"},lg:{size:"48px",borderWidth:"4px"}},Dt={track:t.alpha(t.COLORS.black,15),indicator:t.COLORS.black},nt=e=>At[e]??At.md,wo=oe.keyframes`
|
|
263
259
|
0% {
|
|
264
260
|
transform: rotate(0deg);
|
|
265
261
|
}
|
|
266
262
|
100% {
|
|
267
263
|
transform: rotate(360deg);
|
|
268
264
|
}
|
|
269
|
-
`,
|
|
265
|
+
`,Ro=s.div`
|
|
270
266
|
display: inline-block;
|
|
271
|
-
width: ${e=>
|
|
272
|
-
height: ${e=>
|
|
273
|
-
border: ${e=>
|
|
274
|
-
border-top-color: ${
|
|
267
|
+
width: ${e=>nt(e.$size).size};
|
|
268
|
+
height: ${e=>nt(e.$size).size};
|
|
269
|
+
border: ${e=>nt(e.$size).borderWidth} solid ${Dt.track};
|
|
270
|
+
border-top-color: ${Dt.indicator};
|
|
275
271
|
border-radius: 50%;
|
|
276
|
-
animation: ${
|
|
277
|
-
`,
|
|
272
|
+
animation: ${wo} 0.8s linear infinite;
|
|
273
|
+
`,ko=A.newClassNameGetter("spinner"),Lt=({"aria-label":e="Loading",className:r,ref:o,size:i="md",...n})=>a.jsx(Ro,{...n,ref:o,className:ko("container",r),role:"status","aria-label":e,$size:i}),ke=A.newClassNameGetter("autocomplete"),Lo=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",value:p,onChange:h,onSearch:g,debounceMs:f=300,minChars:O=1,noResultsMessage:m="No results found",...y})=>{const[S,v]=u.useState((p==null?void 0:p.value)??""),[x,$]=u.useState([]),[b,L]=u.useState(!1),[j,N]=u.useState(!1),[H,z]=u.useState(!1),_=u.useRef(null),E=u.useRef(null);u.useEffect(()=>{(p==null?void 0:p.value)!==void 0&&v(p.value)},[p==null?void 0:p.value]);const w=u.useCallback(async T=>{if(T.length<O){$([]),z(!1);return}L(!0),z(!0);try{const F=await g(T);$(F),N(!0)}catch{$([])}finally{L(!1)}},[g,O]),M=u.useCallback(T=>{const F=T.target.value;v(F),h==null||h({value:F,image_url:null}),E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{w(F)},f)},[h,w,f]),C=u.useCallback(T=>{v(T.value),$([]),N(!1),z(!1),h==null||h({value:T.value,image_url:T.image_url})},[h]),I=u.useCallback(()=>{setTimeout(()=>{N(!1)},150)},[]),k=u.useCallback(()=>{x.length>0&&N(!0)},[x.length]);return u.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]),a.jsxs(go,{ref:_,className:ke("container",e),$fullWidth:!!i,children:[n&&a.jsx(fo,{variant:d,className:ke("label",r==null?void 0:r.label),children:n}),a.jsxs(xo,{children:[a.jsx(Oo,{...y,ref:l,type:"text",value:S,onChange:M,onBlur:I,onFocus:k,disabled:o,$size:c,$variant:d,className:ke("input",r==null?void 0:r.input)}),b&&a.jsx($o,{children:a.jsx(Lt,{size:"xs"})})]}),a.jsx(So,{$open:j&&H,className:ke("dropdown",r==null?void 0:r.dropdown),children:x.length>0?x.map(T=>a.jsxs(yo,{onClick:()=>C(T),className:ke("item",r==null?void 0:r.item),children:[T.image_url&&a.jsx(vo,{src:T.image_url,alt:T.value}),a.jsx(Co,{children:T.value})]},T.id)):!b&&a.jsx(mo,{children:m})})]})},_t={compact:{height:"32px",padding:"0 8px",radius:"12px",iconSize:"16px"},default:{height:"40px",padding:"0 12px",radius:"16px",iconSize:"20px"}},Mt={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)}}},J=e=>{const r=Mt[e];return r||Mt.normal},re=e=>{const r=_t[e];return r||_t.default},Po=e=>e?"auto":"fit-content",zo=s.button`
|
|
278
274
|
display: flex;
|
|
279
275
|
gap: 6px;
|
|
280
276
|
text-decoration: none;
|
|
281
277
|
align-items: center;
|
|
282
278
|
justify-content: center;
|
|
283
|
-
width: ${e=>e.$iconOnly?re(e.$size).height:
|
|
279
|
+
width: ${e=>e.$iconOnly?re(e.$size).height:Po(!!e.$fullWidth)};
|
|
284
280
|
color: ${e=>J(e.$variant).color.static};
|
|
285
281
|
background-color: ${e=>J(e.$variant).background.static};
|
|
286
282
|
height: ${e=>re(e.$size).height};
|
|
@@ -300,17 +296,13 @@
|
|
|
300
296
|
border-color: ${e=>J(e.$variant).borderColor.active};
|
|
301
297
|
}
|
|
302
298
|
|
|
303
|
-
&:focus-visible {
|
|
304
|
-
outline-color: ${t.alpha(t.COLORS["iron-grey"],30)};
|
|
305
|
-
}
|
|
306
|
-
|
|
307
299
|
&:disabled {
|
|
308
300
|
cursor: not-allowed;
|
|
309
301
|
color: ${e=>J(e.$variant).color.disabled};
|
|
310
302
|
background-color: ${e=>J(e.$variant).background.disabled};
|
|
311
303
|
border-color: ${e=>J(e.$variant).borderColor.disabled};
|
|
312
304
|
}
|
|
313
|
-
`,
|
|
305
|
+
`,jo=s.div`
|
|
314
306
|
display: grid;
|
|
315
307
|
place-items: center;
|
|
316
308
|
width: ${e=>re(e.$size).iconSize};
|
|
@@ -320,19 +312,19 @@
|
|
|
320
312
|
width: ${e=>re(e.$size).iconSize};
|
|
321
313
|
height: ${e=>re(e.$size).iconSize};
|
|
322
314
|
}
|
|
323
|
-
`,
|
|
315
|
+
`,Eo=s.span`
|
|
324
316
|
font-weight: 600;
|
|
325
317
|
overflow: hidden;
|
|
326
318
|
white-space: nowrap;
|
|
327
319
|
text-overflow: ellipsis;
|
|
328
|
-
`,
|
|
320
|
+
`,To=s(a.LoaderCircle)`
|
|
329
321
|
width: ${e=>re(e.$size).iconSize};
|
|
330
322
|
height: ${e=>re(e.$size).iconSize};
|
|
331
323
|
animation: ${t.KEYFRAMES.rotate} 0.8s linear infinite;
|
|
332
|
-
`,
|
|
324
|
+
`,No=s.div`
|
|
333
325
|
display: flex;
|
|
334
326
|
gap: 3px;
|
|
335
|
-
`,
|
|
327
|
+
`,Io=s.span`
|
|
336
328
|
text-align: center;
|
|
337
329
|
display: flex;
|
|
338
330
|
justify-content: center;
|
|
@@ -345,28 +337,24 @@
|
|
|
345
337
|
border-radius: 4px;
|
|
346
338
|
width: fit-content;
|
|
347
339
|
background-color: ${e=>e.$variant==="light"?t.alpha(t.COLORS.white,25):t.alpha(t.COLORS.black,25)};
|
|
348
|
-
`,
|
|
340
|
+
`,Ao=A.newClassNameGetter("key-symbol"),Sr=({className:e,ref:r,symbol:o,variant:i="light",...n})=>o?a.jsx(Io,{...n,ref:r,className:Ao("container",e),$variant:i,children:o}):null,Ft=A.newClassNameGetter("key-bindings"),yr=({className:e,classnames:r,keys:o,ref:i,variant:n,...l})=>{const c=u.useMemo(()=>t.getKeySymbols(o),[o]);return c.length===0?null:a.jsx(No,{...l,ref:i,className:Ft("container",e),children:c.map(d=>a.jsx(Sr,{symbol:d,className:Ft("item",r==null?void 0:r.item),variant:n},d))})},Bt=A.newClassNameGetter("button"),_e=({children:e,className:r,classnames:o,disabled:i,fullWidth:n,icon:l,loading:c,onClick:d,ref:p=null,keyBindings:h=[],size:g="default",type:f="button",variant:O="normal",...m})=>{const y=u.useRef(null);u.useImperativeHandle(p,()=>y.current,[]),t.useKeyBinding(h,()=>{var v;(v=y.current)==null||v.click()});const S=u.useMemo(()=>{switch(f){case"link":return"button";default:return f}},[f]);return a.jsxs(zo,{...m,onClick:d,ref:y,type:S,disabled:i,className:Bt("container",r),$variant:O,$size:g,$fullWidth:!!n,$iconOnly:!!l&&!(e||(h==null?void 0:h.length)>0),children:[c&&a.jsx(To,{$size:g}),l&&!c&&a.jsx(jo,{$size:g,children:l}),e&&a.jsx(Eo,{className:Bt("label",o==null?void 0:o.label),children:e}),a.jsx(yr,{keys:h,variant:O==="system"?"light":"dark"})]})},Do=s.div`
|
|
349
341
|
background-color: ${t.COLORS.white};
|
|
350
342
|
border-radius: 16px;
|
|
351
343
|
border: ${e=>e.$border?`1px solid ${t.alpha(t.COLORS["iron-grey"],15)}`:"none"};
|
|
352
344
|
box-shadow: ${e=>e.$shadow?`0 2px 8px ${t.alpha(t.COLORS.black,10)}`:"none"};
|
|
353
|
-
`,
|
|
345
|
+
`,_o=A.newClassNameGetter("card"),Mo=({children:e,className:r,ref:o,border:i=!1,shadow:n=!1,...l})=>a.jsx(Do,{...l,ref:o,className:_o("container",r),$border:i,$shadow:n,children:e}),Yt={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}},ye=e=>Yt[e]??Yt.normal,Fo=s.label`
|
|
354
346
|
display: inline-flex;
|
|
355
347
|
align-items: flex-start;
|
|
356
348
|
gap: 8px;
|
|
357
349
|
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
358
350
|
opacity: ${e=>e.$disabled?.5:1};
|
|
359
|
-
|
|
360
|
-
&:has(input:focus-visible) > span:first-of-type {
|
|
361
|
-
box-shadow: 0 0 0 2px ${e=>be(e.$variant).box.focusShadow};
|
|
362
|
-
}
|
|
363
|
-
`,_o=s.input`
|
|
351
|
+
`,Bo=s.input`
|
|
364
352
|
position: absolute;
|
|
365
353
|
opacity: 0;
|
|
366
354
|
width: 0;
|
|
367
355
|
height: 0;
|
|
368
356
|
pointer-events: none;
|
|
369
|
-
`,
|
|
357
|
+
`,Yo=s.span`
|
|
370
358
|
display: inline-flex;
|
|
371
359
|
align-items: center;
|
|
372
360
|
justify-content: center;
|
|
@@ -375,17 +363,17 @@
|
|
|
375
363
|
height: 18px;
|
|
376
364
|
border-radius: 6px;
|
|
377
365
|
border: 1.5px solid
|
|
378
|
-
${e=>e.$checked||e.$indeterminate?
|
|
379
|
-
background-color: ${e=>e.$checked||e.$indeterminate?
|
|
366
|
+
${e=>e.$checked||e.$indeterminate?ye(e.$variant).box.borderChecked:ye(e.$variant).box.border};
|
|
367
|
+
background-color: ${e=>e.$checked||e.$indeterminate?ye(e.$variant).box.backgroundChecked:ye(e.$variant).box.background};
|
|
380
368
|
transition:
|
|
381
369
|
border-color 0.15s ease,
|
|
382
370
|
background-color 0.15s ease,
|
|
383
371
|
box-shadow 0.15s ease;
|
|
384
|
-
`,
|
|
372
|
+
`,Ho=s.span`
|
|
385
373
|
display: inline-flex;
|
|
386
374
|
align-items: center;
|
|
387
375
|
justify-content: center;
|
|
388
|
-
color: ${e=>
|
|
376
|
+
color: ${e=>ye(e.$variant).icon};
|
|
389
377
|
opacity: ${e=>e.$visible?1:0};
|
|
390
378
|
transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
|
|
391
379
|
transition:
|
|
@@ -396,11 +384,11 @@
|
|
|
396
384
|
width: 12px;
|
|
397
385
|
height: 12px;
|
|
398
386
|
}
|
|
399
|
-
`,
|
|
387
|
+
`,Vo=s.span`
|
|
400
388
|
font-size: 14px;
|
|
401
389
|
font-weight: 500;
|
|
402
390
|
line-height: 1.4;
|
|
403
|
-
color: ${e=>
|
|
391
|
+
color: ${e=>ye(e.$variant).label};
|
|
404
392
|
user-select: none;
|
|
405
393
|
|
|
406
394
|
a {
|
|
@@ -412,15 +400,15 @@
|
|
|
412
400
|
text-decoration: none;
|
|
413
401
|
}
|
|
414
402
|
}
|
|
415
|
-
`,Le=A.newClassNameGetter("checkbox"),
|
|
403
|
+
`,Le=A.newClassNameGetter("checkbox"),tt=({checked:e,className:r,classnames:o,disabled:i,indeterminate:n=!1,label:l,onChange:c,ref:d,variant:p="normal",...h})=>a.jsxs(Fo,{className:Le("container",r),$disabled:!!i,$variant:p,children:[a.jsx(Bo,{...h,ref:d,type:"checkbox",className:Le("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:c}),a.jsx(Yo,{className:Le("box",o==null?void 0:o.box),$checked:e,$indeterminate:n,$variant:p,children:a.jsx(Ho,{className:Le("icon",o==null?void 0:o.icon),$visible:n||e,$variant:p,children:n?a.jsx(a.Minus,{}):a.jsx(a.Check,{})})}),l&&a.jsx(Vo,{className:Le("label",o==null?void 0:o.label),$variant:p,children:l})]}),Ht={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)}}},he=e=>Ht[e]??Ht.normal,Go=s.label`
|
|
416
404
|
display: grid;
|
|
417
405
|
grid-template-columns: auto 1fr;
|
|
418
406
|
align-items: start;
|
|
419
407
|
gap: 8px;
|
|
420
408
|
padding: 12px;
|
|
421
|
-
background-color: ${e=>{const r=
|
|
409
|
+
background-color: ${e=>{const r=he(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
|
|
422
410
|
border: 1px solid
|
|
423
|
-
${e=>{const r=
|
|
411
|
+
${e=>{const r=he(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
|
|
424
412
|
border-radius: 12px;
|
|
425
413
|
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
426
414
|
transition:
|
|
@@ -430,18 +418,13 @@
|
|
|
430
418
|
min-width: 0;
|
|
431
419
|
|
|
432
420
|
&:hover:not([data-disabled='true']) {
|
|
433
|
-
border-color: ${e=>{const r=
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
&:has(:focus-visible) {
|
|
437
|
-
outline: none;
|
|
438
|
-
box-shadow: 0 0 0 3px ${e=>se(e.$variant).focusRing};
|
|
421
|
+
border-color: ${e=>{const r=he(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
|
|
439
422
|
}
|
|
440
423
|
|
|
441
424
|
.vacano_checkbox_container {
|
|
442
425
|
pointer-events: none;
|
|
443
426
|
}
|
|
444
|
-
`,
|
|
427
|
+
`,Wo=s.input`
|
|
445
428
|
position: absolute;
|
|
446
429
|
width: 1px;
|
|
447
430
|
height: 1px;
|
|
@@ -451,44 +434,44 @@
|
|
|
451
434
|
clip: rect(0, 0, 0, 0);
|
|
452
435
|
white-space: nowrap;
|
|
453
436
|
border: 0;
|
|
454
|
-
`,
|
|
437
|
+
`,Xo=s.div`
|
|
455
438
|
display: flex;
|
|
456
439
|
flex-direction: column;
|
|
457
440
|
gap: 2px;
|
|
458
441
|
min-width: 0;
|
|
459
|
-
`,
|
|
442
|
+
`,Uo=s.span`
|
|
460
443
|
font-size: 14px;
|
|
461
444
|
font-weight: 500;
|
|
462
445
|
line-height: 1.4;
|
|
463
|
-
color: ${e=>
|
|
446
|
+
color: ${e=>he(e.$variant).label.static};
|
|
464
447
|
|
|
465
448
|
label[data-disabled='true'] & {
|
|
466
|
-
color: ${e=>
|
|
449
|
+
color: ${e=>he(e.$variant).label.disabled};
|
|
467
450
|
}
|
|
468
|
-
`,
|
|
451
|
+
`,qo=s.span`
|
|
469
452
|
font-size: 12px;
|
|
470
453
|
font-weight: 400;
|
|
471
454
|
line-height: 1.4;
|
|
472
|
-
color: ${e=>
|
|
455
|
+
color: ${e=>he(e.$variant).description.static};
|
|
473
456
|
|
|
474
457
|
label[data-disabled='true'] & {
|
|
475
|
-
color: ${e=>
|
|
458
|
+
color: ${e=>he(e.$variant).description.disabled};
|
|
476
459
|
}
|
|
477
|
-
`,
|
|
460
|
+
`,He=A.newClassNameGetter("checkbox-card"),Ko=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(Go,{className:He("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(Wo,{...g,ref:p,type:"checkbox",checked:e,disabled:n,onChange:d}),a.jsx(tt,{className:o==null?void 0:o.checkbox,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(Xo,{className:He("content",o==null?void 0:o.content),children:[a.jsx(Uo,{className:He("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(qo,{className:He("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),Vt={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Zo=s.div`
|
|
478
461
|
display: flex;
|
|
479
462
|
flex-direction: column;
|
|
480
463
|
gap: 8px;
|
|
481
|
-
`,
|
|
464
|
+
`,Jo=s.span`
|
|
482
465
|
font-size: 13px;
|
|
483
466
|
font-weight: 500;
|
|
484
467
|
line-height: 1.5;
|
|
485
|
-
color: ${e=>e.$disabled?
|
|
468
|
+
color: ${e=>e.$disabled?Vt.label.disabledColor:Vt.label.color};
|
|
486
469
|
margin-bottom: 4px;
|
|
487
|
-
`,
|
|
470
|
+
`,Qo=s.div`
|
|
488
471
|
display: flex;
|
|
489
472
|
flex-direction: column;
|
|
490
473
|
gap: 12px;
|
|
491
|
-
`,
|
|
474
|
+
`,at=A.newClassNameGetter("checkbox-group"),ei=({className:e,classnames:r,disabled:o,label:i,onChange:n,options:l,ref:c,value:d,...p})=>{const h=(g,f)=>{n(f?[...d,g]:d.filter(O=>O!==g))};return a.jsxs(Zo,{...p,ref:c,className:at("container",e),children:[i&&a.jsx(Jo,{className:at("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(Qo,{className:at("options",r==null?void 0:r.options),children:l.map(g=>a.jsx(tt,{className:r==null?void 0:r.checkbox,checked:d.includes(g.value),label:g.label,disabled:o,onChange:f=>h(g.value,f.target.checked)},g.value))})]})},Gt={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)}},mt=e=>Gt[e]??Gt.gray,ti=s.span`
|
|
492
475
|
display: inline-flex;
|
|
493
476
|
align-items: center;
|
|
494
477
|
gap: 4px;
|
|
@@ -498,9 +481,9 @@
|
|
|
498
481
|
font-size: 12px;
|
|
499
482
|
font-weight: 500;
|
|
500
483
|
line-height: 1.5;
|
|
501
|
-
background-color: ${e=>
|
|
502
|
-
color: ${e=>
|
|
503
|
-
`,
|
|
484
|
+
background-color: ${e=>mt(e.$variant).background};
|
|
485
|
+
color: ${e=>mt(e.$variant).color};
|
|
486
|
+
`,ri=s.button`
|
|
504
487
|
display: inline-flex;
|
|
505
488
|
align-items: center;
|
|
506
489
|
justify-content: center;
|
|
@@ -515,17 +498,17 @@
|
|
|
515
498
|
transition: background-color 0.15s ease;
|
|
516
499
|
|
|
517
500
|
&:hover {
|
|
518
|
-
background-color: ${e=>
|
|
501
|
+
background-color: ${e=>mt(e.$variant).deleteHover};
|
|
519
502
|
}
|
|
520
503
|
|
|
521
504
|
& svg {
|
|
522
505
|
width: 14px;
|
|
523
506
|
height: 14px;
|
|
524
507
|
}
|
|
525
|
-
`,
|
|
508
|
+
`,oi=s.span`
|
|
526
509
|
flex: 1 0 auto;
|
|
527
510
|
text-align: center;
|
|
528
|
-
`,
|
|
511
|
+
`,lt=A.newClassNameGetter("chip"),Qe=({children:e,className:r,classnames:o,deletable:i,onDelete:n,ref:l,variant:c="gray",...d})=>a.jsxs(ti,{...d,ref:l,className:lt("container",r),$variant:c,$deletable:!!i,children:[a.jsx(oi,{className:lt("label",o==null?void 0:o.label),children:e}),i&&a.jsx(ri,{type:"button",className:lt("delete",o==null?void 0:o.delete),$variant:c,onClick:n,children:a.jsx(a.X,{})})]}),ii="Confirm",ni="Cancel",ai=oe.keyframes`
|
|
529
512
|
from {
|
|
530
513
|
opacity: 0;
|
|
531
514
|
transform: translateX(-50%) translateY(100%);
|
|
@@ -534,7 +517,7 @@
|
|
|
534
517
|
opacity: 1;
|
|
535
518
|
transform: translateX(-50%) translateY(0);
|
|
536
519
|
}
|
|
537
|
-
`,
|
|
520
|
+
`,li=oe.keyframes`
|
|
538
521
|
from {
|
|
539
522
|
opacity: 1;
|
|
540
523
|
transform: translateX(-50%) translateY(0);
|
|
@@ -543,7 +526,7 @@
|
|
|
543
526
|
opacity: 0;
|
|
544
527
|
transform: translateX(-50%) translateY(100%);
|
|
545
528
|
}
|
|
546
|
-
`,
|
|
529
|
+
`,di=s.div`
|
|
547
530
|
position: fixed;
|
|
548
531
|
bottom: 24px;
|
|
549
532
|
left: 50%;
|
|
@@ -558,18 +541,18 @@
|
|
|
558
541
|
box-shadow:
|
|
559
542
|
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
|
560
543
|
0 2px 4px -2px rgba(0, 0, 0, 0.1);
|
|
561
|
-
animation: ${({$open:e})=>e?
|
|
544
|
+
animation: ${({$open:e})=>e?ai:li} 0.2s ease-out forwards;
|
|
562
545
|
z-index: 1000;
|
|
563
|
-
`,
|
|
546
|
+
`,ci=s.p`
|
|
564
547
|
margin: 0;
|
|
565
548
|
font-size: 14px;
|
|
566
549
|
color: ${t.COLORS.black};
|
|
567
550
|
white-space: nowrap;
|
|
568
|
-
`,
|
|
551
|
+
`,si=s.div`
|
|
569
552
|
display: flex;
|
|
570
553
|
align-items: center;
|
|
571
554
|
gap: 8px;
|
|
572
|
-
`,Pe=A.newClassNameGetter("confirmation"),
|
|
555
|
+
`,Pe=A.newClassNameGetter("confirmation"),pi=({cancelBindings:e,cancelLabel:r=ni,className:o,classnames:i,confirmLabel:n=ii,loading:l=!1,message:c,onCancel:d,onConfirm:p,open:h=!0,ref:g,submitBindings:f,...O})=>h?a.jsxs(di,{...O,ref:g,className:Pe("container",o),$open:h,children:[a.jsx(ci,{className:Pe("message",i==null?void 0:i.message),children:c}),a.jsxs(si,{className:Pe("actions",i==null?void 0:i.actions),children:[a.jsx(_e,{variant:"system",size:"compact",onClick:d,keyBindings:e,className:Pe("cancel-button",i==null?void 0:i.cancelButton),children:r}),a.jsx(_e,{variant:"danger",size:"compact",onClick:p,loading:l,keyBindings:f,className:Pe("confirm-button",i==null?void 0:i.confirmButton),children:n})]})]}):null,ze={sm:`${t.BREAKPOINTS.sm}px`,md:`${t.BREAKPOINTS.md}px`,lg:`${t.BREAKPOINTS.lg}px`,xl:`${t.BREAKPOINTS.xl}px`,"2xl":`${t.BREAKPOINTS["2xl"]}px`},ui=s.div`
|
|
573
556
|
width: 100%;
|
|
574
557
|
|
|
575
558
|
${t.mediaUp("sm")} {
|
|
@@ -591,16 +574,16 @@
|
|
|
591
574
|
${t.mediaUp("2xl")} {
|
|
592
575
|
max-width: ${ze["2xl"]};
|
|
593
576
|
}
|
|
594
|
-
`,
|
|
577
|
+
`,hi=A.newClassNameGetter("container"),bi=({children:e,className:r,ref:o,...i})=>a.jsx(ui,{...i,ref:o,className:hi("container",r),children:e}),Je={compact:{height:"32px",padding:"0 10px",radius:"14px",iconSize:16},default:{height:"40px",padding:"0 14px",radius:"16px",iconSize:20}},je={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=36,rt=2,gi=12,vr=(e,r,o="en")=>{const i=e.getFullYear(),n=e.getMonth(),l=e.getDate(),c=e.getHours(),d=e.getMinutes(),p=e.getSeconds(),h=c%12||12,g=c>=12,f=new Intl.DateTimeFormat(o,{month:"long"}).format(e),O=new Intl.DateTimeFormat(o,{month:"short"}).format(e),m=new Intl.DateTimeFormat(o,{weekday:"long"}).format(e),y=new Intl.DateTimeFormat(o,{weekday:"short"}).format(e),S=L=>L.toString().padStart(2,"0"),v=L=>L.toString().padStart(2," "),x=L=>`\0${L}\0`,$=[["2006","YEARFOUR",i.toString()],["January","MONTHLONG",f],["Monday","WEEKDAYLONG",m],["Jan","MONTHSHORT",O],["Mon","WEEKDAYSHORT",y],["06","YEARTWO",i.toString().slice(-2)],["01","MONTHPAD",S(n+1)],["_2","DAYSPACE",v(l)],["02","DAYPAD",S(l)],["15","HOURTWENTYFOUR",S(c)],["03","HOURTWELVEPAD",S(h)],["04","MINUTE",S(d)],["05","SECOND",S(p)],["PM","AMPMUP",g?"PM":"AM"],["pm","AMPMLOW",g?"pm":"am"],["1","MONTH",(n+1).toString()],["2","DAY",l.toString()],["3","HOURTWELVE",h.toString()]];let b=r;for(const[L,j]of $)b=b.split(L).join(x(j));for(const[,L,j]of $)b=b.split(x(L)).join(j);return b},fi=(e,r)=>new Date(e,r+1,0).getDate(),xi=(e,r)=>new Date(e,r,1).getDay(),Oi=(e,r,o=1)=>{const i=fi(e,r);let l=xi(e,r)-o;l<0&&(l+=7);const c=[];for(let d=0;d<l;d++)c.push(null);for(let d=1;d<=i;d++)c.push(d);for(;c.length<42;)c.push(null);return c},$i=(e,r=1)=>{const o=[];for(let i=0;i<7;i++){const n=(r+i)%7,l=new Date(2024,0,7+n);o.push(new Intl.DateTimeFormat(e,{weekday:"short"}).format(l))}return o},Si=e=>{const r=[];for(let o=0;o<12;o++){const i=new Date(2024,o,1);r.push(new Intl.DateTimeFormat(e,{month:"short"}).format(i))}return r},Wt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate(),Xt=(e,r)=>e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth(),yi=(e,r)=>e.getFullYear()===r.getFullYear(),Ut=(e,r,o,i,n)=>{const l=new Date(e,r,o);if(i){const c=new Date(i.getFullYear(),i.getMonth(),i.getDate());if(l<c)return!0}if(n){const c=new Date(n.getFullYear(),n.getMonth(),n.getDate());if(l>c)return!0}return!1},qt=(e,r,o,i)=>{if(o){const n=o.getFullYear(),l=o.getMonth();if(e<n||e===n&&r<l)return!0}if(i){const n=i.getFullYear(),l=i.getMonth();if(e>n||e===n&&r>l)return!0}return!1},Kt=(e,r,o)=>!!(r&&e<r.getFullYear()||o&&e>o.getFullYear()),vi=(e,r=12)=>{const o=e-Math.floor(r/2),i=[];for(let n=0;n<r;n++)i.push(o+n);return i},Ci=e=>{switch(e){case"date":return"02.01.2006";case"month":return"January 2006";case"year":return"2006"}},mi=s.div`
|
|
595
578
|
position: relative;
|
|
596
579
|
display: inline-flex;
|
|
597
580
|
flex-direction: column;
|
|
598
581
|
gap: 2px;
|
|
599
582
|
min-width: 180px;
|
|
600
583
|
width: ${({$fullWidth:e})=>e?"100%":"fit-content"};
|
|
601
|
-
`,
|
|
584
|
+
`,wi=s(ne)`
|
|
602
585
|
margin-left: 6px;
|
|
603
|
-
`,
|
|
586
|
+
`,Ri=s.button`
|
|
604
587
|
display: flex;
|
|
605
588
|
align-items: center;
|
|
606
589
|
justify-content: space-between;
|
|
@@ -611,68 +594,64 @@
|
|
|
611
594
|
font-size: 14px;
|
|
612
595
|
font-weight: 500;
|
|
613
596
|
text-align: left;
|
|
614
|
-
height: ${({$size:e})=>
|
|
615
|
-
padding: ${({$size:e})=>
|
|
616
|
-
border-radius: ${({$size:e})=>
|
|
617
|
-
color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?
|
|
597
|
+
height: ${({$size:e})=>Je[e].height};
|
|
598
|
+
padding: ${({$size:e})=>Je[e].padding};
|
|
599
|
+
border-radius: ${({$size:e})=>Je[e].radius};
|
|
600
|
+
color: ${({$variant:e,$disabled:r,$hasValue:o})=>o?je[e].color[r?"disabled":"static"]:je[e].placeholder[r?"disabled":"static"]};
|
|
618
601
|
border: 1px solid
|
|
619
|
-
${({$variant:e,$disabled:r})=>
|
|
620
|
-
background-color: ${({$variant:e,$disabled:r})=>
|
|
621
|
-
|
|
622
|
-
&:focus-visible {
|
|
623
|
-
outline: 2px solid ${({$variant:e})=>Se[e].focus};
|
|
624
|
-
}
|
|
602
|
+
${({$variant:e,$disabled:r})=>je[e].border[r?"disabled":"static"]};
|
|
603
|
+
background-color: ${({$variant:e,$disabled:r})=>je[e].background[r?"disabled":"static"]};
|
|
625
604
|
|
|
626
605
|
${({$open:e,$variant:r})=>e&&`
|
|
627
|
-
outline: 2px solid ${
|
|
606
|
+
outline: 2px solid ${je[r].focus};
|
|
628
607
|
`}
|
|
629
|
-
`,
|
|
608
|
+
`,ki=s.span`
|
|
630
609
|
flex: 1;
|
|
631
610
|
overflow: hidden;
|
|
632
611
|
text-overflow: ellipsis;
|
|
633
612
|
white-space: nowrap;
|
|
634
|
-
`,
|
|
613
|
+
`,Li=s.span`
|
|
635
614
|
display: flex;
|
|
636
615
|
align-items: center;
|
|
637
616
|
justify-content: center;
|
|
638
617
|
flex-shrink: 0;
|
|
639
618
|
transition: transform 0.15s ease;
|
|
640
619
|
transform: ${({$open:e})=>e?"rotate(180deg)":"rotate(0deg)"};
|
|
641
|
-
`,
|
|
620
|
+
`,Cr=`
|
|
642
621
|
z-index: 100;
|
|
643
622
|
background-color: ${t.COLORS.white};
|
|
644
623
|
border: 1px solid ${t.alpha(t.COLORS.black,15)};
|
|
645
624
|
border-radius: 12px;
|
|
646
625
|
box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
|
|
647
|
-
padding: ${
|
|
648
|
-
`,
|
|
626
|
+
padding: ${gi}px;
|
|
627
|
+
`,mr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Pi=s.div`
|
|
649
628
|
position: absolute;
|
|
650
629
|
${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
|
|
651
630
|
left: 0;
|
|
652
|
-
${
|
|
631
|
+
${Cr}
|
|
653
632
|
opacity: ${({$open:e})=>e?1:0};
|
|
654
633
|
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
655
|
-
transform: ${({$open:e,$position:r})=>
|
|
634
|
+
transform: ${({$open:e,$position:r})=>mr(e,r)};
|
|
656
635
|
transition:
|
|
657
636
|
opacity 0.15s ease,
|
|
658
637
|
transform 0.15s ease,
|
|
659
638
|
visibility 0.15s;
|
|
660
|
-
`,
|
|
639
|
+
`,zi=s.div`
|
|
661
640
|
position: fixed;
|
|
662
|
-
${
|
|
641
|
+
${Cr}
|
|
663
642
|
opacity: ${({$open:e})=>e?1:0};
|
|
664
643
|
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
665
|
-
transform: ${({$open:e,$position:r})=>
|
|
644
|
+
transform: ${({$open:e,$position:r})=>mr(e,r)};
|
|
666
645
|
transition:
|
|
667
646
|
opacity 0.15s ease,
|
|
668
647
|
transform 0.15s ease,
|
|
669
648
|
visibility 0.15s;
|
|
670
|
-
`,
|
|
649
|
+
`,dt=s.div`
|
|
671
650
|
display: flex;
|
|
672
651
|
align-items: center;
|
|
673
652
|
justify-content: space-between;
|
|
674
653
|
margin-bottom: 8px;
|
|
675
|
-
`,
|
|
654
|
+
`,ct=s.button`
|
|
676
655
|
display: flex;
|
|
677
656
|
align-items: center;
|
|
678
657
|
gap: 4px;
|
|
@@ -688,11 +667,7 @@
|
|
|
688
667
|
&:hover {
|
|
689
668
|
background-color: ${t.alpha(t.COLORS.black,5)};
|
|
690
669
|
}
|
|
691
|
-
|
|
692
|
-
&:focus-visible {
|
|
693
|
-
outline: 2px solid ${t.alpha(t.COLORS.black,20)};
|
|
694
|
-
}
|
|
695
|
-
`,ye=s.button`
|
|
670
|
+
`,Oe=s.button`
|
|
696
671
|
display: flex;
|
|
697
672
|
align-items: center;
|
|
698
673
|
justify-content: center;
|
|
@@ -708,10 +683,6 @@
|
|
|
708
683
|
background-color: ${t.alpha(t.COLORS.black,5)};
|
|
709
684
|
}
|
|
710
685
|
|
|
711
|
-
&:focus-visible {
|
|
712
|
-
outline: 2px solid ${t.alpha(t.COLORS.black,20)};
|
|
713
|
-
}
|
|
714
|
-
|
|
715
686
|
&:disabled {
|
|
716
687
|
opacity: 0.3;
|
|
717
688
|
cursor: not-allowed;
|
|
@@ -720,33 +691,33 @@
|
|
|
720
691
|
background: transparent;
|
|
721
692
|
}
|
|
722
693
|
}
|
|
723
|
-
`,
|
|
694
|
+
`,st=s.div`
|
|
724
695
|
display: flex;
|
|
725
696
|
gap: 4px;
|
|
726
|
-
`,
|
|
697
|
+
`,ji=s.div`
|
|
727
698
|
display: grid;
|
|
728
|
-
grid-template-columns: repeat(7, ${
|
|
729
|
-
gap: ${
|
|
699
|
+
grid-template-columns: repeat(7, ${ie}px);
|
|
700
|
+
gap: ${rt}px;
|
|
730
701
|
margin-bottom: 4px;
|
|
731
|
-
`,
|
|
702
|
+
`,Ei=s.div`
|
|
732
703
|
display: flex;
|
|
733
704
|
align-items: center;
|
|
734
705
|
justify-content: center;
|
|
735
|
-
height: ${
|
|
706
|
+
height: ${ie}px;
|
|
736
707
|
font-size: 12px;
|
|
737
708
|
font-weight: 500;
|
|
738
709
|
color: ${t.alpha(t.COLORS.black,50)};
|
|
739
710
|
text-transform: uppercase;
|
|
740
|
-
`,
|
|
711
|
+
`,Ti=s.div`
|
|
741
712
|
display: grid;
|
|
742
|
-
grid-template-columns: repeat(7, ${
|
|
743
|
-
gap: ${
|
|
744
|
-
`,
|
|
713
|
+
grid-template-columns: repeat(7, ${ie}px);
|
|
714
|
+
gap: ${rt}px;
|
|
715
|
+
`,Ni=s.button`
|
|
745
716
|
display: flex;
|
|
746
717
|
align-items: center;
|
|
747
718
|
justify-content: center;
|
|
748
|
-
width: ${
|
|
749
|
-
height: ${
|
|
719
|
+
width: ${ie}px;
|
|
720
|
+
height: ${ie}px;
|
|
750
721
|
border: none;
|
|
751
722
|
border-radius: 8px;
|
|
752
723
|
font-size: 13px;
|
|
@@ -763,20 +734,15 @@
|
|
|
763
734
|
background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
|
|
764
735
|
}
|
|
765
736
|
|
|
766
|
-
&:focus-visible {
|
|
767
|
-
outline: 2px solid ${t.alpha(t.COLORS.black,30)};
|
|
768
|
-
outline-offset: 1px;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
737
|
&:disabled {
|
|
772
738
|
cursor: not-allowed;
|
|
773
739
|
}
|
|
774
|
-
`,
|
|
740
|
+
`,Ii=s.div`
|
|
775
741
|
display: grid;
|
|
776
742
|
grid-template-columns: repeat(3, 1fr);
|
|
777
743
|
gap: 8px;
|
|
778
|
-
width: ${7*
|
|
779
|
-
`,
|
|
744
|
+
width: ${7*ie+6*rt}px;
|
|
745
|
+
`,Ai=s.button`
|
|
780
746
|
display: flex;
|
|
781
747
|
align-items: center;
|
|
782
748
|
justify-content: center;
|
|
@@ -796,17 +762,12 @@
|
|
|
796
762
|
&:hover:not(:disabled) {
|
|
797
763
|
background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
|
|
798
764
|
}
|
|
799
|
-
|
|
800
|
-
&:focus-visible {
|
|
801
|
-
outline: 2px solid ${t.alpha(t.COLORS.black,30)};
|
|
802
|
-
outline-offset: 1px;
|
|
803
|
-
}
|
|
804
|
-
`,Ni=s.div`
|
|
765
|
+
`,Di=s.div`
|
|
805
766
|
display: grid;
|
|
806
767
|
grid-template-columns: repeat(3, 1fr);
|
|
807
768
|
gap: 8px;
|
|
808
|
-
width: ${7*
|
|
809
|
-
`,
|
|
769
|
+
width: ${7*ie+6*rt}px;
|
|
770
|
+
`,_i=s.button`
|
|
810
771
|
display: flex;
|
|
811
772
|
align-items: center;
|
|
812
773
|
justify-content: center;
|
|
@@ -826,15 +787,10 @@
|
|
|
826
787
|
&:hover:not(:disabled) {
|
|
827
788
|
background-color: ${({$selected:e})=>e?t.COLORS.black:t.alpha(t.COLORS.black,8)};
|
|
828
789
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
}
|
|
834
|
-
`,Ai=s.div`
|
|
835
|
-
width: ${ae}px;
|
|
836
|
-
height: ${ae}px;
|
|
837
|
-
`,K=A.newClassNameGetter("date-picker"),He=4,Di=300,_i=({value:e,onChange:r,mode:o="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:h="default",variant:g="normal",disabled:f=!1,fullWidth:O=!1,label:C,portalRenderNode:y,open:S,onOpen:v,onClose:x,className:$,classnames:b,ref:L,...j})=>{const N=u.useMemo(()=>new Date,[]),[H,z]=u.useState(!1),[_,E]=u.useState({top:0,left:0}),[w,M]=u.useState("bottom"),[m,I]=u.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[k,T]=u.useState(()=>e??N),[F,B]=u.useState(()=>((e==null?void 0:e.getFullYear())??N.getFullYear())-6),G=u.useRef(null),P=u.useRef(null),D=u.useRef(null),X=S!==void 0,q=X?S:H,Oe=i??Si(o),_e=u.useMemo(()=>fi(l,c),[l,c]),rt=u.useMemo(()=>xi(l),[l]),Ir=u.useMemo(()=>gi(k.getFullYear(),k.getMonth(),c),[k,c]),Me=u.useMemo(()=>$i(F+6,12),[F]),Lt=u.useMemo(()=>e?$r(e,Oe,l):null,[e,Oe,l]),Ar=n??Oe.replace(/2006|06|January|Jan|01|02/g,"__"),me=u.useCallback(()=>{var we;if(!P.current)return;const R=P.current.getBoundingClientRect(),Y=((we=D.current)==null?void 0:we.offsetHeight)??Di,Ce=window.innerHeight-R.bottom-He,Fe=R.top-He,$e=Ce<Y&&Fe>Ce?"top":"bottom";if(M($e),y){const Be=$e==="bottom"?R.bottom+He:R.top-Y-He;E({top:Be,left:R.left})}},[y]),Pt=u.useCallback(()=>{if(f)return;X||z(!0),v==null||v(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??N;T(R),B(R.getFullYear()-6)},[f,X,v,o,e,N]),Z=u.useCallback(()=>{X||z(!1),x==null||x()},[X,x]),Dr=u.useCallback(()=>{q?Z():Pt()},[q,Z,Pt]),_r=u.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Mr=u.useCallback(R=>{if(o==="month"){const Y=new Date(k.getFullYear(),R,1);r==null||r(Y),Z()}else T(new Date(k.getFullYear(),R,1)),I("days")},[o,k,r,Z]),Fr=u.useCallback(R=>{if(o==="year"){const Y=new Date(R,0,1);r==null||r(Y),Z()}else o==="month"?(T(new Date(R,k.getMonth(),1)),I("months")):(T(new Date(R,k.getMonth(),1)),I("months"))},[o,k,r,Z]),Br=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Yr=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),Hr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Gr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Vr=u.useCallback(()=>{B(R=>R-12)},[]),Wr=u.useCallback(()=>{B(R=>R+12)},[]),zt=u.useCallback(()=>{m==="days"?I("months"):m==="months"&&I("years")},[m]);u.useLayoutEffect(()=>{q&&me()},[q,me]),u.useEffect(()=>{const R=$e=>{const we=$e.target,Be=G.current&&!G.current.contains(we),Jr=D.current&&!D.current.contains(we);y?Be&&Jr&&Z():Be&&Z()},Y=$e=>{$e.key==="Escape"&&Z()},Ce=()=>{q&&y&&me()},Fe=()=>{q&&y&&me()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),y&&(window.addEventListener("scroll",Ce,!0),window.addEventListener("resize",Fe))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",Ce,!0),window.removeEventListener("resize",Fe)}},[q,Z,y,me]);const Ur=Ze[h].iconSize,Xr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(ct,{children:[a.jsx(ye,{onClick:Br,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ye,{onClick:Yr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Li,{children:_e.map((R,Y)=>a.jsx(Pi,{children:R},Y))}),a.jsx(zi,{className:K("grid",b==null?void 0:b.grid),children:Ir.map((R,Y)=>R===null?a.jsx(Ai,{},Y):a.jsx(ji,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Gt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Gt(N,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Wt(k.getFullYear(),k.getMonth(),R,d,p),disabled:Wt(k.getFullYear(),k.getMonth(),R,d,p),onClick:()=>_r(R),children:R},Y))})]}),qr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(dt,{onClick:zt,type:"button",children:k.getFullYear()}),a.jsxs(ct,{children:[a.jsx(ye,{onClick:Hr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ye,{onClick:Gr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ei,{className:K("grid",b==null?void 0:b.grid),children:rt.map((R,Y)=>a.jsx(Ti,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Vt(e,new Date(k.getFullYear(),Y,1)):!1,$current:Vt(N,new Date(k.getFullYear(),Y,1)),$disabled:Ut(k.getFullYear(),Y,d,p),disabled:Ut(k.getFullYear(),Y,d,p),onClick:()=>Mr(Y),children:R},Y))})]}),Kr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(lt,{className:K("header",b==null?void 0:b.header),children:[a.jsxs(dt,{type:"button",style:{cursor:"default"},children:[Me[0]," - ",Me[Me.length-1]]}),a.jsxs(ct,{children:[a.jsx(ye,{onClick:Vr,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(ye,{onClick:Wr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ni,{className:K("grid",b==null?void 0:b.grid),children:Me.map(R=>a.jsx(Ii,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Oi(e,new Date(R,0,1)):!1,$current:N.getFullYear()===R,$disabled:Xt(R,d,p),disabled:Xt(R,d,p),onClick:()=>Fr(R),children:R},R))})]}),jt=()=>{switch(m){case"days":return Xr();case"months":return qr();case"years":return Kr()}},Zr=y?xe.createPortal(a.jsx(ki,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),style:{top:_.top,left:_.left},children:jt()}),y):a.jsx(Ri,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),children:jt()});return a.jsxs(yi,{...j,ref:L??G,$fullWidth:O,className:K("container",$),children:[C&&a.jsx(vi,{children:C}),a.jsxs(mi,{ref:P,type:"button",onClick:Dr,disabled:f,$size:h,$variant:g,$disabled:f,$open:q,$hasValue:!!Lt,className:K("trigger",b==null?void 0:b.trigger),children:[a.jsx(Ci,{children:Lt??Ar}),a.jsx(wi,{$open:q,children:a.jsx(a.ChevronDown,{size:Ur})})]}),Zr]})},Mi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},Fi=(e,r)=>{switch(e){case"left":return`
|
|
790
|
+
`,Mi=s.div`
|
|
791
|
+
width: ${ie}px;
|
|
792
|
+
height: ${ie}px;
|
|
793
|
+
`,K=A.newClassNameGetter("date-picker"),Ve=4,Fi=300,Bi=({value:e,onChange:r,mode:o="date",displayFormat:i,placeholder:n,locale:l="en",weekStartsOn:c=1,minDate:d,maxDate:p,size:h="default",variant:g="normal",disabled:f=!1,fullWidth:O=!1,label:m,portalRenderNode:y,open:S,onOpen:v,onClose:x,className:$,classnames:b,ref:L,...j})=>{const N=u.useMemo(()=>new Date,[]),[H,z]=u.useState(!1),[_,E]=u.useState({top:0,left:0}),[w,M]=u.useState("bottom"),[C,I]=u.useState(()=>o==="year"?"years":o==="month"?"months":"days"),[k,T]=u.useState(()=>e??N),[F,B]=u.useState(()=>((e==null?void 0:e.getFullYear())??N.getFullYear())-6),V=u.useRef(null),P=u.useRef(null),D=u.useRef(null),U=S!==void 0,q=U?S:H,fe=i??Ci(o),Me=u.useMemo(()=>$i(l,c),[l,c]),ot=u.useMemo(()=>Si(l),[l]),_r=u.useMemo(()=>Oi(k.getFullYear(),k.getMonth(),c),[k,c]),Fe=u.useMemo(()=>vi(F+6,12),[F]),zt=u.useMemo(()=>e?vr(e,fe,l):null,[e,fe,l]),Mr=n??fe.replace(/2006|06|January|Jan|01|02/g,"__"),Ce=u.useCallback(()=>{var we;if(!P.current)return;const R=P.current.getBoundingClientRect(),Y=((we=D.current)==null?void 0:we.offsetHeight)??Fi,me=window.innerHeight-R.bottom-Ve,Be=R.top-Ve,xe=me<Y&&Be>me?"top":"bottom";if(M(xe),y){const Ye=xe==="bottom"?R.bottom+Ve:R.top-Y-Ve;E({top:Ye,left:R.left})}},[y]),jt=u.useCallback(()=>{if(f)return;U||z(!0),v==null||v(),I(o==="year"?"years":o==="month"?"months":"days");const R=e??N;T(R),B(R.getFullYear()-6)},[f,U,v,o,e,N]),Z=u.useCallback(()=>{U||z(!1),x==null||x()},[U,x]),Fr=u.useCallback(()=>{q?Z():jt()},[q,Z,jt]),Br=u.useCallback(R=>{const Y=new Date(k.getFullYear(),k.getMonth(),R);r==null||r(Y),Z()},[k,r,Z]),Yr=u.useCallback(R=>{if(o==="month"){const Y=new Date(k.getFullYear(),R,1);r==null||r(Y),Z()}else T(new Date(k.getFullYear(),R,1)),I("days")},[o,k,r,Z]),Hr=u.useCallback(R=>{if(o==="year"){const Y=new Date(R,0,1);r==null||r(Y),Z()}else o==="month"?(T(new Date(R,k.getMonth(),1)),I("months")):(T(new Date(R,k.getMonth(),1)),I("months"))},[o,k,r,Z]),Vr=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()-1,1))},[]),Gr=u.useCallback(()=>{T(R=>new Date(R.getFullYear(),R.getMonth()+1,1))},[]),Wr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()-1,R.getMonth(),1))},[]),Xr=u.useCallback(()=>{T(R=>new Date(R.getFullYear()+1,R.getMonth(),1))},[]),Ur=u.useCallback(()=>{B(R=>R-12)},[]),qr=u.useCallback(()=>{B(R=>R+12)},[]),Et=u.useCallback(()=>{C==="days"?I("months"):C==="months"&&I("years")},[C]);u.useLayoutEffect(()=>{q&&Ce()},[q,Ce]),u.useEffect(()=>{const R=xe=>{const we=xe.target,Ye=V.current&&!V.current.contains(we),to=D.current&&!D.current.contains(we);y?Ye&&to&&Z():Ye&&Z()},Y=xe=>{xe.key==="Escape"&&Z()},me=()=>{q&&y&&Ce()},Be=()=>{q&&y&&Ce()};return q&&(document.addEventListener("mousedown",R),document.addEventListener("keydown",Y),y&&(window.addEventListener("scroll",me,!0),window.addEventListener("resize",Be))),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Y),window.removeEventListener("scroll",me,!0),window.removeEventListener("resize",Be)}},[q,Z,y,Ce]);const Kr=Je[h].iconSize,Zr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:Et,type:"button",children:new Intl.DateTimeFormat(l,{month:"long",year:"numeric"}).format(k)}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:Vr,type:"button","aria-label":"Previous month",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Gr,type:"button","aria-label":"Next month",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(ji,{children:Me.map((R,Y)=>a.jsx(Ei,{children:R},Y))}),a.jsx(Ti,{className:K("grid",b==null?void 0:b.grid),children:_r.map((R,Y)=>R===null?a.jsx(Mi,{},Y):a.jsx(Ni,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Wt(e,new Date(k.getFullYear(),k.getMonth(),R)):!1,$today:Wt(N,new Date(k.getFullYear(),k.getMonth(),R)),$disabled:Ut(k.getFullYear(),k.getMonth(),R,d,p),disabled:Ut(k.getFullYear(),k.getMonth(),R,d,p),onClick:()=>Br(R),children:R},Y))})]}),Jr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsx(ct,{onClick:Et,type:"button",children:k.getFullYear()}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:Wr,type:"button","aria-label":"Previous year",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:Xr,type:"button","aria-label":"Next year",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Ii,{className:K("grid",b==null?void 0:b.grid),children:ot.map((R,Y)=>a.jsx(Ai,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?Xt(e,new Date(k.getFullYear(),Y,1)):!1,$current:Xt(N,new Date(k.getFullYear(),Y,1)),$disabled:qt(k.getFullYear(),Y,d,p),disabled:qt(k.getFullYear(),Y,d,p),onClick:()=>Yr(Y),children:R},Y))})]}),Qr=()=>a.jsxs(a.Fragment,{children:[a.jsxs(dt,{className:K("header",b==null?void 0:b.header),children:[a.jsxs(ct,{type:"button",style:{cursor:"default"},children:[Fe[0]," - ",Fe[Fe.length-1]]}),a.jsxs(st,{children:[a.jsx(Oe,{onClick:Ur,type:"button","aria-label":"Previous years",children:a.jsx(a.ChevronLeft,{size:16})}),a.jsx(Oe,{onClick:qr,type:"button","aria-label":"Next years",children:a.jsx(a.ChevronRight,{size:16})})]})]}),a.jsx(Di,{className:K("grid",b==null?void 0:b.grid),children:Fe.map(R=>a.jsx(_i,{type:"button",className:K("cell",b==null?void 0:b.cell),$selected:e?yi(e,new Date(R,0,1)):!1,$current:N.getFullYear()===R,$disabled:Kt(R,d,p),disabled:Kt(R,d,p),onClick:()=>Hr(R),children:R},R))})]}),Tt=()=>{switch(C){case"days":return Zr();case"months":return Jr();case"years":return Qr()}},eo=y?ge.createPortal(a.jsx(zi,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),style:{top:_.top,left:_.left},children:Tt()}),y):a.jsx(Pi,{ref:D,$open:q,$position:w,className:K("calendar",b==null?void 0:b.calendar),children:Tt()});return a.jsxs(mi,{...j,ref:L??V,$fullWidth:O,className:K("container",$),children:[m&&a.jsx(wi,{children:m}),a.jsxs(Ri,{ref:P,type:"button",onClick:Fr,disabled:f,$size:h,$variant:g,$disabled:f,$open:q,$hasValue:!!zt,className:K("trigger",b==null?void 0:b.trigger),children:[a.jsx(ki,{children:zt??Mr}),a.jsx(Li,{$open:q,children:a.jsx(a.ChevronDown,{size:Kr})})]}),eo]})},Yi={left:t.KEYFRAMES.slideInLeft,right:t.KEYFRAMES.slideInRight,top:t.KEYFRAMES.slideInTop,bottom:t.KEYFRAMES.slideInBottom},Hi=(e,r)=>{switch(e){case"left":return`
|
|
838
794
|
top: 0;
|
|
839
795
|
left: 0;
|
|
840
796
|
height: 100%;
|
|
@@ -854,19 +810,19 @@
|
|
|
854
810
|
left: 0;
|
|
855
811
|
width: 100%;
|
|
856
812
|
height: ${r};
|
|
857
|
-
`}},
|
|
813
|
+
`}},Vi=s.div`
|
|
858
814
|
position: fixed;
|
|
859
815
|
z-index: 1001;
|
|
860
816
|
background-color: ${t.COLORS.white};
|
|
861
817
|
box-shadow: 0 4px 24px ${t.alpha(t.COLORS.black,20)};
|
|
862
|
-
${e=>
|
|
863
|
-
animation: ${e=>
|
|
864
|
-
`,
|
|
818
|
+
${e=>Hi(e.$position,e.$size)}
|
|
819
|
+
animation: ${e=>Yi[e.$position]} ${e=>e.$animated?"0.05s":"0s"} ease-out forwards;
|
|
820
|
+
`,Gi=A.newClassNameGetter("drawer"),Wi=({animated:e,children:r,className:o,open:i,position:n="right",ref:l,size:c="400px",...d})=>i?ge.createPortal(a.jsx(Vi,{...d,ref:l,className:Gi("container",o),$animated:!!e,$position:n,$size:c,children:r}),document.body):null,Xi=s.div`
|
|
865
821
|
position: relative;
|
|
866
822
|
display: inline-block;
|
|
867
|
-
`,
|
|
823
|
+
`,Ui=s.div`
|
|
868
824
|
cursor: pointer;
|
|
869
|
-
`,
|
|
825
|
+
`,wr=`
|
|
870
826
|
z-index: 100;
|
|
871
827
|
min-width: 160px;
|
|
872
828
|
padding: 8px;
|
|
@@ -874,39 +830,39 @@
|
|
|
874
830
|
border: 1px solid ${t.COLORS.gray};
|
|
875
831
|
border-radius: 8px;
|
|
876
832
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
877
|
-
`,
|
|
833
|
+
`,Rr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",qi=s.div`
|
|
878
834
|
position: absolute;
|
|
879
835
|
${({$position:e})=>e==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
|
|
880
836
|
${({$align:e})=>e==="left"?"left: 0;":"right: 0;"}
|
|
881
|
-
${
|
|
837
|
+
${wr}
|
|
882
838
|
opacity: ${({$open:e})=>e?1:0};
|
|
883
839
|
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
884
|
-
transform: ${({$open:e,$position:r})=>
|
|
840
|
+
transform: ${({$open:e,$position:r})=>Rr(e,r)};
|
|
885
841
|
transition:
|
|
886
842
|
opacity 0.15s ease,
|
|
887
843
|
transform 0.15s ease,
|
|
888
844
|
visibility 0.15s;
|
|
889
|
-
`,
|
|
845
|
+
`,Ki=s.div`
|
|
890
846
|
position: fixed;
|
|
891
|
-
${
|
|
847
|
+
${wr}
|
|
892
848
|
opacity: ${({$open:e})=>e?1:0};
|
|
893
849
|
visibility: ${({$open:e})=>e?"visible":"hidden"};
|
|
894
|
-
transform: ${({$open:e,$position:r})=>
|
|
850
|
+
transform: ${({$open:e,$position:r})=>Rr(e,r)};
|
|
895
851
|
transition:
|
|
896
852
|
opacity 0.15s ease,
|
|
897
853
|
transform 0.15s ease,
|
|
898
854
|
visibility 0.15s;
|
|
899
|
-
`,Ge=A.newClassNameGetter("dropdown"),
|
|
855
|
+
`,Ge=A.newClassNameGetter("dropdown"),We=4,Zi=100,Ji=({align:e="left",children:r,className:o,classnames:i,onClose:n,onOpen:l,open:c,portalRenderNode:d,ref:p,trigger:h,...g})=>{const[f,O]=u.useState(!1),[m,y]=u.useState({top:0,left:0}),[S,v]=u.useState("bottom"),x=u.useRef(null),$=u.useRef(null),b=u.useRef(null),L=c!==void 0,j=L?c:f,N=u.useCallback(()=>{var T,F;if(!$.current)return;const E=$.current.getBoundingClientRect(),w=((T=b.current)==null?void 0:T.offsetHeight)??Zi,M=((F=b.current)==null?void 0:F.offsetWidth)??160,C=window.innerHeight-E.bottom-We,I=E.top-We,k=C<w&&I>C?"top":"bottom";if(v(k),d){let B;e==="left"?B=E.left:B=E.right-M;const V=k==="bottom"?E.bottom+We:E.top-w-We;y({top:V,left:B})}},[e,d]),H=u.useCallback(()=>{L?j?n==null||n():l==null||l():O(E=>{const w=!E;return w?l==null||l():n==null||n(),w})},[L,j,n,l]),z=u.useCallback(()=>{L||O(!1),n==null||n()},[L,n]);u.useLayoutEffect(()=>{j&&N()},[j,N]),u.useEffect(()=>{const E=I=>{const k=I.target,T=x.current&&!x.current.contains(k),F=b.current&&!b.current.contains(k);d?T&&F&&z():T&&z()},w=I=>{I.key==="Escape"&&z()},M=()=>{j&&d&&N()},C=()=>{j&&d&&N()};return j&&(document.addEventListener("mousedown",E),document.addEventListener("keydown",w),d&&(window.addEventListener("scroll",M,!0),window.addEventListener("resize",C))),()=>{document.removeEventListener("mousedown",E),document.removeEventListener("keydown",w),window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",C)}},[j,z,d,N]);const _=d?ge.createPortal(a.jsx(Ki,{ref:b,$open:j,$position:S,className:Ge("content",i==null?void 0:i.content),style:{top:m.top,left:m.left},children:r}),d):a.jsx(qi,{ref:b,$align:e,$open:j,$position:S,className:Ge("content",i==null?void 0:i.content),children:r});return a.jsxs(Xi,{...g,ref:p??x,className:Ge("container",o),children:[a.jsx(Ui,{ref:$,onClick:H,className:Ge("trigger",i==null?void 0:i.trigger),children:u.cloneElement(h)}),_]})},Qi={normal:t.COLORS["iron-grey"],error:t.COLORS.red,success:t.COLORS.green,warning:t.COLORS.yellow},en=s.span`
|
|
900
856
|
display: block;
|
|
901
857
|
font-size: 12px;
|
|
902
858
|
font-weight: 500;
|
|
903
859
|
line-height: 1.4;
|
|
904
|
-
color: ${e=>
|
|
905
|
-
`,
|
|
860
|
+
color: ${e=>Qi[e.$variant]};
|
|
861
|
+
`,tn=A.newClassNameGetter("field-message"),rn=({children:e,className:r,ref:o,variant:i="normal",...n})=>e?a.jsx(en,{...n,ref:o,className:tn("container",r),$variant:i,children:e}):null,on=s.div`
|
|
906
862
|
display: flex;
|
|
907
863
|
flex-direction: column;
|
|
908
864
|
gap: 12px;
|
|
909
|
-
`,
|
|
865
|
+
`,nn=s.div`
|
|
910
866
|
width: ${({$size:e})=>e}px;
|
|
911
867
|
height: ${({$size:e})=>e}px;
|
|
912
868
|
border-radius: 8px;
|
|
@@ -922,10 +878,10 @@
|
|
|
922
878
|
height: 100%;
|
|
923
879
|
object-fit: cover;
|
|
924
880
|
}
|
|
925
|
-
`,
|
|
881
|
+
`,an=s.span`
|
|
926
882
|
font-size: 12px;
|
|
927
883
|
color: ${t.COLORS["iron-grey"]};
|
|
928
|
-
`,
|
|
884
|
+
`,ln=e=>`
|
|
929
885
|
.${e} {
|
|
930
886
|
padding: 7px 16px;
|
|
931
887
|
font-size: 14px;
|
|
@@ -943,7 +899,7 @@
|
|
|
943
899
|
.${e}:active {
|
|
944
900
|
transform: translate(0, 1px);
|
|
945
901
|
}
|
|
946
|
-
`,
|
|
902
|
+
`,dn=e=>`
|
|
947
903
|
.${e} {
|
|
948
904
|
display: flex;
|
|
949
905
|
flex: 1 1 auto;
|
|
@@ -967,7 +923,7 @@
|
|
|
967
923
|
max-height: 70vh;
|
|
968
924
|
}
|
|
969
925
|
}
|
|
970
|
-
`,
|
|
926
|
+
`,cn=e=>`
|
|
971
927
|
.${e} {
|
|
972
928
|
padding: 7px 16px;
|
|
973
929
|
font-size: 14px;
|
|
@@ -985,7 +941,7 @@
|
|
|
985
941
|
.${e}:active {
|
|
986
942
|
transform: translate(0, 1px);
|
|
987
943
|
}
|
|
988
|
-
`,
|
|
944
|
+
`,sn=e=>`
|
|
989
945
|
.${e} {
|
|
990
946
|
display: flex;
|
|
991
947
|
flex-direction: column;
|
|
@@ -1003,7 +959,7 @@
|
|
|
1003
959
|
border-radius: 8px;
|
|
1004
960
|
}
|
|
1005
961
|
}
|
|
1006
|
-
`,
|
|
962
|
+
`,pn=e=>`
|
|
1007
963
|
.${e} {
|
|
1008
964
|
display: flex;
|
|
1009
965
|
justify-content: flex-end;
|
|
@@ -1022,7 +978,7 @@
|
|
|
1022
978
|
gap: 8px;
|
|
1023
979
|
}
|
|
1024
980
|
}
|
|
1025
|
-
`,
|
|
981
|
+
`,un=e=>`
|
|
1026
982
|
.${e} {
|
|
1027
983
|
display: flex;
|
|
1028
984
|
justify-content: flex-start;
|
|
@@ -1044,7 +1000,7 @@
|
|
|
1044
1000
|
font-size: 14px;
|
|
1045
1001
|
}
|
|
1046
1002
|
}
|
|
1047
|
-
`,
|
|
1003
|
+
`,hn=e=>`
|
|
1048
1004
|
.${e} {
|
|
1049
1005
|
display: block;
|
|
1050
1006
|
z-index: 101;
|
|
@@ -1062,27 +1018,27 @@
|
|
|
1062
1018
|
position: absolute;
|
|
1063
1019
|
touch-action: none;
|
|
1064
1020
|
}
|
|
1065
|
-
`,
|
|
1021
|
+
`,bn=e=>`
|
|
1066
1022
|
.${e} {
|
|
1067
1023
|
position: absolute;
|
|
1068
1024
|
z-index: 2;
|
|
1069
1025
|
background-color: rgba(0, 0, 0, 0.6);
|
|
1070
1026
|
touch-action: none;
|
|
1071
1027
|
}
|
|
1072
|
-
`,
|
|
1028
|
+
`,gn=e=>`
|
|
1073
1029
|
.${e} {
|
|
1074
1030
|
position: absolute;
|
|
1075
1031
|
z-index: 3;
|
|
1076
1032
|
touch-action: none;
|
|
1077
1033
|
}
|
|
1078
|
-
`,
|
|
1034
|
+
`,fn=e=>`
|
|
1079
1035
|
.${e} {
|
|
1080
1036
|
backface-visibility: hidden;
|
|
1081
1037
|
perspective: 1000px;
|
|
1082
1038
|
max-inline-size: unset !important;
|
|
1083
1039
|
max-block-size: unset !important;
|
|
1084
1040
|
}
|
|
1085
|
-
`,
|
|
1041
|
+
`,xn=e=>`
|
|
1086
1042
|
.${e} {
|
|
1087
1043
|
position: absolute;
|
|
1088
1044
|
z-index: 100;
|
|
@@ -1093,7 +1049,7 @@
|
|
|
1093
1049
|
overflow: hidden;
|
|
1094
1050
|
border-radius: 50%;
|
|
1095
1051
|
}
|
|
1096
|
-
`,
|
|
1052
|
+
`,On={tl:"nw-resize",tr:"ne-resize",bl:"sw-resize",br:"se-resize"},$n={tl:{h:"left",v:"top"},tr:{h:"right",v:"top"},bl:{h:"left",v:"bottom"},br:{h:"right",v:"bottom"}},Xe=(e,r)=>{const o=On[r],{h:i,v:n}=$n[r];return`
|
|
1097
1053
|
.${e} {
|
|
1098
1054
|
display: block;
|
|
1099
1055
|
z-index: 102;
|
|
@@ -1119,7 +1075,7 @@
|
|
|
1119
1075
|
${n}: -12px;
|
|
1120
1076
|
}
|
|
1121
1077
|
}
|
|
1122
|
-
`},
|
|
1078
|
+
`},Sn=e=>`
|
|
1123
1079
|
.${e} {
|
|
1124
1080
|
display: flex;
|
|
1125
1081
|
align-items: center;
|
|
@@ -1145,7 +1101,7 @@
|
|
|
1145
1101
|
padding-bottom: env(safe-area-inset-bottom, 8px);
|
|
1146
1102
|
}
|
|
1147
1103
|
}
|
|
1148
|
-
`,
|
|
1104
|
+
`,yn=e=>`
|
|
1149
1105
|
.${e} {
|
|
1150
1106
|
backface-visibility: hidden;
|
|
1151
1107
|
user-select: none;
|
|
@@ -1158,25 +1114,25 @@
|
|
|
1158
1114
|
position: absolute;
|
|
1159
1115
|
z-index: 1;
|
|
1160
1116
|
}
|
|
1161
|
-
|
|
1162
|
-
${
|
|
1163
|
-
${
|
|
1164
|
-
${
|
|
1165
|
-
${
|
|
1166
|
-
${
|
|
1167
|
-
${
|
|
1168
|
-
${
|
|
1169
|
-
${
|
|
1170
|
-
${
|
|
1171
|
-
${
|
|
1172
|
-
${
|
|
1173
|
-
${
|
|
1174
|
-
${
|
|
1175
|
-
${
|
|
1176
|
-
${
|
|
1177
|
-
${
|
|
1178
|
-
${
|
|
1179
|
-
`,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let yn=0;const vn=e=>{const r=new Map,o=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(r.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...o}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(o[n]=l)}},subscribe:(i,n)=>{const l=String(++yn),c=r.get(i)||[];return r.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of r.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){r.set(n,c);return}}},unsubscribeAll:()=>{r.clear()}}},mt={action:null,sourceBase64:"",fileName:"",sourceHeight:0,sourceWidth:0,frame:{left:0,top:0,width:0,height:0},portal:{left:0,top:0,size:0},emitted:{X:0,Y:0,left:0,top:0,size:0},config:{applyButtonLabel:"Apply",cancelButtonLabel:"Cancel",compression:1,framePadding:3,minPortalSize:50,portalPosition:"center",portalSize:150,outputSize:0,type:"jpeg",maxFileSize:0,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"]}},mn=(e={},r={})=>vn({...mt,config:{...mt.config,...e},css:Sn(r)}),Cn=(e,r)=>{var O;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.body[0]}`);if(!i)return o.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=r.width/r.height;let p,h,g=0,f=0;return c>d?(p=l*d,h=l,f=(n-p)/2):(p=n,h=n*(r.height/r.width),g=(l-h)/2),{width:p,height:h,left:f,top:g}},wn=(e,r,o)=>{const[i,n]=r,l=i+e>o.width?(o.width-e)/2:i,c=n+e>o.height?(o.height-e)/2:n;return[l,c]},Rn=(e,r)=>{const{config:o}=e(),i=Math.min(r.width,r.height)-o.framePadding*2,n=o.portalSize>i?i:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=wn(n,o.portalPosition,r);return{left:l,top:c,size:n}}return o.portalPosition==="center"?{size:n,left:(r.width-n)/2,top:(r.height-n)/2}:{left:0,top:0,size:n}};var te=(e=>(e.MOVE="MOVE",e.RESIZE_TL="RESIZE_TL",e.RESIZE_TR="RESIZE_TR",e.RESIZE_BR="RESIZE_BR",e.RESIZE_BL="RESIZE_BL",e))(te||{});const kn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerMove),o.setAttribute("data-action",te.MOVE),o},Ln=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},Pn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},zn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},jn=e=>{var i;const r=e(),o=document.createElement("span");return U(o,(i=r.css)==null?void 0:i.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},En=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.previewImage),o},Tn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.preview),o.appendChild(En(e)),o},Nn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portal),o.appendChild(Tn(e)),o.appendChild(kn(e)),o.appendChild(zn(e)),o.appendChild(jn(e)),o.appendChild(Ln(e)),o.appendChild(Pn(e)),o},In=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Nn(e)),o},An=e=>{var i;const r=e(),o=document.createElement("img");return U(o,(i=r.css)==null?void 0:i.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Dn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.body),o.appendChild(An(e)),o.appendChild(In(e)),o},_n=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=o.config.applyButtonLabel,i.addEventListener("click",r),i},Mn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return U(i,(n=o.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=o.config.cancelButtonLabel,i.addEventListener("click",r),i},Fn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.footer),n.appendChild(Mn(e,o)),n.appendChild(_n(e,r)),n},Bn=e=>{var i;const r=e(),o=document.createElement("div");return U(o,(i=r.css)==null?void 0:i.header),o},Yn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return U(n,(l=i.css)==null?void 0:l.container),n.appendChild(Bn(e)),n.appendChild(Dn(e)),n.appendChild(Fn(e,r,o)),n},Hn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");U(n,(l=i.css)==null?void 0:l.root),n.appendChild(Yn(e,r,o)),document.body.appendChild(n)},Gn=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ie=new Map,Vn={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},ge=(e,r)=>{if(Ie.has(e))return Ie.get(e);if(!r)return null;const o=r[Vn[e]],i=document.querySelector(`.${o[0]}`);return Ie.set(e,i),i},Wn=()=>{Ie.clear()},Un=()=>{Ie.clear()},Xn=(e,r)=>{const o=ge("header",r.css);o&&(o.innerText=e)},qn=(e,r)=>{const o=ge("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const i=ge("portalArea",r.css);i&&(i.style.height=`${r.frame.height}px`,i.style.width=`${r.frame.width}px`,i.style.left=`${r.frame.left}px`,i.style.top=`${r.frame.top}px`);const n=ge("portal",r.css);n&&(n.style.width=`${r.portal.size}px`,n.style.height=`${r.portal.size}px`,n.style.left=`${r.portal.left}px`,n.style.top=`${r.portal.top}px`);const l=ge("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},Kn=(e,r)=>{const o=ge("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const i=ge("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},st=1,Zn=e=>{var C,y;const r=e(),o=document.createElement("canvas"),i=r.frame.width||st,n=r.frame.height||st,l=r.sourceWidth/i,c=r.sourceHeight/n,d=r.portal.left*l,p=r.portal.top*c,h=Math.max(r.portal.size*Math.min(l,c),st),g=r.config.outputSize>0?r.config.outputSize:h;o.width=g,o.height=g;const f=document.querySelector(`.${(C=r.css)==null?void 0:C.sourceImage[0]}`);f&&((y=o.getContext("2d"))==null||y.drawImage(f,d,p,h,h,0,0,g,g));const O=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((S,v)=>{try{o.toBlob(x=>{if(o.remove(),!x){v(new Error(`Failed to create blob for type: image/${r.config.type}`));return}S([O,x])},`image/${r.config.type}`,r.config.compression)}catch(x){o.remove(),v(x)}})},Jn=(e,r,o)=>{const{emitted:i,portal:n,frame:l,config:c}=r();let d=i.left-i.X+e.clientX,p=i.top-i.Y+e.clientY;const h=c.framePadding,g=l.width-c.framePadding-n.size,f=c.framePadding,O=l.height-c.framePadding-n.size;d<h&&(d=h),d>g&&(d=g),p<f&&(p=f),p>O&&(p=O),o({portal:{...n,left:d,top:p}})},Qn=(e,r,o)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=r(),p=e.pageX-n.X,h=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let g=n.size+Math.max(p,h);return g<d.minPortalSize&&(g=d.minPortalSize),n.top+g>c.height-d.framePadding&&(g=c.height-n.top-d.framePadding),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding),o({portal:{...l,size:g}})}case te.RESIZE_TR:{let g=p+h>0?n.size+p:n.size-h,f=p+h>0?n.top-p:n.top+h;return g<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,g=d.minPortalSize),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(g=n.top+n.size,f=d.framePadding),o({portal:{...l,top:f,size:g}})}case te.RESIZE_TL:{const g=Math.min(p,h);let f=n.size-g,O=n.left+g,C=n.top+g;if(f<d.minPortalSize){const y=n.size-d.minPortalSize;f=d.minPortalSize,O=n.left+y,C=n.top+y}if(C<d.framePadding){const y=d.framePadding-C;C=d.framePadding,O=O+y,f=f-y}if(O<d.framePadding){const y=d.framePadding-O;O=d.framePadding,C=C+y,f=f-y}return o({portal:{...l,top:C,left:O,size:f}})}case te.RESIZE_BL:{let g=p+h>0?n.size+h:n.size-p,f=p+h>0?n.left-h:n.left+p;return g<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,g=d.minPortalSize),g+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,g=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,g=n.left+n.size-d.framePadding),o({portal:{...l,left:f,size:g}})}default:return}},qt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},ea=(e,r)=>{var O,C,y;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),n=document.querySelector(`.${(C=o.css)==null?void 0:C.portalArea[0]}`),l=document.querySelector(`.${(y=o.css)==null?void 0:y.root[0]}`);let c=null,d=null;const p=S=>{S.preventDefault();const{portal:v}=e(),x=qt(S);if(S.target){const $=S.target.getAttribute("data-action"),b={X:x.pageX,Y:x.pageY,left:v.left,top:v.top,size:v.size};r({action:$,emitted:b})}},h=()=>{const{action:S}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,S&&r({action:null})},g=()=>{if(c=null,!d)return;const S=d;d=null;const{action:v}=e();if(v)switch(v){case te.MOVE:Jn(S,e,r);break;default:Qn(S,e,r)}},f=S=>{const{action:v}=e();v&&(S.preventDefault(),d=qt(S),c===null&&(c=requestAnimationFrame(g)))};return l&&(l.addEventListener("mouseup",h),l.addEventListener("touchend",h),l.addEventListener("touchcancel",h)),i&&(i.addEventListener("mousedown",p),i.addEventListener("touchstart",p,{passive:!1})),n&&(n.addEventListener("mousemove",f),n.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",h),l.removeEventListener("touchend",h),l.removeEventListener("touchcancel",h)),i&&(i.removeEventListener("mousedown",p),i.removeEventListener("touchstart",p)),n&&(n.removeEventListener("mousemove",f),n.removeEventListener("touchmove",f))}},Kt=1024*1024,ta=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Kt).toFixed(2);return`File size (${(e.size/Kt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},ra=(e,r,o,i,n,l,c)=>{const d=x=>{c?c(x):console.error(`HqCropper: ${x}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:h}=r(),g=ta(p,h);if(g){d(g),e.target.value="";return}const f=new FileReader;let O=null;const C=()=>{var b;const x=r(),$=document.querySelector(`.${(b=x.css)==null?void 0:b.root[0]}`);$&&($.remove(),document.removeEventListener("keydown",y),O==null||O(),Un(),l(),o(mt))},y=x=>{x.key==="Escape"&&r().sourceBase64&&S(x)},S=x=>{x.preventDefault(),C()},v=x=>{x.preventDefault();const $=r();Zn(r).then(([b,L])=>{i(b,L,$),S(x)}).catch(b=>{d(b instanceof Error?b.message:"Failed to crop image")})};f.onload=x=>{const $=new Image;if(!x.target||typeof x.target.result!="string"){d("Can't load result image");return}$.src=x.target.result,$.onerror=()=>{d("Failed to load image")},$.onload=()=>{var j;Hn(r,v,S),Wn(),n("fileName",Xn),n("sourceBase64",qn),n("portal",Kn);const b=Cn(r,$),L=Rn(r,b);o({frame:b,portal:L,fileName:p.name,sourceBase64:(j=x.target)==null?void 0:j.result,sourceHeight:$.height,sourceWidth:$.width}),O=ea(r,o),document.addEventListener("keydown",y)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},oa=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=mn(r,o),p=Gn(h=>ra(h,n,l,e,c,d,i));return{open:()=>p.click()}},le={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Zt="vacano-image-cropper-styles",ia=`
|
|
1117
|
+
`,vn=e=>{let r=5381;for(let o=0;o<e.length;o++)r=(r<<5)+r^e.charCodeAt(o);return Math.abs(r).toString(36)},G=e=>`hq-cropper__${vn(e)}`,W=e=>e||[],X=(e,r)=>{if(r)for(const o of r)e.classList.add(o)},Cn=e=>{const r={applyButton:[G("applyButton"),...W(e.applyButton)],cancelButton:[G("cancelButton"),...W(e.cancelButton)],container:[G("container"),...W(e.container)],handlerMove:[G("handlerMove"),...W(e.handlerMove)],handlerResizeTopLeft:[G("handlerResizeTopLeft"),...W(e.handlerResizeTopLeft)],handlerResizeTopRight:[G("handlerResizeTopRight"),...W(e.handlerResizeTopRight)],handlerResizeBottomLeft:[G("handlerResizeBottomLeft"),...W(e.handlerResizeBottomLeft)],handlerResizeBottomRight:[G("handlerResizeBottomRight"),...W(e.handlerResizeBottomRight)],sourceImage:[G("sourceImage"),...W(e.sourceImage)],portalArea:[G("portalArea"),...W(e.portalArea)],previewImage:[G("previewImage"),...W(e.previewImage)],body:[G("body"),...W(e.body)],header:[G("header"),...W(e.header)],footer:[G("footer"),...W(e.footer)],portal:[G("portal"),...W(e.portal)],preview:[G("preview"),...W(e.preview)],root:[G("root"),...W(e.root)]},o=`
|
|
1118
|
+
${ln(r.applyButton[0])}
|
|
1119
|
+
${dn(r.body[0])}
|
|
1120
|
+
${cn(r.cancelButton[0])}
|
|
1121
|
+
${sn(r.container[0])}
|
|
1122
|
+
${pn(r.footer[0])}
|
|
1123
|
+
${un(r.header[0])}
|
|
1124
|
+
${hn(r.handlerMove[0])}
|
|
1125
|
+
${bn(r.portalArea[0])}
|
|
1126
|
+
${gn(r.portal[0])}
|
|
1127
|
+
${fn(r.previewImage[0])}
|
|
1128
|
+
${xn(r.preview[0])}
|
|
1129
|
+
${Xe(r.handlerResizeBottomLeft[0],"bl")}
|
|
1130
|
+
${Xe(r.handlerResizeBottomRight[0],"br")}
|
|
1131
|
+
${Xe(r.handlerResizeTopLeft[0],"tl")}
|
|
1132
|
+
${Xe(r.handlerResizeTopRight[0],"tr")}
|
|
1133
|
+
${Sn(r.root[0])}
|
|
1134
|
+
${yn(r.sourceImage[0])}
|
|
1135
|
+
`,i=document.createElement("style");return i.innerHTML=o,document.getElementsByTagName("head")[0].prepend(i),r};let mn=0;const wn=e=>{const r=new Map,o=new Proxy({...e},{set(i,n,l){return Reflect.set(i,n,l),(r.get(n)||[]).forEach(c=>c.action(l,i,n)),!0}});return{getState:()=>({...o}),setState:i=>{for(const n of Object.keys(i)){const l=i[n];l!==void 0&&(o[n]=l)}},subscribe:(i,n)=>{const l=String(++mn),c=r.get(i)||[];return r.set(i,[...c,{action:n,id:l}]),l},unsubscribe:i=>{for(const[n,l]of r.entries()){const c=l.filter(d=>d.id!==i);if(c.length!==l.length){r.set(n,c);return}}},unsubscribeAll:()=>{r.clear()}}},wt={action:null,sourceBase64:"",fileName:"",sourceHeight:0,sourceWidth:0,frame:{left:0,top:0,width:0,height:0},portal:{left:0,top:0,size:0},emitted:{X:0,Y:0,left:0,top:0,size:0},config:{applyButtonLabel:"Apply",cancelButtonLabel:"Cancel",compression:1,framePadding:3,minPortalSize:50,portalPosition:"center",portalSize:150,outputSize:0,type:"jpeg",maxFileSize:0,allowedTypes:["image/jpeg","image/png","image/gif","image/webp"]}},Rn=(e={},r={})=>wn({...wt,config:{...wt.config,...e},css:Cn(r)}),kn=(e,r)=>{var O;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.body[0]}`);if(!i)return o.frame;const{width:n,height:l}=i.getBoundingClientRect(),c=n/l,d=r.width/r.height;let p,h,g=0,f=0;return c>d?(p=l*d,h=l,f=(n-p)/2):(p=n,h=n*(r.height/r.width),g=(l-h)/2),{width:p,height:h,left:f,top:g}},Ln=(e,r,o)=>{const[i,n]=r,l=i+e>o.width?(o.width-e)/2:i,c=n+e>o.height?(o.height-e)/2:n;return[l,c]},Pn=(e,r)=>{const{config:o}=e(),i=Math.min(r.width,r.height)-o.framePadding*2,n=o.portalSize>i?i:o.portalSize;if(Array.isArray(o.portalPosition)&&o.portalPosition.length===2){const[l,c]=Ln(n,o.portalPosition,r);return{left:l,top:c,size:n}}return o.portalPosition==="center"?{size:n,left:(r.width-n)/2,top:(r.height-n)/2}:{left:0,top:0,size:n}};var te=(e=>(e.MOVE="MOVE",e.RESIZE_TL="RESIZE_TL",e.RESIZE_TR="RESIZE_TR",e.RESIZE_BR="RESIZE_BR",e.RESIZE_BL="RESIZE_BL",e))(te||{});const zn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerMove),o.setAttribute("data-action",te.MOVE),o},jn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeBottomLeft),o.setAttribute("data-action",te.RESIZE_BL),o},En=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeBottomRight),o.setAttribute("data-action",te.RESIZE_BR),o},Tn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeTopLeft),o.setAttribute("data-action",te.RESIZE_TL),o},Nn=e=>{var i;const r=e(),o=document.createElement("span");return X(o,(i=r.css)==null?void 0:i.handlerResizeTopRight),o.setAttribute("data-action",te.RESIZE_TR),o},In=e=>{var i;const r=e(),o=document.createElement("img");return X(o,(i=r.css)==null?void 0:i.previewImage),o},An=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.preview),o.appendChild(In(e)),o},Dn=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.portal),o.appendChild(An(e)),o.appendChild(zn(e)),o.appendChild(Tn(e)),o.appendChild(Nn(e)),o.appendChild(jn(e)),o.appendChild(En(e)),o},_n=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.portalArea),o.appendChild(Dn(e)),o},Mn=e=>{var i;const r=e(),o=document.createElement("img");return X(o,(i=r.css)==null?void 0:i.sourceImage),o.setAttribute("alt","source"),o.setAttribute("crossOrigin","anonymous"),o.setAttribute("draggable","false"),o.setAttribute("src",r.sourceBase64),o},Fn=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.body),o.appendChild(Mn(e)),o.appendChild(_n(e)),o},Bn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return X(i,(n=o.css)==null?void 0:n.applyButton),i.setAttribute("role","button"),i.innerText=o.config.applyButtonLabel,i.addEventListener("click",r),i},Yn=(e,r)=>{var n;const o=e(),i=document.createElement("div");return X(i,(n=o.css)==null?void 0:n.cancelButton),i.setAttribute("role","button"),i.innerText=o.config.cancelButtonLabel,i.addEventListener("click",r),i},Hn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return X(n,(l=i.css)==null?void 0:l.footer),n.appendChild(Yn(e,o)),n.appendChild(Bn(e,r)),n},Vn=e=>{var i;const r=e(),o=document.createElement("div");return X(o,(i=r.css)==null?void 0:i.header),o},Gn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");return X(n,(l=i.css)==null?void 0:l.container),n.appendChild(Vn(e)),n.appendChild(Fn(e)),n.appendChild(Hn(e,r,o)),n},Wn=(e,r,o)=>{var l;const i=e(),n=document.createElement("div");X(n,(l=i.css)==null?void 0:l.root),n.appendChild(Gn(e,r,o)),document.body.appendChild(n)},Xn=e=>{const r=document.createElement("input");return r.style.display="none",r.setAttribute("type","file"),r.setAttribute("accept","image/x-png,image/jpeg"),r.addEventListener("change",e,!1),document.body.appendChild(r),r},Ae=new Map,Un={header:"header",sourceImage:"sourceImage",portalArea:"portalArea",portal:"portal",previewImage:"previewImage"},ue=(e,r)=>{if(Ae.has(e))return Ae.get(e);if(!r)return null;const o=r[Un[e]],i=document.querySelector(`.${o[0]}`);return Ae.set(e,i),i},qn=()=>{Ae.clear()},Kn=()=>{Ae.clear()},Zn=(e,r)=>{const o=ue("header",r.css);o&&(o.innerText=e)},Jn=(e,r)=>{const o=ue("sourceImage",r.css);o&&(o.setAttribute("src",e),o.style.height=`${r.frame.height}px`,o.style.width=`${r.frame.width}px`,o.style.left=`${r.frame.left}px`,o.style.top=`${r.frame.top}px`);const i=ue("portalArea",r.css);i&&(i.style.height=`${r.frame.height}px`,i.style.width=`${r.frame.width}px`,i.style.left=`${r.frame.left}px`,i.style.top=`${r.frame.top}px`);const n=ue("portal",r.css);n&&(n.style.width=`${r.portal.size}px`,n.style.height=`${r.portal.size}px`,n.style.left=`${r.portal.left}px`,n.style.top=`${r.portal.top}px`);const l=ue("previewImage",r.css);l&&(l.setAttribute("src",e),l.style.height=`${r.frame.height}px`,l.style.width=`${r.frame.width}px`,l.style.marginLeft=`-${r.portal.left}px`,l.style.marginTop=`-${r.portal.top}px`)},Qn=(e,r)=>{const o=ue("portal",r.css);o&&(o.style.left=`${e.left}px`,o.style.top=`${e.top}px`,o.style.width=`${e.size}px`,o.style.height=`${e.size}px`);const i=ue("previewImage",r.css);i&&(i.style.marginLeft=`-${e.left}px`,i.style.marginTop=`-${e.top}px`)},pt=1,ea=e=>{var m,y;const r=e(),o=document.createElement("canvas"),i=r.frame.width||pt,n=r.frame.height||pt,l=r.sourceWidth/i,c=r.sourceHeight/n,d=r.portal.left*l,p=r.portal.top*c,h=Math.max(r.portal.size*Math.min(l,c),pt),g=r.config.outputSize>0?r.config.outputSize:h;o.width=g,o.height=g;const f=document.querySelector(`.${(m=r.css)==null?void 0:m.sourceImage[0]}`);f&&((y=o.getContext("2d"))==null||y.drawImage(f,d,p,h,h,0,0,g,g));const O=o.toDataURL(`image/${r.config.type}`,r.config.compression);return new Promise((S,v)=>{try{o.toBlob(x=>{if(o.remove(),!x){v(new Error(`Failed to create blob for type: image/${r.config.type}`));return}S([O,x])},`image/${r.config.type}`,r.config.compression)}catch(x){o.remove(),v(x)}})},ta=(e,r,o)=>{const{emitted:i,portal:n,frame:l,config:c}=r();let d=i.left-i.X+e.clientX,p=i.top-i.Y+e.clientY;const h=c.framePadding,g=l.width-c.framePadding-n.size,f=c.framePadding,O=l.height-c.framePadding-n.size;d<h&&(d=h),d>g&&(d=g),p<f&&(p=f),p>O&&(p=O),o({portal:{...n,left:d,top:p}})},ra=(e,r,o)=>{const{action:i,emitted:n,portal:l,frame:c,config:d}=r(),p=e.pageX-n.X,h=e.pageY-n.Y;switch(i){case te.RESIZE_BR:{let g=n.size+Math.max(p,h);return g<d.minPortalSize&&(g=d.minPortalSize),n.top+g>c.height-d.framePadding&&(g=c.height-n.top-d.framePadding),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding),o({portal:{...l,size:g}})}case te.RESIZE_TR:{let g=p+h>0?n.size+p:n.size-h,f=p+h>0?n.top-p:n.top+h;return g<d.minPortalSize&&(f=n.top+n.size-d.minPortalSize,g=d.minPortalSize),n.left+g>c.width-d.framePadding&&(g=c.width-n.left-d.framePadding,f=n.top-c.width+n.left+n.size),f<d.framePadding&&(g=n.top+n.size,f=d.framePadding),o({portal:{...l,top:f,size:g}})}case te.RESIZE_TL:{const g=Math.min(p,h);let f=n.size-g,O=n.left+g,m=n.top+g;if(f<d.minPortalSize){const y=n.size-d.minPortalSize;f=d.minPortalSize,O=n.left+y,m=n.top+y}if(m<d.framePadding){const y=d.framePadding-m;m=d.framePadding,O=O+y,f=f-y}if(O<d.framePadding){const y=d.framePadding-O;O=d.framePadding,m=m+y,f=f-y}return o({portal:{...l,top:m,left:O,size:f}})}case te.RESIZE_BL:{let g=p+h>0?n.size+h:n.size-p,f=p+h>0?n.left-h:n.left+p;return g<d.minPortalSize&&(f=n.left+n.size-d.minPortalSize,g=d.minPortalSize),g+n.top>c.height-d.framePadding&&(f=n.left-c.height+n.top+n.size,g=c.height-n.top-d.framePadding),f<d.framePadding&&(f=d.framePadding,g=n.left+n.size-d.framePadding),o({portal:{...l,left:f,size:g}})}default:return}},Zt=e=>{if("touches"in e&&e.touches.length>0){const o=e.touches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}if("changedTouches"in e&&e.changedTouches.length>0){const o=e.changedTouches[0];return{clientX:o.clientX,clientY:o.clientY,pageX:o.pageX,pageY:o.pageY}}const r=e;return{clientX:r.clientX,clientY:r.clientY,pageX:r.pageX,pageY:r.pageY}},oa=(e,r)=>{var O,m,y;const o=e(),i=document.querySelector(`.${(O=o.css)==null?void 0:O.portal[0]}`),n=document.querySelector(`.${(m=o.css)==null?void 0:m.portalArea[0]}`),l=document.querySelector(`.${(y=o.css)==null?void 0:y.root[0]}`);let c=null,d=null;const p=S=>{S.preventDefault();const{portal:v}=e(),x=Zt(S);if(S.target){const $=S.target.getAttribute("data-action"),b={X:x.pageX,Y:x.pageY,left:v.left,top:v.top,size:v.size};r({action:$,emitted:b})}},h=()=>{const{action:S}=e();c!==null&&(cancelAnimationFrame(c),c=null),d=null,S&&r({action:null})},g=()=>{if(c=null,!d)return;const S=d;d=null;const{action:v}=e();if(v)switch(v){case te.MOVE:ta(S,e,r);break;default:ra(S,e,r)}},f=S=>{const{action:v}=e();v&&(S.preventDefault(),d=Zt(S),c===null&&(c=requestAnimationFrame(g)))};return l&&(l.addEventListener("mouseup",h),l.addEventListener("touchend",h),l.addEventListener("touchcancel",h)),i&&(i.addEventListener("mousedown",p),i.addEventListener("touchstart",p,{passive:!1})),n&&(n.addEventListener("mousemove",f),n.addEventListener("touchmove",f,{passive:!1})),()=>{c!==null&&cancelAnimationFrame(c),l&&(l.removeEventListener("mouseup",h),l.removeEventListener("touchend",h),l.removeEventListener("touchcancel",h)),i&&(i.removeEventListener("mousedown",p),i.removeEventListener("touchstart",p)),n&&(n.removeEventListener("mousemove",f),n.removeEventListener("touchmove",f))}},Jt=1024*1024,ia=(e,r)=>{if(!r.allowedTypes.includes(e.type))return`Invalid file type "${e.type}". Allowed types: ${r.allowedTypes.join(", ")}`;if(r.maxFileSize>0&&e.size>r.maxFileSize){const o=(r.maxFileSize/Jt).toFixed(2);return`File size (${(e.size/Jt).toFixed(2)}MB) exceeds maximum allowed size (${o}MB)`}return null},na=(e,r,o,i,n,l,c)=>{const d=x=>{c?c(x):console.error(`HqCropper: ${x}`)};if(!e.target.files||e.target.files.length===0){d("Can't read file input");return}const p=e.target.files[0],{config:h}=r(),g=ia(p,h);if(g){d(g),e.target.value="";return}const f=new FileReader;let O=null;const m=()=>{var b;const x=r(),$=document.querySelector(`.${(b=x.css)==null?void 0:b.root[0]}`);$&&($.remove(),document.removeEventListener("keydown",y),O==null||O(),Kn(),l(),o(wt))},y=x=>{x.key==="Escape"&&r().sourceBase64&&S(x)},S=x=>{x.preventDefault(),m()},v=x=>{x.preventDefault();const $=r();ea(r).then(([b,L])=>{i(b,L,$),S(x)}).catch(b=>{d(b instanceof Error?b.message:"Failed to crop image")})};f.onload=x=>{const $=new Image;if(!x.target||typeof x.target.result!="string"){d("Can't load result image");return}$.src=x.target.result,$.onerror=()=>{d("Failed to load image")},$.onload=()=>{var j;Wn(r,v,S),qn(),n("fileName",Zn),n("sourceBase64",Jn),n("portal",Qn);const b=kn(r,$),L=Pn(r,b);o({frame:b,portal:L,fileName:p.name,sourceBase64:(j=x.target)==null?void 0:j.result,sourceHeight:$.height,sourceWidth:$.width}),O=oa(r,o),document.addEventListener("keydown",y)}},f.onerror=()=>{d("Failed to read file")},f.readAsDataURL(p),e.target.value=""},aa=(e,r,o,i)=>{const{getState:n,setState:l,subscribe:c,unsubscribeAll:d}=Rn(r,o),p=Xn(h=>na(h,n,l,e,c,d,i));return{open:()=>p.click()}},le={portalSize:200,outputSize:400,compression:.9,type:"jpeg",maxFileSize:10*1024*1024,allowedTypes:["image/jpeg","image/png","image/webp"],applyLabel:"Apply",cancelLabel:"Cancel"},Qt="vacano-image-cropper-styles",la=`
|
|
1180
1136
|
.vacano-cropper-root {
|
|
1181
1137
|
background-color: rgba(0, 0, 0, 0.5);
|
|
1182
1138
|
backdrop-filter: blur(4px);
|
|
@@ -1224,46 +1180,42 @@
|
|
|
1224
1180
|
.vacano-cropper-apply-button:hover {
|
|
1225
1181
|
background-color: ${t.COLORS["iron-grey"]};
|
|
1226
1182
|
}
|
|
1227
|
-
`,
|
|
1183
|
+
`,da=()=>{if(typeof document>"u"||document.getElementById(Qt))return;const e=document.createElement("style");e.id=Qt,e.textContent=la,document.head.appendChild(e)},ca={root:["vacano-cropper-root"],container:["vacano-cropper-container"],header:["vacano-cropper-header"],body:["vacano-cropper-body"],footer:["vacano-cropper-footer"],cancelButton:["vacano-cropper-cancel-button"],applyButton:["vacano-cropper-apply-button"],portal:["vacano-cropper-portal"]},kr=(e={})=>{const{allowedTypes:r=le.allowedTypes,applyLabel:o=le.applyLabel,cancelLabel:i=le.cancelLabel,compression:n=le.compression,maxFileSize:l=le.maxFileSize,onCrop:c,onError:d,outputSize:p=le.outputSize,portalSize:h=le.portalSize,type:g=le.type}=e,f=u.useRef(null);return{open:u.useCallback(()=>{f.current||(da(),f.current=aa((m,y,S)=>{y&&(c==null||c({base64:m,blob:y,state:S}))},{portalSize:h,outputSize:p,compression:n,type:g,maxFileSize:l,allowedTypes:r,applyButtonLabel:o,cancelButtonLabel:i},ca,m=>{d==null||d({code:"CROPPER_ERROR",message:m})})),f.current.open()},[r,o,i,n,l,c,d,p,h,g])}},ut=A.newClassNameGetter("image-cropper"),sa=({allowedTypes:e,applyLabel:r,buttonLabel:o="Select Image",cancelLabel:i,className:n,classnames:l,compression:c,maxFileSize:d,onCrop:p,onError:h,outputSize:g,portalSize:f,previewSize:O=120,ref:m,type:y,value:S,...v})=>{const[x,$]=u.useState(S??null),{open:b}=kr({allowedTypes:e,applyLabel:r,cancelLabel:i,compression:c,maxFileSize:d,onCrop:L=>{$(L.base64),p==null||p(L)},onError:h,outputSize:g,portalSize:f,type:y});return a.jsxs(on,{...v,ref:m,className:ut("container",n),children:[a.jsx(nn,{$size:O,className:ut("preview",l==null?void 0:l.preview),children:x?a.jsx("img",{src:x,alt:"Preview"}):a.jsx(an,{children:"No image"})}),a.jsx(_e,{variant:"system",onClick:b,className:ut("button",l==null?void 0:l.button),style:{width:O},children:o})]})},er={compact:{height:"32px",padding:"0 10px",radius:"14px",prefixSize:"16px"},default:{height:"40px",padding:"0 14px",radius:"16px",prefixSize:"20px"}},tr={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)}},de=e=>tr[e]??tr.normal,ht=e=>er[e]??er.default,pa=s.div`
|
|
1228
1184
|
display: grid;
|
|
1229
1185
|
flex-direction: column;
|
|
1230
1186
|
gap: 2px;
|
|
1231
1187
|
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
1232
|
-
`,
|
|
1188
|
+
`,ua=s(ne)`
|
|
1233
1189
|
margin-left: 6px;
|
|
1234
|
-
`,
|
|
1190
|
+
`,ha=s.input`
|
|
1235
1191
|
flex: 1;
|
|
1236
1192
|
min-width: 0;
|
|
1237
1193
|
outline: none;
|
|
1238
1194
|
font-size: 14px;
|
|
1239
1195
|
font-weight: 500;
|
|
1240
|
-
height: ${e=>
|
|
1241
|
-
padding: ${e=>
|
|
1242
|
-
border-radius: ${e=>
|
|
1196
|
+
height: ${e=>ht(e.$size).height};
|
|
1197
|
+
padding: ${e=>ht(e.$size).padding};
|
|
1198
|
+
border-radius: ${e=>ht(e.$size).radius};
|
|
1243
1199
|
|
|
1244
|
-
color: ${e=>
|
|
1245
|
-
border: 1px solid ${e=>
|
|
1246
|
-
background-color: ${e=>
|
|
1200
|
+
color: ${e=>de(e.$variant).color.static};
|
|
1201
|
+
border: 1px solid ${e=>de(e.$variant).border.static};
|
|
1202
|
+
background-color: ${e=>de(e.$variant).background.static};
|
|
1247
1203
|
|
|
1248
1204
|
&::placeholder {
|
|
1249
|
-
color: ${e=>
|
|
1205
|
+
color: ${e=>de(e.$variant).placeholder.static};
|
|
1250
1206
|
}
|
|
1251
1207
|
|
|
1252
1208
|
&:disabled {
|
|
1253
1209
|
cursor: not-allowed;
|
|
1254
|
-
color: ${e=>
|
|
1255
|
-
background-color: ${e=>
|
|
1256
|
-
border-color: ${e=>
|
|
1210
|
+
color: ${e=>de(e.$variant).color.disabled};
|
|
1211
|
+
background-color: ${e=>de(e.$variant).background.disabled};
|
|
1212
|
+
border-color: ${e=>de(e.$variant).border.disabled};
|
|
1257
1213
|
|
|
1258
1214
|
&::placeholder {
|
|
1259
|
-
color: ${e=>
|
|
1215
|
+
color: ${e=>de(e.$variant).placeholder.disabled};
|
|
1260
1216
|
}
|
|
1261
1217
|
}
|
|
1262
|
-
|
|
1263
|
-
&:focus-visible {
|
|
1264
|
-
outline: 2px solid ${e=>ie(e.$variant).focus};
|
|
1265
|
-
}
|
|
1266
|
-
`,ht=A.newClassNameGetter("input"),wr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(da,{className:ht("container",e),$fullWidth:!!i,children:[a.jsx(ca,{variant:d,className:ht("label",r==null?void 0:r.label),children:n}),a.jsx(sa,{...p,ref:l,disabled:o,$size:c,$variant:d,className:ht("input",r==null?void 0:r.input)})]}),pa=s.div`
|
|
1218
|
+
`,bt=A.newClassNameGetter("input"),Lr=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,size:c="default",variant:d="normal",...p})=>a.jsxs(pa,{className:bt("container",e),$fullWidth:!!i,children:[a.jsx(ua,{variant:d,className:bt("label",r==null?void 0:r.label),children:n}),a.jsx(ha,{...p,ref:l,disabled:o,$size:c,$variant:d,className:bt("input",r==null?void 0:r.input)})]}),ba=s.div`
|
|
1267
1219
|
position: fixed;
|
|
1268
1220
|
inset: 0;
|
|
1269
1221
|
z-index: 1000;
|
|
@@ -1272,7 +1224,7 @@
|
|
|
1272
1224
|
justify-content: center;
|
|
1273
1225
|
background-color: ${t.alpha(t.COLORS.black,50)};
|
|
1274
1226
|
animation: ${t.KEYFRAMES.fadeIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
|
|
1275
|
-
`,
|
|
1227
|
+
`,ga=s.div`
|
|
1276
1228
|
position: relative;
|
|
1277
1229
|
z-index: 1001;
|
|
1278
1230
|
width: ${e=>e.$width};
|
|
@@ -1283,21 +1235,21 @@
|
|
|
1283
1235
|
border-radius: 16px;
|
|
1284
1236
|
box-shadow: 0 8px 32px ${t.alpha(t.COLORS.black,20)};
|
|
1285
1237
|
animation: ${t.KEYFRAMES.scaleIn} ${e=>e.$animated?"0.15s":"0s"} ease-out forwards;
|
|
1286
|
-
`,
|
|
1238
|
+
`,rr=A.newClassNameGetter("modal"),Pr=({animated:e,children:r,className:o,classnames:i,open:n,ref:l,width:c="500px",...d})=>n?ge.createPortal(a.jsx(ba,{className:rr("overlay",i==null?void 0:i.overlay),$animated:!!e,children:a.jsx(ga,{...d,ref:l,className:rr("content",o,i==null?void 0:i.content),$animated:!!e,$width:c,children:r})}),document.body):null,zr={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},fa=s.div`
|
|
1287
1239
|
display: flex;
|
|
1288
1240
|
flex-direction: column;
|
|
1289
1241
|
gap: 4px;
|
|
1290
|
-
`,
|
|
1242
|
+
`,xa=s(ne)`
|
|
1291
1243
|
margin-left: 6px;
|
|
1292
|
-
color: ${e=>
|
|
1293
|
-
`,
|
|
1244
|
+
color: ${e=>zr[e.$variant].label};
|
|
1245
|
+
`,Oa=s.button`
|
|
1294
1246
|
display: flex;
|
|
1295
1247
|
flex-wrap: wrap;
|
|
1296
1248
|
align-items: center;
|
|
1297
1249
|
gap: 6px;
|
|
1298
1250
|
min-height: 44px;
|
|
1299
1251
|
padding: 8px 12px;
|
|
1300
|
-
border: 1px dashed ${e=>
|
|
1252
|
+
border: 1px dashed ${e=>zr[e.$variant].border};
|
|
1301
1253
|
border-radius: 8px;
|
|
1302
1254
|
background: ${t.COLORS.white};
|
|
1303
1255
|
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
@@ -1308,37 +1260,31 @@
|
|
|
1308
1260
|
&:hover:not(:disabled) {
|
|
1309
1261
|
border-color: ${e=>e.$variant==="error"?t.COLORS.red:t.COLORS.black};
|
|
1310
1262
|
}
|
|
1311
|
-
|
|
1312
|
-
&:focus-visible {
|
|
1313
|
-
outline: 2px solid
|
|
1314
|
-
${e=>e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
|
|
1315
|
-
outline-offset: 2px;
|
|
1316
|
-
}
|
|
1317
|
-
`,fa=s.span`
|
|
1263
|
+
`,$a=s.span`
|
|
1318
1264
|
color: ${t.COLORS["iron-grey"]};
|
|
1319
1265
|
font-size: 14px;
|
|
1320
|
-
`,
|
|
1266
|
+
`,Sa=s.div`
|
|
1321
1267
|
display: flex;
|
|
1322
1268
|
flex-direction: column;
|
|
1323
1269
|
padding: 20px;
|
|
1324
1270
|
gap: 16px;
|
|
1325
|
-
`,
|
|
1271
|
+
`,ya=s.div`
|
|
1326
1272
|
display: flex;
|
|
1327
1273
|
align-items: center;
|
|
1328
1274
|
justify-content: space-between;
|
|
1329
|
-
|
|
1275
|
+
`,va=s.h3`
|
|
1330
1276
|
margin: 0;
|
|
1331
1277
|
font-size: 18px;
|
|
1332
1278
|
font-weight: 600;
|
|
1333
1279
|
color: ${t.COLORS.black};
|
|
1334
|
-
`,
|
|
1280
|
+
`,Ca=s.div`
|
|
1335
1281
|
display: flex;
|
|
1336
1282
|
flex-direction: column;
|
|
1337
1283
|
gap: 4px;
|
|
1338
1284
|
min-height: 200px;
|
|
1339
1285
|
max-height: 300px;
|
|
1340
1286
|
overflow-y: auto;
|
|
1341
|
-
`,
|
|
1287
|
+
`,ma=s.label`
|
|
1342
1288
|
display: flex;
|
|
1343
1289
|
align-items: center;
|
|
1344
1290
|
gap: 10px;
|
|
@@ -1351,10 +1297,10 @@
|
|
|
1351
1297
|
&:hover {
|
|
1352
1298
|
background-color: ${e=>e.$disabled?"transparent":t.COLORS.gray};
|
|
1353
1299
|
}
|
|
1354
|
-
`,
|
|
1300
|
+
`,wa=s.span`
|
|
1355
1301
|
font-size: 14px;
|
|
1356
1302
|
color: ${t.COLORS.black};
|
|
1357
|
-
`,
|
|
1303
|
+
`,Ra=s.div`
|
|
1358
1304
|
display: flex;
|
|
1359
1305
|
align-items: center;
|
|
1360
1306
|
justify-content: center;
|
|
@@ -1362,98 +1308,90 @@
|
|
|
1362
1308
|
color: ${t.COLORS["iron-grey"]};
|
|
1363
1309
|
font-size: 14px;
|
|
1364
1310
|
text-align: center;
|
|
1365
|
-
`,Q=A.newClassNameGetter("multi-select"),
|
|
1311
|
+
`,Q=A.newClassNameGetter("multi-select"),ka=({className:e,classnames:r,disabled:o=!1,emptyMessage:i="No options found",label:n,maxVisible:l=1/0,modalTitle:c="Select options",onChange:d,options:p,placeholder:h="Select...",ref:g,searchPlaceholder:f="Search...",value:O,variant:m="normal",...y})=>{const[S,v]=u.useState(!1),[x,$]=u.useState(""),b=u.useMemo(()=>p.filter(w=>O.includes(w.value)),[p,O]),L=u.useMemo(()=>{if(!x.trim())return p;const w=x.toLowerCase().trim();return p.filter(M=>M.label.toLowerCase().includes(w))},[p,x]),j=l===1/0?b:b.slice(0,l),N=b.length-j.length,H=()=>{o||(v(!0),$(""))},z=()=>{v(!1),$("")},_=w=>{O.includes(w)?d(O.filter(M=>M!==w)):d([...O,w])},E=w=>{d(O.filter(M=>M!==w))};return a.jsxs(fa,{...y,ref:g,className:Q("container",e),children:[n&&a.jsx(xa,{$variant:m,className:Q("label",r==null?void 0:r.trigger),children:n}),a.jsx(Oa,{type:"button",$variant:m,$disabled:o,disabled:o,onClick:H,className:Q("trigger",r==null?void 0:r.trigger),children:b.length===0?a.jsx($a,{className:Q("placeholder",r==null?void 0:r.placeholder),children:h}):a.jsxs(a.Fragment,{children:[j.map(w=>a.jsx(Qe,{deletable:!0,onDelete:()=>E(w.value),onClick:M=>M.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:w.label},w.value)),N>0&&a.jsxs(Qe,{variant:"gray",onClick:w=>w.stopPropagation(),className:Q("chip",r==null?void 0:r.chip),children:["+",N]})]})}),a.jsx(Pr,{open:S,width:"400px",animated:!0,className:Q("modal",r==null?void 0:r.modal),children:a.jsxs(Sa,{children:[a.jsxs(ya,{children:[a.jsx(va,{children:c}),a.jsx(_e,{variant:"transparent",size:"compact",icon:a.jsx(a.X,{}),onClick:z})]}),a.jsx(Lr,{type:"text",value:x,onChange:w=>$(w.target.value),placeholder:f,autoFocus:!0,fullWidth:!0,className:Q("search",r==null?void 0:r.search)}),a.jsx(Ca,{className:Q("options",r==null?void 0:r.options),children:L.length===0?a.jsx(Ra,{className:Q("empty",r==null?void 0:r.empty),children:i}):L.map(w=>a.jsxs(ma,{$disabled:!!w.disabled,className:Q("option",r==null?void 0:r.option),children:[a.jsx(tt,{checked:O.includes(w.value),disabled:w.disabled,onChange:()=>_(w.value)}),a.jsx(wa,{children:w.label})]},w.value))})]})})]})},or={compact:{width:"36px",height:"40px",fontSize:"16px",radius:"10px",gap:"8px"},default:{width:"44px",height:"52px",fontSize:"20px",radius:"12px",gap:"10px"}},ir={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)}},Ie=e=>or[e]??or.default,$e=e=>ir[e]??ir.normal,La=s.div`
|
|
1366
1312
|
display: inline-flex;
|
|
1367
1313
|
flex-direction: column;
|
|
1368
1314
|
gap: 2px;
|
|
1369
|
-
`,
|
|
1315
|
+
`,Pa=s(ne)`
|
|
1370
1316
|
margin-left: 6px;
|
|
1371
|
-
`,
|
|
1317
|
+
`,za=s.div`
|
|
1372
1318
|
display: flex;
|
|
1373
|
-
gap: ${e=>
|
|
1374
|
-
`,
|
|
1375
|
-
width: ${e=>
|
|
1376
|
-
height: ${e=>
|
|
1377
|
-
border-radius: ${e=>
|
|
1378
|
-
font-size: ${e=>
|
|
1319
|
+
gap: ${e=>Ie(e.$size).gap};
|
|
1320
|
+
`,ja=s.input`
|
|
1321
|
+
width: ${e=>Ie(e.$size).width};
|
|
1322
|
+
height: ${e=>Ie(e.$size).height};
|
|
1323
|
+
border-radius: ${e=>Ie(e.$size).radius};
|
|
1324
|
+
font-size: ${e=>Ie(e.$size).fontSize};
|
|
1379
1325
|
font-weight: 600;
|
|
1380
1326
|
text-align: center;
|
|
1381
1327
|
outline: none;
|
|
1382
|
-
border: 1px solid ${e
|
|
1383
|
-
background-color: ${e
|
|
1384
|
-
color: ${e
|
|
1328
|
+
border: 1px solid ${e=>$e(e.$variant).border.static};
|
|
1329
|
+
background-color: ${e=>$e(e.$variant).background.static};
|
|
1330
|
+
color: ${e=>$e(e.$variant).color.static};
|
|
1385
1331
|
transition:
|
|
1386
1332
|
border-color 0.15s ease,
|
|
1387
1333
|
box-shadow 0.15s ease;
|
|
1388
1334
|
|
|
1389
1335
|
&:disabled {
|
|
1390
1336
|
cursor: not-allowed;
|
|
1391
|
-
color: ${e
|
|
1392
|
-
background-color: ${e
|
|
1393
|
-
border-color: ${e
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
&:focus-visible {
|
|
1397
|
-
outline: 2px solid ${e=>he(e.$variant).focus};
|
|
1337
|
+
color: ${e=>$e(e.$variant).color.disabled};
|
|
1338
|
+
background-color: ${e=>$e(e.$variant).background.disabled};
|
|
1339
|
+
border-color: ${e=>$e(e.$variant).border.disabled};
|
|
1398
1340
|
}
|
|
1399
1341
|
|
|
1400
1342
|
&::selection {
|
|
1401
1343
|
background-color: transparent;
|
|
1402
1344
|
}
|
|
1403
|
-
`,
|
|
1345
|
+
`,gt=A.newClassNameGetter("otp-code"),Ea=({autoFocus:e,className:r,classnames:o,disabled:i,label:n,length:l=6,onChange:c,ref:d,size:p="default",value:h="",variant:g="normal",...f})=>{const O=u.useRef([]);u.useEffect(()=>{e&&O.current[0]&&O.current[0].focus()},[e]);const m=u.useCallback(x=>{const $=O.current[x];$&&($.focus(),$.select())},[]),y=u.useCallback((x,$)=>{const L=$.target.value.replace(/\D/g,"").slice(-1);if(!L)return;const j=h.padEnd(l," ").split(""),N=j.findIndex(E=>E===" "||E===""),H=N!==-1?N:x;j[H]=L;const z=j.join("").replace(/ /g,"");c==null||c(z);const _=H+1;_<l&&m(_)},[h,l,c,m]),S=u.useCallback((x,$)=>{if($.key==="Backspace"){$.preventDefault();const b=h.split("");b[x]?(b[x]="",c==null||c(b.join(""))):x>0&&(b[x-1]="",c==null||c(b.join("")),m(x-1))}else $.key==="ArrowLeft"&&x>0?($.preventDefault(),m(x-1)):$.key==="ArrowRight"&&x<l-1&&($.preventDefault(),m(x+1))},[h,l,c,m]),v=u.useCallback(x=>{x.preventDefault();const $=x.clipboardData.getData("text").replace(/\D/g,"").slice(0,l);if($){c==null||c($);const b=Math.min($.length,l-1);m(b)}},[l,c,m]);return a.jsxs(La,{ref:d,className:gt("container",r),...f,children:[n&&a.jsx(Pa,{variant:g,className:gt("label",o==null?void 0:o.label),children:n}),a.jsx(za,{$size:p,children:Array.from({length:l}).map((x,$)=>a.jsx(ja,{ref:b=>{O.current[$]=b},type:"text",inputMode:"numeric",autoComplete:"one-time-code",maxLength:2,disabled:i,value:h[$]??"",onChange:b=>y($,b),onKeyDown:b=>S($,b),onPaste:v,onFocus:b=>b.target.select(),$size:p,$variant:g,className:gt("input",o==null?void 0:o.input)},$))})]})},nr={light:{background:t.COLORS.white,border:t.alpha(t.COLORS.black,30),title:t.COLORS.black,description:t.COLORS["iron-grey"]},dark:{background:t.alpha(t.COLORS.white,5),border:t.alpha(t.COLORS.white,30),title:t.COLORS.white,description:"#9ca3af"}},et=e=>nr[e]??nr.light,Ta=s.div`
|
|
1404
1346
|
display: flex;
|
|
1405
1347
|
flex-direction: column;
|
|
1406
1348
|
gap: 16px;
|
|
1407
1349
|
padding: 12px;
|
|
1408
|
-
border: 1px dashed ${({$variant:e})=>
|
|
1350
|
+
border: 1px dashed ${({$variant:e})=>et(e).border};
|
|
1409
1351
|
border-radius: 16px;
|
|
1410
|
-
background-color: ${({$variant:e})=>
|
|
1411
|
-
`,
|
|
1352
|
+
background-color: ${({$variant:e})=>et(e).background};
|
|
1353
|
+
`,Na=s.div`
|
|
1412
1354
|
display: flex;
|
|
1413
1355
|
flex-direction: column;
|
|
1414
1356
|
gap: 4px;
|
|
1415
|
-
`,
|
|
1357
|
+
`,Ia=s.div`
|
|
1416
1358
|
font-size: 18px;
|
|
1417
1359
|
font-weight: 600;
|
|
1418
1360
|
line-height: 1.4;
|
|
1419
|
-
color: ${({$variant:e})=>
|
|
1420
|
-
`,
|
|
1361
|
+
color: ${({$variant:e})=>et(e).title};
|
|
1362
|
+
`,Aa=s.div`
|
|
1421
1363
|
font-size: 14px;
|
|
1422
1364
|
line-height: 1.5;
|
|
1423
|
-
color: ${({$variant:e})=>
|
|
1424
|
-
`,
|
|
1365
|
+
color: ${({$variant:e})=>et(e).description};
|
|
1366
|
+
`,Da=s.div`
|
|
1425
1367
|
display: flex;
|
|
1426
1368
|
flex-wrap: wrap;
|
|
1427
1369
|
gap: 8px;
|
|
1428
|
-
`,Ue=A.newClassNameGetter("panel"),
|
|
1370
|
+
`,Ue=A.newClassNameGetter("panel"),_a=({children:e,className:r,classnames:o,description:i,ref:n,title:l,variant:c="light",...d})=>{const p=l||i;return a.jsxs(Ta,{...d,ref:n,className:Ue("container",r),$variant:c,children:[p&&a.jsxs(Na,{children:[l&&a.jsx(Ia,{className:Ue("title",o==null?void 0:o.title),$variant:c,children:l}),i&&a.jsx(Aa,{className:Ue("description",o==null?void 0:o.description),$variant:c,children:i})]}),a.jsx(Da,{className:Ue("content",o==null?void 0:o.content),children:e})]})},Rt={compact:{height:4,radius:2},default:{height:8,radius:4}},Ma=s.div`
|
|
1429
1371
|
width: 100%;
|
|
1430
|
-
height: ${({$size:e})=>
|
|
1431
|
-
border-radius: ${({$size:e})=>
|
|
1372
|
+
height: ${({$size:e})=>Rt[e].height}px;
|
|
1373
|
+
border-radius: ${({$size:e})=>Rt[e].radius}px;
|
|
1432
1374
|
background-color: ${t.COLORS.gray};
|
|
1433
1375
|
overflow: hidden;
|
|
1434
|
-
`,
|
|
1376
|
+
`,Fa=s.div`
|
|
1435
1377
|
height: 100%;
|
|
1436
1378
|
width: ${({$value:e})=>Math.min(100,Math.max(0,e))}%;
|
|
1437
|
-
border-radius: ${({$size:e})=>
|
|
1379
|
+
border-radius: ${({$size:e})=>Rt[e].radius}px;
|
|
1438
1380
|
background-color: ${t.COLORS.black};
|
|
1439
1381
|
transition: width 0.2s ease;
|
|
1440
|
-
`,
|
|
1382
|
+
`,ar=A.newClassNameGetter("progress"),Ba=({value:e,size:r="default",className:o,classnames:i,ref:n,...l})=>a.jsx(Ma,{...l,ref:n,$size:r,className:ar("track",o,i==null?void 0:i.track),role:"progressbar","aria-valuenow":e,"aria-valuemin":0,"aria-valuemax":100,children:a.jsx(Fa,{$size:r,$value:e,className:ar("bar",i==null?void 0:i.bar)})}),lr={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}},ve=e=>lr[e]??lr.normal,Ya=s.label`
|
|
1441
1383
|
display: inline-flex;
|
|
1442
1384
|
align-items: flex-start;
|
|
1443
1385
|
gap: 8px;
|
|
1444
1386
|
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1445
1387
|
opacity: ${e=>e.$disabled?.5:1};
|
|
1446
|
-
|
|
1447
|
-
&:has(input:focus-visible) > span:first-of-type {
|
|
1448
|
-
box-shadow: 0 0 0 2px ${e=>fe(e.$variant).box.focusShadow};
|
|
1449
|
-
}
|
|
1450
|
-
`,Fa=s.input`
|
|
1388
|
+
`,Ha=s.input`
|
|
1451
1389
|
position: absolute;
|
|
1452
1390
|
opacity: 0;
|
|
1453
1391
|
width: 0;
|
|
1454
1392
|
height: 0;
|
|
1455
1393
|
pointer-events: none;
|
|
1456
|
-
`,
|
|
1394
|
+
`,Va=s.span`
|
|
1457
1395
|
display: inline-flex;
|
|
1458
1396
|
align-items: center;
|
|
1459
1397
|
justify-content: center;
|
|
@@ -1462,27 +1400,27 @@
|
|
|
1462
1400
|
height: 18px;
|
|
1463
1401
|
border-radius: 50%;
|
|
1464
1402
|
border: 1.5px solid
|
|
1465
|
-
${e=>e.$checked?
|
|
1466
|
-
background-color: ${e=>e.$checked?
|
|
1403
|
+
${e=>e.$checked?ve(e.$variant).box.borderChecked:ve(e.$variant).box.border};
|
|
1404
|
+
background-color: ${e=>e.$checked?ve(e.$variant).box.backgroundChecked:ve(e.$variant).box.background};
|
|
1467
1405
|
transition:
|
|
1468
1406
|
border-color 0.15s ease,
|
|
1469
1407
|
background-color 0.15s ease,
|
|
1470
1408
|
box-shadow 0.15s ease;
|
|
1471
|
-
`,
|
|
1409
|
+
`,Ga=s.span`
|
|
1472
1410
|
width: 8px;
|
|
1473
1411
|
height: 8px;
|
|
1474
1412
|
border-radius: 50%;
|
|
1475
|
-
background-color: ${e=>
|
|
1413
|
+
background-color: ${e=>ve(e.$variant).dot};
|
|
1476
1414
|
opacity: ${e=>e.$visible?1:0};
|
|
1477
1415
|
transform: ${e=>e.$visible?"scale(1)":"scale(0.5)"};
|
|
1478
1416
|
transition:
|
|
1479
1417
|
opacity 0.15s ease,
|
|
1480
1418
|
transform 0.15s ease;
|
|
1481
|
-
`,
|
|
1419
|
+
`,Wa=s.span`
|
|
1482
1420
|
font-size: 14px;
|
|
1483
1421
|
font-weight: 500;
|
|
1484
1422
|
line-height: 1.5;
|
|
1485
|
-
color: ${e=>
|
|
1423
|
+
color: ${e=>ve(e.$variant).label};
|
|
1486
1424
|
user-select: none;
|
|
1487
1425
|
|
|
1488
1426
|
a {
|
|
@@ -1494,15 +1432,15 @@
|
|
|
1494
1432
|
text-decoration: none;
|
|
1495
1433
|
}
|
|
1496
1434
|
}
|
|
1497
|
-
`,
|
|
1435
|
+
`,Ee=A.newClassNameGetter("radio"),Pt=({checked:e,className:r,classnames:o,disabled:i,label:n,onChange:l,ref:c,variant:d="normal",...p})=>a.jsxs(Ya,{className:Ee("container",r),$disabled:!!i,$variant:d,children:[a.jsx(Ha,{...p,ref:c,type:"radio",className:Ee("input",o==null?void 0:o.input),checked:e,disabled:i,onChange:l}),a.jsx(Va,{className:Ee("box",o==null?void 0:o.box),$checked:e,$variant:d,children:a.jsx(Ga,{className:Ee("dot",o==null?void 0:o.dot),$visible:e,$variant:d})}),n&&a.jsx(Wa,{className:Ee("label",o==null?void 0:o.label),$variant:d,children:n})]}),dr={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)}}},be=e=>dr[e]??dr.normal,Xa=s.label`
|
|
1498
1436
|
display: grid;
|
|
1499
1437
|
grid-template-columns: auto 1fr;
|
|
1500
1438
|
align-items: start;
|
|
1501
1439
|
gap: 8px;
|
|
1502
1440
|
padding: 12px;
|
|
1503
|
-
background-color: ${e=>{const r=
|
|
1441
|
+
background-color: ${e=>{const r=be(e.$variant);return e.$disabled?r.background.disabled:e.$checked?r.backgroundChecked:r.background.static}};
|
|
1504
1442
|
border: 1px solid
|
|
1505
|
-
${e=>{const r=
|
|
1443
|
+
${e=>{const r=be(e.$variant);return e.$disabled?r.border.disabled:e.$checked?r.borderChecked:r.border.static}};
|
|
1506
1444
|
border-radius: 12px;
|
|
1507
1445
|
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1508
1446
|
transition:
|
|
@@ -1512,18 +1450,13 @@
|
|
|
1512
1450
|
min-width: 0;
|
|
1513
1451
|
|
|
1514
1452
|
&:hover:not([data-disabled='true']) {
|
|
1515
|
-
border-color: ${e=>{const r=
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
&:has(:focus-visible) {
|
|
1519
|
-
outline: none;
|
|
1520
|
-
box-shadow: 0 0 0 3px ${e=>pe(e.$variant).focusRing};
|
|
1453
|
+
border-color: ${e=>{const r=be(e.$variant);return e.$checked?r.borderChecked:r.border.hover}};
|
|
1521
1454
|
}
|
|
1522
1455
|
|
|
1523
1456
|
.vacano_radio_container {
|
|
1524
1457
|
pointer-events: none;
|
|
1525
1458
|
}
|
|
1526
|
-
`,
|
|
1459
|
+
`,Ua=s.input`
|
|
1527
1460
|
position: absolute;
|
|
1528
1461
|
width: 1px;
|
|
1529
1462
|
height: 1px;
|
|
@@ -1533,44 +1466,44 @@
|
|
|
1533
1466
|
clip: rect(0, 0, 0, 0);
|
|
1534
1467
|
white-space: nowrap;
|
|
1535
1468
|
border: 0;
|
|
1536
|
-
`,
|
|
1469
|
+
`,qa=s.div`
|
|
1537
1470
|
display: flex;
|
|
1538
1471
|
flex-direction: column;
|
|
1539
1472
|
gap: 2px;
|
|
1540
1473
|
min-width: 0;
|
|
1541
|
-
`,
|
|
1474
|
+
`,Ka=s.span`
|
|
1542
1475
|
font-size: 14px;
|
|
1543
1476
|
font-weight: 500;
|
|
1544
1477
|
line-height: 1.4;
|
|
1545
|
-
color: ${e=>
|
|
1478
|
+
color: ${e=>be(e.$variant).label.static};
|
|
1546
1479
|
|
|
1547
1480
|
label[data-disabled='true'] & {
|
|
1548
|
-
color: ${e=>
|
|
1481
|
+
color: ${e=>be(e.$variant).label.disabled};
|
|
1549
1482
|
}
|
|
1550
|
-
`,
|
|
1483
|
+
`,Za=s.span`
|
|
1551
1484
|
font-size: 12px;
|
|
1552
1485
|
font-weight: 400;
|
|
1553
1486
|
line-height: 1.4;
|
|
1554
|
-
color: ${e=>
|
|
1487
|
+
color: ${e=>be(e.$variant).description.static};
|
|
1555
1488
|
|
|
1556
1489
|
label[data-disabled='true'] & {
|
|
1557
|
-
color: ${e=>
|
|
1490
|
+
color: ${e=>be(e.$variant).description.disabled};
|
|
1558
1491
|
}
|
|
1559
|
-
`,
|
|
1492
|
+
`,qe=A.newClassNameGetter("radio-card"),Ja=({checked:e,className:r,classnames:o,description:i,disabled:n,fullWidth:l=!1,label:c,onChange:d,ref:p,variant:h="normal",...g})=>a.jsxs(Xa,{className:qe("container",r),$checked:e,$disabled:!!n,$fullWidth:l,$variant:h,"data-disabled":n,children:[a.jsx(Ua,{...g,ref:p,type:"radio",checked:e,disabled:n,onChange:d}),a.jsx(Pt,{className:o==null?void 0:o.radio,checked:e,disabled:n,variant:h,onChange:()=>{},tabIndex:-1,"aria-hidden":!0}),a.jsxs(qa,{className:qe("content",o==null?void 0:o.content),children:[a.jsx(Ka,{className:qe("label",o==null?void 0:o.label),$variant:h,children:c}),i&&a.jsx(Za,{className:qe("description",o==null?void 0:o.description),$variant:h,children:i})]})]}),cr={label:{color:t.COLORS.black,disabledColor:t.alpha(t.COLORS.black,40)}},Qa=s.div`
|
|
1560
1493
|
display: flex;
|
|
1561
1494
|
flex-direction: column;
|
|
1562
1495
|
gap: 8px;
|
|
1563
|
-
`,
|
|
1496
|
+
`,el=s.span`
|
|
1564
1497
|
font-size: 13px;
|
|
1565
1498
|
font-weight: 500;
|
|
1566
1499
|
line-height: 1.5;
|
|
1567
|
-
color: ${e=>e.$disabled?
|
|
1500
|
+
color: ${e=>e.$disabled?cr.label.disabledColor:cr.label.color};
|
|
1568
1501
|
margin-bottom: 4px;
|
|
1569
|
-
`,
|
|
1502
|
+
`,tl=s.div`
|
|
1570
1503
|
display: flex;
|
|
1571
1504
|
flex-direction: column;
|
|
1572
1505
|
gap: 12px;
|
|
1573
|
-
`,
|
|
1506
|
+
`,ft=A.newClassNameGetter("radio-group"),rl=({className:e,classnames:r,disabled:o,label:i,name:n,onChange:l,options:c,ref:d,value:p,...h})=>a.jsxs(Qa,{...h,ref:d,className:ft("container",e),children:[i&&a.jsx(el,{className:ft("label",r==null?void 0:r.label),$disabled:o,children:i}),a.jsx(tl,{className:ft("options",r==null?void 0:r.options),children:c.map(g=>a.jsx(Pt,{className:r==null?void 0:r.radio,name:n,checked:p===g.value,label:g.label,disabled:o,onChange:()=>l(g.value)},g.value))})]}),jr=u.createContext(null),ol=s.div`
|
|
1574
1507
|
position: fixed;
|
|
1575
1508
|
bottom: 24px;
|
|
1576
1509
|
right: 24px;
|
|
@@ -1585,19 +1518,19 @@
|
|
|
1585
1518
|
animation: ${t.KEYFRAMES.fadeIn} 0.2s ease-out;
|
|
1586
1519
|
pointer-events: none;
|
|
1587
1520
|
color: ${t.COLORS.black};
|
|
1588
|
-
`,
|
|
1521
|
+
`,il=s.span`
|
|
1589
1522
|
font-size: 14px;
|
|
1590
1523
|
font-weight: 500;
|
|
1591
1524
|
white-space: nowrap;
|
|
1592
|
-
`,
|
|
1525
|
+
`,nl=({children:e,defaultMessage:r="Saving"})=>{const[o,i]=u.useState(!1),[n,l]=u.useState(r),c=u.useCallback(h=>{l(h??r),i(!0)},[r]),d=u.useCallback(()=>{i(!1)},[]),p=u.useMemo(()=>({isVisible:o,show:c,hide:d}),[o,c,d]);return a.jsxs(jr.Provider,{value:p,children:[e,o&&a.jsxs(ol,{children:[a.jsx(Lt,{size:"sm"}),a.jsx(il,{children:n})]})]})},al=()=>{const e=u.useContext(jr);if(!e)throw new Error("useSaveProgress must be used within SaveProgressProvider");return e},xt=40,Te=4,sr={compact:{height:"32px",padding:"0 10px",radius:"14px"},default:{height:"40px",padding:"0 14px",radius:"16px"}},pr={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)}},Ot=e=>sr[e]??sr.default,pe=e=>pr[e]??pr.normal,ll=s.div`
|
|
1593
1526
|
position: relative;
|
|
1594
1527
|
display: grid;
|
|
1595
1528
|
gap: 2px;
|
|
1596
1529
|
min-width: 180px;
|
|
1597
1530
|
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
1598
|
-
`,
|
|
1531
|
+
`,dl=s(ne)`
|
|
1599
1532
|
margin-left: 6px;
|
|
1600
|
-
`,
|
|
1533
|
+
`,cl=s.button`
|
|
1601
1534
|
display: flex;
|
|
1602
1535
|
align-items: center;
|
|
1603
1536
|
justify-content: space-between;
|
|
@@ -1608,47 +1541,43 @@
|
|
|
1608
1541
|
font-weight: 500;
|
|
1609
1542
|
text-align: left;
|
|
1610
1543
|
cursor: ${e=>e.$disabled?"not-allowed":"pointer"};
|
|
1611
|
-
height: ${e=>
|
|
1612
|
-
padding: ${e=>
|
|
1613
|
-
border-radius: ${e=>
|
|
1544
|
+
height: ${e=>Ot(e.$size).height};
|
|
1545
|
+
padding: ${e=>Ot(e.$size).padding};
|
|
1546
|
+
border-radius: ${e=>Ot(e.$size).radius};
|
|
1614
1547
|
|
|
1615
|
-
color: ${e=>e.$hasValue?e.$disabled?
|
|
1548
|
+
color: ${e=>e.$hasValue?e.$disabled?pe(e.$variant).color.disabled:pe(e.$variant).color.static:pe(e.$variant).placeholder};
|
|
1616
1549
|
border: 1px solid
|
|
1617
|
-
${e=>e.$disabled?
|
|
1618
|
-
background-color: ${e=>e.$disabled?
|
|
1619
|
-
|
|
1620
|
-
&:focus-visible {
|
|
1621
|
-
outline: 2px solid ${e=>de(e.$variant).focus};
|
|
1622
|
-
}
|
|
1623
|
-
`,ll=s.span`
|
|
1550
|
+
${e=>e.$disabled?pe(e.$variant).border.disabled:pe(e.$variant).border.static};
|
|
1551
|
+
background-color: ${e=>e.$disabled?pe(e.$variant).background.disabled:pe(e.$variant).background.static};
|
|
1552
|
+
`,sl=s.span`
|
|
1624
1553
|
flex: 1;
|
|
1625
1554
|
min-width: 0;
|
|
1626
1555
|
overflow: hidden;
|
|
1627
1556
|
text-overflow: ellipsis;
|
|
1628
1557
|
white-space: nowrap;
|
|
1629
|
-
`,
|
|
1558
|
+
`,pl=s.span`
|
|
1630
1559
|
display: flex;
|
|
1631
1560
|
align-items: center;
|
|
1632
1561
|
justify-content: center;
|
|
1633
1562
|
flex-shrink: 0;
|
|
1634
1563
|
transition: transform 0.2s ease;
|
|
1635
1564
|
transform: rotate(${e=>e.$open?"180deg":"0deg"});
|
|
1636
|
-
`,
|
|
1565
|
+
`,Er=`
|
|
1637
1566
|
padding: 4px;
|
|
1638
1567
|
background: ${t.COLORS.white};
|
|
1639
1568
|
border: 1px solid ${t.alpha(t.COLORS.black,10)};
|
|
1640
1569
|
border-radius: 16px;
|
|
1641
1570
|
box-shadow: 0 4px 20px ${t.alpha(t.COLORS.black,15)};
|
|
1642
1571
|
z-index: 1000;
|
|
1643
|
-
`,
|
|
1572
|
+
`,ul=s.div`
|
|
1644
1573
|
position: absolute;
|
|
1645
1574
|
left: -4px;
|
|
1646
1575
|
width: calc(100% + 8px);
|
|
1647
|
-
${
|
|
1648
|
-
`,
|
|
1576
|
+
${Er}
|
|
1577
|
+
`,hl=s.div`
|
|
1649
1578
|
position: fixed;
|
|
1650
|
-
${
|
|
1651
|
-
`,
|
|
1579
|
+
${Er}
|
|
1580
|
+
`,bl=s.button`
|
|
1652
1581
|
display: flex;
|
|
1653
1582
|
align-items: center;
|
|
1654
1583
|
justify-content: space-between;
|
|
@@ -1669,18 +1598,13 @@
|
|
|
1669
1598
|
&:hover:not(:disabled) {
|
|
1670
1599
|
background: ${t.alpha(t.COLORS.black,8)};
|
|
1671
1600
|
}
|
|
1672
|
-
|
|
1673
|
-
&:focus-visible {
|
|
1674
|
-
outline: none;
|
|
1675
|
-
background: ${t.alpha(t.COLORS.black,8)};
|
|
1676
|
-
}
|
|
1677
|
-
`,ul=s.span`
|
|
1601
|
+
`,gl=s.span`
|
|
1678
1602
|
display: flex;
|
|
1679
1603
|
align-items: center;
|
|
1680
1604
|
justify-content: center;
|
|
1681
1605
|
flex-shrink: 0;
|
|
1682
1606
|
color: ${t.COLORS.black};
|
|
1683
|
-
`,
|
|
1607
|
+
`,Se=A.newClassNameGetter("select"),fl=({className:e,classnames:r,disabled:o=!1,fullWidth:i=!1,label:n,onChange:l,options:c,placeholder:d="Select...",portalRenderNode:p,ref:h,size:g="default",value:f,variant:O="normal",...m})=>{const[y,S]=u.useState(!1),[v,x]=u.useState({top:0,left:0,width:0}),$=u.useRef(null),b=u.useRef(null),L=u.useRef(null),j=c.find(C=>C.value===f),N=Math.max(0,c.findIndex(C=>C.value===f)),H=-(N*xt+Te),z=()=>{if(!b.current||!p)return;const C=b.current.getBoundingClientRect(),I=N*xt+Te;let k=C.top-I;const T=c.length*xt+Te*2,F=8,B=window.innerHeight-T-8;k<F&&(k=F),k>B&&(k=B),x({top:k,left:C.left-Te,width:C.width+Te*2})},_=C=>{var I;l==null||l(C),S(!1),(I=b.current)==null||I.focus()},E=C=>{o||(C.key==="Enter"||C.key===" "?(C.preventDefault(),S(I=>!I)):C.key==="Escape"&&y?(C.preventDefault(),S(!1)):C.key==="ArrowDown"&&!y&&(C.preventDefault(),S(!0)))};u.useLayoutEffect(()=>{y&&p&&z()},[y,p,N,c.length]),u.useEffect(()=>{if(!y)return;const C=T=>{const F=T.target,B=$.current&&!$.current.contains(F),V=L.current&&!L.current.contains(F);p?B&&V&&S(!1):B&&S(!1)},I=()=>{p&&z()},k=()=>{p&&z()};return document.addEventListener("mousedown",C),p&&(window.addEventListener("scroll",I,!0),window.addEventListener("resize",k)),()=>{document.removeEventListener("mousedown",C),window.removeEventListener("scroll",I,!0),window.removeEventListener("resize",k)}},[y,p]);const w=()=>c.map(C=>a.jsxs(bl,{type:"button",role:"option",$selected:C.value===f,$disabled:C.disabled??!1,disabled:C.disabled,"aria-selected":C.value===f,onClick:()=>_(C.value),className:Se("option",r==null?void 0:r.option),children:[a.jsx("span",{children:C.label}),C.value===f&&a.jsx(gl,{children:a.jsx(a.Check,{size:16})})]},C.value)),M=p?ge.createPortal(a.jsx(hl,{ref:L,role:"listbox",style:{top:v.top,left:v.left,width:v.width},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()}),p):a.jsx(ul,{ref:L,role:"listbox",style:{top:H},className:Se("dropdown",r==null?void 0:r.dropdown),children:w()});return a.jsxs(ll,{...m,ref:C=>{$.current=C,typeof h=="function"?h(C):h&&(h.current=C)},$fullWidth:i,className:Se("container",e),children:[n&&a.jsx(dl,{className:Se("label",r==null?void 0:r.label),children:n}),a.jsxs(cl,{ref:b,type:"button",$size:g,$variant:O,$disabled:o,$hasValue:!!j,disabled:o,onClick:()=>!o&&S(C=>!C),onKeyDown:E,"aria-haspopup":"listbox","aria-expanded":y,className:Se("trigger",r==null?void 0:r.trigger),children:[a.jsx(sl,{children:(j==null?void 0:j.label)??d}),a.jsx(pl,{$open:y,children:a.jsx(a.ChevronDown,{size:16})})]}),y&&M]})},ur={positive:t.COLORS.green,negative:t.COLORS.red,neutral:t.COLORS["iron-grey"]},xl=e=>ur[e]??ur.neutral,Ol=s.div`
|
|
1684
1608
|
display: flex;
|
|
1685
1609
|
flex-direction: column;
|
|
1686
1610
|
gap: 4px;
|
|
@@ -1689,16 +1613,16 @@
|
|
|
1689
1613
|
border-radius: 16px;
|
|
1690
1614
|
border: ${({$border:e})=>e?"1px solid #e5e7eb":"none"};
|
|
1691
1615
|
box-shadow: ${({$shadow:e})=>e?"0 4px 6px -1px rgba(0, 0, 0, 0.1)":"none"};
|
|
1692
|
-
|
|
1616
|
+
`,$l=s.div`
|
|
1693
1617
|
display: flex;
|
|
1694
1618
|
align-items: center;
|
|
1695
1619
|
justify-content: space-between;
|
|
1696
1620
|
gap: 8px;
|
|
1697
|
-
`,
|
|
1621
|
+
`,Sl=s.p`
|
|
1698
1622
|
margin: 0;
|
|
1699
1623
|
font-size: 13px;
|
|
1700
1624
|
color: ${t.COLORS["iron-grey"]};
|
|
1701
|
-
`,
|
|
1625
|
+
`,yl=s.div`
|
|
1702
1626
|
display: flex;
|
|
1703
1627
|
align-items: center;
|
|
1704
1628
|
justify-content: center;
|
|
@@ -1712,21 +1636,21 @@
|
|
|
1712
1636
|
width: 18px;
|
|
1713
1637
|
height: 18px;
|
|
1714
1638
|
}
|
|
1715
|
-
|
|
1639
|
+
`,vl=s.h3`
|
|
1716
1640
|
margin: 0;
|
|
1717
1641
|
font-size: 28px;
|
|
1718
1642
|
font-weight: 600;
|
|
1719
1643
|
line-height: 1.2;
|
|
1720
1644
|
color: ${t.COLORS.black};
|
|
1721
|
-
`,
|
|
1645
|
+
`,Cl=s.p`
|
|
1722
1646
|
margin: 0;
|
|
1723
1647
|
font-size: 12px;
|
|
1724
|
-
color: ${({$variant:e})=>
|
|
1725
|
-
`,
|
|
1648
|
+
color: ${({$variant:e})=>xl(e)};
|
|
1649
|
+
`,Ke=A.newClassNameGetter("status-card"),ml=({border:e=!1,className:r,classnames:o,icon:i,label:n,ref:l,shadow:c=!1,trend:d,trendVariant:p="neutral",value:h,...g})=>a.jsxs(Ol,{...g,ref:l,className:Ke("container",r),$border:e,$shadow:c,children:[a.jsxs($l,{children:[a.jsx(Sl,{className:Ke("label",o==null?void 0:o.label),children:n}),i&&a.jsx(yl,{children:i})]}),a.jsx(vl,{className:Ke("value",o==null?void 0:o.value),children:h}),d&&a.jsx(Cl,{className:Ke("trend",o==null?void 0:o.trend),$variant:p,children:d})]}),wl=s.div`
|
|
1726
1650
|
display: flex;
|
|
1727
1651
|
align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
|
|
1728
1652
|
flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
|
|
1729
|
-
`,
|
|
1653
|
+
`,Rl=s.div`
|
|
1730
1654
|
display: flex;
|
|
1731
1655
|
align-items: ${e=>e.$orientation==="vertical"?"flex-start":"center"};
|
|
1732
1656
|
flex-direction: ${e=>e.$orientation==="vertical"?"column":"row"};
|
|
@@ -1735,7 +1659,7 @@
|
|
|
1735
1659
|
&:last-child {
|
|
1736
1660
|
flex: 0;
|
|
1737
1661
|
}
|
|
1738
|
-
`,
|
|
1662
|
+
`,kl=s.button`
|
|
1739
1663
|
display: flex;
|
|
1740
1664
|
align-items: center;
|
|
1741
1665
|
gap: 10px;
|
|
@@ -1744,16 +1668,7 @@
|
|
|
1744
1668
|
background: transparent;
|
|
1745
1669
|
cursor: ${e=>e.$clickable?"pointer":"default"};
|
|
1746
1670
|
flex-shrink: 0;
|
|
1747
|
-
|
|
1748
|
-
&:focus-visible {
|
|
1749
|
-
outline: none;
|
|
1750
|
-
|
|
1751
|
-
& > div:first-of-type {
|
|
1752
|
-
outline: 2px solid ${t.COLORS["steel-blue"]};
|
|
1753
|
-
outline-offset: 2px;
|
|
1754
|
-
}
|
|
1755
|
-
}
|
|
1756
|
-
`,wl=s.div`
|
|
1671
|
+
`,Ll=s.div`
|
|
1757
1672
|
display: flex;
|
|
1758
1673
|
align-items: center;
|
|
1759
1674
|
justify-content: center;
|
|
@@ -1777,13 +1692,13 @@
|
|
|
1777
1692
|
border: 2px solid ${t.COLORS.gray};
|
|
1778
1693
|
color: ${t.COLORS["iron-grey"]};
|
|
1779
1694
|
`}
|
|
1780
|
-
`,
|
|
1695
|
+
`,Pl=s.span`
|
|
1781
1696
|
font-size: 14px;
|
|
1782
1697
|
font-weight: 500;
|
|
1783
1698
|
white-space: nowrap;
|
|
1784
1699
|
color: ${e=>e.$active||e.$completed?t.COLORS.black:t.COLORS["iron-grey"]};
|
|
1785
1700
|
transition: color 0.2s ease;
|
|
1786
|
-
`,
|
|
1701
|
+
`,zl=s.div`
|
|
1787
1702
|
background-color: ${e=>e.$completed?t.COLORS.black:t.COLORS.gray};
|
|
1788
1703
|
transition: background-color 0.2s ease;
|
|
1789
1704
|
|
|
@@ -1797,22 +1712,22 @@
|
|
|
1797
1712
|
min-width: 16px;
|
|
1798
1713
|
margin: 0 12px;
|
|
1799
1714
|
`}
|
|
1800
|
-
`,
|
|
1715
|
+
`,Ne=A.newClassNameGetter("stepper"),jl=({className:e,classnames:r,onChange:o,orientation:i="horizontal",ref:n,steps:l,value:c,...d})=>{const p=u.useMemo(()=>l.findIndex(h=>h.value===c),[l,c]);return a.jsx(wl,{...d,ref:n,$orientation:i,className:Ne("container",e),children:l.map((h,g)=>{const f=h.value===c,O=g<p,m=g===l.length-1;return a.jsxs(Rl,{$orientation:i,children:[a.jsxs(kl,{type:"button",$active:f,$completed:O,$clickable:!!o,onClick:()=>o==null?void 0:o(h.value),className:Ne("step",r==null?void 0:r.step),children:[a.jsx(Ll,{$active:f,$completed:O,className:Ne("circle",r==null?void 0:r.circle),children:g+1}),a.jsx(Pl,{$active:f,$completed:O,className:Ne("label",r==null?void 0:r.label),children:h.label})]}),!m&&a.jsx(zl,{$completed:O,$orientation:i,className:Ne("line",r==null?void 0:r.line)})]},h.value)})})},kt={normal:{border:t.COLORS["iron-grey"],label:t.COLORS.black},error:{border:t.COLORS.red,label:t.COLORS.red}},El=s.div`
|
|
1801
1716
|
position: relative;
|
|
1802
1717
|
display: flex;
|
|
1803
1718
|
flex-direction: column;
|
|
1804
1719
|
gap: 4px;
|
|
1805
|
-
`,
|
|
1720
|
+
`,Tl=s(ne)`
|
|
1806
1721
|
margin-left: 6px;
|
|
1807
|
-
color: ${e=>
|
|
1808
|
-
`,
|
|
1722
|
+
color: ${e=>kt[e.$variant].label};
|
|
1723
|
+
`,Nl=s.div`
|
|
1809
1724
|
display: flex;
|
|
1810
1725
|
flex-wrap: wrap;
|
|
1811
1726
|
align-items: center;
|
|
1812
1727
|
gap: 6px;
|
|
1813
1728
|
min-height: 44px;
|
|
1814
1729
|
padding: 8px 12px;
|
|
1815
|
-
border: 1px dashed ${e=>
|
|
1730
|
+
border: 1px dashed ${e=>kt[e.$variant].border};
|
|
1816
1731
|
border-radius: 8px;
|
|
1817
1732
|
background: ${t.COLORS.white};
|
|
1818
1733
|
cursor: ${e=>e.$disabled?"not-allowed":"text"};
|
|
@@ -1820,14 +1735,14 @@
|
|
|
1820
1735
|
transition: border-color 0.15s ease;
|
|
1821
1736
|
|
|
1822
1737
|
&:hover {
|
|
1823
|
-
border-color: ${e=>e.$disabled?
|
|
1738
|
+
border-color: ${e=>e.$disabled?kt[e.$variant].border:e.$variant==="error"?t.COLORS.red:t.COLORS.black};
|
|
1824
1739
|
}
|
|
1825
1740
|
|
|
1826
1741
|
${e=>e.$focused&&`
|
|
1827
1742
|
outline: 2px solid ${e.$variant==="error"?t.COLORS.red:t.COLORS["steel-blue"]};
|
|
1828
1743
|
outline-offset: 2px;
|
|
1829
1744
|
`}
|
|
1830
|
-
`,
|
|
1745
|
+
`,Il=s.input`
|
|
1831
1746
|
flex: 1;
|
|
1832
1747
|
min-width: 80px;
|
|
1833
1748
|
border: none;
|
|
@@ -1844,7 +1759,7 @@
|
|
|
1844
1759
|
&:disabled {
|
|
1845
1760
|
cursor: not-allowed;
|
|
1846
1761
|
}
|
|
1847
|
-
`,
|
|
1762
|
+
`,Tr=`
|
|
1848
1763
|
z-index: 100;
|
|
1849
1764
|
background-color: ${t.COLORS.white};
|
|
1850
1765
|
border: 1px solid ${t.alpha(t.COLORS.black,15)};
|
|
@@ -1852,28 +1767,28 @@
|
|
|
1852
1767
|
box-shadow: 0 4px 16px ${t.alpha(t.COLORS.black,12)};
|
|
1853
1768
|
max-height: 200px;
|
|
1854
1769
|
overflow-y: auto;
|
|
1855
|
-
`,
|
|
1770
|
+
`,Nr=(e,r)=>e?"translateY(0)":r==="bottom"?"translateY(-8px)":"translateY(8px)",Ir=`
|
|
1856
1771
|
opacity 0.15s ease,
|
|
1857
1772
|
transform 0.15s ease,
|
|
1858
1773
|
visibility 0.15s;
|
|
1859
|
-
`,
|
|
1774
|
+
`,Al=s.div`
|
|
1860
1775
|
position: absolute;
|
|
1861
1776
|
left: 0;
|
|
1862
1777
|
right: 0;
|
|
1863
1778
|
${e=>e.$position==="bottom"?"top: calc(100% + 4px);":"bottom: calc(100% + 4px);"}
|
|
1864
|
-
${
|
|
1779
|
+
${Tr}
|
|
1865
1780
|
opacity: ${e=>e.$open?1:0};
|
|
1866
1781
|
visibility: ${e=>e.$open?"visible":"hidden"};
|
|
1867
|
-
transform: ${e=>
|
|
1868
|
-
transition: ${
|
|
1869
|
-
`,
|
|
1782
|
+
transform: ${e=>Nr(e.$open,e.$position)};
|
|
1783
|
+
transition: ${Ir};
|
|
1784
|
+
`,Dl=s.div`
|
|
1870
1785
|
position: fixed;
|
|
1871
|
-
${
|
|
1786
|
+
${Tr}
|
|
1872
1787
|
opacity: ${e=>e.$open?1:0};
|
|
1873
1788
|
visibility: ${e=>e.$open?"visible":"hidden"};
|
|
1874
|
-
transform: ${e=>
|
|
1875
|
-
transition: ${
|
|
1876
|
-
`,
|
|
1789
|
+
transform: ${e=>Nr(e.$open,e.$position)};
|
|
1790
|
+
transition: ${Ir};
|
|
1791
|
+
`,hr=s.button`
|
|
1877
1792
|
display: flex;
|
|
1878
1793
|
align-items: center;
|
|
1879
1794
|
width: 100%;
|
|
@@ -1901,7 +1816,7 @@
|
|
|
1901
1816
|
&:only-child {
|
|
1902
1817
|
border-radius: 7px;
|
|
1903
1818
|
}
|
|
1904
|
-
`,
|
|
1819
|
+
`,br=s.div`
|
|
1905
1820
|
display: flex;
|
|
1906
1821
|
align-items: center;
|
|
1907
1822
|
justify-content: center;
|
|
@@ -1909,11 +1824,11 @@
|
|
|
1909
1824
|
color: ${t.COLORS["iron-grey"]};
|
|
1910
1825
|
font-size: 14px;
|
|
1911
1826
|
text-align: center;
|
|
1912
|
-
`,ee=A.newClassNameGetter("tags"),
|
|
1827
|
+
`,ee=A.newClassNameGetter("tags"),Ze=4,_l=({className:e,classnames:r,createKey:o="Tab",disabled:i=!1,emptyMessage:n="No options",freeSolo:l=!0,label:c,onChange:d,options:p=[],placeholder:h="Add tag...",portalRenderNode:g,ref:f,value:O,variant:m="normal",...y})=>{const S=u.useRef(null),v=u.useRef(null),x=u.useRef(null),$=u.useRef(null),[b,L]=u.useState(""),[j,N]=u.useState(!1),[H,z]=u.useState("bottom"),[_,E]=u.useState({top:0,left:0,width:0}),w=u.useMemo(()=>{const P=p.filter(U=>!O.includes(U.value));if(!b.trim())return P;const D=b.toLowerCase().trim();return P.filter(U=>U.label.toLowerCase().includes(D))},[p,O,b]),M=j&&p.length>0,C=u.useCallback(()=>{var Me;if(!v.current)return;const P=v.current.getBoundingClientRect(),D=((Me=x.current)==null?void 0:Me.offsetHeight)??200,U=window.innerHeight-P.bottom-Ze,q=P.top-Ze,fe=U<D&&q>U?"top":"bottom";if(z(fe),g){const ot=fe==="bottom"?P.bottom+Ze:P.top-D-Ze;E({top:ot,left:P.left,width:P.width})}},[g]);u.useEffect(()=>{if(j)return C(),window.addEventListener("scroll",C,!0),window.addEventListener("resize",C),()=>{window.removeEventListener("scroll",C,!0),window.removeEventListener("resize",C)}},[j,C]);const I=u.useCallback(P=>{const D=P.trim();return!D||O.includes(D)?!1:(d([...O,D]),L(""),!0)},[O,d]),k=P=>{if(P.key===o&&b.trim())if(P.preventDefault(),l)I(b);else{const D=w.find(U=>U.label.toLowerCase()===b.toLowerCase().trim());D&&I(D.value)}else P.key==="Backspace"&&!b&&O.length>0&&d(O.slice(0,-1))},T=P=>{var D;I(P),(D=$.current)==null||D.focus()},F=P=>{d(O.filter(D=>D!==P))},B=()=>{var P;i||(P=$.current)==null||P.focus()},V=P=>{const D=p.find(U=>U.value===P);return(D==null?void 0:D.label)??P};return a.jsxs(El,{...y,ref:f,className:ee("container",e),children:[c&&a.jsx(Tl,{$variant:m,className:ee("label"),children:c}),a.jsxs("div",{ref:S,style:{position:"relative"},children:[a.jsxs(Nl,{ref:v,$variant:m,$disabled:i,$focused:j,onClick:B,className:ee("trigger",r==null?void 0:r.trigger),children:[O.map(P=>a.jsx(Qe,{deletable:!i,onDelete:()=>F(P),className:ee("chip",r==null?void 0:r.chip),children:V(P)},P)),a.jsx(Il,{ref:$,type:"text",value:b,onChange:P=>L(P.target.value),onFocus:()=>N(!0),onBlur:()=>setTimeout(()=>N(!1),150),onKeyDown:k,placeholder:O.length===0?h:"",disabled:i,$disabled:i,className:ee("input",r==null?void 0:r.input)})]}),p.length>0&&(g?ge.createPortal(a.jsx(Dl,{ref:x,$open:M,$position:H,style:{top:_.top,left:_.left,width:_.width},className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(br,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(hr,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}),g):a.jsx(Al,{ref:x,$open:M,$position:H,className:ee("dropdown",r==null?void 0:r.dropdown),children:w.length===0?a.jsx(br,{className:ee("empty",r==null?void 0:r.empty),children:n}):w.map(P=>a.jsx(hr,{type:"button",onMouseDown:D=>D.preventDefault(),onClick:()=>T(P.value),className:ee("option",r==null?void 0:r.option),children:P.label},P.value))}))]})]})},Ml=s.div`
|
|
1913
1828
|
display: flex;
|
|
1914
1829
|
align-items: center;
|
|
1915
1830
|
gap: 6px;
|
|
1916
|
-
`,
|
|
1831
|
+
`,Fl=s.button`
|
|
1917
1832
|
padding: 6px 16px;
|
|
1918
1833
|
border: none;
|
|
1919
1834
|
border-radius: 12px;
|
|
@@ -1931,12 +1846,44 @@
|
|
|
1931
1846
|
&:hover:not(:disabled) {
|
|
1932
1847
|
background-color: ${e=>e.$active?t.COLORS.gray:"rgba(0, 0, 0, 0.05)"};
|
|
1933
1848
|
}
|
|
1849
|
+
`,gr=A.newClassNameGetter("tabs"),Bl=({className:e,classnames:r,onChange:o,ref:i,tabs:n,value:l,...c})=>a.jsx(Ml,{...c,ref:i,className:gr("container",e),role:"tablist",children:n.map(d=>a.jsx(Fl,{type:"button",role:"tab","aria-selected":l===d.value,$active:l===d.value,$disabled:!!d.disabled,disabled:d.disabled,onClick:()=>o(d.value),className:gr("tab",r==null?void 0:r.tab),children:d.label},d.value))}),fr={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)}},ce=e=>fr[e]??fr.normal,Yl=s.div`
|
|
1850
|
+
display: grid;
|
|
1851
|
+
flex-direction: column;
|
|
1852
|
+
gap: 2px;
|
|
1853
|
+
width: ${e=>e.$fullWidth?"100%":"fit-content"};
|
|
1854
|
+
`,Hl=s(ne)`
|
|
1855
|
+
margin-left: 6px;
|
|
1856
|
+
`,Vl=s.textarea`
|
|
1857
|
+
flex: 1;
|
|
1858
|
+
min-width: 0;
|
|
1859
|
+
outline: none;
|
|
1860
|
+
font-size: 14px;
|
|
1861
|
+
font-weight: 500;
|
|
1862
|
+
font-family: inherit;
|
|
1863
|
+
padding: 10px 14px;
|
|
1864
|
+
border-radius: 16px;
|
|
1865
|
+
resize: vertical;
|
|
1866
|
+
|
|
1867
|
+
color: ${e=>ce(e.$variant).color.static};
|
|
1868
|
+
border: 1px solid ${e=>ce(e.$variant).border.static};
|
|
1869
|
+
background-color: ${e=>ce(e.$variant).background.static};
|
|
1870
|
+
|
|
1871
|
+
&::placeholder {
|
|
1872
|
+
color: ${e=>ce(e.$variant).placeholder.static};
|
|
1873
|
+
}
|
|
1934
1874
|
|
|
1935
|
-
&:
|
|
1936
|
-
|
|
1937
|
-
|
|
1875
|
+
&:disabled {
|
|
1876
|
+
cursor: not-allowed;
|
|
1877
|
+
resize: none;
|
|
1878
|
+
color: ${e=>ce(e.$variant).color.disabled};
|
|
1879
|
+
background-color: ${e=>ce(e.$variant).background.disabled};
|
|
1880
|
+
border-color: ${e=>ce(e.$variant).border.disabled};
|
|
1881
|
+
|
|
1882
|
+
&::placeholder {
|
|
1883
|
+
color: ${e=>ce(e.$variant).placeholder.disabled};
|
|
1884
|
+
}
|
|
1938
1885
|
}
|
|
1939
|
-
|
|
1886
|
+
`,$t=A.newClassNameGetter("textarea"),Gl=({className:e,classnames:r,disabled:o,fullWidth:i,label:n,ref:l,variant:c="normal",rows:d=4,...p})=>a.jsxs(Yl,{className:$t("container",e),$fullWidth:!!i,children:[n&&a.jsx(Hl,{variant:c,className:$t("label",r==null?void 0:r.label),children:n}),a.jsx(Vl,{...p,ref:l,rows:d,disabled:o,$variant:c,className:$t("textarea",r==null?void 0:r.textarea)})]}),Ar=u.createContext(null),St=3,xr={default:{background:"#374151",text:t.COLORS.white,border:"#374151"},success:{background:t.COLORS.green,text:t.COLORS.white,border:t.COLORS.green},warning:{background:t.COLORS.yellow,text:t.COLORS.white,border:t.COLORS.yellow},danger:{background:t.COLORS.red,text:t.COLORS.white,border:t.COLORS.red}},Wl=(e,r)=>{switch(r.type){case"ADD_TOAST":{const o=r.payload;return e.toasts.length<St?{...e,toasts:[...e.toasts,o]}:{...e,queue:[...e.queue,o]}}case"REMOVE_TOAST":{const o=r.payload,i=e.toasts.filter(l=>l.id!==o),n=e.queue[0];return n&&i.length<St?{toasts:[...i,n],queue:e.queue.slice(1)}:{...e,toasts:i}}case"SHOW_NEXT_FROM_QUEUE":{const o=e.queue[0];return!o||e.toasts.length>=St?e:{toasts:[...e.toasts,o],queue:e.queue.slice(1)}}default:return e}},Xl={toasts:[],queue:[]},yt=e=>xr[e]??xr.default,Ul=oe.keyframes`
|
|
1940
1887
|
from {
|
|
1941
1888
|
transform: translateY(100%);
|
|
1942
1889
|
opacity: 0;
|
|
@@ -1945,7 +1892,7 @@
|
|
|
1945
1892
|
transform: translateY(0);
|
|
1946
1893
|
opacity: 1;
|
|
1947
1894
|
}
|
|
1948
|
-
`,
|
|
1895
|
+
`,ql=oe.keyframes`
|
|
1949
1896
|
from {
|
|
1950
1897
|
transform: translateY(0);
|
|
1951
1898
|
opacity: 1;
|
|
@@ -1954,7 +1901,7 @@
|
|
|
1954
1901
|
transform: translateY(100%);
|
|
1955
1902
|
opacity: 0;
|
|
1956
1903
|
}
|
|
1957
|
-
`,
|
|
1904
|
+
`,Kl=s.div`
|
|
1958
1905
|
position: fixed;
|
|
1959
1906
|
bottom: 24px;
|
|
1960
1907
|
left: 24px;
|
|
@@ -1965,29 +1912,29 @@
|
|
|
1965
1912
|
pointer-events: none;
|
|
1966
1913
|
width: auto;
|
|
1967
1914
|
max-width: 90vw;
|
|
1968
|
-
`,
|
|
1915
|
+
`,Zl=s.div`
|
|
1969
1916
|
display: flex;
|
|
1970
1917
|
align-items: center;
|
|
1971
1918
|
justify-content: space-between;
|
|
1972
1919
|
gap: 12px;
|
|
1973
1920
|
min-height: 32px;
|
|
1974
1921
|
padding: 8px 8px 8px 16px;
|
|
1975
|
-
background-color: ${({$variant:e})
|
|
1976
|
-
color: ${({$variant:e})
|
|
1977
|
-
border: 1px solid ${({$variant:e})
|
|
1922
|
+
background-color: ${({$variant:e})=>yt(e).background};
|
|
1923
|
+
color: ${({$variant:e})=>yt(e).text};
|
|
1924
|
+
border: 1px solid ${({$variant:e})=>yt(e).border};
|
|
1978
1925
|
border-radius: 96px;
|
|
1979
1926
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
1980
|
-
animation: ${({$isExiting:e})=>e?
|
|
1927
|
+
animation: ${({$isExiting:e})=>e?ql:Ul} 0.3s ease-out;
|
|
1981
1928
|
pointer-events: auto;
|
|
1982
1929
|
max-width: 500px;
|
|
1983
|
-
`,
|
|
1930
|
+
`,Jl=s.span`
|
|
1984
1931
|
font-size: 14px;
|
|
1985
1932
|
font-weight: 500;
|
|
1986
1933
|
line-height: 1.4;
|
|
1987
1934
|
white-space: nowrap;
|
|
1988
1935
|
overflow: hidden;
|
|
1989
1936
|
text-overflow: ellipsis;
|
|
1990
|
-
`,
|
|
1937
|
+
`,Ql=s.button`
|
|
1991
1938
|
display: flex;
|
|
1992
1939
|
align-items: center;
|
|
1993
1940
|
justify-content: center;
|
|
@@ -2005,13 +1952,13 @@
|
|
|
2005
1952
|
&:hover {
|
|
2006
1953
|
opacity: 1;
|
|
2007
1954
|
}
|
|
2008
|
-
`,
|
|
1955
|
+
`,ed=s.div`
|
|
2009
1956
|
display: flex;
|
|
2010
1957
|
align-items: center;
|
|
2011
1958
|
justify-content: space-between;
|
|
2012
1959
|
gap: 12px;
|
|
2013
1960
|
width: 100%;
|
|
2014
|
-
`,
|
|
1961
|
+
`,td=s.div`
|
|
2015
1962
|
display: flex;
|
|
2016
1963
|
align-items: center;
|
|
2017
1964
|
justify-content: center;
|
|
@@ -2026,7 +1973,7 @@
|
|
|
2026
1973
|
font-weight: 500;
|
|
2027
1974
|
white-space: nowrap;
|
|
2028
1975
|
margin-left: auto;
|
|
2029
|
-
`,
|
|
1976
|
+
`,Or=({toast:e,onRemove:r})=>{const[o,i]=u.useState(!1),n=()=>{i(!0),setTimeout(()=>{r(e.id)},300)};return u.useEffect(()=>{if(e.duration){const l=setTimeout(()=>{n()},e.duration);return()=>clearTimeout(l)}},[e.duration,e.id]),a.jsxs(Zl,{$variant:e.variant,$isExiting:o,children:[a.jsx(Jl,{children:e.message}),a.jsx(Ql,{onClick:n,children:a.jsx(a.X,{style:{width:16,height:16}})})]})},rd=({toasts:e,queueCount:r,removeToast:o})=>{if(e.length===0)return null;const i=e.length-1;return a.jsx(Kl,{children:e.map((n,l)=>l===i&&r>0?a.jsxs(ed,{children:[a.jsx(Or,{toast:n,onRemove:o}),a.jsxs(td,{children:["+",r]})]},n.id):a.jsx(Or,{toast:n,onRemove:o},n.id))})},od=({children:e})=>{const[r,o]=u.useReducer(Wl,Xl),i=u.useCallback((l,c="default",d)=>{const p=`toast-${Date.now()}-${Math.random().toString(36).substr(2,9)}`;o({type:"ADD_TOAST",payload:{id:p,message:l,variant:c,duration:d}})},[]),n=u.useCallback(l=>{o({type:"REMOVE_TOAST",payload:l})},[]);return a.jsxs(Ar.Provider,{value:{addToast:i,removeToast:n},children:[e,a.jsx(rd,{toasts:r.toasts,queueCount:r.queue.length,removeToast:n})]})},id=()=>{const e=u.useContext(Ar);if(!e)throw new Error("useToast must be used within ToastProvider");return e},$r={dark:{background:t.COLORS.black,text:t.COLORS.white},light:{background:t.COLORS.white,text:t.COLORS.black,border:t.COLORS.gray},success:{background:t.COLORS.green,text:t.COLORS.white},warning:{background:t.COLORS.yellow,text:t.COLORS.white},danger:{background:t.COLORS.red,text:t.COLORS.white}},De=e=>$r[e]??$r.dark,nd=(e,r)=>{const o=De(r).background;switch(e){case"top":return`
|
|
2030
1977
|
bottom: -12px;
|
|
2031
1978
|
left: 50%;
|
|
2032
1979
|
margin-left: -6px;
|
|
@@ -2046,7 +1993,7 @@
|
|
|
2046
1993
|
top: 50%;
|
|
2047
1994
|
margin-top: -6px;
|
|
2048
1995
|
border-right-color: ${o};
|
|
2049
|
-
`;default:return""}},
|
|
1996
|
+
`;default:return""}},ad=(e,r)=>{if(r!=="light")return"";const o=De(r).border;switch(e){case"top":return`
|
|
2050
1997
|
&::after {
|
|
2051
1998
|
bottom: -14px;
|
|
2052
1999
|
left: 50%;
|
|
@@ -2074,11 +2021,11 @@
|
|
|
2074
2021
|
margin-top: -7px;
|
|
2075
2022
|
border-right-color: ${o};
|
|
2076
2023
|
}
|
|
2077
|
-
`;default:return""}},
|
|
2024
|
+
`;default:return""}},Dr=e=>`
|
|
2078
2025
|
z-index: 1000;
|
|
2079
2026
|
padding: 6px 12px;
|
|
2080
|
-
background-color: ${
|
|
2081
|
-
color: ${
|
|
2027
|
+
background-color: ${De(e.$variant).background};
|
|
2028
|
+
color: ${De(e.$variant).text};
|
|
2082
2029
|
font-size: 13px;
|
|
2083
2030
|
line-height: 1.4;
|
|
2084
2031
|
border-radius: 6px;
|
|
@@ -2092,7 +2039,7 @@
|
|
|
2092
2039
|
transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
|
|
2093
2040
|
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
2094
2041
|
|
|
2095
|
-
${e.$variant==="light"?`border: 1px solid ${
|
|
2042
|
+
${e.$variant==="light"?`border: 1px solid ${De(e.$variant).border};`:""}
|
|
2096
2043
|
|
|
2097
2044
|
&::before {
|
|
2098
2045
|
content: '';
|
|
@@ -2100,7 +2047,7 @@
|
|
|
2100
2047
|
width: 0;
|
|
2101
2048
|
height: 0;
|
|
2102
2049
|
border: 6px solid transparent;
|
|
2103
|
-
${
|
|
2050
|
+
${nd(e.$placement,e.$variant)}
|
|
2104
2051
|
}
|
|
2105
2052
|
|
|
2106
2053
|
${e.$variant==="light"?`
|
|
@@ -2113,11 +2060,11 @@
|
|
|
2113
2060
|
}
|
|
2114
2061
|
`:""}
|
|
2115
2062
|
|
|
2116
|
-
${
|
|
2117
|
-
`,
|
|
2063
|
+
${ad(e.$placement,e.$variant)}
|
|
2064
|
+
`,ld=s.div`
|
|
2118
2065
|
position: relative;
|
|
2119
2066
|
display: inline-block;
|
|
2120
|
-
`,
|
|
2067
|
+
`,dd=e=>{switch(e){case"top":return`
|
|
2121
2068
|
bottom: calc(100% + 8px);
|
|
2122
2069
|
left: 50%;
|
|
2123
2070
|
transform: translateX(-50%);
|
|
@@ -2133,12 +2080,12 @@
|
|
|
2133
2080
|
left: calc(100% + 8px);
|
|
2134
2081
|
top: 50%;
|
|
2135
2082
|
transform: translateY(-50%);
|
|
2136
|
-
`;default:return""}},
|
|
2083
|
+
`;default:return""}},cd=s.div`
|
|
2137
2084
|
position: absolute;
|
|
2138
|
-
${e=>
|
|
2139
|
-
${({$placement:e})=>
|
|
2140
|
-
`,
|
|
2085
|
+
${e=>Dr(e)}
|
|
2086
|
+
${({$placement:e})=>dd(e)}
|
|
2087
|
+
`,sd=s.div`
|
|
2141
2088
|
position: fixed;
|
|
2142
|
-
${e=>
|
|
2143
|
-
`,
|
|
2089
|
+
${e=>Dr(e)}
|
|
2090
|
+
`,vt=A.newClassNameGetter("tooltip"),se=8,pd=({children:e,className:r,classnames:o,content:i,delay:n=200,placement:l="top",portalRenderNode:c,ref:d,variant:p="dark",...h})=>{const[g,f]=u.useState(!1),[O,m]=u.useState(null),[y,S]=u.useState(l),[v,x]=u.useState({top:0,left:0}),$=u.useRef(null),b=u.useRef(null),L=u.useCallback(()=>{var T,F;if(!$.current)return;const z=$.current.getBoundingClientRect(),_=((T=b.current)==null?void 0:T.offsetWidth)??100,E=((F=b.current)==null?void 0:F.offsetHeight)??30,w=z.top-se,M=window.innerHeight-z.bottom-se,C=z.left-se,I=window.innerWidth-z.right-se;let k=l;if(l==="top"&&w<E&&M>w?k="bottom":l==="bottom"&&M<E&&w>M?k="top":l==="left"&&C<_&&I>C?k="right":l==="right"&&I<_&&C>I&&(k="left"),S(k),c){let B,V;switch(k){case"top":B=z.top-E-se,V=z.left+z.width/2-_/2;break;case"bottom":B=z.bottom+se,V=z.left+z.width/2-_/2;break;case"left":B=z.top+z.height/2-E/2,V=z.left-_-se;break;case"right":B=z.top+z.height/2-E/2,V=z.right+se;break;default:B=0,V=0}const P=8;V=Math.max(P,Math.min(V,window.innerWidth-_-P)),B=Math.max(P,Math.min(B,window.innerHeight-E-P)),x({top:B,left:V})}},[l,c]);u.useLayoutEffect(()=>{g&&L()},[g,L]);const j=()=>{const z=setTimeout(()=>{f(!0)},n);m(z)},N=()=>{O&&(clearTimeout(O),m(null)),f(!1)},H=c?ge.createPortal(a.jsx(sd,{ref:b,className:vt("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,style:{top:v.top,left:v.left},children:i}),c):a.jsx(cd,{ref:b,className:vt("content",o==null?void 0:o.content),$placement:y,$variant:p,$visible:g,children:i});return a.jsxs(ld,{...h,ref:z=>{$.current=z,typeof d=="function"?d(z):d&&(d.current=z)},className:vt("wrapper",r),onMouseEnter:j,onMouseLeave:N,children:[e,H]})};exports.Autocomplete=Lo;exports.Button=_e;exports.Card=Mo;exports.Checkbox=tt;exports.CheckboxCard=Ko;exports.CheckboxGroup=ei;exports.Chip=Qe;exports.Confirmation=pi;exports.Container=bi;exports.DatePicker=Bi;exports.Drawer=Wi;exports.Dropdown=Ji;exports.FieldLabel=ne;exports.FieldMessage=rn;exports.GlobalStyle=io;exports.ImageCropper=sa;exports.Input=Lr;exports.KeySymbol=Sr;exports.KeysBindings=yr;exports.Modal=Pr;exports.MultiSelect=ka;exports.OtpCode=Ea;exports.Panel=_a;exports.Progress=Ba;exports.Radio=Pt;exports.RadioCard=Ja;exports.RadioGroup=rl;exports.SaveProgressProvider=nl;exports.Select=fl;exports.Spinner=Lt;exports.StatusCard=ml;exports.Stepper=jl;exports.Tabs=Bl;exports.Tags=_l;exports.Textarea=Gl;exports.ToastProvider=od;exports.Tooltip=pd;exports.formatDateGo=vr;exports.useImageCropper=kr;exports.useSaveProgress=al;exports.useToast=id;
|
|
2144
2091
|
//# sourceMappingURL=index.cjs.map
|