UNPKG

@porsche-design-system/components-react

Version:

Porsche Design System is a component library designed to help developers create the best experience for software or services distributed by Dr. Ing. h.c. F. Porsche AG.

101 lines (100 loc) 4.24 kB
import type { BaseProps } from '../../BaseProps'; import type { SelectedAriaAttributes, ModalAriaAttribute, ModalBackdrop, ModalBackground, BreakpointCustomizable, ModalMotionHiddenEndEventDetail, ModalMotionVisibleEndEventDetail } from '../types'; export type PModalProps = BaseProps & { /** * Sets ARIA attributes on the dialog element for improved accessibility when no visible heading is present. */ aria?: SelectedAriaAttributes<ModalAriaAttribute>; /** * Sets the backdrop style. Use `blur` when the modal is opened by user interaction; use `shading` when opened automatically (e.g. Cookie Consent). * @default 'blur' */ backdrop?: ModalBackdrop; /** * Sets the background color of the modal panel (`canvas` or `surface`). * @default 'canvas' */ background?: ModalBackground; /** * When enabled, clicking the backdrop will not close the modal. * @default false */ disableBackdropClick?: boolean; /** * Shows a dismiss button in the modal header so the user can manually close it. * @default true */ dismissButton?: boolean; /** * Expands the modal to the full viewport size, intended for mobile use cases. Supports responsive breakpoint values. * @default false */ fullscreen?: BreakpointCustomizable<boolean>; /** * Emitted when the user closes the modal via the dismiss button, backdrop click, or Escape key. */ onDismiss?: (event: CustomEvent<void>) => void; /** * Emitted after the modal's close transition completes and the dialog is fully hidden. */ onMotionHiddenEnd?: (event: CustomEvent<ModalMotionHiddenEndEventDetail>) => void; /** * Emitted after the modal's open transition completes and the dialog is fully visible. */ onMotionVisibleEnd?: (event: CustomEvent<ModalMotionVisibleEndEventDetail>) => void; /** * Controls whether the modal dialog is visible. * @default false */ open: boolean; }; export declare const PModal: import("react").ForwardRefExoticComponent<Omit<import("react").DOMAttributes<{}>, "onChange" | "onInput" | "onToggle"> & Pick<import("react").HTMLAttributes<{}>, "suppressHydrationWarning" | "autoFocus" | "className" | "dir" | "hidden" | "id" | "inert" | "inputMode" | "lang" | "slot" | "style" | "tabIndex" | "title" | "translate" | "role"> & { /** * Sets ARIA attributes on the dialog element for improved accessibility when no visible heading is present. */ aria?: SelectedAriaAttributes<ModalAriaAttribute>; /** * Sets the backdrop style. Use `blur` when the modal is opened by user interaction; use `shading` when opened automatically (e.g. Cookie Consent). * @default 'blur' */ backdrop?: ModalBackdrop; /** * Sets the background color of the modal panel (`canvas` or `surface`). * @default 'canvas' */ background?: ModalBackground; /** * When enabled, clicking the backdrop will not close the modal. * @default false */ disableBackdropClick?: boolean; /** * Shows a dismiss button in the modal header so the user can manually close it. * @default true */ dismissButton?: boolean; /** * Expands the modal to the full viewport size, intended for mobile use cases. Supports responsive breakpoint values. * @default false */ fullscreen?: BreakpointCustomizable<boolean>; /** * Emitted when the user closes the modal via the dismiss button, backdrop click, or Escape key. */ onDismiss?: (event: CustomEvent<void>) => void; /** * Emitted after the modal's close transition completes and the dialog is fully hidden. */ onMotionHiddenEnd?: (event: CustomEvent<ModalMotionHiddenEndEventDetail>) => void; /** * Emitted after the modal's open transition completes and the dialog is fully visible. */ onMotionVisibleEnd?: (event: CustomEvent<ModalMotionVisibleEndEventDetail>) => void; /** * Controls whether the modal dialog is visible. * @default false */ open: boolean; } & { children?: import("react").ReactNode | undefined; } & import("react").RefAttributes<HTMLElement>>;