@itcase/storybook-config 1.1.83 → 1.1.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/decorators/withExtraProviders.js +22 -0
  2. package/dist/cjs/decorators/withFigmaSourceLink.js +35 -0
  3. package/dist/cjs/decorators/withFormSubmitDecorator.js +23 -0
  4. package/dist/cjs/decorators/withLayoutDecorator.js +33 -0
  5. package/dist/cjs/decorators/withNextDecorator.js +69 -0
  6. package/dist/cjs/decorators/withUiDecorator.js +15 -0
  7. package/dist/cjs/decorators.js +19 -166
  8. package/dist/decorators/withExtraProviders.js +20 -0
  9. package/dist/decorators/withFigmaSourceLink.js +33 -0
  10. package/dist/decorators/withFormSubmitDecorator.js +21 -0
  11. package/dist/decorators/withLayoutDecorator.js +31 -0
  12. package/dist/decorators/withNextDecorator.js +67 -0
  13. package/dist/decorators/withUiDecorator.js +13 -0
  14. package/dist/decorators.js +13 -164
  15. package/dist/hasFormParameters-CWMGd5t1.js +7 -0
  16. package/dist/hasFormParameters-CtI_uSU6.js +5 -0
  17. package/package.json +14 -10
  18. package/dist/config/addons/addonThemes.js +0 -16
  19. package/dist/config/addons/addonsNextJs.js +0 -10
  20. package/dist/config/addons/addonsVite.js +0 -10
  21. package/dist/config/addons/addonsWebpack.js +0 -30
  22. package/dist/config/backgrounds/index.js +0 -24
  23. package/dist/config/config/mainConfigVite.js +0 -8
  24. package/dist/config/config/mainConfigWebpack.js +0 -65
  25. package/dist/config/framework/frameworkNextJs.js +0 -5
  26. package/dist/config/framework/frameworkVite.js +0 -5
  27. package/dist/config/framework/frameworkWebpack.js +0 -12
  28. package/dist/config/main/index.js +0 -31
  29. package/dist/config/msw/index.js +0 -3
  30. package/dist/config/msw/mswHandlers.js +0 -15
  31. package/dist/config/preview/index.js +0 -6
  32. package/dist/config/static/staticDirsNextJs.js +0 -7
  33. package/dist/config/static/staticDirsVite.js +0 -3
  34. package/dist/config/static/staticDirsWebpack.js +0 -3
  35. package/dist/config/users/authorization.js +0 -9
  36. package/dist/config/users/users.js +0 -22
  37. package/dist/config/viewport/index.js +0 -22
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ function withExtraProviders(providers) {
6
+ if (providers === void 0) {
7
+ providers = [];
8
+ }
9
+ if (!Array.isArray(providers)) throw new Error('withExtraProviders requires an array of components');
10
+ return function (StoryFn, context) {
11
+ var currentStory = StoryFn(context);
12
+ for (var i = providers.length - 1; i >= 0; i--) {
13
+ var item = providers[i];
14
+ var Component = item.provider;
15
+ var props = item.props || {};
16
+ currentStory = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Component, props, currentStory));
17
+ }
18
+ return currentStory;
19
+ };
20
+ }
21
+
22
+ exports.withExtraProviders = withExtraProviders;
@@ -0,0 +1,35 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var castArray = require('lodash/castArray');
5
+
6
+ function withFigmaSourceLink() {
7
+ var decorator = function decorator(Story, _ref) {
8
+ var parameters = _ref.parameters,
9
+ context = _ref.context;
10
+ var sourceLink = parameters.sourceLink || {};
11
+ if (parameters.design) {
12
+ var designList = castArray(parameters.design);
13
+ if (!sourceLink.links) {
14
+ sourceLink.links = {};
15
+ }
16
+ designList.forEach(function (design) {
17
+ var groupKey = "" + design.type + (design.name || '');
18
+ sourceLink.links[groupKey] = {
19
+ label: 'Figma — ' + context.title + (design.name ? ' / ' + design.name : ''),
20
+ href: design.url,
21
+ icon: 'FigmaIcon'
22
+ };
23
+ });
24
+ }
25
+ var updatedContext = Object.assign({}, context, {
26
+ parameters: Object.assign({}, context.parameters, {
27
+ sourceLink: sourceLink
28
+ })
29
+ });
30
+ return /*#__PURE__*/React.createElement(Story, updatedContext);
31
+ };
32
+ return decorator;
33
+ }
34
+
35
+ exports.withFigmaSourceLink = withFigmaSourceLink;
@@ -0,0 +1,23 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var index = require('../components/FormSubmitWrapper.js');
5
+ require('lodash/camelCase');
6
+ require('@itcase/common');
7
+ require('msw');
8
+ var hasFormParameters = require('../../hasFormParameters-CWMGd5t1.js');
9
+
10
+ function withFormSubmitDecorator() {
11
+ var decorator = function decorator(Story, _ref) {
12
+ _ref.args;
13
+ var parameters = _ref.parameters,
14
+ context = _ref.context;
15
+ var updatedContext = Object.assign({}, context, {
16
+ parameters: Object.assign({}, context.parameters)
17
+ });
18
+ return hasFormParameters.hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(index.FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext);
19
+ };
20
+ return decorator;
21
+ }
22
+
23
+ exports.withFormSubmitDecorator = withFormSubmitDecorator;
@@ -0,0 +1,33 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ function withLayoutDecorator() {
6
+ return function (Story, _ref) {
7
+ var parameters = _ref.parameters;
8
+ var layouts = {
9
+ top: 'sb-layout-top',
10
+ right: 'sb-layout-right',
11
+ bottom: 'sb-layout-bottom',
12
+ left: 'sb-layout-left',
13
+ center: 'sb-layout-center'
14
+ };
15
+ var layoutClass = layouts[(parameters == null ? void 0 : parameters.layout) || ''];
16
+ var maxWidthStyle = {
17
+ width: parameters.maxWidth && '100%',
18
+ maxWidth: parameters == null ? void 0 : parameters.maxWidth
19
+ };
20
+ if (!layoutClass) {
21
+ return /*#__PURE__*/React.createElement("div", {
22
+ style: maxWidthStyle
23
+ }, /*#__PURE__*/React.createElement(Story, null));
24
+ }
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ className: layoutClass
27
+ }, /*#__PURE__*/React.createElement("div", {
28
+ style: maxWidthStyle
29
+ }, /*#__PURE__*/React.createElement(Story, null)));
30
+ };
31
+ }
32
+
33
+ exports.withLayoutDecorator = withLayoutDecorator;
@@ -0,0 +1,69 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var Notifications = require('@itcase/ui/context/Notifications');
5
+ var UIContext = require('@itcase/ui/context/UIContext');
6
+ var index = require('../components/FormSubmitWrapper.js');
7
+ require('lodash/camelCase');
8
+ require('@itcase/common');
9
+ var msw = require('msw');
10
+ var hasFormParameters = require('../../hasFormParameters-CWMGd5t1.js');
11
+
12
+ var serverErrorHandler = function serverErrorHandler(formUrl, errors) {
13
+ return msw.http.post(formUrl, function () {
14
+ return msw.HttpResponse.json(errors, {
15
+ status: 400
16
+ });
17
+ });
18
+ };
19
+
20
+ function handleMSWParameters(parameters, args) {
21
+ var mswHandlersParams = {};
22
+ if (parameters.serverError) {
23
+ mswHandlersParams = {
24
+ msw: {
25
+ handlers: [serverErrorHandler(parameters.formUrl, args.errors)]
26
+ }
27
+ };
28
+ }
29
+ // else if (parameters.error500) {
30
+ // mswHandlersParams = {
31
+ // msw: {
32
+ // handlers: [error500Handler(parameters.formUrl)],
33
+ // },
34
+ // }
35
+ // }
36
+
37
+ return mswHandlersParams;
38
+ }
39
+
40
+ function withNextDecoratorFactory(_ref) {
41
+ var App = _ref.App,
42
+ RootStoreProvider = _ref.RootStoreProvider;
43
+ var decorator = function decorator(Story, _ref2) {
44
+ var args = _ref2.args,
45
+ parameters = _ref2.parameters,
46
+ context = _ref2.context;
47
+ var mswHandlersParams = handleMSWParameters(parameters, args);
48
+ var updatedContext = Object.assign({}, context, {
49
+ parameters: Object.assign({}, context.parameters, mswHandlersParams)
50
+ });
51
+ updatedContext.context = updatedContext;
52
+ if (parameters.page) {
53
+ return /*#__PURE__*/React.createElement(App, {
54
+ Component: Story,
55
+ pageProps: args
56
+ });
57
+ }
58
+ if (hasFormParameters.hasFormParameters(parameters) && !parameters.formUrl) {
59
+ throw new Error('Set "formUrl" in stories!');
60
+ }
61
+ if (parameters.storeData) {
62
+ throw new Error('Use store/s/DataSet, add "s"!');
63
+ }
64
+ return /*#__PURE__*/React.createElement(RootStoreProvider, parameters.storesData, /*#__PURE__*/React.createElement(UIContext.UIProvider, null, /*#__PURE__*/React.createElement(Notifications.NotificationsProvider, null, hasFormParameters.hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(index.FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext))));
65
+ };
66
+ return decorator;
67
+ }
68
+
69
+ exports.withNextDecoratorFactory = withNextDecoratorFactory;
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var Notifications = require('@itcase/ui/context/Notifications');
5
+ var UIContext = require('@itcase/ui/context/UIContext');
6
+
7
+ function withUiDecorator(Story, _ref) {
8
+ var args = _ref.args,
9
+ parameters = _ref.parameters;
10
+ return /*#__PURE__*/React.createElement(UIContext.UIProvider, null, /*#__PURE__*/React.createElement(Notifications.NotificationsProvider, {
11
+ initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
12
+ }, /*#__PURE__*/React.createElement(Story, null)));
13
+ }
14
+
15
+ exports.withUiDecorator = withUiDecorator;
@@ -1,173 +1,26 @@
1
1
  'use strict';
