// Copyright (c) Jupyter Development Team. // Distributed under the terms of the Modified BSD License. import { Message } from 'phosphor/lib/core/messaging'; import { Panel } from 'phosphor/lib/ui/panel'; import { Widget } from 'phosphor/lib/ui/widget'; /** * The class name added to dialog instances. */ const DIALOG_CLASS = 'jp-Dialog'; /** * The class name added to dialog content node. */ const CONTENT_CLASS = 'jp-Dialog-content'; /** * The class name added to dialog header node. */ const HEADER_CLASS = 'jp-Dialog-header'; /** * The class name added to dialog title node. */ const TITLE_CLASS = 'jp-Dialog-title'; /** * The class name added to dialog body node. */ const BODY_CLASS = 'jp-Dialog-body'; /** * The class name added to a dialog body content node. */ const BODY_CONTENT_CLASS = 'jp-Dialog-bodyContent'; /** * The class name added to a dialog content node. */ const FOOTER_CLASS = 'jp-Dialog-footer'; /** * The class name added to a dialog button node. */ const BUTTON_CLASS = 'jp-Dialog-button'; /** * The class name added to a dialog button icon node. */ const BUTTON_ICON_CLASS = 'jp-Dialog-buttonIcon'; /** * The class name added to a dialog button text node. */ const BUTTON_TEXT_CLASS = 'jp-Dialog-buttonText'; /* * The class name added to dialog Confirm buttons. */ const OK_BUTTON_CLASS = 'jp-Dialog-okButton'; /** * The class name added to dialog Cancel buttons. */ const CANCEL_BUTTON_CLASS = 'jp-Dialog-cancelButton'; /** * The class name added to dialog Warning buttons. */ const WARNING_BUTTON_CLASS = 'jp-Dialog-warningButton'; /** * The class name added to dialog input field wrappers. */ const INPUT_WRAPPER_CLASS = 'jp-Dialog-inputWrapper'; /** * The class name added to dialog input fields. */ const INPUT_CLASS = 'jp-Dialog-input'; /** * The class name added to dialog select wrappers. */ const SELECT_WRAPPER_CLASS = 'jp-Dialog-selectWrapper'; /** * The class name added to dialog select nodes. */ const SELECT_CLASS = 'jp-Dialog-select'; /** * A button applied to a dialog. */ export interface IButtonItem { /** * The text for the button. */ text: string; /** * The icon class for the button. */ icon?: string; /** * The extra class name to associate with the button. */ className?: string; } /** * A default confirmation button. */ export const okButton: IButtonItem = { text: 'OK', className: OK_BUTTON_CLASS }; /** * A default cancel button. */ export const cancelButton: IButtonItem = { text: 'CANCEL', className: CANCEL_BUTTON_CLASS }; /** * A default delete button. */ export const deleteButton: IButtonItem = { text: 'DELETE', className: WARNING_BUTTON_CLASS }; /** * A default warn button. */ export const warnButton: IButtonItem = { text: 'OK', className: WARNING_BUTTON_CLASS }; /** * The options used to create a dialog. */ export interface IDialogOptions { /** * The tope level text for the dialog (defaults to an empty string). */ title?: string; /** * The main body element for the dialog or a message to display. * * #### Notes * If a `string` is provided, it will be used as the `HTMLContent` of * a ``. If an `` or `