alpha
Login
or
Join now
nandi.uk
/
semble
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
This repository has no description
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
chore: storybook themeing
author
pdelfan
date
2 months ago
(Apr 29, 2026, 2:54 PM -0700)
commit
14455275
14455275775133ccb4026e808119bde8509669be
parent
361bf687
361bf6870731f2286eb50054e4df1fe1b1469563
+44
-12
1 changed file
Expand all
Collapse all
Unified
Split
src
webapp
.storybook
preview.tsx
+44
-12
src/webapp/.storybook/preview.tsx
View file
Reviewed
···
13
13
},
14
14
});
15
15
16
16
+
// Mantine's default body background colors
17
17
+
const MANTINE_LIGHT_BG = '#ffffff';
18
18
+
const MANTINE_DARK_BG = '#1A1B1E';
19
19
+
16
20
const preview: Preview = {
21
21
+
globalTypes: {
22
22
+
colorScheme: {
23
23
+
description: 'Mantine color scheme',
24
24
+
toolbar: {
25
25
+
title: 'Color Scheme',
26
26
+
icon: 'circlehollow',
27
27
+
items: [
28
28
+
{ value: 'light', title: 'Light', icon: 'sun' },
29
29
+
{ value: 'dark', title: 'Dark', icon: 'moon' },
30
30
+
],
31
31
+
dynamicTitle: true,
32
32
+
},
33
33
+
},
34
34
+
},
35
35
+
36
36
+
initialGlobals: {
37
37
+
colorScheme: 'light',
38
38
+
backgrounds: { value: MANTINE_LIGHT_BG },
39
39
+
},
40
40
+
17
41
parameters: {
18
42
nextjs: {
19
43
appDirectory: true,
···
24
48
date: /Date$/i,
25
49
},
26
50
},
27
27
-
51
51
+
backgrounds: {
52
52
+
options: {
53
53
+
light: { name: 'Light', value: MANTINE_LIGHT_BG },
54
54
+
dark: { name: 'Dark', value: MANTINE_DARK_BG },
55
55
+
},
56
56
+
},
28
57
a11y: {
29
58
// 'todo' - show a11y violations in the test UI only
30
59
// 'error' - fail CI on a11y violations
···
34
63
},
35
64
36
65
decorators: [
37
37
-
(Story) => (
38
38
-
<QueryClientProvider client={queryClient}>
39
39
-
<MantineProvider
40
40
-
theme={theme}
41
41
-
cssVariablesResolver={v8CssVariablesResolver}
42
42
-
defaultColorScheme="light"
43
43
-
>
44
44
-
<Story />
45
45
-
</MantineProvider>
46
46
-
</QueryClientProvider>
47
47
-
),
66
66
+
(Story, context) => {
67
67
+
const colorScheme = (context.globals.colorScheme as 'light' | 'dark') ?? 'light';
68
68
+
return (
69
69
+
<QueryClientProvider client={queryClient}>
70
70
+
<MantineProvider
71
71
+
theme={theme}
72
72
+
cssVariablesResolver={v8CssVariablesResolver}
73
73
+
forceColorScheme={colorScheme}
74
74
+
>
75
75
+
<Story />
76
76
+
</MantineProvider>
77
77
+
</QueryClientProvider>
78
78
+
);
79
79
+
},
48
80
],
49
81
};
50
82