storybook 10.2.0-alpha.1 → 10.2.0-alpha.10

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 (120) hide show
  1. package/dist/_browser-chunks/{Color-TNPFN3FC.js → Color-XESOIGZP.js} +9 -568
  2. package/dist/_browser-chunks/{WithTooltip-IO6J4KBT.js → WithTooltip-65CFNBJE.js} +70 -70
  3. package/dist/_browser-chunks/{chunk-45UGUKRX.js → chunk-242VQQM5.js} +1 -1
  4. package/dist/_browser-chunks/{chunk-JP7NCOJX.js → chunk-3LY4VQVK.js} +1 -1
  5. package/dist/_browser-chunks/{chunk-VYJQ7RU5.js → chunk-G4M6MXF4.js} +31 -27
  6. package/dist/_browser-chunks/{chunk-BRX2HXH7.js → chunk-IH6QJILI.js} +1 -1
  7. package/dist/_browser-chunks/{chunk-AS2HQEYC.js → chunk-IWQGIXJS.js} +1 -1
  8. package/dist/_browser-chunks/{chunk-3IAH5M2U.js → chunk-IYCKG66Y.js} +5 -5
  9. package/dist/_browser-chunks/{chunk-UD6FQLAF.js → chunk-JK6U3MQW.js} +3 -3
  10. package/dist/_browser-chunks/{chunk-FQ7SLVLR.js → chunk-JVRDBUUP.js} +20 -1
  11. package/dist/_browser-chunks/{chunk-GFLS4VP3.js → chunk-LCHBOIHN.js} +6 -6
  12. package/dist/_browser-chunks/{chunk-CHUV5WSW.js → chunk-LE2LTDW3.js} +1 -1
  13. package/dist/_browser-chunks/{chunk-IPA5A322.js → chunk-MEXTPDJG.js} +1 -1
  14. package/dist/_browser-chunks/{chunk-XJNX76GA.js → chunk-NQJGOFZV.js} +4 -4
  15. package/dist/_browser-chunks/chunk-NZMVUW5T.js +7 -0
  16. package/dist/_browser-chunks/{chunk-2XZMBGTA.js → chunk-POMIZRJL.js} +3 -3
  17. package/dist/_browser-chunks/{chunk-RP5RXKFU.js → chunk-Q5RYDXT3.js} +38 -30
  18. package/dist/_browser-chunks/{chunk-SS2NHR7W.js → chunk-RBABWY22.js} +18 -18
  19. package/dist/_browser-chunks/{chunk-AXG2BOBL.js → chunk-S6TK43XQ.js} +10 -10
  20. package/dist/_browser-chunks/{chunk-AIOS4NGK.js → chunk-SWJP5COI.js} +11 -11
  21. package/dist/_browser-chunks/{chunk-H6XK3RSC.js → chunk-UAYGIC3L.js} +6 -6
  22. package/dist/_browser-chunks/{chunk-YKE5S47A.js → chunk-V2VKKSMQ.js} +18 -18
  23. package/dist/_browser-chunks/{chunk-GFY5R5EY.js → chunk-V5NV5R37.js} +1 -1
  24. package/dist/_browser-chunks/chunk-VIJ7SQRO.js +568 -0
  25. package/dist/_browser-chunks/{chunk-3OXGAGBE.js → chunk-XLJZ7AOP.js} +14 -14
  26. package/dist/_browser-chunks/{chunk-P4F4UVXX.js → chunk-YKABRMAI.js} +15 -15
  27. package/dist/_browser-chunks/{chunk-WJYERY3R.js → chunk-ZCFV7BZB.js} +2 -2
  28. package/dist/_browser-chunks/{formatter-QJ4M4OGQ.js → formatter-EIJCOSYU.js} +2 -2
  29. package/dist/_browser-chunks/{syntaxhighlighter-IQDEPFLK.js → syntaxhighlighter-ED5Y7EFY.js} +119 -119
  30. package/dist/_node-chunks/{builder-manager-LXL5N6M5.js → builder-manager-IL56SHZF.js} +23 -22
  31. package/dist/_node-chunks/camelcase-P3NIWBZX.js +62 -0
  32. package/dist/_node-chunks/{chunk-SR5ZYD7K.js → chunk-BP66TAYC.js} +8 -8
  33. package/dist/_node-chunks/{chunk-R3WYNAT5.js → chunk-D3YJHXPC.js} +6 -6
  34. package/dist/_node-chunks/{chunk-5GNBLJKS.js → chunk-E2KSZELU.js} +8 -8
  35. package/dist/_node-chunks/{chunk-KXDU466E.js → chunk-EKU7ASGO.js} +31 -31
  36. package/dist/_node-chunks/chunk-GLYH3TSV.js +61 -0
  37. package/dist/_node-chunks/{chunk-GOOBGRAV.js → chunk-JXL37VS7.js} +34 -24
  38. package/dist/_node-chunks/{chunk-4BQMSZKI.js → chunk-KH2A547Y.js} +165 -191
  39. package/dist/_node-chunks/{chunk-77APSTTM.js → chunk-KP3IIE5P.js} +8 -9
  40. package/dist/_node-chunks/{chunk-5NWCBUGD.js → chunk-LZ5NNY6S.js} +6 -6
  41. package/dist/_node-chunks/{chunk-AJUO2ZU3.js → chunk-MLCI5FPI.js} +9 -9
  42. package/dist/_node-chunks/{chunk-CLNMK7MP.js → chunk-OVKHHS4W.js} +5434 -1625
  43. package/dist/_node-chunks/{chunk-ET4VMMZG.js → chunk-OZHIDIRL.js} +77 -16
  44. package/dist/_node-chunks/{chunk-TX77W2KY.js → chunk-POAHHCVK.js} +597 -593
  45. package/dist/_node-chunks/chunk-Q6PDB4Y6.js +126 -0
  46. package/dist/_node-chunks/{chunk-VFTNRF5X.js → chunk-QF3YWFYM.js} +17 -17
  47. package/dist/_node-chunks/{chunk-KMTK5W6O.js → chunk-RGJIQDLW.js} +48 -26
  48. package/dist/_node-chunks/{chunk-FTR6MHOX.js → chunk-SME7252C.js} +59 -147
  49. package/dist/_node-chunks/{chunk-LEDV47V2.js → chunk-TAETXAN6.js} +15 -15
  50. package/dist/_node-chunks/chunk-TPSZ4QDT.js +20 -0
  51. package/dist/_node-chunks/{chunk-PGFQADZC.js → chunk-WULYWBBT.js} +7 -7
  52. package/dist/_node-chunks/{chunk-JYMZJCZ7.js → chunk-XBDIQU4P.js} +62 -124
  53. package/dist/_node-chunks/chunk-XXOA6ULE.js +18 -0
  54. package/dist/_node-chunks/{chunk-ZI2RAI3I.js → chunk-YCQRVBE4.js} +26 -7
  55. package/dist/_node-chunks/{chunk-TP6ICLTL.js → chunk-YELE6V4D.js} +6 -6
  56. package/dist/_node-chunks/{chunk-GYZQMMTN.js → chunk-Z2CJCEHN.js} +9 -9
  57. package/dist/_node-chunks/{chunk-F7377GT2.js → chunk-Z2ETF7EI.js} +111 -38
  58. package/dist/_node-chunks/chunk-ZHSAQXJF.js +23 -0
  59. package/dist/_node-chunks/{dist-HGQ5R6JU.js → dist-5MXCD6KF.js} +10 -10
  60. package/dist/_node-chunks/{globby-5XJTXKUJ.js → globby-322GM5CY.js} +155 -164
  61. package/dist/_node-chunks/{lib-XNLTS2RI.js → lib-IXZT5UQX.js} +16 -16
  62. package/dist/_node-chunks/{mdx-N42X6CFJ-7WF3QWVO.js → mdx-N42X6CFJ-DBPHTSPN.js} +11 -11
  63. package/dist/_node-chunks/{p-limit-RBKYTJKF.js → p-limit-TLN4WCPA.js} +19 -15
  64. package/dist/babel/index.js +10 -10
  65. package/dist/bin/core.js +40 -34
  66. package/dist/bin/dispatcher.js +11 -11
  67. package/dist/bin/loader.js +14 -11
  68. package/dist/channels/index.js +3 -3
  69. package/dist/cli/index.d.ts +1330 -250
  70. package/dist/cli/index.js +18 -18
  71. package/dist/common/index.d.ts +1344 -289
  72. package/dist/common/index.js +22 -22
  73. package/dist/components/index.d.ts +9 -2
  74. package/dist/components/index.js +339 -317
  75. package/dist/core-events/index.d.ts +4 -2
  76. package/dist/core-events/index.js +4 -2
  77. package/dist/core-server/index.d.ts +71 -2
  78. package/dist/core-server/index.js +3381 -3529
  79. package/dist/core-server/presets/common-manager.css +2 -2
  80. package/dist/core-server/presets/common-manager.js +93 -65
  81. package/dist/core-server/presets/common-override-preset.js +9 -9
  82. package/dist/core-server/presets/common-preset.js +86 -118
  83. package/dist/csf/index.d.ts +41 -11
  84. package/dist/csf/index.js +46 -39
  85. package/dist/csf-tools/index.js +9 -9
  86. package/dist/docs-tools/index.js +5 -5
  87. package/dist/instrumenter/index.js +1 -1
  88. package/dist/manager/globals-runtime.js +9402 -7204
  89. package/dist/manager/runtime.js +186 -143
  90. package/dist/manager-api/index.js +34 -26
  91. package/dist/manager-errors.d.ts +24 -0
  92. package/dist/manager-errors.js +2 -2
  93. package/dist/mocking-utils/index.js +14 -14
  94. package/dist/node-logger/index.d.ts +1456 -111
  95. package/dist/node-logger/index.js +9 -9
  96. package/dist/preview/runtime.js +4608 -2436
  97. package/dist/preview-api/index.js +12 -12
  98. package/dist/preview-errors.d.ts +24 -0
  99. package/dist/preview-errors.js +3 -3
  100. package/dist/router/index.js +11 -11
  101. package/dist/server-errors.d.ts +59 -3
  102. package/dist/server-errors.js +22 -11
  103. package/dist/telemetry/index.d.ts +10 -3
  104. package/dist/telemetry/index.js +27 -25
  105. package/dist/test/index.js +3237 -1653
  106. package/dist/theming/create.js +3 -3
  107. package/dist/theming/index.d.ts +5 -5
  108. package/dist/theming/index.js +38 -38
  109. package/dist/types/index.d.ts +12 -6
  110. package/dist/viewport/index.d.ts +3 -3
  111. package/package.json +27 -33
  112. package/dist/_browser-chunks/chunk-EZSQOHRI.js +0 -18
  113. package/dist/_browser-chunks/chunk-QKODTO7K.js +0 -7
  114. package/dist/_node-chunks/camelcase-64II7H4U.js +0 -37
  115. package/dist/_node-chunks/chunk-4EZYJUAC.js +0 -70
  116. package/dist/_node-chunks/chunk-COQ27OZ3.js +0 -61
  117. package/dist/_node-chunks/chunk-MC2R4DSD.js +0 -20
  118. package/dist/_node-chunks/chunk-NEENMS4J.js +0 -18
  119. package/dist/_node-chunks/chunk-VR5LMO3F.js +0 -72
  120. package/dist/_node-chunks/chunk-XEPVDCRL.js +0 -23
