import{r as x,j as e}from"./query-Bw69rE6b.js";import{X as m,c as u}from"./index-CoUu6FiM.js";function v({open:s,onClose:r,title:i,description:t,children:o,footer:a,size:l="md"}){return x.useEffect(()=>{if(!s)return;const d=c=>{c.key==="Escape"&&r()};document.addEventListener("keydown",d);const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=n}},[s,r]),s?e.jsxs("div",{className:"fixed inset-0 z-50 flex items-start justify-center overflow-y-auto bg-black/60 px-4 pt-16 pb-8",children:[e.jsx("div",{className:"absolute inset-0",onClick:r,"aria-hidden":!0}),e.jsxs("div",{role:"dialog","aria-modal":!0,className:u("relative z-10 w-full rounded-xl border border-surface-border bg-surface-raised shadow-2xl",l==="lg"?"max-w-3xl":"max-w-xl"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-surface-border px-5 py-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-base font-semibold tracking-tight",children:i}),t&&e.jsx("p",{className:"mt-0.5 text-sm text-ink-muted",children:t})]}),e.jsx("button",{type:"button",onClick:r,"aria-label":"Close",className:"rounded-md p-1 text-ink-dim hover:bg-surface-subtle hover:text-ink",children:e.jsx(m,{size:16})})]}),e.jsx("div",{className:"max-h-[70vh] overflow-y-auto px-5 py-4",children:o}),a&&e.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-surface-border px-5 py-3",children:a})]})]}):null}export{v as M};
