@uxuissk/design-system 0.6.0 → 0.7.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/sellsuki-ds.css +1 -1
- package/dist/sellsuki-ds.js +1580 -1182
- package/dist/sellsuki-ds.js.map +1 -1
- package/dist/sellsuki-ds.umd.cjs +74 -74
- package/dist/sellsuki-ds.umd.cjs.map +1 -1
- package/dist/types/index.d.ts +88 -0
- package/package.json +1 -1
package/dist/sellsuki-ds.umd.cjs
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
${
|
|
3
|
-
${
|
|
1
|
+
(function(N,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("react/jsx-runtime"),require("react"),require("lucide-react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","lucide-react","react-dom"],e):(N=typeof globalThis<"u"?globalThis:N||self,e(N.SellsukiDS={},N.jsxRuntime,N.React,N.LucideReact,N.ReactDOM))})(this,(function(N,e,h,u,De){"use strict";const nt={sm:"h-8 px-3 gap-1.5",md:"h-10 px-4 gap-2",lg:"h-12 px-6 gap-2.5",xl:"h-14 px-8 gap-3"},lt={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-button)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},xl:{fontFamily:"var(--font-button)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"}},Je={sm:14,md:16,lg:18,xl:20},Qe={primary:"bg-primary text-primary-foreground border border-primary hover:bg-primary/90 active:bg-primary/80 shadow-elevation-sm",secondary:"bg-secondary text-secondary-foreground border border-secondary hover:bg-secondary/90 active:bg-secondary/80 shadow-elevation-sm",outline:"bg-transparent text-foreground border border-border hover:bg-muted active:bg-muted/80",ghost:"bg-transparent text-foreground border border-transparent hover:bg-muted active:bg-muted/80",destructive:"bg-destructive text-destructive-foreground border border-destructive hover:bg-destructive/90 active:bg-destructive/80 shadow-elevation-sm",link:"bg-transparent text-primary border border-transparent underline-offset-4 hover:underline px-0 h-auto"},Me=h.forwardRef(({variant:r="primary",size:t="md",loading:s=!1,loadingText:o,leftIcon:a,rightIcon:n,fullWidth:l=!1,active:i=!1,disabled:d,children:c,className:b="",...g},m)=>{const f=d||s;return e.jsx("button",{ref:m,disabled:f,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
|
|
2
|
+
${nt[t]}
|
|
3
|
+
${Qe[r]}
|
|
4
4
|
${l?"w-full":""}
|
|
5
|
-
${
|
|
6
|
-
${
|
|
5
|
+
${i?"ring-2 ring-ring/30":""}
|
|
6
|
+
${f?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer active:scale-[0.98]"}
|
|
7
7
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
|
|
8
|
-
${
|
|
9
|
-
`,style:
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
${
|
|
8
|
+
${b}
|
|
9
|
+
`,style:lt[t],...g,children:s?e.jsxs(e.Fragment,{children:[e.jsx(u.Loader2,{size:Je[t],className:"animate-spin flex-shrink-0"}),o&&e.jsx("span",{children:o})]}):e.jsxs(e.Fragment,{children:[a&&e.jsx("span",{className:"flex-shrink-0",children:a}),c&&e.jsx("span",{children:c}),n&&e.jsx("span",{className:"flex-shrink-0",children:n})]})})});Me.displayName="DSButton";const Ve=h.forwardRef(({variant:r="ghost",size:t="md",loading:s=!1,icon:o,disabled:a,className:n="",...l},i)=>{const d=a||s,c={sm:"w-8 h-8",md:"w-10 h-10",lg:"w-12 h-12",xl:"w-14 h-14"};return e.jsx("button",{ref:i,disabled:d,className:`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all duration-150
|
|
10
|
+
${c[t]}
|
|
11
|
+
${Qe[r]}
|
|
12
|
+
${d?"opacity-50 cursor-not-allowed pointer-events-none":"cursor-pointer active:scale-[0.98]"}
|
|
13
13
|
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40
|
|
14
14
|
${n}
|
|
15
|
-
`,...l,children:s?e.jsx(u.Loader2,{size:
|
|
16
|
-
${
|
|
17
|
-
${
|
|
18
|
-
${
|
|
19
|
-
${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
`,children:[
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${
|
|
26
|
-
${
|
|
27
|
-
${
|
|
28
|
-
`,children:[e.jsx("textarea",{ref:v,disabled:
|
|
29
|
-
${
|
|
30
|
-
${d?"!cursor-not-allowed":""}
|
|
31
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:t?e.jsx(u.Minus,{size:k.icon,strokeWidth:3}):c?e.jsx(u.Check,{size:k.icon,strokeWidth:3}):null}),(a||n)&&e.jsxs("div",{className:"min-w-0",children:[a&&e.jsx("label",{htmlFor:y,className:`text-foreground block cursor-pointer ${d?"!cursor-not-allowed":""}`,style:k.labelStyle,onClick:v,children:a}),n&&e.jsx("span",{className:"text-muted-foreground block",style:k.descStyle,children:n}),i&&e.jsx("span",{className:"text-destructive block mt-0.5",style:k.descStyle,children:i})]})]})}function ft({label:r,children:t,direction:s="vertical",className:o=""}){return e.jsxs("fieldset",{className:`${o}`,children:[r&&e.jsx("legend",{className:"text-foreground mb-2 block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:r}),e.jsx("div",{className:`flex ${s==="vertical"?"flex-col gap-3":"flex-wrap gap-4"}`,children:t})]})}const tr=b.createContext(null),ht={sm:{outer:"w-4 h-4",inner:"w-1.5 h-1.5",labelStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},md:{outer:"w-5 h-5",inner:"w-2 h-2",labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},lg:{outer:"w-6 h-6",inner:"w-2.5 h-2.5",labelStyle:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}};function or({value:r,label:t,description:s,disabled:o,size:a,className:n=""}){const l=b.useContext(tr),d=l?l.value===r:!1,i=o??(l==null?void 0:l.disabled)??!1,f=a??(l==null?void 0:l.size)??"md",h=ht[f],g=()=>{i||l==null||l.onChange(r)};return e.jsxs("div",{className:`inline-flex items-start gap-2.5 ${i?"opacity-50":""} ${n}`,children:[e.jsx("button",{role:"radio","aria-checked":d,disabled:i,onClick:g,className:`${h.outer} flex-shrink-0 rounded-full border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
|
|
32
|
-
${d?"border-primary":"border-border hover:border-primary/50"}
|
|
15
|
+
`,...l,children:s?e.jsx(u.Loader2,{size:Je[t],className:"animate-spin"}):o})});Ve.displayName="IconButton";function it({children:r,className:t=""}){return e.jsx("div",{className:`inline-flex [&>button]:rounded-none [&>button:first-child]:rounded-l-[var(--radius-md)] [&>button:last-child]:rounded-r-[var(--radius-md)] [&>button:not(:last-child)]:border-r-0 ${t}`,children:r})}const Re={sm:{wrapper:"h-9 px-2.5 gap-1.5",textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:14},md:{wrapper:"h-11 px-3 gap-2",textStyle:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)"},icon:16},lg:{wrapper:"h-13 px-4 gap-2.5",textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},icon:18}},er={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},rr={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},we={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ae=h.forwardRef(({label:r,helperText:t,errorMessage:s,successMessage:o,inputSize:a="md",variant:n="default",state:l="default",leftIcon:i,rightIcon:d,prefix:c,suffix:b,clearable:g=!1,showPasswordToggle:m=!1,loading:f=!1,fullWidth:k=!0,required:y=!1,onClear:v,disabled:$,type:j="text",value:p,defaultValue:w,onChange:F,className:W="",...A},H)=>{const[D,C]=h.useState(!1),[X,L]=h.useState(!1),[S,I]=h.useState(w??""),O=p!==void 0?p:S,P=Re[a],R=er[n],Z=s?"error":l,ee=j==="password",K=ee&&X?"text":j,ae=h.useCallback(le=>{I(le.target.value),F==null||F(le)},[F]),te=h.useCallback(()=>{I(""),v==null||v()},[v]),ne=String(O).length>0;return e.jsxs("div",{className:`${k?"w-full":"inline-flex flex-col"} ${W}`,children:[r&&e.jsxs("label",{className:"block mb-1.5 text-foreground",children:[r,y&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("div",{className:`flex items-center rounded-[var(--radius-md)] transition-all duration-150
|
|
16
|
+
${P.wrapper}
|
|
17
|
+
${R.base}
|
|
18
|
+
${$?"":R.hover}
|
|
19
|
+
${D&&!$?R.focus:""}
|
|
20
|
+
${$?"opacity-50 cursor-not-allowed":""}
|
|
21
|
+
${rr[Z]}
|
|
22
|
+
`,children:[i&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:i}),c&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",style:we,children:c}),e.jsx("input",{ref:H,type:K,disabled:$||f,value:O,onChange:ae,onFocus:()=>C(!0),onBlur:()=>C(!1),className:"flex-1 min-w-0 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground disabled:cursor-not-allowed",style:P.textStyle,...A}),b&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",style:we,children:b}),g&&ne&&!$&&e.jsx("button",{type:"button",onClick:te,className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",children:e.jsx(u.X,{size:P.icon-2})}),ee&&m&&e.jsx("button",{type:"button",onClick:()=>L(!X),className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer p-0.5",children:X?e.jsx(u.EyeOff,{size:P.icon}):e.jsx(u.Eye,{size:P.icon})}),d&&!ee&&e.jsx("span",{className:"flex-shrink-0 text-muted-foreground",children:d}),f&&e.jsx("span",{className:"flex-shrink-0",children:e.jsx("span",{className:"block w-4 h-4 border-2 border-muted-foreground border-t-transparent rounded-full animate-spin"})})]}),(t||s||o)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[Z==="error"&&e.jsx(u.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),Z==="success"&&e.jsx(u.CheckCircle2,{size:12,className:"text-chart-2 flex-shrink-0"}),e.jsx("span",{className:`${Z==="error"?"text-destructive":Z==="success"?"text-chart-2":"text-muted-foreground"}`,style:we,children:s||o||t})]})]})});Ae.displayName="DSInput";const je=h.forwardRef(({label:r,helperText:t,errorMessage:s,successMessage:o,inputSize:a="md",variant:n="default",state:l="default",showCharCount:i=!1,maxLength:d,required:c=!1,disabled:b,value:g,defaultValue:m,onChange:f,className:k="",...y},v)=>{const[$,j]=h.useState(!1),[p,w]=h.useState(String(m??"").length),F=Re[a],W=er[n],A=s?"error":l,H=h.useCallback(D=>{w(D.target.value.length),f==null||f(D)},[f]);return e.jsxs("div",{className:`w-full ${k}`,children:[r&&e.jsxs("label",{className:"block mb-1.5 text-foreground",children:[r,c&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("div",{className:`transition-all duration-150 overflow-hidden rounded-[var(--radius-md)]
|
|
23
|
+
${W.base}
|
|
24
|
+
${b?"":W.hover}
|
|
25
|
+
${$&&!b?W.focus:""}
|
|
26
|
+
${b?"opacity-50 cursor-not-allowed":""}
|
|
27
|
+
${rr[A]}
|
|
28
|
+
`,children:[e.jsx("textarea",{ref:v,disabled:b,value:g,defaultValue:m,maxLength:d,onChange:H,onFocus:()=>j(!0),onBlur:()=>j(!1),className:"w-full min-h-[100px] px-3 py-2.5 bg-transparent border-none outline-none text-foreground placeholder:text-muted-foreground resize-y disabled:cursor-not-allowed",style:F.textStyle,...y}),i&&e.jsxs("div",{className:"flex justify-end px-3 py-1.5 border-t border-border text-muted-foreground bg-muted/20",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:[p,d?` / ${d}`:""," chars"]})]}),(t||s||o)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[A==="error"&&e.jsx(u.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),A==="success"&&e.jsx(u.CheckCircle2,{size:12,className:"text-chart-2 flex-shrink-0"}),e.jsx("span",{className:`${A==="error"?"text-destructive":A==="success"?"text-chart-2":"text-muted-foreground"}`,style:we,children:s||o||t})]})]})});je.displayName="DSTextarea";const dt={info:{bg:"bg-primary/5",border:"border-primary/30",text:"text-primary",icon:e.jsx(u.Info,{size:18})},success:{bg:"bg-chart-2/5",border:"border-chart-2/30",text:"text-chart-2",icon:e.jsx(u.CheckCircle2,{size:18})},warning:{bg:"bg-chart-5/5",border:"border-chart-5/30",text:"text-chart-5",icon:e.jsx(u.AlertTriangle,{size:18})},error:{bg:"bg-destructive/5",border:"border-destructive/30",text:"text-destructive",icon:e.jsx(u.XCircle,{size:18})}};function tr({variant:r="info",title:t,children:s,dismissible:o=!1,onDismiss:a,action:n,icon:l,className:i=""}){const[d,c]=h.useState(!0),b=dt[r];if(!d)return null;const g=()=>{c(!1),a==null||a()};return e.jsxs("div",{className:`flex gap-3 p-4 rounded-[var(--radius)] border ${b.bg} ${b.border} ${i}`,role:"alert",children:[e.jsx("span",{className:`flex-shrink-0 mt-0.5 ${b.text}`,children:l??b.icon}),e.jsxs("div",{className:"flex-1 min-w-0",children:[t&&e.jsx("span",{className:`block ${b.text}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:t}),e.jsx("span",{className:"text-foreground block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:s}),n&&e.jsx("div",{className:"mt-2",children:n})]}),o&&e.jsx("button",{onClick:g,className:"flex-shrink-0 text-muted-foreground hover:text-foreground transition-colors cursor-pointer","aria-label":"Dismiss",children:e.jsx(u.X,{size:16})})]})}let or=[],xe=[];function sr(){or.forEach(r=>r([...xe]))}const he={show:r=>{const t={...r,id:`toast-${Date.now()}-${Math.random().toString(36).slice(2)}`};xe=[...xe,t],sr(),setTimeout(()=>{he.dismiss(t.id)},r.duration??4e3)},info:(r,t)=>he.show({variant:"info",message:r,title:t}),success:(r,t)=>he.show({variant:"success",message:r,title:t}),warning:(r,t)=>he.show({variant:"warning",message:r,title:t}),error:(r,t)=>he.show({variant:"error",message:r,title:t}),dismiss:r=>{xe=xe.filter(t=>t.id!==r),sr()}};function ct(){const[r,t]=h.useState([]),s=h.useRef(!1);return s.current||(s.current=!0,or.push(t)),r.length===0?null:e.jsx("div",{className:"fixed bottom-4 right-4 z-[200] flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:r.map(o=>e.jsx("div",{className:"pointer-events-auto animate-in slide-in-from-right fade-in duration-300",children:e.jsx(tr,{variant:o.variant,title:o.title,dismissible:!0,onDismiss:()=>he.dismiss(o.id),children:o.message})},o.id))})}const ft={default:"bg-primary text-primary-foreground",secondary:"bg-secondary/15 text-secondary",outline:"bg-transparent border border-border text-foreground",destructive:"bg-destructive/15 text-destructive",success:"bg-chart-2/15 text-chart-2",warning:"bg-chart-5/15 text-chart-5"},ht={sm:{className:"px-1.5 py-0.5 gap-1",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},iconSize:10},md:{className:"px-2.5 py-0.5 gap-1.5",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},iconSize:12},lg:{className:"px-3 py-1 gap-1.5",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},iconSize:14}},bt={default:"bg-primary-foreground",secondary:"bg-secondary",outline:"bg-foreground",destructive:"bg-destructive",success:"bg-chart-2",warning:"bg-chart-5"};function ut({children:r,variant:t="default",size:s="md",icon:o,dot:a,removable:n,onRemove:l,className:i=""}){const d=ht[s];return e.jsxs("span",{className:`inline-flex items-center rounded-full whitespace-nowrap ${ft[t]} ${d.className} ${i}`,style:{...d.style,lineHeight:"1.2"},children:[a&&e.jsx("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${bt[t]}`}),o&&e.jsx("span",{className:"flex-shrink-0",children:o}),e.jsx("span",{children:r}),n&&e.jsx("button",{onClick:l,className:"flex-shrink-0 hover:opacity-70 transition-opacity cursor-pointer rounded-full -mr-0.5","aria-label":"Remove",children:e.jsx(u.X,{size:d.iconSize})})]})}const vt={sm:{box:"w-4 h-4",icon:10,labelStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},md:{box:"w-5 h-5",icon:12,labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},lg:{box:"w-6 h-6",icon:14,labelStyle:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}};function ar({checked:r,indeterminate:t=!1,defaultChecked:s=!1,onChange:o,label:a,description:n,size:l="md",disabled:i=!1,error:d,className:c="",id:b}){const[g,m]=h.useState(s),f=r??g,k=vt[l],y=b??`cb-${h.useId()}`,v=()=>{if(i)return;const j=!f;r===void 0&&m(j),o==null||o(j)},$=f||t;return e.jsxs("div",{className:`inline-flex items-start gap-2.5 ${i?"opacity-50":""} ${c}`,children:[e.jsx("button",{id:y,role:"checkbox","aria-checked":t?"mixed":f,disabled:i,onClick:v,className:`${k.box} flex-shrink-0 rounded-[var(--radius-sm)] border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
|
|
29
|
+
${$?"bg-primary border-primary text-primary-foreground":d?"border-destructive bg-card":"border-border bg-card hover:border-primary/50"}
|
|
33
30
|
${i?"!cursor-not-allowed":""}
|
|
34
|
-
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:
|
|
31
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:t?e.jsx(u.Minus,{size:k.icon,strokeWidth:3}):f?e.jsx(u.Check,{size:k.icon,strokeWidth:3}):null}),(a||n)&&e.jsxs("div",{className:"min-w-0",children:[a&&e.jsx("label",{htmlFor:y,className:`text-foreground block cursor-pointer ${i?"!cursor-not-allowed":""}`,style:k.labelStyle,onClick:v,children:a}),n&&e.jsx("span",{className:"text-muted-foreground block",style:k.descStyle,children:n}),d&&e.jsx("span",{className:"text-destructive block mt-0.5",style:k.descStyle,children:d})]})]})}function gt({label:r,children:t,direction:s="vertical",className:o=""}){return e.jsxs("fieldset",{className:`${o}`,children:[r&&e.jsx("legend",{className:"text-foreground mb-2 block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:r}),e.jsx("div",{className:`flex ${s==="vertical"?"flex-col gap-3":"flex-wrap gap-4"}`,children:t})]})}const nr=h.createContext(null),pt={sm:{outer:"w-4 h-4",inner:"w-1.5 h-1.5",labelStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},md:{outer:"w-5 h-5",inner:"w-2 h-2",labelStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"}},lg:{outer:"w-6 h-6",inner:"w-2.5 h-2.5",labelStyle:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}}};function lr({value:r,label:t,description:s,disabled:o,size:a,className:n=""}){const l=h.useContext(nr),i=l?l.value===r:!1,d=o??(l==null?void 0:l.disabled)??!1,c=a??(l==null?void 0:l.size)??"md",b=pt[c],g=()=>{d||l==null||l.onChange(r)};return e.jsxs("div",{className:`inline-flex items-start gap-2.5 ${d?"opacity-50":""} ${n}`,children:[e.jsx("button",{role:"radio","aria-checked":i,disabled:d,onClick:g,className:`${b.outer} flex-shrink-0 rounded-full border-2 transition-all flex items-center justify-center cursor-pointer mt-0.5
|
|
32
|
+
${i?"border-primary":"border-border hover:border-primary/50"}
|
|
33
|
+
${d?"!cursor-not-allowed":""}
|
|
34
|
+
focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 outline-none`,children:i&&e.jsx("span",{className:`${b.inner} rounded-full bg-primary transition-transform scale-100`})}),(t||s)&&e.jsxs("div",{className:"min-w-0",children:[t&&e.jsx("span",{className:`text-foreground block cursor-pointer ${d?"!cursor-not-allowed":""}`,style:b.labelStyle,onClick:g,children:t}),s&&e.jsx("span",{className:"text-muted-foreground block",style:b.descStyle,children:s})]})]})}function mt({name:r,value:t,defaultValue:s="",onChange:o,label:a,size:n="md",disabled:l=!1,direction:i="vertical",children:d,error:c,className:b=""}){const[g,m]=h.useState(s),f=t??g,k=y=>{t===void 0&&m(y),o==null||o(y)};return e.jsx(nr.Provider,{value:{value:f,onChange:k,size:n,disabled:l,name:r},children:e.jsxs("fieldset",{className:b,role:"radiogroup",children:[a&&e.jsx("legend",{className:"text-foreground mb-2 block",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},children:a}),e.jsx("div",{className:`flex ${i==="vertical"?"flex-col gap-3":"flex-wrap gap-4"}`,children:d}),c&&e.jsx("span",{className:"text-destructive block mt-1.5",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:c})]})})}const xt=["Su","Mo","Tu","We","Th","Fr","Sa"],Te=["January","February","March","April","May","June","July","August","September","October","November","December"];function ye(r,t){return r.getFullYear()===t.getFullYear()&&r.getMonth()===t.getMonth()&&r.getDate()===t.getDate()}function ir(r,t,s){if(!t||!s)return!1;const o=r.getTime();return o>t.getTime()&&o<s.getTime()}function dr(r,t,s,o){return!!(t&&r<new Date(t.getFullYear(),t.getMonth(),t.getDate())||s&&r>new Date(s.getFullYear(),s.getMonth(),s.getDate())||o!=null&&o.some(a=>ye(a,r)))}function yt(r,t){return new Date(r,t+1,0).getDate()}function cr(r,t){const s=new Date(r,t,1).getDay(),o=yt(r,t),a=[];for(let n=0;n<s;n++)a.push(null);for(let n=1;n<=o;n++)a.push(new Date(r,t,n));return a}function Ne(r,t){if(!r)return"";const s=String(r.getDate()).padStart(2,"0"),o=String(r.getMonth()+1).padStart(2,"0"),a=r.getFullYear();let n=`${s}/${o}/${a}`;if(t){const l=String(r.getHours()).padStart(2,"0"),i=String(r.getMinutes()).padStart(2,"0");n+=` ${l}:${i}`}return n}const wt={sm:{trigger:"h-8 px-2.5",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:14,cell:"w-7 h-7"},md:{trigger:"h-10 px-3",text:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16,cell:"w-9 h-9"},lg:{trigger:"h-12 px-4",text:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)"},icon:18,cell:"w-10 h-10"}},Nt={default:"bg-input-background border border-border",outlined:"bg-transparent border-2 border-border",filled:"bg-muted/30 border border-transparent",ghost:"bg-transparent border border-transparent"},St={default:"focus-within:ring-2 focus-within:ring-ring/30 focus-within:border-primary",error:"ring-2 ring-destructive/30 border-destructive",success:"ring-2 ring-chart-2/30 border-chart-2"};function $t({value:r=null,rangeValue:t,onChange:s,onRangeChange:o,mode:a="single",label:n,placeholder:l,helperText:i,errorMessage:d,successMessage:c,size:b="md",variant:g="default",state:m="default",disabled:f=!1,required:k=!1,clearable:y=!1,showTime:v=!1,minDate:$,maxDate:j,disabledDates:p,showToday:w=!0,footer:F,fullWidth:W=!1}){const[A,H]=h.useState(!1),[D,C]=h.useState(()=>r??new Date),[X,L]=h.useState("days"),[S,I]=h.useState(null),[O,P]=h.useState(()=>r?r.getHours():0),[R,Z]=h.useState(()=>r?r.getMinutes():0),ee=h.useRef(null),K=wt[b];h.useEffect(()=>{function T(Y){ee.current&&!ee.current.contains(Y.target)&&(H(!1),L("days"))}return A&&document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[A]),h.useMemo(()=>cr(D.getFullYear(),D.getMonth()),[D]);const ae=h.useMemo(()=>new Date,[]),te=()=>C(new Date(D.getFullYear(),D.getMonth()-1,1)),ne=()=>C(new Date(D.getFullYear(),D.getMonth()+1,1)),le=()=>C(new Date(D.getFullYear()-1,D.getMonth(),1)),ie=()=>C(new Date(D.getFullYear()+1,D.getMonth(),1)),_=h.useCallback(T=>{if(!dr(T,$,j,p))if(a==="single"){let Y=new Date(T);v&&Y.setHours(O,R),s==null||s(Y),v||(H(!1),L("days"))}else{const Y=t==null?void 0:t.start,oe=t==null?void 0:t.end;!Y||Y&&oe?o==null||o({start:T,end:null}):(T<Y?o==null||o({start:T,end:Y}):o==null||o({start:Y,end:T}),H(!1),L("days"))}},[a,s,o,t,$,j,p,v,O,R]),ce=T=>{T.stopPropagation(),a==="single"?s==null||s(null):o==null||o({start:null,end:null})},z=()=>{const T=new Date;if(C(T),a==="single"){const Y=new Date(T);v&&Y.setHours(O,R),s==null||s(Y),v||(H(!1),L("days"))}},U=()=>{if(r){const T=new Date(r);T.setHours(O,R),s==null||s(T)}H(!1),L("days")},E=h.useMemo(()=>a==="single"?Ne(r,v):t!=null&&t.start&&(t!=null&&t.end)?`${Ne(t.start)} – ${Ne(t.end)}`:t!=null&&t.start?`${Ne(t.start)} – ...`:"",[a,r,t,v]),re=a==="single"?!!r:!!(t!=null&&t.start||t!=null&&t.end),ue=m==="error"?e.jsx(u.AlertCircle,{size:K.icon,className:"text-destructive flex-shrink-0"}):m==="success"?e.jsx(u.CheckCircle2,{size:K.icon,className:"text-chart-2 flex-shrink-0"}):null,G=m==="error"?d:m==="success"?c:i,J=m==="error"?"text-destructive":m==="success"?"text-chart-2":"text-muted-foreground",ve={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},de={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},V={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ge=Math.floor(D.getFullYear()/12)*12;return e.jsxs("div",{className:`relative ${W?"w-full":""}`,ref:ee,children:[n&&e.jsxs("label",{className:"block text-foreground mb-1.5",style:ve,children:[n,k&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("button",{type:"button",onClick:()=>!f&&H(!A),disabled:f,className:`
|
|
35
35
|
w-full flex items-center gap-2 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
36
|
-
${
|
|
37
|
-
${
|
|
38
|
-
${
|
|
39
|
-
${
|
|
40
|
-
`,style:
|
|
41
|
-
${
|
|
42
|
-
${
|
|
43
|
-
${
|
|
44
|
-
${
|
|
45
|
-
${
|
|
46
|
-
`,style:
|
|
36
|
+
${K.trigger}
|
|
37
|
+
${Nt[g]}
|
|
38
|
+
${St[m]}
|
|
39
|
+
${f?"opacity-50 cursor-not-allowed":"hover:border-primary/50"}
|
|
40
|
+
`,style:K.text,children:[e.jsx(u.Calendar,{size:K.icon,className:"text-muted-foreground flex-shrink-0"}),e.jsx("span",{className:`flex-1 text-left truncate ${re?"text-foreground":"text-muted-foreground"}`,children:re?E:l||(a==="range"?"Select date range…":"Select date…")}),ue,y&&re&&!f&&e.jsx("span",{onClick:ce,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.X,{size:K.icon-2})})]}),G&&e.jsx("p",{className:`mt-1.5 ${J}`,style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:G}),A&&e.jsxs("div",{className:"absolute z-50 mt-1.5 bg-popover border border-border rounded-[var(--radius-lg)] shadow-elevation-sm overflow-hidden",style:{minWidth:a==="range"?"560px":"300px"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-card",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:le,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous year",children:e.jsx(u.ChevronsLeft,{size:16})}),e.jsx("button",{onClick:te,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Previous month",children:e.jsx(u.ChevronLeft,{size:16})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>L(X==="months"?"days":"months"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:V,children:Te[D.getMonth()]}),e.jsx("button",{onClick:()=>L(X==="years"?"days":"years"),className:"px-2 py-1 rounded-[var(--radius-sm)] hover:bg-muted text-foreground transition-colors cursor-pointer",style:V,children:D.getFullYear()})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:ne,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next month",children:e.jsx(u.ChevronRight,{size:16})}),e.jsx("button",{onClick:ie,className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground transition-colors cursor-pointer",title:"Next year",children:e.jsx(u.ChevronsRight,{size:16})})]})]}),X==="days"&&e.jsx("div",{className:`p-3 ${a==="range"?"flex gap-3":""}`,children:(a==="range"?[0,1]:[0]).map(T=>{const Y=new Date(D.getFullYear(),D.getMonth()+T,1),oe=cr(Y.getFullYear(),Y.getMonth());return e.jsxs("div",{className:"flex-1",children:[T>0&&e.jsxs("div",{className:"text-center mb-2 text-foreground",style:V,children:[Te[Y.getMonth()]," ",Y.getFullYear()]}),e.jsx("div",{className:"grid grid-cols-7 mb-1",children:xt.map(q=>e.jsx("div",{className:"text-center text-muted-foreground py-1",style:de,children:q},`${T}-${q}`))}),e.jsx("div",{className:"grid grid-cols-7",children:oe.map((q,Fe)=>{if(!q)return e.jsx("div",{},`empty-${T}-${Fe}`);const Ce=dr(q,$,j,p),Ge=ye(q,ae),pe=a==="single"?r&&ye(q,r):(t==null?void 0:t.start)&&ye(q,t.start)||(t==null?void 0:t.end)&&ye(q,t.end),Ke=a==="range"&&(ir(q,(t==null?void 0:t.start)??null,(t==null?void 0:t.end)??null)||(t==null?void 0:t.start)&&!(t!=null&&t.end)&&S&&ir(q,t.start,S>t.start?S:null));return e.jsx("button",{onClick:()=>_(q),onMouseEnter:()=>a==="range"&&I(q),disabled:Ce,className:`
|
|
41
|
+
${K.cell} flex items-center justify-center rounded-[var(--radius-sm)] transition-all cursor-pointer
|
|
42
|
+
${Ce?"opacity-30 cursor-not-allowed":"hover:bg-muted"}
|
|
43
|
+
${pe?"bg-primary text-primary-foreground hover:bg-primary/90":""}
|
|
44
|
+
${Ke&&!pe?"bg-accent text-accent-foreground":""}
|
|
45
|
+
${Ge&&!pe?"border border-primary text-primary":""}
|
|
46
|
+
`,style:V,children:q.getDate()},`${T}-${q.getTime()}`)})})]},T)})}),X==="months"&&e.jsx("div",{className:"p-3 grid grid-cols-3 gap-2",children:Te.map((T,Y)=>e.jsx("button",{onClick:()=>{C(new Date(D.getFullYear(),Y,1)),L("days")},className:`
|
|
47
47
|
py-2.5 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
48
|
-
${
|
|
49
|
-
`,style:
|
|
48
|
+
${D.getMonth()===Y?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"}
|
|
49
|
+
`,style:V,children:T.substring(0,3)},T))}),X==="years"&&e.jsxs("div",{className:"p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsx("button",{onClick:()=>C(new Date(D.getFullYear()-12,D.getMonth(),1)),className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.ChevronLeft,{size:16})}),e.jsxs("span",{className:"text-foreground",style:V,children:[ge," – ",ge+11]}),e.jsx("button",{onClick:()=>C(new Date(D.getFullYear()+12,D.getMonth(),1)),className:"p-1 rounded-[var(--radius-sm)] hover:bg-muted text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.ChevronRight,{size:16})})]}),e.jsx("div",{className:"grid grid-cols-4 gap-2",children:Array.from({length:12},(T,Y)=>ge+Y).map(T=>e.jsx("button",{onClick:()=>{C(new Date(T,D.getMonth(),1)),L("months")},className:`
|
|
50
50
|
py-2.5 rounded-[var(--radius-md)] transition-all cursor-pointer
|
|
51
|
-
${
|
|
52
|
-
${
|
|
53
|
-
`,style:
|
|
51
|
+
${D.getFullYear()===T?"bg-primary text-primary-foreground":"text-foreground hover:bg-muted"}
|
|
52
|
+
${T===ae.getFullYear()&&D.getFullYear()!==T?"border border-primary text-primary":""}
|
|
53
|
+
`,style:V,children:T},T))})]}),v&&a==="single"&&X==="days"&&e.jsxs("div",{className:"px-4 py-3 border-t border-border flex items-center gap-3",children:[e.jsx(u.Clock,{size:14,className:"text-muted-foreground"}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("input",{type:"number",min:0,max:23,value:String(O).padStart(2,"0"),onChange:T=>P(Math.max(0,Math.min(23,Number(T.target.value)))),className:"w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",style:V}),e.jsx("span",{className:"text-muted-foreground",style:V,children:":"}),e.jsx("input",{type:"number",min:0,max:59,value:String(R).padStart(2,"0"),onChange:T=>Z(Math.max(0,Math.min(59,Number(T.target.value)))),className:"w-10 text-center bg-input-background border border-border rounded-[var(--radius-sm)] py-1 text-foreground focus:outline-none focus:ring-1 focus:ring-ring/30",style:V})]}),e.jsx("button",{onClick:U,className:"ml-auto px-3 py-1 rounded-[var(--radius-md)] bg-primary text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer",style:V,children:"Apply"})]}),e.jsxs("div",{className:"px-4 py-2.5 border-t border-border bg-card flex items-center justify-between",children:[w?e.jsx("button",{onClick:z,className:"text-primary hover:underline cursor-pointer",style:V,children:"Today"}):e.jsx("span",{}),F??e.jsx("button",{onClick:()=>{H(!1),L("days")},className:"text-muted-foreground hover:text-foreground cursor-pointer",style:V,children:"Close"})]})]})]})}const kt={sm:"max-w-sm",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl",full:"max-w-[calc(100vw-2rem)] max-h-[calc(100vh-2rem)]"};function fr({open:r,onClose:t,title:s,description:o,size:a="md",children:n,footer:l,closeOnOverlay:i=!0,showCloseButton:d=!0,className:c=""}){const b=h.useRef(null);return h.useEffect(()=>{if(!r)return;const g=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",g),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",g),document.body.style.overflow=""}},[r,t]),h.useEffect(()=>{r&&b.current&&b.current.focus()},[r]),r?e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",children:[e.jsx("div",{className:"absolute inset-0 bg-foreground/40 backdrop-blur-sm animate-in fade-in duration-200",onClick:i?t:void 0}),e.jsxs("div",{ref:b,tabIndex:-1,role:"dialog","aria-modal":"true","aria-labelledby":s?"modal-title":void 0,className:`relative w-full ${kt[a]} bg-card rounded-[var(--radius-lg)] shadow-lg border border-border animate-in zoom-in-95 fade-in duration-200 flex flex-col ${a==="full"?"h-full":"max-h-[85vh]"} ${c}`,children:[(s||d)&&e.jsxs("div",{className:"flex items-start justify-between gap-4 px-6 pt-6 pb-2 flex-shrink-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[s&&e.jsx("h4",{id:"modal-title",className:"text-foreground",children:s}),o&&e.jsx("span",{className:"text-muted-foreground block mt-0.5",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:o})]}),d&&e.jsx("button",{onClick:t,className:"flex-shrink-0 w-8 h-8 rounded-[var(--radius-sm)] flex items-center justify-center text-muted-foreground hover:text-foreground hover:bg-muted transition-colors cursor-pointer","aria-label":"Close",children:e.jsx(u.X,{size:16})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-6 py-4",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:n}),l&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-6 py-4 border-t border-border flex-shrink-0",children:l})]})]}):null}function zt({open:r,onClose:t,onConfirm:s,title:o="Are you sure?",description:a="This action cannot be undone.",confirmLabel:n="Confirm",cancelLabel:l="Cancel",variant:i="default"}){const d={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsx(fr,{open:r,onClose:t,title:o,description:a,size:"sm",children:e.jsxs("div",{className:"flex items-center justify-end gap-2 pt-4",children:[e.jsx("button",{onClick:t,className:"px-4 py-2 rounded-[var(--radius-md)] border border-border text-foreground hover:bg-muted transition-colors cursor-pointer",style:d,children:l}),e.jsx("button",{onClick:()=>{s(),t()},className:`px-4 py-2 rounded-[var(--radius-md)] text-primary-foreground transition-colors cursor-pointer ${i==="destructive"?"bg-destructive hover:bg-destructive/90":"bg-primary hover:bg-primary/90"}`,style:d,children:n})]})})}const Ft={sm:{btn:"min-w-[28px] h-7 px-1.5",icon:14,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},gap:"gap-1"},md:{btn:"min-w-[34px] h-9 px-2",icon:16,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},gap:"gap-1.5"},lg:{btn:"min-w-[42px] h-11 px-3",icon:18,text:{fontFamily:"var(--font-button)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},gap:"gap-2"}},Ct={default:{base:"bg-transparent text-foreground border border-transparent",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted"},outlined:{base:"bg-transparent text-foreground border border-border",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted hover:border-muted"},filled:{base:"bg-muted/50 text-foreground border border-transparent",active:"bg-primary text-primary-foreground border-primary shadow-elevation-sm",hover:"hover:bg-muted"},minimal:{base:"bg-transparent text-foreground border border-transparent",active:"bg-accent text-accent-foreground border-accent",hover:"hover:text-primary"}};function Wt(r,t,s){return h.useMemo(()=>{if(s*2+5>=t)return Array.from({length:t},(c,b)=>b+1);const a=Math.max(r-s,1),n=Math.min(r+s,t),l=a>2,i=n<t-1;if(!l&&i){const c=3+2*s;return[...Array.from({length:c},(g,m)=>m+1),"dots-right",t]}if(l&&!i){const c=3+2*s;return[1,"dots-left",...Array.from({length:c},(g,m)=>t-c+m+1)]}return[1,"dots-left",...Array.from({length:n-a+1},(c,b)=>a+b),"dots-right",t]},[r,t,s])}function Lt({currentPage:r,totalPages:t,onPageChange:s,siblingCount:o=1,showFirstLast:a=!1,showPrevNext:n=!0,showPageSize:l=!1,pageSizeOptions:i=[10,20,50,100],pageSize:d=10,onPageSizeChange:c,totalItems:b,size:g="md",variant:m="default",disabled:f=!1,showPageInfo:k=!1,showItemsInfo:y=!1,prevLabel:v,nextLabel:$}){const j=Wt(r,t,o),p=Ft[g],w=Ct[m],F=h.useCallback(C=>{!f&&C>=1&&C<=t&&s(C)},[f,t,s]),W=(C,X)=>`inline-flex items-center justify-center rounded-[var(--radius-md)] transition-all cursor-pointer select-none
|
|
54
54
|
${p.btn}
|
|
55
|
-
${
|
|
56
|
-
${L?S.active:`${S.base} ${Y?"":S.hover}`}`,A=h?(r-1)*i+1:0,I=h?Math.min(r*i,h):0,W={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[y&&h!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:W,children:[A,"–",I," of ",h]}),l&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:W,children:"Rows per page:"}),e.jsx("select",{value:i,onChange:L=>f==null?void 0:f(Number(L.target.value)),disabled:c,className:"bg-input-background text-foreground border border-border rounded-[var(--radius-md)] px-2 py-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring/30",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:d.map(L=>e.jsx("option",{value:L,children:L},L))})]})]}),e.jsxs("nav",{className:`flex items-center ${p.gap}`,"aria-label":"Pagination",role:"navigation",children:[a&&e.jsx("button",{onClick:()=>z(1),disabled:c||r<=1,className:F(!1,c||r<=1),style:p.text,"aria-label":"First page",title:"First page",children:e.jsx(u.ChevronsLeft,{size:p.icon})}),n&&e.jsx("button",{onClick:()=>z(r-1),disabled:c||r<=1,className:F(!1,c||r<=1),style:p.text,"aria-label":"Previous page",children:v??e.jsx(u.ChevronLeft,{size:p.icon})}),j.map((L,Y)=>L==="dots-left"||L==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${p.btn}`,style:p.text,children:e.jsx(u.MoreHorizontal,{size:p.icon})},L):e.jsx("button",{onClick:()=>z(L),disabled:c,className:F(L===r,c),style:p.text,"aria-label":`Page ${L}`,"aria-current":L===r?"page":void 0,children:L},L)),n&&e.jsx("button",{onClick:()=>z(r+1),disabled:c||r>=t,className:F(!1,c||r>=t),style:p.text,"aria-label":"Next page",children:N??e.jsx(u.ChevronRight,{size:p.icon})}),a&&e.jsx("button",{onClick:()=>z(t),disabled:c||r>=t,className:F(!1,c||r>=t),style:p.text,"aria-label":"Last page",title:"Last page",children:e.jsx(u.ChevronsRight,{size:p.icon})})]}),k&&e.jsxs("span",{className:"text-muted-foreground",style:W,children:["Page ",r," of ",t]})]})}const zt={sm:{input:"h-8 px-8",icon:14,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},md:{input:"h-10 px-9",icon:16,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},lg:{input:"h-12 px-10",icon:18,style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)"}}},Ft={default:"bg-card border border-border focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",outlined:"bg-transparent border-2 border-border focus-within:border-primary",filled:"bg-muted/50 border border-transparent focus-within:border-ring focus-within:bg-card"};function Ct({value:r,onChange:t,onSearch:s,placeholder:o="Search...",size:a="md",variant:n="default",loading:l=!1,suggestions:d=[],onSuggestionSelect:i,clearable:f=!0,disabled:h=!1,autoFocus:g=!1,debounce:m=0,className:c=""}){const[k,y]=b.useState(""),[v,N]=b.useState(!1),[j,p]=b.useState(-1),S=r??k,z=b.useRef(null),F=b.useRef(null),A=b.useRef(void 0),I=zt[a],W=b.useCallback($=>{r===void 0&&y($),t==null||t($),m>0&&(clearTimeout(A.current),A.current=setTimeout(()=>s==null?void 0:s($),m))},[r,t,s,m]),L=$=>{$.key==="Enter"?j>=0&&d[j]?(i==null||i(d[j]),N(!1)):s==null||s(S):$.key==="ArrowDown"?($.preventDefault(),p(E=>Math.min(E+1,d.length-1))):$.key==="ArrowUp"?($.preventDefault(),p(E=>Math.max(E-1,-1))):$.key==="Escape"&&N(!1)};b.useEffect(()=>{const $=E=>{F.current&&!F.current.contains(E.target)&&N(!1)};return document.addEventListener("mousedown",$),()=>document.removeEventListener("mousedown",$)},[]),b.useEffect(()=>{N(d.length>0&&S.length>0),p(-1)},[d,S]);const Y={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},C={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{ref:F,className:`relative ${c}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${Ft[n]} ${h?"opacity-50 pointer-events-none":""}`,children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:e.jsx(u.Search,{size:I.icon})}),e.jsx("input",{ref:z,type:"text",value:S,onChange:$=>W($.target.value),onKeyDown:L,onFocus:()=>d.length>0&&S.length>0&&N(!0),placeholder:o,disabled:h,autoFocus:g,className:`w-full ${I.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:I.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[l&&e.jsx(u.Loader2,{size:I.icon,className:"animate-spin text-muted-foreground"}),f&&S&&!l&&e.jsx("button",{onClick:()=>{var $;W(""),($=z.current)==null||$.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(u.X,{size:I.icon})})]})]}),v&&d.length>0&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-popover border border-border rounded-[var(--radius-md)] shadow-lg z-50 overflow-hidden max-h-64 overflow-y-auto",style:{padding:"var(--Spacing--Spacing-sm)"},children:d.map(($,E)=>e.jsxs("button",{onClick:()=>{i==null||i($),N(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${E===j?"bg-[var(--Colors--Background--bg-brand-secondary)]":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)"},children:[$.icon&&e.jsx("span",{className:"text-muted-foreground flex-shrink-0",children:$.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-foreground block truncate",style:Y,children:$.label}),$.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...C},children:$.description})]})]},$.id))})]})}const le={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function ir({columns:r,data:t,size:s="md",striped:o=!1,hoverable:a=!0,bordered:n=!1,selectable:l=!1,selectedRows:d,onSelectionChange:i,loading:f=!1,emptyMessage:h="No data available",stickyHeader:g=!1,className:m=""}){const[c,k]=b.useState(null),[y,v]=b.useState("asc"),[N,j]=b.useState(new Set),p=d??N,S=$=>{d||j($),i==null||i($)},z=b.useMemo(()=>c?[...t].sort(($,E)=>{const O=$[c],K=E[c];if(O==null)return 1;if(K==null)return-1;const J=typeof O=="string"?O.localeCompare(K):O-K;return y==="asc"?J:-J}):t,[t,c,y]),F=$=>{c===$?v(E=>E==="asc"?"desc":"asc"):(k($),v("asc"))},A=t.length>0&&p.size===t.length,I=p.size>0&&!A,W=()=>{S(A?new Set:new Set(t.map(($,E)=>E)))},L=$=>{const E=new Set(p);E.has($)?E.delete($):E.add($),S(E)},Y={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},C={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`rounded-[var(--radius-lg)] border border-border overflow-hidden ${m}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:g?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"bg-muted/50 border-b border-border",children:[l&&e.jsx("th",{className:`${le[s]} w-12`,children:e.jsx("input",{type:"checkbox",checked:A,ref:$=>{$&&($.indeterminate=I)},onChange:W,className:"w-4 h-4 rounded-[var(--radius-sm)] border-border accent-primary cursor-pointer"})}),r.map($=>e.jsx("th",{className:`${le[s]} text-${$.align??"left"} text-muted-foreground ${$.sortable?"cursor-pointer select-none hover:text-foreground transition-colors":""} ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...C,width:$.width},onClick:()=>$.sortable&&F($.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[$.header,$.sortable&&e.jsx("span",{className:"text-muted-foreground/60",children:c===$.key?y==="asc"?e.jsx(u.ChevronUp,{size:14}):e.jsx(u.ChevronDown,{size:14}):e.jsx(u.ChevronsUpDown,{size:12})})]})},$.key))]})}),e.jsx("tbody",{children:f?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${le[s]} text-center text-muted-foreground`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2 py-8",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{style:Y,children:"Loading..."})]})})}):z.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${le[s]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:Y,children:h})})}):z.map(($,E)=>{const O=p.has(E);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${O?"bg-primary/5":o&&E%2===1?"bg-muted/20":"bg-card"} ${a?"hover:bg-[var(--Colors--Background--bg-primary_hover)]":""}`,children:[l&&e.jsx("td",{className:`${le[s]} w-12`,children:e.jsx("input",{type:"checkbox",checked:O,onChange:()=>L(E),className:"w-4 h-4 rounded-[var(--radius-sm)] border-border accent-primary cursor-pointer"})}),r.map(K=>e.jsx("td",{className:`${le[s]} text-${K.align??"left"} text-foreground ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:Y,children:K.render?K.render($[K.key],$,E):$[K.key]},K.key))]},E)})})]})})})}const Wt={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",padding:"6px 12px"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",padding:"8px 16px"},lg:{fontFamily:"var(--font-button)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",padding:"10px 20px"}};function Lt({tabs:r,variant:t="default",size:s="md",defaultTab:o,activeTab:a,onChange:n,fullWidth:l=!1,className:d=""}){var j,p;const[i,f]=b.useState(o??((j=r[0])==null?void 0:j.id)??""),h=a??i,g=b.useRef(null),[m,c]=b.useState({left:0,width:0}),k=S=>{a||f(S),n==null||n(S)};b.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const S=g.current;if(!S)return;const z=S.querySelector(`[data-tab-id="${h}"]`);z&&c({left:z.offsetLeft,width:z.offsetWidth})},[h,t]);const y=(p=r.find(S=>S.id===h))==null?void 0:p.content,v=(()=>{switch(t){case"bordered":return"border border-border rounded-[var(--radius)] bg-muted/30 p-1 gap-1";case"pills":return"gap-1.5";case"underline":return"border-b border-border relative";default:return"border-b border-border relative"}})(),N=(S,z)=>{const F="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(z)return`${F} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${F} rounded-[var(--radius-sm)] ${S?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${F} rounded-[var(--radius)] ${S?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${F} ${S?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${F} ${S?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:d,children:[e.jsxs("div",{ref:g,className:`flex ${l?"":"inline-flex"} ${v}`,role:"tablist",children:[(t==="default"||t==="underline")&&e.jsx("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-all duration-200 rounded-full",style:{left:m.left,width:m.width}}),r.map(S=>{const z=h===S.id;return e.jsxs("button",{"data-tab-id":S.id,role:"tab","aria-selected":z,disabled:S.disabled,onClick:()=>!S.disabled&&k(S.id),className:`${N(z,!!S.disabled)} ${l?"flex-1 justify-center":""}`,style:Wt[s],children:[S.icon&&e.jsx("span",{className:"flex-shrink-0",children:S.icon}),e.jsx("span",{children:S.label}),S.badge!==void 0&&e.jsx("span",{className:`ml-1 px-1.5 py-0.5 rounded-full min-w-[18px] text-center ${z&&t==="pills"?"bg-primary-foreground/20 text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",lineHeight:"1"},children:S.badge})]},S.id)})]}),y&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:y})]})}const Dt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Mt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Me({title:r,children:t,open:s,onToggle:o,icon:a}){return e.jsxs("div",{className:"border-b border-border last:border-b-0",children:[e.jsxs("button",{onClick:o,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-muted/20 transition-colors cursor-pointer",children:[a&&e.jsx("span",{className:"text-primary flex-shrink-0",children:a}),e.jsx("span",{className:"flex-1 text-foreground",style:Dt,children:r}),e.jsx(u.ChevronDown,{size:16,className:`text-muted-foreground transition-transform ${s?"rotate-180":""}`})]}),e.jsx("div",{className:`overflow-hidden transition-all ${s?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:e.jsx("div",{className:"px-4 pb-4 text-muted-foreground",style:Mt,children:t})})]})}function dr({type:r="single",items:t,defaultOpen:s,value:o,onChange:a,className:n=""}){const[l,d]=b.useState(typeof s=="string"?s:null),[i,f]=b.useState(Array.isArray(s)?new Set(s):new Set),h=o!==void 0,g=c=>h?r==="single"?o===c:Array.isArray(o)&&o.includes(c):r==="single"?l===c:i.has(c),m=c=>{if(r==="single"){const k=(h?o===c:l===c)?null:c;h||d(k),a==null||a(k)}else if(h){const k=Array.isArray(o)?o:[],y=k.includes(c)?k.filter(v=>v!==c):[...k,c];a==null||a(y)}else f(k=>{const y=new Set(k);return y.has(c)?y.delete(c):y.add(c),y})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${n}`,children:t.map(c=>e.jsx(Me,{title:c.title,open:g(c.id),onToggle:()=>m(c.id),icon:c.icon,children:c.content},c.id))})}dr.displayName="Accordion",Me.displayName="AccordionItem";const cr=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],jt={xs:{box:"w-6 h-6",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},sm:{box:"w-8 h-8",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},md:{box:"w-10 h-10",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},lg:{box:"w-14 h-14",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},xl:{box:"w-20 h-20",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}}},At={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},Tt={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},It={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function fr({src:r,name:t,size:s="md",status:o,className:a=""}){const n=jt[s],l=t?t.split(" ").map(i=>i[0]).join("").slice(0,2).toUpperCase():"?",d=t?cr[t.length%cr.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${a}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${n.box} rounded-full object-cover border-2 border-card`}):e.jsx("div",{className:`${n.box} rounded-full ${d} text-white flex items-center justify-center border-2 border-card`,style:n.font,children:l}),o&&e.jsx("span",{className:`absolute bottom-0 right-0 ${At[s]} ${Tt[o]} rounded-full border-2 border-card`})]})}function hr({children:r,max:t,className:s=""}){const o=b.Children.toArray(r),a=t?o.slice(0,t):o,n=t&&o.length>t?o.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${s}`,children:[a.map((l,d)=>e.jsx("div",{className:"relative",style:{zIndex:a.length-d},children:l},d)),n>0&&e.jsxs("div",{className:"relative w-10 h-10 rounded-full bg-muted text-foreground flex items-center justify-center border-2 border-card",style:{...It,zIndex:0},children:["+",n]})]})}fr.displayName="Avatar",hr.displayName="AvatarGroup";const Et={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}};function Bt({items:r,separator:t="chevron",size:s="md",maxItems:o}){const a=t==="slash"?e.jsx(u.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(u.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(u.ChevronRight,{size:12,className:"text-muted-foreground"}),n=s==="sm"?"gap-1":s==="lg"?"gap-2.5":"gap-1.5",l=Et[s];let d=r;if(o&&r.length>o){const i=r.slice(0,1),f=r.slice(-(o-1));d=[...i,{label:"…"},...f]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${n}`,children:d.map((i,f)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[f>0&&e.jsx("span",{className:"mx-0.5",children:a}),i.label==="…"?e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-accent cursor-pointer",children:e.jsx(u.MoreHorizontal,{size:14})}):f===d.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...l,fontWeight:"var(--weight-button)"},children:[i.icon,i.label]}):e.jsxs("a",{href:i.href||"#",onClick:h=>h.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:l,children:[i.icon,i.label]})]},f))})})}const Ht={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg"};function br({children:r,className:t,hover:s,elevation:o="none"}){return e.jsx("div",{className:`rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden ${Ht[o]??""} ${s?"hover:border-primary/40 hover:shadow-md transition-all cursor-pointer":""} ${t??""}`,children:r})}br.displayName="Card";function ur({children:r,action:t}){return e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("div",{children:r}),t]})}ur.displayName="CardHeader";function vr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}vr.displayName="CardBody";function gr({children:r}){return e.jsx("div",{className:"px-5 py-3 border-t border-border bg-muted/10 flex items-center gap-2",children:r})}gr.displayName="CardFooter";const Yt=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#991b1b","#9a3412","#854d0e","#166534","#155e75","#1e40af","#5b21b6","#9d174d","#fca5a5","#fdba74","#fde047","#86efac","#67e8f9","#93c5fd","#c4b5fd","#f9a8d4"];function _t(r){const t=parseInt(r.slice(1,3),16),s=parseInt(r.slice(3,5),16),o=parseInt(r.slice(5,7),16);return`rgb(${t}, ${s}, ${o})`}function Xt(r){const t=parseInt(r.slice(1,3),16)/255,s=parseInt(r.slice(3,5),16)/255,o=parseInt(r.slice(5,7),16)/255,a=Math.max(t,s,o),n=Math.min(t,s,o),l=(a+n)/2;if(a===n)return`hsl(0, 0%, ${Math.round(l*100)}%)`;const d=a-n,i=l>.5?d/(2-a-n):d/(a+n);let f=0;return a===t?f=((s-o)/d+(s<o?6:0))/6:a===s?f=((o-t)/d+2)/6:f=((t-s)/d+4)/6,`hsl(${Math.round(f*360)}, ${Math.round(i*100)}%, ${Math.round(l*100)}%)`}const Ot={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ut={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},pr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Kt({value:r,onChange:t,label:s,presets:o,showInput:a=!0,showFormats:n,size:l="md"}){const[d,i]=b.useState(!1),f=b.useRef(null),h=l==="sm"?"w-5 h-5":l==="lg"?"w-8 h-8":"w-6 h-6",g=o||Yt,m=c=>{navigator.clipboard.writeText(c).then(()=>{i(!0),setTimeout(()=>i(!1),1500)})};return e.jsxs("div",{className:"space-y-3",children:[s&&e.jsx("label",{className:"block text-foreground",style:Ot,children:s}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-md)] border border-border cursor-pointer overflow-hidden",style:{backgroundColor:r},onClick:()=>{var c;return(c=f.current)==null?void 0:c.click()}}),e.jsx("input",{ref:f,type:"color",value:r,onChange:c=>t(c.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})]}),a&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:r,onChange:c=>{(/^#[0-9a-fA-F]{0,6}$/.test(c.target.value)||c.target.value==="#")&&t(c.target.value)},className:"w-24 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-background text-foreground outline-none focus:border-primary",style:pr,maxLength:7}),e.jsx("button",{onClick:()=>m(r),className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer",children:d?e.jsx(u.Check,{size:14,className:"text-chart-2"}):e.jsx(u.Copy,{size:14})})]})]}),g.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.map(c=>e.jsx("button",{onClick:()=>t(c),className:`${h} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
|
|
57
|
-
${r===
|
|
55
|
+
${X?"opacity-40 pointer-events-none cursor-default":""}
|
|
56
|
+
${C?w.active:`${w.base} ${X?"":w.hover}`}`,A=b?(r-1)*d+1:0,H=b?Math.min(r*d,b):0,D={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[y&&b!==void 0&&e.jsxs("span",{className:"text-muted-foreground",style:D,children:[A,"–",H," of ",b]}),l&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:D,children:"Rows per page:"}),e.jsx("select",{value:d,onChange:C=>c==null?void 0:c(Number(C.target.value)),disabled:f,className:"bg-input-background text-foreground border border-border rounded-[var(--radius-md)] px-2 py-1 cursor-pointer focus:outline-none focus:ring-2 focus:ring-ring/30",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:i.map(C=>e.jsx("option",{value:C,children:C},C))})]})]}),e.jsxs("nav",{className:`flex items-center ${p.gap}`,"aria-label":"Pagination",role:"navigation",children:[a&&e.jsx("button",{onClick:()=>F(1),disabled:f||r<=1,className:W(!1,f||r<=1),style:p.text,"aria-label":"First page",title:"First page",children:e.jsx(u.ChevronsLeft,{size:p.icon})}),n&&e.jsx("button",{onClick:()=>F(r-1),disabled:f||r<=1,className:W(!1,f||r<=1),style:p.text,"aria-label":"Previous page",children:v??e.jsx(u.ChevronLeft,{size:p.icon})}),j.map((C,X)=>C==="dots-left"||C==="dots-right"?e.jsx("span",{className:`inline-flex items-center justify-center text-muted-foreground ${p.btn}`,style:p.text,children:e.jsx(u.MoreHorizontal,{size:p.icon})},C):e.jsx("button",{onClick:()=>F(C),disabled:f,className:W(C===r,f),style:p.text,"aria-label":`Page ${C}`,"aria-current":C===r?"page":void 0,children:C},C)),n&&e.jsx("button",{onClick:()=>F(r+1),disabled:f||r>=t,className:W(!1,f||r>=t),style:p.text,"aria-label":"Next page",children:$??e.jsx(u.ChevronRight,{size:p.icon})}),a&&e.jsx("button",{onClick:()=>F(t),disabled:f||r>=t,className:W(!1,f||r>=t),style:p.text,"aria-label":"Last page",title:"Last page",children:e.jsx(u.ChevronsRight,{size:p.icon})})]}),k&&e.jsxs("span",{className:"text-muted-foreground",style:D,children:["Page ",r," of ",t]})]})}const Dt={sm:{input:"h-8 px-8",icon:14,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},md:{input:"h-10 px-9",icon:16,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}},lg:{input:"h-12 px-10",icon:18,style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)"}}},Mt={default:"bg-card border border-border focus-within:border-ring focus-within:ring-2 focus-within:ring-ring/20",outlined:"bg-transparent border-2 border-border focus-within:border-primary",filled:"bg-muted/50 border border-transparent focus-within:border-ring focus-within:bg-card"};function At({value:r,onChange:t,onSearch:s,placeholder:o="Search...",size:a="md",variant:n="default",loading:l=!1,suggestions:i=[],onSuggestionSelect:d,clearable:c=!0,disabled:b=!1,autoFocus:g=!1,debounce:m=0,className:f=""}){const[k,y]=h.useState(""),[v,$]=h.useState(!1),[j,p]=h.useState(-1),w=r??k,F=h.useRef(null),W=h.useRef(null),A=h.useRef(void 0),H=Dt[a],D=h.useCallback(S=>{r===void 0&&y(S),t==null||t(S),m>0&&(clearTimeout(A.current),A.current=setTimeout(()=>s==null?void 0:s(S),m))},[r,t,s,m]),C=S=>{S.key==="Enter"?j>=0&&i[j]?(d==null||d(i[j]),$(!1)):s==null||s(w):S.key==="ArrowDown"?(S.preventDefault(),p(I=>Math.min(I+1,i.length-1))):S.key==="ArrowUp"?(S.preventDefault(),p(I=>Math.max(I-1,-1))):S.key==="Escape"&&$(!1)};h.useEffect(()=>{const S=I=>{W.current&&!W.current.contains(I.target)&&$(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),h.useEffect(()=>{$(i.length>0&&w.length>0),p(-1)},[i,w]);const X={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},L={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};return e.jsxs("div",{ref:W,className:`relative ${f}`,children:[e.jsxs("div",{className:`relative rounded-[var(--radius-md)] transition-all ${Mt[n]} ${b?"opacity-50 pointer-events-none":""}`,children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none",children:e.jsx(u.Search,{size:H.icon})}),e.jsx("input",{ref:F,type:"text",value:w,onChange:S=>D(S.target.value),onKeyDown:C,onFocus:()=>i.length>0&&w.length>0&&$(!0),placeholder:o,disabled:b,autoFocus:g,className:`w-full ${H.input} rounded-[var(--radius-md)] bg-transparent outline-none text-foreground placeholder:text-muted-foreground`,style:H.style}),e.jsxs("span",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-1",children:[l&&e.jsx(u.Loader2,{size:H.icon,className:"animate-spin text-muted-foreground"}),c&&w&&!l&&e.jsx("button",{onClick:()=>{var S;D(""),(S=F.current)==null||S.focus()},className:"text-muted-foreground hover:text-foreground transition-colors cursor-pointer",children:e.jsx(u.X,{size:H.icon})})]})]}),v&&i.length>0&&e.jsx("div",{className:"absolute top-full left-0 right-0 mt-1 bg-popover border border-border rounded-[var(--radius-md)] shadow-lg z-50 overflow-hidden max-h-64 overflow-y-auto",style:{padding:"var(--Spacing--Spacing-sm)"},children:i.map((S,I)=>e.jsxs("button",{onClick:()=>{d==null||d(S),$(!1)},className:`w-full text-left flex items-center rounded-[var(--radius-sm)] transition-colors cursor-pointer ${I===j?"bg-[var(--Colors--Background--bg-brand-secondary)]":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)"},children:[S.icon&&e.jsx("span",{className:"text-muted-foreground flex-shrink-0",children:S.icon}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"text-foreground block truncate",style:X,children:S.label}),S.description&&e.jsx("span",{className:"text-muted-foreground block truncate",style:{marginTop:"var(--Spacing--Spacing-xxs)",...L},children:S.description})]})]},S.id))})]})}const be={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function hr({columns:r,data:t,size:s="md",striped:o=!1,hoverable:a=!0,bordered:n=!1,selectable:l=!1,selectedRows:i,onSelectionChange:d,loading:c=!1,emptyMessage:b="No data available",stickyHeader:g=!1,className:m=""}){const[f,k]=h.useState(null),[y,v]=h.useState("asc"),[$,j]=h.useState(new Set),p=i??$,w=S=>{i||j(S),d==null||d(S)},F=h.useMemo(()=>f?[...t].sort((S,I)=>{const O=S[f],P=I[f];if(O==null)return 1;if(P==null)return-1;const R=typeof O=="string"?O.localeCompare(P):O-P;return y==="asc"?R:-R}):t,[t,f,y]),W=S=>{f===S?v(I=>I==="asc"?"desc":"asc"):(k(S),v("asc"))},A=t.length>0&&p.size===t.length,H=p.size>0&&!A,D=()=>{w(A?new Set:new Set(t.map((S,I)=>I)))},C=S=>{const I=new Set(p);I.has(S)?I.delete(S):I.add(S),w(I)},X={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},L={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};return e.jsx("div",{className:`rounded-[var(--radius-lg)] border border-border overflow-hidden ${m}`,children:e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",children:[e.jsx("thead",{className:g?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"bg-muted/50 border-b border-border",children:[l&&e.jsx("th",{className:`${be[s]} w-12`,children:e.jsx("input",{type:"checkbox",checked:A,ref:S=>{S&&(S.indeterminate=H)},onChange:D,className:"w-4 h-4 rounded-[var(--radius-sm)] border-border accent-primary cursor-pointer"})}),r.map(S=>e.jsx("th",{className:`${be[s]} text-${S.align??"left"} text-muted-foreground ${S.sortable?"cursor-pointer select-none hover:text-foreground transition-colors":""} ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:{...L,width:S.width},onClick:()=>S.sortable&&W(S.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[S.header,S.sortable&&e.jsx("span",{className:"text-muted-foreground/60",children:f===S.key?y==="asc"?e.jsx(u.ChevronUp,{size:14}):e.jsx(u.ChevronDown,{size:14}):e.jsx(u.ChevronsUpDown,{size:12})})]})},S.key))]})}),e.jsx("tbody",{children:c?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${be[s]} text-center text-muted-foreground`,children:e.jsxs("div",{className:"flex items-center justify-center gap-2 py-8",children:[e.jsx("div",{className:"w-5 h-5 border-2 border-primary border-t-transparent rounded-full animate-spin"}),e.jsx("span",{style:X,children:"Loading..."})]})})}):F.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:r.length+(l?1:0),className:`${be[s]} text-center text-muted-foreground py-12`,children:e.jsx("span",{style:X,children:b})})}):F.map((S,I)=>{const O=p.has(I);return e.jsxs("tr",{className:`border-b border-border last:border-b-0 transition-colors ${O?"bg-primary/5":o&&I%2===1?"bg-muted/20":"bg-card"} ${a?"hover:bg-[var(--Colors--Background--bg-primary_hover)]":""}`,children:[l&&e.jsx("td",{className:`${be[s]} w-12`,children:e.jsx("input",{type:"checkbox",checked:O,onChange:()=>C(I),className:"w-4 h-4 rounded-[var(--radius-sm)] border-border accent-primary cursor-pointer"})}),r.map(P=>e.jsx("td",{className:`${be[s]} text-${P.align??"left"} text-foreground ${n?"border-x border-border first:border-l-0 last:border-r-0":""}`,style:X,children:P.render?P.render(S[P.key],S,I):S[P.key]},P.key))]},I)})})]})})})}const jt={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",padding:"6px 12px"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",padding:"8px 16px"},lg:{fontFamily:"var(--font-button)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",padding:"10px 20px"}};function Tt({tabs:r,variant:t="default",size:s="md",defaultTab:o,activeTab:a,onChange:n,fullWidth:l=!1,className:i=""}){var j,p;const[d,c]=h.useState(o??((j=r[0])==null?void 0:j.id)??""),b=a??d,g=h.useRef(null),[m,f]=h.useState({left:0,width:0}),k=w=>{a||c(w),n==null||n(w)};h.useEffect(()=>{if(t!=="underline"&&t!=="default")return;const w=g.current;if(!w)return;const F=w.querySelector(`[data-tab-id="${b}"]`);F&&f({left:F.offsetLeft,width:F.offsetWidth})},[b,t]);const y=(p=r.find(w=>w.id===b))==null?void 0:p.content,v=(()=>{switch(t){case"bordered":return"border border-border rounded-[var(--radius)] bg-muted/30 p-1 gap-1";case"pills":return"gap-1.5";case"underline":return"border-b border-border relative";default:return"border-b border-border relative"}})(),$=(w,F)=>{const W="relative flex items-center gap-1.5 transition-all cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring whitespace-nowrap";if(F)return`${W} opacity-40 !cursor-not-allowed`;switch(t){case"bordered":return`${W} rounded-[var(--radius-sm)] ${w?"bg-card text-foreground shadow-elevation-sm":"text-muted-foreground hover:text-foreground hover:bg-card/50"}`;case"pills":return`${W} rounded-[var(--radius)] ${w?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted"}`;case"underline":return`${W} ${w?"text-primary":"text-muted-foreground hover:text-foreground"}`;default:return`${W} ${w?"text-primary":"text-muted-foreground hover:text-foreground"}`}};return e.jsxs("div",{className:i,children:[e.jsxs("div",{ref:g,className:`flex ${l?"":"inline-flex"} ${v}`,role:"tablist",children:[(t==="default"||t==="underline")&&e.jsx("div",{className:"absolute bottom-0 h-0.5 bg-primary transition-all duration-200 rounded-full",style:{left:m.left,width:m.width}}),r.map(w=>{const F=b===w.id;return e.jsxs("button",{"data-tab-id":w.id,role:"tab","aria-selected":F,disabled:w.disabled,onClick:()=>!w.disabled&&k(w.id),className:`${$(F,!!w.disabled)} ${l?"flex-1 justify-center":""}`,style:jt[s],children:[w.icon&&e.jsx("span",{className:"flex-shrink-0",children:w.icon}),e.jsx("span",{children:w.label}),w.badge!==void 0&&e.jsx("span",{className:`ml-1 px-1.5 py-0.5 rounded-full min-w-[18px] text-center ${F&&t==="pills"?"bg-primary-foreground/20 text-primary-foreground":"bg-muted text-muted-foreground"}`,style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)",lineHeight:"1"},children:w.badge})]},w.id)})]}),y&&e.jsx("div",{className:"pt-4",role:"tabpanel",children:y})]})}const It={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Et={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Ie({title:r,children:t,open:s,onToggle:o,icon:a}){return e.jsxs("div",{className:"border-b border-border last:border-b-0",children:[e.jsxs("button",{onClick:o,className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-muted/20 transition-colors cursor-pointer",children:[a&&e.jsx("span",{className:"text-primary flex-shrink-0",children:a}),e.jsx("span",{className:"flex-1 text-foreground",style:It,children:r}),e.jsx(u.ChevronDown,{size:16,className:`text-muted-foreground transition-transform ${s?"rotate-180":""}`})]}),e.jsx("div",{className:`overflow-hidden transition-all ${s?"max-h-96 opacity-100":"max-h-0 opacity-0"}`,children:e.jsx("div",{className:"px-4 pb-4 text-muted-foreground",style:Et,children:t})})]})}function br({type:r="single",items:t,defaultOpen:s,value:o,onChange:a,className:n=""}){const[l,i]=h.useState(typeof s=="string"?s:null),[d,c]=h.useState(Array.isArray(s)?new Set(s):new Set),b=o!==void 0,g=f=>b?r==="single"?o===f:Array.isArray(o)&&o.includes(f):r==="single"?l===f:d.has(f),m=f=>{if(r==="single"){const k=(b?o===f:l===f)?null:f;b||i(k),a==null||a(k)}else if(b){const k=Array.isArray(o)?o:[],y=k.includes(f)?k.filter(v=>v!==f):[...k,f];a==null||a(y)}else c(k=>{const y=new Set(k);return y.has(f)?y.delete(f):y.add(f),y})};return e.jsx("div",{className:`rounded-[var(--radius)] border border-border overflow-hidden ${n}`,children:t.map(f=>e.jsx(Ie,{title:f.title,open:g(f.id),onToggle:()=>m(f.id),icon:f.icon,children:f.content},f.id))})}br.displayName="Accordion",Ie.displayName="AccordionItem";const ur=["bg-primary","bg-chart-2","bg-chart-5","bg-destructive","bg-secondary"],Bt={xs:{box:"w-6 h-6",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},sm:{box:"w-8 h-8",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},md:{box:"w-10 h-10",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},lg:{box:"w-14 h-14",font:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"}},xl:{box:"w-20 h-20",font:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}}},Ht={xs:"w-2 h-2",sm:"w-2.5 h-2.5",md:"w-3 h-3",lg:"w-3.5 h-3.5",xl:"w-4 h-4"},_t={online:"bg-chart-2",offline:"bg-secondary",busy:"bg-destructive",away:"bg-chart-5"},Yt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function vr({src:r,name:t,size:s="md",status:o,className:a=""}){const n=Bt[s],l=t?t.split(" ").map(d=>d[0]).join("").slice(0,2).toUpperCase():"?",i=t?ur[t.length%ur.length]:"bg-muted";return e.jsxs("div",{className:`relative inline-flex ${a}`,children:[r?e.jsx("img",{src:r,alt:t||"avatar",className:`${n.box} rounded-full object-cover border-2 border-card`}):e.jsx("div",{className:`${n.box} rounded-full ${i} text-white flex items-center justify-center border-2 border-card`,style:n.font,children:l}),o&&e.jsx("span",{className:`absolute bottom-0 right-0 ${Ht[s]} ${_t[o]} rounded-full border-2 border-card`})]})}function gr({children:r,max:t,className:s=""}){const o=h.Children.toArray(r),a=t?o.slice(0,t):o,n=t&&o.length>t?o.length-t:0;return e.jsxs("div",{className:`flex -space-x-2 ${s}`,children:[a.map((l,i)=>e.jsx("div",{className:"relative",style:{zIndex:a.length-i},children:l},i)),n>0&&e.jsxs("div",{className:"relative w-10 h-10 rounded-full bg-muted text-foreground flex items-center justify-center border-2 border-card",style:{...Yt,zIndex:0},children:["+",n]})]})}vr.displayName="Avatar",gr.displayName="AvatarGroup";const Xt={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},md:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"}};function Ot({items:r,separator:t="chevron",size:s="md",maxItems:o}){const a=t==="slash"?e.jsx(u.Slash,{size:12,className:"text-muted-foreground"}):t==="dot"?e.jsx(u.Dot,{size:16,className:"text-muted-foreground"}):e.jsx(u.ChevronRight,{size:12,className:"text-muted-foreground"}),n=s==="sm"?"gap-1":s==="lg"?"gap-2.5":"gap-1.5",l=Xt[s];let i=r;if(o&&r.length>o){const d=r.slice(0,1),c=r.slice(-(o-1));i=[...d,{label:"…"},...c]}return e.jsx("nav",{"aria-label":"Breadcrumb",children:e.jsx("ol",{className:`flex items-center flex-wrap ${n}`,children:i.map((d,c)=>e.jsxs("li",{className:"flex items-center gap-1.5",children:[c>0&&e.jsx("span",{className:"mx-0.5",children:a}),d.label==="…"?e.jsx("span",{className:"w-6 h-6 flex items-center justify-center rounded-[var(--radius-sm)] text-muted-foreground hover:bg-accent cursor-pointer",children:e.jsx(u.MoreHorizontal,{size:14})}):c===i.length-1?e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-foreground",style:{...l,fontWeight:"var(--weight-button)"},children:[d.icon,d.label]}):e.jsxs("a",{href:d.href||"#",onClick:b=>b.preventDefault(),className:"inline-flex items-center gap-1.5 text-muted-foreground hover:text-foreground transition-colors",style:l,children:[d.icon,d.label]})]},c))})})}const Ut={none:"",sm:"shadow-sm",md:"shadow-md",lg:"shadow-lg"};function pr({children:r,className:t,hover:s,elevation:o="none"}){return e.jsx("div",{className:`rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden ${Ut[o]??""} ${s?"hover:border-primary/40 hover:shadow-md transition-all cursor-pointer":""} ${t??""}`,children:r})}pr.displayName="Card";function mr({children:r,action:t}){return e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between",children:[e.jsx("div",{children:r}),t]})}mr.displayName="CardHeader";function xr({children:r}){return e.jsx("div",{className:"px-5 py-4",children:r})}xr.displayName="CardBody";function yr({children:r}){return e.jsx("div",{className:"px-5 py-3 border-t border-border bg-muted/10 flex items-center gap-2",children:r})}yr.displayName="CardFooter";const Pt=["#ef4444","#f97316","#eab308","#22c55e","#06b6d4","#3b82f6","#8b5cf6","#ec4899","#991b1b","#9a3412","#854d0e","#166534","#155e75","#1e40af","#5b21b6","#9d174d","#fca5a5","#fdba74","#fde047","#86efac","#67e8f9","#93c5fd","#c4b5fd","#f9a8d4"];function Gt(r){const t=parseInt(r.slice(1,3),16),s=parseInt(r.slice(3,5),16),o=parseInt(r.slice(5,7),16);return`rgb(${t}, ${s}, ${o})`}function Kt(r){const t=parseInt(r.slice(1,3),16)/255,s=parseInt(r.slice(3,5),16)/255,o=parseInt(r.slice(5,7),16)/255,a=Math.max(t,s,o),n=Math.min(t,s,o),l=(a+n)/2;if(a===n)return`hsl(0, 0%, ${Math.round(l*100)}%)`;const i=a-n,d=l>.5?i/(2-a-n):i/(a+n);let c=0;return a===t?c=((s-o)/i+(s<o?6:0))/6:a===s?c=((o-t)/i+2)/6:c=((t-s)/i+4)/6,`hsl(${Math.round(c*360)}, ${Math.round(d*100)}%, ${Math.round(l*100)}%)`}const qt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Zt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},wr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Jt({value:r,onChange:t,label:s,presets:o,showInput:a=!0,showFormats:n,size:l="md"}){const[i,d]=h.useState(!1),c=h.useRef(null),b=l==="sm"?"w-5 h-5":l==="lg"?"w-8 h-8":"w-6 h-6",g=o||Pt,m=f=>{navigator.clipboard.writeText(f).then(()=>{d(!0),setTimeout(()=>d(!1),1500)})};return e.jsxs("div",{className:"space-y-3",children:[s&&e.jsx("label",{className:"block text-foreground",style:qt,children:s}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-md)] border border-border cursor-pointer overflow-hidden",style:{backgroundColor:r},onClick:()=>{var f;return(f=c.current)==null?void 0:f.click()}}),e.jsx("input",{ref:c,type:"color",value:r,onChange:f=>t(f.target.value),className:"absolute inset-0 opacity-0 cursor-pointer w-full h-full"})]}),a&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:r,onChange:f=>{(/^#[0-9a-fA-F]{0,6}$/.test(f.target.value)||f.target.value==="#")&&t(f.target.value)},className:"w-24 px-2.5 py-1.5 rounded-[var(--radius-md)] border border-border bg-background text-foreground outline-none focus:border-primary",style:wr,maxLength:7}),e.jsx("button",{onClick:()=>m(r),className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-accent transition-colors cursor-pointer",children:i?e.jsx(u.Check,{size:14,className:"text-chart-2"}):e.jsx(u.Copy,{size:14})})]})]}),g.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5",children:g.map(f=>e.jsx("button",{onClick:()=>t(f),className:`${b} rounded-[var(--radius-sm)] border-2 transition-transform hover:scale-110 cursor-pointer
|
|
57
|
+
${r===f?"border-foreground ring-1 ring-foreground/20":"border-transparent"}`,style:{backgroundColor:f},title:f},f))}),n&&e.jsx("div",{className:"space-y-1",children:[{label:"HEX",val:r.toUpperCase()},{label:"RGB",val:Gt(r)},{label:"HSL",val:Kt(r)}].map(f=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"w-8 text-muted-foreground",style:Zt,children:f.label}),e.jsx("code",{className:"text-foreground",style:wr,children:f.val}),e.jsx("button",{onClick:()=>m(f.val),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.Copy,{size:12})})]},f.label))})]})}const Qt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Nr({label:r,orientation:t="horizontal",dashed:s,spacing:o="md",className:a=""}){const n={sm:"my-2",md:"my-4",lg:"my-8"},l=s?"border-dashed":"border-solid";return t==="vertical"?e.jsx("div",{className:`inline-block h-full min-h-[24px] border-l border-border ${l} mx-3 ${a}`}):r?e.jsxs("div",{className:`flex items-center gap-3 ${n[o]} ${a}`,children:[e.jsx("div",{className:`flex-1 border-t border-border ${l}`}),e.jsx("span",{className:"text-muted-foreground flex-shrink-0",style:Qt,children:r}),e.jsx("div",{className:`flex-1 border-t border-border ${l}`})]}):e.jsx("hr",{className:`border-t border-border ${l} ${n[o]} ${a}`})}Nr.displayName="Divider";const Vt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Sr({open:r,onClose:t,title:s,children:o,side:a="right",size:n="md",footer:l,className:i=""}){if(!r)return null;const d={sm:"w-72",md:"w-96",lg:"w-[480px]"},c={sm:"h-48",md:"h-72",lg:"h-96"},b={right:`top-0 right-0 h-full ${d[n]} animate-[slideRight_0.2s_ease]`,left:`top-0 left-0 h-full ${d[n]} animate-[slideLeft_0.2s_ease]`,top:`top-0 left-0 w-full ${c[n]} animate-[slideTop_0.2s_ease]`,bottom:`bottom-0 left-0 w-full ${c[n]} animate-[slideBottom_0.2s_ease]`};return e.jsxs("div",{className:"fixed inset-0 z-50",children:[e.jsx("div",{className:"absolute inset-0 bg-foreground/20",onClick:t}),e.jsxs("div",{className:`absolute bg-card border border-border shadow-lg flex flex-col ${b[a]} ${i}`,children:[s&&e.jsxs("div",{className:"px-5 py-4 border-b border-border flex items-center justify-between flex-shrink-0",children:[e.jsx("span",{className:"text-foreground",style:Vt,children:s}),e.jsx("button",{onClick:t,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.X,{size:18})})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-5",children:o}),l&&e.jsx("div",{className:"px-5 py-3 border-t border-border flex items-center gap-2 flex-shrink-0",children:l})]}),e.jsx("style",{children:`
|
|
58
58
|
@keyframes slideRight { from { transform: translateX(100%); } to { transform: translateX(0); } }
|
|
59
59
|
@keyframes slideLeft { from { transform: translateX(-100%); } to { transform: translateX(0); } }
|
|
60
60
|
@keyframes slideTop { from { transform: translateY(-100%); } to { transform: translateY(0); } }
|
|
61
61
|
@keyframes slideBottom { from { transform: translateY(100%); } to { transform: translateY(0); } }
|
|
62
|
-
`})]})}
|
|
63
|
-
${
|
|
64
|
-
${
|
|
62
|
+
`})]})}Sr.displayName="Drawer";const Rt={sm:{trigger:"h-9 px-[var(--Spacing--Spacing-xl)] gap-[var(--Spacing--Spacing-sm)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-sm) var(--Spacing--Spacing-xl)"},textStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},descStyle:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},icon:14,avatarSize:20},md:{trigger:"h-11 px-[var(--Spacing--Spacing-2xl)] gap-[var(--Spacing--Spacing-lg)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)"},textStyle:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)"},descStyle:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},icon:16,avatarSize:24},lg:{trigger:"h-13 px-[var(--Spacing--Spacing-3xl)] gap-[var(--Spacing--Spacing-xl)]",option:"rounded-[var(--radius-sm)]",optionStyle:{padding:"var(--Spacing--Spacing-lg) var(--Spacing--Spacing-3xl)"},textStyle:{fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)"},descStyle:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-caption)"},icon:18,avatarSize:28}},eo={default:{base:"border border-border bg-input-background",hover:"hover:border-foreground/30",focus:"ring-2 ring-ring/20 border-ring"},outlined:{base:"border-2 border-border bg-transparent",hover:"hover:border-foreground/40",focus:"ring-2 ring-ring/20 border-ring"},filled:{base:"border border-transparent bg-muted",hover:"hover:bg-muted/80",focus:"ring-2 ring-ring/20 border-ring bg-input-background"},ghost:{base:"border border-transparent bg-transparent",hover:"hover:bg-muted/50",focus:"ring-2 ring-ring/20 bg-input-background"}},ro={default:"",error:"!border-destructive ring-destructive/20",success:"!border-chart-2 ring-chart-2/20",warning:"!border-chart-5 ring-chart-5/20"},$r=h.forwardRef(({options:r,value:t,defaultValue:s,onChange:o,placeholder:a="Select an option…",label:n,helperText:l,errorMessage:i,successMessage:d,size:c="md",variant:b="default",state:g="default",disabled:m=!1,loading:f=!1,searchable:k=!1,clearable:y=!1,multiple:v=!1,maxSelections:$,grouped:j=!1,required:p=!1,id:w,className:F="",showSelectAll:W=!1,tagLimit:A,creatable:H=!1,onCreateOption:D,createLabel:C='Create "{query}"',emptyState:X,footer:L,onSearch:S,searchDebounce:I=300,searchLoading:O=!1,renderOption:P},R)=>{const[Z,ee]=h.useState(!1),[K,ae]=h.useState(""),[te,ne]=h.useState(-1),[le,ie]=h.useState(s??(v?[]:"")),_=t??le,ce=h.useRef(null),z=h.useRef(null),U=h.useRef(null),E=h.useRef(null),[re,ue]=h.useState({top:0,left:0,width:0}),G=Rt[c],J=eo[b];h.useEffect(()=>{if(!Z||!ce.current)return;const x=()=>{const M=ce.current.getBoundingClientRect();ue({top:M.bottom+4,left:M.left,width:M.width})};return x(),window.addEventListener("scroll",x,!0),window.addEventListener("resize",x),()=>{window.removeEventListener("scroll",x,!0),window.removeEventListener("resize",x)}},[Z]);const ve=h.useCallback(x=>{ae(x),S&&(E.current&&clearTimeout(E.current),E.current=setTimeout(()=>{S(x)},I))},[S,I]);h.useEffect(()=>()=>{E.current&&clearTimeout(E.current)},[]);const de=h.useMemo(()=>!K||S?r:r.filter(x=>{var M;return x.label.toLowerCase().includes(K.toLowerCase())||((M=x.description)==null?void 0:M.toLowerCase().includes(K.toLowerCase()))}),[r,K,S]),V=h.useMemo(()=>{if(!j)return null;const x={};return de.forEach(M=>{const B=M.group||"Other";x[B]||(x[B]=[]),x[B].push(M)}),x},[de,j]),ge=h.useMemo(()=>{var x;return v&&Array.isArray(_)?_.map(M=>{var B;return(B=r.find(me=>me.value===M))==null?void 0:B.label}).filter(Boolean):(x=r.find(M=>M.value===_))!=null&&x.label?[r.find(M=>M.value===_).label]:[]},[_,r,v]),T=h.useCallback(x=>v&&Array.isArray(_)?_.includes(x):_===x,[_,v]),Y=h.useCallback(x=>{if(v){const M=Array.isArray(_)?[..._]:[],B=M.indexOf(x);if(B>-1)M.splice(B,1);else{if($&&M.length>=$)return;M.push(x)}ie(M),o==null||o(M)}else ie(x),o==null||o(x),ee(!1);ae("")},[_,v,$,o]),oe=h.useMemo(()=>de.filter(x=>!x.disabled).map(x=>x.value),[de]),q=h.useMemo(()=>!v||!Array.isArray(_)?!1:oe.length>0&&oe.every(x=>_.includes(x)),[v,_,oe]),Fe=h.useMemo(()=>!v||!Array.isArray(_)?!1:oe.some(x=>_.includes(x))&&!q,[v,_,oe,q]),Ce=h.useCallback(()=>{if(v)if(q){const x=Array.isArray(_)?_.filter(M=>!oe.includes(M)):[];ie(x),o==null||o(x)}else{const x=Array.isArray(_)?[..._]:[];for(const M of oe)if(!x.includes(M)){if($&&x.length>=$)break;x.push(M)}ie(x),o==null||o(x)}},[v,q,_,oe,$,o]),Ge=h.useCallback(()=>{K.trim()&&(D==null||D(K.trim()),ae(""))},[K,D]),pe=h.useMemo(()=>!H||!K.trim()?!1:!r.some(x=>x.label.toLowerCase()===K.toLowerCase()),[H,K,r]),Ke=h.useCallback(x=>{x.stopPropagation();const M=v?[]:"";ie(M),o==null||o(M)},[v,o]),We=j?Object.values(V||{}).flat():de,tt=h.useCallback(x=>{var M;if(!(m||f))switch(x.key){case"ArrowDown":x.preventDefault(),Z?ne(B=>B<We.length-1?B+1:0):ee(!0);break;case"ArrowUp":x.preventDefault(),ne(B=>B>0?B-1:We.length-1);break;case"Enter":case" ":if(x.preventDefault(),Z&&te>=0){const B=We[te];B&&!B.disabled&&Y(B.value)}else ee(!0);break;case"Escape":ee(!1),(M=ce.current)==null||M.focus();break}},[m,f,Z,te,We,Y]);h.useEffect(()=>{const x=M=>{const B=M.target;ce.current&&!ce.current.contains(B)&&z.current&&!z.current.contains(B)&&(ee(!1),ae(""))};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[]),h.useEffect(()=>{Z&&k&&setTimeout(()=>{var x;return(x=U.current)==null?void 0:x.focus()},50),Z&&ne(-1)},[Z,k]);const qe=v?Array.isArray(_)&&_.length>0:!!_,Le=i?"error":g,Cs=()=>{const x=ge,M=A&&A>0?A:x.length,B=x.slice(0,M),me=x.length-B.length;return e.jsxs("span",{className:"flex flex-wrap gap-1",children:[B.map(Ze=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-[var(--Colors--Background--bg-brand-secondary)] text-[var(--Colors--Text--text-brand-primary)]",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[Ze,e.jsx(u.X,{size:10,className:"cursor-pointer hover:text-destructive transition-colors",onClick:Ws=>{Ws.stopPropagation();const at=r.find(Ls=>Ls.label===Ze);at&&Y(at.value)}})]},Ze)),me>0&&e.jsxs("span",{className:"inline-flex items-center px-2 py-0.5 rounded-[var(--radius-sm)] bg-muted text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:["+",me," more"]})]})},ot=(x,M)=>{const B=T(x.value);return P?e.jsx("button",{type:"button",role:"option","aria-selected":B,disabled:x.disabled,className:`w-full ${G.option} transition-colors cursor-pointer
|
|
63
|
+
${B?"bg-[var(--Colors--Background--bg-brand-secondary)]":""}
|
|
64
|
+
${te===M&&!B?"bg-[var(--Colors--Background--bg-primary_hover)]":""}
|
|
65
65
|
${x.disabled?"opacity-40 cursor-not-allowed":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}
|
|
66
|
-
`,style:
|
|
67
|
-
${
|
|
68
|
-
${
|
|
66
|
+
`,style:G.optionStyle,onClick:()=>!x.disabled&&Y(x.value),onMouseEnter:()=>ne(M),children:P(x,B)},x.value):e.jsxs("button",{type:"button",role:"option","aria-selected":B,disabled:x.disabled,className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${G.option} transition-colors cursor-pointer
|
|
67
|
+
${B?"bg-[var(--Colors--Background--bg-brand-secondary)] text-[var(--Colors--Text--text-brand-primary)]":""}
|
|
68
|
+
${te===M&&!B?"bg-[var(--Colors--Background--bg-primary_hover)]":""}
|
|
69
69
|
${x.disabled?"opacity-40 cursor-not-allowed":"hover:bg-[var(--Colors--Background--bg-primary_hover)]"}
|
|
70
|
-
`,style:{...
|
|
71
|
-
${
|
|
72
|
-
`,children:
|
|
73
|
-
${
|
|
74
|
-
${!m&&!
|
|
75
|
-
${
|
|
70
|
+
`,style:{...G.optionStyle,...G.textStyle},onClick:()=>!x.disabled&&Y(x.value),onMouseEnter:()=>ne(M),children:[v&&e.jsx("span",{className:`flex-shrink-0 w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center transition-colors
|
|
71
|
+
${B?"bg-primary border-primary":"border-border"}
|
|
72
|
+
`,children:B&&e.jsx(u.Check,{size:10,className:"text-primary-foreground"})}),x.avatar&&e.jsx("img",{src:x.avatar,alt:"",className:"flex-shrink-0 rounded-full object-cover",style:{width:G.avatarSize,height:G.avatarSize}}),x.icon&&e.jsx("span",{className:"flex-shrink-0",children:x.icon}),e.jsxs("span",{className:"flex-1 text-left",children:[e.jsx("span",{className:"block",children:x.label}),x.description&&e.jsx("span",{className:"block text-muted-foreground",style:{marginTop:"var(--Spacing--Spacing-xxs)",...G.descStyle},children:x.description})]}),!v&&B&&e.jsx(u.Check,{size:G.icon,className:"text-primary flex-shrink-0"})]},x.value)};let st=0;return e.jsxs("div",{ref:R,className:`relative w-full ${F}`,id:w,children:[n&&e.jsxs("label",{className:"block mb-1.5 text-foreground",children:[n,p&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]}),e.jsxs("button",{ref:ce,type:"button",role:"combobox","aria-expanded":Z,"aria-haspopup":"listbox",disabled:m||f,onClick:()=>!m&&!f&&ee(!Z),onKeyDown:tt,className:`w-full flex items-center rounded-[var(--radius-md)] transition-all duration-150 ${G.trigger}
|
|
73
|
+
${J.base}
|
|
74
|
+
${!m&&!f?J.hover:""}
|
|
75
|
+
${Z?J.focus:""}
|
|
76
76
|
${m?"opacity-50 cursor-not-allowed":"cursor-pointer"}
|
|
77
|
-
${
|
|
78
|
-
${
|
|
79
|
-
`,style:
|
|
80
|
-
${
|
|
81
|
-
`,children:[
|
|
82
|
-
${o?"opacity-50 pointer-events-none":""} ${
|
|
77
|
+
${f?"opacity-70 cursor-wait":""}
|
|
78
|
+
${ro[Le]}
|
|
79
|
+
`,style:G.textStyle,children:[f?e.jsx(u.Loader2,{size:G.icon,className:"animate-spin text-muted-foreground"}):null,e.jsx("span",{className:`flex-1 text-left truncate ${qe?"text-foreground":"text-muted-foreground"}`,children:qe?v?Cs():ge[0]:a}),y&&qe&&!m&&e.jsx(u.X,{size:G.icon,className:"flex-shrink-0 text-muted-foreground hover:text-foreground cursor-pointer transition-colors",onClick:Ke}),e.jsx(u.ChevronDown,{size:G.icon,className:`flex-shrink-0 text-muted-foreground transition-transform duration-200 ${Z?"rotate-180":""}`})]}),Z&&De.createPortal(e.jsxs("div",{ref:z,role:"listbox",className:"fixed z-[9999] bg-popover border border-border rounded-[var(--radius)] shadow-elevation-sm overflow-hidden",style:{top:re.top,left:re.left,width:re.width||"auto"},children:[k&&e.jsx("div",{className:"p-2 border-b border-border",children:e.jsxs("div",{className:"relative",children:[e.jsx(u.Search,{size:14,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.jsx("input",{ref:U,type:"text",value:K,onChange:x=>ve(x.target.value),placeholder:"Search\\u2026",className:"w-full pl-8 pr-3 py-1.5 bg-background border border-border rounded-[var(--radius-sm)] outline-none placeholder:text-muted-foreground focus:border-ring focus:ring-1 focus:ring-ring/20 transition-colors",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},onKeyDown:tt})]})}),v&&W&&de.length>0&&e.jsxs("button",{type:"button",className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${G.option} border-b border-border transition-colors hover:bg-[var(--Colors--Background--bg-primary_hover)] cursor-pointer`,style:{...G.optionStyle,...G.textStyle},onClick:Ce,children:[e.jsxs("span",{className:`flex-shrink-0 w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center transition-colors
|
|
80
|
+
${q?"bg-primary border-primary":Fe?"bg-primary/50 border-primary":"border-border"}
|
|
81
|
+
`,children:[q&&e.jsx(u.Check,{size:10,className:"text-primary-foreground"}),Fe&&!q&&e.jsx("span",{className:"w-2 h-0.5 bg-primary-foreground rounded-full"})]}),e.jsx("span",{className:"text-foreground",children:q?"Deselect All":"Select All"}),e.jsxs("span",{className:"ml-auto text-muted-foreground",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},children:[Array.isArray(_)?_.length:0,"/",de.filter(x=>!x.disabled).length]})]}),e.jsxs("div",{className:"max-h-60 overflow-y-auto p-1",children:[O?e.jsxs("div",{className:"flex items-center justify-center py-6 gap-2 text-muted-foreground",children:[e.jsx(u.Loader2,{size:16,className:"animate-spin"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"Searching\\u2026"})]}):de.length===0&&!pe?X?e.jsx("div",{className:"py-4 px-3",children:X}):e.jsxs("div",{className:"text-center py-6 text-muted-foreground flex flex-col items-center gap-2",children:[e.jsx(u.Inbox,{size:24,className:"opacity-40"}),e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},children:"No options found"})]}):j&&V?Object.entries(V).map(([x,M])=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1.5 uppercase tracking-wider text-muted-foreground",style:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},children:x}),M.map(B=>{const me=ot(B,st);return st++,me})]},x)):de.map((x,M)=>ot(x,M)),pe&&e.jsxs("button",{type:"button",className:`w-full flex items-center gap-[var(--Spacing--Spacing-lg)] ${G.option} text-primary transition-colors hover:bg-[var(--Colors--Background--bg-primary_hover)] cursor-pointer`,style:{...G.optionStyle,...G.textStyle},onClick:Ge,children:[e.jsx(u.Plus,{size:G.icon,className:"flex-shrink-0"}),e.jsx("span",{children:C.replace("{query}",K.trim())})]})]}),(L||v&&$)&&e.jsxs("div",{className:"border-t border-border",children:[v&&$&&e.jsxs("div",{className:"px-3 py-2 text-muted-foreground",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:[Array.isArray(_)?_.length:0," / ",$," selected"]}),L&&e.jsx("div",{className:"px-3 py-2",children:L})]})]}),document.body),(l||i||d)&&e.jsxs("div",{className:"mt-1.5 flex items-center gap-1",children:[Le==="error"&&e.jsx(u.AlertCircle,{size:12,className:"text-destructive flex-shrink-0"}),e.jsx("span",{className:`${Le==="error"?"text-destructive":Le==="success"?"text-chart-2":"text-muted-foreground"}`,style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},children:i||d||l})]})]})});$r.displayName="Dropdown";const to={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},kr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function oo({icon:r,title:t,description:s,action:o,secondaryAction:a,size:n="md"}){const l=n==="sm"?"w-10 h-10":n==="lg"?"w-16 h-16":"w-12 h-12",i=n==="sm"?"py-6 px-4":n==="lg"?"py-14 px-8":"py-10 px-6";return e.jsxs("div",{className:`flex flex-col items-center text-center ${i}`,children:[r&&e.jsx("div",{className:`${l} rounded-full bg-muted flex items-center justify-center mb-4`,children:e.jsx("span",{className:"text-muted-foreground",children:r})}),e.jsx("h4",{className:"text-foreground",children:t}),s&&e.jsx("p",{className:"text-muted-foreground mt-1.5 max-w-sm",style:to,children:s}),(o||a)&&e.jsxs("div",{className:"flex items-center gap-3 mt-5",children:[o&&e.jsxs("button",{onClick:o.onClick,className:"inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] bg-primary text-primary-foreground hover:bg-primary/90 transition-colors cursor-pointer",style:kr,children:[o.icon,o.label]}),a&&e.jsx("button",{onClick:a.onClick,className:"inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] border border-border text-foreground hover:bg-accent transition-colors cursor-pointer",style:kr,children:a.label})]})]})}const so={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Se={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},zr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},ao={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Fr(r){return r<1024?r+" B":r<1024*1024?(r/1024).toFixed(1)+" KB":(r/(1024*1024)).toFixed(1)+" MB"}function no(r){return r.startsWith("image/")?e.jsx(u.Image,{size:16,className:"text-chart-2"}):r.startsWith("video/")?e.jsx(u.Film,{size:16,className:"text-chart-5"}):r.includes("pdf")||r.includes("document")?e.jsx(u.FileText,{size:16,className:"text-destructive"}):e.jsx(u.File,{size:16,className:"text-muted-foreground"})}function Cr({files:r,onRemove:t}){return e.jsx("div",{className:"space-y-2",children:r.map(s=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-[var(--radius-md)] border border-border bg-card",children:[no(s.type),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-foreground truncate",style:so,children:s.name}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground",style:zr,children:Fr(s.size)}),s.status==="uploading"&&e.jsx("div",{className:"flex-1 h-1 bg-muted rounded-full overflow-hidden",children:e.jsx("div",{className:"h-full bg-primary rounded-full transition-all",style:{width:`${s.progress}%`}})}),s.status==="done"&&e.jsx(u.CheckCircle2,{size:12,className:"text-chart-2"})]})]}),e.jsx("button",{onClick:()=>t(s.id),className:"text-muted-foreground hover:text-destructive cursor-pointer",children:e.jsx(u.X,{size:14})})]},s.id))})}function lo({accept:r,maxSize:t,multiple:s,disabled:o,variant:a="dropzone",label:n,description:l,value:i,onChange:d,onUpload:c,onRemove:b}){const[g,m]=h.useState([]),[f,k]=h.useState(!1),y=h.useRef(null),v=i??g,$=p=>{if(!p)return;const w=Array.from(p);if(d&&d(w),i===void 0){const F=w.map(W=>({id:Math.random().toString(36).slice(2),name:W.name,size:W.size,type:W.type,progress:0,status:"uploading"}));m(W=>[...W,...F]),F.forEach(W=>{let A=0;const H=setInterval(()=>{A+=Math.random()*30+10,A>=100&&(A=100,clearInterval(H)),m(D=>D.map(C=>C.id===W.id?{...C,progress:Math.min(A,100),status:A>=100?"done":"uploading"}:C)),A>=100&&c&&c({...W,progress:100,status:"done"})},300)})}},j=p=>{b&&b(p),i===void 0&&m(w=>w.filter(F=>F.id!==p))};return a==="button"?e.jsxs("div",{className:"space-y-3",children:[n&&e.jsx("label",{className:"block text-foreground",style:Se,children:n}),e.jsxs("button",{onClick:()=>{var p;return(p=y.current)==null?void 0:p.click()},disabled:o,className:`inline-flex items-center gap-2 px-4 py-2 rounded-[var(--radius-md)] border border-border bg-background text-foreground hover:bg-accent transition-colors cursor-pointer ${o?"opacity-50 pointer-events-none":""}`,style:ao,children:[e.jsx(u.Upload,{size:14})," Choose File",s?"s":""]}),e.jsx("input",{ref:y,type:"file",className:"hidden",accept:r,multiple:s,onChange:p=>$(p.target.files)}),v.length>0&&e.jsx(Cr,{files:v,onRemove:j})]}):a==="avatar"?e.jsxs("div",{className:"space-y-2",children:[n&&e.jsx("label",{className:"block text-foreground",style:Se,children:n}),e.jsx("div",{onClick:()=>{var p;return!o&&((p=y.current)==null?void 0:p.click())},className:`w-24 h-24 rounded-full border-2 border-dashed flex items-center justify-center cursor-pointer transition-colors
|
|
82
|
+
${o?"opacity-50 pointer-events-none":""} ${f?"border-primary bg-primary/5":"border-border hover:border-primary/40"}`,children:v.length>0&&v[v.length-1].status==="done"?e.jsx(u.CheckCircle2,{size:24,className:"text-chart-2"}):e.jsx(u.Upload,{size:20,className:"text-muted-foreground"})}),e.jsx("input",{ref:y,type:"file",className:"hidden",accept:r||"image/*",onChange:p=>$(p.target.files)})]}):e.jsxs("div",{className:"space-y-3",children:[n&&e.jsx("label",{className:"block text-foreground",style:Se,children:n}),e.jsxs("div",{onDragOver:p=>{p.preventDefault(),k(!0)},onDragLeave:()=>k(!1),onDrop:p=>{p.preventDefault(),k(!1),$(p.dataTransfer.files)},onClick:()=>{var p;return!o&&((p=y.current)==null?void 0:p.click())},className:`relative flex flex-col items-center justify-center gap-2 px-6 py-10 rounded-[var(--radius-lg)] border-2 border-dashed transition-all cursor-pointer
|
|
83
83
|
${o?"opacity-50 pointer-events-none":""}
|
|
84
|
-
${
|
|
85
|
-
${a
|
|
86
|
-
${N===a?"border-white":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:v.thumbnail||v.src,alt:v.alt,className:"w-full h-full object-cover"})},N))})]})]})}const no={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},lo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},io={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function co({items:r,parentRect:t}){const s=b.useRef(null),[o,a]=b.useState({top:t.top,left:t.right+4});return b.useEffect(()=>{if(!s.current)return;const l=s.current.getBoundingClientRect();let d=t.top,i=t.right+4;i+l.width>window.innerWidth-8&&(i=t.left-l.width-4),d+l.height>window.innerHeight-8&&(d=window.innerHeight-l.height-8),a({top:d,left:i})},[t]),Fe.createPortal(e.jsx("div",{ref:s,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-md py-1",style:{top:o.top,left:o.left},children:r.map((n,l)=>e.jsx(kr,{item:n},l))}),document.body)}function kr({item:r}){const[t,s]=b.useState(!1),o=b.useRef(null),a=b.useRef(null);if(r.divider)return e.jsx("div",{className:"my-1 border-t border-border"});if(r.label)return e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground uppercase tracking-wider",style:io,children:r.label});const n=r.children&&r.children.length>0,l=()=>{a.current&&clearTimeout(a.current),n&&s(!0)},d=()=>{a.current=setTimeout(()=>s(!1),150)};return e.jsxs("div",{ref:o,className:"relative",onMouseEnter:l,onMouseLeave:d,children:[e.jsxs("button",{onClick:()=>{var i;n||(i=r.onClick)==null||i.call(r)},disabled:r.disabled,className:`w-full flex items-center text-left rounded-[var(--radius-sm)] transition-colors cursor-pointer ${r.destructive?"text-destructive hover:bg-destructive/10":r.disabled?"text-muted-foreground opacity-50 cursor-not-allowed":"text-popover-foreground hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)",...no},children:[r.icon&&e.jsx("span",{className:"flex-shrink-0",children:r.icon}),e.jsx("span",{className:"flex-1",children:r.text}),r.shortcut&&e.jsx("span",{className:"text-muted-foreground ml-4",style:lo,children:r.shortcut}),n&&e.jsx(u.ChevronRight,{size:14,className:"text-muted-foreground"})]}),n&&t&&o.current&&e.jsx(co,{items:r.children,parentRect:o.current.getBoundingClientRect()})]})}function zr({items:r,open:t,onClose:s,triggerRef:o,className:a=""}){const n=b.useRef(null),[l,d]=b.useState({top:0,left:0});return b.useEffect(()=>{if(!t||!o.current)return;const i=o.current.getBoundingClientRect();let f=i.bottom+4,h=i.left;requestAnimationFrame(()=>{if(!n.current)return;const g=n.current.getBoundingClientRect();h+g.width>window.innerWidth-8&&(h=i.right-g.width),f+g.height>window.innerHeight-8&&(f=i.top-g.height-4),d({top:f,left:h})}),d({top:f,left:h})},[t,o]),b.useEffect(()=>{if(!t)return;const i=f=>{var h,g;(h=o.current)!=null&&h.contains(f.target)||(g=n.current)!=null&&g.contains(f.target)||s()};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[t,s,o]),t?Fe.createPortal(e.jsxs("div",{ref:n,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-md py-1 animate-[fadeIn_0.15s_ease] ${a}`,style:{top:l.top,left:l.left},children:[r.map((i,f)=>e.jsx(kr,{item:i},f)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}zr.displayName="Menu";const Fr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},je={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},fo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},xe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Cr({type:r="info",title:t,message:s,closable:o=!0,onClose:a,action:n,avatar:l,time:d,read:i}){const f={info:e.jsx(u.Info,{size:16,className:"text-primary"}),success:e.jsx(u.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(u.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(u.XCircle,{size:16,className:"text-destructive"})},h={info:"border-l-primary",success:"border-l-chart-2",warning:"border-l-chart-5",error:"border-l-destructive"};return e.jsxs("div",{className:`flex gap-3 px-4 py-3 rounded-[var(--radius-md)] border border-border bg-card border-l-[3px] ${h[r]} ${i===!1?"bg-primary/5":""}`,children:[l?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:je,children:e.jsx("span",{className:"text-primary",children:l.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:f[r]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"text-foreground",style:je,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d&&e.jsx("span",{className:"text-muted-foreground",style:fo,children:d}),i===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),o&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.X,{size:14})})]})]}),s&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Fr,children:s}),n&&e.jsxs("button",{onClick:n.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:xe,children:[n.label," ",e.jsx(u.ExternalLink,{size:12})]})]})]})}function ho({items:r,onMarkRead:t,onMarkAllRead:s,onDismiss:o,onClearAll:a}){const[n,l]=b.useState(r),d=t!==void 0||s!==void 0,i=d?r:n,f=i.filter(c=>!c.read).length,h=()=>{s&&s(),d||l(c=>c.map(k=>({...k,read:!0})))},g=c=>{o&&o(c),d||l(k=>k.filter(y=>y.id!==c))},m=c=>{t&&t(c),d||l(k=>k.map(y=>y.id===c?{...y,read:!0}:y))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:je,children:"Notifications"}),f>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:xe,children:f})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[f>0&&e.jsx("button",{onClick:h,className:"text-primary cursor-pointer",style:xe,children:"Mark all read"}),i.length>0&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:xe,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:i.map(c=>e.jsx("div",{className:`px-3 py-2 ${c.read?"":"bg-primary/5"}`,onClick:()=>!c.read&&m(c.id),children:e.jsx(Cr,{type:c.type,title:c.title,message:c.message,time:c.time,read:c.read,closable:!!o,onClose:()=>g(c.id)})},c.id))}),i.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(u.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:Fr,children:"No notifications"})]})]})}const bo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function uo({trigger:r,children:t,placement:s="bottom",title:o,open:a,onOpenChange:n}){const[l,d]=b.useState(!1),i=a!==void 0?a:l,f=m=>{n==null||n(m),a===void 0&&d(m)},h=b.useRef(null);b.useEffect(()=>{if(!i)return;const m=c=>{h.current&&!h.current.contains(c.target)&&f(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[i]);const g={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return e.jsxs("div",{className:"relative inline-block",ref:h,children:[e.jsx("div",{onClick:()=>f(!i),className:"cursor-pointer",children:r}),i&&e.jsx("div",{className:`absolute z-50 ${g[s]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card shadow-lg overflow-hidden",children:[o&&e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:bo,children:o}),e.jsx("button",{onClick:()=>f(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const vo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},go={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Wr({value:r,max:t=100,size:s="md",color:o,label:a,showValue:n,indeterminate:l,className:d=""}){const i={sm:"h-1.5",md:"h-2.5",lg:"h-4"},f=l?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${d}`,children:[(a||n)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a&&e.jsx("span",{className:"text-foreground",style:vo,children:a}),n&&!l&&e.jsxs("span",{className:"text-muted-foreground",style:go,children:[Math.round(f),"%"]})]}),e.jsx("div",{className:`w-full ${i[s]} rounded-full bg-muted overflow-hidden`,children:l?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:o??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${f}%`,backgroundColor:o??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}Wr.displayName="ProgressBar";const po={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},mo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function xo({value:r=0,onChange:t,max:s=5,size:o="md",disabled:a,readOnly:n,icon:l="star",showValue:d,label:i}){const[f,h]=b.useState(0),g=o==="sm"?16:o==="lg"?28:20,m=o==="sm"?"gap-0.5":o==="lg"?"gap-1.5":"gap-1",c=l==="heart"?u.Heart:l==="thumb"?u.ThumbsUp:u.Star,k=l==="heart"?"text-destructive":"text-chart-5",y=Array.from({length:s},(v,N)=>N+1);return e.jsxs("div",{className:`inline-flex items-center ${m} ${a?"opacity-50 pointer-events-none":""}`,children:[i&&e.jsx("span",{className:"text-foreground mr-2",style:po,children:i}),y.map(v=>{const N=v<=(f||r);return e.jsx("button",{type:"button",className:`transition-transform ${n||a?"":"cursor-pointer hover:scale-110"} ${N?k:"text-muted-foreground/40"}`,onMouseEnter:()=>!n&&!a&&h(v),onMouseLeave:()=>h(0),onClick:()=>!n&&!a&&(t==null?void 0:t(v===r?0:v)),disabled:a||n,children:e.jsx(c,{size:g,fill:N?"currentColor":"none"})},v)}),d&&e.jsxs("span",{className:"text-foreground ml-1",style:mo,children:[r,"/",s]})]})}const yo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},wo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},Ae={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},No={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Lr({brand:r,groups:t,activeItem:s,onNavigate:o,collapsed:a=!1,onCollapsedChange:n,className:l=""}){return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 transition-all ${a?"w-16":"w-64"} ${l}`,children:[r&&e.jsxs("div",{className:"px-4 py-4 border-b border-sidebar-border flex items-center gap-2",children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Ae,children:r.name.charAt(0).toUpperCase()}),!a&&e.jsx("span",{className:"text-sidebar-foreground truncate",style:yo,children:r.name})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2",children:t.map(d=>e.jsxs("div",{className:"mb-4",children:[!a&&e.jsx("span",{className:"px-2 mb-1.5 block text-muted-foreground uppercase tracking-wider",style:Ae,children:d.label}),e.jsx("div",{className:"space-y-0.5",children:d.items.map(i=>{const f=s===i.id;return e.jsxs("button",{onClick:()=>o==null?void 0:o(i),className:`w-full flex items-center gap-2 px-2 py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${f?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:wo,children:[e.jsx("span",{className:f?"text-sidebar-primary":"text-muted-foreground",children:i.icon}),!a&&e.jsx("span",{className:"truncate flex-1 text-left",children:i.label}),!a&&i.badge&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:{...Ae,lineHeight:"1"},children:i.badge})]},i.id)})})]},d.label))}),n&&e.jsx("div",{className:"px-3 py-3 border-t border-sidebar-border",children:e.jsx("button",{onClick:()=>n(!a),className:"w-full px-2 py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer text-left",style:No,children:a?">":"Collapse"})})]})}Lr.displayName="Sidebar";function P({width:r,height:t,variant:s="rectangular",animate:o=!0,className:a}){const n="bg-muted",l=o?"animate-pulse":"",d=s==="circular"?"rounded-full":s==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${n} ${l} ${d} ${a??""}`,style:{width:r??"100%",height:t??(s==="text"?"1em":s==="circular"?40:20)}})}function So(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(P,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(P,{variant:"text",width:"60%",height:20}),e.jsx(P,{variant:"text",width:"100%",height:14}),e.jsx(P,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(P,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(P,{variant:"text",width:"40%",height:14}),e.jsx(P,{variant:"text",width:"25%",height:12})]})]})]})}function $o(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex gap-4",children:[120,160,100,80].map((r,t)=>e.jsx(P,{variant:"text",width:r,height:14},t))}),[0,1,2,3].map(r=>e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-4",children:[e.jsx(P,{variant:"circular",width:28,height:28}),e.jsx(P,{variant:"text",width:100+r*15,height:14}),e.jsx(P,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(P,{variant:"rounded",width:60,height:22}),e.jsx(P,{variant:"text",width:80,height:14})]},r))]})}function ko(){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:[0,1,2].map(r=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-[var(--radius-md)] border border-border bg-card",children:[e.jsx(P,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(P,{variant:"text",width:`${60+r*10}%`,height:14}),e.jsx(P,{variant:"text",width:`${40+r*5}%`,height:12})]}),e.jsx(P,{variant:"rounded",width:50,height:24})]},r))})}const zo={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-[3px]",lg:"w-12 h-12 border-4",xl:"w-16 h-16 border-4"};function Dr({size:r="md",color:t,className:s=""}){return e.jsx("div",{className:`${zo[r]} rounded-full border-muted animate-spin ${s}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}Dr.displayName="Spinner";const Te={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Mr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},jr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ar={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Fo={sm:{fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},md:{fontFamily:"var(--font-h2)",fontSize:"var(--text-h2)",fontWeight:"var(--weight-h2)"},lg:{fontFamily:"var(--font-h1)",fontSize:"var(--text-h1)",fontWeight:"var(--weight-h1)"}};function Co({title:r,value:t,prefix:s,suffix:o,trend:a,trendLabel:n,icon:l,size:d="md",loading:i}){const f=Fo[d],h=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",g=(a==null?void 0:a.direction)==="up"?u.ArrowUpRight:(a==null?void 0:a.direction)==="down"?u.ArrowDownRight:u.Minus;return i?e.jsxs("div",{className:"space-y-2 animate-pulse",children:[e.jsx("div",{className:"h-3 w-20 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded-[var(--radius-sm)]"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-muted-foreground",style:Te,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[s&&e.jsx("span",{className:"text-muted-foreground",style:Mr,children:s}),e.jsx("span",{className:"text-foreground",style:f,children:typeof t=="number"?t.toLocaleString():t}),o&&e.jsx("span",{className:"text-muted-foreground",style:Te,children:o})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${h}`,children:[e.jsx(g,{size:14}),e.jsxs("span",{style:Ar,children:[a.value,"%"]}),n&&e.jsx("span",{className:"text-muted-foreground",style:jr,children:n})]})]})}function Wo({title:r,value:t,prefix:s,trend:o,trendLabel:a,icon:n,iconBg:l}){const d=(o==null?void 0:o.direction)==="up"?"text-chart-2":(o==null?void 0:o.direction)==="down"?"text-destructive":"text-muted-foreground",i=(o==null?void 0:o.direction)==="up"?u.ArrowUpRight:(o==null?void 0:o.direction)==="down"?u.ArrowDownRight:u.Minus;return e.jsx("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-5",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-muted-foreground",style:Te,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[s&&e.jsx("span",{className:"text-muted-foreground",style:Mr,children:s}),e.jsx("span",{className:"text-foreground",style:{fontFamily:"var(--font-h3)",fontSize:"var(--text-h3)",fontWeight:"var(--weight-h3)"},children:typeof t=="number"?t.toLocaleString():t})]}),o&&e.jsxs("div",{className:`flex items-center gap-1 ${d}`,children:[e.jsx(i,{size:12}),e.jsxs("span",{style:Ar,children:[o.value,"%"]}),a&&e.jsx("span",{className:"text-muted-foreground",style:jr,children:a})]})]}),n&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${l||"bg-primary/10 text-primary"}`,children:n})]})})}const Lo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Tr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ir={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Er={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Br({steps:r,current:t,orientation:s="horizontal",onStepClick:o,className:a=""}){return s==="vertical"?e.jsx("div",{className:`flex flex-col ${a}`,children:r.map((n,l)=>{const d=l<t,i=l===t;return e.jsxs("div",{className:"flex gap-3",onClick:()=>o==null?void 0:o(l),children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${o?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Er,children:d?e.jsx(u.Check,{size:14}):l+1}),l<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${d?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${l===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${i?"text-foreground":"text-muted-foreground"}`,style:i?Tr:Lo,children:n.title}),n.description&&e.jsx("span",{className:"text-muted-foreground block",style:Ir,children:n.description})]})]},l)})}):e.jsx("div",{className:`flex items-center ${a}`,children:r.map((n,l)=>{const d=l<t,i=l===t;return e.jsxs("div",{className:`flex items-center ${l<r.length-1?"flex-1":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>o==null?void 0:o(l),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${o?"cursor-pointer":""} ${d||i?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Er,children:d?e.jsx(u.Check,{size:14}):l+1}),e.jsx("span",{className:`text-center ${i?"text-foreground":"text-muted-foreground"}`,style:i?Tr:Ir,children:n.title})]}),l<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${d?"bg-primary":"bg-border"}`})]},l)})})}Br.displayName="Stepper";const Do={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Mo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},jo={sm:{track:"w-7 h-4",thumb:"w-3 h-3",on:"translate-x-3"},md:{track:"w-10 h-6",thumb:"w-4.5 h-4.5",on:"translate-x-4.5"},lg:{track:"w-14 h-8",thumb:"w-6.5 h-6.5",on:"translate-x-6"}},Ao={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},To={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Io({checked:r,onChange:t,label:s,description:o,size:a="md",disabled:n,color:l="primary"}){const d=jo[a],i=To[a];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${n?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:n,className:`${d.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Ao[l]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-white shadow-sm absolute transition-transform",style:{width:i.w,height:i.h,top:"50%",transform:`translateY(-50%) translateX(${r?i.on:2}px)`,left:0}})}),(s||o)&&e.jsxs("div",{children:[s&&e.jsx("span",{className:"text-foreground block",style:Do,children:s}),o&&e.jsx("span",{className:"text-muted-foreground block",style:Mo,children:o})]})]})}const Eo={default:"bg-muted/50 text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/20",success:"bg-chart-2/10 text-chart-2 border-chart-2/20",warning:"bg-chart-5/10 text-chart-5 border-chart-5/20",destructive:"bg-destructive/10 text-destructive border-destructive/20",info:"bg-accent text-accent-foreground border-primary/20"},Bo={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Ho={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}};function Hr({children:r,color:t="default",size:s="md",icon:o,closable:a,onClose:n,className:l=""}){const d=Eo[t],i=Bo[s],f=Ho[s];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${d} ${i} ${l}`,style:f,children:[o&&e.jsx("span",{className:"flex-shrink-0",children:o}),r,a&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:n,children:e.jsx(u.X,{size:s==="sm"?10:12})})]})}Hr.displayName="Tag";const Yo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},_o={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Xo={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function Yr({tags:r,onChange:t,placeholder:s,disabled:o,maxTags:a,variant:n="default",className:l=""}){const[d,i]=b.useState(""),f=()=>{const g=d.trim();!g||r.includes(g)||a&&r.length>=a||(t([...r,g]),i(""))},h=g=>{t(r.filter(m=>m!==g))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${Xo[n]} transition-colors focus-within:border-primary ${o?"opacity-50 pointer-events-none":""} ${l}`,children:[r.map(g=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-primary/10 text-primary",style:_o,children:[g,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>h(g),children:e.jsx(u.X,{size:12})})]},g)),e.jsx("input",{value:d,onChange:g=>i(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),f()),g.key==="Backspace"&&!d&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":s,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Yo,disabled:o})]})}Yr.displayName="TagInput";const Oo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},_r={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ie={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Uo({items:r,variant:t="default",size:s="md"}){const o=s==="sm"?"w-6 h-6":s==="lg"?"w-10 h-10":"w-8 h-8",a=s==="sm"?12:s==="lg"?18:14,n=l=>l==="completed"?"bg-chart-2 text-white":l==="current"?"bg-primary text-primary-foreground":l==="error"?"bg-destructive text-white":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((l,d)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`${o} rounded-full flex items-center justify-center flex-shrink-0 ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(u.CheckCircle2,{size:a}):e.jsx(u.Circle,{size:a}))}),d<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 min-h-4 bg-border"})]}),e.jsxs("div",{className:"pb-4 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-foreground",style:_r,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:Ie,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Ie,children:l.description})]})]},d))}):e.jsx("div",{className:"relative",children:r.map((l,d)=>{const i=t==="alternate"&&d%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${i?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${o} rounded-full flex items-center justify-center ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(u.CheckCircle2,{size:a}):e.jsx(u.Circle,{size:a}))}),d<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 bg-border mt-1"})]}),e.jsxs("div",{className:`flex-1 min-w-0 ${i?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${i?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:_r,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:Ie,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Oo,children:l.description}),l.children&&e.jsx("div",{className:"mt-2",children:l.children})]})]},d)})})}const Ko={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},Go={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Xr({children:r,content:t,placement:s="top",className:o=""}){const[a,n]=b.useState(!1);return e.jsxs("div",{className:`relative inline-flex ${o}`,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),children:[r,a&&e.jsx("div",{className:`absolute ${Ko[s]} z-50 px-3 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-md`,style:Go,role:"tooltip",children:t})]})}Xr.displayName="Tooltip";const ye={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Or({brand:r,breadcrumbs:t,actions:s,user:o,height:a="72px",showSearch:n=!1,searchPlaceholder:l="Search... (Ctrl+K)",onSearchClick:d,notificationCount:i,onNotificationClick:f,onMobileMenuClick:h,onUserClick:g,onBreadcrumbClick:m,className:c=""}){const k=o!=null&&o.name?o.name.split(" ").map(y=>y[0]).join("").slice(0,2).toUpperCase():"";return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-5 gap-4 ${c}`,style:{height:a},children:[h&&e.jsx("button",{className:"lg:hidden w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:h,children:e.jsx(u.Menu,{size:16})}),r&&e.jsx(e.Fragment,{children:typeof r.logo=="string"?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):r.logo?e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] overflow-hidden flex-shrink-0",children:r.logo}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ye,children:r.name.charAt(0).toUpperCase()})}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:ye,children:t.map((y,v)=>e.jsxs(b.Fragment,{children:[v>0&&e.jsx(u.ChevronRight,{size:12}),y.href||m?e.jsx("span",{className:`cursor-pointer ${v===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>m==null?void 0:m(y,v),children:y.label}):e.jsx("span",{className:v===t.length-1?"text-foreground":"",children:y.label})]},v))}),e.jsx("div",{className:"flex-1"}),n&&e.jsxs("div",{className:"hidden md:flex items-center gap-2 px-3 h-8 rounded-[var(--radius)] border border-border bg-muted/20 text-muted-foreground w-56 cursor-pointer hover:border-primary/40 transition-colors",onClick:d,children:[e.jsx(u.Search,{size:14}),e.jsx("span",{style:ye,children:l})]}),s,f&&e.jsxs("button",{className:"relative w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:f,children:[e.jsx(u.Bell,{size:16}),i!==void 0&&i>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),o&&e.jsx("div",{className:"cursor-pointer",onClick:g,children:o.avatar?e.jsx("img",{src:o.avatar,alt:o.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",style:ye,children:k})})]})}Or.displayName="TopNavbar";const Po={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},qo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ee={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Ur({title:r,items:t,selected:s,onToggle:o,search:a,onSearch:n,searchable:l}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30 flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:qo,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:Ee,children:[t.length," items"]})]}),l&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(u.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:a,onChange:d=>n(d.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Ee})]}),e.jsxs("div",{className:"max-h-[240px] overflow-y-auto py-1",children:[t.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-muted-foreground",style:Ee,children:"No items"}),t.map(d=>e.jsxs("button",{onClick:()=>!d.disabled&&o(d.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
|
|
87
|
-
${s.has(
|
|
88
|
-
${
|
|
89
|
-
${s.has(
|
|
84
|
+
${f?"border-primary bg-primary/5":"border-border hover:border-primary/40 hover:bg-accent/30"}`,children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:e.jsx(u.Upload,{size:20,className:"text-primary"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-foreground",style:Se,children:[e.jsx("span",{className:"text-primary",children:"Click to upload"})," or drag and drop"]}),e.jsxs("p",{className:"text-muted-foreground",style:zr,children:[l||(r?`Accepted: ${r}`:"Any file type"),t&&` · Max ${Fr(t)}`]})]})]}),e.jsx("input",{ref:y,type:"file",className:"hidden",accept:r,multiple:s,onChange:p=>$(p.target.files)}),v.length>0&&e.jsx(Cr,{files:v,onRemove:j})]})}const io={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},co={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function fo({images:r,initialIndex:t=0}){const[s,o]=h.useState(!1),[a,n]=h.useState(t),[l,i]=h.useState(1),[d,c]=h.useState(0),b=r[a],g=()=>{n(v=>(v-1+r.length)%r.length),i(1),c(0)},m=()=>{n(v=>(v+1)%r.length),i(1),c(0)},f=()=>i(v=>Math.min(v+.25,3)),k=()=>i(v=>Math.max(v-.25,.5)),y=()=>c(v=>(v+90)%360);return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((v,$)=>e.jsx("button",{onClick:()=>{n($),o(!0),i(1),c(0)},className:`rounded-[var(--radius-md)] overflow-hidden border-2 transition-all cursor-pointer hover:opacity-80
|
|
85
|
+
${a===$&&s?"border-primary":"border-border"}`,children:e.jsx("div",{className:"w-20 h-20 bg-muted flex items-center justify-center overflow-hidden",children:e.jsx("img",{src:v.thumbnail||v.src,alt:v.alt,className:"w-full h-full object-cover",loading:"lazy"})})},$))}),s&&e.jsxs("div",{className:"fixed inset-0 z-[60] bg-foreground/80 flex flex-col",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-foreground/20",children:[e.jsxs("span",{className:"text-white",style:io,children:[b.alt," (",a+1,"/",r.length,")"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:k,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-white/70 hover:text-white hover:bg-white/10 cursor-pointer",children:e.jsx(u.ZoomOut,{size:16})}),e.jsxs("span",{className:"text-white/70 px-2",style:co,children:[Math.round(l*100),"%"]}),e.jsx("button",{onClick:f,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-white/70 hover:text-white hover:bg-white/10 cursor-pointer",children:e.jsx(u.ZoomIn,{size:16})}),e.jsx("button",{onClick:y,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-white/70 hover:text-white hover:bg-white/10 cursor-pointer",children:e.jsx(u.RotateCw,{size:16})}),e.jsx("div",{className:"w-px h-5 bg-white/20 mx-1"}),e.jsx("button",{onClick:()=>{o(!1),i(1),c(0)},className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-white/70 hover:text-white hover:bg-white/10 cursor-pointer",children:e.jsx(u.X,{size:16})})]})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",onClick:v=>{v.target===v.currentTarget&&(o(!1),i(1),c(0))},children:[r.length>1&&e.jsx("button",{onClick:g,className:"absolute left-4 w-10 h-10 rounded-full bg-foreground/30 text-white flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(u.ChevronLeft,{size:20})}),e.jsx("img",{src:b.src,alt:b.alt,className:"max-w-[90%] max-h-[80vh] object-contain transition-transform",style:{transform:`scale(${l}) rotate(${d}deg)`}}),r.length>1&&e.jsx("button",{onClick:m,className:"absolute right-4 w-10 h-10 rounded-full bg-foreground/30 text-white flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(u.ChevronRight,{size:20})})]}),r.length>1&&e.jsx("div",{className:"flex items-center justify-center gap-2 py-3 bg-foreground/20",children:r.map((v,$)=>e.jsx("button",{onClick:()=>{n($),i(1),c(0)},className:`w-12 h-12 rounded-[var(--radius-sm)] overflow-hidden border-2 cursor-pointer transition-all
|
|
86
|
+
${$===a?"border-white":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:v.thumbnail||v.src,alt:v.alt,className:"w-full h-full object-cover"})},$))})]})]})}const ho={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},bo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},uo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function vo({items:r,parentRect:t}){const s=h.useRef(null),[o,a]=h.useState({top:t.top,left:t.right+4});return h.useEffect(()=>{if(!s.current)return;const l=s.current.getBoundingClientRect();let i=t.top,d=t.right+4;d+l.width>window.innerWidth-8&&(d=t.left-l.width-4),i+l.height>window.innerHeight-8&&(i=window.innerHeight-l.height-8),a({top:i,left:d})},[t]),De.createPortal(e.jsx("div",{ref:s,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-md py-1",style:{top:o.top,left:o.left},children:r.map((n,l)=>e.jsx(Wr,{item:n},l))}),document.body)}function Wr({item:r}){const[t,s]=h.useState(!1),o=h.useRef(null),a=h.useRef(null);if(r.divider)return e.jsx("div",{className:"my-1 border-t border-border"});if(r.label)return e.jsx("div",{className:"px-3 py-1.5 text-muted-foreground uppercase tracking-wider",style:uo,children:r.label});const n=r.children&&r.children.length>0,l=()=>{a.current&&clearTimeout(a.current),n&&s(!0)},i=()=>{a.current=setTimeout(()=>s(!1),150)};return e.jsxs("div",{ref:o,className:"relative",onMouseEnter:l,onMouseLeave:i,children:[e.jsxs("button",{onClick:()=>{var d;n||(d=r.onClick)==null||d.call(r)},disabled:r.disabled,className:`w-full flex items-center text-left rounded-[var(--radius-sm)] transition-colors cursor-pointer ${r.destructive?"text-destructive hover:bg-destructive/10":r.disabled?"text-muted-foreground opacity-50 cursor-not-allowed":"text-popover-foreground hover:bg-[var(--Colors--Background--bg-primary_hover)]"}`,style:{padding:"var(--Spacing--Spacing-md) var(--Spacing--Spacing-2xl)",gap:"var(--Spacing--Spacing-lg)",...ho},children:[r.icon&&e.jsx("span",{className:"flex-shrink-0",children:r.icon}),e.jsx("span",{className:"flex-1",children:r.text}),r.shortcut&&e.jsx("span",{className:"text-muted-foreground ml-4",style:bo,children:r.shortcut}),n&&e.jsx(u.ChevronRight,{size:14,className:"text-muted-foreground"})]}),n&&t&&o.current&&e.jsx(vo,{items:r.children,parentRect:o.current.getBoundingClientRect()})]})}function Lr({items:r,open:t,onClose:s,triggerRef:o,className:a=""}){const n=h.useRef(null),[l,i]=h.useState({top:0,left:0});return h.useEffect(()=>{if(!t||!o.current)return;const d=o.current.getBoundingClientRect();let c=d.bottom+4,b=d.left;requestAnimationFrame(()=>{if(!n.current)return;const g=n.current.getBoundingClientRect();b+g.width>window.innerWidth-8&&(b=d.right-g.width),c+g.height>window.innerHeight-8&&(c=d.top-g.height-4),i({top:c,left:b})}),i({top:c,left:b})},[t,o]),h.useEffect(()=>{if(!t)return;const d=c=>{var b,g;(b=o.current)!=null&&b.contains(c.target)||(g=n.current)!=null&&g.contains(c.target)||s()};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[t,s,o]),t?De.createPortal(e.jsxs("div",{ref:n,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-md py-1 animate-[fadeIn_0.15s_ease] ${a}`,style:{top:l.top,left:l.left},children:[r.map((d,c)=>e.jsx(Wr,{item:d},c)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}Lr.displayName="Menu";const Dr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ee={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},go={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},$e={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Mr({type:r="info",title:t,message:s,closable:o=!0,onClose:a,action:n,avatar:l,time:i,read:d}){const c={info:e.jsx(u.Info,{size:16,className:"text-primary"}),success:e.jsx(u.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(u.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(u.XCircle,{size:16,className:"text-destructive"})},b={info:"border-l-primary",success:"border-l-chart-2",warning:"border-l-chart-5",error:"border-l-destructive"};return e.jsxs("div",{className:`flex gap-3 px-4 py-3 rounded-[var(--radius-md)] border border-border bg-card border-l-[3px] ${b[r]} ${d===!1?"bg-primary/5":""}`,children:[l?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:Ee,children:e.jsx("span",{className:"text-primary",children:l.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:c[r]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("span",{className:"text-foreground",style:Ee,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[i&&e.jsx("span",{className:"text-muted-foreground",style:go,children:i}),d===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),o&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.X,{size:14})})]})]}),s&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:Dr,children:s}),n&&e.jsxs("button",{onClick:n.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:$e,children:[n.label," ",e.jsx(u.ExternalLink,{size:12})]})]})]})}function po({items:r,onMarkRead:t,onMarkAllRead:s,onDismiss:o,onClearAll:a}){const[n,l]=h.useState(r),i=t!==void 0||s!==void 0,d=i?r:n,c=d.filter(f=>!f.read).length,b=()=>{s&&s(),i||l(f=>f.map(k=>({...k,read:!0})))},g=f=>{o&&o(f),i||l(k=>k.filter(y=>y.id!==f))},m=f=>{t&&t(f),i||l(k=>k.map(y=>y.id===f?{...y,read:!0}:y))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:Ee,children:"Notifications"}),c>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:$e,children:c})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[c>0&&e.jsx("button",{onClick:b,className:"text-primary cursor-pointer",style:$e,children:"Mark all read"}),d.length>0&&a&&e.jsx("button",{onClick:a,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:$e,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:d.map(f=>e.jsx("div",{className:`px-3 py-2 ${f.read?"":"bg-primary/5"}`,onClick:()=>!f.read&&m(f.id),children:e.jsx(Mr,{type:f.type,title:f.title,message:f.message,time:f.time,read:f.read,closable:!!o,onClose:()=>g(f.id)})},f.id))}),d.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(u.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:Dr,children:"No notifications"})]})]})}const mo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function xo({trigger:r,children:t,placement:s="bottom",title:o,open:a,onOpenChange:n}){const[l,i]=h.useState(!1),d=a!==void 0?a:l,c=m=>{n==null||n(m),a===void 0&&i(m)},b=h.useRef(null);h.useEffect(()=>{if(!d)return;const m=f=>{b.current&&!b.current.contains(f.target)&&c(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[d]);const g={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"};return e.jsxs("div",{className:"relative inline-block",ref:b,children:[e.jsx("div",{onClick:()=>c(!d),className:"cursor-pointer",children:r}),d&&e.jsx("div",{className:`absolute z-50 ${g[s]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card shadow-lg overflow-hidden",children:[o&&e.jsxs("div",{className:"px-4 py-2.5 border-b border-border flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:mo,children:o}),e.jsx("button",{onClick:()=>c(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(u.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const yo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},wo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Ar({value:r,max:t=100,size:s="md",color:o,label:a,showValue:n,indeterminate:l,className:i=""}){const d={sm:"h-1.5",md:"h-2.5",lg:"h-4"},c=l?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${i}`,children:[(a||n)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[a&&e.jsx("span",{className:"text-foreground",style:yo,children:a}),n&&!l&&e.jsxs("span",{className:"text-muted-foreground",style:wo,children:[Math.round(c),"%"]})]}),e.jsx("div",{className:`w-full ${d[s]} rounded-full bg-muted overflow-hidden`,children:l?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:o??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${c}%`,backgroundColor:o??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}Ar.displayName="ProgressBar";const No={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},So={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function $o({value:r=0,onChange:t,max:s=5,size:o="md",disabled:a,readOnly:n,icon:l="star",showValue:i,label:d}){const[c,b]=h.useState(0),g=o==="sm"?16:o==="lg"?28:20,m=o==="sm"?"gap-0.5":o==="lg"?"gap-1.5":"gap-1",f=l==="heart"?u.Heart:l==="thumb"?u.ThumbsUp:u.Star,k=l==="heart"?"text-destructive":"text-chart-5",y=Array.from({length:s},(v,$)=>$+1);return e.jsxs("div",{className:`inline-flex items-center ${m} ${a?"opacity-50 pointer-events-none":""}`,children:[d&&e.jsx("span",{className:"text-foreground mr-2",style:No,children:d}),y.map(v=>{const $=v<=(c||r);return e.jsx("button",{type:"button",className:`transition-transform ${n||a?"":"cursor-pointer hover:scale-110"} ${$?k:"text-muted-foreground/40"}`,onMouseEnter:()=>!n&&!a&&b(v),onMouseLeave:()=>b(0),onClick:()=>!n&&!a&&(t==null?void 0:t(v===r?0:v)),disabled:a||n,children:e.jsx(f,{size:g,fill:$?"currentColor":"none"})},v)}),i&&e.jsxs("span",{className:"text-foreground ml-1",style:So,children:[r,"/",s]})]})}const ko={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},zo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},Be={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Fo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function jr({brand:r,groups:t,activeItem:s,onNavigate:o,collapsed:a=!1,onCollapsedChange:n,className:l=""}){return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 transition-all ${a?"w-16":"w-64"} ${l}`,children:[r&&e.jsxs("div",{className:"px-4 py-4 border-b border-sidebar-border flex items-center gap-2",children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Be,children:r.name.charAt(0).toUpperCase()}),!a&&e.jsx("span",{className:"text-sidebar-foreground truncate",style:ko,children:r.name})]}),e.jsx("nav",{className:"flex-1 overflow-y-auto py-3 px-2",children:t.map(i=>e.jsxs("div",{className:"mb-4",children:[!a&&e.jsx("span",{className:"px-2 mb-1.5 block text-muted-foreground uppercase tracking-wider",style:Be,children:i.label}),e.jsx("div",{className:"space-y-0.5",children:i.items.map(d=>{const c=s===d.id;return e.jsxs("button",{onClick:()=>o==null?void 0:o(d),className:`w-full flex items-center gap-2 px-2 py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${c?"bg-sidebar-accent text-sidebar-accent-foreground":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:zo,children:[e.jsx("span",{className:c?"text-sidebar-primary":"text-muted-foreground",children:d.icon}),!a&&e.jsx("span",{className:"truncate flex-1 text-left",children:d.label}),!a&&d.badge&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:{...Be,lineHeight:"1"},children:d.badge})]},d.id)})})]},i.label))}),n&&e.jsx("div",{className:"px-3 py-3 border-t border-sidebar-border",children:e.jsx("button",{onClick:()=>n(!a),className:"w-full px-2 py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer text-left",style:Fo,children:a?">":"Collapse"})})]})}jr.displayName="Sidebar";function Q({width:r,height:t,variant:s="rectangular",animate:o=!0,className:a}){const n="bg-muted",l=o?"animate-pulse":"",i=s==="circular"?"rounded-full":s==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${n} ${l} ${i} ${a??""}`,style:{width:r??"100%",height:t??(s==="text"?"1em":s==="circular"?40:20)}})}function Co(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(Q,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(Q,{variant:"text",width:"60%",height:20}),e.jsx(Q,{variant:"text",width:"100%",height:14}),e.jsx(Q,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Q,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(Q,{variant:"text",width:"40%",height:14}),e.jsx(Q,{variant:"text",width:"25%",height:12})]})]})]})}function Wo(){return e.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex gap-4",children:[120,160,100,80].map((r,t)=>e.jsx(Q,{variant:"text",width:r,height:14},t))}),[0,1,2,3].map(r=>e.jsxs("div",{className:"px-4 py-3 border-b border-border flex items-center gap-4",children:[e.jsx(Q,{variant:"circular",width:28,height:28}),e.jsx(Q,{variant:"text",width:100+r*15,height:14}),e.jsx(Q,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(Q,{variant:"rounded",width:60,height:22}),e.jsx(Q,{variant:"text",width:80,height:14})]},r))]})}function Lo(){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:[0,1,2].map(r=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 rounded-[var(--radius-md)] border border-border bg-card",children:[e.jsx(Q,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(Q,{variant:"text",width:`${60+r*10}%`,height:14}),e.jsx(Q,{variant:"text",width:`${40+r*5}%`,height:12})]}),e.jsx(Q,{variant:"rounded",width:50,height:24})]},r))})}const Do={sm:"w-4 h-4 border-2",md:"w-8 h-8 border-[3px]",lg:"w-12 h-12 border-4",xl:"w-16 h-16 border-4"};function Tr({size:r="md",color:t,className:s=""}){return e.jsx("div",{className:`${Do[r]} rounded-full border-muted animate-spin ${s}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}Tr.displayName="Spinner";const He={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ir={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Er={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Br={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Mo={sm:{fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},md:{fontFamily:"var(--font-h2)",fontSize:"var(--text-h2)",fontWeight:"var(--weight-h2)"},lg:{fontFamily:"var(--font-h1)",fontSize:"var(--text-h1)",fontWeight:"var(--weight-h1)"}};function Ao({title:r,value:t,prefix:s,suffix:o,trend:a,trendLabel:n,icon:l,size:i="md",loading:d}){const c=Mo[i],b=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",g=(a==null?void 0:a.direction)==="up"?u.ArrowUpRight:(a==null?void 0:a.direction)==="down"?u.ArrowDownRight:u.Minus;return d?e.jsxs("div",{className:"space-y-2 animate-pulse",children:[e.jsx("div",{className:"h-3 w-20 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-8 w-32 bg-muted rounded-[var(--radius-sm)]"}),e.jsx("div",{className:"h-3 w-24 bg-muted rounded-[var(--radius-sm)]"})]}):e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[l&&e.jsx("span",{className:"text-muted-foreground",children:l}),e.jsx("span",{className:"text-muted-foreground",style:He,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[s&&e.jsx("span",{className:"text-muted-foreground",style:Ir,children:s}),e.jsx("span",{className:"text-foreground",style:c,children:typeof t=="number"?t.toLocaleString():t}),o&&e.jsx("span",{className:"text-muted-foreground",style:He,children:o})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${b}`,children:[e.jsx(g,{size:14}),e.jsxs("span",{style:Br,children:[a.value,"%"]}),n&&e.jsx("span",{className:"text-muted-foreground",style:Er,children:n})]})]})}function jo({title:r,value:t,prefix:s,trend:o,trendLabel:a,icon:n,iconBg:l}){const i=(o==null?void 0:o.direction)==="up"?"text-chart-2":(o==null?void 0:o.direction)==="down"?"text-destructive":"text-muted-foreground",d=(o==null?void 0:o.direction)==="up"?u.ArrowUpRight:(o==null?void 0:o.direction)==="down"?u.ArrowDownRight:u.Minus;return e.jsx("div",{className:"rounded-[var(--radius-lg)] border border-border bg-card p-5",children:e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("span",{className:"text-muted-foreground",style:He,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[s&&e.jsx("span",{className:"text-muted-foreground",style:Ir,children:s}),e.jsx("span",{className:"text-foreground",style:{fontFamily:"var(--font-h3)",fontSize:"var(--text-h3)",fontWeight:"var(--weight-h3)"},children:typeof t=="number"?t.toLocaleString():t})]}),o&&e.jsxs("div",{className:`flex items-center gap-1 ${i}`,children:[e.jsx(d,{size:12}),e.jsxs("span",{style:Br,children:[o.value,"%"]}),a&&e.jsx("span",{className:"text-muted-foreground",style:Er,children:a})]})]}),n&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${l||"bg-primary/10 text-primary"}`,children:n})]})})}const To={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Hr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_r={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Yr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Xr({steps:r,current:t,orientation:s="horizontal",onStepClick:o,className:a=""}){return s==="vertical"?e.jsx("div",{className:`flex flex-col ${a}`,children:r.map((n,l)=>{const i=l<t,d=l===t;return e.jsxs("div",{className:"flex gap-3",onClick:()=>o==null?void 0:o(l),children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${o?"cursor-pointer":""} ${i||d?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Yr,children:i?e.jsx(u.Check,{size:14}):l+1}),l<r.length-1&&e.jsx("div",{className:`w-px flex-1 min-h-[24px] my-1 ${i?"bg-primary":"bg-border"}`})]}),e.jsxs("div",{className:`pb-6 ${l===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${d?"text-foreground":"text-muted-foreground"}`,style:d?Hr:To,children:n.title}),n.description&&e.jsx("span",{className:"text-muted-foreground block",style:_r,children:n.description})]})]},l)})}):e.jsx("div",{className:`flex items-center ${a}`,children:r.map((n,l)=>{const i=l<t,d=l===t;return e.jsxs("div",{className:`flex items-center ${l<r.length-1?"flex-1":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>o==null?void 0:o(l),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${o?"cursor-pointer":""} ${i||d?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:Yr,children:i?e.jsx(u.Check,{size:14}):l+1}),e.jsx("span",{className:`text-center ${d?"text-foreground":"text-muted-foreground"}`,style:d?Hr:_r,children:n.title})]}),l<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${i?"bg-primary":"bg-border"}`})]},l)})})}Xr.displayName="Stepper";const Io={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Eo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Bo={sm:{track:"w-7 h-4",thumb:"w-3 h-3",on:"translate-x-3"},md:{track:"w-10 h-6",thumb:"w-4.5 h-4.5",on:"translate-x-4.5"},lg:{track:"w-14 h-8",thumb:"w-6.5 h-6.5",on:"translate-x-6"}},Ho={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},_o={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Yo({checked:r,onChange:t,label:s,description:o,size:a="md",disabled:n,color:l="primary"}){const i=Bo[a],d=_o[a];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${n?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:n,className:`${i.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Ho[l]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-white shadow-sm absolute transition-transform",style:{width:d.w,height:d.h,top:"50%",transform:`translateY(-50%) translateX(${r?d.on:2}px)`,left:0}})}),(s||o)&&e.jsxs("div",{children:[s&&e.jsx("span",{className:"text-foreground block",style:Io,children:s}),o&&e.jsx("span",{className:"text-muted-foreground block",style:Eo,children:o})]})]})}const Xo={default:"bg-muted/50 text-foreground border-border",primary:"bg-primary/10 text-primary border-primary/20",success:"bg-chart-2/10 text-chart-2 border-chart-2/20",warning:"bg-chart-5/10 text-chart-5 border-chart-5/20",destructive:"bg-destructive/10 text-destructive border-destructive/20",info:"bg-accent text-accent-foreground border-primary/20"},Oo={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Uo={sm:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},md:{fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},lg:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"}};function Or({children:r,color:t="default",size:s="md",icon:o,closable:a,onClose:n,className:l=""}){const i=Xo[t],d=Oo[s],c=Uo[s];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${i} ${d} ${l}`,style:c,children:[o&&e.jsx("span",{className:"flex-shrink-0",children:o}),r,a&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:n,children:e.jsx(u.X,{size:s==="sm"?10:12})})]})}Or.displayName="Tag";const Po={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Go={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},Ko={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function Ur({tags:r,onChange:t,placeholder:s,disabled:o,maxTags:a,variant:n="default",className:l=""}){const[i,d]=h.useState(""),c=()=>{const g=i.trim();!g||r.includes(g)||a&&r.length>=a||(t([...r,g]),d(""))},b=g=>{t(r.filter(m=>m!==g))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${Ko[n]} transition-colors focus-within:border-primary ${o?"opacity-50 pointer-events-none":""} ${l}`,children:[r.map(g=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-[var(--radius-sm)] bg-primary/10 text-primary",style:Go,children:[g,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>b(g),children:e.jsx(u.X,{size:12})})]},g)),e.jsx("input",{value:i,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Enter"&&(g.preventDefault(),c()),g.key==="Backspace"&&!i&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":s,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Po,disabled:o})]})}Ur.displayName="TagInput";const qo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Pr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_e={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Zo({items:r,variant:t="default",size:s="md"}){const o=s==="sm"?"w-6 h-6":s==="lg"?"w-10 h-10":"w-8 h-8",a=s==="sm"?12:s==="lg"?18:14,n=l=>l==="completed"?"bg-chart-2 text-white":l==="current"?"bg-primary text-primary-foreground":l==="error"?"bg-destructive text-white":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((l,i)=>e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:`${o} rounded-full flex items-center justify-center flex-shrink-0 ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(u.CheckCircle2,{size:a}):e.jsx(u.Circle,{size:a}))}),i<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 min-h-4 bg-border"})]}),e.jsxs("div",{className:"pb-4 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-foreground",style:Pr,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:_e,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:_e,children:l.description})]})]},i))}):e.jsx("div",{className:"relative",children:r.map((l,i)=>{const d=t==="alternate"&&i%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${d?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${o} rounded-full flex items-center justify-center ${n(l.status)}`,children:l.icon||(l.status==="completed"?e.jsx(u.CheckCircle2,{size:a}):e.jsx(u.Circle,{size:a}))}),i<r.length-1&&e.jsx("div",{className:"w-0.5 flex-1 bg-border mt-1"})]}),e.jsxs("div",{className:`flex-1 min-w-0 ${d?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${d?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:Pr,children:l.title}),l.time&&e.jsx("span",{className:"text-muted-foreground",style:_e,children:l.time})]}),l.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:qo,children:l.description}),l.children&&e.jsx("div",{className:"mt-2",children:l.children})]})]},i)})})}const Jo={top:"bottom-full left-1/2 -translate-x-1/2 mb-2",bottom:"top-full left-1/2 -translate-x-1/2 mt-2",left:"right-full top-1/2 -translate-y-1/2 mr-2",right:"left-full top-1/2 -translate-y-1/2 ml-2"},Qo={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Gr({children:r,content:t,placement:s="top",className:o=""}){const[a,n]=h.useState(!1);return e.jsxs("div",{className:`relative inline-flex ${o}`,onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),onFocus:()=>n(!0),onBlur:()=>n(!1),children:[r,a&&e.jsx("div",{className:`absolute ${Jo[s]} z-50 px-3 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-md`,style:Qo,role:"tooltip",children:t})]})}Gr.displayName="Tooltip";const ke={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function Kr({brand:r,breadcrumbs:t,actions:s,user:o,height:a="72px",showSearch:n=!1,searchPlaceholder:l="Search... (Ctrl+K)",onSearchClick:i,notificationCount:d,onNotificationClick:c,onMobileMenuClick:b,onUserClick:g,onBreadcrumbClick:m,className:f=""}){const k=o!=null&&o.name?o.name.split(" ").map(y=>y[0]).join("").slice(0,2).toUpperCase():"";return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-5 gap-4 ${f}`,style:{height:a},children:[b&&e.jsx("button",{className:"lg:hidden w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:b,children:e.jsx(u.Menu,{size:16})}),r&&e.jsx(e.Fragment,{children:typeof r.logo=="string"?e.jsx("img",{src:r.logo,alt:r.name,className:"w-8 h-8 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):r.logo?e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] overflow-hidden flex-shrink-0",children:r.logo}):e.jsx("div",{className:"w-8 h-8 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ke,children:r.name.charAt(0).toUpperCase()})}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:ke,children:t.map((y,v)=>e.jsxs(h.Fragment,{children:[v>0&&e.jsx(u.ChevronRight,{size:12}),y.href||m?e.jsx("span",{className:`cursor-pointer ${v===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>m==null?void 0:m(y,v),children:y.label}):e.jsx("span",{className:v===t.length-1?"text-foreground":"",children:y.label})]},v))}),e.jsx("div",{className:"flex-1"}),n&&e.jsxs("div",{className:"hidden md:flex items-center gap-2 px-3 h-8 rounded-[var(--radius)] border border-border bg-muted/20 text-muted-foreground w-56 cursor-pointer hover:border-primary/40 transition-colors",onClick:i,children:[e.jsx(u.Search,{size:14}),e.jsx("span",{style:ke,children:l})]}),s,c&&e.jsxs("button",{className:"relative w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors cursor-pointer",onClick:c,children:[e.jsx(u.Bell,{size:16}),d!==void 0&&d>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),o&&e.jsx("div",{className:"cursor-pointer",onClick:g,children:o.avatar?e.jsx("img",{src:o.avatar,alt:o.name,className:"w-8 h-8 rounded-full object-cover"}):e.jsx("div",{className:"w-8 h-8 rounded-full bg-primary text-primary-foreground flex items-center justify-center",style:ke,children:k})})]})}Kr.displayName="TopNavbar";const Vo={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ro={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Ye={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function qr({title:r,items:t,selected:s,onToggle:o,search:a,onSearch:n,searchable:l}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-card overflow-hidden",children:[e.jsxs("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30 flex items-center justify-between",children:[e.jsx("span",{className:"text-foreground",style:Ro,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:Ye,children:[t.length," items"]})]}),l&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(u.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:a,onChange:i=>n(i.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Ye})]}),e.jsxs("div",{className:"max-h-[240px] overflow-y-auto py-1",children:[t.length===0&&e.jsx("div",{className:"px-3 py-6 text-center text-muted-foreground",style:Ye,children:"No items"}),t.map(i=>e.jsxs("button",{onClick:()=>!i.disabled&&o(i.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
|
|
87
|
+
${s.has(i.id)?"bg-primary/10":"hover:bg-accent"}
|
|
88
|
+
${i.disabled?"opacity-40 pointer-events-none":""}`,style:Vo,children:[e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0
|
|
89
|
+
${s.has(i.id)?"bg-primary border-primary":"border-border"}`,children:s.has(i.id)&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"text-foreground truncate",children:i.label})]},i.id))]})]})}function es({sourceTitle:r="Available",targetTitle:t="Selected",items:s,defaultTarget:o=[],searchable:a,value:n,onChange:l}){const[i,d]=h.useState(new Set(o)),c=n!==void 0?new Set(n):i,b=L=>{l&&l(Array.from(L)),n===void 0&&d(L)},[g,m]=h.useState(new Set),[f,k]=h.useState(new Set),[y,v]=h.useState(""),[$,j]=h.useState(""),p=s.filter(L=>!c.has(L.id)),w=s.filter(L=>c.has(L.id)),F=y?p.filter(L=>L.label.toLowerCase().includes(y.toLowerCase())):p,W=$?w.filter(L=>L.label.toLowerCase().includes($.toLowerCase())):w,A=()=>{const L=new Set(c);g.forEach(S=>L.add(S)),b(L),m(new Set)},H=()=>{const L=new Set(c);f.forEach(S=>L.delete(S)),b(L),k(new Set)},D=()=>{b(new Set(s.filter(L=>!L.disabled).map(L=>L.id))),m(new Set)},C=()=>{b(new Set),k(new Set)},X=(L,S,I)=>{const O=new Set(S);O.has(L)?O.delete(L):O.add(L),I(O)};return e.jsxs("div",{className:"flex items-stretch gap-3 flex-wrap",children:[e.jsx(qr,{title:r,items:F,selected:g,onToggle:L=>X(L,g,m),search:y,onSearch:v,searchable:a}),e.jsxs("div",{className:"flex flex-col items-center justify-center gap-1.5 py-4",children:[e.jsx("button",{onClick:D,disabled:p.length===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(u.ChevronsRight,{size:14})}),e.jsx("button",{onClick:A,disabled:g.size===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(u.ChevronRight,{size:14})}),e.jsx("button",{onClick:H,disabled:f.size===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(u.ChevronLeft,{size:14})}),e.jsx("button",{onClick:C,disabled:w.length===0,className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] border border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",children:e.jsx(u.ChevronsLeft,{size:14})})]}),e.jsx(qr,{title:t,items:W,selected:f,onToggle:L=>X(L,f,k),search:$,onSearch:j,searchable:a})]})}const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function Zr({node:r,level:t,expanded:s,selected:o,onToggle:a,onSelect:n,selectable:l,showLines:i}){const d=r.children&&r.children.length>0,c=s.has(r.id),b=o.has(r.id),g=d?c?e.jsx(u.FolderOpen,{size:14,className:"text-chart-5"}):e.jsx(u.Folder,{size:14,className:"text-chart-5"}):e.jsx(u.File,{size:14,className:"text-muted-foreground"});return e.jsxs("div",{children:[e.jsxs("div",{className:`flex items-center gap-1.5 py-1 px-2 rounded-[var(--radius-sm)] transition-colors
|
|
90
90
|
${r.disabled?"opacity-40 pointer-events-none":"cursor-pointer hover:bg-accent"}
|
|
91
|
-
${
|
|
91
|
+
${b?"bg-primary/10 text-primary":"text-foreground"}`,style:{paddingLeft:`${t*20+8}px`,...rs},onClick:()=>{d&&a(r.id),l&&n(r.id)},children:[d?e.jsx("span",{className:"w-4 h-4 flex items-center justify-center flex-shrink-0",children:c?e.jsx(u.ChevronDown,{size:12}):e.jsx(u.ChevronRight,{size:12})}):e.jsx("span",{className:"w-4"}),l&&e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0 ${b?"bg-primary border-primary":"border-border"}`,children:b&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"flex-shrink-0",children:r.icon||g}),e.jsx("span",{className:"truncate",children:r.label})]}),d&&c&&e.jsx("div",{className:i?"border-l border-border ml-[22px]":"",children:r.children.map(m=>e.jsx(Zr,{node:m,level:t+1,expanded:s,selected:o,onToggle:a,onSelect:n,selectable:l,showLines:i},m.id))})]})}function ts({data:r,selectable:t,showLines:s,defaultExpanded:o,expandedItems:a,onExpandChange:n,selectedItems:l,onSelect:i}){const[d,c]=h.useState(new Set(o||[])),[b,g]=h.useState(new Set),m=a!==void 0?new Set(a):d,f=l!==void 0?new Set(l):b,k=v=>{const $=new Set(m);$.has(v)?$.delete(v):$.add(v),n&&n(Array.from($)),a===void 0&&c($)},y=v=>{const $=new Set(f);$.has(v)?$.delete(v):$.add(v),i&&i(Array.from($)),l===void 0&&g($)};return e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card py-1",children:r.map(v=>e.jsx(Zr,{node:v,level:0,expanded:m,selected:f,onToggle:k,onSelect:y,selectable:t,showLines:s},v.id))})}const os={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},Xe={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Jr=h.createContext({name:""});function ss(){return h.useContext(Jr)}function Oe({htmlFor:r,required:t,children:s,className:o=""}){return e.jsxs("label",{htmlFor:r,className:`block text-foreground mb-1.5 ${o}`,style:os,children:[s,t&&e.jsx("span",{className:"text-destructive ml-0.5",children:"*"})]})}function Qr({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-destructive ${t}`,style:Xe,role:"alert",children:[e.jsx(u.AlertCircle,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function Vr({message:r,className:t=""}){return r?e.jsxs("div",{className:`flex items-center gap-1 mt-1.5 text-[var(--color-chart-2,#059669)] ${t}`,style:Xe,role:"status",children:[e.jsx(u.CheckCircle2,{size:12,className:"flex-shrink-0"}),e.jsx("span",{children:r})]}):null}function Rr({children:r,className:t=""}){return e.jsx("p",{className:`mt-1.5 text-muted-foreground ${t}`,style:Xe,children:r})}function as({name:r,label:t,required:s,error:o,successMessage:a,helperText:n,layout:l="vertical",labelWidth:i="160px",children:d,className:c=""}){const b=l==="horizontal",g=o?e.jsx(Qr,{message:o}):a?e.jsx(Vr,{message:a}):n?e.jsx(Rr,{children:n}):null;return e.jsx(Jr.Provider,{value:{name:r,error:o},children:b?e.jsxs("div",{className:`flex items-start gap-4 ${c}`,children:[t&&e.jsx("div",{style:{width:i,flexShrink:0,paddingTop:"6px"},children:e.jsx(Oe,{htmlFor:r,required:s,children:t})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[d,g]})]}):e.jsxs("div",{className:`${c}`,children:[t&&e.jsx(Oe,{htmlFor:r,required:s,children:t}),d,g]})})}const ns={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ls={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},is={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},ds={sm:"h-8 text-sm",md:"h-10",lg:"h-12 text-lg"},et={sm:14,md:16,lg:18};function cs({value:r,defaultValue:t=0,onChange:s,min:o,max:a,step:n=1,disabled:l,size:i="md",label:d,placeholder:c,error:b,className:g=""}){const[m,f]=h.useState(t),k=r??m,y=j=>{const p=Math.max(o??-1/0,Math.min(a??1/0,j));s&&s(p),r===void 0&&f(p)},v=o===void 0||k-n>=o,$=a===void 0||k+n<=a;return e.jsxs("div",{className:g,children:[d&&e.jsx("label",{className:"block text-foreground mb-1.5",style:ns,children:d}),e.jsxs("div",{className:`inline-flex items-center rounded-[var(--radius-md)] border ${b?"border-destructive":"border-border"} bg-background overflow-hidden ${l?"opacity-50 pointer-events-none":""}`,children:[e.jsx("button",{type:"button",onClick:()=>y(k-n),disabled:l||!v,className:"flex items-center justify-center px-2.5 border-r border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",style:{height:"100%"},children:e.jsx(u.Minus,{size:et[i]})}),e.jsx("input",{type:"number",value:k,placeholder:c,onChange:j=>{const p=parseFloat(j.target.value);isNaN(p)||y(p)},disabled:l,className:`w-20 text-center bg-transparent outline-none text-foreground ${ds[i]} [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none`,style:ls}),e.jsx("button",{type:"button",onClick:()=>y(k+n),disabled:l||!$,className:"flex items-center justify-center px-2.5 border-l border-border text-muted-foreground hover:text-foreground hover:bg-accent disabled:opacity-30 transition-colors cursor-pointer",style:{height:"100%"},children:e.jsx(u.Plus,{size:et[i]})})]}),b&&e.jsx("p",{className:"mt-1.5 text-destructive",style:is,children:b})]})}const fs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},hs={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},bs={sm:"w-9 h-9 text-sm",md:"w-11 h-11 text-base",lg:"w-14 h-14 text-xl"};function us({length:r=6,value:t,onChange:s,onComplete:o,disabled:a,error:n,size:l="md",label:i,masked:d,className:c=""}){const[b,g]=h.useState(()=>"".padEnd(r,"")),m=h.useRef([]),k=(t??b).padEnd(r,"").split("").slice(0,r),y=h.useCallback(p=>{s&&s(p),t===void 0&&g(p),p.replace(/ /g,"").length===r&&o&&o(p)},[s,o,t,r]),v=(p,w)=>{var A;if(!/^\d$/.test(w))return;const F=k.slice();F[p]=w;const W=F.join("");y(W),p<r-1&&((A=m.current[p+1])==null||A.focus())},$=(p,w)=>{var F,W,A;if(w.key==="Backspace"){w.preventDefault();const H=k.slice();H[p]!==" "&&H[p]!==""?(H[p]=" ",y(H.join(""))):p>0&&(H[p-1]=" ",y(H.join("")),(F=m.current[p-1])==null||F.focus())}else w.key==="ArrowLeft"&&p>0?(W=m.current[p-1])==null||W.focus():w.key==="ArrowRight"&&p<r-1&&((A=m.current[p+1])==null||A.focus())},j=p=>{var F;p.preventDefault();const w=p.clipboardData.getData("text").replace(/\D/g,"").slice(0,r);if(w){y(w.padEnd(r," "));const W=Math.min(w.length,r-1);(F=m.current[W])==null||F.focus()}};return e.jsxs("div",{className:c,children:[i&&e.jsx("label",{className:"block text-foreground mb-2",style:fs,children:i}),e.jsx("div",{className:"flex gap-2",onPaste:j,children:k.map((p,w)=>e.jsx("input",{ref:F=>{m.current[w]=F},type:d?"password":"text",inputMode:"numeric",maxLength:1,value:p===" "?"":p,disabled:a,onChange:F=>{const W=F.target.value;W&&v(w,W[W.length-1])},onKeyDown:F=>$(w,F),onFocus:F=>F.target.select(),className:`${bs[l]} text-center rounded-[var(--radius-md)] border outline-none transition-all
|
|
92
92
|
${n?"border-destructive focus:ring-2 focus:ring-destructive/30":"border-border focus:border-primary focus:ring-2 focus:ring-primary/20"}
|
|
93
93
|
${a?"opacity-50 pointer-events-none bg-muted":"bg-background"}
|
|
94
|
-
text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},S))}),n&&e.jsx("p",{className:"mt-2 text-destructive",style:ls,children:n})]})}const cs={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},fs={fontFamily:"var(--font-p, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-p, 24px)",fontWeight:"var(--weight-p, 400)",color:"var(--muted-foreground)",lineHeight:1.4},hs={fontFamily:"var(--font-caption, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-caption, 20px)"};function bs({title:r,subtitle:t,breadcrumb:s,actions:o,tabs:a,sticky:n=!1,className:l=""}){return e.jsxs("div",{className:`bg-[var(--background,#fff)] border-b border-[var(--border,#e5e7eb)] ${n?"sticky top-0 z-10":""} ${l}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[s&&e.jsx("div",{className:"mb-2",style:hs,children:s}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{style:cs,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:fs,children:t})]}),o&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 pt-0.5",children:o})]})]}),a&&e.jsx("div",{className:"px-6",children:a})]})}const us={fontFamily:"var(--font-button, 'Inter', sans-serif)",fontSize:"var(--text-button, 14px)",fontWeight:"var(--weight-button, 600)"},we={fontFamily:"var(--font-button, 'Inter', sans-serif)",fontSize:"var(--text-button, 13px)",fontWeight:400};function vs({config:r,value:t,onChange:s}){var f;const[o,a]=b.useState(!1),n=Array.isArray(t)?t:t?[t]:[],l=n.length>0,d=b.useCallback(h=>{if(r.type==="single"){const g=n[0]===h?null:h;s(r.key,g),a(!1)}else{const g=n.includes(h)?n.filter(m=>m!==h):[...n,h];s(r.key,g.length?g:null)}},[r,n,s]),i=n.length===1?(f=r.options.find(h=>h.value===n[0]))==null?void 0:f.label:n.length>1?`${r.label} (${n.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(h=>!h),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${l?"bg-[var(--primary,#32a9ff)]/10 border-[var(--primary,#32a9ff)] text-[var(--primary,#32a9ff)]":"bg-[var(--background,#fff)] border-[var(--border,#e5e7eb)] text-[var(--foreground,#1f2937)] hover:bg-[var(--muted,#f3f4f6)]"}`,style:us,children:[i,l&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary,#32a9ff)] text-white text-[10px] font-bold",children:n.length}),e.jsx(u.ChevronDown,{size:14,className:`transition-transform ${o?"rotate-180":""}`})]}),o&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),e.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 bg-[var(--card,#fff)] border border-[var(--border,#e5e7eb)] rounded-lg shadow-md min-w-[160px] py-1 overflow-hidden",children:r.options.map(h=>{const g=n.includes(h.value);return e.jsxs("button",{type:"button",onClick:()=>d(h.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${g?"bg-[var(--primary,#32a9ff)]/10 text-[var(--primary,#32a9ff)]":"text-[var(--foreground,#1f2937)] hover:bg-[var(--muted,#f3f4f6)]"}`,style:we,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${g?"bg-[var(--primary,#32a9ff)] border-[var(--primary,#32a9ff)]":"border-[var(--border,#e5e7eb)]"}`,children:g&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),h.label]},h.value)})})]})]})}function gs({filters:r=[],searchPlaceholder:t="Search...",showSearch:s=!0,value:o,onFilterChange:a,className:n=""}){const[l,d]=b.useState({search:"",filters:{}}),i=o??l,f=b.useCallback(y=>{d(y),a==null||a(y)},[a]),h=b.useCallback(y=>{f({...i,search:y.target.value})},[i,f]),g=b.useCallback((y,v)=>{f({...i,filters:{...i.filters,[y]:v}})},[i,f]),m=b.useCallback(()=>{f({search:"",filters:{}})},[f]),c=Object.values(i.filters).filter(y=>y!==null&&(!Array.isArray(y)||y.length>0)).length,k=c>0||i.search&&i.search.length>0;return e.jsxs("div",{className:`flex items-center gap-2 flex-wrap bg-[var(--background,#fff)] border border-[var(--border,#e5e7eb)] rounded-lg px-3 py-2 ${n}`,children:[s&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(u.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground,#6b7280)] pointer-events-none"}),e.jsx("input",{type:"text",value:i.search??"",onChange:h,placeholder:t,className:"h-8 pl-8 pr-3 rounded-md border border-[var(--border,#e5e7eb)] bg-[var(--background,#fff)] text-[var(--foreground,#1f2937)] placeholder:text-[var(--muted-foreground,#9ca3af)] focus:outline-none focus:border-[var(--primary,#32a9ff)] focus:ring-1 focus:ring-[var(--primary,#32a9ff)] transition-colors min-w-[200px]",style:we})]}),s&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border,#e5e7eb)] flex-shrink-0"}),r.length>0&&e.jsx(u.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground,#6b7280)] flex-shrink-0"}),r.map(y=>e.jsx(vs,{config:y,value:i.filters[y.key]??null,onChange:g},y.key)),c>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-[var(--primary,#32a9ff)]/10 text-[var(--primary,#32a9ff)]",style:{...we,fontSize:"12px"},children:[c," active"]}),k&&e.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 h-7 px-2 rounded-md text-[var(--muted-foreground,#6b7280)] hover:text-[var(--foreground,#1f2937)] hover:bg-[var(--muted,#f3f4f6)] transition-colors cursor-pointer ml-auto",style:we,children:[e.jsx(u.X,{size:12}),"Clear all"]})]})}w.Accordion=dr,w.AccordionItem=Me,w.Alert=Ve,w.Avatar=fr,w.AvatarGroup=hr,w.Badge=dt,w.Breadcrumb=Bt,w.Button=Ce,w.ButtonGroup=ot,w.Card=br,w.CardBody=vr,w.CardFooter=gr,w.CardHeader=ur,w.Checkbox=rr,w.CheckboxGroup=ft,w.ColorPicker=Kt,w.ConfirmDialog=wt,w.DSButton=Ce,w.DSCheckbox=rr,w.DSInput=We,w.DSRadio=or,w.DSTable=ir,w.DSTextarea=Le,w.DatePicker=xt,w.Divider=mr,w.Drawer=xr,w.Dropdown=yr,w.EmptyState=Vt,w.FileUpload=to,w.FilterBar=gs,w.FormError=Pr,w.FormField=es,w.FormHelperText=Jr,w.FormLabel=He,w.FormSuccess=qr,w.IconButton=qe,w.ImagePreview=ao,w.Input=We,w.Menu=zr,w.Modal=lr,w.Notification=Cr,w.NotificationCenter=ho,w.NumberInput=as,w.OTPInput=ds,w.PageHeader=bs,w.Pagination=kt,w.Popover=uo,w.ProgressBar=Wr,w.Radio=or,w.RadioGroup=bt,w.Rating=xo,w.SearchField=Ct,w.Sidebar=Lr,w.Skeleton=P,w.SkeletonCard=So,w.SkeletonList=ko,w.SkeletonTable=$o,w.Spinner=Dr,w.StatCard=Wo,w.Statistic=Co,w.Stepper=Br,w.Switch=Io,w.Table=ir,w.Tabs=Lt,w.Tag=Hr,w.TagInput=Yr,w.Textarea=Le,w.Timeline=Uo,w.ToastContainer=at,w.Tooltip=Xr,w.TopNavbar=Or,w.TransferList=Jo,w.Tree=Qo,w.toast=oe,w.useFormField=Ro,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));
|
|
94
|
+
text-foreground`,style:{fontFamily:"var(--font-button)",fontWeight:"var(--weight-button)"}},w))}),n&&e.jsx("p",{className:"mt-2 text-destructive",style:hs,children:n})]})}const vs={fontFamily:"var(--font-h3, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-h3, 28px)",fontWeight:"var(--weight-h3, 700)",color:"var(--foreground)",lineHeight:1.3},gs={fontFamily:"var(--font-p, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-p, 24px)",fontWeight:"var(--weight-p, 400)",color:"var(--muted-foreground)",lineHeight:1.4},ps={fontFamily:"var(--font-caption, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-caption, 20px)"};function ms({title:r,subtitle:t,breadcrumb:s,actions:o,tabs:a,sticky:n=!1,className:l=""}){return e.jsxs("div",{className:`bg-[var(--background,#fff)] border-b border-[var(--border,#e5e7eb)] ${n?"sticky top-0 z-10":""} ${l}`,children:[e.jsxs("div",{className:"px-6 pt-5 pb-4",children:[s&&e.jsx("div",{className:"mb-2",style:ps,children:s}),e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{style:vs,className:"truncate",children:r}),t&&e.jsx("p",{className:"mt-0.5",style:gs,children:t})]}),o&&e.jsx("div",{className:"flex items-center gap-2 flex-shrink-0 pt-0.5",children:o})]})]}),a&&e.jsx("div",{className:"px-6",children:a})]})}const xs={fontFamily:"var(--font-button, 'Inter', sans-serif)",fontSize:"var(--text-button, 14px)",fontWeight:"var(--weight-button, 600)"},ze={fontFamily:"var(--font-button, 'Inter', sans-serif)",fontSize:"var(--text-button, 13px)",fontWeight:400};function ys({config:r,value:t,onChange:s}){var c;const[o,a]=h.useState(!1),n=Array.isArray(t)?t:t?[t]:[],l=n.length>0,i=h.useCallback(b=>{if(r.type==="single"){const g=n[0]===b?null:b;s(r.key,g),a(!1)}else{const g=n.includes(b)?n.filter(m=>m!==b):[...n,b];s(r.key,g.length?g:null)}},[r,n,s]),d=n.length===1?(c=r.options.find(b=>b.value===n[0]))==null?void 0:c.label:n.length>1?`${r.label} (${n.length})`:r.label;return e.jsxs("div",{className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(b=>!b),className:`inline-flex items-center gap-1.5 h-9 px-3 rounded-lg border transition-colors cursor-pointer select-none ${l?"bg-[var(--primary,#32a9ff)]/10 border-[var(--primary,#32a9ff)] text-[var(--primary,#32a9ff)]":"bg-[var(--background,#fff)] border-[var(--border,#e5e7eb)] text-[var(--foreground,#1f2937)] hover:bg-[var(--muted,#f3f4f6)]"}`,style:xs,children:[d,l&&e.jsx("span",{className:"inline-flex items-center justify-center w-4 h-4 rounded-full bg-[var(--primary,#32a9ff)] text-white text-[10px] font-bold",children:n.length}),e.jsx(u.ChevronDown,{size:14,className:`transition-transform ${o?"rotate-180":""}`})]}),o&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed inset-0 z-10",onClick:()=>a(!1)}),e.jsx("div",{className:"absolute left-0 top-full mt-1 z-20 bg-[var(--card,#fff)] border border-[var(--border,#e5e7eb)] rounded-lg shadow-md min-w-[160px] py-1 overflow-hidden",children:r.options.map(b=>{const g=n.includes(b.value);return e.jsxs("button",{type:"button",onClick:()=>i(b.value),className:`w-full flex items-center gap-2 px-3 py-2 text-left transition-colors cursor-pointer ${g?"bg-[var(--primary,#32a9ff)]/10 text-[var(--primary,#32a9ff)]":"text-[var(--foreground,#1f2937)] hover:bg-[var(--muted,#f3f4f6)]"}`,style:ze,children:[r.type==="multi"&&e.jsx("span",{className:`inline-flex items-center justify-center w-4 h-4 rounded border flex-shrink-0 ${g?"bg-[var(--primary,#32a9ff)] border-[var(--primary,#32a9ff)]":"border-[var(--border,#e5e7eb)]"}`,children:g&&e.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:e.jsx("path",{d:"M1 4L3.5 6.5L9 1",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),b.label]},b.value)})})]})]})}function ws({filters:r=[],searchPlaceholder:t="Search...",showSearch:s=!0,value:o,onFilterChange:a,className:n=""}){const[l,i]=h.useState({search:"",filters:{}}),d=o??l,c=h.useCallback(y=>{i(y),a==null||a(y)},[a]),b=h.useCallback(y=>{c({...d,search:y.target.value})},[d,c]),g=h.useCallback((y,v)=>{c({...d,filters:{...d.filters,[y]:v}})},[d,c]),m=h.useCallback(()=>{c({search:"",filters:{}})},[c]),f=Object.values(d.filters).filter(y=>y!==null&&(!Array.isArray(y)||y.length>0)).length,k=f>0||d.search&&d.search.length>0;return e.jsxs("div",{className:`flex items-center gap-2 flex-wrap bg-[var(--background,#fff)] border border-[var(--border,#e5e7eb)] rounded-lg px-3 py-2 ${n}`,children:[s&&e.jsxs("div",{className:"relative flex items-center",children:[e.jsx(u.Search,{size:14,className:"absolute left-2.5 text-[var(--muted-foreground,#6b7280)] pointer-events-none"}),e.jsx("input",{type:"text",value:d.search??"",onChange:b,placeholder:t,className:"h-8 pl-8 pr-3 rounded-md border border-[var(--border,#e5e7eb)] bg-[var(--background,#fff)] text-[var(--foreground,#1f2937)] placeholder:text-[var(--muted-foreground,#9ca3af)] focus:outline-none focus:border-[var(--primary,#32a9ff)] focus:ring-1 focus:ring-[var(--primary,#32a9ff)] transition-colors min-w-[200px]",style:ze})]}),s&&r.length>0&&e.jsx("div",{className:"w-px h-5 bg-[var(--border,#e5e7eb)] flex-shrink-0"}),r.length>0&&e.jsx(u.SlidersHorizontal,{size:14,className:"text-[var(--muted-foreground,#6b7280)] flex-shrink-0"}),r.map(y=>e.jsx(ys,{config:y,value:d.filters[y.key]??null,onChange:g},y.key)),f>0&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-[var(--primary,#32a9ff)]/10 text-[var(--primary,#32a9ff)]",style:{...ze,fontSize:"12px"},children:[f," active"]}),k&&e.jsxs("button",{type:"button",onClick:m,className:"inline-flex items-center gap-1 h-7 px-2 rounded-md text-[var(--muted-foreground,#6b7280)] hover:text-[var(--foreground,#1f2937)] hover:bg-[var(--muted,#f3f4f6)] transition-colors cursor-pointer ml-auto",style:ze,children:[e.jsx(u.X,{size:12}),"Clear all"]})]})}const rt={fontFamily:"var(--font-button, 'Inter', sans-serif)",fontSize:"var(--text-button, 14px)",fontWeight:"var(--weight-button, 600)"},Ue={fontFamily:"var(--font-label, 'DB HeaventRounded', sans-serif)",fontSize:"var(--text-label, 18px)",fontWeight:"var(--weight-label, 400)"},fe={fontFamily:"var(--font-button, 'Inter', sans-serif)",fontSize:"13px",fontWeight:400},se={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-5 py-4"};function Ns({width:r}){return e.jsx("div",{className:"h-4 rounded bg-muted animate-pulse",style:{width:r??"80%"}})}function Ss({columns:r,hidden:t,onToggle:s}){const[o,a]=h.useState(!1),n=h.useRef(null);h.useEffect(()=>{function i(d){n.current&&!n.current.contains(d.target)&&a(!1)}return o&&document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[o]);const l=r.filter(i=>i.hideable!==!1);return e.jsxs("div",{ref:n,className:"relative",children:[e.jsxs("button",{type:"button",onClick:()=>a(i=>!i),className:"inline-flex items-center gap-1.5 h-8 px-3 rounded-lg border border-[var(--border,#e5e7eb)] bg-[var(--background,#fff)] text-[var(--muted-foreground,#6b7280)] hover:bg-[var(--muted,#f3f4f6)] hover:text-[var(--foreground,#1f2937)] transition-colors cursor-pointer",style:fe,children:[e.jsx(u.Columns3,{size:14}),"Columns"]}),o&&e.jsx("div",{className:"absolute right-0 top-full mt-1 z-30 bg-[var(--card,#fff)] border border-[var(--border,#e5e7eb)] rounded-lg shadow-md w-44 py-1",children:l.map(i=>{const d=!t.has(i.key);return e.jsxs("button",{type:"button",onClick:()=>s(i.key),className:"w-full flex items-center justify-between gap-2 px-3 py-2 hover:bg-[var(--muted,#f3f4f6)] text-[var(--foreground,#1f2937)] transition-colors cursor-pointer",style:fe,children:[e.jsx("span",{children:i.header}),d&&e.jsx(u.Check,{size:13,className:"text-[var(--primary,#32a9ff)]"})]},i.key)})})]})}function $s({count:r,actions:t,selectedKeys:s,onClear:o}){return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-2.5 bg-[var(--primary,#32a9ff)]/8 border-b border-[var(--primary,#32a9ff)]/20",children:[e.jsxs("span",{className:"text-[var(--primary,#32a9ff)] flex-shrink-0",style:{...rt,fontSize:13},children:[r," selected"]}),e.jsx("div",{className:"flex items-center gap-2 flex-1 flex-wrap",children:t.map((a,n)=>e.jsxs("button",{type:"button",onClick:()=>a.onClick(s),className:`inline-flex items-center gap-1.5 h-7 px-3 rounded-md border transition-colors cursor-pointer ${a.variant==="destructive"?"border-[var(--destructive,#e11d48)] text-[var(--destructive,#e11d48)] hover:bg-[var(--destructive,#e11d48)]/10":"border-[var(--primary,#32a9ff)] text-[var(--primary,#32a9ff)] hover:bg-[var(--primary,#32a9ff)]/10"}`,style:{...fe,fontWeight:500},children:[a.icon,a.label]},n))}),e.jsx("button",{type:"button",onClick:o,className:"text-[var(--muted-foreground,#6b7280)] hover:text-[var(--foreground,#1f2937)] transition-colors cursor-pointer p-1 rounded",title:"Clear selection",children:e.jsx(u.X,{size:14})})]})}const ks=[10,20,50,100];function zs({meta:r,onPageChange:t}){const{page:s,pageSize:o,totalCount:a}=r,n=Math.max(1,Math.ceil(a/o)),l=a===0?0:(s-1)*o+1,i=Math.min(s*o,a),d=h.useMemo(()=>{const c=[];if(n<=7)for(let b=1;b<=n;b++)c.push(b);else{c.push(1),s>3&&c.push("...");for(let b=Math.max(2,s-1);b<=Math.min(n-1,s+1);b++)c.push(b);s<n-2&&c.push("..."),c.push(n)}return c},[s,n]);return e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[var(--border,#e5e7eb)] flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-[var(--muted-foreground,#6b7280)] whitespace-nowrap",style:fe,children:[l,"–",i," of ",a.toLocaleString()]}),e.jsx("select",{value:o,onChange:c=>t(1,Number(c.target.value)),className:"h-7 px-2 rounded-md border border-[var(--border,#e5e7eb)] bg-[var(--background,#fff)] text-[var(--foreground,#1f2937)] focus:outline-none focus:border-[var(--primary,#32a9ff)] cursor-pointer",style:fe,children:ks.map(c=>e.jsxs("option",{value:c,children:[c," / page"]},c))})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Pe,{disabled:s===1,onClick:()=>t(s-1,o),label:"‹ Prev"}),d.map((c,b)=>c==="..."?e.jsx("span",{className:"px-2 text-[var(--muted-foreground,#6b7280)]",style:fe,children:"…"},`ellipsis-${b}`):e.jsx(Pe,{active:c===s,onClick:()=>t(c,o),label:String(c)},c)),e.jsx(Pe,{disabled:s===n,onClick:()=>t(s+1,o),label:"Next ›"})]})]})}function Pe({label:r,active:t,disabled:s,onClick:o}){return e.jsx("button",{type:"button",onClick:o,disabled:s,className:`min-w-[28px] h-7 px-2 rounded-md border transition-colors cursor-pointer ${t?"bg-[var(--primary,#32a9ff)] border-[var(--primary,#32a9ff)] text-white":s?"border-transparent text-[var(--muted-foreground,#9ca3af)] cursor-not-allowed":"border-[var(--border,#e5e7eb)] text-[var(--foreground,#1f2937)] hover:bg-[var(--muted,#f3f4f6)]"}`,style:{...fe,fontWeight:t?600:400},children:r})}function Fs({columns:r,data:t,rowKey:s="id",pagination:o,sortBy:a,sortOrder:n,onPageChange:l,onSortChange:i,selectable:d=!1,selectedRows:c,onSelectionChange:b,bulkActions:g=[],onRowClick:m,expandedRowRender:f,loading:k=!1,loadingRows:y=5,error:v,emptyMessage:$="No data found",emptyDescription:j,showColumnToggle:p=!1,size:w="md",stickyHeader:F=!1,className:W=""}){const[A,H]=h.useState(new Set(r.filter(z=>z.defaultHidden).map(z=>z.key))),D=h.useCallback(z=>{H(U=>{const E=new Set(U);return E.has(z)?E.delete(z):E.add(z),E})},[]),C=h.useMemo(()=>r.filter(z=>!A.has(z.key)),[r,A]),[X,L]=h.useState(new Set),S=c??X,I=h.useCallback(z=>{c||L(z);const U=t.filter(E=>z.has(E[s]));b==null||b(z,U)},[c,t,s,b]),O=h.useMemo(()=>t.map(z=>z[s]),[t,s]),P=O.length>0&&O.every(z=>S.has(z)),R=S.size>0&&!P,Z=h.useCallback(()=>{I(P?new Set:new Set(O))},[P,O,I]),ee=h.useCallback(z=>{const U=new Set(S);U.has(z)?U.delete(z):U.add(z),I(U)},[S,I]),[K,ae]=h.useState(new Set),te=h.useCallback(z=>{ae(U=>{const E=new Set(U);return E.has(z)?E.delete(z):E.add(z),E})},[]),ne=h.useCallback(z=>{i&&(a===z?i(z,n==="asc"?"desc":"asc"):i(z,"asc"))},[a,n,i]),le=h.useMemo(()=>{const z={};let U=0;d&&(U+=48),f&&(U+=40);for(const E of C)if(E.frozen){z[E.key]=U;const re=typeof E.width=="number"?E.width:parseInt(E.width??"120");U+=isNaN(re)?120:re}return z},[C,d,f]),ie=C.length+(d?1:0)+(f?1:0),_="sticky z-[1] bg-[var(--card,#fff)]",ce="sticky z-[2] bg-[var(--muted,#f9fafb)]";return e.jsxs("div",{className:`rounded-[var(--radius-lg,8px)] border border-[var(--border,#e5e7eb)] overflow-hidden ${W}`,children:[p&&e.jsx("div",{className:"flex items-center justify-end gap-2 px-4 py-2.5 border-b border-[var(--border,#e5e7eb)] bg-[var(--background,#fff)]",children:e.jsx(Ss,{columns:r,hidden:A,onToggle:D})}),d&&S.size>0&&g.length>0&&e.jsx($s,{count:S.size,actions:g,selectedKeys:Array.from(S),onClear:()=>I(new Set)}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full border-collapse",style:{minWidth:"100%"},children:[e.jsx("thead",{className:F?"sticky top-0 z-10":"",children:e.jsxs("tr",{className:"border-b border-[var(--border,#e5e7eb)] bg-[var(--muted,#f9fafb)]",children:[f&&e.jsx("th",{className:`${se[w]} w-10`}),d&&e.jsx("th",{className:`${se[w]} w-12`,children:e.jsx("input",{type:"checkbox",checked:P,ref:z=>{z&&(z.indeterminate=R)},onChange:Z,className:"w-4 h-4 rounded border-[var(--border)] accent-[var(--primary,#32a9ff)] cursor-pointer"})}),C.map(z=>{const U=z.frozen&&z.key in le,E=a===z.key;return e.jsx("th",{className:`${se[w]} text-${z.align??"left"} text-[var(--muted-foreground,#6b7280)] whitespace-nowrap select-none ${z.sortable&&i?"cursor-pointer hover:text-[var(--foreground,#1f2937)]":""} ${U?ce:""}`,style:{...rt,fontSize:13,width:z.width,minWidth:z.minWidth??80,...U?{left:le[z.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},onClick:()=>z.sortable&&ne(z.key),children:e.jsxs("span",{className:"inline-flex items-center gap-1",children:[z.header,z.sortable&&i&&e.jsx("span",{className:"text-[var(--muted-foreground,#9ca3af)]",children:E?n==="asc"?e.jsx(u.ChevronUp,{size:13}):e.jsx(u.ChevronDown,{size:13}):e.jsx(u.ChevronsUpDown,{size:12})})]})},z.key)})]})}),e.jsxs("tbody",{children:[v&&e.jsx("tr",{children:e.jsx("td",{colSpan:ie,className:`${se[w]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-10",children:[e.jsx(u.AlertCircle,{size:32,className:"text-[var(--destructive,#e11d48)] opacity-60"}),e.jsx("span",{className:"text-[var(--destructive,#e11d48)]",style:Ue,children:v})]})})}),!v&&k&&Array.from({length:y}).map((z,U)=>e.jsxs("tr",{className:"border-b border-[var(--border,#e5e7eb)] last:border-b-0",children:[f&&e.jsx("td",{className:`${se[w]} w-10`}),d&&e.jsx("td",{className:`${se[w]} w-12`,children:e.jsx("div",{className:"w-4 h-4 rounded bg-muted animate-pulse"})}),C.map(E=>e.jsx("td",{className:`${se[w]}`,children:e.jsx(Ns,{width:E.align==="right"?"60%":E.align==="center"?"50%":"75%"})},E.key))]},`skel-${U}`)),!v&&!k&&t.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:ie,className:`${se[w]} text-center`,children:e.jsxs("div",{className:"flex flex-col items-center gap-2 py-12",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-[var(--muted,#f3f4f6)] flex items-center justify-center text-[var(--muted-foreground,#9ca3af)]",children:e.jsx(u.ChevronsUpDown,{size:20})}),e.jsx("span",{className:"text-[var(--foreground,#1f2937)]",style:Ue,children:$}),j&&e.jsx("span",{className:"text-[var(--muted-foreground,#6b7280)]",style:fe,children:j})]})})}),!v&&!k&&t.map((z,U)=>{const E=z[s],re=S.has(E),ue=K.has(E),G=!!m||!!f;return e.jsxs(h.Fragment,{children:[e.jsxs("tr",{className:`border-b border-[var(--border,#e5e7eb)] last:border-b-0 transition-colors ${re?"bg-[var(--primary,#32a9ff)]/5":"bg-[var(--card,#fff)] hover:bg-[var(--muted,#f9fafb)]"} ${G?"cursor-pointer":""}`,onClick:()=>{m==null||m(z),f&&te(E)},children:[f&&e.jsx("td",{className:`${se[w]} w-10 text-center`,onClick:J=>{J.stopPropagation(),te(E)},children:e.jsx(u.ChevronRight,{size:14,className:`text-[var(--muted-foreground,#6b7280)] transition-transform mx-auto ${ue?"rotate-90":""}`})}),d&&e.jsx("td",{className:`${se[w]} w-12`,onClick:J=>J.stopPropagation(),children:e.jsx("input",{type:"checkbox",checked:re,onChange:()=>ee(E),className:"w-4 h-4 rounded border-[var(--border)] accent-[var(--primary,#32a9ff)] cursor-pointer"})}),C.map(J=>{const ve=J.frozen&&J.key in le;return e.jsx("td",{className:`${se[w]} text-${J.align??"left"} text-[var(--foreground,#1f2937)] ${ve?_:""}`,style:{...Ue,...ve?{left:le[J.key],boxShadow:"2px 0 4px rgba(0,0,0,0.04)"}:{}},children:J.render?J.render(z[J.key],z,U):z[J.key]},J.key)})]}),f&&ue&&e.jsx("tr",{className:"bg-[var(--muted,#f9fafb)] border-b border-[var(--border,#e5e7eb)]",children:e.jsx("td",{colSpan:ie,className:"px-6 py-4",children:f(z)})})]},E??U)})]})]})}),o&&l&&!k&&!v&&e.jsx(zs,{meta:o,onPageChange:l})]})}N.Accordion=br,N.AccordionItem=Ie,N.AdvancedDataTable=Fs,N.Alert=tr,N.Avatar=vr,N.AvatarGroup=gr,N.Badge=ut,N.Breadcrumb=Ot,N.Button=Me,N.ButtonGroup=it,N.Card=pr,N.CardBody=xr,N.CardFooter=yr,N.CardHeader=mr,N.Checkbox=ar,N.CheckboxGroup=gt,N.ColorPicker=Jt,N.ConfirmDialog=zt,N.DSButton=Me,N.DSCheckbox=ar,N.DSInput=Ae,N.DSRadio=lr,N.DSTable=hr,N.DSTextarea=je,N.DatePicker=$t,N.Divider=Nr,N.Drawer=Sr,N.Dropdown=$r,N.EmptyState=oo,N.FileUpload=lo,N.FilterBar=ws,N.FormError=Qr,N.FormField=as,N.FormHelperText=Rr,N.FormLabel=Oe,N.FormSuccess=Vr,N.IconButton=Ve,N.ImagePreview=fo,N.Input=Ae,N.Menu=Lr,N.Modal=fr,N.Notification=Mr,N.NotificationCenter=po,N.NumberInput=cs,N.OTPInput=us,N.PageHeader=ms,N.Pagination=Lt,N.Popover=xo,N.ProgressBar=Ar,N.Radio=lr,N.RadioGroup=mt,N.Rating=$o,N.SearchField=At,N.Sidebar=jr,N.Skeleton=Q,N.SkeletonCard=Co,N.SkeletonList=Lo,N.SkeletonTable=Wo,N.Spinner=Tr,N.StatCard=jo,N.Statistic=Ao,N.Stepper=Xr,N.Switch=Yo,N.Table=hr,N.Tabs=Tt,N.Tag=Or,N.TagInput=Ur,N.Textarea=je,N.Timeline=Zo,N.ToastContainer=ct,N.Tooltip=Gr,N.TopNavbar=Kr,N.TransferList=es,N.Tree=ts,N.toast=he,N.useFormField=ss,Object.defineProperty(N,Symbol.toStringTag,{value:"Module"})}));
|
|
95
95
|
//# sourceMappingURL=sellsuki-ds.umd.cjs.map
|