storybook 10.1.0-alpha.9 → 10.1.0-beta.1

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 (198) hide show
  1. package/dist/_browser-chunks/Color-FTG7SQDA.js +1097 -0
  2. package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
  3. package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
  4. package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
  5. package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
  6. package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
  7. package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
  8. package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
  9. package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
  10. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  11. package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
  12. package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
  13. package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
  14. package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
  15. package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
  16. package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
  17. package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
  18. package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
  19. package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
  20. package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
  21. package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
  22. package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
  23. package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
  24. package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
  25. package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
  26. package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
  27. package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
  28. package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
  29. package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
  30. package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
  31. package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
  32. package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
  33. package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
  34. package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
  35. package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
  36. package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
  37. package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
  38. package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
  39. package/dist/_node-chunks/{builder-manager-SM3UWERX.js → builder-manager-FTVC2JL7.js} +510 -1019
  40. package/dist/_node-chunks/camelcase-3SMT5WKC.js +37 -0
  41. package/dist/_node-chunks/chunk-2OVULPK3.js +54 -0
  42. package/dist/_node-chunks/chunk-3JJPSDXI.js +3043 -0
  43. package/dist/_node-chunks/chunk-54NMJ4II.js +1564 -0
  44. package/dist/_node-chunks/chunk-5V4A6MSI.js +943 -0
  45. package/dist/_node-chunks/chunk-6DEMT5VX.js +299 -0
  46. package/dist/_node-chunks/{chunk-HHSTA6QS.js → chunk-6L7FFBOW.js} +8 -10
  47. package/dist/_node-chunks/chunk-6ULDIDXV.js +46662 -0
  48. package/dist/_node-chunks/chunk-AREL5IXS.js +603 -0
  49. package/dist/_node-chunks/chunk-DWA53E73.js +23 -0
  50. package/dist/_node-chunks/chunk-FNYKBULZ.js +765 -0
  51. package/dist/_node-chunks/chunk-IUYZQKSX.js +70 -0
  52. package/dist/_node-chunks/{chunk-F6EFOEC7.js → chunk-K673CX4Q.js} +469 -983
  53. package/dist/_node-chunks/chunk-KJAFCNZ3.js +61 -0
  54. package/dist/_node-chunks/chunk-N3BJOOY5.js +78 -0
  55. package/dist/_node-chunks/{chunk-EBUEXRH5.js → chunk-O5FMCQHP.js} +116 -276
  56. package/dist/_node-chunks/chunk-RIKQZHV3.js +29 -0
  57. package/dist/_node-chunks/chunk-RURZIE3W.js +3780 -0
  58. package/dist/_node-chunks/chunk-RVII4SK6.js +919 -0
  59. package/dist/_node-chunks/chunk-S3PBHOVC.js +6024 -0
  60. package/dist/_node-chunks/chunk-SQSFX47N.js +61 -0
  61. package/dist/_node-chunks/{chunk-SGM3ZCCT.js → chunk-TURUTKVH.js} +292 -688
  62. package/dist/_node-chunks/chunk-VRICJPXY.js +72 -0
  63. package/dist/_node-chunks/chunk-WIWWMCEU.js +119 -0
  64. package/dist/_node-chunks/{chunk-ATDHMMIZ.js → chunk-XGNRK7QB.js} +15 -24
  65. package/dist/_node-chunks/chunk-Y2FOTPAE.js +4523 -0
  66. package/dist/_node-chunks/{chunk-GHIBZRKD.js → chunk-Y4UYN72K.js} +8133 -8887
  67. package/dist/_node-chunks/chunk-Z4BMBA5L.js +18 -0
  68. package/dist/_node-chunks/chunk-ZMCJS2GU.js +20 -0
  69. package/dist/_node-chunks/dist-TZLZ3T6L.js +121 -0
  70. package/dist/_node-chunks/globby-22GFCZQD.js +3452 -0
  71. package/dist/_node-chunks/lib-37NQ4ZIJ.js +366 -0
  72. package/dist/_node-chunks/mdx-N42X6CFJ-2TRB7OEH.js +14329 -0
  73. package/dist/_node-chunks/p-limit-UD7TYFDW.js +116 -0
  74. package/dist/actions/decorator.js +21 -42
  75. package/dist/actions/index.js +3 -3
  76. package/dist/babel/index.d.ts +671 -335
  77. package/dist/babel/index.js +10 -11
  78. package/dist/bin/core.js +602 -1549
  79. package/dist/bin/dispatcher.js +36 -36
  80. package/dist/bin/loader.js +24 -38
  81. package/dist/channels/index.js +98 -234
  82. package/dist/cli/index.d.ts +1479 -133
  83. package/dist/cli/index.js +30 -8540
  84. package/dist/client-logger/index.js +31 -61
  85. package/dist/common/index.d.ts +139 -62
  86. package/dist/common/index.js +66 -51
  87. package/dist/components/index.d.ts +575 -273
  88. package/dist/components/index.js +14863 -4313
  89. package/dist/core-events/index.js +2 -66
  90. package/dist/core-server/index.d.ts +3 -2
  91. package/dist/core-server/index.js +2911 -8519
  92. package/dist/core-server/presets/common-manager.css +2 -2
  93. package/dist/core-server/presets/common-manager.js +2521 -5233
  94. package/dist/core-server/presets/common-override-preset.js +31 -60
  95. package/dist/core-server/presets/common-preset.js +663 -962
  96. package/dist/csf/index.js +534 -1179
  97. package/dist/csf-tools/index.js +9 -9
  98. package/dist/docs-tools/index.js +6 -6
  99. package/dist/highlight/index.js +2 -2
  100. package/dist/instrumenter/index.js +199 -415
  101. package/dist/manager/globals-runtime.js +59044 -67141
  102. package/dist/manager/globals.js +2 -3
  103. package/dist/manager/manager-stores.d.ts +1 -0
  104. package/dist/manager/manager-stores.js +23 -0
  105. package/dist/manager/runtime.js +11569 -10953
  106. package/dist/manager-api/index.d.ts +1813 -2
  107. package/dist/manager-api/index.js +1348 -2401
  108. package/dist/manager-errors.d.ts +9 -0
  109. package/dist/manager-errors.js +3 -3
  110. package/dist/mocking-utils/index.d.ts +1126 -0
  111. package/dist/mocking-utils/index.js +1181 -0
  112. package/dist/node-logger/index.d.ts +192 -24
  113. package/dist/node-logger/index.js +23 -4471
  114. package/dist/preview/globals.js +2 -3
  115. package/dist/preview/runtime.js +10799 -22393
  116. package/dist/preview-api/index.d.ts +1 -1
  117. package/dist/preview-api/index.js +13 -13
  118. package/dist/preview-errors.d.ts +9 -0
  119. package/dist/preview-errors.js +4 -4
  120. package/dist/router/index.js +347 -899
  121. package/dist/server-errors.d.ts +34 -1
  122. package/dist/server-errors.js +17 -10
  123. package/dist/telemetry/index.d.ts +24 -3
  124. package/dist/telemetry/index.js +25 -24
  125. package/dist/test/index.js +6131 -11916
  126. package/dist/theming/create.d.ts +1 -0
  127. package/dist/theming/create.js +4 -4
  128. package/dist/theming/index.d.ts +3366 -2599
  129. package/dist/theming/index.js +501 -1091
  130. package/dist/types/index.d.ts +72 -8
  131. package/dist/types/index.js +27 -12
  132. package/dist/viewport/index.js +3 -3
  133. package/package.json +26 -17
  134. package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
  135. package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
  136. package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
  137. package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
  138. package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
  139. package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
  140. package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
  141. package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
  142. package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
  143. package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
  144. package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
  145. package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
  146. package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
  147. package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
  148. package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
  149. package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
  150. package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
  151. package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
  152. package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
  153. package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
  154. package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
  155. package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
  156. package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
  157. package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
  158. package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
  159. package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
  160. package/dist/_node-chunks/camelcase-H5QSGQLK.js +0 -18
  161. package/dist/_node-chunks/chunk-3THWHQOC.js +0 -61
  162. package/dist/_node-chunks/chunk-45YUOLTU.js +0 -69
  163. package/dist/_node-chunks/chunk-4QSNCPAU.js +0 -64656
  164. package/dist/_node-chunks/chunk-744PQSOU.js +0 -79
  165. package/dist/_node-chunks/chunk-74Z2U7QG.js +0 -1544
  166. package/dist/_node-chunks/chunk-7MB7TFPO.js +0 -1198
  167. package/dist/_node-chunks/chunk-A7GS4RFT.js +0 -697
  168. package/dist/_node-chunks/chunk-BIA3A5UM.js +0 -61
  169. package/dist/_node-chunks/chunk-C5G7CLWX.js +0 -1657
  170. package/dist/_node-chunks/chunk-DLFUKMYJ.js +0 -1531
  171. package/dist/_node-chunks/chunk-EMRGRXKT.js +0 -111
  172. package/dist/_node-chunks/chunk-EX46EHHY.js +0 -420
  173. package/dist/_node-chunks/chunk-F76QKNOJ.js +0 -304
  174. package/dist/_node-chunks/chunk-HDCRUTEF.js +0 -220
  175. package/dist/_node-chunks/chunk-HUYAOIPH.js +0 -90
  176. package/dist/_node-chunks/chunk-IBJZQZJC.js +0 -101
  177. package/dist/_node-chunks/chunk-KZN2RDDT.js +0 -6712
  178. package/dist/_node-chunks/chunk-LYUNFU3F.js +0 -4741
  179. package/dist/_node-chunks/chunk-N44SIS6K.js +0 -28
  180. package/dist/_node-chunks/chunk-NILZM6KR.js +0 -18
  181. package/dist/_node-chunks/chunk-PC4ZRP6W.js +0 -34
  182. package/dist/_node-chunks/chunk-TJNGOQUH.js +0 -4272
  183. package/dist/_node-chunks/chunk-UBSYLHIL.js +0 -1250
  184. package/dist/_node-chunks/chunk-UTCLXPOC.js +0 -1518
  185. package/dist/_node-chunks/chunk-WOXXODXP.js +0 -5029
  186. package/dist/_node-chunks/chunk-XC4MEUA6.js +0 -1586
  187. package/dist/_node-chunks/chunk-YRXXMKRR.js +0 -2256
  188. package/dist/_node-chunks/dist-SL73W244.js +0 -175
  189. package/dist/_node-chunks/globby-ZSHAUQZ5.js +0 -5222
  190. package/dist/_node-chunks/lib-U2VIPUTI.js +0 -518
  191. package/dist/_node-chunks/mdx-N42X6CFJ-ZLHD33JK.js +0 -22017
  192. package/dist/_node-chunks/p-limit-K5BS5MSV.js +0 -168
  193. package/dist/_node-chunks/plugin-5PD4YIUH.js +0 -129
  194. package/dist/_node-chunks/plugin-MONDT2WL.js +0 -159
  195. package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-EUZJRG3W.js +0 -69102
  196. package/dist/_node-chunks/webpack-mock-plugin-T4LDXEHE.js +0 -124
  197. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
  198. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
