storybook 9.0.0-alpha.2 → 9.0.0-alpha.4

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 (79) hide show
  1. package/README.md +1 -1
  2. package/dist/actions/decorator.d.ts +6 -0
  3. package/dist/actions/decorator.js +139 -0
  4. package/dist/actions/index.cjs +127 -0
  5. package/dist/actions/index.d.ts +105 -0
  6. package/dist/actions/index.js +112 -0
  7. package/dist/actions/manager.js +1196 -0
  8. package/dist/actions/preview.cjs +165 -0
  9. package/dist/actions/preview.d.ts +55 -0
  10. package/dist/actions/preview.js +156 -0
  11. package/dist/bin/index.cjs +63 -65
  12. package/dist/bin/index.js +63 -65
  13. package/dist/channels/index.cjs +209 -234
  14. package/dist/channels/index.js +304 -308
  15. package/dist/cli/bin/index.cjs +409 -409
  16. package/dist/cli/bin/index.js +414 -414
  17. package/dist/cli/index.cjs +1 -1
  18. package/dist/cli/index.d.ts +2 -2
  19. package/dist/cli/index.js +1 -1
  20. package/dist/client-logger/index.cjs +56 -88
  21. package/dist/client-logger/index.js +41 -47
  22. package/dist/common/index.cjs +148 -148
  23. package/dist/common/index.d.ts +1 -5
  24. package/dist/common/index.js +171 -171
  25. package/dist/components/index.cjs +9413 -11578
  26. package/dist/components/index.d.ts +92 -92
  27. package/dist/components/index.js +6768 -7544
  28. package/dist/core-events/index.d.ts +138 -25
  29. package/dist/core-server/index.cjs +5244 -5270
  30. package/dist/core-server/index.d.ts +1 -1
  31. package/dist/core-server/index.js +5356 -5380
  32. package/dist/core-server/presets/common-manager.js +11 -19
  33. package/dist/core-server/presets/common-preset.cjs +243 -242
  34. package/dist/core-server/presets/common-preset.js +379 -378
  35. package/dist/csf/index.cjs +76 -120
  36. package/dist/csf/index.d.ts +1 -3
  37. package/dist/csf/index.js +69 -113
  38. package/dist/docs-tools/index.cjs +1 -1
  39. package/dist/docs-tools/index.d.ts +2 -2
  40. package/dist/docs-tools/index.js +1 -1
  41. package/dist/instrumenter/index.cjs +1260 -1289
  42. package/dist/instrumenter/index.js +1344 -1348
  43. package/dist/manager/globals-module-info.cjs +272 -135
  44. package/dist/manager/globals-module-info.d.ts +1 -1
  45. package/dist/manager/globals-module-info.js +257 -120
  46. package/dist/manager/globals-runtime.js +59553 -22373
  47. package/dist/manager/globals.cjs +23 -19
  48. package/dist/manager/globals.d.ts +8 -5
  49. package/dist/manager/globals.js +10 -6
  50. package/dist/manager/runtime.js +129 -129
  51. package/dist/manager-api/index.cjs +1184 -1209
  52. package/dist/manager-api/index.d.ts +3 -3
  53. package/dist/manager-api/index.js +1012 -1012
  54. package/dist/preview/globals.cjs +21 -17
  55. package/dist/preview/globals.d.ts +4 -1
  56. package/dist/preview/globals.js +6 -2
  57. package/dist/preview/runtime.js +43946 -6548
  58. package/dist/preview-api/index.cjs +1245 -1243
  59. package/dist/preview-api/index.d.ts +105 -61
  60. package/dist/preview-api/index.js +1311 -1273
  61. package/dist/preview-errors.cjs +1 -1
  62. package/dist/preview-errors.js +1 -1
  63. package/dist/router/index.cjs +847 -871
  64. package/dist/router/index.js +193 -199
  65. package/dist/test/index.cjs +34778 -0
  66. package/dist/test/index.d.ts +186 -0
  67. package/dist/test/index.js +32916 -0
  68. package/dist/test/preview.cjs +15870 -0
  69. package/dist/test/preview.d.ts +54 -0
  70. package/dist/test/preview.js +14441 -0
  71. package/dist/test/spy.cjs +258 -0
  72. package/dist/test/spy.d.ts +66 -0
  73. package/dist/test/spy.js +240 -0
  74. package/dist/theming/create.cjs +79 -2269
  75. package/dist/theming/create.js +67 -841
  76. package/dist/theming/index.cjs +1065 -3232
  77. package/dist/theming/index.js +951 -1719
  78. package/dist/types/index.d.ts +242 -242
  79. package/package.json +155 -3