@@ -1,580 +1,21 @@
1
1
  import {
2
2
  getControlId
3
3
  } from "./chunk-2FRVAXCZ.js";
4
- import "./chunk-QKODTO7K.js";
5
4
  import {
6
- __commonJS,
5
+ require_color_convert
6
+ } from "./chunk-VIJ7SQRO.js";
7
+ import "./chunk-NZMVUW5T.js";
8
+ import {
7
9
  __toESM
8
10
  } from "./chunk-A242L54C.js";
9
11
 
10
- // ../node_modules/color-name/index.js
11
- var require_color_name = __commonJS({
12
- "../node_modules/color-name/index.js"(exports, module) {
13
- "use strict";
14
- module.exports = {
15
- aliceblue: [240, 248, 255],
16
- antiquewhite: [250, 235, 215],
17
- aqua: [0, 255, 255],
18
- aquamarine: [127, 255, 212],
19
- azure: [240, 255, 255],
20
- beige: [245, 245, 220],
21
- bisque: [255, 228, 196],
22
- black: [0, 0, 0],
23
- blanchedalmond: [255, 235, 205],
24
- blue: [0, 0, 255],
25
- blueviolet: [138, 43, 226],
26
- brown: [165, 42, 42],
27
- burlywood: [222, 184, 135],
28
- cadetblue: [95, 158, 160],
29
- chartreuse: [127, 255, 0],
30
- chocolate: [210, 105, 30],
31
- coral: [255, 127, 80],
32
- cornflowerblue: [100, 149, 237],
33
- cornsilk: [255, 248, 220],
34
- crimson: [220, 20, 60],
35
- cyan: [0, 255, 255],
36
- darkblue: [0, 0, 139],
37
- darkcyan: [0, 139, 139],
38
- darkgoldenrod: [184, 134, 11],
39
- darkgray: [169, 169, 169],
40
- darkgreen: [0, 100, 0],
41
- darkgrey: [169, 169, 169],
42
- darkkhaki: [189, 183, 107],
43
- darkmagenta: [139, 0, 139],
44
- darkolivegreen: [85, 107, 47],
45
- darkorange: [255, 140, 0],
46
- darkorchid: [153, 50, 204],
47
- darkred: [139, 0, 0],
48
- darksalmon: [233, 150, 122],
49
- darkseagreen: [143, 188, 143],
50
- darkslateblue: [72, 61, 139],
51
- darkslategray: [47, 79, 79],
52
- darkslategrey: [47, 79, 79],
53
- darkturquoise: [0, 206, 209],
54
- darkviolet: [148, 0, 211],
55
- deeppink: [255, 20, 147],
56
- deepskyblue: [0, 191, 255],
57
- dimgray: [105, 105, 105],
58
- dimgrey: [105, 105, 105],
59
- dodgerblue: [30, 144, 255],
60
- firebrick: [178, 34, 34],
61
- floralwhite: [255, 250, 240],
62
- forestgreen: [34, 139, 34],
63
- fuchsia: [255, 0, 255],
64
- gainsboro: [220, 220, 220],
65
- ghostwhite: [248, 248, 255],
66
- gold: [255, 215, 0],
67
- goldenrod: [218, 165, 32],
68
- gray: [128, 128, 128],
69
- green: [0, 128, 0],
70
- greenyellow: [173, 255, 47],
71
- grey: [128, 128, 128],
72
- honeydew: [240, 255, 240],
73
- hotpink: [255, 105, 180],
74
- indianred: [205, 92, 92],
75
- indigo: [75, 0, 130],
76
- ivory: [255, 255, 240],
77
- khaki: [240, 230, 140],
78
- lavender: [230, 230, 250],
79
- lavenderblush: [255, 240, 245],
80
- lawngreen: [124, 252, 0],
81
- lemonchiffon: [255, 250, 205],
82
- lightblue: [173, 216, 230],
83
- lightcoral: [240, 128, 128],
84
- lightcyan: [224, 255, 255],
85
- lightgoldenrodyellow: [250, 250, 210],
86
- lightgray: [211, 211, 211],
87
- lightgreen: [144, 238, 144],
88
- lightgrey: [211, 211, 211],
89
- lightpink: [255, 182, 193],
90
- lightsalmon: [255, 160, 122],
91
- lightseagreen: [32, 178, 170],
92
- lightskyblue: [135, 206, 250],
93
- lightslategray: [119, 136, 153],
94
- lightslategrey: [119, 136, 153],
95
- lightsteelblue: [176, 196, 222],
96
- lightyellow: [255, 255, 224],
97
- lime: [0, 255, 0],
98
- limegreen: [50, 205, 50],
99
- linen: [250, 240, 230],
100
- magenta: [255, 0, 255],
101
- maroon: [128, 0, 0],
102
- mediumaquamarine: [102, 205, 170],
103
- mediumblue: [0, 0, 205],
104
- mediumorchid: [186, 85, 211],
105
- mediumpurple: [147, 112, 219],
106
- mediumseagreen: [60, 179, 113],
107
- mediumslateblue: [123, 104, 238],
108
- mediumspringgreen: [0, 250, 154],
109
- mediumturquoise: [72, 209, 204],
110
- mediumvioletred: [199, 21, 133],
111
- midnightblue: [25, 25, 112],
112
- mintcream: [245, 255, 250],
113
- mistyrose: [255, 228, 225],
114
- moccasin: [255, 228, 181],
115
- navajowhite: [255, 222, 173],
116
- navy: [0, 0, 128],
117
- oldlace: [253, 245, 230],
118
- olive: [128, 128, 0],
119
- olivedrab: [107, 142, 35],
120
- orange: [255, 165, 0],
121
- orangered: [255, 69, 0],
122
- orchid: [218, 112, 214],
123
- palegoldenrod: [238, 232, 170],
124
- palegreen: [152, 251, 152],
125
- paleturquoise: [175, 238, 238],
126
- palevioletred: [219, 112, 147],
127
- papayawhip: [255, 239, 213],
128
- peachpuff: [255, 218, 185],
129
- peru: [205, 133, 63],
130
- pink: [255, 192, 203],
131
- plum: [221, 160, 221],
132
- powderblue: [176, 224, 230],
133
- purple: [128, 0, 128],
134
- rebeccapurple: [102, 51, 153],
135
- red: [255, 0, 0],
136
- rosybrown: [188, 143, 143],
137
- royalblue: [65, 105, 225],
138
- saddlebrown: [139, 69, 19],
139
- salmon: [250, 128, 114],
140
- sandybrown: [244, 164, 96],
141
- seagreen: [46, 139, 87],
142
- seashell: [255, 245, 238],
143
- sienna: [160, 82, 45],
144
- silver: [192, 192, 192],
145
- skyblue: [135, 206, 235],
146
- slateblue: [106, 90, 205],
147
- slategray: [112, 128, 144],
148
- slategrey: [112, 128, 144],
149
- snow: [255, 250, 250],
150
- springgreen: [0, 255, 127],
151
- steelblue: [70, 130, 180],
152
- tan: [210, 180, 140],
153
- teal: [0, 128, 128],
154
- thistle: [216, 191, 216],
155
- tomato: [255, 99, 71],
156
- turquoise: [64, 224, 208],
157
- violet: [238, 130, 238],
158
- wheat: [245, 222, 179],
159
- white: [255, 255, 255],
160
- whitesmoke: [245, 245, 245],
161
- yellow: [255, 255, 0],
162
- yellowgreen: [154, 205, 50]
163
- };
164
- }
165
- });
166
-
167
- // ../node_modules/color-convert/conversions.js
168
- var require_conversions = __commonJS({
169
- "../node_modules/color-convert/conversions.js"(exports, module) {
170
- var cssKeywords = require_color_name(), reverseKeywords = {};
171
- for (let key of Object.keys(cssKeywords))
172
- reverseKeywords[cssKeywords[key]] = key;
173
- var convert2 = {
174
- rgb: { channels: 3, labels: "rgb" },
175
- hsl: { channels: 3, labels: "hsl" },
176
- hsv: { channels: 3, labels: "hsv" },
177
- hwb: { channels: 3, labels: "hwb" },
178
- cmyk: { channels: 4, labels: "cmyk" },
179
- xyz: { channels: 3, labels: "xyz" },
180
- lab: { channels: 3, labels: "lab" },
181
- lch: { channels: 3, labels: "lch" },
182
- hex: { channels: 1, labels: ["hex"] },
183
- keyword: { channels: 1, labels: ["keyword"] },
184
- ansi16: { channels: 1, labels: ["ansi16"] },
185
- ansi256: { channels: 1, labels: ["ansi256"] },
186
- hcg: { channels: 3, labels: ["h", "c", "g"] },
187
- apple: { channels: 3, labels: ["r16", "g16", "b16"] },
188
- gray: { channels: 1, labels: ["gray"] }
189
- };
190
- module.exports = convert2;
191
- for (let model of Object.keys(convert2)) {
192
- if (!("channels" in convert2[model]))
193
- throw new Error("missing channels property: " + model);
194
- if (!("labels" in convert2[model]))
195
- throw new Error("missing channel labels property: " + model);
196
- if (convert2[model].labels.length !== convert2[model].channels)
197
- throw new Error("channel and label counts mismatch: " + model);
198
- let { channels, labels } = convert2[model];
199
- delete convert2[model].channels, delete convert2[model].labels, Object.defineProperty(convert2[model], "channels", { value: channels }), Object.defineProperty(convert2[model], "labels", { value: labels });
200
- }
201
- convert2.rgb.hsl = function(rgb) {
202
- let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, min = Math.min(r2, g2, b2), max = Math.max(r2, g2, b2), delta = max - min, h2, s2;
203
- max === min ? h2 = 0 : r2 === max ? h2 = (g2 - b2) / delta : g2 === max ? h2 = 2 + (b2 - r2) / delta : b2 === max && (h2 = 4 + (r2 - g2) / delta), h2 = Math.min(h2 * 60, 360), h2 < 0 && (h2 += 360);
204
- let l2 = (min + max) / 2;
205
- return max === min ? s2 = 0 : l2 <= 0.5 ? s2 = delta / (max + min) : s2 = delta / (2 - max - min), [h2, s2 * 100, l2 * 100];
206
- };
207
- convert2.rgb.hsv = function(rgb) {
208
- let rdif, gdif, bdif, h2, s2, r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, v2 = Math.max(r2, g2, b2), diff = v2 - Math.min(r2, g2, b2), diffc = function(c2) {
209
- return (v2 - c2) / 6 / diff + 1 / 2;
210
- };
211
- return diff === 0 ? (h2 = 0, s2 = 0) : (s2 = diff / v2, rdif = diffc(r2), gdif = diffc(g2), bdif = diffc(b2), r2 === v2 ? h2 = bdif - gdif : g2 === v2 ? h2 = 1 / 3 + rdif - bdif : b2 === v2 && (h2 = 2 / 3 + gdif - rdif), h2 < 0 ? h2 += 1 : h2 > 1 && (h2 -= 1)), [
212
- h2 * 360,
213
- s2 * 100,
214
- v2 * 100
215
- ];
216
- };
217
- convert2.rgb.hwb = function(rgb) {
218
- let r2 = rgb[0], g2 = rgb[1], b2 = rgb[2], h2 = convert2.rgb.hsl(rgb)[0], w2 = 1 / 255 * Math.min(r2, Math.min(g2, b2));
219
- return b2 = 1 - 1 / 255 * Math.max(r2, Math.max(g2, b2)), [h2, w2 * 100, b2 * 100];
220
- };
221
- convert2.rgb.cmyk = function(rgb) {
222
- let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, k2 = Math.min(1 - r2, 1 - g2, 1 - b2), c2 = (1 - r2 - k2) / (1 - k2) || 0, m2 = (1 - g2 - k2) / (1 - k2) || 0, y2 = (1 - b2 - k2) / (1 - k2) || 0;
223
- return [c2 * 100, m2 * 100, y2 * 100, k2 * 100];
224
- };
225
- function comparativeDistance(x2, y2) {
226
- return (x2[0] - y2[0]) ** 2 + (x2[1] - y2[1]) ** 2 + (x2[2] - y2[2]) ** 2;
227
- }
228
- convert2.rgb.keyword = function(rgb) {
229
- let reversed = reverseKeywords[rgb];
230
- if (reversed)
231
- return reversed;
232
- let currentClosestDistance = 1 / 0, currentClosestKeyword;
233
- for (let keyword of Object.keys(cssKeywords)) {
234
- let value = cssKeywords[keyword], distance = comparativeDistance(rgb, value);
235
- distance < currentClosestDistance && (currentClosestDistance = distance, currentClosestKeyword = keyword);
236
- }
237
- return currentClosestKeyword;
238
- };
239
- convert2.keyword.rgb = function(keyword) {
240
- return cssKeywords[keyword];
241
- };
242
- convert2.rgb.xyz = function(rgb) {
243
- let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255;
244
- r2 = r2 > 0.04045 ? ((r2 + 0.055) / 1.055) ** 2.4 : r2 / 12.92, g2 = g2 > 0.04045 ? ((g2 + 0.055) / 1.055) ** 2.4 : g2 / 12.92, b2 = b2 > 0.04045 ? ((b2 + 0.055) / 1.055) ** 2.4 : b2 / 12.92;
245
- let x2 = r2 * 0.4124 + g2 * 0.3576 + b2 * 0.1805, y2 = r2 * 0.2126 + g2 * 0.7152 + b2 * 0.0722, z2 = r2 * 0.0193 + g2 * 0.1192 + b2 * 0.9505;
246
- return [x2 * 100, y2 * 100, z2 * 100];
247
- };
248
- convert2.rgb.lab = function(rgb) {
249
- let xyz = convert2.rgb.xyz(rgb), x2 = xyz[0], y2 = xyz[1], z2 = xyz[2];
250
- x2 /= 95.047, y2 /= 100, z2 /= 108.883, x2 = x2 > 8856e-6 ? x2 ** (1 / 3) : 7.787 * x2 + 16 / 116, y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116, z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
251
- let l2 = 116 * y2 - 16, a2 = 500 * (x2 - y2), b2 = 200 * (y2 - z2);
252
- return [l2, a2, b2];
253
- };
254
- convert2.hsl.rgb = function(hsl) {
255
- let h2 = hsl[0] / 360, s2 = hsl[1] / 100, l2 = hsl[2] / 100, t2, t3, val;
256
- if (s2 === 0)
257
- return val = l2 * 255, [val, val, val];
258
- l2 < 0.5 ? t2 = l2 * (1 + s2) : t2 = l2 + s2 - l2 * s2;
259
- let t1 = 2 * l2 - t2, rgb = [0, 0, 0];
260
- for (let i2 = 0; i2 < 3; i2++)
261
- t3 = h2 + 1 / 3 * -(i2 - 1), t3 < 0 && t3++, t3 > 1 && t3--, 6 * t3 < 1 ? val = t1 + (t2 - t1) * 6 * t3 : 2 * t3 < 1 ? val = t2 : 3 * t3 < 2 ? val = t1 + (t2 - t1) * (2 / 3 - t3) * 6 : val = t1, rgb[i2] = val * 255;
262
- return rgb;
263
- };
264
- convert2.hsl.hsv = function(hsl) {
265
- let h2 = hsl[0], s2 = hsl[1] / 100, l2 = hsl[2] / 100, smin = s2, lmin = Math.max(l2, 0.01);
266
- l2 *= 2, s2 *= l2 <= 1 ? l2 : 2 - l2, smin *= lmin <= 1 ? lmin : 2 - lmin;
267
- let v2 = (l2 + s2) / 2, sv = l2 === 0 ? 2 * smin / (lmin + smin) : 2 * s2 / (l2 + s2);
268
- return [h2, sv * 100, v2 * 100];
269
- };
270
- convert2.hsv.rgb = function(hsv) {
271
- let h2 = hsv[0] / 60, s2 = hsv[1] / 100, v2 = hsv[2] / 100, hi = Math.floor(h2) % 6, f2 = h2 - Math.floor(h2), p2 = 255 * v2 * (1 - s2), q2 = 255 * v2 * (1 - s2 * f2), t2 = 255 * v2 * (1 - s2 * (1 - f2));
272
- switch (v2 *= 255, hi) {
273
- case 0:
274
- return [v2, t2, p2];
275
- case 1:
276
- return [q2, v2, p2];
277
- case 2:
278
- return [p2, v2, t2];
279
- case 3:
280
- return [p2, q2, v2];
281
- case 4:
282
- return [t2, p2, v2];
283
- case 5:
284
- return [v2, p2, q2];
285
- }
286
- };
287
- convert2.hsv.hsl = function(hsv) {
288
- let h2 = hsv[0], s2 = hsv[1] / 100, v2 = hsv[2] / 100, vmin = Math.max(v2, 0.01), sl, l2;
289
- l2 = (2 - s2) * v2;
290
- let lmin = (2 - s2) * vmin;
291
- return sl = s2 * vmin, sl /= lmin <= 1 ? lmin : 2 - lmin, sl = sl || 0, l2 /= 2, [h2, sl * 100, l2 * 100];
292
- };
293
- convert2.hwb.rgb = function(hwb) {
294
- let h2 = hwb[0] / 360, wh = hwb[1] / 100, bl = hwb[2] / 100, ratio = wh + bl, f2;
295
- ratio > 1 && (wh /= ratio, bl /= ratio);
296
- let i2 = Math.floor(6 * h2), v2 = 1 - bl;
297
- f2 = 6 * h2 - i2, (i2 & 1) !== 0 && (f2 = 1 - f2);
298
- let n2 = wh + f2 * (v2 - wh), r2, g2, b2;
299
- switch (i2) {
300
- default:
301
- case 6:
302
- case 0:
303
- r2 = v2, g2 = n2, b2 = wh;
304
- break;
305
- case 1:
306
- r2 = n2, g2 = v2, b2 = wh;
307
- break;
308
- case 2:
309
- r2 = wh, g2 = v2, b2 = n2;
310
- break;
311
- case 3:
312
- r2 = wh, g2 = n2, b2 = v2;
313
- break;
314
- case 4:
315
- r2 = n2, g2 = wh, b2 = v2;
316
- break;
317
- case 5:
318
- r2 = v2, g2 = wh, b2 = n2;
319
- break;
320
- }
321
- return [r2 * 255, g2 * 255, b2 * 255];
322
- };
323
- convert2.cmyk.rgb = function(cmyk) {
324
- let c2 = cmyk[0] / 100, m2 = cmyk[1] / 100, y2 = cmyk[2] / 100, k2 = cmyk[3] / 100, r2 = 1 - Math.min(1, c2 * (1 - k2) + k2), g2 = 1 - Math.min(1, m2 * (1 - k2) + k2), b2 = 1 - Math.min(1, y2 * (1 - k2) + k2);
325
- return [r2 * 255, g2 * 255, b2 * 255];
326
- };
327
- convert2.xyz.rgb = function(xyz) {
328
- let x2 = xyz[0] / 100, y2 = xyz[1] / 100, z2 = xyz[2] / 100, r2, g2, b2;
329
- return r2 = x2 * 3.2406 + y2 * -1.5372 + z2 * -0.4986, g2 = x2 * -0.9689 + y2 * 1.8758 + z2 * 0.0415, b2 = x2 * 0.0557 + y2 * -0.204 + z2 * 1.057, r2 = r2 > 31308e-7 ? 1.055 * r2 ** (1 / 2.4) - 0.055 : r2 * 12.92, g2 = g2 > 31308e-7 ? 1.055 * g2 ** (1 / 2.4) - 0.055 : g2 * 12.92, b2 = b2 > 31308e-7 ? 1.055 * b2 ** (1 / 2.4) - 0.055 : b2 * 12.92, r2 = Math.min(Math.max(0, r2), 1), g2 = Math.min(Math.max(0, g2), 1), b2 = Math.min(Math.max(0, b2), 1), [r2 * 255, g2 * 255, b2 * 255];
330
- };
331
- convert2.xyz.lab = function(xyz) {
332
- let x2 = xyz[0], y2 = xyz[1], z2 = xyz[2];
333
- x2 /= 95.047, y2 /= 100, z2 /= 108.883, x2 = x2 > 8856e-6 ? x2 ** (1 / 3) : 7.787 * x2 + 16 / 116, y2 = y2 > 8856e-6 ? y2 ** (1 / 3) : 7.787 * y2 + 16 / 116, z2 = z2 > 8856e-6 ? z2 ** (1 / 3) : 7.787 * z2 + 16 / 116;
334
- let l2 = 116 * y2 - 16, a2 = 500 * (x2 - y2), b2 = 200 * (y2 - z2);
335
- return [l2, a2, b2];
336
- };
337
- convert2.lab.xyz = function(lab) {
338
- let l2 = lab[0], a2 = lab[1], b2 = lab[2], x2, y2, z2;
339
- y2 = (l2 + 16) / 116, x2 = a2 / 500 + y2, z2 = y2 - b2 / 200;
340
- let y22 = y2 ** 3, x22 = x2 ** 3, z22 = z2 ** 3;
341
- return y2 = y22 > 8856e-6 ? y22 : (y2 - 16 / 116) / 7.787, x2 = x22 > 8856e-6 ? x22 : (x2 - 16 / 116) / 7.787, z2 = z22 > 8856e-6 ? z22 : (z2 - 16 / 116) / 7.787, x2 *= 95.047, y2 *= 100, z2 *= 108.883, [x2, y2, z2];
342
- };
343
- convert2.lab.lch = function(lab) {
344
- let l2 = lab[0], a2 = lab[1], b2 = lab[2], h2;
345
- h2 = Math.atan2(b2, a2) * 360 / 2 / Math.PI, h2 < 0 && (h2 += 360);
346
- let c2 = Math.sqrt(a2 * a2 + b2 * b2);
347
- return [l2, c2, h2];
348
- };
349
- convert2.lch.lab = function(lch) {
350
- let l2 = lch[0], c2 = lch[1], hr = lch[2] / 360 * 2 * Math.PI, a2 = c2 * Math.cos(hr), b2 = c2 * Math.sin(hr);
351
- return [l2, a2, b2];
352
- };
353
- convert2.rgb.ansi16 = function(args, saturation = null) {
354
- let [r2, g2, b2] = args, value = saturation === null ? convert2.rgb.hsv(args)[2] : saturation;
355
- if (value = Math.round(value / 50), value === 0)
356
- return 30;
357
- let ansi = 30 + (Math.round(b2 / 255) << 2 | Math.round(g2 / 255) << 1 | Math.round(r2 / 255));
358
- return value === 2 && (ansi += 60), ansi;
359
- };
360
- convert2.hsv.ansi16 = function(args) {
361
- return convert2.rgb.ansi16(convert2.hsv.rgb(args), args[2]);
362
- };
363
- convert2.rgb.ansi256 = function(args) {
364
- let r2 = args[0], g2 = args[1], b2 = args[2];
365
- return r2 === g2 && g2 === b2 ? r2 < 8 ? 16 : r2 > 248 ? 231 : Math.round((r2 - 8) / 247 * 24) + 232 : 16 + 36 * Math.round(r2 / 255 * 5) + 6 * Math.round(g2 / 255 * 5) + Math.round(b2 / 255 * 5);
366
- };
367
- convert2.ansi16.rgb = function(args) {
368
- let color = args % 10;
369
- if (color === 0 || color === 7)
370
- return args > 50 && (color += 3.5), color = color / 10.5 * 255, [color, color, color];
371
- let mult = (~~(args > 50) + 1) * 0.5, r2 = (color & 1) * mult * 255, g2 = (color >> 1 & 1) * mult * 255, b2 = (color >> 2 & 1) * mult * 255;
372
- return [r2, g2, b2];
373
- };
374
- convert2.ansi256.rgb = function(args) {
375
- if (args >= 232) {
376
- let c2 = (args - 232) * 10 + 8;
377
- return [c2, c2, c2];
378
- }
379
- args -= 16;
380
- let rem, r2 = Math.floor(args / 36) / 5 * 255, g2 = Math.floor((rem = args % 36) / 6) / 5 * 255, b2 = rem % 6 / 5 * 255;
381
- return [r2, g2, b2];
382
- };
383
- convert2.rgb.hex = function(args) {
384
- let string = (((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255)).toString(16).toUpperCase();
385
- return "000000".substring(string.length) + string;
386
- };
387
- convert2.hex.rgb = function(args) {
388
- let match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
389
- if (!match)
390
- return [0, 0, 0];
391
- let colorString = match[0];
392
- match[0].length === 3 && (colorString = colorString.split("").map((char) => char + char).join(""));
393
- let integer = parseInt(colorString, 16), r2 = integer >> 16 & 255, g2 = integer >> 8 & 255, b2 = integer & 255;
394
- return [r2, g2, b2];
395
- };
396
- convert2.rgb.hcg = function(rgb) {
397
- let r2 = rgb[0] / 255, g2 = rgb[1] / 255, b2 = rgb[2] / 255, max = Math.max(Math.max(r2, g2), b2), min = Math.min(Math.min(r2, g2), b2), chroma = max - min, grayscale, hue;
398
- return chroma < 1 ? grayscale = min / (1 - chroma) : grayscale = 0, chroma <= 0 ? hue = 0 : max === r2 ? hue = (g2 - b2) / chroma % 6 : max === g2 ? hue = 2 + (b2 - r2) / chroma : hue = 4 + (r2 - g2) / chroma, hue /= 6, hue %= 1, [hue * 360, chroma * 100, grayscale * 100];
399
- };
400
- convert2.hsl.hcg = function(hsl) {
401
- let s2 = hsl[1] / 100, l2 = hsl[2] / 100, c2 = l2 < 0.5 ? 2 * s2 * l2 : 2 * s2 * (1 - l2), f2 = 0;
402
- return c2 < 1 && (f2 = (l2 - 0.5 * c2) / (1 - c2)), [hsl[0], c2 * 100, f2 * 100];
403
- };
404
- convert2.hsv.hcg = function(hsv) {
405
- let s2 = hsv[1] / 100, v2 = hsv[2] / 100, c2 = s2 * v2, f2 = 0;
406
- return c2 < 1 && (f2 = (v2 - c2) / (1 - c2)), [hsv[0], c2 * 100, f2 * 100];
407
- };
408
- convert2.hcg.rgb = function(hcg) {
409
- let h2 = hcg[0] / 360, c2 = hcg[1] / 100, g2 = hcg[2] / 100;
410
- if (c2 === 0)
411
- return [g2 * 255, g2 * 255, g2 * 255];
412
- let pure = [0, 0, 0], hi = h2 % 1 * 6, v2 = hi % 1, w2 = 1 - v2, mg = 0;
413
- switch (Math.floor(hi)) {
414
- case 0:
415
- pure[0] = 1, pure[1] = v2, pure[2] = 0;
416
- break;
417
- case 1:
418
- pure[0] = w2, pure[1] = 1, pure[2] = 0;
419
- break;
420
- case 2:
421
- pure[0] = 0, pure[1] = 1, pure[2] = v2;
422
- break;
423
- case 3:
424
- pure[0] = 0, pure[1] = w2, pure[2] = 1;
425
- break;
426
- case 4:
427
- pure[0] = v2, pure[1] = 0, pure[2] = 1;
428
- break;
429
- default:
430
- pure[0] = 1, pure[1] = 0, pure[2] = w2;
431
- }
432
- return mg = (1 - c2) * g2, [
433
- (c2 * pure[0] + mg) * 255,
434
- (c2 * pure[1] + mg) * 255,
435
- (c2 * pure[2] + mg) * 255
436
- ];
437
- };
438
- convert2.hcg.hsv = function(hcg) {
439
- let c2 = hcg[1] / 100, g2 = hcg[2] / 100, v2 = c2 + g2 * (1 - c2), f2 = 0;
440
- return v2 > 0 && (f2 = c2 / v2), [hcg[0], f2 * 100, v2 * 100];
441
- };
442
- convert2.hcg.hsl = function(hcg) {
443
- let c2 = hcg[1] / 100, l2 = hcg[2] / 100 * (1 - c2) + 0.5 * c2, s2 = 0;
444
- return l2 > 0 && l2 < 0.5 ? s2 = c2 / (2 * l2) : l2 >= 0.5 && l2 < 1 && (s2 = c2 / (2 * (1 - l2))), [hcg[0], s2 * 100, l2 * 100];
445
- };
446
- convert2.hcg.hwb = function(hcg) {
447
- let c2 = hcg[1] / 100, g2 = hcg[2] / 100, v2 = c2 + g2 * (1 - c2);
448
- return [hcg[0], (v2 - c2) * 100, (1 - v2) * 100];
449
- };
450
- convert2.hwb.hcg = function(hwb) {
451
- let w2 = hwb[1] / 100, v2 = 1 - hwb[2] / 100, c2 = v2 - w2, g2 = 0;
452
- return c2 < 1 && (g2 = (v2 - c2) / (1 - c2)), [hwb[0], c2 * 100, g2 * 100];
453
- };
454
- convert2.apple.rgb = function(apple) {
455
- return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
456
- };
457
- convert2.rgb.apple = function(rgb) {
458
- return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
459
- };
460
- convert2.gray.rgb = function(args) {
461
- return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
462
- };
463
- convert2.gray.hsl = function(args) {
464
- return [0, 0, args[0]];
465
- };
466
- convert2.gray.hsv = convert2.gray.hsl;
467
- convert2.gray.hwb = function(gray) {
468
- return [0, 100, gray[0]];
469
- };
470
- convert2.gray.cmyk = function(gray) {
471
- return [0, 0, 0, gray[0]];
472
- };
473
- convert2.gray.lab = function(gray) {
474
- return [gray[0], 0, 0];
475
- };
476
- convert2.gray.hex = function(gray) {
477
- let val = Math.round(gray[0] / 100 * 255) & 255, string = ((val << 16) + (val << 8) + val).toString(16).toUpperCase();
478
- return "000000".substring(string.length) + string;
479
- };
480
- convert2.rgb.gray = function(rgb) {
481
- return [(rgb[0] + rgb[1] + rgb[2]) / 3 / 255 * 100];
482
- };
483
- }
484
- });
485
-
486
- // ../node_modules/color-convert/route.js
487
- var require_route = __commonJS({
488
- "../node_modules/color-convert/route.js"(exports, module) {
489
- var conversions = require_conversions();
490
- function buildGraph() {
491
- let graph = {}, models = Object.keys(conversions);
492
- for (let len = models.length, i2 = 0; i2 < len; i2++)
493
- graph[models[i2]] = {
494
- // http://jsperf.com/1-vs-infinity
495
- // micro-opt, but this is simple.
496
- distance: -1,
497
- parent: null
498
- };
499
- return graph;
500
- }
501
- function deriveBFS(fromModel) {
502
- let graph = buildGraph(), queue = [fromModel];
503
- for (graph[fromModel].distance = 0; queue.length; ) {
504
- let current = queue.pop(), adjacents = Object.keys(conversions[current]);
505
- for (let len = adjacents.length, i2 = 0; i2 < len; i2++) {
506
- let adjacent = adjacents[i2], node = graph[adjacent];
507
- node.distance === -1 && (node.distance = graph[current].distance + 1, node.parent = current, queue.unshift(adjacent));
508
- }
509
- }
510
- return graph;
511
- }
512
- function link(from, to) {
513
- return function(args) {
514
- return to(from(args));
515
- };
516
- }
517
- function wrapConversion(toModel, graph) {
518
- let path = [graph[toModel].parent, toModel], fn = conversions[graph[toModel].parent][toModel], cur = graph[toModel].parent;
519
- for (; graph[cur].parent; )
520
- path.unshift(graph[cur].parent), fn = link(conversions[graph[cur].parent][cur], fn), cur = graph[cur].parent;
521
- return fn.conversion = path, fn;
522
- }
523
- module.exports = function(fromModel) {
524
- let graph = deriveBFS(fromModel), conversion = {}, models = Object.keys(graph);
525
- for (let len = models.length, i2 = 0; i2 < len; i2++) {
526
- let toModel = models[i2];
527
- graph[toModel].parent !== null && (conversion[toModel] = wrapConversion(toModel, graph));
528
- }
529
- return conversion;
530
- };
531
- }
532
- });
533
-
534
- // ../node_modules/color-convert/index.js
535
- var require_color_convert = __commonJS({
536
- "../node_modules/color-convert/index.js"(exports, module) {
537
- var conversions = require_conversions(), route = require_route(), convert2 = {}, models = Object.keys(conversions);
538
- function wrapRaw(fn) {
539
- let wrappedFn = function(...args) {
540
- let arg0 = args[0];
541
- return arg0 == null ? arg0 : (arg0.length > 1 && (args = arg0), fn(args));
542
- };
543
- return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
544
- }
545
- function wrapRounded(fn) {
546
- let wrappedFn = function(...args) {
547
- let arg0 = args[0];
548
- if (arg0 == null)
549
- return arg0;
550
- arg0.length > 1 && (args = arg0);
551
- let result = fn(args);
552
- if (typeof result == "object")
553
- for (let len = result.length, i2 = 0; i2 < len; i2++)
554
- result[i2] = Math.round(result[i2]);
555
- return result;
556
- };
557
- return "conversion" in fn && (wrappedFn.conversion = fn.conversion), wrappedFn;
558
- }
559
- models.forEach((fromModel) => {
560
- convert2[fromModel] = {}, Object.defineProperty(convert2[fromModel], "channels", { value: conversions[fromModel].channels }), Object.defineProperty(convert2[fromModel], "labels", { value: conversions[fromModel].labels });
561
- let routes = route(fromModel);
562
- Object.keys(routes).forEach((toModel) => {
563
- let fn = routes[toModel];
564
- convert2[fromModel][toModel] = wrapRounded(fn), convert2[fromModel][toModel].raw = wrapRaw(fn);
565
- });
566
- });
567
- module.exports = convert2;
568
- }
569
- });
570
-
571
12
  // ../addons/docs/src/blocks/controls/Color.tsx
572
13
  var import_color_convert = __toESM(require_color_convert(), 1);
573
14
  import React, { useCallback, useEffect, useMemo, useState } from "react";
574
15
  import { Button, Form, PopoverProvider } from "storybook/internal/components";
575
16
  import { MarkupIcon } from "@storybook/icons";
576
17
 
577
- // ../node_modules/es-toolkit/dist/function/debounce.mjs
18
+ // ../../node_modules/es-toolkit/dist/function/debounce.mjs
578
19
  function debounce(func, debounceMs, { signal, edges } = {}) {
579
20
  let pendingThis, pendingArgs = null, leading = edges != null && edges.includes("leading"), trailing = edges == null || edges.includes("trailing"), invoke = () => {
580
21
  pendingArgs !== null && (func.apply(pendingThis, pendingArgs), pendingThis = void 0, pendingArgs = null);
@@ -600,7 +41,7 @@ function debounce(func, debounceMs, { signal, edges } = {}) {
600
41
  return debounced.schedule = schedule, debounced.cancel = cancel, debounced.flush = flush, signal?.addEventListener("abort", cancel, { once: !0 }), debounced;
601
42
  }
602
43
 
603
- // ../node_modules/es-toolkit/dist/function/partial.mjs
44
+ // ../../node_modules/es-toolkit/dist/function/partial.mjs
604
45
  function partial(func, ...partialArgs) {
605
46
  return partialImpl(func, placeholderSymbol, ...partialArgs);
606
47
  }
@@ -614,7 +55,7 @@ function partialImpl(func, placeholder, ...partialArgs) {
614
55
  var placeholderSymbol = Symbol("partial.placeholder");
615
56
  partial.placeholder = placeholderSymbol;
616
57
 
617
- // ../node_modules/es-toolkit/dist/function/partialRight.mjs
58
+ // ../../node_modules/es-toolkit/dist/function/partialRight.mjs
618
59
  function partialRight(func, ...partialArgs) {
619
60
  return partialRightImpl(func, placeholderSymbol2, ...partialArgs);
620
61
  }
@@ -628,10 +69,10 @@ function partialRightImpl(func, placeholder, ...partialArgs) {
628
69
  var placeholderSymbol2 = Symbol("partialRight.placeholder");
629
70
  partialRight.placeholder = placeholderSymbol2;
630
71
 
631
- // ../node_modules/es-toolkit/dist/function/retry.mjs
72
+ // ../../node_modules/es-toolkit/dist/function/retry.mjs
632
73
  var DEFAULT_RETRIES = Number.POSITIVE_INFINITY;
633
74
 
634
- // ../node_modules/react-colorful/dist/index.mjs
75
+ // ../../node_modules/react-colorful/dist/index.mjs
635
76
  import e, { useRef as r, useMemo as t, useEffect as n, useState as o, useCallback as a, useLayoutEffect as l } from "react";
636
77
  function u() {
637
78
  return (u = Object.assign || function(e2) {