UNPKG

2.29 kBTypeScriptView Raw
1import * as React from "react";
2import { AbstractPureComponent2 } from "../../common";
3import { Props, MaybeElement } from "../../common/props";
4import { IconName } from "../icon/icon";
5import { IBackdropProps, OverlayableProps } from "../overlay/overlay";
6export declare type DialogProps = IDialogProps;
7/** @deprecated use DialogProps */
8export interface IDialogProps extends OverlayableProps, IBackdropProps, Props {
9 /**
10 * Toggles the visibility of the overlay and its children.
11 * This prop is required because the component is controlled.
12 */
13 isOpen: boolean;
14 /**
15 * Name of a Blueprint UI icon (or an icon element) to render in the
16 * dialog's header. Note that the header will only be rendered if `title` is
17 * provided.
18 */
19 icon?: IconName | MaybeElement;
20 /**
21 * Whether to show the close button in the dialog's header.
22 * Note that the header will only be rendered if `title` is provided.
23 *
24 * @default true
25 */
26 isCloseButtonShown?: boolean;
27 /**
28 * CSS styles to apply to the dialog.
29 *
30 * @default {}
31 */
32 style?: React.CSSProperties;
33 /**
34 * Title of the dialog. If provided, an element with `Classes.DIALOG_HEADER`
35 * will be rendered inside the dialog before any children elements.
36 */
37 title?: React.ReactNode;
38 /**
39 * Name of the transition for internal `CSSTransition`. Providing your own
40 * name here will require defining new CSS transition properties.
41 */
42 transitionName?: string;
43 /**
44 * ID of the element that contains title or label text for this dialog.
45 *
46 * By default, if the `title` prop is supplied, this component will generate
47 * a unique ID for the `<H4>` title element and use that ID here.
48 */
49 "aria-labelledby"?: string;
50 /**
51 * ID of an element that contains description text inside this dialog.
52 */
53 "aria-describedby"?: string;
54}
55export declare class Dialog extends AbstractPureComponent2<DialogProps> {
56 static defaultProps: DialogProps;
57 private titleId;
58 static displayName: string;
59 constructor(props: DialogProps);
60 render(): JSX.Element;
61 protected validateProps(props: DialogProps): void;
62 private maybeRenderCloseButton;
63 private maybeRenderHeader;
64}