import React, { ReactNode } from 'react'; import { Color } from '../types.js'; /** * Shape of the currently open dialog in the imperative dialog portal. The portal renders at * most one dialog at a time; opening a new one replaces the previous via the context setter. * Mirrors `DialogProps` for the props that the portal-rendered Dialog forwards. */ export type DialogsPortalData = { /** Dialog title - auto-wired to `aria-labelledby`. */ title: string; /** Dialog body text - auto-wired to `aria-describedby`. */ text: string | ReactNode; /** * Type-to-confirm guard. If string-coercible (truthy), the confirm button is disabled * until the user types this exact value. Forwarded to `Dialog.requireConfirmText` after * `String(...)` coercion. */ requireConfirmText?: boolean | string | ReactNode; /** Stop click propagation on backdrop and surface. */ stopPropagationOnClick?: 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; /** Fires when the confirm button is pressed (and the `requireConfirmText` guard passes). Always called with `true`. */ onConfirm?: (confirmed: boolean) => void; /** Fires when the cancel button is pressed. Always called with `false`. */ onCancel?: (cancelled: boolean) => void; /** Fires after the close transition completes - use for unmount cleanup. */ onClosed?: (closed: boolean) => void; /** Defer rendering until first opened, and unmount after close. */ lazy?: boolean; }; type DialogsPortalDataValue = { data: DialogsPortalData | null; state: boolean; }; type DialogsPortalApiValue = { setData: React.Dispatch>; setState: React.Dispatch>; }; export declare const DialogsPortalDataContext: React.Context; export declare const DialogsPortalApiContext: React.Context; export declare const DialogsPortalProvider: ({ children, }: { children: ReactNode; }) => import("react/jsx-runtime").JSX.Element; export declare const useDialogsPortalData: () => DialogsPortalDataValue; export declare const useDialogsPortalApi: () => DialogsPortalApiValue; export {}; //# sourceMappingURL=DialogsPortalContext.d.ts.map