-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreview.js
88 lines (84 loc) · 1.73 KB
/
preview.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
import ColorSchemes from '../storybook/colorScheme';
import { withCommonLibs, FullScreen, withColorScheme } from '../storybook/decorator';
import { withDesign } from 'storybook-addon-designs';
export const decorators = [FullScreen, withCommonLibs, withColorScheme, withDesign];
const viewports = {
iPhoneX: {
name: 'iPhone X',
styles: {
width: '375px',
height: '812px',
},
},
iPhoneSE: {
name: 'iPhone SE',
styles: {
width: '320px',
height: '568px',
},
},
iPhone13Pro: {
name: 'iPhone 13 Pro',
styles: {
width: '428px',
height: '926px',
},
},
GalaxyS8: {
name: 'Samsung Galaxy S8',
styles: {
width: '360px',
height: '740px',
},
},
iPadPro11Landscape: {
name: 'iPad Pro 11" (landscape)',
styles: {
width: '1024px',
height: '756px',
},
},
iPadPro11Portrait: {
name: 'iPad Pro 11" (portrait)',
styles: {
width: '756px',
height: '1024px',
},
},
};
export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
layout: 'none',
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
backgrounds: {
default: 'white',
values: Object.entries(ColorSchemes.procivis)
.filter(([_, value]) => typeof value === 'string')
.map(([name, value]) => ({ name, value })),
grid: {
cellSize: 8,
cellAmount: 3,
opacity: 0.15,
},
},
viewport: {
defaultViewport: 'iPhoneX',
viewports,
},
};
export const globalTypes = {
colorScheme: {
name: 'Color Scheme',
defaultValue: 'procivis',
toolbar: {
icon: 'eye',
items: Object.keys(ColorSchemes),
showName: true,
},
},
};