UNPKG

@nozzlegear/react-win-dialog

Version:

An attempt to recreate the Dialog element from WinJS.

76 lines (72 loc) 2.18 kB
import * as React_2 from 'react'; export declare function Dialog(props: Props): React_2.JSX.Element; export declare type Props = React_2.PropsWithChildren<{ /** * The dialog's title. */ title: string; /** * Whether the dialog is open or not. */ open: boolean; /** * Change's the dialog's outline and primary button color to red when true. */ danger?: boolean; /** * Indicates that data is being loaded or saved. */ loading?: boolean; /** * A custom component to use as the loading indicator when {@link Props.loading} is true. * @default `<progress />` */ loadingComponent?: React_2.ReactNode | React_2.ComponentType; /** * Whether the dialog should hide its primary and secondary buttons when {@link Props.loading} is true. * */ loadingHidesButtons?: boolean; /** * The dialog's primary (right) button text. */ primaryText?: string; /** * The dialog's secondary (left) button text. */ secondaryText?: string; /** * Event handler called when the primary (right) button is clicked. */ onPrimaryClick?: (event: React_2.FormEvent<HTMLButtonElement>) => void; /** * Event handler called when the secondary (left) button is clicked. */ onSecondaryClick?: (event: React_2.FormEvent<HTMLButtonElement>) => void; /** * Style object applied to the dialog's overlay. */ overlayStyle?: React_2.CSSProperties; /** * Whether the dialog should prevent scrolling of the body elements under/behind the dialog when the dialog is open. * @default true */ overlayPreventsScrolling?: boolean; /** * Style object applied to the dialog container. */ containerStyle?: React_2.CSSProperties; /** * Style object applied to the dialog. */ dialogStyle?: React_2.CSSProperties; /** * Id applied to the dialog container. */ id?: string; /** * Classname applied to the dialog container. */ className?: string; }>; export { }