import React from 'react'; import { CloseOrigin as BaseCloseOrigin } from '../BaseDialog'; interface AlertDialogProps { /** * The text on the cancel button. */ cancelButtonText?: string; /** * The text on the confirm button. */ confirmButtonText?: string; /** * As with all the other waffles components, dataAttributes can be used to set * data- html attributes on the element. */ dataAttributes?: { [key: string]: string; }; /** * The body text to render in the Dialog. */ description: string; /** * The main intention of the Dialog. This is used to set the button colors and * provide a default focus when the Dialog opens. */ intent?: 'neutral' | 'success' | 'warning' | 'danger'; /** * When this is set to true the Dialog will show. It is preferred to use this * to control when to display the dialog rather than simply mounting and * unmounting as setting this to false allows the close animation to play * fully. */ isOpen: boolean; /** * When this is set to true the Modal will show a spinner in the confirmation * button.The user will not be able to close the dialog while it's loading */ loading?: boolean; /** * This function is called whenever the user requests to close the Dialog. It * is the responsibility of the application to handle this correctly and set * isOpen to false. This function will be called with an origin string that * specifies how the user requested to close the modal. */ onClose: (origin: CloseOrigin) => void; /** * This function is called whenever the user clicks the confirm button. */ onConfirm: () => void; /** * The main heading for the Dialog. */ title: string; } declare type CloseOrigin = 'cancelButton' | BaseCloseOrigin; declare const AlertDialog: ({ cancelButtonText, confirmButtonText, dataAttributes, description, intent, isOpen, loading, onClose, onConfirm, title, }: AlertDialogProps) => React.ReactElement; export default AlertDialog;