forked from gumgum/storybook
/
index.js
132 lines (132 loc) · 2.42 KB
/
index.js
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
export const ADDON_ID = 'storybook-addon-viewport';
export const PANEL_ID = `${ADDON_ID}/addon-panel`;
export const UPDATE_VIEWPORT_EVENT_ID = 'addon:viewport:update';
export const CONFIGURE_VIEWPORT_EVENT_ID = 'addon:viewport:configure';
export const SET_STORY_DEFAULT_VIEWPORT_EVENT_ID = 'addon:viewport:setStoryDefaultViewport';
export const VIEWPORT_CHANGED_EVENT_ID = 'addon:viewport:viewportChanged';
export const INITIAL_VIEWPORTS = {
responsive: {
name: 'Responsive',
styles: {
width: '100%',
height: '100%',
border: 'none',
display: 'block',
boxShadow: 'none',
},
type: 'desktop',
},
iphone5: {
name: 'iPhone 5',
styles: {
height: '568px',
width: '320px',
},
type: 'mobile',
},
iphone6: {
name: 'iPhone 6',
styles: {
height: '667px',
width: '375px',
},
type: 'mobile',
},
iphone6p: {
name: 'iPhone 6 Plus',
styles: {
height: '736px',
width: '414px',
},
type: 'mobile',
},
iphone8p: {
name: 'iPhone 7 Plus',
styles: {
height: '960px',
width: '540px',
},
type: 'mobile',
},
iphonex: {
name: 'iPhone X',
styles: {
height: '1218px',
width: '563px',
},
type: 'mobile',
},
ipad: {
name: 'iPad',
styles: {
height: '1024px',
width: '768px',
},
type: 'tablet',
},
ipad10p: {
name: 'iPad Pro 10.5-in',
styles: {
height: '1112px',
width: '834px',
},
type: 'tablet',
},
ipad12p: {
name: 'iPad Pro 12.9-in',
styles: {
height: '1366px',
width: '1024px',
},
type: 'tablet',
},
galaxys5: {
name: 'Galaxy S5',
styles: {
height: '640px',
width: '360px',
},
type: 'mobile',
},
galaxys9: {
name: 'Galaxy S9',
styles: {
height: '1480px',
width: '720px',
},
type: 'mobile',
},
nexus5x: {
name: 'Nexus 5X',
styles: {
height: '660px',
width: '412px',
},
type: 'mobile',
},
nexus6p: {
name: 'Nexus 6P',
styles: {
height: '732px',
width: '412px',
},
type: 'mobile',
},
pixel: {
name: 'Pixel',
styles: {
height: '960px',
width: '540px',
},
type: 'mobile',
},
pixelxl: {
name: 'Pixel XL',
styles: {
height: '1280px',
width: '720px',
},
type: 'mobile',
},
};
export const DEFAULT_VIEWPORT = 'responsive';