import { X } from 'lucide-react'; /** * The single modal shell for the app (design.md). * Plain dark overlay (no backdrop-blur), hairline paper2 panel. * * Props: * - isOpen / onClose * - title (string, rendered lowercase serif) — optional * - eyebrow (string, mono UPPERCASE micro label above title) — optional * - size: 'sm' | 'md' | 'lg' | 'xl' (max width; default 'md') * - children: body content * - footer: optional node pinned under the body * - hideClose: hide the X button */ const SIZES = { sm: 'max-w-sm', md: 'max-w-md', lg: 'max-w-2xl', xl: 'max-w-5xl', }; export default function Modal({ isOpen, onClose, title, eyebrow, size = 'md', children, footer, hideClose = false }) { if (!isOpen) return null; return ( /* Phone: a bottom sheet — anchored to the thumb, edge to edge, and free to run taller than a centred dialog whose 4px side margins wasted the only width there was. From sm up it is the centred dialog it always was. */
{ if (e.target === e.currentTarget && onClose) onClose(); }} role="dialog" aria-modal="true" >
{/* Grab handle: the affordance that says "this sheet closes downward". */} {!hideClose && onClose && ( )} {(title || eyebrow) && (
{eyebrow &&

{eyebrow}

} {title &&

{title}

}
)}
{children}
{footer && (
{footer}
)} {!footer &&
}
); }