2
2
 
3
- var React = require('react');
4
- var castArray = require('lodash/castArray');
5
- var index = require('./components/FormSubmitWrapper.js');
3
+ var withExtraProviders = require('./decorators/withExtraProviders.js');
4
+ var withFigmaSourceLink = require('./decorators/withFigmaSourceLink.js');
5
+ var withFormSubmitDecorator = require('./decorators/withFormSubmitDecorator.js');
6
+ var withLayoutDecorator = require('./decorators/withLayoutDecorator.js');
7
+ var withNextDecorator = require('./decorators/withNextDecorator.js');
8
+ var withUiDecorator = require('./decorators/withUiDecorator.js');
9
+ require('react');
10
+ require('lodash/castArray');
11
+ require('./components/FormSubmitWrapper.js');
6
12
  require('lodash/camelCase');
7
13
  require('@itcase/common');
8
- var msw = require('msw');
9
- var Notifications = require('@itcase/ui/context/Notifications');
10
- var UIContext = require('@itcase/ui/context/UIContext');
14
+ require('msw');
15
+ require('../hasFormParameters-CWMGd5t1.js');
16
+ require('@itcase/ui/context/Notifications');
17
+ require('@itcase/ui/context/UIContext');
11
18
 
12
- function withExtraProviders(providers) {
13
- if (providers === void 0) {
14
- providers = [];
15
- }
16
- if (!Array.isArray(providers)) throw new Error('withExtraProviders requires an array of components');
17
- return function (StoryFn, context) {
18
- var currentStory = StoryFn(context);
19
- for (var i = providers.length - 1; i >= 0; i--) {
20
- var item = providers[i];
21
- var Component = item.provider;
22
- var props = item.props || {};
23
- currentStory = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Component, props, currentStory));
24
- }
25
- return currentStory;
26
- };
27
- }
28
19
 
