@uxuissk/design-system 0.8.11 → 0.8.13

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.
@@ -4603,7 +4603,7 @@ function Yr({
4603
4603
  children: /* @__PURE__ */ e(Gt, { size: 16 })
4604
4604
  }
4605
4605
  ),
4606
- t && p && /* @__PURE__ */ e("div", { className: "flex items-center flex-shrink-0", children: typeof p == "string" ? /* @__PURE__ */ e(
4606
+ t && p && /* @__PURE__ */ e("div", { className: "flex items-center flex-shrink-0 text-foreground", children: typeof p == "string" ? /* @__PURE__ */ e(
4607
4607
  "img",
4608
4608
  {
4609
4609
  src: p,
@@ -83,7 +83,7 @@
83
83
  ${a?"opacity-50 pointer-events-none":""}
84
84
  ${h?"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(g.Upload,{size:20,className:"text-primary"})}),e.jsxs("div",{className:"text-center",children:[e.jsxs("p",{className:"text-foreground",style:_e,children:[e.jsx("span",{className:"text-primary",children:"Click to upload"})," or drag and drop"]}),e.jsxs("p",{className:"text-muted-foreground",style:tt,children:[i||(r?`Accepted: ${r}`:"Any file type"),t&&` · Max ${ot(t)}`]})]})]}),e.jsx("input",{ref:m,type:"file",className:"hidden",accept:r,multiple:o,onChange:c=>k(c.target.files)}),y.length>0&&e.jsx(at,{files:y,onRemove:F})]})}const ua={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ba={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function ga({images:r,initialIndex:t=0}){const[o,a]=f.useState(!1),[s,l]=f.useState(t),[i,d]=f.useState(1),[n,u]=f.useState(0),b=r[s],x=()=>{l(y=>(y-1+r.length)%r.length),d(1),u(0)},w=()=>{l(y=>(y+1)%r.length),d(1),u(0)},h=()=>d(y=>Math.min(y+.25,3)),p=()=>d(y=>Math.max(y-.25,.5)),m=()=>u(y=>(y+90)%360);return e.jsxs("div",{children:[e.jsx("div",{className:"flex flex-wrap gap-2",children:r.map((y,k)=>e.jsx("button",{onClick:()=>{l(k),a(!0),d(1),u(0)},className:`rounded-[var(--radius-md)] overflow-hidden border-2 transition-all cursor-pointer hover:opacity-80
85
85
  ${s===k&&o?"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:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover",loading:"lazy"})})},k))}),o&&e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":`Image preview: ${b.alt}`,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-primary-foreground",style:ua,children:[b.alt," (",s+1,"/",r.length,")"]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("button",{onClick:p,"aria-label":"Zoom out",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(g.ZoomOut,{size:16})}),e.jsxs("span",{className:"text-primary-foreground/70 px-2",style:ba,"aria-live":"polite","aria-label":`Zoom level ${Math.round(i*100)}%`,children:[Math.round(i*100),"%"]}),e.jsx("button",{onClick:h,"aria-label":"Zoom in",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(g.ZoomIn,{size:16})}),e.jsx("button",{onClick:m,"aria-label":"Rotate clockwise",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(g.RotateCw,{size:16})}),e.jsx("div",{className:"w-px h-5 bg-primary-foreground/20 mx-1"}),e.jsx("button",{onClick:()=>{a(!1),d(1),u(0)},"aria-label":"Close preview",className:"w-8 h-8 flex items-center justify-center rounded-[var(--radius-md)] text-primary-foreground/70 hover:text-primary-foreground hover:bg-primary-foreground/10 cursor-pointer",children:e.jsx(g.X,{size:16})})]})]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center relative overflow-hidden",onClick:y=>{y.target===y.currentTarget&&(a(!1),d(1),u(0))},children:[r.length>1&&e.jsx("button",{onClick:x,"aria-label":"Previous image",className:"absolute left-4 w-10 h-10 rounded-full bg-foreground/30 text-primary-foreground flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(g.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(${i}) rotate(${n}deg)`}}),r.length>1&&e.jsx("button",{onClick:w,"aria-label":"Next image",className:"absolute right-4 w-10 h-10 rounded-full bg-foreground/30 text-primary-foreground flex items-center justify-center hover:bg-foreground/50 cursor-pointer z-10",children:e.jsx(g.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((y,k)=>e.jsx("button",{onClick:()=>{l(k),d(1),u(0)},className:`w-12 h-12 rounded-[var(--radius-sm)] overflow-hidden border-2 cursor-pointer transition-all
86
- ${k===s?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover"})},k))})]})]})}const pa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},va={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},ma={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function xa({items:r,parentRect:t}){const o=f.useRef(null),[a,s]=f.useState({top:t.top,left:t.right+4});return f.useEffect(()=>{if(!o.current)return;const i=o.current.getBoundingClientRect();let d=t.top,n=t.right+4;n+i.width>window.innerWidth-8&&(n=t.left-i.width-4),d+i.height>window.innerHeight-8&&(d=window.innerHeight-i.height-8),s({top:d,left:n})},[t]),Ce.createPortal(e.jsx("div",{ref:o,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1",style:{top:a.top,left:a.left},children:r.map((l,i)=>e.jsx(st,{item:l},i))}),document.body)}function st({item:r}){const[t,o]=f.useState(!1),a=f.useRef(null),s=f.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",style:ma,children:r.label});const l=r.children&&r.children.length>0,i=()=>{s.current&&clearTimeout(s.current),l&&o(!0)},d=()=>{s.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:a,className:"relative",onMouseEnter:i,onMouseLeave:d,children:[e.jsxs("button",{onClick:()=>{var n;l||(n=r.onClick)==null||n.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)",...pa},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:va,children:r.shortcut}),l&&e.jsx(g.ChevronRight,{size:14,className:"text-muted-foreground"})]}),l&&t&&a.current&&e.jsx(xa,{items:r.children,parentRect:a.current.getBoundingClientRect()})]})}function lt({items:r,open:t,onClose:o,triggerRef:a,className:s=""}){const l=f.useRef(null),[i,d]=f.useState({top:0,left:0});return f.useEffect(()=>{if(!t||!a.current)return;const n=a.current.getBoundingClientRect();let u=n.bottom+4,b=n.left;requestAnimationFrame(()=>{if(!l.current)return;const x=l.current.getBoundingClientRect();b+x.width>window.innerWidth-8&&(b=n.right-x.width),u+x.height>window.innerHeight-8&&(u=n.top-x.height-4),d({top:u,left:b})}),d({top:u,left:b})},[t,a]),f.useEffect(()=>{if(!t)return;const n=u=>{var b,x;(b=a.current)!=null&&b.contains(u.target)||(x=l.current)!=null&&x.contains(u.target)||o()};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[t,o,a]),t?Ce.createPortal(e.jsxs("div",{ref:l,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1 animate-[fadeIn_0.15s_ease] ${s}`,style:{top:i.top,left:i.left},children:[r.map((n,u)=>e.jsx(st,{item:n},u)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}lt.displayName="Menu";const nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},er={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ya={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},He={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function it({type:r="info",title:t,message:o,closable:a=!0,onClose:s,action:l,avatar:i,time:d,read:n}){const u={info:e.jsx(g.Info,{size:16,className:"text-primary"}),success:e.jsx(g.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(g.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(g.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]} ${n===!1?"bg-primary/5":""}`,children:[i?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:er,children:e.jsx("span",{className:"text-primary",children:i.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:u[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:er,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d&&e.jsx("span",{className:"text-muted-foreground",style:ya,children:d}),n===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),a&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(g.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:nt,children:o}),l&&e.jsxs("button",{onClick:l.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:He,children:[l.label," ",e.jsx(g.ExternalLink,{size:12})]})]})]})}function wa({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:a,onClearAll:s}){const[l,i]=f.useState(r),d=t!==void 0||o!==void 0,n=d?r:l,u=n.filter(h=>!h.read).length,b=()=>{o&&o(),d||i(h=>h.map(p=>({...p,read:!0})))},x=h=>{a&&a(h),d||i(p=>p.filter(m=>m.id!==h))},w=h=>{t&&t(h),d||i(p=>p.map(m=>m.id===h?{...m,read:!0}:m))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-md)] 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(g.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:er,children:"Notifications"}),u>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:He,children:u})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[u>0&&e.jsx("button",{onClick:b,className:"text-primary cursor-pointer",style:He,children:"Mark all read"}),n.length>0&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:He,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:n.map(h=>e.jsx("div",{className:`px-3 py-2 ${h.read?"":"bg-primary/5"}`,onClick:()=>!h.read&&w(h.id),children:e.jsx(it,{type:h.type,title:h.title,message:h.message,time:h.time,read:h.read,closable:!!a,onClose:()=>x(h.id)})},h.id))}),n.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(g.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:nt,children:"No notifications"})]})]})}const Na={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Sa({trigger:r,children:t,placement:o="bottom",title:a,open:s,onOpenChange:l}){const[i,d]=f.useState(!1),n=s!==void 0?s:i,u=w=>{l==null||l(w),s===void 0&&d(w)},b=f.useRef(null);f.useEffect(()=>{if(!n)return;const w=h=>{b.current&&!b.current.contains(h.target)&&u(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[n]);const x={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:()=>u(!n),className:"cursor-pointer",children:r}),n&&e.jsx("div",{className:`absolute z-50 ${x[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card shadow-elevation-sm overflow-hidden",children:[a&&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:Na,children:a}),e.jsx("button",{onClick:()=>u(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(g.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const ka={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},$a={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function dt({value:r,max:t=100,size:o="md",color:a,label:s,showValue:l,indeterminate:i,className:d=""}){const n={sm:"h-1.5",md:"h-2.5",lg:"h-4"},u=i?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${d}`,children:[(s||l)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s&&e.jsx("span",{className:"text-foreground",style:ka,children:s}),l&&!i&&e.jsxs("span",{className:"text-muted-foreground",style:$a,children:[Math.round(u),"%"]})]}),e.jsx("div",{className:`w-full ${n[o]} rounded-full bg-muted overflow-hidden`,children:i?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:a??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${u}%`,backgroundColor:a??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}dt.displayName="ProgressBar";const za={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ca={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Fa({value:r=0,onChange:t,max:o=5,size:a="md",disabled:s,readOnly:l,icon:i="star",showValue:d,label:n}){const[u,b]=f.useState(0),x=a==="sm"?16:a==="lg"?28:20,w=a==="sm"?"gap-0.5":a==="lg"?"gap-1.5":"gap-1",h=i==="heart"?g.Heart:i==="thumb"?g.ThumbsUp:g.Star,p=i==="heart"?"text-destructive":"text-chart-5",m=Array.from({length:o},(y,k)=>k+1);return e.jsxs("div",{className:`inline-flex items-center ${w} ${s?"opacity-50 pointer-events-none":""}`,children:[n&&e.jsx("span",{className:"text-foreground mr-2",style:za,children:n}),m.map(y=>{const k=y<=(u||r);return e.jsx("button",{type:"button",className:`transition-transform ${l||s?"":"cursor-pointer hover:scale-110"} ${k?p:"text-muted-foreground/40"}`,onMouseEnter:()=>!l&&!s&&b(y),onMouseLeave:()=>b(0),onClick:()=>!l&&!s&&(t==null?void 0:t(y===r?0:y)),disabled:s||l,children:e.jsx(h,{size:x,fill:k?"currentColor":"none"})},y)}),d&&e.jsxs("span",{className:"text-foreground ml-1",style:Ca,children:[r,"/",o]})]})}const Wa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function rr({children:r,content:t,placement:o="top",className:a=""}){const[s,l]=f.useState(!1),[i,d]=f.useState({top:0,left:0}),n=f.useRef(null),u=()=>{if(!n.current)return;const p=n.current.getBoundingClientRect(),m=8;let y=0,k=0;o==="right"?(y=p.top+p.height/2,k=p.right+m):o==="left"?(y=p.top+p.height/2,k=p.left-m):o==="bottom"?(y=p.bottom+m,k=p.left+p.width/2):(y=p.top-m,k=p.left+p.width/2),d({top:y,left:k})},b=()=>{u(),l(!0)},x=()=>l(!1);f.useEffect(()=>{if(!s)return;const p=()=>u();return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]);const w=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},h=s?e.jsx("div",{style:{position:"fixed",top:i.top,left:i.left,zIndex:9999,pointerEvents:"none",...w},children:e.jsx("div",{className:"px-2.5 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-elevation-sm",style:Wa,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:n,className:`relative inline-flex ${a}`,onMouseEnter:b,onMouseLeave:x,onFocus:b,onBlur:x,children:r}),typeof document<"u"&&Ce.createPortal(h,document.body)]})}rr.displayName="Tooltip";const ct={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-button)",lineHeight:"1"},La={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"},Ma={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"};function tr({item:r,size:t=40}){const o=t+"px",a=t>=40?"var(--text-label)":"var(--text-caption)";if(r.avatarUrl)return e.jsx("img",{src:r.avatarUrl,alt:r.name,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}});const s=r.avatarFallback||r.name.charAt(0).toUpperCase();return e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:"var(--Base_Color--Sky--100, #e0f2fe)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-label)",fontSize:a,fontWeight:"var(--weight-button)",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:s})}function or({company:r,branch:t,provider:o,companies:a=[],branches:s=[],providers:l=[],onCompanyChange:i,onBranchChange:d,onProviderChange:n,collapsed:u=!1}){const[b,x]=f.useState(!1),w=f.useRef(null);f.useEffect(()=>{if(!b)return;const y=k=>{w.current&&!w.current.contains(k.target)&&x(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[b]);const h=r,p=(t==null?void 0:t.name)??(o==null?void 0:o.name),m=y=>{i==null||i(y),x(!1)};return u?e.jsx("button",{onClick:()=>x(!b),title:(h==null?void 0:h.name)??"Switch account",style:{width:40,height:40,borderRadius:"50%",border:"none",background:"rgba(240,249,255,1)",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},children:h?e.jsx(tr,{item:h,size:36}):e.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},children:"S"})}):e.jsxs("div",{ref:w,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>x(!b),style:{width:"100%",background:"rgba(240,249,255,1)",border:"1px solid rgba(217,242,255,1)",borderRadius:"8px",padding:"8px 16px 8px 8px",display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",textAlign:"left",minHeight:"56px"},children:[h?e.jsx(tr,{item:h,size:40}):e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(h==null?void 0:h.name)??"Select Company"}),p&&e.jsx("span",{style:{...La,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:p})]}),e.jsx(g.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:b?"rotate(0deg)":"rotate(180deg)"}})]}),b&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:50,background:"var(--background, #fff)",border:"1px solid var(--border, #e5e7eb)",borderRadius:"8px",boxShadow:"0px 4px 12px 0px rgba(0,0,0,0.08)",overflow:"hidden"},children:e.jsx("div",{style:{maxHeight:"240px",overflowY:"auto"},children:a.map(y=>{const k=(r==null?void 0:r.id)===y.id;return e.jsxs("button",{onClick:()=>m(y),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:k?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:F=>{k||(F.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:F=>{F.currentTarget.style.background=k?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(tr,{item:y,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.name}),y.handle&&e.jsx("div",{style:{...Ma,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:y.handle})]}),k&&e.jsx(g.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},y.id)})})})]})}or.displayName="SidebarAccountSwitcher";const Da={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},Aa={fontFamily:"var(--font-p)",fontSize:"var(--text-p)"},ft={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ja={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ea={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Pe({brand:r,accountSwitcher:t,groups:o,activeItem:a,onNavigate:s,collapsed:l=!1,onCollapsedChange:i,showCollapseToggle:d=!1,utilityItems:n,version:u,versionDate:b,width:x,className:w=""}){const[h,p]=f.useState(new Set),m=v=>{p($=>{const C=new Set($);return C.has(v)?C.delete(v):C.add(v),C})},F=l?"var(--shell-sidebar-collapsed, 64px)":x??"var(--shell-sidebar-width, 200px)",c=v=>{const $=a===v.id,C=e.jsxs("button",{onClick:()=>s==null?void 0:s(v),className:`w-full flex items-center ${l?"justify-center px-0":"gap-2 px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${$?"bg-sidebar-accent text-sidebar-primary":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:Aa,children:[e.jsx("span",{className:`flex-shrink-0 ${$?"text-sidebar-primary":"text-muted-foreground"}`,children:v.icon}),!l&&e.jsx("span",{className:`truncate flex-1 text-left ${$?"text-sidebar-primary":""}`,children:v.label}),v.badge!=null&&!l&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:String(v.badge)})]},v.id);return l?e.jsx("div",{className:"w-full flex",children:e.jsx(rr,{content:v.label,placement:"right",className:"flex-1",children:C})},v.id):C},N=()=>{if(!r)return null;if(l){const v=r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] object-cover flex-shrink-0"}):r.logoFull?e.jsx("div",{className:"w-10 h-10 flex-shrink-0 overflow-hidden flex items-center",title:r.name,children:e.jsx("div",{style:{flexShrink:0},children:r.logoFull})}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()});return e.jsx("div",{className:"flex justify-center",children:v})}return r.logoFull?e.jsx("div",{className:"flex items-center",style:{height:"40px"},children:r.logoFull}):e.jsxs("div",{className:"flex items-center gap-2",children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()}),e.jsx("span",{className:"text-sidebar-foreground truncate",style:Da,children:r.name})]})};return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 h-full ${w}`,style:{width:F,minWidth:F,transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1)), min-width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",overflow:"visible"},children:[t?e.jsx("div",{className:`${l?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${l?"justify-center":""}`,children:e.jsx(or,{...t,collapsed:l})}):r&&e.jsx("div",{className:`${l?"px-2 py-3":"px-4 py-3"} border-b border-sidebar-border`,children:N()}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${l?"px-1.5":"px-2"}`,children:o.map(v=>{const $=h.has(v.label);return e.jsxs("div",{className:"mb-4",children:[!l&&e.jsxs("button",{onClick:()=>m(v.label),className:"w-full flex items-center justify-between px-2 mb-1.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",style:ja,children:[e.jsx("span",{children:v.label}),e.jsx(g.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:$?"rotate(180deg)":"rotate(0deg)"}})]}),l&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!$&&e.jsx("div",{className:"space-y-0.5",children:v.items.map(C=>c(C))})]},v.label)})}),((n==null?void 0:n.length)||d&&i||u)&&e.jsxs("div",{className:`${l?"px-1.5":"px-2"} pb-3 border-t border-sidebar-border flex flex-col`,children:[n&&n.length>0&&e.jsx("div",{className:"pt-2 space-y-0.5",children:n.map(v=>c(v))}),d&&i&&e.jsx("div",{className:`${n!=null&&n.length?"mt-1":"pt-2"}`,children:e.jsxs("button",{onClick:()=>i(!l),className:`w-full flex items-center ${l?"justify-center":"gap-2 px-2"} py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer`,style:Ea,title:l?"Expand sidebar":"Collapse sidebar",children:[l?e.jsx(g.PanelLeftOpen,{size:16}):e.jsx(g.PanelLeftClose,{size:16}),!l&&e.jsx("span",{children:"Collapse"})]})}),u&&!l&&e.jsxs("div",{className:"px-2 pt-1 flex items-center gap-1.5 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},children:[e.jsx("span",{children:u}),b&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:b})]})]}),u&&l&&e.jsx("div",{className:"flex justify-center pt-1 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},title:`${u}${b?` · ${b}`:""}`,children:u})]})]})}Pe.displayName="Sidebar";function se({width:r,height:t,variant:o="rectangular",animate:a=!0,className:s}){const l="bg-muted",i=a?"animate-pulse":"",d=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${l} ${i} ${d} ${s??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function Ta(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(se,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{variant:"text",width:"60%",height:20}),e.jsx(se,{variant:"text",width:"100%",height:14}),e.jsx(se,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:"40%",height:14}),e.jsx(se,{variant:"text",width:"25%",height:12})]})]})]})}function Ia(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] 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(se,{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(se,{variant:"circular",width:28,height:28}),e.jsx(se,{variant:"text",width:100+r*15,height:14}),e.jsx(se,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(se,{variant:"rounded",width:60,height:22}),e.jsx(se,{variant:"text",width:80,height:14})]},r))]})}function ar({rows:r=3}){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:Array.from({length:r}).map((t,o)=>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(se,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:`${60+o*10}%`,height:14}),e.jsx(se,{variant:"text",width:`${40+o*5}%`,height:12})]}),e.jsx(se,{variant:"rounded",width:50,height:24})]},o))})}const Ba={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 ht({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Ba[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}ht.displayName="Spinner";const sr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ut={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},gt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_a={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 Ha({title:r,value:t,prefix:o,suffix:a,trend:s,trendLabel:l,icon:i,size:d="md",loading:n}){const u=_a[d],b=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",x=(s==null?void 0:s.direction)==="up"?g.ArrowUpRight:(s==null?void 0:s.direction)==="down"?g.ArrowDownRight:g.Minus;return n?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:[i&&e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx("span",{className:"text-muted-foreground",style:sr,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:o}),e.jsx("span",{className:"text-foreground",style:u,children:typeof t=="number"?t.toLocaleString():t}),a&&e.jsx("span",{className:"text-muted-foreground",style:sr,children:a})]}),s&&e.jsxs("div",{className:`flex items-center gap-1 ${b}`,children:[e.jsx(x,{size:14}),e.jsxs("span",{style:gt,children:[s.value,"%"]}),l&&e.jsx("span",{className:"text-muted-foreground",style:bt,children:l})]})]})}function Pa({title:r,value:t,prefix:o,trend:a,trendLabel:s,icon:l,iconBg:i}){const d=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",n=(a==null?void 0:a.direction)==="up"?g.ArrowUpRight:(a==null?void 0:a.direction)==="down"?g.ArrowDownRight:g.Minus;return e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-5 overflow-hidden",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1 min-w-0 flex-1",children:[e.jsx("span",{className:"text-muted-foreground",style:sr,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:o}),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})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${d}`,children:[e.jsx(n,{size:12}),e.jsxs("span",{style:gt,children:[a.value,"%"]}),s&&e.jsx("span",{className:"text-muted-foreground",style:bt,children:s})]})]}),l&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${i||"bg-primary/10 text-primary"}`,children:l})]})})}const Oa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},pt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},vt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},mt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function xt({steps:r,current:t,orientation:o="horizontal",onStepClick:a,className:s=""}){return o==="vertical"?e.jsx("div",{className:`flex flex-col ${s}`,children:r.map((l,i)=>{const d=i<t,n=i===t,u=l.disabled;return e.jsxs("div",{className:`flex gap-3 ${u?"opacity-50":""}`,onClick:()=>!u&&(a==null?void 0:a(i)),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 ${u?"cursor-not-allowed":a?"cursor-pointer":""} ${d||n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:mt,children:d?e.jsx(g.Check,{size:14}):i+1}),i<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 ${i===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${n?"text-foreground":"text-muted-foreground"}`,style:n?pt:Oa,children:l.title}),l.description&&e.jsx("span",{className:"text-muted-foreground block",style:vt,children:l.description})]})]},i)})}):e.jsx("div",{className:`flex items-center ${s}`,children:r.map((l,i)=>{const d=i<t,n=i===t;return e.jsxs("div",{className:`flex items-center ${i<r.length-1?"flex-1":""} ${l.disabled?"opacity-50":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>!l.disabled&&(a==null?void 0:a(i)),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${l.disabled?"cursor-not-allowed":a?"cursor-pointer":""} ${d||n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:mt,children:d?e.jsx(g.Check,{size:14}):i+1}),e.jsx("span",{className:`text-center ${n?"text-foreground":"text-muted-foreground"}`,style:n?pt:vt,children:l.title})]}),i<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${d?"bg-primary":"bg-border"}`})]},i)})})}xt.displayName="Stepper";const Ya={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ga={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ua={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"}},Xa={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Ka={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Za({checked:r,onChange:t,label:o,description:a,size:s="md",disabled:l,color:i="primary"}){const d=Ua[s],n=Ka[s];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${l?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:l,className:`${d.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Xa[i]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:n.w,height:n.h,top:"50%",transform:`translateY(-50%) translateX(${r?n.on:2}px)`,left:0}})}),(o||a)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Ya,children:o}),a&&e.jsx("span",{className:"text-muted-foreground block",style:Ga,children:a})]})]})}const qa={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"},Ja={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qa={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 yt({children:r,color:t="default",size:o="md",icon:a,closable:s,onClose:l,className:i=""}){const d=qa[t],n=Ja[o],u=Qa[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${d} ${n} ${i}`,style:u,children:[a&&e.jsx("span",{className:"flex-shrink-0",children:a}),r,s&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:l,children:e.jsx(g.X,{size:o==="sm"?10:12})})]})}yt.displayName="Tag";const Va={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ra={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},es={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function wt({tags:r,onChange:t,placeholder:o,disabled:a,maxTags:s,variant:l="default",className:i=""}){const[d,n]=f.useState(""),u=()=>{const x=d.trim();!x||r.includes(x)||s&&r.length>=s||(t([...r,x]),n(""))},b=x=>{t(r.filter(w=>w!==x))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${es[l]} transition-colors focus-within:border-primary ${a?"opacity-50 pointer-events-none":""} ${i}`,children:[r.map(x=>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:Ra,children:[x,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>b(x),children:e.jsx(g.X,{size:12})})]},x)),e.jsx("input",{value:d,onChange:x=>n(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),u()),x.key==="Backspace"&&!d&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":o,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Va,disabled:a})]})}wt.displayName="TagInput";const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},lr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ts({items:r,variant:t="default",size:o="md"}){const a=o==="sm"?"w-6 h-6":o==="lg"?"w-10 h-10":"w-8 h-8",s=o==="sm"?12:o==="lg"?18:14,l=i=>i==="completed"?"bg-chart-2 text-primary-foreground":i==="current"?"bg-primary text-primary-foreground":i==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((i,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:`${a} rounded-full flex items-center justify-center flex-shrink-0 ${l(i.status)}`,children:i.icon||(i.status==="completed"?e.jsx(g.CheckCircle2,{size:s}):e.jsx(g.Circle,{size:s}))}),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:Nt,children:i.title}),i.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:i.time})]}),i.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:lr,children:i.description})]})]},d))}):e.jsx("div",{className:"relative",children:r.map((i,d)=>{const n=t==="alternate"&&d%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${n?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center ${l(i.status)}`,children:i.icon||(i.status==="completed"?e.jsx(g.CheckCircle2,{size:s}):e.jsx(g.Circle,{size:s}))}),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 ${n?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${n?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:Nt,children:i.title}),i.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:i.time})]}),i.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:rs,children:i.description}),i.children&&e.jsx("div",{className:"mt-2",children:i.children})]})]},d)})})}const Oe={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},os={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"};function nr({brand:r,breadcrumbs:t,title:o,actions:a,user:s,height:l="56px",searchMode:i,searchPlaceholder:d="Search... (Ctrl+K)",onSearchClick:n,notificationCount:u,onNotificationClick:b,onMobileMenuClick:x,onSidebarToggle:w,onAppSwitcherClick:h,onUserClick:p,onBreadcrumbClick:m,workspaceSwitcher:y,showSearch:k,className:F=""}){const c=i??(k?"bar":"none"),N=s!=null&&s.name?s.name.split(" ").map($=>$[0]).join("").slice(0,2).toUpperCase():"",v=(r==null?void 0:r.logoFull)??(r==null?void 0:r.logo);return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-4 gap-3 ${F}`,style:{height:l},children:[w&&e.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer flex-shrink-0",onClick:w,title:"Toggle sidebar",children:e.jsx(g.Menu,{size:18})}),!w&&x&&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 flex-shrink-0",onClick:x,children:e.jsx(g.Menu,{size:16})}),r&&v&&e.jsx("div",{className:"flex items-center flex-shrink-0",children:typeof v=="string"?e.jsx("img",{src:v,alt:r.name,style:{height:"40px",width:"auto"},className:"rounded-[var(--radius-sm)] object-contain"}):e.jsx("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:v})}),r&&!v&&e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Oe,children:r.name.charAt(0).toUpperCase()}),y&&e.jsx("div",{className:"flex items-center",children:y}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:os,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:Oe,children:t.map(($,C)=>e.jsxs(f.Fragment,{children:[C>0&&e.jsx(g.ChevronRight,{size:12}),$.href||m?e.jsx("span",{className:`cursor-pointer ${C===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>m==null?void 0:m($,C),children:$.label}):e.jsx("span",{className:C===t.length-1?"text-foreground":"",children:$.label})]},C))}),e.jsx("div",{className:"flex-1"}),c==="bar"&&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:n,children:[e.jsx(g.Search,{size:14}),e.jsx("span",{style:Oe,children:d})]}),c==="icon"&&e.jsx("button",{className:"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:n,title:"Search",children:e.jsx(g.Search,{size:16})}),a,b&&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:b,children:[e.jsx(g.Bell,{size:16}),u!==void 0&&u>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),h&&e.jsx("button",{className:"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:h,title:"Switch app",children:e.jsx(g.LayoutGrid,{size:16})}),s&&e.jsx("div",{className:"cursor-pointer flex-shrink-0",onClick:p,children:s.avatar?e.jsx("img",{src:s.avatar,alt:s.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:Oe,children:N})})]})}nr.displayName="TopNavbar";const as={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},St={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)"};function kt({title:r,items:t,selected:o,onToggle:a,search:s,onSearch:l,searchable:i}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] 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:St,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:ir,children:[t.length," items"]})]}),i&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(g.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:s,onChange:d=>l(d.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:ir})]}),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:ir,children:"No items"}),t.map(d=>e.jsxs("button",{onClick:()=>!d.disabled&&a(d.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
86
+ ${k===s?"border-primary-foreground":"border-transparent opacity-50 hover:opacity-80"}`,children:e.jsx("img",{src:y.thumbnail||y.src,alt:y.alt,className:"w-full h-full object-cover"})},k))})]})]})}const pa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},va={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},ma={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function xa({items:r,parentRect:t}){const o=f.useRef(null),[a,s]=f.useState({top:t.top,left:t.right+4});return f.useEffect(()=>{if(!o.current)return;const i=o.current.getBoundingClientRect();let d=t.top,n=t.right+4;n+i.width>window.innerWidth-8&&(n=t.left-i.width-4),d+i.height>window.innerHeight-8&&(d=window.innerHeight-i.height-8),s({top:d,left:n})},[t]),Ce.createPortal(e.jsx("div",{ref:o,className:"fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1",style:{top:a.top,left:a.left},children:r.map((l,i)=>e.jsx(st,{item:l},i))}),document.body)}function st({item:r}){const[t,o]=f.useState(!1),a=f.useRef(null),s=f.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",style:ma,children:r.label});const l=r.children&&r.children.length>0,i=()=>{s.current&&clearTimeout(s.current),l&&o(!0)},d=()=>{s.current=setTimeout(()=>o(!1),150)};return e.jsxs("div",{ref:a,className:"relative",onMouseEnter:i,onMouseLeave:d,children:[e.jsxs("button",{onClick:()=>{var n;l||(n=r.onClick)==null||n.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)",...pa},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:va,children:r.shortcut}),l&&e.jsx(g.ChevronRight,{size:14,className:"text-muted-foreground"})]}),l&&t&&a.current&&e.jsx(xa,{items:r.children,parentRect:a.current.getBoundingClientRect()})]})}function lt({items:r,open:t,onClose:o,triggerRef:a,className:s=""}){const l=f.useRef(null),[i,d]=f.useState({top:0,left:0});return f.useEffect(()=>{if(!t||!a.current)return;const n=a.current.getBoundingClientRect();let u=n.bottom+4,b=n.left;requestAnimationFrame(()=>{if(!l.current)return;const x=l.current.getBoundingClientRect();b+x.width>window.innerWidth-8&&(b=n.right-x.width),u+x.height>window.innerHeight-8&&(u=n.top-x.height-4),d({top:u,left:b})}),d({top:u,left:b})},[t,a]),f.useEffect(()=>{if(!t)return;const n=u=>{var b,x;(b=a.current)!=null&&b.contains(u.target)||(x=l.current)!=null&&x.contains(u.target)||o()};return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[t,o,a]),t?Ce.createPortal(e.jsxs("div",{ref:l,className:`fixed z-[9999] min-w-[200px] rounded-[var(--radius)] border border-border bg-popover shadow-elevation-sm py-1 animate-[fadeIn_0.15s_ease] ${s}`,style:{top:i.top,left:i.left},children:[r.map((n,u)=>e.jsx(st,{item:n},u)),e.jsx("style",{children:"@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }"})]}),document.body):null}lt.displayName="Menu";const nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},er={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},ya={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},He={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function it({type:r="info",title:t,message:o,closable:a=!0,onClose:s,action:l,avatar:i,time:d,read:n}){const u={info:e.jsx(g.Info,{size:16,className:"text-primary"}),success:e.jsx(g.CheckCircle2,{size:16,className:"text-chart-2"}),warning:e.jsx(g.AlertTriangle,{size:16,className:"text-chart-5"}),error:e.jsx(g.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]} ${n===!1?"bg-primary/5":""}`,children:[i?e.jsx("div",{className:"w-8 h-8 rounded-full bg-muted flex-shrink-0 flex items-center justify-center overflow-hidden",style:er,children:e.jsx("span",{className:"text-primary",children:i.slice(0,2).toUpperCase()})}):e.jsx("span",{className:"flex-shrink-0 mt-0.5",children:u[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:er,children:t}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[d&&e.jsx("span",{className:"text-muted-foreground",style:ya,children:d}),n===!1&&e.jsx("span",{className:"w-2 h-2 rounded-full bg-primary"}),a&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(g.X,{size:14})})]})]}),o&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:nt,children:o}),l&&e.jsxs("button",{onClick:l.onClick,className:"inline-flex items-center gap-1 text-primary mt-2 hover:underline cursor-pointer",style:He,children:[l.label," ",e.jsx(g.ExternalLink,{size:12})]})]})]})}function wa({items:r,onMarkRead:t,onMarkAllRead:o,onDismiss:a,onClearAll:s}){const[l,i]=f.useState(r),d=t!==void 0||o!==void 0,n=d?r:l,u=n.filter(h=>!h.read).length,b=()=>{o&&o(),d||i(h=>h.map(p=>({...p,read:!0})))},x=h=>{a&&a(h),d||i(p=>p.filter(m=>m.id!==h))},w=h=>{t&&t(h),d||i(p=>p.map(m=>m.id===h?{...m,read:!0}:m))};return e.jsxs("div",{className:"max-w-md rounded-[var(--radius-md)] 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(g.Bell,{size:16,className:"text-foreground"}),e.jsx("span",{className:"text-foreground",style:er,children:"Notifications"}),u>0&&e.jsx("span",{className:"px-1.5 py-0.5 rounded-full bg-primary text-primary-foreground",style:He,children:u})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[u>0&&e.jsx("button",{onClick:b,className:"text-primary cursor-pointer",style:He,children:"Mark all read"}),n.length>0&&s&&e.jsx("button",{onClick:s,className:"text-muted-foreground hover:text-destructive cursor-pointer",style:He,children:"Clear all"})]})]}),e.jsx("div",{className:"divide-y divide-border max-h-[360px] overflow-y-auto",children:n.map(h=>e.jsx("div",{className:`px-3 py-2 ${h.read?"":"bg-primary/5"}`,onClick:()=>!h.read&&w(h.id),children:e.jsx(it,{type:h.type,title:h.title,message:h.message,time:h.time,read:h.read,closable:!!a,onClose:()=>x(h.id)})},h.id))}),n.length===0&&e.jsxs("div",{className:"py-10 text-center text-muted-foreground",children:[e.jsx(g.BellOff,{size:24,className:"mx-auto mb-2 opacity-40"}),e.jsx("span",{style:nt,children:"No notifications"})]})]})}const Na={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Sa({trigger:r,children:t,placement:o="bottom",title:a,open:s,onOpenChange:l}){const[i,d]=f.useState(!1),n=s!==void 0?s:i,u=w=>{l==null||l(w),s===void 0&&d(w)},b=f.useRef(null);f.useEffect(()=>{if(!n)return;const w=h=>{b.current&&!b.current.contains(h.target)&&u(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[n]);const x={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:()=>u(!n),className:"cursor-pointer",children:r}),n&&e.jsx("div",{className:`absolute z-50 ${x[o]} w-max max-w-xs`,children:e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card shadow-elevation-sm overflow-hidden",children:[a&&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:Na,children:a}),e.jsx("button",{onClick:()=>u(!1),className:"text-muted-foreground hover:text-foreground cursor-pointer",children:e.jsx(g.X,{size:14})})]}),e.jsx("div",{className:"px-4 py-3",children:t})]})})]})}const ka={fontFamily:"var(--font-label)",fontSize:"var(--text-label)"},$a={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function dt({value:r,max:t=100,size:o="md",color:a,label:s,showValue:l,indeterminate:i,className:d=""}){const n={sm:"h-1.5",md:"h-2.5",lg:"h-4"},u=i?0:Math.min(100,Math.max(0,(r??0)/t*100));return e.jsxs("div",{className:`w-full ${d}`,children:[(s||l)&&e.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[s&&e.jsx("span",{className:"text-foreground",style:ka,children:s}),l&&!i&&e.jsxs("span",{className:"text-muted-foreground",style:$a,children:[Math.round(u),"%"]})]}),e.jsx("div",{className:`w-full ${n[o]} rounded-full bg-muted overflow-hidden`,children:i?e.jsx("div",{className:"h-full w-1/3 rounded-full animate-[indeterminate_1.5s_infinite_ease-in-out]",style:{backgroundColor:a??"var(--primary)"}}):e.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${u}%`,backgroundColor:a??"var(--primary)"}})}),e.jsx("style",{children:"@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(400%); } }"})]})}dt.displayName="ProgressBar";const za={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ca={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"};function Fa({value:r=0,onChange:t,max:o=5,size:a="md",disabled:s,readOnly:l,icon:i="star",showValue:d,label:n}){const[u,b]=f.useState(0),x=a==="sm"?16:a==="lg"?28:20,w=a==="sm"?"gap-0.5":a==="lg"?"gap-1.5":"gap-1",h=i==="heart"?g.Heart:i==="thumb"?g.ThumbsUp:g.Star,p=i==="heart"?"text-destructive":"text-chart-5",m=Array.from({length:o},(y,k)=>k+1);return e.jsxs("div",{className:`inline-flex items-center ${w} ${s?"opacity-50 pointer-events-none":""}`,children:[n&&e.jsx("span",{className:"text-foreground mr-2",style:za,children:n}),m.map(y=>{const k=y<=(u||r);return e.jsx("button",{type:"button",className:`transition-transform ${l||s?"":"cursor-pointer hover:scale-110"} ${k?p:"text-muted-foreground/40"}`,onMouseEnter:()=>!l&&!s&&b(y),onMouseLeave:()=>b(0),onClick:()=>!l&&!s&&(t==null?void 0:t(y===r?0:y)),disabled:s||l,children:e.jsx(h,{size:x,fill:k?"currentColor":"none"})},y)}),d&&e.jsxs("span",{className:"text-foreground ml-1",style:Ca,children:[r,"/",o]})]})}const Wa={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function rr({children:r,content:t,placement:o="top",className:a=""}){const[s,l]=f.useState(!1),[i,d]=f.useState({top:0,left:0}),n=f.useRef(null),u=()=>{if(!n.current)return;const p=n.current.getBoundingClientRect(),m=8;let y=0,k=0;o==="right"?(y=p.top+p.height/2,k=p.right+m):o==="left"?(y=p.top+p.height/2,k=p.left-m):o==="bottom"?(y=p.bottom+m,k=p.left+p.width/2):(y=p.top-m,k=p.left+p.width/2),d({top:y,left:k})},b=()=>{u(),l(!0)},x=()=>l(!1);f.useEffect(()=>{if(!s)return;const p=()=>u();return window.addEventListener("scroll",p,!0),window.addEventListener("resize",p),()=>{window.removeEventListener("scroll",p,!0),window.removeEventListener("resize",p)}},[s]);const w=o==="right"?{transform:"translateY(-50%)"}:o==="left"?{transform:"translate(-100%, -50%)"}:o==="bottom"?{transform:"translateX(-50%)"}:{transform:"translate(-50%, -100%)"},h=s?e.jsx("div",{style:{position:"fixed",top:i.top,left:i.left,zIndex:9999,pointerEvents:"none",...w},children:e.jsx("div",{className:"px-2.5 py-1.5 rounded-[var(--radius-sm)] bg-foreground text-background whitespace-nowrap shadow-elevation-sm",style:Wa,role:"tooltip",children:t})}):null;return e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:n,className:`relative inline-flex ${a}`,onMouseEnter:b,onMouseLeave:x,onFocus:b,onBlur:x,children:r}),typeof document<"u"&&Ce.createPortal(h,document.body)]})}rr.displayName="Tooltip";const ct={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-button)",lineHeight:"1"},La={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"},Ma={fontFamily:"var(--font-p)",fontSize:"var(--text-p)",fontWeight:"var(--weight-p)",lineHeight:"1"};function tr({item:r,size:t=40}){const o=t+"px",a=t>=40?"var(--text-label)":"var(--text-caption)";if(r.avatarUrl)return e.jsx("img",{src:r.avatarUrl,alt:r.name,style:{width:o,height:o,borderRadius:"50%",objectFit:"cover",flexShrink:0}});const s=r.avatarFallback||r.name.charAt(0).toUpperCase();return e.jsx("div",{style:{width:o,height:o,borderRadius:"50%",flexShrink:0,background:"var(--Base_Color--Sky--100, #e0f2fe)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-label)",fontSize:a,fontWeight:"var(--weight-button)",color:"var(--Base_Color--Sky--600, #1b8bf5)"},children:s})}function or({company:r,branch:t,provider:o,companies:a=[],branches:s=[],providers:l=[],onCompanyChange:i,onBranchChange:d,onProviderChange:n,collapsed:u=!1}){const[b,x]=f.useState(!1),w=f.useRef(null);f.useEffect(()=>{if(!b)return;const y=k=>{w.current&&!w.current.contains(k.target)&&x(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[b]);const h=r,p=(t==null?void 0:t.name)??(o==null?void 0:o.name),m=y=>{i==null||i(y),x(!1)};return u?e.jsx("button",{onClick:()=>x(!b),title:(h==null?void 0:h.name)??"Switch account",style:{width:40,height:40,borderRadius:"50%",border:"none",background:"rgba(240,249,255,1)",cursor:"pointer",padding:0,display:"flex",alignItems:"center",justifyContent:"center"},children:h?e.jsx(tr,{item:h,size:36}):e.jsx("div",{style:{width:36,height:36,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)"},children:"S"})}):e.jsxs("div",{ref:w,style:{position:"relative",width:"100%"},children:[e.jsxs("button",{onClick:()=>x(!b),style:{width:"100%",background:"rgba(240,249,255,1)",border:"1px solid rgba(217,242,255,1)",borderRadius:"8px",padding:"8px 16px 8px 8px",display:"flex",alignItems:"center",gap:"10px",cursor:"pointer",textAlign:"left",minHeight:"56px"},children:[h?e.jsx(tr,{item:h,size:40}):e.jsx("div",{style:{width:40,height:40,borderRadius:"50%",background:"var(--primary)",display:"flex",alignItems:"center",justifyContent:"center",color:"#fff",fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)",flexShrink:0},children:"S"}),e.jsxs("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"4px"},children:[e.jsx("span",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:(h==null?void 0:h.name)??"Select Company"}),p&&e.jsx("span",{style:{...La,color:"var(--Base_Color--Sky--500, #32a9ff)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"},children:p})]}),e.jsx(g.ChevronUp,{size:16,color:"rgba(50,169,255,1)",style:{flexShrink:0,transition:"transform 0.2s ease",transform:b?"rotate(0deg)":"rotate(180deg)"}})]}),b&&e.jsx("div",{style:{position:"absolute",top:"calc(100% + 4px)",left:0,right:0,zIndex:50,background:"var(--background, #fff)",border:"1px solid var(--border, #e5e7eb)",borderRadius:"8px",boxShadow:"0px 4px 12px 0px rgba(0,0,0,0.08)",overflow:"hidden"},children:e.jsx("div",{style:{maxHeight:"240px",overflowY:"auto"},children:a.map(y=>{const k=(r==null?void 0:r.id)===y.id;return e.jsxs("button",{onClick:()=>m(y),style:{width:"100%",display:"flex",alignItems:"center",gap:"10px",padding:"8px 12px",background:k?"rgba(240,249,255,0.6)":"none",border:"none",cursor:"pointer",textAlign:"left",transition:"background 0.15s",minHeight:"48px"},onMouseEnter:F=>{k||(F.currentTarget.style.background="var(--accent, #f3f4f6)")},onMouseLeave:F=>{F.currentTarget.style.background=k?"rgba(240,249,255,0.6)":"none"},children:[e.jsx(tr,{item:y,size:36}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx("div",{style:{...ct,color:"var(--foreground, #1f2937)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:y.name}),y.handle&&e.jsx("div",{style:{...Ma,color:"var(--muted-foreground, #6b7280)",marginTop:"2px"},children:y.handle})]}),k&&e.jsx(g.Check,{size:16,color:"var(--Base_Color--Sky--500, #32a9ff)",style:{flexShrink:0}})]},y.id)})})})]})}or.displayName="SidebarAccountSwitcher";const Da={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"},Aa={fontFamily:"var(--font-p)",fontSize:"var(--text-p)"},ft={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},ja={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ea={fontFamily:"var(--font-label)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function Pe({brand:r,accountSwitcher:t,groups:o,activeItem:a,onNavigate:s,collapsed:l=!1,onCollapsedChange:i,showCollapseToggle:d=!1,utilityItems:n,version:u,versionDate:b,width:x,className:w=""}){const[h,p]=f.useState(new Set),m=v=>{p($=>{const C=new Set($);return C.has(v)?C.delete(v):C.add(v),C})},F=l?"var(--shell-sidebar-collapsed, 64px)":x??"var(--shell-sidebar-width, 200px)",c=v=>{const $=a===v.id,C=e.jsxs("button",{onClick:()=>s==null?void 0:s(v),className:`w-full flex items-center ${l?"justify-center px-0":"gap-2 px-2"} py-2 rounded-[var(--radius-md)] transition-colors cursor-pointer ${$?"bg-sidebar-accent text-sidebar-primary":"text-sidebar-foreground hover:bg-sidebar-accent/50"}`,style:Aa,children:[e.jsx("span",{className:`flex-shrink-0 ${$?"text-sidebar-primary":"text-muted-foreground"}`,children:v.icon}),!l&&e.jsx("span",{className:`truncate flex-1 text-left ${$?"text-sidebar-primary":""}`,children:v.label}),v.badge!=null&&!l&&e.jsx("span",{className:"rounded-full bg-primary text-primary-foreground",style:{fontFamily:"var(--font-caption)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-button)",lineHeight:"1",padding:"2px 6px",display:"inline-flex",alignItems:"center",minWidth:"18px",justifyContent:"center"},children:String(v.badge)})]},v.id);return l?e.jsx("div",{className:"w-full flex",children:e.jsx(rr,{content:v.label,placement:"right",className:"flex-1",children:C})},v.id):C},N=()=>{if(!r)return null;if(l){const v=r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] object-cover flex-shrink-0"}):r.logoFull?e.jsx("div",{className:"w-10 h-10 flex-shrink-0 overflow-hidden flex items-center",title:r.name,children:e.jsx("div",{style:{flexShrink:0},children:r.logoFull})}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()});return e.jsx("div",{className:"flex justify-center",children:v})}return r.logoFull?e.jsx("div",{className:"flex items-center",style:{height:"40px"},children:r.logoFull}):e.jsxs("div",{className:"flex items-center gap-2",children:[r.logo?e.jsx("img",{src:r.logo,alt:r.name,className:"w-10 h-10 rounded-[var(--radius-sm)] flex-shrink-0 object-cover"}):e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:ft,children:r.name.charAt(0).toUpperCase()}),e.jsx("span",{className:"text-sidebar-foreground truncate",style:Da,children:r.name})]})};return e.jsxs("div",{className:`bg-sidebar border-r border-sidebar-border flex flex-col flex-shrink-0 h-full ${w}`,style:{width:F,minWidth:F,transition:"width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1)), min-width var(--shell-sidebar-transition, 250ms cubic-bezier(0.4,0,0.2,1))",overflow:"visible"},children:[t?e.jsx("div",{className:`${l?"px-2 py-2":"px-3 py-3"} border-b border-sidebar-border flex items-center ${l?"justify-center":""}`,children:e.jsx(or,{...t,collapsed:l})}):r&&e.jsx("div",{className:`${l?"px-2 py-3":"px-4 py-3"} border-b border-sidebar-border`,children:N()}),e.jsx("nav",{className:`flex-1 overflow-y-auto py-3 ${l?"px-1.5":"px-2"}`,children:o.map(v=>{const $=h.has(v.label);return e.jsxs("div",{className:"mb-4",children:[!l&&e.jsxs("button",{onClick:()=>m(v.label),className:"w-full flex items-center justify-between px-2 mb-1.5 text-muted-foreground hover:text-foreground transition-colors cursor-pointer",style:ja,children:[e.jsx("span",{children:v.label}),e.jsx(g.ChevronUp,{size:12,style:{transition:"transform 0.2s ease",transform:$?"rotate(180deg)":"rotate(0deg)"}})]}),l&&e.jsx("div",{className:"h-px bg-sidebar-border mx-1 mb-2 mt-1"}),!$&&e.jsx("div",{className:"space-y-0.5",children:v.items.map(C=>c(C))})]},v.label)})}),((n==null?void 0:n.length)||d&&i||u)&&e.jsxs("div",{className:`${l?"px-1.5":"px-2"} pb-3 border-t border-sidebar-border flex flex-col`,children:[n&&n.length>0&&e.jsx("div",{className:"pt-2 space-y-0.5",children:n.map(v=>c(v))}),d&&i&&e.jsx("div",{className:`${n!=null&&n.length?"mt-1":"pt-2"}`,children:e.jsxs("button",{onClick:()=>i(!l),className:`w-full flex items-center ${l?"justify-center":"gap-2 px-2"} py-1.5 rounded-[var(--radius-md)] text-muted-foreground hover:text-foreground hover:bg-sidebar-accent/50 cursor-pointer`,style:Ea,title:l?"Expand sidebar":"Collapse sidebar",children:[l?e.jsx(g.PanelLeftOpen,{size:16}):e.jsx(g.PanelLeftClose,{size:16}),!l&&e.jsx("span",{children:"Collapse"})]})}),u&&!l&&e.jsxs("div",{className:"px-2 pt-1 flex items-center gap-1.5 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},children:[e.jsx("span",{children:u}),b&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:b})]})]}),u&&l&&e.jsx("div",{className:"flex justify-center pt-1 text-muted-foreground/60",style:{fontFamily:"var(--font-label)",fontSize:"var(--text-caption)",fontWeight:"var(--weight-label)"},title:`${u}${b?` · ${b}`:""}`,children:u})]})]})}Pe.displayName="Sidebar";function se({width:r,height:t,variant:o="rectangular",animate:a=!0,className:s}){const l="bg-muted",i=a?"animate-pulse":"",d=o==="circular"?"rounded-full":o==="rounded"?"rounded-[var(--radius-md)]":"rounded-[var(--radius-sm)]";return e.jsx("div",{className:`${l} ${i} ${d} ${s??""}`,style:{width:r??"100%",height:t??(o==="text"?"1em":o==="circular"?40:20)}})}function Ta(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-4 space-y-4 w-full max-w-sm",children:[e.jsx(se,{variant:"rounded",height:160}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(se,{variant:"text",width:"60%",height:20}),e.jsx(se,{variant:"text",width:"100%",height:14}),e.jsx(se,{variant:"text",width:"80%",height:14})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(se,{variant:"circular",width:36,height:36}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:"40%",height:14}),e.jsx(se,{variant:"text",width:"25%",height:12})]})]})]})}function Ia(){return e.jsxs("div",{className:"rounded-[var(--radius-md)] 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(se,{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(se,{variant:"circular",width:28,height:28}),e.jsx(se,{variant:"text",width:100+r*15,height:14}),e.jsx(se,{variant:"text",width:140,height:14,className:"flex-1"}),e.jsx(se,{variant:"rounded",width:60,height:22}),e.jsx(se,{variant:"text",width:80,height:14})]},r))]})}function ar({rows:r=3}){return e.jsx("div",{className:"space-y-3 w-full max-w-md",children:Array.from({length:r}).map((t,o)=>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(se,{variant:"circular",width:40,height:40}),e.jsxs("div",{className:"flex-1 space-y-1.5",children:[e.jsx(se,{variant:"text",width:`${60+o*10}%`,height:14}),e.jsx(se,{variant:"text",width:`${40+o*5}%`,height:12})]}),e.jsx(se,{variant:"rounded",width:50,height:24})]},o))})}const Ba={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 ht({size:r="md",color:t,className:o=""}){return e.jsx("div",{className:`${Ba[r]} rounded-full border-muted animate-spin ${o}`,style:{borderTopColor:t??"var(--primary)"},role:"status","aria-label":"Loading"})}ht.displayName="Spinner";const sr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},ut={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},bt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},gt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},_a={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 Ha({title:r,value:t,prefix:o,suffix:a,trend:s,trendLabel:l,icon:i,size:d="md",loading:n}){const u=_a[d],b=(s==null?void 0:s.direction)==="up"?"text-chart-2":(s==null?void 0:s.direction)==="down"?"text-destructive":"text-muted-foreground",x=(s==null?void 0:s.direction)==="up"?g.ArrowUpRight:(s==null?void 0:s.direction)==="down"?g.ArrowDownRight:g.Minus;return n?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:[i&&e.jsx("span",{className:"text-muted-foreground",children:i}),e.jsx("span",{className:"text-muted-foreground",style:sr,children:r})]}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:o}),e.jsx("span",{className:"text-foreground",style:u,children:typeof t=="number"?t.toLocaleString():t}),a&&e.jsx("span",{className:"text-muted-foreground",style:sr,children:a})]}),s&&e.jsxs("div",{className:`flex items-center gap-1 ${b}`,children:[e.jsx(x,{size:14}),e.jsxs("span",{style:gt,children:[s.value,"%"]}),l&&e.jsx("span",{className:"text-muted-foreground",style:bt,children:l})]})]})}function Pa({title:r,value:t,prefix:o,trend:a,trendLabel:s,icon:l,iconBg:i}){const d=(a==null?void 0:a.direction)==="up"?"text-chart-2":(a==null?void 0:a.direction)==="down"?"text-destructive":"text-muted-foreground",n=(a==null?void 0:a.direction)==="up"?g.ArrowUpRight:(a==null?void 0:a.direction)==="down"?g.ArrowDownRight:g.Minus;return e.jsx("div",{className:"rounded-[var(--radius-md)] border border-border bg-card p-5 overflow-hidden",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-1 min-w-0 flex-1",children:[e.jsx("span",{className:"text-muted-foreground",style:sr,children:r}),e.jsxs("div",{className:"flex items-baseline gap-1",children:[o&&e.jsx("span",{className:"text-muted-foreground",style:ut,children:o}),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})]}),a&&e.jsxs("div",{className:`flex items-center gap-1 ${d}`,children:[e.jsx(n,{size:12}),e.jsxs("span",{style:gt,children:[a.value,"%"]}),s&&e.jsx("span",{className:"text-muted-foreground",style:bt,children:s})]})]}),l&&e.jsx("div",{className:`w-10 h-10 rounded-[var(--radius-md)] flex items-center justify-center flex-shrink-0 ${i||"bg-primary/10 text-primary"}`,children:l})]})})}const Oa={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},pt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},vt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},mt={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"};function xt({steps:r,current:t,orientation:o="horizontal",onStepClick:a,className:s=""}){return o==="vertical"?e.jsx("div",{className:`flex flex-col ${s}`,children:r.map((l,i)=>{const d=i<t,n=i===t,u=l.disabled;return e.jsxs("div",{className:`flex gap-3 ${u?"opacity-50":""}`,onClick:()=>!u&&(a==null?void 0:a(i)),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 ${u?"cursor-not-allowed":a?"cursor-pointer":""} ${d||n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:mt,children:d?e.jsx(g.Check,{size:14}):i+1}),i<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 ${i===r.length-1?"pb-0":""}`,children:[e.jsx("span",{className:`block ${n?"text-foreground":"text-muted-foreground"}`,style:n?pt:Oa,children:l.title}),l.description&&e.jsx("span",{className:"text-muted-foreground block",style:vt,children:l.description})]})]},i)})}):e.jsx("div",{className:`flex items-center ${s}`,children:r.map((l,i)=>{const d=i<t,n=i===t;return e.jsxs("div",{className:`flex items-center ${i<r.length-1?"flex-1":""} ${l.disabled?"opacity-50":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center gap-1",onClick:()=>!l.disabled&&(a==null?void 0:a(i)),children:[e.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 transition-colors ${l.disabled?"cursor-not-allowed":a?"cursor-pointer":""} ${d||n?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"}`,style:mt,children:d?e.jsx(g.Check,{size:14}):i+1}),e.jsx("span",{className:`text-center ${n?"text-foreground":"text-muted-foreground"}`,style:n?pt:vt,children:l.title})]}),i<r.length-1&&e.jsx("div",{className:`flex-1 h-px mx-2 mt-[-20px] ${d?"bg-primary":"bg-border"}`})]},i)})})}xt.displayName="Stepper";const Ya={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ga={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"},Ua={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"}},Xa={primary:"bg-primary",success:"bg-chart-2",warning:"bg-chart-5",destructive:"bg-destructive"},Ka={sm:{w:12,h:12,on:14},md:{w:18,h:18,on:18},lg:{w:26,h:26,on:24}};function Za({checked:r,onChange:t,label:o,description:a,size:s="md",disabled:l,color:i="primary"}){const d=Ua[s],n=Ka[s];return e.jsxs("label",{className:`inline-flex items-start gap-3 ${l?"opacity-50 pointer-events-none":"cursor-pointer"}`,children:[e.jsx("button",{role:"switch","aria-checked":r,onClick:()=>t(!r),disabled:l,className:`${d.track} rounded-full relative flex-shrink-0 transition-colors cursor-pointer ${r?Xa[i]:"bg-muted"}`,children:e.jsx("span",{className:"rounded-full bg-background shadow-elevation-sm absolute transition-transform",style:{width:n.w,height:n.h,top:"50%",transform:`translateY(-50%) translateX(${r?n.on:2}px)`,left:0}})}),(o||a)&&e.jsxs("div",{children:[o&&e.jsx("span",{className:"text-foreground block",style:Ya,children:o}),a&&e.jsx("span",{className:"text-muted-foreground block",style:Ga,children:a})]})]})}const qa={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"},Ja={sm:"px-1.5 py-0.5",md:"px-2 py-0.5",lg:"px-3 py-1.5"},Qa={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 yt({children:r,color:t="default",size:o="md",icon:a,closable:s,onClose:l,className:i=""}){const d=qa[t],n=Ja[o],u=Qa[o];return e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border ${d} ${n} ${i}`,style:u,children:[a&&e.jsx("span",{className:"flex-shrink-0",children:a}),r,s&&e.jsx("button",{className:"hover:opacity-70 cursor-pointer",onClick:l,children:e.jsx(g.X,{size:o==="sm"?10:12})})]})}yt.displayName="Tag";const Va={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Ra={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-button)"},es={default:"bg-card border-border",outline:"bg-transparent border-border",filled:"bg-muted/30 border-transparent"};function wt({tags:r,onChange:t,placeholder:o,disabled:a,maxTags:s,variant:l="default",className:i=""}){const[d,n]=f.useState(""),u=()=>{const x=d.trim();!x||r.includes(x)||s&&r.length>=s||(t([...r,x]),n(""))},b=x=>{t(r.filter(w=>w!==x))};return e.jsxs("div",{className:`flex flex-wrap items-center gap-1.5 px-3 py-2 rounded-[var(--radius)] border ${es[l]} transition-colors focus-within:border-primary ${a?"opacity-50 pointer-events-none":""} ${i}`,children:[r.map(x=>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:Ra,children:[x,e.jsx("button",{className:"hover:text-destructive cursor-pointer",onClick:()=>b(x),children:e.jsx(g.X,{size:12})})]},x)),e.jsx("input",{value:d,onChange:x=>n(x.target.value),onKeyDown:x=>{x.key==="Enter"&&(x.preventDefault(),u()),x.key==="Backspace"&&!d&&r.length&&t(r.slice(0,-1))},placeholder:r.length?"":o,className:"flex-1 min-w-[80px] bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:Va,disabled:a})]})}wt.displayName="TagInput";const rs={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},Nt={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},lr={fontFamily:"var(--font-button)",fontSize:"var(--text-button)",fontWeight:"var(--weight-label)"};function ts({items:r,variant:t="default",size:o="md"}){const a=o==="sm"?"w-6 h-6":o==="lg"?"w-10 h-10":"w-8 h-8",s=o==="sm"?12:o==="lg"?18:14,l=i=>i==="completed"?"bg-chart-2 text-primary-foreground":i==="current"?"bg-primary text-primary-foreground":i==="error"?"bg-destructive text-primary-foreground":"bg-muted text-muted-foreground";return t==="compact"?e.jsx("div",{className:"space-y-0",children:r.map((i,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:`${a} rounded-full flex items-center justify-center flex-shrink-0 ${l(i.status)}`,children:i.icon||(i.status==="completed"?e.jsx(g.CheckCircle2,{size:s}):e.jsx(g.Circle,{size:s}))}),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:Nt,children:i.title}),i.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:i.time})]}),i.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:lr,children:i.description})]})]},d))}):e.jsx("div",{className:"relative",children:r.map((i,d)=>{const n=t==="alternate"&&d%2===1;return e.jsxs("div",{className:`flex gap-4 pb-8 last:pb-0 ${n?"flex-row-reverse":""}`,children:[e.jsxs("div",{className:"flex flex-col items-center flex-shrink-0",children:[e.jsx("div",{className:`${a} rounded-full flex items-center justify-center ${l(i.status)}`,children:i.icon||(i.status==="completed"?e.jsx(g.CheckCircle2,{size:s}):e.jsx(g.Circle,{size:s}))}),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 ${n?"text-right":""}`,children:[e.jsxs("div",{className:`flex items-center gap-2 ${n?"justify-end":""}`,children:[e.jsx("span",{className:"text-foreground",style:Nt,children:i.title}),i.time&&e.jsx("span",{className:"text-muted-foreground",style:lr,children:i.time})]}),i.description&&e.jsx("p",{className:"text-muted-foreground mt-0.5",style:rs,children:i.description}),i.children&&e.jsx("div",{className:"mt-2",children:i.children})]})]},d)})})}const Oe={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-button)"},os={fontFamily:"var(--font-h4)",fontSize:"var(--text-h4)",fontWeight:"var(--weight-h4)"};function nr({brand:r,breadcrumbs:t,title:o,actions:a,user:s,height:l="56px",searchMode:i,searchPlaceholder:d="Search... (Ctrl+K)",onSearchClick:n,notificationCount:u,onNotificationClick:b,onMobileMenuClick:x,onSidebarToggle:w,onAppSwitcherClick:h,onUserClick:p,onBreadcrumbClick:m,workspaceSwitcher:y,showSearch:k,className:F=""}){const c=i??(k?"bar":"none"),N=s!=null&&s.name?s.name.split(" ").map($=>$[0]).join("").slice(0,2).toUpperCase():"",v=(r==null?void 0:r.logoFull)??(r==null?void 0:r.logo);return e.jsxs("div",{className:`bg-card border-b border-border flex items-center px-4 gap-3 ${F}`,style:{height:l},children:[w&&e.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-[var(--radius-md)] text-foreground hover:bg-muted/30 transition-colors cursor-pointer flex-shrink-0",onClick:w,title:"Toggle sidebar",children:e.jsx(g.Menu,{size:18})}),!w&&x&&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 flex-shrink-0",onClick:x,children:e.jsx(g.Menu,{size:16})}),r&&v&&e.jsx("div",{className:"flex items-center flex-shrink-0 text-foreground",children:typeof v=="string"?e.jsx("img",{src:v,alt:r.name,style:{height:"40px",width:"auto"},className:"rounded-[var(--radius-sm)] object-contain"}):e.jsx("div",{style:{height:"40px",display:"flex",alignItems:"center"},children:v})}),r&&!v&&e.jsx("div",{className:"w-10 h-10 rounded-[var(--radius-sm)] bg-primary flex items-center justify-center text-primary-foreground flex-shrink-0",style:Oe,children:r.name.charAt(0).toUpperCase()}),y&&e.jsx("div",{className:"flex items-center",children:y}),o&&e.jsx("span",{className:"text-foreground hidden sm:block truncate",style:os,children:o}),t&&t.length>0&&e.jsx("nav",{className:"hidden sm:flex items-center gap-1.5 text-muted-foreground",style:Oe,children:t.map(($,C)=>e.jsxs(f.Fragment,{children:[C>0&&e.jsx(g.ChevronRight,{size:12}),$.href||m?e.jsx("span",{className:`cursor-pointer ${C===t.length-1?"text-foreground":"hover:text-foreground"}`,onClick:()=>m==null?void 0:m($,C),children:$.label}):e.jsx("span",{className:C===t.length-1?"text-foreground":"",children:$.label})]},C))}),e.jsx("div",{className:"flex-1"}),c==="bar"&&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:n,children:[e.jsx(g.Search,{size:14}),e.jsx("span",{style:Oe,children:d})]}),c==="icon"&&e.jsx("button",{className:"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:n,title:"Search",children:e.jsx(g.Search,{size:16})}),a,b&&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:b,children:[e.jsx(g.Bell,{size:16}),u!==void 0&&u>0&&e.jsx("span",{className:"absolute top-1 right-1 w-2 h-2 rounded-full bg-destructive"})]}),h&&e.jsx("button",{className:"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:h,title:"Switch app",children:e.jsx(g.LayoutGrid,{size:16})}),s&&e.jsx("div",{className:"cursor-pointer flex-shrink-0",onClick:p,children:s.avatar?e.jsx("img",{src:s.avatar,alt:s.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:Oe,children:N})})]})}nr.displayName="TopNavbar";const as={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"},St={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)"};function kt({title:r,items:t,selected:o,onToggle:a,search:s,onSearch:l,searchable:i}){return e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] 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:St,children:r}),e.jsxs("span",{className:"text-muted-foreground",style:ir,children:[t.length," items"]})]}),i&&e.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-2",children:[e.jsx(g.Search,{size:12,className:"text-muted-foreground"}),e.jsx("input",{value:s,onChange:d=>l(d.target.value),placeholder:"Search\\u2026",className:"flex-1 bg-transparent outline-none text-foreground placeholder:text-muted-foreground",style:ir})]}),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:ir,children:"No items"}),t.map(d=>e.jsxs("button",{onClick:()=>!d.disabled&&a(d.id),className:`w-full flex items-center gap-2 px-3 py-1.5 transition-colors cursor-pointer
87
87
  ${o.has(d.id)?"bg-primary/10":"hover:bg-accent"}
