1
1
import React from "react" ;
2
2
import { themes } from "@storybook/theming" ;
3
3
import { NextUIProvider } from "@nextui-org/system/src/provider" ;
4
- import type { Preview } from ' @storybook/react' ;
4
+ import type { Preview } from " @storybook/react" ;
5
5
6
- import ' ./style.css'
6
+ import " ./style.css" ;
7
7
8
- const decorators : Preview [ ' decorators' ] = [
9
- ( Story , { globals : { locale} } ) => {
10
- const direction =
11
- // @ts -ignore
12
- locale && new Intl . Locale ( locale ) ?. textInfo ?. direction === "rtl" ? "rtl" : undefined ;
8
+ const decorators : Preview [ " decorators" ] = [
9
+ ( Story , { globals : { locale} } ) => {
10
+ const direction =
11
+ // @ts -ignore
12
+ locale && new Intl . Locale ( locale ) ?. textInfo ?. direction === "rtl" ? "rtl" : undefined ;
13
13
14
- return (
15
- < NextUIProvider locale = { locale } >
16
- < div className = "bg-dark" lang = { locale } dir = { direction } >
17
- < Story />
18
- </ div >
19
- </ NextUIProvider >
20
- ) ;
21
- } ,
22
- ]
14
+ return (
15
+ < NextUIProvider locale = { locale } >
16
+ < div className = "bg-dark" lang = { locale } dir = { direction } >
17
+ < Story />
18
+ </ div >
19
+ </ NextUIProvider >
20
+ ) ;
21
+ } ,
22
+ ] ;
23
23
24
- const commonTheme = {
25
- brandTitle : "NextUI" ,
26
- brandUrl : "https://nextui.org" ,
27
- brandTarget : "_self" ,
28
- }
24
+ const commonTheme = {
25
+ brandTitle : "NextUI" ,
26
+ brandUrl : "https://nextui.org" ,
27
+ brandTarget : "_self" ,
28
+ } ;
29
29
30
- const parameters : Preview [ ' parameters' ] = {
30
+ const parameters : Preview [ " parameters" ] = {
31
31
actions : { argTypesRegex : "^on[A-Z].*" } ,
32
32
options : {
33
33
storySort : {
@@ -103,7 +103,7 @@ const locales = [
103
103
"zh-TW" ,
104
104
] ;
105
105
106
- const globalTypes : Preview [ ' globalTypes' ] = {
106
+ const globalTypes : Preview [ " globalTypes" ] = {
107
107
locale : {
108
108
toolbar : {
109
109
icon : "globe" ,
@@ -117,8 +117,10 @@ const globalTypes: Preview['globalTypes'] = {
117
117
} ,
118
118
} ;
119
119
120
- export default {
120
+ const preview : Preview = {
121
121
decorators,
122
122
parameters,
123
- globalTypes
124
- } satisfies Preview ;
123
+ globalTypes,
124
+ } ;
125
+
126
+ export default preview ;
0 commit comments