@@ -1,852 +0,0 @@
1
- import {
2
- _extends
3
- } from "./chunk-MH6AXFXB.js";
4
- import {
5
- __name
6
- } from "./chunk-MM7DTO55.js";
7
-
8
- // ../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
9
- function _assertThisInitialized(e) {
10
- if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
11
- return e;
12
- }
13
- __name(_assertThisInitialized, "_assertThisInitialized");
14
-
15
- // ../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
16
- function _setPrototypeOf(t, e) {
17
- return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t2, e2) {
18
- return t2.__proto__ = e2, t2;
19
- }, _setPrototypeOf(t, e);
20
- }
21
- __name(_setPrototypeOf, "_setPrototypeOf");
22
-
23
- // ../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
24
- function _inheritsLoose(t, o) {
25
- t.prototype = Object.create(o.prototype), t.prototype.constructor = t, _setPrototypeOf(t, o);
26
- }
27
- __name(_inheritsLoose, "_inheritsLoose");
28
-
29
- // ../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
30
- function _getPrototypeOf(t) {
31
- return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t2) {
32
- return t2.__proto__ || Object.getPrototypeOf(t2);
33
- }, _getPrototypeOf(t);
34
- }
35
- __name(_getPrototypeOf, "_getPrototypeOf");
36
-
37
- // ../node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
38
- function _isNativeFunction(t) {
39
- try {
40
- return -1 !== Function.toString.call(t).indexOf("[native code]");
41
- } catch (n) {
42
- return "function" == typeof t;
43
- }
44
- }
45
- __name(_isNativeFunction, "_isNativeFunction");
46
-
47
- // ../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
48
- function _isNativeReflectConstruct() {
49
- try {
50
- var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
51
- }));
52
- } catch (t2) {
53
- }
54
- return (_isNativeReflectConstruct = /* @__PURE__ */ __name(function _isNativeReflectConstruct2() {
55
- return !!t;
56
- }, "_isNativeReflectConstruct"))();
57
- }
58
- __name(_isNativeReflectConstruct, "_isNativeReflectConstruct");
59
-
60
- // ../node_modules/@babel/runtime/helpers/esm/construct.js
61
- function _construct(t, e, r) {
62
- if (_isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
63
- var o = [null];
64
- o.push.apply(o, e);
65
- var p = new (t.bind.apply(t, o))();
66
- return r && _setPrototypeOf(p, r.prototype), p;
67
- }
68
- __name(_construct, "_construct");
69
-
70
- // ../node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
71
- function _wrapNativeSuper(t) {
72
- var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
73
- return _wrapNativeSuper = /* @__PURE__ */ __name(function _wrapNativeSuper2(t2) {
74
- if (null === t2 || !_isNativeFunction(t2)) return t2;
75
- if ("function" != typeof t2) throw new TypeError("Super expression must either be null or a function");
76
- if (void 0 !== r) {
77
- if (r.has(t2)) return r.get(t2);
78
- r.set(t2, Wrapper);
79
- }
80
- function Wrapper() {
81
- return _construct(t2, arguments, _getPrototypeOf(this).constructor);
82
- }
83
- __name(Wrapper, "Wrapper");
84
- return Wrapper.prototype = Object.create(t2.prototype, {
85
- constructor: {
86
- value: Wrapper,
87
- enumerable: false,
88
- writable: true,
89
- configurable: true
90
- }
91
- }), _setPrototypeOf(Wrapper, t2);
92
- }, "_wrapNativeSuper"), _wrapNativeSuper(t);
93
- }
94
- __name(_wrapNativeSuper, "_wrapNativeSuper");
95
-
96
- // ../node_modules/polished/dist/polished.esm.js
97
- var ERRORS = {
98
- "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",
99
- "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",
100
- "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
101
- "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
102
- "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
103
- "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",
104
- "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",
105
- "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
106
- "9": "Please provide a number of steps to the modularScale helper.\n\n",
107
- "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
108
- "11": 'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',
109
- "12": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',
110
- "13": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',
111
- "14": 'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
112
- "15": 'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',
113
- "16": "You must provide a template to this method.\n\n",
114
- "17": "You passed an unsupported selector state to this method.\n\n",
115
- "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
116
- "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
117
- "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
118
- "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
119
- "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
120
- "23": "fontFace expects a name of a font-family.\n\n",
121
- "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
122
- "25": "fontFace expects localFonts to be an array.\n\n",
123
- "26": "fontFace expects fileFormats to be an array.\n\n",
124
- "27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
125
- "28": "Please supply a filename to retinaImage() as the first argument.\n\n",
126
- "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
127
- "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
128
- "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
129
- "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",
130
- "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
131
- "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
132
- "35": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
133
- "36": "Property must be a string value.\n\n",
134
- "37": "Syntax Error at %s.\n\n",
135
- "38": "Formula contains a function that needs parentheses at %s.\n\n",
136
- "39": "Formula is missing closing parenthesis at %s.\n\n",
137
- "40": "Formula has too many closing parentheses at %s.\n\n",
138
- "41": "All values in a formula must have the same unit or be unitless.\n\n",
139
- "42": "Please provide a number of steps to the modularScale helper.\n\n",
140
- "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
141
- "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
142
- "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
143
- "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
144
- "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
145
- "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
146
- "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
147
- "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
148
- "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
149
- "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
150
- "53": "fontFace expects localFonts to be an array.\n\n",
151
- "54": "fontFace expects fileFormats to be an array.\n\n",
152
- "55": "fontFace expects a name of a font-family.\n\n",
153
- "56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
154
- "57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
155
- "58": "Please supply a filename to retinaImage() as the first argument.\n\n",
156
- "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
157
- "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
158
- "61": "Property must be a string value.\n\n",
159
- "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
160
- "63": 'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',
161
- "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
162
- "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",
163
- "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
164
- "67": "You must provide a template to this method.\n\n",
165
- "68": "You passed an unsupported selector state to this method.\n\n",
166
- "69": 'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',
167
- "70": 'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',
168
- "71": 'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',
169
- "72": 'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',
170
- "73": "Please provide a valid CSS variable.\n\n",
171
- "74": "CSS variable not found and no default was provided.\n\n",
172
- "75": "important requires a valid style object, got a %s instead.\n\n",
173
- "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
174
- "77": 'remToPx expects a value in "rem" but you provided it in "%s".\n\n',
175
- "78": 'base must be set in "px" or "%" but you set it in "%s".\n'
176
- };
177
- function format() {
178
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
179
- args[_key] = arguments[_key];
180
- }
181
- var a = args[0];
182
- var b = [];
183
- var c;
184
- for (c = 1; c < args.length; c += 1) {
185
- b.push(args[c]);
186
- }
187
- b.forEach(function(d) {
188
- a = a.replace(/%[a-z]/, d);
189
- });
190
- return a;
191
- }
192
- __name(format, "format");
193
- var PolishedError = function(_Error) {
194
- _inheritsLoose(PolishedError2, _Error);
195
- function PolishedError2(code) {
196
- var _this;
197
- if (process.env.NODE_ENV === "production") {
198
- _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;
199
- } else {
200
- for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
201
- args[_key2 - 1] = arguments[_key2];
202
- }
203
- _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
204
- }
205
- return _assertThisInitialized(_this);
206
- }
207
- __name(PolishedError2, "PolishedError");
208
- return PolishedError2;
209
- }(_wrapNativeSuper(Error));
210
- function endsWith(string, suffix) {
211
- return string.substr(-suffix.length) === suffix;
212
- }
213
- __name(endsWith, "endsWith");
214
- var cssRegex$1 = /^([+-]?(?:\d+|\d*\.\d+))([a-z]*|%)$/;
215
- function stripUnit(value) {
216
- if (typeof value !== "string") return value;
217
- var matchedValue = value.match(cssRegex$1);
218
- return matchedValue ? parseFloat(value) : value;
219
- }
220
- __name(stripUnit, "stripUnit");
221
- var pxtoFactory = /* @__PURE__ */ __name(function pxtoFactory2(to) {
222
- return function(pxval, base) {
223
- if (base === void 0) {
224
- base = "16px";
225
- }
226
- var newPxval = pxval;
227
- var newBase = base;
228
- if (typeof pxval === "string") {
229
- if (!endsWith(pxval, "px")) {
230
- throw new PolishedError(69, to, pxval);
231
- }
232
- newPxval = stripUnit(pxval);
233
- }
234
- if (typeof base === "string") {
235
- if (!endsWith(base, "px")) {
236
- throw new PolishedError(70, to, base);
237
- }
238
- newBase = stripUnit(base);
239
- }
240
- if (typeof newPxval === "string") {
241
- throw new PolishedError(71, pxval, to);
242
- }
243
- if (typeof newBase === "string") {
244
- throw new PolishedError(72, base, to);
245
- }
246
- return "" + newPxval / newBase + to;
247
- };
248
- }, "pxtoFactory");
249
- var pixelsto = pxtoFactory;
250
- var em = pixelsto("em");
251
- var rem = pixelsto("rem");
252
- function colorToInt(color) {
253
- return Math.round(color * 255);
254
- }
255
- __name(colorToInt, "colorToInt");
256
- function convertToInt(red, green, blue) {
257
- return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
258
- }
259
- __name(convertToInt, "convertToInt");
260
- function hslToRgb(hue, saturation, lightness, convert) {
261
- if (convert === void 0) {
262
- convert = convertToInt;
263
- }
264
- if (saturation === 0) {
265
- return convert(lightness, lightness, lightness);
266
- }
267
- var huePrime = (hue % 360 + 360) % 360 / 60;
268
- var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
269
- var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
270
- var red = 0;
271
- var green = 0;
272
- var blue = 0;
273
- if (huePrime >= 0 && huePrime < 1) {
274
- red = chroma;
275
- green = secondComponent;
276
- } else if (huePrime >= 1 && huePrime < 2) {
277
- red = secondComponent;
278
- green = chroma;
279
- } else if (huePrime >= 2 && huePrime < 3) {
280
- green = chroma;
281
- blue = secondComponent;
282
- } else if (huePrime >= 3 && huePrime < 4) {
283
- green = secondComponent;
284
- blue = chroma;
285
- } else if (huePrime >= 4 && huePrime < 5) {
286
- red = secondComponent;
287
- blue = chroma;
288
- } else if (huePrime >= 5 && huePrime < 6) {
289
- red = chroma;
290
- blue = secondComponent;
291
- }
292
- var lightnessModification = lightness - chroma / 2;
293
- var finalRed = red + lightnessModification;
294
- var finalGreen = green + lightnessModification;
295
- var finalBlue = blue + lightnessModification;
296
- return convert(finalRed, finalGreen, finalBlue);
297
- }
298
- __name(hslToRgb, "hslToRgb");
299
- var namedColorMap = {
300
- aliceblue: "f0f8ff",
301
- antiquewhite: "faebd7",
302
- aqua: "00ffff",
303
- aquamarine: "7fffd4",
304
- azure: "f0ffff",
305
- beige: "f5f5dc",
306
- bisque: "ffe4c4",
307
- black: "000",
308
- blanchedalmond: "ffebcd",
309
- blue: "0000ff",
310
- blueviolet: "8a2be2",
311
- brown: "a52a2a",
312
- burlywood: "deb887",
313
- cadetblue: "5f9ea0",
314
- chartreuse: "7fff00",
315
- chocolate: "d2691e",
316
- coral: "ff7f50",
317
- cornflowerblue: "6495ed",
318
- cornsilk: "fff8dc",
319
- crimson: "dc143c",
320
- cyan: "00ffff",
321
- darkblue: "00008b",
322
- darkcyan: "008b8b",
323
- darkgoldenrod: "b8860b",
324
- darkgray: "a9a9a9",
325
- darkgreen: "006400",
326
- darkgrey: "a9a9a9",
327
- darkkhaki: "bdb76b",
328
- darkmagenta: "8b008b",
329
- darkolivegreen: "556b2f",
330
- darkorange: "ff8c00",
331
- darkorchid: "9932cc",
332
- darkred: "8b0000",
333
- darksalmon: "e9967a",
334
- darkseagreen: "8fbc8f",
335
- darkslateblue: "483d8b",
336
- darkslategray: "2f4f4f",
337
- darkslategrey: "2f4f4f",
338
- darkturquoise: "00ced1",
339
- darkviolet: "9400d3",
340
- deeppink: "ff1493",
341
- deepskyblue: "00bfff",
342
- dimgray: "696969",
343
- dimgrey: "696969",
344
- dodgerblue: "1e90ff",
345
- firebrick: "b22222",
346
- floralwhite: "fffaf0",
347
- forestgreen: "228b22",
348
- fuchsia: "ff00ff",
349
- gainsboro: "dcdcdc",
350
- ghostwhite: "f8f8ff",
351
- gold: "ffd700",
352
- goldenrod: "daa520",
353
- gray: "808080",
354
- green: "008000",
355
- greenyellow: "adff2f",
356
- grey: "808080",
357
- honeydew: "f0fff0",
358
- hotpink: "ff69b4",
359
- indianred: "cd5c5c",
360
- indigo: "4b0082",
361
- ivory: "fffff0",
362
- khaki: "f0e68c",
363
- lavender: "e6e6fa",
364
- lavenderblush: "fff0f5",
365
- lawngreen: "7cfc00",
366
- lemonchiffon: "fffacd",
367
- lightblue: "add8e6",
368
- lightcoral: "f08080",
369
- lightcyan: "e0ffff",
370
- lightgoldenrodyellow: "fafad2",
371
- lightgray: "d3d3d3",
372
- lightgreen: "90ee90",
373
- lightgrey: "d3d3d3",
374
- lightpink: "ffb6c1",
375
- lightsalmon: "ffa07a",
376
- lightseagreen: "20b2aa",
377
- lightskyblue: "87cefa",
378
- lightslategray: "789",
379
- lightslategrey: "789",
380
- lightsteelblue: "b0c4de",
381
- lightyellow: "ffffe0",
382
- lime: "0f0",
383
- limegreen: "32cd32",
384
- linen: "faf0e6",
385
- magenta: "f0f",
386
- maroon: "800000",
387
- mediumaquamarine: "66cdaa",
388
- mediumblue: "0000cd",
389
- mediumorchid: "ba55d3",
390
- mediumpurple: "9370db",
391
- mediumseagreen: "3cb371",
392
- mediumslateblue: "7b68ee",
393
- mediumspringgreen: "00fa9a",
394
- mediumturquoise: "48d1cc",
395
- mediumvioletred: "c71585",
396
- midnightblue: "191970",
397
- mintcream: "f5fffa",
398
- mistyrose: "ffe4e1",
399
- moccasin: "ffe4b5",
400
- navajowhite: "ffdead",
401
- navy: "000080",
402
- oldlace: "fdf5e6",
403
- olive: "808000",
404
- olivedrab: "6b8e23",
405
- orange: "ffa500",
406
- orangered: "ff4500",
407
- orchid: "da70d6",
408
- palegoldenrod: "eee8aa",
409
- palegreen: "98fb98",
410
- paleturquoise: "afeeee",
411
- palevioletred: "db7093",
412
- papayawhip: "ffefd5",
413
- peachpuff: "ffdab9",
414
- peru: "cd853f",
415
- pink: "ffc0cb",
416
- plum: "dda0dd",
417
- powderblue: "b0e0e6",
418
- purple: "800080",
419
- rebeccapurple: "639",
420
- red: "f00",
421
- rosybrown: "bc8f8f",
422
- royalblue: "4169e1",
423
- saddlebrown: "8b4513",
424
- salmon: "fa8072",
425
- sandybrown: "f4a460",
426
- seagreen: "2e8b57",
427
- seashell: "fff5ee",
428
- sienna: "a0522d",
429
- silver: "c0c0c0",
430
- skyblue: "87ceeb",
431
- slateblue: "6a5acd",
432
- slategray: "708090",
433
- slategrey: "708090",
434
- snow: "fffafa",
435
- springgreen: "00ff7f",
436
- steelblue: "4682b4",
437
- tan: "d2b48c",
438
- teal: "008080",
439
- thistle: "d8bfd8",
440
- tomato: "ff6347",
441
- turquoise: "40e0d0",
442
- violet: "ee82ee",
443
- wheat: "f5deb3",
444
- white: "fff",
445
- whitesmoke: "f5f5f5",
446
- yellow: "ff0",
447
- yellowgreen: "9acd32"
448
- };
449
- function nameToHex(color) {
450
- if (typeof color !== "string") return color;
451
- var normalizedColorName = color.toLowerCase();
452
- return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
453
- }
454
- __name(nameToHex, "nameToHex");
455
- var hexRegex = /^#[a-fA-F0-9]{6}$/;
456
- var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
457
- var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
458
- var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
459
- var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i;
460
- var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
461
- 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;
462
- 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;
463
- function parseToRgb(color) {
464
- if (typeof color !== "string") {
465
- throw new PolishedError(3);
466
- }
467
- var normalizedColor = nameToHex(color);
468
- if (normalizedColor.match(hexRegex)) {
469
- return {
470
- red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
471
- green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
472
- blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
473
- };
474
- }
475
- if (normalizedColor.match(hexRgbaRegex)) {
476
- var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
477
- return {
478
- red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
479
- green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
480
- blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
481
- alpha
482
- };
483
- }
484
- if (normalizedColor.match(reducedHexRegex)) {
485
- return {
486
- red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
487
- green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
488
- blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
489
- };
490
- }
491
- if (normalizedColor.match(reducedRgbaHexRegex)) {
492
- var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
493
- return {
494
- red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
495
- green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
496
- blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
497
- alpha: _alpha
498
- };
499
- }
500
- var rgbMatched = rgbRegex.exec(normalizedColor);
501
- if (rgbMatched) {
502
- return {
503
- red: parseInt("" + rgbMatched[1], 10),
504
- green: parseInt("" + rgbMatched[2], 10),
505
- blue: parseInt("" + rgbMatched[3], 10)
506
- };
507
- }
508
- var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
509
- if (rgbaMatched) {
510
- return {
511
- red: parseInt("" + rgbaMatched[1], 10),
512
- green: parseInt("" + rgbaMatched[2], 10),
513
- blue: parseInt("" + rgbaMatched[3], 10),
514
- alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
515
- };
516
- }
517
- var hslMatched = hslRegex.exec(normalizedColor);
518
- if (hslMatched) {
519
- var hue = parseInt("" + hslMatched[1], 10);
520
- var saturation = parseInt("" + hslMatched[2], 10) / 100;
521
- var lightness = parseInt("" + hslMatched[3], 10) / 100;
522
- var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
523
- var hslRgbMatched = rgbRegex.exec(rgbColorString);
524
- if (!hslRgbMatched) {
525
- throw new PolishedError(4, normalizedColor, rgbColorString);
526
- }
527
- return {
528
- red: parseInt("" + hslRgbMatched[1], 10),
529
- green: parseInt("" + hslRgbMatched[2], 10),
530
- blue: parseInt("" + hslRgbMatched[3], 10)
531
- };
532
- }
533
- var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
534
- if (hslaMatched) {
535
- var _hue = parseInt("" + hslaMatched[1], 10);
536
- var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
537
- var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
538
- var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
539
- var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
540
- if (!_hslRgbMatched) {
541
- throw new PolishedError(4, normalizedColor, _rgbColorString);
542
- }
543
- return {
544
- red: parseInt("" + _hslRgbMatched[1], 10),
545
- green: parseInt("" + _hslRgbMatched[2], 10),
546
- blue: parseInt("" + _hslRgbMatched[3], 10),
547
- alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
548
- };
549
- }
550
- throw new PolishedError(5);
551
- }
552
- __name(parseToRgb, "parseToRgb");
553
- function rgbToHsl(color) {
554
- var red = color.red / 255;
555
- var green = color.green / 255;
556
- var blue = color.blue / 255;
557
- var max = Math.max(red, green, blue);
558
- var min = Math.min(red, green, blue);
559
- var lightness = (max + min) / 2;
560
- if (max === min) {
561
- if (color.alpha !== void 0) {
562
- return {
563
- hue: 0,
564
- saturation: 0,
565
- lightness,
566
- alpha: color.alpha
567
- };
568
- } else {
569
- return {
570
- hue: 0,
571
- saturation: 0,
572
- lightness
573
- };
574
- }
575
- }
576
- var hue;
577
- var delta = max - min;
578
- var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
579
- switch (max) {
580
- case red:
581
- hue = (green - blue) / delta + (green < blue ? 6 : 0);
582
- break;
583
- case green:
584
- hue = (blue - red) / delta + 2;
585
- break;
586
- default:
587
- hue = (red - green) / delta + 4;
588
- break;
589
- }
590
- hue *= 60;
591
- if (color.alpha !== void 0) {
592
- return {
593
- hue,
594
- saturation,
595
- lightness,
596
- alpha: color.alpha
597
- };
598
- }
599
- return {
600
- hue,
601
- saturation,
602
- lightness
603
- };
604
- }
605
- __name(rgbToHsl, "rgbToHsl");
606
- function parseToHsl(color) {
607
- return rgbToHsl(parseToRgb(color));
608
- }
609
- __name(parseToHsl, "parseToHsl");
610
- var reduceHexValue = /* @__PURE__ */ __name(function reduceHexValue2(value) {
611
- if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
612
- return "#" + value[1] + value[3] + value[5];
613
- }
614
- return value;
615
- }, "reduceHexValue");
616
- var reduceHexValue$1 = reduceHexValue;
617
- function numberToHex(value) {
618
- var hex = value.toString(16);
619
- return hex.length === 1 ? "0" + hex : hex;
620
- }
621
- __name(numberToHex, "numberToHex");
622
- function colorToHex(color) {
623
- return numberToHex(Math.round(color * 255));
624
- }
625
- __name(colorToHex, "colorToHex");
626
- function convertToHex(red, green, blue) {
627
- return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
628
- }
629
- __name(convertToHex, "convertToHex");
630
- function hslToHex(hue, saturation, lightness) {
631
- return hslToRgb(hue, saturation, lightness, convertToHex);
632
- }
633
- __name(hslToHex, "hslToHex");
634
- function hsl(value, saturation, lightness) {
635
- if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number") {
636
- return hslToHex(value, saturation, lightness);
637
- } else if (typeof value === "object" && saturation === void 0 && lightness === void 0) {
638
- return hslToHex(value.hue, value.saturation, value.lightness);
639
- }
640
- throw new PolishedError(1);
641
- }
642
- __name(hsl, "hsl");
643
- function hsla(value, saturation, lightness, alpha) {
644
- if (typeof value === "number" && typeof saturation === "number" && typeof lightness === "number" && typeof alpha === "number") {
645
- return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
646
- } else if (typeof value === "object" && saturation === void 0 && lightness === void 0 && alpha === void 0) {
647
- return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
648
- }
649
- throw new PolishedError(2);
650
- }
651
- __name(hsla, "hsla");
652
- function rgb(value, green, blue) {
653
- if (typeof value === "number" && typeof green === "number" && typeof blue === "number") {
654
- return reduceHexValue$1("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
655
- } else if (typeof value === "object" && green === void 0 && blue === void 0) {
656
- return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
657
- }
658
- throw new PolishedError(6);
659
- }
660
- __name(rgb, "rgb");
661
- function rgba(firstValue, secondValue, thirdValue, fourthValue) {
662
- if (typeof firstValue === "string" && typeof secondValue === "number") {
663
- var rgbValue = parseToRgb(firstValue);
664
- return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
665
- } else if (typeof firstValue === "number" && typeof secondValue === "number" && typeof thirdValue === "number" && typeof fourthValue === "number") {
666
- return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
667
- } else if (typeof firstValue === "object" && secondValue === void 0 && thirdValue === void 0 && fourthValue === void 0) {
668
- return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
669
- }
670
- throw new PolishedError(7);
671
- }
672
- __name(rgba, "rgba");
673
- var isRgb = /* @__PURE__ */ __name(function isRgb2(color) {
674
- return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined");
675
- }, "isRgb");
676
- var isRgba = /* @__PURE__ */ __name(function isRgba2(color) {
677
- return typeof color.red === "number" && typeof color.green === "number" && typeof color.blue === "number" && typeof color.alpha === "number";
678
- }, "isRgba");
679
- var isHsl = /* @__PURE__ */ __name(function isHsl2(color) {
680
- return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && (typeof color.alpha !== "number" || typeof color.alpha === "undefined");
681
- }, "isHsl");
682
- var isHsla = /* @__PURE__ */ __name(function isHsla2(color) {
683
- return typeof color.hue === "number" && typeof color.saturation === "number" && typeof color.lightness === "number" && typeof color.alpha === "number";
684
- }, "isHsla");
685
- function toColorString(color) {
686
- if (typeof color !== "object") throw new PolishedError(8);
687
- if (isRgba(color)) return rgba(color);
688
- if (isRgb(color)) return rgb(color);
689
- if (isHsla(color)) return hsla(color);
690
- if (isHsl(color)) return hsl(color);
691
- throw new PolishedError(8);
692
- }
693
- __name(toColorString, "toColorString");
694
- function curried(f, length, acc) {
695
- return /* @__PURE__ */ __name(function fn() {
696
- var combined = acc.concat(Array.prototype.slice.call(arguments));
697
- return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
698
- }, "fn");
699
- }
700
- __name(curried, "curried");
701
- function curry(f) {
702
- return curried(f, f.length, []);
703
- }
704
- __name(curry, "curry");
705
- function adjustHue(degree, color) {
706
- if (color === "transparent") return color;
707
- var hslColor = parseToHsl(color);
708
- return toColorString(_extends({}, hslColor, {
709
- hue: hslColor.hue + parseFloat(degree)
710
- }));
711
- }
712
- __name(adjustHue, "adjustHue");
713
- var curriedAdjustHue = curry(adjustHue);
714
- function guard(lowerBoundary, upperBoundary, value) {
715
- return Math.max(lowerBoundary, Math.min(upperBoundary, value));
716
- }
717
- __name(guard, "guard");
718
- function darken(amount, color) {
719
- if (color === "transparent") return color;
720
- var hslColor = parseToHsl(color);
721
- return toColorString(_extends({}, hslColor, {
722
- lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
723
- }));
724
- }
725
- __name(darken, "darken");
726
- var curriedDarken = curry(darken);
727
- var curriedDarken$1 = curriedDarken;
728
- function desaturate(amount, color) {
729
- if (color === "transparent") return color;
730
- var hslColor = parseToHsl(color);
731
- return toColorString(_extends({}, hslColor, {
732
- saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
733
- }));
734
- }
735
- __name(desaturate, "desaturate");
736
- var curriedDesaturate = curry(desaturate);
737
- function lighten(amount, color) {
738
- if (color === "transparent") return color;
739
- var hslColor = parseToHsl(color);
740
- return toColorString(_extends({}, hslColor, {
741
- lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
742
- }));
743
- }
744
- __name(lighten, "lighten");
745
- var curriedLighten = curry(lighten);
746
- var curriedLighten$1 = curriedLighten;
747
- function mix(weight, color, otherColor) {
748
- if (color === "transparent") return otherColor;
749
- if (otherColor === "transparent") return color;
750
- if (weight === 0) return otherColor;
751
- var parsedColor1 = parseToRgb(color);
752
- var color1 = _extends({}, parsedColor1, {
753
- alpha: typeof parsedColor1.alpha === "number" ? parsedColor1.alpha : 1
754
- });
755
- var parsedColor2 = parseToRgb(otherColor);
756
- var color2 = _extends({}, parsedColor2, {
757
- alpha: typeof parsedColor2.alpha === "number" ? parsedColor2.alpha : 1
758
- });
759
- var alphaDelta = color1.alpha - color2.alpha;
760
- var x = parseFloat(weight) * 2 - 1;
761
- var y = x * alphaDelta === -1 ? x : x + alphaDelta;
762
- var z = 1 + x * alphaDelta;
763
- var weight1 = (y / z + 1) / 2;
764
- var weight2 = 1 - weight1;
765
- var mixedColor = {
766
- red: Math.floor(color1.red * weight1 + color2.red * weight2),
767
- green: Math.floor(color1.green * weight1 + color2.green * weight2),
768
- blue: Math.floor(color1.blue * weight1 + color2.blue * weight2),
769
- alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
770
- };
771
- return rgba(mixedColor);
772
- }
773
- __name(mix, "mix");
774
- var curriedMix = curry(mix);
775
- var mix$1 = curriedMix;
776
- function opacify(amount, color) {
777
- if (color === "transparent") return color;
778
- var parsedColor = parseToRgb(color);
779
- var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
780
- var colorWithAlpha = _extends({}, parsedColor, {
781
- alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
782
- });
783
- return rgba(colorWithAlpha);
784
- }
785
- __name(opacify, "opacify");
786
- var curriedOpacify = curry(opacify);
787
- var curriedOpacify$1 = curriedOpacify;
788
- function saturate(amount, color) {
789
- if (color === "transparent") return color;
790
- var hslColor = parseToHsl(color);
791
- return toColorString(_extends({}, hslColor, {
792
- saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
793
- }));
794
- }
795
- __name(saturate, "saturate");
796
- var curriedSaturate = curry(saturate);
797
- function setHue(hue, color) {
798
- if (color === "transparent") return color;
799
- return toColorString(_extends({}, parseToHsl(color), {
800
- hue: parseFloat(hue)
801
- }));
802
- }
803
- __name(setHue, "setHue");
804
- var curriedSetHue = curry(setHue);
805
- function setLightness(lightness, color) {
806
- if (color === "transparent") return color;
807
- return toColorString(_extends({}, parseToHsl(color), {
808
- lightness: parseFloat(lightness)
809
- }));
810
- }
811
- __name(setLightness, "setLightness");
812
- var curriedSetLightness = curry(setLightness);
813
- function setSaturation(saturation, color) {
814
- if (color === "transparent") return color;
815
- return toColorString(_extends({}, parseToHsl(color), {
816
- saturation: parseFloat(saturation)
817
- }));
818
- }
819
- __name(setSaturation, "setSaturation");
820
- var curriedSetSaturation = curry(setSaturation);
821
- function shade(percentage, color) {
822
- if (color === "transparent") return color;
823
- return mix$1(parseFloat(percentage), "rgb(0, 0, 0)", color);
824
- }
825
- __name(shade, "shade");
826
- var curriedShade = curry(shade);
827
- function tint(percentage, color) {
828
- if (color === "transparent") return color;
829
- return mix$1(parseFloat(percentage), "rgb(255, 255, 255)", color);
830
- }
831
- __name(tint, "tint");
832
- var curriedTint = curry(tint);
833
- function transparentize(amount, color) {
834
- if (color === "transparent") return color;
835
- var parsedColor = parseToRgb(color);
836
- var alpha = typeof parsedColor.alpha === "number" ? parsedColor.alpha : 1;
837
- var colorWithAlpha = _extends({}, parsedColor, {
838
- alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
839
- });
840
- return rgba(colorWithAlpha);
841
- }
842
- __name(transparentize, "transparentize");
843
- var curriedTransparentize = curry(transparentize);
844
- var curriedTransparentize$1 = curriedTransparentize;
845
-
846
- export {
847
- rgba,
848
- curriedDarken$1,
849
- curriedLighten$1,
850
- curriedOpacify$1,
851
- curriedTransparentize$1
852
- };