@@ -1,776 +1,9 @@
1
- var ie = Object.defineProperty;
2
- var n = (r, e) => ie(r, "name", { value: e, configurable: !0 });
3
-
4
- // ../node_modules/@babel/runtime/helpers/esm/extends.js
5
- function v() {
6
- return v = Object.assign ? Object.assign.bind() : function(r) {
7
- for (var e = 1; e < arguments.length; e++) {
8
- var t = arguments[e];
9
- for (var a in t) ({}).hasOwnProperty.call(t, a) && (r[a] = t[a]);
10
- }
11
- return r;
12
- }, v.apply(null, arguments);
13
- }
14
- n(v, "_extends");
15
-
16
- // ../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
17
- function q(r) {
18
- if (r === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
19
- return r;
20
- }
21
- n(q, "_assertThisInitialized");
22
-
23
- // ../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
24
- function m(r, e) {
25
- return m = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, a) {
26
- return t.__proto__ = a, t;
27
- }, m(r, e);
28
- }
29
- n(m, "_setPrototypeOf");
30
-
31
- // ../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
32
- function U(r, e) {
33
- r.prototype = Object.create(e.prototype), r.prototype.constructor = r, m(r, e);
34
- }
35
- n(U, "_inheritsLoose");
36
-
37
- // ../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
38
- function F(r) {
39
- return F = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
40
- return e.__proto__ || Object.getPrototypeOf(e);
41
- }, F(r);
42
- }
43
- n(F, "_getPrototypeOf");
44
-
45
- // ../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
46
- function V(r) {
47
- try {
48
- return Function.toString.call(r).indexOf("[native code]") !== -1;
49
- } catch {
50
- return typeof r == "function";
51
- }
52
- }
53
- n(V, "_isNativeFunction");
54
-
55
- // ../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
56
- function T() {
57
- try {
58
- var r = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
59
- }));
60
- } catch {
61
- }
62
- return (T = /* @__PURE__ */ n(function() {
63
- return !!r;
64
- }, "_isNativeReflectConstruct"))();
65
- }
66
- n(T, "_isNativeReflectConstruct");
67
-
68
- // ../node_modules/@babel/runtime/helpers/esm/construct.js
69
- function N(r, e, t) {
70
- if (T()) return Reflect.construct.apply(null, arguments);
71
- var a = [null];
72
- a.push.apply(a, e);
73
- var i = new (r.bind.apply(r, a))();
74
- return t && m(i, t.prototype), i;
75
- }
76
- n(N, "_construct");
77
-
78
- // ../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
79
- function C(r) {
80
- var e = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
81
- return C = /* @__PURE__ */ n(function(a) {
82
- if (a === null || !V(a)) return a;
83
- if (typeof a != "function") throw new TypeError("Super expression must either be null or a function");
84
- if (e !== void 0) {
85
- if (e.has(a)) return e.get(a);
86
- e.set(a, i);
87
- }
88
- function i() {
89
- return N(a, arguments, F(this).constructor);
90
- }
91
- return n(i, "Wrapper"), i.prototype = Object.create(a.prototype, {
92
- constructor: {
93
- value: i,
94
- enumerable: !1,
95
- writable: !0,
96
- configurable: !0
97
- }
98
- }), m(i, a);
99
- }, "_wrapNativeSuper"), C(r);
100
- }
101
- n(C, "_wrapNativeSuper");
102
-
103
- // ../node_modules/polished/dist/polished.esm.js
104
- var oe = {
105
- 1: `Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0\
106
- .4, lightness: 0.75 }).
107
-
108
- `,
109
- 2: `Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, satura\
110
- tion: 0.4, lightness: 0.75, alpha: 0.7 }).
111
-
112
- `,
113
- 3: `Passed an incorrect argument to a color function, please pass a string representation of a color.
114
-
115
- `,
116
- 4: `Couldn't generate valid rgb string from %s, it returned %s.
117
-
118
- `,
119
- 5: `Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
120
-
121
- `,
122
- 6: `Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, bl\
123
- ue: 100 }).
124
-
125
- `,
126
- 7: `Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: \
127
- 205, blue: 100, alpha: 0.75 }).
128
-
129
- `,
130
- 8: `Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
131
-
132
- `,
133
- 9: `Please provide a number of steps to the modularScale helper.
134
-
135
- `,
136
- 10: `Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
137
-
138
- `,
139
- 11: `Invalid value passed as base to modularScale, expected number or em string but got "%s"
140
-
141
- `,
142
- 12: `Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
143
-
144
- `,
145
- 13: `Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
146
-
147
- `,
148
- 14: `Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
149
-
150
- `,
151
- 15: `Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
152
-
153
- `,
154
- 16: `You must provide a template to this method.
155
-
156
- `,
157
- 17: `You passed an unsupported selector state to this method.
158
-
159
- `,
160
- 18: `minScreen and maxScreen must be provided as stringified numbers with the same units.
161
-
162
- `,
163
- 19: `fromSize and toSize must be provided as stringified numbers with the same units.
164
-
165
- `,
166
- 20: `expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
167
-
168
- `,
169
- 21: "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
170
- 22: "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
171
- 23: `fontFace expects a name of a font-family.
172
-
173
- `,
174
- 24: `fontFace expects either the path to the font file(s) or a name of a local copy.
175
-
176
- `,
177
- 25: `fontFace expects localFonts to be an array.
178
-
179
- `,
180
- 26: `fontFace expects fileFormats to be an array.
181
-
182
- `,
183
- 27: `radialGradient requries at least 2 color-stops to properly render.
184
-
185
- `,
186
- 28: `Please supply a filename to retinaImage() as the first argument.
187
-
188
- `,
189
- 29: `Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
190
-
191
- `,
192
- 30: "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
193
- 31: `The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation
194
-
195
- `,
196
- 32: `To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
197
- To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
198
-
199
- `,
200
- 33: `The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
201
-
202
- `,
203
- 34: `borderRadius expects a radius value as a string or number as the second argument.
204
-
205
- `,
206
- 35: `borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
207
-
208
- `,
209
- 36: `Property must be a string value.
210
-
211
- `,
212
- 37: `Syntax Error at %s.
213
-
214
- `,
215
- 38: `Formula contains a function that needs parentheses at %s.
216
-
217
- `,
218
- 39: `Formula is missing closing parenthesis at %s.
219
-
220
- `,
221
- 40: `Formula has too many closing parentheses at %s.
222
-
223
- `,
224
- 41: `All values in a formula must have the same unit or be unitless.
225
-
226
- `,
227
- 42: `Please provide a number of steps to the modularScale helper.
228
-
229
- `,
230
- 43: `Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
231
-
232
- `,
233
- 44: `Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
234
-
235
- `,
236
- 45: `Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
237
-
238
- `,
239
- 46: `Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
240
-
241
- `,
242
- 47: `minScreen and maxScreen must be provided as stringified numbers with the same units.
243
-
244
- `,
245
- 48: `fromSize and toSize must be provided as stringified numbers with the same units.
246
-
247
- `,
248
- 49: `Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
249
-
250
- `,
251
- 50: `Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
252
-
253
- `,
254
- 51: `Expects the first argument object to have the properties prop, fromSize, and toSize.
255
-
256
- `,
257
- 52: `fontFace expects either the path to the font file(s) or a name of a local copy.
258
-
259
- `,
260
- 53: `fontFace expects localFonts to be an array.
261
-
262
- `,
263
- 54: `fontFace expects fileFormats to be an array.
264
-
265
- `,
266
- 55: `fontFace expects a name of a font-family.
267
-
268
- `,
269
- 56: `linearGradient requries at least 2 color-stops to properly render.
270
-
271
- `,
272
- 57: `radialGradient requries at least 2 color-stops to properly render.
273
-
274
- `,
275
- 58: `Please supply a filename to retinaImage() as the first argument.
276
-
277
- `,
278
- 59: `Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
279
-
280
- `,
281
- 60: "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
282
- 61: `Property must be a string value.
283
-
284
- `,
285
- 62: `borderRadius expects a radius value as a string or number as the second argument.
286
-
287
- `,
288
- 63: `borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
289
-
290
- `,
291
- 64: `The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
292
-
293
- `,
294
- 65: `To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animatio\
295
- n please supply them in simple values, e.g. animation('rotate', '2s').
296
-
297
- `,
298
- 66: `The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
299
-
300
- `,
301
- 67: `You must provide a template to this method.
302
-
303
- `,
304
- 68: `You passed an unsupported selector state to this method.
305
-
306
- `,
307
- 69: `Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
308
-
309
- `,
310
- 70: `Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
311
-
312
- `,
313
- 71: `Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
314
-
315
- `,
316
- 72: `Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
317
-
318
- `,
319
- 73: `Please provide a valid CSS variable.
320
-
321
- `,
322
- 74: `CSS variable not found and no default was provided.
323
-
324
- `,
325
- 75: `important requires a valid style object, got a %s instead.
326
-
327
- `,
328
- 76: `fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
329
-
330
- `,
331
- 77: `remToPx expects a value in "rem" but you provided it in "%s".
332
-
333
- `,
334
- 78: `base must be set in "px" or "%" but you set it in "%s".
335
- `
336
- };
337
- function se() {
338
- for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
339
- e[t] = arguments[t];
340
- var a = e[0], i = [], o;
341
- for (o = 1; o < e.length; o += 1)
342
- i.push(e[o]);
343
- return i.forEach(function(u) {
344
- a = a.replace(/%[a-z]/, u);
345
- }), a;
346
- }
347
- n(se, "format");
348
- var d = /* @__PURE__ */ function(r) {
349
- U(e, r);
350
- function e(t) {
351
- for (var a, i = arguments.length, o = new Array(i > 1 ? i - 1 : 0), u = 1; u < i; u++)
352
- o[u - 1] = arguments[u];
353
- return a = r.call(this, se.apply(void 0, [oe[t]].concat(o))) || this, q(a);
354
- }
355
- return n(e, "PolishedError"), e;
356
- }(/* @__PURE__ */ C(Error));
357
- function I(r) {
358
- return Math.round(r * 255);
359
- }
360
- n(I, "colorToInt");
361
- function ue(r, e, t) {
362
- return I(r) + "," + I(e) + "," + I(t);
363
- }
364
- n(ue, "convertToInt");
365
- function w(r, e, t, a) {
366
- if (a === void 0 && (a = ue), e === 0)
367
- return a(t, t, t);
368
- var i = (r % 360 + 360) % 360 / 60, o = (1 - Math.abs(2 * t - 1)) * e, u = o * (1 - Math.abs(i % 2 - 1)), f = 0, p = 0, l = 0;
369
- i >= 0 && i < 1 ? (f = o, p = u) : i >= 1 && i < 2 ? (f = u, p = o) : i >= 2 && i < 3 ? (p = o, l = u) : i >= 3 && i < 4 ? (p = u, l = o) :
370
- i >= 4 && i < 5 ? (f = u, l = o) : i >= 5 && i < 6 && (f = o, l = u);
371
- var h = t - o / 2, b = f + h, c = p + h, A = l + h;
372
- return a(b, c, A);
373
- }
374
- n(w, "hslToRgb");
375
- var G = {
376
- aliceblue: "f0f8ff",
377
- antiquewhite: "faebd7",
378
- aqua: "00ffff",
379
- aquamarine: "7fffd4",
380
- azure: "f0ffff",
381
- beige: "f5f5dc",
382
- bisque: "ffe4c4",
383
- black: "000",
384
- blanchedalmond: "ffebcd",
385
- blue: "0000ff",
386
- blueviolet: "8a2be2",
387
- brown: "a52a2a",
388
- burlywood: "deb887",
389
- cadetblue: "5f9ea0",
390
- chartreuse: "7fff00",
391
- chocolate: "d2691e",
392
- coral: "ff7f50",
393
- cornflowerblue: "6495ed",
394
- cornsilk: "fff8dc",
395
- crimson: "dc143c",
396
- cyan: "00ffff",
397
- darkblue: "00008b",
398
- darkcyan: "008b8b",
399
- darkgoldenrod: "b8860b",
400
- darkgray: "a9a9a9",
401
- darkgreen: "006400",
402
- darkgrey: "a9a9a9",
403
- darkkhaki: "bdb76b",
404
- darkmagenta: "8b008b",
405
- darkolivegreen: "556b2f",
406
- darkorange: "ff8c00",
407
- darkorchid: "9932cc",
408
- darkred: "8b0000",
409
- darksalmon: "e9967a",
410
- darkseagreen: "8fbc8f",
411
- darkslateblue: "483d8b",
412
- darkslategray: "2f4f4f",
413
- darkslategrey: "2f4f4f",
414
- darkturquoise: "00ced1",
415
- darkviolet: "9400d3",
416
- deeppink: "ff1493",
417
- deepskyblue: "00bfff",
418
- dimgray: "696969",
419
- dimgrey: "696969",
420
- dodgerblue: "1e90ff",
421
- firebrick: "b22222",
422
- floralwhite: "fffaf0",
423
- forestgreen: "228b22",
424
- fuchsia: "ff00ff",
425
- gainsboro: "dcdcdc",
426
- ghostwhite: "f8f8ff",
427
- gold: "ffd700",
428
- goldenrod: "daa520",
429
- gray: "808080",
430
- green: "008000",
431
- greenyellow: "adff2f",
432
- grey: "808080",
433
- honeydew: "f0fff0",
434
- hotpink: "ff69b4",
435
- indianred: "cd5c5c",
436
- indigo: "4b0082",
437
- ivory: "fffff0",
438
- khaki: "f0e68c",
439
- lavender: "e6e6fa",
440
- lavenderblush: "fff0f5",
441
- lawngreen: "7cfc00",
442
- lemonchiffon: "fffacd",
443
- lightblue: "add8e6",
444
- lightcoral: "f08080",
445
- lightcyan: "e0ffff",
446
- lightgoldenrodyellow: "fafad2",
447
- lightgray: "d3d3d3",
448
- lightgreen: "90ee90",
449
- lightgrey: "d3d3d3",
450
- lightpink: "ffb6c1",
451
- lightsalmon: "ffa07a",
452
- lightseagreen: "20b2aa",
453
- lightskyblue: "87cefa",
454
- lightslategray: "789",
455
- lightslategrey: "789",
456
- lightsteelblue: "b0c4de",
457
- lightyellow: "ffffe0",
458
- lime: "0f0",
459
- limegreen: "32cd32",
460
- linen: "faf0e6",
461
- magenta: "f0f",
462
- maroon: "800000",
463
- mediumaquamarine: "66cdaa",
464
- mediumblue: "0000cd",
465
- mediumorchid: "ba55d3",
466
- mediumpurple: "9370db",
467
- mediumseagreen: "3cb371",
468
- mediumslateblue: "7b68ee",
469
- mediumspringgreen: "00fa9a",
470
- mediumturquoise: "48d1cc",
471
- mediumvioletred: "c71585",
472
- midnightblue: "191970",
473
- mintcream: "f5fffa",
474
- mistyrose: "ffe4e1",
475
- moccasin: "ffe4b5",
476
- navajowhite: "ffdead",
477
- navy: "000080",
478
- oldlace: "fdf5e6",
479
- olive: "808000",
480
- olivedrab: "6b8e23",
481
- orange: "ffa500",
482
- orangered: "ff4500",
483
- orchid: "da70d6",
484
- palegoldenrod: "eee8aa",
485
- palegreen: "98fb98",
486
- paleturquoise: "afeeee",
487
- palevioletred: "db7093",
488
- papayawhip: "ffefd5",
489
- peachpuff: "ffdab9",
490
- peru: "cd853f",
491
- pink: "ffc0cb",
492
- plum: "dda0dd",
493
- powderblue: "b0e0e6",
494
- purple: "800080",
495
- rebeccapurple: "639",
496
- red: "f00",
497
- rosybrown: "bc8f8f",
498
- royalblue: "4169e1",
499
- saddlebrown: "8b4513",
500
- salmon: "fa8072",
501
- sandybrown: "f4a460",
502
- seagreen: "2e8b57",
503
- seashell: "fff5ee",
504
- sienna: "a0522d",
505
- silver: "c0c0c0",
506
- skyblue: "87ceeb",
507
- slateblue: "6a5acd",
508
- slategray: "708090",
509
- slategrey: "708090",
510
- snow: "fffafa",
511
- springgreen: "00ff7f",
512
- steelblue: "4682b4",
513
- tan: "d2b48c",
514
- teal: "008080",
515
- thistle: "d8bfd8",
516
- tomato: "ff6347",
517
- turquoise: "40e0d0",
518
- violet: "ee82ee",
519
- wheat: "f5deb3",
520
- white: "fff",
521
- whitesmoke: "f5f5f5",
522
- yellow: "ff0",
523
- yellowgreen: "9acd32"
524
- };
525
- function fe(r) {
526
- if (typeof r != "string") return r;
527
- var e = r.toLowerCase();
528
- return G[e] ? "#" + G[e] : r;
529
- }
530
- n(fe, "nameToHex");
531
- var pe = /^#[a-fA-F0-9]{6}$/, le = /^#[a-fA-F0-9]{8}$/, de = /^#[a-fA-F0-9]{3}$/, ce = /^#[a-fA-F0-9]{4}$/, R = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,
532
- me = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, ge = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,
533
- he = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
534
- function $(r) {
535
- if (typeof r != "string")
536
- throw new d(3);
537
- var e = fe(r);
538
- if (e.match(pe))
539
- return {
540
- red: parseInt("" + e[1] + e[2], 16),
541
- green: parseInt("" + e[3] + e[4], 16),
542
- blue: parseInt("" + e[5] + e[6], 16)
543
- };
544
- if (e.match(le)) {
545
- var t = parseFloat((parseInt("" + e[7] + e[8], 16) / 255).toFixed(2));
546
- return {
547
- red: parseInt("" + e[1] + e[2], 16),
548
- green: parseInt("" + e[3] + e[4], 16),
549
- blue: parseInt("" + e[5] + e[6], 16),
550
- alpha: t
551
- };
552
- }
553
- if (e.match(de))
554
- return {
555
- red: parseInt("" + e[1] + e[1], 16),
556
- green: parseInt("" + e[2] + e[2], 16),
557
- blue: parseInt("" + e[3] + e[3], 16)
558
- };
559
- if (e.match(ce)) {
560
- var a = parseFloat((parseInt("" + e[4] + e[4], 16) / 255).toFixed(2));
561
- return {
562
- red: parseInt("" + e[1] + e[1], 16),
563
- green: parseInt("" + e[2] + e[2], 16),
564
- blue: parseInt("" + e[3] + e[3], 16),
565
- alpha: a
566
- };
567
- }
568
- var i = R.exec(e);
569
- if (i)
570
- return {
571
- red: parseInt("" + i[1], 10),
572
- green: parseInt("" + i[2], 10),
573
- blue: parseInt("" + i[3], 10)
574
- };
575
- var o = me.exec(e.substring(0, 50));
576
- if (o)
577
- return {
578
- red: parseInt("" + o[1], 10),
579
- green: parseInt("" + o[2], 10),
580
- blue: parseInt("" + o[3], 10),
581
- alpha: parseFloat("" + o[4]) > 1 ? parseFloat("" + o[4]) / 100 : parseFloat("" + o[4])
582
- };
583
- var u = ge.exec(e);
584
- if (u) {
585
- var f = parseInt("" + u[1], 10), p = parseInt("" + u[2], 10) / 100, l = parseInt("" + u[3], 10) / 100, h = "rgb(" + w(f, p, l) + ")", b = R.
586
- exec(h);
587
- if (!b)
588
- throw new d(4, e, h);
589
- return {
590
- red: parseInt("" + b[1], 10),
591
- green: parseInt("" + b[2], 10),
592
- blue: parseInt("" + b[3], 10)
593
- };
594
- }
595
- var c = he.exec(e.substring(0, 50));
596
- if (c) {
597
- var A = parseInt("" + c[1], 10), ne = parseInt("" + c[2], 10) / 100, ae = parseInt("" + c[3], 10) / 100, W = "rgb(" + w(A, ne, ae) + ")",
598
- S = R.exec(W);
599
- if (!S)
600
- throw new d(4, e, W);
601
- return {
602
- red: parseInt("" + S[1], 10),
603
- green: parseInt("" + S[2], 10),
604
- blue: parseInt("" + S[3], 10),
605
- alpha: parseFloat("" + c[4]) > 1 ? parseFloat("" + c[4]) / 100 : parseFloat("" + c[4])
606
- };
607
- }
608
- throw new d(5);
609
- }
610
- n($, "parseToRgb");
611
- function be(r) {
612
- var e = r.red / 255, t = r.green / 255, a = r.blue / 255, i = Math.max(e, t, a), o = Math.min(e, t, a), u = (i + o) / 2;
613
- if (i === o)
614
- return r.alpha !== void 0 ? {
615
- hue: 0,
616
- saturation: 0,
617
- lightness: u,
618
- alpha: r.alpha
619
- } : {
620
- hue: 0,
621
- saturation: 0,
622
- lightness: u
623
- };
624
- var f, p = i - o, l = u > 0.5 ? p / (2 - i - o) : p / (i + o);
625
- switch (i) {
626
- case e:
627
- f = (t - a) / p + (t < a ? 6 : 0);
628
- break;
629
- case t:
630
- f = (a - e) / p + 2;
631
- break;
632
- default:
633
- f = (e - t) / p + 4;
634
- break;
635
- }
636
- return f *= 60, r.alpha !== void 0 ? {
637
- hue: f,
638
- saturation: l,
639
- lightness: u,
640
- alpha: r.alpha
641
- } : {
642
- hue: f,
643
- saturation: l,
644
- lightness: u
645
- };
646
- }
647
- n(be, "rgbToHsl");
648
- function Q(r) {
649
- return be($(r));
650
- }
651
- n(Q, "parseToHsl");
652
- var ve = /* @__PURE__ */ n(function(e) {
653
- return e.length === 7 && e[1] === e[2] && e[3] === e[4] && e[5] === e[6] ? "#" + e[1] + e[3] + e[5] : e;
654
- }, "reduceHexValue"), O = ve;
655
- function g(r) {
656
- var e = r.toString(16);
657
- return e.length === 1 ? "0" + e : e;
658
- }
659
- n(g, "numberToHex");
660
- function j(r) {
661
- return g(Math.round(r * 255));
662
- }
663
- n(j, "colorToHex");
664
- function ye(r, e, t) {
665
- return O("#" + j(r) + j(e) + j(t));
666
- }
667
- n(ye, "convertToHex");
668
- function z(r, e, t) {
669
- return w(r, e, t, ye);
670
- }
671
- n(z, "hslToHex");
672
- function we(r, e, t) {
673
- if (typeof r == "number" && typeof e == "number" && typeof t == "number")
674
- return z(r, e, t);
675
- if (typeof r == "object" && e === void 0 && t === void 0)
676
- return z(r.hue, r.saturation, r.lightness);
677
- throw new d(1);
678
- }
679
- n(we, "hsl");
680
- function xe(r, e, t, a) {
681
- if (typeof r == "number" && typeof e == "number" && typeof t == "number" && typeof a == "number")
682
- return a >= 1 ? z(r, e, t) : "rgba(" + w(r, e, t) + "," + a + ")";
683
- if (typeof r == "object" && e === void 0 && t === void 0 && a === void 0)
684
- return r.alpha >= 1 ? z(r.hue, r.saturation, r.lightness) : "rgba(" + w(r.hue, r.saturation, r.lightness) + "," + r.alpha + ")";
685
- throw new d(2);
686
- }
687
- n(xe, "hsla");
688
- function k(r, e, t) {
689
- if (typeof r == "number" && typeof e == "number" && typeof t == "number")
690
- return O("#" + g(r) + g(e) + g(t));
691
- if (typeof r == "object" && e === void 0 && t === void 0)
692
- return O("#" + g(r.red) + g(r.green) + g(r.blue));
693
- throw new d(6);
694
- }
695
- n(k, "rgb");
696
- function x(r, e, t, a) {
697
- if (typeof r == "string" && typeof e == "number") {
698
- var i = $(r);
699
- return "rgba(" + i.red + "," + i.green + "," + i.blue + "," + e + ")";
700
- } else {
701
- if (typeof r == "number" && typeof e == "number" && typeof t == "number" && typeof a == "number")
702
- return a >= 1 ? k(r, e, t) : "rgba(" + r + "," + e + "," + t + "," + a + ")";
703
- if (typeof r == "object" && e === void 0 && t === void 0 && a === void 0)
704
- return r.alpha >= 1 ? k(r.red, r.green, r.blue) : "rgba(" + r.red + "," + r.green + "," + r.blue + "," + r.alpha + ")";
705
- }
706
- throw new d(7);
707
- }
708
- n(x, "rgba");
709
- var Se = /* @__PURE__ */ n(function(e) {
710
- return typeof e.red == "number" && typeof e.green == "number" && typeof e.blue == "number" && (typeof e.alpha != "number" || typeof e.alpha >
711
- "u");
712
- }, "isRgb"), Fe = /* @__PURE__ */ n(function(e) {
713
- return typeof e.red == "number" && typeof e.green == "number" && typeof e.blue == "number" && typeof e.alpha == "number";
714
- }, "isRgba"), Ce = /* @__PURE__ */ n(function(e) {
715
- return typeof e.hue == "number" && typeof e.saturation == "number" && typeof e.lightness == "number" && (typeof e.alpha != "number" || typeof e.
716
- alpha > "u");
717
- }, "isHsl"), ze = /* @__PURE__ */ n(function(e) {
718
- return typeof e.hue == "number" && typeof e.saturation == "number" && typeof e.lightness == "number" && typeof e.alpha == "number";
719
- }, "isHsla");
720
- function Y(r) {
721
- if (typeof r != "object") throw new d(8);
722
- if (Fe(r)) return x(r);
723
- if (Se(r)) return k(r);
724
- if (ze(r)) return xe(r);
725
- if (Ce(r)) return we(r);
726
- throw new d(8);
727
- }
728
- n(Y, "toColorString");
729
- function J(r, e, t) {
730
- return /* @__PURE__ */ n(function() {
731
- var i = t.concat(Array.prototype.slice.call(arguments));
732
- return i.length >= e ? r.apply(this, i) : J(r, e, i);
733
- }, "fn");
734
- }
735
- n(J, "curried");
736
- function B(r) {
737
- return J(r, r.length, []);
738
- }
739
- n(B, "curry");
740
- function M(r, e, t) {
741
- return Math.max(r, Math.min(e, t));
742
- }
743
- n(M, "guard");
744
- function Ae(r, e) {
745
- if (e === "transparent") return e;
746
- var t = Q(e);
747
- return Y(v({}, t, {
748
- lightness: M(0, 1, t.lightness - parseFloat(r))
749
- }));
750
- }
751
- n(Ae, "darken");
752
- var Te = /* @__PURE__ */ B(Ae), Z = Te;
753
- function Ie(r, e) {
754
- if (e === "transparent") return e;
755
- var t = Q(e);
756
- return Y(v({}, t, {
757
- lightness: M(0, 1, t.lightness + parseFloat(r))
758
- }));
759
- }
760
- n(Ie, "lighten");
761
- var Re = /* @__PURE__ */ B(Ie), X = Re;
762
- function je(r, e) {
763
- if (e === "transparent") return e;
764
- var t = $(e), a = typeof t.alpha == "number" ? t.alpha : 1, i = v({}, t, {
765
- alpha: M(0, 1, +(a * 100 - parseFloat(r) * 100).toFixed(2) / 100)
766
- });
767
- return x(i);
768
- }
769
- n(je, "transparentize");
770
- var Oe = /* @__PURE__ */ B(je), K = Oe;
1
+ var h = Object.defineProperty;
2
+ var o = (r, t) => h(r, "name", { value: t, configurable: !0 });
771
3
 
