@storybook/addon-docs 10.1.0-alpha.9 → 10.1.0-beta.0

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 (33) hide show
  1. package/dist/_browser-chunks/Color-S5NAVK5F.js +1096 -0
  2. package/dist/_browser-chunks/{DocsRenderer-HT7GNKAR.js → DocsRenderer-GHJI37HO.js} +2 -2
  3. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  4. package/dist/_browser-chunks/chunk-CYSK6WYR.js +7 -0
  5. package/dist/_browser-chunks/chunk-DDRHE7EB.js +949 -0
  6. package/dist/_browser-chunks/{chunk-74ZUTOZN.js → chunk-OATZR77O.js} +9 -22
  7. package/dist/_browser-chunks/chunk-UUESKCKV.js +31 -0
  8. package/dist/_node-chunks/{chunk-D527LDYX.js → chunk-OGE4GWLB.js} +13 -19
  9. package/dist/_node-chunks/chunk-PRNIBEEO.js +196 -0
  10. package/dist/_node-chunks/chunk-SEBYU7IP.js +168 -0
  11. package/dist/_node-chunks/chunk-SZXCUVK4.js +22630 -0
  12. package/dist/_node-chunks/mdx-plugin-NLBBLG32.js +1032 -0
  13. package/dist/_node-chunks/rehype-external-links-V2D4HT5U.js +121 -0
  14. package/dist/_node-chunks/{rehype-slug-NIZ5EZAF.js → rehype-slug-U5W6TP4H.js} +24 -58
  15. package/dist/angular/index.js +3 -5
  16. package/dist/blocks.d.ts +5 -2
  17. package/dist/blocks.js +4658 -6651
  18. package/dist/ember/index.js +3 -5
  19. package/dist/index.js +4 -6
  20. package/dist/manager.js +11 -22
  21. package/dist/mdx-loader.js +13 -19
  22. package/dist/preset.js +160 -453
  23. package/dist/preview.js +2 -2
  24. package/package.json +6 -6
  25. package/dist/_browser-chunks/Color-64QXVMR3.js +0 -1675
  26. package/dist/_browser-chunks/chunk-DMNQCVA2.js +0 -12
  27. package/dist/_browser-chunks/chunk-UZFOWTVP.js +0 -974
  28. package/dist/_browser-chunks/chunk-YDZYZRYC.js +0 -39
  29. package/dist/_node-chunks/chunk-45YQE7PZ.js +0 -36332
  30. package/dist/_node-chunks/chunk-BBLOWQ3W.js +0 -231
  31. package/dist/_node-chunks/chunk-P7HMFQCU.js +0 -248
  32. package/dist/_node-chunks/mdx-plugin-36DJJXJE.js +0 -1654
  33. package/dist/_node-chunks/rehype-external-links-AGP76D2N.js +0 -168
