-
Notifications
You must be signed in to change notification settings - Fork 3
/
preview.js
75 lines (69 loc) · 1.61 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
import { actions } from "@storybook/addon-actions";
import { DocsContainer } from "@storybook/addon-docs";
import { unpackDecorator } from "@kickstartds/core/lib/storybook/helpers";
import "@kickstartds/base/lib/global/base.js";
import "@kickstartds/base/lib/global/base.css";
import "../src/index.js";
import "../static/index.css";
import IconSprite from "../src/token/icons/IconSprite";
import Providers from "../src/components/Providers";
import { LinkProvider } from "../src/docs/LinkProvider";
const myActions = actions("radio");
window._ks.radio.on("*", myActions.radio);
const providerDecorator = (Story, context) => (
<Providers>
<Story {...context} />
</Providers>
);
export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
options: {
storySort: {
order: [
"Docs",
["Welcome", "Integration"],
"Pages",
"Components",
"Layout",
"Recipes",
"Design Tokens",
],
method: "alphabetical",
},
},
designToken: {
disable: true,
},
docs: {
container: (props) => (
<LinkProvider>
<Providers>
<IconSprite />
<DocsContainer {...props} />
</Providers>
</LinkProvider>
),
},
playroom: {
url:
process.env.NODE_ENV === "production"
? "http://localhost:9000/playroom/"
: "http://localhost:9000",
},
};
export const decorators = [
unpackDecorator,
providerDecorator,
(Story) => (
<>
<IconSprite />
<Story />
</>
),
];