storybook 9.0.0-beta.4 → 9.0.0-beta.6

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 (59) hide show
  1. package/assets/server/base-preview-head.html +2 -1
  2. package/dist/babel/index.cjs +15060 -14974
  3. package/dist/babel/index.d.ts +37 -18
  4. package/dist/babel/index.js +15097 -15011
  5. package/dist/bin/index.cjs +44 -44
  6. package/dist/bin/index.js +44 -44
  7. package/dist/builder-manager/index.cjs +119 -104
  8. package/dist/builder-manager/index.js +118 -102
  9. package/dist/cli/bin/index.cjs +1 -1
  10. package/dist/cli/bin/index.js +1 -1
  11. package/dist/cli/index.cjs +19438 -19340
  12. package/dist/cli/index.js +19449 -19351
  13. package/dist/client-logger/index.d.ts +2 -1
  14. package/dist/common/index.cjs +4997 -4925
  15. package/dist/common/index.js +5090 -5014
  16. package/dist/components/index.cjs +4581 -4419
  17. package/dist/components/index.d.ts +12 -12
  18. package/dist/components/index.js +3847 -3681
  19. package/dist/core-server/index.cjs +6360 -6276
  20. package/dist/core-server/index.js +6407 -6318
  21. package/dist/core-server/presets/common-manager.js +3871 -3476
  22. package/dist/core-server/presets/common-preset.cjs +2304 -2238
  23. package/dist/core-server/presets/common-preset.js +2389 -2319
  24. package/dist/docs-tools/index.cjs +484 -464
  25. package/dist/docs-tools/index.js +502 -482
  26. package/dist/highlight/index.cjs +19 -18
  27. package/dist/highlight/index.d.ts +4 -5
  28. package/dist/highlight/index.js +3 -2
  29. package/dist/highlight/preview.cjs +311 -307
  30. package/dist/highlight/preview.js +293 -289
  31. package/dist/instrumenter/index.cjs +561 -559
  32. package/dist/instrumenter/index.js +1551 -1498
  33. package/dist/manager/globals-module-info.cjs +1 -0
  34. package/dist/manager/globals-module-info.js +1 -0
  35. package/dist/manager/globals-runtime.js +19639 -19374
  36. package/dist/manager/runtime.js +4372 -4133
  37. package/dist/manager-api/index.cjs +2375 -2319
  38. package/dist/manager-api/index.js +1722 -1666
  39. package/dist/node-logger/index.cjs +25 -25
  40. package/dist/node-logger/index.js +25 -25
  41. package/dist/preview/runtime.js +12782 -12707
  42. package/dist/preview-api/index.cjs +1121 -1102
  43. package/dist/preview-api/index.js +1169 -1150
  44. package/dist/router/index.cjs +1366 -1347
  45. package/dist/router/index.js +594 -575
  46. package/dist/server-errors.cjs +6 -6
  47. package/dist/server-errors.js +6 -6
  48. package/dist/telemetry/index.cjs +696 -691
  49. package/dist/telemetry/index.js +764 -759
  50. package/dist/test/index.cjs +69 -70
  51. package/dist/test/index.d.ts +1216 -74
  52. package/dist/test/index.js +128 -130
  53. package/dist/test/preview.cjs +16 -16
  54. package/dist/test/preview.js +15 -15
  55. package/dist/theming/create.cjs +16 -17
  56. package/dist/theming/create.js +346 -228
  57. package/dist/theming/index.cjs +16 -17
  58. package/dist/theming/index.js +948 -839
  59. package/package.json +10 -17
@@ -1,92 +1,92 @@
1
- var ae = Object.defineProperty;
2
- var n = (r, e) => ae(r, "name", { value: e, configurable: !0 });
1
+ var se = Object.defineProperty;
2
+ var n = (r, e) => se(r, "name", { value: e, configurable: !0 });
3
3
 
4
4
  // ../node_modules/@babel/runtime/helpers/esm/extends.js
5
- function v() {
6
- return v = Object.assign ? Object.assign.bind() : function(r) {
5
+ function l() {
6
+ return l = Object.assign ? Object.assign.bind() : function(r) {
7
7
  for (var e = 1; e < arguments.length; e++) {
8
8
  var t = arguments[e];
9
9
  for (var a in t) ({}).hasOwnProperty.call(t, a) && (r[a] = t[a]);
10
10
  }
11
11
  return r;
12
- }, v.apply(null, arguments);
12
+ }, l.apply(null, arguments);
13
13
  }
14
- n(v, "_extends");
14
+ n(l, "_extends");
15
15
 
16
16
  // ../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
17
- function q(r) {
17
+ function V(r) {
18
18
  if (r === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
19
19
  return r;
20
20
  }
21
- n(q, "_assertThisInitialized");
21
+ n(V, "_assertThisInitialized");
22
22
 
23
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) {
24
+ function v(r, e) {
25
+ return v = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, a) {
26
26
  return t.__proto__ = a, t;
27
- }, m(r, e);
27
+ }, v(r, e);
28
28
  }
29
- n(m, "_setPrototypeOf");
29
+ n(v, "_setPrototypeOf");
30
30
 
31
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);
32
+ function N(r, e) {
33
+ r.prototype = Object.create(e.prototype), r.prototype.constructor = r, v(r, e);
34
34
  }
