@thecb/components 10.6.4 → 10.6.5-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 +637 -97
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +637 -97
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- package/src/components/atoms/wallet-name/WalletName.js +3 -1
- package/src/components/atoms/wallet-name/index.d.ts +1 -0
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +6 -4
package/dist/index.esm.js
CHANGED
|
@@ -19637,7 +19637,6 @@ function _wrapNativeSuper(Class) {
|
|
|
19637
19637
|
}
|
|
19638
19638
|
|
|
19639
19639
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
19640
|
-
|
|
19641
19640
|
/**
|
|
19642
19641
|
* Parse errors.md and turn it into a simple hash of code: message
|
|
19643
19642
|
* @private
|
|
@@ -19722,84 +19721,71 @@ var ERRORS = {
|
|
|
19722
19721
|
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
19723
19722
|
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
19724
19723
|
};
|
|
19724
|
+
|
|
19725
19725
|
/**
|
|
19726
19726
|
* super basic version of sprintf
|
|
19727
19727
|
* @private
|
|
19728
19728
|
*/
|
|
19729
|
-
|
|
19730
19729
|
function format() {
|
|
19731
19730
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19732
19731
|
args[_key] = arguments[_key];
|
|
19733
19732
|
}
|
|
19734
|
-
|
|
19735
19733
|
var a = args[0];
|
|
19736
19734
|
var b = [];
|
|
19737
19735
|
var c;
|
|
19738
|
-
|
|
19739
19736
|
for (c = 1; c < args.length; c += 1) {
|
|
19740
19737
|
b.push(args[c]);
|
|
19741
19738
|
}
|
|
19742
|
-
|
|
19743
19739
|
b.forEach(function (d) {
|
|
19744
19740
|
a = a.replace(/%[a-z]/, d);
|
|
19745
19741
|
});
|
|
19746
19742
|
return a;
|
|
19747
19743
|
}
|
|
19744
|
+
|
|
19748
19745
|
/**
|
|
19749
19746
|
* Create an error file out of errors.md for development and a simple web link to the full errors
|
|
19750
19747
|
* in production mode.
|
|
19751
19748
|
* @private
|
|
19752
19749
|
*/
|
|
19753
|
-
|
|
19754
|
-
|
|
19755
19750
|
var PolishedError = /*#__PURE__*/function (_Error) {
|
|
19756
19751
|
_inheritsLoose(PolishedError, _Error);
|
|
19757
|
-
|
|
19758
19752
|
function PolishedError(code) {
|
|
19759
19753
|
var _this;
|
|
19760
|
-
|
|
19761
19754
|
if (process.env.NODE_ENV === 'production') {
|
|
19762
19755
|
_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;
|
|
19763
19756
|
} else {
|
|
19764
19757
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
19765
19758
|
args[_key2 - 1] = arguments[_key2];
|
|
19766
19759
|
}
|
|
19767
|
-
|
|
19768
19760
|
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
19769
19761
|
}
|
|
19770
|
-
|
|
19771
19762
|
return _assertThisInitialized(_this);
|
|
19772
19763
|
}
|
|
19773
|
-
|
|
19774
19764
|
return PolishedError;
|
|
19775
19765
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
19776
19766
|
|
|
19777
19767
|
function colorToInt(color) {
|
|
19778
19768
|
return Math.round(color * 255);
|
|
19779
19769
|
}
|
|
19780
|
-
|
|
19781
19770
|
function convertToInt(red, green, blue) {
|
|
19782
19771
|
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
19783
19772
|
}
|
|
19784
|
-
|
|
19785
19773
|
function hslToRgb(hue, saturation, lightness, convert) {
|
|
19786
19774
|
if (convert === void 0) {
|
|
19787
19775
|
convert = convertToInt;
|
|
19788
19776
|
}
|
|
19789
|
-
|
|
19790
19777
|
if (saturation === 0) {
|
|
19791
19778
|
// achromatic
|
|
19792
19779
|
return convert(lightness, lightness, lightness);
|
|
19793
|
-
}
|
|
19794
|
-
|
|
19780
|
+
}
|
|
19795
19781
|
|
|
19782
|
+
// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
19796
19783
|
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
19797
19784
|
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
19798
19785
|
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
19799
19786
|
var red = 0;
|
|
19800
19787
|
var green = 0;
|
|
19801
19788
|
var blue = 0;
|
|
19802
|
-
|
|
19803
19789
|
if (huePrime >= 0 && huePrime < 1) {
|
|
19804
19790
|
red = chroma;
|
|
19805
19791
|
green = secondComponent;
|
|
@@ -19819,7 +19805,6 @@ function hslToRgb(hue, saturation, lightness, convert) {
|
|
|
19819
19805
|
red = chroma;
|
|
19820
19806
|
blue = secondComponent;
|
|
19821
19807
|
}
|
|
19822
|
-
|
|
19823
19808
|
var lightnessModification = lightness - chroma / 2;
|
|
19824
19809
|
var finalRed = red + lightnessModification;
|
|
19825
19810
|
var finalGreen = green + lightnessModification;
|
|
@@ -19977,11 +19962,11 @@ var namedColorMap = {
|
|
|
19977
19962
|
yellow: 'ff0',
|
|
19978
19963
|
yellowgreen: '9acd32'
|
|
19979
19964
|
};
|
|
19965
|
+
|
|
19980
19966
|
/**
|
|
19981
19967
|
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
|
|
19982
19968
|
* @private
|
|
19983
19969
|
*/
|
|
19984
|
-
|
|
19985
19970
|
function nameToHex(color) {
|
|
19986
19971
|
if (typeof color !== 'string') return color;
|
|
19987
19972
|
var normalizedColorName = color.toLowerCase();
|
|
@@ -19996,6 +19981,7 @@ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\
|
|
|
19996
19981
|
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
19997
19982
|
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;
|
|
19998
19983
|
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;
|
|
19984
|
+
|
|
19999
19985
|
/**
|
|
20000
19986
|
* Returns an RgbColor or RgbaColor object. This utility function is only useful
|
|
20001
19987
|
* if want to extract a color component. With the color util `toColorString` you
|
|
@@ -20007,14 +19993,11 @@ var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[
|
|
|
20007
19993
|
* // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
|
|
20008
19994
|
* const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
|
|
20009
19995
|
*/
|
|
20010
|
-
|
|
20011
19996
|
function parseToRgb(color) {
|
|
20012
19997
|
if (typeof color !== 'string') {
|
|
20013
19998
|
throw new PolishedError(3);
|
|
20014
19999
|
}
|
|
20015
|
-
|
|
20016
20000
|
var normalizedColor = nameToHex(color);
|
|
20017
|
-
|
|
20018
20001
|
if (normalizedColor.match(hexRegex)) {
|
|
20019
20002
|
return {
|
|
20020
20003
|
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
@@ -20022,7 +20005,6 @@ function parseToRgb(color) {
|
|
|
20022
20005
|
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
20023
20006
|
};
|
|
20024
20007
|
}
|
|
20025
|
-
|
|
20026
20008
|
if (normalizedColor.match(hexRgbaRegex)) {
|
|
20027
20009
|
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
20028
20010
|
return {
|
|
@@ -20032,7 +20014,6 @@ function parseToRgb(color) {
|
|
|
20032
20014
|
alpha: alpha
|
|
20033
20015
|
};
|
|
20034
20016
|
}
|
|
20035
|
-
|
|
20036
20017
|
if (normalizedColor.match(reducedHexRegex)) {
|
|
20037
20018
|
return {
|
|
20038
20019
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
@@ -20040,10 +20021,8 @@ function parseToRgb(color) {
|
|
|
20040
20021
|
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
20041
20022
|
};
|
|
20042
20023
|
}
|
|
20043
|
-
|
|
20044
20024
|
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
20045
20025
|
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
20046
|
-
|
|
20047
20026
|
return {
|
|
20048
20027
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
20049
20028
|
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
@@ -20051,9 +20030,7 @@ function parseToRgb(color) {
|
|
|
20051
20030
|
alpha: _alpha
|
|
20052
20031
|
};
|
|
20053
20032
|
}
|
|
20054
|
-
|
|
20055
20033
|
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
20056
|
-
|
|
20057
20034
|
if (rgbMatched) {
|
|
20058
20035
|
return {
|
|
20059
20036
|
red: parseInt("" + rgbMatched[1], 10),
|
|
@@ -20061,9 +20038,7 @@ function parseToRgb(color) {
|
|
|
20061
20038
|
blue: parseInt("" + rgbMatched[3], 10)
|
|
20062
20039
|
};
|
|
20063
20040
|
}
|
|
20064
|
-
|
|
20065
20041
|
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
20066
|
-
|
|
20067
20042
|
if (rgbaMatched) {
|
|
20068
20043
|
return {
|
|
20069
20044
|
red: parseInt("" + rgbaMatched[1], 10),
|
|
@@ -20072,44 +20047,32 @@ function parseToRgb(color) {
|
|
|
20072
20047
|
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
20073
20048
|
};
|
|
20074
20049
|
}
|
|
20075
|
-
|
|
20076
20050
|
var hslMatched = hslRegex.exec(normalizedColor);
|
|
20077
|
-
|
|
20078
20051
|
if (hslMatched) {
|
|
20079
20052
|
var hue = parseInt("" + hslMatched[1], 10);
|
|
20080
20053
|
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
20081
20054
|
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
20082
20055
|
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
20083
20056
|
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
20084
|
-
|
|
20085
20057
|
if (!hslRgbMatched) {
|
|
20086
20058
|
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
20087
20059
|
}
|
|
20088
|
-
|
|
20089
20060
|
return {
|
|
20090
20061
|
red: parseInt("" + hslRgbMatched[1], 10),
|
|
20091
20062
|
green: parseInt("" + hslRgbMatched[2], 10),
|
|
20092
20063
|
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
20093
20064
|
};
|
|
20094
20065
|
}
|
|
20095
|
-
|
|
20096
20066
|
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
20097
|
-
|
|
20098
20067
|
if (hslaMatched) {
|
|
20099
20068
|
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
20100
|
-
|
|
20101
20069
|
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
20102
|
-
|
|
20103
20070
|
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
20104
|
-
|
|
20105
20071
|
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
20106
|
-
|
|
20107
20072
|
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
20108
|
-
|
|
20109
20073
|
if (!_hslRgbMatched) {
|
|
20110
20074
|
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
20111
20075
|
}
|
|
20112
|
-
|
|
20113
20076
|
return {
|
|
20114
20077
|
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
20115
20078
|
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
@@ -20117,10 +20080,82 @@ function parseToRgb(color) {
|
|
|
20117
20080
|
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
20118
20081
|
};
|
|
20119
20082
|
}
|
|
20120
|
-
|
|
20121
20083
|
throw new PolishedError(5);
|
|
20122
20084
|
}
|
|
20123
20085
|
|
|
20086
|
+
function rgbToHsl(color) {
|
|
20087
|
+
// make sure rgb are contained in a set of [0, 255]
|
|
20088
|
+
var red = color.red / 255;
|
|
20089
|
+
var green = color.green / 255;
|
|
20090
|
+
var blue = color.blue / 255;
|
|
20091
|
+
var max = Math.max(red, green, blue);
|
|
20092
|
+
var min = Math.min(red, green, blue);
|
|
20093
|
+
var lightness = (max + min) / 2;
|
|
20094
|
+
if (max === min) {
|
|
20095
|
+
// achromatic
|
|
20096
|
+
if (color.alpha !== undefined) {
|
|
20097
|
+
return {
|
|
20098
|
+
hue: 0,
|
|
20099
|
+
saturation: 0,
|
|
20100
|
+
lightness: lightness,
|
|
20101
|
+
alpha: color.alpha
|
|
20102
|
+
};
|
|
20103
|
+
} else {
|
|
20104
|
+
return {
|
|
20105
|
+
hue: 0,
|
|
20106
|
+
saturation: 0,
|
|
20107
|
+
lightness: lightness
|
|
20108
|
+
};
|
|
20109
|
+
}
|
|
20110
|
+
}
|
|
20111
|
+
var hue;
|
|
20112
|
+
var delta = max - min;
|
|
20113
|
+
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
20114
|
+
switch (max) {
|
|
20115
|
+
case red:
|
|
20116
|
+
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
20117
|
+
break;
|
|
20118
|
+
case green:
|
|
20119
|
+
hue = (blue - red) / delta + 2;
|
|
20120
|
+
break;
|
|
20121
|
+
default:
|
|
20122
|
+
// blue case
|
|
20123
|
+
hue = (red - green) / delta + 4;
|
|
20124
|
+
break;
|
|
20125
|
+
}
|
|
20126
|
+
hue *= 60;
|
|
20127
|
+
if (color.alpha !== undefined) {
|
|
20128
|
+
return {
|
|
20129
|
+
hue: hue,
|
|
20130
|
+
saturation: saturation,
|
|
20131
|
+
lightness: lightness,
|
|
20132
|
+
alpha: color.alpha
|
|
20133
|
+
};
|
|
20134
|
+
}
|
|
20135
|
+
return {
|
|
20136
|
+
hue: hue,
|
|
20137
|
+
saturation: saturation,
|
|
20138
|
+
lightness: lightness
|
|
20139
|
+
};
|
|
20140
|
+
}
|
|
20141
|
+
|
|
20142
|
+
/**
|
|
20143
|
+
* Returns an HslColor or HslaColor object. This utility function is only useful
|
|
20144
|
+
* if want to extract a color component. With the color util `toColorString` you
|
|
20145
|
+
* can convert a HslColor or HslaColor object back to a string.
|
|
20146
|
+
*
|
|
20147
|
+
* @example
|
|
20148
|
+
* // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1
|
|
20149
|
+
* const color1 = parseToHsl('rgb(255, 0, 0)');
|
|
20150
|
+
* // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2
|
|
20151
|
+
* const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)');
|
|
20152
|
+
*/
|
|
20153
|
+
function parseToHsl(color) {
|
|
20154
|
+
// Note: At a later stage we can optimize this function as right now a hsl
|
|
20155
|
+
// color would be parsed converted to rgb values and converted back to hsl.
|
|
20156
|
+
return rgbToHsl(parseToRgb(color));
|
|
20157
|
+
}
|
|
20158
|
+
|
|
20124
20159
|
/**
|
|
20125
20160
|
* Reduces hex values if possible e.g. #ff8866 to #f86
|
|
20126
20161
|
* @private
|
|
@@ -20129,10 +20164,8 @@ var reduceHexValue = function reduceHexValue(value) {
|
|
|
20129
20164
|
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
20130
20165
|
return "#" + value[1] + value[3] + value[5];
|
|
20131
20166
|
}
|
|
20132
|
-
|
|
20133
20167
|
return value;
|
|
20134
20168
|
};
|
|
20135
|
-
|
|
20136
20169
|
var reduceHexValue$1 = reduceHexValue;
|
|
20137
20170
|
|
|
20138
20171
|
function numberToHex(value) {
|
|
@@ -20140,6 +20173,83 @@ function numberToHex(value) {
|
|
|
20140
20173
|
return hex.length === 1 ? "0" + hex : hex;
|
|
20141
20174
|
}
|
|
20142
20175
|
|
|
20176
|
+
function colorToHex(color) {
|
|
20177
|
+
return numberToHex(Math.round(color * 255));
|
|
20178
|
+
}
|
|
20179
|
+
function convertToHex(red, green, blue) {
|
|
20180
|
+
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
|
20181
|
+
}
|
|
20182
|
+
function hslToHex(hue, saturation, lightness) {
|
|
20183
|
+
return hslToRgb(hue, saturation, lightness, convertToHex);
|
|
20184
|
+
}
|
|
20185
|
+
|
|
20186
|
+
/**
|
|
20187
|
+
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
20188
|
+
*
|
|
20189
|
+
* @example
|
|
20190
|
+
* // Styles as object usage
|
|
20191
|
+
* const styles = {
|
|
20192
|
+
* background: hsl(359, 0.75, 0.4),
|
|
20193
|
+
* background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }),
|
|
20194
|
+
* }
|
|
20195
|
+
*
|
|
20196
|
+
* // styled-components usage
|
|
20197
|
+
* const div = styled.div`
|
|
20198
|
+
* background: ${hsl(359, 0.75, 0.4)};
|
|
20199
|
+
* background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })};
|
|
20200
|
+
* `
|
|
20201
|
+
*
|
|
20202
|
+
* // CSS in JS Output
|
|
20203
|
+
*
|
|
20204
|
+
* element {
|
|
20205
|
+
* background: "#b3191c";
|
|
20206
|
+
* background: "#b3191c";
|
|
20207
|
+
* }
|
|
20208
|
+
*/
|
|
20209
|
+
function hsl(value, saturation, lightness) {
|
|
20210
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
|
|
20211
|
+
return hslToHex(value, saturation, lightness);
|
|
20212
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
|
|
20213
|
+
return hslToHex(value.hue, value.saturation, value.lightness);
|
|
20214
|
+
}
|
|
20215
|
+
throw new PolishedError(1);
|
|
20216
|
+
}
|
|
20217
|
+
|
|
20218
|
+
/**
|
|
20219
|
+
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
|
|
20220
|
+
*
|
|
20221
|
+
* @example
|
|
20222
|
+
* // Styles as object usage
|
|
20223
|
+
* const styles = {
|
|
20224
|
+
* background: hsla(359, 0.75, 0.4, 0.7),
|
|
20225
|
+
* background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }),
|
|
20226
|
+
* background: hsla(359, 0.75, 0.4, 1),
|
|
20227
|
+
* }
|
|
20228
|
+
*
|
|
20229
|
+
* // styled-components usage
|
|
20230
|
+
* const div = styled.div`
|
|
20231
|
+
* background: ${hsla(359, 0.75, 0.4, 0.7)};
|
|
20232
|
+
* background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })};
|
|
20233
|
+
* background: ${hsla(359, 0.75, 0.4, 1)};
|
|
20234
|
+
* `
|
|
20235
|
+
*
|
|
20236
|
+
* // CSS in JS Output
|
|
20237
|
+
*
|
|
20238
|
+
* element {
|
|
20239
|
+
* background: "rgba(179,25,28,0.7)";
|
|
20240
|
+
* background: "rgba(179,25,28,0.7)";
|
|
20241
|
+
* background: "#b3191c";
|
|
20242
|
+
* }
|
|
20243
|
+
*/
|
|
20244
|
+
function hsla$1(value, saturation, lightness, alpha) {
|
|
20245
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
|
|
20246
|
+
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
|
20247
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
|
|
20248
|
+
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
|
20249
|
+
}
|
|
20250
|
+
throw new PolishedError(2);
|
|
20251
|
+
}
|
|
20252
|
+
|
|
20143
20253
|
/**
|
|
20144
20254
|
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
20145
20255
|
*
|
|
@@ -20169,7 +20279,6 @@ function rgb(value, green, blue) {
|
|
|
20169
20279
|
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
|
20170
20280
|
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
20171
20281
|
}
|
|
20172
|
-
|
|
20173
20282
|
throw new PolishedError(6);
|
|
20174
20283
|
}
|
|
20175
20284
|
|
|
@@ -20216,10 +20325,62 @@ function rgba$1(firstValue, secondValue, thirdValue, fourthValue) {
|
|
|
20216
20325
|
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
|
|
20217
20326
|
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
20218
20327
|
}
|
|
20219
|
-
|
|
20220
20328
|
throw new PolishedError(7);
|
|
20221
20329
|
}
|
|
20222
20330
|
|
|
20331
|
+
var isRgb = function isRgb(color) {
|
|
20332
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
20333
|
+
};
|
|
20334
|
+
var isRgba$1 = function isRgba(color) {
|
|
20335
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
|
|
20336
|
+
};
|
|
20337
|
+
var isHsl = function isHsl(color) {
|
|
20338
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
20339
|
+
};
|
|
20340
|
+
var isHsla$1 = function isHsla(color) {
|
|
20341
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
|
|
20342
|
+
};
|
|
20343
|
+
|
|
20344
|
+
/**
|
|
20345
|
+
* Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string.
|
|
20346
|
+
* This util is useful in case you only know on runtime which color object is
|
|
20347
|
+
* used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`.
|
|
20348
|
+
*
|
|
20349
|
+
* @example
|
|
20350
|
+
* // Styles as object usage
|
|
20351
|
+
* const styles = {
|
|
20352
|
+
* background: toColorString({ red: 255, green: 205, blue: 100 }),
|
|
20353
|
+
* background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }),
|
|
20354
|
+
* background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }),
|
|
20355
|
+
* background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }),
|
|
20356
|
+
* }
|
|
20357
|
+
*
|
|
20358
|
+
* // styled-components usage
|
|
20359
|
+
* const div = styled.div`
|
|
20360
|
+
* background: ${toColorString({ red: 255, green: 205, blue: 100 })};
|
|
20361
|
+
* background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })};
|
|
20362
|
+
* background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })};
|
|
20363
|
+
* background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })};
|
|
20364
|
+
* `
|
|
20365
|
+
*
|
|
20366
|
+
* // CSS in JS Output
|
|
20367
|
+
* element {
|
|
20368
|
+
* background: "#ffcd64";
|
|
20369
|
+
* background: "rgba(255,205,100,0.72)";
|
|
20370
|
+
* background: "#00f";
|
|
20371
|
+
* background: "rgba(179,25,25,0.72)";
|
|
20372
|
+
* }
|
|
20373
|
+
*/
|
|
20374
|
+
|
|
20375
|
+
function toColorString(color) {
|
|
20376
|
+
if (typeof color !== 'object') throw new PolishedError(8);
|
|
20377
|
+
if (isRgba$1(color)) return rgba$1(color);
|
|
20378
|
+
if (isRgb(color)) return rgb(color);
|
|
20379
|
+
if (isHsla$1(color)) return hsla$1(color);
|
|
20380
|
+
if (isHsl(color)) return hsl(color);
|
|
20381
|
+
throw new PolishedError(8);
|
|
20382
|
+
}
|
|
20383
|
+
|
|
20223
20384
|
// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
|
|
20224
20385
|
// eslint-disable-next-line no-unused-vars
|
|
20225
20386
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -20230,14 +20391,156 @@ function curried(f, length, acc) {
|
|
|
20230
20391
|
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
20231
20392
|
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
|
20232
20393
|
};
|
|
20233
|
-
}
|
|
20234
|
-
|
|
20394
|
+
}
|
|
20235
20395
|
|
|
20396
|
+
// eslint-disable-next-line no-redeclare
|
|
20236
20397
|
function curry(f) {
|
|
20237
20398
|
// eslint-disable-line no-redeclare
|
|
20238
20399
|
return curried(f, f.length, []);
|
|
20239
20400
|
}
|
|
20240
20401
|
|
|
20402
|
+
/**
|
|
20403
|
+
* Changes the hue of the color. Hue is a number between 0 to 360. The first
|
|
20404
|
+
* argument for adjustHue is the amount of degrees the color is rotated around
|
|
20405
|
+
* the color wheel, always producing a positive hue value.
|
|
20406
|
+
*
|
|
20407
|
+
* @example
|
|
20408
|
+
* // Styles as object usage
|
|
20409
|
+
* const styles = {
|
|
20410
|
+
* background: adjustHue(180, '#448'),
|
|
20411
|
+
* background: adjustHue('180', 'rgba(101,100,205,0.7)'),
|
|
20412
|
+
* }
|
|
20413
|
+
*
|
|
20414
|
+
* // styled-components usage
|
|
20415
|
+
* const div = styled.div`
|
|
20416
|
+
* background: ${adjustHue(180, '#448')};
|
|
20417
|
+
* background: ${adjustHue('180', 'rgba(101,100,205,0.7)')};
|
|
20418
|
+
* `
|
|
20419
|
+
*
|
|
20420
|
+
* // CSS in JS Output
|
|
20421
|
+
* element {
|
|
20422
|
+
* background: "#888844";
|
|
20423
|
+
* background: "rgba(136,136,68,0.7)";
|
|
20424
|
+
* }
|
|
20425
|
+
*/
|
|
20426
|
+
function adjustHue(degree, color) {
|
|
20427
|
+
if (color === 'transparent') return color;
|
|
20428
|
+
var hslColor = parseToHsl(color);
|
|
20429
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20430
|
+
hue: hslColor.hue + parseFloat(degree)
|
|
20431
|
+
}));
|
|
20432
|
+
}
|
|
20433
|
+
|
|
20434
|
+
// prettier-ignore
|
|
20435
|
+
var curriedAdjustHue = curry /* ::<number | string, string, string> */(adjustHue);
|
|
20436
|
+
|
|
20437
|
+
function guard(lowerBoundary, upperBoundary, value) {
|
|
20438
|
+
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
|
20439
|
+
}
|
|
20440
|
+
|
|
20441
|
+
/**
|
|
20442
|
+
* Returns a string value for the darkened color.
|
|
20443
|
+
*
|
|
20444
|
+
* @example
|
|
20445
|
+
* // Styles as object usage
|
|
20446
|
+
* const styles = {
|
|
20447
|
+
* background: darken(0.2, '#FFCD64'),
|
|
20448
|
+
* background: darken('0.2', 'rgba(255,205,100,0.7)'),
|
|
20449
|
+
* }
|
|
20450
|
+
*
|
|
20451
|
+
* // styled-components usage
|
|
20452
|
+
* const div = styled.div`
|
|
20453
|
+
* background: ${darken(0.2, '#FFCD64')};
|
|
20454
|
+
* background: ${darken('0.2', 'rgba(255,205,100,0.7)')};
|
|
20455
|
+
* `
|
|
20456
|
+
*
|
|
20457
|
+
* // CSS in JS Output
|
|
20458
|
+
*
|
|
20459
|
+
* element {
|
|
20460
|
+
* background: "#ffbd31";
|
|
20461
|
+
* background: "rgba(255,189,49,0.7)";
|
|
20462
|
+
* }
|
|
20463
|
+
*/
|
|
20464
|
+
function darken(amount, color) {
|
|
20465
|
+
if (color === 'transparent') return color;
|
|
20466
|
+
var hslColor = parseToHsl(color);
|
|
20467
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20468
|
+
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
|
20469
|
+
}));
|
|
20470
|
+
}
|
|
20471
|
+
|
|
20472
|
+
// prettier-ignore
|
|
20473
|
+
var curriedDarken = curry /* ::<number | string, string, string> */(darken);
|
|
20474
|
+
|
|
20475
|
+
/**
|
|
20476
|
+
* Decreases the intensity of a color. Its range is between 0 to 1. The first
|
|
20477
|
+
* argument of the desaturate function is the amount by how much the color
|
|
20478
|
+
* intensity should be decreased.
|
|
20479
|
+
*
|
|
20480
|
+
* @example
|
|
20481
|
+
* // Styles as object usage
|
|
20482
|
+
* const styles = {
|
|
20483
|
+
* background: desaturate(0.2, '#CCCD64'),
|
|
20484
|
+
* background: desaturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20485
|
+
* }
|
|
20486
|
+
*
|
|
20487
|
+
* // styled-components usage
|
|
20488
|
+
* const div = styled.div`
|
|
20489
|
+
* background: ${desaturate(0.2, '#CCCD64')};
|
|
20490
|
+
* background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20491
|
+
* `
|
|
20492
|
+
*
|
|
20493
|
+
* // CSS in JS Output
|
|
20494
|
+
* element {
|
|
20495
|
+
* background: "#b8b979";
|
|
20496
|
+
* background: "rgba(184,185,121,0.7)";
|
|
20497
|
+
* }
|
|
20498
|
+
*/
|
|
20499
|
+
function desaturate(amount, color) {
|
|
20500
|
+
if (color === 'transparent') return color;
|
|
20501
|
+
var hslColor = parseToHsl(color);
|
|
20502
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20503
|
+
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
|
20504
|
+
}));
|
|
20505
|
+
}
|
|
20506
|
+
|
|
20507
|
+
// prettier-ignore
|
|
20508
|
+
var curriedDesaturate = curry /* ::<number | string, string, string> */(desaturate);
|
|
20509
|
+
|
|
20510
|
+
/**
|
|
20511
|
+
* Returns a string value for the lightened color.
|
|
20512
|
+
*
|
|
20513
|
+
* @example
|
|
20514
|
+
* // Styles as object usage
|
|
20515
|
+
* const styles = {
|
|
20516
|
+
* background: lighten(0.2, '#CCCD64'),
|
|
20517
|
+
* background: lighten('0.2', 'rgba(204,205,100,0.7)'),
|
|
20518
|
+
* }
|
|
20519
|
+
*
|
|
20520
|
+
* // styled-components usage
|
|
20521
|
+
* const div = styled.div`
|
|
20522
|
+
* background: ${lighten(0.2, '#FFCD64')};
|
|
20523
|
+
* background: ${lighten('0.2', 'rgba(204,205,100,0.7)')};
|
|
20524
|
+
* `
|
|
20525
|
+
*
|
|
20526
|
+
* // CSS in JS Output
|
|
20527
|
+
*
|
|
20528
|
+
* element {
|
|
20529
|
+
* background: "#e5e6b1";
|
|
20530
|
+
* background: "rgba(229,230,177,0.7)";
|
|
20531
|
+
* }
|
|
20532
|
+
*/
|
|
20533
|
+
function lighten(amount, color) {
|
|
20534
|
+
if (color === 'transparent') return color;
|
|
20535
|
+
var hslColor = parseToHsl(color);
|
|
20536
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20537
|
+
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
|
20538
|
+
}));
|
|
20539
|
+
}
|
|
20540
|
+
|
|
20541
|
+
// prettier-ignore
|
|
20542
|
+
var curriedLighten = curry /* ::<number | string, string, string> */(lighten);
|
|
20543
|
+
|
|
20241
20544
|
/**
|
|
20242
20545
|
* 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.
|
|
20243
20546
|
*
|
|
@@ -20264,25 +20567,21 @@ function curry(f) {
|
|
|
20264
20567
|
* background: "rgba(63, 0, 191, 0.75)";
|
|
20265
20568
|
* }
|
|
20266
20569
|
*/
|
|
20267
|
-
|
|
20268
20570
|
function mix$1(weight, color, otherColor) {
|
|
20269
20571
|
if (color === 'transparent') return otherColor;
|
|
20270
20572
|
if (otherColor === 'transparent') return color;
|
|
20271
20573
|
if (weight === 0) return otherColor;
|
|
20272
20574
|
var parsedColor1 = parseToRgb(color);
|
|
20273
|
-
|
|
20274
20575
|
var color1 = _extends$1({}, parsedColor1, {
|
|
20275
20576
|
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
|
|
20276
20577
|
});
|
|
20277
|
-
|
|
20278
20578
|
var parsedColor2 = parseToRgb(otherColor);
|
|
20279
|
-
|
|
20280
20579
|
var color2 = _extends$1({}, parsedColor2, {
|
|
20281
20580
|
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
|
|
20282
|
-
});
|
|
20283
|
-
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
20284
|
-
|
|
20581
|
+
});
|
|
20285
20582
|
|
|
20583
|
+
// The formula is copied from the original Sass implementation:
|
|
20584
|
+
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
20286
20585
|
var alphaDelta = color1.alpha - color2.alpha;
|
|
20287
20586
|
var x = parseFloat(weight) * 2 - 1;
|
|
20288
20587
|
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
|
|
@@ -20296,14 +20595,218 @@ function mix$1(weight, color, otherColor) {
|
|
|
20296
20595
|
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
|
20297
20596
|
};
|
|
20298
20597
|
return rgba$1(mixedColor);
|
|
20299
|
-
}
|
|
20300
|
-
|
|
20598
|
+
}
|
|
20301
20599
|
|
|
20302
|
-
|
|
20303
|
-
/* ::<number | string, string, string, string> */
|
|
20304
|
-
(mix$1);
|
|
20600
|
+
// prettier-ignore
|
|
20601
|
+
var curriedMix = curry /* ::<number | string, string, string, string> */(mix$1);
|
|
20305
20602
|
var mix$1$1 = curriedMix;
|
|
20306
20603
|
|
|
20604
|
+
/**
|
|
20605
|
+
* Increases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20606
|
+
*
|
|
20607
|
+
*
|
|
20608
|
+
* @example
|
|
20609
|
+
* // Styles as object usage
|
|
20610
|
+
* const styles = {
|
|
20611
|
+
* background: opacify(0.1, 'rgba(255, 255, 255, 0.9)');
|
|
20612
|
+
* background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'),
|
|
20613
|
+
* background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'),
|
|
20614
|
+
* }
|
|
20615
|
+
*
|
|
20616
|
+
* // styled-components usage
|
|
20617
|
+
* const div = styled.div`
|
|
20618
|
+
* background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')};
|
|
20619
|
+
* background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')},
|
|
20620
|
+
* background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')},
|
|
20621
|
+
* `
|
|
20622
|
+
*
|
|
20623
|
+
* // CSS in JS Output
|
|
20624
|
+
*
|
|
20625
|
+
* element {
|
|
20626
|
+
* background: "#fff";
|
|
20627
|
+
* background: "rgba(255,255,255,0.7)";
|
|
20628
|
+
* background: "rgba(255,0,0,0.7)";
|
|
20629
|
+
* }
|
|
20630
|
+
*/
|
|
20631
|
+
function opacify(amount, color) {
|
|
20632
|
+
if (color === 'transparent') return color;
|
|
20633
|
+
var parsedColor = parseToRgb(color);
|
|
20634
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20635
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20636
|
+
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
|
20637
|
+
});
|
|
20638
|
+
return rgba$1(colorWithAlpha);
|
|
20639
|
+
}
|
|
20640
|
+
|
|
20641
|
+
// prettier-ignore
|
|
20642
|
+
var curriedOpacify = curry /* ::<number | string, string, string> */(opacify);
|
|
20643
|
+
|
|
20644
|
+
/**
|
|
20645
|
+
* Increases the intensity of a color. Its range is between 0 to 1. The first
|
|
20646
|
+
* argument of the saturate function is the amount by how much the color
|
|
20647
|
+
* intensity should be increased.
|
|
20648
|
+
*
|
|
20649
|
+
* @example
|
|
20650
|
+
* // Styles as object usage
|
|
20651
|
+
* const styles = {
|
|
20652
|
+
* background: saturate(0.2, '#CCCD64'),
|
|
20653
|
+
* background: saturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20654
|
+
* }
|
|
20655
|
+
*
|
|
20656
|
+
* // styled-components usage
|
|
20657
|
+
* const div = styled.div`
|
|
20658
|
+
* background: ${saturate(0.2, '#FFCD64')};
|
|
20659
|
+
* background: ${saturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20660
|
+
* `
|
|
20661
|
+
*
|
|
20662
|
+
* // CSS in JS Output
|
|
20663
|
+
*
|
|
20664
|
+
* element {
|
|
20665
|
+
* background: "#e0e250";
|
|
20666
|
+
* background: "rgba(224,226,80,0.7)";
|
|
20667
|
+
* }
|
|
20668
|
+
*/
|
|
20669
|
+
function saturate(amount, color) {
|
|
20670
|
+
if (color === 'transparent') return color;
|
|
20671
|
+
var hslColor = parseToHsl(color);
|
|
20672
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20673
|
+
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
|
20674
|
+
}));
|
|
20675
|
+
}
|
|
20676
|
+
|
|
20677
|
+
// prettier-ignore
|
|
20678
|
+
var curriedSaturate = curry /* ::<number | string, string, string> */(saturate);
|
|
20679
|
+
|
|
20680
|
+
/**
|
|
20681
|
+
* Sets the hue of a color to the provided value. The hue range can be
|
|
20682
|
+
* from 0 and 359.
|
|
20683
|
+
*
|
|
20684
|
+
* @example
|
|
20685
|
+
* // Styles as object usage
|
|
20686
|
+
* const styles = {
|
|
20687
|
+
* background: setHue(42, '#CCCD64'),
|
|
20688
|
+
* background: setHue('244', 'rgba(204,205,100,0.7)'),
|
|
20689
|
+
* }
|
|
20690
|
+
*
|
|
20691
|
+
* // styled-components usage
|
|
20692
|
+
* const div = styled.div`
|
|
20693
|
+
* background: ${setHue(42, '#CCCD64')};
|
|
20694
|
+
* background: ${setHue('244', 'rgba(204,205,100,0.7)')};
|
|
20695
|
+
* `
|
|
20696
|
+
*
|
|
20697
|
+
* // CSS in JS Output
|
|
20698
|
+
* element {
|
|
20699
|
+
* background: "#cdae64";
|
|
20700
|
+
* background: "rgba(107,100,205,0.7)";
|
|
20701
|
+
* }
|
|
20702
|
+
*/
|
|
20703
|
+
function setHue(hue, color) {
|
|
20704
|
+
if (color === 'transparent') return color;
|
|
20705
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20706
|
+
hue: parseFloat(hue)
|
|
20707
|
+
}));
|
|
20708
|
+
}
|
|
20709
|
+
|
|
20710
|
+
// prettier-ignore
|
|
20711
|
+
var curriedSetHue = curry /* ::<number | string, string, string> */(setHue);
|
|
20712
|
+
|
|
20713
|
+
/**
|
|
20714
|
+
* Sets the lightness of a color to the provided value. The lightness range can be
|
|
20715
|
+
* from 0 and 1.
|
|
20716
|
+
*
|
|
20717
|
+
* @example
|
|
20718
|
+
* // Styles as object usage
|
|
20719
|
+
* const styles = {
|
|
20720
|
+
* background: setLightness(0.2, '#CCCD64'),
|
|
20721
|
+
* background: setLightness('0.75', 'rgba(204,205,100,0.7)'),
|
|
20722
|
+
* }
|
|
20723
|
+
*
|
|
20724
|
+
* // styled-components usage
|
|
20725
|
+
* const div = styled.div`
|
|
20726
|
+
* background: ${setLightness(0.2, '#CCCD64')};
|
|
20727
|
+
* background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')};
|
|
20728
|
+
* `
|
|
20729
|
+
*
|
|
20730
|
+
* // CSS in JS Output
|
|
20731
|
+
* element {
|
|
20732
|
+
* background: "#4d4d19";
|
|
20733
|
+
* background: "rgba(223,224,159,0.7)";
|
|
20734
|
+
* }
|
|
20735
|
+
*/
|
|
20736
|
+
function setLightness(lightness, color) {
|
|
20737
|
+
if (color === 'transparent') return color;
|
|
20738
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20739
|
+
lightness: parseFloat(lightness)
|
|
20740
|
+
}));
|
|
20741
|
+
}
|
|
20742
|
+
|
|
20743
|
+
// prettier-ignore
|
|
20744
|
+
var curriedSetLightness = curry /* ::<number | string, string, string> */(setLightness);
|
|
20745
|
+
|
|
20746
|
+
/**
|
|
20747
|
+
* Sets the saturation of a color to the provided value. The saturation range can be
|
|
20748
|
+
* from 0 and 1.
|
|
20749
|
+
*
|
|
20750
|
+
* @example
|
|
20751
|
+
* // Styles as object usage
|
|
20752
|
+
* const styles = {
|
|
20753
|
+
* background: setSaturation(0.2, '#CCCD64'),
|
|
20754
|
+
* background: setSaturation('0.75', 'rgba(204,205,100,0.7)'),
|
|
20755
|
+
* }
|
|
20756
|
+
*
|
|
20757
|
+
* // styled-components usage
|
|
20758
|
+
* const div = styled.div`
|
|
20759
|
+
* background: ${setSaturation(0.2, '#CCCD64')};
|
|
20760
|
+
* background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')};
|
|
20761
|
+
* `
|
|
20762
|
+
*
|
|
20763
|
+
* // CSS in JS Output
|
|
20764
|
+
* element {
|
|
20765
|
+
* background: "#adad84";
|
|
20766
|
+
* background: "rgba(228,229,76,0.7)";
|
|
20767
|
+
* }
|
|
20768
|
+
*/
|
|
20769
|
+
function setSaturation(saturation, color) {
|
|
20770
|
+
if (color === 'transparent') return color;
|
|
20771
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20772
|
+
saturation: parseFloat(saturation)
|
|
20773
|
+
}));
|
|
20774
|
+
}
|
|
20775
|
+
|
|
20776
|
+
// prettier-ignore
|
|
20777
|
+
var curriedSetSaturation = curry /* ::<number | string, string, string> */(setSaturation);
|
|
20778
|
+
|
|
20779
|
+
/**
|
|
20780
|
+
* Shades a color by mixing it with black. `shade` can produce
|
|
20781
|
+
* hue shifts, where as `darken` manipulates the luminance channel and therefore
|
|
20782
|
+
* doesn't produce hue shifts.
|
|
20783
|
+
*
|
|
20784
|
+
* @example
|
|
20785
|
+
* // Styles as object usage
|
|
20786
|
+
* const styles = {
|
|
20787
|
+
* background: shade(0.25, '#00f')
|
|
20788
|
+
* }
|
|
20789
|
+
*
|
|
20790
|
+
* // styled-components usage
|
|
20791
|
+
* const div = styled.div`
|
|
20792
|
+
* background: ${shade(0.25, '#00f')};
|
|
20793
|
+
* `
|
|
20794
|
+
*
|
|
20795
|
+
* // CSS in JS Output
|
|
20796
|
+
*
|
|
20797
|
+
* element {
|
|
20798
|
+
* background: "#00003f";
|
|
20799
|
+
* }
|
|
20800
|
+
*/
|
|
20801
|
+
|
|
20802
|
+
function shade(percentage, color) {
|
|
20803
|
+
if (color === 'transparent') return color;
|
|
20804
|
+
return mix$1$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
|
|
20805
|
+
}
|
|
20806
|
+
|
|
20807
|
+
// prettier-ignore
|
|
20808
|
+
var curriedShade = curry /* ::<number | string, string, string> */(shade);
|
|
20809
|
+
|
|
20307
20810
|
/**
|
|
20308
20811
|
* Tints a color by mixing it with white. `tint` can produce
|
|
20309
20812
|
* hue shifts, where as `lighten` manipulates the luminance channel and therefore
|
|
@@ -20330,14 +20833,52 @@ var mix$1$1 = curriedMix;
|
|
|
20330
20833
|
function tint(percentage, color) {
|
|
20331
20834
|
if (color === 'transparent') return color;
|
|
20332
20835
|
return mix$1$1(parseFloat(percentage), 'rgb(255, 255, 255)', color);
|
|
20333
|
-
}
|
|
20334
|
-
|
|
20836
|
+
}
|
|
20335
20837
|
|
|
20336
|
-
|
|
20337
|
-
/* ::<number | string, string, string> */
|
|
20338
|
-
(tint);
|
|
20838
|
+
// prettier-ignore
|
|
20839
|
+
var curriedTint = curry /* ::<number | string, string, string> */(tint);
|
|
20339
20840
|
var curriedTint$1 = curriedTint;
|
|
20340
20841
|
|
|
20842
|
+
/**
|
|
20843
|
+
* Decreases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20844
|
+
*
|
|
20845
|
+
*
|
|
20846
|
+
* @example
|
|
20847
|
+
* // Styles as object usage
|
|
20848
|
+
* const styles = {
|
|
20849
|
+
* background: transparentize(0.1, '#fff'),
|
|
20850
|
+
* background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
|
|
20851
|
+
* background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'),
|
|
20852
|
+
* }
|
|
20853
|
+
*
|
|
20854
|
+
* // styled-components usage
|
|
20855
|
+
* const div = styled.div`
|
|
20856
|
+
* background: ${transparentize(0.1, '#fff')};
|
|
20857
|
+
* background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')};
|
|
20858
|
+
* background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')};
|
|
20859
|
+
* `
|
|
20860
|
+
*
|
|
20861
|
+
* // CSS in JS Output
|
|
20862
|
+
*
|
|
20863
|
+
* element {
|
|
20864
|
+
* background: "rgba(255,255,255,0.9)";
|
|
20865
|
+
* background: "rgba(255,255,255,0.8)";
|
|
20866
|
+
* background: "rgba(255,0,0,0.3)";
|
|
20867
|
+
* }
|
|
20868
|
+
*/
|
|
20869
|
+
function transparentize(amount, color) {
|
|
20870
|
+
if (color === 'transparent') return color;
|
|
20871
|
+
var parsedColor = parseToRgb(color);
|
|
20872
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20873
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20874
|
+
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
|
20875
|
+
});
|
|
20876
|
+
return rgba$1(colorWithAlpha);
|
|
20877
|
+
}
|
|
20878
|
+
|
|
20879
|
+
// prettier-ignore
|
|
20880
|
+
var curriedTransparentize = curry /* ::<number | string, string, string> */(transparentize);
|
|
20881
|
+
|
|
20341
20882
|
var linkColor = MATISSE_BLUE;
|
|
20342
20883
|
var fallbackValues$8 = {
|
|
20343
20884
|
linkColor: linkColor
|
|
@@ -23027,32 +23568,19 @@ var toIndexedObject = function (it) {
|
|
|
23027
23568
|
return indexedObject(requireObjectCoercible(it));
|
|
23028
23569
|
};
|
|
23029
23570
|
|
|
23030
|
-
var documentAll = typeof document == 'object' && document.all;
|
|
23031
|
-
|
|
23032
23571
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
23033
|
-
|
|
23034
|
-
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
23035
|
-
|
|
23036
|
-
var documentAll_1 = {
|
|
23037
|
-
all: documentAll,
|
|
23038
|
-
IS_HTMLDDA: IS_HTMLDDA
|
|
23039
|
-
};
|
|
23040
|
-
|
|
23041
|
-
var documentAll$1 = documentAll_1.all;
|
|
23572
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
23042
23573
|
|
|
23043
23574
|
// `IsCallable` abstract operation
|
|
23044
23575
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
23045
|
-
|
|
23046
|
-
|
|
23576
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
23577
|
+
var isCallable = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
23578
|
+
return typeof argument == 'function' || argument === documentAll;
|
|
23047
23579
|
} : function (argument) {
|
|
23048
23580
|
return typeof argument == 'function';
|
|
23049
23581
|
};
|
|
23050
23582
|
|
|
23051
|
-
var
|
|
23052
|
-
|
|
23053
|
-
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
23054
|
-
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
23055
|
-
} : function (it) {
|
|
23583
|
+
var isObject = function (it) {
|
|
23056
23584
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
23057
23585
|
};
|
|
23058
23586
|
|
|
@@ -23188,10 +23716,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
23188
23716
|
(module.exports = function (key, value) {
|
|
23189
23717
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
23190
23718
|
})('versions', []).push({
|
|
23191
|
-
version: '3.
|
|
23719
|
+
version: '3.35.1',
|
|
23192
23720
|
mode: 'global',
|
|
23193
|
-
copyright: '© 2014-
|
|
23194
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
23721
|
+
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
23722
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
|
|
23195
23723
|
source: 'https://github.com/zloirock/core-js'
|
|
23196
23724
|
});
|
|
23197
23725
|
});
|
|
@@ -23488,7 +24016,7 @@ var TEMPLATE = String(String).split('String');
|
|
|
23488
24016
|
|
|
23489
24017
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
23490
24018
|
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
23491
|
-
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)
|
|
24019
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
23492
24020
|
}
|
|
23493
24021
|
if (options && options.getter) name = 'get ' + name;
|
|
23494
24022
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -23576,7 +24104,8 @@ var min$1 = Math.min;
|
|
|
23576
24104
|
// `ToLength` abstract operation
|
|
23577
24105
|
// https://tc39.es/ecma262/#sec-tolength
|
|
23578
24106
|
var toLength = function (argument) {
|
|
23579
|
-
|
|
24107
|
+
var len = toIntegerOrInfinity(argument);
|
|
24108
|
+
return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
23580
24109
|
};
|
|
23581
24110
|
|
|
23582
24111
|
// `LengthOfArrayLike` abstract operation
|
|
@@ -23736,7 +24265,7 @@ var _export = function (options, source) {
|
|
|
23736
24265
|
} else if (STATIC) {
|
|
23737
24266
|
target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
23738
24267
|
} else {
|
|
23739
|
-
target =
|
|
24268
|
+
target = global_1[TARGET] && global_1[TARGET].prototype;
|
|
23740
24269
|
}
|
|
23741
24270
|
if (target) for (key in source) {
|
|
23742
24271
|
sourceProperty = source[key];
|
|
@@ -23999,11 +24528,15 @@ var functionUncurryThisAccessor = function (object, key, method) {
|
|
|
23999
24528
|
} catch (error) { /* empty */ }
|
|
24000
24529
|
};
|
|
24001
24530
|
|
|
24531
|
+
var isPossiblePrototype = function (argument) {
|
|
24532
|
+
return isObject(argument) || argument === null;
|
|
24533
|
+
};
|
|
24534
|
+
|
|
24002
24535
|
var $String$4 = String;
|
|
24003
24536
|
var $TypeError$6 = TypeError;
|
|
24004
24537
|
|
|
24005
24538
|
var aPossiblePrototype = function (argument) {
|
|
24006
|
-
if (
|
|
24539
|
+
if (isPossiblePrototype(argument)) return argument;
|
|
24007
24540
|
throw new $TypeError$6("Can't set " + $String$4(argument) + ' as a prototype');
|
|
24008
24541
|
};
|
|
24009
24542
|
|
|
@@ -39189,7 +39722,9 @@ var WalletName = function WalletName(_ref) {
|
|
|
39189
39722
|
_ref$linkButtonExtraS = _ref.linkButtonExtraStyles,
|
|
39190
39723
|
linkButtonExtraStyles = _ref$linkButtonExtraS === void 0 ? "" : _ref$linkButtonExtraS,
|
|
39191
39724
|
_ref$isLoading = _ref.isLoading,
|
|
39192
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading
|
|
39725
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
39726
|
+
_ref$dataQa = _ref.dataQa,
|
|
39727
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
39193
39728
|
var _useContext = useContext(ThemeContext),
|
|
39194
39729
|
isMobile = _useContext.isMobile;
|
|
39195
39730
|
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(Module$1, {
|
|
@@ -39219,6 +39754,7 @@ var WalletName = function WalletName(_ref) {
|
|
|
39219
39754
|
}, text), (text || actionText) && /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0"), action && actionText && /*#__PURE__*/React.createElement(ButtonWithAction, {
|
|
39220
39755
|
disabled: disableAction,
|
|
39221
39756
|
text: actionText,
|
|
39757
|
+
dataQa: dataQa,
|
|
39222
39758
|
action: action,
|
|
39223
39759
|
variant: "smallGhost",
|
|
39224
39760
|
extraStyles: "\n margin: 0;\n min-width: 0;\n span {font-size: 0.75rem;}\n ".concat(linkButtonExtraStyles, "\n ")
|
|
@@ -48006,7 +48542,11 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
48006
48542
|
buttonGroupStyles = _ref.buttonGroupStyles,
|
|
48007
48543
|
_ref$hideAdditionalBu = _ref.hideAdditionalButton,
|
|
48008
48544
|
hideAdditionalButton = _ref$hideAdditionalBu === void 0 ? false : _ref$hideAdditionalBu,
|
|
48009
|
-
additionalButton = _ref.additionalButton
|
|
48545
|
+
additionalButton = _ref.additionalButton,
|
|
48546
|
+
_ref$nextButtonTestId = _ref.nextButtonTestId,
|
|
48547
|
+
nextButtonTestId = _ref$nextButtonTestId === void 0 ? null : _ref$nextButtonTestId,
|
|
48548
|
+
_ref$backButtonTestId = _ref.backButtonTestId,
|
|
48549
|
+
backButtonTestId = _ref$backButtonTestId === void 0 ? null : _ref$backButtonTestId;
|
|
48010
48550
|
var _useContext = useContext(ThemeContext),
|
|
48011
48551
|
isMobile = _useContext.isMobile;
|
|
48012
48552
|
var backButton = !!cancelURL && !!cancelText ? /*#__PURE__*/React.createElement(ButtonWithLink, {
|
|
@@ -48014,7 +48554,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
48014
48554
|
url: cancelURL,
|
|
48015
48555
|
variant: backButtonVariant,
|
|
48016
48556
|
extraStyles: isMobile && "flex-grow: 1",
|
|
48017
|
-
dataQa: cancelText,
|
|
48557
|
+
dataQa: backButtonTestId || cancelText,
|
|
48018
48558
|
"aria-labelledby": "".concat(kebabCaseString(cancelText), "-button"),
|
|
48019
48559
|
role: "link"
|
|
48020
48560
|
}) : backButtonAction && /*#__PURE__*/React.createElement(ButtonWithAction, {
|
|
@@ -48031,7 +48571,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
48031
48571
|
text: redirectText,
|
|
48032
48572
|
variant: forwardButtonVariant,
|
|
48033
48573
|
extraStyles: isMobile && "flex-grow: 1",
|
|
48034
|
-
dataQa: redirectText,
|
|
48574
|
+
dataQa: nextButtonTestId || redirectText,
|
|
48035
48575
|
disabled: isForwardButtonDisabled,
|
|
48036
48576
|
"aria-labelledby": "".concat(kebabCaseString(redirectText), "-button"),
|
|
48037
48577
|
role: forwardButtonAriaRole
|
|
@@ -48041,7 +48581,7 @@ var PaymentButtonBar = function PaymentButtonBar(_ref) {
|
|
|
48041
48581
|
action: forwardButtonAction,
|
|
48042
48582
|
isLoading: forwardButtonLoading,
|
|
48043
48583
|
extraStyles: isMobile && "flex-grow: 1",
|
|
48044
|
-
dataQa: forwardButtonText,
|
|
48584
|
+
dataQa: nextButtonTestId || forwardButtonText,
|
|
48045
48585
|
disabled: isForwardButtonDisabled,
|
|
48046
48586
|
"aria-labelledby": "".concat(kebabCaseString(forwardButtonText), "-button"),
|
|
48047
48587
|
role: forwardButtonAriaRole
|