@@ -3,39 +3,17 @@ import './styles.scss';
3
3
// eslint-disable-next-line import/order
4
4
import '@gravity-ui/uikit/styles/styles.css' ;
5
5
6
- import React from 'react' ;
7
-
8
- import { Lang , MobileProvider , ThemeProvider , configure as uiKitConfigure } from '@gravity-ui/uikit' ;
9
6
import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport' ;
10
- import type { Decorator , Preview } from '@storybook/react' ;
11
-
12
- import { configure } from '../src' ;
7
+ import type { Preview } from '@storybook/react' ;
13
8
14
9
import { withLang } from './decorators/withLang' ;
15
10
import { withMobile } from './decorators/withMobile' ;
11
+ import { withStrictMode } from './decorators/withStrictMode' ;
12
+ import { withTheme } from './decorators/withTheme' ;
16
13
import { Docs } from './docs' ;
17
14
18
- configure ( {
19
- lang : Lang . En ,
20
- } ) ;
21
- uiKitConfigure ( {
22
- lang : Lang . En ,
23
- } ) ;
24
-
25
- const withContextProvider : Decorator = ( Story , context ) => {
26
- return (
27
- < React . StrictMode >
28
- < ThemeProvider theme = { context . globals . theme } >
29
- < MobileProvider >
30
- < Story { ...context } />
31
- </ MobileProvider >
32
- </ ThemeProvider >
33
- </ React . StrictMode >
34
- ) ;
35
- } ;
36
-
37
15
const preview : Preview = {
38
- decorators : [ withMobile , withLang , withContextProvider ] ,
16
+ decorators : [ withLang , withMobile , withTheme , withStrictMode ] ,
39
17
parameters : {
40
18
docs : {
41
19
page : Docs ,
@@ -60,9 +38,10 @@ const preview: Preview = {
60
38
items : [
61
39
{ value : 'light' , right : '☼' , title : 'Light' } ,
62
40
{ value : 'dark' , right : '☾' , title : 'Dark' } ,
63
- { value : 'light-hc' , right : '☼' , title : 'High Contrast Light (beta )' } ,
64
- { value : 'dark-hc' , right : '☾' , title : 'High Contrast Dark (beta )' } ,
41
+ { value : 'light-hc' , right : '☼' , title : 'Light (high contrast )' } ,
42
+ { value : 'dark-hc' , right : '☾' , title : 'Dark (high contrast )' } ,
65
43
] ,
44
+ dynamicTitle : true ,
66
45
} ,
67
46
} ,
68
47
lang : {
@@ -74,6 +53,19 @@ const preview: Preview = {
74
53
{ value : 'en' , right : '🇬🇧' , title : 'En' } ,
75
54
{ value : 'ru' , right : '🇷🇺' , title : 'Ru' } ,
76
55
] ,
56
+ dynamicTitle : true ,
57
+ } ,
58
+ } ,
59
+ direction : {
60
+ defaultValue : 'ltr' ,
61
+ toolbar : {
62
+ title : 'Direction' ,
63
+ icon : 'menu' ,
64
+ items : [
65
+ { value : 'ltr' , title : 'Left to Right' , icon : 'arrowrightalt' } ,
66
+ { value : 'rtl' , title : 'Right to Left' , icon : 'arrowleftalt' } ,
67
+ ] ,
68
+ dynamicTitle : true ,
77
69
} ,
78
70
} ,
79
71
platform : {
@@ -84,6 +76,7 @@ const preview: Preview = {
84
76
{ value : 'desktop' , title : 'Desktop' , icon : 'browser' } ,
85
77
{ value : 'mobile' , title : 'Mobile' , icon : 'mobile' } ,
86
78
] ,
79
+ dynamicTitle : true ,
87
80
} ,
88
81
} ,
89
82
} ,
0 commit comments