@procore/storybook-addon 4.6.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.
@@ -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,
@@ -72,7 +72,7 @@ declare const typescript: {
72
72
  };
73
73
 
74
74
  declare const _default: {
75
- addons: (string | {
75
+ addons: () => (string | {
76
76
  name: string;
77
77
  options: {
78
78
  rules: {
@@ -72,7 +72,7 @@ declare const typescript: {
72
72
  };
73
73
 
74
74
  declare const _default: {
75
- addons: (string | {
75
+ addons: () => (string | {
76
76
  name: string;
77
77
  options: {
78
78
  rules: {
@@ -1,10 +1,209 @@
1
1
  import {
2
- addons,
3
- babelDefault,
4
- preset_default,
5
- previewHead_default,
6
- typescript
7
- } from "./chunk-CLCAWS5I.js";
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,
@@ -0,0 +1,37 @@
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
+ export {
34
+ __require,
35
+ __commonJS,
36
+ __toESM
37
+ };