import { ReactNode } from 'react'; import { ModalHandle } from './useModalControl'; export interface DesktopOverrides { /** Margin around the modal panel in px. Affects max-size constraints. @default 24 */ safeMarginSize?: number; /** Show debug borders and labels on each slot (header, content, footer). */ debugMode?: boolean; /** Scroll behavior. 'content': only Content scrolls. 'dialog': entire panel scrolls. @default 'content' */ scroll?: "content" | "dialog"; /** Panel takes full available width. @default true */ expandX?: boolean; /** Panel takes max available height and Content auto-fills remaining space. */ expandY?: boolean; } export interface MobileOverrides { /** Snap points for the drawer. Accepts '%', 'px', numbers (0-1 as %), or 'auto' (fit content). @default ['auto'] */ snapPoints?: (string | number | "auto")[]; /** Hide the drawer completely when closed (no visible dragger). @default true via Modal */ hideOnClose?: boolean; } export interface ModalProps { /** Modal title — renders in header on both platforms */ title?: string; /** Modal content. Function form receives context passed via open(). */ children: ReactNode | ((context: TContext | null) => ReactNode); /** Ref from useModalControl — optional when using controlled `isOpen`. */ ref?: React.RefObject | null>; /** Called when the modal closes */ onClose?: (context: TContext | null) => void; /** Controlled open state. Changes trigger open/close on the active platform. Internal closes still work and notify via onClose. */ isOpen?: boolean; /** Additional CSS class for the modal container */ className?: string; /** z-index for the modal overlay and panel */ zIndex?: number; /** Render inside parent instead of portal to document.body */ attachToParent?: boolean; /** * Unmount children after close animation completes. * @default true */ unmountChildrenOnClose?: boolean; /** Hide the close button in the header */ hideCloseButton?: boolean; /** Show backdrop overlay behind the modal. @default true */ modal?: boolean; /** Close when clicking outside the panel. Works with or without backdrop. @default true */ closeOnOverlayClick?: boolean; /** Close on Escape key. Set false for non-dismissable flows. @default true */ closeOnEscape?: boolean; /** * Modal size. 'medium' and 'large' affect desktop width. * 'mobile' forces drawer mode regardless of screen size. */ size?: "medium" | "large" | "mobile"; /** Props that only apply on desktop (DesktopModal) */ desktopProps?: DesktopOverrides; /** Props that only apply on mobile (DrawerMobile) */ mobileProps?: MobileOverrides; } type ModalHeaderMarkerProps = { children?: ReactNode; title?: string; className?: string; expandY?: boolean; }; type ModalContentMarkerProps = { children?: ReactNode; className?: string; expandY?: boolean; }; type ModalFooterMarkerProps = { children?: ReactNode; className?: string; expandY?: boolean; }; type ModalHeaderActionsMarkerProps = { children?: ReactNode; className?: string; }; type ModalTitleMarkerProps = { children?: ReactNode; className?: string; }; declare const Modal: (({ children, ref, title, size, onClose, isOpen, className, zIndex, attachToParent, unmountChildrenOnClose, hideCloseButton, modal: showModal, closeOnOverlayClick, closeOnEscape, desktopProps, mobileProps, }: ModalProps) => import("react/jsx-runtime").JSX.Element) & { Header: ({ children, title, className, expandY: _expandY, }: ModalHeaderMarkerProps) => import("react/jsx-runtime").JSX.Element; HeaderActions: ({ children, }: ModalHeaderActionsMarkerProps) => ReactNode; Title: ({ children }: ModalTitleMarkerProps) => ReactNode; Content: import('react').NamedExoticComponent; Footer: ({ children, className, expandY: _expandY, }: ModalFooterMarkerProps) => import("react/jsx-runtime").JSX.Element | null; }; export default Modal;