@thecb/components 11.0.2-beta.0 → 11.0.2-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.
- package/dist/index.cjs.js +96 -627
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +96 -627
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/link/ExternalLink.d.ts +1 -0
- package/src/components/atoms/link/ExternalLink.js +3 -2
- package/src/components/atoms/link/Link.stories.js +8 -0
package/dist/index.esm.js
CHANGED
|
@@ -21075,6 +21075,7 @@ function _wrapNativeSuper(Class) {
|
|
|
21075
21075
|
}
|
|
21076
21076
|
|
|
21077
21077
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
21078
|
+
|
|
21078
21079
|
/**
|
|
21079
21080
|
* Parse errors.md and turn it into a simple hash of code: message
|
|
21080
21081
|
* @private
|
|
@@ -21159,71 +21160,84 @@ var ERRORS = {
|
|
|
21159
21160
|
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
21160
21161
|
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
21161
21162
|
};
|
|
21162
|
-
|
|
21163
21163
|
/**
|
|
21164
21164
|
* super basic version of sprintf
|
|
21165
21165
|
* @private
|
|
21166
21166
|
*/
|
|
21167
|
+
|
|
21167
21168
|
function format() {
|
|
21168
21169
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
21169
21170
|
args[_key] = arguments[_key];
|
|
21170
21171
|
}
|
|
21172
|
+
|
|
21171
21173
|
var a = args[0];
|
|
21172
21174
|
var b = [];
|
|
21173
21175
|
var c;
|
|
21176
|
+
|
|
21174
21177
|
for (c = 1; c < args.length; c += 1) {
|
|
21175
21178
|
b.push(args[c]);
|
|
21176
21179
|
}
|
|
21180
|
+
|
|
21177
21181
|
b.forEach(function (d) {
|
|
21178
21182
|
a = a.replace(/%[a-z]/, d);
|
|
21179
21183
|
});
|
|
21180
21184
|
return a;
|
|
21181
21185
|
}
|
|
21182
|
-
|
|
21183
21186
|
/**
|
|
21184
21187
|
* Create an error file out of errors.md for development and a simple web link to the full errors
|
|
21185
21188
|
* in production mode.
|
|
21186
21189
|
* @private
|
|
21187
21190
|
*/
|
|
21191
|
+
|
|
21192
|
+
|
|
21188
21193
|
var PolishedError = /*#__PURE__*/function (_Error) {
|
|
21189
21194
|
_inheritsLoose(PolishedError, _Error);
|
|
21195
|
+
|
|
21190
21196
|
function PolishedError(code) {
|
|
21191
21197
|
var _this;
|
|
21198
|
+
|
|
21192
21199
|
if (process.env.NODE_ENV === 'production') {
|
|
21193
21200
|
_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;
|
|
21194
21201
|
} else {
|
|
21195
21202
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
21196
21203
|
args[_key2 - 1] = arguments[_key2];
|
|
21197
21204
|
}
|
|
21205
|
+
|
|
21198
21206
|
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
21199
21207
|
}
|
|
21208
|
+
|
|
21200
21209
|
return _assertThisInitialized(_this);
|
|
21201
21210
|
}
|
|
21211
|
+
|
|
21202
21212
|
return PolishedError;
|
|
21203
21213
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
21204
21214
|
|
|
21205
21215
|
function colorToInt(color) {
|
|
21206
21216
|
return Math.round(color * 255);
|
|
21207
21217
|
}
|
|
21218
|
+
|
|
21208
21219
|
function convertToInt(red, green, blue) {
|
|
21209
21220
|
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
21210
21221
|
}
|
|
21222
|
+
|
|
21211
21223
|
function hslToRgb(hue, saturation, lightness, convert) {
|
|
21212
21224
|
if (convert === void 0) {
|
|
21213
21225
|
convert = convertToInt;
|
|
21214
21226
|
}
|
|
21227
|
+
|
|
21215
21228
|
if (saturation === 0) {
|
|
21216
21229
|
// achromatic
|
|
21217
21230
|
return convert(lightness, lightness, lightness);
|
|
21218
|
-
}
|
|
21231
|
+
} // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
21232
|
+
|
|
21219
21233
|
|
|
21220
|
-
// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
21221
21234
|
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
21222
21235
|
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
21223
21236
|
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
21224
21237
|
var red = 0;
|
|
21225
21238
|
var green = 0;
|
|
21226
21239
|
var blue = 0;
|
|
21240
|
+
|
|
21227
21241
|
if (huePrime >= 0 && huePrime < 1) {
|
|
21228
21242
|
red = chroma;
|
|
21229
21243
|
green = secondComponent;
|
|
@@ -21243,6 +21257,7 @@ function hslToRgb(hue, saturation, lightness, convert) {
|
|
|
21243
21257
|
red = chroma;
|
|
21244
21258
|
blue = secondComponent;
|
|
21245
21259
|
}
|
|
21260
|
+
|
|
21246
21261
|
var lightnessModification = lightness - chroma / 2;
|
|
21247
21262
|
var finalRed = red + lightnessModification;
|
|
21248
21263
|
var finalGreen = green + lightnessModification;
|
|
@@ -21400,11 +21415,11 @@ var namedColorMap = {
|
|
|
21400
21415
|
yellow: 'ff0',
|
|
21401
21416
|
yellowgreen: '9acd32'
|
|
21402
21417
|
};
|
|
21403
|
-
|
|
21404
21418
|
/**
|
|
21405
21419
|
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
|
|
21406
21420
|
* @private
|
|
21407
21421
|
*/
|
|
21422
|
+
|
|
21408
21423
|
function nameToHex(color) {
|
|
21409
21424
|
if (typeof color !== 'string') return color;
|
|
21410
21425
|
var normalizedColorName = color.toLowerCase();
|
|
@@ -21419,7 +21434,6 @@ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\
|
|
|
21419
21434
|
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
21420
21435
|
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;
|
|
21421
21436
|
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;
|
|
21422
|
-
|
|
21423
21437
|
/**
|
|
21424
21438
|
* Returns an RgbColor or RgbaColor object. This utility function is only useful
|
|
21425
21439
|
* if want to extract a color component. With the color util `toColorString` you
|
|
@@ -21431,11 +21445,14 @@ var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[
|
|
|
21431
21445
|
* // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
|
|
21432
21446
|
* const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
|
|
21433
21447
|
*/
|
|
21448
|
+
|
|
21434
21449
|
function parseToRgb(color) {
|
|
21435
21450
|
if (typeof color !== 'string') {
|
|
21436
21451
|
throw new PolishedError(3);
|
|
21437
21452
|
}
|
|
21453
|
+
|
|
21438
21454
|
var normalizedColor = nameToHex(color);
|
|
21455
|
+
|
|
21439
21456
|
if (normalizedColor.match(hexRegex)) {
|
|
21440
21457
|
return {
|
|
21441
21458
|
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
@@ -21443,6 +21460,7 @@ function parseToRgb(color) {
|
|
|
21443
21460
|
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
21444
21461
|
};
|
|
21445
21462
|
}
|
|
21463
|
+
|
|
21446
21464
|
if (normalizedColor.match(hexRgbaRegex)) {
|
|
21447
21465
|
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
21448
21466
|
return {
|
|
@@ -21452,6 +21470,7 @@ function parseToRgb(color) {
|
|
|
21452
21470
|
alpha: alpha
|
|
21453
21471
|
};
|
|
21454
21472
|
}
|
|
21473
|
+
|
|
21455
21474
|
if (normalizedColor.match(reducedHexRegex)) {
|
|
21456
21475
|
return {
|
|
21457
21476
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
@@ -21459,8 +21478,10 @@ function parseToRgb(color) {
|
|
|
21459
21478
|
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
21460
21479
|
};
|
|
21461
21480
|
}
|
|
21481
|
+
|
|
21462
21482
|
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
21463
21483
|
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
21484
|
+
|
|
21464
21485
|
return {
|
|
21465
21486
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
21466
21487
|
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
@@ -21468,7 +21489,9 @@ function parseToRgb(color) {
|
|
|
21468
21489
|
alpha: _alpha
|
|
21469
21490
|
};
|
|
21470
21491
|
}
|
|
21492
|
+
|
|
21471
21493
|
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
21494
|
+
|
|
21472
21495
|
if (rgbMatched) {
|
|
21473
21496
|
return {
|
|
21474
21497
|
red: parseInt("" + rgbMatched[1], 10),
|
|
@@ -21476,7 +21499,9 @@ function parseToRgb(color) {
|
|
|
21476
21499
|
blue: parseInt("" + rgbMatched[3], 10)
|
|
21477
21500
|
};
|
|
21478
21501
|
}
|
|
21502
|
+
|
|
21479
21503
|
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
21504
|
+
|
|
21480
21505
|
if (rgbaMatched) {
|
|
21481
21506
|
return {
|
|
21482
21507
|
red: parseInt("" + rgbaMatched[1], 10),
|
|
@@ -21485,32 +21510,44 @@ function parseToRgb(color) {
|
|
|
21485
21510
|
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
21486
21511
|
};
|
|
21487
21512
|
}
|
|
21513
|
+
|
|
21488
21514
|
var hslMatched = hslRegex.exec(normalizedColor);
|
|
21515
|
+
|
|
21489
21516
|
if (hslMatched) {
|
|
21490
21517
|
var hue = parseInt("" + hslMatched[1], 10);
|
|
21491
21518
|
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
21492
21519
|
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
21493
21520
|
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
21494
21521
|
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
21522
|
+
|
|
21495
21523
|
if (!hslRgbMatched) {
|
|
21496
21524
|
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
21497
21525
|
}
|
|
21526
|
+
|
|
21498
21527
|
return {
|
|
21499
21528
|
red: parseInt("" + hslRgbMatched[1], 10),
|
|
21500
21529
|
green: parseInt("" + hslRgbMatched[2], 10),
|
|
21501
21530
|
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
21502
21531
|
};
|
|
21503
21532
|
}
|
|
21533
|
+
|
|
21504
21534
|
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
21535
|
+
|
|
21505
21536
|
if (hslaMatched) {
|
|
21506
21537
|
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
21538
|
+
|
|
21507
21539
|
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
21540
|
+
|
|
21508
21541
|
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
21542
|
+
|
|
21509
21543
|
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
21544
|
+
|
|
21510
21545
|
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
21546
|
+
|
|
21511
21547
|
if (!_hslRgbMatched) {
|
|
21512
21548
|
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
21513
21549
|
}
|
|
21550
|
+
|
|
21514
21551
|
return {
|
|
21515
21552
|
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
21516
21553
|
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
@@ -21518,80 +21555,8 @@ function parseToRgb(color) {
|
|
|
21518
21555
|
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
21519
21556
|
};
|
|
21520
21557
|
}
|
|
21521
|
-
throw new PolishedError(5);
|
|
21522
|
-
}
|
|
21523
|
-
|
|
21524
|
-
function rgbToHsl(color) {
|
|
21525
|
-
// make sure rgb are contained in a set of [0, 255]
|
|
21526
|
-
var red = color.red / 255;
|
|
21527
|
-
var green = color.green / 255;
|
|
21528
|
-
var blue = color.blue / 255;
|
|
21529
|
-
var max = Math.max(red, green, blue);
|
|
21530
|
-
var min = Math.min(red, green, blue);
|
|
21531
|
-
var lightness = (max + min) / 2;
|
|
21532
|
-
if (max === min) {
|
|
21533
|
-
// achromatic
|
|
21534
|
-
if (color.alpha !== undefined) {
|
|
21535
|
-
return {
|
|
21536
|
-
hue: 0,
|
|
21537
|
-
saturation: 0,
|
|
21538
|
-
lightness: lightness,
|
|
21539
|
-
alpha: color.alpha
|
|
21540
|
-
};
|
|
21541
|
-
} else {
|
|
21542
|
-
return {
|
|
21543
|
-
hue: 0,
|
|
21544
|
-
saturation: 0,
|
|
21545
|
-
lightness: lightness
|
|
21546
|
-
};
|
|
21547
|
-
}
|
|
21548
|
-
}
|
|
21549
|
-
var hue;
|
|
21550
|
-
var delta = max - min;
|
|
21551
|
-
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
21552
|
-
switch (max) {
|
|
21553
|
-
case red:
|
|
21554
|
-
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
21555
|
-
break;
|
|
21556
|
-
case green:
|
|
21557
|
-
hue = (blue - red) / delta + 2;
|
|
21558
|
-
break;
|
|
21559
|
-
default:
|
|
21560
|
-
// blue case
|
|
21561
|
-
hue = (red - green) / delta + 4;
|
|
21562
|
-
break;
|
|
21563
|
-
}
|
|
21564
|
-
hue *= 60;
|
|
21565
|
-
if (color.alpha !== undefined) {
|
|
21566
|
-
return {
|
|
21567
|
-
hue: hue,
|
|
21568
|
-
saturation: saturation,
|
|
21569
|
-
lightness: lightness,
|
|
21570
|
-
alpha: color.alpha
|
|
21571
|
-
};
|
|
21572
|
-
}
|
|
21573
|
-
return {
|
|
21574
|
-
hue: hue,
|
|
21575
|
-
saturation: saturation,
|
|
21576
|
-
lightness: lightness
|
|
21577
|
-
};
|
|
21578
|
-
}
|
|
21579
21558
|
|
|
21580
|
-
|
|
21581
|
-
* Returns an HslColor or HslaColor object. This utility function is only useful
|
|
21582
|
-
* if want to extract a color component. With the color util `toColorString` you
|
|
21583
|
-
* can convert a HslColor or HslaColor object back to a string.
|
|
21584
|
-
*
|
|
21585
|
-
* @example
|
|
21586
|
-
* // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1
|
|
21587
|
-
* const color1 = parseToHsl('rgb(255, 0, 0)');
|
|
21588
|
-
* // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2
|
|
21589
|
-
* const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)');
|
|
21590
|
-
*/
|
|
21591
|
-
function parseToHsl(color) {
|
|
21592
|
-
// Note: At a later stage we can optimize this function as right now a hsl
|
|
21593
|
-
// color would be parsed converted to rgb values and converted back to hsl.
|
|
21594
|
-
return rgbToHsl(parseToRgb(color));
|
|
21559
|
+
throw new PolishedError(5);
|
|
21595
21560
|
}
|
|
21596
21561
|
|
|
21597
21562
|
/**
|
|
@@ -21602,8 +21567,10 @@ var reduceHexValue = function reduceHexValue(value) {
|
|
|
21602
21567
|
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
21603
21568
|
return "#" + value[1] + value[3] + value[5];
|
|
21604
21569
|
}
|
|
21570
|
+
|
|
21605
21571
|
return value;
|
|
21606
21572
|
};
|
|
21573
|
+
|
|
21607
21574
|
var reduceHexValue$1 = reduceHexValue;
|
|
21608
21575
|
|
|
21609
21576
|
function numberToHex(value) {
|
|
@@ -21611,83 +21578,6 @@ function numberToHex(value) {
|
|
|
21611
21578
|
return hex.length === 1 ? "0" + hex : hex;
|
|
21612
21579
|
}
|
|
21613
21580
|
|
|
21614
|
-
function colorToHex(color) {
|
|
21615
|
-
return numberToHex(Math.round(color * 255));
|
|
21616
|
-
}
|
|
21617
|
-
function convertToHex(red, green, blue) {
|
|
21618
|
-
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
|
21619
|
-
}
|
|
21620
|
-
function hslToHex(hue, saturation, lightness) {
|
|
21621
|
-
return hslToRgb(hue, saturation, lightness, convertToHex);
|
|
21622
|
-
}
|
|
21623
|
-
|
|
21624
|
-
/**
|
|
21625
|
-
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
21626
|
-
*
|
|
21627
|
-
* @example
|
|
21628
|
-
* // Styles as object usage
|
|
21629
|
-
* const styles = {
|
|
21630
|
-
* background: hsl(359, 0.75, 0.4),
|
|
21631
|
-
* background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }),
|
|
21632
|
-
* }
|
|
21633
|
-
*
|
|
21634
|
-
* // styled-components usage
|
|
21635
|
-
* const div = styled.div`
|
|
21636
|
-
* background: ${hsl(359, 0.75, 0.4)};
|
|
21637
|
-
* background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })};
|
|
21638
|
-
* `
|
|
21639
|
-
*
|
|
21640
|
-
* // CSS in JS Output
|
|
21641
|
-
*
|
|
21642
|
-
* element {
|
|
21643
|
-
* background: "#b3191c";
|
|
21644
|
-
* background: "#b3191c";
|
|
21645
|
-
* }
|
|
21646
|
-
*/
|
|
21647
|
-
function hsl(value, saturation, lightness) {
|
|
21648
|
-
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
|
|
21649
|
-
return hslToHex(value, saturation, lightness);
|
|
21650
|
-
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
|
|
21651
|
-
return hslToHex(value.hue, value.saturation, value.lightness);
|
|
21652
|
-
}
|
|
21653
|
-
throw new PolishedError(1);
|
|
21654
|
-
}
|
|
21655
|
-
|
|
21656
|
-
/**
|
|
21657
|
-
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
|
|
21658
|
-
*
|
|
21659
|
-
* @example
|
|
21660
|
-
* // Styles as object usage
|
|
21661
|
-
* const styles = {
|
|
21662
|
-
* background: hsla(359, 0.75, 0.4, 0.7),
|
|
21663
|
-
* background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }),
|
|
21664
|
-
* background: hsla(359, 0.75, 0.4, 1),
|
|
21665
|
-
* }
|
|
21666
|
-
*
|
|
21667
|
-
* // styled-components usage
|
|
21668
|
-
* const div = styled.div`
|
|
21669
|
-
* background: ${hsla(359, 0.75, 0.4, 0.7)};
|
|
21670
|
-
* background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })};
|
|
21671
|
-
* background: ${hsla(359, 0.75, 0.4, 1)};
|
|
21672
|
-
* `
|
|
21673
|
-
*
|
|
21674
|
-
* // CSS in JS Output
|
|
21675
|
-
*
|
|
21676
|
-
* element {
|
|
21677
|
-
* background: "rgba(179,25,28,0.7)";
|
|
21678
|
-
* background: "rgba(179,25,28,0.7)";
|
|
21679
|
-
* background: "#b3191c";
|
|
21680
|
-
* }
|
|
21681
|
-
*/
|
|
21682
|
-
function hsla$1(value, saturation, lightness, alpha) {
|
|
21683
|
-
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
|
|
21684
|
-
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
|
21685
|
-
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
|
|
21686
|
-
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
|
21687
|
-
}
|
|
21688
|
-
throw new PolishedError(2);
|
|
21689
|
-
}
|
|
21690
|
-
|
|
21691
21581
|
/**
|
|
21692
21582
|
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
21693
21583
|
*
|
|
@@ -21717,6 +21607,7 @@ function rgb(value, green, blue) {
|
|
|
21717
21607
|
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
|
21718
21608
|
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
21719
21609
|
}
|
|
21610
|
+
|
|
21720
21611
|
throw new PolishedError(6);
|
|
21721
21612
|
}
|
|
21722
21613
|
|
|
@@ -21763,60 +21654,8 @@ function rgba$1(firstValue, secondValue, thirdValue, fourthValue) {
|
|
|
21763
21654
|
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
|
|
21764
21655
|
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
21765
21656
|
}
|
|
21766
|
-
throw new PolishedError(7);
|
|
21767
|
-
}
|
|
21768
21657
|
|
|
21769
|
-
|
|
21770
|
-
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
21771
|
-
};
|
|
21772
|
-
var isRgba$1 = function isRgba(color) {
|
|
21773
|
-
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
|
|
21774
|
-
};
|
|
21775
|
-
var isHsl = function isHsl(color) {
|
|
21776
|
-
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
21777
|
-
};
|
|
21778
|
-
var isHsla$1 = function isHsla(color) {
|
|
21779
|
-
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
|
|
21780
|
-
};
|
|
21781
|
-
|
|
21782
|
-
/**
|
|
21783
|
-
* Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string.
|
|
21784
|
-
* This util is useful in case you only know on runtime which color object is
|
|
21785
|
-
* used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`.
|
|
21786
|
-
*
|
|
21787
|
-
* @example
|
|
21788
|
-
* // Styles as object usage
|
|
21789
|
-
* const styles = {
|
|
21790
|
-
* background: toColorString({ red: 255, green: 205, blue: 100 }),
|
|
21791
|
-
* background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }),
|
|
21792
|
-
* background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }),
|
|
21793
|
-
* background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }),
|
|
21794
|
-
* }
|
|
21795
|
-
*
|
|
21796
|
-
* // styled-components usage
|
|
21797
|
-
* const div = styled.div`
|
|
21798
|
-
* background: ${toColorString({ red: 255, green: 205, blue: 100 })};
|
|
21799
|
-
* background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })};
|
|
21800
|
-
* background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })};
|
|
21801
|
-
* background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })};
|
|
21802
|
-
* `
|
|
21803
|
-
*
|
|
21804
|
-
* // CSS in JS Output
|
|
21805
|
-
* element {
|
|
21806
|
-
* background: "#ffcd64";
|
|
21807
|
-
* background: "rgba(255,205,100,0.72)";
|
|
21808
|
-
* background: "#00f";
|
|
21809
|
-
* background: "rgba(179,25,25,0.72)";
|
|
21810
|
-
* }
|
|
21811
|
-
*/
|
|
21812
|
-
|
|
21813
|
-
function toColorString(color) {
|
|
21814
|
-
if (typeof color !== 'object') throw new PolishedError(8);
|
|
21815
|
-
if (isRgba$1(color)) return rgba$1(color);
|
|
21816
|
-
if (isRgb(color)) return rgb(color);
|
|
21817
|
-
if (isHsla$1(color)) return hsla$1(color);
|
|
21818
|
-
if (isHsl(color)) return hsl(color);
|
|
21819
|
-
throw new PolishedError(8);
|
|
21658
|
+
throw new PolishedError(7);
|
|
21820
21659
|
}
|
|
21821
21660
|
|
|
21822
21661
|
// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
|
|
@@ -21829,156 +21668,14 @@ function curried(f, length, acc) {
|
|
|
21829
21668
|
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
21830
21669
|
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
|
21831
21670
|
};
|
|
21832
|
-
}
|
|
21671
|
+
} // eslint-disable-next-line no-redeclare
|
|
21672
|
+
|
|
21833
21673
|
|
|
21834
|
-
// eslint-disable-next-line no-redeclare
|
|
21835
21674
|
function curry(f) {
|
|
21836
21675
|
// eslint-disable-line no-redeclare
|
|
21837
21676
|
return curried(f, f.length, []);
|
|
21838
21677
|
}
|
|
21839
21678
|
|
|
21840
|
-
/**
|
|
21841
|
-
* Changes the hue of the color. Hue is a number between 0 to 360. The first
|
|
21842
|
-
* argument for adjustHue is the amount of degrees the color is rotated around
|
|
21843
|
-
* the color wheel, always producing a positive hue value.
|
|
21844
|
-
*
|
|
21845
|
-
* @example
|
|
21846
|
-
* // Styles as object usage
|
|
21847
|
-
* const styles = {
|
|
21848
|
-
* background: adjustHue(180, '#448'),
|
|
21849
|
-
* background: adjustHue('180', 'rgba(101,100,205,0.7)'),
|
|
21850
|
-
* }
|
|
21851
|
-
*
|
|
21852
|
-
* // styled-components usage
|
|
21853
|
-
* const div = styled.div`
|
|
21854
|
-
* background: ${adjustHue(180, '#448')};
|
|
21855
|
-
* background: ${adjustHue('180', 'rgba(101,100,205,0.7)')};
|
|
21856
|
-
* `
|
|
21857
|
-
*
|
|
21858
|
-
* // CSS in JS Output
|
|
21859
|
-
* element {
|
|
21860
|
-
* background: "#888844";
|
|
21861
|
-
* background: "rgba(136,136,68,0.7)";
|
|
21862
|
-
* }
|
|
21863
|
-
*/
|
|
21864
|
-
function adjustHue(degree, color) {
|
|
21865
|
-
if (color === 'transparent') return color;
|
|
21866
|
-
var hslColor = parseToHsl(color);
|
|
21867
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
21868
|
-
hue: hslColor.hue + parseFloat(degree)
|
|
21869
|
-
}));
|
|
21870
|
-
}
|
|
21871
|
-
|
|
21872
|
-
// prettier-ignore
|
|
21873
|
-
var curriedAdjustHue = curry /* ::<number | string, string, string> */(adjustHue);
|
|
21874
|
-
|
|
21875
|
-
function guard(lowerBoundary, upperBoundary, value) {
|
|
21876
|
-
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
|
21877
|
-
}
|
|
21878
|
-
|
|
21879
|
-
/**
|
|
21880
|
-
* Returns a string value for the darkened color.
|
|
21881
|
-
*
|
|
21882
|
-
* @example
|
|
21883
|
-
* // Styles as object usage
|
|
21884
|
-
* const styles = {
|
|
21885
|
-
* background: darken(0.2, '#FFCD64'),
|
|
21886
|
-
* background: darken('0.2', 'rgba(255,205,100,0.7)'),
|
|
21887
|
-
* }
|
|
21888
|
-
*
|
|
21889
|
-
* // styled-components usage
|
|
21890
|
-
* const div = styled.div`
|
|
21891
|
-
* background: ${darken(0.2, '#FFCD64')};
|
|
21892
|
-
* background: ${darken('0.2', 'rgba(255,205,100,0.7)')};
|
|
21893
|
-
* `
|
|
21894
|
-
*
|
|
21895
|
-
* // CSS in JS Output
|
|
21896
|
-
*
|
|
21897
|
-
* element {
|
|
21898
|
-
* background: "#ffbd31";
|
|
21899
|
-
* background: "rgba(255,189,49,0.7)";
|
|
21900
|
-
* }
|
|
21901
|
-
*/
|
|
21902
|
-
function darken(amount, color) {
|
|
21903
|
-
if (color === 'transparent') return color;
|
|
21904
|
-
var hslColor = parseToHsl(color);
|
|
21905
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
21906
|
-
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
|
21907
|
-
}));
|
|
21908
|
-
}
|
|
21909
|
-
|
|
21910
|
-
// prettier-ignore
|
|
21911
|
-
var curriedDarken = curry /* ::<number | string, string, string> */(darken);
|
|
21912
|
-
|
|
21913
|
-
/**
|
|
21914
|
-
* Decreases the intensity of a color. Its range is between 0 to 1. The first
|
|
21915
|
-
* argument of the desaturate function is the amount by how much the color
|
|
21916
|
-
* intensity should be decreased.
|
|
21917
|
-
*
|
|
21918
|
-
* @example
|
|
21919
|
-
* // Styles as object usage
|
|
21920
|
-
* const styles = {
|
|
21921
|
-
* background: desaturate(0.2, '#CCCD64'),
|
|
21922
|
-
* background: desaturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
21923
|
-
* }
|
|
21924
|
-
*
|
|
21925
|
-
* // styled-components usage
|
|
21926
|
-
* const div = styled.div`
|
|
21927
|
-
* background: ${desaturate(0.2, '#CCCD64')};
|
|
21928
|
-
* background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
21929
|
-
* `
|
|
21930
|
-
*
|
|
21931
|
-
* // CSS in JS Output
|
|
21932
|
-
* element {
|
|
21933
|
-
* background: "#b8b979";
|
|
21934
|
-
* background: "rgba(184,185,121,0.7)";
|
|
21935
|
-
* }
|
|
21936
|
-
*/
|
|
21937
|
-
function desaturate(amount, color) {
|
|
21938
|
-
if (color === 'transparent') return color;
|
|
21939
|
-
var hslColor = parseToHsl(color);
|
|
21940
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
21941
|
-
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
|
21942
|
-
}));
|
|
21943
|
-
}
|
|
21944
|
-
|
|
21945
|
-
// prettier-ignore
|
|
21946
|
-
var curriedDesaturate = curry /* ::<number | string, string, string> */(desaturate);
|
|
21947
|
-
|
|
21948
|
-
/**
|
|
21949
|
-
* Returns a string value for the lightened color.
|
|
21950
|
-
*
|
|
21951
|
-
* @example
|
|
21952
|
-
* // Styles as object usage
|
|
21953
|
-
* const styles = {
|
|
21954
|
-
* background: lighten(0.2, '#CCCD64'),
|
|
21955
|
-
* background: lighten('0.2', 'rgba(204,205,100,0.7)'),
|
|
21956
|
-
* }
|
|
21957
|
-
*
|
|
21958
|
-
* // styled-components usage
|
|
21959
|
-
* const div = styled.div`
|
|
21960
|
-
* background: ${lighten(0.2, '#FFCD64')};
|
|
21961
|
-
* background: ${lighten('0.2', 'rgba(204,205,100,0.7)')};
|
|
21962
|
-
* `
|
|
21963
|
-
*
|
|
21964
|
-
* // CSS in JS Output
|
|
21965
|
-
*
|
|
21966
|
-
* element {
|
|
21967
|
-
* background: "#e5e6b1";
|
|
21968
|
-
* background: "rgba(229,230,177,0.7)";
|
|
21969
|
-
* }
|
|
21970
|
-
*/
|
|
21971
|
-
function lighten(amount, color) {
|
|
21972
|
-
if (color === 'transparent') return color;
|
|
21973
|
-
var hslColor = parseToHsl(color);
|
|
21974
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
21975
|
-
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
|
21976
|
-
}));
|
|
21977
|
-
}
|
|
21978
|
-
|
|
21979
|
-
// prettier-ignore
|
|
21980
|
-
var curriedLighten = curry /* ::<number | string, string, string> */(lighten);
|
|
21981
|
-
|
|
21982
21679
|
/**
|
|
21983
21680
|
* Mixes the two provided colors together by calculating the average of each of the RGB components weighted to the first color by the provided weight.
|
|
21984
21681
|
*
|
|
@@ -22005,21 +21702,25 @@ var curriedLighten = curry /* ::<number | string, string, string> */(lighten);
|
|
|
22005
21702
|
* background: "rgba(63, 0, 191, 0.75)";
|
|
22006
21703
|
* }
|
|
22007
21704
|
*/
|
|
21705
|
+
|
|
22008
21706
|
function mix$1(weight, color, otherColor) {
|
|
22009
21707
|
if (color === 'transparent') return otherColor;
|
|
22010
21708
|
if (otherColor === 'transparent') return color;
|
|
22011
21709
|
if (weight === 0) return otherColor;
|
|
22012
21710
|
var parsedColor1 = parseToRgb(color);
|
|
21711
|
+
|
|
22013
21712
|
var color1 = _extends$1({}, parsedColor1, {
|
|
22014
21713
|
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
|
|
22015
21714
|
});
|
|
21715
|
+
|
|
22016
21716
|
var parsedColor2 = parseToRgb(otherColor);
|
|
21717
|
+
|
|
22017
21718
|
var color2 = _extends$1({}, parsedColor2, {
|
|
22018
21719
|
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
|
|
22019
|
-
});
|
|
22020
|
-
|
|
22021
|
-
// The formula is copied from the original Sass implementation:
|
|
21720
|
+
}); // The formula is copied from the original Sass implementation:
|
|
22022
21721
|
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
21722
|
+
|
|
21723
|
+
|
|
22023
21724
|
var alphaDelta = color1.alpha - color2.alpha;
|
|
22024
21725
|
var x = parseFloat(weight) * 2 - 1;
|
|
22025
21726
|
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
|
|
@@ -22033,217 +21734,13 @@ function mix$1(weight, color, otherColor) {
|
|
|
22033
21734
|
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
|
22034
21735
|
};
|
|
22035
21736
|
return rgba$1(mixedColor);
|
|
22036
|
-
}
|
|
22037
|
-
|
|
22038
|
-
// prettier-ignore
|
|
22039
|
-
var curriedMix = curry /* ::<number | string, string, string, string> */(mix$1);
|
|
22040
|
-
var mix$1$1 = curriedMix;
|
|
22041
|
-
|
|
22042
|
-
/**
|
|
22043
|
-
* Increases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
22044
|
-
*
|
|
22045
|
-
*
|
|
22046
|
-
* @example
|
|
22047
|
-
* // Styles as object usage
|
|
22048
|
-
* const styles = {
|
|
22049
|
-
* background: opacify(0.1, 'rgba(255, 255, 255, 0.9)');
|
|
22050
|
-
* background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'),
|
|
22051
|
-
* background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'),
|
|
22052
|
-
* }
|
|
22053
|
-
*
|
|
22054
|
-
* // styled-components usage
|
|
22055
|
-
* const div = styled.div`
|
|
22056
|
-
* background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')};
|
|
22057
|
-
* background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')},
|
|
22058
|
-
* background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')},
|
|
22059
|
-
* `
|
|
22060
|
-
*
|
|
22061
|
-
* // CSS in JS Output
|
|
22062
|
-
*
|
|
22063
|
-
* element {
|
|
22064
|
-
* background: "#fff";
|
|
22065
|
-
* background: "rgba(255,255,255,0.7)";
|
|
22066
|
-
* background: "rgba(255,0,0,0.7)";
|
|
22067
|
-
* }
|
|
22068
|
-
*/
|
|
22069
|
-
function opacify(amount, color) {
|
|
22070
|
-
if (color === 'transparent') return color;
|
|
22071
|
-
var parsedColor = parseToRgb(color);
|
|
22072
|
-
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
22073
|
-
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
22074
|
-
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
|
22075
|
-
});
|
|
22076
|
-
return rgba$1(colorWithAlpha);
|
|
22077
|
-
}
|
|
22078
|
-
|
|
22079
|
-
// prettier-ignore
|
|
22080
|
-
var curriedOpacify = curry /* ::<number | string, string, string> */(opacify);
|
|
22081
|
-
|
|
22082
|
-
/**
|
|
22083
|
-
* Increases the intensity of a color. Its range is between 0 to 1. The first
|
|
22084
|
-
* argument of the saturate function is the amount by how much the color
|
|
22085
|
-
* intensity should be increased.
|
|
22086
|
-
*
|
|
22087
|
-
* @example
|
|
22088
|
-
* // Styles as object usage
|
|
22089
|
-
* const styles = {
|
|
22090
|
-
* background: saturate(0.2, '#CCCD64'),
|
|
22091
|
-
* background: saturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
22092
|
-
* }
|
|
22093
|
-
*
|
|
22094
|
-
* // styled-components usage
|
|
22095
|
-
* const div = styled.div`
|
|
22096
|
-
* background: ${saturate(0.2, '#FFCD64')};
|
|
22097
|
-
* background: ${saturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
22098
|
-
* `
|
|
22099
|
-
*
|
|
22100
|
-
* // CSS in JS Output
|
|
22101
|
-
*
|
|
22102
|
-
* element {
|
|
22103
|
-
* background: "#e0e250";
|
|
22104
|
-
* background: "rgba(224,226,80,0.7)";
|
|
22105
|
-
* }
|
|
22106
|
-
*/
|
|
22107
|
-
function saturate(amount, color) {
|
|
22108
|
-
if (color === 'transparent') return color;
|
|
22109
|
-
var hslColor = parseToHsl(color);
|
|
22110
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
22111
|
-
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
|
22112
|
-
}));
|
|
22113
|
-
}
|
|
22114
|
-
|
|
22115
|
-
// prettier-ignore
|
|
22116
|
-
var curriedSaturate = curry /* ::<number | string, string, string> */(saturate);
|
|
22117
|
-
|
|
22118
|
-
/**
|
|
22119
|
-
* Sets the hue of a color to the provided value. The hue range can be
|
|
22120
|
-
* from 0 and 359.
|
|
22121
|
-
*
|
|
22122
|
-
* @example
|
|
22123
|
-
* // Styles as object usage
|
|
22124
|
-
* const styles = {
|
|
22125
|
-
* background: setHue(42, '#CCCD64'),
|
|
22126
|
-
* background: setHue('244', 'rgba(204,205,100,0.7)'),
|
|
22127
|
-
* }
|
|
22128
|
-
*
|
|
22129
|
-
* // styled-components usage
|
|
22130
|
-
* const div = styled.div`
|
|
22131
|
-
* background: ${setHue(42, '#CCCD64')};
|
|
22132
|
-
* background: ${setHue('244', 'rgba(204,205,100,0.7)')};
|
|
22133
|
-
* `
|
|
22134
|
-
*
|
|
22135
|
-
* // CSS in JS Output
|
|
22136
|
-
* element {
|
|
22137
|
-
* background: "#cdae64";
|
|
22138
|
-
* background: "rgba(107,100,205,0.7)";
|
|
22139
|
-
* }
|
|
22140
|
-
*/
|
|
22141
|
-
function setHue(hue, color) {
|
|
22142
|
-
if (color === 'transparent') return color;
|
|
22143
|
-
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
22144
|
-
hue: parseFloat(hue)
|
|
22145
|
-
}));
|
|
22146
|
-
}
|
|
22147
|
-
|
|
22148
|
-
// prettier-ignore
|
|
22149
|
-
var curriedSetHue = curry /* ::<number | string, string, string> */(setHue);
|
|
22150
|
-
|
|
22151
|
-
/**
|
|
22152
|
-
* Sets the lightness of a color to the provided value. The lightness range can be
|
|
22153
|
-
* from 0 and 1.
|
|
22154
|
-
*
|
|
22155
|
-
* @example
|
|
22156
|
-
* // Styles as object usage
|
|
22157
|
-
* const styles = {
|
|
22158
|
-
* background: setLightness(0.2, '#CCCD64'),
|
|
22159
|
-
* background: setLightness('0.75', 'rgba(204,205,100,0.7)'),
|
|
22160
|
-
* }
|
|
22161
|
-
*
|
|
22162
|
-
* // styled-components usage
|
|
22163
|
-
* const div = styled.div`
|
|
22164
|
-
* background: ${setLightness(0.2, '#CCCD64')};
|
|
22165
|
-
* background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')};
|
|
22166
|
-
* `
|
|
22167
|
-
*
|
|
22168
|
-
* // CSS in JS Output
|
|
22169
|
-
* element {
|
|
22170
|
-
* background: "#4d4d19";
|
|
22171
|
-
* background: "rgba(223,224,159,0.7)";
|
|
22172
|
-
* }
|
|
22173
|
-
*/
|
|
22174
|
-
function setLightness(lightness, color) {
|
|
22175
|
-
if (color === 'transparent') return color;
|
|
22176
|
-
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
22177
|
-
lightness: parseFloat(lightness)
|
|
22178
|
-
}));
|
|
22179
|
-
}
|
|
22180
|
-
|
|
22181
|
-
// prettier-ignore
|
|
22182
|
-
var curriedSetLightness = curry /* ::<number | string, string, string> */(setLightness);
|
|
22183
|
-
|
|
22184
|
-
/**
|
|
22185
|
-
* Sets the saturation of a color to the provided value. The saturation range can be
|
|
22186
|
-
* from 0 and 1.
|
|
22187
|
-
*
|
|
22188
|
-
* @example
|
|
22189
|
-
* // Styles as object usage
|
|
22190
|
-
* const styles = {
|
|
22191
|
-
* background: setSaturation(0.2, '#CCCD64'),
|
|
22192
|
-
* background: setSaturation('0.75', 'rgba(204,205,100,0.7)'),
|
|
22193
|
-
* }
|
|
22194
|
-
*
|
|
22195
|
-
* // styled-components usage
|
|
22196
|
-
* const div = styled.div`
|
|
22197
|
-
* background: ${setSaturation(0.2, '#CCCD64')};
|
|
22198
|
-
* background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')};
|
|
22199
|
-
* `
|
|
22200
|
-
*
|
|
22201
|
-
* // CSS in JS Output
|
|
22202
|
-
* element {
|
|
22203
|
-
* background: "#adad84";
|
|
22204
|
-
* background: "rgba(228,229,76,0.7)";
|
|
22205
|
-
* }
|
|
22206
|
-
*/
|
|
22207
|
-
function setSaturation(saturation, color) {
|
|
22208
|
-
if (color === 'transparent') return color;
|
|
22209
|
-
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
22210
|
-
saturation: parseFloat(saturation)
|
|
22211
|
-
}));
|
|
22212
|
-
}
|
|
22213
|
-
|
|
22214
|
-
// prettier-ignore
|
|
22215
|
-
var curriedSetSaturation = curry /* ::<number | string, string, string> */(setSaturation);
|
|
22216
|
-
|
|
22217
|
-
/**
|
|
22218
|
-
* Shades a color by mixing it with black. `shade` can produce
|
|
22219
|
-
* hue shifts, where as `darken` manipulates the luminance channel and therefore
|
|
22220
|
-
* doesn't produce hue shifts.
|
|
22221
|
-
*
|
|
22222
|
-
* @example
|
|
22223
|
-
* // Styles as object usage
|
|
22224
|
-
* const styles = {
|
|
22225
|
-
* background: shade(0.25, '#00f')
|
|
22226
|
-
* }
|
|
22227
|
-
*
|
|
22228
|
-
* // styled-components usage
|
|
22229
|
-
* const div = styled.div`
|
|
22230
|
-
* background: ${shade(0.25, '#00f')};
|
|
22231
|
-
* `
|
|
22232
|
-
*
|
|
22233
|
-
* // CSS in JS Output
|
|
22234
|
-
*
|
|
22235
|
-
* element {
|
|
22236
|
-
* background: "#00003f";
|
|
22237
|
-
* }
|
|
22238
|
-
*/
|
|
21737
|
+
} // prettier-ignore
|
|
22239
21738
|
|
|
22240
|
-
function shade(percentage, color) {
|
|
22241
|
-
if (color === 'transparent') return color;
|
|
22242
|
-
return mix$1$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
|
|
22243
|
-
}
|
|
22244
21739
|
|
|
22245
|
-
|
|
22246
|
-
|
|
21740
|
+
var curriedMix = /*#__PURE__*/curry
|
|
21741
|
+
/* ::<number | string, string, string, string> */
|
|
21742
|
+
(mix$1);
|
|
21743
|
+
var mix$1$1 = curriedMix;
|
|
22247
21744
|
|
|
22248
21745
|
/**
|
|
22249
21746
|
* Tints a color by mixing it with white. `tint` can produce
|
|
@@ -22271,51 +21768,13 @@ var curriedShade = curry /* ::<number | string, string, string> */(shade);
|
|
|
22271
21768
|
function tint(percentage, color) {
|
|
22272
21769
|
if (color === 'transparent') return color;
|
|
22273
21770
|
return mix$1$1(parseFloat(percentage), 'rgb(255, 255, 255)', color);
|
|
22274
|
-
}
|
|
21771
|
+
} // prettier-ignore
|
|
22275
21772
|
|
|
22276
|
-
// prettier-ignore
|
|
22277
|
-
var curriedTint = curry /* ::<number | string, string, string> */(tint);
|
|
22278
|
-
var curriedTint$1 = curriedTint;
|
|
22279
21773
|
|
|
22280
|
-
|
|
22281
|
-
|
|
22282
|
-
|
|
22283
|
-
|
|
22284
|
-
* @example
|
|
22285
|
-
* // Styles as object usage
|
|
22286
|
-
* const styles = {
|
|
22287
|
-
* background: transparentize(0.1, '#fff'),
|
|
22288
|
-
* background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
|
|
22289
|
-
* background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'),
|
|
22290
|
-
* }
|
|
22291
|
-
*
|
|
22292
|
-
* // styled-components usage
|
|
22293
|
-
* const div = styled.div`
|
|
22294
|
-
* background: ${transparentize(0.1, '#fff')};
|
|
22295
|
-
* background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')};
|
|
22296
|
-
* background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')};
|
|
22297
|
-
* `
|
|
22298
|
-
*
|
|
22299
|
-
* // CSS in JS Output
|
|
22300
|
-
*
|
|
22301
|
-
* element {
|
|
22302
|
-
* background: "rgba(255,255,255,0.9)";
|
|
22303
|
-
* background: "rgba(255,255,255,0.8)";
|
|
22304
|
-
* background: "rgba(255,0,0,0.3)";
|
|
22305
|
-
* }
|
|
22306
|
-
*/
|
|
22307
|
-
function transparentize(amount, color) {
|
|
22308
|
-
if (color === 'transparent') return color;
|
|
22309
|
-
var parsedColor = parseToRgb(color);
|
|
22310
|
-
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
22311
|
-
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
22312
|
-
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
|
22313
|
-
});
|
|
22314
|
-
return rgba$1(colorWithAlpha);
|
|
22315
|
-
}
|
|
22316
|
-
|
|
22317
|
-
// prettier-ignore
|
|
22318
|
-
var curriedTransparentize = curry /* ::<number | string, string, string> */(transparentize);
|
|
21774
|
+
var curriedTint = /*#__PURE__*/curry
|
|
21775
|
+
/* ::<number | string, string, string> */
|
|
21776
|
+
(tint);
|
|
21777
|
+
var curriedTint$1 = curriedTint;
|
|
22319
21778
|
|
|
22320
21779
|
var linkColor = MATISSE_BLUE;
|
|
22321
21780
|
var fallbackValues$8 = {
|
|
@@ -22450,6 +21909,8 @@ var ExternalLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
22450
21909
|
extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles,
|
|
22451
21910
|
_ref$variant = _ref.variant,
|
|
22452
21911
|
variant = _ref$variant === void 0 ? "primary" : _ref$variant,
|
|
21912
|
+
_ref$containerTabInde = _ref.containerTabIndex,
|
|
21913
|
+
containerTabIndex = _ref$containerTabInde === void 0 ? "-1" : _ref$containerTabInde,
|
|
22453
21914
|
_ref$tabIndex = _ref.tabIndex,
|
|
22454
21915
|
tabIndex = _ref$tabIndex === void 0 ? "0" : _ref$tabIndex,
|
|
22455
21916
|
dataQa = _ref.dataQa,
|
|
@@ -22469,7 +21930,7 @@ var ExternalLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
22469
21930
|
};
|
|
22470
21931
|
return /*#__PURE__*/React.createElement(Box, {
|
|
22471
21932
|
padding: "0",
|
|
22472
|
-
tabIndex:
|
|
21933
|
+
tabIndex: containerTabIndex,
|
|
22473
21934
|
onKeyDown: handleKeyDown
|
|
22474
21935
|
}, /*#__PURE__*/React.createElement(StyledExternalLink, {
|
|
22475
21936
|
href: href,
|
|
@@ -22481,7 +21942,7 @@ var ExternalLink = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
22481
21942
|
hovercolor: themeValues.hoverColor,
|
|
22482
21943
|
activeColor: themeValues.activeColor,
|
|
22483
21944
|
fontFamily: themeValues.fontFamily,
|
|
22484
|
-
tabIndex:
|
|
21945
|
+
tabIndex: tabIndex,
|
|
22485
21946
|
extrastyles: extraStyles,
|
|
22486
21947
|
rel: newTab ? "noopener" : "",
|
|
22487
21948
|
"data-qa": dataQa,
|
|
@@ -23633,19 +23094,32 @@ var toIndexedObject = function (it) {
|
|
|
23633
23094
|
return indexedObject(requireObjectCoercible(it));
|
|
23634
23095
|
};
|
|
23635
23096
|
|
|
23636
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
23637
23097
|
var documentAll = typeof document == 'object' && document.all;
|
|
23638
23098
|
|
|
23099
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
23100
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
23101
|
+
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
23102
|
+
|
|
23103
|
+
var documentAll_1 = {
|
|
23104
|
+
all: documentAll,
|
|
23105
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
23106
|
+
};
|
|
23107
|
+
|
|
23108
|
+
var documentAll$1 = documentAll_1.all;
|
|
23109
|
+
|
|
23639
23110
|
// `IsCallable` abstract operation
|
|
23640
23111
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
23641
|
-
|
|
23642
|
-
|
|
23643
|
-
return typeof argument == 'function' || argument === documentAll;
|
|
23112
|
+
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
23113
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
23644
23114
|
} : function (argument) {
|
|
23645
23115
|
return typeof argument == 'function';
|
|
23646
23116
|
};
|
|
23647
23117
|
|
|
23648
|
-
var
|
|
23118
|
+
var documentAll$2 = documentAll_1.all;
|
|
23119
|
+
|
|
23120
|
+
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
23121
|
+
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
23122
|
+
} : function (it) {
|
|
23649
23123
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
23650
23124
|
};
|
|
23651
23125
|
|
|
@@ -23781,10 +23255,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
23781
23255
|
(module.exports = function (key, value) {
|
|
23782
23256
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
23783
23257
|
})('versions', []).push({
|
|
23784
|
-
version: '3.
|
|
23258
|
+
version: '3.33.3',
|
|
23785
23259
|
mode: 'global',
|
|
23786
|
-
copyright: '© 2014-
|
|
23787
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
23260
|
+
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
23261
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE',
|
|
23788
23262
|
source: 'https://github.com/zloirock/core-js'
|
|
23789
23263
|
});
|
|
23790
23264
|
});
|
|
@@ -24081,7 +23555,7 @@ var TEMPLATE = String(String).split('String');
|
|
|
24081
23555
|
|
|
24082
23556
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
24083
23557
|
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
24084
|
-
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)
|
|
23558
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
24085
23559
|
}
|
|
24086
23560
|
if (options && options.getter) name = 'get ' + name;
|
|
24087
23561
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -24169,8 +23643,7 @@ var min$1 = Math.min;
|
|
|
24169
23643
|
// `ToLength` abstract operation
|
|
24170
23644
|
// https://tc39.es/ecma262/#sec-tolength
|
|
24171
23645
|
var toLength = function (argument) {
|
|
24172
|
-
|
|
24173
|
-
return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
23646
|
+
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
24174
23647
|
};
|
|
24175
23648
|
|
|
24176
23649
|
// `LengthOfArrayLike` abstract operation
|
|
@@ -24330,7 +23803,7 @@ var _export = function (options, source) {
|
|
|
24330
23803
|
} else if (STATIC) {
|
|
24331
23804
|
target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
24332
23805
|
} else {
|
|
24333
|
-
target = global_1[TARGET]
|
|
23806
|
+
target = (global_1[TARGET] || {}).prototype;
|
|
24334
23807
|
}
|
|
24335
23808
|
if (target) for (key in source) {
|
|
24336
23809
|
sourceProperty = source[key];
|
|
@@ -24593,15 +24066,11 @@ var functionUncurryThisAccessor = function (object, key, method) {
|
|
|
24593
24066
|
} catch (error) { /* empty */ }
|
|
24594
24067
|
};
|
|
24595
24068
|
|
|
24596
|
-
var isPossiblePrototype = function (argument) {
|
|
24597
|
-
return isObject(argument) || argument === null;
|
|
24598
|
-
};
|
|
24599
|
-
|
|
24600
24069
|
var $String$4 = String;
|
|
24601
24070
|
var $TypeError$6 = TypeError;
|
|
24602
24071
|
|
|
24603
24072
|
var aPossiblePrototype = function (argument) {
|
|
24604
|
-
if (
|
|
24073
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
24605
24074
|
throw new $TypeError$6("Can't set " + $String$4(argument) + ' as a prototype');
|
|
24606
24075
|
};
|
|
24607
24076
|
|