Skip to content

Commit 7f884bc

Browse files
committed
feat(storybook): migrate preview to ts file
1 parent 17f154c commit 7f884bc

File tree

2 files changed

+10
-32
lines changed

2 files changed

+10
-32
lines changed

packages/bezier-react/.storybook/preview.js renamed to packages/bezier-react/.storybook/WithFoundationProvider.jsx

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,6 @@ const FoundationKeyword = {
1717
Dark: 'dark',
1818
}
1919

20-
export const parameters = {
21-
layout: 'centered',
22-
backgrounds: {
23-
default: 'light',
24-
values: [
25-
{
26-
name: 'light',
27-
value: 'white',
28-
},
29-
{
30-
name: 'dark',
31-
value: '#2f3233',
32-
},
33-
],
34-
}
35-
}
36-
37-
export const globalTypes = {
38-
Foundation: {
39-
name: 'Foundation',
40-
description: 'Global Foundation for components',
41-
defaultValue: 'light',
42-
toolbar: {
43-
icon: 'circlehollow',
44-
items: [FoundationKeyword.Light, FoundationKeyword.Dark],
45-
},
46-
},
47-
};
48-
4920
function getFoundation(keyword) {
5021
const isDarkFoundation = keyword === FoundationKeyword.Dark
5122
return {
@@ -87,7 +58,7 @@ const innerWrapperStyle = {
8758
borderRadius: 20,
8859
}
8960

90-
function withFoundationProvider(Story, context) {
61+
export function WithFoundationProvider(Story, context) {
9162
const {
9263
isDarkFoundation,
9364
foundation,
@@ -143,5 +114,3 @@ function withFoundationProvider(Story, context) {
143114
</FeatureProvider>
144115
)
145116
}
146-
147-
export const decorators = [withFoundationProvider]
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import type { Preview } from "@storybook/react"
2+
3+
import { WithFoundationProvider } from './WithFoundationProvider'
4+
5+
const preview: Preview = {
6+
decorators: [WithFoundationProvider],
7+
}
8+
9+
export default preview

0 commit comments

Comments
 (0)