88
88
  ${d.disabled?"opacity-40 pointer-events-none":""}`,style:as,children:[e.jsx("span",{className:`w-4 h-4 rounded-[var(--radius-sm)] border flex items-center justify-center flex-shrink-0
89
89
  ${o.has(d.id)?"bg-primary border-primary":"border-border"}`,children:o.has(d.id)&&e.jsx("span",{className:"w-2 h-2 rounded-[1px] bg-primary-foreground"})}),e.jsx("span",{className:"text-foreground truncate",children:d.label})]},d.id))]})]})}function ss({sourceTitle:r="Available",targetTitle:t="Selected",items:o,defaultTarget:a=[],searchable:s,value:l,onChange:i,loading:d=!1,error:n}){const[u,b]=f.useState(new Set(a)),x=l!==void 0?new Set(l):u,w=z=>{i&&i(Array.from(z)),l===void 0&&b(z)},[h,p]=f.useState(new Set),[m,y]=f.useState(new Set),[k,F]=f.useState(""),[c,N]=f.useState(""),v=o.filter(z=>!x.has(z.id)),$=o.filter(z=>x.has(z.id)),C=k?v.filter(z=>z.label.toLowerCase().includes(k.toLowerCase())):v,A=c?$.filter(z=>z.label.toLowerCase().includes(c.toLowerCase())):$,L=()=>{const z=new Set(x);h.forEach(E=>z.add(E)),w(z),p(new Set)},D=()=>{const z=new Set(x);m.forEach(E=>z.delete(E)),w(z),y(new Set)},T=()=>{w(new Set(o.filter(z=>!z.disabled).map(z=>z.id))),p(new Set)},M=()=>{w(new Set),y(new Set)},S=(z,E,I)=>{const O=new Set(E);O.has(z)?O.delete(z):O.add(z),I(O)};return n?e.jsx("div",{className:"flex items-center justify-center rounded-[var(--radius-md)] border border-border bg-card px-6 py-10 text-center",children:e.jsx("span",{style:{fontFamily:"var(--font-label)",fontSize:"var(--text-label)",color:"var(--destructive)"},children:n})}):d?e.jsx("div",{className:"flex items-stretch gap-3 flex-wrap opacity-60 pointer-events-none",children:[r,t].map(z=>e.jsxs("div",{className:"flex-1 min-w-[180px] rounded-[var(--radius-md)] border border-border bg-card overflow-hidden",children:[e.jsx("div",{className:"px-3 py-2.5 border-b border-border bg-muted/30",children:e.jsx("span",{style:St,children:z})}),e.jsx("div",{className:"p-3 flex flex-col gap-2",children:[1,2,3,4].map(E=>e.jsx("div",{className:"h-8 rounded bg-muted/50 animate-pulse"},E))})]},z))}):e.jsxs("div",{className:"flex items-stretch gap-3 flex-wrap",children:[e.jsx(kt,{title:r,items:C,selected:h,onToggle:z=>S(z,h,p),search:k,onSearch:F,searchable:s}),e.jsxs("div",{className:"flex flex-col items-center justify-center gap-1.5 py-4",children:[e.jsx("button",{onClick:T,disabled:v.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(g.ChevronsRight,{size:14})}),e.jsx("button",{onClick:L,disabled:h.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(g.ChevronRight,{size:14})}),e.jsx("button",{onClick:D,disabled:m.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(g.ChevronLeft,{size:14})}),e.jsx("button",{onClick:M,disabled:$.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(g.ChevronsLeft,{size:14})})]}),e.jsx(kt,{title:t,items:A,selected:m,onToggle:z=>S(z,m,y),search:c,onSearch:N,searchable:s})]})}const dr={fontFamily:"var(--font-label)",fontSize:"var(--text-label)",fontWeight:"var(--weight-label)"};function $t({node:r,level:t,expanded:o,selected:a,onToggle:s,onSelect:l,selectable:i,showLines:d}){const n=r.children&&r.children.length>0,u=o.has(r.id),b=a.has(r.id),x=n?u?e.jsx(g.FolderOpen,{size:14,className:"text-chart-5"}):e.jsx(g.Folder,{size:14,className:"text-chart-5"}):e.jsx(g.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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxuissk/design-system",
3
- "version": "0.8.11",
3
+ "version": "0.8.13",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "workspaces": [