35
- n(U, "_inheritsLoose");
35
+ n(N, "_inheritsLoose");
36
36
 
37
37
  // ../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
38
- function F(r) {
39
- return F = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
38
+ function R(r) {
39
+ return R = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(e) {
40
40
  return e.__proto__ || Object.getPrototypeOf(e);
41
- }, F(r);
41
+ }, R(r);
42
42
  }
43
- n(F, "_getPrototypeOf");
43
+ n(R, "_getPrototypeOf");
44
44
 
45
45
  // ../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
46
- function V(r) {
46
+ function G(r) {
47
47
  try {
48
48
  return Function.toString.call(r).indexOf("[native code]") !== -1;
49
49
  } catch {
50
50
  return typeof r == "function";
51
51
  }
52
52
  }
53
- n(V, "_isNativeFunction");
53
+ n(G, "_isNativeFunction");
54
54
 
55
55
  // ../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
56
- function T() {
56
+ function k() {
57
57
  try {
58
58
  var r = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
59
59
  }));
60
60
  } catch {
61
61
  }
62
- return (T = /* @__PURE__ */ n(function() {
62
+ return (k = /* @__PURE__ */ n(function() {
63
63
  return !!r;
64
64
  }, "_isNativeReflectConstruct"))();
65
65
  }
66
- n(T, "_isNativeReflectConstruct");
66
+ n(k, "_isNativeReflectConstruct");
67
67
 
68
68
  // ../node_modules/@babel/runtime/helpers/esm/construct.js
69
- function N(r, e, t) {
70
- if (T()) return Reflect.construct.apply(null, arguments);
69
+ function Q(r, e, t) {
70
+ if (k()) return Reflect.construct.apply(null, arguments);
71
71
  var a = [null];
72
72
  a.push.apply(a, e);
73
73
  var i = new (r.bind.apply(r, a))();
74
- return t && m(i, t.prototype), i;
74
+ return t && v(i, t.prototype), i;
75
75
  }
76
- n(N, "_construct");
76
+ n(Q, "_construct");
77
77
 
78
78
  // ../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
79
- function C(r) {
79
+ function j(r) {
80
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;
81
+ return j = /* @__PURE__ */ n(function(a) {
82
+ if (a === null || !G(a)) return a;
83
83
  if (typeof a != "function") throw new TypeError("Super expression must either be null or a function");
84
84
  if (e !== void 0) {
85
85
  if (e.has(a)) return e.get(a);
86
86
  e.set(a, i);
87
87
  }
88
88
  function i() {
89
- return N(a, arguments, F(this).constructor);
89
+ return Q(a, arguments, R(this).constructor);
90
90
  }
91
91
  return n(i, "Wrapper"), i.prototype = Object.create(a.prototype, {
92
92
  constructor: {
@@ -95,13 +95,13 @@ function C(r) {
95
95
  writable: !0,
96
96
  configurable: !0
97
97
  }
98
- }), m(i, a);
99
- }, "_wrapNativeSuper"), C(r);
98
+ }), v(i, a);
99
+ }, "_wrapNativeSuper"), j(r);
100
100
  }
101
- n(C, "_wrapNativeSuper");
101
+ n(j, "_wrapNativeSuper");
102
102
 
103
103
  // ../node_modules/polished/dist/polished.esm.js
104
- var ie = {
104
+ var fe = {
105
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
106
  .4, lightness: 0.75 }).
107
107
 
@@ -334,45 +334,78 @@ n please supply them in simple values, e.g. animation('rotate', '2s').
334
334
  78: `base must be set in "px" or "%" but you set it in "%s".
335
335
  `
336
336
  };
