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