2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{j as e}from"./vendor-query-a3e439f2.js";import{r as s}from"./vendor-react-ac1483bd.js";import{e as r}from"./index-590deac5.js";import{X as t}from"./vendor-ui-8a3c5c7d.js";const n=({isOpen:n,onClose:o,title:a,children:i,size:d="md",showCloseButton:l=!0,actions:c})=>{if(s.useEffect(()=>{const e=e=>{"Escape"===e.key&&o()};return n&&(document.addEventListener("keydown",e),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",e),document.body.style.overflow="unset"}},[n,o]),!n)return null;return e.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:e.jsxs("div",{className:"flex min-h-screen items-center justify-center p-4",children:[e.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:o}),e.jsxs("div",{className:`\n relative w-full ${{sm:"max-w-md",md:"max-w-lg",lg:"max-w-2xl",xl:"max-w-4xl"}[d]} \n bg-white dark:bg-gray-800 rounded-lg shadow-xl \n transform transition-all\n `,children:[e.jsxs("div",{className:"flex items-center justify-between p-4 sm:p-6 border-b border-gray-200 dark:border-gray-700",children:[e.jsx(r,{children:a}),l&&e.jsx("button",{onClick:o,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:e.jsx(t,{className:"h-5 w-5"})})]}),e.jsx("div",{className:"p-4 sm:p-6",children:i}),c&&e.jsx("div",{className:"flex flex-col space-y-2 sm:flex-row sm:justify-end sm:space-y-0 sm:space-x-3 sm:space-x-reverse p-4 sm:p-6 border-t border-gray-200 dark:border-gray-700",children:c})]})]})})};export{n as M};
|