import type { ReactNode } from 'react';
import type { OmitStrict } from '../../types';
import type { PopoverProps } from '../Popover';
import type { ProgressProps } from '../Progress';
export interface BaseDialogProps {
    /**
     * Certain uses of dialogs require a linear edge with an input like control.
     * There an arrow is not desired.
     * @default true
     */
    arrow?: PopoverProps['arrow'];
    /**
     * An element the dialog is contextually and visually associated with. Normally a triggering button.
     * Components rendering Dialog should mount and unmount instances based on this value.
     */
    target: HTMLElement;
    /** Content for the dialog. Avoid form control buttons within as those should be rendered by way of onCancel and onSubmit with FormDialog. */
    children: PopoverProps['children'];
    /** If there is a progress state either on opening, or after submit, you must indicate as such. A custom message is supported as well. */
    progress?: boolean | ProgressProps['message'];
    /** Optionally render the dialog element at the end of the body or within a specified element. */
    portal?: PopoverProps['portal'];
    /** Positioning strategy for solving rendering scenarios. */
    strategy?: PopoverProps['strategy'];
    /**
     * Intended positioning placement for the dialog element.
     * Placement may auto adjust based on screen position and other layout variables.
     */
    placement?: PopoverProps['placement'];
    /** Reference to the dialog's root element. */
    ref?: PopoverProps['ref'];
}
export type DialogProps = BaseDialogProps & {
    /** The DOM id for the dialog's visible labelling element. */
    labelledbyId?: string;
    /** Provide a contextually sufficient aria label if a visible labelling element is not present. */
    ariaLabel?: string;
};
/** A simple callback or an object to customize a subset button properties. */
type FormAction = (() => void) | {
    text?: string;
    disabled?: boolean;
    handler: () => void;
};
export type FormDialogProps = BaseDialogProps & {
    /** Called when the user presses escape or clicks away. */
    onDismiss?: () => void;
    /**
     * Renders a standard design system cancel button.
     * If onDismiss is not provided, onCancel will be invoked when the user presses the Escape key or clicks outside of the dialog.
     * Invocation of this indicates the user wishes to cancel any changes and close the dialog.
     */
    onCancel: FormAction;
    /**
     * Renders a standard design system submit button.
     * Invocation of this indicates the user wishes to submit any changes and close the dialog. Please consider progress states after submit.
     */
    onSubmit: FormAction;
} & ({
    /** A string to indicate context for the dialog. The dialog will be labelled by this value. */
    heading: string;
    ariaLabel?: never;
} | {
    /** Provide a contextually sufficient aria label if a visible heading is not provided. */
    heading?: never;
    ariaLabel: string;
});
export interface InfoDialogProps extends OmitStrict<BaseDialogProps, 'arrow'> {
    /** A string or summary item like props to indicate context for the dialog. The dialog will be labelled by either the heading element or primary property. */
    heading?: string | {
        primary: string;
        secondary?: string;
        visual?: ReactNode;
    };
    /** Renders a standard design system dismiss button to close the dialog when the user clicks this button, presses escape or clicks away. */
    onDismiss: () => void;
}
/**
 * Components which render Dialog internally may need to offer some control to consuming components.
 * Use this interface to offer an imperative handle for shared control.
 */
export interface DialogHandleValue {
    open: () => void;
    close: () => void;
}
export {};
//# sourceMappingURL=Dialog.types.d.ts.map