772
4
  // src/theming/base.ts
773
- var s = {
5
+ import { transparentize as u } from "polished";
6
+ var e = {
774
7
  // Official color palette
775
8
  primary: "#FF4785",
776
9
  // coral
@@ -808,20 +41,20 @@ var s = {
808
41
  positiveText: "#448028",
809
42
  negativeText: "#D43900",
810
43
  warningText: "#A15C20"
811
- }, P = {
44
+ }, i = {
812
45
  app: "#F6F9FC",
813
- bar: s.lightest,
814
- content: s.lightest,
815
- preview: s.lightest,
46
+ bar: e.lightest,
47
+ content: e.lightest,
48
+ preview: e.lightest,
816
49
  gridCellSize: 10,
817
- hoverable: K(0.9, s.secondary),
50
+ hoverable: u(0.9, e.secondary),
818
51
  // hover state for items in a list
819
52
  // Notification, error, and warning backgrounds
820
53
  positive: "#E1FFD4",
821
54
  negative: "#FEDED2",
822
55
  warning: "#FFF5CF",
823
56
  critical: "#FF4400"
824
- }, y = {
57
+ }, a = {
825
58
  fonts: {
826
59
  base: [
827
60
  '"Nunito Sans"',
@@ -867,7 +100,7 @@ var s = {
867
100
  };
868
101
 
869
102
  // src/theming/themes/dark.ts
870
- var ke = {
103
+ var C = {
871
104
  base: "dark",
872
105
  // Storybook-specific color palette
873
106
  colorPrimary: "#FF4785",
@@ -877,20 +110,20 @@ var ke = {
877
110
  // UI
878
111
  appBg: "#222425",
879
112
  appContentBg: "#1B1C1D",
880
- appPreviewBg: s.lightest,
113
+ appPreviewBg: e.lightest,
881
114
  appBorderColor: "rgba(255,255,255,.1)",
882
115
  appBorderRadius: 4,
883
116
  // Fonts
884
- fontBase: y.fonts.base,
885
- fontCode: y.fonts.mono,
117
+ fontBase: a.fonts.base,
118
+ fontCode: a.fonts.mono,
886
119
  // Text colors
887
120
  textColor: "#C9CDCF",
888
121
  textInverseColor: "#222425",
889
122
  textMutedColor: "#798186",
890
123
  // Toolbar default and active colors
891
- barTextColor: s.mediumdark,
892
- barHoverColor: s.secondary,
893
- barSelectedColor: s.secondary,
124
+ barTextColor: e.mediumdark,
125
+ barHoverColor: e.secondary,
126
+ barSelectedColor: e.secondary,
894
127
  barBg: "#292C2E",
895
128
  // Form colors
896
129
  buttonBg: "#222425",
@@ -899,12 +132,12 @@ var ke = {
899
132
  booleanSelectedBg: "#2E3438",
900
133
  inputBg: "#1B1C1D",
901
134
  inputBorder: "rgba(255,255,255,.1)",
902
- inputTextColor: s.lightest,
135
+ inputTextColor: e.lightest,
903
136
  inputBorderRadius: 4
904
- }, _ = ke;
137
+ }, g = C;
905
138
 
906
139
  // src/theming/themes/light.ts
907
- var $e = {
140
+ var b = {
908
141
  base: "light",
909
142
  // Storybook-specific color palette
910
143
  colorPrimary: "#FF4785",
@@ -912,79 +145,72 @@ var $e = {
912
145
  colorSecondary: "#029CFD",
913
146
  // ocean
914
147
  // UI
915
- appBg: P.app,
916
- appContentBg: s.lightest,
917
- appPreviewBg: s.lightest,
918
- appBorderColor: s.border,
148
+ appBg: i.app,
149
+ appContentBg: e.lightest,
150
+ appPreviewBg: e.lightest,
151
+ appBorderColor: e.border,
919
152
  appBorderRadius: 4,
920
153
  // Fonts
921
- fontBase: y.fonts.base,
922
- fontCode: y.fonts.mono,
154
+ fontBase: a.fonts.base,
155
+ fontCode: a.fonts.mono,
923
156
  // Text colors
924
- textColor: s.darkest,
925
- textInverseColor: s.lightest,
926
- textMutedColor: s.dark,
157
+ textColor: e.darkest,
158
+ textInverseColor: e.lightest,
159
+ textMutedColor: e.dark,
927
160
  // Toolbar default and active colors
928
- barTextColor: s.mediumdark,
929
- barHoverColor: s.secondary,
930
- barSelectedColor: s.secondary,
931
- barBg: s.lightest,
161
+ barTextColor: e.mediumdark,
162
+ barHoverColor: e.secondary,
163
+ barSelectedColor: e.secondary,
164
+ barBg: e.lightest,
932
165
  // Form colors
933
- buttonBg: P.app,
934
- buttonBorder: s.medium,
935
- booleanBg: s.mediumlight,
936
- booleanSelectedBg: s.lightest,
937
- inputBg: s.lightest,
938
- inputBorder: s.border,
939
- inputTextColor: s.darkest,
166
+ buttonBg: i.app,
167
+ buttonBorder: e.medium,
168
+ booleanBg: e.mediumlight,
169
+ booleanSelectedBg: e.lightest,
170
+ inputBg: e.lightest,
171
+ inputBorder: e.border,
172
+ inputTextColor: e.darkest,
940
173
  inputBorderRadius: 4
941
- }, E = $e;
942
-
943
- // src/theming/utils.ts
944
- import { logger as Be } from "storybook/internal/client-logger";
945
-
946
- // ../node_modules/@storybook/global/dist/index.mjs
947
- var ee = (() => {
948
- let r;
949
- return typeof window < "u" ? r = window : typeof globalThis < "u" ? r = globalThis : typeof global < "u" ? r = global : typeof self < "u" ?
950
- r = self : r = {}, r;
951
- })();
174
+ }, s = b;
952
175
 
953
176
  // src/theming/utils.ts
954
- var { window: H } = ee;
955
- var Me = /* @__PURE__ */ n((r) => typeof r != "string" ? (Be.warn(
177
+ import { logger as f } from "storybook/internal/client-logger";
178
+ import { global as y } from "@storybook/global";
179
+ import { darken as B, lighten as x, rgba as m } from "polished";
180
+ var { window: l } = y;
181
+ var k = /* @__PURE__ */ o((r) => typeof r != "string" ? (f.warn(
956
182
  `Color passed to theme object should be a string. Instead ${r}(${typeof r}) was passed.`
957
- ), !1) : !0, "isColorString"), Pe = /* @__PURE__ */ n((r) => !/(gradient|var|calc)/.test(r), "isValidColorForPolished"), Ee = /* @__PURE__ */ n(
958
- (r, e) => r === "darken" ? x(`${Z(1, e)}`, 0.95) : r === "lighten" ? x(`${X(1, e)}`, 0.95) : e, "applyPolished"), re = /* @__PURE__ */ n((r) => (e) => {
959
- if (!Me(e) || !Pe(e))
960
- return e;
183
+ ), !1) : !0, "isColorString"), T = /* @__PURE__ */ o((r) => !/(gradient|var|calc)/.test(r), "isValidColorForPolished"), S = /* @__PURE__ */ o(
184
+ (r, t) => r === "darken" ? m(`${B(1, t)}`, 0.95) : r === "lighten" ? m(`${x(1, t)}`, 0.95) : t, "applyPolished"), c = /* @__PURE__ */ o((r) => (t) => {
185
+ if (!k(t) || !T(t))
186
+ return t;
961
187
  try {
962
- return Ee(r, e);
188
+ return S(r, t);
963
189
  } catch {
964
- return e;
190
+ return t;
965
191
  }
966
- }, "colorFactory"), jr = re("lighten"), Or = re("darken"), te = /* @__PURE__ */ n(() => !H || !H.matchMedia ? "light" : H.matchMedia("(prefe\
967
- rs-color-scheme: dark)").matches ? "dark" : "light", "getPreferredColorScheme");
192
+ }, "colorFactory"), I = c("lighten"), N = c("darken"), F = /* @__PURE__ */ o(() => !l || !l.matchMedia ? "light" : l.matchMedia("(prefers-co\
193
+ lor-scheme: dark)").matches ? "dark" : "light", "getPreferredColorScheme");
968
194
 
969
195
  // src/theming/create.ts
970
- var L = {
971
- light: E,
972
- dark: _,
973
- normal: E
974
- }, D = te(), Er = /* @__PURE__ */ n((r = { base: D }, e) => {
975
- let t = {
976
- ...L[D],
977
- ...L[r.base] || {},
196
+ var d = {
197
+ light: s,
198
+ dark: g,
199
+ normal: s
200
+ }, p = F(), W = /* @__PURE__ */ o((r = { base: p }, t) => {
201
+ let n = {
202
+ ...d[p],
203
+ ...d[r.base] || {},
978
204
  ...r,
979
- base: L[r.base] ? r.base : D
205
+ base: d[r.base] ? r.base : p
980
206
  };
981
207
  return {
982
- ...e,
983
208
  ...t,
984
- barSelectedColor: r.barSelectedColor || t.colorSecondary
209
+ ...n,
210
+ barSelectedColor: r.barSelectedColor || n.colorSecondary
985
211
  };
986
212
  }, "create");
987
213
  export {
988
- Er as create,
989
- L as themes
214
+ W as create,
215
+ d as themes
990
216
  };