29
- function withFigmaSourceLink() {
30
- var decorator = function decorator(Story, _ref) {
31
- var parameters = _ref.parameters,
32
- context = _ref.context;
33
- var sourceLink = parameters.sourceLink || {};
34
- if (parameters.design) {
35
- var designList = castArray(parameters.design);
36
- if (!sourceLink.links) {
37
- sourceLink.links = {};
38
- }
39
- designList.forEach(function (design) {
40
- var groupKey = "" + design.type + (design.name || '');
41
- sourceLink.links[groupKey] = {
42
- label: 'Figma — ' + context.title + (design.name ? ' / ' + design.name : ''),
43
- href: design.url,
44
- icon: 'FigmaIcon'
45
- };
46
- });
47
- }
48
- var updatedContext = Object.assign({}, context, {
49
- parameters: Object.assign({}, context.parameters, {
50
- sourceLink: sourceLink
51
- })
52
- });
53
- return /*#__PURE__*/React.createElement(Story, updatedContext);
54
- };
55
- return decorator;
56
- }
57
20
 
58
- var serverErrorHandler = function serverErrorHandler(formUrl, errors) {
59
- return msw.http.post(formUrl, function () {
60
- return msw.HttpResponse.json(errors, {
61
- status: 400
62
- });
63
- });
64
- };
65
-
66
- function handleMSWParameters(parameters, args) {
67
- var mswHandlersParams = {};
68
- if (parameters.serverError) {
69
- mswHandlersParams = {
70
- msw: {
71
- handlers: [serverErrorHandler(parameters.formUrl, args.errors)]
72
- }
73
- };
74
- }
75
- // else if (parameters.error500) {
76
- // mswHandlersParams = {
77
- // msw: {
78
- // handlers: [error500Handler(parameters.formUrl)],
79
- // },
80
- // }
81
- // }
82
-
83
- return mswHandlersParams;
84
- }
85
-
86
- function hasFormParameters(parameters) {
87
- return Boolean(parameters.require || parameters.validation || parameters.error || parameters.serverError || parameters.serverErrorData);
88
- }
89
-
90
- function withFormSubmitDecorator() {
91
- var decorator = function decorator(Story, _ref) {
92
- _ref.args;
93
- var parameters = _ref.parameters,
94
- context = _ref.context;
95
- var updatedContext = Object.assign({}, context, {
96
- parameters: Object.assign({}, context.parameters)
97
- });
98
- return hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(index.FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext);
99
- };
100
- return decorator;
101
- }
102
-
103
- function withLayoutDecorator() {
104
- return function (Story, _ref) {
105
- var parameters = _ref.parameters;
106
- var layouts = {
107
- top: 'sb-layout-top',
108
- right: 'sb-layout-right',
109
- bottom: 'sb-layout-bottom',
110
- left: 'sb-layout-left',
111
- center: 'sb-layout-center'
112
- };
113
- var layoutClass = layouts[(parameters == null ? void 0 : parameters.layout) || ''];
114
- var maxWidthStyle = {
115
- width: parameters.maxWidth && '100%',
116
- maxWidth: parameters == null ? void 0 : parameters.maxWidth
117
- };
118
- if (!layoutClass) {
119
- return /*#__PURE__*/React.createElement("div", {
120
- style: maxWidthStyle
121
- }, /*#__PURE__*/React.createElement(Story, null));
122
- }
123
- return /*#__PURE__*/React.createElement("div", {
124
- className: layoutClass
125
- }, /*#__PURE__*/React.createElement("div", {
126
- style: maxWidthStyle
127
- }, /*#__PURE__*/React.createElement(Story, null)));
128
- };
129
- }
130
-
131
- function withNextDecoratorFactory(_ref) {
132
- var App = _ref.App,
133
- RootStoreProvider = _ref.RootStoreProvider;
134
- var decorator = function decorator(Story, _ref2) {
135
- var args = _ref2.args,
136
- parameters = _ref2.parameters,
137
- context = _ref2.context;
138
- var mswHandlersParams = handleMSWParameters(parameters, args);
139
- var updatedContext = Object.assign({}, context, {
140
- parameters: Object.assign({}, context.parameters, mswHandlersParams)
141
- });
142
- updatedContext.context = updatedContext;
143
- if (parameters.page) {
144
- return /*#__PURE__*/React.createElement(App, {
145
- Component: Story,
146
- pageProps: args
147
- });
148
- }
149
- if (hasFormParameters(parameters) && !parameters.formUrl) {
150
- throw new Error('Set "formUrl" in stories!');
151
- }
152
- if (parameters.storeData) {
153
- throw new Error('Use store/s/DataSet, add "s"!');
154
- }
155
- return /*#__PURE__*/React.createElement(RootStoreProvider, parameters.storesData, /*#__PURE__*/React.createElement(UIContext.UIProvider, null, /*#__PURE__*/React.createElement(Notifications.NotificationsProvider, null, hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(index.FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext))));
156
- };
157
- return decorator;
158
- }
159
-
160
- function withUiDecorator(Story, _ref) {
161
- var args = _ref.args,
162
- parameters = _ref.parameters;
163
- return /*#__PURE__*/React.createElement(UIContext.UIProvider, null, /*#__PURE__*/React.createElement(Notifications.NotificationsProvider, {
164
- initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
165
- }, /*#__PURE__*/React.createElement(Story, null)));
166
- }
167
-
168
- exports.withExtraProviders = withExtraProviders;
169
- exports.withFigmaSourceLink = withFigmaSourceLink;
170
- exports.withFormSubmitDecorator = withFormSubmitDecorator;
171
- exports.withLayoutDecorator = withLayoutDecorator;
172
- exports.withNextDecoratorFactory = withNextDecoratorFactory;
173
- exports.withUiDecorator = withUiDecorator;
21
+ exports.withExtraProviders = withExtraProviders.withExtraProviders;
22
+ exports.withFigmaSourceLink = withFigmaSourceLink.withFigmaSourceLink;
23
+ exports.withFormSubmitDecorator = withFormSubmitDecorator.withFormSubmitDecorator;
24
+ exports.withLayoutDecorator = withLayoutDecorator.withLayoutDecorator;
25
+ exports.withNextDecoratorFactory = withNextDecorator.withNextDecoratorFactory;
26
+ exports.withUiDecorator = withUiDecorator.withUiDecorator;
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+
3
+ function withExtraProviders(providers) {
4
+ if (providers === void 0) {
5
+ providers = [];
6
+ }
7
+ if (!Array.isArray(providers)) throw new Error('withExtraProviders requires an array of components');
8
+ return function (StoryFn, context) {
9
+ var currentStory = StoryFn(context);
10
+ for (var i = providers.length - 1; i >= 0; i--) {
11
+ var item = providers[i];
12
+ var Component = item.provider;
13
+ var props = item.props || {};
14
+ currentStory = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Component, props, currentStory));
15
+ }
16
+ return currentStory;
17
+ };
18
+ }
19
+
20
+ export { withExtraProviders };
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import castArray from 'lodash/castArray';
3
+
4
+ function withFigmaSourceLink() {
5
+ var decorator = function decorator(Story, _ref) {
6
+ var parameters = _ref.parameters,
7
+ context = _ref.context;
8
+ var sourceLink = parameters.sourceLink || {};
9
+ if (parameters.design) {
10
+ var designList = castArray(parameters.design);
11
+ if (!sourceLink.links) {
12
+ sourceLink.links = {};
13
+ }
14
+ designList.forEach(function (design) {
15
+ var groupKey = "" + design.type + (design.name || '');
16
+ sourceLink.links[groupKey] = {
17
+ label: 'Figma — ' + context.title + (design.name ? ' / ' + design.name : ''),
18
+ href: design.url,
19
+ icon: 'FigmaIcon'
20
+ };
21
+ });
22
+ }
23
+ var updatedContext = Object.assign({}, context, {
24
+ parameters: Object.assign({}, context.parameters, {
25
+ sourceLink: sourceLink
26
+ })
27
+ });
28
+ return /*#__PURE__*/React.createElement(Story, updatedContext);
29
+ };
30
+ return decorator;
31
+ }
32
+
33
+ export { withFigmaSourceLink };
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { FormSubmitWrapper } from '../components/FormSubmitWrapper.js';
3
+ import 'lodash/camelCase';
4
+ import '@itcase/common';
5
+ import 'msw';
6
+ import { h as hasFormParameters } from '../hasFormParameters-CtI_uSU6.js';
7
+
8
+ function withFormSubmitDecorator() {
9
+ var decorator = function decorator(Story, _ref) {
10
+ _ref.args;
11
+ var parameters = _ref.parameters,
12
+ context = _ref.context;
13
+ var updatedContext = Object.assign({}, context, {
14
+ parameters: Object.assign({}, context.parameters)
15
+ });
16
+ return hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext);
17
+ };
18
+ return decorator;
19
+ }
20
+
21
+ export { withFormSubmitDecorator };
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+
3
+ function withLayoutDecorator() {
4
+ return function (Story, _ref) {
5
+ var parameters = _ref.parameters;
6
+ var layouts = {
7
+ top: 'sb-layout-top',
8
+ right: 'sb-layout-right',
9
+ bottom: 'sb-layout-bottom',
10
+ left: 'sb-layout-left',
11
+ center: 'sb-layout-center'
12
+ };
13
+ var layoutClass = layouts[(parameters == null ? void 0 : parameters.layout) || ''];
14
+ var maxWidthStyle = {
15
+ width: parameters.maxWidth && '100%',
16
+ maxWidth: parameters == null ? void 0 : parameters.maxWidth
17
+ };
18
+ if (!layoutClass) {
19
+ return /*#__PURE__*/React.createElement("div", {
20
+ style: maxWidthStyle
21
+ }, /*#__PURE__*/React.createElement(Story, null));
22
+ }
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ className: layoutClass
25
+ }, /*#__PURE__*/React.createElement("div", {
26
+ style: maxWidthStyle
27
+ }, /*#__PURE__*/React.createElement(Story, null)));
28
+ };
29
+ }
30
+
31
+ export { withLayoutDecorator };
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import { NotificationsProvider } from '@itcase/ui/context/Notifications';
3
+ import { UIProvider } from '@itcase/ui/context/UIContext';
4
+ import { FormSubmitWrapper } from '../components/FormSubmitWrapper.js';
5
+ import 'lodash/camelCase';
6
+ import '@itcase/common';
7
+ import { http, HttpResponse } from 'msw';
8
+ import { h as hasFormParameters } from '../hasFormParameters-CtI_uSU6.js';
9
+
10
+ var serverErrorHandler = function serverErrorHandler(formUrl, errors) {
11
+ return http.post(formUrl, function () {
12
+ return HttpResponse.json(errors, {
13
+ status: 400
14
+ });
15
+ });
16
+ };
17
+
18
+ function handleMSWParameters(parameters, args) {
19
+ var mswHandlersParams = {};
20
+ if (parameters.serverError) {
21
+ mswHandlersParams = {
22
+ msw: {
23
+ handlers: [serverErrorHandler(parameters.formUrl, args.errors)]
24
+ }
25
+ };
26
+ }
27
+ // else if (parameters.error500) {
28
+ // mswHandlersParams = {
29
+ // msw: {
30
+ // handlers: [error500Handler(parameters.formUrl)],
31
+ // },
32
+ // }
33
+ // }
34
+
35
+ return mswHandlersParams;
36
+ }
37
+
38
+ function withNextDecoratorFactory(_ref) {
39
+ var App = _ref.App,
40
+ RootStoreProvider = _ref.RootStoreProvider;
41
+ var decorator = function decorator(Story, _ref2) {
42
+ var args = _ref2.args,
43
+ parameters = _ref2.parameters,
44
+ context = _ref2.context;
45
+ var mswHandlersParams = handleMSWParameters(parameters, args);
46
+ var updatedContext = Object.assign({}, context, {
47
+ parameters: Object.assign({}, context.parameters, mswHandlersParams)
48
+ });
49
+ updatedContext.context = updatedContext;
50
+ if (parameters.page) {
51
+ return /*#__PURE__*/React.createElement(App, {
52
+ Component: Story,
53
+ pageProps: args
54
+ });
55
+ }
56
+ if (hasFormParameters(parameters) && !parameters.formUrl) {
57
+ throw new Error('Set "formUrl" in stories!');
58
+ }
59
+ if (parameters.storeData) {
60
+ throw new Error('Use store/s/DataSet, add "s"!');
61
+ }
62
+ return /*#__PURE__*/React.createElement(RootStoreProvider, parameters.storesData, /*#__PURE__*/React.createElement(UIProvider, null, /*#__PURE__*/React.createElement(NotificationsProvider, null, hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext))));
63
+ };
64
+ return decorator;
65
+ }
66
+
67
+ export { withNextDecoratorFactory };
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { NotificationsProvider } from '@itcase/ui/context/Notifications';
3
+ import { UIProvider } from '@itcase/ui/context/UIContext';
4
+
5
+ function withUiDecorator(Story, _ref) {
6
+ var args = _ref.args,
7
+ parameters = _ref.parameters;
8
+ return /*#__PURE__*/React.createElement(UIProvider, null, /*#__PURE__*/React.createElement(NotificationsProvider, {
9
+ initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
10
+ }, /*#__PURE__*/React.createElement(Story, null)));
11
+ }
12
+
13
+ export { withUiDecorator };
@@ -1,166 +1,15 @@
1
- import React from 'react';
2
- import castArray from 'lodash/castArray';
3
- import { FormSubmitWrapper } from './components/FormSubmitWrapper.js';
1
+ export { withExtraProviders } from './decorators/withExtraProviders.js';
2
+ export { withFigmaSourceLink } from './decorators/withFigmaSourceLink.js';
3
+ export { withFormSubmitDecorator } from './decorators/withFormSubmitDecorator.js';
4
+ export { withLayoutDecorator } from './decorators/withLayoutDecorator.js';
5
+ export { withNextDecoratorFactory } from './decorators/withNextDecorator.js';
6
+ export { withUiDecorator } from './decorators/withUiDecorator.js';
7
+ import 'react';
8
+ import 'lodash/castArray';
9
+ import './components/FormSubmitWrapper.js';
4
10
  import 'lodash/camelCase';
