UNPKG

@uva-glass/component-library

Version:

React components UvA

43 lines (42 loc) 2.62 kB
import { FormHTMLAttributes, PropsWithChildren, ReactNode } from 'react'; import { AriaDialogProps } from '@react-types/dialog'; export interface ModalDialogProps { /** The buttons of the dialog. */ buttons?: ReactNode; /** `true` if the dialog can be closed by clicking outside of it; otherwise, `false`. The default is `false`. */ isDismissable?: boolean; /** `true` to disable closing the dialog with the keyboard; otherwise, `false`. The default is `false`. */ isKeyboardDismissDisabled?: boolean; /** `true` to show a spinner, if the contents of the dialog is lazy loaded; otherwise, `false`. The default is `false`. */ isLoading?: boolean; /** The `aria-valuetext` value of the [Spinner](/story/atoms-spinner--spinner-example) component. The default is `'Loading'` Used together with `isLoading`. */ spinnerAriaValueText?: string; /** The `aria-label` value of the [OverlayCloseButton](/story/atoms-overlayclosebutton--overlay-close-button-example) component. The default is `'Close'` */ closeButtonAriaValueText?: string; /** `true` to render the dialog opened; otherwise, `false`. The default is `false`. */ isOpen: boolean; /** `true` to disable form validation; otherwise, `false`. The default is `false`. */ noValidate?: boolean; /** The callback function that is invoked when the dialog is closed. */ onClose?(): void; /** The callback function that is invoked when the form is submitted. */ onSubmit?: FormHTMLAttributes<HTMLFormElement>['onSubmit']; /** The `aria-role` value of the dialog. Possible values are `'dialog'`, `'alertdialog'`. The default is `'dialog'`. */ role?: AriaDialogProps['role']; /** The title of the dialog. */ title?: string; /** The contents of the dialog header. */ headerContent?: ReactNode; /** The variant of the dialog. */ variant?: 'confirm' | 'dialog'; /** `true` to add padding to the dialog; otherwise, `false`. The default is `false`. */ padded?: boolean; /** `true` to display the dialog in a slimmer form; otherwise, `false`. The default is `false`. */ slim?: boolean; /** `true` to display the dialog in a wider form; otherwise, `false`. The default is `false`. */ wide?: boolean; /** `true` to show a border between the main content of the dialog and the buttons; otherwise, `false`. The default is `false`. */ noButtonBorder?: boolean; } /** Represents a component for a modal dialog. */ export declare function ModalDialog(props: PropsWithChildren<ModalDialogProps>): import("react/jsx-runtime").JSX.Element | null;