UNPKG

@rws-air/webcomponents

Version:
49 lines 1.65 kB
import { DialogProps } from '@mui/material/Dialog'; import { DialogContentProps } from '@mui/material/DialogContent'; import { DialogTitleProps } from '@mui/material/DialogTitle'; import React, { ReactNode } from 'react'; export interface ModalQAs { /** Data-qa applied to the main modal */ modal?: string; /** Data-qa applied to the title */ title?: string; /** Data-qa applied to the content */ content?: string; } export interface ModalProps { /** Whether the modal should be opened or not */ open: boolean; /** The content to show in the modal */ dialogContent: JSX.Element; /** Title for the modal */ topic: string | ReactNode; /** Any othe props passed to the Dialog */ DialogProps?: DialogProps; /** Any other props passed to the DialogContent */ DialogContentProps?: DialogContentProps; /** Any other props passed to the DialogTitle */ DialogTitleProps?: DialogTitleProps; /** Object of data-qa tags to pass to the modal */ modalqas?: ModalQAs; /** The action to trigger to close this modal */ closeAction(): void; } /** * Constructs a modal using pre-defined Rijkswaterstaat styling * @param props Props to pass to the modal - {@link ModalProps} * @example * ```jsx * <Modal * topic='topic' * modalqas={{ * modal: 'modal', * content: 'content', * title: 'title', * }} * dialogContent={<div>SAMPLE</div>} * open={true} * /> * ``` */ export declare const Modal: React.MemoExoticComponent<({ DialogContentProps, DialogTitleProps, DialogProps, ...props }: ModalProps) => JSX.Element>; //# sourceMappingURL=index.d.ts.map