/** * 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; /** Extra classes merged onto the dialog surface. */ className?: string; } /** * A centered modal dialog covering the three common blocking interactions: * alert, confirm and prompt. * * 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, className, }: ModalProps) => import("react/jsx-runtime").JSX.Element | null;