-
Notifications
You must be signed in to change notification settings - Fork 39
/
preview.jsx
49 lines (44 loc) · 1.06 KB
/
preview.jsx
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
import * as React from 'react';
import { Box, Provider as MosaicProvider } from '@stoplight/mosaic';
import { Title, Subtitle, Description, Primary, ArgsTable, PRIMARY_STORY } from '@storybook/addon-docs/blocks';
import customTheme from './theme';
import { injectStyles } from '@stoplight/mosaic';
export const globalTypes = {
theme: {
name: 'Theme',
description: 'Global theme for components',
defaultValue: 'light',
toolbar: {
icon: 'circlehollow',
items: ['light', 'dark'],
},
},
};
const MosaicProviderDecorator = Story => {
injectStyles();
return (
<MosaicProvider>
<Box mx="auto" py={20} px={8} style={{ maxWidth: 800 }}>
<Story />
</Box>
</MosaicProvider>
);
};
export const decorators = [MosaicProviderDecorator];
export const parameters = {
docs: {
page: () => (
<>
<Title />
<Subtitle />
<Description />
<Primary />
<ArgsTable story={PRIMARY_STORY} />
</>
),
theme: customTheme,
},
storySort: {
order: ['Default'],
},
};