5
11
  import '@itcase/common';
6
- import { http, HttpResponse } from 'msw';
7
- import { NotificationsProvider } from '@itcase/ui/context/Notifications';
8
- import { UIProvider } from '@itcase/ui/context/UIContext';
9
-
10
- function withExtraProviders(providers) {
11
- if (providers === void 0) {
12
- providers = [];
13
- }
14
- if (!Array.isArray(providers)) throw new Error('withExtraProviders requires an array of components');
15
- return function (StoryFn, context) {
16
- var currentStory = StoryFn(context);
17
- for (var i = providers.length - 1; i >= 0; i--) {
18
- var item = providers[i];
19
- var Component = item.provider;
20
- var props = item.props || {};
21
- currentStory = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Component, props, currentStory));
22
- }
23
- return currentStory;
24
- };
25
- }
26
-
27
- function withFigmaSourceLink() {
28
- var decorator = function decorator(Story, _ref) {
29
- var parameters = _ref.parameters,
30
- context = _ref.context;
31
- var sourceLink = parameters.sourceLink || {};
32
- if (parameters.design) {
33
- var designList = castArray(parameters.design);
34
- if (!sourceLink.links) {
35
- sourceLink.links = {};
36
- }
37
- designList.forEach(function (design) {
38
- var groupKey = "" + design.type + (design.name || '');
39
- sourceLink.links[groupKey] = {
40
- label: 'Figma — ' + context.title + (design.name ? ' / ' + design.name : ''),
41
- href: design.url,
42
- icon: 'FigmaIcon'
43
- };
44
- });
45
- }
46
- var updatedContext = Object.assign({}, context, {
47
- parameters: Object.assign({}, context.parameters, {
48
- sourceLink: sourceLink
49
- })
50
- });
51
- return /*#__PURE__*/React.createElement(Story, updatedContext);
52
- };
53
- return decorator;
54
- }
55
-
56
- var serverErrorHandler = function serverErrorHandler(formUrl, errors) {
57
- return http.post(formUrl, function () {
58
- return HttpResponse.json(errors, {
59
- status: 400
60
- });
61
- });
62
- };
63
-
64
- function handleMSWParameters(parameters, args) {
65
- var mswHandlersParams = {};
66
- if (parameters.serverError) {
67
- mswHandlersParams = {
68
- msw: {
69
- handlers: [serverErrorHandler(parameters.formUrl, args.errors)]
70
- }
71
- };
72
- }
73
- // else if (parameters.error500) {
74
- // mswHandlersParams = {
75
- // msw: {
76
- // handlers: [error500Handler(parameters.formUrl)],
77
- // },
78
- // }
79
- // }
80
-
81
- return mswHandlersParams;
82
- }
83
-
84
- function hasFormParameters(parameters) {
85
- return Boolean(parameters.require || parameters.validation || parameters.error || parameters.serverError || parameters.serverErrorData);
86
- }
87
-
88
- function withFormSubmitDecorator() {
89
- var decorator = function decorator(Story, _ref) {
90
- _ref.args;
91
- var parameters = _ref.parameters,
92
- context = _ref.context;
93
- var updatedContext = Object.assign({}, context, {
94
- parameters: Object.assign({}, context.parameters)
95
- });
96
- return hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext);
97
- };
98
- return decorator;
99
- }
100
-
101
- function withLayoutDecorator() {
102
- return function (Story, _ref) {
103
- var parameters = _ref.parameters;
104
- var layouts = {
105
- top: 'sb-layout-top',
106
- right: 'sb-layout-right',
107
- bottom: 'sb-layout-bottom',
108
- left: 'sb-layout-left',
109
- center: 'sb-layout-center'
110
- };
111
- var layoutClass = layouts[(parameters == null ? void 0 : parameters.layout) || ''];
112
- var maxWidthStyle = {
113
- width: parameters.maxWidth && '100%',
114
- maxWidth: parameters == null ? void 0 : parameters.maxWidth
115
- };
116
- if (!layoutClass) {
117
- return /*#__PURE__*/React.createElement("div", {
118
- style: maxWidthStyle
119
- }, /*#__PURE__*/React.createElement(Story, null));
120
- }
121
- return /*#__PURE__*/React.createElement("div", {
122
- className: layoutClass
123
- }, /*#__PURE__*/React.createElement("div", {
124
- style: maxWidthStyle
125
- }, /*#__PURE__*/React.createElement(Story, null)));
126
- };
127
- }
128
-
129
- function withNextDecoratorFactory(_ref) {
130
- var App = _ref.App,
131
- RootStoreProvider = _ref.RootStoreProvider;
132
- var decorator = function decorator(Story, _ref2) {
133
- var args = _ref2.args,
134
- parameters = _ref2.parameters,
135
- context = _ref2.context;
136
- var mswHandlersParams = handleMSWParameters(parameters, args);
137
- var updatedContext = Object.assign({}, context, {
138
- parameters: Object.assign({}, context.parameters, mswHandlersParams)
139
- });
140
- updatedContext.context = updatedContext;
141
- if (parameters.page) {
142
- return /*#__PURE__*/React.createElement(App, {
143
- Component: Story,
144
- pageProps: args
145
- });
146
- }
147
- if (hasFormParameters(parameters) && !parameters.formUrl) {
148
- throw new Error('Set "formUrl" in stories!');
149
- }
150
- if (parameters.storeData) {
151
- throw new Error('Use store/s/DataSet, add "s"!');
152
- }
153
- return /*#__PURE__*/React.createElement(RootStoreProvider, parameters.storesData, /*#__PURE__*/React.createElement(UIProvider, null, /*#__PURE__*/React.createElement(NotificationsProvider, null, hasFormParameters(parameters) ? /*#__PURE__*/React.createElement(FormSubmitWrapper, updatedContext, /*#__PURE__*/React.createElement(Story, updatedContext)) : /*#__PURE__*/React.createElement(Story, updatedContext))));
154
- };
155
- return decorator;
156
- }
157
-
158
- function withUiDecorator(Story, _ref) {
159
- var args = _ref.args,
160
- parameters = _ref.parameters;
161
- return /*#__PURE__*/React.createElement(UIProvider, null, /*#__PURE__*/React.createElement(NotificationsProvider, {
162
- initialNotificationsList: parameters.initialNotificationsList || args.initialNotificationsList || []
163
- }, /*#__PURE__*/React.createElement(Story, null)));
164
- }
165
-
166
- export { withExtraProviders, withFigmaSourceLink, withFormSubmitDecorator, withLayoutDecorator, withNextDecoratorFactory, withUiDecorator };
12
+ import 'msw';
13
+ import './hasFormParameters-CtI_uSU6.js';
14
+ import '@itcase/ui/context/Notifications';
15
+ import '@itcase/ui/context/UIContext';
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ function hasFormParameters(parameters) {
4
+ return Boolean(parameters.require || parameters.validation || parameters.error || parameters.serverError || parameters.serverErrorData);
5
+ }
6
+
7
+ exports.hasFormParameters = hasFormParameters;
@@ -0,0 +1,5 @@
1
+ function hasFormParameters(parameters) {
2
+ return Boolean(parameters.require || parameters.validation || parameters.error || parameters.serverError || parameters.serverErrorData);
3
+ }
4
+
5
+ export { hasFormParameters as h };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/storybook-config",
3
- "version": "1.1.83",
3
+ "version": "1.1.85",
4
4
  "author": "ITCase",
