forked from navikt/aksel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreview.js
53 lines (49 loc) · 1.1 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
import "@navikt/ds-css/index.css";
import "@navikt/ds-css-internal/index.css";
import "./layout.css";
export const parameters = {
/* actions: { argTypesRegex: "^on[A-Z].*" }, */
options: {
storySort: {
method: "",
order: ["Intro", "ds-icons", "ds-react", ["form"], ["Default"]],
locales: "",
},
},
viewMode: "docs",
layout: "centered",
backgrounds: {
default: "Canvas",
values: [
{
name: "Canvas",
value: "#ffffff",
},
{
name: "Darkmode",
value: "#262626",
},
],
},
};
export const globalTypes = {
theme: {
name: "Theme",
description: "Global theme for components",
defaultValue: "light",
toolbar: {
icon: "circlehollow",
items: [
{ value: "light", icon: "circlehollow", title: "light" },
{ value: "dark", icon: "circle", title: "dark" },
],
showName: true,
},
},
};
export const withTheme = (StoryFn, context) => (
<div data-theme={context.parameters.theme || context.globals.theme}>
<StoryFn />
</div>
);
export const decorators = [withTheme];