@procore/storybook-addon 4.7.0 → 4.7.1
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.
- package/CHANGELOG.md +6 -0
- package/dist/legacy/chunk-QGM4M3NI.js +37 -0
- package/dist/legacy/index.cjs +2931 -3026
- package/dist/legacy/index.d.cts +0 -1
- package/dist/legacy/index.d.ts +0 -1
- package/dist/legacy/index.js +3125 -3010
- package/dist/legacy/preset.cjs +3 -13
- package/dist/legacy/preset.d.cts +1 -1
- package/dist/legacy/preset.d.ts +1 -1
- package/dist/legacy/preset.js +205 -6
- package/dist/modern/chunk-QGM4M3NI.js +37 -0
- package/dist/modern/index.cjs +2931 -3026
- package/dist/modern/index.d.cts +0 -1
- package/dist/modern/index.d.ts +0 -1
- package/dist/modern/index.js +3125 -3010
- package/dist/modern/preset.cjs +3 -13
- package/dist/modern/preset.d.cts +1 -1
- package/dist/modern/preset.d.ts +1 -1
- package/dist/modern/preset.js +205 -6
- package/package.json +9 -14
- package/preset.js +1 -0
- package/dist/legacy/chunk-CLCAWS5I.js +0 -253
- package/dist/modern/chunk-CLCAWS5I.js +0 -253
package/dist/modern/preset.cjs
CHANGED
|
@@ -207,9 +207,7 @@ var addons = () => {
|
|
|
207
207
|
{
|
|
208
208
|
loader: "sass-loader",
|
|
209
209
|
options: {
|
|
210
|
-
...sassImplementation ? {
|
|
211
|
-
implementation: sassImplementation
|
|
212
|
-
} : {}
|
|
210
|
+
...sassImplementation ? { implementation: sassImplementation } : {}
|
|
213
211
|
}
|
|
214
212
|
}
|
|
215
213
|
]
|
|
@@ -239,18 +237,10 @@ function babelDefault() {
|
|
|
239
237
|
return createConfigForReact();
|
|
240
238
|
}
|
|
241
239
|
var typescript = {
|
|
242
|
-
checkOptions: {
|
|
243
|
-
check: true,
|
|
244
|
-
exclude: /node_modules/
|
|
245
|
-
},
|
|
240
|
+
checkOptions: { check: true, exclude: /node_modules/ },
|
|
246
241
|
reactDocgen: false
|
|
247
242
|
};
|
|
248
|
-
var preset_default = {
|
|
249
|
-
addons: addons(),
|
|
250
|
-
babelDefault,
|
|
251
|
-
typescript,
|
|
252
|
-
previewHead: previewHead_default
|
|
253
|
-
};
|
|
243
|
+
var preset_default = { addons, babelDefault, typescript, previewHead: previewHead_default };
|
|
254
244
|
// Annotate the CommonJS export names for ESM import in node:
|
|
255
245
|
0 && (module.exports = {
|
|
256
246
|
addons,
|
package/dist/modern/preset.d.cts
CHANGED
package/dist/modern/preset.d.ts
CHANGED
package/dist/modern/preset.js
CHANGED
|
@@ -1,10 +1,209 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
__commonJS,
|
|
3
|
+
__require,
|
|
4
|
+
__toESM
|
|
5
|
+
} from "./chunk-QGM4M3NI.js";
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/react-dev-utils/getCacheIdentifier.js
|
|
8
|
+
var require_getCacheIdentifier = __commonJS({
|
|
9
|
+
"../../node_modules/react-dev-utils/getCacheIdentifier.js"(exports, module) {
|
|
10
|
+
"use strict";
|
|
11
|
+
module.exports = function getCacheIdentifier2(environment, packages) {
|
|
12
|
+
let cacheIdentifier = environment == null ? "" : environment.toString();
|
|
13
|
+
for (const packageName of packages) {
|
|
14
|
+
cacheIdentifier += `:${packageName}@`;
|
|
15
|
+
try {
|
|
16
|
+
cacheIdentifier += __require(`${packageName}/package.json`).version;
|
|
17
|
+
} catch (_) {
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return cacheIdentifier;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// src/configurations/babel.ts
|
|
26
|
+
var import_getCacheIdentifier = __toESM(require_getCacheIdentifier(), 1);
|
|
27
|
+
import { version as babelRuntimeVersion } from "@babel/runtime/package.json";
|
|
28
|
+
import { version as corejsVersion } from "core-js/package.json";
|
|
29
|
+
var targets = "defaults";
|
|
30
|
+
var transformRuntimeOptions = {
|
|
31
|
+
// By default, babel assumes babel/runtime version 7.0.0-beta.0,
|
|
32
|
+
// explicitly resolving to match the provided helper functions.
|
|
33
|
+
// https://github.com/babel/babel/issues/10261
|
|
34
|
+
version: babelRuntimeVersion
|
|
35
|
+
};
|
|
36
|
+
function createConfigForReact() {
|
|
37
|
+
const env = process.env.NODE_ENV || "development";
|
|
38
|
+
const isProduction = env === "production";
|
|
39
|
+
return {
|
|
40
|
+
babelrc: false,
|
|
41
|
+
cacheCompression: false,
|
|
42
|
+
cacheDirectory: true,
|
|
43
|
+
cacheIdentifier: (0, import_getCacheIdentifier.default)(env, [
|
|
44
|
+
"babel-plugin-named-asset-import",
|
|
45
|
+
"react-dev-utils"
|
|
46
|
+
]),
|
|
47
|
+
assumptions: {
|
|
48
|
+
privateFieldsAsProperties: true,
|
|
49
|
+
setPublicClassFields: true
|
|
50
|
+
},
|
|
51
|
+
compact: isProduction,
|
|
52
|
+
configFile: false,
|
|
53
|
+
sourceType: "unambiguous",
|
|
54
|
+
targets,
|
|
55
|
+
plugins: [
|
|
56
|
+
[
|
|
57
|
+
__require.resolve("@babel/plugin-transform-runtime"),
|
|
58
|
+
transformRuntimeOptions
|
|
59
|
+
],
|
|
60
|
+
[
|
|
61
|
+
__require.resolve("babel-plugin-named-asset-import"),
|
|
62
|
+
{
|
|
63
|
+
loaderMap: {
|
|
64
|
+
svg: {
|
|
65
|
+
ReactComponent: "@svgr/webpack?-svgo,+titleProp,+ref![path]"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
[
|
|
71
|
+
__require.resolve("babel-plugin-styled-components"),
|
|
72
|
+
{
|
|
73
|
+
minify: true,
|
|
74
|
+
ssr: false,
|
|
75
|
+
displayName: true,
|
|
76
|
+
fileName: false,
|
|
77
|
+
transpileTemplateLiterals: true,
|
|
78
|
+
pure: false
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
],
|
|
82
|
+
presets: [
|
|
83
|
+
[
|
|
84
|
+
__require.resolve("@babel/preset-env"),
|
|
85
|
+
{
|
|
86
|
+
useBuiltIns: "usage",
|
|
87
|
+
corejs: corejsVersion
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
[
|
|
91
|
+
__require.resolve("@babel/preset-react"),
|
|
92
|
+
{
|
|
93
|
+
useBuiltIns: true
|
|
94
|
+
}
|
|
95
|
+
],
|
|
96
|
+
__require.resolve("@babel/preset-typescript")
|
|
97
|
+
]
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/configurations/previewHead.ts
|
|
102
|
+
var defaultValues = {
|
|
103
|
+
includeBoxSizing: true
|
|
104
|
+
};
|
|
105
|
+
function previewHead_default(head, _options, parameters) {
|
|
106
|
+
const { includeBoxSizing = true } = {
|
|
107
|
+
...defaultValues,
|
|
108
|
+
...parameters
|
|
109
|
+
};
|
|
110
|
+
return `
|
|
111
|
+
${head}
|
|
112
|
+
<meta charset="UTF-8" />
|
|
113
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
114
|
+
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">
|
|
115
|
+
|
|
116
|
+
<style>
|
|
117
|
+
${includeBoxSizing ? `
|
|
118
|
+
*,
|
|
119
|
+
*:before,
|
|
120
|
+
*:after {
|
|
121
|
+
-webkit-box-sizing: inherit;
|
|
122
|
+
-moz-box-sizing: inherit;
|
|
123
|
+
box-sizing: inherit;
|
|
124
|
+
}
|
|
125
|
+
html {
|
|
126
|
+
-webkit-box-sizing: border-box;
|
|
127
|
+
-moz-box-sizing: border-box;
|
|
128
|
+
box-sizing: border-box;
|
|
129
|
+
}
|
|
130
|
+
` : ""}
|
|
131
|
+
html {
|
|
132
|
+
font-family: Inter, sans-serif;
|
|
133
|
+
}
|
|
134
|
+
body {
|
|
135
|
+
width: 100%;
|
|
136
|
+
}
|
|
137
|
+
</style>
|
|
138
|
+
`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// src/utils/index.ts
|
|
142
|
+
function requireIfExists(moduleName) {
|
|
143
|
+
try {
|
|
144
|
+
return __require(moduleName);
|
|
145
|
+
} catch (e) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// src/preset.ts
|
|
151
|
+
var addons = () => {
|
|
152
|
+
const sassImplementation = requireIfExists("sass");
|
|
153
|
+
return [
|
|
154
|
+
{
|
|
155
|
+
name: "@storybook/addon-styling-webpack",
|
|
156
|
+
options: {
|
|
157
|
+
rules: [
|
|
158
|
+
{
|
|
159
|
+
test: /\.scss$/,
|
|
160
|
+
use: [
|
|
161
|
+
"style-loader",
|
|
162
|
+
{
|
|
163
|
+
loader: "css-loader",
|
|
164
|
+
options: {
|
|
165
|
+
modules: {
|
|
166
|
+
localIdentName: "[name]__[local]--[hash:base64:5]"
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
loader: "sass-loader",
|
|
172
|
+
options: {
|
|
173
|
+
...sassImplementation ? { implementation: sassImplementation } : {}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
test: /\.css$/,
|
|
180
|
+
use: [
|
|
181
|
+
"style-loader",
|
|
182
|
+
{
|
|
183
|
+
loader: "css-loader",
|
|
184
|
+
options: {
|
|
185
|
+
modules: {
|
|
186
|
+
localIdentName: "[name]__[local]--[hash:base64:5]"
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
"@storybook/addon-docs",
|
|
196
|
+
"@storybook/addon-a11y"
|
|
197
|
+
];
|
|
198
|
+
};
|
|
199
|
+
function babelDefault() {
|
|
200
|
+
return createConfigForReact();
|
|
201
|
+
}
|
|
202
|
+
var typescript = {
|
|
203
|
+
checkOptions: { check: true, exclude: /node_modules/ },
|
|
204
|
+
reactDocgen: false
|
|
205
|
+
};
|
|
206
|
+
var preset_default = { addons, babelDefault, typescript, previewHead: previewHead_default };
|
|
8
207
|
export {
|
|
9
208
|
addons,
|
|
10
209
|
babelDefault,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procore/storybook-addon",
|
|
3
|
-
"version": "4.7.
|
|
3
|
+
"version": "4.7.1",
|
|
4
4
|
"description": "Procore Storybook Configuration",
|
|
5
5
|
"author": "Procore Technologies",
|
|
6
6
|
"homepage": "https://github.com/procore/frontend-tooling#readme",
|
|
@@ -31,14 +31,8 @@
|
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"./preset": {
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"default": "./dist/modern/preset.js"
|
|
37
|
-
},
|
|
38
|
-
"require": {
|
|
39
|
-
"types": "./dist/modern/preset.d.cts",
|
|
40
|
-
"default": "./dist/modern/preset.cjs"
|
|
41
|
-
}
|
|
34
|
+
"types": "./dist/modern/preset.d.cts",
|
|
35
|
+
"default": "./dist/modern/preset.cjs"
|
|
42
36
|
},
|
|
43
37
|
"./package.json": "./package.json"
|
|
44
38
|
},
|
|
@@ -46,7 +40,8 @@
|
|
|
46
40
|
"module": "dist/legacy/index.js",
|
|
47
41
|
"types": "dist/legacy/index.d.ts",
|
|
48
42
|
"files": [
|
|
49
|
-
"dist"
|
|
43
|
+
"dist",
|
|
44
|
+
"preset.js"
|
|
50
45
|
],
|
|
51
46
|
"scripts": {
|
|
52
47
|
"build": "hammer lib:build",
|
|
@@ -84,10 +79,10 @@
|
|
|
84
79
|
"devDependencies": {
|
|
85
80
|
"@babel/core": "^7.23.3",
|
|
86
81
|
"@procore/eslint-config": "^15.3.2",
|
|
87
|
-
"@procore/hammer": "^
|
|
88
|
-
"@procore/hammer-lib-tsup": "^0.
|
|
89
|
-
"@procore/hammer-lint-eslint": "^0.
|
|
90
|
-
"@procore/hammer-test-vitest": "^0.
|
|
82
|
+
"@procore/hammer": "^1.2.0",
|
|
83
|
+
"@procore/hammer-lib-tsup": "^1.0.0",
|
|
84
|
+
"@procore/hammer-lint-eslint": "^1.0.1",
|
|
85
|
+
"@procore/hammer-test-vitest": "^1.0.0",
|
|
91
86
|
"@procore/prettier-config": "^1.1.1",
|
|
92
87
|
"@procore/typescript-config": "^2.1.0",
|
|
93
88
|
"@types/react": "^18.2.37",
|
package/preset.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dist/modern/preset.cjs';
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
8
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
9
|
-
}) : x)(function(x) {
|
|
10
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
|
-
});
|
|
13
|
-
var __commonJS = (cb, mod) => function __require2() {
|
|
14
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
15
|
-
};
|
|
16
|
-
var __copyProps = (to, from, except, desc) => {
|
|
17
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
-
for (let key of __getOwnPropNames(from))
|
|
19
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
20
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
21
|
-
}
|
|
22
|
-
return to;
|
|
23
|
-
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
26
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
30
|
-
mod
|
|
31
|
-
));
|
|
32
|
-
|
|
33
|
-
// ../../node_modules/react-dev-utils/getCacheIdentifier.js
|
|
34
|
-
var require_getCacheIdentifier = __commonJS({
|
|
35
|
-
"../../node_modules/react-dev-utils/getCacheIdentifier.js"(exports, module) {
|
|
36
|
-
"use strict";
|
|
37
|
-
module.exports = function getCacheIdentifier2(environment, packages) {
|
|
38
|
-
let cacheIdentifier = environment == null ? "" : environment.toString();
|
|
39
|
-
for (const packageName of packages) {
|
|
40
|
-
cacheIdentifier += `:${packageName}@`;
|
|
41
|
-
try {
|
|
42
|
-
cacheIdentifier += __require(`${packageName}/package.json`).version;
|
|
43
|
-
} catch (_) {
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return cacheIdentifier;
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// src/configurations/babel.ts
|
|
52
|
-
var import_getCacheIdentifier = __toESM(require_getCacheIdentifier(), 1);
|
|
53
|
-
import { version as babelRuntimeVersion } from "@babel/runtime/package.json";
|
|
54
|
-
import { version as corejsVersion } from "core-js/package.json";
|
|
55
|
-
var targets = "defaults";
|
|
56
|
-
var transformRuntimeOptions = {
|
|
57
|
-
// By default, babel assumes babel/runtime version 7.0.0-beta.0,
|
|
58
|
-
// explicitly resolving to match the provided helper functions.
|
|
59
|
-
// https://github.com/babel/babel/issues/10261
|
|
60
|
-
version: babelRuntimeVersion
|
|
61
|
-
};
|
|
62
|
-
function createConfigForReact() {
|
|
63
|
-
const env = process.env.NODE_ENV || "development";
|
|
64
|
-
const isProduction = env === "production";
|
|
65
|
-
return {
|
|
66
|
-
babelrc: false,
|
|
67
|
-
cacheCompression: false,
|
|
68
|
-
cacheDirectory: true,
|
|
69
|
-
cacheIdentifier: (0, import_getCacheIdentifier.default)(env, [
|
|
70
|
-
"babel-plugin-named-asset-import",
|
|
71
|
-
"react-dev-utils"
|
|
72
|
-
]),
|
|
73
|
-
assumptions: {
|
|
74
|
-
privateFieldsAsProperties: true,
|
|
75
|
-
setPublicClassFields: true
|
|
76
|
-
},
|
|
77
|
-
compact: isProduction,
|
|
78
|
-
configFile: false,
|
|
79
|
-
sourceType: "unambiguous",
|
|
80
|
-
targets,
|
|
81
|
-
plugins: [
|
|
82
|
-
[
|
|
83
|
-
__require.resolve("@babel/plugin-transform-runtime"),
|
|
84
|
-
transformRuntimeOptions
|
|
85
|
-
],
|
|
86
|
-
[
|
|
87
|
-
__require.resolve("babel-plugin-named-asset-import"),
|
|
88
|
-
{
|
|
89
|
-
loaderMap: {
|
|
90
|
-
svg: {
|
|
91
|
-
ReactComponent: "@svgr/webpack?-svgo,+titleProp,+ref![path]"
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
],
|
|
96
|
-
[
|
|
97
|
-
__require.resolve("babel-plugin-styled-components"),
|
|
98
|
-
{
|
|
99
|
-
minify: true,
|
|
100
|
-
ssr: false,
|
|
101
|
-
displayName: true,
|
|
102
|
-
fileName: false,
|
|
103
|
-
transpileTemplateLiterals: true,
|
|
104
|
-
pure: false
|
|
105
|
-
}
|
|
106
|
-
]
|
|
107
|
-
],
|
|
108
|
-
presets: [
|
|
109
|
-
[
|
|
110
|
-
__require.resolve("@babel/preset-env"),
|
|
111
|
-
{
|
|
112
|
-
useBuiltIns: "usage",
|
|
113
|
-
corejs: corejsVersion
|
|
114
|
-
}
|
|
115
|
-
],
|
|
116
|
-
[
|
|
117
|
-
__require.resolve("@babel/preset-react"),
|
|
118
|
-
{
|
|
119
|
-
useBuiltIns: true
|
|
120
|
-
}
|
|
121
|
-
],
|
|
122
|
-
__require.resolve("@babel/preset-typescript")
|
|
123
|
-
]
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// src/configurations/previewHead.ts
|
|
128
|
-
var defaultValues = {
|
|
129
|
-
includeBoxSizing: true
|
|
130
|
-
};
|
|
131
|
-
function previewHead_default(head, _options, parameters) {
|
|
132
|
-
const { includeBoxSizing = true } = {
|
|
133
|
-
...defaultValues,
|
|
134
|
-
...parameters
|
|
135
|
-
};
|
|
136
|
-
return `
|
|
137
|
-
${head}
|
|
138
|
-
<meta charset="UTF-8" />
|
|
139
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
140
|
-
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap">
|
|
141
|
-
|
|
142
|
-
<style>
|
|
143
|
-
${includeBoxSizing ? `
|
|
144
|
-
*,
|
|
145
|
-
*:before,
|
|
146
|
-
*:after {
|
|
147
|
-
-webkit-box-sizing: inherit;
|
|
148
|
-
-moz-box-sizing: inherit;
|
|
149
|
-
box-sizing: inherit;
|
|
150
|
-
}
|
|
151
|
-
html {
|
|
152
|
-
-webkit-box-sizing: border-box;
|
|
153
|
-
-moz-box-sizing: border-box;
|
|
154
|
-
box-sizing: border-box;
|
|
155
|
-
}
|
|
156
|
-
` : ""}
|
|
157
|
-
html {
|
|
158
|
-
font-family: Inter, sans-serif;
|
|
159
|
-
}
|
|
160
|
-
body {
|
|
161
|
-
width: 100%;
|
|
162
|
-
}
|
|
163
|
-
</style>
|
|
164
|
-
`;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
// src/utils/index.ts
|
|
168
|
-
function requireIfExists(moduleName) {
|
|
169
|
-
try {
|
|
170
|
-
return __require(moduleName);
|
|
171
|
-
} catch (e) {
|
|
172
|
-
return;
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
// src/preset.ts
|
|
177
|
-
var addons = () => {
|
|
178
|
-
const sassImplementation = requireIfExists("sass");
|
|
179
|
-
return [
|
|
180
|
-
{
|
|
181
|
-
name: "@storybook/addon-styling-webpack",
|
|
182
|
-
options: {
|
|
183
|
-
rules: [
|
|
184
|
-
{
|
|
185
|
-
test: /\.scss$/,
|
|
186
|
-
use: [
|
|
187
|
-
"style-loader",
|
|
188
|
-
{
|
|
189
|
-
loader: "css-loader",
|
|
190
|
-
options: {
|
|
191
|
-
modules: {
|
|
192
|
-
localIdentName: "[name]__[local]--[hash:base64:5]"
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
loader: "sass-loader",
|
|
198
|
-
options: {
|
|
199
|
-
...sassImplementation ? {
|
|
200
|
-
implementation: sassImplementation
|
|
201
|
-
} : {}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
]
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
test: /\.css$/,
|
|
208
|
-
use: [
|
|
209
|
-
"style-loader",
|
|
210
|
-
{
|
|
211
|
-
loader: "css-loader",
|
|
212
|
-
options: {
|
|
213
|
-
modules: {
|
|
214
|
-
localIdentName: "[name]__[local]--[hash:base64:5]"
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
]
|
|
219
|
-
}
|
|
220
|
-
]
|
|
221
|
-
}
|
|
222
|
-
},
|
|
223
|
-
"@storybook/addon-docs",
|
|
224
|
-
"@storybook/addon-a11y"
|
|
225
|
-
];
|
|
226
|
-
};
|
|
227
|
-
function babelDefault() {
|
|
228
|
-
return createConfigForReact();
|
|
229
|
-
}
|
|
230
|
-
var typescript = {
|
|
231
|
-
checkOptions: {
|
|
232
|
-
check: true,
|
|
233
|
-
exclude: /node_modules/
|
|
234
|
-
},
|
|
235
|
-
reactDocgen: false
|
|
236
|
-
};
|
|
237
|
-
var preset_default = {
|
|
238
|
-
addons: addons(),
|
|
239
|
-
babelDefault,
|
|
240
|
-
typescript,
|
|
241
|
-
previewHead: previewHead_default
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
export {
|
|
245
|
-
__require,
|
|
246
|
-
__commonJS,
|
|
247
|
-
__toESM,
|
|
248
|
-
previewHead_default,
|
|
249
|
-
addons,
|
|
250
|
-
babelDefault,
|
|
251
|
-
typescript,
|
|
252
|
-
preset_default
|
|
253
|
-
};
|