import { PropsWithChildren, ReactElement, ReactNode, default as React } from 'react'; import { AriaDialogProps } from 'react-aria'; import { DialogOverlayProps } from '../../../.deps/ui/core-web/src'; import { BreakpointKey } from '../../../hooks/useScreenHasMinWidth'; import { ButtonProps } from '../../Button/Button'; type InputDialogPresentation = 'sheet' | 'prompt'; type InputDialogSize = 'fit-content' | 'full-screen'; export interface InputDialogProps extends AriaDialogProps, Pick { /** * The id of the dialog. */ id?: string; /** * The children of the dialog. */ children: ReactNode; /** * The label of the close button. * @default 'Close' */ closeButtonLabel?: string; /** * The close button variant. * @default 'secondary' */ closeButtonVariant?: ButtonProps['variant']; /** * Whether the dialog is open (controlled). */ isOpen?: boolean; /** * Whether the dialog is open by default (uncontrolled). */ isDefaultOpen?: boolean; /** * The label of the dialog. */ label: ReactNode; /** * The maximum width of the dialog. * @default true */ maxWidth?: boolean | BreakpointKey; /** * The function that is called when the open state changes. */ onOpenChange?: (isOpen: boolean) => void; /** * The size of the dialog. * @default 'fit-content' */ size?: InputDialogSize; /** * The element that opens the dialog; its open state is reflected via cloned * `aria-expanded` / `aria-controls`. */ trigger: ReactElement; /** * The presentation of the dialog. * @default 'sheet' */ presentation?: InputDialogPresentation; /** * Whether to autofocus the first tabbable element on open. * @default true */ autoFocus?: DialogOverlayProps['autoFocus']; } export interface InputDialogHeaderProps extends PropsWithChildren<{ close: () => void; }> { } export type InputDialogInputProps = PropsWithChildren; export type InputDialogBodyProps = PropsWithChildren; export type InputDialogBodyInnerProps = PropsWithChildren; /** * A dialog that is used to display input field. * Used for creating a mobile friendly dialog that contains input field. * * **⚠️ INTERNAL UI KIT USE ONLY** * * @internal */ export declare const InputDialog: React.ForwardRefExoticComponent> & { Input: React.ForwardRefExoticComponent<{ children?: ReactNode | undefined; } & React.RefAttributes> & { displayName: string; }; Divider: React.ForwardRefExoticComponent, "ref"> & React.RefAttributes> & { displayName: string; }; Body: React.ForwardRefExoticComponent<{ children?: ReactNode | undefined; } & React.RefAttributes> & { displayName: string; }; BodyInner: any; }; export {};