@moondreamsdev/dreamer-ui 1.7.7-test.2 → 1.7.7-test.3

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.
@@ -0,0 +1,2 @@
1
+ "use strict";const e=require("react/jsx-runtime"),d=require("react"),S=require("react-dom"),g=require("./X-CgjeP2OI.cjs"),B=require("./utils.cjs.js");function h(...t){return t.filter(l=>typeof l=="string"&&l).join(" ").trim()||void 0}function I({size:t=15,color:l="currentColor",className:n="inline",...r}){return e.jsx("svg",{...r,width:t,height:t,className:n,viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:l,fillRule:"evenodd",clipRule:"evenodd"})})}function v(...t){return t.filter(l=>typeof l=="string"&&l).join(" ").trim()||void 0}d.createContext(void 0);function M(){const[t,l]=d.useState(0);return d.useEffect(()=>{const n=setInterval(()=>{l(r=>(r+1)%3)},500);return()=>clearInterval(n)},[]),e.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(n=>e.jsx("div",{className:h("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",t===n&&"transform -translate-y-1")},n))})}const O={base:"",primary:"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",tertiary:"text-primary hover:text-primary-foreground disabled:text-muted",outline:"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",link:"underline-offset-4 hover:underline disabled:underline disabled:text-muted",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"},D={stripped:"",fitted:"size-fit",sm:"px-2 py-1 text-sm",md:"px-4 py-2 text-base",lg:"px-6 py-3 text-lg",icon:"p-1 w-fit aspect-square",full:"p-2 w-full"},F={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},p={variant:"primary",size:"md",rounded:"md"};function H({variant:t=p.variant,size:l,rounded:n=p.rounded,loading:r,linkTo:i,linkProps:s,type:a="button",className:c,...o}){let u;t==="link"&&!l?u="fitted":u=l||p.size;const m=h("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",O[t],D[u],F[n],r&&"relative pointer-events-none",i&&"relative",c);return e.jsxs("button",{...o,role:i?"link":o.role,"aria-label":o["aria-label"]||(s==null?void 0:s["aria-label"]),"aria-description":o["aria-description"]||(s==null?void 0:s["aria-description"]),"aria-disabled":o.disabled||r,"aria-busy":r,type:a,className:m,children:[r&&e.jsx(M,{}),e.jsx("span",{className:h(r&&"invisible"),children:o.children}),i&&!o.disabled&&e.jsx("a",{...s,"aria-hidden":!0,href:i,rel:(s==null?void 0:s.rel)||"noreferrer",className:"absolute inset-0"})]})}function P(t){const[l,n]=d.useState(!1),[r,i]=d.useState(!1);return d.useEffect(()=>{t?(i(!0),setTimeout(()=>n(!0),10)):(n(!1),setTimeout(()=>i(!1),150))},[t]),{show:l,shouldRender:r}}function V(t,l){d.useEffect(()=>{const n=r=>{r.key==="Escape"&&t&&l()};return document.addEventListener("keydown",n),t&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",n),document.body.style.overflow="auto"}},[t,l])}function X(t,l){const n=d.useRef(null),r=d.useCallback(()=>{const i=document.getElementById(t);if(!i)return;const s=i.querySelectorAll('[data-modal-action="true"]');if(s.length>0){s[0].focus();return}const a=i.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const c=Array.from(a).filter(o=>!(o instanceof HTMLButtonElement&&o.getAttribute("data-modal-close-button")==="true"));if(c.length>0){c[0].focus();return}a[0].focus();return}i.focus()},[t]);d.useEffect(()=>(l&&(n.current=document.activeElement,r()),()=>{document.body.style.overflow="auto",n.current instanceof HTMLElement&&n.current.focus()}),[l,r])}function K({id:t,isOpen:l,onClose:n,title:r,children:i,contentOnly:s=!1,className:a,overlayClassName:c,hideCloseButton:o=!1,actions:u=[],disableCloseOnOverlayClick:m=!1,ariaLabelledBy:f,ariaDescribedBy:b}){const x=d.useId(),j=t||`modal-${x}`,w=t?`${t}-title`:`modal-title-${x}`,{show:k,shouldRender:y}=P(l);if(X(j,y),V(y,n),!y)return null;const C=()=>r?d.isValidElement(r)?e.jsx("div",{className:"mb-4",children:r}):e.jsx("h2",{className:"mb-4 text-xl font-semibold",id:w,children:r}):null,E=()=>u.length===0?null:e.jsx("div",{className:"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3",children:u.map((L,z)=>{const{label:T,className:q,...A}=L;return e.jsx(H,{className:q,type:"button",...A,"data-modal-action":"true",children:T},z)})});return e.jsx(e.Fragment,{children:S.createPortal(e.jsx("div",{"aria-labelledby":f??r?w:void 0,"aria-describedby":b,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:e.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[e.jsx("div",{className:v("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{m||n()}}),s&&e.jsx("div",{className:v("relative w-fit",a),children:i}),!s&&e.jsxs("div",{id:j,tabIndex:-1,className:v("relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",k?"opacity-100 scale-100":"opacity-0 scale-90",a),children:[!o&&e.jsx("button",{type:"button",onClick:n,"data-modal-close-button":"true",className:"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",children:e.jsx(I,{size:18})}),C(),i,E()]})]})}),document.body)})}function R({type:t,message:l,cancelText:n,confirmText:r,onConfirm:i,onClose:s,destructive:a=!1,title:c,...o}){const u=d.useMemo(()=>t==="confirm"?{confirm:r||"Confirm",cancel:n||"Cancel",defaultTitle:c||"Confirm Action"}:{confirm:r||"OK",cancel:null,defaultTitle:c||"Alert"},[t,r,c,n]),m=d.useMemo(()=>[...u.cancel?[{label:u.cancel,variant:"secondary",onClick:s}]:[],{label:u.confirm,variant:a?"destructive":"primary",onClick:()=>{i==null||i(),s()}}],[u,a,i,s]);return e.jsx(K,{...o,title:c||u.defaultTitle,onClose:s,actions:m,disableCloseOnOverlayClick:t==="confirm",hideCloseButton:t==="confirm",children:typeof l=="string"?e.jsx("p",{className:"text-sm",children:l}):l})}const N={info:{className:"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",icon:e.jsx(g.InfoCircled,{size:20})},warning:{className:"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",icon:e.jsx(g.ExclamationTriangle,{size:20})},error:{className:"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",icon:e.jsx(g.CrossCircled,{size:20})}};function W({id:t,title:l,description:n,type:r="info",action:i,duration:s=5e3,onRemove:a,customTypes:c,customComponent:o}){const[u,m]=d.useState(!1),f=d.useCallback(()=>{m(!0),setTimeout(()=>{a==null||a(t)},150)},[t,a]);if(d.useEffect(()=>{if(s>0){const x=setTimeout(()=>{f()},s);return()=>clearTimeout(x)}},[s,t,a,f]),o)return e.jsx(o,{id:t,title:l,description:n,type:r,action:i,duration:s,onRemove:a});const b=(c==null?void 0:c[r])||N[r]||N.info;return e.jsxs("div",{role:r==="error"?"alert":"status","aria-live":r==="error"?void 0:"polite",className:B.join("relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",i&&"pb-3",b.className,u?"opacity-0 translate-x-full":"opacity-100 translate-x-0"),children:[e.jsx("div",{className:"flex-shrink-0 mr-3",children:b.icon}),e.jsxs("div",{className:"flex-grow min-w-0",children:[e.jsx("div",{className:"font-medium text-sm leading-5",children:l}),n&&e.jsx("div",{className:"mt-1 text-sm opacity-90 leading-5",children:n}),i&&e.jsx("div",{className:"mt-1.5",children:e.jsx("button",{onClick:i.onClick,className:"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer",children:i.label})})]}),e.jsx("button",{onClick:f,className:"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0",children:e.jsx(g.X,{size:16})})]})}exports.ActionModal=R;exports.Toast=W;exports.n=h;
2
+ //# sourceMappingURL=Toast-SgqUNTIy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Toast-SgqUNTIy.cjs","sources":["utils.esm.js","X-CIoyLewf.js","Toast-C5BwqBkw.js","components.esm.js","../src/components/actionmodal/ActionModal.tsx","../src/components/toast/Toast.tsx"],"sourcesContent":["function n(...t) {\n return t.filter((s) => typeof s == \"string\" && s).join(\" \").trim() || void 0;\n}\nexport {\n n as join\n};\n//# sourceMappingURL=utils.esm.js.map\n","import { jsx as e } from \"react/jsx-runtime\";\nfunction t({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M0.877075 7.49988C0.877075 3.84219 3.84222 0.877045 7.49991 0.877045C11.1576 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1576 14.1227 7.49991 14.1227C3.84222 14.1227 0.877075 11.1575 0.877075 7.49988ZM7.49991 1.82704C4.36689 1.82704 1.82708 4.36686 1.82708 7.49988C1.82708 10.6329 4.36689 13.1727 7.49991 13.1727C10.6329 13.1727 13.1727 10.6329 13.1727 7.49988C13.1727 4.36686 10.6329 1.82704 7.49991 1.82704ZM9.85358 5.14644C10.0488 5.3417 10.0488 5.65829 9.85358 5.85355L8.20713 7.49999L9.85358 9.14644C10.0488 9.3417 10.0488 9.65829 9.85358 9.85355C9.65832 10.0488 9.34173 10.0488 9.14647 9.85355L7.50002 8.2071L5.85358 9.85355C5.65832 10.0488 5.34173 10.0488 5.14647 9.85355C4.95121 9.65829 4.95121 9.3417 5.14647 9.14644L6.79292 7.49999L5.14647 5.85355C4.95121 5.65829 4.95121 5.3417 5.14647 5.14644C5.34173 4.95118 5.65832 4.95118 5.85358 5.14644L7.50002 6.79289L9.14647 5.14644C9.34173 4.95118 9.65832 4.95118 9.85358 5.14644Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction o({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M8.4449 0.608765C8.0183 -0.107015 6.9817 -0.107015 6.55509 0.608766L0.161178 11.3368C-0.275824 12.07 0.252503 13 1.10608 13H13.8939C14.7475 13 15.2758 12.07 14.8388 11.3368L8.4449 0.608765ZM7.4141 1.12073C7.45288 1.05566 7.54712 1.05566 7.5859 1.12073L13.9798 11.8488C14.0196 11.9154 13.9715 12 13.8939 12H1.10608C1.02849 12 0.980454 11.9154 1.02018 11.8488L7.4141 1.12073ZM6.8269 4.48611C6.81221 4.10423 7.11783 3.78663 7.5 3.78663C7.88217 3.78663 8.18778 4.10423 8.1731 4.48612L8.01921 8.48701C8.00848 8.766 7.7792 8.98664 7.5 8.98664C7.2208 8.98664 6.99151 8.766 6.98078 8.48701L6.8269 4.48611ZM8.24989 10.476C8.24989 10.8902 7.9141 11.226 7.49989 11.226C7.08567 11.226 6.74989 10.8902 6.74989 10.476C6.74989 10.0618 7.08567 9.72599 7.49989 9.72599C7.9141 9.72599 8.24989 10.0618 8.24989 10.476Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction d({\n size: C = 15,\n color: l = \"currentColor\",\n className: n = \"inline\",\n ...i\n}) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M7.49991 0.876892C3.84222 0.876892 0.877075 3.84204 0.877075 7.49972C0.877075 11.1574 3.84222 14.1226 7.49991 14.1226C11.1576 14.1226 14.1227 11.1574 14.1227 7.49972C14.1227 3.84204 11.1576 0.876892 7.49991 0.876892ZM1.82707 7.49972C1.82707 4.36671 4.36689 1.82689 7.49991 1.82689C10.6329 1.82689 13.1727 4.36671 13.1727 7.49972C13.1727 10.6327 10.6329 13.1726 7.49991 13.1726C4.36689 13.1726 1.82707 10.6327 1.82707 7.49972ZM8.24992 4.49999C8.24992 4.9142 7.91413 5.24999 7.49992 5.24999C7.08571 5.24999 6.74992 4.9142 6.74992 4.49999C6.74992 4.08577 7.08571 3.74999 7.49992 3.74999C7.91413 3.74999 8.24992 4.08577 8.24992 4.49999ZM6.00003 5.99999H6.50003H7.50003C7.77618 5.99999 8.00003 6.22384 8.00003 6.49999V9.99999H8.50003H9.00003V11H8.50003H7.50003H6.50003H6.00003V9.99999H6.50003H7.00003V6.99999H6.50003H6.00003V5.99999Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nfunction h({ size: C = 15, color: l = \"currentColor\", className: n = \"inline\", ...i }) {\n return /* @__PURE__ */ e(\n \"svg\",\n {\n ...i,\n width: C,\n height: C,\n className: n,\n viewBox: \"0 0 15 15\",\n xmlns: \"http://www.w3.org/2000/svg\",\n children: /* @__PURE__ */ e(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n )\n }\n );\n}\nexport {\n t as C,\n o as E,\n d as I,\n h as X\n};\n//# sourceMappingURL=X-CIoyLewf.js.map\n","import { jsx as r, Fragment as M, jsxs as f } from \"react/jsx-runtime\";\nimport q, { createContext as H, useId as K, useState as p, useEffect as b, useRef as P, useCallback as L, useMemo as C } from \"react\";\nimport { createPortal as V } from \"react-dom\";\nimport { X as D, C as F, E as X, I as Z } from \"./X-CIoyLewf.js\";\nimport { join as G } from \"./utils.esm.js\";\nfunction w(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nfunction J({ size: e = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ r(\"svg\", { width: e, height: e, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", children: /* @__PURE__ */ r(\n \"path\",\n {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: l,\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction y(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nH(void 0);\nfunction Q() {\n const [e, l] = p(0);\n return b(() => {\n const n = setInterval(() => {\n l((t) => (t + 1) % 3);\n }, 500);\n return () => clearInterval(n);\n }, []), /* @__PURE__ */ r(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((n) => /* @__PURE__ */ r(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n e === n && \"transform -translate-y-1\"\n )\n },\n n\n )) });\n}\nconst R = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, U = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, W = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, x = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction Y({\n variant: e = x.variant,\n size: l,\n rounded: n = x.rounded,\n loading: t,\n linkTo: i,\n linkProps: a,\n type: o = \"button\",\n className: d,\n ...s\n}) {\n let c;\n e === \"link\" && !l ? c = \"fitted\" : c = l || x.size;\n const u = w(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n R[e],\n U[c],\n W[n],\n t && \"relative pointer-events-none\",\n i && \"relative\",\n d\n );\n return /* @__PURE__ */ f(\n \"button\",\n {\n ...s,\n role: i ? \"link\" : s.role,\n \"aria-label\": s[\"aria-label\"] || (a == null ? void 0 : a[\"aria-label\"]),\n \"aria-description\": s[\"aria-description\"] || (a == null ? void 0 : a[\"aria-description\"]),\n \"aria-disabled\": s.disabled || t,\n \"aria-busy\": t,\n type: o,\n className: u,\n children: [\n t && /* @__PURE__ */ r(Q, {}),\n /* @__PURE__ */ r(\"span\", { className: w(t && \"invisible\"), children: s.children }),\n i && !s.disabled && /* @__PURE__ */ r(\n \"a\",\n {\n ...a,\n \"aria-hidden\": !0,\n href: i,\n rel: (a == null ? void 0 : a.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction _(e) {\n const [l, n] = p(!1), [t, i] = p(!1);\n return b(() => {\n e ? (i(!0), setTimeout(() => n(!0), 10)) : (n(!1), setTimeout(() => i(!1), 150));\n }, [e]), { show: l, shouldRender: t };\n}\nfunction $(e, l) {\n b(() => {\n const n = (t) => {\n t.key === \"Escape\" && e && l();\n };\n return document.addEventListener(\"keydown\", n), e && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", n), document.body.style.overflow = \"auto\";\n };\n }, [e, l]);\n}\nfunction ee(e, l) {\n const n = P(null), t = L(() => {\n const i = document.getElementById(e);\n if (!i) return;\n const a = i.querySelectorAll('[data-modal-action=\"true\"]');\n if (a.length > 0) {\n a[0].focus();\n return;\n }\n const o = i.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (o.length > 0) {\n const d = Array.from(o).filter((s) => !(s instanceof HTMLButtonElement && s.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (d.length > 0) {\n d[0].focus();\n return;\n }\n o[0].focus();\n return;\n }\n i.focus();\n }, [e]);\n b(() => (l && (n.current = document.activeElement, t()), () => {\n document.body.style.overflow = \"auto\", n.current instanceof HTMLElement && n.current.focus();\n }), [l, t]);\n}\nfunction te({\n id: e,\n isOpen: l,\n onClose: n,\n title: t,\n children: i,\n contentOnly: a = !1,\n className: o,\n overlayClassName: d,\n hideCloseButton: s = !1,\n actions: c = [],\n disableCloseOnOverlayClick: u = !1,\n ariaLabelledBy: m,\n ariaDescribedBy: g\n}) {\n const h = K(), N = e || `modal-${h}`, k = e ? `${e}-title` : `modal-title-${h}`, { show: z, shouldRender: v } = _(l);\n if (ee(N, v), $(v, n), !v) return null;\n const T = () => t ? q.isValidElement(t) ? /* @__PURE__ */ r(\"div\", { className: \"mb-4\", children: t }) : /* @__PURE__ */ r(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: k, children: t }) : null, j = () => c.length === 0 ? null : /* @__PURE__ */ r(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: c.map((A, I) => {\n const { label: B, className: O, ...S } = A;\n return /* @__PURE__ */ r(Y, { className: O, type: \"button\", ...S, \"data-modal-action\": \"true\", children: B }, I);\n }) });\n return /* @__PURE__ */ r(M, { children: V(\n /* @__PURE__ */ r(\n \"div\",\n {\n \"aria-labelledby\": m ?? t ? k : void 0,\n \"aria-describedby\": g,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ f(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ r(\n \"div\",\n {\n className: y(\"fixed inset-0 bg-black/20 transition-all\", d),\n onClick: () => {\n u || n();\n }\n }\n ),\n a && /* @__PURE__ */ r(\"div\", { className: y(\"relative w-fit\", o), children: i }),\n !a && /* @__PURE__ */ f(\n \"div\",\n {\n id: N,\n tabIndex: -1,\n className: y(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75\",\n z ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n o\n ),\n children: [\n !s && /* @__PURE__ */ r(\n \"button\",\n {\n type: \"button\",\n onClick: n,\n \"data-modal-close-button\": \"true\",\n className: \"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ r(J, { size: 18 })\n }\n ),\n T(),\n i,\n j()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction oe({\n type: e,\n message: l,\n cancelText: n,\n confirmText: t,\n onConfirm: i,\n onClose: a,\n destructive: o = !1,\n title: d,\n ...s\n}) {\n const c = C(() => e === \"confirm\" ? {\n confirm: t || \"Confirm\",\n cancel: n || \"Cancel\",\n defaultTitle: d || \"Confirm Action\"\n } : {\n confirm: t || \"OK\",\n cancel: null,\n defaultTitle: d || \"Alert\"\n }, [e, t, d, n]), u = C(\n () => [\n ...c.cancel ? [\n {\n label: c.cancel,\n variant: \"secondary\",\n onClick: a\n }\n ] : [],\n {\n label: c.confirm,\n variant: o ? \"destructive\" : \"primary\",\n onClick: () => {\n i == null || i(), a();\n }\n }\n ],\n [c, o, i, a]\n );\n return /* @__PURE__ */ r(\n te,\n {\n ...s,\n title: d || c.defaultTitle,\n onClose: a,\n actions: u,\n disableCloseOnOverlayClick: e === \"confirm\",\n hideCloseButton: e === \"confirm\",\n children: typeof l == \"string\" ? /* @__PURE__ */ r(\"p\", { className: \"text-sm\", children: l }) : l\n }\n );\n}\nconst E = {\n info: {\n className: \"bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100\",\n icon: /* @__PURE__ */ r(Z, { size: 20 })\n },\n warning: {\n className: \"bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100\",\n icon: /* @__PURE__ */ r(X, { size: 20 })\n },\n error: {\n className: \"bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100\",\n icon: /* @__PURE__ */ r(F, { size: 20 })\n }\n};\nfunction se({\n id: e,\n title: l,\n description: n,\n type: t = \"info\",\n action: i,\n duration: a = 5e3,\n onRemove: o,\n customTypes: d,\n customComponent: s\n}) {\n const [c, u] = p(!1), m = L(() => {\n u(!0), setTimeout(() => {\n o == null || o(e);\n }, 150);\n }, [e, o]);\n if (b(() => {\n if (a > 0) {\n const h = setTimeout(() => {\n m();\n }, a);\n return () => clearTimeout(h);\n }\n }, [a, e, o, m]), s)\n return /* @__PURE__ */ r(\n s,\n {\n id: e,\n title: l,\n description: n,\n type: t,\n action: i,\n duration: a,\n onRemove: o\n }\n );\n const g = (d == null ? void 0 : d[t]) || E[t] || E.info;\n return /* @__PURE__ */ f(\n \"div\",\n {\n role: t === \"error\" ? \"alert\" : \"status\",\n \"aria-live\": t === \"error\" ? void 0 : \"polite\",\n className: G(\n \"relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out\",\n i && \"pb-3\",\n g.className,\n c ? \"opacity-0 translate-x-full\" : \"opacity-100 translate-x-0\"\n ),\n children: [\n /* @__PURE__ */ r(\"div\", { className: \"flex-shrink-0 mr-3\", children: g.icon }),\n /* @__PURE__ */ f(\"div\", { className: \"flex-grow min-w-0\", children: [\n /* @__PURE__ */ r(\"div\", { className: \"font-medium text-sm leading-5\", children: l }),\n n && /* @__PURE__ */ r(\"div\", { className: \"mt-1 text-sm opacity-90 leading-5\", children: n }),\n i && /* @__PURE__ */ r(\"div\", { className: \"mt-1.5\", children: /* @__PURE__ */ r(\n \"button\",\n {\n onClick: i.onClick,\n className: \"text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer\",\n children: i.label\n }\n ) })\n ] }),\n /* @__PURE__ */ r(\n \"button\",\n {\n onClick: m,\n className: \"flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0\",\n children: /* @__PURE__ */ r(D, { size: 16 })\n }\n )\n ]\n }\n );\n}\nexport {\n oe as A,\n se as T,\n w as n\n};\n//# sourceMappingURL=Toast-C5BwqBkw.js.map\n","import { jsxs as E, jsx as f, Fragment as J } from \"react/jsx-runtime\";\nimport z, { useId as I, useState as x, createElement as Y, useEffect as C, useCallback as A, useMemo as W, useRef as j, isValidElement as P, cloneElement as ee } from \"react\";\nimport { join as w } from \"./utils.esm.js\";\nimport { b as te, C as re, a as ne, c as oe, E as ae, Q as se } from \"./QuestionMarkCircled-BVBF3skB.js\";\nimport { n as q } from \"./Toast-C5BwqBkw.js\";\nimport { A as Me, T as Oe } from \"./Toast-C5BwqBkw.js\";\nimport { E as ie, X as le } from \"./X-CIoyLewf.js\";\nimport { createPortal as M } from \"react-dom\";\nfunction K({\n id: o,\n title: a,\n content: e,\n children: n,\n className: t = \"\",\n disabled: r = !1,\n isOpen: s = !1,\n onToggle: d,\n triggerClassName: u = \"\",\n bodyClassName: l = \"\"\n}) {\n const b = I(), i = o || `accordion-item-${b}`, v = `${i}-header`, c = `${i}-panel`, m = () => {\n !r && d && d();\n }, p = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), m());\n };\n return /* @__PURE__ */ E(\"div\", { className: w(\"border-b border-gray-200\", r && \"opacity-60 cursor-not-allowed\", t), children: [\n /* @__PURE__ */ E(\n \"button\",\n {\n id: v,\n type: \"button\",\n className: w(\n \"w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary\",\n r ? \"cursor-not-allowed\" : \"hover:bg-gray-50/10 cursor-pointer\",\n u\n ),\n \"aria-expanded\": s,\n \"aria-controls\": c,\n disabled: r,\n onClick: m,\n onKeyDown: p,\n children: [\n /* @__PURE__ */ f(\"span\", { children: a }),\n /* @__PURE__ */ f(\n \"span\",\n {\n className: w(\n \"transform transition-transform duration-300 ease-linear\",\n s ? \"rotate-180\" : \"rotate-0\"\n ),\n \"aria-hidden\": \"true\",\n children: /* @__PURE__ */ f(te, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ f(\n \"div\",\n {\n id: c,\n role: \"region\",\n \"aria-labelledby\": v,\n className: w(\n \"transition-all duration-300 ease-linear px-4\",\n s ? \"max-h-96 opacity-100 overflow-auto py-3\" : \"max-h-0 opacity-0 overflow-hidden\",\n l\n ),\n children: s && (n || e)\n }\n )\n ] });\n}\nfunction He({\n id: o,\n items: a = [],\n children: e,\n className: n = \"\",\n itemClassName: t = \"\",\n allowMultiple: r = !1,\n defaultOpenItems: s = [],\n triggersClassName: d = \"\",\n bodiesClassName: u = \"\"\n}) {\n const l = I(), b = o || `accordion-group-${l}`, [i, v] = x(new Set(s)), c = (h) => {\n v((y) => {\n const g = new Set(y);\n return g.has(h) ? g.delete(h) : (r || g.clear(), g.add(h)), g;\n });\n }, m = (h) => `${l}-item-${h}`, p = (h) => i.has(h);\n return /* @__PURE__ */ E(\"div\", { id: b, className: n, children: [\n a.length > 0 && a.map((h, y) => {\n const g = h.id || m(y);\n return /* @__PURE__ */ f(\n K,\n {\n id: g,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: p(g),\n onToggle: () => c(g),\n className: t,\n triggerClassName: d,\n bodyClassName: u\n },\n g\n );\n }),\n a.length === 0 && e && z.Children.map(e, (h, y) => {\n if (z.isValidElement(h) && h.type === K) {\n const g = h.props.id || m(y);\n return /* @__PURE__ */ Y(\n K,\n {\n ...h.props,\n key: g,\n id: g,\n className: w(t, h.props.className),\n isOpen: p(g),\n onToggle: () => c(g),\n triggerClassName: w(d, h.props.triggerClassName),\n bodyClassName: w(u, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction de() {\n const [o, a] = x(0);\n return C(() => {\n const e = setInterval(() => {\n a((n) => (n + 1) % 3);\n }, 500);\n return () => clearInterval(e);\n }, []), /* @__PURE__ */ f(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((e) => /* @__PURE__ */ f(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n o === e && \"transform -translate-y-1\"\n )\n },\n e\n )) });\n}\nconst ue = {\n base: \"\",\n primary: \"bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground\",\n secondary: \"bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80\",\n tertiary: \"text-primary hover:text-primary-foreground disabled:text-muted\",\n outline: \"border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted\",\n link: \"underline-offset-4 hover:underline disabled:underline disabled:text-muted\",\n destructive: \"bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground\"\n}, ce = {\n stripped: \"\",\n fitted: \"size-fit\",\n sm: \"px-2 py-1 text-sm\",\n md: \"px-4 py-2 text-base\",\n lg: \"px-6 py-3 text-lg\",\n icon: \"p-1 w-fit aspect-square\",\n full: \"p-2 w-full\"\n}, fe = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, V = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction me({\n variant: o = V.variant,\n size: a,\n rounded: e = V.rounded,\n loading: n,\n linkTo: t,\n linkProps: r,\n type: s = \"button\",\n className: d,\n ...u\n}) {\n let l;\n o === \"link\" && !a ? l = \"fitted\" : l = a || V.size;\n const i = w(\n \"appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all\",\n ue[o],\n ce[l],\n fe[e],\n n && \"relative pointer-events-none\",\n t && \"relative\",\n d\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ...u,\n role: t ? \"link\" : u.role,\n \"aria-label\": u[\"aria-label\"] || (r == null ? void 0 : r[\"aria-label\"]),\n \"aria-description\": u[\"aria-description\"] || (r == null ? void 0 : r[\"aria-description\"]),\n \"aria-disabled\": u.disabled || n,\n \"aria-busy\": n,\n type: s,\n className: i,\n children: [\n n && /* @__PURE__ */ f(de, {}),\n /* @__PURE__ */ f(\"span\", { className: w(n && \"invisible\"), children: u.children }),\n t && !u.disabled && /* @__PURE__ */ f(\n \"a\",\n {\n ...r,\n \"aria-hidden\": !0,\n href: t,\n rel: (r == null ? void 0 : r.rel) || \"noreferrer\",\n className: \"absolute inset-0\"\n }\n )\n ]\n }\n );\n}\nfunction be(o) {\n const [a, e] = x(\"\"), n = A((t) => {\n let r = t, s = \"\";\n for (; r && !s; ) {\n const d = window.getComputedStyle(r).backgroundColor;\n d && d !== \"transparent\" && d !== \"rgba(0, 0, 0, 0)\" && (s = d), r = r.parentElement;\n }\n return s || \"transparent\";\n }, []);\n return C(() => {\n const t = document.getElementById(o);\n if (t) {\n const r = n(t.parentElement);\n e(r);\n }\n }, [o, n]), a;\n}\nfunction qe({\n ref: o,\n id: a,\n size: e = 20,\n color: n,\n filled: t = !1,\n rounded: r = !0,\n checked: s = !1,\n onCheckedChange: d,\n disabled: u,\n className: l = \"\",\n ...b\n}) {\n const i = I(), v = W(() => a || `checkbox-${i}`, [a, i]), c = be(v), [m, p] = x(s);\n C(() => {\n p(s);\n }, [s]);\n const h = () => {\n u || (p(!m), d == null || d(!m));\n }, y = (N) => {\n N.key === \" \" && (N.preventDefault(), h());\n }, g = w(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n r && \"rounded\",\n u && \"opacity-40 cursor-not-allowed\",\n !u && \"cursor-pointer\",\n l\n );\n return /* @__PURE__ */ f(\n \"button\",\n {\n id: v,\n type: \"button\",\n ref: o,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": m,\n \"aria-disabled\": u,\n onKeyDownCapture: y,\n style: {\n width: e,\n height: e,\n color: n,\n backgroundColor: m && t ? \"currentcolor\" : \"transparent\"\n },\n className: g,\n ...b,\n children: m && /* @__PURE__ */ f(re, { size: e, color: t ? c : void 0 })\n }\n );\n}\nfunction Ke({\n children: o,\n className: a,\n linkTo: e,\n linkProps: n,\n onButtonClick: t,\n buttonProps: r,\n ...s\n}) {\n return e && t && console.warn('Clickable: Both \"linkTo\" and \"onButtonClick\" props are provided. Only \"linkTo\" will be used.'), /* @__PURE__ */ E(\"div\", { className: w(\"relative w-fit\", a), ...s, children: [\n o,\n e && /* @__PURE__ */ f(\n \"a\",\n {\n ...n,\n rel: (n == null ? void 0 : n.rel) || \"noreferrer\",\n href: e,\n className: w(\"absolute inset-0\", n == null ? void 0 : n.className)\n }\n ),\n !e && t && /* @__PURE__ */ f(\n \"button\",\n {\n ...r,\n type: \"button\",\n onClick: t,\n className: w(\"absolute inset-0 cursor-pointer\", r == null ? void 0 : r.className)\n }\n )\n ] });\n}\nfunction S({ elementId: o, type: a, message: e }) {\n return C(() => {\n const n = document.getElementById(o);\n if (n) {\n if (!e && a === \"error\") {\n n.removeAttribute(\"data-error\");\n return;\n }\n if (!e && a === \"success\") {\n n.removeAttribute(\"data-success\");\n return;\n }\n return n.setAttribute(\"aria-describedby\", `${o}-${a}-message`), n.setAttribute(\"aria-invalid\", a === \"error\" ? \"true\" : \"false\"), a === \"error\" && n.setAttribute(\"data-error\", \"true\"), a === \"success\" && n.setAttribute(\"data-success\", \"true\"), () => {\n n.removeAttribute(\"aria-describedby\"), n.removeAttribute(\"aria-invalid\"), n.removeAttribute(\"data-error\"), n.removeAttribute(\"data-success\");\n };\n }\n }, [o, a, e]), e ? /* @__PURE__ */ E(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start\",\n a === \"error\" && \"text-destructive\",\n a === \"success\" && \"text-success\"\n ),\n role: \"status\",\n children: [\n a === \"error\" ? /* @__PURE__ */ f(ie, {}) : /* @__PURE__ */ f(ne, {}),\n /* @__PURE__ */ f(\"span\", { id: `${o}-${a}-message`, children: e })\n ]\n }\n ) : null;\n}\nconst he = {\n base: \"\",\n default: \"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success\",\n underline: \"border-b border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, ge = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, Q = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction Ve({\n variant: o = Q.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: n,\n successMessage: t,\n type: r = \"text\",\n className: s,\n ...d\n}) {\n const u = I(), [l, b] = x(!1);\n let i = a;\n o === \"outline\" && !a && (i = \"md\"), i = i || Q.rounded;\n const m = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n \"file:mr-2 file:border-0 file:rounded-md file:px-1.5 file:py-1 file:bg-primary hover:file:bg-primary/85 file:text-sm file:font-medium file:text-foreground file:transition-colors\",\n !e && he[o],\n !e && ge[i],\n r === \"password\" && \"pr-10\",\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n s\n );\n return /* @__PURE__ */ E(\"div\", { className: w(e && \"cursor-text\"), style: { height: d.height, width: d.width }, children: [\n /* @__PURE__ */ E(\"div\", { className: w(r === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ f(\n \"input\",\n {\n ...d,\n id: u,\n type: r === \"password\" && l ? \"text\" : r,\n \"aria-disabled\": d.disabled,\n readOnly: e,\n \"aria-readonly\": e || d[\"aria-readonly\"],\n \"data-error\": n ? !0 : void 0,\n \"data-success\": t ? !0 : void 0,\n className: m\n }\n ),\n r === \"password\" && /* @__PURE__ */ f(\n \"button\",\n {\n onClick: () => b(!l),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": l ? \"visible\" : \"hidden\",\n children: l ? /* @__PURE__ */ f(oe, { size: 20 }) : /* @__PURE__ */ f(ae, { size: 20 })\n }\n )\n ] }),\n !e && /* @__PURE__ */ f(S, { elementId: u, type: \"error\", message: n }),\n !e && /* @__PURE__ */ f(S, { elementId: u, type: \"success\", message: t })\n ] });\n}\nfunction Ge({\n display: o = \"inline\",\n width: a = \"fit-content\",\n className: e = \"\",\n required: n,\n helpMessage: t,\n suffix: r,\n htmlFor: s,\n children: d,\n ...u\n}) {\n const l = I(), b = w(\"font-medium\", o, e), i = t ? `${s ?? l}-help` : void 0;\n return /* @__PURE__ */ E(\"div\", { style: { display: o === \"inline\" ? \"inline-flex\" : \"flex\", width: a }, className: \"relative\", children: [\n /* @__PURE__ */ E(\"label\", { className: b, htmlFor: s, ...u, children: [\n d,\n n && /* @__PURE__ */ f(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n t && /* @__PURE__ */ f(\n \"span\",\n {\n className: \"text-gray-500 ml-1 size-fit -translate-y-1/3\",\n \"aria-describedby\": i,\n \"aria-label\": \"Help information\",\n title: t,\n children: /* @__PURE__ */ f(se, {})\n }\n ),\n t && /* @__PURE__ */ f(\"div\", { id: i, className: \"sr-only\", children: t }),\n r && /* @__PURE__ */ f(\"span\", { className: \"ml-1\", children: r })\n ] });\n}\nfunction pe(o) {\n const [a, e] = x(!1), [n, t] = x(!1);\n return C(() => {\n o ? (t(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => t(!1), 150));\n }, [o]), { show: a, shouldRender: n };\n}\nfunction ve(o, a) {\n C(() => {\n const e = (n) => {\n n.key === \"Escape\" && o && a();\n };\n return document.addEventListener(\"keydown\", e), o && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", e), document.body.style.overflow = \"auto\";\n };\n }, [o, a]);\n}\nfunction we(o, a) {\n const e = j(null), n = A(() => {\n const t = document.getElementById(o);\n if (!t) return;\n const r = t.querySelectorAll('[data-modal-action=\"true\"]');\n if (r.length > 0) {\n r[0].focus();\n return;\n }\n const s = t.querySelectorAll(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n if (s.length > 0) {\n const d = Array.from(s).filter((u) => !(u instanceof HTMLButtonElement && u.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (d.length > 0) {\n d[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n t.focus();\n }, [o]);\n C(() => (a && (e.current = document.activeElement, n()), () => {\n document.body.style.overflow = \"auto\", e.current instanceof HTMLElement && e.current.focus();\n }), [a, n]);\n}\nfunction We({\n id: o,\n isOpen: a,\n onClose: e,\n title: n,\n children: t,\n contentOnly: r = !1,\n className: s,\n overlayClassName: d,\n hideCloseButton: u = !1,\n actions: l = [],\n disableCloseOnOverlayClick: b = !1,\n ariaLabelledBy: i,\n ariaDescribedBy: v\n}) {\n const c = I(), m = o || `modal-${c}`, p = o ? `${o}-title` : `modal-title-${c}`, { show: h, shouldRender: y } = pe(a);\n if (we(m, y), ve(y, e), !y) return null;\n const g = () => n ? z.isValidElement(n) ? /* @__PURE__ */ f(\"div\", { className: \"mb-4\", children: n }) : /* @__PURE__ */ f(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: p, children: n }) : null, N = () => l.length === 0 ? null : /* @__PURE__ */ f(\"div\", { className: \"mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3\", children: l.map((D, $) => {\n const { label: F, className: L, ...R } = D;\n return /* @__PURE__ */ f(me, { className: L, type: \"button\", ...R, \"data-modal-action\": \"true\", children: F }, $);\n }) });\n return /* @__PURE__ */ f(J, { children: M(\n /* @__PURE__ */ f(\n \"div\",\n {\n \"aria-labelledby\": i ?? n ? p : void 0,\n \"aria-describedby\": v,\n role: \"dialog\",\n \"aria-modal\": \"true\",\n className: \"fixed inset-0 z-[100] overflow-y-auto\",\n children: /* @__PURE__ */ E(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ f(\n \"div\",\n {\n className: q(\"fixed inset-0 bg-black/20 transition-all\", d),\n onClick: () => {\n b || e();\n }\n }\n ),\n r && /* @__PURE__ */ f(\"div\", { className: q(\"relative w-fit\", s), children: t }),\n !r && /* @__PURE__ */ E(\n \"div\",\n {\n id: m,\n tabIndex: -1,\n className: q(\n \"relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75\",\n h ? \"opacity-100 scale-100\" : \"opacity-0 scale-90\",\n s\n ),\n children: [\n !u && /* @__PURE__ */ f(\n \"button\",\n {\n type: \"button\",\n onClick: e,\n \"data-modal-close-button\": \"true\",\n className: \"rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0\",\n children: /* @__PURE__ */ f(le, { size: 18 })\n }\n ),\n g(),\n t,\n N()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction ye({ itemId: o, checked: a, onChange: e, name: n, disabled: t = !1, className: r = \"\" }) {\n const s = \"relative inline-flex items-center justify-center rounded-full\", d = () => {\n t || e();\n }, u = w(\n s,\n !a && \"hover:border-current/60\",\n !t && \"border-current cursor-pointer\",\n t && \"border-muted/60 cursor-not-allowed\",\n r\n );\n return /* @__PURE__ */ f(\n \"div\",\n {\n id: o,\n role: \"radio\",\n tabIndex: -1,\n \"aria-checked\": a,\n \"aria-disabled\": t,\n \"aria-description\": `Radio button for ${n}`,\n \"aria-labelledby\": `${o}-label`,\n onClick: d,\n className: u,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: a && /* @__PURE__ */ f(\n \"div\",\n {\n className: w(\"size-full aspect-square rounded-full\", t && \"bg-muted/60\", !t && \"bg-current\")\n }\n )\n }\n );\n}\nfunction G({\n value: o,\n children: a,\n className: e = \"\",\n isSelected: n = !1,\n onChange: t,\n disabled: r = !1,\n hideInput: s = !1,\n description: d,\n name: u\n}) {\n const b = `radio-${I()}-${o}`, i = () => {\n r || t == null || t(o);\n };\n return /* @__PURE__ */ E(\n \"div\",\n {\n title: d,\n className: w(\n \"relative flex items-center\",\n e,\n // Uses text color for borders\n s && `p-2 border-2 focus-within:border-dashed focus-within:${r ? \"border-current/50\" : \"border-current/80\"}`,\n s && !n && `border-transparent ${r ? \"\" : \"not-focus-within:hover:border-border/60\"}`,\n s && n && \"border-border\",\n r && \"opacity-60 cursor-not-allowed\"\n ),\n style: {\n gap: \"0.5em\"\n },\n children: [\n !s && /* @__PURE__ */ f(\n ye,\n {\n itemId: b,\n name: u || \"\",\n checked: n,\n onChange: i,\n disabled: r,\n className: w(s && \"\")\n }\n ),\n /* @__PURE__ */ f(\n \"div\",\n {\n id: s ? b : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? i : void 0,\n \"aria-checked\": s ? n ? \"true\" : \"false\" : void 0,\n \"aria-disabled\": s ? r : void 0,\n \"aria-description\": s ? d || `Radio button for ${u}` : void 0,\n \"aria-labelledby\": s ? `${b}-label` : void 0,\n className: w(s && \"size-full\", typeof a == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ f(\n \"label\",\n {\n id: `${b}-label`,\n onClick: s ? void 0 : i,\n className: w(r && \"cursor-not-allowed\", !r && \"cursor-pointer\"),\n children: a\n }\n )\n }\n )\n ]\n }\n );\n}\nfunction xe(o, a) {\n const [e, n] = x(a), [t, r] = x(-1), [s, d] = x(!1), u = A((c, m) => {\n var y;\n const p = c[m];\n p.hasAttribute(\"disabled\") || p.getAttribute(\"aria-disabled\") === \"true\" || ((y = c[m]) == null || y.click(), r(m));\n }, []), l = A(\n (c, m) => {\n var h;\n if (c.preventDefault(), s || !m.length) return;\n const p = a !== -1 ? a : 0;\n (h = m[p]) == null || h.focus(), n(p), a !== -1 && u(m, p);\n },\n [a, s, u]\n ), b = A(\n (c) => {\n var y;\n if (!c.shiftKey)\n return;\n c.preventDefault();\n const m = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((g) => !g.hasAttribute(\"disabled\") && g.tabIndex >= 0), p = m.findIndex((g) => g.id === o), h = p > 0 ? p - 1 : m.length - 1;\n (y = m[h]) == null || y.focus();\n },\n [o]\n ), i = A(\n (c, m) => {\n var N;\n if (!m.length) return;\n const p = c.target;\n if (!m.some((D) => D.id === p.id)) return;\n const y = e !== -1 ? e : 0;\n let g = y;\n switch (c.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n c.preventDefault(), g = y > 0 ? y - 1 : m.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n c.preventDefault(), g = (y + 1) % m.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n c.preventDefault(), u(m, y);\n return;\n case \"Tab\":\n b(c);\n return;\n default:\n return;\n }\n (N = m[g]) == null || N.focus(), n(g), t !== -1 && u(m, g);\n },\n [e, t, b, u]\n ), v = A(() => {\n const c = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n return c ? Array.from(c.querySelectorAll('[role=\"radio\"]')) : [];\n }, [o]);\n C(() => {\n const c = document.querySelector(`[id=\"${o}\"][role=\"radiogroup\"]`);\n if (!c) return;\n const m = v(), p = (N) => l(N, m), h = (N) => i(N, m), y = () => d(!0), g = () => d(!1);\n return document.addEventListener(\"keydown\", h), c.addEventListener(\"focus\", p), c.addEventListener(\"mousedown\", y), document.addEventListener(\"mouseup\", g), () => {\n document.removeEventListener(\"keydown\", h), c.removeEventListener(\"focus\", p), c.removeEventListener(\"mousedown\", y), document.removeEventListener(\"mouseup\", g);\n };\n }, [o, v, l, i]);\n}\nfunction Ue({\n options: o = [],\n value: a,\n onChange: e,\n id: n,\n children: t,\n className: r = \"\",\n childrenClassName: s = \"\",\n hideInputs: d = !1\n}) {\n const u = I(), l = n || `radio-group-${u}`;\n xe(\n l,\n o.findIndex((i) => i === a)\n );\n const b = W(() => o.reduce((i, v) => (typeof v == \"string\" ? i.some((c) => c.value === v) || i.push({ label: v, value: v }) : i.push(v), i), []), [o]);\n return /* @__PURE__ */ E(\"div\", { id: l, role: \"radiogroup\", tabIndex: 0, className: w(r, \"focus:outline-none\"), children: [\n b.length > 0 && b.map((i, v) => /* @__PURE__ */ f(\n G,\n {\n value: i.value,\n isSelected: a === i.value,\n onChange: e,\n name: l,\n disabled: i.disabled,\n description: i.description,\n hideInput: d,\n className: s,\n children: i.label\n },\n `${i.value}-${v}`\n )),\n b.length === 0 && t && z.Children.map(t, (i) => z.isValidElement(i) && i.type === G ? /* @__PURE__ */ f(\n G,\n {\n ...i.props,\n className: w(s, i.props.className),\n hideInput: i.props.hideInput || d,\n isSelected: a === i.props.value,\n onChange: e,\n name: l,\n children: i.props.children\n }\n ) : null)\n ] });\n}\nfunction _e({ children: o, ref: a, ...e }) {\n if (P(o)) {\n let n = { ...e };\n return o.props && (n = { ...n, ...o.props }), ee(o, {\n ...n,\n ref: (t) => {\n typeof a == \"function\" ? a(t) : a && (a.current = t);\n }\n });\n }\n return Y(\"div\", { ...e, ref: a }, o);\n}\nfunction Ee({ elementId: o, maxLength: a }) {\n const [e, n] = x(0);\n return C(() => {\n const t = document.getElementById(o);\n if (!t)\n return;\n const r = () => {\n const s = t.value.length;\n n(s);\n const d = s >= a;\n t.setAttribute(\"aria-describedby\", `${o}-character-count`), t.setAttribute(\"aria-invalid\", d ? \"true\" : \"false\"), d ? t.setAttribute(\"data-error\", \"true\") : t.removeAttribute(\"data-error\");\n };\n return r(), t.addEventListener(\"input\", r), t.setAttribute(\"maxlength\", String(a)), () => {\n t.removeEventListener(\"input\", r), t.removeAttribute(\"maxlength\"), t.removeAttribute(\"aria-describedby\"), t.removeAttribute(\"aria-invalid\"), t.removeAttribute(\"data-error\");\n };\n }, [o, a]), /* @__PURE__ */ f(\n \"small\",\n {\n className: w(\n \"mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end\",\n e >= a && \"text-destructive\",\n e < a && \"text-current\"\n ),\n role: \"status\",\n children: /* @__PURE__ */ E(\"span\", { id: `${o}-character-count`, children: [\n e,\n \" / \",\n a,\n \" characters\"\n ] })\n }\n );\n}\nfunction Ne(o, a) {\n C(() => {\n const e = document.getElementById(o);\n if (!e)\n return;\n if (!a) {\n e.style.height = \"auto\";\n return;\n }\n const n = () => {\n e.style.height = \"auto\", e.style.height = `${e.scrollHeight}px`;\n };\n return n(), e.addEventListener(\"input\", n), e.addEventListener(\"resize\", n), window.addEventListener(\"resize\", n), () => {\n e.removeEventListener(\"input\", n), e.removeEventListener(\"resize\", n), window.removeEventListener(\"resize\", n);\n };\n }, [o, a]);\n}\nconst Ce = {\n base: \"\",\n \"left-line\": \"border-l border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\",\n outline: \"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success\"\n}, Ae = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, X = {\n variant: \"outline\",\n rounded: \"none\"\n};\nfunction Qe({\n variant: o = X.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: n,\n successMessage: t,\n hideResizeHandle: r = !1,\n autoExpand: s = !1,\n characterLimit: d = 0,\n className: u,\n ...l\n}) {\n const b = I();\n Ne(b, s || e);\n let i = a;\n o === \"outline\" && !a && (i = \"md\"), i = i || X.rounded;\n let v = r;\n (e || o === \"left-line\" && !r) && (v = !0);\n const m = w(\n \"appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all\",\n !e && Ce[o],\n !e && Ae[i],\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n v && \"no-resize-handle\",\n u\n );\n return /* @__PURE__ */ E(\"div\", { className: w(\"-space-y-1.5\", e && \"cursor-text\"), children: [\n /* @__PURE__ */ f(\n \"textarea\",\n {\n ...l,\n id: b,\n \"aria-disabled\": l.disabled,\n readOnly: e,\n \"aria-readonly\": e || l[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: m\n }\n ),\n d > 0 && /* @__PURE__ */ f(Ee, { elementId: b, maxLength: d }),\n !e && /* @__PURE__ */ f(S, { elementId: b, type: \"error\", message: n }),\n !e && /* @__PURE__ */ f(S, { elementId: b, type: \"success\", message: t })\n ] });\n}\nconst Ie = {\n sm: {\n container: \"h-5 min-w-9 w-9\",\n thumb: \"h-4 w-4\",\n translate: \"translate-x-4\"\n },\n md: {\n container: \"h-6 min-w-11 w-11\",\n thumb: \"h-5 w-5\",\n translate: \"translate-x-5\"\n },\n lg: {\n container: \"h-7 min-w-13 w-13\",\n thumb: \"h-6 w-6\",\n translate: \"translate-x-6\"\n }\n}, $e = {\n default: {\n unchecked: \"bg-muted\",\n checked: \"bg-primary\"\n },\n success: {\n unchecked: \"bg-muted\",\n checked: \"bg-success\"\n },\n destructive: {\n unchecked: \"bg-muted\",\n checked: \"bg-destructive\"\n }\n}, Z = {\n variant: \"default\",\n size: \"md\"\n};\nfunction Xe({\n ref: o,\n id: a,\n size: e = Z.size,\n variant: n = Z.variant,\n checked: t,\n onCheckedChange: r,\n disabled: s = !1,\n className: d,\n thumbClassName: u,\n backgroundClassNames: l,\n ...b\n}) {\n const i = I(), v = W(() => a || `toggle-${i}`, [a, i]), [c, m] = x(t);\n C(() => {\n m(t);\n }, [t]);\n const p = () => {\n if (!s) {\n const $ = !c;\n t === void 0 && m($), r == null || r($);\n }\n }, h = ($) => {\n ($.key === \" \" || $.key === \"Enter\") && ($.preventDefault(), p());\n }, y = Ie[e], g = $e[n], N = w(\n // Base styles\n \"relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out\",\n \"focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2\",\n // Size\n y.container,\n // Variant and state\n c ? (l == null ? void 0 : l.checked) || g.checked : (l == null ? void 0 : l.unchecked) || g.unchecked,\n // Disabled state\n s && \"opacity-50 cursor-not-allowed\",\n !s && \"cursor-pointer\",\n d\n ), D = w(\n // Base thumb styles\n \"absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out\",\n // Size\n y.thumb,\n // Position based on state\n c && y.translate,\n u\n );\n return /* @__PURE__ */ E(\n \"button\",\n {\n ref: o,\n id: v,\n type: \"button\",\n role: \"switch\",\n tabIndex: 0,\n \"aria-checked\": c,\n \"aria-disabled\": s,\n disabled: s,\n onClick: p,\n onKeyDown: h,\n className: N,\n ...b,\n children: [\n /* @__PURE__ */ f(\"span\", { className: D }),\n /* @__PURE__ */ f(\"span\", { className: \"sr-only\", children: c ? \"Enabled\" : \"Disabled\" })\n ]\n }\n );\n}\nconst k = 8, B = 4, T = 6;\nfunction Te(o) {\n return { calculatePosition: A(\n (e, n) => {\n const t = e.getBoundingClientRect(), r = n.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, d = (v, c, m, p) => v < 0 || c < 0 || v + m > s.width || c + p > s.height, u = {\n top: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.top - r.height - B,\n arrow: {\n x: r.width / 2 - T,\n y: r.height\n }\n },\n bottom: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.bottom + B,\n arrow: {\n x: r.width / 2 - T,\n y: -6\n }\n },\n left: {\n x: t.left - r.width - B,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: r.width,\n y: r.height / 2 - T\n }\n },\n right: {\n x: t.right + B,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: -6,\n y: r.height / 2 - T\n }\n }\n };\n let l = o, b = u[o];\n if (d(b.x, b.y, r.width, r.height)) {\n const v = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, c = u[v[o]];\n if (!d(c.x, c.y, r.width, r.height))\n l = v[o], b = c;\n else {\n const m = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (p) => p !== o && p !== v[o]\n );\n for (const p of m) {\n const h = u[p];\n if (!d(h.x, h.y, r.width, r.height)) {\n l = p, b = h;\n break;\n }\n }\n }\n }\n b.x = Math.max(\n k,\n Math.min(b.x, s.width - r.width - k)\n ), b.y = Math.max(\n k,\n Math.min(b.y, s.height - r.height - k)\n );\n const i = {\n x: t.left + t.width / 2,\n y: t.top + t.height / 2\n };\n return l === \"top\" || l === \"bottom\" ? b.arrow.x = Math.max(\n T,\n Math.min(i.x - b.x - T, r.width - T * 2)\n ) : b.arrow.y = Math.max(\n T,\n Math.min(i.y - b.y - T, r.height - T * 2)\n ), {\n ...b,\n placement: l\n };\n },\n [o]\n ) };\n}\nfunction De(o, a, e) {\n const n = j(null), t = j(null), r = A(() => {\n if (!n.current || !t.current) return;\n const s = o(n.current, t.current);\n e(s);\n }, [o, e]);\n return C(() => {\n if (!a) return;\n const s = () => r();\n return window.addEventListener(\"resize\", s), () => {\n window.removeEventListener(\"resize\", s);\n };\n }, [a, r]), {\n triggerRef: n,\n tooltipRef: t,\n updatePosition: r\n };\n}\nfunction ze(o, a, e, n, t, r, s, d, u) {\n const l = j(null), b = A(() => {\n o || (l.current && clearTimeout(l.current), l.current = window.setTimeout(() => {\n e(!0), requestAnimationFrame(() => {\n t(), n(!0);\n });\n }, a));\n }, [o, a, e, t, n]), i = A(\n (v = !1) => {\n if (l.current && clearTimeout(l.current), v) {\n n(!1), setTimeout(() => e(!1), 150);\n return;\n }\n l.current = window.setTimeout(() => {\n n(!1), setTimeout(() => e(!1), 150);\n }, 100);\n },\n [n, e]\n );\n return C(() => {\n !r && !s && !d && u && i();\n }, [r, s, d, u, i]), C(() => () => {\n l.current && clearTimeout(l.current);\n }, []), {\n showTooltip: b,\n hideTooltip: i,\n timeoutRef: l\n };\n}\nfunction Ze({\n id: o,\n children: a,\n message: e,\n placement: n = \"top\",\n disabled: t = !1,\n delay: r = 200,\n className: s\n}) {\n const [d, u] = x(!1), [l, b] = x(!1), [i, v] = x(null), [c, m] = x(!1), [p, h] = x(!1), [y, g] = x(!1), { calculatePosition: N } = Te(n), { triggerRef: D, tooltipRef: $, updatePosition: F } = De(N, l, v), { showTooltip: L, hideTooltip: R, timeoutRef: U } = ze(\n t,\n r,\n b,\n u,\n F,\n c,\n p,\n y,\n d\n ), O = I(), _ = o ?? O;\n return /* @__PURE__ */ E(J, { children: [\n z.cloneElement(a, {\n ref: (H) => {\n D.current = H;\n },\n onMouseEnter: () => {\n m(!0), L();\n },\n onMouseLeave: () => {\n m(!1);\n },\n onFocus: () => {\n g(!0), L();\n },\n onBlur: () => {\n g(!1), R(!0);\n },\n onKeyDown: (H) => {\n H.key === \"Escape\" && R(!0);\n },\n \"aria-describedby\": t ? void 0 : _\n }),\n l && M(\n /* @__PURE__ */ f(\n \"div\",\n {\n ref: $,\n id: _,\n role: \"tooltip\",\n className: w(\n \"fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out\",\n d ? \"opacity-100\" : \"opacity-0\",\n s\n ),\n style: i ? { left: i.x, top: i.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), U.current && clearTimeout(U.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: e\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n He as Accordion,\n K as AccordionItem,\n Me as ActionModal,\n me as Button,\n de as ButtonLoadingDots,\n qe as Checkbox,\n Ke as Clickable,\n Ve as Input,\n Ge as Label,\n We as Modal,\n Ue as RadioGroup,\n G as RadioGroupItem,\n ye as RadioInput,\n _e as Slot,\n Qe as Textarea,\n Oe as Toast,\n Xe as Toggle,\n Ze as Tooltip\n};\n//# sourceMappingURL=components.esm.js.map\n","import { Modal, ModalProps } from '@moondreamsdev/dreamer-ui/components';\nimport React, { useMemo } from 'react';\n\ninterface BaseActionModalProps extends Omit<ModalProps, 'children' | 'actions'> {\n message: React.ReactNode;\n destructive?: boolean;\n}\n\ninterface AlertModalProps extends BaseActionModalProps {\n type: 'alert';\n confirmText?: string;\n onConfirm?: () => void;\n // Cancel-related props are not allowed for alerts\n cancelText?: never;\n}\n\ninterface ConfirmModalProps extends BaseActionModalProps {\n type: 'confirm';\n confirmText?: string;\n cancelText?: string;\n onConfirm?: () => void;\n}\n\nexport type ActionModalProps = AlertModalProps | ConfirmModalProps;\n\nexport function ActionModal({\n type,\n message,\n cancelText,\n confirmText,\n onConfirm,\n onClose,\n destructive = false,\n title,\n ...modalProps\n}: ActionModalProps) {\n const defaultTexts = useMemo(() => {\n if (type === 'confirm') {\n return {\n confirm: confirmText || 'Confirm',\n cancel: cancelText || 'Cancel',\n defaultTitle: title || 'Confirm Action',\n };\n }\n return {\n confirm: confirmText || 'OK',\n cancel: null,\n defaultTitle: title || 'Alert',\n };\n }, [type, confirmText, title, cancelText]);\n\n const actions: ModalProps['actions'] = useMemo(\n () => [\n ...(defaultTexts.cancel\n ? [\n {\n label: defaultTexts.cancel,\n variant: 'secondary' as const,\n onClick: onClose,\n },\n ]\n : []),\n {\n label: defaultTexts.confirm,\n variant: destructive ? 'destructive' : 'primary',\n onClick: () => {\n onConfirm?.();\n onClose();\n },\n },\n ],\n [defaultTexts, destructive, onConfirm, onClose]\n );\n\n return (\n <Modal\n {...modalProps}\n title={title || defaultTexts.defaultTitle}\n onClose={onClose}\n actions={actions}\n disableCloseOnOverlayClick={type === 'confirm'}\n hideCloseButton={type === 'confirm'}\n >\n {typeof message === 'string' ? <p className='text-sm'>{message}</p> : message}\n </Modal>\n );\n}\n","import { ReactNode, useCallback, useEffect, useState } from 'react';\nimport { CrossCircled, ExclamationTriangle, InfoCircled, X } from '../../symbols';\nimport { join } from '../../utils';\nexport type ToastType = 'info' | 'warning' | 'error';\n\nexport interface ToastAction {\n label: string;\n onClick: () => void;\n}\n\nexport interface ToastData {\n id: string;\n title: string;\n description?: string;\n type?: ToastType;\n action?: ToastAction;\n duration?: number;\n onRemove?: (id: string) => void;\n}\n\ninterface ToastProps extends ToastData {\n customTypes?: Record<string, { className: string; icon?: ReactNode }>;\n customComponent?: React.ComponentType<ToastData>;\n}\n\nconst defaultTypeStyles: Record<ToastType, { className: string; icon: ReactNode }> = {\n info: {\n className: 'bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100',\n icon: <InfoCircled size={20} />,\n },\n warning: {\n className:\n 'bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100',\n icon: <ExclamationTriangle size={20} />,\n },\n error: {\n className: 'bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100',\n icon: <CrossCircled size={20} />,\n },\n};\n\nexport function Toast({\n id,\n title,\n description,\n type = 'info',\n action,\n duration = 5000,\n onRemove,\n customTypes,\n customComponent: CustomComponent,\n}: ToastProps) {\n const [isExiting, setIsExiting] = useState(false);\n\n const handleRemove = useCallback(() => {\n setIsExiting(true);\n setTimeout(() => {\n onRemove?.(id);\n }, 150); // Match animation duration\n }, [id, onRemove]);\n\n useEffect(() => {\n if (duration > 0) {\n const timer = setTimeout(() => {\n handleRemove();\n }, duration);\n\n return () => clearTimeout(timer);\n }\n }, [duration, id, onRemove, handleRemove]);\n\n if (CustomComponent) {\n return (\n <CustomComponent\n id={id}\n title={title}\n description={description}\n type={type}\n action={action}\n duration={duration}\n onRemove={onRemove}\n />\n );\n }\n\n // Check custom types first, then fall back to default\n const typeStyle = customTypes?.[type] || defaultTypeStyles[type as ToastType] || defaultTypeStyles.info;\n\n return (\n <div\n role={type === 'error' ? 'alert' : 'status'}\n aria-live={type === 'error' ? undefined : 'polite'}\n className={join(\n 'relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out',\n action && 'pb-3',\n typeStyle.className,\n isExiting ? 'opacity-0 translate-x-full' : 'opacity-100 translate-x-0'\n )}\n >\n {/* Icon */}\n <div className='flex-shrink-0 mr-3'>{typeStyle.icon}</div>\n\n {/* Content */}\n <div className='flex-grow min-w-0'>\n <div className='font-medium text-sm leading-5'>{title}</div>\n {description && <div className='mt-1 text-sm opacity-90 leading-5'>{description}</div>}\n {action && (\n <div className='mt-1.5'>\n <button\n onClick={action.onClick}\n className='text-sm font-medium underline hover:no-underline focus:outline-none focus:ring-1 focus:ring-current rounded px-1 py-0.5 hover:cursor-pointer'\n >\n {action.label}\n </button>\n </div>\n )}\n </div>\n\n {/* Close button */}\n <button\n onClick={handleRemove}\n className='flex-shrink-0 ml-3 p-1 rounded-md hover:bg-black/10 dark:hover:bg-white/10 focus:outline-none focus:ring-1 focus:ring-current leading-0'\n >\n <X size={16} />\n </button>\n </div>\n );\n}\n"],"names":["n","s","h","C","i","e","w","H","de","o","a","x","f","ue","ce","fe","V","me","t","r","d","u","l","E","pe","ve","we","j","A","We","b","v","c","I","m","p","g","z","N","D","$","F","L","R","J","M","q","le","ActionModal","type","message","cancelText","confirmText","onConfirm","onClose","destructive","title","modalProps","defaultTexts","useMemo","actions","jsx","Modal","defaultTypeStyles","InfoCircled","ExclamationTriangle","CrossCircled","Toast","id","description","action","duration","onRemove","customTypes","CustomComponent","isExiting","setIsExiting","useState","handleRemove","useCallback","useEffect","timer","typeStyle","jsxs","join","X"],"mappings":"sJAAA,SAASA,KAAK,EAAG,CACf,OAAO,EAAE,OAAQC,GAAM,OAAOA,GAAK,UAAYA,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CCgFA,SAASC,EAAE,CAAE,KAAMC,EAAI,GAAI,MAAO,EAAI,eAAgB,UAAW,EAAI,SAAU,GAAGC,CAAC,EAAI,CACrF,OAAuBC,EAAC,IACtB,MACA,CACE,GAAGD,EACH,MAAOD,EACP,OAAQA,EACR,UAAW,EACX,QAAS,YACT,MAAO,6BACP,SAA0BE,EAAC,IACzB,OACA,CACE,EAAG,0gBACH,KAAM,EACN,SAAU,UACV,SAAU,SACpB,CACA,CACA,CACG,CACH,CClGA,SAASC,KAAKD,EAAG,CACf,OAAOA,EAAE,OAAQ,GAAM,OAAO,GAAK,UAAY,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CAeAE,EAAC,cAAC,MAAM,EC4GR,SAASC,GAAK,CACZ,KAAM,CAACC,EAAGC,CAAC,EAAIC,EAAAA,SAAE,CAAC,EAClB,OAAOR,EAAC,UAAC,IAAM,CACb,MAAME,EAAI,YAAY,IAAM,CAC1BK,EAAGV,IAAOA,EAAI,GAAK,CAAC,CACrB,EAAE,GAAG,EACN,MAAO,IAAM,cAAcK,CAAC,CAChC,EAAK,CAAA,CAAE,EAAmBO,EAAC,IAAC,MAAO,CAAE,UAAW,gFAAiF,SAAU,CAAC,EAAG,EAA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AC,SAAA,CACC,QAASiB,EACT,UAAU,0IAEV,SAAAjB,EAAAA,IAACwB,EAAAA,EAAE,CAAA,KAAM,EAAI,CAAA,CAAA,CAAA,CACf,CAAA,CACF,CAEJ"}
@@ -1,27 +1,38 @@
1
- import { jsx as r, Fragment as M, jsxs as f } from "react/jsx-runtime";
2
- import q, { createContext as H, useId as K, useState as p, useEffect as b, useRef as P, useCallback as L, useMemo as C } from "react";
1
+ import { jsx as r, Fragment as S, jsxs as f } from "react/jsx-runtime";
2
+ import q, { createContext as F, useId as H, useState as p, useEffect as b, useRef as P, useCallback as z, useMemo as C } from "react";
3
3
  import { createPortal as V } from "react-dom";
4
- import { X as D, C as F, E as X, I as Z } from "./X-CIoyLewf.js";
5
- import { join as G } from "./utils.esm.js";
4
+ import { X as D, C as K, E as W, I as X } from "./X-CIoyLewf.js";
5
+ import { join as Z } from "./utils.esm.js";
6
6
  function w(...e) {
7
7
  return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
8
8
  }
9
- function J({ size: e = 15, color: l = "currentColor" }) {
10
- return /* @__PURE__ */ r("svg", { width: e, height: e, className: "inline", viewBox: "0 0 15 15", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ r(
11
- "path",
9
+ function G({ size: e = 15, color: l = "currentColor", className: n = "inline", ...t }) {
10
+ return /* @__PURE__ */ r(
11
+ "svg",
12
12
  {
13
- d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
14
- fill: l,
15
- fillRule: "evenodd",
16
- clipRule: "evenodd"
13
+ ...t,
14
+ width: e,
15
+ height: e,
16
+ className: n,
17
+ viewBox: "0 0 15 15",
18
+ xmlns: "http://www.w3.org/2000/svg",
19
+ children: /* @__PURE__ */ r(
20
+ "path",
21
+ {
22
+ d: "M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",
23
+ fill: l,
24
+ fillRule: "evenodd",
25
+ clipRule: "evenodd"
26
+ }
27
+ )
17
28
  }
18
- ) });
29
+ );
19
30
  }
20
- function y(...e) {
31
+ function v(...e) {
21
32
  return e.filter((l) => typeof l == "string" && l).join(" ").trim() || void 0;
22
33
  }
23
- H(void 0);
24
- function Q() {
34
+ F(void 0);
35
+ function J() {
25
36
  const [e, l] = p(0);
26
37
  return b(() => {
27
38
  const n = setInterval(() => {
@@ -39,7 +50,7 @@ function Q() {
39
50
  n
40
51
  )) });
41
52
  }
42
- const R = {
53
+ const Q = {
43
54
  base: "",
44
55
  primary: "bg-primary text-primary-foreground hover:bg-primary/85 disabled:bg-muted disabled:text-muted-foreground",
45
56
  secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/85 disabled:bg-muted/80 disabled:text-muted-foreground/80",
@@ -47,7 +58,7 @@ const R = {
47
58
  outline: "border border-primary text-primary hover:border-primary-foreground hover:text-primary-foreground disabled:border-muted disabled:text-muted",
48
59
  link: "underline-offset-4 hover:underline disabled:underline disabled:text-muted",
49
60
  destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/85 disabled:bg-muted disabled:text-muted-foreground"
50
- }, U = {
61
+ }, R = {
51
62
  stripped: "",
52
63
  fitted: "size-fit",
53
64
  sm: "px-2 py-1 text-sm",
@@ -55,7 +66,7 @@ const R = {
55
66
  lg: "px-6 py-3 text-lg",
56
67
  icon: "p-1 w-fit aspect-square",
57
68
  full: "p-2 w-full"
58
- }, W = {
69
+ }, U = {
59
70
  none: "rounded-none",
60
71
  sm: "rounded-sm",
61
72
  md: "rounded-md",
@@ -74,35 +85,35 @@ function Y({
74
85
  linkTo: i,
75
86
  linkProps: a,
76
87
  type: o = "button",
77
- className: d,
78
- ...s
88
+ className: s,
89
+ ...d
79
90
  }) {
80
91
  let c;
81
92
  e === "link" && !l ? c = "fitted" : c = l || x.size;
82
93
  const u = w(
83
94
  "appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",
84
- R[e],
85
- U[c],
86
- W[n],
95
+ Q[e],
96
+ R[c],
97
+ U[n],
87
98
  t && "relative pointer-events-none",
88
99
  i && "relative",
89
- d
100
+ s
90
101
  );
91
102
  return /* @__PURE__ */ f(
92
103
  "button",
93
104
  {
94
- ...s,
95
- role: i ? "link" : s.role,
96
- "aria-label": s["aria-label"] || (a == null ? void 0 : a["aria-label"]),
97
- "aria-description": s["aria-description"] || (a == null ? void 0 : a["aria-description"]),
98
- "aria-disabled": s.disabled || t,
105
+ ...d,
106
+ role: i ? "link" : d.role,
107
+ "aria-label": d["aria-label"] || (a == null ? void 0 : a["aria-label"]),
108
+ "aria-description": d["aria-description"] || (a == null ? void 0 : a["aria-description"]),
109
+ "aria-disabled": d.disabled || t,
99
110
  "aria-busy": t,
100
111
  type: o,
101
112
  className: u,
102
113
  children: [
103
- t && /* @__PURE__ */ r(Q, {}),
104
- /* @__PURE__ */ r("span", { className: w(t && "invisible"), children: s.children }),
105
- i && !s.disabled && /* @__PURE__ */ r(
114
+ t && /* @__PURE__ */ r(J, {}),
115
+ /* @__PURE__ */ r("span", { className: w(t && "invisible"), children: d.children }),
116
+ i && !d.disabled && /* @__PURE__ */ r(
106
117
  "a",
107
118
  {
108
119
  ...a,
@@ -133,7 +144,7 @@ function $(e, l) {
133
144
  }, [e, l]);
134
145
  }
135
146
  function ee(e, l) {
136
- const n = P(null), t = L(() => {
147
+ const n = P(null), t = z(() => {
137
148
  const i = document.getElementById(e);
138
149
  if (!i) return;
139
150
  const a = i.querySelectorAll('[data-modal-action="true"]');
@@ -145,9 +156,9 @@ function ee(e, l) {
145
156
  'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
146
157
  );
147
158
  if (o.length > 0) {
148
- const d = Array.from(o).filter((s) => !(s instanceof HTMLButtonElement && s.getAttribute("data-modal-close-button") === "true"));
149
- if (d.length > 0) {
150
- d[0].focus();
159
+ const s = Array.from(o).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute("data-modal-close-button") === "true"));
160
+ if (s.length > 0) {
161
+ s[0].focus();
151
162
  return;
152
163
  }
153
164
  o[0].focus();
@@ -167,20 +178,20 @@ function te({
167
178
  children: i,
168
179
  contentOnly: a = !1,
169
180
  className: o,
170
- overlayClassName: d,
171
- hideCloseButton: s = !1,
181
+ overlayClassName: s,
182
+ hideCloseButton: d = !1,
172
183
  actions: c = [],
173
184
  disableCloseOnOverlayClick: u = !1,
174
185
  ariaLabelledBy: m,
175
186
  ariaDescribedBy: g
176
187
  }) {
177
- const h = K(), N = e || `modal-${h}`, k = e ? `${e}-title` : `modal-title-${h}`, { show: z, shouldRender: v } = _(l);
178
- if (ee(N, v), $(v, n), !v) return null;
188
+ const h = H(), N = e || `modal-${h}`, k = e ? `${e}-title` : `modal-title-${h}`, { show: E, shouldRender: y } = _(l);
189
+ if (ee(N, y), $(y, n), !y) return null;
179
190
  const T = () => t ? q.isValidElement(t) ? /* @__PURE__ */ r("div", { className: "mb-4", children: t }) : /* @__PURE__ */ r("h2", { className: "mb-4 text-xl font-semibold", id: k, children: t }) : null, j = () => c.length === 0 ? null : /* @__PURE__ */ r("div", { className: "mt-6 not-sm:grid gap-y-2 sm:flex sm:justify-start sm:flex-row-reverse sm:gap-x-3", children: c.map((A, I) => {
180
- const { label: B, className: O, ...S } = A;
181
- return /* @__PURE__ */ r(Y, { className: O, type: "button", ...S, "data-modal-action": "true", children: B }, I);
191
+ const { label: B, className: O, ...M } = A;
192
+ return /* @__PURE__ */ r(Y, { className: O, type: "button", ...M, "data-modal-action": "true", children: B }, I);
182
193
  }) });
183
- return /* @__PURE__ */ r(M, { children: V(
194
+ return /* @__PURE__ */ r(S, { children: V(
184
195
  /* @__PURE__ */ r(
185
196
  "div",
186
197
  {
@@ -193,32 +204,32 @@ function te({
193
204
  /* @__PURE__ */ r(
194
205
  "div",
195
206
  {
196
- className: y("fixed inset-0 bg-black/20 transition-all", d),
207
+ className: v("fixed inset-0 bg-black/20 transition-all", s),
197
208
  onClick: () => {
198
209
  u || n();
199
210
  }
200
211
  }
201
212
  ),
202
- a && /* @__PURE__ */ r("div", { className: y("relative w-fit", o), children: i }),
213
+ a && /* @__PURE__ */ r("div", { className: v("relative w-fit", o), children: i }),
203
214
  !a && /* @__PURE__ */ f(
204
215
  "div",
205
216
  {
206
217
  id: N,
207
218
  tabIndex: -1,
208
- className: y(
219
+ className: v(
209
220
  "relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",
210
- z ? "opacity-100 scale-100" : "opacity-0 scale-90",
221
+ E ? "opacity-100 scale-100" : "opacity-0 scale-90",
211
222
  o
212
223
  ),
213
224
  children: [
214
- !s && /* @__PURE__ */ r(
225
+ !d && /* @__PURE__ */ r(
215
226
  "button",
216
227
  {
217
228
  type: "button",
218
229
  onClick: n,
219
230
  "data-modal-close-button": "true",
220
231
  className: "rounded-md p-0.5 top-2.5 right-2.5 absolute opacity-80 hover:opacity-100 transition-opacity focus:outline-none focus:ring-2 focus:ring-gray-500 leading-0",
221
- children: /* @__PURE__ */ r(J, { size: 18 })
232
+ children: /* @__PURE__ */ r(G, { size: 18 })
222
233
  }
223
234
  ),
224
235
  T(),
@@ -241,18 +252,18 @@ function oe({
241
252
  onConfirm: i,
242
253
  onClose: a,
243
254
  destructive: o = !1,
244
- title: d,
245
- ...s
255
+ title: s,
256
+ ...d
246
257
  }) {
247
258
  const c = C(() => e === "confirm" ? {
248
259
  confirm: t || "Confirm",
249
260
  cancel: n || "Cancel",
250
- defaultTitle: d || "Confirm Action"
261
+ defaultTitle: s || "Confirm Action"
251
262
  } : {
252
263
  confirm: t || "OK",
253
264
  cancel: null,
254
- defaultTitle: d || "Alert"
255
- }, [e, t, d, n]), u = C(
265
+ defaultTitle: s || "Alert"
266
+ }, [e, t, s, n]), u = C(
256
267
  () => [
257
268
  ...c.cancel ? [
258
269
  {
@@ -274,8 +285,8 @@ function oe({
274
285
  return /* @__PURE__ */ r(
275
286
  te,
276
287
  {
277
- ...s,
278
- title: d || c.defaultTitle,
288
+ ...d,
289
+ title: s || c.defaultTitle,
279
290
  onClose: a,
280
291
  actions: u,
281
292
  disableCloseOnOverlayClick: e === "confirm",
@@ -284,21 +295,21 @@ function oe({
284
295
  }
285
296
  );
286
297
  }
287
- const E = {
298
+ const L = {
288
299
  info: {
289
300
  className: "bg-blue-50 border-blue-200 text-blue-900 dark:bg-blue-800 dark:border-blue-950 dark:text-blue-100",
290
- icon: /* @__PURE__ */ r(Z, { size: 20 })
301
+ icon: /* @__PURE__ */ r(X, { size: 20 })
291
302
  },
292
303
  warning: {
293
304
  className: "bg-yellow-50 border-yellow-200 text-yellow-900 dark:bg-yellow-800 dark:border-yellow-950 dark:text-yellow-100",
294
- icon: /* @__PURE__ */ r(X, { size: 20 })
305
+ icon: /* @__PURE__ */ r(W, { size: 20 })
295
306
  },
296
307
  error: {
297
308
  className: "bg-red-50 border-red-200 text-red-900 dark:bg-red-800 dark:border-red-950 dark:text-red-100",
298
- icon: /* @__PURE__ */ r(F, { size: 20 })
309
+ icon: /* @__PURE__ */ r(K, { size: 20 })
299
310
  }
300
311
  };
301
- function se({
312
+ function de({
302
313
  id: e,
303
314
  title: l,
304
315
  description: n,
@@ -306,10 +317,10 @@ function se({
306
317
  action: i,
307
318
  duration: a = 5e3,
308
319
  onRemove: o,
309
- customTypes: d,
310
- customComponent: s
320
+ customTypes: s,
321
+ customComponent: d
311
322
  }) {
312
- const [c, u] = p(!1), m = L(() => {
323
+ const [c, u] = p(!1), m = z(() => {
313
324
  u(!0), setTimeout(() => {
314
325
  o == null || o(e);
315
326
  }, 150);
@@ -321,9 +332,9 @@ function se({
321
332
  }, a);
322
333
  return () => clearTimeout(h);
323
334
  }
324
- }, [a, e, o, m]), s)
335
+ }, [a, e, o, m]), d)
325
336
  return /* @__PURE__ */ r(
326
- s,
337
+ d,
327
338
  {
328
339
  id: e,
329
340
  title: l,
@@ -334,13 +345,13 @@ function se({
334
345
  onRemove: o
335
346
  }
336
347
  );
337
- const g = (d == null ? void 0 : d[t]) || E[t] || E.info;
348
+ const g = (s == null ? void 0 : s[t]) || L[t] || L.info;
338
349
  return /* @__PURE__ */ f(
339
350
  "div",
340
351
  {
341
352
  role: t === "error" ? "alert" : "status",
342
353
  "aria-live": t === "error" ? void 0 : "polite",
343
- className: G(
354
+ className: Z(
344
355
  "relative flex items-start p-4 rounded-lg border shadow-lg transition-all duration-150 ease-in-out",
345
356
  i && "pb-3",
346
357
  g.className,
@@ -374,7 +385,7 @@ function se({
374
385
  }
375
386
  export {
376
387
  oe as A,
377
- se as T,
388
+ de as T,
378
389
  w as n
379
390
  };
380
- //# sourceMappingURL=Toast-C5BwqBkw.js.map
391
+ //# sourceMappingURL=Toast-vensJgtx.js.map