5
5
  "description": "Code style linter configuration presets",
6
6
  "engines": {
@@ -45,6 +45,10 @@
45
45
  "import": "./dist/config/*.js",
46
46
  "require": "./dist/config/*.js"
47
47
  },
48
+ "./decorators/*": {
49
+ "import": "./dist/decorators/*.js",
50
+ "require": "./dist/cjs/decorators/*.js"
51
+ },
48
52
  "./decorators": {
49
53
  "import": "./dist/decorators.js",
50
54
  "require": "./dist/decorators.js"
@@ -69,16 +73,16 @@
69
73
  "@itcase/config": "^1.0.55",
70
74
  "@itcase/storybook-addon-auth": "^1.0.5",
71
75
  "@storybook/addon-designs": "^10.0.2",
72
- "@storybook/addon-docs": "^9.1.1",
73
- "@storybook/addon-links": "^9.1.1",
76
+ "@storybook/addon-docs": "^9.1.2",
77
+ "@storybook/addon-links": "^9.1.2",
74
78
  "@storybook/addon-styling-webpack": "^2.0.0",
75
- "@storybook/addon-themes": "^9.1.1",
79
+ "@storybook/addon-themes": "^9.1.2",
76
80
  "@storybook/addon-webpack5-compiler-swc": "^3.0.0",
77
- "@storybook/addon-vitest": "^9.1.1",
81
+ "@storybook/addon-vitest": "^9.1.2",
78
82
  "@vitejs/plugin-react": "^5.0.0",
79
- "@storybook/nextjs": "^9.1.1",
80
- "@storybook/react-vite": "^9.1.1",
81
- "@storybook/react-webpack5": "^9.1.1",
83
+ "@storybook/nextjs": "^9.1.2",
84
+ "@storybook/react-vite": "^9.1.2",
85
+ "@storybook/react-webpack5": "^9.1.2",
82
86
  "chalk": "^5.5.0",
83
87
  "http-proxy-middleware": "^3.0.5",
84
88
  "msw": "^2.10.4",
@@ -87,7 +91,7 @@
87
91
  "react-docgen-typescript-plugin": "^1.0.8",
88
92
  "storybook-addon-source-link": "^0.2.2",
89
93
  "@std/path": "npm:@jsr/std__path@^1.1.1",
90
- "vite": "^7.1.1",
94
+ "vite": "^7.1.2",
91
95
  "vitest": "^3.2.4"
92
96
  },
