@thecb/components 10.3.1 → 10.3.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 +629 -96
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +629 -96
- package/dist/index.esm.js.map +1 -1
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +49322 -0
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- package/src/components/molecules/registration-form/RegistrationForm.js +6 -3
- package/src/components/molecules/registration-form/RegistrationForm.state.js +4 -3
package/dist/index.cjs.js
CHANGED
|
@@ -19256,7 +19256,6 @@ function _wrapNativeSuper(Class) {
|
|
|
19256
19256
|
}
|
|
19257
19257
|
|
|
19258
19258
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
19259
|
-
|
|
19260
19259
|
/**
|
|
19261
19260
|
* Parse errors.md and turn it into a simple hash of code: message
|
|
19262
19261
|
* @private
|
|
@@ -19341,84 +19340,71 @@ var ERRORS = {
|
|
|
19341
19340
|
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
19342
19341
|
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
19343
19342
|
};
|
|
19343
|
+
|
|
19344
19344
|
/**
|
|
19345
19345
|
* super basic version of sprintf
|
|
19346
19346
|
* @private
|
|
19347
19347
|
*/
|
|
19348
|
-
|
|
19349
19348
|
function format() {
|
|
19350
19349
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19351
19350
|
args[_key] = arguments[_key];
|
|
19352
19351
|
}
|
|
19353
|
-
|
|
19354
19352
|
var a = args[0];
|
|
19355
19353
|
var b = [];
|
|
19356
19354
|
var c;
|
|
19357
|
-
|
|
19358
19355
|
for (c = 1; c < args.length; c += 1) {
|
|
19359
19356
|
b.push(args[c]);
|
|
19360
19357
|
}
|
|
19361
|
-
|
|
19362
19358
|
b.forEach(function (d) {
|
|
19363
19359
|
a = a.replace(/%[a-z]/, d);
|
|
19364
19360
|
});
|
|
19365
19361
|
return a;
|
|
19366
19362
|
}
|
|
19363
|
+
|
|
19367
19364
|
/**
|
|
19368
19365
|
* Create an error file out of errors.md for development and a simple web link to the full errors
|
|
19369
19366
|
* in production mode.
|
|
19370
19367
|
* @private
|
|
19371
19368
|
*/
|
|
19372
|
-
|
|
19373
|
-
|
|
19374
19369
|
var PolishedError = /*#__PURE__*/function (_Error) {
|
|
19375
19370
|
_inheritsLoose(PolishedError, _Error);
|
|
19376
|
-
|
|
19377
19371
|
function PolishedError(code) {
|
|
19378
19372
|
var _this;
|
|
19379
|
-
|
|
19380
19373
|
if (process.env.NODE_ENV === 'production') {
|
|
19381
19374
|
_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;
|
|
19382
19375
|
} else {
|
|
19383
19376
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
19384
19377
|
args[_key2 - 1] = arguments[_key2];
|
|
19385
19378
|
}
|
|
19386
|
-
|
|
19387
19379
|
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
19388
19380
|
}
|
|
19389
|
-
|
|
19390
19381
|
return _assertThisInitialized(_this);
|
|
19391
19382
|
}
|
|
19392
|
-
|
|
19393
19383
|
return PolishedError;
|
|
19394
19384
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
19395
19385
|
|
|
19396
19386
|
function colorToInt(color) {
|
|
19397
19387
|
return Math.round(color * 255);
|
|
19398
19388
|
}
|
|
19399
|
-
|
|
19400
19389
|
function convertToInt(red, green, blue) {
|
|
19401
19390
|
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
19402
19391
|
}
|
|
19403
|
-
|
|
19404
19392
|
function hslToRgb(hue, saturation, lightness, convert) {
|
|
19405
19393
|
if (convert === void 0) {
|
|
19406
19394
|
convert = convertToInt;
|
|
19407
19395
|
}
|
|
19408
|
-
|
|
19409
19396
|
if (saturation === 0) {
|
|
19410
19397
|
// achromatic
|
|
19411
19398
|
return convert(lightness, lightness, lightness);
|
|
19412
|
-
}
|
|
19413
|
-
|
|
19399
|
+
}
|
|
19414
19400
|
|
|
19401
|
+
// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
19415
19402
|
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
19416
19403
|
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
19417
19404
|
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
19418
19405
|
var red = 0;
|
|
19419
19406
|
var green = 0;
|
|
19420
19407
|
var blue = 0;
|
|
19421
|
-
|
|
19422
19408
|
if (huePrime >= 0 && huePrime < 1) {
|
|
19423
19409
|
red = chroma;
|
|
19424
19410
|
green = secondComponent;
|
|
@@ -19438,7 +19424,6 @@ function hslToRgb(hue, saturation, lightness, convert) {
|
|
|
19438
19424
|
red = chroma;
|
|
19439
19425
|
blue = secondComponent;
|
|
19440
19426
|
}
|
|
19441
|
-
|
|
19442
19427
|
var lightnessModification = lightness - chroma / 2;
|
|
19443
19428
|
var finalRed = red + lightnessModification;
|
|
19444
19429
|
var finalGreen = green + lightnessModification;
|
|
@@ -19596,11 +19581,11 @@ var namedColorMap = {
|
|
|
19596
19581
|
yellow: 'ff0',
|
|
19597
19582
|
yellowgreen: '9acd32'
|
|
19598
19583
|
};
|
|
19584
|
+
|
|
19599
19585
|
/**
|
|
19600
19586
|
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
|
|
19601
19587
|
* @private
|
|
19602
19588
|
*/
|
|
19603
|
-
|
|
19604
19589
|
function nameToHex(color) {
|
|
19605
19590
|
if (typeof color !== 'string') return color;
|
|
19606
19591
|
var normalizedColorName = color.toLowerCase();
|
|
@@ -19615,6 +19600,7 @@ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\
|
|
|
19615
19600
|
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
19616
19601
|
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;
|
|
19617
19602
|
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;
|
|
19603
|
+
|
|
19618
19604
|
/**
|
|
19619
19605
|
* Returns an RgbColor or RgbaColor object. This utility function is only useful
|
|
19620
19606
|
* if want to extract a color component. With the color util `toColorString` you
|
|
@@ -19626,14 +19612,11 @@ var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[
|
|
|
19626
19612
|
* // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
|
|
19627
19613
|
* const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
|
|
19628
19614
|
*/
|
|
19629
|
-
|
|
19630
19615
|
function parseToRgb(color) {
|
|
19631
19616
|
if (typeof color !== 'string') {
|
|
19632
19617
|
throw new PolishedError(3);
|
|
19633
19618
|
}
|
|
19634
|
-
|
|
19635
19619
|
var normalizedColor = nameToHex(color);
|
|
19636
|
-
|
|
19637
19620
|
if (normalizedColor.match(hexRegex)) {
|
|
19638
19621
|
return {
|
|
19639
19622
|
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
@@ -19641,7 +19624,6 @@ function parseToRgb(color) {
|
|
|
19641
19624
|
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
19642
19625
|
};
|
|
19643
19626
|
}
|
|
19644
|
-
|
|
19645
19627
|
if (normalizedColor.match(hexRgbaRegex)) {
|
|
19646
19628
|
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
19647
19629
|
return {
|
|
@@ -19651,7 +19633,6 @@ function parseToRgb(color) {
|
|
|
19651
19633
|
alpha: alpha
|
|
19652
19634
|
};
|
|
19653
19635
|
}
|
|
19654
|
-
|
|
19655
19636
|
if (normalizedColor.match(reducedHexRegex)) {
|
|
19656
19637
|
return {
|
|
19657
19638
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
@@ -19659,10 +19640,8 @@ function parseToRgb(color) {
|
|
|
19659
19640
|
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
19660
19641
|
};
|
|
19661
19642
|
}
|
|
19662
|
-
|
|
19663
19643
|
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
19664
19644
|
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
19665
|
-
|
|
19666
19645
|
return {
|
|
19667
19646
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
19668
19647
|
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
@@ -19670,9 +19649,7 @@ function parseToRgb(color) {
|
|
|
19670
19649
|
alpha: _alpha
|
|
19671
19650
|
};
|
|
19672
19651
|
}
|
|
19673
|
-
|
|
19674
19652
|
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
19675
|
-
|
|
19676
19653
|
if (rgbMatched) {
|
|
19677
19654
|
return {
|
|
19678
19655
|
red: parseInt("" + rgbMatched[1], 10),
|
|
@@ -19680,9 +19657,7 @@ function parseToRgb(color) {
|
|
|
19680
19657
|
blue: parseInt("" + rgbMatched[3], 10)
|
|
19681
19658
|
};
|
|
19682
19659
|
}
|
|
19683
|
-
|
|
19684
19660
|
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
19685
|
-
|
|
19686
19661
|
if (rgbaMatched) {
|
|
19687
19662
|
return {
|
|
19688
19663
|
red: parseInt("" + rgbaMatched[1], 10),
|
|
@@ -19691,44 +19666,32 @@ function parseToRgb(color) {
|
|
|
19691
19666
|
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
19692
19667
|
};
|
|
19693
19668
|
}
|
|
19694
|
-
|
|
19695
19669
|
var hslMatched = hslRegex.exec(normalizedColor);
|
|
19696
|
-
|
|
19697
19670
|
if (hslMatched) {
|
|
19698
19671
|
var hue = parseInt("" + hslMatched[1], 10);
|
|
19699
19672
|
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
19700
19673
|
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
19701
19674
|
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
19702
19675
|
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
19703
|
-
|
|
19704
19676
|
if (!hslRgbMatched) {
|
|
19705
19677
|
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
19706
19678
|
}
|
|
19707
|
-
|
|
19708
19679
|
return {
|
|
19709
19680
|
red: parseInt("" + hslRgbMatched[1], 10),
|
|
19710
19681
|
green: parseInt("" + hslRgbMatched[2], 10),
|
|
19711
19682
|
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
19712
19683
|
};
|
|
19713
19684
|
}
|
|
19714
|
-
|
|
19715
19685
|
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
19716
|
-
|
|
19717
19686
|
if (hslaMatched) {
|
|
19718
19687
|
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
19719
|
-
|
|
19720
19688
|
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
19721
|
-
|
|
19722
19689
|
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
19723
|
-
|
|
19724
19690
|
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
19725
|
-
|
|
19726
19691
|
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
19727
|
-
|
|
19728
19692
|
if (!_hslRgbMatched) {
|
|
19729
19693
|
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
19730
19694
|
}
|
|
19731
|
-
|
|
19732
19695
|
return {
|
|
19733
19696
|
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
19734
19697
|
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
@@ -19736,10 +19699,82 @@ function parseToRgb(color) {
|
|
|
19736
19699
|
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
19737
19700
|
};
|
|
19738
19701
|
}
|
|
19739
|
-
|
|
19740
19702
|
throw new PolishedError(5);
|
|
19741
19703
|
}
|
|
19742
19704
|
|
|
19705
|
+
function rgbToHsl(color) {
|
|
19706
|
+
// make sure rgb are contained in a set of [0, 255]
|
|
19707
|
+
var red = color.red / 255;
|
|
19708
|
+
var green = color.green / 255;
|
|
19709
|
+
var blue = color.blue / 255;
|
|
19710
|
+
var max = Math.max(red, green, blue);
|
|
19711
|
+
var min = Math.min(red, green, blue);
|
|
19712
|
+
var lightness = (max + min) / 2;
|
|
19713
|
+
if (max === min) {
|
|
19714
|
+
// achromatic
|
|
19715
|
+
if (color.alpha !== undefined) {
|
|
19716
|
+
return {
|
|
19717
|
+
hue: 0,
|
|
19718
|
+
saturation: 0,
|
|
19719
|
+
lightness: lightness,
|
|
19720
|
+
alpha: color.alpha
|
|
19721
|
+
};
|
|
19722
|
+
} else {
|
|
19723
|
+
return {
|
|
19724
|
+
hue: 0,
|
|
19725
|
+
saturation: 0,
|
|
19726
|
+
lightness: lightness
|
|
19727
|
+
};
|
|
19728
|
+
}
|
|
19729
|
+
}
|
|
19730
|
+
var hue;
|
|
19731
|
+
var delta = max - min;
|
|
19732
|
+
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
19733
|
+
switch (max) {
|
|
19734
|
+
case red:
|
|
19735
|
+
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
19736
|
+
break;
|
|
19737
|
+
case green:
|
|
19738
|
+
hue = (blue - red) / delta + 2;
|
|
19739
|
+
break;
|
|
19740
|
+
default:
|
|
19741
|
+
// blue case
|
|
19742
|
+
hue = (red - green) / delta + 4;
|
|
19743
|
+
break;
|
|
19744
|
+
}
|
|
19745
|
+
hue *= 60;
|
|
19746
|
+
if (color.alpha !== undefined) {
|
|
19747
|
+
return {
|
|
19748
|
+
hue: hue,
|
|
19749
|
+
saturation: saturation,
|
|
19750
|
+
lightness: lightness,
|
|
19751
|
+
alpha: color.alpha
|
|
19752
|
+
};
|
|
19753
|
+
}
|
|
19754
|
+
return {
|
|
19755
|
+
hue: hue,
|
|
19756
|
+
saturation: saturation,
|
|
19757
|
+
lightness: lightness
|
|
19758
|
+
};
|
|
19759
|
+
}
|
|
19760
|
+
|
|
19761
|
+
/**
|
|
19762
|
+
* Returns an HslColor or HslaColor object. This utility function is only useful
|
|
19763
|
+
* if want to extract a color component. With the color util `toColorString` you
|
|
19764
|
+
* can convert a HslColor or HslaColor object back to a string.
|
|
19765
|
+
*
|
|
19766
|
+
* @example
|
|
19767
|
+
* // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1
|
|
19768
|
+
* const color1 = parseToHsl('rgb(255, 0, 0)');
|
|
19769
|
+
* // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2
|
|
19770
|
+
* const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)');
|
|
19771
|
+
*/
|
|
19772
|
+
function parseToHsl(color) {
|
|
19773
|
+
// Note: At a later stage we can optimize this function as right now a hsl
|
|
19774
|
+
// color would be parsed converted to rgb values and converted back to hsl.
|
|
19775
|
+
return rgbToHsl(parseToRgb(color));
|
|
19776
|
+
}
|
|
19777
|
+
|
|
19743
19778
|
/**
|
|
19744
19779
|
* Reduces hex values if possible e.g. #ff8866 to #f86
|
|
19745
19780
|
* @private
|
|
@@ -19748,10 +19783,8 @@ var reduceHexValue = function reduceHexValue(value) {
|
|
|
19748
19783
|
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
19749
19784
|
return "#" + value[1] + value[3] + value[5];
|
|
19750
19785
|
}
|
|
19751
|
-
|
|
19752
19786
|
return value;
|
|
19753
19787
|
};
|
|
19754
|
-
|
|
19755
19788
|
var reduceHexValue$1 = reduceHexValue;
|
|
19756
19789
|
|
|
19757
19790
|
function numberToHex(value) {
|
|
@@ -19759,6 +19792,83 @@ function numberToHex(value) {
|
|
|
19759
19792
|
return hex.length === 1 ? "0" + hex : hex;
|
|
19760
19793
|
}
|
|
19761
19794
|
|
|
19795
|
+
function colorToHex(color) {
|
|
19796
|
+
return numberToHex(Math.round(color * 255));
|
|
19797
|
+
}
|
|
19798
|
+
function convertToHex(red, green, blue) {
|
|
19799
|
+
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
|
19800
|
+
}
|
|
19801
|
+
function hslToHex(hue, saturation, lightness) {
|
|
19802
|
+
return hslToRgb(hue, saturation, lightness, convertToHex);
|
|
19803
|
+
}
|
|
19804
|
+
|
|
19805
|
+
/**
|
|
19806
|
+
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
19807
|
+
*
|
|
19808
|
+
* @example
|
|
19809
|
+
* // Styles as object usage
|
|
19810
|
+
* const styles = {
|
|
19811
|
+
* background: hsl(359, 0.75, 0.4),
|
|
19812
|
+
* background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }),
|
|
19813
|
+
* }
|
|
19814
|
+
*
|
|
19815
|
+
* // styled-components usage
|
|
19816
|
+
* const div = styled.div`
|
|
19817
|
+
* background: ${hsl(359, 0.75, 0.4)};
|
|
19818
|
+
* background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })};
|
|
19819
|
+
* `
|
|
19820
|
+
*
|
|
19821
|
+
* // CSS in JS Output
|
|
19822
|
+
*
|
|
19823
|
+
* element {
|
|
19824
|
+
* background: "#b3191c";
|
|
19825
|
+
* background: "#b3191c";
|
|
19826
|
+
* }
|
|
19827
|
+
*/
|
|
19828
|
+
function hsl(value, saturation, lightness) {
|
|
19829
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
|
|
19830
|
+
return hslToHex(value, saturation, lightness);
|
|
19831
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
|
|
19832
|
+
return hslToHex(value.hue, value.saturation, value.lightness);
|
|
19833
|
+
}
|
|
19834
|
+
throw new PolishedError(1);
|
|
19835
|
+
}
|
|
19836
|
+
|
|
19837
|
+
/**
|
|
19838
|
+
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
|
|
19839
|
+
*
|
|
19840
|
+
* @example
|
|
19841
|
+
* // Styles as object usage
|
|
19842
|
+
* const styles = {
|
|
19843
|
+
* background: hsla(359, 0.75, 0.4, 0.7),
|
|
19844
|
+
* background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }),
|
|
19845
|
+
* background: hsla(359, 0.75, 0.4, 1),
|
|
19846
|
+
* }
|
|
19847
|
+
*
|
|
19848
|
+
* // styled-components usage
|
|
19849
|
+
* const div = styled.div`
|
|
19850
|
+
* background: ${hsla(359, 0.75, 0.4, 0.7)};
|
|
19851
|
+
* background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })};
|
|
19852
|
+
* background: ${hsla(359, 0.75, 0.4, 1)};
|
|
19853
|
+
* `
|
|
19854
|
+
*
|
|
19855
|
+
* // CSS in JS Output
|
|
19856
|
+
*
|
|
19857
|
+
* element {
|
|
19858
|
+
* background: "rgba(179,25,28,0.7)";
|
|
19859
|
+
* background: "rgba(179,25,28,0.7)";
|
|
19860
|
+
* background: "#b3191c";
|
|
19861
|
+
* }
|
|
19862
|
+
*/
|
|
19863
|
+
function hsla$1(value, saturation, lightness, alpha) {
|
|
19864
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
|
|
19865
|
+
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
|
19866
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
|
|
19867
|
+
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
|
19868
|
+
}
|
|
19869
|
+
throw new PolishedError(2);
|
|
19870
|
+
}
|
|
19871
|
+
|
|
19762
19872
|
/**
|
|
19763
19873
|
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
19764
19874
|
*
|
|
@@ -19788,7 +19898,6 @@ function rgb(value, green, blue) {
|
|
|
19788
19898
|
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
|
19789
19899
|
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
19790
19900
|
}
|
|
19791
|
-
|
|
19792
19901
|
throw new PolishedError(6);
|
|
19793
19902
|
}
|
|
19794
19903
|
|
|
@@ -19835,10 +19944,62 @@ function rgba$1(firstValue, secondValue, thirdValue, fourthValue) {
|
|
|
19835
19944
|
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
|
|
19836
19945
|
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
19837
19946
|
}
|
|
19838
|
-
|
|
19839
19947
|
throw new PolishedError(7);
|
|
19840
19948
|
}
|
|
19841
19949
|
|
|
19950
|
+
var isRgb = function isRgb(color) {
|
|
19951
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
19952
|
+
};
|
|
19953
|
+
var isRgba$1 = function isRgba(color) {
|
|
19954
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
|
|
19955
|
+
};
|
|
19956
|
+
var isHsl = function isHsl(color) {
|
|
19957
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
19958
|
+
};
|
|
19959
|
+
var isHsla$1 = function isHsla(color) {
|
|
19960
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
|
|
19961
|
+
};
|
|
19962
|
+
|
|
19963
|
+
/**
|
|
19964
|
+
* Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string.
|
|
19965
|
+
* This util is useful in case you only know on runtime which color object is
|
|
19966
|
+
* used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`.
|
|
19967
|
+
*
|
|
19968
|
+
* @example
|
|
19969
|
+
* // Styles as object usage
|
|
19970
|
+
* const styles = {
|
|
19971
|
+
* background: toColorString({ red: 255, green: 205, blue: 100 }),
|
|
19972
|
+
* background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }),
|
|
19973
|
+
* background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }),
|
|
19974
|
+
* background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }),
|
|
19975
|
+
* }
|
|
19976
|
+
*
|
|
19977
|
+
* // styled-components usage
|
|
19978
|
+
* const div = styled.div`
|
|
19979
|
+
* background: ${toColorString({ red: 255, green: 205, blue: 100 })};
|
|
19980
|
+
* background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })};
|
|
19981
|
+
* background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })};
|
|
19982
|
+
* background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })};
|
|
19983
|
+
* `
|
|
19984
|
+
*
|
|
19985
|
+
* // CSS in JS Output
|
|
19986
|
+
* element {
|
|
19987
|
+
* background: "#ffcd64";
|
|
19988
|
+
* background: "rgba(255,205,100,0.72)";
|
|
19989
|
+
* background: "#00f";
|
|
19990
|
+
* background: "rgba(179,25,25,0.72)";
|
|
19991
|
+
* }
|
|
19992
|
+
*/
|
|
19993
|
+
|
|
19994
|
+
function toColorString(color) {
|
|
19995
|
+
if (typeof color !== 'object') throw new PolishedError(8);
|
|
19996
|
+
if (isRgba$1(color)) return rgba$1(color);
|
|
19997
|
+
if (isRgb(color)) return rgb(color);
|
|
19998
|
+
if (isHsla$1(color)) return hsla$1(color);
|
|
19999
|
+
if (isHsl(color)) return hsl(color);
|
|
20000
|
+
throw new PolishedError(8);
|
|
20001
|
+
}
|
|
20002
|
+
|
|
19842
20003
|
// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
|
|
19843
20004
|
// eslint-disable-next-line no-unused-vars
|
|
19844
20005
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -19849,14 +20010,156 @@ function curried(f, length, acc) {
|
|
|
19849
20010
|
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
19850
20011
|
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
|
19851
20012
|
};
|
|
19852
|
-
}
|
|
19853
|
-
|
|
20013
|
+
}
|
|
19854
20014
|
|
|
20015
|
+
// eslint-disable-next-line no-redeclare
|
|
19855
20016
|
function curry(f) {
|
|
19856
20017
|
// eslint-disable-line no-redeclare
|
|
19857
20018
|
return curried(f, f.length, []);
|
|
19858
20019
|
}
|
|
19859
20020
|
|
|
20021
|
+
/**
|
|
20022
|
+
* Changes the hue of the color. Hue is a number between 0 to 360. The first
|
|
20023
|
+
* argument for adjustHue is the amount of degrees the color is rotated around
|
|
20024
|
+
* the color wheel, always producing a positive hue value.
|
|
20025
|
+
*
|
|
20026
|
+
* @example
|
|
20027
|
+
* // Styles as object usage
|
|
20028
|
+
* const styles = {
|
|
20029
|
+
* background: adjustHue(180, '#448'),
|
|
20030
|
+
* background: adjustHue('180', 'rgba(101,100,205,0.7)'),
|
|
20031
|
+
* }
|
|
20032
|
+
*
|
|
20033
|
+
* // styled-components usage
|
|
20034
|
+
* const div = styled.div`
|
|
20035
|
+
* background: ${adjustHue(180, '#448')};
|
|
20036
|
+
* background: ${adjustHue('180', 'rgba(101,100,205,0.7)')};
|
|
20037
|
+
* `
|
|
20038
|
+
*
|
|
20039
|
+
* // CSS in JS Output
|
|
20040
|
+
* element {
|
|
20041
|
+
* background: "#888844";
|
|
20042
|
+
* background: "rgba(136,136,68,0.7)";
|
|
20043
|
+
* }
|
|
20044
|
+
*/
|
|
20045
|
+
function adjustHue(degree, color) {
|
|
20046
|
+
if (color === 'transparent') return color;
|
|
20047
|
+
var hslColor = parseToHsl(color);
|
|
20048
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20049
|
+
hue: hslColor.hue + parseFloat(degree)
|
|
20050
|
+
}));
|
|
20051
|
+
}
|
|
20052
|
+
|
|
20053
|
+
// prettier-ignore
|
|
20054
|
+
var curriedAdjustHue = curry /* ::<number | string, string, string> */(adjustHue);
|
|
20055
|
+
|
|
20056
|
+
function guard(lowerBoundary, upperBoundary, value) {
|
|
20057
|
+
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
|
20058
|
+
}
|
|
20059
|
+
|
|
20060
|
+
/**
|
|
20061
|
+
* Returns a string value for the darkened color.
|
|
20062
|
+
*
|
|
20063
|
+
* @example
|
|
20064
|
+
* // Styles as object usage
|
|
20065
|
+
* const styles = {
|
|
20066
|
+
* background: darken(0.2, '#FFCD64'),
|
|
20067
|
+
* background: darken('0.2', 'rgba(255,205,100,0.7)'),
|
|
20068
|
+
* }
|
|
20069
|
+
*
|
|
20070
|
+
* // styled-components usage
|
|
20071
|
+
* const div = styled.div`
|
|
20072
|
+
* background: ${darken(0.2, '#FFCD64')};
|
|
20073
|
+
* background: ${darken('0.2', 'rgba(255,205,100,0.7)')};
|
|
20074
|
+
* `
|
|
20075
|
+
*
|
|
20076
|
+
* // CSS in JS Output
|
|
20077
|
+
*
|
|
20078
|
+
* element {
|
|
20079
|
+
* background: "#ffbd31";
|
|
20080
|
+
* background: "rgba(255,189,49,0.7)";
|
|
20081
|
+
* }
|
|
20082
|
+
*/
|
|
20083
|
+
function darken(amount, color) {
|
|
20084
|
+
if (color === 'transparent') return color;
|
|
20085
|
+
var hslColor = parseToHsl(color);
|
|
20086
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20087
|
+
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
|
20088
|
+
}));
|
|
20089
|
+
}
|
|
20090
|
+
|
|
20091
|
+
// prettier-ignore
|
|
20092
|
+
var curriedDarken = curry /* ::<number | string, string, string> */(darken);
|
|
20093
|
+
|
|
20094
|
+
/**
|
|
20095
|
+
* Decreases the intensity of a color. Its range is between 0 to 1. The first
|
|
20096
|
+
* argument of the desaturate function is the amount by how much the color
|
|
20097
|
+
* intensity should be decreased.
|
|
20098
|
+
*
|
|
20099
|
+
* @example
|
|
20100
|
+
* // Styles as object usage
|
|
20101
|
+
* const styles = {
|
|
20102
|
+
* background: desaturate(0.2, '#CCCD64'),
|
|
20103
|
+
* background: desaturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20104
|
+
* }
|
|
20105
|
+
*
|
|
20106
|
+
* // styled-components usage
|
|
20107
|
+
* const div = styled.div`
|
|
20108
|
+
* background: ${desaturate(0.2, '#CCCD64')};
|
|
20109
|
+
* background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20110
|
+
* `
|
|
20111
|
+
*
|
|
20112
|
+
* // CSS in JS Output
|
|
20113
|
+
* element {
|
|
20114
|
+
* background: "#b8b979";
|
|
20115
|
+
* background: "rgba(184,185,121,0.7)";
|
|
20116
|
+
* }
|
|
20117
|
+
*/
|
|
20118
|
+
function desaturate(amount, color) {
|
|
20119
|
+
if (color === 'transparent') return color;
|
|
20120
|
+
var hslColor = parseToHsl(color);
|
|
20121
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20122
|
+
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
|
20123
|
+
}));
|
|
20124
|
+
}
|
|
20125
|
+
|
|
20126
|
+
// prettier-ignore
|
|
20127
|
+
var curriedDesaturate = curry /* ::<number | string, string, string> */(desaturate);
|
|
20128
|
+
|
|
20129
|
+
/**
|
|
20130
|
+
* Returns a string value for the lightened color.
|
|
20131
|
+
*
|
|
20132
|
+
* @example
|
|
20133
|
+
* // Styles as object usage
|
|
20134
|
+
* const styles = {
|
|
20135
|
+
* background: lighten(0.2, '#CCCD64'),
|
|
20136
|
+
* background: lighten('0.2', 'rgba(204,205,100,0.7)'),
|
|
20137
|
+
* }
|
|
20138
|
+
*
|
|
20139
|
+
* // styled-components usage
|
|
20140
|
+
* const div = styled.div`
|
|
20141
|
+
* background: ${lighten(0.2, '#FFCD64')};
|
|
20142
|
+
* background: ${lighten('0.2', 'rgba(204,205,100,0.7)')};
|
|
20143
|
+
* `
|
|
20144
|
+
*
|
|
20145
|
+
* // CSS in JS Output
|
|
20146
|
+
*
|
|
20147
|
+
* element {
|
|
20148
|
+
* background: "#e5e6b1";
|
|
20149
|
+
* background: "rgba(229,230,177,0.7)";
|
|
20150
|
+
* }
|
|
20151
|
+
*/
|
|
20152
|
+
function lighten(amount, color) {
|
|
20153
|
+
if (color === 'transparent') return color;
|
|
20154
|
+
var hslColor = parseToHsl(color);
|
|
20155
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20156
|
+
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
|
20157
|
+
}));
|
|
20158
|
+
}
|
|
20159
|
+
|
|
20160
|
+
// prettier-ignore
|
|
20161
|
+
var curriedLighten = curry /* ::<number | string, string, string> */(lighten);
|
|
20162
|
+
|
|
19860
20163
|
/**
|
|
19861
20164
|
* 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.
|
|
19862
20165
|
*
|
|
@@ -19883,25 +20186,21 @@ function curry(f) {
|
|
|
19883
20186
|
* background: "rgba(63, 0, 191, 0.75)";
|
|
19884
20187
|
* }
|
|
19885
20188
|
*/
|
|
19886
|
-
|
|
19887
20189
|
function mix$1(weight, color, otherColor) {
|
|
19888
20190
|
if (color === 'transparent') return otherColor;
|
|
19889
20191
|
if (otherColor === 'transparent') return color;
|
|
19890
20192
|
if (weight === 0) return otherColor;
|
|
19891
20193
|
var parsedColor1 = parseToRgb(color);
|
|
19892
|
-
|
|
19893
20194
|
var color1 = _extends$1({}, parsedColor1, {
|
|
19894
20195
|
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
|
|
19895
20196
|
});
|
|
19896
|
-
|
|
19897
20197
|
var parsedColor2 = parseToRgb(otherColor);
|
|
19898
|
-
|
|
19899
20198
|
var color2 = _extends$1({}, parsedColor2, {
|
|
19900
20199
|
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
|
|
19901
|
-
});
|
|
19902
|
-
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
19903
|
-
|
|
20200
|
+
});
|
|
19904
20201
|
|
|
20202
|
+
// The formula is copied from the original Sass implementation:
|
|
20203
|
+
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
19905
20204
|
var alphaDelta = color1.alpha - color2.alpha;
|
|
19906
20205
|
var x = parseFloat(weight) * 2 - 1;
|
|
19907
20206
|
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
|
|
@@ -19915,14 +20214,218 @@ function mix$1(weight, color, otherColor) {
|
|
|
19915
20214
|
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
|
19916
20215
|
};
|
|
19917
20216
|
return rgba$1(mixedColor);
|
|
19918
|
-
}
|
|
19919
|
-
|
|
20217
|
+
}
|
|
19920
20218
|
|
|
19921
|
-
|
|
19922
|
-
/* ::<number | string, string, string, string> */
|
|
19923
|
-
(mix$1);
|
|
20219
|
+
// prettier-ignore
|
|
20220
|
+
var curriedMix = curry /* ::<number | string, string, string, string> */(mix$1);
|
|
19924
20221
|
var mix$1$1 = curriedMix;
|
|
19925
20222
|
|
|
20223
|
+
/**
|
|
20224
|
+
* Increases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20225
|
+
*
|
|
20226
|
+
*
|
|
20227
|
+
* @example
|
|
20228
|
+
* // Styles as object usage
|
|
20229
|
+
* const styles = {
|
|
20230
|
+
* background: opacify(0.1, 'rgba(255, 255, 255, 0.9)');
|
|
20231
|
+
* background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'),
|
|
20232
|
+
* background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'),
|
|
20233
|
+
* }
|
|
20234
|
+
*
|
|
20235
|
+
* // styled-components usage
|
|
20236
|
+
* const div = styled.div`
|
|
20237
|
+
* background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')};
|
|
20238
|
+
* background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')},
|
|
20239
|
+
* background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')},
|
|
20240
|
+
* `
|
|
20241
|
+
*
|
|
20242
|
+
* // CSS in JS Output
|
|
20243
|
+
*
|
|
20244
|
+
* element {
|
|
20245
|
+
* background: "#fff";
|
|
20246
|
+
* background: "rgba(255,255,255,0.7)";
|
|
20247
|
+
* background: "rgba(255,0,0,0.7)";
|
|
20248
|
+
* }
|
|
20249
|
+
*/
|
|
20250
|
+
function opacify(amount, color) {
|
|
20251
|
+
if (color === 'transparent') return color;
|
|
20252
|
+
var parsedColor = parseToRgb(color);
|
|
20253
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20254
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20255
|
+
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
|
20256
|
+
});
|
|
20257
|
+
return rgba$1(colorWithAlpha);
|
|
20258
|
+
}
|
|
20259
|
+
|
|
20260
|
+
// prettier-ignore
|
|
20261
|
+
var curriedOpacify = curry /* ::<number | string, string, string> */(opacify);
|
|
20262
|
+
|
|
20263
|
+
/**
|
|
20264
|
+
* Increases the intensity of a color. Its range is between 0 to 1. The first
|
|
20265
|
+
* argument of the saturate function is the amount by how much the color
|
|
20266
|
+
* intensity should be increased.
|
|
20267
|
+
*
|
|
20268
|
+
* @example
|
|
20269
|
+
* // Styles as object usage
|
|
20270
|
+
* const styles = {
|
|
20271
|
+
* background: saturate(0.2, '#CCCD64'),
|
|
20272
|
+
* background: saturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20273
|
+
* }
|
|
20274
|
+
*
|
|
20275
|
+
* // styled-components usage
|
|
20276
|
+
* const div = styled.div`
|
|
20277
|
+
* background: ${saturate(0.2, '#FFCD64')};
|
|
20278
|
+
* background: ${saturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20279
|
+
* `
|
|
20280
|
+
*
|
|
20281
|
+
* // CSS in JS Output
|
|
20282
|
+
*
|
|
20283
|
+
* element {
|
|
20284
|
+
* background: "#e0e250";
|
|
20285
|
+
* background: "rgba(224,226,80,0.7)";
|
|
20286
|
+
* }
|
|
20287
|
+
*/
|
|
20288
|
+
function saturate(amount, color) {
|
|
20289
|
+
if (color === 'transparent') return color;
|
|
20290
|
+
var hslColor = parseToHsl(color);
|
|
20291
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20292
|
+
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
|
20293
|
+
}));
|
|
20294
|
+
}
|
|
20295
|
+
|
|
20296
|
+
// prettier-ignore
|
|
20297
|
+
var curriedSaturate = curry /* ::<number | string, string, string> */(saturate);
|
|
20298
|
+
|
|
20299
|
+
/**
|
|
20300
|
+
* Sets the hue of a color to the provided value. The hue range can be
|
|
20301
|
+
* from 0 and 359.
|
|
20302
|
+
*
|
|
20303
|
+
* @example
|
|
20304
|
+
* // Styles as object usage
|
|
20305
|
+
* const styles = {
|
|
20306
|
+
* background: setHue(42, '#CCCD64'),
|
|
20307
|
+
* background: setHue('244', 'rgba(204,205,100,0.7)'),
|
|
20308
|
+
* }
|
|
20309
|
+
*
|
|
20310
|
+
* // styled-components usage
|
|
20311
|
+
* const div = styled.div`
|
|
20312
|
+
* background: ${setHue(42, '#CCCD64')};
|
|
20313
|
+
* background: ${setHue('244', 'rgba(204,205,100,0.7)')};
|
|
20314
|
+
* `
|
|
20315
|
+
*
|
|
20316
|
+
* // CSS in JS Output
|
|
20317
|
+
* element {
|
|
20318
|
+
* background: "#cdae64";
|
|
20319
|
+
* background: "rgba(107,100,205,0.7)";
|
|
20320
|
+
* }
|
|
20321
|
+
*/
|
|
20322
|
+
function setHue(hue, color) {
|
|
20323
|
+
if (color === 'transparent') return color;
|
|
20324
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20325
|
+
hue: parseFloat(hue)
|
|
20326
|
+
}));
|
|
20327
|
+
}
|
|
20328
|
+
|
|
20329
|
+
// prettier-ignore
|
|
20330
|
+
var curriedSetHue = curry /* ::<number | string, string, string> */(setHue);
|
|
20331
|
+
|
|
20332
|
+
/**
|
|
20333
|
+
* Sets the lightness of a color to the provided value. The lightness range can be
|
|
20334
|
+
* from 0 and 1.
|
|
20335
|
+
*
|
|
20336
|
+
* @example
|
|
20337
|
+
* // Styles as object usage
|
|
20338
|
+
* const styles = {
|
|
20339
|
+
* background: setLightness(0.2, '#CCCD64'),
|
|
20340
|
+
* background: setLightness('0.75', 'rgba(204,205,100,0.7)'),
|
|
20341
|
+
* }
|
|
20342
|
+
*
|
|
20343
|
+
* // styled-components usage
|
|
20344
|
+
* const div = styled.div`
|
|
20345
|
+
* background: ${setLightness(0.2, '#CCCD64')};
|
|
20346
|
+
* background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')};
|
|
20347
|
+
* `
|
|
20348
|
+
*
|
|
20349
|
+
* // CSS in JS Output
|
|
20350
|
+
* element {
|
|
20351
|
+
* background: "#4d4d19";
|
|
20352
|
+
* background: "rgba(223,224,159,0.7)";
|
|
20353
|
+
* }
|
|
20354
|
+
*/
|
|
20355
|
+
function setLightness(lightness, color) {
|
|
20356
|
+
if (color === 'transparent') return color;
|
|
20357
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20358
|
+
lightness: parseFloat(lightness)
|
|
20359
|
+
}));
|
|
20360
|
+
}
|
|
20361
|
+
|
|
20362
|
+
// prettier-ignore
|
|
20363
|
+
var curriedSetLightness = curry /* ::<number | string, string, string> */(setLightness);
|
|
20364
|
+
|
|
20365
|
+
/**
|
|
20366
|
+
* Sets the saturation of a color to the provided value. The saturation range can be
|
|
20367
|
+
* from 0 and 1.
|
|
20368
|
+
*
|
|
20369
|
+
* @example
|
|
20370
|
+
* // Styles as object usage
|
|
20371
|
+
* const styles = {
|
|
20372
|
+
* background: setSaturation(0.2, '#CCCD64'),
|
|
20373
|
+
* background: setSaturation('0.75', 'rgba(204,205,100,0.7)'),
|
|
20374
|
+
* }
|
|
20375
|
+
*
|
|
20376
|
+
* // styled-components usage
|
|
20377
|
+
* const div = styled.div`
|
|
20378
|
+
* background: ${setSaturation(0.2, '#CCCD64')};
|
|
20379
|
+
* background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')};
|
|
20380
|
+
* `
|
|
20381
|
+
*
|
|
20382
|
+
* // CSS in JS Output
|
|
20383
|
+
* element {
|
|
20384
|
+
* background: "#adad84";
|
|
20385
|
+
* background: "rgba(228,229,76,0.7)";
|
|
20386
|
+
* }
|
|
20387
|
+
*/
|
|
20388
|
+
function setSaturation(saturation, color) {
|
|
20389
|
+
if (color === 'transparent') return color;
|
|
20390
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20391
|
+
saturation: parseFloat(saturation)
|
|
20392
|
+
}));
|
|
20393
|
+
}
|
|
20394
|
+
|
|
20395
|
+
// prettier-ignore
|
|
20396
|
+
var curriedSetSaturation = curry /* ::<number | string, string, string> */(setSaturation);
|
|
20397
|
+
|
|
20398
|
+
/**
|
|
20399
|
+
* Shades a color by mixing it with black. `shade` can produce
|
|
20400
|
+
* hue shifts, where as `darken` manipulates the luminance channel and therefore
|
|
20401
|
+
* doesn't produce hue shifts.
|
|
20402
|
+
*
|
|
20403
|
+
* @example
|
|
20404
|
+
* // Styles as object usage
|
|
20405
|
+
* const styles = {
|
|
20406
|
+
* background: shade(0.25, '#00f')
|
|
20407
|
+
* }
|
|
20408
|
+
*
|
|
20409
|
+
* // styled-components usage
|
|
20410
|
+
* const div = styled.div`
|
|
20411
|
+
* background: ${shade(0.25, '#00f')};
|
|
20412
|
+
* `
|
|
20413
|
+
*
|
|
20414
|
+
* // CSS in JS Output
|
|
20415
|
+
*
|
|
20416
|
+
* element {
|
|
20417
|
+
* background: "#00003f";
|
|
20418
|
+
* }
|
|
20419
|
+
*/
|
|
20420
|
+
|
|
20421
|
+
function shade(percentage, color) {
|
|
20422
|
+
if (color === 'transparent') return color;
|
|
20423
|
+
return mix$1$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
|
|
20424
|
+
}
|
|
20425
|
+
|
|
20426
|
+
// prettier-ignore
|
|
20427
|
+
var curriedShade = curry /* ::<number | string, string, string> */(shade);
|
|
20428
|
+
|
|
19926
20429
|
/**
|
|
19927
20430
|
* Tints a color by mixing it with white. `tint` can produce
|
|
19928
20431
|
* hue shifts, where as `lighten` manipulates the luminance channel and therefore
|
|
@@ -19949,14 +20452,52 @@ var mix$1$1 = curriedMix;
|
|
|
19949
20452
|
function tint(percentage, color) {
|
|
19950
20453
|
if (color === 'transparent') return color;
|
|
19951
20454
|
return mix$1$1(parseFloat(percentage), 'rgb(255, 255, 255)', color);
|
|
19952
|
-
}
|
|
19953
|
-
|
|
20455
|
+
}
|
|
19954
20456
|
|
|
19955
|
-
|
|
19956
|
-
/* ::<number | string, string, string> */
|
|
19957
|
-
(tint);
|
|
20457
|
+
// prettier-ignore
|
|
20458
|
+
var curriedTint = curry /* ::<number | string, string, string> */(tint);
|
|
19958
20459
|
var curriedTint$1 = curriedTint;
|
|
19959
20460
|
|
|
20461
|
+
/**
|
|
20462
|
+
* Decreases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20463
|
+
*
|
|
20464
|
+
*
|
|
20465
|
+
* @example
|
|
20466
|
+
* // Styles as object usage
|
|
20467
|
+
* const styles = {
|
|
20468
|
+
* background: transparentize(0.1, '#fff'),
|
|
20469
|
+
* background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
|
|
20470
|
+
* background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'),
|
|
20471
|
+
* }
|
|
20472
|
+
*
|
|
20473
|
+
* // styled-components usage
|
|
20474
|
+
* const div = styled.div`
|
|
20475
|
+
* background: ${transparentize(0.1, '#fff')};
|
|
20476
|
+
* background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')};
|
|
20477
|
+
* background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')};
|
|
20478
|
+
* `
|
|
20479
|
+
*
|
|
20480
|
+
* // CSS in JS Output
|
|
20481
|
+
*
|
|
20482
|
+
* element {
|
|
20483
|
+
* background: "rgba(255,255,255,0.9)";
|
|
20484
|
+
* background: "rgba(255,255,255,0.8)";
|
|
20485
|
+
* background: "rgba(255,0,0,0.3)";
|
|
20486
|
+
* }
|
|
20487
|
+
*/
|
|
20488
|
+
function transparentize(amount, color) {
|
|
20489
|
+
if (color === 'transparent') return color;
|
|
20490
|
+
var parsedColor = parseToRgb(color);
|
|
20491
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20492
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20493
|
+
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
|
20494
|
+
});
|
|
20495
|
+
return rgba$1(colorWithAlpha);
|
|
20496
|
+
}
|
|
20497
|
+
|
|
20498
|
+
// prettier-ignore
|
|
20499
|
+
var curriedTransparentize = curry /* ::<number | string, string, string> */(transparentize);
|
|
20500
|
+
|
|
19960
20501
|
var linkColor = MATISSE_BLUE;
|
|
19961
20502
|
var fallbackValues$8 = {
|
|
19962
20503
|
linkColor: linkColor
|
|
@@ -22646,32 +23187,19 @@ var toIndexedObject = function (it) {
|
|
|
22646
23187
|
return indexedObject(requireObjectCoercible(it));
|
|
22647
23188
|
};
|
|
22648
23189
|
|
|
22649
|
-
var documentAll = typeof document == 'object' && document.all;
|
|
22650
|
-
|
|
22651
23190
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
22652
|
-
|
|
22653
|
-
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
22654
|
-
|
|
22655
|
-
var documentAll_1 = {
|
|
22656
|
-
all: documentAll,
|
|
22657
|
-
IS_HTMLDDA: IS_HTMLDDA
|
|
22658
|
-
};
|
|
22659
|
-
|
|
22660
|
-
var documentAll$1 = documentAll_1.all;
|
|
23191
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
22661
23192
|
|
|
22662
23193
|
// `IsCallable` abstract operation
|
|
22663
23194
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
22664
|
-
|
|
22665
|
-
|
|
23195
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
23196
|
+
var isCallable = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
23197
|
+
return typeof argument == 'function' || argument === documentAll;
|
|
22666
23198
|
} : function (argument) {
|
|
22667
23199
|
return typeof argument == 'function';
|
|
22668
23200
|
};
|
|
22669
23201
|
|
|
22670
|
-
var
|
|
22671
|
-
|
|
22672
|
-
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
22673
|
-
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
22674
|
-
} : function (it) {
|
|
23202
|
+
var isObject = function (it) {
|
|
22675
23203
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
22676
23204
|
};
|
|
22677
23205
|
|
|
@@ -22807,10 +23335,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
22807
23335
|
(module.exports = function (key, value) {
|
|
22808
23336
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
22809
23337
|
})('versions', []).push({
|
|
22810
|
-
version: '3.
|
|
23338
|
+
version: '3.35.1',
|
|
22811
23339
|
mode: 'global',
|
|
22812
|
-
copyright: '© 2014-
|
|
22813
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
23340
|
+
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
23341
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
|
|
22814
23342
|
source: 'https://github.com/zloirock/core-js'
|
|
22815
23343
|
});
|
|
22816
23344
|
});
|
|
@@ -23107,7 +23635,7 @@ var TEMPLATE = String(String).split('String');
|
|
|
23107
23635
|
|
|
23108
23636
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
23109
23637
|
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
23110
|
-
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)
|
|
23638
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
23111
23639
|
}
|
|
23112
23640
|
if (options && options.getter) name = 'get ' + name;
|
|
23113
23641
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -23195,7 +23723,8 @@ var min$1 = Math.min;
|
|
|
23195
23723
|
// `ToLength` abstract operation
|
|
23196
23724
|
// https://tc39.es/ecma262/#sec-tolength
|
|
23197
23725
|
var toLength = function (argument) {
|
|
23198
|
-
|
|
23726
|
+
var len = toIntegerOrInfinity(argument);
|
|
23727
|
+
return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
23199
23728
|
};
|
|
23200
23729
|
|
|
23201
23730
|
// `LengthOfArrayLike` abstract operation
|
|
@@ -23355,7 +23884,7 @@ var _export = function (options, source) {
|
|
|
23355
23884
|
} else if (STATIC) {
|
|
23356
23885
|
target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
23357
23886
|
} else {
|
|
23358
|
-
target =
|
|
23887
|
+
target = global_1[TARGET] && global_1[TARGET].prototype;
|
|
23359
23888
|
}
|
|
23360
23889
|
if (target) for (key in source) {
|
|
23361
23890
|
sourceProperty = source[key];
|
|
@@ -23618,11 +24147,15 @@ var functionUncurryThisAccessor = function (object, key, method) {
|
|
|
23618
24147
|
} catch (error) { /* empty */ }
|
|
23619
24148
|
};
|
|
23620
24149
|
|
|
24150
|
+
var isPossiblePrototype = function (argument) {
|
|
24151
|
+
return isObject(argument) || argument === null;
|
|
24152
|
+
};
|
|
24153
|
+
|
|
23621
24154
|
var $String$4 = String;
|
|
23622
24155
|
var $TypeError$6 = TypeError;
|
|
23623
24156
|
|
|
23624
24157
|
var aPossiblePrototype = function (argument) {
|
|
23625
|
-
if (
|
|
24158
|
+
if (isPossiblePrototype(argument)) return argument;
|
|
23626
24159
|
throw new $TypeError$6("Can't set " + $String$4(argument) + ' as a prototype');
|
|
23627
24160
|
};
|
|
23628
24161
|
|
|
@@ -48787,8 +49320,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
48787
49320
|
};
|
|
48788
49321
|
}, []);
|
|
48789
49322
|
}
|
|
48790
|
-
var firstNameErrorMessages = _defineProperty({}, required.error, "First name is required");
|
|
48791
|
-
var lastNameErrorMessages = _defineProperty({}, required.error, "Last name is required");
|
|
49323
|
+
var firstNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "First name is required"), matchesRegex.error, "First name contains invalid characters");
|
|
49324
|
+
var lastNameErrorMessages = _defineProperty(_defineProperty({}, required.error, "Last name is required"), matchesRegex.error, "Last name contains invalid characters");
|
|
48792
49325
|
var emailErrorMessages = _defineProperty(_defineProperty({}, required.error, "Email is required"), isProbablyEmail.error, "Invalid email address");
|
|
48793
49326
|
var passwordErrorMessages = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, required.error, "Password is required"), hasLength.error, "Password must have at least 8 characters"), hasNumber.error, "Password must contain at least one number"), hasLowercaseLetter.error, "Password must contain at least one lowercase letter"), hasUppercaseLetter.error, "Password must contain at least one uppercase letter"), hasSpecialCharacter.error, "Password must contain at least one special character (!@#$%^&*.?)");
|
|
48794
49327
|
var confirmPasswordErrorMessages = _defineProperty({}, matchesField.error, "Confirm password must match password");
|
|
@@ -48864,10 +49397,10 @@ var RegistrationForm = function RegistrationForm(_ref) {
|
|
|
48864
49397
|
|
|
48865
49398
|
var formConfig$9 = {
|
|
48866
49399
|
firstName: {
|
|
48867
|
-
validators: [required()]
|
|
49400
|
+
validators: [required(), matchesRegex(/[A-Za-z]+(\s?[A-Za-z\-,'])*/i)]
|
|
48868
49401
|
},
|
|
48869
49402
|
lastName: {
|
|
48870
|
-
validators: [required()]
|
|
49403
|
+
validators: [required(), matchesRegex(/[A-Za-z]+(\s?[A-Za-z\-,'])*/i)]
|
|
48871
49404
|
},
|
|
48872
49405
|
email: {
|
|
48873
49406
|
validators: [required(), isProbablyEmail()]
|