@storybook/addon-docs 9.0.0-alpha.17 → 9.0.0-alpha.19
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.
- package/README.md +1 -1
- package/dist/Color-SIUCOEKT.mjs +10 -0
- package/dist/DocsRenderer-3PZUHFFL.mjs +2 -0
- package/dist/blocks.d.ts +1031 -2
- package/dist/blocks.js +198 -1
- package/dist/blocks.mjs +214 -3
- package/dist/{chunk-PRSJUHPQ.mjs → chunk-GFTNOJSG.mjs} +2 -2
- package/dist/{chunk-NUUEMKO5.mjs → chunk-GWJYCGSQ.mjs} +1 -1
- package/dist/chunk-QUZPS4B6.mjs +3 -0
- package/dist/chunk-W6FI2KYE.mjs +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +4 -4
- package/dist/mdx-loader.mjs +1 -1
- package/dist/preset.js +1 -1
- package/dist/preview.js +1 -1
- package/dist/preview.mjs +2 -2
- package/package.json +16 -7
- package/dist/DocsRenderer-CFRXHY34.mjs +0 -2
- package/dist/chunk-H6MOWX77.mjs +0 -3
- package/dist/manager.d.ts +0 -2
- package/dist/manager.js +0 -149
- package/dist/manager.mjs +0 -155
package/dist/manager.js
DELETED
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
"use strict";var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var import_react3=__toESM(require("react")),import_components3=require("storybook/internal/components"),import_manager_api=require("storybook/manager-api"),import_theming3=require("storybook/theming");var ADDON_ID="storybook/docs",PANEL_ID=`${ADDON_ID}/panel`,PARAM_KEY="docs",SNIPPET_RENDERED=`${ADDON_ID}/snippet-rendered`;var import_react2=__toESM(require("react")),import_components2=require("storybook/internal/components"),import_theming2=require("storybook/theming");var import_react=__toESM(require("react")),import_components=require("storybook/internal/components");function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},_extends.apply(null,arguments)}function _assertThisInitialized(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t2,e2){return t2.__proto__=e2,t2},_setPrototypeOf(t,e)}function _inheritsLoose(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,_setPrototypeOf(t,o)}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t2){return t2.__proto__||Object.getPrototypeOf(t2)},_getPrototypeOf(t)}function _isNativeFunction(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_isNativeReflectConstruct=function(){return!!t})()}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _wrapNativeSuper(t){var r=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(t2){if(t2===null||!_isNativeFunction(t2))return t2;if(typeof t2!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(t2))return r.get(t2);r.set(t2,Wrapper2)}function Wrapper2(){return _construct(t2,arguments,_getPrototypeOf(this).constructor)}return Wrapper2.prototype=Object.create(t2.prototype,{constructor:{value:Wrapper2,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper2,t2)},_wrapNativeSuper(t)}var ERRORS={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 }).
|
|
2
|
-
|
|
3
|
-
`,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 }).
|
|
4
|
-
|
|
5
|
-
`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.
|
|
6
|
-
|
|
7
|
-
`,4:`Couldn't generate valid rgb string from %s, it returned %s.
|
|
8
|
-
|
|
9
|
-
`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
|
|
10
|
-
|
|
11
|
-
`,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 }).
|
|
12
|
-
|
|
13
|
-
`,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 }).
|
|
14
|
-
|
|
15
|
-
`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
|
|
16
|
-
|
|
17
|
-
`,9:`Please provide a number of steps to the modularScale helper.
|
|
18
|
-
|
|
19
|
-
`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
|
|
20
|
-
|
|
21
|
-
`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"
|
|
22
|
-
|
|
23
|
-
`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
|
|
24
|
-
|
|
25
|
-
`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
|
|
26
|
-
|
|
27
|
-
`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
|
|
28
|
-
|
|
29
|
-
`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
|
|
30
|
-
|
|
31
|
-
`,16:`You must provide a template to this method.
|
|
32
|
-
|
|
33
|
-
`,17:`You passed an unsupported selector state to this method.
|
|
34
|
-
|
|
35
|
-
`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.
|
|
36
|
-
|
|
37
|
-
`,19:`fromSize and toSize must be provided as stringified numbers with the same units.
|
|
38
|
-
|
|
39
|
-
`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
|
|
40
|
-
|
|
41
|
-
`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.
|
|
42
|
-
|
|
43
|
-
`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.
|
|
44
|
-
|
|
45
|
-
`,25:`fontFace expects localFonts to be an array.
|
|
46
|
-
|
|
47
|
-
`,26:`fontFace expects fileFormats to be an array.
|
|
48
|
-
|
|
49
|
-
`,27:`radialGradient requries at least 2 color-stops to properly render.
|
|
50
|
-
|
|
51
|
-
`,28:`Please supply a filename to retinaImage() as the first argument.
|
|
52
|
-
|
|
53
|
-
`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
|
|
54
|
-
|
|
55
|
-
`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation
|
|
56
|
-
|
|
57
|
-
`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
|
|
58
|
-
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
|
|
59
|
-
|
|
60
|
-
`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
|
|
61
|
-
|
|
62
|
-
`,34:`borderRadius expects a radius value as a string or number as the second argument.
|
|
63
|
-
|
|
64
|
-
`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
|
|
65
|
-
|
|
66
|
-
`,36:`Property must be a string value.
|
|
67
|
-
|
|
68
|
-
`,37:`Syntax Error at %s.
|
|
69
|
-
|
|
70
|
-
`,38:`Formula contains a function that needs parentheses at %s.
|
|
71
|
-
|
|
72
|
-
`,39:`Formula is missing closing parenthesis at %s.
|
|
73
|
-
|
|
74
|
-
`,40:`Formula has too many closing parentheses at %s.
|
|
75
|
-
|
|
76
|
-
`,41:`All values in a formula must have the same unit or be unitless.
|
|
77
|
-
|
|
78
|
-
`,42:`Please provide a number of steps to the modularScale helper.
|
|
79
|
-
|
|
80
|
-
`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
|
|
81
|
-
|
|
82
|
-
`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
|
|
83
|
-
|
|
84
|
-
`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
|
|
85
|
-
|
|
86
|
-
`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
|
|
87
|
-
|
|
88
|
-
`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.
|
|
89
|
-
|
|
90
|
-
`,48:`fromSize and toSize must be provided as stringified numbers with the same units.
|
|
91
|
-
|
|
92
|
-
`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
|
|
93
|
-
|
|
94
|
-
`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
|
|
95
|
-
|
|
96
|
-
`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.
|
|
97
|
-
|
|
98
|
-
`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.
|
|
99
|
-
|
|
100
|
-
`,53:`fontFace expects localFonts to be an array.
|
|
101
|
-
|
|
102
|
-
`,54:`fontFace expects fileFormats to be an array.
|
|
103
|
-
|
|
104
|
-
`,55:`fontFace expects a name of a font-family.
|
|
105
|
-
|
|
106
|
-
`,56:`linearGradient requries at least 2 color-stops to properly render.
|
|
107
|
-
|
|
108
|
-
`,57:`radialGradient requries at least 2 color-stops to properly render.
|
|
109
|
-
|
|
110
|
-
`,58:`Please supply a filename to retinaImage() as the first argument.
|
|
111
|
-
|
|
112
|
-
`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
|
|
113
|
-
|
|
114
|
-
`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.
|
|
115
|
-
|
|
116
|
-
`,62:`borderRadius expects a radius value as a string or number as the second argument.
|
|
117
|
-
|
|
118
|
-
`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
|
|
119
|
-
|
|
120
|
-
`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
|
|
121
|
-
|
|
122
|
-
`,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').
|
|
123
|
-
|
|
124
|
-
`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
|
|
125
|
-
|
|
126
|
-
`,67:`You must provide a template to this method.
|
|
127
|
-
|
|
128
|
-
`,68:`You passed an unsupported selector state to this method.
|
|
129
|
-
|
|
130
|
-
`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
|
|
131
|
-
|
|
132
|
-
`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
|
|
133
|
-
|
|
134
|
-
`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
|
|
135
|
-
|
|
136
|
-
`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
|
|
137
|
-
|
|
138
|
-
`,73:`Please provide a valid CSS variable.
|
|
139
|
-
|
|
140
|
-
`,74:`CSS variable not found and no default was provided.
|
|
141
|
-
|
|
142
|
-
`,75:`important requires a valid style object, got a %s instead.
|
|
143
|
-
|
|
144
|
-
`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
|
|
145
|
-
|
|
146
|
-
`,77:`remToPx expects a value in "rem" but you provided it in "%s".
|
|
147
|
-
|
|
148
|
-
`,78:`base must be set in "px" or "%" but you set it in "%s".
|
|
149
|
-
`};function format(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];var a=args[0],b=[],c;for(c=1;c<args.length;c+=1)b.push(args[c]);return b.forEach(function(d){a=a.replace(/%[a-z]/,d)}),a}var PolishedError=function(_Error){_inheritsLoose(PolishedError2,_Error);function PolishedError2(code){var _this;if(process.env.NODE_ENV==="production")_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;else{for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];_this=_Error.call(this,format.apply(void 0,[ERRORS[code]].concat(args)))||this}return _assertThisInitialized(_this)}return PolishedError2}(_wrapNativeSuper(Error));function colorToInt(color){return Math.round(color*255)}function convertToInt(red,green,blue){return colorToInt(red)+","+colorToInt(green)+","+colorToInt(blue)}function hslToRgb(hue,saturation,lightness,convert2){if(convert2===void 0&&(convert2=convertToInt),saturation===0)return convert2(lightness,lightness,lightness);var huePrime=(hue%360+360)%360/60,chroma=(1-Math.abs(2*lightness-1))*saturation,secondComponent=chroma*(1-Math.abs(huePrime%2-1)),red=0,green=0,blue=0;huePrime>=0&&huePrime<1?(red=chroma,green=secondComponent):huePrime>=1&&huePrime<2?(red=secondComponent,green=chroma):huePrime>=2&&huePrime<3?(green=chroma,blue=secondComponent):huePrime>=3&&huePrime<4?(green=secondComponent,blue=chroma):huePrime>=4&&huePrime<5?(red=secondComponent,blue=chroma):huePrime>=5&&huePrime<6&&(red=chroma,blue=secondComponent);var lightnessModification=lightness-chroma/2,finalRed=red+lightnessModification,finalGreen=green+lightnessModification,finalBlue=blue+lightnessModification;return convert2(finalRed,finalGreen,finalBlue)}var namedColorMap={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function nameToHex(color){if(typeof color!="string")return color;var normalizedColorName=color.toLowerCase();return namedColorMap[normalizedColorName]?"#"+namedColorMap[normalizedColorName]:color}var hexRegex=/^#[a-fA-F0-9]{6}$/,hexRgbaRegex=/^#[a-fA-F0-9]{8}$/,reducedHexRegex=/^#[a-fA-F0-9]{3}$/,reducedRgbaHexRegex=/^#[a-fA-F0-9]{4}$/,rgbRegex=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,rgbaRegex=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,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,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;function parseToRgb(color){if(typeof color!="string")throw new PolishedError(3);var normalizedColor=nameToHex(color);if(normalizedColor.match(hexRegex))return{red:parseInt(""+normalizedColor[1]+normalizedColor[2],16),green:parseInt(""+normalizedColor[3]+normalizedColor[4],16),blue:parseInt(""+normalizedColor[5]+normalizedColor[6],16)};if(normalizedColor.match(hexRgbaRegex)){var alpha=parseFloat((parseInt(""+normalizedColor[7]+normalizedColor[8],16)/255).toFixed(2));return{red:parseInt(""+normalizedColor[1]+normalizedColor[2],16),green:parseInt(""+normalizedColor[3]+normalizedColor[4],16),blue:parseInt(""+normalizedColor[5]+normalizedColor[6],16),alpha}}if(normalizedColor.match(reducedHexRegex))return{red:parseInt(""+normalizedColor[1]+normalizedColor[1],16),green:parseInt(""+normalizedColor[2]+normalizedColor[2],16),blue:parseInt(""+normalizedColor[3]+normalizedColor[3],16)};if(normalizedColor.match(reducedRgbaHexRegex)){var _alpha=parseFloat((parseInt(""+normalizedColor[4]+normalizedColor[4],16)/255).toFixed(2));return{red:parseInt(""+normalizedColor[1]+normalizedColor[1],16),green:parseInt(""+normalizedColor[2]+normalizedColor[2],16),blue:parseInt(""+normalizedColor[3]+normalizedColor[3],16),alpha:_alpha}}var rgbMatched=rgbRegex.exec(normalizedColor);if(rgbMatched)return{red:parseInt(""+rgbMatched[1],10),green:parseInt(""+rgbMatched[2],10),blue:parseInt(""+rgbMatched[3],10)};var rgbaMatched=rgbaRegex.exec(normalizedColor.substring(0,50));if(rgbaMatched)return{red:parseInt(""+rgbaMatched[1],10),green:parseInt(""+rgbaMatched[2],10),blue:parseInt(""+rgbaMatched[3],10),alpha:parseFloat(""+rgbaMatched[4])>1?parseFloat(""+rgbaMatched[4])/100:parseFloat(""+rgbaMatched[4])};var hslMatched=hslRegex.exec(normalizedColor);if(hslMatched){var hue=parseInt(""+hslMatched[1],10),saturation=parseInt(""+hslMatched[2],10)/100,lightness=parseInt(""+hslMatched[3],10)/100,rgbColorString="rgb("+hslToRgb(hue,saturation,lightness)+")",hslRgbMatched=rgbRegex.exec(rgbColorString);if(!hslRgbMatched)throw new PolishedError(4,normalizedColor,rgbColorString);return{red:parseInt(""+hslRgbMatched[1],10),green:parseInt(""+hslRgbMatched[2],10),blue:parseInt(""+hslRgbMatched[3],10)}}var hslaMatched=hslaRegex.exec(normalizedColor.substring(0,50));if(hslaMatched){var _hue=parseInt(""+hslaMatched[1],10),_saturation=parseInt(""+hslaMatched[2],10)/100,_lightness=parseInt(""+hslaMatched[3],10)/100,_rgbColorString="rgb("+hslToRgb(_hue,_saturation,_lightness)+")",_hslRgbMatched=rgbRegex.exec(_rgbColorString);if(!_hslRgbMatched)throw new PolishedError(4,normalizedColor,_rgbColorString);return{red:parseInt(""+_hslRgbMatched[1],10),green:parseInt(""+_hslRgbMatched[2],10),blue:parseInt(""+_hslRgbMatched[3],10),alpha:parseFloat(""+hslaMatched[4])>1?parseFloat(""+hslaMatched[4])/100:parseFloat(""+hslaMatched[4])}}throw new PolishedError(5)}var reduceHexValue=function(value){return value.length===7&&value[1]===value[2]&&value[3]===value[4]&&value[5]===value[6]?"#"+value[1]+value[3]+value[5]:value},reduceHexValue$1=reduceHexValue;function numberToHex(value){var hex=value.toString(16);return hex.length===1?"0"+hex:hex}function rgb(value,green,blue){if(typeof value=="number"&&typeof green=="number"&&typeof blue=="number")return reduceHexValue$1("#"+numberToHex(value)+numberToHex(green)+numberToHex(blue));if(typeof value=="object"&&green===void 0&&blue===void 0)return reduceHexValue$1("#"+numberToHex(value.red)+numberToHex(value.green)+numberToHex(value.blue));throw new PolishedError(6)}function rgba(firstValue,secondValue,thirdValue,fourthValue){if(typeof firstValue=="string"&&typeof secondValue=="number"){var rgbValue=parseToRgb(firstValue);return"rgba("+rgbValue.red+","+rgbValue.green+","+rgbValue.blue+","+secondValue+")"}else{if(typeof firstValue=="number"&&typeof secondValue=="number"&&typeof thirdValue=="number"&&typeof fourthValue=="number")return fourthValue>=1?rgb(firstValue,secondValue,thirdValue):"rgba("+firstValue+","+secondValue+","+thirdValue+","+fourthValue+")";if(typeof firstValue=="object"&&secondValue===void 0&&thirdValue===void 0&&fourthValue===void 0)return firstValue.alpha>=1?rgb(firstValue.red,firstValue.green,firstValue.blue):"rgba("+firstValue.red+","+firstValue.green+","+firstValue.blue+","+firstValue.alpha+")"}throw new PolishedError(7)}function curried(f,length,acc){return function(){var combined=acc.concat(Array.prototype.slice.call(arguments));return combined.length>=length?f.apply(this,combined):curried(f,length,combined)}}function curry(f){return curried(f,f.length,[])}function guard(lowerBoundary,upperBoundary,value){return Math.max(lowerBoundary,Math.min(upperBoundary,value))}function transparentize(amount,color){if(color==="transparent")return color;var parsedColor=parseToRgb(color),alpha=typeof parsedColor.alpha=="number"?parsedColor.alpha:1,colorWithAlpha=_extends({},parsedColor,{alpha:guard(0,1,+(alpha*100-parseFloat(amount)*100).toFixed(2)/100)});return rgba(colorWithAlpha)}var curriedTransparentize=curry(transparentize),curriedTransparentize$1=curriedTransparentize;var import_theming=require("storybook/theming"),Wrapper=import_theming.styled.div(import_components.withReset,({theme})=>({backgroundColor:theme.base==="light"?"rgba(0,0,0,.01)":"rgba(255,255,255,.01)",borderRadius:theme.appBorderRadius,border:`1px dashed ${theme.appBorderColor}`,display:"flex",alignItems:"center",justifyContent:"center",padding:20,margin:"25px 0 40px",color:curriedTransparentize$1(.3,theme.color.defaultText),fontSize:theme.typography.size.s2})),EmptyBlock=props=>import_react.default.createElement(Wrapper,{...props,className:"docblock-emptyblock sb-unstyled"});var StyledSyntaxHighlighter=(0,import_theming2.styled)(import_components2.SyntaxHighlighter)(({theme})=>({fontSize:`${theme.typography.size.s2-1}px`,lineHeight:"19px",margin:"25px 0 40px",borderRadius:theme.appBorderRadius,boxShadow:theme.base==="light"?"rgba(0, 0, 0, 0.10) 0 1px 3px 0":"rgba(0, 0, 0, 0.20) 0 2px 5px 0","pre.prismjs":{padding:20,background:"inherit"}}));var SourceSkeletonWrapper=import_theming2.styled.div(({theme})=>({background:theme.background.content,borderRadius:theme.appBorderRadius,border:`1px solid ${theme.appBorderColor}`,boxShadow:theme.base==="light"?"rgba(0, 0, 0, 0.10) 0 1px 3px 0":"rgba(0, 0, 0, 0.20) 0 2px 5px 0",margin:"25px 0 40px",padding:"20px 20px 20px 22px"})),SourceSkeletonPlaceholder=import_theming2.styled.div(({theme})=>({animation:`${theme.animation.glow} 1.5s ease-in-out infinite`,background:theme.appBorderColor,height:17,marginTop:1,width:"60%",[`&:first-child${import_theming2.ignoreSsrWarning}`]:{margin:0}})),SourceSkeleton=()=>import_react2.default.createElement(SourceSkeletonWrapper,null,import_react2.default.createElement(SourceSkeletonPlaceholder,null),import_react2.default.createElement(SourceSkeletonPlaceholder,{style:{width:"80%"}}),import_react2.default.createElement(SourceSkeletonPlaceholder,{style:{width:"30%"}}),import_react2.default.createElement(SourceSkeletonPlaceholder,{style:{width:"80%"}})),Source=({isLoading,error,language,code,dark,format:format2=!0,...rest})=>{let{typography}=(0,import_theming2.useTheme)();if(isLoading)return import_react2.default.createElement(SourceSkeleton,null);if(error)return import_react2.default.createElement(EmptyBlock,null,error);let syntaxHighlighter=import_react2.default.createElement(StyledSyntaxHighlighter,{bordered:!0,copyable:!0,format:format2,language,className:"docblock-source sb-unstyled",...rest},code);if(typeof dark>"u")return syntaxHighlighter;let overrideTheme=dark?import_theming2.themes.dark:import_theming2.themes.light;return import_react2.default.createElement(import_theming2.ThemeProvider,{theme:(0,import_theming2.convert)({...overrideTheme,fontCode:typography.fonts.mono,fontBase:typography.fonts.base})},syntaxHighlighter)};import_manager_api.addons.register(ADDON_ID,api=>{import_manager_api.addons.add(PANEL_ID,{title:"Code",type:import_manager_api.types.PANEL,paramKey:PARAM_KEY,disabled:parameters=>!parameters?.docs?.codePanel,match:({viewMode})=>viewMode==="story",render:({active})=>{let lastEvent=api.getChannel()?.last(SNIPPET_RENDERED)?.[0],[codeSnippet,setSourceCode]=(0,import_react3.useState)({source:lastEvent?.source??"",format:lastEvent?.format??void 0}),parameter=(0,import_manager_api.useParameter)(PARAM_KEY,{source:{code:""},theme:"dark"});(0,import_manager_api.useChannel)({[SNIPPET_RENDERED]:({source,format:format2})=>{setSourceCode({source,format:format2})}});let isDark=(0,import_theming3.useTheme)().base!=="light";return import_react3.default.createElement(import_components3.AddonPanel,{active:!!active},import_react3.default.createElement(SourceStyles,null,import_react3.default.createElement(Source,{...parameter.source,code:parameter.source.code||codeSnippet.source,format:codeSnippet.format,dark:isDark})))}})});var SourceStyles=import_theming3.styled.div(()=>({height:"100%",[`> :first-child${import_theming3.ignoreSsrWarning}`]:{margin:0,height:"100%",boxShadow:"none"}}));
|
package/dist/manager.mjs
DELETED
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import './chunk-H6MOWX77.mjs';
|
|
2
|
-
import React2, { useState } from 'react';
|
|
3
|
-
import { withReset, SyntaxHighlighter, AddonPanel } from 'storybook/internal/components';
|
|
4
|
-
import { addons, types, useParameter, useChannel } from 'storybook/manager-api';
|
|
5
|
-
import { styled, ignoreSsrWarning, useTheme, themes, ThemeProvider, convert } from 'storybook/theming';
|
|
6
|
-
|
|
7
|
-
var ADDON_ID="storybook/docs",PANEL_ID=`${ADDON_ID}/panel`,PARAM_KEY="docs",SNIPPET_RENDERED=`${ADDON_ID}/snippet-rendered`;function _extends(){return _extends=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r]);}return n},_extends.apply(null,arguments)}function _assertThisInitialized(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _setPrototypeOf(t,e){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t2,e2){return t2.__proto__=e2,t2},_setPrototypeOf(t,e)}function _inheritsLoose(t,o){t.prototype=Object.create(o.prototype),t.prototype.constructor=t,_setPrototypeOf(t,o);}function _getPrototypeOf(t){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t2){return t2.__proto__||Object.getPrototypeOf(t2)},_getPrototypeOf(t)}function _isNativeFunction(t){try{return Function.toString.call(t).indexOf("[native code]")!==-1}catch{return typeof t=="function"}}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch{}return (_isNativeReflectConstruct=function(){return !!t})()}function _construct(t,e,r){if(_isNativeReflectConstruct())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,e);var p=new(t.bind.apply(t,o));return r&&_setPrototypeOf(p,r.prototype),p}function _wrapNativeSuper(t){var r=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(t2){if(t2===null||!_isNativeFunction(t2))return t2;if(typeof t2!="function")throw new TypeError("Super expression must either be null or a function");if(r!==void 0){if(r.has(t2))return r.get(t2);r.set(t2,Wrapper2);}function Wrapper2(){return _construct(t2,arguments,_getPrototypeOf(this).constructor)}return Wrapper2.prototype=Object.create(t2.prototype,{constructor:{value:Wrapper2,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper2,t2)},_wrapNativeSuper(t)}var ERRORS={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 }).
|
|
8
|
-
|
|
9
|
-
`,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 }).
|
|
10
|
-
|
|
11
|
-
`,3:`Passed an incorrect argument to a color function, please pass a string representation of a color.
|
|
12
|
-
|
|
13
|
-
`,4:`Couldn't generate valid rgb string from %s, it returned %s.
|
|
14
|
-
|
|
15
|
-
`,5:`Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.
|
|
16
|
-
|
|
17
|
-
`,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 }).
|
|
18
|
-
|
|
19
|
-
`,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 }).
|
|
20
|
-
|
|
21
|
-
`,8:`Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.
|
|
22
|
-
|
|
23
|
-
`,9:`Please provide a number of steps to the modularScale helper.
|
|
24
|
-
|
|
25
|
-
`,10:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
|
|
26
|
-
|
|
27
|
-
`,11:`Invalid value passed as base to modularScale, expected number or em string but got "%s"
|
|
28
|
-
|
|
29
|
-
`,12:`Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.
|
|
30
|
-
|
|
31
|
-
`,13:`Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.
|
|
32
|
-
|
|
33
|
-
`,14:`Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.
|
|
34
|
-
|
|
35
|
-
`,15:`Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.
|
|
36
|
-
|
|
37
|
-
`,16:`You must provide a template to this method.
|
|
38
|
-
|
|
39
|
-
`,17:`You passed an unsupported selector state to this method.
|
|
40
|
-
|
|
41
|
-
`,18:`minScreen and maxScreen must be provided as stringified numbers with the same units.
|
|
42
|
-
|
|
43
|
-
`,19:`fromSize and toSize must be provided as stringified numbers with the same units.
|
|
44
|
-
|
|
45
|
-
`,20:`expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
|
|
46
|
-
|
|
47
|
-
`,21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:`fontFace expects a name of a font-family.
|
|
48
|
-
|
|
49
|
-
`,24:`fontFace expects either the path to the font file(s) or a name of a local copy.
|
|
50
|
-
|
|
51
|
-
`,25:`fontFace expects localFonts to be an array.
|
|
52
|
-
|
|
53
|
-
`,26:`fontFace expects fileFormats to be an array.
|
|
54
|
-
|
|
55
|
-
`,27:`radialGradient requries at least 2 color-stops to properly render.
|
|
56
|
-
|
|
57
|
-
`,28:`Please supply a filename to retinaImage() as the first argument.
|
|
58
|
-
|
|
59
|
-
`,29:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
|
|
60
|
-
|
|
61
|
-
`,30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation
|
|
62
|
-
|
|
63
|
-
`,32:`To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])
|
|
64
|
-
To pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')
|
|
65
|
-
|
|
66
|
-
`,33:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation
|
|
67
|
-
|
|
68
|
-
`,34:`borderRadius expects a radius value as a string or number as the second argument.
|
|
69
|
-
|
|
70
|
-
`,35:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
|
|
71
|
-
|
|
72
|
-
`,36:`Property must be a string value.
|
|
73
|
-
|
|
74
|
-
`,37:`Syntax Error at %s.
|
|
75
|
-
|
|
76
|
-
`,38:`Formula contains a function that needs parentheses at %s.
|
|
77
|
-
|
|
78
|
-
`,39:`Formula is missing closing parenthesis at %s.
|
|
79
|
-
|
|
80
|
-
`,40:`Formula has too many closing parentheses at %s.
|
|
81
|
-
|
|
82
|
-
`,41:`All values in a formula must have the same unit or be unitless.
|
|
83
|
-
|
|
84
|
-
`,42:`Please provide a number of steps to the modularScale helper.
|
|
85
|
-
|
|
86
|
-
`,43:`Please pass a number or one of the predefined scales to the modularScale helper as the ratio.
|
|
87
|
-
|
|
88
|
-
`,44:`Invalid value passed as base to modularScale, expected number or em/rem string but got %s.
|
|
89
|
-
|
|
90
|
-
`,45:`Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.
|
|
91
|
-
|
|
92
|
-
`,46:`Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.
|
|
93
|
-
|
|
94
|
-
`,47:`minScreen and maxScreen must be provided as stringified numbers with the same units.
|
|
95
|
-
|
|
96
|
-
`,48:`fromSize and toSize must be provided as stringified numbers with the same units.
|
|
97
|
-
|
|
98
|
-
`,49:`Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.
|
|
99
|
-
|
|
100
|
-
`,50:`Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.
|
|
101
|
-
|
|
102
|
-
`,51:`Expects the first argument object to have the properties prop, fromSize, and toSize.
|
|
103
|
-
|
|
104
|
-
`,52:`fontFace expects either the path to the font file(s) or a name of a local copy.
|
|
105
|
-
|
|
106
|
-
`,53:`fontFace expects localFonts to be an array.
|
|
107
|
-
|
|
108
|
-
`,54:`fontFace expects fileFormats to be an array.
|
|
109
|
-
|
|
110
|
-
`,55:`fontFace expects a name of a font-family.
|
|
111
|
-
|
|
112
|
-
`,56:`linearGradient requries at least 2 color-stops to properly render.
|
|
113
|
-
|
|
114
|
-
`,57:`radialGradient requries at least 2 color-stops to properly render.
|
|
115
|
-
|
|
116
|
-
`,58:`Please supply a filename to retinaImage() as the first argument.
|
|
117
|
-
|
|
118
|
-
`,59:`Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.
|
|
119
|
-
|
|
120
|
-
`,60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:`Property must be a string value.
|
|
121
|
-
|
|
122
|
-
`,62:`borderRadius expects a radius value as a string or number as the second argument.
|
|
123
|
-
|
|
124
|
-
`,63:`borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.
|
|
125
|
-
|
|
126
|
-
`,64:`The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.
|
|
127
|
-
|
|
128
|
-
`,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').
|
|
129
|
-
|
|
130
|
-
`,66:`The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.
|
|
131
|
-
|
|
132
|
-
`,67:`You must provide a template to this method.
|
|
133
|
-
|
|
134
|
-
`,68:`You passed an unsupported selector state to this method.
|
|
135
|
-
|
|
136
|
-
`,69:`Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.
|
|
137
|
-
|
|
138
|
-
`,70:`Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.
|
|
139
|
-
|
|
140
|
-
`,71:`Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.
|
|
141
|
-
|
|
142
|
-
`,72:`Passed invalid base value %s to %s(), please pass a value like "12px" or 12.
|
|
143
|
-
|
|
144
|
-
`,73:`Please provide a valid CSS variable.
|
|
145
|
-
|
|
146
|
-
`,74:`CSS variable not found and no default was provided.
|
|
147
|
-
|
|
148
|
-
`,75:`important requires a valid style object, got a %s instead.
|
|
149
|
-
|
|
150
|
-
`,76:`fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.
|
|
151
|
-
|
|
152
|
-
`,77:`remToPx expects a value in "rem" but you provided it in "%s".
|
|
153
|
-
|
|
154
|
-
`,78:`base must be set in "px" or "%" but you set it in "%s".
|
|
155
|
-
`};function format(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];var a=args[0],b=[],c;for(c=1;c<args.length;c+=1)b.push(args[c]);return b.forEach(function(d){a=a.replace(/%[a-z]/,d);}),a}var PolishedError=function(_Error){_inheritsLoose(PolishedError2,_Error);function PolishedError2(code){var _this;if(process.env.NODE_ENV==="production")_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;else {for(var _len2=arguments.length,args=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)args[_key2-1]=arguments[_key2];_this=_Error.call(this,format.apply(void 0,[ERRORS[code]].concat(args)))||this;}return _assertThisInitialized(_this)}return PolishedError2}(_wrapNativeSuper(Error));function colorToInt(color){return Math.round(color*255)}function convertToInt(red,green,blue){return colorToInt(red)+","+colorToInt(green)+","+colorToInt(blue)}function hslToRgb(hue,saturation,lightness,convert2){if(convert2===void 0&&(convert2=convertToInt),saturation===0)return convert2(lightness,lightness,lightness);var huePrime=(hue%360+360)%360/60,chroma=(1-Math.abs(2*lightness-1))*saturation,secondComponent=chroma*(1-Math.abs(huePrime%2-1)),red=0,green=0,blue=0;huePrime>=0&&huePrime<1?(red=chroma,green=secondComponent):huePrime>=1&&huePrime<2?(red=secondComponent,green=chroma):huePrime>=2&&huePrime<3?(green=chroma,blue=secondComponent):huePrime>=3&&huePrime<4?(green=secondComponent,blue=chroma):huePrime>=4&&huePrime<5?(red=secondComponent,blue=chroma):huePrime>=5&&huePrime<6&&(red=chroma,blue=secondComponent);var lightnessModification=lightness-chroma/2,finalRed=red+lightnessModification,finalGreen=green+lightnessModification,finalBlue=blue+lightnessModification;return convert2(finalRed,finalGreen,finalBlue)}var namedColorMap={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};function nameToHex(color){if(typeof color!="string")return color;var normalizedColorName=color.toLowerCase();return namedColorMap[normalizedColorName]?"#"+namedColorMap[normalizedColorName]:color}var hexRegex=/^#[a-fA-F0-9]{6}$/,hexRgbaRegex=/^#[a-fA-F0-9]{8}$/,reducedHexRegex=/^#[a-fA-F0-9]{3}$/,reducedRgbaHexRegex=/^#[a-fA-F0-9]{4}$/,rgbRegex=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,rgbaRegex=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,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,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;function parseToRgb(color){if(typeof color!="string")throw new PolishedError(3);var normalizedColor=nameToHex(color);if(normalizedColor.match(hexRegex))return {red:parseInt(""+normalizedColor[1]+normalizedColor[2],16),green:parseInt(""+normalizedColor[3]+normalizedColor[4],16),blue:parseInt(""+normalizedColor[5]+normalizedColor[6],16)};if(normalizedColor.match(hexRgbaRegex)){var alpha=parseFloat((parseInt(""+normalizedColor[7]+normalizedColor[8],16)/255).toFixed(2));return {red:parseInt(""+normalizedColor[1]+normalizedColor[2],16),green:parseInt(""+normalizedColor[3]+normalizedColor[4],16),blue:parseInt(""+normalizedColor[5]+normalizedColor[6],16),alpha}}if(normalizedColor.match(reducedHexRegex))return {red:parseInt(""+normalizedColor[1]+normalizedColor[1],16),green:parseInt(""+normalizedColor[2]+normalizedColor[2],16),blue:parseInt(""+normalizedColor[3]+normalizedColor[3],16)};if(normalizedColor.match(reducedRgbaHexRegex)){var _alpha=parseFloat((parseInt(""+normalizedColor[4]+normalizedColor[4],16)/255).toFixed(2));return {red:parseInt(""+normalizedColor[1]+normalizedColor[1],16),green:parseInt(""+normalizedColor[2]+normalizedColor[2],16),blue:parseInt(""+normalizedColor[3]+normalizedColor[3],16),alpha:_alpha}}var rgbMatched=rgbRegex.exec(normalizedColor);if(rgbMatched)return {red:parseInt(""+rgbMatched[1],10),green:parseInt(""+rgbMatched[2],10),blue:parseInt(""+rgbMatched[3],10)};var rgbaMatched=rgbaRegex.exec(normalizedColor.substring(0,50));if(rgbaMatched)return {red:parseInt(""+rgbaMatched[1],10),green:parseInt(""+rgbaMatched[2],10),blue:parseInt(""+rgbaMatched[3],10),alpha:parseFloat(""+rgbaMatched[4])>1?parseFloat(""+rgbaMatched[4])/100:parseFloat(""+rgbaMatched[4])};var hslMatched=hslRegex.exec(normalizedColor);if(hslMatched){var hue=parseInt(""+hslMatched[1],10),saturation=parseInt(""+hslMatched[2],10)/100,lightness=parseInt(""+hslMatched[3],10)/100,rgbColorString="rgb("+hslToRgb(hue,saturation,lightness)+")",hslRgbMatched=rgbRegex.exec(rgbColorString);if(!hslRgbMatched)throw new PolishedError(4,normalizedColor,rgbColorString);return {red:parseInt(""+hslRgbMatched[1],10),green:parseInt(""+hslRgbMatched[2],10),blue:parseInt(""+hslRgbMatched[3],10)}}var hslaMatched=hslaRegex.exec(normalizedColor.substring(0,50));if(hslaMatched){var _hue=parseInt(""+hslaMatched[1],10),_saturation=parseInt(""+hslaMatched[2],10)/100,_lightness=parseInt(""+hslaMatched[3],10)/100,_rgbColorString="rgb("+hslToRgb(_hue,_saturation,_lightness)+")",_hslRgbMatched=rgbRegex.exec(_rgbColorString);if(!_hslRgbMatched)throw new PolishedError(4,normalizedColor,_rgbColorString);return {red:parseInt(""+_hslRgbMatched[1],10),green:parseInt(""+_hslRgbMatched[2],10),blue:parseInt(""+_hslRgbMatched[3],10),alpha:parseFloat(""+hslaMatched[4])>1?parseFloat(""+hslaMatched[4])/100:parseFloat(""+hslaMatched[4])}}throw new PolishedError(5)}var reduceHexValue=function(value){return value.length===7&&value[1]===value[2]&&value[3]===value[4]&&value[5]===value[6]?"#"+value[1]+value[3]+value[5]:value},reduceHexValue$1=reduceHexValue;function numberToHex(value){var hex=value.toString(16);return hex.length===1?"0"+hex:hex}function rgb(value,green,blue){if(typeof value=="number"&&typeof green=="number"&&typeof blue=="number")return reduceHexValue$1("#"+numberToHex(value)+numberToHex(green)+numberToHex(blue));if(typeof value=="object"&&green===void 0&&blue===void 0)return reduceHexValue$1("#"+numberToHex(value.red)+numberToHex(value.green)+numberToHex(value.blue));throw new PolishedError(6)}function rgba(firstValue,secondValue,thirdValue,fourthValue){if(typeof firstValue=="string"&&typeof secondValue=="number"){var rgbValue=parseToRgb(firstValue);return "rgba("+rgbValue.red+","+rgbValue.green+","+rgbValue.blue+","+secondValue+")"}else {if(typeof firstValue=="number"&&typeof secondValue=="number"&&typeof thirdValue=="number"&&typeof fourthValue=="number")return fourthValue>=1?rgb(firstValue,secondValue,thirdValue):"rgba("+firstValue+","+secondValue+","+thirdValue+","+fourthValue+")";if(typeof firstValue=="object"&&secondValue===void 0&&thirdValue===void 0&&fourthValue===void 0)return firstValue.alpha>=1?rgb(firstValue.red,firstValue.green,firstValue.blue):"rgba("+firstValue.red+","+firstValue.green+","+firstValue.blue+","+firstValue.alpha+")"}throw new PolishedError(7)}function curried(f,length,acc){return function(){var combined=acc.concat(Array.prototype.slice.call(arguments));return combined.length>=length?f.apply(this,combined):curried(f,length,combined)}}function curry(f){return curried(f,f.length,[])}function guard(lowerBoundary,upperBoundary,value){return Math.max(lowerBoundary,Math.min(upperBoundary,value))}function transparentize(amount,color){if(color==="transparent")return color;var parsedColor=parseToRgb(color),alpha=typeof parsedColor.alpha=="number"?parsedColor.alpha:1,colorWithAlpha=_extends({},parsedColor,{alpha:guard(0,1,+(alpha*100-parseFloat(amount)*100).toFixed(2)/100)});return rgba(colorWithAlpha)}var curriedTransparentize=curry(transparentize),curriedTransparentize$1=curriedTransparentize;var Wrapper=styled.div(withReset,({theme})=>({backgroundColor:theme.base==="light"?"rgba(0,0,0,.01)":"rgba(255,255,255,.01)",borderRadius:theme.appBorderRadius,border:`1px dashed ${theme.appBorderColor}`,display:"flex",alignItems:"center",justifyContent:"center",padding:20,margin:"25px 0 40px",color:curriedTransparentize$1(.3,theme.color.defaultText),fontSize:theme.typography.size.s2})),EmptyBlock=props=>React2.createElement(Wrapper,{...props,className:"docblock-emptyblock sb-unstyled"});var StyledSyntaxHighlighter=styled(SyntaxHighlighter)(({theme})=>({fontSize:`${theme.typography.size.s2-1}px`,lineHeight:"19px",margin:"25px 0 40px",borderRadius:theme.appBorderRadius,boxShadow:theme.base==="light"?"rgba(0, 0, 0, 0.10) 0 1px 3px 0":"rgba(0, 0, 0, 0.20) 0 2px 5px 0","pre.prismjs":{padding:20,background:"inherit"}}));var SourceSkeletonWrapper=styled.div(({theme})=>({background:theme.background.content,borderRadius:theme.appBorderRadius,border:`1px solid ${theme.appBorderColor}`,boxShadow:theme.base==="light"?"rgba(0, 0, 0, 0.10) 0 1px 3px 0":"rgba(0, 0, 0, 0.20) 0 2px 5px 0",margin:"25px 0 40px",padding:"20px 20px 20px 22px"})),SourceSkeletonPlaceholder=styled.div(({theme})=>({animation:`${theme.animation.glow} 1.5s ease-in-out infinite`,background:theme.appBorderColor,height:17,marginTop:1,width:"60%",[`&:first-child${ignoreSsrWarning}`]:{margin:0}})),SourceSkeleton=()=>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%"}})),Source=({isLoading,error,language,code,dark,format:format2=!0,...rest})=>{let{typography}=useTheme();if(isLoading)return React2.createElement(SourceSkeleton,null);if(error)return React2.createElement(EmptyBlock,null,error);let syntaxHighlighter=React2.createElement(StyledSyntaxHighlighter,{bordered:!0,copyable:!0,format:format2,language,className:"docblock-source sb-unstyled",...rest},code);if(typeof dark>"u")return syntaxHighlighter;let overrideTheme=dark?themes.dark:themes.light;return React2.createElement(ThemeProvider,{theme:convert({...overrideTheme,fontCode:typography.fonts.mono,fontBase:typography.fonts.base})},syntaxHighlighter)};addons.register(ADDON_ID,api=>{addons.add(PANEL_ID,{title:"Code",type:types.PANEL,paramKey:PARAM_KEY,disabled:parameters=>!parameters?.docs?.codePanel,match:({viewMode})=>viewMode==="story",render:({active})=>{let lastEvent=api.getChannel()?.last(SNIPPET_RENDERED)?.[0],[codeSnippet,setSourceCode]=useState({source:lastEvent?.source??"",format:lastEvent?.format??void 0}),parameter=useParameter(PARAM_KEY,{source:{code:""},theme:"dark"});useChannel({[SNIPPET_RENDERED]:({source,format:format2})=>{setSourceCode({source,format:format2});}});let isDark=useTheme().base!=="light";return React2.createElement(AddonPanel,{active:!!active},React2.createElement(SourceStyles,null,React2.createElement(Source,{...parameter.source,code:parameter.source.code||codeSnippet.source,format:codeSnippet.format,dark:isDark})))}});});var SourceStyles=styled.div(()=>({height:"100%",[`> :first-child${ignoreSsrWarning}`]:{margin:0,height:"100%",boxShadow:"none"}}));
|