UNPKG

2.61 kBTypeScriptView Raw
1import * as React from "react";
2import { AbstractPureComponent2 } from "../../common";
3import { Position } from "../../common/position";
4import { MaybeElement, Props } from "../../common/props";
5import { IconName } from "../icon/icon";
6import { IBackdropProps, OverlayableProps } from "../overlay/overlay";
7export declare enum DrawerSize {
8 SMALL = "360px",
9 STANDARD = "50%",
10 LARGE = "90%"
11}
12export declare type DrawerProps = IDrawerProps;
13/** @deprecated use DrawerProps */
14export interface IDrawerProps extends OverlayableProps, IBackdropProps, Props {
15 /** Drawer contents. */
16 children?: React.ReactNode;
17 /**
18 * Name of a Blueprint UI icon (or an icon element) to render in the
19 * drawer's header. Note that the header will only be rendered if `title` is
20 * provided.
21 */
22 icon?: IconName | MaybeElement;
23 /**
24 * Whether to show the close button in the dialog's header.
25 * Note that the header will only be rendered if `title` is provided.
26 *
27 * @default true
28 */
29 isCloseButtonShown?: boolean;
30 /**
31 * Toggles the visibility of the overlay and its children.
32 * This prop is required because the component is controlled.
33 */
34 isOpen: boolean;
35 /**
36 * Position of a drawer. All angled positions will be casted into pure positions
37 * (TOP, BOTTOM, LEFT or RIGHT).
38 *
39 * @default Position.RIGHT
40 */
41 position?: Position;
42 /**
43 * CSS size of the drawer. This sets `width` if horizontal position (default)
44 * and `height` otherwise.
45 *
46 * Constants are available for common sizes:
47 * - `DrawerSize.SMALL = 360px`
48 * - `DrawerSize.STANDARD = 50%`
49 * - `DrawerSize.LARGE = 90%`
50 *
51 * @default DrawerSize.STANDARD = "50%"
52 */
53 size?: number | string;
54 /**
55 * CSS styles to apply to the dialog.
56 *
57 * @default {}
58 */
59 style?: React.CSSProperties;
60 /**
61 * Title of the dialog. If provided, an element with `Classes.DIALOG_HEADER`
62 * will be rendered inside the dialog before any children elements.
63 */
64 title?: React.ReactNode;
65 /**
66 * Name of the transition for internal `CSSTransition`. Providing your own
67 * name here will require defining new CSS transition properties.
68 */
69 transitionName?: string;
70}
71export declare class Drawer extends AbstractPureComponent2<DrawerProps> {
72 static displayName: string;
73 static defaultProps: DrawerProps;
74 render(): JSX.Element;
75 protected validateProps(props: DrawerProps): void;
76 private maybeRenderCloseButton;
77 private maybeRenderHeader;
78}