UNPKG

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