93
97
  "devDependencies": {
@@ -116,7 +120,7 @@
116
120
  "rollup-plugin-copy": "^3.5.0",
117
121
  "rollup-plugin-peer-deps-external": "^2.2.4",
118
122
  "semantic-release": "^24.2.7",
119
- "storybook": "^9.1.1",
123
+ "storybook": "^9.1.2",
120
124
  "stylelint": "^16.23.1",
121
125
  "typescript": "^5.9.2"
122
126
  }
@@ -1,16 +0,0 @@
1
- const ADDON_THEMES = {
2
- defaultTheme: 'AM',
3
- themes: {
4
- AM: 'am',
5
- 'AM Dark Theme': 'am dark-theme',
6
- 'AM Light Theme': 'am light-theme',
7
- Baikal: 'baikal',
8
- 'Baikal Dark Theme': 'baikal dark-theme',
9
- 'Baikal Light Theme': 'baikal light-theme',
10
- ITCase: 'itcase',
11
- 'ITCase Dark': 'itcase dark-theme',
12
- 'ITCase Light Theme': 'itcase light-theme',
13
- },
14
- }
15
-
16
- export { ADDON_THEMES }
@@ -1,10 +0,0 @@
1
- const ADDONS_NEXTJS = [
2
- '@storybook/addon-links',
3
- '@itcase/storybook-addon-auth',
4
- '@storybook/addon-themes',
5
- '@storybook/addon-designs',
6
- '@storybook/addon-docs',
7
- 'storybook-addon-source-link',
8
- ]
9
-
10
- export { ADDONS_NEXTJS }
@@ -1,10 +0,0 @@
1
- const ADDONS_VITE = [
2
- '@storybook/addon-links',
3
- '@storybook/addon-themes',
4
- '@storybook/addon-designs',
5
- '@storybook/addon-docs',
6
- '@storybook/addon-vitest',
7
- //'storybook-addon-source-link',
8
- ]
9
-
10
- export { ADDONS_VITE }
@@ -1,30 +0,0 @@
1
- const ADDONS_WEBPACK = [
2
- '@storybook/addon-webpack5-compiler-swc',
3
- '@storybook/addon-themes',
4
- '@storybook/addon-designs',
5
- '@storybook/addon-docs',
6
- '@storybook/addon-themes',
7
- {
8
- name: '@storybook/addon-styling-webpack',
9
- options: {
10
- rules: [
11
- {
12
- test: /\.css$/,
13
- use: [
14
- 'style-loader',
15
- {
16
- loader: 'css-loader',
17
- options: { importLoaders: 1 },
18
- },
19
- {
20
- loader: 'postcss-loader',
21
- },
22
- ],
23
- },
24
- ],
25
- },
26
- },
27
- 'storybook-addon-source-link',
28
- ]
29
-
30
- export { ADDONS_WEBPACK }
@@ -1,24 +0,0 @@
1
- const BACKGROUNDS = {
2
- baikal: {
3
- name: 'Baikal',
4
- value: '#4CB7EA',
5
- },
6
- dark: {
7
- name: 'Dark',
8
- value: '#000000',
9
- },
10
- default: {
11
- name: 'Default',
12
- value: 'none',
13
- },
14
- figma: {
15
- name: 'Figma',
16
- value: '#E5E5E5',
17
- },
18
- light: {
19
- name: 'Light',
20
- value: '#fff',
21
- },
22
- }
23
-
24
- export { BACKGROUNDS }
@@ -1,8 +0,0 @@
1
- const MAIN_CONFIG_VITE = {
2
- tags: ['autodocs'],
3
- core: {
4
- disableTelemetry: true,
5
- },
6
- }
7
-
8
- export { MAIN_CONFIG_VITE }
@@ -1,65 +0,0 @@
1
- import chalk from 'chalk'
2
-
3
- const STORYBOOK_PUBLIC_PATH = null
4
- const WEBPACK_ALIAS = {
5
- src: `${process.cwd()}/src`,
6
- '@itcase/ui': `${process.cwd()}/node_modules/@itcase/ui/dist`,
7
- }
8
-
9
- const MAIN_CONFIG_WEBPACK = {
10
- webpackFinal: async (config) => {
11
- console.log(
12
- chalk.green(
13
- 'info =>',
14
- chalk.white(
15
- 'Using default "publicPath" set "STORYBOOK_PUBLIC_PATH" variable to use another one',
16
- ),
17
- ),
18
- )
19
-
20
- if (STORYBOOK_PUBLIC_PATH) {
21
- config.output.publicPath = STORYBOOK_PUBLIC_PATH
22
- }
23
- // @svgr/webpack
24
- const imageRule = config.module?.rules?.find((rule) => {
25
- const test = rule.test
26
- if (!test) {
27
- return false
28
- }
29
- return test.test('.svg')
30
- })
31
-
32
- imageRule.exclude = /\.svg$/
33
-
34
- config.module?.rules?.push({
35
- test: /\.svg$/,
36
- use: ['@svgr/webpack'],
37
- })
38
-
39
- // update webpack alias
40
- console.log(
41
- chalk.green(
42
- 'info =>',
43
- chalk.white('Using default "WEBPACK_ALIAS" from'),
44
- chalk.cyan('src'),
45
- chalk.white('to'),
46
- chalk.cyan(`${process.cwd()}/src`),
47
- chalk.white('change it to use another one'),
48
- ),
49
- )
50
-
51
- config.resolve.alias = {
52
- ...config.resolve.alias,
53
- ...WEBPACK_ALIAS,
54
- }
55
-
56
- return config
57
- },
58
- tags: ['autodocs'],
59
- core: {
60
- disableTelemetry: true,
61
- disableWhatsNewNotifications: true,
62
- },
63
- }
64
-
65
- export { MAIN_CONFIG_WEBPACK }
@@ -1,5 +0,0 @@
1
- const FRAMEWORK_NEXTJS = {
2
- framework: '@storybook/nextjs',
3
- }
4
-
5
- export { FRAMEWORK_NEXTJS }
@@ -1,5 +0,0 @@
1
- const FRAMEWORK_VITE = {
2
- framework: '@storybook/react-vite',
3
- }
4
-
5
- export { FRAMEWORK_VITE }
@@ -1,12 +0,0 @@
1
- const FRAMEWORK_WEBPACK = {
2
- framework: {
3
- name: '@storybook/react-webpack5',
4
- options: {
5
- builder: {
6
- useSWC: true,
7
- },
8
- },
9
- },
10
- }
11
-
12
- export { FRAMEWORK_WEBPACK }
@@ -1,31 +0,0 @@
1
- import { ADDONS_NEXTJS } from '../addons/addonsNextJs.js'
2
- import { ADDONS_VITE } from '../addons/addonsVite.js'
3
- import { ADDONS_WEBPACK } from '../addons/addonsWebpack.js'
4
- import { AUTHORIZATION } from '../authorization.js'
5
- import { MAIN_CONFIG_VITE } from '../config/mainConfigVite.js'
6
- import { MAIN_CONFIG_WEBPACK } from '../config/mainConfigWebpack.js'
7
- import { FRAMEWORK_NEXTJS } from '../framework/frameworkNextJs.js'
8
- import { FRAMEWORK_VITE } from '../framework/frameworkVite.js'
9
- import { FRAMEWORK_WEBPACK } from '../framework/frameworkWebpack.js'
10
- import { REFS } from '../refs.js'
11
- import { STATIC_DIRS_NEXTJS } from '../static/staticDirsNextJs.js'
12
- import { STATIC_DIRS_VITE } from '../static/staticDirsVite.js'
13
- import { STATIC_DIRS_WEBPACK } from '../static/staticDirsWebpack.js'
14
- import { STATUS } from '../status.js'
15
-
16
- export {
17
- ADDONS_NEXTJS,
18
- ADDONS_VITE,
19
- ADDONS_WEBPACK,
20
- AUTHORIZATION,
21
- MAIN_CONFIG_VITE,
22
- MAIN_CONFIG_WEBPACK,
23
- FRAMEWORK_NEXTJS,
24
- FRAMEWORK_VITE,
25
- FRAMEWORK_WEBPACK,
26
- REFS,
27
- STATIC_DIRS_NEXTJS,
28
- STATIC_DIRS_VITE,
29
- STATIC_DIRS_WEBPACK,
30
- STATUS,
31
- }
@@ -1,3 +0,0 @@
1
- import { serverErrorDataHandler, serverErrorHandler } from './mswHandlers'
2
-
3
- export { serverErrorHandler, serverErrorDataHandler }
@@ -1,15 +0,0 @@
1
- import { http, HttpResponse } from 'msw'
2
-
3
- const serverErrorHandler = (formUrl, errors) => {
4
- return http.post(formUrl, () => {
5
- return HttpResponse.json(errors, { status: 400 })
6
- })
7
- }
8
-
9
- const serverErrorDataHandler = (formUrl, message) => {
10
- return http.post(formUrl, () => {
11
- return HttpResponse.json({ non_field_errors: message }, { status: 400 })
12
- })
13
- }
14
-
15
- export { serverErrorHandler, serverErrorDataHandler }
@@ -1,6 +0,0 @@
1
- import { ADDON_THEMES } from '../addons/addonThemes.js'
2
- import { BACKGROUNDS } from '../backgrounds/index.js'
3
- import { SOURCE_LINK } from '../sourceLink.js'
4
- import { VIEWPORTS } from '../viewport/index.js'
5
-
6
- export { ADDON_THEMES, BACKGROUNDS, SOURCE_LINK, VIEWPORTS }
@@ -1,7 +0,0 @@
1
- const STATIC_DIRS_NEXTJS = [
2
- { from: '../public', to: '/' },
3
- { from: '../src/appearance/', to: 'src/appearance/' },
4
- { from: '../public/img', to: 'img/' },
5
- ]
6
-
7
- export { STATIC_DIRS_NEXTJS }
@@ -1,3 +0,0 @@
1
- const STATIC_DIRS_VITE = [{ from: '../public', to: '/' }]
2
-
3
- export { STATIC_DIRS_VITE }
@@ -1,3 +0,0 @@
1
- const STATIC_DIRS_WEBPACK = [{ from: '../public', to: '/' }]
2
-
3
- export { STATIC_DIRS_WEBPACK }
@@ -1,9 +0,0 @@
1
- import { USERS } from './users.js'
2
-
3
- const AUTHORIZATION = {
4
- profileUrl: `${process.env.REST_BASE_URL}/rest/profile/`,
5
- signInUrl: `${process.env.REST_BASE_URL}/rest/sign-in/`,
6
- values: USERS,
7
- }
8
-
9
- export { AUTHORIZATION }
@@ -1,22 +0,0 @@
1
- import { DEFAULT_USERS } from '@itcase/storybook-addon-auth/defaults'
2
-
3
- const USERS = {
4
- admin: {
5
- name: 'Admin',
6
- color: '#1EA5FC',
7
- token: process.env.ADMIN_AUTH_TOKEN,
8
- },
9
- manager: {
10
- name: 'Manager',
11
- color: '#D80E4F',
12
- token: process.env.MANAGER_AUTH_TOKEN,
13
- },
14
- user: {
15
- name: 'User',
16
- color: '#777777',
17
- token: process.env.USER_AUTH_TOKEN,
18
- },
19
- ...DEFAULT_USERS,
20
- }
21
-
22
- export { USERS }
@@ -1,22 +0,0 @@
1
- import { INITIAL_VIEWPORTS, MINIMAL_VIEWPORTS } from 'storybook/viewport'
2
-
3
- const VIEWPORTS = {
4
- desktop: {
5
- name: 'Desktop',
6
- styles: {
7
- width: '1440px',
8
- height: '100%',
9
- },
10
- },
11
- mobile: {
12
- name: 'Mobile',
13
- styles: {
14
- width: '375px',
15
- height: '667px',
16
- },
17
- },
18
- ...INITIAL_VIEWPORTS,
19
- ...MINIMAL_VIEWPORTS,
20
- }
21
-
22
- export { VIEWPORTS }