import { ReactNode, Ref } from 'react'; import { Color } from '../types.js'; import { SurfaceVariant } from './Surface.js'; export interface DialogRootProps { /** Trigger + dialog (+ optional close) elements. */ children: ReactNode; /** Initial open state (uncontrolled). Default `false`. Ignored when `open` is provided. */ defaultOpen?: boolean; /** Controlled open state. When provided, internal state is bypassed. */ open?: boolean; /** Fires whenever the open state should change (trigger click, outside click, escape, button press). */ onOpenChange?: (open: boolean) => void; } /** * State container for the `Dialog` + `DialogTrigger` + `Dialog` compound. Use when you want * the trigger and the dialog to be siblings in JSX: * * ```tsx * * * * * ``` * * Skip this and pass `open`/`onOpenChange` directly to `` if you'd rather control state. */ export declare const DialogRoot: ({ children, defaultOpen, open: openProp, onOpenChange, }: DialogRootProps) => import("react/jsx-runtime").JSX.Element; export interface DialogTriggerProps { /** Single React element to clone as the trigger. Must accept `onClick`. */ children: ReactNode; } /** * Wraps a single child element to act as the dialog trigger. **Clones** the child to attach * an `onClick` handler that toggles the surrounding `DialogRoot`'s open state (composed with * any existing `onClick` on the child). * * No-ops (renders the child as-is) when used outside a `DialogRoot`. Unlike `PopoverTrigger`, * this does **not** register an anchor ref - dialogs are centered on the viewport, not anchored. */ export declare const DialogTrigger: ({ children }: DialogTriggerProps) => import("react/jsx-runtime").JSX.Element; export interface DialogCloseProps { /** Single React element to clone as the close affordance. Must accept `onClick`. */ children: ReactNode; } /** * Wraps a single child element to close the surrounding dialog when clicked. **Clones** the * child to attach an `onClick` handler that flips the surrounding `DialogRoot`'s open state * to `false` (composed with any existing `onClick` on the child). * * ```tsx * * * * ... * * * * ``` * * No-ops (renders the child as-is) when used outside a `DialogRoot`. */ export declare const DialogClose: ({ children }: DialogCloseProps) => import("react/jsx-runtime").JSX.Element; export interface DialogProps { /** Controlled open state. When omitted, falls back to the surrounding `DialogRoot` state, then `false`. */ open?: boolean; /** Fires whenever the open state should change. When omitted, falls back to the `DialogRoot` setter. */ onOpenChange?: (open: boolean) => void; /** Portal target selector. Default `'#app, #__next, #root'` (first match wins). */ root?: string; /** * Selector for the container made `inert` while the dialog is open. Default `'.app-container'`. * * Used to block focus/interaction with the rest of the app while the modal is shown. */ inertContainer?: string; /** Fires after the close transition completes - use for unmount or post-dismiss cleanup. */ onClosed?: () => void; /** Extra classes applied to the dialog root `Surface`. */ className?: string; /** Extra classes applied to the inner content area. Default includes `flex flex-col gap-4 p-4`. */ contentClassName?: string; /** Title slot. Rendered as `
` with `text-cladd-md font-semibold`. Auto-wired to `aria-labelledby`. */ title?: ReactNode; /** Body text slot. Rendered as `
` with `text-cladd-sm leading-relaxed`. Auto-wired to `aria-describedby`. */ text?: ReactNode; /** Set to `true` when the dialog is rendered inside a React `lazy()` + `Suspense` boundary so it opens on the next tick (after the lazy chunk has resolved and mounted). */ lazy?: boolean; /** Custom button row. Rendered after the auto-generated cancel/confirm buttons (if any). */ buttons?: ReactNode; /** * "Type to confirm" guard. When set, renders an `Input` and disables the confirm button until the user types this exact string - used for destructive actions (e.g. type the project name to delete). */ requireConfirmText?: string; /** Stop click propagation on backdrop and surface. Useful when the dialog is rendered inside a clickable parent. */ stopPropagationOnClick?: boolean; /** Default `true`. */ closeOnBackdropClick?: boolean; /** Default `true`. Suppressed automatically when this dialog has a child popover/dialog open. */ closeOnEscape?: boolean; /** Label for the cancel button. When omitted, the cancel button is not rendered. */ cancelButtonText?: ReactNode; /** Label for the confirm button. When omitted, the confirm button is not rendered. */ confirmButtonText?: ReactNode; /** Color for the cancel button. Default `'neutral'`. */ cancelButtonColor?: Color; /** Color for the confirm button. Default: theme accent color. */ confirmButtonColor?: Color; /** Forwarded to the underlying `Surface` as `level`. Default `1`. */ surfaceLevel?: string | number; /** Surface variant. Default depends on theme: `'solid'` for light, `'gradient'` for dark. */ variant?: SurfaceVariant; /** Outline ring on the dialog surface. Default `true` for dark, `false` for light. */ outline?: boolean; /** Fires after the cancel button is pressed (the dialog also closes). */ onCancel?: () => void; /** Fires after the confirm button is pressed and the `requireConfirmText` guard (if any) is satisfied. */ onConfirm?: () => void; /** Forwarded to the dialog surface root. */ ref?: Ref; /** ARIA label fallback when no `aria-labelledby`/`title` is set. */ 'aria-label'?: string; /** Override the auto-wired label id. By default this is the `title` element's id. */ 'aria-labelledby'?: string; /** Override the auto-wired description id. By default this is the `text` element's id. */ 'aria-describedby'?: string; /** Custom content rendered between `text` and the optional confirm-input/buttons row. */ children?: ReactNode; } /** Shape of `Dialog` defaults that can be supplied via `CladdProvider`'s `defaults` prop. */ export type DialogDefaultProps = Partial>; export declare const Dialog: (props: DialogProps) => import("react/jsx-runtime").JSX.Element; //# sourceMappingURL=Dialog.d.ts.map