@asgardex/asgardex-theme 0.1.2

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.
@@ -0,0 +1,1239 @@
1
+ /******************************************************************************
2
+ Copyright (c) Microsoft Corporation.
3
+
4
+ Permission to use, copy, modify, and/or distribute this software for any
5
+ purpose with or without fee is hereby granted.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
+ PERFORMANCE OF THIS SOFTWARE.
14
+ ***************************************************************************** */
15
+
16
+ var __assign = function() {
17
+ __assign = Object.assign || function __assign(t) {
18
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
19
+ s = arguments[i];
20
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
21
+ }
22
+ return t;
23
+ };
24
+ return __assign.apply(this, arguments);
25
+ };
26
+
27
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
28
+ var e = new Error(message);
29
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
30
+ };
31
+
32
+ function _extends() {
33
+ _extends = Object.assign || function (target) {
34
+ for (var i = 1; i < arguments.length; i++) {
35
+ var source = arguments[i];
36
+
37
+ for (var key in source) {
38
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
39
+ target[key] = source[key];
40
+ }
41
+ }
42
+ }
43
+
44
+ return target;
45
+ };
46
+
47
+ return _extends.apply(this, arguments);
48
+ }
49
+
50
+ function _assertThisInitialized(self) {
51
+ if (self === void 0) {
52
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
53
+ }
54
+
55
+ return self;
56
+ }
57
+
58
+ function _inheritsLoose(subClass, superClass) {
59
+ subClass.prototype = Object.create(superClass.prototype);
60
+ subClass.prototype.constructor = subClass;
61
+ subClass.__proto__ = superClass;
62
+ }
63
+
64
+ function _getPrototypeOf(o) {
65
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
66
+ return o.__proto__ || Object.getPrototypeOf(o);
67
+ };
68
+ return _getPrototypeOf(o);
69
+ }
70
+
71
+ function _setPrototypeOf(o, p) {
72
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
73
+ o.__proto__ = p;
74
+ return o;
75
+ };
76
+
77
+ return _setPrototypeOf(o, p);
78
+ }
79
+
80
+ function _isNativeFunction(fn) {
81
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
82
+ }
83
+
84
+ function _isNativeReflectConstruct() {
85
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
86
+ if (Reflect.construct.sham) return false;
87
+ if (typeof Proxy === "function") return true;
88
+
89
+ try {
90
+ Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
91
+ return true;
92
+ } catch (e) {
93
+ return false;
94
+ }
95
+ }
96
+
97
+ function _construct(Parent, args, Class) {
98
+ if (_isNativeReflectConstruct()) {
99
+ _construct = Reflect.construct;
100
+ } else {
101
+ _construct = function _construct(Parent, args, Class) {
102
+ var a = [null];
103
+ a.push.apply(a, args);
104
+ var Constructor = Function.bind.apply(Parent, a);
105
+ var instance = new Constructor();
106
+ if (Class) _setPrototypeOf(instance, Class.prototype);
107
+ return instance;
108
+ };
109
+ }
110
+
111
+ return _construct.apply(null, arguments);
112
+ }
113
+
114
+ function _wrapNativeSuper(Class) {
115
+ var _cache = typeof Map === "function" ? new Map() : undefined;
116
+
117
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
118
+ if (Class === null || !_isNativeFunction(Class)) return Class;
119
+
120
+ if (typeof Class !== "function") {
121
+ throw new TypeError("Super expression must either be null or a function");
122
+ }
123
+
124
+ if (typeof _cache !== "undefined") {
125
+ if (_cache.has(Class)) return _cache.get(Class);
126
+
127
+ _cache.set(Class, Wrapper);
128
+ }
129
+
130
+ function Wrapper() {
131
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
132
+ }
133
+
134
+ Wrapper.prototype = Object.create(Class.prototype, {
135
+ constructor: {
136
+ value: Wrapper,
137
+ enumerable: false,
138
+ writable: true,
139
+ configurable: true
140
+ }
141
+ });
142
+ return _setPrototypeOf(Wrapper, Class);
143
+ };
144
+
145
+ return _wrapNativeSuper(Class);
146
+ }
147
+
148
+ // based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
149
+
150
+ /**
151
+ * Parse errors.md and turn it into a simple hash of code: message
152
+ * @private
153
+ */
154
+ var ERRORS = {
155
+ "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",
156
+ "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",
157
+ "3": "Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",
158
+ "4": "Couldn't generate valid rgb string from %s, it returned %s.\n\n",
159
+ "5": "Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",
160
+ "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",
161
+ "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",
162
+ "8": "Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",
163
+ "9": "Please provide a number of steps to the modularScale helper.\n\n",
164
+ "10": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
165
+ "11": "Invalid value passed as base to modularScale, expected number or em string but got \"%s\"\n\n",
166
+ "12": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got \"%s\" instead.\n\n",
167
+ "13": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got \"%s\" instead.\n\n",
168
+ "14": "Passed invalid pixel value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
169
+ "15": "Passed invalid base value (\"%s\") to %s(), please pass a value like \"12px\" or 12.\n\n",
170
+ "16": "You must provide a template to this method.\n\n",
171
+ "17": "You passed an unsupported selector state to this method.\n\n",
172
+ "18": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
173
+ "19": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
174
+ "20": "expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
175
+ "21": "expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
176
+ "22": "expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",
177
+ "23": "fontFace expects a name of a font-family.\n\n",
178
+ "24": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
179
+ "25": "fontFace expects localFonts to be an array.\n\n",
180
+ "26": "fontFace expects fileFormats to be an array.\n\n",
181
+ "27": "radialGradient requries at least 2 color-stops to properly render.\n\n",
182
+ "28": "Please supply a filename to retinaImage() as the first argument.\n\n",
183
+ "29": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
184
+ "30": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
185
+ "31": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",
186
+ "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",
187
+ "33": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",
188
+ "34": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
189
+ "35": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
190
+ "36": "Property must be a string value.\n\n",
191
+ "37": "Syntax Error at %s.\n\n",
192
+ "38": "Formula contains a function that needs parentheses at %s.\n\n",
193
+ "39": "Formula is missing closing parenthesis at %s.\n\n",
194
+ "40": "Formula has too many closing parentheses at %s.\n\n",
195
+ "41": "All values in a formula must have the same unit or be unitless.\n\n",
196
+ "42": "Please provide a number of steps to the modularScale helper.\n\n",
197
+ "43": "Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",
198
+ "44": "Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",
199
+ "45": "Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",
200
+ "46": "Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",
201
+ "47": "minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",
202
+ "48": "fromSize and toSize must be provided as stringified numbers with the same units.\n\n",
203
+ "49": "Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",
204
+ "50": "Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",
205
+ "51": "Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",
206
+ "52": "fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",
207
+ "53": "fontFace expects localFonts to be an array.\n\n",
208
+ "54": "fontFace expects fileFormats to be an array.\n\n",
209
+ "55": "fontFace expects a name of a font-family.\n\n",
210
+ "56": "linearGradient requries at least 2 color-stops to properly render.\n\n",
211
+ "57": "radialGradient requries at least 2 color-stops to properly render.\n\n",
212
+ "58": "Please supply a filename to retinaImage() as the first argument.\n\n",
213
+ "59": "Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",
214
+ "60": "Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",
215
+ "61": "Property must be a string value.\n\n",
216
+ "62": "borderRadius expects a radius value as a string or number as the second argument.\n\n",
217
+ "63": "borderRadius expects one of \"top\", \"bottom\", \"left\" or \"right\" as the first argument.\n\n",
218
+ "64": "The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",
219
+ "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",
220
+ "66": "The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",
221
+ "67": "You must provide a template to this method.\n\n",
222
+ "68": "You passed an unsupported selector state to this method.\n\n",
223
+ "69": "Expected a string ending in \"px\" or a number passed as the first argument to %s(), got %s instead.\n\n",
224
+ "70": "Expected a string ending in \"px\" or a number passed as the second argument to %s(), got %s instead.\n\n",
225
+ "71": "Passed invalid pixel value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
226
+ "72": "Passed invalid base value %s to %s(), please pass a value like \"12px\" or 12.\n\n",
227
+ "73": "Please provide a valid CSS variable.\n\n",
228
+ "74": "CSS variable not found.\n"
229
+ };
230
+ /**
231
+ * super basic version of sprintf
232
+ * @private
233
+ */
234
+
235
+ function format() {
236
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
237
+ args[_key] = arguments[_key];
238
+ }
239
+
240
+ var a = args[0];
241
+ var b = [];
242
+ var c;
243
+
244
+ for (c = 1; c < args.length; c += 1) {
245
+ b.push(args[c]);
246
+ }
247
+
248
+ b.forEach(function (d) {
249
+ a = a.replace(/%[a-z]/, d);
250
+ });
251
+ return a;
252
+ }
253
+ /**
254
+ * Create an error file out of errors.md for development and a simple web link to the full errors
255
+ * in production mode.
256
+ * @private
257
+ */
258
+
259
+
260
+ var PolishedError = /*#__PURE__*/function (_Error) {
261
+ _inheritsLoose(PolishedError, _Error);
262
+
263
+ function PolishedError(code) {
264
+ var _this;
265
+
266
+ if (process.env.NODE_ENV === 'production') {
267
+ _this = _Error.call(this, "An error occurred. See https://github.com/styled-components/polished/blob/master/src/internalHelpers/errors.md#" + code + " for more information.") || this;
268
+ } else {
269
+ for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
270
+ args[_key2 - 1] = arguments[_key2];
271
+ }
272
+
273
+ _this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
274
+ }
275
+
276
+ return _assertThisInitialized(_this);
277
+ }
278
+
279
+ return PolishedError;
280
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
281
+
282
+ function colorToInt(color) {
283
+ return Math.round(color * 255);
284
+ }
285
+
286
+ function convertToInt(red, green, blue) {
287
+ return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
288
+ }
289
+
290
+ function hslToRgb(hue, saturation, lightness, convert) {
291
+ if (convert === void 0) {
292
+ convert = convertToInt;
293
+ }
294
+
295
+ if (saturation === 0) {
296
+ // achromatic
297
+ return convert(lightness, lightness, lightness);
298
+ } // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
299
+
300
+
301
+ var huePrime = (hue % 360 + 360) % 360 / 60;
302
+ var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
303
+ var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
304
+ var red = 0;
305
+ var green = 0;
306
+ var blue = 0;
307
+
308
+ if (huePrime >= 0 && huePrime < 1) {
309
+ red = chroma;
310
+ green = secondComponent;
311
+ } else if (huePrime >= 1 && huePrime < 2) {
312
+ red = secondComponent;
313
+ green = chroma;
314
+ } else if (huePrime >= 2 && huePrime < 3) {
315
+ green = chroma;
316
+ blue = secondComponent;
317
+ } else if (huePrime >= 3 && huePrime < 4) {
318
+ green = secondComponent;
319
+ blue = chroma;
320
+ } else if (huePrime >= 4 && huePrime < 5) {
321
+ red = secondComponent;
322
+ blue = chroma;
323
+ } else if (huePrime >= 5 && huePrime < 6) {
324
+ red = chroma;
325
+ blue = secondComponent;
326
+ }
327
+
328
+ var lightnessModification = lightness - chroma / 2;
329
+ var finalRed = red + lightnessModification;
330
+ var finalGreen = green + lightnessModification;
331
+ var finalBlue = blue + lightnessModification;
332
+ return convert(finalRed, finalGreen, finalBlue);
333
+ }
334
+
335
+ var namedColorMap = {
336
+ aliceblue: 'f0f8ff',
337
+ antiquewhite: 'faebd7',
338
+ aqua: '00ffff',
339
+ aquamarine: '7fffd4',
340
+ azure: 'f0ffff',
341
+ beige: 'f5f5dc',
342
+ bisque: 'ffe4c4',
343
+ black: '000',
344
+ blanchedalmond: 'ffebcd',
345
+ blue: '0000ff',
346
+ blueviolet: '8a2be2',
347
+ brown: 'a52a2a',
348
+ burlywood: 'deb887',
349
+ cadetblue: '5f9ea0',
350
+ chartreuse: '7fff00',
351
+ chocolate: 'd2691e',
352
+ coral: 'ff7f50',
353
+ cornflowerblue: '6495ed',
354
+ cornsilk: 'fff8dc',
355
+ crimson: 'dc143c',
356
+ cyan: '00ffff',
357
+ darkblue: '00008b',
358
+ darkcyan: '008b8b',
359
+ darkgoldenrod: 'b8860b',
360
+ darkgray: 'a9a9a9',
361
+ darkgreen: '006400',
362
+ darkgrey: 'a9a9a9',
363
+ darkkhaki: 'bdb76b',
364
+ darkmagenta: '8b008b',
365
+ darkolivegreen: '556b2f',
366
+ darkorange: 'ff8c00',
367
+ darkorchid: '9932cc',
368
+ darkred: '8b0000',
369
+ darksalmon: 'e9967a',
370
+ darkseagreen: '8fbc8f',
371
+ darkslateblue: '483d8b',
372
+ darkslategray: '2f4f4f',
373
+ darkslategrey: '2f4f4f',
374
+ darkturquoise: '00ced1',
375
+ darkviolet: '9400d3',
376
+ deeppink: 'ff1493',
377
+ deepskyblue: '00bfff',
378
+ dimgray: '696969',
379
+ dimgrey: '696969',
380
+ dodgerblue: '1e90ff',
381
+ firebrick: 'b22222',
382
+ floralwhite: 'fffaf0',
383
+ forestgreen: '228b22',
384
+ fuchsia: 'ff00ff',
385
+ gainsboro: 'dcdcdc',
386
+ ghostwhite: 'f8f8ff',
387
+ gold: 'ffd700',
388
+ goldenrod: 'daa520',
389
+ gray: '808080',
390
+ green: '008000',
391
+ greenyellow: 'adff2f',
392
+ grey: '808080',
393
+ honeydew: 'f0fff0',
394
+ hotpink: 'ff69b4',
395
+ indianred: 'cd5c5c',
396
+ indigo: '4b0082',
397
+ ivory: 'fffff0',
398
+ khaki: 'f0e68c',
399
+ lavender: 'e6e6fa',
400
+ lavenderblush: 'fff0f5',
401
+ lawngreen: '7cfc00',
402
+ lemonchiffon: 'fffacd',
403
+ lightblue: 'add8e6',
404
+ lightcoral: 'f08080',
405
+ lightcyan: 'e0ffff',
406
+ lightgoldenrodyellow: 'fafad2',
407
+ lightgray: 'd3d3d3',
408
+ lightgreen: '90ee90',
409
+ lightgrey: 'd3d3d3',
410
+ lightpink: 'ffb6c1',
411
+ lightsalmon: 'ffa07a',
412
+ lightseagreen: '20b2aa',
413
+ lightskyblue: '87cefa',
414
+ lightslategray: '789',
415
+ lightslategrey: '789',
416
+ lightsteelblue: 'b0c4de',
417
+ lightyellow: 'ffffe0',
418
+ lime: '0f0',
419
+ limegreen: '32cd32',
420
+ linen: 'faf0e6',
421
+ magenta: 'f0f',
422
+ maroon: '800000',
423
+ mediumaquamarine: '66cdaa',
424
+ mediumblue: '0000cd',
425
+ mediumorchid: 'ba55d3',
426
+ mediumpurple: '9370db',
427
+ mediumseagreen: '3cb371',
428
+ mediumslateblue: '7b68ee',
429
+ mediumspringgreen: '00fa9a',
430
+ mediumturquoise: '48d1cc',
431
+ mediumvioletred: 'c71585',
432
+ midnightblue: '191970',
433
+ mintcream: 'f5fffa',
434
+ mistyrose: 'ffe4e1',
435
+ moccasin: 'ffe4b5',
436
+ navajowhite: 'ffdead',
437
+ navy: '000080',
438
+ oldlace: 'fdf5e6',
439
+ olive: '808000',
440
+ olivedrab: '6b8e23',
441
+ orange: 'ffa500',
442
+ orangered: 'ff4500',
443
+ orchid: 'da70d6',
444
+ palegoldenrod: 'eee8aa',
445
+ palegreen: '98fb98',
446
+ paleturquoise: 'afeeee',
447
+ palevioletred: 'db7093',
448
+ papayawhip: 'ffefd5',
449
+ peachpuff: 'ffdab9',
450
+ peru: 'cd853f',
451
+ pink: 'ffc0cb',
452
+ plum: 'dda0dd',
453
+ powderblue: 'b0e0e6',
454
+ purple: '800080',
455
+ rebeccapurple: '639',
456
+ red: 'f00',
457
+ rosybrown: 'bc8f8f',
458
+ royalblue: '4169e1',
459
+ saddlebrown: '8b4513',
460
+ salmon: 'fa8072',
461
+ sandybrown: 'f4a460',
462
+ seagreen: '2e8b57',
463
+ seashell: 'fff5ee',
464
+ sienna: 'a0522d',
465
+ silver: 'c0c0c0',
466
+ skyblue: '87ceeb',
467
+ slateblue: '6a5acd',
468
+ slategray: '708090',
469
+ slategrey: '708090',
470
+ snow: 'fffafa',
471
+ springgreen: '00ff7f',
472
+ steelblue: '4682b4',
473
+ tan: 'd2b48c',
474
+ teal: '008080',
475
+ thistle: 'd8bfd8',
476
+ tomato: 'ff6347',
477
+ turquoise: '40e0d0',
478
+ violet: 'ee82ee',
479
+ wheat: 'f5deb3',
480
+ white: 'fff',
481
+ whitesmoke: 'f5f5f5',
482
+ yellow: 'ff0',
483
+ yellowgreen: '9acd32'
484
+ };
485
+ /**
486
+ * Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
487
+ * @private
488
+ */
489
+
490
+ function nameToHex(color) {
491
+ if (typeof color !== 'string') return color;
492
+ var normalizedColorName = color.toLowerCase();
493
+ return namedColorMap[normalizedColorName] ? "#" + namedColorMap[normalizedColorName] : color;
494
+ }
495
+
496
+ var hexRegex = /^#[a-fA-F0-9]{6}$/;
497
+ var hexRgbaRegex = /^#[a-fA-F0-9]{8}$/;
498
+ var reducedHexRegex = /^#[a-fA-F0-9]{3}$/;
499
+ var reducedRgbaHexRegex = /^#[a-fA-F0-9]{4}$/;
500
+ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i;
501
+ var rgbaRegex = /^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
502
+ var hslRegex = /^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i;
503
+ var hslaRegex = /^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*(\d{1,3}[.]?[0-9]?)%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;
504
+ /**
505
+ * Returns an RgbColor or RgbaColor object. This utility function is only useful
506
+ * if want to extract a color component. With the color util `toColorString` you
507
+ * can convert a RgbColor or RgbaColor object back to a string.
508
+ *
509
+ * @example
510
+ * // Assigns `{ red: 255, green: 0, blue: 0 }` to color1
511
+ * const color1 = parseToRgb('rgb(255, 0, 0)');
512
+ * // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
513
+ * const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
514
+ */
515
+
516
+ function parseToRgb(color) {
517
+ if (typeof color !== 'string') {
518
+ throw new PolishedError(3);
519
+ }
520
+
521
+ var normalizedColor = nameToHex(color);
522
+
523
+ if (normalizedColor.match(hexRegex)) {
524
+ return {
525
+ red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
526
+ green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
527
+ blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
528
+ };
529
+ }
530
+
531
+ if (normalizedColor.match(hexRgbaRegex)) {
532
+ var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
533
+ return {
534
+ red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
535
+ green: parseInt("" + normalizedColor[3] + normalizedColor[4], 16),
536
+ blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16),
537
+ alpha: alpha
538
+ };
539
+ }
540
+
541
+ if (normalizedColor.match(reducedHexRegex)) {
542
+ return {
543
+ red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
544
+ green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
545
+ blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
546
+ };
547
+ }
548
+
549
+ if (normalizedColor.match(reducedRgbaHexRegex)) {
550
+ var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
551
+
552
+ return {
553
+ red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
554
+ green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
555
+ blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16),
556
+ alpha: _alpha
557
+ };
558
+ }
559
+
560
+ var rgbMatched = rgbRegex.exec(normalizedColor);
561
+
562
+ if (rgbMatched) {
563
+ return {
564
+ red: parseInt("" + rgbMatched[1], 10),
565
+ green: parseInt("" + rgbMatched[2], 10),
566
+ blue: parseInt("" + rgbMatched[3], 10)
567
+ };
568
+ }
569
+
570
+ var rgbaMatched = rgbaRegex.exec(normalizedColor);
571
+
572
+ if (rgbaMatched) {
573
+ return {
574
+ red: parseInt("" + rgbaMatched[1], 10),
575
+ green: parseInt("" + rgbaMatched[2], 10),
576
+ blue: parseInt("" + rgbaMatched[3], 10),
577
+ alpha: parseFloat("" + rgbaMatched[4])
578
+ };
579
+ }
580
+
581
+ var hslMatched = hslRegex.exec(normalizedColor);
582
+
583
+ if (hslMatched) {
584
+ var hue = parseInt("" + hslMatched[1], 10);
585
+ var saturation = parseInt("" + hslMatched[2], 10) / 100;
586
+ var lightness = parseInt("" + hslMatched[3], 10) / 100;
587
+ var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
588
+ var hslRgbMatched = rgbRegex.exec(rgbColorString);
589
+
590
+ if (!hslRgbMatched) {
591
+ throw new PolishedError(4, normalizedColor, rgbColorString);
592
+ }
593
+
594
+ return {
595
+ red: parseInt("" + hslRgbMatched[1], 10),
596
+ green: parseInt("" + hslRgbMatched[2], 10),
597
+ blue: parseInt("" + hslRgbMatched[3], 10)
598
+ };
599
+ }
600
+
601
+ var hslaMatched = hslaRegex.exec(normalizedColor);
602
+
603
+ if (hslaMatched) {
604
+ var _hue = parseInt("" + hslaMatched[1], 10);
605
+
606
+ var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
607
+
608
+ var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
609
+
610
+ var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
611
+
612
+ var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
613
+
614
+ if (!_hslRgbMatched) {
615
+ throw new PolishedError(4, normalizedColor, _rgbColorString);
616
+ }
617
+
618
+ return {
619
+ red: parseInt("" + _hslRgbMatched[1], 10),
620
+ green: parseInt("" + _hslRgbMatched[2], 10),
621
+ blue: parseInt("" + _hslRgbMatched[3], 10),
622
+ alpha: parseFloat("" + hslaMatched[4])
623
+ };
624
+ }
625
+
626
+ throw new PolishedError(5);
627
+ }
628
+
629
+ function rgbToHsl(color) {
630
+ // make sure rgb are contained in a set of [0, 255]
631
+ var red = color.red / 255;
632
+ var green = color.green / 255;
633
+ var blue = color.blue / 255;
634
+ var max = Math.max(red, green, blue);
635
+ var min = Math.min(red, green, blue);
636
+ var lightness = (max + min) / 2;
637
+
638
+ if (max === min) {
639
+ // achromatic
640
+ if (color.alpha !== undefined) {
641
+ return {
642
+ hue: 0,
643
+ saturation: 0,
644
+ lightness: lightness,
645
+ alpha: color.alpha
646
+ };
647
+ } else {
648
+ return {
649
+ hue: 0,
650
+ saturation: 0,
651
+ lightness: lightness
652
+ };
653
+ }
654
+ }
655
+
656
+ var hue;
657
+ var delta = max - min;
658
+ var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
659
+
660
+ switch (max) {
661
+ case red:
662
+ hue = (green - blue) / delta + (green < blue ? 6 : 0);
663
+ break;
664
+
665
+ case green:
666
+ hue = (blue - red) / delta + 2;
667
+ break;
668
+
669
+ default:
670
+ // blue case
671
+ hue = (red - green) / delta + 4;
672
+ break;
673
+ }
674
+
675
+ hue *= 60;
676
+
677
+ if (color.alpha !== undefined) {
678
+ return {
679
+ hue: hue,
680
+ saturation: saturation,
681
+ lightness: lightness,
682
+ alpha: color.alpha
683
+ };
684
+ }
685
+
686
+ return {
687
+ hue: hue,
688
+ saturation: saturation,
689
+ lightness: lightness
690
+ };
691
+ }
692
+
693
+ /**
694
+ * Returns an HslColor or HslaColor object. This utility function is only useful
695
+ * if want to extract a color component. With the color util `toColorString` you
696
+ * can convert a HslColor or HslaColor object back to a string.
697
+ *
698
+ * @example
699
+ * // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1
700
+ * const color1 = parseToHsl('rgb(255, 0, 0)');
701
+ * // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2
702
+ * const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)');
703
+ */
704
+ function parseToHsl(color) {
705
+ // Note: At a later stage we can optimize this function as right now a hsl
706
+ // color would be parsed converted to rgb values and converted back to hsl.
707
+ return rgbToHsl(parseToRgb(color));
708
+ }
709
+
710
+ /**
711
+ * Reduces hex values if possible e.g. #ff8866 to #f86
712
+ * @private
713
+ */
714
+ var reduceHexValue = function reduceHexValue(value) {
715
+ if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
716
+ return "#" + value[1] + value[3] + value[5];
717
+ }
718
+
719
+ return value;
720
+ };
721
+
722
+ function numberToHex(value) {
723
+ var hex = value.toString(16);
724
+ return hex.length === 1 ? "0" + hex : hex;
725
+ }
726
+
727
+ function colorToHex(color) {
728
+ return numberToHex(Math.round(color * 255));
729
+ }
730
+
731
+ function convertToHex(red, green, blue) {
732
+ return reduceHexValue("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
733
+ }
734
+
735
+ function hslToHex(hue, saturation, lightness) {
736
+ return hslToRgb(hue, saturation, lightness, convertToHex);
737
+ }
738
+
739
+ /**
740
+ * Returns a string value for the color. The returned result is the smallest possible hex notation.
741
+ *
742
+ * @example
743
+ * // Styles as object usage
744
+ * const styles = {
745
+ * background: hsl(359, 0.75, 0.4),
746
+ * background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }),
747
+ * }
748
+ *
749
+ * // styled-components usage
750
+ * const div = styled.div`
751
+ * background: ${hsl(359, 0.75, 0.4)};
752
+ * background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })};
753
+ * `
754
+ *
755
+ * // CSS in JS Output
756
+ *
757
+ * element {
758
+ * background: "#b3191c";
759
+ * background: "#b3191c";
760
+ * }
761
+ */
762
+ function hsl(value, saturation, lightness) {
763
+ if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
764
+ return hslToHex(value, saturation, lightness);
765
+ } else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
766
+ return hslToHex(value.hue, value.saturation, value.lightness);
767
+ }
768
+
769
+ throw new PolishedError(1);
770
+ }
771
+
772
+ /**
773
+ * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
774
+ *
775
+ * @example
776
+ * // Styles as object usage
777
+ * const styles = {
778
+ * background: hsla(359, 0.75, 0.4, 0.7),
779
+ * background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }),
780
+ * background: hsla(359, 0.75, 0.4, 1),
781
+ * }
782
+ *
783
+ * // styled-components usage
784
+ * const div = styled.div`
785
+ * background: ${hsla(359, 0.75, 0.4, 0.7)};
786
+ * background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })};
787
+ * background: ${hsla(359, 0.75, 0.4, 1)};
788
+ * `
789
+ *
790
+ * // CSS in JS Output
791
+ *
792
+ * element {
793
+ * background: "rgba(179,25,28,0.7)";
794
+ * background: "rgba(179,25,28,0.7)";
795
+ * background: "#b3191c";
796
+ * }
797
+ */
798
+ function hsla(value, saturation, lightness, alpha) {
799
+ if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
800
+ return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
801
+ } else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
802
+ return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
803
+ }
804
+
805
+ throw new PolishedError(2);
806
+ }
807
+
808
+ /**
809
+ * Returns a string value for the color. The returned result is the smallest possible hex notation.
810
+ *
811
+ * @example
812
+ * // Styles as object usage
813
+ * const styles = {
814
+ * background: rgb(255, 205, 100),
815
+ * background: rgb({ red: 255, green: 205, blue: 100 }),
816
+ * }
817
+ *
818
+ * // styled-components usage
819
+ * const div = styled.div`
820
+ * background: ${rgb(255, 205, 100)};
821
+ * background: ${rgb({ red: 255, green: 205, blue: 100 })};
822
+ * `
823
+ *
824
+ * // CSS in JS Output
825
+ *
826
+ * element {
827
+ * background: "#ffcd64";
828
+ * background: "#ffcd64";
829
+ * }
830
+ */
831
+ function rgb(value, green, blue) {
832
+ if (typeof value === 'number' && typeof green === 'number' && typeof blue === 'number') {
833
+ return reduceHexValue("#" + numberToHex(value) + numberToHex(green) + numberToHex(blue));
834
+ } else if (typeof value === 'object' && green === undefined && blue === undefined) {
835
+ return reduceHexValue("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
836
+ }
837
+
838
+ throw new PolishedError(6);
839
+ }
840
+
841
+ /**
842
+ * Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
843
+ *
844
+ * Can also be used to fade a color by passing a hex value or named CSS color along with an alpha value.
845
+ *
846
+ * @example
847
+ * // Styles as object usage
848
+ * const styles = {
849
+ * background: rgba(255, 205, 100, 0.7),
850
+ * background: rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 }),
851
+ * background: rgba(255, 205, 100, 1),
852
+ * background: rgba('#ffffff', 0.4),
853
+ * background: rgba('black', 0.7),
854
+ * }
855
+ *
856
+ * // styled-components usage
857
+ * const div = styled.div`
858
+ * background: ${rgba(255, 205, 100, 0.7)};
859
+ * background: ${rgba({ red: 255, green: 205, blue: 100, alpha: 0.7 })};
860
+ * background: ${rgba(255, 205, 100, 1)};
861
+ * background: ${rgba('#ffffff', 0.4)};
862
+ * background: ${rgba('black', 0.7)};
863
+ * `
864
+ *
865
+ * // CSS in JS Output
866
+ *
867
+ * element {
868
+ * background: "rgba(255,205,100,0.7)";
869
+ * background: "rgba(255,205,100,0.7)";
870
+ * background: "#ffcd64";
871
+ * background: "rgba(255,255,255,0.4)";
872
+ * background: "rgba(0,0,0,0.7)";
873
+ * }
874
+ */
875
+ function rgba(firstValue, secondValue, thirdValue, fourthValue) {
876
+ if (typeof firstValue === 'string' && typeof secondValue === 'number') {
877
+ var rgbValue = parseToRgb(firstValue);
878
+ return "rgba(" + rgbValue.red + "," + rgbValue.green + "," + rgbValue.blue + "," + secondValue + ")";
879
+ } else if (typeof firstValue === 'number' && typeof secondValue === 'number' && typeof thirdValue === 'number' && typeof fourthValue === 'number') {
880
+ return fourthValue >= 1 ? rgb(firstValue, secondValue, thirdValue) : "rgba(" + firstValue + "," + secondValue + "," + thirdValue + "," + fourthValue + ")";
881
+ } else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
882
+ return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
883
+ }
884
+
885
+ throw new PolishedError(7);
886
+ }
887
+
888
+ var isRgb = function isRgb(color) {
889
+ return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
890
+ };
891
+
892
+ var isRgba = function isRgba(color) {
893
+ return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
894
+ };
895
+
896
+ var isHsl = function isHsl(color) {
897
+ return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
898
+ };
899
+
900
+ var isHsla = function isHsla(color) {
901
+ return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
902
+ };
903
+ /**
904
+ * Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string.
905
+ * This util is useful in case you only know on runtime which color object is
906
+ * used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`.
907
+ *
908
+ * @example
909
+ * // Styles as object usage
910
+ * const styles = {
911
+ * background: toColorString({ red: 255, green: 205, blue: 100 }),
912
+ * background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }),
913
+ * background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }),
914
+ * background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }),
915
+ * }
916
+ *
917
+ * // styled-components usage
918
+ * const div = styled.div`
919
+ * background: ${toColorString({ red: 255, green: 205, blue: 100 })};
920
+ * background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })};
921
+ * background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })};
922
+ * background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })};
923
+ * `
924
+ *
925
+ * // CSS in JS Output
926
+ * element {
927
+ * background: "#ffcd64";
928
+ * background: "rgba(255,205,100,0.72)";
929
+ * background: "#00f";
930
+ * background: "rgba(179,25,25,0.72)";
931
+ * }
932
+ */
933
+
934
+
935
+ function toColorString(color) {
936
+ if (typeof color !== 'object') throw new PolishedError(8);
937
+ if (isRgba(color)) return rgba(color);
938
+ if (isRgb(color)) return rgb(color);
939
+ if (isHsla(color)) return hsla(color);
940
+ if (isHsl(color)) return hsl(color);
941
+ throw new PolishedError(8);
942
+ }
943
+
944
+ // Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
945
+ // eslint-disable-next-line no-unused-vars
946
+ // eslint-disable-next-line no-unused-vars
947
+ // eslint-disable-next-line no-redeclare
948
+ function curried(f, length, acc) {
949
+ return function fn() {
950
+ // eslint-disable-next-line prefer-rest-params
951
+ var combined = acc.concat(Array.prototype.slice.call(arguments));
952
+ return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
953
+ };
954
+ } // eslint-disable-next-line no-redeclare
955
+
956
+
957
+ function curry(f) {
958
+ // eslint-disable-line no-redeclare
959
+ return curried(f, f.length, []);
960
+ }
961
+
962
+ function guard(lowerBoundary, upperBoundary, value) {
963
+ return Math.max(lowerBoundary, Math.min(upperBoundary, value));
964
+ }
965
+
966
+ /**
967
+ * Returns a string value for the darkened color.
968
+ *
969
+ * @example
970
+ * // Styles as object usage
971
+ * const styles = {
972
+ * background: darken(0.2, '#FFCD64'),
973
+ * background: darken('0.2', 'rgba(255,205,100,0.7)'),
974
+ * }
975
+ *
976
+ * // styled-components usage
977
+ * const div = styled.div`
978
+ * background: ${darken(0.2, '#FFCD64')};
979
+ * background: ${darken('0.2', 'rgba(255,205,100,0.7)')};
980
+ * `
981
+ *
982
+ * // CSS in JS Output
983
+ *
984
+ * element {
985
+ * background: "#ffbd31";
986
+ * background: "rgba(255,189,49,0.7)";
987
+ * }
988
+ */
989
+
990
+ function darken(amount, color) {
991
+ if (color === 'transparent') return color;
992
+ var hslColor = parseToHsl(color);
993
+ return toColorString(_extends({}, hslColor, {
994
+ lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
995
+ }));
996
+ } // prettier-ignore
997
+
998
+
999
+ var curriedDarken = /*#__PURE__*/curry
1000
+ /* ::<number | string, string, string> */
1001
+ (darken);
1002
+
1003
+ /**
1004
+ * Returns a string value for the lightened color.
1005
+ *
1006
+ * @example
1007
+ * // Styles as object usage
1008
+ * const styles = {
1009
+ * background: lighten(0.2, '#CCCD64'),
1010
+ * background: lighten('0.2', 'rgba(204,205,100,0.7)'),
1011
+ * }
1012
+ *
1013
+ * // styled-components usage
1014
+ * const div = styled.div`
1015
+ * background: ${lighten(0.2, '#FFCD64')};
1016
+ * background: ${lighten('0.2', 'rgba(204,205,100,0.7)')};
1017
+ * `
1018
+ *
1019
+ * // CSS in JS Output
1020
+ *
1021
+ * element {
1022
+ * background: "#e5e6b1";
1023
+ * background: "rgba(229,230,177,0.7)";
1024
+ * }
1025
+ */
1026
+
1027
+ function lighten(amount, color) {
1028
+ if (color === 'transparent') return color;
1029
+ var hslColor = parseToHsl(color);
1030
+ return toColorString(_extends({}, hslColor, {
1031
+ lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
1032
+ }));
1033
+ } // prettier-ignore
1034
+
1035
+
1036
+ var curriedLighten = /*#__PURE__*/curry
1037
+ /* ::<number | string, string, string> */
1038
+ (lighten);
1039
+
1040
+ var palette = {
1041
+ primary: [
1042
+ '#e4ffee',
1043
+ '#beffd5',
1044
+ '#8bffb9',
1045
+ '#33ff99',
1046
+ '#00fb7d',
1047
+ '#00f568',
1048
+ '#00e35c',
1049
+ '#00ce4e',
1050
+ '#00bc42',
1051
+ '#00992c', // 900
1052
+ ],
1053
+ secondary: [
1054
+ '#dff7ff',
1055
+ '#ace9fe',
1056
+ '#70dbfe',
1057
+ '#00ccff',
1058
+ '#00c0ff',
1059
+ '#00b4ff',
1060
+ '#00a6f4',
1061
+ '#0093e1',
1062
+ '#0081cd',
1063
+ '#0061ac', // 900
1064
+ ],
1065
+ gray: [
1066
+ '#f7f7f7',
1067
+ '#eeeeee',
1068
+ '#e2e2e2',
1069
+ '#d0d0d0',
1070
+ '#ababab',
1071
+ '#8a8a8a',
1072
+ '#636363',
1073
+ '#505050',
1074
+ '#323232',
1075
+ '#121212', // 900,
1076
+ ],
1077
+ dark: [
1078
+ '#F3F4F4',
1079
+ '#d1d5da',
1080
+ '#b4b9c2',
1081
+ '#969dab',
1082
+ '#a9b3be',
1083
+ '#89939d',
1084
+ '#616b75',
1085
+ '#4e5761',
1086
+ '#303942',
1087
+ '#101921', // 900 night black
1088
+ ],
1089
+ };
1090
+ var secondary$1 = palette.secondary, primary = palette.primary;
1091
+ var BIFROST_BLUE = secondary$1[3];
1092
+ var YGGDRASIL_GREEN = primary[3];
1093
+ var MIDGARD_TURQUOISE = '#23DCC8';
1094
+ var FLASH_ORANGE = '#F3BA2F';
1095
+ var SURTR_RED = '#FF4954';
1096
+
1097
+ var secondary = palette.secondary, dark$1 = palette.dark;
1098
+ var COL_DARKEN_RATE = 0.15;
1099
+ var COL_LIGHTEN_RATE = 0.35;
1100
+ var DARK_COL = curriedDarken(COL_DARKEN_RATE, BIFROST_BLUE);
1101
+ var LIGHT_COL = curriedLighten(0.2, BIFROST_BLUE);
1102
+ var DARK_COL_BASE = curriedDarken(COL_DARKEN_RATE, MIDGARD_TURQUOISE);
1103
+ var LIGHT_COL_BASE = curriedLighten(0.2, MIDGARD_TURQUOISE);
1104
+ var theme = {
1105
+ palette: {
1106
+ gradient: [
1107
+ "linear-gradient(9.34deg, ".concat(MIDGARD_TURQUOISE, " 19.28%, ").concat(BIFROST_BLUE, " 106.03%)"),
1108
+ "linear-gradient(9.34deg, ".concat(DARK_COL_BASE, " 19.28%, ").concat(DARK_COL, " 106.03%)"),
1109
+ "linear-gradient(9.34deg, ".concat(LIGHT_COL_BASE, " 19.28%, ").concat(LIGHT_COL, " 106.03%)"),
1110
+ ],
1111
+ primary: [
1112
+ MIDGARD_TURQUOISE,
1113
+ YGGDRASIL_GREEN, // 1 primary
1114
+ ],
1115
+ secondary: [
1116
+ BIFROST_BLUE,
1117
+ secondary[0], // 1 box-shadow, hover
1118
+ ],
1119
+ warning: [
1120
+ FLASH_ORANGE,
1121
+ curriedDarken(COL_DARKEN_RATE, FLASH_ORANGE),
1122
+ curriedLighten(COL_LIGHTEN_RATE, FLASH_ORANGE),
1123
+ "linear-gradient(47.73deg, ".concat(FLASH_ORANGE, " 0%, ").concat(FLASH_ORANGE, " 100%)"),
1124
+ ],
1125
+ success: [
1126
+ MIDGARD_TURQUOISE,
1127
+ curriedDarken(COL_DARKEN_RATE, MIDGARD_TURQUOISE),
1128
+ curriedLighten(COL_LIGHTEN_RATE, MIDGARD_TURQUOISE),
1129
+ "linear-gradient(47.73deg, ".concat(MIDGARD_TURQUOISE, " 0%, ").concat(MIDGARD_TURQUOISE, " 100%)"),
1130
+ ],
1131
+ error: [
1132
+ SURTR_RED,
1133
+ curriedDarken(COL_DARKEN_RATE, SURTR_RED),
1134
+ curriedLighten(COL_LIGHTEN_RATE, SURTR_RED),
1135
+ "linear-gradient(47.73deg, ".concat(SURTR_RED, " 0%, ").concat(SURTR_RED, " 100%)"),
1136
+ ],
1137
+ gray: [
1138
+ dark$1[0],
1139
+ dark$1[1],
1140
+ dark$1[2], // 2: hover
1141
+ ],
1142
+ background: [
1143
+ '#fff',
1144
+ '#fff',
1145
+ dark$1[0],
1146
+ dark$1[0],
1147
+ '#fff', // 4: popover bg
1148
+ ],
1149
+ text: [
1150
+ dark$1[8],
1151
+ dark$1[9],
1152
+ dark$1[6],
1153
+ '#fff', // 3: white text
1154
+ ],
1155
+ },
1156
+ sizes: {
1157
+ headerHeight: '70px',
1158
+ footerHeight: '50px',
1159
+ panelHeight: '550px',
1160
+ panelHeaderHeight: '50px',
1161
+ lineHeight: '50px',
1162
+ crypto: '35px',
1163
+ icon: '16px',
1164
+ social: '17px',
1165
+ gutter: {
1166
+ horizontal: '30px',
1167
+ vertical: '20px',
1168
+ },
1169
+ button: {
1170
+ small: {
1171
+ width: '55px',
1172
+ height: '20px',
1173
+ },
1174
+ normal: {
1175
+ width: '100px',
1176
+ height: '30px',
1177
+ },
1178
+ big: {
1179
+ width: '166px',
1180
+ height: '70px',
1181
+ },
1182
+ },
1183
+ tooltip: {
1184
+ small: '15px',
1185
+ normal: '30px',
1186
+ },
1187
+ font: {
1188
+ tiny: '8px',
1189
+ small: '10px',
1190
+ normal: '12px',
1191
+ big: '15px',
1192
+ large: '18px',
1193
+ },
1194
+ coin: {
1195
+ small: '30px',
1196
+ big: '40px',
1197
+ },
1198
+ },
1199
+ fonts: {
1200
+ primary: 'Exo 2',
1201
+ pre: 'Consolas, Liberation Mono, Menlo, Courier, monospace',
1202
+ },
1203
+ };
1204
+
1205
+ var dark = palette.dark;
1206
+ var darkTheme = JSON.parse(JSON.stringify(theme));
1207
+ darkTheme.palette = __assign(__assign({}, darkTheme.palette), { secondary: [
1208
+ BIFROST_BLUE,
1209
+ dark[6], // 1 box-shadow, hover
1210
+ ], gray: [
1211
+ dark[8],
1212
+ dark[6],
1213
+ dark[5], // 2: hover
1214
+ ], background: [
1215
+ dark[9],
1216
+ dark[9],
1217
+ dark[8],
1218
+ '#000',
1219
+ dark[8], // 4: popover bg
1220
+ ], text: [
1221
+ '#fff',
1222
+ dark[0],
1223
+ dark[1],
1224
+ '#fff', // 3: white text
1225
+ ] });
1226
+
1227
+ var ThemeType;
1228
+ (function (ThemeType) {
1229
+ ThemeType["DARK"] = "DARK_THEME";
1230
+ ThemeType["LIGHT"] = "LIGHT_THEME";
1231
+ })(ThemeType || (ThemeType = {}));
1232
+
1233
+ var index = {
1234
+ dark: darkTheme,
1235
+ light: theme,
1236
+ };
1237
+
1238
+ export { ThemeType, index as default };
1239
+ //# sourceMappingURL=index.esm.js.map