// nyashelf-modals.jsx // Modal/sheet primitive + ToastProvider + a few task-specific modals // (NotesModal, ExportCsvModal, ConfirmDialog). // ───────────────────────────────────────────────────────────────────────────── // Modal — bottom-sheet style modal on top of the phone area. position: fixed // anchors to .nya-stage (transformed ancestor) so it fills the phone exactly. // ───────────────────────────────────────────────────────────────────────────── function Modal({ open, onClose, title, children, footer, maxHeight = 600 }) { React.useEffect(() => { if (!open) return; const onKey = (e) => { if (e.key === 'Escape') onClose?.(); }; window.addEventListener('keydown', onKey); return () => window.removeEventListener('keydown', onKey); }, [open, onClose]); if (!open) return null; return (
e.stopPropagation()} style={{ background: 'linear-gradient(180deg, rgba(60,40,90,.55), rgba(30,18,55,.85))', backdropFilter: 'blur(24px) saturate(160%)', WebkitBackdropFilter: 'blur(24px) saturate(160%)', borderTop: '1px solid var(--card-border)', borderLeft: '1px solid var(--card-border)', borderRight: '1px solid var(--card-border)', borderTopLeftRadius: 28, borderTopRightRadius: 28, maxHeight: maxHeight, display: 'flex', flexDirection: 'column', animation: 'nya-slide-up .25s ease forwards', boxShadow: '0 -10px 40px rgba(0,0,0,.4), 0 -2px 0 rgba(255,255,255,.05) inset', }} > {/* grab handle */}
{/* title bar */} {title && (

{title}

)} {/* body */}
{children}
{/* sticky footer */} {footer && (
{footer}
)}
); } // Form helpers for use inside modals function FormField({ label, children, hint }) { return (
{children} {hint && (
{hint}
)}
); } function FormInput({ value, onChange, type = 'text', placeholder, multiline = false }) { const base = { width: '100%', padding: '11px 14px', background: 'rgba(255,255,255,.05)', border: '1px solid var(--card-border)', borderRadius: 14, outline: 0, color: 'var(--text)', fontFamily: 'Quicksand, sans-serif', fontSize: 14, fontWeight: 500, transition: 'border-color .15s', }; if (multiline) { return (