UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

37 lines (36 loc) 1.51 kB
import { BoxProps, ElementProps, Factory, MantineSize, StylesApiProps } from '../../core'; import { AffixBaseProps } from '../Affix'; import { PaperBaseProps } from '../Paper'; import { TransitionOverride } from '../Transition'; export type DialogStylesNames = 'root' | 'closeButton'; export type DialogCssVariables = { root: '--dialog-size'; }; export interface DialogProps extends BoxProps, AffixBaseProps, PaperBaseProps, StylesApiProps<DialogFactory>, ElementProps<'div'> { /** If set, the component uses `display: none` to hide the root element instead of removing the DOM node @default false */ keepMounted?: boolean; /** If set, displays the close button @default true */ withCloseButton?: boolean; /** Called on close button click */ onClose?: () => void; /** Dialog content */ children?: React.ReactNode; /** Opened state */ opened: boolean; /** Props passed down to the underlying `Transition` component @default { transition: 'pop-top-right', duration: 200 } */ transitionProps?: TransitionOverride; /** Controls `width` of the dialog @default 'md' */ size?: MantineSize | (string & {}) | number; } export type DialogFactory = Factory<{ props: DialogProps; ref: HTMLDivElement; stylesNames: DialogStylesNames; vars: DialogCssVariables; }>; export declare const Dialog: import("../..").MantineComponent<{ props: DialogProps; ref: HTMLDivElement; stylesNames: DialogStylesNames; vars: DialogCssVariables; }>;