UNPKG

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