-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpreview.ts
More file actions
49 lines (46 loc) · 1.14 KB
/
preview.ts
File metadata and controls
49 lines (46 loc) · 1.14 KB
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 type { Preview } from '@storybook/react';
import React from 'react';
import { OverlayProvider } from 'overlay-kit';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import '../src/style/reset.css.ts';
import '../src/style/global.css.ts';
const queryClient = new QueryClient();
const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
backgrounds: {
default: 'dark',
values: [
{
name: 'dark',
value: '#02050B',
},
{
name: 'light',
value: '#ffffff',
},
],
},
a11y: {
// 'todo' - show a11y violations in the test UI only
// 'error' - fail CI on a11y violations
// 'off' - skip a11y checks entirely
test: 'todo',
},
},
decorators: [
(Story) =>
React.createElement(
QueryClientProvider,
{ client: queryClient },
React.createElement(OverlayProvider, null, React.createElement(Story)),
),
],
};
export default preview;