import * as React from 'react'; import { cn } from '@/lib/utils'; import { Dialog, DialogContent, DialogDescription, DialogTitle, } from '@/components/ui/dialog'; const KICKER_CLASS = 'font-mono text-[10px] uppercase tracking-[0.22em]'; type ModalSize = 'sm' | 'md' | 'lg' | 'xl'; const SIZE_CLASS: Record = { sm: 'max-w-sm', md: 'max-w-md', lg: 'max-w-lg', xl: 'max-w-xl w-[95vw]', }; interface ModalProps { open: boolean; onOpenChange: (open: boolean) => void; children: React.ReactNode; size?: ModalSize; className?: string; } export function Modal({ open, onOpenChange, children, size = 'md', className }: ModalProps) { return ( {children} ); } interface ModalHeaderBaseProps { kicker: string; title: React.ReactNode; description?: string; } function HeaderShell({ kicker, title, description, railClassName, kickerClassName, }: ModalHeaderBaseProps & { railClassName: string; kickerClassName: string }) { return (
{kicker}
{title} {description ?? (typeof title === 'string' ? title : kicker)}
); } export function ModalHeader(props: ModalHeaderBaseProps) { return ( ); } export function ModalDestructiveHeader(props: ModalHeaderBaseProps) { return ( ); } export function ModalBody({ className, ...props }: React.HTMLAttributes) { return
; } interface ModalFooterProps { primary: React.ReactNode; secondary?: React.ReactNode; hint?: React.ReactNode; hintAccent?: React.ReactNode; } export function ModalFooter({ primary, secondary, hint, hintAccent }: ModalFooterProps) { return (
{hint} {hintAccent !== undefined && ( {hintAccent} )}
{secondary} {primary}
); }