337
- function oe() {
337
+ function pe() {
338
338
  for (var r = arguments.length, e = new Array(r), t = 0; t < r; t++)
339
339
  e[t] = arguments[t];
340
340
  var a = e[0], i = [], o;
341
341
  for (o = 1; o < e.length; o += 1)
342
342
  i.push(e[o]);
343
- return i.forEach(function(s) {
344
- a = a.replace(/%[a-z]/, s);
343
+ return i.forEach(function(u) {
344
+ a = a.replace(/%[a-z]/, u);
345
345
  }), a;
346
346
  }
347
- n(oe, "format");
347
+ n(pe, "format");
348
348
  var d = /* @__PURE__ */ function(r) {
349
- U(e, r);
349
+ N(e, r);
350
350
  function e(t) {
351
- for (var a, i = arguments.length, o = new Array(i > 1 ? i - 1 : 0), s = 1; s < i; s++)
352
- o[s - 1] = arguments[s];
353
- return a = r.call(this, oe.apply(void 0, [ie[t]].concat(o))) || this, q(a);
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, pe.apply(void 0, [fe[t]].concat(o))) || this, V(a);
354
354
  }
355
355
  return n(e, "PolishedError"), e;
356
- }(/* @__PURE__ */ C(Error));
357
- function I(r) {
356
+ }(/* @__PURE__ */ j(Error));
357
+ function Y(r, e) {
358
+ return r.substr(-e.length) === e;
359
+ }
360
+ n(Y, "endsWith");
361
+ var le = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
362
+ function J(r) {
363
+ if (typeof r != "string") return r;
364
+ var e = r.match(le);
365
+ return e ? parseFloat(r) : r;
366
+ }
367
+ n(J, "stripUnit");
368
+ var de = /* @__PURE__ */ n(function(e) {
369
+ return function(t, a) {
370
+ a === void 0 && (a = "16px");
371
+ var i = t, o = a;
372
+ if (typeof t == "string") {
373
+ if (!Y(t, "px"))
374
+ throw new d(69, e, t);
375
+ i = J(t);
376
+ }
377
+ if (typeof a == "string") {
378
+ if (!Y(a, "px"))
379
+ throw new d(70, e, a);
380
+ o = J(a);
381
+ }
382
+ if (typeof i == "string")
383
+ throw new d(71, t, e);
384
+ if (typeof o == "string")
385
+ throw new d(72, a, e);
386
+ return "" + i / o + e;
387
+ };
388
+ }, "pxtoFactory"), X = de, Mr = X("em");
389
+ var Pr = X("rem");
390
+ function $(r) {
358
391
  return Math.round(r * 255);
359
392
  }
360
- n(I, "colorToInt");
361
- function ue(r, e, t) {
362
- return I(r) + "," + I(e) + "," + I(t);
393
+ n($, "colorToInt");
394
+ function ce(r, e, t) {
395
+ return $(r) + "," + $(e) + "," + $(t);
363
396
  }
364
- n(ue, "convertToInt");
365
- function w(r, e, t, a) {
366
- if (a === void 0 && (a = ue), e === 0)
397
+ n(ce, "convertToInt");
398
+ function T(r, e, t, a) {
399
+ if (a === void 0 && (a = ce), e === 0)
367
400
  return a(t, t, t);
368
- var i = (r % 360 + 360) % 360 / 60, o = (1 - Math.abs(2 * t - 1)) * e, s = o * (1 - Math.abs(i % 2 - 1)), f = 0, p = 0, l = 0;
369
- i >= 0 && i < 1 ? (f = o, p = s) : i >= 1 && i < 2 ? (f = s, p = o) : i >= 2 && i < 3 ? (p = o, l = s) : i >= 3 && i < 4 ? (p = s, l = o) :
370
- i >= 4 && i < 5 ? (f = s, l = o) : i >= 5 && i < 6 && (f = o, l = s);
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 = {
401
+ 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, g = 0;
402
+ i >= 0 && i < 1 ? (f = o, p = u) : i >= 1 && i < 2 ? (f = u, p = o) : i >= 2 && i < 3 ? (p = o, g = u) : i >= 3 && i < 4 ? (p = u, g = o) :
403
+ i >= 4 && i < 5 ? (f = u, g = o) : i >= 5 && i < 6 && (f = o, g = u);
404
+ var b = t - o / 2, h = f + b, c = p + b, A = g + b;
405
+ return a(h, c, A);
406
+ }
407
+ n(T, "hslToRgb");
408
+ var Z = {
376
409
  aliceblue: "f0f8ff",
377
410
  antiquewhite: "faebd7",
378
411
  aqua: "00ffff",
@@ -522,26 +555,26 @@ var G = {
522
555
  yellow: "ff0",
523
556
  yellowgreen: "9acd32"
524
557
  };
525
- function se(r) {
558
+ function me(r) {
526
559
  if (typeof r != "string") return r;
527
560
  var e = r.toLowerCase();
528
- return G[e] ? "#" + G[e] : r;
561
+ return Z[e] ? "#" + Z[e] : r;
529
562
  }
530
- n(se, "nameToHex");
531
- var fe = /^#[a-fA-F0-9]{6}$/, pe = /^#[a-fA-F0-9]{8}$/, le = /^#[a-fA-F0-9]{3}$/, de = /^#[a-fA-F0-9]{4}$/, R = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,
532
- ce = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, me = /^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
- ge = /^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) {
563
+ n(me, "nameToHex");
564
+ var ge = /^#[a-fA-F0-9]{6}$/, he = /^#[a-fA-F0-9]{8}$/, be = /^#[a-fA-F0-9]{3}$/, ve = /^#[a-fA-F0-9]{4}$/, B = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,
565
+ ye = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i, we = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,
566
+ xe = /^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;
567
+ function F(r) {
535
568
  if (typeof r != "string")
536
569
  throw new d(3);
537
- var e = se(r);
538
- if (e.match(fe))
570
+ var e = me(r);
571
+ if (e.match(ge))
539
572
  return {
540
573
  red: parseInt("" + e[1] + e[2], 16),
541
574
  green: parseInt("" + e[3] + e[4], 16),
542
575
  blue: parseInt("" + e[5] + e[6], 16)
543
576
  };
544
- if (e.match(pe)) {
577
+ if (e.match(he)) {
545
578
  var t = parseFloat((parseInt("" + e[7] + e[8], 16) / 255).toFixed(2));
546
579
  return {
547
580
  red: parseInt("" + e[1] + e[2], 16),
@@ -550,13 +583,13 @@ function $(r) {
550
583
  alpha: t
551
584
  };
552
585
  }
553
- if (e.match(le))
586
+ if (e.match(be))
554
587
  return {
555
588
  red: parseInt("" + e[1] + e[1], 16),
556
589
  green: parseInt("" + e[2] + e[2], 16),
557
590
  blue: parseInt("" + e[3] + e[3], 16)
558
591
  };
559
- if (e.match(de)) {
592
+ if (e.match(ve)) {
560
593
  var a = parseFloat((parseInt("" + e[4] + e[4], 16) / 255).toFixed(2));
561
594
  return {
562
595
  red: parseInt("" + e[1] + e[1], 16),
@@ -565,14 +598,14 @@ function $(r) {
565
598
  alpha: a
566
599
  };
567
600
  }
568
- var i = R.exec(e);
601
+ var i = B.exec(e);
569
602
  if (i)
570
603
  return {
571
604
  red: parseInt("" + i[1], 10),
572
605
  green: parseInt("" + i[2], 10),
573
606
  blue: parseInt("" + i[3], 10)
574
607
  };
575
- var o = ce.exec(e.substring(0, 50));
608
+ var o = ye.exec(e.substring(0, 50));
576
609
  if (o)
577
610
  return {
578
611
  red: parseInt("" + o[1], 10),
@@ -580,48 +613,48 @@ function $(r) {
580
613
  blue: parseInt("" + o[3], 10),
581
614
  alpha: parseFloat("" + o[4]) > 1 ? parseFloat("" + o[4]) / 100 : parseFloat("" + o[4])
582
615
  };
583
- var s = me.exec(e);
584
- if (s) {
585
- var f = parseInt("" + s[1], 10), p = parseInt("" + s[2], 10) / 100, l = parseInt("" + s[3], 10) / 100, h = "rgb(" + w(f, p, l) + ")", b = R.
586
- exec(h);
587
- if (!b)
588
- throw new d(4, e, h);
616
+ var u = we.exec(e);
617
+ if (u) {
618
+ var f = parseInt("" + u[1], 10), p = parseInt("" + u[2], 10) / 100, g = parseInt("" + u[3], 10) / 100, b = "rgb(" + T(f, p, g) + ")", h = B.
619
+ exec(b);
620
+ if (!h)
621
+ throw new d(4, e, b);
589
622
  return {
590
- red: parseInt("" + b[1], 10),
591
- green: parseInt("" + b[2], 10),
592
- blue: parseInt("" + b[3], 10)
623
+ red: parseInt("" + h[1], 10),
624
+ green: parseInt("" + h[2], 10),
625
+ blue: parseInt("" + h[3], 10)
593
626
  };
594
627
  }
595
- var c = ge.exec(e.substring(0, 50));
628
+ var c = xe.exec(e.substring(0, 50));
596
629
  if (c) {
597
- var A = parseInt("" + c[1], 10), te = parseInt("" + c[2], 10) / 100, ne = parseInt("" + c[3], 10) / 100, W = "rgb(" + w(A, te, ne) + ")",
598
- S = R.exec(W);
599
- if (!S)
600
- throw new d(4, e, W);
630
+ var A = parseInt("" + c[1], 10), oe = parseInt("" + c[2], 10) / 100, ue = parseInt("" + c[3], 10) / 100, U = "rgb(" + T(A, oe, ue) + ")",
631
+ I = B.exec(U);
632
+ if (!I)
633
+ throw new d(4, e, U);
601
634
  return {
602
- red: parseInt("" + S[1], 10),
603
- green: parseInt("" + S[2], 10),
604
- blue: parseInt("" + S[3], 10),
635
+ red: parseInt("" + I[1], 10),
636
+ green: parseInt("" + I[2], 10),
637
+ blue: parseInt("" + I[3], 10),
605
638
  alpha: parseFloat("" + c[4]) > 1 ? parseFloat("" + c[4]) / 100 : parseFloat("" + c[4])
606
639
  };
607
640
  }
608
641
  throw new d(5);
609
642
  }
610
- n($, "parseToRgb");
611
- function he(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), s = (i + o) / 2;
643
+ n(F, "parseToRgb");
644
+ function Se(r) {
645
+ 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
646
  if (i === o)
614
647
  return r.alpha !== void 0 ? {
615
648
  hue: 0,
616
649
  saturation: 0,
617
- lightness: s,
650
+ lightness: u,
618
651
  alpha: r.alpha
619
652
  } : {
620
653
  hue: 0,
621
654
  saturation: 0,
622
- lightness: s
655
+ lightness: u
623
656
  };
624
- var f, p = i - o, l = s > 0.5 ? p / (2 - i - o) : p / (i + o);
657
+ var f, p = i - o, g = u > 0.5 ? p / (2 - i - o) : p / (i + o);
625
658
  switch (i) {
626
659
  case e:
627
660
  f = (t - a) / p + (t < a ? 6 : 0);
@@ -635,142 +668,227 @@ function he(r) {
635
668
  }
636
669
  return f *= 60, r.alpha !== void 0 ? {
637
670
  hue: f,
638
- saturation: l,
639
- lightness: s,
671
+ saturation: g,
672
+ lightness: u,
640
673
  alpha: r.alpha
641
674
  } : {
642
675
  hue: f,
643
- saturation: l,
644
- lightness: s
676
+ saturation: g,
677
+ lightness: u
645
678
  };
646
679
  }
647
- n(he, "rgbToHsl");
648
- function Q(r) {
649
- return he($(r));
680
+ n(Se, "rgbToHsl");
681
+ function y(r) {
682
+ return Se(F(r));
650
683
  }
651
- n(Q, "parseToHsl");
652
- var be = /* @__PURE__ */ n(function(e) {
684
+ n(y, "parseToHsl");
685
+ var Fe = /* @__PURE__ */ n(function(e) {
653
686
  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 = be;
655
- function g(r) {
687
+ }, "reduceHexValue"), P = Fe;
688
+ function x(r) {
656
689
  var e = r.toString(16);
657
690
  return e.length === 1 ? "0" + e : e;
658
691
  }
659
- n(g, "numberToHex");
660
- function j(r) {
661
- return g(Math.round(r * 255));
692
+ n(x, "numberToHex");
693
+ function M(r) {
694
+ return x(Math.round(r * 255));
662
695
  }
663
- n(j, "colorToHex");
664
- function ve(r, e, t) {
665
- return O("#" + j(r) + j(e) + j(t));
696
+ n(M, "colorToHex");
697
+ function Ce(r, e, t) {
698
+ return P("#" + M(r) + M(e) + M(t));
666
699
  }
667
- n(ve, "convertToHex");
668
- function z(r, e, t) {
669
- return w(r, e, t, ve);
700
+ n(Ce, "convertToHex");
701
+ function O(r, e, t) {
702
+ return T(r, e, t, Ce);
670
703
  }
671
- n(z, "hslToHex");
672
- function ye(r, e, t) {
704
+ n(O, "hslToHex");
705
+ function ze(r, e, t) {
673
706
  if (typeof r == "number" && typeof e == "number" && typeof t == "number")
674
- return z(r, e, t);
707
+ return O(r, e, t);
675
708
  if (typeof r == "object" && e === void 0 && t === void 0)
676
- return z(r.hue, r.saturation, r.lightness);
709
+ return O(r.hue, r.saturation, r.lightness);
677
710
  throw new d(1);
678
711
  }
679
- n(ye, "hsl");
680
- function we(r, e, t, a) {
712
+ n(ze, "hsl");
713
+ function Ae(r, e, t, a) {
681
714
  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 + ")";
715
+ return a >= 1 ? O(r, e, t) : "rgba(" + T(r, e, t) + "," + a + ")";
683
716
  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 + ")";
717
+ return r.alpha >= 1 ? O(r.hue, r.saturation, r.lightness) : "rgba(" + T(r.hue, r.saturation, r.lightness) + "," + r.alpha + ")";
685
718
  throw new d(2);
686
719
  }
687
- n(we, "hsla");
688
- function k(r, e, t) {
720
+ n(Ae, "hsla");
721
+ function E(r, e, t) {
689
722
  if (typeof r == "number" && typeof e == "number" && typeof t == "number")
690
- return O("#" + g(r) + g(e) + g(t));
723
+ return P("#" + x(r) + x(e) + x(t));
691
724
  if (typeof r == "object" && e === void 0 && t === void 0)
692
- return O("#" + g(r.red) + g(r.green) + g(r.blue));
725
+ return P("#" + x(r.red) + x(r.green) + x(r.blue));
693
726
  throw new d(6);
694
727
  }
695
- n(k, "rgb");
696
- function x(r, e, t, a) {
728
+ n(E, "rgb");
729
+ function S(r, e, t, a) {
697
730
  if (typeof r == "string" && typeof e == "number") {
698
- var i = $(r);
731
+ var i = F(r);
699
732
  return "rgba(" + i.red + "," + i.green + "," + i.blue + "," + e + ")";
700
733
  } else {
701
734
  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 + ")";
735
+ return a >= 1 ? E(r, e, t) : "rgba(" + r + "," + e + "," + t + "," + a + ")";
703
736
  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 + ")";
737
+ return r.alpha >= 1 ? E(r.red, r.green, r.blue) : "rgba(" + r.red + "," + r.green + "," + r.blue + "," + r.alpha + ")";
705
738
  }
706
739
  throw new d(7);
707
740
  }
708
- n(x, "rgba");
709
- var xe = /* @__PURE__ */ n(function(e) {
741
+ n(S, "rgba");
742
+ var Te = /* @__PURE__ */ n(function(e) {
710
743
  return typeof e.red == "number" && typeof e.green == "number" && typeof e.blue == "number" && (typeof e.alpha != "number" || typeof e.alpha >
711
744
  "u");
712
- }, "isRgb"), Se = /* @__PURE__ */ n(function(e) {
745
+ }, "isRgb"), Ie = /* @__PURE__ */ n(function(e) {
713
746
  return typeof e.red == "number" && typeof e.green == "number" && typeof e.blue == "number" && typeof e.alpha == "number";
714
- }, "isRgba"), Fe = /* @__PURE__ */ n(function(e) {
747
+ }, "isRgba"), Re = /* @__PURE__ */ n(function(e) {
715
748
  return typeof e.hue == "number" && typeof e.saturation == "number" && typeof e.lightness == "number" && (typeof e.alpha != "number" || typeof e.
716
749
  alpha > "u");
717
- }, "isHsl"), Ce = /* @__PURE__ */ n(function(e) {
750
+ }, "isHsl"), je = /* @__PURE__ */ n(function(e) {
718
751
  return typeof e.hue == "number" && typeof e.saturation == "number" && typeof e.lightness == "number" && typeof e.alpha == "number";
719
752
  }, "isHsla");
720
- function Y(r) {
753
+ function w(r) {
721
754
  if (typeof r != "object") throw new d(8);
722
- if (Se(r)) return x(r);
723
- if (xe(r)) return k(r);
724
- if (Ce(r)) return we(r);
725
- if (Fe(r)) return ye(r);
755
+ if (Ie(r)) return S(r);
756
+ if (Te(r)) return E(r);
757
+ if (je(r)) return Ae(r);
758
+ if (Re(r)) return ze(r);
726
759
  throw new d(8);
727
760
  }
728
- n(Y, "toColorString");
729
- function J(r, e, t) {
761
+ n(w, "toColorString");
762
+ function K(r, e, t) {
730
763
  return /* @__PURE__ */ n(function() {
731
764
  var i = t.concat(Array.prototype.slice.call(arguments));
732
- return i.length >= e ? r.apply(this, i) : J(r, e, i);
765
+ return i.length >= e ? r.apply(this, i) : K(r, e, i);
733
766
  }, "fn");
734
767
  }
735
- n(J, "curried");
736
- function B(r) {
737
- return J(r, r.length, []);
768
+ n(K, "curried");
769
+ function m(r) {
770
+ return K(r, r.length, []);
738
771
  }
739
- n(B, "curry");
740
- function M(r, e, t) {
772
+ n(m, "curry");
773
+ function Oe(r, e) {
774
+ if (e === "transparent") return e;
775
+ var t = y(e);
776
+ return w(l({}, t, {
777
+ hue: t.hue + parseFloat(r)
778
+ }));
779
+ }
780
+ n(Oe, "adjustHue");
781
+ var Er = m(Oe);
782
+ function C(r, e, t) {
741
783
  return Math.max(r, Math.min(e, t));
742
784
  }
743
- n(M, "guard");
744
- function ze(r, e) {
785
+ n(C, "guard");
786
+ function ke(r, e) {
745
787
  if (e === "transparent") return e;
746
- var t = Q(e);
747
- return Y(v({}, t, {
748
- lightness: M(0, 1, t.lightness - parseFloat(r))
788
+ var t = y(e);
789
+ return w(l({}, t, {
790
+ lightness: C(0, 1, t.lightness - parseFloat(r))
749
791
  }));
750
792
  }
751
- n(ze, "darken");
752
- var Ae = /* @__PURE__ */ B(ze), Z = Ae;
753
- function Te(r, e) {
793
+ n(ke, "darken");
794
+ var $e = m(ke), _ = $e;
795
+ function Be(r, e) {
754
796
  if (e === "transparent") return e;
755
- var t = Q(e);
756
- return Y(v({}, t, {
757
- lightness: M(0, 1, t.lightness + parseFloat(r))
797
+ var t = y(e);
798
+ return w(l({}, t, {
799
+ saturation: C(0, 1, t.saturation - parseFloat(r))
758
800
  }));
759
801
  }
760
- n(Te, "lighten");
761
- var Ie = /* @__PURE__ */ B(Te), X = Ie;
762
- function Re(r, e) {
802
+ n(Be, "desaturate");
803
+ var Hr = m(Be);
804
+ function Me(r, e) {
805
+ if (e === "transparent") return e;
806
+ var t = y(e);
807
+ return w(l({}, t, {
808
+ lightness: C(0, 1, t.lightness + parseFloat(r))
809
+ }));
810
+ }
811
+ n(Me, "lighten");
812
+ var Pe = m(Me), ee = Pe;
813
+ function Ee(r, e, t) {
814
+ if (e === "transparent") return t;
815
+ if (t === "transparent") return e;
816
+ if (r === 0) return t;
817
+ var a = F(e), i = l({}, a, {
818
+ alpha: typeof a.alpha == "number" ? a.alpha : 1
819
+ }), o = F(t), u = l({}, o, {
820
+ alpha: typeof o.alpha == "number" ? o.alpha : 1
821
+ }), f = i.alpha - u.alpha, p = parseFloat(r) * 2 - 1, g = p * f === -1 ? p : p + f, b = 1 + p * f, h = (g / b + 1) / 2, c = 1 - h, A = {
822
+ red: Math.floor(i.red * h + u.red * c),
823
+ green: Math.floor(i.green * h + u.green * c),
824
+ blue: Math.floor(i.blue * h + u.blue * c),
825
+ alpha: i.alpha * parseFloat(r) + u.alpha * (1 - parseFloat(r))
826
+ };
827
+ return S(A);
828
+ }
829
+ n(Ee, "mix");
830
+ var He = m(Ee), re = He;
831
+ function Le(r, e) {
832
+ if (e === "transparent") return e;
833
+ var t = F(e), a = typeof t.alpha == "number" ? t.alpha : 1, i = l({}, t, {
834
+ alpha: C(0, 1, (a * 100 + parseFloat(r) * 100) / 100)
835
+ });
836
+ return S(i);
837
+ }
838
+ n(Le, "opacify");
839
+ var Lr = m(Le);
840
+ function De(r, e) {
841
+ if (e === "transparent") return e;
842
+ var t = y(e);
843
+ return w(l({}, t, {
844
+ saturation: C(0, 1, t.saturation + parseFloat(r))
845
+ }));
846
+ }
847
+ n(De, "saturate");
848
+ var Dr = m(De);
849
+ function We(r, e) {
850
+ return e === "transparent" ? e : w(l({}, y(e), {
851
+ hue: parseFloat(r)
852
+ }));
853
+ }
854
+ n(We, "setHue");
855
+ var Wr = m(We);
856
+ function qe(r, e) {
857
+ return e === "transparent" ? e : w(l({}, y(e), {
858
+ lightness: parseFloat(r)
859
+ }));
860
+ }
861
+ n(qe, "setLightness");
862
+ var qr = m(qe);
863
+ function Ue(r, e) {
864
+ return e === "transparent" ? e : w(l({}, y(e), {
865
+ saturation: parseFloat(r)
866
+ }));
867
+ }
868
+ n(Ue, "setSaturation");
869
+ var Ur = m(Ue);
870
+ function Ve(r, e) {
871
+ return e === "transparent" ? e : re(parseFloat(r), "rgb(0, 0, 0)", e);
872
+ }
873
+ n(Ve, "shade");
874
+ var Vr = m(Ve);
875
+ function Ne(r, e) {
876
+ return e === "transparent" ? e : re(parseFloat(r), "rgb(255, 255, 255)", e);
877
+ }
878
+ n(Ne, "tint");
879
+ var Nr = m(Ne);
880
+ function Ge(r, e) {
763
881
  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)
882
+ var t = F(e), a = typeof t.alpha == "number" ? t.alpha : 1, i = l({}, t, {
883
+ alpha: C(0, 1, +(a * 100 - parseFloat(r) * 100).toFixed(2) / 100)
766
884
  });
767
- return x(i);
885
+ return S(i);
768
886
  }
769
- n(Re, "transparentize");
770
- var je = /* @__PURE__ */ B(Re), K = je;
887
+ n(Ge, "transparentize");
888
+ var Qe = m(Ge), te = Qe;
771
889
 
772
890
  // src/theming/base.ts
773
- var u = {
891
+ var s = {
774
892
  // Official color palette
775
893
  primary: "#FF4785",
776
894
  // coral
@@ -808,20 +926,20 @@ var u = {
808
926
  positiveText: "#448028",
809
927
  negativeText: "#D43900",
810
928
  warningText: "#A15C20"
811
- }, P = {
929
+ }, H = {
812
930
  app: "#F6F9FC",
813
- bar: u.lightest,
814
- content: u.lightest,
815
- preview: u.lightest,
931
+ bar: s.lightest,
932
+ content: s.lightest,
933
+ preview: s.lightest,
816
934
  gridCellSize: 10,
817
- hoverable: K(0.9, u.secondary),
935
+ hoverable: te(0.9, s.secondary),
818
936
  // hover state for items in a list
819
937
  // Notification, error, and warning backgrounds
820
938
  positive: "#E1FFD4",
821
939
  negative: "#FEDED2",
822
940
  warning: "#FFF5CF",
823
941
  critical: "#FF4400"
824
- }, y = {
942
+ }, z = {
825
943
  fonts: {
826
944
  base: [
827
945
  '"Nunito Sans"',
@@ -867,7 +985,7 @@ var u = {
867
985
  };
868
986
 
869
987
  // src/theming/themes/dark.ts
870
- var Oe = {
988
+ var Ye = {
871
989
  base: "dark",
872
990
  // Storybook-specific color palette
873
991
  colorPrimary: "#FF4785",
@@ -877,20 +995,20 @@ var Oe = {
877
995
  // UI
878
996
  appBg: "#222425",
879
997
  appContentBg: "#1B1C1D",
880
- appPreviewBg: u.lightest,
998
+ appPreviewBg: s.lightest,
881
999
  appBorderColor: "rgba(255,255,255,.1)",
882
1000
  appBorderRadius: 4,
883
1001
  // Fonts
884
- fontBase: y.fonts.base,
885
- fontCode: y.fonts.mono,
1002
+ fontBase: z.fonts.base,
1003
+ fontCode: z.fonts.mono,
886
1004
  // Text colors
887
1005
  textColor: "#C9CDCF",
888
1006
  textInverseColor: "#222425",
889
1007
  textMutedColor: "#798186",
890
1008
  // Toolbar default and active colors
891
- barTextColor: u.mediumdark,
892
- barHoverColor: u.secondary,
893
- barSelectedColor: u.secondary,
1009
+ barTextColor: s.mediumdark,
1010
+ barHoverColor: s.secondary,
1011
+ barSelectedColor: s.secondary,
894
1012
  barBg: "#292C2E",
895
1013
  // Form colors
896
1014
  buttonBg: "#222425",
@@ -899,12 +1017,12 @@ var Oe = {
899
1017
  booleanSelectedBg: "#2E3438",
900
1018
  inputBg: "#1B1C1D",
901
1019
  inputBorder: "rgba(255,255,255,.1)",
902
- inputTextColor: u.lightest,
1020
+ inputTextColor: s.lightest,
903
1021
  inputBorderRadius: 4
904
- }, _ = Oe;
1022
+ }, ne = Ye;
905
1023
 
906
1024
  // src/theming/themes/light.ts
907
- var ke = {
1025
+ var Je = {
908
1026
  base: "light",
909
1027
  // Storybook-specific color palette
910
1028
  colorPrimary: "#FF4785",
@@ -912,63 +1030,63 @@ var ke = {
912
1030
  colorSecondary: "#029CFD",
913
1031
  // ocean
914
1032
  // UI
915
- appBg: P.app,
916
- appContentBg: u.lightest,
917
- appPreviewBg: u.lightest,
918
- appBorderColor: u.border,
1033
+ appBg: H.app,
1034
+ appContentBg: s.lightest,
1035
+ appPreviewBg: s.lightest,
1036
+ appBorderColor: s.border,
919
1037
  appBorderRadius: 4,
920
1038
  // Fonts
921
- fontBase: y.fonts.base,
922
- fontCode: y.fonts.mono,
1039
+ fontBase: z.fonts.base,
1040
+ fontCode: z.fonts.mono,
923
1041
  // Text colors
924
- textColor: u.darkest,
925
- textInverseColor: u.lightest,
926
- textMutedColor: u.dark,
1042
+ textColor: s.darkest,
1043
+ textInverseColor: s.lightest,
1044
+ textMutedColor: s.dark,
927
1045
  // Toolbar default and active colors
928
- barTextColor: u.mediumdark,
929
- barHoverColor: u.secondary,
930
- barSelectedColor: u.secondary,
931
- barBg: u.lightest,
1046
+ barTextColor: s.mediumdark,
1047
+ barHoverColor: s.secondary,
1048
+ barSelectedColor: s.secondary,
1049
+ barBg: s.lightest,
932
1050
  // Form colors
933
- buttonBg: P.app,
934
- buttonBorder: u.medium,
935
- booleanBg: u.mediumlight,
936
- booleanSelectedBg: u.lightest,
937
- inputBg: u.lightest,
938
- inputBorder: u.border,
939
- inputTextColor: u.darkest,
1051
+ buttonBg: H.app,
1052
+ buttonBorder: s.medium,
1053
+ booleanBg: s.mediumlight,
1054
+ booleanSelectedBg: s.lightest,
1055
+ inputBg: s.lightest,
1056
+ inputBorder: s.border,
1057
+ inputTextColor: s.darkest,
940
1058
  inputBorderRadius: 4
941
- }, E = ke;
1059
+ }, L = Je;
942
1060
 
943
1061
  // src/theming/utils.ts
944
- import { logger as $e } from "storybook/internal/client-logger";
945
- import { global as Be } from "@storybook/global";
946
- var { window: H } = Be;
947
- var Me = /* @__PURE__ */ n((r) => typeof r != "string" ? ($e.warn(
1062
+ import { logger as Ze } from "storybook/internal/client-logger";
1063
+ import { global as Xe } from "@storybook/global";
1064
+ var { window: D } = Xe;
1065
+ var Ke = /* @__PURE__ */ n((r) => typeof r != "string" ? (Ze.warn(
948
1066
  `Color passed to theme object should be a string. Instead ${r}(${typeof r}) was passed.`
949
- ), !1) : !0, "isColorString"), Pe = /* @__PURE__ */ n((r) => !/(gradient|var|calc)/.test(r), "isValidColorForPolished"), Ee = /* @__PURE__ */ n(
950
- (r, e) => r === "darken" ? x(`${Z(1, e)}`, 0.95) : r === "lighten" ? x(`${X(1, e)}`, 0.95) : e, "applyPolished"), ee = /* @__PURE__ */ n((r) => (e) => {
951
- if (!Me(e) || !Pe(e))
1067
+ ), !1) : !0, "isColorString"), _e = /* @__PURE__ */ n((r) => !/(gradient|var|calc)/.test(r), "isValidColorForPolished"), er = /* @__PURE__ */ n(
1068
+ (r, e) => r === "darken" ? S(`${_(1, e)}`, 0.95) : r === "lighten" ? S(`${ee(1, e)}`, 0.95) : e, "applyPolished"), ae = /* @__PURE__ */ n((r) => (e) => {
1069
+ if (!Ke(e) || !_e(e))
952
1070
  return e;
953
1071
  try {
954
- return Ee(r, e);
1072
+ return er(r, e);
955
1073
  } catch {
956
1074
  return e;
957
1075
  }
958
- }, "colorFactory"), Rr = ee("lighten"), jr = ee("darken"), re = /* @__PURE__ */ n(() => !H || !H.matchMedia ? "light" : H.matchMedia("(prefe\
1076
+ }, "colorFactory"), nt = ae("lighten"), at = ae("darken"), ie = /* @__PURE__ */ n(() => !D || !D.matchMedia ? "light" : D.matchMedia("(prefe\
959
1077
  rs-color-scheme: dark)").matches ? "dark" : "light", "getPreferredColorScheme");
960
1078
 
961
1079
  // src/theming/create.ts
962
- var L = {
963
- light: E,
964
- dark: _,
965
- normal: E
966
- }, D = re(), Pr = /* @__PURE__ */ n((r = { base: D }, e) => {
1080
+ var W = {
1081
+ light: L,
1082
+ dark: ne,
1083
+ normal: L
1084
+ }, q = ie(), pt = /* @__PURE__ */ n((r = { base: q }, e) => {
967
1085
  let t = {
968
- ...L[D],
969
- ...L[r.base] || {},
1086
+ ...W[q],
1087
+ ...W[r.base] || {},
970
1088
  ...r,
971
- base: L[r.base] ? r.base : D
1089
+ base: W[r.base] ? r.base : q
972
1090
  };
973
1091
  return {
974
1092
  ...e,
@@ -977,6 +1095,6 @@ var L = {
977
1095
  };
978
1096
  }, "create");
979
1097
  export {
980
- Pr as create,
981
- L as themes
1098
+ pt as create,
1099
+ W as themes
982
1100
  };