@dnotrever2/super-kit 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/Select/Select.d.ts +8 -0
- package/dist/super-kit.cjs +1 -1
- package/dist/super-kit.cjs.map +1 -1
- package/dist/super-kit.css +1 -1
- package/dist/super-kit.js +554 -550
- package/dist/super-kit.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -393,6 +393,9 @@ const options = [
|
|
|
393
393
|
multiple
|
|
394
394
|
searchable
|
|
395
395
|
clearable
|
|
396
|
+
showSelectedValues={false}
|
|
397
|
+
showSelectedCount={false}
|
|
398
|
+
showClearAll={false}
|
|
396
399
|
onValueChange={(values) => setRegions(values)}
|
|
397
400
|
/>
|
|
398
401
|
```
|
|
@@ -407,6 +410,10 @@ const options = [
|
|
|
407
410
|
| `disabled` | `boolean` | `false` |
|
|
408
411
|
| `placeholder` | `string` | `"Select"` |
|
|
409
412
|
| `optionsPosition` | `"bottom" \| "top"` | `"bottom"` |
|
|
413
|
+
| `showSelectedCount` | `boolean` | `true` |
|
|
414
|
+
| `showClearAll` | `boolean` | `true` |
|
|
415
|
+
| `showSelectedValues` | `boolean` | `true` |
|
|
416
|
+
| `closeOnSelect` | `boolean` | `true` single, `false` multi |
|
|
410
417
|
| `label` | `string` | — |
|
|
411
418
|
| `onValueChange` | `(value, selectedOptions) => void` | — |
|
|
412
419
|
| `filterOptions` | `(options, search) => options` | built-in case-insensitive |
|
package/dist/Select/Select.d.ts
CHANGED
|
@@ -22,6 +22,10 @@ export type SelectProps<Value extends string = string> = Omit<HTMLAttributes<HTM
|
|
|
22
22
|
loadingLabel?: string;
|
|
23
23
|
isLoading?: boolean;
|
|
24
24
|
optionsPosition?: SelectOptionsPosition;
|
|
25
|
+
showSelectedCount?: boolean;
|
|
26
|
+
showClearAll?: boolean;
|
|
27
|
+
showSelectedValues?: boolean;
|
|
28
|
+
closeOnSelect?: boolean;
|
|
25
29
|
filterOptions?: (options: SelectOption<Value>[], searchValue: string) => SelectOption<Value>[];
|
|
26
30
|
onSearchChange?: (searchValue: string) => void;
|
|
27
31
|
onValueChange?: (value: SelectValue<Value>, selectedOptions: SelectOption<Value>[]) => void;
|
|
@@ -41,6 +45,10 @@ export declare const Select: import('react').ForwardRefExoticComponent<Omit<HTML
|
|
|
41
45
|
loadingLabel?: string;
|
|
42
46
|
isLoading?: boolean;
|
|
43
47
|
optionsPosition?: SelectOptionsPosition;
|
|
48
|
+
showSelectedCount?: boolean;
|
|
49
|
+
showClearAll?: boolean;
|
|
50
|
+
showSelectedValues?: boolean;
|
|
51
|
+
closeOnSelect?: boolean;
|
|
44
52
|
filterOptions?: ((options: SelectOption<string>[], searchValue: string) => SelectOption<string>[]) | undefined;
|
|
45
53
|
onSearchChange?: (searchValue: string) => void;
|
|
46
54
|
onValueChange?: ((value: SelectValue<string>, selectedOptions: SelectOption<string>[]) => void) | undefined;
|
package/dist/super-kit.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),Oe=require("react-dom"),Ee="_badge_lyltm_1",We="_neutral_lyltm_18",Ae="_accent_lyltm_24",Fe="_outline_lyltm_29",ze="_success_lyltm_35",Xe="_warning_lyltm_40",qe="_danger_lyltm_45",Ge="_info_lyltm_50",Ve="_count_lyltm_55",Ue="_mono_lyltm_63",He="_version_lyltm_71",Ke="_dismiss_lyltm_80",Ye="_dismissBtn_lyltm_84",Ze="_dot_lyltm_98",Je="_dotIndicator_lyltm_111",Qe="_pill_lyltm_119",W={badge:Ee,neutral:We,accent:Ae,outline:Fe,success:ze,warning:Xe,danger:qe,info:Ge,count:Ve,mono:Ue,version:He,dismiss:Ke,dismissBtn:Ye,dot:Ze,dotIndicator:Je,pill:Qe},Pe=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function re({variant:n="neutral",icon:o,pill:t=!1,dismissable:s=!1,onDismiss:a,dotColor:l,children:c,className:r,...i}){if(n==="dot"){const x=[W.badge,W.dot,r].filter(Boolean).join(" ");return e.jsxs("span",{...i,className:x,children:[e.jsx("span",{className:W.dotIndicator,style:{background:l??"var(--accent)"}}),c]})}const h=[W.badge,W[n],t?W.pill:null,s?W.dismiss:null,r].filter(Boolean).join(" ");return e.jsxs("span",{...i,className:h,children:[o||null,c,s&&e.jsx("button",{type:"button",className:W.dismissBtn,"aria-label":"Remove",onClick:a,children:e.jsx(Pe,{})})]})}re.displayName="Badge";function de({direction:n="vertical",track:o=!1,arrows:t=!1,autoHide:s=!1,expand:a=!1,scrollbarSize:l,height:c,children:r,className:i,style:h,...x}){const m=["sb",o?"sb-track":null,t?"sb-arrows":null,s?"sb-auto-hide":null,a?"sb-expand":null,i].filter(Boolean).join(" "),g=n==="vertical"?{overflowY:"auto",overflowX:"hidden"}:n==="horizontal"?{overflowX:"auto",overflowY:"hidden"}:{overflow:"auto"},p=l!==void 0?{"--sb-w":`${l}px`}:void 0;return e.jsx("div",{...x,className:m,style:{height:c,...g,...p,...h},children:r})}de.displayName="Scrollable";const et="_btn_8cdvn_1",tt="_icon_8cdvn_34",st="_primary_8cdvn_43",nt="_secondary_8cdvn_51",ot="_ghost_8cdvn_61",lt="_danger_8cdvn_71",at="_success_8cdvn_79",ct="_warning_8cdvn_87",it="_sm_8cdvn_96",rt="_md_8cdvn_104",dt="_lg_8cdvn_106",Q={btn:et,icon:tt,primary:st,secondary:nt,ghost:ot,danger:lt,success:at,warning:ct,sm:it,md:rt,lg:dt},_e=u.forwardRef(({type:n="button",variant:o="secondary",size:t="md",icon:s,loading:a=!1,children:l,className:c,disabled:r,...i},h)=>{const x=[Q.btn,Q[o],Q[t],c].filter(Boolean).join(" ");return e.jsxs("button",{ref:h,type:n,disabled:r||a,className:x,...i,children:[s?e.jsx("span",{className:Q.icon,children:s}):null,l]})});_e.displayName="Button";const _t="_card_1gxgi_1",ut="_bordered_1gxgi_8",ht="_tilt_1gxgi_12",xt="_closeBtn_1gxgi_20",pt="_padSm_1gxgi_41",mt="_padMd_1gxgi_42",jt="_padLg_1gxgi_43",ft="_padNone_1gxgi_44",gt="_header_1gxgi_47",vt="_headerIcon_1gxgi_54",bt="_title_1gxgi_63",kt="_subtitle_1gxgi_69",Nt="_stat_1gxgi_76",yt="_statValue_1gxgi_83",wt="_statUnit_1gxgi_91",Bt="_statDelta_1gxgi_97",Ct="_deltaPositive_1gxgi_102",It="_deltaNegative_1gxgi_103",$t="_deltaNeutral_1gxgi_104",f={card:_t,bordered:ut,tilt:ht,closeBtn:xt,padSm:pt,padMd:mt,padLg:jt,padNone:ft,header:gt,headerIcon:vt,title:bt,subtitle:kt,stat:Nt,statValue:yt,statUnit:wt,statDelta:Bt,deltaPositive:Ct,deltaNegative:It,deltaNeutral:$t},Mt={none:f.padNone,sm:f.padSm,md:f.padMd,lg:f.padLg},St=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function ue({padding:n="md",bordered:o=!1,tilt:t=!1,onClose:s,closeBtnProps:a,children:l,className:c,...r}){const i=[f.card,Mt[n],o?f.bordered:null,t?f.tilt:null,c].filter(Boolean).join(" ");return e.jsxs("div",{...r,className:i,children:[s&&e.jsx("button",{type:"button","aria-label":"Close",...a,className:[f.closeBtn,a==null?void 0:a.className].filter(Boolean).join(" "),onClick:s,children:e.jsx(St,{})}),l]})}ue.displayName="Card";function he({icon:n,title:o,subtitle:t,className:s,...a}){return e.jsxs("div",{...a,className:[f.header,s].filter(Boolean).join(" "),children:[n&&e.jsx("span",{className:f.headerIcon,children:n}),e.jsxs("div",{children:[e.jsx("div",{className:f.title,children:o}),t&&e.jsx("div",{className:f.subtitle,children:t})]})]})}he.displayName="CardHeader";function xe({value:n,unit:o,delta:t,deltaDirection:s="positive",className:a,...l}){const c=[f.statDelta,s==="positive"?f.deltaPositive:s==="negative"?f.deltaNegative:f.deltaNeutral].filter(Boolean).join(" ");return e.jsxs("div",{...l,className:[f.stat,a].filter(Boolean).join(" "),children:[e.jsxs("span",{className:f.statValue,children:[n,o&&e.jsxs("span",{className:f.statUnit,children:[" ",o]})]}),t&&e.jsx("span",{className:c,children:t})]})}xe.displayName="CardStat";function P(n,o,t){const[s,a]=u.useState(o),l=n!==void 0,c=l?n:s,r=u.useCallback(i=>{l||a(i),t==null||t(i)},[l,t]);return[c,r,l]}const Lt="X",Rt=/[a-zA-Z0-9]/;function se(n,o={}){const t=o.allowedPattern??Rt;return n.split("").filter(s=>t.test(s)).join("")}function pe(n,o,t={}){const s=t.placeholder??Lt,a=se(n,t);let l=0,c="";for(const r of o){if(l>=a.length)break;if(r===s){c+=a[l],l+=1;continue}c+=r}return c}const Tt="_wrapper_25x8h_1",Dt="_field_25x8h_7",Ot="_label_25x8h_13",Et="_input_25x8h_22",Wt="_hasIcon_25x8h_52",At="_hasIconRight_25x8h_55",Ft="_hasClear_25x8h_58",zt="_hasClearAndIconRight_25x8h_61",Xt="_iconSlot_25x8h_64",qt="_iconSlotRight_25x8h_78",Gt="_iconSlotRightWithClear_25x8h_92",Vt="_clearBtn_25x8h_95",M={wrapper:Tt,field:Dt,label:Ot,input:Et,hasIcon:Wt,hasIconRight:At,hasClear:Ft,hasClearAndIconRight:zt,iconSlot:Xt,iconSlotRight:qt,iconSlotRightWithClear:Gt,clearBtn:Vt},Ut=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),me=u.forwardRef(({label:n,icon:o,iconPosition:t="left",clearable:s=!1,clearButtonProps:a,clearLabel:l,defaultValue:c="",disabled:r,mask:i,maskAllowedPattern:h,maskPlaceholder:x,selectOnFocus:m=!1,textAlign:g,onChange:p,onValueChange:v,value:R,wrapperProps:C,fieldProps:k,className:I,...w},b)=>{const N=u.useRef(null),[T,K]=P(R,c,j=>{v==null||v({value:j,rawValue:i?se(j,{allowedPattern:h}):j})});u.useImperativeHandle(b,()=>N.current);const q=u.useCallback(j=>i?pe(j,i,{allowedPattern:h,placeholder:x}):j,[i,h,x]),F=j=>{const z=q(j.target.value);j.target.value=z,K(z),p==null||p(j)},U=()=>{var j;K(""),(j=N.current)==null||j.focus()},y=o&&t==="right",D=o&&t==="left",Y=[M.input,D?M.hasIcon:null,y?M.hasIconRight:null,s&&y?M.hasClearAndIconRight:s?M.hasClear:null,I].filter(Boolean).join(" "),H=j=>{var z;m&&j.target.select(),(z=w.onFocus)==null||z.call(w,j)},ee=e.jsx("input",{ref:N,disabled:r,value:q(T),onChange:F,onFocus:H,className:Y,style:g?{textAlign:g,...w.style}:w.style,...w}),Z=[M.wrapper,C==null?void 0:C.className].filter(Boolean).join(" "),J=e.jsxs("span",{...C,className:Z,children:[D?e.jsx("span",{className:M.iconSlot,children:o}):null,ee,y?e.jsx("span",{className:[M.iconSlotRight,s?M.iconSlotRightWithClear:null].filter(Boolean).join(" "),children:o}):null,s?e.jsx("button",{type:"button","aria-label":"Clear",title:"Clear",disabled:r||T.length===0,onClick:U,className:M.clearBtn,...a,children:(a==null?void 0:a.children)??e.jsx(Ut,{})}):null]});return!n&&!k?J:e.jsxs("div",{...k,className:[M.field,k==null?void 0:k.className].filter(Boolean).join(" "),children:[n?e.jsx("label",{className:M.label,children:n}):null,J]})});me.displayName="Input";const Ht="_checkbox_7kjwa_2",Kt="_checkboxBox_7kjwa_13",Yt="_checked_7kjwa_33",Zt="_indeterminate_7kjwa_42",Jt="_disabled_7kjwa_55",Qt="_radio_7kjwa_61",Pt="_radioDot_7kjwa_72",es="_radioChecked_7kjwa_85",ts="_radioDisabled_7kjwa_97",ss="_radioGroup_7kjwa_102",ns="_switchWrap_7kjwa_109",os="_switchTrack_7kjwa_120",ls="_switchOn_7kjwa_143",as="_switchDisabled_7kjwa_153",B={checkbox:Ht,checkboxBox:Kt,checked:Yt,indeterminate:Zt,disabled:Jt,radio:Qt,radioDot:Pt,radioChecked:es,radioDisabled:ts,radioGroup:ss,switchWrap:ns,switchTrack:os,switchOn:ls,switchDisabled:as},cs=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})});function je({label:n,checked:o,defaultChecked:t,indeterminate:s=!1,disabled:a=!1,onChange:l,className:c,...r}){const i=o??t??!1,h=[B.checkbox,i&&!s?B.checked:null,s?B.indeterminate:null,a?B.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("label",{className:h,children:[e.jsx("input",{...r,type:"checkbox",checked:i,disabled:a,style:{display:"none"},onChange:x=>l==null?void 0:l(x.currentTarget.checked)}),e.jsx("span",{className:B.checkboxBox,children:!s&&e.jsx(cs,{})}),n]})}je.displayName="Checkbox";function fe({label:n,checked:o=!1,disabled:t=!1,onChange:s,value:a,className:l,...c}){const r=[B.radio,o?B.radioChecked:null,t?B.radioDisabled:null,l].filter(Boolean).join(" ");return e.jsxs("label",{className:r,children:[e.jsx("input",{...c,type:"radio",checked:o,disabled:t,value:a,style:{display:"none"},onChange:i=>s==null?void 0:s(i.currentTarget.value)}),e.jsx("span",{className:B.radioDot}),n]})}fe.displayName="Radio";function ge({children:n,className:o,...t}){const s=[B.radioGroup,o].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"radiogroup",children:n})}ge.displayName="RadioGroup";function ve({label:n,checked:o,defaultChecked:t,disabled:s=!1,onChange:a,className:l,...c}){const r=o??t??!1,i=[B.switchWrap,r?B.switchOn:null,s?B.switchDisabled:null,l].filter(Boolean).join(" ");return e.jsxs("label",{className:i,children:[e.jsx("input",{...c,type:"checkbox",checked:r,disabled:s,style:{display:"none"},onChange:h=>a==null?void 0:a(h.currentTarget.checked)}),e.jsx("span",{className:B.switchTrack}),n]})}ve.displayName="Switch";const is="_menu_pga52_1",rs="_item_pga52_13",ds="_active_pga52_41",_s="_danger_pga52_53",us="_disabled_pga52_65",hs="_kbd_pga52_71",xs="_separator_pga52_79",X={menu:is,item:rs,active:ds,danger:_s,disabled:us,kbd:hs,separator:xs};function be({children:n,className:o,...t}){const s=[X.menu,o].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"menu",children:n})}be.displayName="Menu";function ke({icon:n,kbd:o,active:t=!1,danger:s=!1,disabled:a=!1,children:l,className:c,...r}){const i=[X.item,t?X.active:null,s?X.danger:null,a?X.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("button",{...r,type:"button",className:i,disabled:a,role:"menuitem",children:[n,l,o&&e.jsx("span",{className:X.kbd,children:o})]})}ke.displayName="MenuItem";function Ne({className:n,...o}){const t=[X.separator,n].filter(Boolean).join(" ");return e.jsx("div",{...o,className:t,role:"separator"})}Ne.displayName="MenuSeparator";const ps="_backdrop_pya14_1",ms="_modal_pya14_23",js="_header_pya14_37",fs="_titleBlock_pya14_45",gs="_title_pya14_45",vs="_subtitle_pya14_58",bs="_closeBtn_pya14_64",ks="_body_pya14_86",Ns="_footer_pya14_92",O={backdrop:ps,modal:ms,header:js,titleBlock:fs,title:gs,subtitle:vs,closeBtn:bs,body:ks,footer:Ns},ys=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"11",height:"11",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),ye=u.forwardRef(({open:n,title:o,subtitle:t,children:s,footer:a,closeOnBackdrop:l=!0,showCloseButton:c=!0,backdropProps:r,modalProps:i,headerProps:h,bodyProps:x,footerProps:m,closeButtonProps:g,onOpenChange:p,onClose:v},R)=>{const C=u.useRef(null);u.useImperativeHandle(R,()=>C.current),u.useEffect(()=>{if(!n)return;const N=T=>{T.key==="Escape"&&k()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[n]);const k=()=>{p==null||p(!1),v==null||v()},I=N=>{l&&N.target===N.currentTarget&&k()};if(!n)return null;const w=[O.backdrop,r==null?void 0:r.className].filter(Boolean).join(" "),b=[O.modal,i==null?void 0:i.className].filter(Boolean).join(" ");return e.jsx("div",{...r,className:w,onClick:I,role:"presentation",children:e.jsxs("div",{ref:C,...i,className:b,role:"dialog","aria-modal":"true",children:[(o||c)&&e.jsxs("header",{...h,className:[O.header,h==null?void 0:h.className].filter(Boolean).join(" "),children:[e.jsxs("div",{className:O.titleBlock,children:[o?e.jsx("div",{className:O.title,children:o}):null,t?e.jsx("div",{className:O.subtitle,children:t}):null]}),c&&e.jsx("button",{type:"button","aria-label":"Close",className:O.closeBtn,onClick:k,...g,children:(g==null?void 0:g.children)??e.jsx(ys,{})})]}),e.jsx("section",{...x,className:[O.body,x==null?void 0:x.className].filter(Boolean).join(" "),children:s}),a&&e.jsx("footer",{...m,className:[O.footer,m==null?void 0:m.className].filter(Boolean).join(" "),children:a})]})})});ye.displayName="Modal";const ws="_wrapper_10d4l_1",Bs="_pop_10d4l_8",Cs="_sideRight_10d4l_22",Is="_sideTop_10d4l_27",$s="_arrow_10d4l_34",Ms="_head_10d4l_60",Ss="_title_10d4l_67",Ls="_closeBtn_10d4l_74",Rs="_body_10d4l_105",E={wrapper:ws,pop:Bs,sideRight:Cs,sideTop:Is,arrow:$s,head:Ms,title:Ss,closeBtn:Ls,body:Rs},Ts=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]});function we({open:n,defaultOpen:o=!1,title:t,children:s,trigger:a,side:l="bottom-start",showCloseButton:c=!0,onOpenChange:r,popProps:i}){const[h,x]=u.useState(o),m=n!==void 0,g=m?n:h,p=u.useRef(null);function v(I){m||x(I),r==null||r(I)}u.useEffect(()=>{function I(w){p.current&&!p.current.contains(w.target)&&v(!1)}return g&&document.addEventListener("mousedown",I),()=>document.removeEventListener("mousedown",I)},[g]);const R=l.startsWith("top"),C=l.endsWith("end"),k=[E.pop,C?E.sideRight:null,R?E.sideTop:null,i==null?void 0:i.className].filter(Boolean).join(" ");return e.jsxs("div",{ref:p,className:E.wrapper,children:[a&&e.jsx("div",{onClick:()=>v(!g),style:{display:"inline-flex"},children:a}),g&&e.jsxs("div",{...i,className:k,children:[e.jsx("span",{className:E.arrow}),(t||c)&&e.jsxs("div",{className:E.head,children:[t&&e.jsx("span",{className:E.title,children:t}),c&&e.jsx("button",{type:"button",className:E.closeBtn,"aria-label":"Close",onClick:()=>v(!1),children:e.jsx(Ts,{})})]}),e.jsx("div",{className:E.body,children:s})]})]})}we.displayName="Popover";const Ds="_group_1ehqf_1",Os="_pb_1ehqf_9",Es="_on_1ehqf_37",Ws="_accent_1ehqf_42",As="_solo_1ehqf_47",Fs="_disabled_1ehqf_62",V={group:Ds,pb:Os,on:Es,accent:Ws,solo:As,disabled:Fs};function Be({children:n,className:o,...t}){const s=[V.group,o].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"group",children:n})}Be.displayName="PushButtonGroup";function Ce({on:n=!1,accent:o=!1,solo:t=!1,icon:s,children:a,disabled:l=!1,className:c,...r}){const i=[V.pb,n?V.on:null,n&&o?V.accent:null,t?V.solo:null,l?V.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("button",{...r,type:"button",className:i,disabled:l,children:[s,a]})}Ce.displayName="PushButton";const zs="_root_11gjp_1",Xs="_field_11gjp_6",qs="_label_11gjp_12",Gs="_labelMeta_11gjp_24",Vs="_trigger_11gjp_33",Us="_triggerOpen_11gjp_59",Hs="_triggerConnectedBottom_11gjp_64",Ks="_triggerConnectedTop_11gjp_69",Ys="_triggerValue_11gjp_74",Zs="_triggerPlaceholder_11gjp_83",Js="_chevron_11gjp_85",Qs="_chevronOpen_11gjp_94",Ps="_chips_11gjp_97",en="_chip_11gjp_97",tn="_chipOverflow_11gjp_120",sn="_clearBtn_11gjp_123",nn="_popover_11gjp_143",on="_popoverBottom_11gjp_154",ln="_popoverTop_11gjp_162",an="_search_11gjp_181",cn="_searchIcon_11gjp_188",rn="_searchInput_11gjp_195",dn="_list_11gjp_209",_n="_item_11gjp_217",un="_itemActive_11gjp_230",hn="_itemDisabled_11gjp_238",xn="_itemMeta_11gjp_240",pn="_checkbox_11gjp_248",mn="_checkboxChecked_11gjp_260",jn="_checkIcon_11gjp_266",fn="_emptyState_11gjp_277",gn="_popFooter_11gjp_285",vn="_popFooterBtn_11gjp_295",_={root:zs,field:Xs,label:qs,labelMeta:Gs,trigger:Vs,triggerOpen:Us,triggerConnectedBottom:Hs,triggerConnectedTop:Ks,triggerValue:Ys,triggerPlaceholder:Zs,chevron:Js,chevronOpen:Qs,chips:Ps,chip:en,chipOverflow:tn,clearBtn:sn,popover:nn,popoverBottom:on,popoverTop:ln,search:an,searchIcon:cn,searchInput:rn,list:dn,item:_n,itemActive:un,itemDisabled:hn,itemMeta:xn,checkbox:pn,checkboxChecked:mn,checkIcon:jn,emptyState:fn,popFooter:gn,popFooterBtn:vn},bn=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"14",height:"14",children:e.jsx("path",{d:"m6 9 6 6 6-6"})}),ce=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),kn=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"m20 20-3.5-3.5"})]}),ie=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),Nn=(n,o)=>{const t=o.trim().toLowerCase();return t?n.filter(s=>String(s.label).toLowerCase().includes(t)):n},Ie=u.forwardRef(({label:n,clearable:o=!1,defaultValue:t=null,disabled:s=!1,emptyLabel:a="No options found",filterOptions:l=Nn,isLoading:c=!1,loadingLabel:r="Loading...",multiple:i=!1,onSearchChange:h,onValueChange:x,options:m,optionsPosition:g="bottom",placeholder:p="Select",searchable:v=!1,searchPlaceholder:R="Search...",value:C,className:k,...I},w)=>{const[b,N]=u.useState(!1),[T,K]=u.useState(""),q=u.useRef(null),[F,U]=P(C,t,d=>{const $=m.filter(G=>Array.isArray(d)?d.includes(G.value):G.value===d);x==null||x(d,$)}),y=u.useMemo(()=>Array.isArray(F)?F:F?[F]:[],[F]),D=u.useMemo(()=>m.filter(d=>y.includes(d.value)),[m,y]),Y=u.useMemo(()=>l(m,T),[l,m,T]);u.useEffect(()=>{if(!b)return;const d=$=>{q.current&&!q.current.contains($.target)&&N(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[b]);const H=d=>{K(d),h==null||h(d)},ee=d=>{if(!d.disabled){if(i){const $=y.includes(d.value)?y.filter(G=>G!==d.value):[...y,d.value];U($);return}U(d.value),N(!1)}},Z=()=>{U(i?[]:null),H("")},J=d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),N($=>!$)),d.key==="Escape"&&N(!1)},j=g==="top",z=[_.trigger,b?_.triggerOpen:null,b?j?_.triggerConnectedTop:_.triggerConnectedBottom:null].filter(Boolean).join(" "),Te=i&&D.length>0,oe=2,le=D.length-oe,De=[_.root,k].filter(Boolean).join(" "),ae=e.jsxs("div",{ref:q,...I,className:De,children:[e.jsxs("button",{type:"button",className:z,disabled:s,"aria-haspopup":"listbox","aria-expanded":b,onClick:()=>!s&&N(d=>!d),onKeyDown:J,children:[Te?e.jsxs("div",{className:_.chips,children:[D.slice(0,oe).map(d=>e.jsx("span",{className:_.chip,children:d.label},d.value)),le>0&&e.jsxs("span",{className:[_.chip,_.chipOverflow].join(" "),children:["+",le]})]}):e.jsx("span",{className:[_.triggerValue,D.length===0?_.triggerPlaceholder:null].filter(Boolean).join(" "),children:D.length>0?D.map(d=>d.label).join(", "):p}),o&&y.length>0&&e.jsx("button",{type:"button","aria-label":"Clear",className:_.clearBtn,disabled:s,onClick:d=>{d.stopPropagation(),Z()},children:e.jsx(ce,{})}),e.jsx("span",{className:[_.chevron,b?_.chevronOpen:null].filter(Boolean).join(" "),children:e.jsx(bn,{})})]}),b&&e.jsxs("div",{className:[_.popover,j?_.popoverTop:_.popoverBottom].join(" "),role:"listbox","aria-multiselectable":i||void 0,children:[v&&e.jsxs("div",{className:_.search,children:[e.jsx("span",{className:_.searchIcon,children:e.jsx(kn,{})}),e.jsx("input",{autoFocus:!0,value:T,placeholder:R,className:_.searchInput,onChange:d=>H(d.target.value)}),T&&e.jsx("button",{className:_.clearBtn,onClick:()=>H(""),children:e.jsx(ce,{})})]}),e.jsxs("ul",{className:_.list,children:[c&&e.jsx("li",{className:_.emptyState,children:r}),!c&&Y.length===0&&e.jsx("li",{className:_.emptyState,children:a}),!c&&Y.map(d=>{const $=y.includes(d.value),G=[_.item,$?_.itemActive:null,d.disabled?_.itemDisabled:null].filter(Boolean).join(" ");return e.jsxs("li",{className:G,role:"option","aria-selected":$,onClick:()=>ee(d),children:[i?e.jsx("span",{className:[_.checkbox,$?_.checkboxChecked:null].filter(Boolean).join(" "),children:$&&e.jsx(ie,{})}):null,e.jsx("span",{children:d.label}),d.meta&&e.jsx("span",{className:_.itemMeta,children:d.meta}),!i&&$&&e.jsx("span",{className:_.checkIcon,children:e.jsx(ie,{})})]},d.value)})]}),i&&y.length>0&&e.jsxs("div",{className:_.popFooter,children:[e.jsxs("span",{children:[y.length," selected"]}),e.jsx("button",{className:_.popFooterBtn,onClick:Z,children:"Clear all"})]})]})]});return n?e.jsxs("div",{className:_.field,children:[e.jsxs("label",{className:_.label,children:[n,i&&y.length>0&&e.jsxs("span",{className:_.labelMeta,children:["· ",y.length," selected"]})]}),ae]}):ae});Ie.displayName="Select";const yn="_ring_mxe7t_2",wn="_spin_mxe7t_1",Bn="_ringMuted_mxe7t_12",Cn="_sm_mxe7t_14",In="_md_mxe7t_15",$n="_lg_mxe7t_16",Mn="_onAccent_mxe7t_19",Sn="_dots_mxe7t_29",Ln="_dot_mxe7t_29",Rn="_dotPulse_mxe7t_1",Tn="_bar_mxe7t_52",Dn="_barFill_mxe7t_62",On="_barSlide_mxe7t_1",L={ring:yn,spin:wn,ringMuted:Bn,sm:Cn,md:In,lg:$n,onAccent:Mn,dots:Sn,dot:Ln,dotPulse:Rn,bar:Tn,barFill:Dn,barSlide:On};function $e({variant:n="ring",size:o="md",muted:t=!1,onAccent:s=!1,className:a,...l}){if(n==="dots"){const r=[L.dots,a].filter(Boolean).join(" ");return e.jsxs("span",{...l,className:r,role:"status","aria-label":"Loading",children:[e.jsx("span",{className:L.dot}),e.jsx("span",{className:L.dot}),e.jsx("span",{className:L.dot})]})}if(n==="bar"){const r=[L.bar,a].filter(Boolean).join(" ");return e.jsx("span",{...l,className:r,role:"status","aria-label":"Loading",children:e.jsx("span",{className:L.barFill})})}const c=[L.ring,L[o],t?L.ringMuted:null,s?L.onAccent:null,a].filter(Boolean).join(" ");return e.jsx("span",{...l,className:c,role:"status","aria-label":"Loading"})}$e.displayName="Spinner";const En="_field_fazrx_1",Wn="_label_fazrx_7",An="_wrapper_fazrx_16",Fn="_textarea_fazrx_20",zn="_mono_fazrx_53",Xn="_hasClear_fazrx_59",qn="_clearBtn_fazrx_62",Gn="_footer_fazrx_84",Vn="_helpText_fazrx_92",Un="_charCount_fazrx_94",Hn="_charCountOver_fazrx_100",S={field:En,label:Wn,wrapper:An,textarea:Fn,mono:zn,hasClear:Xn,clearBtn:qn,footer:Gn,helpText:Vn,charCount:Un,charCountOver:Hn},Kn=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),Me=u.forwardRef(({label:n,helpText:o,maxLength:t,clearable:s=!1,mono:a=!1,value:l,defaultValue:c="",disabled:r,onChange:i,onValueChange:h,className:x,...m},g)=>{const[p,v]=P(l,c,b=>h==null?void 0:h(b)),R=b=>{v(b.target.value),i==null||i(b)},C=()=>{v("")},k=t!==void 0&&p.length>t,I=[S.textarea,"sb",a?S.mono:null,s?S.hasClear:null,x].filter(Boolean).join(" "),w=e.jsxs("div",{className:S.wrapper,children:[e.jsx("textarea",{ref:g,disabled:r,maxLength:t,value:p,onChange:R,className:I,...m}),s&&e.jsx("button",{type:"button",className:S.clearBtn,disabled:r||p.length===0,"aria-label":"Clear",onClick:C,children:e.jsx(Kn,{})})]});return!n&&!o&&t===void 0?w:e.jsxs("div",{className:S.field,children:[n&&e.jsx("label",{className:S.label,children:n}),w,(o||t!==void 0)&&e.jsxs("div",{className:S.footer,children:[o&&e.jsx("span",{className:S.helpText,children:o}),t!==void 0&&e.jsxs("span",{className:[S.charCount,k?S.charCountOver:null].filter(Boolean).join(" "),children:[p.length," / ",t]})]})]})});Me.displayName="Textarea";const Yn="_toast_d6t69_1",Zn="_slideUp_d6t69_1",Jn="_toastExiting_d6t69_26",Qn="_slideOut_d6t69_1",Pn="_lead_d6t69_30",eo="_body_d6t69_37",to="_title_d6t69_45",so="_message_d6t69_51",no="_closeBtn_d6t69_56",oo="_ok_d6t69_79",lo="_error_d6t69_82",ao="_warning_d6t69_85",co="_info_d6t69_88",io="_stack_d6t69_92",A={toast:Yn,slideUp:Zn,toastExiting:Jn,slideOut:Qn,lead:Pn,body:eo,title:to,message:so,closeBtn:no,ok:oo,error:lo,warning:ao,info:co,stack:io},ro=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),Se=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"11",height:"11",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),_o=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[e.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),uo=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),ho={ok:e.jsx(ro,{}),error:e.jsx(Se,{}),warning:e.jsx(_o,{}),info:e.jsx(uo,{})};function ne({variant:n="ok",title:o,message:t,onDismiss:s,className:a,...l}){const c=[A.toast,A[n],a].filter(Boolean).join(" ");return e.jsxs("div",{...l,className:c,role:"alert",children:[e.jsx("span",{className:A.lead,children:ho[n]}),e.jsxs("div",{className:A.body,children:[e.jsx("div",{className:A.title,children:o}),t&&e.jsx("div",{className:A.message,children:t})]}),s&&e.jsx("button",{type:"button",className:A.closeBtn,"aria-label":"Dismiss",onClick:s,children:e.jsx(Se,{})})]})}ne.displayName="Toast";const Le=u.createContext(null);function xo({children:n}){const[o,t]=u.useState([]),s=u.useCallback(l=>{t(c=>c.filter(r=>r.id!==l))},[]),a=u.useCallback(l=>{const c=Math.random().toString(36).slice(2),r=l.duration??4e3;return t(i=>[...i,{...l,id:c}]),r>0&&setTimeout(()=>s(c),r),c},[s]);return e.jsxs(Le.Provider,{value:{toast:a,dismiss:s},children:[n,typeof document<"u"&&Oe.createPortal(e.jsx("div",{className:A.stack,children:o.map(l=>e.jsx(ne,{variant:l.variant,title:l.title,message:l.message,onDismiss:()=>s(l.id)},l.id))}),document.body)]})}function po(){const n=u.useContext(Le);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}const mo="_wrapper_18lxw_1",jo="_tooltip_18lxw_6",fo="_fadeIn_18lxw_1",go="_top_18lxw_33",vo="_bottom_18lxw_52",bo="_kbd_18lxw_72",te={wrapper:mo,tooltip:jo,fadeIn:fo,top:go,bottom:vo,kbd:bo};function Re({content:n,side:o="top",children:t,wrapperProps:s,disabled:a=!1}){const[l,c]=u.useState(!1);if(a)return e.jsx(e.Fragment,{children:t});const r=[te.tooltip,te[o]].filter(Boolean).join(" "),i=[te.wrapper,s==null?void 0:s.className].filter(Boolean).join(" ");return e.jsxs("span",{...s,className:i,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),children:[t,l&&e.jsx("span",{className:r,role:"tooltip",children:n})]})}Re.displayName="Tooltip";exports.Badge=re;exports.Button=_e;exports.Card=ue;exports.CardHeader=he;exports.CardStat=xe;exports.Checkbox=je;exports.Input=me;exports.Menu=be;exports.MenuItem=ke;exports.MenuSeparator=Ne;exports.Modal=ye;exports.Popover=we;exports.PushButton=Ce;exports.PushButtonGroup=Be;exports.Radio=fe;exports.RadioGroup=ge;exports.Scrollable=de;exports.Select=Ie;exports.Spinner=$e;exports.Switch=ve;exports.Textarea=Me;exports.Toast=ne;exports.ToastProvider=xo;exports.Tooltip=Re;exports.applyMask=pe;exports.getRawMaskValue=se;exports.useControlledState=P;exports.useToast=po;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),u=require("react"),qe=require("react-dom"),Ge="_badge_lyltm_1",Ue="_neutral_lyltm_18",He="_accent_lyltm_24",Ke="_outline_lyltm_29",Ye="_success_lyltm_35",Ze="_warning_lyltm_40",Je="_danger_lyltm_45",Qe="_info_lyltm_50",Pe="_count_lyltm_55",et="_mono_lyltm_63",tt="_version_lyltm_71",st="_dismiss_lyltm_80",nt="_dismissBtn_lyltm_84",ot="_dot_lyltm_98",lt="_dotIndicator_lyltm_111",at="_pill_lyltm_119",W={badge:Ge,neutral:Ue,accent:He,outline:Ke,success:Ye,warning:Ze,danger:Je,info:Qe,count:Pe,mono:et,version:tt,dismiss:st,dismissBtn:nt,dot:ot,dotIndicator:lt,pill:at},ct=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function he({variant:n="neutral",icon:o,pill:t=!1,dismissable:s=!1,onDismiss:a,dotColor:l,children:c,className:r,...i}){if(n==="dot"){const f=[W.badge,W.dot,r].filter(Boolean).join(" ");return e.jsxs("span",{...i,className:f,children:[e.jsx("span",{className:W.dotIndicator,style:{background:l??"var(--accent)"}}),c]})}const h=[W.badge,W[n],t?W.pill:null,s?W.dismiss:null,r].filter(Boolean).join(" ");return e.jsxs("span",{...i,className:h,children:[o||null,c,s&&e.jsx("button",{type:"button",className:W.dismissBtn,"aria-label":"Remove",onClick:a,children:e.jsx(ct,{})})]})}he.displayName="Badge";function fe({direction:n="vertical",track:o=!1,arrows:t=!1,autoHide:s=!1,expand:a=!1,scrollbarSize:l,height:c,children:r,className:i,style:h,...f}){const j=["sb",o?"sb-track":null,t?"sb-arrows":null,s?"sb-auto-hide":null,a?"sb-expand":null,i].filter(Boolean).join(" "),g=n==="vertical"?{overflowY:"auto",overflowX:"hidden"}:n==="horizontal"?{overflowX:"auto",overflowY:"hidden"}:{overflow:"auto"},x=l!==void 0?{"--sb-w":`${l}px`}:void 0;return e.jsx("div",{...f,className:j,style:{height:c,...g,...x,...h},children:r})}fe.displayName="Scrollable";const it="_btn_8cdvn_1",rt="_icon_8cdvn_34",dt="_primary_8cdvn_43",_t="_secondary_8cdvn_51",ut="_ghost_8cdvn_61",ht="_danger_8cdvn_71",ft="_success_8cdvn_79",xt="_warning_8cdvn_87",mt="_sm_8cdvn_96",jt="_md_8cdvn_104",pt="_lg_8cdvn_106",Q={btn:it,icon:rt,primary:dt,secondary:_t,ghost:ut,danger:ht,success:ft,warning:xt,sm:mt,md:jt,lg:pt},xe=u.forwardRef(({type:n="button",variant:o="secondary",size:t="md",icon:s,loading:a=!1,children:l,className:c,disabled:r,...i},h)=>{const f=[Q.btn,Q[o],Q[t],c].filter(Boolean).join(" ");return e.jsxs("button",{ref:h,type:n,disabled:r||a,className:f,...i,children:[s?e.jsx("span",{className:Q.icon,children:s}):null,l]})});xe.displayName="Button";const gt="_card_1gxgi_1",vt="_bordered_1gxgi_8",bt="_tilt_1gxgi_12",kt="_closeBtn_1gxgi_20",Nt="_padSm_1gxgi_41",yt="_padMd_1gxgi_42",wt="_padLg_1gxgi_43",Bt="_padNone_1gxgi_44",Ct="_header_1gxgi_47",It="_headerIcon_1gxgi_54",$t="_title_1gxgi_63",Mt="_subtitle_1gxgi_69",St="_stat_1gxgi_76",Lt="_statValue_1gxgi_83",Tt="_statUnit_1gxgi_91",Rt="_statDelta_1gxgi_97",Dt="_deltaPositive_1gxgi_102",Ot="_deltaNegative_1gxgi_103",Et="_deltaNeutral_1gxgi_104",p={card:gt,bordered:vt,tilt:bt,closeBtn:kt,padSm:Nt,padMd:yt,padLg:wt,padNone:Bt,header:Ct,headerIcon:It,title:$t,subtitle:Mt,stat:St,statValue:Lt,statUnit:Tt,statDelta:Rt,deltaPositive:Dt,deltaNegative:Ot,deltaNeutral:Et},Wt={none:p.padNone,sm:p.padSm,md:p.padMd,lg:p.padLg},At=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})});function me({padding:n="md",bordered:o=!1,tilt:t=!1,onClose:s,closeBtnProps:a,children:l,className:c,...r}){const i=[p.card,Wt[n],o?p.bordered:null,t?p.tilt:null,c].filter(Boolean).join(" ");return e.jsxs("div",{...r,className:i,children:[s&&e.jsx("button",{type:"button","aria-label":"Close",...a,className:[p.closeBtn,a==null?void 0:a.className].filter(Boolean).join(" "),onClick:s,children:e.jsx(At,{})}),l]})}me.displayName="Card";function je({icon:n,title:o,subtitle:t,className:s,...a}){return e.jsxs("div",{...a,className:[p.header,s].filter(Boolean).join(" "),children:[n&&e.jsx("span",{className:p.headerIcon,children:n}),e.jsxs("div",{children:[e.jsx("div",{className:p.title,children:o}),t&&e.jsx("div",{className:p.subtitle,children:t})]})]})}je.displayName="CardHeader";function pe({value:n,unit:o,delta:t,deltaDirection:s="positive",className:a,...l}){const c=[p.statDelta,s==="positive"?p.deltaPositive:s==="negative"?p.deltaNegative:p.deltaNeutral].filter(Boolean).join(" ");return e.jsxs("div",{...l,className:[p.stat,a].filter(Boolean).join(" "),children:[e.jsxs("span",{className:p.statValue,children:[n,o&&e.jsxs("span",{className:p.statUnit,children:[" ",o]})]}),t&&e.jsx("span",{className:c,children:t})]})}pe.displayName="CardStat";function P(n,o,t){const[s,a]=u.useState(o),l=n!==void 0,c=l?n:s,r=u.useCallback(i=>{l||a(i),t==null||t(i)},[l,t]);return[c,r,l]}const Ft="X",zt=/[a-zA-Z0-9]/;function se(n,o={}){const t=o.allowedPattern??zt;return n.split("").filter(s=>t.test(s)).join("")}function ge(n,o,t={}){const s=t.placeholder??Ft,a=se(n,t);let l=0,c="";for(const r of o){if(l>=a.length)break;if(r===s){c+=a[l],l+=1;continue}c+=r}return c}const Vt="_wrapper_25x8h_1",Xt="_field_25x8h_7",qt="_label_25x8h_13",Gt="_input_25x8h_22",Ut="_hasIcon_25x8h_52",Ht="_hasIconRight_25x8h_55",Kt="_hasClear_25x8h_58",Yt="_hasClearAndIconRight_25x8h_61",Zt="_iconSlot_25x8h_64",Jt="_iconSlotRight_25x8h_78",Qt="_iconSlotRightWithClear_25x8h_92",Pt="_clearBtn_25x8h_95",I={wrapper:Vt,field:Xt,label:qt,input:Gt,hasIcon:Ut,hasIconRight:Ht,hasClear:Kt,hasClearAndIconRight:Yt,iconSlot:Zt,iconSlotRight:Jt,iconSlotRightWithClear:Qt,clearBtn:Pt},es=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),ve=u.forwardRef(({label:n,icon:o,iconPosition:t="left",clearable:s=!1,clearButtonProps:a,clearLabel:l,defaultValue:c="",disabled:r,mask:i,maskAllowedPattern:h,maskPlaceholder:f,selectOnFocus:j=!1,textAlign:g,onChange:x,onValueChange:v,value:R,wrapperProps:N,fieldProps:b,className:y,...k},S)=>{const $=u.useRef(null),[q,ee]=P(R,c,m=>{v==null||v({value:m,rawValue:i?se(m,{allowedPattern:h}):m})});u.useImperativeHandle(S,()=>$.current);const L=u.useCallback(m=>i?ge(m,i,{allowedPattern:h,placeholder:f}):m,[i,h,f]),E=m=>{const V=L(m.target.value);m.target.value=V,ee(V),x==null||x(m)},G=()=>{var m;ee(""),(m=$.current)==null||m.focus()},Y=o&&t==="right",U=o&&t==="left",F=[I.input,U?I.hasIcon:null,Y?I.hasIconRight:null,s&&Y?I.hasClearAndIconRight:s?I.hasClear:null,y].filter(Boolean).join(" "),Z=m=>{var V;j&&m.target.select(),(V=k.onFocus)==null||V.call(k,m)},B=e.jsx("input",{ref:$,disabled:r,value:L(q),onChange:E,onFocus:Z,className:F,style:g?{textAlign:g,...k.style}:k.style,...k}),z=[I.wrapper,N==null?void 0:N.className].filter(Boolean).join(" "),J=e.jsxs("span",{...N,className:z,children:[U?e.jsx("span",{className:I.iconSlot,children:o}):null,B,Y?e.jsx("span",{className:[I.iconSlotRight,s?I.iconSlotRightWithClear:null].filter(Boolean).join(" "),children:o}):null,s?e.jsx("button",{type:"button","aria-label":"Clear",title:"Clear",disabled:r||q.length===0,onClick:G,className:I.clearBtn,...a,children:(a==null?void 0:a.children)??e.jsx(es,{})}):null]});return!n&&!b?J:e.jsxs("div",{...b,className:[I.field,b==null?void 0:b.className].filter(Boolean).join(" "),children:[n?e.jsx("label",{className:I.label,children:n}):null,J]})});ve.displayName="Input";const ts="_checkbox_7kjwa_2",ss="_checkboxBox_7kjwa_13",ns="_checked_7kjwa_33",os="_indeterminate_7kjwa_42",ls="_disabled_7kjwa_55",as="_radio_7kjwa_61",cs="_radioDot_7kjwa_72",is="_radioChecked_7kjwa_85",rs="_radioDisabled_7kjwa_97",ds="_radioGroup_7kjwa_102",_s="_switchWrap_7kjwa_109",us="_switchTrack_7kjwa_120",hs="_switchOn_7kjwa_143",fs="_switchDisabled_7kjwa_153",w={checkbox:ts,checkboxBox:ss,checked:ns,indeterminate:os,disabled:ls,radio:as,radioDot:cs,radioChecked:is,radioDisabled:rs,radioGroup:ds,switchWrap:_s,switchTrack:us,switchOn:hs,switchDisabled:fs},xs=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})});function be({label:n,checked:o,defaultChecked:t,indeterminate:s=!1,disabled:a=!1,onChange:l,className:c,...r}){const i=o??t??!1,h=[w.checkbox,i&&!s?w.checked:null,s?w.indeterminate:null,a?w.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("label",{className:h,children:[e.jsx("input",{...r,type:"checkbox",checked:i,disabled:a,style:{display:"none"},onChange:f=>l==null?void 0:l(f.currentTarget.checked)}),e.jsx("span",{className:w.checkboxBox,children:!s&&e.jsx(xs,{})}),n]})}be.displayName="Checkbox";function ke({label:n,checked:o=!1,disabled:t=!1,onChange:s,value:a,className:l,...c}){const r=[w.radio,o?w.radioChecked:null,t?w.radioDisabled:null,l].filter(Boolean).join(" ");return e.jsxs("label",{className:r,children:[e.jsx("input",{...c,type:"radio",checked:o,disabled:t,value:a,style:{display:"none"},onChange:i=>s==null?void 0:s(i.currentTarget.value)}),e.jsx("span",{className:w.radioDot}),n]})}ke.displayName="Radio";function Ne({children:n,className:o,...t}){const s=[w.radioGroup,o].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"radiogroup",children:n})}Ne.displayName="RadioGroup";function ye({label:n,checked:o,defaultChecked:t,disabled:s=!1,onChange:a,className:l,...c}){const r=o??t??!1,i=[w.switchWrap,r?w.switchOn:null,s?w.switchDisabled:null,l].filter(Boolean).join(" ");return e.jsxs("label",{className:i,children:[e.jsx("input",{...c,type:"checkbox",checked:r,disabled:s,style:{display:"none"},onChange:h=>a==null?void 0:a(h.currentTarget.checked)}),e.jsx("span",{className:w.switchTrack}),n]})}ye.displayName="Switch";const ms="_menu_pga52_1",js="_item_pga52_13",ps="_active_pga52_41",gs="_danger_pga52_53",vs="_disabled_pga52_65",bs="_kbd_pga52_71",ks="_separator_pga52_79",X={menu:ms,item:js,active:ps,danger:gs,disabled:vs,kbd:bs,separator:ks};function we({children:n,className:o,...t}){const s=[X.menu,o].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"menu",children:n})}we.displayName="Menu";function Be({icon:n,kbd:o,active:t=!1,danger:s=!1,disabled:a=!1,children:l,className:c,...r}){const i=[X.item,t?X.active:null,s?X.danger:null,a?X.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("button",{...r,type:"button",className:i,disabled:a,role:"menuitem",children:[n,l,o&&e.jsx("span",{className:X.kbd,children:o})]})}Be.displayName="MenuItem";function Ce({className:n,...o}){const t=[X.separator,n].filter(Boolean).join(" ");return e.jsx("div",{...o,className:t,role:"separator"})}Ce.displayName="MenuSeparator";const Ns="_backdrop_pya14_1",ys="_modal_pya14_23",ws="_header_pya14_37",Bs="_titleBlock_pya14_45",Cs="_title_pya14_45",Is="_subtitle_pya14_58",$s="_closeBtn_pya14_64",Ms="_body_pya14_86",Ss="_footer_pya14_92",D={backdrop:Ns,modal:ys,header:ws,titleBlock:Bs,title:Cs,subtitle:Is,closeBtn:$s,body:Ms,footer:Ss},Ls=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"11",height:"11",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),Ie=u.forwardRef(({open:n,title:o,subtitle:t,children:s,footer:a,closeOnBackdrop:l=!0,showCloseButton:c=!0,backdropProps:r,modalProps:i,headerProps:h,bodyProps:f,footerProps:j,closeButtonProps:g,onOpenChange:x,onClose:v},R)=>{const N=u.useRef(null);u.useImperativeHandle(R,()=>N.current),u.useEffect(()=>{if(!n)return;const $=q=>{q.key==="Escape"&&b()};return document.addEventListener("keydown",$),()=>document.removeEventListener("keydown",$)},[n]);const b=()=>{x==null||x(!1),v==null||v()},y=$=>{l&&$.target===$.currentTarget&&b()};if(!n)return null;const k=[D.backdrop,r==null?void 0:r.className].filter(Boolean).join(" "),S=[D.modal,i==null?void 0:i.className].filter(Boolean).join(" ");return e.jsx("div",{...r,className:k,onClick:y,role:"presentation",children:e.jsxs("div",{ref:N,...i,className:S,role:"dialog","aria-modal":"true",children:[(o||c)&&e.jsxs("header",{...h,className:[D.header,h==null?void 0:h.className].filter(Boolean).join(" "),children:[e.jsxs("div",{className:D.titleBlock,children:[o?e.jsx("div",{className:D.title,children:o}):null,t?e.jsx("div",{className:D.subtitle,children:t}):null]}),c&&e.jsx("button",{type:"button","aria-label":"Close",className:D.closeBtn,onClick:b,...g,children:(g==null?void 0:g.children)??e.jsx(Ls,{})})]}),e.jsx("section",{...f,className:[D.body,f==null?void 0:f.className].filter(Boolean).join(" "),children:s}),a&&e.jsx("footer",{...j,className:[D.footer,j==null?void 0:j.className].filter(Boolean).join(" "),children:a})]})})});Ie.displayName="Modal";const Ts="_wrapper_10d4l_1",Rs="_pop_10d4l_8",Ds="_sideRight_10d4l_22",Os="_sideTop_10d4l_27",Es="_arrow_10d4l_34",Ws="_head_10d4l_60",As="_title_10d4l_67",Fs="_closeBtn_10d4l_74",zs="_body_10d4l_105",O={wrapper:Ts,pop:Rs,sideRight:Ds,sideTop:Os,arrow:Es,head:Ws,title:As,closeBtn:Fs,body:zs},Vs=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]});function $e({open:n,defaultOpen:o=!1,title:t,children:s,trigger:a,side:l="bottom-start",showCloseButton:c=!0,onOpenChange:r,popProps:i}){const[h,f]=u.useState(o),j=n!==void 0,g=j?n:h,x=u.useRef(null);function v(y){j||f(y),r==null||r(y)}u.useEffect(()=>{function y(k){x.current&&!x.current.contains(k.target)&&v(!1)}return g&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[g]);const R=l.startsWith("top"),N=l.endsWith("end"),b=[O.pop,N?O.sideRight:null,R?O.sideTop:null,i==null?void 0:i.className].filter(Boolean).join(" ");return e.jsxs("div",{ref:x,className:O.wrapper,children:[a&&e.jsx("div",{onClick:()=>v(!g),style:{display:"inline-flex"},children:a}),g&&e.jsxs("div",{...i,className:b,children:[e.jsx("span",{className:O.arrow}),(t||c)&&e.jsxs("div",{className:O.head,children:[t&&e.jsx("span",{className:O.title,children:t}),c&&e.jsx("button",{type:"button",className:O.closeBtn,"aria-label":"Close",onClick:()=>v(!1),children:e.jsx(Vs,{})})]}),e.jsx("div",{className:O.body,children:s})]})]})}$e.displayName="Popover";const Xs="_group_1ehqf_1",qs="_pb_1ehqf_9",Gs="_on_1ehqf_37",Us="_accent_1ehqf_42",Hs="_solo_1ehqf_47",Ks="_disabled_1ehqf_62",K={group:Xs,pb:qs,on:Gs,accent:Us,solo:Hs,disabled:Ks};function Me({children:n,className:o,...t}){const s=[K.group,o].filter(Boolean).join(" ");return e.jsx("div",{...t,className:s,role:"group",children:n})}Me.displayName="PushButtonGroup";function Se({on:n=!1,accent:o=!1,solo:t=!1,icon:s,children:a,disabled:l=!1,className:c,...r}){const i=[K.pb,n?K.on:null,n&&o?K.accent:null,t?K.solo:null,l?K.disabled:null,c].filter(Boolean).join(" ");return e.jsxs("button",{...r,type:"button",className:i,disabled:l,children:[s,a]})}Se.displayName="PushButton";const Ys="_root_1ijff_1",Zs="_field_1ijff_6",Js="_label_1ijff_12",Qs="_labelMeta_1ijff_24",Ps="_trigger_1ijff_33",en="_triggerOpen_1ijff_59",tn="_triggerConnectedBottom_1ijff_64",sn="_triggerConnectedTop_1ijff_69",nn="_triggerValue_1ijff_74",on="_triggerPlaceholder_1ijff_83",ln="_chevron_1ijff_85",an="_chevronOpen_1ijff_94",cn="_chips_1ijff_97",rn="_chip_1ijff_97",dn="_chipOverflow_1ijff_120",_n="_clearBtn_1ijff_123",un="_popover_1ijff_143",hn="_popoverBottom_1ijff_154",fn="_popoverTop_1ijff_162",xn="_search_1ijff_181",mn="_searchIcon_1ijff_188",jn="_searchInput_1ijff_195",pn="_list_1ijff_209",gn="_item_1ijff_217",vn="_itemActive_1ijff_230",bn="_itemDisabled_1ijff_238",kn="_itemMeta_1ijff_240",Nn="_checkbox_1ijff_248",yn="_checkboxChecked_1ijff_260",wn="_checkIcon_1ijff_266",Bn="_emptyState_1ijff_277",Cn="_popFooter_1ijff_285",In="_popFooterBtn_1ijff_295",_={root:Ys,field:Zs,label:Js,labelMeta:Qs,trigger:Ps,triggerOpen:en,triggerConnectedBottom:tn,triggerConnectedTop:sn,triggerValue:nn,triggerPlaceholder:on,chevron:ln,chevronOpen:an,chips:cn,chip:rn,chipOverflow:dn,clearBtn:_n,popover:un,popoverBottom:hn,popoverTop:fn,search:xn,searchIcon:mn,searchInput:jn,list:pn,item:gn,itemActive:vn,itemDisabled:bn,itemMeta:kn,checkbox:Nn,checkboxChecked:yn,checkIcon:wn,emptyState:Bn,popFooter:Cn,popFooterBtn:In},$n=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"14",height:"14",children:e.jsx("path",{d:"m6 9 6 6 6-6"})}),_e=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),Mn=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"11",cy:"11",r:"7"}),e.jsx("path",{d:"m20 20-3.5-3.5"})]}),ue=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",width:"10",height:"10",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),Sn=(n,o)=>{const t=o.trim().toLowerCase();return t?n.filter(s=>String(s.label).toLowerCase().includes(t)):n},Le=u.forwardRef(({label:n,clearable:o=!1,defaultValue:t=null,disabled:s=!1,emptyLabel:a="No options found",filterOptions:l=Sn,isLoading:c=!1,loadingLabel:r="Loading...",multiple:i=!1,onSearchChange:h,onValueChange:f,options:j,optionsPosition:g="bottom",placeholder:x="Select",searchable:v=!1,searchPlaceholder:R="Search...",showSelectedCount:N=!0,showClearAll:b=!0,showSelectedValues:y=!0,closeOnSelect:k,value:S,className:$,...q},ee)=>{const[L,E]=u.useState(!1),[G,Y]=u.useState(""),U=u.useRef(null),[F,Z]=P(S,t,d=>{const C=j.filter(H=>Array.isArray(d)?d.includes(H.value):H.value===d);f==null||f(d,C)}),B=u.useMemo(()=>Array.isArray(F)?F:F?[F]:[],[F]),z=u.useMemo(()=>j.filter(d=>B.includes(d.value)),[j,B]),J=u.useMemo(()=>l(j,G),[l,j,G]);u.useEffect(()=>{if(!L)return;const d=C=>{U.current&&!U.current.contains(C.target)&&E(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[L]);const m=d=>{Y(d),h==null||h(d)},V=d=>{if(!d.disabled){if(i){const C=B.includes(d.value)?B.filter(H=>H!==d.value):[...B,d.value];Z(C),k&&E(!1);return}Z(d.value),(k??!0)&&E(!1)}},oe=()=>{Z(i?[]:null),m("")},We=d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),E(C=>!C)),d.key==="Escape"&&E(!1)},le=g==="top",Ae=[_.trigger,L?_.triggerOpen:null,L?le?_.triggerConnectedTop:_.triggerConnectedBottom:null].filter(Boolean).join(" "),Fe=!i||y,ze=i&&y&&z.length>0,ae=i,Ve=i&&B.length>0,ce=Fe&&z.length>0,ie=2,re=z.length-ie,Xe=[_.root,$].filter(Boolean).join(" "),de=e.jsxs("div",{ref:U,...q,className:Xe,children:[e.jsxs("button",{type:"button",className:Ae,disabled:s,"aria-haspopup":"listbox","aria-expanded":L,onClick:()=>!s&&E(d=>!d),onKeyDown:We,children:[ze?e.jsxs("div",{className:_.chips,children:[z.slice(0,ie).map(d=>e.jsx("span",{className:_.chip,children:d.label},d.value)),re>0&&e.jsxs("span",{className:[_.chip,_.chipOverflow].join(" "),children:["+",re]})]}):e.jsx("span",{className:[_.triggerValue,ce?null:_.triggerPlaceholder].filter(Boolean).join(" "),children:ce?z.map(d=>d.label).join(", "):x}),o&&B.length>0&&e.jsx("button",{type:"button","aria-label":"Clear",className:_.clearBtn,disabled:s,onClick:d=>{d.stopPropagation(),oe()},children:e.jsx(_e,{})}),e.jsx("span",{className:[_.chevron,L?_.chevronOpen:null].filter(Boolean).join(" "),children:e.jsx($n,{})})]}),L&&e.jsxs("div",{className:[_.popover,le?_.popoverTop:_.popoverBottom].join(" "),role:"listbox","aria-multiselectable":i||void 0,children:[v&&e.jsxs("div",{className:_.search,children:[e.jsx("span",{className:_.searchIcon,children:e.jsx(Mn,{})}),e.jsx("input",{autoFocus:!0,value:G,placeholder:R,className:_.searchInput,onChange:d=>m(d.target.value)}),G&&e.jsx("button",{className:_.clearBtn,onClick:()=>m(""),children:e.jsx(_e,{})})]}),e.jsxs("ul",{className:_.list,children:[c&&e.jsx("li",{className:_.emptyState,children:r}),!c&&J.length===0&&e.jsx("li",{className:_.emptyState,children:a}),!c&&J.map(d=>{const C=B.includes(d.value),H=[_.item,C?_.itemActive:null,d.disabled?_.itemDisabled:null].filter(Boolean).join(" ");return e.jsxs("li",{className:H,role:"option","aria-selected":C,onClick:()=>V(d),children:[ae?e.jsx("span",{className:[_.checkbox,C?_.checkboxChecked:null].filter(Boolean).join(" "),children:C&&e.jsx(ue,{})}):null,e.jsx("span",{children:d.label}),d.meta&&e.jsx("span",{className:_.itemMeta,children:d.meta}),!ae&&C&&e.jsx("span",{className:_.checkIcon,children:e.jsx(ue,{})})]},d.value)})]}),Ve&&(N||b)&&e.jsxs("div",{className:_.popFooter,children:[N&&e.jsxs("span",{children:[B.length," selected"]}),b&&e.jsx("button",{className:_.popFooterBtn,onClick:oe,children:"Clear all"})]})]})]});return n?e.jsxs("div",{className:_.field,children:[e.jsxs("label",{className:_.label,children:[n,i&&N&&B.length>0&&e.jsxs("span",{className:_.labelMeta,children:["· ",B.length," selected"]})]}),de]}):de});Le.displayName="Select";const Ln="_ring_mxe7t_2",Tn="_spin_mxe7t_1",Rn="_ringMuted_mxe7t_12",Dn="_sm_mxe7t_14",On="_md_mxe7t_15",En="_lg_mxe7t_16",Wn="_onAccent_mxe7t_19",An="_dots_mxe7t_29",Fn="_dot_mxe7t_29",zn="_dotPulse_mxe7t_1",Vn="_bar_mxe7t_52",Xn="_barFill_mxe7t_62",qn="_barSlide_mxe7t_1",T={ring:Ln,spin:Tn,ringMuted:Rn,sm:Dn,md:On,lg:En,onAccent:Wn,dots:An,dot:Fn,dotPulse:zn,bar:Vn,barFill:Xn,barSlide:qn};function Te({variant:n="ring",size:o="md",muted:t=!1,onAccent:s=!1,className:a,...l}){if(n==="dots"){const r=[T.dots,a].filter(Boolean).join(" ");return e.jsxs("span",{...l,className:r,role:"status","aria-label":"Loading",children:[e.jsx("span",{className:T.dot}),e.jsx("span",{className:T.dot}),e.jsx("span",{className:T.dot})]})}if(n==="bar"){const r=[T.bar,a].filter(Boolean).join(" ");return e.jsx("span",{...l,className:r,role:"status","aria-label":"Loading",children:e.jsx("span",{className:T.barFill})})}const c=[T.ring,T[o],t?T.ringMuted:null,s?T.onAccent:null,a].filter(Boolean).join(" ");return e.jsx("span",{...l,className:c,role:"status","aria-label":"Loading"})}Te.displayName="Spinner";const Gn="_field_fazrx_1",Un="_label_fazrx_7",Hn="_wrapper_fazrx_16",Kn="_textarea_fazrx_20",Yn="_mono_fazrx_53",Zn="_hasClear_fazrx_59",Jn="_clearBtn_fazrx_62",Qn="_footer_fazrx_84",Pn="_helpText_fazrx_92",eo="_charCount_fazrx_94",to="_charCountOver_fazrx_100",M={field:Gn,label:Un,wrapper:Hn,textarea:Kn,mono:Yn,hasClear:Zn,clearBtn:Jn,footer:Qn,helpText:Pn,charCount:eo,charCountOver:to},so=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"12",height:"12",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),Re=u.forwardRef(({label:n,helpText:o,maxLength:t,clearable:s=!1,mono:a=!1,value:l,defaultValue:c="",disabled:r,onChange:i,onValueChange:h,className:f,...j},g)=>{const[x,v]=P(l,c,S=>h==null?void 0:h(S)),R=S=>{v(S.target.value),i==null||i(S)},N=()=>{v("")},b=t!==void 0&&x.length>t,y=[M.textarea,"sb",a?M.mono:null,s?M.hasClear:null,f].filter(Boolean).join(" "),k=e.jsxs("div",{className:M.wrapper,children:[e.jsx("textarea",{ref:g,disabled:r,maxLength:t,value:x,onChange:R,className:y,...j}),s&&e.jsx("button",{type:"button",className:M.clearBtn,disabled:r||x.length===0,"aria-label":"Clear",onClick:N,children:e.jsx(so,{})})]});return!n&&!o&&t===void 0?k:e.jsxs("div",{className:M.field,children:[n&&e.jsx("label",{className:M.label,children:n}),k,(o||t!==void 0)&&e.jsxs("div",{className:M.footer,children:[o&&e.jsx("span",{className:M.helpText,children:o}),t!==void 0&&e.jsxs("span",{className:[M.charCount,b?M.charCountOver:null].filter(Boolean).join(" "),children:[x.length," / ",t]})]})]})});Re.displayName="Textarea";const no="_toast_d6t69_1",oo="_slideUp_d6t69_1",lo="_toastExiting_d6t69_26",ao="_slideOut_d6t69_1",co="_lead_d6t69_30",io="_body_d6t69_37",ro="_title_d6t69_45",_o="_message_d6t69_51",uo="_closeBtn_d6t69_56",ho="_ok_d6t69_79",fo="_error_d6t69_82",xo="_warning_d6t69_85",mo="_info_d6t69_88",jo="_stack_d6t69_92",A={toast:no,slideUp:oo,toastExiting:lo,slideOut:ao,lead:co,body:io,title:ro,message:_o,closeBtn:uo,ok:ho,error:fo,warning:xo,info:mo,stack:jo},po=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:e.jsx("path",{d:"M20 6 9 17l-5-5"})}),De=()=>e.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"11",height:"11",children:e.jsx("path",{d:"M18 6 6 18M6 6l12 12"})}),go=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[e.jsx("path",{d:"M10.29 3.86 1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z"}),e.jsx("line",{x1:"12",y1:"9",x2:"12",y2:"13"}),e.jsx("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),vo=()=>e.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",width:"16",height:"16",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),bo={ok:e.jsx(po,{}),error:e.jsx(De,{}),warning:e.jsx(go,{}),info:e.jsx(vo,{})};function ne({variant:n="ok",title:o,message:t,onDismiss:s,className:a,...l}){const c=[A.toast,A[n],a].filter(Boolean).join(" ");return e.jsxs("div",{...l,className:c,role:"alert",children:[e.jsx("span",{className:A.lead,children:bo[n]}),e.jsxs("div",{className:A.body,children:[e.jsx("div",{className:A.title,children:o}),t&&e.jsx("div",{className:A.message,children:t})]}),s&&e.jsx("button",{type:"button",className:A.closeBtn,"aria-label":"Dismiss",onClick:s,children:e.jsx(De,{})})]})}ne.displayName="Toast";const Oe=u.createContext(null);function ko({children:n}){const[o,t]=u.useState([]),s=u.useCallback(l=>{t(c=>c.filter(r=>r.id!==l))},[]),a=u.useCallback(l=>{const c=Math.random().toString(36).slice(2),r=l.duration??4e3;return t(i=>[...i,{...l,id:c}]),r>0&&setTimeout(()=>s(c),r),c},[s]);return e.jsxs(Oe.Provider,{value:{toast:a,dismiss:s},children:[n,typeof document<"u"&&qe.createPortal(e.jsx("div",{className:A.stack,children:o.map(l=>e.jsx(ne,{variant:l.variant,title:l.title,message:l.message,onDismiss:()=>s(l.id)},l.id))}),document.body)]})}function No(){const n=u.useContext(Oe);if(!n)throw new Error("useToast must be used within a ToastProvider");return n}const yo="_wrapper_18lxw_1",wo="_tooltip_18lxw_6",Bo="_fadeIn_18lxw_1",Co="_top_18lxw_33",Io="_bottom_18lxw_52",$o="_kbd_18lxw_72",te={wrapper:yo,tooltip:wo,fadeIn:Bo,top:Co,bottom:Io,kbd:$o};function Ee({content:n,side:o="top",children:t,wrapperProps:s,disabled:a=!1}){const[l,c]=u.useState(!1);if(a)return e.jsx(e.Fragment,{children:t});const r=[te.tooltip,te[o]].filter(Boolean).join(" "),i=[te.wrapper,s==null?void 0:s.className].filter(Boolean).join(" ");return e.jsxs("span",{...s,className:i,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocus:()=>c(!0),onBlur:()=>c(!1),children:[t,l&&e.jsx("span",{className:r,role:"tooltip",children:n})]})}Ee.displayName="Tooltip";exports.Badge=he;exports.Button=xe;exports.Card=me;exports.CardHeader=je;exports.CardStat=pe;exports.Checkbox=be;exports.Input=ve;exports.Menu=we;exports.MenuItem=Be;exports.MenuSeparator=Ce;exports.Modal=Ie;exports.Popover=$e;exports.PushButton=Se;exports.PushButtonGroup=Me;exports.Radio=ke;exports.RadioGroup=Ne;exports.Scrollable=fe;exports.Select=Le;exports.Spinner=Te;exports.Switch=ye;exports.Textarea=Re;exports.Toast=ne;exports.ToastProvider=ko;exports.Tooltip=Ee;exports.applyMask=ge;exports.getRawMaskValue=se;exports.useControlledState=P;exports.useToast=No;
|
|
2
2
|
//# sourceMappingURL=super-kit.cjs.map
|