import { default as React } from 'react'; /** * Which of the three dialog shapes to render. * * - `alert` — a single OK button. * - `confirm` — Cancel and Confirm. * - `prompt` — Cancel and Confirm, plus a text input. */ export type ModalType = 'alert' | 'confirm' | 'prompt'; export interface ModalProps { /** Whether the dialog is mounted. Nothing renders when `false`. */ open: boolean; /** Dialog shape. Defaults to `"alert"`. */ type?: ModalType; /** Heading text. */ title: string; /** Body text. Newlines are preserved. */ message?: string; /** Initial value of the input when `type` is `"prompt"`. */ defaultValue?: string; /** * Called on Confirm/OK and on Enter. Receives the input text for `prompt`, * and `undefined` for `alert` and `confirm`. */ onConfirm?: (value?: string) => void; /** Called on Cancel, on the close button, on Escape, and on backdrop click. */ onCancel?: () => void; /** Label for the confirm button. Defaults to `"OK"` / `"Confirm"` by `type`. */ confirmLabel?: string; /** Label for the cancel button. Defaults to `"Cancel"`. */ cancelLabel?: string; /** Placeholder for the prompt input. */ placeholder?: string; /** * Arbitrary dialog content — a form, an editor, a review panel. Replaces * the message, icon, prompt input and default buttons; supply your own * actions with `footer`. Enter is not intercepted, so textareas work. */ children?: React.ReactNode; /** Action row for a content dialog. Omit for none. */ footer?: React.ReactNode; /** Dialog width. Defaults to `"md"`. */ size?: 'sm' | 'md' | 'lg' | 'xl' | 'full'; /** Whether a click on the backdrop cancels. Defaults to `true`. */ closeOnBackdrop?: boolean; /** Extra classes merged onto the dialog surface. */ className?: string; } /** * A centered modal dialog covering the three common blocking interactions — * alert, confirm and prompt — or, given `children`, any content at all. * * Keyboard focus is trapped inside while open and returned to whatever had it * when the dialog closes. In a content dialog, the first element marked * `data-autofocus` (else the first focusable one) receives focus. * * Fully controlled — it owns only the prompt's draft text. Escape, backdrop * click and the close button all route to `onCancel`; Enter routes to * `onConfirm`. For the promise-based variant driven by `useModalStore` (so you * can `await openConfirm(...)` from anywhere), see `ConnectedModal`. * * @example * ```tsx * rename(name)} * onCancel={() => setOpen(false)} * /> * ``` */ export declare const Modal: ({ open, type, title, message, defaultValue, onConfirm, onCancel, confirmLabel, cancelLabel, placeholder, children, footer, size, closeOnBackdrop, className, }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;