@cruxkit/core 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +964 -0
- package/dist/index.cjs +211 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +828 -0
- package/dist/index.d.ts +828 -0
- package/dist/index.js +211 -0
- package/dist/index.js.map +1 -0
- package/package.json +58 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
'use strict';var signals=require('@minejs/signals'),jsxRuntime=require('@minejs/jsx/jsx-runtime');function ke(...s){return s.filter(Boolean).join(" ").trim().replace(/\s+/g," ")}function xr(s,e){if(!e)return s;let r=Object.entries(e).filter(([t,o])=>o).map(([t,o])=>typeof o=="string"?o:t).join(" ");return ke(s,r)}function Pe(s,e){let r=e||document.body,t=document.createElement("div");t.setAttribute("data-portal","true"),r.appendChild(t),s&&t.appendChild(s);}function hr(s){return signals.effect(()=>{Pe(s.children,s.container);}),null}function vr(s){signals.effect(()=>{let e=s.current;if(!e)return;let r=e.querySelectorAll('a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])'),t=r[0],o=r[r.length-1],a=l=>{l.key==="Tab"&&(l.shiftKey&&document.activeElement===t?(l.preventDefault(),o?.focus()):!l.shiftKey&&document.activeElement===o&&(l.preventDefault(),t?.focus()));};return e.addEventListener("keydown",a),t?.focus(),()=>{e.removeEventListener("keydown",a);}});}function yr(){let s=null;signals.effect(()=>(s=document.activeElement,()=>{s?.focus();}));}function wr(s,e){signals.effect(()=>{let r=t=>{s.current&&!s.current.contains(t.target)&&e(t);};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r);}});}function Cr(s){signals.effect(()=>{let e=r=>{r.key==="Escape"&&s();};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e);}});}function Er(){let e=signals.signal((()=>{let t=localStorage.getItem("theme");return t||(window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light")})());return signals.effect(()=>{let t=e();document.documentElement.setAttribute("data-theme",t),localStorage.setItem("theme",t);}),signals.effect(()=>{let t=window.matchMedia("(prefers-color-scheme: dark)"),o=a=>{localStorage.getItem("theme")||e.set(a.matches?"dark":"light");};return t.addEventListener("change",o),()=>{t.removeEventListener("change",o);}}),{theme:e,setTheme:t=>e.set(t),toggle:()=>{e.set(e()==="light"?"dark":"light");},isDark:()=>e()==="dark",isLight:()=>e()==="light"}}var k={xs:0,sm:640,md:768,lg:1024,xl:1280,"2xl":1536};function Sr(){let s=()=>{let r=window.innerWidth;return r>=k["2xl"]?"2xl":r>=k.xl?"xl":r>=k.lg?"lg":r>=k.md?"md":r>=k.sm?"sm":"xs"},e=signals.signal(s());return signals.effect(()=>{let r=()=>{e.set(s());};return window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r);}}),{current:e,isXs:()=>e()==="xs",isSm:()=>e()==="sm",isMd:()=>e()==="md",isLg:()=>e()==="lg",isXl:()=>e()==="xl",is2Xl:()=>e()==="2xl",isAbove:r=>k[e()]>=k[r],isBelow:r=>k[e()]<k[r]}}function kr(s){let e=signals.signal(false);return signals.effect(()=>{let r=window.matchMedia(s);e.set(r.matches);let t=o=>{e.set(o.matches);};return r.addEventListener("change",t),()=>{r.removeEventListener("change",t);}}),e}function Pr(s=true){signals.effect(()=>{if(s){let e=window.innerWidth-document.documentElement.clientWidth;document.body.style.overflow="hidden",document.body.style.paddingRight=`${e}px`;}else document.body.style.overflow="",document.body.style.paddingRight="";return ()=>{document.body.style.overflow="",document.body.style.paddingRight="";}});}function Xr(s,e){let r;return function(...o){let a=()=>{clearTimeout(r),s(...o);};clearTimeout(r),r=setTimeout(a,e);}}function Jr(s,e){let r;return function(...o){r||(s(...o),r=true,setTimeout(()=>r=false,e));}}function zr(s="ui"){return `${s}-${Math.random().toString(36).substr(2,9)}`}async function Xe(s){try{return await navigator.clipboard.writeText(s),!0}catch(e){return console.error("Failed to copy:",e),false}}function Tr(s=2e3){let e=signals.signal(false);return {copied:e,copy:async t=>{let o=await Xe(t);return e.set(o),o&&setTimeout(()=>e.set(false),s),o}}}function $r(){let s=signals.signal(document.documentElement.getAttribute("dir")||"ltr");return signals.effect(()=>{let e=new MutationObserver(r=>{r.forEach(t=>{t.type==="attributes"&&t.attributeName==="dir"&&s.set(document.documentElement.getAttribute("dir")||"ltr");});});return e.observe(document.documentElement,{attributes:true,attributeFilter:["dir"]}),()=>e.disconnect()}),{dir:s,isRtl:()=>s()==="rtl",isLtr:()=>s()==="ltr",toggle:()=>{let e=s()==="ltr"?"rtl":"ltr";document.documentElement.setAttribute("dir",e);}}}function Lr(s){let{as:e="p",size:r="base",weight:t="normal",align:o="start",color:a="1",italic:l=false,underline:n=false,lineThrough:c=false,truncate:p=false,noWrap:i=false,display:d,children:m,class:f,...u}=s,b={xs:"text-xs",sm:"text-sm",base:"text-base",md:"text-md",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl","4xl":"text-4xl","5xl":"text-5xl","6xl":"text-6xl"},x={light:"font-light",normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},g={start:"text-start",center:"text-center",end:"text-end",justify:"text-justify"},h={1:"text-1",2:"text-2",3:"text-3",4:"text-4",inverse:"text-inverse",brand:"text-brand",success:"text-success",warning:"text-warning",error:"text-error"},y=d?{block:"block",inline:"inline","inline-block":"inline-block"}[d]:"",v=[];l&&v.push("italic"),n&&v.push("underline"),c&&v.push("line-through"),p&&v.push("truncate"),i&&v.push("whitespace-nowrap");let C=[b[r],x[t],g[o],h[a],y,...v,f].filter(Boolean).join(" ");return jsxRuntime.jsx(e,{class:C,...u,children:m})}function ze(s){let{variant:e="solid",color:r="brand",size:t="md",disabled:o=false,loading:a=false,active:l=false,fullWidth:n=false,leftIcon:c,rightIcon:p,children:i,onClick:d,onPointerDown:m,onPointerUp:f,type:u="button",class:b,...x}=s,g=["inline-flex","items-center","justify-center","gap-2","font-medium","rounded-md","transition-all","duration-150","select-none","disabled:opacity-50","disabled:cursor-not-allowed","disabled:pointer-events-none","focus:outline-none","focus-visible:ring","focus-visible:ring-offset-2"],h={sm:["h-8","px-3","text-sm","gap-1.5"],md:["h-10","px-4","text-base","gap-2"],lg:["h-12","px-6","text-lg","gap-2.5"]},y={solid:{brand:["bg-brand","text-inverse","border","border-transparent","hover:bg-brand-hover","active:bg-brand-active","active:scale-95","shadow-sm","hover:shadow-md"],success:["bg-success","text-inverse","border","border-transparent","hover:bg-success-hover","active:bg-success-active","active:scale-95","shadow-sm","hover:shadow-md"],warning:["bg-warning","text-inverse","border","border-transparent","hover:bg-warning-hover","active:bg-warning-active","active:scale-95","shadow-sm","hover:shadow-md"],error:["bg-error","text-inverse","border","border-transparent","hover:bg-error-hover","active:bg-error-active","active:scale-95","shadow-sm","hover:shadow-md"],neutral:["bg-surface","text-1","border","border-1","hover:bg-raised","active:bg-tertiary","active:scale-95","shadow-sm","hover:shadow-md"]},outline:{brand:["bg-transparent","text-brand","border","border-brand","hover:bg-brand-subtle","active:bg-brand-subtle","active:scale-95"],success:["bg-transparent","text-success","border","border-success","hover:bg-success-subtle","active:bg-success-subtle","active:scale-95"],warning:["bg-transparent","text-warning","border","border-warning","hover:bg-warning-subtle","active:bg-warning-subtle","active:scale-95"],error:["bg-transparent","text-error","border","border-error","hover:bg-error-subtle","active:bg-error-subtle","active:scale-95"],neutral:["bg-transparent","text-1","border","border-1","hover:bg-raised","active:bg-tertiary","active:scale-95"]},ghost:{brand:["bg-transparent","text-brand","border","border-transparent","hover:bg-brand-subtle","active:bg-brand-subtle","active:scale-95"],success:["bg-transparent","text-success","border","border-transparent","hover:bg-success-subtle","active:bg-success-subtle","active:scale-95"],warning:["bg-transparent","text-warning","border","border-transparent","hover:bg-warning-subtle","active:bg-warning-subtle","active:scale-95"],error:["bg-transparent","text-error","border","border-transparent","hover:bg-error-subtle","active:bg-error-subtle","active:scale-95"],neutral:["bg-transparent","text-1","border","border-transparent","hover:bg-raised","active:bg-tertiary","active:scale-95"]},link:{brand:["bg-transparent","text-brand","border","border-transparent","hover:underline","underline-offset-4","decoration-2","px-1"],success:["bg-transparent","text-success","border","border-transparent","hover:underline","underline-offset-4","decoration-2","px-1"],warning:["bg-transparent","text-warning","border","border-transparent","hover:underline","underline-offset-4","decoration-2","px-1"],error:["bg-transparent","text-error","border","border-transparent","hover:underline","underline-offset-4","decoration-2","px-1"],neutral:["bg-transparent","text-1","border","border-transparent","hover:underline","underline-offset-4","decoration-2","px-1"]}},v=[];a&&v.push("cursor-wait","pointer-events-none"),l&&v.push("scale-95"),n&&v.push("w-full");let C=[...g,...h[t],...y[e][r],...v,b].filter(Boolean).join(" ");return jsxRuntime.jsxs("button",{type:u,class:C,disabled:o||a,onClick:d,onPointerDown:m,onPointerUp:f,...x,children:[a&&jsxRuntime.jsxs("svg",{class:"animate-spin size-4",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[jsxRuntime.jsx("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),jsxRuntime.jsx("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),!a&&c&&jsxRuntime.jsx("span",{class:"inline-flex shrink-0",children:c}),i&&jsxRuntime.jsx("span",{class:"inline-flex",children:i}),!a&&p&&jsxRuntime.jsx("span",{class:"inline-flex shrink-0",children:p})]})}function Ir(s){let{icon:e,...r}=s;return jsxRuntime.jsx(ze,{...r,class:`aspect-square p-0 ${s.class||""}`,children:e})}function Or(s){let{attached:e=false,spacing:r=2,children:t,class:o}=s,a=["inline-flex","items-center"],l={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4"},n=e?["[&>button:not(:first-child)]:rounded-s-none","[&>button:not(:last-child)]:rounded-e-none","[&>button:not(:first-child)]:-ms-px"]:[],c=[...a,l[r],...n,o].filter(Boolean).join(" ");return jsxRuntime.jsx("div",{class:c,children:t})}function Ar(s){let{variant:e="outline",size:r="md",disabled:t=false,readOnly:o=false,required:a=false,invalid:l=false,fullWidth:n=false,leftIcon:c,rightIcon:p,leftAddon:i,rightAddon:d,type:m="text",class:f,inputClass:u,...b}=s,x=["inline-flex","items-center","relative","transition-all","duration-150"],g={sm:{wrapper:["h-8","text-sm"],input:["px-3","text-sm"],icon:["size-4"],addon:["px-2","text-sm"]},md:{wrapper:["h-10","text-base"],input:["px-4","text-base"],icon:["size-5"],addon:["px-3","text-base"]},lg:{wrapper:["h-12","text-lg"],input:["px-5","text-lg"],icon:["size-6"],addon:["px-4","text-lg"]}},h={outline:{wrapper:["border","rounded-md","bg-surface",l?"border-error":"border-1","hover:border-2","focus-within:border-brand","focus-within:ring-2","focus-within:ring-brand","focus-within:ring-opacity-20"],input:["bg-transparent","border-0"],addon:["bg-raised","border-e","border-1","first:border-e","last:border-s"]},filled:{wrapper:["border","border-transparent","rounded-md","bg-raised","hover:bg-tertiary","focus-within:bg-surface","focus-within:border-brand","focus-within:ring-2","focus-within:ring-brand","focus-within:ring-opacity-20"],input:["bg-transparent","border-0"],addon:["bg-tertiary","border-e","border-1","first:border-e","last:border-s"]},flushed:{wrapper:["border-b-2","rounded-none","bg-transparent",l?"border-error":"border-1","focus-within:border-brand"],input:["bg-transparent","border-0","rounded-none"],addon:["bg-transparent","border-b-2","border-1"]}},y=[];t&&y.push("opacity-50","cursor-not-allowed","pointer-events-none"),o&&y.push("cursor-default"),n&&y.push("w-full");let v=["flex-1","outline-none","bg-transparent","placeholder:text-3","disabled:cursor-not-allowed","read-only:cursor-default","text-1"],C=["flex","items-center","justify-center","shrink-0"],J=[...x,...g[r].wrapper,...h[e].wrapper,...y,f].filter(Boolean).join(" "),z=[...v,...g[r].input,...h[e].input,u].filter(Boolean).join(" "),O=[...C,...g[r].icon,"text-3"].join(" "),H=["flex","items-center","shrink-0",...g[r].addon,...h[e].addon,"text-2","first:rounded-s-md","last:rounded-e-md"].filter(Boolean).join(" ");return jsxRuntime.jsxs("div",{class:J,children:[i&&jsxRuntime.jsx("div",{class:H,children:i}),c&&!i&&jsxRuntime.jsx("div",{class:`${O} ps-3`,children:c}),jsxRuntime.jsx("input",{type:m,class:z,disabled:t,readOnly:o,required:a,"aria-invalid":l,"aria-required":a,...b}),p&&!d&&jsxRuntime.jsx("div",{class:`${O} pe-3`,children:p}),d&&jsxRuntime.jsx("div",{class:H,children:d})]})}function Rr(s){let{children:e,class:r}=s,t=["flex","items-stretch","[&>*:not(:first-child):not(:last-child)]:rounded-none","[&>*:first-child:not(:only-child)]:rounded-e-none","[&>*:last-child:not(:only-child)]:rounded-s-none","[&>*:not(:first-child)]:-ms-px",r].filter(Boolean).join(" ");return jsxRuntime.jsx("div",{class:t,children:e})}function Hr(s){let{variant:e="outline",size:r="md",disabled:t=false,readOnly:o=false,required:a=false,invalid:l=false,fullWidth:n=false,rows:c=4,resize:p="vertical",class:i,inputClass:d,...m}=s,f={sm:["p-2","text-sm"],md:["p-3","text-base"],lg:["p-4","text-lg"]},u={outline:["border","rounded-md","bg-surface",l?"border-error":"border-1","hover:border-2","focus:border-brand","focus:ring-2","focus:ring-brand","focus:ring-opacity-20"],filled:["border","border-transparent","rounded-md","bg-raised","hover:bg-tertiary","focus:bg-surface","focus:border-brand","focus:ring-2","focus:ring-brand","focus:ring-opacity-20"],flushed:["border-b-2","rounded-none","bg-transparent",l?"border-error":"border-1","focus:border-brand"]},b={none:"resize-none",vertical:"resize-y",horizontal:"resize-x",both:"resize"},x=[];t&&x.push("opacity-50","cursor-not-allowed"),n&&x.push("w-full");let h=[...["outline-none","placeholder:text-3","disabled:cursor-not-allowed","read-only:cursor-default","text-1","transition-all","duration-150"],...f[r],...u[e],b[p],...x,i,d].filter(Boolean).join(" ");return jsxRuntime.jsx("textarea",{class:h,disabled:t,readOnly:o,required:a,rows:c,"aria-invalid":l,"aria-required":a,...m})}function $e(s){let{src:e,alt:r,name:t,fallback:o,size:a="md",rounded:l="full",badge:n,badgePosition:c="bottom-end",class:p,onClick:i,...d}=s,m={xs:"size-6",sm:"size-8",md:"size-10",lg:"size-12",xl:"size-16","2xl":"size-20"},f={xs:"text-xs",sm:"text-sm",md:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl"},u={base:"rounded-md",full:"rounded-full"},b={"top-start":"top-0 start-0","top-end":"top-0 end-0","bottom-start":"bottom-0 start-0","bottom-end":"bottom-0 end-0"},x=["relative","inline-flex","items-center","justify-center","shrink-0","overflow-hidden","bg-raised","text-1","font-medium","select-none",m[a],u[l],f[a],i&&"cursor-pointer hover:opacity-80 transition",p].filter(Boolean).join(" "),g=y=>y.split(" ").map(v=>v[0]).join("").toUpperCase().slice(0,2),h;return e?h=jsxRuntime.jsx("img",{src:e,alt:r||t||"Avatar",class:"size-full object-cover"}):t?h=jsxRuntime.jsx("span",{children:g(t)}):o?h=jsxRuntime.jsx("span",{children:o}):h=jsxRuntime.jsx("svg",{class:"size-3/5 text-3",fill:"currentColor",viewBox:"0 0 24 24",children:jsxRuntime.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"})}),jsxRuntime.jsxs("div",{class:x,onClick:i,...d,children:[h,n&&jsxRuntime.jsx("span",{class:`absolute ${b[c]} -translate-x-1/4 -translate-y-1/4`,children:n})]})}function Dr(s){let{children:e,max:r=5,spacing:t="normal",class:o}=s,l=["inline-flex","items-center",{tight:"[&>*:not(:first-child)]:-ms-2",normal:"[&>*:not(:first-child)]:-ms-3",loose:"[&>*:not(:first-child)]:-ms-4"}[t],"[&>*]:border-2","[&>*]:border-surface",o].filter(Boolean).join(" "),n=Array.isArray(e)?e:[e],c=n.slice(0,r),p=n.length-r;return jsxRuntime.jsxs("div",{class:l,children:[c,p>0&&jsxRuntime.jsx($e,{fallback:`+${p}`,class:"bg-tertiary text-2 font-semibold"})]})}function Kr(s){let{variant:e="solid",color:r="neutral",size:t="md",rounded:o="full",children:a,leftIcon:l,rightIcon:n,dot:c=false,class:p,...i}=s,d=["inline-flex","items-center","gap-1","font-medium","shrink-0"],m={sm:["h-5","px-2","text-xs"],md:["h-6","px-2.5","text-sm"],lg:["h-7","px-3","text-base"]},f={base:"rounded-md",full:"rounded-full"},u={solid:{brand:["bg-brand","text-inverse"],success:["bg-success","text-inverse"],warning:["bg-warning","text-inverse"],error:["bg-error","text-inverse"],neutral:["bg-surface","text-1","border","border-1"]},outline:{brand:["border","border-brand","text-brand"],success:["border","border-success","text-success"],warning:["border","border-warning","text-warning"],error:["border","border-error","text-error"],neutral:["border","border-1","text-1"]},subtle:{brand:["bg-brand-subtle","text-brand"],success:["bg-success-subtle","text-success"],warning:["bg-warning-subtle","text-warning"],error:["bg-error-subtle","text-error"],neutral:["bg-raised","text-1"]}},b=[...d,...m[t],f[o],...u[e][r],p].filter(Boolean).join(" "),x=c&&jsxRuntime.jsx("span",{class:`size-1.5 rounded-full ${e==="solid"?"bg-inverse":`bg-${r}`}`});return jsxRuntime.jsxs("span",{class:b,...i,children:[x,l&&jsxRuntime.jsx("span",{class:"inline-flex shrink-0",children:l}),a,n&&jsxRuntime.jsx("span",{class:"inline-flex shrink-0",children:n})]})}function Yr(s){let{size:e="md",color:r="current",thickness:t="normal",speed:o="normal",class:a,...l}=s,n={xs:"size-3",sm:"size-4",md:"size-6",lg:"size-8",xl:"size-12"},c={current:"text-current",brand:"text-brand",success:"text-success",warning:"text-warning",error:"text-error"},p={thin:"2",normal:"3",thick:"4"},i={slow:"duration-1000",normal:"duration-700",fast:"duration-500"},d=["inline-block","animate-spin",n[e],c[r],i[o],a].filter(Boolean).join(" ");return jsxRuntime.jsxs("svg",{class:d,xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",role:"status","aria-label":s["aria-label"]||"Loading",...l,children:[jsxRuntime.jsx("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":p[t]}),jsxRuntime.jsx("path",{class:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function et(s){let{width:e,height:r,variant:t="text",animate:o=true,class:a}=s,n=["bg-raised",o&&"animate-pulse",{text:"rounded h-4",circular:"rounded-full",rectangular:"rounded-md"}[t],a].filter(Boolean).join(" ");return jsxRuntime.jsx("div",{class:n,style:{width:e||(t==="text"?"100%":void 0),height:r||(t==="text"?void 0:"100%")}})}function st(s){let{maxWidth:e="xl",px:r=4,py:t,centerContent:o=false,children:a,class:l,as:n="div",...c}=s,p={xs:"max-w-xs",sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl","2xl":"max-w-2xl",full:"max-w-full"},i={0:"px-0",1:"px-1",2:"px-2",3:"px-3",4:"px-4",6:"px-6",8:"px-8",12:"px-12"},d=t!==void 0?{0:"py-0",1:"py-1",2:"py-2",3:"py-3",4:"py-4",6:"py-6",8:"py-8",12:"py-12"}[t]:"",m=["w-full","mx-auto",p[e],i[r],d,o&&"flex items-center justify-center",l].filter(Boolean).join(" ");return jsxRuntime.jsxs(n,{class:m,...c,children:[" ",a," "]})}function at(s){let{gap:e=4,align:r="stretch",justify:t="start",reverse:o=false,wrap:a=false,children:l,class:n,as:c="div",...p}=s,i={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8",10:"gap-10",12:"gap-12",16:"gap-16",20:"gap-20",24:"gap-24"},d={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},m={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},f=["flex",o?"flex-col-reverse":"flex-col",i[e],d[r],m[t],a&&"flex-wrap",n].filter(Boolean).join(" ");return jsxRuntime.jsxs(c,{class:f,...p,children:[" ",l," "]})}function ct(s){let{gap:e=4,align:r="center",justify:t="start",reverse:o=false,wrap:a=false,children:l,class:n,as:c="div",...p}=s,i={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8",10:"gap-10",12:"gap-12",16:"gap-16",20:"gap-20",24:"gap-24"},d={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch",baseline:"items-baseline"},m={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"},f=["flex",o?"flex-row-reverse":"flex-row",i[e],d[r],m[t],a&&"flex-wrap",n].filter(Boolean).join(" ");return jsxRuntime.jsxs(c,{class:f,...p,children:[" ",l," "]})}function mt(s){let{cols:e,colsSm:r,colsMd:t,colsLg:o,colsXl:a,rows:l,gap:n,gapX:c,gapY:p,align:i,justify:d,flow:m,children:f,class:u,as:b="div",...x}=s,g=H=>H?`grid-cols-${H}`:"",h={0:"gap-0",1:"gap-1",2:"gap-2",3:"gap-3",4:"gap-4",5:"gap-5",6:"gap-6",8:"gap-8",10:"gap-10",12:"gap-12",16:"gap-16",20:"gap-20",24:"gap-24"},y=c!==void 0?{0:"gap-x-0",1:"gap-x-1",2:"gap-x-2",3:"gap-x-3",4:"gap-x-4",5:"gap-x-5",6:"gap-x-6",8:"gap-x-8",10:"gap-x-10",12:"gap-x-12",16:"gap-x-16",20:"gap-x-20",24:"gap-x-24"}[c]:"",v=p!==void 0?{0:"gap-y-0",1:"gap-y-1",2:"gap-y-2",3:"gap-y-3",4:"gap-y-4",5:"gap-y-5",6:"gap-y-6",8:"gap-y-8",10:"gap-y-10",12:"gap-y-12",16:"gap-y-16",20:"gap-y-20",24:"gap-y-24"}[p]:"",C=i?{start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"}[i]:"",J=d?{start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around",evenly:"justify-evenly"}[d]:"",z=m?{row:"grid-flow-row",col:"grid-flow-col",dense:"grid-flow-dense","row-dense":"grid-flow-row-dense","col-dense":"grid-flow-col-dense"}[m]:"",O=l?`grid-rows-${l}`:"",R=["grid",g(e),r&&`sm:${g(r)}`,t&&`md:${g(t)}`,o&&`lg:${g(o)}`,a&&`xl:${g(a)}`,O,n!==void 0?h[n]:"",y,v,C,J,z,u].filter(Boolean).join(" ");return jsxRuntime.jsxs(b,{class:R,...x,children:[" ",f," "]})}function gt(s){let{size:e,axis:r="both",flex:t=false,class:o}=s,a=e?{x:{1:"w-1",2:"w-2",3:"w-3",4:"w-4",6:"w-6",8:"w-8",10:"w-10",12:"w-12",16:"w-16",20:"w-20",24:"w-24"},y:{1:"h-1",2:"h-2",3:"h-3",4:"h-4",6:"h-6",8:"h-8",10:"h-10",12:"h-12",16:"h-16",20:"h-20",24:"h-24"},both:{1:"size-1",2:"size-2",3:"size-3",4:"size-4",6:"size-6",8:"size-8",10:"size-10",12:"size-12",16:"size-16",20:"size-20",24:"size-24"}}[r][e]:"",l=[t&&"flex-1",!t&&a,o].filter(Boolean).join(" ");return jsxRuntime.jsx("div",{class:l,"aria-hidden":"true"})}function ht(s){let{orientation:e="horizontal",variant:r="solid",thickness:t="thin",color:o="2",label:a,labelPosition:l="center",spacing:n,class:c,role:p="separator",...i}=s,d={horizontal:{thin:"border-t",medium:"border-t-2",thick:"border-t-4"},vertical:{thin:"border-s",medium:"border-s-2",thick:"border-s-4"}},m={solid:"border-solid",dashed:"border-dashed",dotted:"border-dotted"},f={1:"border-1",2:"border-2",3:"border-3",brand:"border-brand",current:"border-current"},u=n!==void 0?{horizontal:{0:"my-0",1:"my-1",2:"my-2",3:"my-3",4:"my-4",6:"my-6",8:"my-8",12:"my-12"},vertical:{0:"mx-0",1:"mx-1",2:"mx-2",3:"mx-3",4:"mx-4",6:"mx-6",8:"mx-8",12:"mx-12"}}[e][n]:"",b=[d[e][t],m[r],f[o],u,e==="horizontal"?"w-full":"h-full",c].filter(Boolean).join(" ");return a?jsxRuntime.jsxs("div",{class:`${e==="horizontal"?"flex items-center w-full":"flex flex-col items-center h-full"} ${{horizontal:{start:"justify-start",center:"justify-center",end:"justify-end"},vertical:{start:"justify-start",center:"justify-center",end:"justify-end"}}[e][l]} ${u}`,role:p,"aria-orientation":e,...i,children:[l!=="start"&&jsxRuntime.jsx("div",{class:`flex-1 ${b}`}),jsxRuntime.jsx("span",{class:`${e==="horizontal"?"px-3":"py-3"} text-2 text-sm`,children:a}),l!=="end"&&jsxRuntime.jsx("div",{class:`flex-1 ${b}`})]}):jsxRuntime.jsx("div",{class:b,role:p,"aria-orientation":e,...i})}function wt(s){let{inline:e=false,children:r,class:t,as:o="div",...a}=s,l=e?["flex","justify-center",t].filter(Boolean).join(" "):["flex","items-center","justify-center",t].filter(Boolean).join(" ");return jsxRuntime.jsxs(o,{class:l,...a,children:[" ",r," "]})}function St(s){let{children:e,class:r,as:t="div",...o}=s;return jsxRuntime.jsxs(t,{class:r,...o,children:[" ",e," "]})}function me(s){let{status:e="info",variant:r="subtle",title:t,description:o,children:a,icon:l,showIcon:n=true,closable:c=false,onClose:p,actions:i,class:d,role:m="alert","aria-live":f="polite",...u}=s,b=signals.signal(true),x=()=>{b.set(false),p?.();};if(!b())return null;let g={solid:{info:["bg-color-primary","text-white","border border-color-primary"],success:["bg-color-success","text-white","border border-color-success"],warning:["bg-color-warning","text-white","border border-color-warning"],error:["bg-color-error","text-white","border border-color-error"]},subtle:{info:["bg-color-primary-subtle","text-primary","border border-color-primary"],success:["bg-color-success-subtle","text-primary","border border-color-success"],warning:["bg-color-warning-subtle","text-primary","border border-color-warning"],error:["bg-color-error-subtle","text-primary","border border-color-error"]},"left-accent":{info:["bg-color-primary-subtle","text-primary","border-s-4","border-color-primary"],success:["bg-color-success-subtle","text-primary","border-s-4","border-color-success"],warning:["bg-color-warning-subtle","text-primary","border-s-4","border-color-warning"],error:["bg-color-error-subtle","text-primary","border-s-4","border-color-error"]},"top-accent":{info:["bg-color-primary-subtle","text-primary","border-t-4","border-color-primary"],success:["bg-color-success-subtle","text-primary","border-t-4","border-color-success"],warning:["bg-color-warning-subtle","text-primary","border-t-4","border-color-warning"],error:["bg-color-error-subtle","text-primary","border-t-4","border-color-error"]}},h={info:jsxRuntime.jsx("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z","clip-rule":"evenodd"})}),success:jsxRuntime.jsx("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z","clip-rule":"evenodd"})}),warning:jsxRuntime.jsx("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z","clip-rule":"evenodd"})}),error:jsxRuntime.jsx("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z","clip-rule":"evenodd"})})},y=["flex gap-3 p-4 rounded-lg",...g[r][e],d].filter(Boolean).join(" "),v=n&&(l||h[e]);return jsxRuntime.jsxs("div",{class:y,role:m,"aria-live":f,...u,children:[v&&jsxRuntime.jsx("div",{class:"shrink-0 pt-0.5",children:v}),jsxRuntime.jsxs("div",{class:"flex-1 min-w-0",children:[t&&jsxRuntime.jsx("div",{class:"font-semibold mb-1",children:t}),(o||a)&&jsxRuntime.jsx("div",{class:"text-sm opacity-90",children:o||a}),i&&jsxRuntime.jsx("div",{class:"mt-3",children:i})]}),c&&jsxRuntime.jsx("button",{onClick:x,class:"shrink-0 p-1 rounded hover:bg-black hover:bg-opacity-10 transition","aria-label":"Close alert",children:jsxRuntime.jsx("svg",{class:"size-4",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})})})]})}function $t(s){let{status:e="info",title:r,description:t,duration:o=5e3,closable:a=true,icon:l,action:n,onClose:c,class:p}=s,i=signals.signal(true),d=signals.signal(100);signals.effect(()=>{if(o>0){let b=setInterval(()=>{d.update(x=>{let g=x-100/(o/50);return g<=0?(clearInterval(b),m(),0):g});},50);return ()=>clearInterval(b)}});let m=()=>{i.set(false),setTimeout(()=>c?.(),200);};if(!i())return null;let u=["relative flex gap-3 p-4 rounded-lg shadow-lg min-w-80 max-w-md","animate-in slide-in-from-bottom-4 fade-in duration-300",...{info:["bg-color-primary","text-white"],success:["bg-color-success","text-white"],warning:["bg-color-warning","text-white"],error:["bg-color-error","text-white"]}[e],p].filter(Boolean).join(" ");return jsxRuntime.jsxs("div",{class:u,role:"alert",children:[l&&jsxRuntime.jsx("div",{class:"shrink-0 pt-0.5",children:l}),jsxRuntime.jsxs("div",{class:"flex-1 min-w-0",children:[r&&jsxRuntime.jsx("div",{class:"font-semibold mb-1",children:r}),t&&jsxRuntime.jsx("div",{class:"text-sm opacity-90",children:t}),n&&jsxRuntime.jsx("div",{class:"mt-2",children:n})]}),a&&jsxRuntime.jsx("button",{onClick:m,class:"shrink-0 p-1 rounded hover:bg-black hover:bg-opacity-10 transition","aria-label":"Close notification",children:jsxRuntime.jsx("svg",{class:"size-4",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})})}),o>0&&jsxRuntime.jsx("div",{class:"absolute bottom-0 left-0 right-0 h-1 bg-black bg-opacity-20 rounded-b-lg overflow-hidden",children:jsxRuntime.jsx("div",{class:"h-full bg-inverse transition-all duration-50 ease-linear",style:{width:`${d()}%`}})})]})}function Mt(s){let{value:e=0,max:r=100,size:t="md",color:o="brand",variant:a="linear",label:l,showValue:n=false,indeterminate:c=false,striped:p=false,animated:i=false,class:d,...m}=s,f=Math.min(Math.max(e/r*100,0),100);if(a==="circular"){let h={xs:32,sm:40,md:48,lg:64},y={xs:3,sm:4,md:4,lg:5},v=h[t],C=y[t],J=(v-C)/2,z=2*Math.PI*J,O=z-f/100*z,R={brand:"text-color-primary",success:"text-color-success",warning:"text-color-warning",error:"text-color-error"};return jsxRuntime.jsxs("div",{class:`inline-flex flex-col items-center gap-2 ${d||""}`,children:[jsxRuntime.jsxs("div",{class:"relative",style:{width:`${v}px`,height:`${v}px`},children:[jsxRuntime.jsxs("svg",{class:"transform -rotate-90",width:v,height:v,children:[jsxRuntime.jsx("circle",{cx:v/2,cy:v/2,r:J,stroke:"currentColor","stroke-width":C,fill:"none",class:"text-raised opacity-30"}),!c&&jsxRuntime.jsx("circle",{cx:v/2,cy:v/2,r:J,stroke:"currentColor","stroke-width":C,fill:"none","stroke-linecap":"round","stroke-dasharray":z,"stroke-dashoffset":O,class:`${R[o]} transition-all duration-300`}),c&&jsxRuntime.jsx("circle",{cx:v/2,cy:v/2,r:J,stroke:"currentColor","stroke-width":C,fill:"none","stroke-linecap":"round","stroke-dasharray":z*.25,class:`${R[o]} animate-spin`})]}),n&&!c&&jsxRuntime.jsx("div",{class:"absolute inset-0 flex items-center justify-center",children:jsxRuntime.jsxs("span",{class:"text-sm font-semibold",children:[Math.round(f),"%"]})})]}),l&&jsxRuntime.jsx("span",{class:"text-sm text-2",children:l})]})}let u={xs:"h-1",sm:"h-2",md:"h-3",lg:"h-4"},b={brand:"bg-color-primary",success:"bg-color-success",warning:"bg-color-warning",error:"bg-color-error"},x=["w-full rounded-full overflow-hidden bg-raised",u[t],d].filter(Boolean).join(" "),g=["h-full rounded-full transition-all duration-300",b[o],p&&"bg-stripes",i&&p&&"animate-stripes",c&&"animate-progress-indeterminate"].filter(Boolean).join(" ");return jsxRuntime.jsxs("div",{class:"w-full",children:[(l||n)&&jsxRuntime.jsxs("div",{class:"flex justify-between items-center mb-2",children:[l&&jsxRuntime.jsx("span",{class:"text-sm text-2",children:l}),n&&!c&&jsxRuntime.jsxs("span",{class:"text-sm font-semibold",children:[Math.round(f),"%"]})]}),jsxRuntime.jsx("div",{class:x,role:"progressbar","aria-valuenow":c?void 0:e,"aria-valuemin":0,"aria-valuemax":r,...m,children:jsxRuntime.jsx("div",{class:g,style:{width:c?"30%":`${f}%`}})})]})}function Ft(s){let{position:e="top-end",duration:r,onClose:t,...o}=s,a=signals.signal(true);signals.effect(()=>{if(r&&r>0){let c=setTimeout(()=>{a.set(false),setTimeout(()=>t?.(),200);},r);return ()=>clearTimeout(c)}});let l=()=>{a.set(false),setTimeout(()=>t?.(),200);};return a()?jsxRuntime.jsx("div",{class:`fixed ${{top:"top-4 left-1/2 -translate-x-1/2",bottom:"bottom-4 left-1/2 -translate-x-1/2","top-start":"top-4 start-4","top-end":"top-4 end-4","bottom-start":"bottom-4 start-4","bottom-end":"bottom-4 end-4"}[e]} z-notification max-w-md animate-in slide-in-from-top-4 fade-in duration-300`,children:jsxRuntime.jsx(me,{...o,variant:"subtle",closable:true,onClose:l,class:"shadow-xl"})}):null}function Vt(s){let{isOpen:e=false,onClose:r,title:t,description:o,children:a,actions:l,size:n="md",backdrop:c=true,closeOnBackdrop:p=true,class:i,role:d="dialog",...m}=s,f=signals.signal(e),u={sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-full"},b=()=>{p&&(f.set(false),r?.());},x=()=>{f.set(false),r?.();};return f()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[c&&jsxRuntime.jsx("div",{class:"fixed inset-0 bg-black/40 z-modal-backdrop animate-in fade-in duration-200",onClick:b,"aria-hidden":"true"}),jsxRuntime.jsx("div",{class:"fixed inset-0 flex items-center justify-center z-modal pointer-events-none",children:jsxRuntime.jsxs("div",{class:`
|
|
2
|
+
relative w-full mx-4 ${u[n]} rounded-lg
|
|
3
|
+
bg-surface shadow-lg animate-in zoom-in-95 fade-in duration-200
|
|
4
|
+
pointer-events-auto border border-border-primary
|
|
5
|
+
${i||""}
|
|
6
|
+
`.trim(),role:d,"aria-modal":"true",...m,children:[(t||o)&&jsxRuntime.jsxs("div",{class:"px-6 py-4 border-b border-border-primary",children:[t&&jsxRuntime.jsx("h2",{class:"text-lg font-semibold text-primary mb-1",children:t}),o&&jsxRuntime.jsx("p",{class:"text-sm text-primary/70",children:o})]}),a&&jsxRuntime.jsx("div",{class:"px-6 py-4",children:a}),l&&jsxRuntime.jsx("div",{class:"px-6 py-4 border-t border-border-primary flex gap-3 justify-end",children:l}),jsxRuntime.jsx("button",{onClick:x,class:"absolute top-4 right-4 p-1 rounded-md hover:bg-surface-hover transition","aria-label":"Close modal",children:jsxRuntime.jsx("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})})})]})})]}):null}function qt(s){let{isOpen:e=false,onClose:r,title:t,children:o,position:a="left",size:l="md",backdrop:n=true,closeOnBackdrop:c=true,class:p,role:i="dialog",...d}=s,m=signals.signal(e),f={left:{sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]"},right:{sm:"w-64",md:"w-80",lg:"w-96",xl:"w-[28rem]"},top:{sm:"h-40",md:"h-48",lg:"h-64",xl:"h-80"},bottom:{sm:"h-40",md:"h-48",lg:"h-64",xl:"h-80"}},u={left:"inset-y-0 left-0 animate-in slide-in-from-left",right:"inset-y-0 right-0 animate-in slide-in-from-right",top:"inset-x-0 top-0 animate-in slide-in-from-top",bottom:"inset-x-0 bottom-0 animate-in slide-in-from-bottom"},b=()=>{c&&(m.set(false),r?.());},x=()=>{m.set(false),r?.();};return m()?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[n&&jsxRuntime.jsx("div",{class:"fixed inset-0 bg-black/40 z-drawer-backdrop animate-in fade-in duration-200",onClick:b,"aria-hidden":"true"}),jsxRuntime.jsxs("div",{class:`
|
|
7
|
+
fixed ${u[a]} ${f[a][l]}
|
|
8
|
+
z-drawer bg-surface shadow-lg duration-200 flex flex-col
|
|
9
|
+
border-border-primary
|
|
10
|
+
${a==="left"||a==="right"?"border-e":"border-t"}
|
|
11
|
+
${p||""}
|
|
12
|
+
`.trim(),role:i,"aria-modal":"true",...d,children:[jsxRuntime.jsxs("div",{class:"flex items-center justify-between px-6 py-4 border-b border-border-primary shrink-0",children:[t&&jsxRuntime.jsx("h2",{class:"text-lg font-semibold text-primary",children:t}),jsxRuntime.jsx("button",{onClick:x,class:"p-1 rounded-md hover:bg-surface-hover transition ml-auto","aria-label":"Close drawer",children:jsxRuntime.jsx("svg",{class:"size-5",fill:"currentColor",viewBox:"0 0 20 20",children:jsxRuntime.jsx("path",{"fill-rule":"evenodd",d:"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z","clip-rule":"evenodd"})})})]}),jsxRuntime.jsx("div",{class:"flex-1 overflow-y-auto px-6 py-4",children:o})]})]}):null}function Yt(s){let{trigger:e,children:r,position:t="bottom",isOpen:o=false,onOpenChange:a,closeOnClickOutside:l=true,closeOnEscape:n=true,class:c,role:p="dialog",...i}=s,d=signals.signal(o),m={top:"bottom-full mb-2",bottom:"top-full mt-2",left:"right-full mr-2",right:"left-full ml-2"},f=()=>{let x=!d();d.set(x),a?.(x);},u=()=>{d.set(false),a?.(false);},b=x=>{n&&x.key==="Escape"&&u();};return jsxRuntime.jsxs("div",{class:"relative inline-block",children:[jsxRuntime.jsx("div",{onClick:f,class:"cursor-pointer",children:e}),d()&&jsxRuntime.jsx("div",{class:`
|
|
13
|
+
absolute z-popover ${m[t]}
|
|
14
|
+
bg-surface rounded-lg shadow-lg border border-border-primary
|
|
15
|
+
p-3 min-w-48 max-w-xs animate-in fade-in zoom-in-95 duration-200
|
|
16
|
+
${c||""}
|
|
17
|
+
`.trim(),role:p,onKeyDown:b,onClick:x=>x.stopPropagation(),...i,children:r}),d()&&l&&jsxRuntime.jsx("div",{class:"fixed inset-0 z-popover-backdrop",onClick:u,"aria-hidden":"true"})]})}function rs(s){let{content:e,children:r,position:t="top",delayShow:o=200,delayHide:a=100,class:l,contentClass:n,...c}=s,p=signals.signal(false),i=null,d=null,m={top:"bottom-full mb-2",bottom:"top-full mt-2",left:"right-full mr-2",right:"left-full ml-2"},f={top:"-bottom-1 left-1/2 -translate-x-1/2 border-t-8 border-l-4 border-r-4 border-l-transparent border-r-transparent border-t-surface",bottom:"-top-1 left-1/2 -translate-x-1/2 border-b-8 border-l-4 border-r-4 border-l-transparent border-r-transparent border-b-surface",left:"-right-1 top-1/2 -translate-y-1/2 border-l-8 border-t-4 border-b-4 border-t-transparent border-b-transparent border-l-surface",right:"-left-1 top-1/2 -translate-y-1/2 border-r-8 border-t-4 border-b-4 border-t-transparent border-b-transparent border-r-surface"},u=()=>{d&&clearTimeout(d),i=setTimeout(()=>{p.set(true);},o);},b=()=>{i&&clearTimeout(i),d=setTimeout(()=>{p.set(false);},a);};return jsxRuntime.jsxs("div",{class:`relative inline-block ${l||""}`,onMouseEnter:u,onMouseLeave:b,children:[r,p()&&e&&jsxRuntime.jsxs("div",{class:`
|
|
18
|
+
absolute z-tooltip ${m[t]}
|
|
19
|
+
bg-surface text-primary text-sm rounded-md shadow-lg
|
|
20
|
+
px-2 py-1 whitespace-nowrap pointer-events-none
|
|
21
|
+
animate-in fade-in zoom-in-95 duration-200
|
|
22
|
+
border border-border-primary
|
|
23
|
+
${n||""}
|
|
24
|
+
`.trim(),role:"tooltip",...c,children:[e,jsxRuntime.jsx("div",{class:`absolute ${f[t]}`})]})]})}function ns(s){let{trigger:e,items:r,position:t="bottom",isOpen:o=false,onOpenChange:a,closeOnSelect:l=true,closeOnClickOutside:n=true,class:c,role:p="menu",...i}=s,d=signals.signal(o),m={top:"bottom-full mb-2",bottom:"top-full mt-2"},f=()=>{let g=!d();d.set(g),a?.(g);},u=()=>{d.set(false),a?.(false);},b=g=>{g.disabled||(g.onClick?.(),l&&u());},x=(g="default",h=false)=>h?"opacity-50 cursor-not-allowed":g==="danger"?"text-color-error hover:bg-color-error/10":"hover:bg-surface-hover";return jsxRuntime.jsxs("div",{class:"relative inline-block",children:[jsxRuntime.jsx("div",{onClick:f,class:"cursor-pointer",children:e}),d()&&jsxRuntime.jsx("div",{class:`
|
|
25
|
+
absolute z-dropdown-menu ${m[t]} right-0
|
|
26
|
+
bg-surface rounded-lg shadow-lg border border-border-primary
|
|
27
|
+
min-w-48 py-1 animate-in fade-in zoom-in-95 duration-200
|
|
28
|
+
${c||""}
|
|
29
|
+
`.trim(),role:p,...i,children:r.map((g,h)=>jsxRuntime.jsxs("button",{onClick:()=>b(g),disabled:g.disabled,class:`
|
|
30
|
+
w-full flex items-center gap-3 px-4 py-2 text-sm
|
|
31
|
+
text-left transition-colors
|
|
32
|
+
${x(g.variant,g.disabled)}
|
|
33
|
+
${g.class||""}
|
|
34
|
+
`.trim(),role:"menuitem",children:[g.icon&&jsxRuntime.jsx("span",{class:"shrink-0 size-4",children:g.icon}),jsxRuntime.jsx("span",{class:"flex-1",children:g.label})]},h))}),d()&&n&&jsxRuntime.jsx("div",{class:"fixed inset-0 z-dropdown-backdrop",onClick:u,"aria-hidden":"true"})]})}function is(s){let{children:e,onSubmit:r,onChange:t,class:o,noValidate:a=false,...l}=s;return jsxRuntime.jsx("form",{class:o,onSubmit:r,onChange:t,noValidate:a,...l,children:e})}function cs(s){let{label:e,error:r,required:t=false,hint:o,class:a,children:l}=s;return jsxRuntime.jsxs("div",{class:`flex flex-col gap-2 ${a||""}`,children:[e&&jsxRuntime.jsxs("label",{class:"text-sm font-semibold text-primary",children:[e,t&&jsxRuntime.jsx("span",{class:"text-color-error ml-1",children:"*"})]}),jsxRuntime.jsx("div",{children:l}),r&&jsxRuntime.jsx("div",{class:"text-sm text-color-error",children:r}),o&&!r&&jsxRuntime.jsx("div",{class:"text-sm text-primary/60",children:o})]})}function ds(s){let{for:e,required:r=false,children:t,class:o}=s;return jsxRuntime.jsxs("label",{for:e,class:`text-sm font-semibold text-primary ${o||""}`,children:[t,r&&jsxRuntime.jsx("span",{class:"text-color-error ml-1",children:"*"})]})}function ps(s){let{children:e,class:r}=s;return jsxRuntime.jsx("div",{class:`text-sm text-color-error ${r||""}`,children:e})}function ms(s){let{children:e,class:r}=s;return jsxRuntime.jsx("div",{class:`text-sm text-primary/60 ${r||""}`,children:e})}function fs(s){let{checked:e=false,onChange:r,label:t,disabled:o=false,class:a,...l}=s,n=signals.signal(e),c=p=>{let i=p.target;n.set(i.checked),r?.(i.checked);};return jsxRuntime.jsxs("label",{class:`flex items-center gap-2 cursor-pointer ${o?"opacity-50 cursor-not-allowed":""} ${a||""}`,children:[jsxRuntime.jsx("input",{type:"checkbox",checked:n(),onChange:c,disabled:o,class:`
|
|
35
|
+
w-5 h-5 rounded border-2 border-border-primary
|
|
36
|
+
bg-surface cursor-pointer transition-colors
|
|
37
|
+
checked:bg-color-primary checked:border-color-primary
|
|
38
|
+
focus:outline-none focus:ring-2 focus:ring-color-primary/50
|
|
39
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
40
|
+
accent-color-primary
|
|
41
|
+
`.trim(),...l}),t&&jsxRuntime.jsx("span",{class:"text-sm text-primary font-medium",children:t})]})}function or(s){let{value:e,checked:r=false,onChange:t,label:o,disabled:a=false,class:l,...n}=s,c=signals.signal(r),p=i=>{i.target.checked&&(c.set(true),t?.(e));};return jsxRuntime.jsxs("label",{class:`flex items-center gap-2 cursor-pointer ${a?"opacity-50 cursor-not-allowed":""} ${l||""}`,children:[jsxRuntime.jsx("input",{type:"radio",value:e,checked:c(),onChange:p,disabled:a,class:`
|
|
42
|
+
w-5 h-5 rounded-full border-2 border-border-primary
|
|
43
|
+
bg-surface cursor-pointer transition-colors
|
|
44
|
+
checked:border-color-primary
|
|
45
|
+
focus:outline-none focus:ring-2 focus:ring-color-primary/50
|
|
46
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
47
|
+
accent-color-primary
|
|
48
|
+
`.trim(),...n}),o&&jsxRuntime.jsx("span",{class:"text-sm text-primary font-medium",children:o})]})}function ys(s){let{value:e="",onChange:r,options:t,direction:o="vertical",disabled:a=false,class:l,name:n,...c}=s,p=signals.signal(e),i=m=>{p.set(m),r?.(m);};return jsxRuntime.jsx("div",{class:`flex ${o==="horizontal"?"flex-row":"flex-col"} gap-3 ${l||""}`,...c,children:t.map(m=>jsxRuntime.jsx(or,{value:m.value,label:m.label,checked:p()===m.value,onChange:i,disabled:a||m.disabled,name:n}))})}function Ss(s){let{checked:e=false,onChange:r,label:t,disabled:o=false,class:a,...l}=s,n=signals.signal(e),c=p=>{let i=p.target;n.set(i.checked),r?.(i.checked);};return jsxRuntime.jsxs("label",{class:`flex items-center gap-3 cursor-pointer ${o?"opacity-50 cursor-not-allowed":""} ${a||""}`,children:[jsxRuntime.jsxs("div",{class:"relative inline-block",children:[jsxRuntime.jsx("input",{type:"checkbox",checked:n(),onChange:c,disabled:o,class:"sr-only",...l}),jsxRuntime.jsx("div",{class:`
|
|
49
|
+
w-11 h-6 rounded-full transition-colors
|
|
50
|
+
${n()?"bg-color-primary":"bg-border-primary"}
|
|
51
|
+
${o?"opacity-50":""}
|
|
52
|
+
`.trim()}),jsxRuntime.jsx("div",{class:`
|
|
53
|
+
absolute top-0.5 left-0.5 w-5 h-5 rounded-full
|
|
54
|
+
bg-white shadow-md transition-transform
|
|
55
|
+
${n()?"translate-x-5":"translate-x-0"}
|
|
56
|
+
`.trim()})]}),t&&jsxRuntime.jsx("span",{class:"text-sm text-primary font-medium",children:t})]})}function Js(s){let{value:e="",onChange:r,options:t,placeholder:o="Select an option",disabled:a=false,class:l,...n}=s,c=signals.signal(e),p=i=>{let d=i.target;c.set(d.value),r?.(d.value);};return jsxRuntime.jsxs("select",{value:c(),onChange:p,disabled:a,class:`
|
|
57
|
+
w-full px-4 py-2 rounded-lg border border-border-primary
|
|
58
|
+
bg-surface text-primary text-sm font-medium
|
|
59
|
+
transition-colors focus:outline-none focus:ring-2
|
|
60
|
+
focus:ring-color-primary/50 focus:border-color-primary
|
|
61
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
62
|
+
appearance-none cursor-pointer
|
|
63
|
+
${l||""}
|
|
64
|
+
`.trim(),...n,children:[o&&jsxRuntime.jsx("option",{value:"",disabled:true,children:o}),t.map(i=>jsxRuntime.jsx("option",{value:i.value,disabled:i.disabled,children:i.label},i.value))]})}function Bs(s){let{value:e=50,onChange:r,min:t=0,max:o=100,step:a=1,label:l,showValue:n=true,disabled:c=false,class:p,...i}=s,d=signals.signal(e),m=u=>{let b=u.target,x=parseFloat(b.value);d.set(x),r?.(x);},f=(d()-t)/(o-t)*100;return jsxRuntime.jsxs("div",{class:`flex flex-col gap-3 ${p||""}`,children:[(l||n)&&jsxRuntime.jsxs("div",{class:"flex items-center justify-between",children:[l&&jsxRuntime.jsx("span",{class:"text-sm font-semibold text-primary",children:l}),n&&jsxRuntime.jsx("span",{class:"text-sm font-medium text-primary",children:d()})]}),jsxRuntime.jsxs("div",{class:"relative w-full",children:[jsxRuntime.jsx("div",{class:`
|
|
65
|
+
absolute top-1/2 -translate-y-1/2 left-0 h-2
|
|
66
|
+
rounded-full bg-color-primary
|
|
67
|
+
`.trim(),style:{width:`${f}%`}}),jsxRuntime.jsx("div",{class:"absolute top-1/2 -translate-y-1/2 w-full h-2 rounded-full bg-border-primary"}),jsxRuntime.jsx("input",{type:"range",value:d(),onChange:m,min:t,max:o,step:a,disabled:c,class:`
|
|
68
|
+
relative w-full h-2 rounded-full appearance-none
|
|
69
|
+
bg-transparent cursor-pointer z-5
|
|
70
|
+
accent-color-primary
|
|
71
|
+
[&::-webkit-slider-thumb]:appearance-none
|
|
72
|
+
[&::-webkit-slider-thumb]:w-5
|
|
73
|
+
[&::-webkit-slider-thumb]:h-5
|
|
74
|
+
[&::-webkit-slider-thumb]:rounded-full
|
|
75
|
+
[&::-webkit-slider-thumb]:bg-color-primary
|
|
76
|
+
[&::-webkit-slider-thumb]:cursor-pointer
|
|
77
|
+
[&::-webkit-slider-thumb]:shadow-md
|
|
78
|
+
[&::-webkit-slider-thumb]:border-2
|
|
79
|
+
[&::-webkit-slider-thumb]:border-white
|
|
80
|
+
[&::-moz-range-thumb]:w-5
|
|
81
|
+
[&::-moz-range-thumb]:h-5
|
|
82
|
+
[&::-moz-range-thumb]:rounded-full
|
|
83
|
+
[&::-moz-range-thumb]:bg-color-primary
|
|
84
|
+
[&::-moz-range-thumb]:cursor-pointer
|
|
85
|
+
[&::-moz-range-thumb]:border-2
|
|
86
|
+
[&::-moz-range-thumb]:border-white
|
|
87
|
+
[&::-moz-range-thumb]:shadow-md
|
|
88
|
+
disabled:opacity-50
|
|
89
|
+
disabled:cursor-not-allowed
|
|
90
|
+
`.trim(),...i})]})]})}function Ns(s){let{items:e,orientation:r="horizontal",class:t,role:o="navigation",...a}=s;return jsxRuntime.jsx("nav",{class:`
|
|
91
|
+
flex ${r==="vertical"?"flex-col":"flex-row"} gap-1
|
|
92
|
+
${t||""}
|
|
93
|
+
`.trim(),role:o,...a,children:e.map(n=>jsxRuntime.jsxs("a",{href:n.href,class:`
|
|
94
|
+
flex items-center gap-2 px-4 py-2 rounded-lg
|
|
95
|
+
text-sm font-medium transition-colors
|
|
96
|
+
${n.active?"bg-color-primary text-white":"text-primary hover:bg-surface-hover"}
|
|
97
|
+
${n.disabled?"opacity-50 cursor-not-allowed pointer-events-none":""}
|
|
98
|
+
`.trim(),children:[n.icon&&jsxRuntime.jsx("span",{class:"shrink-0 size-4",children:n.icon}),jsxRuntime.jsx("span",{children:n.label})]}))})}function Fs(s){let{tabs:e,defaultTab:r=e[0]?.id||"",activeTab:t,onTabChange:o,variant:a="line",class:l,tabsClass:n,contentClass:c,...p}=s,i=signals.signal(t||r),d=u=>{i.set(u),o?.(u);},m=t||i(),f=(u,b)=>{let x="flex items-center gap-2 px-4 py-2 text-sm font-medium transition-colors cursor-pointer";return a==="line"?b?`${x} text-color-primary border-b-2 border-color-primary`:`${x} text-primary hover:text-primary border-b-2 border-transparent`:a==="solid"?b?`${x} bg-color-primary text-white rounded-t-lg`:`${x} text-primary hover:bg-surface-hover rounded-t-lg`:b?`${x} bg-color-primary text-white rounded-lg`:`${x} text-primary border border-border-primary hover:border-color-primary`};return jsxRuntime.jsxs("div",{class:`w-full ${l||""}`,...p,children:[jsxRuntime.jsx("div",{class:`
|
|
99
|
+
flex gap-1 overflow-x-auto border-b
|
|
100
|
+
border-border-primary pb-0
|
|
101
|
+
${a==="solid"?"bg-surface":""}
|
|
102
|
+
${n||""}
|
|
103
|
+
`.trim(),role:"tablist",children:e.map(u=>jsxRuntime.jsxs("button",{onClick:()=>!u.disabled&&d(u.id),disabled:u.disabled,class:`
|
|
104
|
+
${f(u.id,m===u.id)}
|
|
105
|
+
${u.disabled?"opacity-50 cursor-not-allowed":""}
|
|
106
|
+
`.trim(),role:"tab","aria-selected":m===u.id,children:[u.icon&&jsxRuntime.jsx("span",{class:"shrink-0 size-4",children:u.icon}),jsxRuntime.jsx("span",{children:u.label})]},u.id))}),jsxRuntime.jsx("div",{class:`pt-4 ${c||""}`,children:e.map(u=>m===u.id&&jsxRuntime.jsx("div",{role:"tabpanel",class:"animate-in fade-in duration-200",children:u.content},u.id))})]})}function Hs(s){let{items:e,separator:r="/",class:t,itemClass:o,...a}=s;return jsxRuntime.jsx("nav",{class:`flex items-center gap-1 ${t||""}`,role:"navigation","aria-label":"breadcrumb",...a,children:jsxRuntime.jsx("ol",{class:"flex items-center gap-1",children:e.map((l,n)=>{let c=n===e.length-1;return jsxRuntime.jsxs("li",{class:"flex items-center gap-1",children:[n>0&&jsxRuntime.jsx("span",{class:`
|
|
107
|
+
text-xs font-semibold text-primary opacity-60
|
|
108
|
+
mx-1
|
|
109
|
+
`,children:r}),l.href?jsxRuntime.jsxs("a",{href:l.href,class:`
|
|
110
|
+
inline-flex items-center gap-1 px-2 py-1 text-sm
|
|
111
|
+
rounded-md transition-colors
|
|
112
|
+
${c?"text-color-primary font-semibold cursor-default":"text-primary hover:text-color-primary hover:bg-surface-hover"}
|
|
113
|
+
${o||""}
|
|
114
|
+
`.trim(),"aria-current":c?"page":void 0,children:[l.icon&&jsxRuntime.jsx("span",{class:"shrink-0 size-4",children:l.icon}),jsxRuntime.jsx("span",{children:l.label})]}):jsxRuntime.jsxs("span",{class:`
|
|
115
|
+
inline-flex items-center gap-1 px-2 py-1 text-sm
|
|
116
|
+
rounded-md
|
|
117
|
+
${c?"text-color-primary font-semibold":"text-primary"}
|
|
118
|
+
${o||""}
|
|
119
|
+
`.trim(),children:[l.icon&&jsxRuntime.jsx("span",{class:"shrink-0 size-4",children:l.icon}),jsxRuntime.jsx("span",{children:l.label})]})]},n)})})})}function Ds(s){let{current:e,total:r,onChange:t,siblingCount:o=1,showFirstLast:a=true,class:l,buttonClass:n,activeButtonClass:c,...p}=s,i=()=>{let b=[],x=Math.max(2,e-o),g=Math.min(r-1,e+o);b.push(1),x>2&&b.push("...");for(let h=x;h<=g;h++)h!==1&&h!==r&&b.push(h);return g<r-1&&b.push("..."),r>1&&b.push(r),b},d=e===1,m=e===r,f=`
|
|
120
|
+
inline-flex items-center justify-center gap-2 px-3 py-2 text-sm
|
|
121
|
+
font-medium rounded-lg transition-all
|
|
122
|
+
border border-border-primary
|
|
123
|
+
hover:border-color-primary hover:text-color-primary
|
|
124
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
125
|
+
${n||""}
|
|
126
|
+
`.trim(),u=b=>b?`
|
|
127
|
+
${f}
|
|
128
|
+
bg-color-primary text-white border-color-primary
|
|
129
|
+
${c||""}
|
|
130
|
+
`.trim():f;return jsxRuntime.jsxs("nav",{class:`flex items-center gap-2 justify-center ${l||""}`,role:"navigation","aria-label":"pagination",...p,children:[jsxRuntime.jsx("button",{onClick:()=>e>1&&t(e-1),disabled:d,class:u(false),"aria-label":"Previous page",children:"\u2190 Previous"}),a&&e>1&&jsxRuntime.jsx("button",{onClick:()=>t(1),class:u(false),"aria-label":"First page",children:"1"}),jsxRuntime.jsx("div",{class:"flex items-center gap-1",children:i().map((b,x)=>{if(b==="...")return jsxRuntime.jsx("span",{class:"px-2 py-2 text-sm text-primary opacity-60",children:b},`ellipsis-${x}`);let g=b,h=g===e;return jsxRuntime.jsx("button",{onClick:()=>t(g),class:u(h),"aria-current":h?"page":void 0,"aria-label":`Page ${g}`,children:g},g)})}),jsxRuntime.jsx("button",{onClick:()=>e<r&&t(e+1),disabled:m,class:u(false),"aria-label":"Next page",children:"Next \u2192"})]})}function Ks(s){let{children:e,class:r,variant:t="outlined",padding:o="md",rounded:a="md",hover:l=false,clickable:n=false,onClick:c,...p}=s,i={none:"p-0",xs:"p-2",sm:"p-3",md:"p-4",lg:"p-6",xl:"p-8"},d={none:"rounded-none",sm:"rounded-sm",md:"rounded-lg",lg:"rounded-xl",xl:"rounded-2xl",full:"rounded-full"},m={elevated:"bg-surface shadow-lg border border-border-primary",outlined:"bg-surface border border-border-primary",filled:"bg-surface-subtle border-none"},f=`
|
|
131
|
+
${n?"cursor-pointer":""}
|
|
132
|
+
${l?"hover:shadow-lg hover:border-color-primary transition-all":""}
|
|
133
|
+
`.trim();return jsxRuntime.jsx("div",{class:`
|
|
134
|
+
${m[t]}
|
|
135
|
+
${i[o]}
|
|
136
|
+
${d[a]}
|
|
137
|
+
${f}
|
|
138
|
+
${r||""}
|
|
139
|
+
`.trim(),onClick:n&&c?c:void 0,...p,children:e})}function Qs(s){let{children:e,class:r,divider:t=false}=s;return jsxRuntime.jsx("div",{class:`
|
|
140
|
+
${t?"border-b border-border-primary pb-4":""}
|
|
141
|
+
${r||""}
|
|
142
|
+
`.trim(),children:e})}function Us(s){let{children:e,class:r}=s;return jsxRuntime.jsx("div",{class:`${r||""}`,children:e})}function Ys(s){let{children:e,class:r,divider:t=false}=s;return jsxRuntime.jsx("div",{class:`
|
|
143
|
+
${t?"border-t border-border-primary pt-4":""}
|
|
144
|
+
${r||""}
|
|
145
|
+
`.trim(),children:e})}function eo(s){let{data:e,columns:r,striped:t=false,hoverable:o=false,sortBy:a,sortOrder:l="asc",onSort:n,class:c,headerClass:p,rowClass:i,cellClass:d,...m}=s;return jsxRuntime.jsx("div",{class:`
|
|
146
|
+
w-full overflow-x-auto rounded-lg border border-border-primary
|
|
147
|
+
${c||""}
|
|
148
|
+
`.trim(),...m,children:jsxRuntime.jsxs("table",{class:"w-full border-collapse",children:[jsxRuntime.jsx(ur,{columns:r,sortBy:a,sortOrder:l,onSort:n,headerClass:p,cellClass:d}),jsxRuntime.jsx(br,{data:e,columns:r,striped:t,hoverable:o,rowClass:i,cellClass:d})]})})}function ur(s){let{columns:e,sortBy:r,sortOrder:t="asc",onSort:o,headerClass:a,cellClass:l}=s;return jsxRuntime.jsx("thead",{class:`bg-surface-subtle border-b border-border-primary ${a||""}`,children:jsxRuntime.jsx("tr",{children:e.map(n=>jsxRuntime.jsx("th",{class:`
|
|
149
|
+
px-4 py-3 text-left font-semibold text-sm
|
|
150
|
+
${n.align==="center"?"text-center":""}
|
|
151
|
+
${n.align==="right"?"text-right":""}
|
|
152
|
+
${n.sortable&&o?"cursor-pointer hover:bg-surface-hover":""}
|
|
153
|
+
${l||""}
|
|
154
|
+
`.trim(),style:{width:n.width?typeof n.width=="number"?`${n.width}px`:n.width:void 0},onClick:()=>{if(n.sortable&&o){let c=r===n.key&&t==="asc"?"desc":"asc";o(n.key,c);}},children:jsxRuntime.jsxs("div",{class:"flex items-center gap-2",children:[jsxRuntime.jsx("span",{children:n.label}),n.sortable&&r===n.key&&jsxRuntime.jsx("span",{class:"text-xs",children:t==="asc"?"\u2191":"\u2193"})]})},String(n.key)))})})}function br(s){let{data:e,columns:r,striped:t=false,hoverable:o=false,rowClass:a,cellClass:l}=s;return jsxRuntime.jsx("tbody",{children:e.map((n,c)=>jsxRuntime.jsx("tr",{class:`
|
|
155
|
+
border-b border-border-primary
|
|
156
|
+
${t&&c%2!==0?"bg-surface-subtle":""}
|
|
157
|
+
${o?"hover:bg-surface-subtle transition-colors":""}
|
|
158
|
+
${a||""}
|
|
159
|
+
`.trim(),children:r.map(p=>{let i=n[p.key],d=p.render?p.render(i,n,c):i;return jsxRuntime.jsx("td",{class:`
|
|
160
|
+
px-4 py-3 text-sm text-primary
|
|
161
|
+
${p.align==="center"?"text-center":""}
|
|
162
|
+
${p.align==="right"?"text-right":""}
|
|
163
|
+
${l||""}
|
|
164
|
+
`.trim(),children:d},String(p.key))})},c))})}function so(s){let{items:e,variant:r="simple",size:t="md",class:o,itemClass:a,selectable:l=false,onItemClick:n,...c}=s;return jsxRuntime.jsx("ul",{class:`
|
|
165
|
+
flex flex-col w-full list-none
|
|
166
|
+
${{sm:"gap-1",md:"gap-2",lg:"gap-3"}[t]}
|
|
167
|
+
${o||""}
|
|
168
|
+
`.trim(),...c,children:e.map((i,d)=>jsxRuntime.jsxs("li",{class:`
|
|
169
|
+
flex items-center gap-3 px-3 py-2 rounded-lg
|
|
170
|
+
transition-colors
|
|
171
|
+
${i.disabled?"opacity-50 cursor-not-allowed":""}
|
|
172
|
+
${!i.disabled&&(l||i.onClick||n)?"cursor-pointer hover:bg-surface-hover":""}
|
|
173
|
+
${r==="divider"?"border-b border-border-primary last:border-b-0":""}
|
|
174
|
+
${r==="spaced"&&d>0?"mt-1":""}
|
|
175
|
+
${a||""}
|
|
176
|
+
`.trim(),onClick:()=>{i.disabled||(i.onClick?.(),n?.(i,d));},children:[i.avatar&&jsxRuntime.jsx("div",{class:"shrink-0",children:i.avatar}),i.icon&&!i.avatar&&jsxRuntime.jsx("div",{class:"shrink-0 size-5 flex items-center justify-center text-color-primary",children:i.icon}),jsxRuntime.jsxs("div",{class:"flex-1 min-w-0",children:[i.label&&jsxRuntime.jsx("div",{class:`
|
|
177
|
+
font-medium text-sm text-primary
|
|
178
|
+
${i.description?"mb-0.5":""}
|
|
179
|
+
`,children:i.label}),i.description&&jsxRuntime.jsx("div",{class:"text-xs text-primary opacity-60",children:i.description})]}),i.trailing&&jsxRuntime.jsx("div",{class:"shrink-0",children:i.trailing})]},i.id||d))})}function ao(s){let{children:e,icon:r,variant:t="solid",color:o="primary",size:a="md",closeable:l=false,onClose:n,disabled:c=false,class:p,...i}=s,d={sm:"px-2 py-1 text-xs gap-1",md:"px-3 py-1.5 text-sm gap-1.5",lg:"px-4 py-2 text-base gap-2"},m={primary:{solid:"bg-color-primary text-white",outline:"border border-color-primary text-color-primary",subtle:"bg-color-primary bg-opacity-10 text-color-primary"},success:{solid:"bg-color-success text-white",outline:"border border-color-success text-color-success",subtle:"bg-color-success bg-opacity-10 text-color-success"},warning:{solid:"bg-color-warning text-white",outline:"border border-color-warning text-color-warning",subtle:"bg-color-warning bg-opacity-10 text-color-warning"},error:{solid:"bg-color-error text-white",outline:"border border-color-error text-color-error",subtle:"bg-color-error bg-opacity-10 text-color-error"}},f=m[o]?.[t]||m.primary.solid;return jsxRuntime.jsxs("div",{class:`
|
|
180
|
+
inline-flex items-center rounded-full font-medium
|
|
181
|
+
transition-all
|
|
182
|
+
${d[a]}
|
|
183
|
+
${f}
|
|
184
|
+
${c?"opacity-50 cursor-not-allowed":""}
|
|
185
|
+
${p||""}
|
|
186
|
+
`.trim(),...i,children:[r&&jsxRuntime.jsx("span",{class:"shrink-0 flex items-center justify-center",children:r}),jsxRuntime.jsx("span",{class:"truncate",children:e}),l&&!c&&jsxRuntime.jsx("button",{onClick:n,class:`
|
|
187
|
+
shrink-0 ml-1 rounded-full hover:opacity-70
|
|
188
|
+
transition-opacity flex items-center justify-center
|
|
189
|
+
w-4 h-4
|
|
190
|
+
`,"aria-label":"Remove tag",children:"\u2715"})]})}function co(s){let{value:e,label:r,description:t,icon:o,class:a,variant:l="card",size:n="md",change:c,changeLabel:p,trend:i="neutral",color:d="primary",...m}=s,f={sm:"px-3 py-2",md:"px-4 py-3",lg:"px-6 py-4"},u={sm:"text-2xl",md:"text-3xl",lg:"text-4xl"},b={sm:"text-sm",md:"text-base",lg:"text-lg"},x={card:"bg-surface border border-border-primary rounded-lg",simple:"bg-transparent border-0",bordered:"bg-surface-subtle border-l-4 border-l-color-primary pl-4"},g={up:"text-color-success",down:"text-color-error",neutral:"text-primary opacity-60"},h={primary:"text-color-primary",success:"text-color-success",warning:"text-color-warning",error:"text-color-error"};return jsxRuntime.jsxs("div",{class:`
|
|
191
|
+
${x[l]}
|
|
192
|
+
${f[n]}
|
|
193
|
+
flex items-center gap-4
|
|
194
|
+
${a||""}
|
|
195
|
+
`.trim(),...m,children:[o&&jsxRuntime.jsx("div",{class:`
|
|
196
|
+
shrink-0 flex items-center justify-center size-10
|
|
197
|
+
${h[d]} opacity-80
|
|
198
|
+
`,children:o}),jsxRuntime.jsxs("div",{class:"flex-1 min-w-0",children:[jsxRuntime.jsx("div",{class:`
|
|
199
|
+
font-bold font-mono
|
|
200
|
+
${u[n]}
|
|
201
|
+
${h[d]}
|
|
202
|
+
leading-tight
|
|
203
|
+
`,children:e}),jsxRuntime.jsx("div",{class:`
|
|
204
|
+
${b[n]}
|
|
205
|
+
font-medium text-primary mt-1
|
|
206
|
+
`,children:r}),t&&jsxRuntime.jsx("div",{class:"text-xs text-primary opacity-60 mt-1",children:t}),c!==void 0&&jsxRuntime.jsxs("div",{class:`
|
|
207
|
+
text-xs font-semibold mt-2
|
|
208
|
+
flex items-center gap-1
|
|
209
|
+
${g[i]}
|
|
210
|
+
`,children:[jsxRuntime.jsxs("span",{children:[i==="up"&&"\u2191",i==="down"&&"\u2193",i==="neutral"&&"\u2192"]}),jsxRuntime.jsxs("span",{children:[Math.abs(c),"%"]}),p&&jsxRuntime.jsx("span",{class:"opacity-70",children:p})]})]})]})}exports.Alert=me;exports.Avatar=$e;exports.AvatarGroup=Dr;exports.Badge=Kr;exports.Box=St;exports.Breadcrumb=Hs;exports.Button=ze;exports.ButtonGroup=Or;exports.Card=Ks;exports.CardBody=Us;exports.CardFooter=Ys;exports.CardHeader=Qs;exports.Center=wt;exports.Checkbox=fs;exports.Container=st;exports.Divider=ht;exports.Drawer=qt;exports.DropdownMenu=ns;exports.Form=is;exports.FormError=ps;exports.FormField=cs;exports.FormHint=ms;exports.FormLabel=ds;exports.Grid=mt;exports.Group=ct;exports.IconButton=Ir;exports.Input=Ar;exports.InputGroup=Rr;exports.List=so;exports.Modal=Vt;exports.Nav=Ns;exports.Notification=Ft;exports.Pagination=Ds;exports.Popover=Yt;exports.Portal=hr;exports.Progress=Mt;exports.Radio=or;exports.RadioGroup=ys;exports.Select=Js;exports.Skeleton=et;exports.Slider=Bs;exports.Spacer=gt;exports.Spinner=Yr;exports.Stack=at;exports.Stat=co;exports.Switch=Ss;exports.Table=eo;exports.TableBody=br;exports.TableHeader=ur;exports.Tabs=Fs;exports.Tag=ao;exports.Text=Lr;exports.Textarea=Hr;exports.Toast=$t;exports.Tooltip=rs;exports.clsx=xr;exports.cn=ke;exports.copyToClipboard=Xe;exports.createPortal=Pe;exports.debounce=Xr;exports.throttle=Jr;exports.useBreakpoint=Sr;exports.useClipboard=Tr;exports.useDirection=$r;exports.useEscapeKey=Cr;exports.useFocusTrap=vr;exports.useId=zr;exports.useMediaQuery=kr;exports.useOutsideClick=wr;exports.useReturnFocus=yr;exports.useScrollLock=Pr;exports.useTheme=Er;//# sourceMappingURL=index.cjs.map
|
|
211
|
+
//# sourceMappingURL=index.cjs.map
|