@@ -1,974 +0,0 @@
1
- import {
2
- __name
3
- } from "./chunk-MM7DTO55.js";
4
-
5
- // src/blocks/components/Source.tsx
6
- import React2 from "react";
7
- import { SyntaxHighlighter } from "storybook/internal/components";
8
- import {
9
- ThemeProvider,
10
- convert,
11
- ignoreSsrWarning,
12
- styled as styled2,
13
- themes,
14
- useTheme
15
- } from "storybook/theming";
16
-
17
- // src/blocks/components/EmptyBlock.tsx
18
- import React from "react";
19
- import { withReset } from "storybook/internal/components";
20
-
21
- // ../../node_modules/@babel/runtime/helpers/esm/extends.js
22
- function _extends() {
23
- return _extends = Object.assign ? Object.assign.bind() : function(n) {
24
- for (var e = 1; e < arguments.length; e++) {
25
- var t = arguments[e];
26
- for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
27
- }
28
- return n;
29
- }, _extends.apply(null, arguments);
30
- }
31
- __name(_extends, "_extends");
32
-
33
- // ../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
34
- function _assertThisInitialized(e) {
35
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
36
- return e;
37
- }
38
- __name(_assertThisInitialized, "_assertThisInitialized");
39
-
40
- // ../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
41
- function _setPrototypeOf(t, e) {
42
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
43
- return t2.__proto__ = e2, t2;
44
- }, _setPrototypeOf(t, e);
45
- }
46
- __name(_setPrototypeOf, "_setPrototypeOf");
47
-
48
- // ../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
49
- function _inheritsLoose(t, o) {
50
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
51
- }
52
- __name(_inheritsLoose, "_inheritsLoose");
53
-
54
- // ../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
55
- function _getPrototypeOf(t) {
56
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t2) {
57
- return t2.__proto__ || Object.getPrototypeOf(t2);
58
- }, _getPrototypeOf(t);
59
- }
60
- __name(_getPrototypeOf, "_getPrototypeOf");
61
-
62
- // ../../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
63
- function _isNativeFunction(t) {
64
- try {
65
- return -1 !== Function.toString.call(t).indexOf("[native code]");
66
- } catch (n) {
67
- return "function" == typeof t;
68
- }
69
- }
70
- __name(_isNativeFunction, "_isNativeFunction");
71
-
72
- // ../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
73
- function _isNativeReflectConstruct() {
74
- try {
75
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
76
- }));
77
- } catch (t2) {
78
- }
79
- return (_isNativeReflectConstruct = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
80
- return !!t;
81
- }, "_isNativeReflectConstruct"))();
82
- }
83
- __name(_isNativeReflectConstruct, "_isNativeReflectConstruct");
84
-
85
- // ../../node_modules/@babel/runtime/helpers/esm/construct.js
86
- function _construct(t, e, r) {
87
- if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
88
- var o = [null];
89
- o.push.apply(o, e);
90
- var p = new (t.bind.apply(t, o))();
91
- return r && _setPrototypeOf(p, r.prototype), p;
92
- }
93
- __name(_construct, "_construct");
94
-
95
- // ../../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
96
- function _wrapNativeSuper(t) {
97
- var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
98
- return _wrapNativeSuper = /* @__PURE__ */ __name(function _wrapNativeSuper2(t2) {
99
- if (null === t2 || !_isNativeFunction(t2)) return t2;
100
- if ("function" != typeof t2) throw new TypeError("Super expression must either be null or a function");
101
- if (void 0 !== r) {
102
- if (r.has(t2)) return r.get(t2);
103
- r.set(t2, Wrapper2);
104
- }
105
- function Wrapper2() {
106
- return _construct(t2, arguments, _getPrototypeOf(this).constructor);
107
- }
108
- __name(Wrapper2, "Wrapper");
109
- return Wrapper2.prototype = Object.create(t2.prototype, {
110
- constructor: {
111
- value: Wrapper2,
112
- enumerable: false,
113
- writable: true,
114
- configurable: true
115
- }
116
- }), _setPrototypeOf(Wrapper2, t2);
117
- }, "_wrapNativeSuper"), _wrapNativeSuper(t);
118
- }
119
- __name(_wrapNativeSuper, "_wrapNativeSuper");
120
-
121
- // ../../node_modules/polished/dist/polished.esm.js
122
- var ERRORS = {
123
- "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.4, lightness: 0.75 }).\n\n",
124
- "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, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",
125
- "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
126
- "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
127
- "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
128
- "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, blue: 100 }).\n\n",
129
- "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: 205, blue: 100, alpha: 0.75 }).\n\n",
130
- "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
131
- "9": "Please provide a number of steps to the modularScale helper.\n\n",
132
- "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
133
- "11": 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',
134
- "12": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',
135
- "13": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',
136
- "14": 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
137
- "15": 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
138
- "16": "You must provide a template to this method.\n\n",
139
- "17": "You passed an unsupported selector state to this method.\n\n",
140
- "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
141
- "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
142
- "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
143
- "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
144
- "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
145
- "23": "fontFace expects a name of a font-family.\n\n",
146
- "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
147
- "25": "fontFace expects localFonts to be an array.\n\n",
148
- "26": "fontFace expects fileFormats to be an array.\n\n",
149
- "27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
150
- "28": "Please supply a filename to retinaImage() as the first argument.\n\n",
151
- "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
152
- "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
153
- "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
154
- "32": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",
155
- "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
156
- "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
157
- "35": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
158
- "36": "Property must be a string value.\n\n",
159
- "37": "Syntax Error at %s.\n\n",
160
- "38": "Formula contains a function that needs parentheses at %s.\n\n",
161
- "39": "Formula is missing closing parenthesis at %s.\n\n",
162
- "40": "Formula has too many closing parentheses at %s.\n\n",
163
- "41": "All values in a formula must have the same unit or be unitless.\n\n",
164
- "42": "Please provide a number of steps to the modularScale helper.\n\n",
165
- "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
166
- "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
167
- "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
168
- "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
169
- "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
170
- "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
171
- "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
172
- "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
173
- "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
174
- "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
175
- "53": "fontFace expects localFonts to be an array.\n\n",
176
- "54": "fontFace expects fileFormats to be an array.\n\n",
177
- "55": "fontFace expects a name of a font-family.\n\n",
178
- "56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
179
- "57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
180
- "58": "Please supply a filename to retinaImage() as the first argument.\n\n",
181
- "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
182
- "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
183
- "61": "Property must be a string value.\n\n",
184
- "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
185
- "63": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
186
- "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
187
- "65": "To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",
188
- "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
189
- "67": "You must provide a template to this method.\n\n",
190
- "68": "You passed an unsupported selector state to this method.\n\n",
191
- "69": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',
192
- "70": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',
193
- "71": 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',
194
- "72": 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',
195
- "73": "Please provide a valid CSS variable.\n\n",
196
- "74": "CSS variable not found and no default was provided.\n\n",
197
- "75": "important requires a valid style object, got a %s instead.\n\n",
198
- "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
199
- "77": 'remToPx expects a value in "rem" but you provided it in "%s".\n\n',
200
- "78": 'base must be set in "px" or "%" but you set it in "%s".\n'
201
- };
202
- function format() {
203
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
204
- args[_key] = arguments[_key];
205
- }
206
- var a = args[0];
207
- var b = [];
208
- var c;
209
- for (c = 1; c < args.length; c += 1) {
210
- b.push(args[c]);
211
- }
212
- b.forEach(function(d) {
213
- a = a.replace(/%[a-z]/, d);
214
- });
215
- return a;
216
- }
217
- __name(format, "format");
218
- var PolishedError = function(_Error) {
219
- _inheritsLoose(PolishedError2, _Error);
220
- function PolishedError2(code) {
221
- var _this;
222
- if (process.env.NODE_ENV === "production") {
223
- _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#" + code + " for more information.") || this;
224
- } else {
225
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
226
- args[_key2 - 1] = arguments[_key2];
227
- }
228
- _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
229
- }
230
- return _assertThisInitialized(_this);
231
- }
232
- __name(PolishedError2, "PolishedError");
233
- return PolishedError2;
234
- }(_wrapNativeSuper(Error));
235
- function endsWith(string, suffix) {
236
- return string.substr(-suffix.length) === suffix;
237
- }
238
- __name(endsWith, "endsWith");
239
- var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
240
- function stripUnit(value) {
241
- if (typeof value !== "string") return value;
242
- var matchedValue = value.match(cssRegex$1);
243
- return matchedValue ? parseFloat(value) : value;
244
- }
245
- __name(stripUnit, "stripUnit");
246
- var pxtoFactory = /* @__PURE__ */ __name(function pxtoFactory2(to) {
247
- return function(pxval, base) {
248
- if (base === void 0) {
249
- base = "16px";
250
- }
251
- var newPxval = pxval;
252
- var newBase = base;
253
- if (typeof pxval === "string") {
254
- if (!endsWith(pxval, "px")) {
255
- throw new PolishedError(69, to, pxval);
256
- }
257
- newPxval = stripUnit(pxval);
258
- }
259
- if (typeof base === "string") {
260
- if (!endsWith(base, "px")) {
261
- throw new PolishedError(70, to, base);
262
- }
263
- newBase = stripUnit(base);
264
- }
265
- if (typeof newPxval === "string") {
266
- throw new PolishedError(71, pxval, to);
267
- }
268
- if (typeof newBase === "string") {
269
- throw new PolishedError(72, base, to);
270
- }
271
- return "" + newPxval / newBase + to;
272
- };
273
- }, "pxtoFactory");
274
- var pixelsto = pxtoFactory;
275
- var em = pixelsto("em");
276
- var rem = pixelsto("rem");
277
- function colorToInt(color) {
278
- return Math.round(color * 255);
279
- }
280
- __name(colorToInt, "colorToInt");
281
- function convertToInt(red, green, blue) {
282
- return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
283
- }
284
- __name(convertToInt, "convertToInt");
285
- function hslToRgb(hue, saturation, lightness, convert2) {
286
- if (convert2 === void 0) {
287
- convert2 = convertToInt;
288
- }
289
- if (saturation === 0) {
290
- return convert2(lightness, lightness, lightness);
291
- }
292
- var huePrime = (hue % 360 + 360) % 360 / 60;
293
- var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
294
- var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
295
- var red = 0;
296
- var green = 0;
297
- var blue = 0;
298
- if (huePrime >= 0 && huePrime < 1) {
299
- red = chroma;
300
- green = secondComponent;
301
- } else if (huePrime >= 1 && huePrime < 2) {
302
- red = secondComponent;
303
- green = chroma;
304
- } else if (huePrime >= 2 && huePrime < 3) {
305
- green = chroma;
306
- blue = secondComponent;
307
- } else if (huePrime >= 3 && huePrime < 4) {
308
- green = secondComponent;
309
- blue = chroma;
310
- } else if (huePrime >= 4 && huePrime < 5) {
311
- red = secondComponent;
312
- blue = chroma;
313
- } else if (huePrime >= 5 && huePrime < 6) {
314
- red = chroma;
315
- blue = secondComponent;
316
- }
317
- var lightnessModification = lightness - chroma / 2;
318
- var finalRed = red + lightnessModification;
319
- var finalGreen = green + lightnessModification;
320
- var finalBlue = blue + lightnessModification;
321
- return convert2(finalRed, finalGreen, finalBlue);
322
- }
323
- __name(hslToRgb, "hslToRgb");
324
- var namedColorMap = {
325
- aliceblue: "f0f8ff",
326
- antiquewhite: "faebd7",
327
- aqua: "00ffff",
328
- aquamarine: "7fffd4",
329
- azure: "f0ffff",
330
- beige: "f5f5dc",
331
- bisque: "ffe4c4",
332
- black: "000",
333
- blanchedalmond: "ffebcd",
334
- blue: "0000ff",
335
- blueviolet: "8a2be2",
336
- brown: "a52a2a",
337
- burlywood: "deb887",
338
- cadetblue: "5f9ea0",
339
- chartreuse: "7fff00",
340
- chocolate: "d2691e",
341
- coral: "ff7f50",
342
- cornflowerblue: "6495ed",
343
- cornsilk: "fff8dc",
344
- crimson: "dc143c",
345
- cyan: "00ffff",
346
- darkblue: "00008b",
347
- darkcyan: "008b8b",
348
- darkgoldenrod: "b8860b",
349
- darkgray: "a9a9a9",
350
- darkgreen: "006400",
351
- darkgrey: "a9a9a9",
352
- darkkhaki: "bdb76b",
353
- darkmagenta: "8b008b",
354
- darkolivegreen: "556b2f",
355
- darkorange: "ff8c00",
356
- darkorchid: "9932cc",
357
- darkred: "8b0000",
358
- darksalmon: "e9967a",
359
- darkseagreen: "8fbc8f",
360
- darkslateblue: "483d8b",
361
- darkslategray: "2f4f4f",
362
- darkslategrey: "2f4f4f",
363
- darkturquoise: "00ced1",
364
- darkviolet: "9400d3",
365
- deeppink: "ff1493",
366
- deepskyblue: "00bfff",
367
- dimgray: "696969",
368
- dimgrey: "696969",
369
- dodgerblue: "1e90ff",
370
- firebrick: "b22222",
371
- floralwhite: "fffaf0",
372
- forestgreen: "228b22",
373
- fuchsia: "ff00ff",
374
- gainsboro: "dcdcdc",
375
- ghostwhite: "f8f8ff",
376
- gold: "ffd700",
377
- goldenrod: "daa520",
378
- gray: "808080",
379
- green: "008000",
380
- greenyellow: "adff2f",
381
- grey: "808080",
382
- honeydew: "f0fff0",
383
- hotpink: "ff69b4",
384
- indianred: "cd5c5c",
385
- indigo: "4b0082",
386
- ivory: "fffff0",
387
- khaki: "f0e68c",
388
- lavender: "e6e6fa",
389
- lavenderblush: "fff0f5",
390
- lawngreen: "7cfc00",
391
- lemonchiffon: "fffacd",
392
- lightblue: "add8e6",
393
- lightcoral: "f08080",
394
- lightcyan: "e0ffff",
395
- lightgoldenrodyellow: "fafad2",
396
- lightgray: "d3d3d3",
397
- lightgreen: "90ee90",
398
- lightgrey: "d3d3d3",
399
- lightpink: "ffb6c1",
400
- lightsalmon: "ffa07a",
401
- lightseagreen: "20b2aa",
402
- lightskyblue: "87cefa",
403
- lightslategray: "789",
404
- lightslategrey: "789",
405
- lightsteelblue: "b0c4de",
406
- lightyellow: "ffffe0",
407
- lime: "0f0",
408
- limegreen: "32cd32",
409
- linen: "faf0e6",
410
- magenta: "f0f",
411
- maroon: "800000",
412
- mediumaquamarine: "66cdaa",
413
- mediumblue: "0000cd",
414
- mediumorchid: "ba55d3",
415
- mediumpurple: "9370db",
416
- mediumseagreen: "3cb371",
417
- mediumslateblue: "7b68ee",
418
- mediumspringgreen: "00fa9a",
419
- mediumturquoise: "48d1cc",
420
- mediumvioletred: "c71585",
421
- midnightblue: "191970",
422
- mintcream: "f5fffa",
423
- mistyrose: "ffe4e1",
424
- moccasin: "ffe4b5",
425
- navajowhite: "ffdead",
426
- navy: "000080",
427
- oldlace: "fdf5e6",
428
- olive: "808000",
429
- olivedrab: "6b8e23",
430
- orange: "ffa500",
431
- orangered: "ff4500",
432
- orchid: "da70d6",
433
- palegoldenrod: "eee8aa",
434
- palegreen: "98fb98",
435
- paleturquoise: "afeeee",
436
- palevioletred: "db7093",
437
- papayawhip: "ffefd5",
438
- peachpuff: "ffdab9",
439
- peru: "cd853f",
440
- pink: "ffc0cb",
441
- plum: "dda0dd",
442
- powderblue: "b0e0e6",
443
- purple: "800080",
444
- rebeccapurple: "639",
445
- red: "f00",
446
- rosybrown: "bc8f8f",
447
- royalblue: "4169e1",
448
- saddlebrown: "8b4513",
449
- salmon: "fa8072",
450
- sandybrown: "f4a460",
451
- seagreen: "2e8b57",
452
- seashell: "fff5ee",
453
- sienna: "a0522d",
454
- silver: "c0c0c0",
455
- skyblue: "87ceeb",
456
- slateblue: "6a5acd",
457
- slategray: "708090",
458
- slategrey: "708090",
459
- snow: "fffafa",
460
- springgreen: "00ff7f",
461
- steelblue: "4682b4",
462
- tan: "d2b48c",
463
- teal: "008080",
464
- thistle: "d8bfd8",
465
- tomato: "ff6347",
466
- turquoise: "40e0d0",
467
- violet: "ee82ee",
468
- wheat: "f5deb3",
469
- white: "fff",
470
- whitesmoke: "f5f5f5",
471
- yellow: "ff0",
472
- yellowgreen: "9acd32"
473
- };
474
- function nameToHex(color) {
475
- if (typeof color !== "string") return color;
476
- var normalizedColorName = color.toLowerCase();
477
- return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
478
- }
479
- __name(nameToHex, "nameToHex");
480
- var hexRegex = /^#[a-fA-F0-9]{6}$/;
481
- var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
482
- var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
483
- var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
484
- var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
485
- var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
486
- var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
487
- var hslaRegex = /^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;
488
- function parseToRgb(color) {
489
- if (typeof color !== "string") {
490
- throw new PolishedError(3);
491
- }
492
- var normalizedColor = nameToHex(color);
493
- if (normalizedColor.match(hexRegex)) {
494
- return {
495
- red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
496
- green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
497
- blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
498
- };
499
- }
500
- if (normalizedColor.match(hexRgbaRegex)) {
501
- var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
502
- return {
503
- red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
504
- green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
505
- blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
506
- alpha
507
- };
508
- }
509
- if (normalizedColor.match(reducedHexRegex)) {
510
- return {
511
- red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
512
- green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
513
- blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
514
- };
515
- }
516
- if (normalizedColor.match(reducedRgbaHexRegex)) {
517
- var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
518
- return {
519
- red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
520
- green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
521
- blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
522
- alpha: _alpha
523
- };
524
- }
525
- var rgbMatched = rgbRegex.exec(normalizedColor);
526
- if (rgbMatched) {
527
- return {
528
- red: parseInt("" + rgbMatched[1], 10),
529
- green: parseInt("" + rgbMatched[2], 10),
530
- blue: parseInt("" + rgbMatched[3], 10)
531
- };
532
- }
533
- var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
534
- if (rgbaMatched) {
535
- return {
536
- red: parseInt("" + rgbaMatched[1], 10),
537
- green: parseInt("" + rgbaMatched[2], 10),
538
- blue: parseInt("" + rgbaMatched[3], 10),
539
- alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
540
- };
541
- }
542
- var hslMatched = hslRegex.exec(normalizedColor);
543
- if (hslMatched) {
544
- var hue = parseInt("" + hslMatched[1], 10);
545
- var saturation = parseInt("" + hslMatched[2], 10) / 100;
546
- var lightness = parseInt("" + hslMatched[3], 10) / 100;
547
- var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
548
- var hslRgbMatched = rgbRegex.exec(rgbColorString);
549
- if (!hslRgbMatched) {
550
- throw new PolishedError(4, normalizedColor, rgbColorString);
551
- }
552
- return {
553
- red: parseInt("" + hslRgbMatched[1], 10),
554
- green: parseInt("" + hslRgbMatched[2], 10),
555
- blue: parseInt("" + hslRgbMatched[3], 10)
556
- };
557
- }
558
- var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
559
- if (hslaMatched) {
560
- var _hue = parseInt("" + hslaMatched[1], 10);
561
- var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
562
- var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
563
- var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
564
- var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
565
- if (!_hslRgbMatched) {
566
- throw new PolishedError(4, normalizedColor, _rgbColorString);
567
- }
568
- return {
569
- red: parseInt("" + _hslRgbMatched[1], 10),
570
- green: parseInt("" + _hslRgbMatched[2], 10),
571
- blue: parseInt("" + _hslRgbMatched[3], 10),
572
- alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
573
- };
574
- }
575
- throw new PolishedError(5);
576
- }
577
- __name(parseToRgb, "parseToRgb");
578
- function rgbToHsl(color) {
579
- var red = color.red / 255;
580
- var green = color.green / 255;
581
- var blue = color.blue / 255;
582
- var max = Math.max(red, green, blue);
583
- var min = Math.min(red, green, blue);
584
- var lightness = (max + min) / 2;
585
- if (max === min) {
586
- if (color.alpha !== void 0) {
587
- return {
588
- hue: 0,
589
- saturation: 0,
590
- lightness,
591
- alpha: color.alpha
592
- };
593
- } else {
594
- return {
595
- hue: 0,
596
- saturation: 0,
597
- lightness
598
- };
599
- }
600
- }
601
- var hue;
602
- var delta = max - min;
603
- var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
604
- switch (max) {
605
- case red:
606
- hue = (green - blue) / delta + (green < blue ? 6 : 0);
607
- break;
608
- case green:
609
- hue = (blue - red) / delta + 2;
610
- break;
611
- default:
612
- hue = (red - green) / delta + 4;
613
- break;
614
- }
615
- hue *= 60;
616
- if (color.alpha !== void 0) {
617
- return {
618
- hue,
619
- saturation,
620
- lightness,
621
- alpha: color.alpha
622
- };
623
- }
624
- return {
625
- hue,
626
- saturation,
627
- lightness
628
- };
629
- }
630
- __name(rgbToHsl, "rgbToHsl");
631
- function parseToHsl(color) {
632
- return rgbToHsl(parseToRgb(color));
633
- }
634
- __name(parseToHsl, "parseToHsl");
635
- var reduceHexValue = /* @__PURE__ */ __name(function reduceHexValue2(value) {
636
- if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
637
- return "#" + value[1] + value[3] + value[5];
638
- }
639
- return value;
640
- }, "reduceHexValue");
641
- var reduceHexValue$1 = reduceHexValue;
642
- function numberToHex(value) {
643
- var hex = value.toString(16);
644
- return hex.length === 1 ? "0" + hex : hex;
645
- }
646
- __name(numberToHex, "numberToHex");
647
- function colorToHex(color) {
648
- return numberToHex(Math.round(color * 255));
649
- }
650
- __name(colorToHex, "colorToHex");
651
- function convertToHex(red, green, blue) {
652
- return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
653
- }
654
- __name(convertToHex, "convertToHex");
655
- function hslToHex(hue, saturation, lightness) {
656
- return hslToRgb(hue, saturation, lightness, convertToHex);
657
- }
658
- __name(hslToHex, "hslToHex");
659
- function hsl(value, saturation, lightness) {
660
- if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number") {
661
- return hslToHex(value, saturation, lightness);
662
- } else if (typeof value === "object" && saturation === void 0 && lightness === void 0) {
663
- return hslToHex(value.hue, value.saturation, value.lightness);
664
- }
665
- throw new PolishedError(1);
666
- }
667
- __name(hsl, "hsl");
668
- function hsla(value, saturation, lightness, alpha) {
669
- if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number" && typeof alpha === "number") {
670
- return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
671
- } else if (typeof value === "object" && saturation === void 0 && lightness === void 0 && alpha === void 0) {
672
- return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
673
- }
674
- throw new PolishedError(2);
675
- }
676
- __name(hsla, "hsla");
677
- function rgb(value, green, blue) {
678
- if (typeof value === "number" && typeof green === "number" && typeof blue === "number") {
679
- return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
680
- } else if (typeof value === "object" && green === void 0 && blue === void 0) {
681
- return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
682
- }
683
- throw new PolishedError(6);
684
- }
685
- __name(rgb, "rgb");
686
- function rgba(firstValue, secondValue, thirdValue, fourthValue) {
687
- if (typeof firstValue === "string" && typeof secondValue === "number") {
688
- var rgbValue = parseToRgb(firstValue);
689
- return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
690
- } else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") {
691
- return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
692
- } else if (typeof firstValue === "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) {
693
- return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
694
- }
695
- throw new PolishedError(7);
696
- }
697
- __name(rgba, "rgba");
698
- var isRgb = /* @__PURE__ */ __name(function isRgb2(color) {
699
- return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined");
700
- }, "isRgb");
701
- var isRgba = /* @__PURE__ */ __name(function isRgba2(color) {
702
- return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && typeof color.alpha === "number";
703
- }, "isRgba");
704
- var isHsl = /* @__PURE__ */ __name(function isHsl2(color) {
705
- return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined");
706
- }, "isHsl");
707
- var isHsla = /* @__PURE__ */ __name(function isHsla2(color) {
708
- return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && typeof color.alpha === "number";
709
- }, "isHsla");
710
- function toColorString(color) {
711
- if (typeof color !== "object") throw new PolishedError(8);
712
- if (isRgba(color)) return rgba(color);
713
- if (isRgb(color)) return rgb(color);
714
- if (isHsla(color)) return hsla(color);
715
- if (isHsl(color)) return hsl(color);
716
- throw new PolishedError(8);
717
- }
718
- __name(toColorString, "toColorString");
719
- function curried(f, length, acc) {
720
- return /* @__PURE__ */ __name(function fn() {
721
- var combined = acc.concat(Array.prototype.slice.call(arguments));
722
- return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
723
- }, "fn");
724
- }
725
- __name(curried, "curried");
726
- function curry(f) {
727
- return curried(f, f.length, []);
728
- }
729
- __name(curry, "curry");
730
- function adjustHue(degree, color) {
731
- if (color === "transparent") return color;
732
- var hslColor = parseToHsl(color);
733
- return toColorString(_extends({}, hslColor, {
734
- hue: hslColor.hue + parseFloat(degree)
735
- }));
736
- }
737
- __name(adjustHue, "adjustHue");
738
- var curriedAdjustHue = curry(adjustHue);
739
- function guard(lowerBoundary, upperBoundary, value) {
740
- return Math.max(lowerBoundary, Math.min(upperBoundary, value));
741
- }
742
- __name(guard, "guard");
743
- function darken(amount, color) {
744
- if (color === "transparent") return color;
745
- var hslColor = parseToHsl(color);
746
- return toColorString(_extends({}, hslColor, {
747
- lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
748
- }));
749
- }
750
- __name(darken, "darken");
751
- var curriedDarken = curry(darken);
752
- var curriedDarken$1 = curriedDarken;
753
- function desaturate(amount, color) {
754
- if (color === "transparent") return color;
755
- var hslColor = parseToHsl(color);
756
- return toColorString(_extends({}, hslColor, {
757
- saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
758
- }));
759
- }
760
- __name(desaturate, "desaturate");
761
- var curriedDesaturate = curry(desaturate);
762
- function lighten(amount, color) {
763
- if (color === "transparent") return color;
764
- var hslColor = parseToHsl(color);
765
- return toColorString(_extends({}, hslColor, {
766
- lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
767
- }));
768
- }
769
- __name(lighten, "lighten");
770
- var curriedLighten = curry(lighten);
771
- var curriedLighten$1 = curriedLighten;
772
- function mix(weight, color, otherColor) {
773
- if (color === "transparent") return otherColor;
774
- if (otherColor === "transparent") return color;
775
- if (weight === 0) return otherColor;
776
- var parsedColor1 = parseToRgb(color);
777
- var color1 = _extends({}, parsedColor1, {
778
- alpha: typeof parsedColor1.alpha === "number" ? parsedColor1.alpha : 1
779
- });
780
- var parsedColor2 = parseToRgb(otherColor);
781
- var color2 = _extends({}, parsedColor2, {
782
- alpha: typeof parsedColor2.alpha === "number" ? parsedColor2.alpha : 1
783
- });
784
- var alphaDelta = color1.alpha - color2.alpha;
785
- var x = parseFloat(weight) * 2 - 1;
786
- var y = x * alphaDelta === -1 ? x : x + alphaDelta;
787
- var z = 1 + x * alphaDelta;
788
- var weight1 = (y / z + 1) / 2;
789
- var weight2 = 1 - weight1;
790
- var mixedColor = {
791
- red: Math.floor(color1.red * weight1 + color2.red * weight2),
792
- green: Math.floor(color1.green * weight1 + color2.green * weight2),
793
- blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
794
- alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
795
- };
796
- return rgba(mixedColor);
797
- }
798
- __name(mix, "mix");
799
- var curriedMix = curry(mix);
800
- var mix$1 = curriedMix;
801
- function opacify(amount, color) {
802
- if (color === "transparent") return color;
803
- var parsedColor = parseToRgb(color);
804
- var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
805
- var colorWithAlpha = _extends({}, parsedColor, {
806
- alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
807
- });
808
- return rgba(colorWithAlpha);
809
- }
810
- __name(opacify, "opacify");
811
- var curriedOpacify = curry(opacify);
812
- var curriedOpacify$1 = curriedOpacify;
813
- function saturate(amount, color) {
814
- if (color === "transparent") return color;
815
- var hslColor = parseToHsl(color);
816
- return toColorString(_extends({}, hslColor, {
817
- saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
818
- }));
819
- }
820
- __name(saturate, "saturate");
821
- var curriedSaturate = curry(saturate);
822
- function setHue(hue, color) {
823
- if (color === "transparent") return color;
824
- return toColorString(_extends({}, parseToHsl(color), {
825
- hue: parseFloat(hue)
826
- }));
827
- }
828
- __name(setHue, "setHue");
829
- var curriedSetHue = curry(setHue);
830
- function setLightness(lightness, color) {
831
- if (color === "transparent") return color;
832
- return toColorString(_extends({}, parseToHsl(color), {
833
- lightness: parseFloat(lightness)
834
- }));
835
- }
836
- __name(setLightness, "setLightness");
837
- var curriedSetLightness = curry(setLightness);
838
- function setSaturation(saturation, color) {
839
- if (color === "transparent") return color;
840
- return toColorString(_extends({}, parseToHsl(color), {
841
- saturation: parseFloat(saturation)
842
- }));
843
- }
844
- __name(setSaturation, "setSaturation");
845
- var curriedSetSaturation = curry(setSaturation);
846
- function shade(percentage, color) {
847
- if (color === "transparent") return color;
848
- return mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color);
849
- }
850
- __name(shade, "shade");
851
- var curriedShade = curry(shade);
852
- function tint(percentage, color) {
853
- if (color === "transparent") return color;
854
- return mix$1(parseFloat(percentage), "rgb(255, 255, 255)", color);
855
- }
856
- __name(tint, "tint");
857
- var curriedTint = curry(tint);
858
- function transparentize(amount, color) {
859
- if (color === "transparent") return color;
860
- var parsedColor = parseToRgb(color);
861
- var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
862
- var colorWithAlpha = _extends({}, parsedColor, {
863
- alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
864
- });
865
- return rgba(colorWithAlpha);
866
- }
867
- __name(transparentize, "transparentize");
868
- var curriedTransparentize = curry(transparentize);
869
- var curriedTransparentize$1 = curriedTransparentize;
870
-
871
- // src/blocks/components/EmptyBlock.tsx
872
- import { styled } from "storybook/theming";
873
- var Wrapper = styled.div(withReset, ({ theme }) => ({
874
- backgroundColor: theme.base === "light" ? "rgba(0,0,0,.01)" : "rgba(255,255,255,.01)",
875
- borderRadius: theme.appBorderRadius,
876
- border: `1px dashed ${theme.appBorderColor}`,
877
- display: "flex",
878
- alignItems: "center",
879
- justifyContent: "center",
880
- padding: 20,
881
- margin: "25px 0 40px",
882
- color: curriedTransparentize$1(0.3, theme.color.defaultText),
883
- fontSize: theme.typography.size.s2
884
- }));
885
- var EmptyBlock = /* @__PURE__ */ __name((props) => React.createElement(Wrapper, { ...props, className: "docblock-emptyblock sb-unstyled" }), "EmptyBlock");
886
-
887
- // src/blocks/components/Source.tsx
888
- var StyledSyntaxHighlighter = styled2(
889
- SyntaxHighlighter
890
- )(({ theme }) => ({
891
- // DocBlocks-specific styling and overrides
892
- fontSize: `${theme.typography.size.s2 - 1}px`,
893
- lineHeight: "19px",
894
- margin: "25px 0 40px",
895
- borderRadius: theme.appBorderRadius,
896
- boxShadow: theme.base === "light" ? "rgba(0, 0, 0, 0.10) 0 1px 3px 0" : "rgba(0, 0, 0, 0.20) 0 2px 5px 0",
897
- "pre.prismjs": {
898
- padding: 20,
899
- background: "inherit"
900
- }
901
- }));
902
- var SourceSkeletonWrapper = styled2.div(({ theme }) => ({
903
- background: theme.background.content,
904
- borderRadius: theme.appBorderRadius,
905
- border: `1px solid ${theme.appBorderColor}`,
906
- boxShadow: theme.base === "light" ? "rgba(0, 0, 0, 0.10) 0 1px 3px 0" : "rgba(0, 0, 0, 0.20) 0 2px 5px 0",
907
- margin: "25px 0 40px",
908
- padding: "20px 20px 20px 22px"
909
- }));
910
- var SourceSkeletonPlaceholder = styled2.div(({ theme }) => ({
911
- animation: `${theme.animation.glow} 1.5s ease-in-out infinite`,
912
- background: theme.appBorderColor,
913
- height: 17,
914
- marginTop: 1,
915
- width: "60%",
916
- [`&:first-child${ignoreSsrWarning}`]: {
917
- margin: 0
918
- }
919
- }));
920
- var SourceSkeleton = /* @__PURE__ */ __name(() => React2.createElement(SourceSkeletonWrapper, null, React2.createElement(SourceSkeletonPlaceholder, null), React2.createElement(SourceSkeletonPlaceholder, { style: { width: "80%" } }), React2.createElement(SourceSkeletonPlaceholder, { style: { width: "30%" } }), React2.createElement(SourceSkeletonPlaceholder, { style: { width: "80%" } })), "SourceSkeleton");
921
- var Source = /* @__PURE__ */ __name(({
922
- isLoading,
923
- error,
924
- language,
925
- code,
926
- dark,
927
- format: format2 = true,
928
- ...rest
929
- }) => {
930
- const { typography } = useTheme();
931
- if (isLoading) {
932
- return React2.createElement(SourceSkeleton, null);
933
- }
934
- if (error) {
935
- return React2.createElement(EmptyBlock, null, error);
936
- }
937
- const syntaxHighlighter = React2.createElement(
938
- StyledSyntaxHighlighter,
939
- {
940
- bordered: true,
941
- copyable: true,
942
- format: format2,
943
- language: language ?? "jsx",
944
- className: "docblock-source sb-unstyled",
945
- ...rest
946
- },
947
- code
948
- );
949
- if (typeof dark === "undefined") {
950
- return syntaxHighlighter;
951
- }
952
- const overrideTheme = dark ? themes.dark : themes.light;
953
- return React2.createElement(
954
- ThemeProvider,
955
- {
956
- theme: convert({
957
- ...overrideTheme,
958
- fontCode: typography.fonts.mono,
959
- fontBase: typography.fonts.base
960
- })
961
- },
962
- syntaxHighlighter
963
- );
964
- }, "Source");
965
-
966
- export {
967
- rgba,
968
- curriedDarken$1,
969
- curriedLighten$1,
970
- curriedOpacify$1,
971
- curriedTransparentize$1,
972
- EmptyBlock,
973
- Source
974
- };