@moondreamsdev/dreamer-ui 1.7.7-test.1 → 1.7.7-test.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/QuestionMarkCircled-BVBF3skB.js +157 -0
- package/dist/QuestionMarkCircled-BVBF3skB.js.map +1 -0
- package/dist/QuestionMarkCircled-D5cHmQp1.cjs +2 -0
- package/dist/QuestionMarkCircled-D5cHmQp1.cjs.map +1 -0
- package/dist/{Toast-Bn0CCsLY.js → Toast-C5BwqBkw.js} +30 -30
- package/dist/Toast-C5BwqBkw.js.map +1 -0
- package/dist/{Toast-uzg_Sy4r.cjs → Toast-FzI16Fnl.cjs} +2 -2
- package/dist/Toast-FzI16Fnl.cjs.map +1 -0
- package/dist/X-CIoyLewf.js +111 -0
- package/dist/X-CIoyLewf.js.map +1 -0
- package/dist/X-CgjeP2OI.cjs +2 -0
- package/dist/X-CgjeP2OI.cjs.map +1 -0
- package/dist/components.cjs.js +1 -1
- package/dist/components.cjs.js.map +1 -1
- package/dist/components.esm.js +560 -459
- package/dist/components.esm.js.map +1 -1
- package/dist/providers.cjs.js +1 -1
- package/dist/providers.cjs.js.map +1 -1
- package/dist/providers.esm.js +15 -15
- package/dist/providers.esm.js.map +1 -1
- package/dist/src/components/accordion/AccordionItem.d.ts +1 -0
- package/dist/src/components/clickable/Clickable.d.ts +1 -0
- package/dist/src/components/index.d.ts +1 -0
- package/dist/src/components/radiogroup/RadioGroupItem.d.ts +1 -0
- package/dist/src/components/toggle/Toggle.d.ts +13 -0
- package/dist/src/components/toggle/index.d.ts +2 -0
- package/dist/src/components/toggle/variants.d.ts +29 -0
- package/dist/src/components/tooltip/hooks.d.ts +1 -0
- package/dist/src/hooks/useActionModal.d.ts +1 -0
- package/dist/src/hooks/useToast.d.ts +2 -1
- package/dist/src/symbols/Check.d.ts +2 -4
- package/dist/src/symbols/CheckCircled.d.ts +2 -3
- package/dist/src/symbols/ChevronDown.d.ts +2 -4
- package/dist/src/symbols/CrossCircled.d.ts +2 -4
- package/dist/src/symbols/ExclamationTriangle.d.ts +2 -3
- package/dist/src/symbols/EyeClosed.d.ts +2 -3
- package/dist/src/symbols/EyeOpened.d.ts +2 -3
- package/dist/src/symbols/InfoCircled.d.ts +2 -4
- package/dist/src/symbols/QuestionMarkCircled.d.ts +2 -4
- package/dist/src/symbols/X.d.ts +2 -4
- package/dist/src/symbols/index.d.ts +5 -0
- package/dist/symbols.cjs.js +1 -1
- package/dist/symbols.esm.js +2 -2
- package/dist/useToast-CEKvEJVB.js.map +1 -1
- package/dist/useToast-CraVIawn.cjs.map +1 -1
- package/package.json +2 -2
- package/dist/QuestionMarkCircled-B6xdNcJl.js +0 -76
- package/dist/QuestionMarkCircled-B6xdNcJl.js.map +0 -1
- package/dist/QuestionMarkCircled-Dh6Bl18_.cjs +0 -2
- package/dist/QuestionMarkCircled-Dh6Bl18_.cjs.map +0 -1
- package/dist/Toast-Bn0CCsLY.js.map +0 -1
- package/dist/Toast-uzg_Sy4r.cjs.map +0 -1
- package/dist/X-JuXyHwMp.cjs +0 -2
- package/dist/X-JuXyHwMp.cjs.map +0 -1
- package/dist/X-aXWqJhiz.js +0 -52
- package/dist/X-aXWqJhiz.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";const e=require("react/jsx-runtime"),d=require("react"),A=require("react-dom"),g=require("./X-
|
|
2
|
-
//# sourceMappingURL=Toast-
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),d=require("react"),A=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"}){return e.jsx("svg",{width:t,height:t,className:"inline",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 y(...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"},H={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},p={variant:"primary",size:"md",rounded:"md"};function K({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 f=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],H[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:f,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 F({id:t,isOpen:l,onClose:n,title:r,children:i,contentOnly:s=!1,className:a,overlayClassName:c,hideCloseButton:o=!1,actions:u=[],disableCloseOnOverlayClick:f=!1,ariaLabelledBy:m,ariaDescribedBy:b}){const x=d.useId(),j=t||`modal-${x}`,w=t?`${t}-title`:`modal-title-${x}`,{show:N,shouldRender:v}=P(l);if(X(j,v),V(v,n),!v)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:S,...q}=L;return e.jsx(K,{className:S,type:"button",...q,"data-modal-action":"true",children:T},z)})});return e.jsx(e.Fragment,{children:A.createPortal(e.jsx("div",{"aria-labelledby":m??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:y("fixed inset-0 bg-black/20 transition-all",c),onClick:()=>{f||n()}}),s&&e.jsx("div",{className:y("relative w-fit",a),children:i}),!s&&e.jsxs("div",{id:j,tabIndex:-1,className:y("relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",N?"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]),f=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(F,{...o,title:c||u.defaultTitle,onClose:s,actions:f,disableCloseOnOverlayClick:t==="confirm",hideCloseButton:t==="confirm",children:typeof l=="string"?e.jsx("p",{className:"text-sm",children:l}):l})}const k={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 Z({id:t,title:l,description:n,type:r="info",action:i,duration:s=5e3,onRemove:a,customTypes:c,customComponent:o}){const[u,f]=d.useState(!1),m=d.useCallback(()=>{f(!0),setTimeout(()=>{a==null||a(t)},150)},[t,a]);if(d.useEffect(()=>{if(s>0){const x=setTimeout(()=>{m()},s);return()=>clearTimeout(x)}},[s,t,a,m]),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])||k[r]||k.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:m,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=Z;exports.n=h;
|
|
2
|
+
//# sourceMappingURL=Toast-FzI16Fnl.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toast-FzI16Fnl.cjs","sources":["utils.esm.js","X-aXWqJhiz.js","Toast-Bn0CCsLY.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 i({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", 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}\nfunction r({ size: C = 15 }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", 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: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }\n ) });\n}\nfunction t({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", 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}\nfunction o({ size: C = 15, color: l = \"currentColor\" }) {\n return /* @__PURE__ */ e(\"svg\", { width: C, height: C, className: \"inline\", viewBox: \"0 0 15 15\", xmlns: \"http://www.w3.org/2000/svg\", 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}\nexport {\n i as C,\n r as E,\n t as I,\n o as X\n};\n//# sourceMappingURL=X-aXWqJhiz.js.map\n","import { jsx as r, Fragment as M, jsxs as f } from \"react/jsx-runtime\";\nimport q, { createContext as $, useId as H, useState as p, useEffect as b, useRef as K, useCallback as E, useMemo as C } from \"react\";\nimport { createPortal as P } from \"react-dom\";\nimport { X as D, C as F, E as V, I as X } from \"./X-aXWqJhiz.js\";\nimport { join as Z } from \"./utils.esm.js\";\nfunction w(...e) {\n return e.filter((l) => typeof l == \"string\" && l).join(\" \").trim() || void 0;\n}\nfunction G({ 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}\n$(void 0);\nfunction J() {\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 Q = {\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}, R = {\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}, U = {\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 W({\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 Q[e],\n R[c],\n U[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(J, {}),\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 Y(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 = K(null), t = E(() => {\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 = H(), N = e || `modal-${h}`, k = e ? `${e}-title` : `modal-title-${h}`, { show: z, shouldRender: v } = Y(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(W, { className: O, type: \"button\", ...S, \"data-modal-action\": \"true\", children: B }, I);\n }) });\n return /* @__PURE__ */ r(M, { children: P(\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(G, { 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 L = {\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(X, { 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(V, { 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 = E(() => {\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]) || L[t] || L.info;\n return /* @__PURE__ */ f(\n \"div\",\n {\n role: t === \"error\" ? \"alert\" : \"status\",\n \"aria-live\": t === \"error\" ? void 0 : \"polite\",\n className: Z(\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-Bn0CCsLY.js.map\n","import { jsxs as N, jsx as c, Fragment as X } from \"react/jsx-runtime\";\nimport T, { useId as $, useState as x, createElement as Z, useEffect as C, useCallback as A, useMemo as J, useRef as B, isValidElement as O, cloneElement as P } from \"react\";\nimport { join as w } from \"./utils.esm.js\";\nimport { b as ee, C as te, a as re, c as oe, E as ne, Q as ae } from \"./QuestionMarkCircled-B6xdNcJl.js\";\nimport { n as q } from \"./Toast-Bn0CCsLY.js\";\nimport { A as Xe, T as Ze } from \"./Toast-Bn0CCsLY.js\";\nimport { E as se, X as ie } from \"./X-aXWqJhiz.js\";\nimport { createPortal as Y } from \"react-dom\";\nfunction V({\n id: n,\n title: a,\n content: e,\n children: o,\n className: t = \"\",\n disabled: r = !1,\n isOpen: s = !1,\n onToggle: l,\n triggerClassName: d = \"\",\n bodyClassName: u = \"\"\n}) {\n const f = $(), i = n || `accordion-item-${f}`, g = `${i}-header`, b = `${i}-panel`, m = () => {\n !r && l && l();\n }, v = (h) => {\n (h.key === \"Enter\" || h.key === \" \") && (h.preventDefault(), m());\n };\n return /* @__PURE__ */ N(\"div\", { className: w(\"border-b border-gray-200\", r && \"opacity-60 cursor-not-allowed\", t), children: [\n /* @__PURE__ */ N(\n \"button\",\n {\n id: g,\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 d\n ),\n \"aria-expanded\": s,\n \"aria-controls\": b,\n disabled: r,\n onClick: m,\n onKeyDown: v,\n children: [\n /* @__PURE__ */ c(\"span\", { children: a }),\n /* @__PURE__ */ c(\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__ */ c(ee, { size: 18 })\n }\n )\n ]\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: b,\n role: \"region\",\n \"aria-labelledby\": g,\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 u\n ),\n children: s && (o || e)\n }\n )\n ] });\n}\nfunction je({\n id: n,\n items: a = [],\n children: e,\n className: o = \"\",\n itemClassName: t = \"\",\n allowMultiple: r = !1,\n defaultOpenItems: s = [],\n triggersClassName: l = \"\",\n bodiesClassName: d = \"\"\n}) {\n const u = $(), f = n || `accordion-group-${u}`, [i, g] = x(new Set(s)), b = (h) => {\n g((y) => {\n const p = new Set(y);\n return p.has(h) ? p.delete(h) : (r || p.clear(), p.add(h)), p;\n });\n }, m = (h) => `${u}-item-${h}`, v = (h) => i.has(h);\n return /* @__PURE__ */ N(\"div\", { id: f, className: o, children: [\n a.length > 0 && a.map((h, y) => {\n const p = h.id || m(y);\n return /* @__PURE__ */ c(\n V,\n {\n id: p,\n title: h.title,\n content: h.content,\n disabled: h.disabled,\n isOpen: v(p),\n onToggle: () => b(p),\n className: t,\n triggerClassName: l,\n bodyClassName: d\n },\n p\n );\n }),\n a.length === 0 && e && T.Children.map(e, (h, y) => {\n if (T.isValidElement(h) && h.type === V) {\n const p = h.props.id || m(y);\n return /* @__PURE__ */ Z(\n V,\n {\n ...h.props,\n key: p,\n id: p,\n className: w(t, h.props.className),\n isOpen: v(p),\n onToggle: () => b(p),\n triggerClassName: w(l, h.props.triggerClassName),\n bodyClassName: w(d, h.props.bodyClassName)\n }\n );\n }\n return null;\n })\n ] });\n}\nfunction le() {\n const [n, a] = x(0);\n return C(() => {\n const e = setInterval(() => {\n a((o) => (o + 1) % 3);\n }, 500);\n return () => clearInterval(e);\n }, []), /* @__PURE__ */ c(\"div\", { className: \"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle\", children: [0, 1, 2].map((e) => /* @__PURE__ */ c(\n \"div\",\n {\n className: w(\n \"rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current\",\n n === e && \"transform -translate-y-1\"\n )\n },\n e\n )) });\n}\nconst de = {\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}, ue = {\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}, ce = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"rounded-full\"\n}, K = {\n variant: \"primary\",\n size: \"md\",\n rounded: \"md\"\n};\nfunction fe({\n variant: n = K.variant,\n size: a,\n rounded: e = K.rounded,\n loading: o,\n linkTo: t,\n linkProps: r,\n type: s = \"button\",\n className: l,\n ...d\n}) {\n let u;\n n === \"link\" && !a ? u = \"fitted\" : u = a || K.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 de[n],\n ue[u],\n ce[e],\n o && \"relative pointer-events-none\",\n t && \"relative\",\n l\n );\n return /* @__PURE__ */ N(\n \"button\",\n {\n ...d,\n role: t ? \"link\" : d.role,\n \"aria-label\": d[\"aria-label\"] || (r == null ? void 0 : r[\"aria-label\"]),\n \"aria-description\": d[\"aria-description\"] || (r == null ? void 0 : r[\"aria-description\"]),\n \"aria-disabled\": d.disabled || o,\n \"aria-busy\": o,\n type: s,\n className: i,\n children: [\n o && /* @__PURE__ */ c(le, {}),\n /* @__PURE__ */ c(\"span\", { className: w(o && \"invisible\"), children: d.children }),\n t && !d.disabled && /* @__PURE__ */ c(\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 me(n) {\n const [a, e] = x(\"\"), o = A((t) => {\n let r = t, s = \"\";\n for (; r && !s; ) {\n const l = window.getComputedStyle(r).backgroundColor;\n l && l !== \"transparent\" && l !== \"rgba(0, 0, 0, 0)\" && (s = l), r = r.parentElement;\n }\n return s || \"transparent\";\n }, []);\n return C(() => {\n const t = document.getElementById(n);\n if (t) {\n const r = o(t.parentElement);\n e(r);\n }\n }, [n, o]), a;\n}\nfunction Fe({\n ref: n,\n id: a,\n size: e = 20,\n color: o,\n filled: t = !1,\n rounded: r = !0,\n checked: s = !1,\n onCheckedChange: l,\n disabled: d,\n className: u = \"\",\n ...f\n}) {\n const i = $(), g = J(() => a || `checkbox-${i}`, [a, i]), b = me(g), [m, v] = x(s);\n C(() => {\n v(s);\n }, [s]);\n const h = () => {\n d || (v(!m), l == null || l(!m));\n }, y = (E) => {\n E.key === \" \" && (E.preventDefault(), h());\n }, p = w(\n \"flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2\",\n r && \"rounded\",\n d && \"opacity-40 cursor-not-allowed\",\n !d && \"cursor-pointer\",\n u\n );\n return /* @__PURE__ */ c(\n \"button\",\n {\n id: g,\n type: \"button\",\n ref: n,\n tabIndex: 0,\n role: \"checkbox\",\n onClick: h,\n \"aria-checked\": m,\n \"aria-disabled\": d,\n onKeyDownCapture: y,\n style: {\n width: e,\n height: e,\n color: o,\n backgroundColor: m && t ? \"currentcolor\" : \"transparent\"\n },\n className: p,\n ...f,\n children: m && /* @__PURE__ */ c(te, { size: e, color: t ? b : void 0 })\n }\n );\n}\nfunction Se({\n children: n,\n className: a,\n linkTo: e,\n linkProps: o,\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__ */ N(\"div\", { className: w(\"relative w-fit\", a), ...s, children: [\n n,\n e && /* @__PURE__ */ c(\n \"a\",\n {\n ...o,\n rel: (o == null ? void 0 : o.rel) || \"noreferrer\",\n href: e,\n className: w(\"absolute inset-0\", o == null ? void 0 : o.className)\n }\n ),\n !e && t && /* @__PURE__ */ c(\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 j({ elementId: n, type: a, message: e }) {\n return C(() => {\n const o = document.getElementById(n);\n if (o) {\n if (!e && a === \"error\") {\n o.removeAttribute(\"data-error\");\n return;\n }\n if (!e && a === \"success\") {\n o.removeAttribute(\"data-success\");\n return;\n }\n return o.setAttribute(\"aria-describedby\", `${n}-${a}-message`), o.setAttribute(\"aria-invalid\", a === \"error\" ? \"true\" : \"false\"), a === \"error\" && o.setAttribute(\"data-error\", \"true\"), a === \"success\" && o.setAttribute(\"data-success\", \"true\"), () => {\n o.removeAttribute(\"aria-describedby\"), o.removeAttribute(\"aria-invalid\"), o.removeAttribute(\"data-error\"), o.removeAttribute(\"data-success\");\n };\n }\n }, [n, a, e]), e ? /* @__PURE__ */ N(\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__ */ c(se, {}) : /* @__PURE__ */ c(re, {}),\n /* @__PURE__ */ c(\"span\", { id: `${n}-${a}-message`, children: e })\n ]\n }\n ) : null;\n}\nconst be = {\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}, he = {\n none: \"rounded-none\",\n sm: \"rounded-sm\",\n md: \"rounded-md\",\n lg: \"rounded-lg\",\n full: \"px-3 rounded-full\"\n}, _ = {\n variant: \"default\",\n rounded: \"none\"\n};\nfunction He({\n variant: n = _.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: o,\n successMessage: t,\n type: r = \"text\",\n className: s,\n ...l\n}) {\n const d = $(), [u, f] = x(!1);\n let i = a;\n n === \"outline\" && !a && (i = \"md\"), i = i || _.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 && be[n],\n !e && he[i],\n r === \"password\" && \"pr-10\",\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n s\n );\n return /* @__PURE__ */ N(\"div\", { className: w(e && \"cursor-text\"), style: { height: l.height, width: l.width }, children: [\n /* @__PURE__ */ N(\"div\", { className: w(r === \"password\" && \"relative\"), children: [\n /* @__PURE__ */ c(\n \"input\",\n {\n ...l,\n id: d,\n type: r === \"password\" && u ? \"text\" : r,\n \"aria-disabled\": l.disabled,\n readOnly: e,\n \"aria-readonly\": e || l[\"aria-readonly\"],\n \"data-error\": o ? !0 : void 0,\n \"data-success\": t ? !0 : void 0,\n className: m\n }\n ),\n r === \"password\" && /* @__PURE__ */ c(\n \"button\",\n {\n onClick: () => f(!u),\n className: \"absolute inset-y-0 right-0 px-2 hover:cursor-pointer\",\n \"aria-label\": \"Toggle password visibility\",\n \"data-state\": u ? \"visible\" : \"hidden\",\n children: u ? /* @__PURE__ */ c(oe, { size: 20 }) : /* @__PURE__ */ c(ne, { size: 20 })\n }\n )\n ] }),\n !e && /* @__PURE__ */ c(j, { elementId: d, type: \"error\", message: o }),\n !e && /* @__PURE__ */ c(j, { elementId: d, type: \"success\", message: t })\n ] });\n}\nfunction qe({\n display: n = \"inline\",\n width: a = \"fit-content\",\n className: e = \"\",\n required: o,\n helpMessage: t,\n suffix: r,\n htmlFor: s,\n children: l,\n ...d\n}) {\n const u = $(), f = w(\"font-medium\", n, e), i = t ? `${s ?? u}-help` : void 0;\n return /* @__PURE__ */ N(\"div\", { style: { display: n === \"inline\" ? \"inline-flex\" : \"flex\", width: a }, className: \"relative\", children: [\n /* @__PURE__ */ N(\"label\", { className: f, htmlFor: s, ...d, children: [\n l,\n o && /* @__PURE__ */ c(\"span\", { className: \"text-red-500 font-medium ml-1\", \"aria-label\": \"required\", children: \"*\" })\n ] }),\n t && /* @__PURE__ */ c(\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__ */ c(ae, {})\n }\n ),\n t && /* @__PURE__ */ c(\"div\", { id: i, className: \"sr-only\", children: t }),\n r && /* @__PURE__ */ c(\"span\", { className: \"ml-1\", children: r })\n ] });\n}\nfunction pe(n) {\n const [a, e] = x(!1), [o, t] = x(!1);\n return C(() => {\n n ? (t(!0), setTimeout(() => e(!0), 10)) : (e(!1), setTimeout(() => t(!1), 150));\n }, [n]), { show: a, shouldRender: o };\n}\nfunction ge(n, a) {\n C(() => {\n const e = (o) => {\n o.key === \"Escape\" && n && a();\n };\n return document.addEventListener(\"keydown\", e), n && (document.body.style.overflow = \"hidden\"), () => {\n document.removeEventListener(\"keydown\", e), document.body.style.overflow = \"auto\";\n };\n }, [n, a]);\n}\nfunction ve(n, a) {\n const e = B(null), o = A(() => {\n const t = document.getElementById(n);\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 l = Array.from(s).filter((d) => !(d instanceof HTMLButtonElement && d.getAttribute(\"data-modal-close-button\") === \"true\"));\n if (l.length > 0) {\n l[0].focus();\n return;\n }\n s[0].focus();\n return;\n }\n t.focus();\n }, [n]);\n C(() => (a && (e.current = document.activeElement, o()), () => {\n document.body.style.overflow = \"auto\", e.current instanceof HTMLElement && e.current.focus();\n }), [a, o]);\n}\nfunction Ve({\n id: n,\n isOpen: a,\n onClose: e,\n title: o,\n children: t,\n contentOnly: r = !1,\n className: s,\n overlayClassName: l,\n hideCloseButton: d = !1,\n actions: u = [],\n disableCloseOnOverlayClick: f = !1,\n ariaLabelledBy: i,\n ariaDescribedBy: g\n}) {\n const b = $(), m = n || `modal-${b}`, v = n ? `${n}-title` : `modal-title-${b}`, { show: h, shouldRender: y } = pe(a);\n if (ve(m, y), ge(y, e), !y) return null;\n const p = () => o ? T.isValidElement(o) ? /* @__PURE__ */ c(\"div\", { className: \"mb-4\", children: o }) : /* @__PURE__ */ c(\"h2\", { className: \"mb-4 text-xl font-semibold\", id: v, children: o }) : null, E = () => u.length === 0 ? null : /* @__PURE__ */ c(\"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((D, F) => {\n const { label: S, className: L, ...R } = D;\n return /* @__PURE__ */ c(fe, { className: L, type: \"button\", ...R, \"data-modal-action\": \"true\", children: S }, F);\n }) });\n return /* @__PURE__ */ c(X, { children: Y(\n /* @__PURE__ */ c(\n \"div\",\n {\n \"aria-labelledby\": i ?? o ? v : 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__ */ N(\"div\", { className: \"flex min-h-screen items-center justify-center p-4\", children: [\n /* @__PURE__ */ c(\n \"div\",\n {\n className: q(\"fixed inset-0 bg-black/20 transition-all\", l),\n onClick: () => {\n f || e();\n }\n }\n ),\n r && /* @__PURE__ */ c(\"div\", { className: q(\"relative w-fit\", s), children: t }),\n !r && /* @__PURE__ */ N(\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 !d && /* @__PURE__ */ c(\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__ */ c(ie, { size: 18 })\n }\n ),\n p(),\n t,\n E()\n ]\n }\n )\n ] })\n }\n ),\n document.body\n ) });\n}\nfunction we({ itemId: n, checked: a, onChange: e, name: o, disabled: t = !1, className: r = \"\" }) {\n const s = \"relative inline-flex items-center justify-center rounded-full\", l = () => {\n t || e();\n }, d = 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__ */ c(\n \"div\",\n {\n id: n,\n role: \"radio\",\n tabIndex: -1,\n \"aria-checked\": a,\n \"aria-disabled\": t,\n \"aria-description\": `Radio button for ${o}`,\n \"aria-labelledby\": `${n}-label`,\n onClick: l,\n className: d,\n style: {\n width: \"1em\",\n height: \"1em\",\n padding: \"0.1em\",\n borderWidth: \"0.06em\"\n },\n children: a && /* @__PURE__ */ c(\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: n,\n children: a,\n className: e = \"\",\n isSelected: o = !1,\n onChange: t,\n disabled: r = !1,\n hideInput: s = !1,\n description: l,\n name: d\n}) {\n const f = `radio-${$()}-${n}`, i = () => {\n r || t == null || t(n);\n };\n return /* @__PURE__ */ N(\n \"div\",\n {\n title: l,\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 && !o && `border-transparent ${r ? \"\" : \"not-focus-within:hover:border-border/60\"}`,\n s && o && \"border-border\",\n r && \"opacity-60 cursor-not-allowed\"\n ),\n style: {\n gap: \"0.5em\"\n },\n children: [\n !s && /* @__PURE__ */ c(\n we,\n {\n itemId: f,\n name: d || \"\",\n checked: o,\n onChange: i,\n disabled: r,\n className: w(s && \"\")\n }\n ),\n /* @__PURE__ */ c(\n \"div\",\n {\n id: s ? f : void 0,\n tabIndex: s ? -1 : void 0,\n role: s ? \"radio\" : void 0,\n onClick: s ? i : void 0,\n \"aria-checked\": s ? o ? \"true\" : \"false\" : void 0,\n \"aria-disabled\": s ? r : void 0,\n \"aria-description\": s ? l || `Radio button for ${d}` : void 0,\n \"aria-labelledby\": s ? `${f}-label` : void 0,\n className: w(s && \"size-full\", typeof a == \"object\" && \"grow focus:outline-none\"),\n children: /* @__PURE__ */ c(\n \"label\",\n {\n id: `${f}-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 ye(n, a) {\n const [e, o] = x(a), [t, r] = x(-1), [s, l] = x(!1), d = A((b, m) => {\n var y;\n const v = b[m];\n v.hasAttribute(\"disabled\") || v.getAttribute(\"aria-disabled\") === \"true\" || ((y = b[m]) == null || y.click(), r(m));\n }, []), u = A(\n (b, m) => {\n var h;\n if (b.preventDefault(), s || !m.length) return;\n const v = a !== -1 ? a : 0;\n (h = m[v]) == null || h.focus(), o(v), a !== -1 && d(m, v);\n },\n [a, s, d]\n ), f = A(\n (b) => {\n var y;\n if (!b.shiftKey)\n return;\n b.preventDefault();\n const m = Array.from(\n document.querySelectorAll(\n 'a, button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"])'\n )\n ).filter((p) => !p.hasAttribute(\"disabled\") && p.tabIndex >= 0), v = m.findIndex((p) => p.id === n), h = v > 0 ? v - 1 : m.length - 1;\n (y = m[h]) == null || y.focus();\n },\n [n]\n ), i = A(\n (b, m) => {\n var E;\n if (!m.length) return;\n const v = b.target;\n if (!m.some((D) => D.id === v.id)) return;\n const y = e !== -1 ? e : 0;\n let p = y;\n switch (b.key) {\n case \"ArrowUp\":\n case \"ArrowLeft\":\n b.preventDefault(), p = y > 0 ? y - 1 : m.length - 1;\n break;\n case \"ArrowDown\":\n case \"ArrowRight\":\n b.preventDefault(), p = (y + 1) % m.length;\n break;\n // Select the option when the space key is pressed\n case \" \":\n b.preventDefault(), d(m, y);\n return;\n case \"Tab\":\n f(b);\n return;\n default:\n return;\n }\n (E = m[p]) == null || E.focus(), o(p), t !== -1 && d(m, p);\n },\n [e, t, f, d]\n ), g = A(() => {\n const b = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n return b ? Array.from(b.querySelectorAll('[role=\"radio\"]')) : [];\n }, [n]);\n C(() => {\n const b = document.querySelector(`[id=\"${n}\"][role=\"radiogroup\"]`);\n if (!b) return;\n const m = g(), v = (E) => u(E, m), h = (E) => i(E, m), y = () => l(!0), p = () => l(!1);\n return document.addEventListener(\"keydown\", h), b.addEventListener(\"focus\", v), b.addEventListener(\"mousedown\", y), document.addEventListener(\"mouseup\", p), () => {\n document.removeEventListener(\"keydown\", h), b.removeEventListener(\"focus\", v), b.removeEventListener(\"mousedown\", y), document.removeEventListener(\"mouseup\", p);\n };\n }, [n, g, u, i]);\n}\nfunction Ke({\n options: n = [],\n value: a,\n onChange: e,\n id: o,\n children: t,\n className: r = \"\",\n childrenClassName: s = \"\",\n hideInputs: l = !1\n}) {\n const d = $(), u = o || `radio-group-${d}`;\n ye(\n u,\n n.findIndex((i) => i === a)\n );\n const f = J(() => n.reduce((i, g) => (typeof g == \"string\" ? i.some((b) => b.value === g) || i.push({ label: g, value: g }) : i.push(g), i), []), [n]);\n return /* @__PURE__ */ N(\"div\", { id: u, role: \"radiogroup\", tabIndex: 0, className: w(r, \"focus:outline-none\"), children: [\n f.length > 0 && f.map((i, g) => /* @__PURE__ */ c(\n G,\n {\n value: i.value,\n isSelected: a === i.value,\n onChange: e,\n name: u,\n disabled: i.disabled,\n description: i.description,\n hideInput: l,\n className: s,\n children: i.label\n },\n `${i.value}-${g}`\n )),\n f.length === 0 && t && T.Children.map(t, (i) => T.isValidElement(i) && i.type === G ? /* @__PURE__ */ c(\n G,\n {\n ...i.props,\n className: w(s, i.props.className),\n hideInput: i.props.hideInput || l,\n isSelected: a === i.props.value,\n onChange: e,\n name: u,\n children: i.props.children\n }\n ) : null)\n ] });\n}\nfunction Ge({ children: n, ref: a, ...e }) {\n if (O(n)) {\n let o = { ...e };\n return n.props && (o = { ...o, ...n.props }), P(n, {\n ...o,\n ref: (t) => {\n typeof a == \"function\" ? a(t) : a && (a.current = t);\n }\n });\n }\n return Z(\"div\", { ...e, ref: a }, n);\n}\nfunction xe({ elementId: n, maxLength: a }) {\n const [e, o] = x(0);\n return C(() => {\n const t = document.getElementById(n);\n if (!t)\n return;\n const r = () => {\n const s = t.value.length;\n o(s);\n const l = s >= a;\n t.setAttribute(\"aria-describedby\", `${n}-character-count`), t.setAttribute(\"aria-invalid\", l ? \"true\" : \"false\"), l ? 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 }, [n, a]), /* @__PURE__ */ c(\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__ */ N(\"span\", { id: `${n}-character-count`, children: [\n e,\n \" / \",\n a,\n \" characters\"\n ] })\n }\n );\n}\nfunction Ne(n, a) {\n C(() => {\n const e = document.getElementById(n);\n if (!e)\n return;\n if (!a) {\n e.style.height = \"auto\";\n return;\n }\n const o = () => {\n e.style.height = \"auto\", e.style.height = `${e.scrollHeight}px`;\n };\n return o(), e.addEventListener(\"input\", o), e.addEventListener(\"resize\", o), window.addEventListener(\"resize\", o), () => {\n e.removeEventListener(\"input\", o), e.removeEventListener(\"resize\", o), window.removeEventListener(\"resize\", o);\n };\n }, [n, a]);\n}\nconst Ee = {\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}, Ce = {\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: \"outline\",\n rounded: \"none\"\n};\nfunction We({\n variant: n = Q.variant,\n rounded: a,\n displayOnlyMode: e = !1,\n errorMessage: o,\n successMessage: t,\n hideResizeHandle: r = !1,\n autoExpand: s = !1,\n characterLimit: l = 0,\n className: d,\n ...u\n}) {\n const f = $();\n Ne(f, s || e);\n let i = a;\n n === \"outline\" && !a && (i = \"md\"), i = i || Q.rounded;\n let g = r;\n (e || n === \"left-line\" && !r) && (g = !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 && Ee[n],\n !e && Ce[i],\n !e && \"px-2 py-1\",\n e && \"pointer-events-none\",\n g && \"no-resize-handle\",\n d\n );\n return /* @__PURE__ */ N(\"div\", { className: w(\"-space-y-1.5\", e && \"cursor-text\"), children: [\n /* @__PURE__ */ c(\n \"textarea\",\n {\n ...u,\n id: f,\n \"aria-disabled\": u.disabled,\n readOnly: e,\n \"aria-readonly\": e || u[\"aria-readonly\"],\n style: {\n resize: s ? \"none\" : void 0\n },\n className: m\n }\n ),\n l > 0 && /* @__PURE__ */ c(xe, { elementId: f, maxLength: l }),\n !e && /* @__PURE__ */ c(j, { elementId: f, type: \"error\", message: o }),\n !e && /* @__PURE__ */ c(j, { elementId: f, type: \"success\", message: t })\n ] });\n}\nconst k = 8, z = 4, I = 6;\nfunction Ae(n) {\n return { calculatePosition: A(\n (e, o) => {\n const t = e.getBoundingClientRect(), r = o.getBoundingClientRect(), s = {\n width: window.innerWidth,\n height: window.innerHeight\n }, l = (g, b, m, v) => g < 0 || b < 0 || g + m > s.width || b + v > s.height, d = {\n top: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.top - r.height - z,\n arrow: {\n x: r.width / 2 - I,\n y: r.height\n }\n },\n bottom: {\n x: t.left + t.width / 2 - r.width / 2,\n y: t.bottom + z,\n arrow: {\n x: r.width / 2 - I,\n y: -6\n }\n },\n left: {\n x: t.left - r.width - z,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: r.width,\n y: r.height / 2 - I\n }\n },\n right: {\n x: t.right + z,\n y: t.top + t.height / 2 - r.height / 2,\n arrow: {\n x: -6,\n y: r.height / 2 - I\n }\n }\n };\n let u = n, f = d[n];\n if (l(f.x, f.y, r.width, r.height)) {\n const g = {\n top: \"bottom\",\n bottom: \"top\",\n left: \"right\",\n right: \"left\"\n }, b = d[g[n]];\n if (!l(b.x, b.y, r.width, r.height))\n u = g[n], f = b;\n else {\n const m = [\"top\", \"bottom\", \"left\", \"right\"].filter(\n (v) => v !== n && v !== g[n]\n );\n for (const v of m) {\n const h = d[v];\n if (!l(h.x, h.y, r.width, r.height)) {\n u = v, f = h;\n break;\n }\n }\n }\n }\n f.x = Math.max(\n k,\n Math.min(f.x, s.width - r.width - k)\n ), f.y = Math.max(\n k,\n Math.min(f.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 u === \"top\" || u === \"bottom\" ? f.arrow.x = Math.max(\n I,\n Math.min(i.x - f.x - I, r.width - I * 2)\n ) : f.arrow.y = Math.max(\n I,\n Math.min(i.y - f.y - I, r.height - I * 2)\n ), {\n ...f,\n placement: u\n };\n },\n [n]\n ) };\n}\nfunction Ie(n, a, e) {\n const o = B(null), t = B(null), r = A(() => {\n if (!o.current || !t.current) return;\n const s = n(o.current, t.current);\n e(s);\n }, [n, 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: o,\n tooltipRef: t,\n updatePosition: r\n };\n}\nfunction $e(n, a, e, o, t, r, s, l, d) {\n const u = B(null), f = A(() => {\n n || (u.current && clearTimeout(u.current), u.current = window.setTimeout(() => {\n e(!0), requestAnimationFrame(() => {\n t(), o(!0);\n });\n }, a));\n }, [n, a, e, t, o]), i = A(\n (g = !1) => {\n if (u.current && clearTimeout(u.current), g) {\n o(!1), setTimeout(() => e(!1), 150);\n return;\n }\n u.current = window.setTimeout(() => {\n o(!1), setTimeout(() => e(!1), 150);\n }, 100);\n },\n [o, e]\n );\n return C(() => {\n !r && !s && !l && d && i();\n }, [r, s, l, d, i]), C(() => () => {\n u.current && clearTimeout(u.current);\n }, []), {\n showTooltip: f,\n hideTooltip: i,\n timeoutRef: u\n };\n}\nfunction Ue({\n id: n,\n children: a,\n message: e,\n placement: o = \"top\",\n disabled: t = !1,\n delay: r = 200,\n className: s\n}) {\n const [l, d] = x(!1), [u, f] = x(!1), [i, g] = x(null), [b, m] = x(!1), [v, h] = x(!1), [y, p] = x(!1), { calculatePosition: E } = Ae(o), { triggerRef: D, tooltipRef: F, updatePosition: S } = Ie(E, u, g), { showTooltip: L, hideTooltip: R, timeoutRef: W } = $e(\n t,\n r,\n f,\n d,\n S,\n b,\n v,\n y,\n l\n ), M = $(), U = n ?? M;\n return /* @__PURE__ */ N(X, { children: [\n T.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 p(!0), L();\n },\n onBlur: () => {\n p(!1), R(!0);\n },\n onKeyDown: (H) => {\n H.key === \"Escape\" && R(!0);\n },\n \"aria-describedby\": t ? void 0 : U\n }),\n u && Y(\n /* @__PURE__ */ c(\n \"div\",\n {\n ref: F,\n id: U,\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 l ? \"opacity-100\" : \"opacity-0\",\n s\n ),\n style: i ? { left: i.x, top: i.y } : { opacity: 0 },\n onMouseEnter: () => {\n h(!0), W.current && clearTimeout(W.current);\n },\n onMouseLeave: () => {\n h(!1);\n },\n children: e\n }\n ),\n document.body\n )\n ] });\n}\nexport {\n je as Accordion,\n V as AccordionItem,\n Xe as ActionModal,\n fe as Button,\n le as ButtonLoadingDots,\n Fe as Checkbox,\n Se as Clickable,\n He as Input,\n qe as Label,\n Ve as Modal,\n Ke as RadioGroup,\n G as RadioGroupItem,\n we as RadioInput,\n Ge as Slot,\n We as Textarea,\n Ze as Toast,\n Ue 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","o","C","e","w","$","le","a","x","c","de","ue","ce","K","fe","t","r","l","d","i","N","pe","ge","ve","B","A","Ve","g","b","m","v","h","y","p","T","D","F","S","L","R","X","Y","q","ie","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"],"mappings":"sJAAA,SAASA,KAAK,EAAG,CACf,OAAO,EAAE,OAAQC,GAAM,OAAOA,GAAK,UAAYA,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CCgCA,SAASC,EAAE,CAAE,KAAMC,EAAI,GAAI,MAAO,EAAI,gBAAkB,CACtD,OAAuBC,EAAAA,IAAE,MAAO,CAAE,MAAOD,EAAG,OAAQA,EAAG,UAAW,SAAU,QAAS,YAAa,MAAO,6BAA8B,SAA0BC,EAAC,IAChK,OACA,CACE,EAAG,0gBACH,KAAM,EACN,SAAU,UACV,SAAU,SAChB,CACA,EAAK,CACL,CCvCA,SAASC,KAAKD,EAAG,CACf,OAAOA,EAAE,OAAQ,GAAM,OAAO,GAAK,UAAY,CAAC,EAAE,KAAK,GAAG,EAAE,KAAM,GAAI,MACxE,CAeAE,EAAC,cAAC,MAAM,EC4GR,SAAS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BACb,SAAA,CAACtB,EAAA,IAAA,MAAA,CAAI,UAAU,gCAAiC,SAAML,EAAA,EACrDa,GAAeR,EAAA,IAAC,MAAI,CAAA,UAAU,oCAAqC,SAAYQ,EAAA,EAC/EC,GACCT,EAAA,IAAC,MAAI,CAAA,UAAU,SACb,SAAAA,EAAA,IAAC,SAAA,CACC,QAASS,EAAO,QAChB,UAAU,+IAET,SAAOA,EAAA,KAAA,CAAA,CAEZ,CAAA,CAAA,EAEJ,EAGAT,EAAA,IAAC,SAAA,CACC,QAASiB,EACT,UAAU,0IAEV,SAAAjB,EAAAA,IAACjB,EAAAA,EAAE,CAAA,KAAM,EAAI,CAAA,CAAA,CAAA,CACf,CAAA,CACF,CAEJ"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function t({
|
|
3
|
+
size: C = 15,
|
|
4
|
+
color: l = "currentColor",
|
|
5
|
+
className: n = "inline",
|
|
6
|
+
...i
|
|
7
|
+
}) {
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
|
+
"svg",
|
|
10
|
+
{
|
|
11
|
+
...i,
|
|
12
|
+
width: C,
|
|
13
|
+
height: C,
|
|
14
|
+
className: n,
|
|
15
|
+
viewBox: "0 0 15 15",
|
|
16
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17
|
+
children: /* @__PURE__ */ e(
|
|
18
|
+
"path",
|
|
19
|
+
{
|
|
20
|
+
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",
|
|
21
|
+
fill: l,
|
|
22
|
+
fillRule: "evenodd",
|
|
23
|
+
clipRule: "evenodd"
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function o({
|
|
30
|
+
size: C = 15,
|
|
31
|
+
color: l = "currentColor",
|
|
32
|
+
className: n = "inline",
|
|
33
|
+
...i
|
|
34
|
+
}) {
|
|
35
|
+
return /* @__PURE__ */ e(
|
|
36
|
+
"svg",
|
|
37
|
+
{
|
|
38
|
+
...i,
|
|
39
|
+
width: C,
|
|
40
|
+
height: C,
|
|
41
|
+
className: n,
|
|
42
|
+
viewBox: "0 0 15 15",
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
+
children: /* @__PURE__ */ e(
|
|
45
|
+
"path",
|
|
46
|
+
{
|
|
47
|
+
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",
|
|
48
|
+
fill: l,
|
|
49
|
+
fillRule: "evenodd",
|
|
50
|
+
clipRule: "evenodd"
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
function d({
|
|
57
|
+
size: C = 15,
|
|
58
|
+
color: l = "currentColor",
|
|
59
|
+
className: n = "inline",
|
|
60
|
+
...i
|
|
61
|
+
}) {
|
|
62
|
+
return /* @__PURE__ */ e(
|
|
63
|
+
"svg",
|
|
64
|
+
{
|
|
65
|
+
...i,
|
|
66
|
+
width: C,
|
|
67
|
+
height: C,
|
|
68
|
+
className: n,
|
|
69
|
+
viewBox: "0 0 15 15",
|
|
70
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
71
|
+
children: /* @__PURE__ */ e(
|
|
72
|
+
"path",
|
|
73
|
+
{
|
|
74
|
+
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",
|
|
75
|
+
fill: l,
|
|
76
|
+
fillRule: "evenodd",
|
|
77
|
+
clipRule: "evenodd"
|
|
78
|
+
}
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
function h({ size: C = 15, color: l = "currentColor", className: n = "inline", ...i }) {
|
|
84
|
+
return /* @__PURE__ */ e(
|
|
85
|
+
"svg",
|
|
86
|
+
{
|
|
87
|
+
...i,
|
|
88
|
+
width: C,
|
|
89
|
+
height: C,
|
|
90
|
+
className: n,
|
|
91
|
+
viewBox: "0 0 15 15",
|
|
92
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
93
|
+
children: /* @__PURE__ */ e(
|
|
94
|
+
"path",
|
|
95
|
+
{
|
|
96
|
+
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",
|
|
97
|
+
fill: l,
|
|
98
|
+
fillRule: "evenodd",
|
|
99
|
+
clipRule: "evenodd"
|
|
100
|
+
}
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
t as C,
|
|
107
|
+
o as E,
|
|
108
|
+
d as I,
|
|
109
|
+
h as X
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=X-CIoyLewf.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"X-CIoyLewf.js","sources":["../src/symbols/CrossCircled.tsx","../src/symbols/ExclamationTriangle.tsx","../src/symbols/InfoCircled.tsx","../src/symbols/X.tsx"],"sourcesContent":["import { SymbolProps } from '.';\n\nexport default function CrossCircled({\n size = 15,\n color = 'currentColor',\n className = 'inline',\n ...props\n}: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { SymbolProps } from '.';\n\nexport default function ExclamationTriangle({\n size = 15,\n color = 'currentColor',\n className = 'inline',\n ...props\n}: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { SymbolProps } from '.';\n\nexport default function InfoCircled({\n size = 15,\n color = 'currentColor',\n className = 'inline',\n ...props\n}: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { SymbolProps } from '.';\n\nexport default function X({ size = 15, color = 'currentColor', className = 'inline', ...props }: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n"],"names":["CrossCircled","size","color","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AAA,MAEN,UAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAMH;AAAA,UACN,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IACX;AAAA,EACF;AAEJ;ACvBwB,SAAAM,EAAE,EAAE,MAAAP,IAAO,IAAI,OAAAC,IAAQ,gBAAgB,WAAAC,IAAY,UAAU,GAAGC,KAAsB;AAE1G,SAAA,gBAAAC;AAAA,IAAC;AAAA,IAAA;AAAA,MACE,GAAGD;AAAA,MACJ,OAAOH;AAAA,MACP,QAAQA;AAAA,MACR,WAAAE;AAAA,MACA,SAAQ;AAAA,MACR,OAAM;AAAA,MAEN,UAAA,gBAAAE;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,GAAE;AAAA,UACF,MAAMH;AAAA,UACN,UAAS;AAAA,UACT,UAAS;AAAA,QAAA;AAAA,MAAA;AAAA,IACX;AAAA,EACF;AAEJ;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime");function r({size:C=15,color:l="currentColor",className:n="inline",...i}){return e.jsx("svg",{...i,width:C,height:C,className:n,viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{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",fill:l,fillRule:"evenodd",clipRule:"evenodd"})})}function t({size:C=15,color:l="currentColor",className:n="inline",...i}){return e.jsx("svg",{...i,width:C,height:C,className:n,viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{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",fill:l,fillRule:"evenodd",clipRule:"evenodd"})})}function o({size:C=15,color:l="currentColor",className:n="inline",...i}){return e.jsx("svg",{...i,width:C,height:C,className:n,viewBox:"0 0 15 15",xmlns:"http://www.w3.org/2000/svg",children:e.jsx("path",{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",fill:l,fillRule:"evenodd",clipRule:"evenodd"})})}function d({size:C=15,color:l="currentColor",className:n="inline",...i}){return e.jsx("svg",{...i,width:C,height:C,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"})})}exports.CrossCircled=r;exports.ExclamationTriangle=t;exports.InfoCircled=o;exports.X=d;
|
|
2
|
+
//# sourceMappingURL=X-CgjeP2OI.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"X-CgjeP2OI.cjs","sources":["../src/symbols/CrossCircled.tsx","../src/symbols/ExclamationTriangle.tsx","../src/symbols/InfoCircled.tsx","../src/symbols/X.tsx"],"sourcesContent":["import { SymbolProps } from '.';\n\nexport default function CrossCircled({\n size = 15,\n color = 'currentColor',\n className = 'inline',\n ...props\n}: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { SymbolProps } from '.';\n\nexport default function ExclamationTriangle({\n size = 15,\n color = 'currentColor',\n className = 'inline',\n ...props\n}: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { SymbolProps } from '.';\n\nexport default function InfoCircled({\n size = 15,\n color = 'currentColor',\n className = 'inline',\n ...props\n}: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n","import { SymbolProps } from '.';\n\nexport default function X({ size = 15, color = 'currentColor', className = 'inline', ...props }: SymbolProps) {\n return (\n <svg\n {...props}\n width={size}\n height={size}\n className={className}\n viewBox='0 0 15 15'\n xmlns='http://www.w3.org/2000/svg'\n >\n <path\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={color}\n fillRule='evenodd'\n clipRule='evenodd'\n />\n </svg>\n );\n}\n"],"names":["CrossCircled","size","color","className","props","jsx","ExclamationTriangle","InfoCircled","X"],"mappings":"kDAEA,SAAwBA,EAAa,CACnC,KAAAC,EAAO,GACP,MAAAC,EAAQ,eACR,UAAAC,EAAY,SACZ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
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("react"),y=require("./utils.cjs.js"),E=require("./QuestionMarkCircled-Dh6Bl18_.cjs"),I=require("./Toast-uzg_Sy4r.cjs"),K=require("./X-JuXyHwMp.cjs"),M=require("react-dom");function S({id:s,title:n,content:e,children:o,className:t="",disabled:r=!1,isOpen:a=!1,onToggle:d,triggerClassName:c="",bodyClassName:f=""}){const m=u.useId(),l=s||`accordion-item-${m}`,p=`${l}-header`,h=`${l}-panel`,b=()=>{!r&&d&&d()},v=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),b())};return i.jsxs("div",{className:y.join("border-b border-gray-200",r&&"opacity-60 cursor-not-allowed",t),children:[i.jsxs("button",{id:p,type:"button",className:y.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",r?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",c),"aria-expanded":a,"aria-controls":h,disabled:r,onClick:b,onKeyDown:v,children:[i.jsx("span",{children:n}),i.jsx("span",{className:y.join("transform transition-transform duration-300 ease-linear",a?"rotate-180":"rotate-0"),"aria-hidden":"true",children:i.jsx(E.ChevronDown,{size:18})})]}),i.jsx("div",{id:h,role:"region","aria-labelledby":p,className:y.join("transition-all duration-300 ease-linear px-4",a?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",f),children:a&&(o||e)})]})}function X({id:s,items:n=[],children:e,className:o="",itemClassName:t="",allowMultiple:r=!1,defaultOpenItems:a=[],triggersClassName:d="",bodiesClassName:c=""}){const f=u.useId(),m=s||`accordion-group-${f}`,[l,p]=u.useState(new Set(a)),h=x=>{p(w=>{const g=new Set(w);return g.has(x)?g.delete(x):(r||g.clear(),g.add(x)),g})},b=x=>`${f}-item-${x}`,v=x=>l.has(x);return i.jsxs("div",{id:m,className:o,children:[n.length>0&&n.map((x,w)=>{const g=x.id||b(w);return i.jsx(S,{id:g,title:x.title,content:x.content,disabled:x.disabled,isOpen:v(g),onToggle:()=>h(g),className:t,triggerClassName:d,bodyClassName:c},g)}),n.length===0&&e&&u.Children.map(e,(x,w)=>{if(u.isValidElement(x)&&x.type===S){const g=x.props.id||b(w);return u.createElement(S,{...x.props,key:g,id:g,className:y.join(t,x.props.className),isOpen:v(g),onToggle:()=>h(g),triggerClassName:y.join(d,x.props.triggerClassName),bodyClassName:y.join(c,x.props.bodyClassName)})}return null})]})}function W(){const[s,n]=u.useState(0);return u.useEffect(()=>{const e=setInterval(()=>{n(o=>(o+1)%3)},500);return()=>clearInterval(e)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(e=>i.jsx("div",{className:y.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",s===e&&"transform -translate-y-1")},e))})}const Z={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"},J={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"},Y={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},q={variant:"primary",size:"md",rounded:"md"};function U({variant:s=q.variant,size:n,rounded:e=q.rounded,loading:o,linkTo:t,linkProps:r,type:a="button",className:d,...c}){let f;s==="link"&&!n?f="fitted":f=n||q.size;const l=y.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",Z[s],J[f],Y[e],o&&"relative pointer-events-none",t&&"relative",d);return i.jsxs("button",{...c,role:t?"link":c.role,"aria-label":c["aria-label"]||(r==null?void 0:r["aria-label"]),"aria-description":c["aria-description"]||(r==null?void 0:r["aria-description"]),"aria-disabled":c.disabled||o,"aria-busy":o,type:a,className:l,children:[o&&i.jsx(W,{}),i.jsx("span",{className:y.join(o&&"invisible"),children:c.children}),t&&!c.disabled&&i.jsx("a",{...r,"aria-hidden":!0,href:t,rel:(r==null?void 0:r.rel)||"noreferrer",className:"absolute inset-0"})]})}function O(s){const[n,e]=u.useState(""),o=u.useCallback(t=>{let r=t,a="";for(;r&&!a;){const d=window.getComputedStyle(r).backgroundColor;d&&d!=="transparent"&&d!=="rgba(0, 0, 0, 0)"&&(a=d),r=r.parentElement}return a||"transparent"},[]);return u.useEffect(()=>{const t=document.getElementById(s);if(t){const r=o(t.parentElement);e(r)}},[s,o]),n}function P({ref:s,id:n,size:e=20,color:o,filled:t=!1,rounded:r=!0,checked:a=!1,onCheckedChange:d,disabled:c,className:f="",...m}){const l=u.useId(),p=u.useMemo(()=>n||`checkbox-${l}`,[n,l]),h=O(p),[b,v]=u.useState(a);u.useEffect(()=>{v(a)},[a]);const x=()=>{c||(v(!b),d==null||d(!b))},w=j=>{j.key===" "&&(j.preventDefault(),x())},g=y.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",r&&"rounded",c&&"opacity-40 cursor-not-allowed",!c&&"cursor-pointer",f);return i.jsx("button",{id:p,type:"button",ref:s,tabIndex:0,role:"checkbox",onClick:x,"aria-checked":b,"aria-disabled":c,onKeyDownCapture:w,style:{width:e,height:e,color:o,backgroundColor:b&&t?"currentcolor":"transparent"},className:g,...m,children:b&&i.jsx(E.Check,{size:e,color:t?h:void 0})})}function ee({children:s,className:n,linkTo:e,linkProps:o,onButtonClick:t,buttonProps:r,...a}){return e&&t&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),i.jsxs("div",{className:y.join("relative w-fit",n),...a,children:[s,e&&i.jsx("a",{...o,rel:(o==null?void 0:o.rel)||"noreferrer",href:e,className:y.join("absolute inset-0",o==null?void 0:o.className)}),!e&&t&&i.jsx("button",{...r,type:"button",onClick:t,className:y.join("absolute inset-0 cursor-pointer",r==null?void 0:r.className)})]})}function D({elementId:s,type:n,message:e}){return u.useEffect(()=>{const o=document.getElementById(s);if(o){if(!e&&n==="error"){o.removeAttribute("data-error");return}if(!e&&n==="success"){o.removeAttribute("data-success");return}return o.setAttribute("aria-describedby",`${s}-${n}-message`),o.setAttribute("aria-invalid",n==="error"?"true":"false"),n==="error"&&o.setAttribute("data-error","true"),n==="success"&&o.setAttribute("data-success","true"),()=>{o.removeAttribute("aria-describedby"),o.removeAttribute("aria-invalid"),o.removeAttribute("data-error"),o.removeAttribute("data-success")}}},[s,n,e]),e?i.jsxs("small",{className:y.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",n==="error"&&"text-destructive",n==="success"&&"text-success"),role:"status",children:[n==="error"?i.jsx(K.ExclamationTriangle,{}):i.jsx(E.CheckCircled,{}),i.jsx("span",{id:`${s}-${n}-message`,children:e})]}):null}const te={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},re={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},G={variant:"default",rounded:"none"};function oe({variant:s=G.variant,rounded:n,displayOnlyMode:e=!1,errorMessage:o,successMessage:t,type:r="text",className:a,...d}){const c=u.useId(),[f,m]=u.useState(!1);let l=n;s==="outline"&&!n&&(l="md"),l=l||G.rounded;const b=y.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","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",!e&&te[s],!e&&re[l],r==="password"&&"pr-10",!e&&"px-2 py-1",e&&"pointer-events-none",a);return i.jsxs("div",{className:y.join(e&&"cursor-text"),style:{height:d.height,width:d.width},children:[i.jsxs("div",{className:y.join(r==="password"&&"relative"),children:[i.jsx("input",{...d,id:c,type:r==="password"&&f?"text":r,"aria-disabled":d.disabled,readOnly:e,"aria-readonly":e||d["aria-readonly"],"data-error":o?!0:void 0,"data-success":t?!0:void 0,className:b}),r==="password"&&i.jsx("button",{onClick:()=>m(!f),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":f?"visible":"hidden",children:f?i.jsx(E.EyeClosed$1,{size:20}):i.jsx(E.EyeClosed,{size:20})})]}),!e&&i.jsx(D,{elementId:c,type:"error",message:o}),!e&&i.jsx(D,{elementId:c,type:"success",message:t})]})}function se({display:s="inline",width:n="fit-content",className:e="",required:o,helpMessage:t,suffix:r,htmlFor:a,children:d,...c}){const f=u.useId(),m=y.join("font-medium",s,e),l=t?`${a??f}-help`:void 0;return i.jsxs("div",{style:{display:s==="inline"?"inline-flex":"flex",width:n},className:"relative",children:[i.jsxs("label",{className:m,htmlFor:a,...c,children:[d,o&&i.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),t&&i.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":l,"aria-label":"Help information",title:t,children:i.jsx(E.QuestionMarkCircled,{})}),t&&i.jsx("div",{id:l,className:"sr-only",children:t}),r&&i.jsx("span",{className:"ml-1",children:r})]})}function ne(s){const[n,e]=u.useState(!1),[o,t]=u.useState(!1);return u.useEffect(()=>{s?(t(!0),setTimeout(()=>e(!0),10)):(e(!1),setTimeout(()=>t(!1),150))},[s]),{show:n,shouldRender:o}}function ae(s,n){u.useEffect(()=>{const e=o=>{o.key==="Escape"&&s&&n()};return document.addEventListener("keydown",e),s&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",e),document.body.style.overflow="auto"}},[s,n])}function ie(s,n){const e=u.useRef(null),o=u.useCallback(()=>{const t=document.getElementById(s);if(!t)return;const r=t.querySelectorAll('[data-modal-action="true"]');if(r.length>0){r[0].focus();return}const a=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const d=Array.from(a).filter(c=>!(c instanceof HTMLButtonElement&&c.getAttribute("data-modal-close-button")==="true"));if(d.length>0){d[0].focus();return}a[0].focus();return}t.focus()},[s]);u.useEffect(()=>(n&&(e.current=document.activeElement,o()),()=>{document.body.style.overflow="auto",e.current instanceof HTMLElement&&e.current.focus()}),[n,o])}function ue({id:s,isOpen:n,onClose:e,title:o,children:t,contentOnly:r=!1,className:a,overlayClassName:d,hideCloseButton:c=!1,actions:f=[],disableCloseOnOverlayClick:m=!1,ariaLabelledBy:l,ariaDescribedBy:p}){const h=u.useId(),b=s||`modal-${h}`,v=s?`${s}-title`:`modal-title-${h}`,{show:x,shouldRender:w}=ne(n);if(ie(b,w),ae(w,e),!w)return null;const g=()=>o?u.isValidElement(o)?i.jsx("div",{className:"mb-4",children:o}):i.jsx("h2",{className:"mb-4 text-xl font-semibold",id:v,children:o}):null,j=()=>f.length===0?null:i.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:f.map((N,L)=>{const{label:z,className:A,...T}=N;return i.jsx(U,{className:A,type:"button",...T,"data-modal-action":"true",children:z},L)})});return i.jsx(i.Fragment,{children:M.createPortal(i.jsx("div",{"aria-labelledby":l??o?v:void 0,"aria-describedby":p,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:i.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[i.jsx("div",{className:I.n("fixed inset-0 bg-black/20 transition-all",d),onClick:()=>{m||e()}}),r&&i.jsx("div",{className:I.n("relative w-fit",a),children:t}),!r&&i.jsxs("div",{id:b,tabIndex:-1,className:I.n("relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",x?"opacity-100 scale-100":"opacity-0 scale-90",a),children:[!c&&i.jsx("button",{type:"button",onClick:e,"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:i.jsx(K.X,{size:18})}),g(),t,j()]})]})}),document.body)})}function _({itemId:s,checked:n,onChange:e,name:o,disabled:t=!1,className:r=""}){const a="relative inline-flex items-center justify-center rounded-full",d=()=>{t||e()},c=y.join(a,!n&&"hover:border-current/60",!t&&"border-current cursor-pointer",t&&"border-muted/60 cursor-not-allowed",r);return i.jsx("div",{id:s,role:"radio",tabIndex:-1,"aria-checked":n,"aria-disabled":t,"aria-description":`Radio button for ${o}`,"aria-labelledby":`${s}-label`,onClick:d,className:c,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:n&&i.jsx("div",{className:y.join("size-full aspect-square rounded-full",t&&"bg-muted/60",!t&&"bg-current")})})}function R({value:s,children:n,className:e="",isSelected:o=!1,onChange:t,disabled:r=!1,hideInput:a=!1,description:d,name:c}){const m=`radio-${u.useId()}-${s}`,l=()=>{r||t==null||t(s)};return i.jsxs("div",{title:d,className:y.join("relative flex items-center",e,a&&`p-2 border-2 focus-within:border-dashed focus-within:${r?"border-current/50":"border-current/80"}`,a&&!o&&`border-transparent ${r?"":"not-focus-within:hover:border-border/60"}`,a&&o&&"border-border",r&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!a&&i.jsx(_,{itemId:m,name:c||"",checked:o,onChange:l,disabled:r,className:y.join(a&&"")}),i.jsx("div",{id:a?m:void 0,tabIndex:a?-1:void 0,role:a?"radio":void 0,onClick:a?l:void 0,"aria-checked":a?o?"true":"false":void 0,"aria-disabled":a?r:void 0,"aria-description":a?d||`Radio button for ${c}`:void 0,"aria-labelledby":a?`${m}-label`:void 0,className:y.join(a&&"size-full",typeof n=="object"&&"grow focus:outline-none"),children:i.jsx("label",{id:`${m}-label`,onClick:a?void 0:l,className:y.join(r&&"cursor-not-allowed",!r&&"cursor-pointer"),children:n})})]})}function le(s,n){const[e,o]=u.useState(n),[t,r]=u.useState(-1),[a,d]=u.useState(!1),c=u.useCallback((h,b)=>{var w;const v=h[b];v.hasAttribute("disabled")||v.getAttribute("aria-disabled")==="true"||((w=h[b])==null||w.click(),r(b))},[]),f=u.useCallback((h,b)=>{var x;if(h.preventDefault(),a||!b.length)return;const v=n!==-1?n:0;(x=b[v])==null||x.focus(),o(v),n!==-1&&c(b,v)},[n,a,c]),m=u.useCallback(h=>{var w;if(!h.shiftKey)return;h.preventDefault();const b=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(g=>!g.hasAttribute("disabled")&&g.tabIndex>=0),v=b.findIndex(g=>g.id===s),x=v>0?v-1:b.length-1;(w=b[x])==null||w.focus()},[s]),l=u.useCallback((h,b)=>{var j;if(!b.length)return;const v=h.target;if(!b.some(N=>N.id===v.id))return;const w=e!==-1?e:0;let g=w;switch(h.key){case"ArrowUp":case"ArrowLeft":h.preventDefault(),g=w>0?w-1:b.length-1;break;case"ArrowDown":case"ArrowRight":h.preventDefault(),g=(w+1)%b.length;break;case" ":h.preventDefault(),c(b,w);return;case"Tab":m(h);return;default:return}(j=b[g])==null||j.focus(),o(g),t!==-1&&c(b,g)},[e,t,m,c]),p=u.useCallback(()=>{const h=document.querySelector(`[id="${s}"][role="radiogroup"]`);return h?Array.from(h.querySelectorAll('[role="radio"]')):[]},[s]);u.useEffect(()=>{const h=document.querySelector(`[id="${s}"][role="radiogroup"]`);if(!h)return;const b=p(),v=j=>f(j,b),x=j=>l(j,b),w=()=>d(!0),g=()=>d(!1);return document.addEventListener("keydown",x),h.addEventListener("focus",v),h.addEventListener("mousedown",w),document.addEventListener("mouseup",g),()=>{document.removeEventListener("keydown",x),h.removeEventListener("focus",v),h.removeEventListener("mousedown",w),document.removeEventListener("mouseup",g)}},[s,p,f,l])}function de({options:s=[],value:n,onChange:e,id:o,children:t,className:r="",childrenClassName:a="",hideInputs:d=!1}){const c=u.useId(),f=o||`radio-group-${c}`;le(f,s.findIndex(l=>l===n));const m=u.useMemo(()=>s.reduce((l,p)=>(typeof p=="string"?l.some(h=>h.value===p)||l.push({label:p,value:p}):l.push(p),l),[]),[s]);return i.jsxs("div",{id:f,role:"radiogroup",tabIndex:0,className:y.join(r,"focus:outline-none"),children:[m.length>0&&m.map((l,p)=>i.jsx(R,{value:l.value,isSelected:n===l.value,onChange:e,name:f,disabled:l.disabled,description:l.description,hideInput:d,className:a,children:l.label},`${l.value}-${p}`)),m.length===0&&t&&u.Children.map(t,l=>u.isValidElement(l)&&l.type===R?i.jsx(R,{...l.props,className:y.join(a,l.props.className),hideInput:l.props.hideInput||d,isSelected:n===l.props.value,onChange:e,name:f,children:l.props.children}):null)]})}function ce({children:s,ref:n,...e}){if(u.isValidElement(s)){let o={...e};return s.props&&(o={...o,...s.props}),u.cloneElement(s,{...o,ref:t=>{typeof n=="function"?n(t):n&&(n.current=t)}})}return u.createElement("div",{...e,ref:n},s)}function fe({elementId:s,maxLength:n}){const[e,o]=u.useState(0);return u.useEffect(()=>{const t=document.getElementById(s);if(!t)return;const r=()=>{const a=t.value.length;o(a);const d=a>=n;t.setAttribute("aria-describedby",`${s}-character-count`),t.setAttribute("aria-invalid",d?"true":"false"),d?t.setAttribute("data-error","true"):t.removeAttribute("data-error")};return r(),t.addEventListener("input",r),t.setAttribute("maxlength",String(n)),()=>{t.removeEventListener("input",r),t.removeAttribute("maxlength"),t.removeAttribute("aria-describedby"),t.removeAttribute("aria-invalid"),t.removeAttribute("data-error")}},[s,n]),i.jsx("small",{className:y.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",e>=n&&"text-destructive",e<n&&"text-current"),role:"status",children:i.jsxs("span",{id:`${s}-character-count`,children:[e," / ",n," characters"]})})}function me(s,n){u.useEffect(()=>{const e=document.getElementById(s);if(!e)return;if(!n){e.style.height="auto";return}const o=()=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return o(),e.addEventListener("input",o),e.addEventListener("resize",o),window.addEventListener("resize",o),()=>{e.removeEventListener("input",o),e.removeEventListener("resize",o),window.removeEventListener("resize",o)}},[s,n])}const be={base:"","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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},he={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},V={variant:"outline",rounded:"none"};function xe({variant:s=V.variant,rounded:n,displayOnlyMode:e=!1,errorMessage:o,successMessage:t,hideResizeHandle:r=!1,autoExpand:a=!1,characterLimit:d=0,className:c,...f}){const m=u.useId();me(m,a||e);let l=n;s==="outline"&&!n&&(l="md"),l=l||V.rounded;let p=r;(e||s==="left-line"&&!r)&&(p=!0);const b=y.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!e&&be[s],!e&&he[l],!e&&"px-2 py-1",e&&"pointer-events-none",p&&"no-resize-handle",c);return i.jsxs("div",{className:y.join("-space-y-1.5",e&&"cursor-text"),children:[i.jsx("textarea",{...f,id:m,"aria-disabled":f.disabled,readOnly:e,"aria-readonly":e||f["aria-readonly"],style:{resize:a?"none":void 0},className:b}),d>0&&i.jsx(fe,{elementId:m,maxLength:d}),!e&&i.jsx(D,{elementId:m,type:"error",message:o}),!e&&i.jsx(D,{elementId:m,type:"success",message:t})]})}const k=8,$=4,C=6;function ge(s){return{calculatePosition:u.useCallback((e,o)=>{const t=e.getBoundingClientRect(),r=o.getBoundingClientRect(),a={width:window.innerWidth,height:window.innerHeight},d=(p,h,b,v)=>p<0||h<0||p+b>a.width||h+v>a.height,c={top:{x:t.left+t.width/2-r.width/2,y:t.top-r.height-$,arrow:{x:r.width/2-C,y:r.height}},bottom:{x:t.left+t.width/2-r.width/2,y:t.bottom+$,arrow:{x:r.width/2-C,y:-6}},left:{x:t.left-r.width-$,y:t.top+t.height/2-r.height/2,arrow:{x:r.width,y:r.height/2-C}},right:{x:t.right+$,y:t.top+t.height/2-r.height/2,arrow:{x:-6,y:r.height/2-C}}};let f=s,m=c[s];if(d(m.x,m.y,r.width,r.height)){const p={top:"bottom",bottom:"top",left:"right",right:"left"},h=c[p[s]];if(!d(h.x,h.y,r.width,r.height))f=p[s],m=h;else{const b=["top","bottom","left","right"].filter(v=>v!==s&&v!==p[s]);for(const v of b){const x=c[v];if(!d(x.x,x.y,r.width,r.height)){f=v,m=x;break}}}}m.x=Math.max(k,Math.min(m.x,a.width-r.width-k)),m.y=Math.max(k,Math.min(m.y,a.height-r.height-k));const l={x:t.left+t.width/2,y:t.top+t.height/2};return f==="top"||f==="bottom"?m.arrow.x=Math.max(C,Math.min(l.x-m.x-C,r.width-C*2)):m.arrow.y=Math.max(C,Math.min(l.y-m.y-C,r.height-C*2)),{...m,placement:f}},[s])}}function pe(s,n,e){const o=u.useRef(null),t=u.useRef(null),r=u.useCallback(()=>{if(!o.current||!t.current)return;const a=s(o.current,t.current);e(a)},[s,e]);return u.useEffect(()=>{if(!n)return;const a=()=>r();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[n,r]),{triggerRef:o,tooltipRef:t,updatePosition:r}}function ve(s,n,e,o,t,r,a,d,c){const f=u.useRef(null),m=u.useCallback(()=>{s||(f.current&&clearTimeout(f.current),f.current=window.setTimeout(()=>{e(!0),requestAnimationFrame(()=>{t(),o(!0)})},n))},[s,n,e,t,o]),l=u.useCallback((p=!1)=>{if(f.current&&clearTimeout(f.current),p){o(!1),setTimeout(()=>e(!1),150);return}f.current=window.setTimeout(()=>{o(!1),setTimeout(()=>e(!1),150)},100)},[o,e]);return u.useEffect(()=>{!r&&!a&&!d&&c&&l()},[r,a,d,c,l]),u.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]),{showTooltip:m,hideTooltip:l,timeoutRef:f}}function ye({id:s,children:n,message:e,placement:o="top",disabled:t=!1,delay:r=200,className:a}){const[d,c]=u.useState(!1),[f,m]=u.useState(!1),[l,p]=u.useState(null),[h,b]=u.useState(!1),[v,x]=u.useState(!1),[w,g]=u.useState(!1),{calculatePosition:j}=ge(o),{triggerRef:N,tooltipRef:L,updatePosition:z}=pe(j,f,p),{showTooltip:A,hideTooltip:T,timeoutRef:F}=ve(t,r,m,c,z,h,v,w,d),Q=u.useId(),H=s??Q;return i.jsxs(i.Fragment,{children:[u.cloneElement(n,{ref:B=>{N.current=B},onMouseEnter:()=>{b(!0),A()},onMouseLeave:()=>{b(!1)},onFocus:()=>{g(!0),A()},onBlur:()=>{g(!1),T(!0)},onKeyDown:B=>{B.key==="Escape"&&T(!0)},"aria-describedby":t?void 0:H}),f&&M.createPortal(i.jsx("div",{ref:L,id:H,role:"tooltip",className:y.join("fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out",d?"opacity-100":"opacity-0",a),style:l?{left:l.x,top:l.y}:{opacity:0},onMouseEnter:()=>{x(!0),F.current&&clearTimeout(F.current)},onMouseLeave:()=>{x(!1)},children:e}),document.body)]})}exports.ActionModal=I.ActionModal;exports.Toast=I.Toast;exports.Accordion=X;exports.AccordionItem=S;exports.Button=U;exports.ButtonLoadingDots=W;exports.Checkbox=P;exports.Clickable=ee;exports.Input=oe;exports.Label=se;exports.Modal=ue;exports.RadioGroup=de;exports.RadioGroupItem=R;exports.RadioInput=_;exports.Slot=ce;exports.Textarea=xe;exports.Tooltip=ye;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),u=require("react"),w=require("./utils.cjs.js"),N=require("./QuestionMarkCircled-D5cHmQp1.cjs"),A=require("./Toast-FzI16Fnl.cjs"),M=require("./X-CgjeP2OI.cjs"),W=require("react-dom");function D({id:o,title:s,content:e,children:n,className:t="",disabled:r=!1,isOpen:a=!1,onToggle:d,triggerClassName:f="",bodyClassName:c=""}){const h=u.useId(),l=o||`accordion-item-${h}`,v=`${l}-header`,m=`${l}-panel`,b=()=>{!r&&d&&d()},p=x=>{(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),b())};return i.jsxs("div",{className:w.join("border-b border-gray-200",r&&"opacity-60 cursor-not-allowed",t),children:[i.jsxs("button",{id:v,type:"button",className:w.join("w-full text-left py-3 px-4 flex justify-between items-center focus:outline focus:outline-secondary",r?"cursor-not-allowed":"hover:bg-gray-50/10 cursor-pointer",f),"aria-expanded":a,"aria-controls":m,disabled:r,onClick:b,onKeyDown:p,children:[i.jsx("span",{children:s}),i.jsx("span",{className:w.join("transform transition-transform duration-300 ease-linear",a?"rotate-180":"rotate-0"),"aria-hidden":"true",children:i.jsx(N.ChevronDown,{size:18})})]}),i.jsx("div",{id:m,role:"region","aria-labelledby":v,className:w.join("transition-all duration-300 ease-linear px-4",a?"max-h-96 opacity-100 overflow-auto py-3":"max-h-0 opacity-0 overflow-hidden",c),children:a&&(n||e)})]})}function Z({id:o,items:s=[],children:e,className:n="",itemClassName:t="",allowMultiple:r=!1,defaultOpenItems:a=[],triggersClassName:d="",bodiesClassName:f=""}){const c=u.useId(),h=o||`accordion-group-${c}`,[l,v]=u.useState(new Set(a)),m=x=>{v(y=>{const g=new Set(y);return g.has(x)?g.delete(x):(r||g.clear(),g.add(x)),g})},b=x=>`${c}-item-${x}`,p=x=>l.has(x);return i.jsxs("div",{id:h,className:n,children:[s.length>0&&s.map((x,y)=>{const g=x.id||b(y);return i.jsx(D,{id:g,title:x.title,content:x.content,disabled:x.disabled,isOpen:p(g),onToggle:()=>m(g),className:t,triggerClassName:d,bodyClassName:f},g)}),s.length===0&&e&&u.Children.map(e,(x,y)=>{if(u.isValidElement(x)&&x.type===D){const g=x.props.id||b(y);return u.createElement(D,{...x.props,key:g,id:g,className:w.join(t,x.props.className),isOpen:p(g),onToggle:()=>m(g),triggerClassName:w.join(d,x.props.triggerClassName),bodyClassName:w.join(f,x.props.bodyClassName)})}return null})]})}function U(){const[o,s]=u.useState(0);return u.useEffect(()=>{const e=setInterval(()=>{s(n=>(n+1)%3)},500);return()=>clearInterval(e)},[]),i.jsx("div",{className:"absolute inset-0 inline-flex items-center justify-center gap-x-2 align-middle",children:[0,1,2].map(e=>i.jsx("div",{className:w.join("rounded-full transition-all duration-500 ease-in-out size-[0.35em] bg-current",o===e&&"transform -translate-y-1")},e))})}const J={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"},Y={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"},O={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"rounded-full"},q={variant:"primary",size:"md",rounded:"md"};function _({variant:o=q.variant,size:s,rounded:e=q.rounded,loading:n,linkTo:t,linkProps:r,type:a="button",className:d,...f}){let c;o==="link"&&!s?c="fitted":c=s||q.size;const l=w.join("appearance-none focus:outline-none focus:ring not-disabled:hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed transition-all",J[o],Y[c],O[e],n&&"relative pointer-events-none",t&&"relative",d);return i.jsxs("button",{...f,role:t?"link":f.role,"aria-label":f["aria-label"]||(r==null?void 0:r["aria-label"]),"aria-description":f["aria-description"]||(r==null?void 0:r["aria-description"]),"aria-disabled":f.disabled||n,"aria-busy":n,type:a,className:l,children:[n&&i.jsx(U,{}),i.jsx("span",{className:w.join(n&&"invisible"),children:f.children}),t&&!f.disabled&&i.jsx("a",{...r,"aria-hidden":!0,href:t,rel:(r==null?void 0:r.rel)||"noreferrer",className:"absolute inset-0"})]})}function P(o){const[s,e]=u.useState(""),n=u.useCallback(t=>{let r=t,a="";for(;r&&!a;){const d=window.getComputedStyle(r).backgroundColor;d&&d!=="transparent"&&d!=="rgba(0, 0, 0, 0)"&&(a=d),r=r.parentElement}return a||"transparent"},[]);return u.useEffect(()=>{const t=document.getElementById(o);if(t){const r=n(t.parentElement);e(r)}},[o,n]),s}function ee({ref:o,id:s,size:e=20,color:n,filled:t=!1,rounded:r=!0,checked:a=!1,onCheckedChange:d,disabled:f,className:c="",...h}){const l=u.useId(),v=u.useMemo(()=>s||`checkbox-${l}`,[s,l]),m=P(v),[b,p]=u.useState(a);u.useEffect(()=>{p(a)},[a]);const x=()=>{f||(p(!b),d==null||d(!b))},y=j=>{j.key===" "&&(j.preventDefault(),x())},g=w.join("flex items-center justify-center border outline outline-transparent focus:outline-current focus:outline-offset-2",r&&"rounded",f&&"opacity-40 cursor-not-allowed",!f&&"cursor-pointer",c);return i.jsx("button",{id:v,type:"button",ref:o,tabIndex:0,role:"checkbox",onClick:x,"aria-checked":b,"aria-disabled":f,onKeyDownCapture:y,style:{width:e,height:e,color:n,backgroundColor:b&&t?"currentcolor":"transparent"},className:g,...h,children:b&&i.jsx(N.Check,{size:e,color:t?m:void 0})})}function te({children:o,className:s,linkTo:e,linkProps:n,onButtonClick:t,buttonProps:r,...a}){return e&&t&&console.warn('Clickable: Both "linkTo" and "onButtonClick" props are provided. Only "linkTo" will be used.'),i.jsxs("div",{className:w.join("relative w-fit",s),...a,children:[o,e&&i.jsx("a",{...n,rel:(n==null?void 0:n.rel)||"noreferrer",href:e,className:w.join("absolute inset-0",n==null?void 0:n.className)}),!e&&t&&i.jsx("button",{...r,type:"button",onClick:t,className:w.join("absolute inset-0 cursor-pointer",r==null?void 0:r.className)})]})}function L({elementId:o,type:s,message:e}){return u.useEffect(()=>{const n=document.getElementById(o);if(n){if(!e&&s==="error"){n.removeAttribute("data-error");return}if(!e&&s==="success"){n.removeAttribute("data-success");return}return n.setAttribute("aria-describedby",`${o}-${s}-message`),n.setAttribute("aria-invalid",s==="error"?"true":"false"),s==="error"&&n.setAttribute("data-error","true"),s==="success"&&n.setAttribute("data-success","true"),()=>{n.removeAttribute("aria-describedby"),n.removeAttribute("aria-invalid"),n.removeAttribute("data-error"),n.removeAttribute("data-success")}}},[o,s,e]),e?i.jsxs("small",{className:w.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-start",s==="error"&&"text-destructive",s==="success"&&"text-success"),role:"status",children:[s==="error"?i.jsx(M.ExclamationTriangle,{}):i.jsx(N.CheckCircled,{}),i.jsx("span",{id:`${o}-${s}-message`,children:e})]}):null}const re={base:"",default:"ring ring-transparent focus:ring-primary-foreground not-disabled:data-error:ring-destructive not-disabled:data-success:ring-success",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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},ne={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},K={variant:"default",rounded:"none"};function oe({variant:o=K.variant,rounded:s,displayOnlyMode:e=!1,errorMessage:n,successMessage:t,type:r="text",className:a,...d}){const f=u.useId(),[c,h]=u.useState(!1);let l=s;o==="outline"&&!s&&(l="md"),l=l||K.rounded;const b=w.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all","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",!e&&re[o],!e&&ne[l],r==="password"&&"pr-10",!e&&"px-2 py-1",e&&"pointer-events-none",a);return i.jsxs("div",{className:w.join(e&&"cursor-text"),style:{height:d.height,width:d.width},children:[i.jsxs("div",{className:w.join(r==="password"&&"relative"),children:[i.jsx("input",{...d,id:f,type:r==="password"&&c?"text":r,"aria-disabled":d.disabled,readOnly:e,"aria-readonly":e||d["aria-readonly"],"data-error":n?!0:void 0,"data-success":t?!0:void 0,className:b}),r==="password"&&i.jsx("button",{onClick:()=>h(!c),className:"absolute inset-y-0 right-0 px-2 hover:cursor-pointer","aria-label":"Toggle password visibility","data-state":c?"visible":"hidden",children:c?i.jsx(N.EyeClosed$1,{size:20}):i.jsx(N.EyeClosed,{size:20})})]}),!e&&i.jsx(L,{elementId:f,type:"error",message:n}),!e&&i.jsx(L,{elementId:f,type:"success",message:t})]})}function se({display:o="inline",width:s="fit-content",className:e="",required:n,helpMessage:t,suffix:r,htmlFor:a,children:d,...f}){const c=u.useId(),h=w.join("font-medium",o,e),l=t?`${a??c}-help`:void 0;return i.jsxs("div",{style:{display:o==="inline"?"inline-flex":"flex",width:s},className:"relative",children:[i.jsxs("label",{className:h,htmlFor:a,...f,children:[d,n&&i.jsx("span",{className:"text-red-500 font-medium ml-1","aria-label":"required",children:"*"})]}),t&&i.jsx("span",{className:"text-gray-500 ml-1 size-fit -translate-y-1/3","aria-describedby":l,"aria-label":"Help information",title:t,children:i.jsx(N.QuestionMarkCircled,{})}),t&&i.jsx("div",{id:l,className:"sr-only",children:t}),r&&i.jsx("span",{className:"ml-1",children:r})]})}function ae(o){const[s,e]=u.useState(!1),[n,t]=u.useState(!1);return u.useEffect(()=>{o?(t(!0),setTimeout(()=>e(!0),10)):(e(!1),setTimeout(()=>t(!1),150))},[o]),{show:s,shouldRender:n}}function ie(o,s){u.useEffect(()=>{const e=n=>{n.key==="Escape"&&o&&s()};return document.addEventListener("keydown",e),o&&(document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",e),document.body.style.overflow="auto"}},[o,s])}function ue(o,s){const e=u.useRef(null),n=u.useCallback(()=>{const t=document.getElementById(o);if(!t)return;const r=t.querySelectorAll('[data-modal-action="true"]');if(r.length>0){r[0].focus();return}const a=t.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(a.length>0){const d=Array.from(a).filter(f=>!(f instanceof HTMLButtonElement&&f.getAttribute("data-modal-close-button")==="true"));if(d.length>0){d[0].focus();return}a[0].focus();return}t.focus()},[o]);u.useEffect(()=>(s&&(e.current=document.activeElement,n()),()=>{document.body.style.overflow="auto",e.current instanceof HTMLElement&&e.current.focus()}),[s,n])}function le({id:o,isOpen:s,onClose:e,title:n,children:t,contentOnly:r=!1,className:a,overlayClassName:d,hideCloseButton:f=!1,actions:c=[],disableCloseOnOverlayClick:h=!1,ariaLabelledBy:l,ariaDescribedBy:v}){const m=u.useId(),b=o||`modal-${m}`,p=o?`${o}-title`:`modal-title-${m}`,{show:x,shouldRender:y}=ae(s);if(ue(b,y),ie(y,e),!y)return null;const g=()=>n?u.isValidElement(n)?i.jsx("div",{className:"mb-4",children:n}):i.jsx("h2",{className:"mb-4 text-xl font-semibold",id:p,children:n}):null,j=()=>c.length===0?null:i.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:c.map((I,E)=>{const{label:z,className:T,...$}=I;return i.jsx(_,{className:T,type:"button",...$,"data-modal-action":"true",children:z},E)})});return i.jsx(i.Fragment,{children:W.createPortal(i.jsx("div",{"aria-labelledby":l??n?p:void 0,"aria-describedby":v,role:"dialog","aria-modal":"true",className:"fixed inset-0 z-[100] overflow-y-auto",children:i.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[i.jsx("div",{className:A.n("fixed inset-0 bg-black/20 transition-all",d),onClick:()=>{h||e()}}),r&&i.jsx("div",{className:A.n("relative w-fit",a),children:t}),!r&&i.jsxs("div",{id:b,tabIndex:-1,className:A.n("relative w-full max-w-xl transform rounded-lg shadow-xl transition-all p-6 bg-inherit focus:ring ease-in duration-75",x?"opacity-100 scale-100":"opacity-0 scale-90",a),children:[!f&&i.jsx("button",{type:"button",onClick:e,"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:i.jsx(M.X,{size:18})}),g(),t,j()]})]})}),document.body)})}function Q({itemId:o,checked:s,onChange:e,name:n,disabled:t=!1,className:r=""}){const a="relative inline-flex items-center justify-center rounded-full",d=()=>{t||e()},f=w.join(a,!s&&"hover:border-current/60",!t&&"border-current cursor-pointer",t&&"border-muted/60 cursor-not-allowed",r);return i.jsx("div",{id:o,role:"radio",tabIndex:-1,"aria-checked":s,"aria-disabled":t,"aria-description":`Radio button for ${n}`,"aria-labelledby":`${o}-label`,onClick:d,className:f,style:{width:"1em",height:"1em",padding:"0.1em",borderWidth:"0.06em"},children:s&&i.jsx("div",{className:w.join("size-full aspect-square rounded-full",t&&"bg-muted/60",!t&&"bg-current")})})}function R({value:o,children:s,className:e="",isSelected:n=!1,onChange:t,disabled:r=!1,hideInput:a=!1,description:d,name:f}){const h=`radio-${u.useId()}-${o}`,l=()=>{r||t==null||t(o)};return i.jsxs("div",{title:d,className:w.join("relative flex items-center",e,a&&`p-2 border-2 focus-within:border-dashed focus-within:${r?"border-current/50":"border-current/80"}`,a&&!n&&`border-transparent ${r?"":"not-focus-within:hover:border-border/60"}`,a&&n&&"border-border",r&&"opacity-60 cursor-not-allowed"),style:{gap:"0.5em"},children:[!a&&i.jsx(Q,{itemId:h,name:f||"",checked:n,onChange:l,disabled:r,className:w.join(a&&"")}),i.jsx("div",{id:a?h:void 0,tabIndex:a?-1:void 0,role:a?"radio":void 0,onClick:a?l:void 0,"aria-checked":a?n?"true":"false":void 0,"aria-disabled":a?r:void 0,"aria-description":a?d||`Radio button for ${f}`:void 0,"aria-labelledby":a?`${h}-label`:void 0,className:w.join(a&&"size-full",typeof s=="object"&&"grow focus:outline-none"),children:i.jsx("label",{id:`${h}-label`,onClick:a?void 0:l,className:w.join(r&&"cursor-not-allowed",!r&&"cursor-pointer"),children:s})})]})}function ce(o,s){const[e,n]=u.useState(s),[t,r]=u.useState(-1),[a,d]=u.useState(!1),f=u.useCallback((m,b)=>{var y;const p=m[b];p.hasAttribute("disabled")||p.getAttribute("aria-disabled")==="true"||((y=m[b])==null||y.click(),r(b))},[]),c=u.useCallback((m,b)=>{var x;if(m.preventDefault(),a||!b.length)return;const p=s!==-1?s:0;(x=b[p])==null||x.focus(),n(p),s!==-1&&f(b,p)},[s,a,f]),h=u.useCallback(m=>{var y;if(!m.shiftKey)return;m.preventDefault();const b=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(g=>!g.hasAttribute("disabled")&&g.tabIndex>=0),p=b.findIndex(g=>g.id===o),x=p>0?p-1:b.length-1;(y=b[x])==null||y.focus()},[o]),l=u.useCallback((m,b)=>{var j;if(!b.length)return;const p=m.target;if(!b.some(I=>I.id===p.id))return;const y=e!==-1?e:0;let g=y;switch(m.key){case"ArrowUp":case"ArrowLeft":m.preventDefault(),g=y>0?y-1:b.length-1;break;case"ArrowDown":case"ArrowRight":m.preventDefault(),g=(y+1)%b.length;break;case" ":m.preventDefault(),f(b,y);return;case"Tab":h(m);return;default:return}(j=b[g])==null||j.focus(),n(g),t!==-1&&f(b,g)},[e,t,h,f]),v=u.useCallback(()=>{const m=document.querySelector(`[id="${o}"][role="radiogroup"]`);return m?Array.from(m.querySelectorAll('[role="radio"]')):[]},[o]);u.useEffect(()=>{const m=document.querySelector(`[id="${o}"][role="radiogroup"]`);if(!m)return;const b=v(),p=j=>c(j,b),x=j=>l(j,b),y=()=>d(!0),g=()=>d(!1);return document.addEventListener("keydown",x),m.addEventListener("focus",p),m.addEventListener("mousedown",y),document.addEventListener("mouseup",g),()=>{document.removeEventListener("keydown",x),m.removeEventListener("focus",p),m.removeEventListener("mousedown",y),document.removeEventListener("mouseup",g)}},[o,v,c,l])}function de({options:o=[],value:s,onChange:e,id:n,children:t,className:r="",childrenClassName:a="",hideInputs:d=!1}){const f=u.useId(),c=n||`radio-group-${f}`;ce(c,o.findIndex(l=>l===s));const h=u.useMemo(()=>o.reduce((l,v)=>(typeof v=="string"?l.some(m=>m.value===v)||l.push({label:v,value:v}):l.push(v),l),[]),[o]);return i.jsxs("div",{id:c,role:"radiogroup",tabIndex:0,className:w.join(r,"focus:outline-none"),children:[h.length>0&&h.map((l,v)=>i.jsx(R,{value:l.value,isSelected:s===l.value,onChange:e,name:c,disabled:l.disabled,description:l.description,hideInput:d,className:a,children:l.label},`${l.value}-${v}`)),h.length===0&&t&&u.Children.map(t,l=>u.isValidElement(l)&&l.type===R?i.jsx(R,{...l.props,className:w.join(a,l.props.className),hideInput:l.props.hideInput||d,isSelected:s===l.props.value,onChange:e,name:c,children:l.props.children}):null)]})}function fe({children:o,ref:s,...e}){if(u.isValidElement(o)){let n={...e};return o.props&&(n={...n,...o.props}),u.cloneElement(o,{...n,ref:t=>{typeof s=="function"?s(t):s&&(s.current=t)}})}return u.createElement("div",{...e,ref:s},o)}function me({elementId:o,maxLength:s}){const[e,n]=u.useState(0);return u.useEffect(()=>{const t=document.getElementById(o);if(!t)return;const r=()=>{const a=t.value.length;n(a);const d=a>=s;t.setAttribute("aria-describedby",`${o}-character-count`),t.setAttribute("aria-invalid",d?"true":"false"),d?t.setAttribute("data-error","true"):t.removeAttribute("data-error")};return r(),t.addEventListener("input",r),t.setAttribute("maxlength",String(s)),()=>{t.removeEventListener("input",r),t.removeAttribute("maxlength"),t.removeAttribute("aria-describedby"),t.removeAttribute("aria-invalid"),t.removeAttribute("data-error")}},[o,s]),i.jsx("small",{className:w.join("mt-0.5 text-sm inline-flex items-center gap-1 w-full justify-end",e>=s&&"text-destructive",e<s&&"text-current"),role:"status",children:i.jsxs("span",{id:`${o}-character-count`,children:[e," / ",s," characters"]})})}function be(o,s){u.useEffect(()=>{const e=document.getElementById(o);if(!e)return;if(!s){e.style.height="auto";return}const n=()=>{e.style.height="auto",e.style.height=`${e.scrollHeight}px`};return n(),e.addEventListener("input",n),e.addEventListener("resize",n),window.addEventListener("resize",n),()=>{e.removeEventListener("input",n),e.removeEventListener("resize",n),window.removeEventListener("resize",n)}},[o,s])}const he={base:"","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",outline:"border border-border focus:border-primary-foreground disabled:border-muted/30 not-disabled:data-error:border-destructive not-disabled:data-success:border-success"},xe={none:"rounded-none",sm:"rounded-sm",md:"rounded-md",lg:"rounded-lg",full:"px-3 rounded-full"},V={variant:"outline",rounded:"none"};function ge({variant:o=V.variant,rounded:s,displayOnlyMode:e=!1,errorMessage:n,successMessage:t,hideResizeHandle:r=!1,autoExpand:a=!1,characterLimit:d=0,className:f,...c}){const h=u.useId();be(h,a||e);let l=s;o==="outline"&&!s&&(l="md"),l=l||V.rounded;let v=r;(e||o==="left-line"&&!r)&&(v=!0);const b=w.join("appearance-none w-full focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed placeholder:text-muted/70 hide-number-input-arrows transition-all",!e&&he[o],!e&&xe[l],!e&&"px-2 py-1",e&&"pointer-events-none",v&&"no-resize-handle",f);return i.jsxs("div",{className:w.join("-space-y-1.5",e&&"cursor-text"),children:[i.jsx("textarea",{...c,id:h,"aria-disabled":c.disabled,readOnly:e,"aria-readonly":e||c["aria-readonly"],style:{resize:a?"none":void 0},className:b}),d>0&&i.jsx(me,{elementId:h,maxLength:d}),!e&&i.jsx(L,{elementId:h,type:"error",message:n}),!e&&i.jsx(L,{elementId:h,type:"success",message:t})]})}const pe={sm:{container:"h-5 min-w-9 w-9",thumb:"h-4 w-4",translate:"translate-x-4"},md:{container:"h-6 min-w-11 w-11",thumb:"h-5 w-5",translate:"translate-x-5"},lg:{container:"h-7 min-w-13 w-13",thumb:"h-6 w-6",translate:"translate-x-6"}},ve={default:{unchecked:"bg-muted",checked:"bg-primary"},success:{unchecked:"bg-muted",checked:"bg-success"},destructive:{unchecked:"bg-muted",checked:"bg-destructive"}},G={variant:"default",size:"md"};function we({ref:o,id:s,size:e=G.size,variant:n=G.variant,checked:t,onCheckedChange:r,disabled:a=!1,className:d,thumbClassName:f,backgroundClassNames:c,...h}){const l=u.useId(),v=u.useMemo(()=>s||`toggle-${l}`,[s,l]),[m,b]=u.useState(t);u.useEffect(()=>{b(t)},[t]);const p=()=>{if(!a){const E=!m;t===void 0&&b(E),r==null||r(E)}},x=E=>{(E.key===" "||E.key==="Enter")&&(E.preventDefault(),p())},y=pe[e],g=ve[n],j=w.join("relative inline-flex items-center rounded-full transition-all duration-200 ease-in-out","focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",y.container,m?(c==null?void 0:c.checked)||g.checked:(c==null?void 0:c.unchecked)||g.unchecked,a&&"opacity-50 cursor-not-allowed",!a&&"cursor-pointer",d),I=w.join("absolute left-0.5 top-1/2 -translate-y-1/2 rounded-full bg-white shadow-sm transition-transform duration-200 ease-in-out",y.thumb,m&&y.translate,f);return i.jsxs("button",{ref:o,id:v,type:"button",role:"switch",tabIndex:0,"aria-checked":m,"aria-disabled":a,disabled:a,onClick:p,onKeyDown:x,className:j,...h,children:[i.jsx("span",{className:I}),i.jsx("span",{className:"sr-only",children:m?"Enabled":"Disabled"})]})}const k=8,S=4,C=6;function ye(o){return{calculatePosition:u.useCallback((e,n)=>{const t=e.getBoundingClientRect(),r=n.getBoundingClientRect(),a={width:window.innerWidth,height:window.innerHeight},d=(v,m,b,p)=>v<0||m<0||v+b>a.width||m+p>a.height,f={top:{x:t.left+t.width/2-r.width/2,y:t.top-r.height-S,arrow:{x:r.width/2-C,y:r.height}},bottom:{x:t.left+t.width/2-r.width/2,y:t.bottom+S,arrow:{x:r.width/2-C,y:-6}},left:{x:t.left-r.width-S,y:t.top+t.height/2-r.height/2,arrow:{x:r.width,y:r.height/2-C}},right:{x:t.right+S,y:t.top+t.height/2-r.height/2,arrow:{x:-6,y:r.height/2-C}}};let c=o,h=f[o];if(d(h.x,h.y,r.width,r.height)){const v={top:"bottom",bottom:"top",left:"right",right:"left"},m=f[v[o]];if(!d(m.x,m.y,r.width,r.height))c=v[o],h=m;else{const b=["top","bottom","left","right"].filter(p=>p!==o&&p!==v[o]);for(const p of b){const x=f[p];if(!d(x.x,x.y,r.width,r.height)){c=p,h=x;break}}}}h.x=Math.max(k,Math.min(h.x,a.width-r.width-k)),h.y=Math.max(k,Math.min(h.y,a.height-r.height-k));const l={x:t.left+t.width/2,y:t.top+t.height/2};return c==="top"||c==="bottom"?h.arrow.x=Math.max(C,Math.min(l.x-h.x-C,r.width-C*2)):h.arrow.y=Math.max(C,Math.min(l.y-h.y-C,r.height-C*2)),{...h,placement:c}},[o])}}function je(o,s,e){const n=u.useRef(null),t=u.useRef(null),r=u.useCallback(()=>{if(!n.current||!t.current)return;const a=o(n.current,t.current);e(a)},[o,e]);return u.useEffect(()=>{if(!s)return;const a=()=>r();return window.addEventListener("resize",a),()=>{window.removeEventListener("resize",a)}},[s,r]),{triggerRef:n,tooltipRef:t,updatePosition:r}}function Ee(o,s,e,n,t,r,a,d,f){const c=u.useRef(null),h=u.useCallback(()=>{o||(c.current&&clearTimeout(c.current),c.current=window.setTimeout(()=>{e(!0),requestAnimationFrame(()=>{t(),n(!0)})},s))},[o,s,e,t,n]),l=u.useCallback((v=!1)=>{if(c.current&&clearTimeout(c.current),v){n(!1),setTimeout(()=>e(!1),150);return}c.current=window.setTimeout(()=>{n(!1),setTimeout(()=>e(!1),150)},100)},[n,e]);return u.useEffect(()=>{!r&&!a&&!d&&f&&l()},[r,a,d,f,l]),u.useEffect(()=>()=>{c.current&&clearTimeout(c.current)},[]),{showTooltip:h,hideTooltip:l,timeoutRef:c}}function Ce({id:o,children:s,message:e,placement:n="top",disabled:t=!1,delay:r=200,className:a}){const[d,f]=u.useState(!1),[c,h]=u.useState(!1),[l,v]=u.useState(null),[m,b]=u.useState(!1),[p,x]=u.useState(!1),[y,g]=u.useState(!1),{calculatePosition:j}=ye(n),{triggerRef:I,tooltipRef:E,updatePosition:z}=je(j,c,v),{showTooltip:T,hideTooltip:$,timeoutRef:F}=Ee(t,r,h,f,z,m,p,y,d),X=u.useId(),H=o??X;return i.jsxs(i.Fragment,{children:[u.cloneElement(s,{ref:B=>{I.current=B},onMouseEnter:()=>{b(!0),T()},onMouseLeave:()=>{b(!1)},onFocus:()=>{g(!0),T()},onBlur:()=>{g(!1),$(!0)},onKeyDown:B=>{B.key==="Escape"&&$(!0)},"aria-describedby":t?void 0:H}),c&&W.createPortal(i.jsx("div",{ref:E,id:H,role:"tooltip",className:w.join("fixed z-50 px-2 py-1 text-sm rounded shadow-lg pointer-events-auto transition-all duration-150 ease-out",d?"opacity-100":"opacity-0",a),style:l?{left:l.x,top:l.y}:{opacity:0},onMouseEnter:()=>{x(!0),F.current&&clearTimeout(F.current)},onMouseLeave:()=>{x(!1)},children:e}),document.body)]})}exports.ActionModal=A.ActionModal;exports.Toast=A.Toast;exports.Accordion=Z;exports.AccordionItem=D;exports.Button=_;exports.ButtonLoadingDots=U;exports.Checkbox=ee;exports.Clickable=te;exports.Input=oe;exports.Label=se;exports.Modal=le;exports.RadioGroup=de;exports.RadioGroupItem=R;exports.RadioInput=Q;exports.Slot=fe;exports.Textarea=ge;exports.Toggle=we;exports.Tooltip=Ce;
|
|
2
2
|
//# sourceMappingURL=components.cjs.js.map
|