-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.d.ts
92 lines (89 loc) · 2.36 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
import * as React from 'react';
type VoidFunction = (...args: any[]) => void;
export interface SheetProps {
/**
* Function, that returns Sheet container
* @default () => document.body
*/
getContainer?: () => React.ReactNode;
/**
* Sheet placement
* @default bottom
*/
placement?: 'top' | 'bottom' | 'right' | 'left';
/**
* Intent from container side. (for example, if placement == "bottom", then indent from left and right sides)
* @default '0'
*/
sideIndent?: string;
/**
* Sheet className
*/
className?: string;
/**
* Sheet z-index
* @default 100
*/
zIndex?: number;
/**
* Sheet trigger
*/
children?: React.ReactChildren | (({ open: VoidFunction, close: VoidFunction, toggle: VoidFunction, isOpen: boolean }) => React.ReactChildren);
/**
* Sheet content
*/
content?: React.ReactChildren | (({ close: VoidFunction }) => React.ReactChildren);
/**
* Whether close Sheet on Escape button press or not
* @default true
*/
closeOnEscape?: boolean;
/**
* Whether close Sheet on Enter button press or not
* @default false
*/
closeOnEnter?: boolean;
/**
* Whether close Sheet on remote click or not
* @default true
*/
closeOnRemoteClick?: boolean;
/**
* Whether Sheet open or not (use if you want to control Sheet open state)
*/
isOpen?: boolean;
/**
* Handler, called when sheet should change opened state
*/
onChangeOpen?: (isOpen: boolean) => void;
/**
* Sheet trigger container tag
* @default 'div'
*/
triggerContainerTag?: string,
/**
* Whether render Sheet into getContainer() or on place
* @default true
*/
usePortal?: boolean;
/**
* framer-motion animation props for opening/closing Sheet
* @default { transition: { ease: 'easeInOut' } }
*/
animation?: Object;
/**
* Sheet size (initial size if resizable)
* @default '25rem'
*/
size?: string,
/**
* Whether Sheet resizable or not
* @default false
*/
resizable?: boolean;
/**
* resize Sheet handler, called with current Sheet size as number (px)
*/
onResize?: (size: number) => void;
}
export default class Sheet extends React.Component<SheetProps> {}