-
Notifications
You must be signed in to change notification settings - Fork 15
/
utilities.js.flow
54 lines (48 loc) · 1.1 KB
/
utilities.js.flow
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
// @flow
import * as React from 'react';
type MarginSize =
| 0.25
| 0.5
| 1
| 1.5
| 2
| 3
| -0.25
| -0.5
| -1
| -1.5
| -2
| -3
| 'auto';
type CommonProps = {|
'data-guide'?: string,
'data-test'?: string,
'data-tracking'?: string,
'data-masking'?: boolean,
ma?: MarginSize,
mt?: MarginSize,
mb?: MarginSize,
ml?: MarginSize,
mr?: MarginSize,
|};
type VibesContextValue = {|
responsive: boolean,
|};
type getFocusableElements = (el: HTMLElement) => NodeList<Element>;
type isFocusableElement = (el: HTMLElement) => boolean;
declare module.exports: {
CommonProps: CommonProps,
convertRemToPixel: (rem: number) => number,
pickCommonProps: (props: CommonProps) => CommonProps,
VibesContext: React.Context<VibesContextValue>,
useResponsive: (responsiveProp?: boolean) => boolean,
VibesProvider: ({
children: React.Node,
fixedLayout?: boolean,
portalParent?: HTMLElement,
portalParentRef?: React.Ref<HTMLElement>,
lang?: 'ja' | 'en',
}) => React.Node,
getFocusableElements: getFocusableElements,
isFocusableElement: isFocusableElement,
};