@thecb/components 10.6.4 → 10.6.5-beta.0
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 -93
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +629 -93
- 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/dist/index.cjs.js
CHANGED
|
@@ -19645,7 +19645,6 @@ function _wrapNativeSuper(Class) {
|
|
|
19645
19645
|
}
|
|
19646
19646
|
|
|
19647
19647
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
19648
|
-
|
|
19649
19648
|
/**
|
|
19650
19649
|
* Parse errors.md and turn it into a simple hash of code: message
|
|
19651
19650
|
* @private
|
|
@@ -19730,84 +19729,71 @@ var ERRORS = {
|
|
|
19730
19729
|
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
19731
19730
|
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
19732
19731
|
};
|
|
19732
|
+
|
|
19733
19733
|
/**
|
|
19734
19734
|
* super basic version of sprintf
|
|
19735
19735
|
* @private
|
|
19736
19736
|
*/
|
|
19737
|
-
|
|
19738
19737
|
function format() {
|
|
19739
19738
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19740
19739
|
args[_key] = arguments[_key];
|
|
19741
19740
|
}
|
|
19742
|
-
|
|
19743
19741
|
var a = args[0];
|
|
19744
19742
|
var b = [];
|
|
19745
19743
|
var c;
|
|
19746
|
-
|
|
19747
19744
|
for (c = 1; c < args.length; c += 1) {
|
|
19748
19745
|
b.push(args[c]);
|
|
19749
19746
|
}
|
|
19750
|
-
|
|
19751
19747
|
b.forEach(function (d) {
|
|
19752
19748
|
a = a.replace(/%[a-z]/, d);
|
|
19753
19749
|
});
|
|
19754
19750
|
return a;
|
|
19755
19751
|
}
|
|
19752
|
+
|
|
19756
19753
|
/**
|
|
19757
19754
|
* Create an error file out of errors.md for development and a simple web link to the full errors
|
|
19758
19755
|
* in production mode.
|
|
19759
19756
|
* @private
|
|
19760
19757
|
*/
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
19758
|
var PolishedError = /*#__PURE__*/function (_Error) {
|
|
19764
19759
|
_inheritsLoose(PolishedError, _Error);
|
|
19765
|
-
|
|
19766
19760
|
function PolishedError(code) {
|
|
19767
19761
|
var _this;
|
|
19768
|
-
|
|
19769
19762
|
if (process.env.NODE_ENV === 'production') {
|
|
19770
19763
|
_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;
|
|
19771
19764
|
} else {
|
|
19772
19765
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
19773
19766
|
args[_key2 - 1] = arguments[_key2];
|
|
19774
19767
|
}
|
|
19775
|
-
|
|
19776
19768
|
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
19777
19769
|
}
|
|
19778
|
-
|
|
19779
19770
|
return _assertThisInitialized(_this);
|
|
19780
19771
|
}
|
|
19781
|
-
|
|
19782
19772
|
return PolishedError;
|
|
19783
19773
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
19784
19774
|
|
|
19785
19775
|
function colorToInt(color) {
|
|
19786
19776
|
return Math.round(color * 255);
|
|
19787
19777
|
}
|
|
19788
|
-
|
|
19789
19778
|
function convertToInt(red, green, blue) {
|
|
19790
19779
|
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
19791
19780
|
}
|
|
19792
|
-
|
|
19793
19781
|
function hslToRgb(hue, saturation, lightness, convert) {
|
|
19794
19782
|
if (convert === void 0) {
|
|
19795
19783
|
convert = convertToInt;
|
|
19796
19784
|
}
|
|
19797
|
-
|
|
19798
19785
|
if (saturation === 0) {
|
|
19799
19786
|
// achromatic
|
|
19800
19787
|
return convert(lightness, lightness, lightness);
|
|
19801
|
-
}
|
|
19802
|
-
|
|
19788
|
+
}
|
|
19803
19789
|
|
|
19790
|
+
// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
19804
19791
|
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
19805
19792
|
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
19806
19793
|
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
19807
19794
|
var red = 0;
|
|
19808
19795
|
var green = 0;
|
|
19809
19796
|
var blue = 0;
|
|
19810
|
-
|
|
19811
19797
|
if (huePrime >= 0 && huePrime < 1) {
|
|
19812
19798
|
red = chroma;
|
|
19813
19799
|
green = secondComponent;
|
|
@@ -19827,7 +19813,6 @@ function hslToRgb(hue, saturation, lightness, convert) {
|
|
|
19827
19813
|
red = chroma;
|
|
19828
19814
|
blue = secondComponent;
|
|
19829
19815
|
}
|
|
19830
|
-
|
|
19831
19816
|
var lightnessModification = lightness - chroma / 2;
|
|
19832
19817
|
var finalRed = red + lightnessModification;
|
|
19833
19818
|
var finalGreen = green + lightnessModification;
|
|
@@ -19985,11 +19970,11 @@ var namedColorMap = {
|
|
|
19985
19970
|
yellow: 'ff0',
|
|
19986
19971
|
yellowgreen: '9acd32'
|
|
19987
19972
|
};
|
|
19973
|
+
|
|
19988
19974
|
/**
|
|
19989
19975
|
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
|
|
19990
19976
|
* @private
|
|
19991
19977
|
*/
|
|
19992
|
-
|
|
19993
19978
|
function nameToHex(color) {
|
|
19994
19979
|
if (typeof color !== 'string') return color;
|
|
19995
19980
|
var normalizedColorName = color.toLowerCase();
|
|
@@ -20004,6 +19989,7 @@ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\
|
|
|
20004
19989
|
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
20005
19990
|
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;
|
|
20006
19991
|
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;
|
|
19992
|
+
|
|
20007
19993
|
/**
|
|
20008
19994
|
* Returns an RgbColor or RgbaColor object. This utility function is only useful
|
|
20009
19995
|
* if want to extract a color component. With the color util `toColorString` you
|
|
@@ -20015,14 +20001,11 @@ var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[
|
|
|
20015
20001
|
* // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
|
|
20016
20002
|
* const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
|
|
20017
20003
|
*/
|
|
20018
|
-
|
|
20019
20004
|
function parseToRgb(color) {
|
|
20020
20005
|
if (typeof color !== 'string') {
|
|
20021
20006
|
throw new PolishedError(3);
|
|
20022
20007
|
}
|
|
20023
|
-
|
|
20024
20008
|
var normalizedColor = nameToHex(color);
|
|
20025
|
-
|
|
20026
20009
|
if (normalizedColor.match(hexRegex)) {
|
|
20027
20010
|
return {
|
|
20028
20011
|
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
@@ -20030,7 +20013,6 @@ function parseToRgb(color) {
|
|
|
20030
20013
|
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
20031
20014
|
};
|
|
20032
20015
|
}
|
|
20033
|
-
|
|
20034
20016
|
if (normalizedColor.match(hexRgbaRegex)) {
|
|
20035
20017
|
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
20036
20018
|
return {
|
|
@@ -20040,7 +20022,6 @@ function parseToRgb(color) {
|
|
|
20040
20022
|
alpha: alpha
|
|
20041
20023
|
};
|
|
20042
20024
|
}
|
|
20043
|
-
|
|
20044
20025
|
if (normalizedColor.match(reducedHexRegex)) {
|
|
20045
20026
|
return {
|
|
20046
20027
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
@@ -20048,10 +20029,8 @@ function parseToRgb(color) {
|
|
|
20048
20029
|
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
20049
20030
|
};
|
|
20050
20031
|
}
|
|
20051
|
-
|
|
20052
20032
|
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
20053
20033
|
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
20054
|
-
|
|
20055
20034
|
return {
|
|
20056
20035
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
20057
20036
|
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
@@ -20059,9 +20038,7 @@ function parseToRgb(color) {
|
|
|
20059
20038
|
alpha: _alpha
|
|
20060
20039
|
};
|
|
20061
20040
|
}
|
|
20062
|
-
|
|
20063
20041
|
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
20064
|
-
|
|
20065
20042
|
if (rgbMatched) {
|
|
20066
20043
|
return {
|
|
20067
20044
|
red: parseInt("" + rgbMatched[1], 10),
|
|
@@ -20069,9 +20046,7 @@ function parseToRgb(color) {
|
|
|
20069
20046
|
blue: parseInt("" + rgbMatched[3], 10)
|
|
20070
20047
|
};
|
|
20071
20048
|
}
|
|
20072
|
-
|
|
20073
20049
|
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
20074
|
-
|
|
20075
20050
|
if (rgbaMatched) {
|
|
20076
20051
|
return {
|
|
20077
20052
|
red: parseInt("" + rgbaMatched[1], 10),
|
|
@@ -20080,44 +20055,32 @@ function parseToRgb(color) {
|
|
|
20080
20055
|
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
20081
20056
|
};
|
|
20082
20057
|
}
|
|
20083
|
-
|
|
20084
20058
|
var hslMatched = hslRegex.exec(normalizedColor);
|
|
20085
|
-
|
|
20086
20059
|
if (hslMatched) {
|
|
20087
20060
|
var hue = parseInt("" + hslMatched[1], 10);
|
|
20088
20061
|
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
20089
20062
|
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
20090
20063
|
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
20091
20064
|
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
20092
|
-
|
|
20093
20065
|
if (!hslRgbMatched) {
|
|
20094
20066
|
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
20095
20067
|
}
|
|
20096
|
-
|
|
20097
20068
|
return {
|
|
20098
20069
|
red: parseInt("" + hslRgbMatched[1], 10),
|
|
20099
20070
|
green: parseInt("" + hslRgbMatched[2], 10),
|
|
20100
20071
|
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
20101
20072
|
};
|
|
20102
20073
|
}
|
|
20103
|
-
|
|
20104
20074
|
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
20105
|
-
|
|
20106
20075
|
if (hslaMatched) {
|
|
20107
20076
|
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
20108
|
-
|
|
20109
20077
|
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
20110
|
-
|
|
20111
20078
|
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
20112
|
-
|
|
20113
20079
|
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
20114
|
-
|
|
20115
20080
|
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
20116
|
-
|
|
20117
20081
|
if (!_hslRgbMatched) {
|
|
20118
20082
|
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
20119
20083
|
}
|
|
20120
|
-
|
|
20121
20084
|
return {
|
|
20122
20085
|
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
20123
20086
|
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
@@ -20125,10 +20088,82 @@ function parseToRgb(color) {
|
|
|
20125
20088
|
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
20126
20089
|
};
|
|
20127
20090
|
}
|
|
20128
|
-
|
|
20129
20091
|
throw new PolishedError(5);
|
|
20130
20092
|
}
|
|
20131
20093
|
|
|
20094
|
+
function rgbToHsl(color) {
|
|
20095
|
+
// make sure rgb are contained in a set of [0, 255]
|
|
20096
|
+
var red = color.red / 255;
|
|
20097
|
+
var green = color.green / 255;
|
|
20098
|
+
var blue = color.blue / 255;
|
|
20099
|
+
var max = Math.max(red, green, blue);
|
|
20100
|
+
var min = Math.min(red, green, blue);
|
|
20101
|
+
var lightness = (max + min) / 2;
|
|
20102
|
+
if (max === min) {
|
|
20103
|
+
// achromatic
|
|
20104
|
+
if (color.alpha !== undefined) {
|
|
20105
|
+
return {
|
|
20106
|
+
hue: 0,
|
|
20107
|
+
saturation: 0,
|
|
20108
|
+
lightness: lightness,
|
|
20109
|
+
alpha: color.alpha
|
|
20110
|
+
};
|
|
20111
|
+
} else {
|
|
20112
|
+
return {
|
|
20113
|
+
hue: 0,
|
|
20114
|
+
saturation: 0,
|
|
20115
|
+
lightness: lightness
|
|
20116
|
+
};
|
|
20117
|
+
}
|
|
20118
|
+
}
|
|
20119
|
+
var hue;
|
|
20120
|
+
var delta = max - min;
|
|
20121
|
+
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
20122
|
+
switch (max) {
|
|
20123
|
+
case red:
|
|
20124
|
+
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
20125
|
+
break;
|
|
20126
|
+
case green:
|
|
20127
|
+
hue = (blue - red) / delta + 2;
|
|
20128
|
+
break;
|
|
20129
|
+
default:
|
|
20130
|
+
// blue case
|
|
20131
|
+
hue = (red - green) / delta + 4;
|
|
20132
|
+
break;
|
|
20133
|
+
}
|
|
20134
|
+
hue *= 60;
|
|
20135
|
+
if (color.alpha !== undefined) {
|
|
20136
|
+
return {
|
|
20137
|
+
hue: hue,
|
|
20138
|
+
saturation: saturation,
|
|
20139
|
+
lightness: lightness,
|
|
20140
|
+
alpha: color.alpha
|
|
20141
|
+
};
|
|
20142
|
+
}
|
|
20143
|
+
return {
|
|
20144
|
+
hue: hue,
|
|
20145
|
+
saturation: saturation,
|
|
20146
|
+
lightness: lightness
|
|
20147
|
+
};
|
|
20148
|
+
}
|
|
20149
|
+
|
|
20150
|
+
/**
|
|
20151
|
+
* Returns an HslColor or HslaColor object. This utility function is only useful
|
|
20152
|
+
* if want to extract a color component. With the color util `toColorString` you
|
|
20153
|
+
* can convert a HslColor or HslaColor object back to a string.
|
|
20154
|
+
*
|
|
20155
|
+
* @example
|
|
20156
|
+
* // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1
|
|
20157
|
+
* const color1 = parseToHsl('rgb(255, 0, 0)');
|
|
20158
|
+
* // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2
|
|
20159
|
+
* const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)');
|
|
20160
|
+
*/
|
|
20161
|
+
function parseToHsl(color) {
|
|
20162
|
+
// Note: At a later stage we can optimize this function as right now a hsl
|
|
20163
|
+
// color would be parsed converted to rgb values and converted back to hsl.
|
|
20164
|
+
return rgbToHsl(parseToRgb(color));
|
|
20165
|
+
}
|
|
20166
|
+
|
|
20132
20167
|
/**
|
|
20133
20168
|
* Reduces hex values if possible e.g. #ff8866 to #f86
|
|
20134
20169
|
* @private
|
|
@@ -20137,10 +20172,8 @@ var reduceHexValue = function reduceHexValue(value) {
|
|
|
20137
20172
|
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
20138
20173
|
return "#" + value[1] + value[3] + value[5];
|
|
20139
20174
|
}
|
|
20140
|
-
|
|
20141
20175
|
return value;
|
|
20142
20176
|
};
|
|
20143
|
-
|
|
20144
20177
|
var reduceHexValue$1 = reduceHexValue;
|
|
20145
20178
|
|
|
20146
20179
|
function numberToHex(value) {
|
|
@@ -20148,6 +20181,83 @@ function numberToHex(value) {
|
|
|
20148
20181
|
return hex.length === 1 ? "0" + hex : hex;
|
|
20149
20182
|
}
|
|
20150
20183
|
|
|
20184
|
+
function colorToHex(color) {
|
|
20185
|
+
return numberToHex(Math.round(color * 255));
|
|
20186
|
+
}
|
|
20187
|
+
function convertToHex(red, green, blue) {
|
|
20188
|
+
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
|
20189
|
+
}
|
|
20190
|
+
function hslToHex(hue, saturation, lightness) {
|
|
20191
|
+
return hslToRgb(hue, saturation, lightness, convertToHex);
|
|
20192
|
+
}
|
|
20193
|
+
|
|
20194
|
+
/**
|
|
20195
|
+
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
20196
|
+
*
|
|
20197
|
+
* @example
|
|
20198
|
+
* // Styles as object usage
|
|
20199
|
+
* const styles = {
|
|
20200
|
+
* background: hsl(359, 0.75, 0.4),
|
|
20201
|
+
* background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }),
|
|
20202
|
+
* }
|
|
20203
|
+
*
|
|
20204
|
+
* // styled-components usage
|
|
20205
|
+
* const div = styled.div`
|
|
20206
|
+
* background: ${hsl(359, 0.75, 0.4)};
|
|
20207
|
+
* background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })};
|
|
20208
|
+
* `
|
|
20209
|
+
*
|
|
20210
|
+
* // CSS in JS Output
|
|
20211
|
+
*
|
|
20212
|
+
* element {
|
|
20213
|
+
* background: "#b3191c";
|
|
20214
|
+
* background: "#b3191c";
|
|
20215
|
+
* }
|
|
20216
|
+
*/
|
|
20217
|
+
function hsl(value, saturation, lightness) {
|
|
20218
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
|
|
20219
|
+
return hslToHex(value, saturation, lightness);
|
|
20220
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
|
|
20221
|
+
return hslToHex(value.hue, value.saturation, value.lightness);
|
|
20222
|
+
}
|
|
20223
|
+
throw new PolishedError(1);
|
|
20224
|
+
}
|
|
20225
|
+
|
|
20226
|
+
/**
|
|
20227
|
+
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
|
|
20228
|
+
*
|
|
20229
|
+
* @example
|
|
20230
|
+
* // Styles as object usage
|
|
20231
|
+
* const styles = {
|
|
20232
|
+
* background: hsla(359, 0.75, 0.4, 0.7),
|
|
20233
|
+
* background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }),
|
|
20234
|
+
* background: hsla(359, 0.75, 0.4, 1),
|
|
20235
|
+
* }
|
|
20236
|
+
*
|
|
20237
|
+
* // styled-components usage
|
|
20238
|
+
* const div = styled.div`
|
|
20239
|
+
* background: ${hsla(359, 0.75, 0.4, 0.7)};
|
|
20240
|
+
* background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })};
|
|
20241
|
+
* background: ${hsla(359, 0.75, 0.4, 1)};
|
|
20242
|
+
* `
|
|
20243
|
+
*
|
|
20244
|
+
* // CSS in JS Output
|
|
20245
|
+
*
|
|
20246
|
+
* element {
|
|
20247
|
+
* background: "rgba(179,25,28,0.7)";
|
|
20248
|
+
* background: "rgba(179,25,28,0.7)";
|
|
20249
|
+
* background: "#b3191c";
|
|
20250
|
+
* }
|
|
20251
|
+
*/
|
|
20252
|
+
function hsla$1(value, saturation, lightness, alpha) {
|
|
20253
|
+
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
|
|
20254
|
+
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
|
20255
|
+
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
|
|
20256
|
+
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
|
20257
|
+
}
|
|
20258
|
+
throw new PolishedError(2);
|
|
20259
|
+
}
|
|
20260
|
+
|
|
20151
20261
|
/**
|
|
20152
20262
|
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
20153
20263
|
*
|
|
@@ -20177,7 +20287,6 @@ function rgb(value, green, blue) {
|
|
|
20177
20287
|
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
|
20178
20288
|
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
20179
20289
|
}
|
|
20180
|
-
|
|
20181
20290
|
throw new PolishedError(6);
|
|
20182
20291
|
}
|
|
20183
20292
|
|
|
@@ -20224,10 +20333,62 @@ function rgba$1(firstValue, secondValue, thirdValue, fourthValue) {
|
|
|
20224
20333
|
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
|
|
20225
20334
|
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
20226
20335
|
}
|
|
20227
|
-
|
|
20228
20336
|
throw new PolishedError(7);
|
|
20229
20337
|
}
|
|
20230
20338
|
|
|
20339
|
+
var isRgb = function isRgb(color) {
|
|
20340
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
20341
|
+
};
|
|
20342
|
+
var isRgba$1 = function isRgba(color) {
|
|
20343
|
+
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
|
|
20344
|
+
};
|
|
20345
|
+
var isHsl = function isHsl(color) {
|
|
20346
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
20347
|
+
};
|
|
20348
|
+
var isHsla$1 = function isHsla(color) {
|
|
20349
|
+
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
|
|
20350
|
+
};
|
|
20351
|
+
|
|
20352
|
+
/**
|
|
20353
|
+
* Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string.
|
|
20354
|
+
* This util is useful in case you only know on runtime which color object is
|
|
20355
|
+
* used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`.
|
|
20356
|
+
*
|
|
20357
|
+
* @example
|
|
20358
|
+
* // Styles as object usage
|
|
20359
|
+
* const styles = {
|
|
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
|
+
* // styled-components usage
|
|
20367
|
+
* const div = styled.div`
|
|
20368
|
+
* background: ${toColorString({ red: 255, green: 205, blue: 100 })};
|
|
20369
|
+
* background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })};
|
|
20370
|
+
* background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })};
|
|
20371
|
+
* background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })};
|
|
20372
|
+
* `
|
|
20373
|
+
*
|
|
20374
|
+
* // CSS in JS Output
|
|
20375
|
+
* element {
|
|
20376
|
+
* background: "#ffcd64";
|
|
20377
|
+
* background: "rgba(255,205,100,0.72)";
|
|
20378
|
+
* background: "#00f";
|
|
20379
|
+
* background: "rgba(179,25,25,0.72)";
|
|
20380
|
+
* }
|
|
20381
|
+
*/
|
|
20382
|
+
|
|
20383
|
+
function toColorString(color) {
|
|
20384
|
+
if (typeof color !== 'object') throw new PolishedError(8);
|
|
20385
|
+
if (isRgba$1(color)) return rgba$1(color);
|
|
20386
|
+
if (isRgb(color)) return rgb(color);
|
|
20387
|
+
if (isHsla$1(color)) return hsla$1(color);
|
|
20388
|
+
if (isHsl(color)) return hsl(color);
|
|
20389
|
+
throw new PolishedError(8);
|
|
20390
|
+
}
|
|
20391
|
+
|
|
20231
20392
|
// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
|
|
20232
20393
|
// eslint-disable-next-line no-unused-vars
|
|
20233
20394
|
// eslint-disable-next-line no-unused-vars
|
|
@@ -20238,14 +20399,156 @@ function curried(f, length, acc) {
|
|
|
20238
20399
|
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
20239
20400
|
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
|
20240
20401
|
};
|
|
20241
|
-
}
|
|
20242
|
-
|
|
20402
|
+
}
|
|
20243
20403
|
|
|
20404
|
+
// eslint-disable-next-line no-redeclare
|
|
20244
20405
|
function curry(f) {
|
|
20245
20406
|
// eslint-disable-line no-redeclare
|
|
20246
20407
|
return curried(f, f.length, []);
|
|
20247
20408
|
}
|
|
20248
20409
|
|
|
20410
|
+
/**
|
|
20411
|
+
* Changes the hue of the color. Hue is a number between 0 to 360. The first
|
|
20412
|
+
* argument for adjustHue is the amount of degrees the color is rotated around
|
|
20413
|
+
* the color wheel, always producing a positive hue value.
|
|
20414
|
+
*
|
|
20415
|
+
* @example
|
|
20416
|
+
* // Styles as object usage
|
|
20417
|
+
* const styles = {
|
|
20418
|
+
* background: adjustHue(180, '#448'),
|
|
20419
|
+
* background: adjustHue('180', 'rgba(101,100,205,0.7)'),
|
|
20420
|
+
* }
|
|
20421
|
+
*
|
|
20422
|
+
* // styled-components usage
|
|
20423
|
+
* const div = styled.div`
|
|
20424
|
+
* background: ${adjustHue(180, '#448')};
|
|
20425
|
+
* background: ${adjustHue('180', 'rgba(101,100,205,0.7)')};
|
|
20426
|
+
* `
|
|
20427
|
+
*
|
|
20428
|
+
* // CSS in JS Output
|
|
20429
|
+
* element {
|
|
20430
|
+
* background: "#888844";
|
|
20431
|
+
* background: "rgba(136,136,68,0.7)";
|
|
20432
|
+
* }
|
|
20433
|
+
*/
|
|
20434
|
+
function adjustHue(degree, color) {
|
|
20435
|
+
if (color === 'transparent') return color;
|
|
20436
|
+
var hslColor = parseToHsl(color);
|
|
20437
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20438
|
+
hue: hslColor.hue + parseFloat(degree)
|
|
20439
|
+
}));
|
|
20440
|
+
}
|
|
20441
|
+
|
|
20442
|
+
// prettier-ignore
|
|
20443
|
+
var curriedAdjustHue = curry /* ::<number | string, string, string> */(adjustHue);
|
|
20444
|
+
|
|
20445
|
+
function guard(lowerBoundary, upperBoundary, value) {
|
|
20446
|
+
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
|
20447
|
+
}
|
|
20448
|
+
|
|
20449
|
+
/**
|
|
20450
|
+
* Returns a string value for the darkened color.
|
|
20451
|
+
*
|
|
20452
|
+
* @example
|
|
20453
|
+
* // Styles as object usage
|
|
20454
|
+
* const styles = {
|
|
20455
|
+
* background: darken(0.2, '#FFCD64'),
|
|
20456
|
+
* background: darken('0.2', 'rgba(255,205,100,0.7)'),
|
|
20457
|
+
* }
|
|
20458
|
+
*
|
|
20459
|
+
* // styled-components usage
|
|
20460
|
+
* const div = styled.div`
|
|
20461
|
+
* background: ${darken(0.2, '#FFCD64')};
|
|
20462
|
+
* background: ${darken('0.2', 'rgba(255,205,100,0.7)')};
|
|
20463
|
+
* `
|
|
20464
|
+
*
|
|
20465
|
+
* // CSS in JS Output
|
|
20466
|
+
*
|
|
20467
|
+
* element {
|
|
20468
|
+
* background: "#ffbd31";
|
|
20469
|
+
* background: "rgba(255,189,49,0.7)";
|
|
20470
|
+
* }
|
|
20471
|
+
*/
|
|
20472
|
+
function darken(amount, color) {
|
|
20473
|
+
if (color === 'transparent') return color;
|
|
20474
|
+
var hslColor = parseToHsl(color);
|
|
20475
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20476
|
+
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
|
20477
|
+
}));
|
|
20478
|
+
}
|
|
20479
|
+
|
|
20480
|
+
// prettier-ignore
|
|
20481
|
+
var curriedDarken = curry /* ::<number | string, string, string> */(darken);
|
|
20482
|
+
|
|
20483
|
+
/**
|
|
20484
|
+
* Decreases the intensity of a color. Its range is between 0 to 1. The first
|
|
20485
|
+
* argument of the desaturate function is the amount by how much the color
|
|
20486
|
+
* intensity should be decreased.
|
|
20487
|
+
*
|
|
20488
|
+
* @example
|
|
20489
|
+
* // Styles as object usage
|
|
20490
|
+
* const styles = {
|
|
20491
|
+
* background: desaturate(0.2, '#CCCD64'),
|
|
20492
|
+
* background: desaturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20493
|
+
* }
|
|
20494
|
+
*
|
|
20495
|
+
* // styled-components usage
|
|
20496
|
+
* const div = styled.div`
|
|
20497
|
+
* background: ${desaturate(0.2, '#CCCD64')};
|
|
20498
|
+
* background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20499
|
+
* `
|
|
20500
|
+
*
|
|
20501
|
+
* // CSS in JS Output
|
|
20502
|
+
* element {
|
|
20503
|
+
* background: "#b8b979";
|
|
20504
|
+
* background: "rgba(184,185,121,0.7)";
|
|
20505
|
+
* }
|
|
20506
|
+
*/
|
|
20507
|
+
function desaturate(amount, color) {
|
|
20508
|
+
if (color === 'transparent') return color;
|
|
20509
|
+
var hslColor = parseToHsl(color);
|
|
20510
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20511
|
+
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
|
20512
|
+
}));
|
|
20513
|
+
}
|
|
20514
|
+
|
|
20515
|
+
// prettier-ignore
|
|
20516
|
+
var curriedDesaturate = curry /* ::<number | string, string, string> */(desaturate);
|
|
20517
|
+
|
|
20518
|
+
/**
|
|
20519
|
+
* Returns a string value for the lightened color.
|
|
20520
|
+
*
|
|
20521
|
+
* @example
|
|
20522
|
+
* // Styles as object usage
|
|
20523
|
+
* const styles = {
|
|
20524
|
+
* background: lighten(0.2, '#CCCD64'),
|
|
20525
|
+
* background: lighten('0.2', 'rgba(204,205,100,0.7)'),
|
|
20526
|
+
* }
|
|
20527
|
+
*
|
|
20528
|
+
* // styled-components usage
|
|
20529
|
+
* const div = styled.div`
|
|
20530
|
+
* background: ${lighten(0.2, '#FFCD64')};
|
|
20531
|
+
* background: ${lighten('0.2', 'rgba(204,205,100,0.7)')};
|
|
20532
|
+
* `
|
|
20533
|
+
*
|
|
20534
|
+
* // CSS in JS Output
|
|
20535
|
+
*
|
|
20536
|
+
* element {
|
|
20537
|
+
* background: "#e5e6b1";
|
|
20538
|
+
* background: "rgba(229,230,177,0.7)";
|
|
20539
|
+
* }
|
|
20540
|
+
*/
|
|
20541
|
+
function lighten(amount, color) {
|
|
20542
|
+
if (color === 'transparent') return color;
|
|
20543
|
+
var hslColor = parseToHsl(color);
|
|
20544
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20545
|
+
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
|
20546
|
+
}));
|
|
20547
|
+
}
|
|
20548
|
+
|
|
20549
|
+
// prettier-ignore
|
|
20550
|
+
var curriedLighten = curry /* ::<number | string, string, string> */(lighten);
|
|
20551
|
+
|
|
20249
20552
|
/**
|
|
20250
20553
|
* 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.
|
|
20251
20554
|
*
|
|
@@ -20272,25 +20575,21 @@ function curry(f) {
|
|
|
20272
20575
|
* background: "rgba(63, 0, 191, 0.75)";
|
|
20273
20576
|
* }
|
|
20274
20577
|
*/
|
|
20275
|
-
|
|
20276
20578
|
function mix$1(weight, color, otherColor) {
|
|
20277
20579
|
if (color === 'transparent') return otherColor;
|
|
20278
20580
|
if (otherColor === 'transparent') return color;
|
|
20279
20581
|
if (weight === 0) return otherColor;
|
|
20280
20582
|
var parsedColor1 = parseToRgb(color);
|
|
20281
|
-
|
|
20282
20583
|
var color1 = _extends$1({}, parsedColor1, {
|
|
20283
20584
|
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
|
|
20284
20585
|
});
|
|
20285
|
-
|
|
20286
20586
|
var parsedColor2 = parseToRgb(otherColor);
|
|
20287
|
-
|
|
20288
20587
|
var color2 = _extends$1({}, parsedColor2, {
|
|
20289
20588
|
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
|
|
20290
|
-
});
|
|
20291
|
-
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
20292
|
-
|
|
20589
|
+
});
|
|
20293
20590
|
|
|
20591
|
+
// The formula is copied from the original Sass implementation:
|
|
20592
|
+
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
20294
20593
|
var alphaDelta = color1.alpha - color2.alpha;
|
|
20295
20594
|
var x = parseFloat(weight) * 2 - 1;
|
|
20296
20595
|
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
|
|
@@ -20304,14 +20603,218 @@ function mix$1(weight, color, otherColor) {
|
|
|
20304
20603
|
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
|
20305
20604
|
};
|
|
20306
20605
|
return rgba$1(mixedColor);
|
|
20307
|
-
}
|
|
20308
|
-
|
|
20606
|
+
}
|
|
20309
20607
|
|
|
20310
|
-
|
|
20311
|
-
/* ::<number | string, string, string, string> */
|
|
20312
|
-
(mix$1);
|
|
20608
|
+
// prettier-ignore
|
|
20609
|
+
var curriedMix = curry /* ::<number | string, string, string, string> */(mix$1);
|
|
20313
20610
|
var mix$1$1 = curriedMix;
|
|
20314
20611
|
|
|
20612
|
+
/**
|
|
20613
|
+
* Increases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20614
|
+
*
|
|
20615
|
+
*
|
|
20616
|
+
* @example
|
|
20617
|
+
* // Styles as object usage
|
|
20618
|
+
* const styles = {
|
|
20619
|
+
* background: opacify(0.1, 'rgba(255, 255, 255, 0.9)');
|
|
20620
|
+
* background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'),
|
|
20621
|
+
* background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'),
|
|
20622
|
+
* }
|
|
20623
|
+
*
|
|
20624
|
+
* // styled-components usage
|
|
20625
|
+
* const div = styled.div`
|
|
20626
|
+
* background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')};
|
|
20627
|
+
* background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')},
|
|
20628
|
+
* background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')},
|
|
20629
|
+
* `
|
|
20630
|
+
*
|
|
20631
|
+
* // CSS in JS Output
|
|
20632
|
+
*
|
|
20633
|
+
* element {
|
|
20634
|
+
* background: "#fff";
|
|
20635
|
+
* background: "rgba(255,255,255,0.7)";
|
|
20636
|
+
* background: "rgba(255,0,0,0.7)";
|
|
20637
|
+
* }
|
|
20638
|
+
*/
|
|
20639
|
+
function opacify(amount, color) {
|
|
20640
|
+
if (color === 'transparent') return color;
|
|
20641
|
+
var parsedColor = parseToRgb(color);
|
|
20642
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20643
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20644
|
+
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
|
20645
|
+
});
|
|
20646
|
+
return rgba$1(colorWithAlpha);
|
|
20647
|
+
}
|
|
20648
|
+
|
|
20649
|
+
// prettier-ignore
|
|
20650
|
+
var curriedOpacify = curry /* ::<number | string, string, string> */(opacify);
|
|
20651
|
+
|
|
20652
|
+
/**
|
|
20653
|
+
* Increases the intensity of a color. Its range is between 0 to 1. The first
|
|
20654
|
+
* argument of the saturate function is the amount by how much the color
|
|
20655
|
+
* intensity should be increased.
|
|
20656
|
+
*
|
|
20657
|
+
* @example
|
|
20658
|
+
* // Styles as object usage
|
|
20659
|
+
* const styles = {
|
|
20660
|
+
* background: saturate(0.2, '#CCCD64'),
|
|
20661
|
+
* background: saturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20662
|
+
* }
|
|
20663
|
+
*
|
|
20664
|
+
* // styled-components usage
|
|
20665
|
+
* const div = styled.div`
|
|
20666
|
+
* background: ${saturate(0.2, '#FFCD64')};
|
|
20667
|
+
* background: ${saturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20668
|
+
* `
|
|
20669
|
+
*
|
|
20670
|
+
* // CSS in JS Output
|
|
20671
|
+
*
|
|
20672
|
+
* element {
|
|
20673
|
+
* background: "#e0e250";
|
|
20674
|
+
* background: "rgba(224,226,80,0.7)";
|
|
20675
|
+
* }
|
|
20676
|
+
*/
|
|
20677
|
+
function saturate(amount, color) {
|
|
20678
|
+
if (color === 'transparent') return color;
|
|
20679
|
+
var hslColor = parseToHsl(color);
|
|
20680
|
+
return toColorString(_extends$1({}, hslColor, {
|
|
20681
|
+
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
|
20682
|
+
}));
|
|
20683
|
+
}
|
|
20684
|
+
|
|
20685
|
+
// prettier-ignore
|
|
20686
|
+
var curriedSaturate = curry /* ::<number | string, string, string> */(saturate);
|
|
20687
|
+
|
|
20688
|
+
/**
|
|
20689
|
+
* Sets the hue of a color to the provided value. The hue range can be
|
|
20690
|
+
* from 0 and 359.
|
|
20691
|
+
*
|
|
20692
|
+
* @example
|
|
20693
|
+
* // Styles as object usage
|
|
20694
|
+
* const styles = {
|
|
20695
|
+
* background: setHue(42, '#CCCD64'),
|
|
20696
|
+
* background: setHue('244', 'rgba(204,205,100,0.7)'),
|
|
20697
|
+
* }
|
|
20698
|
+
*
|
|
20699
|
+
* // styled-components usage
|
|
20700
|
+
* const div = styled.div`
|
|
20701
|
+
* background: ${setHue(42, '#CCCD64')};
|
|
20702
|
+
* background: ${setHue('244', 'rgba(204,205,100,0.7)')};
|
|
20703
|
+
* `
|
|
20704
|
+
*
|
|
20705
|
+
* // CSS in JS Output
|
|
20706
|
+
* element {
|
|
20707
|
+
* background: "#cdae64";
|
|
20708
|
+
* background: "rgba(107,100,205,0.7)";
|
|
20709
|
+
* }
|
|
20710
|
+
*/
|
|
20711
|
+
function setHue(hue, color) {
|
|
20712
|
+
if (color === 'transparent') return color;
|
|
20713
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20714
|
+
hue: parseFloat(hue)
|
|
20715
|
+
}));
|
|
20716
|
+
}
|
|
20717
|
+
|
|
20718
|
+
// prettier-ignore
|
|
20719
|
+
var curriedSetHue = curry /* ::<number | string, string, string> */(setHue);
|
|
20720
|
+
|
|
20721
|
+
/**
|
|
20722
|
+
* Sets the lightness of a color to the provided value. The lightness range can be
|
|
20723
|
+
* from 0 and 1.
|
|
20724
|
+
*
|
|
20725
|
+
* @example
|
|
20726
|
+
* // Styles as object usage
|
|
20727
|
+
* const styles = {
|
|
20728
|
+
* background: setLightness(0.2, '#CCCD64'),
|
|
20729
|
+
* background: setLightness('0.75', 'rgba(204,205,100,0.7)'),
|
|
20730
|
+
* }
|
|
20731
|
+
*
|
|
20732
|
+
* // styled-components usage
|
|
20733
|
+
* const div = styled.div`
|
|
20734
|
+
* background: ${setLightness(0.2, '#CCCD64')};
|
|
20735
|
+
* background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')};
|
|
20736
|
+
* `
|
|
20737
|
+
*
|
|
20738
|
+
* // CSS in JS Output
|
|
20739
|
+
* element {
|
|
20740
|
+
* background: "#4d4d19";
|
|
20741
|
+
* background: "rgba(223,224,159,0.7)";
|
|
20742
|
+
* }
|
|
20743
|
+
*/
|
|
20744
|
+
function setLightness(lightness, color) {
|
|
20745
|
+
if (color === 'transparent') return color;
|
|
20746
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20747
|
+
lightness: parseFloat(lightness)
|
|
20748
|
+
}));
|
|
20749
|
+
}
|
|
20750
|
+
|
|
20751
|
+
// prettier-ignore
|
|
20752
|
+
var curriedSetLightness = curry /* ::<number | string, string, string> */(setLightness);
|
|
20753
|
+
|
|
20754
|
+
/**
|
|
20755
|
+
* Sets the saturation of a color to the provided value. The saturation range can be
|
|
20756
|
+
* from 0 and 1.
|
|
20757
|
+
*
|
|
20758
|
+
* @example
|
|
20759
|
+
* // Styles as object usage
|
|
20760
|
+
* const styles = {
|
|
20761
|
+
* background: setSaturation(0.2, '#CCCD64'),
|
|
20762
|
+
* background: setSaturation('0.75', 'rgba(204,205,100,0.7)'),
|
|
20763
|
+
* }
|
|
20764
|
+
*
|
|
20765
|
+
* // styled-components usage
|
|
20766
|
+
* const div = styled.div`
|
|
20767
|
+
* background: ${setSaturation(0.2, '#CCCD64')};
|
|
20768
|
+
* background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')};
|
|
20769
|
+
* `
|
|
20770
|
+
*
|
|
20771
|
+
* // CSS in JS Output
|
|
20772
|
+
* element {
|
|
20773
|
+
* background: "#adad84";
|
|
20774
|
+
* background: "rgba(228,229,76,0.7)";
|
|
20775
|
+
* }
|
|
20776
|
+
*/
|
|
20777
|
+
function setSaturation(saturation, color) {
|
|
20778
|
+
if (color === 'transparent') return color;
|
|
20779
|
+
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20780
|
+
saturation: parseFloat(saturation)
|
|
20781
|
+
}));
|
|
20782
|
+
}
|
|
20783
|
+
|
|
20784
|
+
// prettier-ignore
|
|
20785
|
+
var curriedSetSaturation = curry /* ::<number | string, string, string> */(setSaturation);
|
|
20786
|
+
|
|
20787
|
+
/**
|
|
20788
|
+
* Shades a color by mixing it with black. `shade` can produce
|
|
20789
|
+
* hue shifts, where as `darken` manipulates the luminance channel and therefore
|
|
20790
|
+
* doesn't produce hue shifts.
|
|
20791
|
+
*
|
|
20792
|
+
* @example
|
|
20793
|
+
* // Styles as object usage
|
|
20794
|
+
* const styles = {
|
|
20795
|
+
* background: shade(0.25, '#00f')
|
|
20796
|
+
* }
|
|
20797
|
+
*
|
|
20798
|
+
* // styled-components usage
|
|
20799
|
+
* const div = styled.div`
|
|
20800
|
+
* background: ${shade(0.25, '#00f')};
|
|
20801
|
+
* `
|
|
20802
|
+
*
|
|
20803
|
+
* // CSS in JS Output
|
|
20804
|
+
*
|
|
20805
|
+
* element {
|
|
20806
|
+
* background: "#00003f";
|
|
20807
|
+
* }
|
|
20808
|
+
*/
|
|
20809
|
+
|
|
20810
|
+
function shade(percentage, color) {
|
|
20811
|
+
if (color === 'transparent') return color;
|
|
20812
|
+
return mix$1$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
|
|
20813
|
+
}
|
|
20814
|
+
|
|
20815
|
+
// prettier-ignore
|
|
20816
|
+
var curriedShade = curry /* ::<number | string, string, string> */(shade);
|
|
20817
|
+
|
|
20315
20818
|
/**
|
|
20316
20819
|
* Tints a color by mixing it with white. `tint` can produce
|
|
20317
20820
|
* hue shifts, where as `lighten` manipulates the luminance channel and therefore
|
|
@@ -20338,14 +20841,52 @@ var mix$1$1 = curriedMix;
|
|
|
20338
20841
|
function tint(percentage, color) {
|
|
20339
20842
|
if (color === 'transparent') return color;
|
|
20340
20843
|
return mix$1$1(parseFloat(percentage), 'rgb(255, 255, 255)', color);
|
|
20341
|
-
}
|
|
20342
|
-
|
|
20844
|
+
}
|
|
20343
20845
|
|
|
20344
|
-
|
|
20345
|
-
/* ::<number | string, string, string> */
|
|
20346
|
-
(tint);
|
|
20846
|
+
// prettier-ignore
|
|
20847
|
+
var curriedTint = curry /* ::<number | string, string, string> */(tint);
|
|
20347
20848
|
var curriedTint$1 = curriedTint;
|
|
20348
20849
|
|
|
20850
|
+
/**
|
|
20851
|
+
* Decreases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20852
|
+
*
|
|
20853
|
+
*
|
|
20854
|
+
* @example
|
|
20855
|
+
* // Styles as object usage
|
|
20856
|
+
* const styles = {
|
|
20857
|
+
* background: transparentize(0.1, '#fff'),
|
|
20858
|
+
* background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
|
|
20859
|
+
* background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'),
|
|
20860
|
+
* }
|
|
20861
|
+
*
|
|
20862
|
+
* // styled-components usage
|
|
20863
|
+
* const div = styled.div`
|
|
20864
|
+
* background: ${transparentize(0.1, '#fff')};
|
|
20865
|
+
* background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')};
|
|
20866
|
+
* background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')};
|
|
20867
|
+
* `
|
|
20868
|
+
*
|
|
20869
|
+
* // CSS in JS Output
|
|
20870
|
+
*
|
|
20871
|
+
* element {
|
|
20872
|
+
* background: "rgba(255,255,255,0.9)";
|
|
20873
|
+
* background: "rgba(255,255,255,0.8)";
|
|
20874
|
+
* background: "rgba(255,0,0,0.3)";
|
|
20875
|
+
* }
|
|
20876
|
+
*/
|
|
20877
|
+
function transparentize(amount, color) {
|
|
20878
|
+
if (color === 'transparent') return color;
|
|
20879
|
+
var parsedColor = parseToRgb(color);
|
|
20880
|
+
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20881
|
+
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20882
|
+
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
|
20883
|
+
});
|
|
20884
|
+
return rgba$1(colorWithAlpha);
|
|
20885
|
+
}
|
|
20886
|
+
|
|
20887
|
+
// prettier-ignore
|
|
20888
|
+
var curriedTransparentize = curry /* ::<number | string, string, string> */(transparentize);
|
|
20889
|
+
|
|
20349
20890
|
var linkColor = MATISSE_BLUE;
|
|
20350
20891
|
var fallbackValues$8 = {
|
|
20351
20892
|
linkColor: linkColor
|
|
@@ -23035,32 +23576,19 @@ var toIndexedObject = function (it) {
|
|
|
23035
23576
|
return indexedObject(requireObjectCoercible(it));
|
|
23036
23577
|
};
|
|
23037
23578
|
|
|
23038
|
-
var documentAll = typeof document == 'object' && document.all;
|
|
23039
|
-
|
|
23040
23579
|
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
23041
|
-
|
|
23042
|
-
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
23043
|
-
|
|
23044
|
-
var documentAll_1 = {
|
|
23045
|
-
all: documentAll,
|
|
23046
|
-
IS_HTMLDDA: IS_HTMLDDA
|
|
23047
|
-
};
|
|
23048
|
-
|
|
23049
|
-
var documentAll$1 = documentAll_1.all;
|
|
23580
|
+
var documentAll = typeof document == 'object' && document.all;
|
|
23050
23581
|
|
|
23051
23582
|
// `IsCallable` abstract operation
|
|
23052
23583
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
23053
|
-
|
|
23054
|
-
|
|
23584
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
23585
|
+
var isCallable = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
|
23586
|
+
return typeof argument == 'function' || argument === documentAll;
|
|
23055
23587
|
} : function (argument) {
|
|
23056
23588
|
return typeof argument == 'function';
|
|
23057
23589
|
};
|
|
23058
23590
|
|
|
23059
|
-
var
|
|
23060
|
-
|
|
23061
|
-
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
23062
|
-
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
23063
|
-
} : function (it) {
|
|
23591
|
+
var isObject = function (it) {
|
|
23064
23592
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
23065
23593
|
};
|
|
23066
23594
|
|
|
@@ -23196,10 +23724,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
23196
23724
|
(module.exports = function (key, value) {
|
|
23197
23725
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
23198
23726
|
})('versions', []).push({
|
|
23199
|
-
version: '3.
|
|
23727
|
+
version: '3.35.1',
|
|
23200
23728
|
mode: 'global',
|
|
23201
|
-
copyright: '© 2014-
|
|
23202
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
23729
|
+
copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
|
23730
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.35.1/LICENSE',
|
|
23203
23731
|
source: 'https://github.com/zloirock/core-js'
|
|
23204
23732
|
});
|
|
23205
23733
|
});
|
|
@@ -23496,7 +24024,7 @@ var TEMPLATE = String(String).split('String');
|
|
|
23496
24024
|
|
|
23497
24025
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
23498
24026
|
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
23499
|
-
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)
|
|
24027
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
|
23500
24028
|
}
|
|
23501
24029
|
if (options && options.getter) name = 'get ' + name;
|
|
23502
24030
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -23584,7 +24112,8 @@ var min$1 = Math.min;
|
|
|
23584
24112
|
// `ToLength` abstract operation
|
|
23585
24113
|
// https://tc39.es/ecma262/#sec-tolength
|
|
23586
24114
|
var toLength = function (argument) {
|
|
23587
|
-
|
|
24115
|
+
var len = toIntegerOrInfinity(argument);
|
|
24116
|
+
return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
23588
24117
|
};
|
|
23589
24118
|
|
|
23590
24119
|
// `LengthOfArrayLike` abstract operation
|
|
@@ -23744,7 +24273,7 @@ var _export = function (options, source) {
|
|
|
23744
24273
|
} else if (STATIC) {
|
|
23745
24274
|
target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
23746
24275
|
} else {
|
|
23747
|
-
target =
|
|
24276
|
+
target = global_1[TARGET] && global_1[TARGET].prototype;
|
|
23748
24277
|
}
|
|
23749
24278
|
if (target) for (key in source) {
|
|
23750
24279
|
sourceProperty = source[key];
|
|
@@ -24007,11 +24536,15 @@ var functionUncurryThisAccessor = function (object, key, method) {
|
|
|
24007
24536
|
} catch (error) { /* empty */ }
|
|
24008
24537
|
};
|
|
24009
24538
|
|
|
24539
|
+
var isPossiblePrototype = function (argument) {
|
|
24540
|
+
return isObject(argument) || argument === null;
|
|
24541
|
+
};
|
|
24542
|
+
|
|
24010
24543
|
var $String$4 = String;
|
|
24011
24544
|
var $TypeError$6 = TypeError;
|
|
24012
24545
|
|
|
24013
24546
|
var aPossiblePrototype = function (argument) {
|
|
24014
|
-
if (
|
|
24547
|
+
if (isPossiblePrototype(argument)) return argument;
|
|
24015
24548
|
throw new $TypeError$6("Can't set " + $String$4(argument) + ' as a prototype');
|
|
24016
24549
|
};
|
|
24017
24550
|
|
|
@@ -39197,7 +39730,9 @@ var WalletName = function WalletName(_ref) {
|
|
|
39197
39730
|
_ref$linkButtonExtraS = _ref.linkButtonExtraStyles,
|
|
39198
39731
|
linkButtonExtraStyles = _ref$linkButtonExtraS === void 0 ? "" : _ref$linkButtonExtraS,
|
|
39199
39732
|
_ref$isLoading = _ref.isLoading,
|
|
39200
|
-
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading
|
|
39733
|
+
isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading,
|
|
39734
|
+
_ref$dataQa = _ref.dataQa,
|
|
39735
|
+
dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
|
|
39201
39736
|
var _useContext = React.useContext(styled.ThemeContext),
|
|
39202
39737
|
isMobile = _useContext.isMobile;
|
|
39203
39738
|
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(Module$1, {
|
|
@@ -39227,6 +39762,7 @@ var WalletName = function WalletName(_ref) {
|
|
|
39227
39762
|
}, text), (text || actionText) && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "\xA0"), action && actionText && /*#__PURE__*/React__default.createElement(ButtonWithAction, {
|
|
39228
39763
|
disabled: disableAction,
|
|
39229
39764
|
text: actionText,
|
|
39765
|
+
dataQa: dataQa,
|
|
39230
39766
|
action: action,
|
|
39231
39767
|
variant: "smallGhost",
|
|
39232
39768
|
extraStyles: "\n margin: 0;\n min-width: 0;\n span {font-size: 0.75rem;}\n ".concat(linkButtonExtraStyles, "\n ")
|