generated from nl-design-system/example
-
Notifications
You must be signed in to change notification settings - Fork 1
/
preview.tsx
100 lines (96 loc) · 2.73 KB
/
preview.tsx
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
import { LuxDocument } from '@lux-design-system/components-react';
import { defineCustomElements } from '@lux-design-system/web-components-stencil/loader/index.js';
import { withThemeByClassName } from '@storybook/addon-themes';
import type { Preview, ReactRenderer } from '@storybook/react';
import '@lux-design-system/font/src/index.scss';
import './themes';
import '../src/styles/theme.css';
defineCustomElements();
const preview: Preview = {
decorators: [
// LUX-303: Spike - Mogelijkheid thema's en modus te splitsen in Storybook themes.
withThemeByClassName<ReactRenderer>({
themes: {
'DigiD light': 'lux-theme--digid-light',
'DigiD dark': 'lux-theme--digid-dark',
'Logius light': 'lux-theme--logius-light',
'Logius dark': 'lux-theme--logius-dark',
'Mijn Overheid light': 'lux-theme--mijnoverheid-light',
'Mijn Overheid dark': 'lux-theme--mijnoverheid-dark',
'NLdoc light': 'lux-theme--nldoc-light',
'NLdoc dark': 'lux-theme--nldoc-dark',
},
defaultTheme: 'Logius light',
}),
(Story, { parameters: { withDocument = true } }) =>
withDocument ? (
<LuxDocument>
<Story />
</LuxDocument>
) : (
<Story />
),
],
parameters: {
backgrounds: {
default: 'default',
values: [
{
name: 'default',
value: 'var(--lux-color-background-default)',
},
{
/*
Deliberately provide a background which we'd never use in production.
This helps us identify the component boundaries. Use purple because
it's Aline's favorite color.
*/
name: 'boundaries',
value: 'rebeccapurple',
},
{
name: 'transparent',
value:
'fixed repeating-conic-gradient(#CCC 0% 25%, var(--lux-color-background-default) 0% 50%) 50% / 20px 20px',
},
{
name: 'light',
value: 'white',
},
{
name: 'dark',
value: 'black',
},
],
},
chromatic: {
disable: true,
// Enable on story level. Not every story needs to be tested.
disableSnapshot: true,
},
controls: { expanded: false },
docs: {
toc: {
headingSelector: 'h2',
title: 'Op deze pagina',
},
},
options: {
showPanel: true,
panelPosition: 'bottom',
storySort: {
order: [
'Intro',
'Design Tokens',
['Design Tokens', 'Core', 'Common'],
'React Components',
'Web Components',
['Docs', 'Playground', '*', 'Design Tokens'],
'*',
'Colofon',
],
},
},
},
};
export default preview;