@thecb/components 10.6.2-beta.5 → 10.6.2-beta.7
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 +104 -632
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +104 -632
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/layouts/Box.js +2 -0
- package/src/components/atoms/layouts/Box.styled.js +3 -1
- package/src/components/atoms/placeholder/Placeholder.js +5 -3
- package/src/components/molecules/editable-list/EditableList.stories.js +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -6427,7 +6427,7 @@ var Text = function Text(_ref) {
|
|
|
6427
6427
|
};
|
|
6428
6428
|
var Text$1 = themeComponent(Text, "Text", fallbackValues, "p");
|
|
6429
6429
|
|
|
6430
|
-
var _excluded$2 = ["activeStyles", "hoverStyles", "disabledStyles", "extraStyles", "borderSize", "borderColor", "borderWidthOverride", "borderRadius", "textAlign", "boxShadow", "minHeight", "minWidth", "maxWidth", "padding", "hiddenStyles", "ariaControls", "ariaLabel"];
|
|
6430
|
+
var _excluded$2 = ["activeStyles", "focusStyles", "hoverStyles", "disabledStyles", "extraStyles", "borderSize", "borderColor", "borderWidthOverride", "borderRadius", "textAlign", "boxShadow", "minHeight", "minWidth", "maxWidth", "padding", "hiddenStyles", "ariaControls", "ariaLabel"];
|
|
6431
6431
|
/*
|
|
6432
6432
|
The child span selector on hover styles targets the text inside of buttons when a button is hovered,
|
|
6433
6433
|
as long as the box wrapper has an "as" prop equal to "button"
|
|
@@ -6439,6 +6439,7 @@ var _excluded$2 = ["activeStyles", "hoverStyles", "disabledStyles", "extraStyles
|
|
|
6439
6439
|
/* eslint-disable no-unused-vars */
|
|
6440
6440
|
var BoxWrapper = styled__default(function (_ref) {
|
|
6441
6441
|
var activeStyles = _ref.activeStyles,
|
|
6442
|
+
focusStyles = _ref.focusStyles,
|
|
6442
6443
|
hoverStyles = _ref.hoverStyles,
|
|
6443
6444
|
disabledStyles = _ref.disabledStyles,
|
|
6444
6445
|
extraStyles = _ref.extraStyles,
|
|
@@ -6507,8 +6508,9 @@ var BoxWrapper = styled__default(function (_ref) {
|
|
|
6507
6508
|
disabled = _ref14.disabled;
|
|
6508
6509
|
return styled.css(["", " ", ""], hoverStyles, as === "button" && !disabled ? "> * > span {\n ".concat(hoverStyles, "\n border: none;\n outline: none;\n box-shadow: none;\n }") : "");
|
|
6509
6510
|
}, function (_ref15) {
|
|
6510
|
-
var
|
|
6511
|
-
|
|
6511
|
+
var focusStyles = _ref15.focusStyles,
|
|
6512
|
+
as = _ref15.as;
|
|
6513
|
+
return styled.css(["", " outline:3px solid ", ";outline-offset:2px;", ""], focusStyles, ROYAL_BLUE, as === "button" && "\n > * > span {\n border: none;\n outline: none;\n box-shadow: none;\n }");
|
|
6512
6514
|
}, function (_ref16) {
|
|
6513
6515
|
var activeStyles = _ref16.activeStyles,
|
|
6514
6516
|
as = _ref16.as;
|
|
@@ -6533,7 +6535,7 @@ var BoxWrapper = styled__default(function (_ref) {
|
|
|
6533
6535
|
});
|
|
6534
6536
|
/* eslint-enable no-unused-vars */
|
|
6535
6537
|
|
|
6536
|
-
var _excluded$3 = ["autocompleteValue", "padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "srOnly", "dataQa", "children"];
|
|
6538
|
+
var _excluded$3 = ["autocompleteValue", "padding", "borderSize", "borderColor", "borderRadius", "boxShadow", "background", "color", "minHeight", "width", "minWidth", "maxWidth", "borderWidthOverride", "border", "textAlign", "hoverStyles", "activeStyles", "disabledStyles", "focusStyles", "variant", "as", "onClick", "onKeyDown", "onMouseEnter", "onMouseLeave", "onFocus", "onBlur", "onTouchEnd", "theme", "hiddenStyles", "extraStyles", "srOnly", "dataQa", "children"];
|
|
6537
6539
|
|
|
6538
6540
|
/*
|
|
6539
6541
|
Box component to create generic boxes
|
|
@@ -6566,6 +6568,7 @@ var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
6566
6568
|
hoverStyles = _ref.hoverStyles,
|
|
6567
6569
|
activeStyles = _ref.activeStyles,
|
|
6568
6570
|
disabledStyles = _ref.disabledStyles,
|
|
6571
|
+
focusStyles = _ref.focusStyles,
|
|
6569
6572
|
variant = _ref.variant,
|
|
6570
6573
|
as = _ref.as,
|
|
6571
6574
|
onClick = _ref.onClick,
|
|
@@ -6601,6 +6604,7 @@ var Box = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
6601
6604
|
hoverStyles: hoverStyles,
|
|
6602
6605
|
activeStyles: activeStyles,
|
|
6603
6606
|
disabledStyles: disabledStyles,
|
|
6607
|
+
focusStyles: focusStyles,
|
|
6604
6608
|
variant: variant,
|
|
6605
6609
|
as: as,
|
|
6606
6610
|
onClick: onClick,
|
|
@@ -19614,6 +19618,7 @@ function _wrapNativeSuper(Class) {
|
|
|
19614
19618
|
}
|
|
19615
19619
|
|
|
19616
19620
|
// based on https://github.com/styled-components/styled-components/blob/fcf6f3804c57a14dd7984dfab7bc06ee2edca044/src/utils/error.js
|
|
19621
|
+
|
|
19617
19622
|
/**
|
|
19618
19623
|
* Parse errors.md and turn it into a simple hash of code: message
|
|
19619
19624
|
* @private
|
|
@@ -19698,71 +19703,84 @@ var ERRORS = {
|
|
|
19698
19703
|
"77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
|
|
19699
19704
|
"78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
|
|
19700
19705
|
};
|
|
19701
|
-
|
|
19702
19706
|
/**
|
|
19703
19707
|
* super basic version of sprintf
|
|
19704
19708
|
* @private
|
|
19705
19709
|
*/
|
|
19710
|
+
|
|
19706
19711
|
function format() {
|
|
19707
19712
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19708
19713
|
args[_key] = arguments[_key];
|
|
19709
19714
|
}
|
|
19715
|
+
|
|
19710
19716
|
var a = args[0];
|
|
19711
19717
|
var b = [];
|
|
19712
19718
|
var c;
|
|
19719
|
+
|
|
19713
19720
|
for (c = 1; c < args.length; c += 1) {
|
|
19714
19721
|
b.push(args[c]);
|
|
19715
19722
|
}
|
|
19723
|
+
|
|
19716
19724
|
b.forEach(function (d) {
|
|
19717
19725
|
a = a.replace(/%[a-z]/, d);
|
|
19718
19726
|
});
|
|
19719
19727
|
return a;
|
|
19720
19728
|
}
|
|
19721
|
-
|
|
19722
19729
|
/**
|
|
19723
19730
|
* Create an error file out of errors.md for development and a simple web link to the full errors
|
|
19724
19731
|
* in production mode.
|
|
19725
19732
|
* @private
|
|
19726
19733
|
*/
|
|
19734
|
+
|
|
19735
|
+
|
|
19727
19736
|
var PolishedError = /*#__PURE__*/function (_Error) {
|
|
19728
19737
|
_inheritsLoose(PolishedError, _Error);
|
|
19738
|
+
|
|
19729
19739
|
function PolishedError(code) {
|
|
19730
19740
|
var _this;
|
|
19741
|
+
|
|
19731
19742
|
if (process.env.NODE_ENV === 'production') {
|
|
19732
19743
|
_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;
|
|
19733
19744
|
} else {
|
|
19734
19745
|
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
19735
19746
|
args[_key2 - 1] = arguments[_key2];
|
|
19736
19747
|
}
|
|
19748
|
+
|
|
19737
19749
|
_this = _Error.call(this, format.apply(void 0, [ERRORS[code]].concat(args))) || this;
|
|
19738
19750
|
}
|
|
19751
|
+
|
|
19739
19752
|
return _assertThisInitialized(_this);
|
|
19740
19753
|
}
|
|
19754
|
+
|
|
19741
19755
|
return PolishedError;
|
|
19742
19756
|
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
19743
19757
|
|
|
19744
19758
|
function colorToInt(color) {
|
|
19745
19759
|
return Math.round(color * 255);
|
|
19746
19760
|
}
|
|
19761
|
+
|
|
19747
19762
|
function convertToInt(red, green, blue) {
|
|
19748
19763
|
return colorToInt(red) + "," + colorToInt(green) + "," + colorToInt(blue);
|
|
19749
19764
|
}
|
|
19765
|
+
|
|
19750
19766
|
function hslToRgb(hue, saturation, lightness, convert) {
|
|
19751
19767
|
if (convert === void 0) {
|
|
19752
19768
|
convert = convertToInt;
|
|
19753
19769
|
}
|
|
19770
|
+
|
|
19754
19771
|
if (saturation === 0) {
|
|
19755
19772
|
// achromatic
|
|
19756
19773
|
return convert(lightness, lightness, lightness);
|
|
19757
|
-
}
|
|
19774
|
+
} // formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
19775
|
+
|
|
19758
19776
|
|
|
19759
|
-
// formulae from https://en.wikipedia.org/wiki/HSL_and_HSV
|
|
19760
19777
|
var huePrime = (hue % 360 + 360) % 360 / 60;
|
|
19761
19778
|
var chroma = (1 - Math.abs(2 * lightness - 1)) * saturation;
|
|
19762
19779
|
var secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
19763
19780
|
var red = 0;
|
|
19764
19781
|
var green = 0;
|
|
19765
19782
|
var blue = 0;
|
|
19783
|
+
|
|
19766
19784
|
if (huePrime >= 0 && huePrime < 1) {
|
|
19767
19785
|
red = chroma;
|
|
19768
19786
|
green = secondComponent;
|
|
@@ -19782,6 +19800,7 @@ function hslToRgb(hue, saturation, lightness, convert) {
|
|
|
19782
19800
|
red = chroma;
|
|
19783
19801
|
blue = secondComponent;
|
|
19784
19802
|
}
|
|
19803
|
+
|
|
19785
19804
|
var lightnessModification = lightness - chroma / 2;
|
|
19786
19805
|
var finalRed = red + lightnessModification;
|
|
19787
19806
|
var finalGreen = green + lightnessModification;
|
|
@@ -19939,11 +19958,11 @@ var namedColorMap = {
|
|
|
19939
19958
|
yellow: 'ff0',
|
|
19940
19959
|
yellowgreen: '9acd32'
|
|
19941
19960
|
};
|
|
19942
|
-
|
|
19943
19961
|
/**
|
|
19944
19962
|
* Checks if a string is a CSS named color and returns its equivalent hex value, otherwise returns the original color.
|
|
19945
19963
|
* @private
|
|
19946
19964
|
*/
|
|
19965
|
+
|
|
19947
19966
|
function nameToHex(color) {
|
|
19948
19967
|
if (typeof color !== 'string') return color;
|
|
19949
19968
|
var normalizedColorName = color.toLowerCase();
|
|
@@ -19958,7 +19977,6 @@ var rgbRegex = /^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\
|
|
|
19958
19977
|
var rgbaRegex = /^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;
|
|
19959
19978
|
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;
|
|
19960
19979
|
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;
|
|
19961
|
-
|
|
19962
19980
|
/**
|
|
19963
19981
|
* Returns an RgbColor or RgbaColor object. This utility function is only useful
|
|
19964
19982
|
* if want to extract a color component. With the color util `toColorString` you
|
|
@@ -19970,11 +19988,14 @@ var hslaRegex = /^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[
|
|
|
19970
19988
|
* // Assigns `{ red: 92, green: 102, blue: 112, alpha: 0.75 }` to color2
|
|
19971
19989
|
* const color2 = parseToRgb('hsla(210, 10%, 40%, 0.75)');
|
|
19972
19990
|
*/
|
|
19991
|
+
|
|
19973
19992
|
function parseToRgb(color) {
|
|
19974
19993
|
if (typeof color !== 'string') {
|
|
19975
19994
|
throw new PolishedError(3);
|
|
19976
19995
|
}
|
|
19996
|
+
|
|
19977
19997
|
var normalizedColor = nameToHex(color);
|
|
19998
|
+
|
|
19978
19999
|
if (normalizedColor.match(hexRegex)) {
|
|
19979
20000
|
return {
|
|
19980
20001
|
red: parseInt("" + normalizedColor[1] + normalizedColor[2], 16),
|
|
@@ -19982,6 +20003,7 @@ function parseToRgb(color) {
|
|
|
19982
20003
|
blue: parseInt("" + normalizedColor[5] + normalizedColor[6], 16)
|
|
19983
20004
|
};
|
|
19984
20005
|
}
|
|
20006
|
+
|
|
19985
20007
|
if (normalizedColor.match(hexRgbaRegex)) {
|
|
19986
20008
|
var alpha = parseFloat((parseInt("" + normalizedColor[7] + normalizedColor[8], 16) / 255).toFixed(2));
|
|
19987
20009
|
return {
|
|
@@ -19991,6 +20013,7 @@ function parseToRgb(color) {
|
|
|
19991
20013
|
alpha: alpha
|
|
19992
20014
|
};
|
|
19993
20015
|
}
|
|
20016
|
+
|
|
19994
20017
|
if (normalizedColor.match(reducedHexRegex)) {
|
|
19995
20018
|
return {
|
|
19996
20019
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
@@ -19998,8 +20021,10 @@ function parseToRgb(color) {
|
|
|
19998
20021
|
blue: parseInt("" + normalizedColor[3] + normalizedColor[3], 16)
|
|
19999
20022
|
};
|
|
20000
20023
|
}
|
|
20024
|
+
|
|
20001
20025
|
if (normalizedColor.match(reducedRgbaHexRegex)) {
|
|
20002
20026
|
var _alpha = parseFloat((parseInt("" + normalizedColor[4] + normalizedColor[4], 16) / 255).toFixed(2));
|
|
20027
|
+
|
|
20003
20028
|
return {
|
|
20004
20029
|
red: parseInt("" + normalizedColor[1] + normalizedColor[1], 16),
|
|
20005
20030
|
green: parseInt("" + normalizedColor[2] + normalizedColor[2], 16),
|
|
@@ -20007,7 +20032,9 @@ function parseToRgb(color) {
|
|
|
20007
20032
|
alpha: _alpha
|
|
20008
20033
|
};
|
|
20009
20034
|
}
|
|
20035
|
+
|
|
20010
20036
|
var rgbMatched = rgbRegex.exec(normalizedColor);
|
|
20037
|
+
|
|
20011
20038
|
if (rgbMatched) {
|
|
20012
20039
|
return {
|
|
20013
20040
|
red: parseInt("" + rgbMatched[1], 10),
|
|
@@ -20015,7 +20042,9 @@ function parseToRgb(color) {
|
|
|
20015
20042
|
blue: parseInt("" + rgbMatched[3], 10)
|
|
20016
20043
|
};
|
|
20017
20044
|
}
|
|
20045
|
+
|
|
20018
20046
|
var rgbaMatched = rgbaRegex.exec(normalizedColor.substring(0, 50));
|
|
20047
|
+
|
|
20019
20048
|
if (rgbaMatched) {
|
|
20020
20049
|
return {
|
|
20021
20050
|
red: parseInt("" + rgbaMatched[1], 10),
|
|
@@ -20024,32 +20053,44 @@ function parseToRgb(color) {
|
|
|
20024
20053
|
alpha: parseFloat("" + rgbaMatched[4]) > 1 ? parseFloat("" + rgbaMatched[4]) / 100 : parseFloat("" + rgbaMatched[4])
|
|
20025
20054
|
};
|
|
20026
20055
|
}
|
|
20056
|
+
|
|
20027
20057
|
var hslMatched = hslRegex.exec(normalizedColor);
|
|
20058
|
+
|
|
20028
20059
|
if (hslMatched) {
|
|
20029
20060
|
var hue = parseInt("" + hslMatched[1], 10);
|
|
20030
20061
|
var saturation = parseInt("" + hslMatched[2], 10) / 100;
|
|
20031
20062
|
var lightness = parseInt("" + hslMatched[3], 10) / 100;
|
|
20032
20063
|
var rgbColorString = "rgb(" + hslToRgb(hue, saturation, lightness) + ")";
|
|
20033
20064
|
var hslRgbMatched = rgbRegex.exec(rgbColorString);
|
|
20065
|
+
|
|
20034
20066
|
if (!hslRgbMatched) {
|
|
20035
20067
|
throw new PolishedError(4, normalizedColor, rgbColorString);
|
|
20036
20068
|
}
|
|
20069
|
+
|
|
20037
20070
|
return {
|
|
20038
20071
|
red: parseInt("" + hslRgbMatched[1], 10),
|
|
20039
20072
|
green: parseInt("" + hslRgbMatched[2], 10),
|
|
20040
20073
|
blue: parseInt("" + hslRgbMatched[3], 10)
|
|
20041
20074
|
};
|
|
20042
20075
|
}
|
|
20076
|
+
|
|
20043
20077
|
var hslaMatched = hslaRegex.exec(normalizedColor.substring(0, 50));
|
|
20078
|
+
|
|
20044
20079
|
if (hslaMatched) {
|
|
20045
20080
|
var _hue = parseInt("" + hslaMatched[1], 10);
|
|
20081
|
+
|
|
20046
20082
|
var _saturation = parseInt("" + hslaMatched[2], 10) / 100;
|
|
20083
|
+
|
|
20047
20084
|
var _lightness = parseInt("" + hslaMatched[3], 10) / 100;
|
|
20085
|
+
|
|
20048
20086
|
var _rgbColorString = "rgb(" + hslToRgb(_hue, _saturation, _lightness) + ")";
|
|
20087
|
+
|
|
20049
20088
|
var _hslRgbMatched = rgbRegex.exec(_rgbColorString);
|
|
20089
|
+
|
|
20050
20090
|
if (!_hslRgbMatched) {
|
|
20051
20091
|
throw new PolishedError(4, normalizedColor, _rgbColorString);
|
|
20052
20092
|
}
|
|
20093
|
+
|
|
20053
20094
|
return {
|
|
20054
20095
|
red: parseInt("" + _hslRgbMatched[1], 10),
|
|
20055
20096
|
green: parseInt("" + _hslRgbMatched[2], 10),
|
|
@@ -20057,80 +20098,8 @@ function parseToRgb(color) {
|
|
|
20057
20098
|
alpha: parseFloat("" + hslaMatched[4]) > 1 ? parseFloat("" + hslaMatched[4]) / 100 : parseFloat("" + hslaMatched[4])
|
|
20058
20099
|
};
|
|
20059
20100
|
}
|
|
20060
|
-
throw new PolishedError(5);
|
|
20061
|
-
}
|
|
20062
|
-
|
|
20063
|
-
function rgbToHsl(color) {
|
|
20064
|
-
// make sure rgb are contained in a set of [0, 255]
|
|
20065
|
-
var red = color.red / 255;
|
|
20066
|
-
var green = color.green / 255;
|
|
20067
|
-
var blue = color.blue / 255;
|
|
20068
|
-
var max = Math.max(red, green, blue);
|
|
20069
|
-
var min = Math.min(red, green, blue);
|
|
20070
|
-
var lightness = (max + min) / 2;
|
|
20071
|
-
if (max === min) {
|
|
20072
|
-
// achromatic
|
|
20073
|
-
if (color.alpha !== undefined) {
|
|
20074
|
-
return {
|
|
20075
|
-
hue: 0,
|
|
20076
|
-
saturation: 0,
|
|
20077
|
-
lightness: lightness,
|
|
20078
|
-
alpha: color.alpha
|
|
20079
|
-
};
|
|
20080
|
-
} else {
|
|
20081
|
-
return {
|
|
20082
|
-
hue: 0,
|
|
20083
|
-
saturation: 0,
|
|
20084
|
-
lightness: lightness
|
|
20085
|
-
};
|
|
20086
|
-
}
|
|
20087
|
-
}
|
|
20088
|
-
var hue;
|
|
20089
|
-
var delta = max - min;
|
|
20090
|
-
var saturation = lightness > 0.5 ? delta / (2 - max - min) : delta / (max + min);
|
|
20091
|
-
switch (max) {
|
|
20092
|
-
case red:
|
|
20093
|
-
hue = (green - blue) / delta + (green < blue ? 6 : 0);
|
|
20094
|
-
break;
|
|
20095
|
-
case green:
|
|
20096
|
-
hue = (blue - red) / delta + 2;
|
|
20097
|
-
break;
|
|
20098
|
-
default:
|
|
20099
|
-
// blue case
|
|
20100
|
-
hue = (red - green) / delta + 4;
|
|
20101
|
-
break;
|
|
20102
|
-
}
|
|
20103
|
-
hue *= 60;
|
|
20104
|
-
if (color.alpha !== undefined) {
|
|
20105
|
-
return {
|
|
20106
|
-
hue: hue,
|
|
20107
|
-
saturation: saturation,
|
|
20108
|
-
lightness: lightness,
|
|
20109
|
-
alpha: color.alpha
|
|
20110
|
-
};
|
|
20111
|
-
}
|
|
20112
|
-
return {
|
|
20113
|
-
hue: hue,
|
|
20114
|
-
saturation: saturation,
|
|
20115
|
-
lightness: lightness
|
|
20116
|
-
};
|
|
20117
|
-
}
|
|
20118
20101
|
|
|
20119
|
-
|
|
20120
|
-
* Returns an HslColor or HslaColor object. This utility function is only useful
|
|
20121
|
-
* if want to extract a color component. With the color util `toColorString` you
|
|
20122
|
-
* can convert a HslColor or HslaColor object back to a string.
|
|
20123
|
-
*
|
|
20124
|
-
* @example
|
|
20125
|
-
* // Assigns `{ hue: 0, saturation: 1, lightness: 0.5 }` to color1
|
|
20126
|
-
* const color1 = parseToHsl('rgb(255, 0, 0)');
|
|
20127
|
-
* // Assigns `{ hue: 128, saturation: 1, lightness: 0.5, alpha: 0.75 }` to color2
|
|
20128
|
-
* const color2 = parseToHsl('hsla(128, 100%, 50%, 0.75)');
|
|
20129
|
-
*/
|
|
20130
|
-
function parseToHsl(color) {
|
|
20131
|
-
// Note: At a later stage we can optimize this function as right now a hsl
|
|
20132
|
-
// color would be parsed converted to rgb values and converted back to hsl.
|
|
20133
|
-
return rgbToHsl(parseToRgb(color));
|
|
20102
|
+
throw new PolishedError(5);
|
|
20134
20103
|
}
|
|
20135
20104
|
|
|
20136
20105
|
/**
|
|
@@ -20141,8 +20110,10 @@ var reduceHexValue = function reduceHexValue(value) {
|
|
|
20141
20110
|
if (value.length === 7 && value[1] === value[2] && value[3] === value[4] && value[5] === value[6]) {
|
|
20142
20111
|
return "#" + value[1] + value[3] + value[5];
|
|
20143
20112
|
}
|
|
20113
|
+
|
|
20144
20114
|
return value;
|
|
20145
20115
|
};
|
|
20116
|
+
|
|
20146
20117
|
var reduceHexValue$1 = reduceHexValue;
|
|
20147
20118
|
|
|
20148
20119
|
function numberToHex(value) {
|
|
@@ -20150,83 +20121,6 @@ function numberToHex(value) {
|
|
|
20150
20121
|
return hex.length === 1 ? "0" + hex : hex;
|
|
20151
20122
|
}
|
|
20152
20123
|
|
|
20153
|
-
function colorToHex(color) {
|
|
20154
|
-
return numberToHex(Math.round(color * 255));
|
|
20155
|
-
}
|
|
20156
|
-
function convertToHex(red, green, blue) {
|
|
20157
|
-
return reduceHexValue$1("#" + colorToHex(red) + colorToHex(green) + colorToHex(blue));
|
|
20158
|
-
}
|
|
20159
|
-
function hslToHex(hue, saturation, lightness) {
|
|
20160
|
-
return hslToRgb(hue, saturation, lightness, convertToHex);
|
|
20161
|
-
}
|
|
20162
|
-
|
|
20163
|
-
/**
|
|
20164
|
-
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
20165
|
-
*
|
|
20166
|
-
* @example
|
|
20167
|
-
* // Styles as object usage
|
|
20168
|
-
* const styles = {
|
|
20169
|
-
* background: hsl(359, 0.75, 0.4),
|
|
20170
|
-
* background: hsl({ hue: 360, saturation: 0.75, lightness: 0.4 }),
|
|
20171
|
-
* }
|
|
20172
|
-
*
|
|
20173
|
-
* // styled-components usage
|
|
20174
|
-
* const div = styled.div`
|
|
20175
|
-
* background: ${hsl(359, 0.75, 0.4)};
|
|
20176
|
-
* background: ${hsl({ hue: 360, saturation: 0.75, lightness: 0.4 })};
|
|
20177
|
-
* `
|
|
20178
|
-
*
|
|
20179
|
-
* // CSS in JS Output
|
|
20180
|
-
*
|
|
20181
|
-
* element {
|
|
20182
|
-
* background: "#b3191c";
|
|
20183
|
-
* background: "#b3191c";
|
|
20184
|
-
* }
|
|
20185
|
-
*/
|
|
20186
|
-
function hsl(value, saturation, lightness) {
|
|
20187
|
-
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number') {
|
|
20188
|
-
return hslToHex(value, saturation, lightness);
|
|
20189
|
-
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined) {
|
|
20190
|
-
return hslToHex(value.hue, value.saturation, value.lightness);
|
|
20191
|
-
}
|
|
20192
|
-
throw new PolishedError(1);
|
|
20193
|
-
}
|
|
20194
|
-
|
|
20195
|
-
/**
|
|
20196
|
-
* Returns a string value for the color. The returned result is the smallest possible rgba or hex notation.
|
|
20197
|
-
*
|
|
20198
|
-
* @example
|
|
20199
|
-
* // Styles as object usage
|
|
20200
|
-
* const styles = {
|
|
20201
|
-
* background: hsla(359, 0.75, 0.4, 0.7),
|
|
20202
|
-
* background: hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 }),
|
|
20203
|
-
* background: hsla(359, 0.75, 0.4, 1),
|
|
20204
|
-
* }
|
|
20205
|
-
*
|
|
20206
|
-
* // styled-components usage
|
|
20207
|
-
* const div = styled.div`
|
|
20208
|
-
* background: ${hsla(359, 0.75, 0.4, 0.7)};
|
|
20209
|
-
* background: ${hsla({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0,7 })};
|
|
20210
|
-
* background: ${hsla(359, 0.75, 0.4, 1)};
|
|
20211
|
-
* `
|
|
20212
|
-
*
|
|
20213
|
-
* // CSS in JS Output
|
|
20214
|
-
*
|
|
20215
|
-
* element {
|
|
20216
|
-
* background: "rgba(179,25,28,0.7)";
|
|
20217
|
-
* background: "rgba(179,25,28,0.7)";
|
|
20218
|
-
* background: "#b3191c";
|
|
20219
|
-
* }
|
|
20220
|
-
*/
|
|
20221
|
-
function hsla$1(value, saturation, lightness, alpha) {
|
|
20222
|
-
if (typeof value === 'number' && typeof saturation === 'number' && typeof lightness === 'number' && typeof alpha === 'number') {
|
|
20223
|
-
return alpha >= 1 ? hslToHex(value, saturation, lightness) : "rgba(" + hslToRgb(value, saturation, lightness) + "," + alpha + ")";
|
|
20224
|
-
} else if (typeof value === 'object' && saturation === undefined && lightness === undefined && alpha === undefined) {
|
|
20225
|
-
return value.alpha >= 1 ? hslToHex(value.hue, value.saturation, value.lightness) : "rgba(" + hslToRgb(value.hue, value.saturation, value.lightness) + "," + value.alpha + ")";
|
|
20226
|
-
}
|
|
20227
|
-
throw new PolishedError(2);
|
|
20228
|
-
}
|
|
20229
|
-
|
|
20230
20124
|
/**
|
|
20231
20125
|
* Returns a string value for the color. The returned result is the smallest possible hex notation.
|
|
20232
20126
|
*
|
|
@@ -20256,6 +20150,7 @@ function rgb(value, green, blue) {
|
|
|
20256
20150
|
} else if (typeof value === 'object' && green === undefined && blue === undefined) {
|
|
20257
20151
|
return reduceHexValue$1("#" + numberToHex(value.red) + numberToHex(value.green) + numberToHex(value.blue));
|
|
20258
20152
|
}
|
|
20153
|
+
|
|
20259
20154
|
throw new PolishedError(6);
|
|
20260
20155
|
}
|
|
20261
20156
|
|
|
@@ -20302,60 +20197,8 @@ function rgba$1(firstValue, secondValue, thirdValue, fourthValue) {
|
|
|
20302
20197
|
} else if (typeof firstValue === 'object' && secondValue === undefined && thirdValue === undefined && fourthValue === undefined) {
|
|
20303
20198
|
return firstValue.alpha >= 1 ? rgb(firstValue.red, firstValue.green, firstValue.blue) : "rgba(" + firstValue.red + "," + firstValue.green + "," + firstValue.blue + "," + firstValue.alpha + ")";
|
|
20304
20199
|
}
|
|
20305
|
-
throw new PolishedError(7);
|
|
20306
|
-
}
|
|
20307
20200
|
|
|
20308
|
-
|
|
20309
|
-
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
20310
|
-
};
|
|
20311
|
-
var isRgba$1 = function isRgba(color) {
|
|
20312
|
-
return typeof color.red === 'number' && typeof color.green === 'number' && typeof color.blue === 'number' && typeof color.alpha === 'number';
|
|
20313
|
-
};
|
|
20314
|
-
var isHsl = function isHsl(color) {
|
|
20315
|
-
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && (typeof color.alpha !== 'number' || typeof color.alpha === 'undefined');
|
|
20316
|
-
};
|
|
20317
|
-
var isHsla$1 = function isHsla(color) {
|
|
20318
|
-
return typeof color.hue === 'number' && typeof color.saturation === 'number' && typeof color.lightness === 'number' && typeof color.alpha === 'number';
|
|
20319
|
-
};
|
|
20320
|
-
|
|
20321
|
-
/**
|
|
20322
|
-
* Converts a RgbColor, RgbaColor, HslColor or HslaColor object to a color string.
|
|
20323
|
-
* This util is useful in case you only know on runtime which color object is
|
|
20324
|
-
* used. Otherwise we recommend to rely on `rgb`, `rgba`, `hsl` or `hsla`.
|
|
20325
|
-
*
|
|
20326
|
-
* @example
|
|
20327
|
-
* // Styles as object usage
|
|
20328
|
-
* const styles = {
|
|
20329
|
-
* background: toColorString({ red: 255, green: 205, blue: 100 }),
|
|
20330
|
-
* background: toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 }),
|
|
20331
|
-
* background: toColorString({ hue: 240, saturation: 1, lightness: 0.5 }),
|
|
20332
|
-
* background: toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 }),
|
|
20333
|
-
* }
|
|
20334
|
-
*
|
|
20335
|
-
* // styled-components usage
|
|
20336
|
-
* const div = styled.div`
|
|
20337
|
-
* background: ${toColorString({ red: 255, green: 205, blue: 100 })};
|
|
20338
|
-
* background: ${toColorString({ red: 255, green: 205, blue: 100, alpha: 0.72 })};
|
|
20339
|
-
* background: ${toColorString({ hue: 240, saturation: 1, lightness: 0.5 })};
|
|
20340
|
-
* background: ${toColorString({ hue: 360, saturation: 0.75, lightness: 0.4, alpha: 0.72 })};
|
|
20341
|
-
* `
|
|
20342
|
-
*
|
|
20343
|
-
* // CSS in JS Output
|
|
20344
|
-
* element {
|
|
20345
|
-
* background: "#ffcd64";
|
|
20346
|
-
* background: "rgba(255,205,100,0.72)";
|
|
20347
|
-
* background: "#00f";
|
|
20348
|
-
* background: "rgba(179,25,25,0.72)";
|
|
20349
|
-
* }
|
|
20350
|
-
*/
|
|
20351
|
-
|
|
20352
|
-
function toColorString(color) {
|
|
20353
|
-
if (typeof color !== 'object') throw new PolishedError(8);
|
|
20354
|
-
if (isRgba$1(color)) return rgba$1(color);
|
|
20355
|
-
if (isRgb(color)) return rgb(color);
|
|
20356
|
-
if (isHsla$1(color)) return hsla$1(color);
|
|
20357
|
-
if (isHsl(color)) return hsl(color);
|
|
20358
|
-
throw new PolishedError(8);
|
|
20201
|
+
throw new PolishedError(7);
|
|
20359
20202
|
}
|
|
20360
20203
|
|
|
20361
20204
|
// Type definitions taken from https://github.com/gcanti/flow-static-land/blob/master/src/Fun.js
|
|
@@ -20368,156 +20211,14 @@ function curried(f, length, acc) {
|
|
|
20368
20211
|
var combined = acc.concat(Array.prototype.slice.call(arguments));
|
|
20369
20212
|
return combined.length >= length ? f.apply(this, combined) : curried(f, length, combined);
|
|
20370
20213
|
};
|
|
20371
|
-
}
|
|
20214
|
+
} // eslint-disable-next-line no-redeclare
|
|
20215
|
+
|
|
20372
20216
|
|
|
20373
|
-
// eslint-disable-next-line no-redeclare
|
|
20374
20217
|
function curry(f) {
|
|
20375
20218
|
// eslint-disable-line no-redeclare
|
|
20376
20219
|
return curried(f, f.length, []);
|
|
20377
20220
|
}
|
|
20378
20221
|
|
|
20379
|
-
/**
|
|
20380
|
-
* Changes the hue of the color. Hue is a number between 0 to 360. The first
|
|
20381
|
-
* argument for adjustHue is the amount of degrees the color is rotated around
|
|
20382
|
-
* the color wheel, always producing a positive hue value.
|
|
20383
|
-
*
|
|
20384
|
-
* @example
|
|
20385
|
-
* // Styles as object usage
|
|
20386
|
-
* const styles = {
|
|
20387
|
-
* background: adjustHue(180, '#448'),
|
|
20388
|
-
* background: adjustHue('180', 'rgba(101,100,205,0.7)'),
|
|
20389
|
-
* }
|
|
20390
|
-
*
|
|
20391
|
-
* // styled-components usage
|
|
20392
|
-
* const div = styled.div`
|
|
20393
|
-
* background: ${adjustHue(180, '#448')};
|
|
20394
|
-
* background: ${adjustHue('180', 'rgba(101,100,205,0.7)')};
|
|
20395
|
-
* `
|
|
20396
|
-
*
|
|
20397
|
-
* // CSS in JS Output
|
|
20398
|
-
* element {
|
|
20399
|
-
* background: "#888844";
|
|
20400
|
-
* background: "rgba(136,136,68,0.7)";
|
|
20401
|
-
* }
|
|
20402
|
-
*/
|
|
20403
|
-
function adjustHue(degree, color) {
|
|
20404
|
-
if (color === 'transparent') return color;
|
|
20405
|
-
var hslColor = parseToHsl(color);
|
|
20406
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
20407
|
-
hue: hslColor.hue + parseFloat(degree)
|
|
20408
|
-
}));
|
|
20409
|
-
}
|
|
20410
|
-
|
|
20411
|
-
// prettier-ignore
|
|
20412
|
-
var curriedAdjustHue = curry /* ::<number | string, string, string> */(adjustHue);
|
|
20413
|
-
|
|
20414
|
-
function guard(lowerBoundary, upperBoundary, value) {
|
|
20415
|
-
return Math.max(lowerBoundary, Math.min(upperBoundary, value));
|
|
20416
|
-
}
|
|
20417
|
-
|
|
20418
|
-
/**
|
|
20419
|
-
* Returns a string value for the darkened color.
|
|
20420
|
-
*
|
|
20421
|
-
* @example
|
|
20422
|
-
* // Styles as object usage
|
|
20423
|
-
* const styles = {
|
|
20424
|
-
* background: darken(0.2, '#FFCD64'),
|
|
20425
|
-
* background: darken('0.2', 'rgba(255,205,100,0.7)'),
|
|
20426
|
-
* }
|
|
20427
|
-
*
|
|
20428
|
-
* // styled-components usage
|
|
20429
|
-
* const div = styled.div`
|
|
20430
|
-
* background: ${darken(0.2, '#FFCD64')};
|
|
20431
|
-
* background: ${darken('0.2', 'rgba(255,205,100,0.7)')};
|
|
20432
|
-
* `
|
|
20433
|
-
*
|
|
20434
|
-
* // CSS in JS Output
|
|
20435
|
-
*
|
|
20436
|
-
* element {
|
|
20437
|
-
* background: "#ffbd31";
|
|
20438
|
-
* background: "rgba(255,189,49,0.7)";
|
|
20439
|
-
* }
|
|
20440
|
-
*/
|
|
20441
|
-
function darken(amount, color) {
|
|
20442
|
-
if (color === 'transparent') return color;
|
|
20443
|
-
var hslColor = parseToHsl(color);
|
|
20444
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
20445
|
-
lightness: guard(0, 1, hslColor.lightness - parseFloat(amount))
|
|
20446
|
-
}));
|
|
20447
|
-
}
|
|
20448
|
-
|
|
20449
|
-
// prettier-ignore
|
|
20450
|
-
var curriedDarken = curry /* ::<number | string, string, string> */(darken);
|
|
20451
|
-
|
|
20452
|
-
/**
|
|
20453
|
-
* Decreases the intensity of a color. Its range is between 0 to 1. The first
|
|
20454
|
-
* argument of the desaturate function is the amount by how much the color
|
|
20455
|
-
* intensity should be decreased.
|
|
20456
|
-
*
|
|
20457
|
-
* @example
|
|
20458
|
-
* // Styles as object usage
|
|
20459
|
-
* const styles = {
|
|
20460
|
-
* background: desaturate(0.2, '#CCCD64'),
|
|
20461
|
-
* background: desaturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20462
|
-
* }
|
|
20463
|
-
*
|
|
20464
|
-
* // styled-components usage
|
|
20465
|
-
* const div = styled.div`
|
|
20466
|
-
* background: ${desaturate(0.2, '#CCCD64')};
|
|
20467
|
-
* background: ${desaturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20468
|
-
* `
|
|
20469
|
-
*
|
|
20470
|
-
* // CSS in JS Output
|
|
20471
|
-
* element {
|
|
20472
|
-
* background: "#b8b979";
|
|
20473
|
-
* background: "rgba(184,185,121,0.7)";
|
|
20474
|
-
* }
|
|
20475
|
-
*/
|
|
20476
|
-
function desaturate(amount, color) {
|
|
20477
|
-
if (color === 'transparent') return color;
|
|
20478
|
-
var hslColor = parseToHsl(color);
|
|
20479
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
20480
|
-
saturation: guard(0, 1, hslColor.saturation - parseFloat(amount))
|
|
20481
|
-
}));
|
|
20482
|
-
}
|
|
20483
|
-
|
|
20484
|
-
// prettier-ignore
|
|
20485
|
-
var curriedDesaturate = curry /* ::<number | string, string, string> */(desaturate);
|
|
20486
|
-
|
|
20487
|
-
/**
|
|
20488
|
-
* Returns a string value for the lightened color.
|
|
20489
|
-
*
|
|
20490
|
-
* @example
|
|
20491
|
-
* // Styles as object usage
|
|
20492
|
-
* const styles = {
|
|
20493
|
-
* background: lighten(0.2, '#CCCD64'),
|
|
20494
|
-
* background: lighten('0.2', 'rgba(204,205,100,0.7)'),
|
|
20495
|
-
* }
|
|
20496
|
-
*
|
|
20497
|
-
* // styled-components usage
|
|
20498
|
-
* const div = styled.div`
|
|
20499
|
-
* background: ${lighten(0.2, '#FFCD64')};
|
|
20500
|
-
* background: ${lighten('0.2', 'rgba(204,205,100,0.7)')};
|
|
20501
|
-
* `
|
|
20502
|
-
*
|
|
20503
|
-
* // CSS in JS Output
|
|
20504
|
-
*
|
|
20505
|
-
* element {
|
|
20506
|
-
* background: "#e5e6b1";
|
|
20507
|
-
* background: "rgba(229,230,177,0.7)";
|
|
20508
|
-
* }
|
|
20509
|
-
*/
|
|
20510
|
-
function lighten(amount, color) {
|
|
20511
|
-
if (color === 'transparent') return color;
|
|
20512
|
-
var hslColor = parseToHsl(color);
|
|
20513
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
20514
|
-
lightness: guard(0, 1, hslColor.lightness + parseFloat(amount))
|
|
20515
|
-
}));
|
|
20516
|
-
}
|
|
20517
|
-
|
|
20518
|
-
// prettier-ignore
|
|
20519
|
-
var curriedLighten = curry /* ::<number | string, string, string> */(lighten);
|
|
20520
|
-
|
|
20521
20222
|
/**
|
|
20522
20223
|
* 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.
|
|
20523
20224
|
*
|
|
@@ -20544,21 +20245,25 @@ var curriedLighten = curry /* ::<number | string, string, string> */(lighten);
|
|
|
20544
20245
|
* background: "rgba(63, 0, 191, 0.75)";
|
|
20545
20246
|
* }
|
|
20546
20247
|
*/
|
|
20248
|
+
|
|
20547
20249
|
function mix$1(weight, color, otherColor) {
|
|
20548
20250
|
if (color === 'transparent') return otherColor;
|
|
20549
20251
|
if (otherColor === 'transparent') return color;
|
|
20550
20252
|
if (weight === 0) return otherColor;
|
|
20551
20253
|
var parsedColor1 = parseToRgb(color);
|
|
20254
|
+
|
|
20552
20255
|
var color1 = _extends$1({}, parsedColor1, {
|
|
20553
20256
|
alpha: typeof parsedColor1.alpha === 'number' ? parsedColor1.alpha : 1
|
|
20554
20257
|
});
|
|
20258
|
+
|
|
20555
20259
|
var parsedColor2 = parseToRgb(otherColor);
|
|
20260
|
+
|
|
20556
20261
|
var color2 = _extends$1({}, parsedColor2, {
|
|
20557
20262
|
alpha: typeof parsedColor2.alpha === 'number' ? parsedColor2.alpha : 1
|
|
20558
|
-
});
|
|
20559
|
-
|
|
20560
|
-
// The formula is copied from the original Sass implementation:
|
|
20263
|
+
}); // The formula is copied from the original Sass implementation:
|
|
20561
20264
|
// http://sass-lang.com/documentation/Sass/Script/Functions.html#mix-instance_method
|
|
20265
|
+
|
|
20266
|
+
|
|
20562
20267
|
var alphaDelta = color1.alpha - color2.alpha;
|
|
20563
20268
|
var x = parseFloat(weight) * 2 - 1;
|
|
20564
20269
|
var y = x * alphaDelta === -1 ? x : x + alphaDelta;
|
|
@@ -20572,217 +20277,13 @@ function mix$1(weight, color, otherColor) {
|
|
|
20572
20277
|
alpha: color1.alpha * parseFloat(weight) + color2.alpha * (1 - parseFloat(weight))
|
|
20573
20278
|
};
|
|
20574
20279
|
return rgba$1(mixedColor);
|
|
20575
|
-
}
|
|
20576
|
-
|
|
20577
|
-
// prettier-ignore
|
|
20578
|
-
var curriedMix = curry /* ::<number | string, string, string, string> */(mix$1);
|
|
20579
|
-
var mix$1$1 = curriedMix;
|
|
20580
|
-
|
|
20581
|
-
/**
|
|
20582
|
-
* Increases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20583
|
-
*
|
|
20584
|
-
*
|
|
20585
|
-
* @example
|
|
20586
|
-
* // Styles as object usage
|
|
20587
|
-
* const styles = {
|
|
20588
|
-
* background: opacify(0.1, 'rgba(255, 255, 255, 0.9)');
|
|
20589
|
-
* background: opacify(0.2, 'hsla(0, 0%, 100%, 0.5)'),
|
|
20590
|
-
* background: opacify('0.5', 'rgba(255, 0, 0, 0.2)'),
|
|
20591
|
-
* }
|
|
20592
|
-
*
|
|
20593
|
-
* // styled-components usage
|
|
20594
|
-
* const div = styled.div`
|
|
20595
|
-
* background: ${opacify(0.1, 'rgba(255, 255, 255, 0.9)')};
|
|
20596
|
-
* background: ${opacify(0.2, 'hsla(0, 0%, 100%, 0.5)')},
|
|
20597
|
-
* background: ${opacify('0.5', 'rgba(255, 0, 0, 0.2)')},
|
|
20598
|
-
* `
|
|
20599
|
-
*
|
|
20600
|
-
* // CSS in JS Output
|
|
20601
|
-
*
|
|
20602
|
-
* element {
|
|
20603
|
-
* background: "#fff";
|
|
20604
|
-
* background: "rgba(255,255,255,0.7)";
|
|
20605
|
-
* background: "rgba(255,0,0,0.7)";
|
|
20606
|
-
* }
|
|
20607
|
-
*/
|
|
20608
|
-
function opacify(amount, color) {
|
|
20609
|
-
if (color === 'transparent') return color;
|
|
20610
|
-
var parsedColor = parseToRgb(color);
|
|
20611
|
-
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20612
|
-
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20613
|
-
alpha: guard(0, 1, (alpha * 100 + parseFloat(amount) * 100) / 100)
|
|
20614
|
-
});
|
|
20615
|
-
return rgba$1(colorWithAlpha);
|
|
20616
|
-
}
|
|
20280
|
+
} // prettier-ignore
|
|
20617
20281
|
|
|
20618
|
-
// prettier-ignore
|
|
20619
|
-
var curriedOpacify = curry /* ::<number | string, string, string> */(opacify);
|
|
20620
20282
|
|
|
20621
|
-
|
|
20622
|
-
|
|
20623
|
-
|
|
20624
|
-
|
|
20625
|
-
*
|
|
20626
|
-
* @example
|
|
20627
|
-
* // Styles as object usage
|
|
20628
|
-
* const styles = {
|
|
20629
|
-
* background: saturate(0.2, '#CCCD64'),
|
|
20630
|
-
* background: saturate('0.2', 'rgba(204,205,100,0.7)'),
|
|
20631
|
-
* }
|
|
20632
|
-
*
|
|
20633
|
-
* // styled-components usage
|
|
20634
|
-
* const div = styled.div`
|
|
20635
|
-
* background: ${saturate(0.2, '#FFCD64')};
|
|
20636
|
-
* background: ${saturate('0.2', 'rgba(204,205,100,0.7)')};
|
|
20637
|
-
* `
|
|
20638
|
-
*
|
|
20639
|
-
* // CSS in JS Output
|
|
20640
|
-
*
|
|
20641
|
-
* element {
|
|
20642
|
-
* background: "#e0e250";
|
|
20643
|
-
* background: "rgba(224,226,80,0.7)";
|
|
20644
|
-
* }
|
|
20645
|
-
*/
|
|
20646
|
-
function saturate(amount, color) {
|
|
20647
|
-
if (color === 'transparent') return color;
|
|
20648
|
-
var hslColor = parseToHsl(color);
|
|
20649
|
-
return toColorString(_extends$1({}, hslColor, {
|
|
20650
|
-
saturation: guard(0, 1, hslColor.saturation + parseFloat(amount))
|
|
20651
|
-
}));
|
|
20652
|
-
}
|
|
20653
|
-
|
|
20654
|
-
// prettier-ignore
|
|
20655
|
-
var curriedSaturate = curry /* ::<number | string, string, string> */(saturate);
|
|
20656
|
-
|
|
20657
|
-
/**
|
|
20658
|
-
* Sets the hue of a color to the provided value. The hue range can be
|
|
20659
|
-
* from 0 and 359.
|
|
20660
|
-
*
|
|
20661
|
-
* @example
|
|
20662
|
-
* // Styles as object usage
|
|
20663
|
-
* const styles = {
|
|
20664
|
-
* background: setHue(42, '#CCCD64'),
|
|
20665
|
-
* background: setHue('244', 'rgba(204,205,100,0.7)'),
|
|
20666
|
-
* }
|
|
20667
|
-
*
|
|
20668
|
-
* // styled-components usage
|
|
20669
|
-
* const div = styled.div`
|
|
20670
|
-
* background: ${setHue(42, '#CCCD64')};
|
|
20671
|
-
* background: ${setHue('244', 'rgba(204,205,100,0.7)')};
|
|
20672
|
-
* `
|
|
20673
|
-
*
|
|
20674
|
-
* // CSS in JS Output
|
|
20675
|
-
* element {
|
|
20676
|
-
* background: "#cdae64";
|
|
20677
|
-
* background: "rgba(107,100,205,0.7)";
|
|
20678
|
-
* }
|
|
20679
|
-
*/
|
|
20680
|
-
function setHue(hue, color) {
|
|
20681
|
-
if (color === 'transparent') return color;
|
|
20682
|
-
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20683
|
-
hue: parseFloat(hue)
|
|
20684
|
-
}));
|
|
20685
|
-
}
|
|
20686
|
-
|
|
20687
|
-
// prettier-ignore
|
|
20688
|
-
var curriedSetHue = curry /* ::<number | string, string, string> */(setHue);
|
|
20689
|
-
|
|
20690
|
-
/**
|
|
20691
|
-
* Sets the lightness of a color to the provided value. The lightness range can be
|
|
20692
|
-
* from 0 and 1.
|
|
20693
|
-
*
|
|
20694
|
-
* @example
|
|
20695
|
-
* // Styles as object usage
|
|
20696
|
-
* const styles = {
|
|
20697
|
-
* background: setLightness(0.2, '#CCCD64'),
|
|
20698
|
-
* background: setLightness('0.75', 'rgba(204,205,100,0.7)'),
|
|
20699
|
-
* }
|
|
20700
|
-
*
|
|
20701
|
-
* // styled-components usage
|
|
20702
|
-
* const div = styled.div`
|
|
20703
|
-
* background: ${setLightness(0.2, '#CCCD64')};
|
|
20704
|
-
* background: ${setLightness('0.75', 'rgba(204,205,100,0.7)')};
|
|
20705
|
-
* `
|
|
20706
|
-
*
|
|
20707
|
-
* // CSS in JS Output
|
|
20708
|
-
* element {
|
|
20709
|
-
* background: "#4d4d19";
|
|
20710
|
-
* background: "rgba(223,224,159,0.7)";
|
|
20711
|
-
* }
|
|
20712
|
-
*/
|
|
20713
|
-
function setLightness(lightness, color) {
|
|
20714
|
-
if (color === 'transparent') return color;
|
|
20715
|
-
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20716
|
-
lightness: parseFloat(lightness)
|
|
20717
|
-
}));
|
|
20718
|
-
}
|
|
20719
|
-
|
|
20720
|
-
// prettier-ignore
|
|
20721
|
-
var curriedSetLightness = curry /* ::<number | string, string, string> */(setLightness);
|
|
20722
|
-
|
|
20723
|
-
/**
|
|
20724
|
-
* Sets the saturation of a color to the provided value. The saturation range can be
|
|
20725
|
-
* from 0 and 1.
|
|
20726
|
-
*
|
|
20727
|
-
* @example
|
|
20728
|
-
* // Styles as object usage
|
|
20729
|
-
* const styles = {
|
|
20730
|
-
* background: setSaturation(0.2, '#CCCD64'),
|
|
20731
|
-
* background: setSaturation('0.75', 'rgba(204,205,100,0.7)'),
|
|
20732
|
-
* }
|
|
20733
|
-
*
|
|
20734
|
-
* // styled-components usage
|
|
20735
|
-
* const div = styled.div`
|
|
20736
|
-
* background: ${setSaturation(0.2, '#CCCD64')};
|
|
20737
|
-
* background: ${setSaturation('0.75', 'rgba(204,205,100,0.7)')};
|
|
20738
|
-
* `
|
|
20739
|
-
*
|
|
20740
|
-
* // CSS in JS Output
|
|
20741
|
-
* element {
|
|
20742
|
-
* background: "#adad84";
|
|
20743
|
-
* background: "rgba(228,229,76,0.7)";
|
|
20744
|
-
* }
|
|
20745
|
-
*/
|
|
20746
|
-
function setSaturation(saturation, color) {
|
|
20747
|
-
if (color === 'transparent') return color;
|
|
20748
|
-
return toColorString(_extends$1({}, parseToHsl(color), {
|
|
20749
|
-
saturation: parseFloat(saturation)
|
|
20750
|
-
}));
|
|
20751
|
-
}
|
|
20752
|
-
|
|
20753
|
-
// prettier-ignore
|
|
20754
|
-
var curriedSetSaturation = curry /* ::<number | string, string, string> */(setSaturation);
|
|
20755
|
-
|
|
20756
|
-
/**
|
|
20757
|
-
* Shades a color by mixing it with black. `shade` can produce
|
|
20758
|
-
* hue shifts, where as `darken` manipulates the luminance channel and therefore
|
|
20759
|
-
* doesn't produce hue shifts.
|
|
20760
|
-
*
|
|
20761
|
-
* @example
|
|
20762
|
-
* // Styles as object usage
|
|
20763
|
-
* const styles = {
|
|
20764
|
-
* background: shade(0.25, '#00f')
|
|
20765
|
-
* }
|
|
20766
|
-
*
|
|
20767
|
-
* // styled-components usage
|
|
20768
|
-
* const div = styled.div`
|
|
20769
|
-
* background: ${shade(0.25, '#00f')};
|
|
20770
|
-
* `
|
|
20771
|
-
*
|
|
20772
|
-
* // CSS in JS Output
|
|
20773
|
-
*
|
|
20774
|
-
* element {
|
|
20775
|
-
* background: "#00003f";
|
|
20776
|
-
* }
|
|
20777
|
-
*/
|
|
20778
|
-
|
|
20779
|
-
function shade(percentage, color) {
|
|
20780
|
-
if (color === 'transparent') return color;
|
|
20781
|
-
return mix$1$1(parseFloat(percentage), 'rgb(0, 0, 0)', color);
|
|
20782
|
-
}
|
|
20783
|
-
|
|
20784
|
-
// prettier-ignore
|
|
20785
|
-
var curriedShade = curry /* ::<number | string, string, string> */(shade);
|
|
20283
|
+
var curriedMix = /*#__PURE__*/curry
|
|
20284
|
+
/* ::<number | string, string, string, string> */
|
|
20285
|
+
(mix$1);
|
|
20286
|
+
var mix$1$1 = curriedMix;
|
|
20786
20287
|
|
|
20787
20288
|
/**
|
|
20788
20289
|
* Tints a color by mixing it with white. `tint` can produce
|
|
@@ -20810,51 +20311,13 @@ var curriedShade = curry /* ::<number | string, string, string> */(shade);
|
|
|
20810
20311
|
function tint(percentage, color) {
|
|
20811
20312
|
if (color === 'transparent') return color;
|
|
20812
20313
|
return mix$1$1(parseFloat(percentage), 'rgb(255, 255, 255)', color);
|
|
20813
|
-
}
|
|
20814
|
-
|
|
20815
|
-
// prettier-ignore
|
|
20816
|
-
var curriedTint = curry /* ::<number | string, string, string> */(tint);
|
|
20817
|
-
var curriedTint$1 = curriedTint;
|
|
20314
|
+
} // prettier-ignore
|
|
20818
20315
|
|
|
20819
|
-
/**
|
|
20820
|
-
* Decreases the opacity of a color. Its range for the amount is between 0 to 1.
|
|
20821
|
-
*
|
|
20822
|
-
*
|
|
20823
|
-
* @example
|
|
20824
|
-
* // Styles as object usage
|
|
20825
|
-
* const styles = {
|
|
20826
|
-
* background: transparentize(0.1, '#fff'),
|
|
20827
|
-
* background: transparentize(0.2, 'hsl(0, 0%, 100%)'),
|
|
20828
|
-
* background: transparentize('0.5', 'rgba(255, 0, 0, 0.8)'),
|
|
20829
|
-
* }
|
|
20830
|
-
*
|
|
20831
|
-
* // styled-components usage
|
|
20832
|
-
* const div = styled.div`
|
|
20833
|
-
* background: ${transparentize(0.1, '#fff')};
|
|
20834
|
-
* background: ${transparentize(0.2, 'hsl(0, 0%, 100%)')};
|
|
20835
|
-
* background: ${transparentize('0.5', 'rgba(255, 0, 0, 0.8)')};
|
|
20836
|
-
* `
|
|
20837
|
-
*
|
|
20838
|
-
* // CSS in JS Output
|
|
20839
|
-
*
|
|
20840
|
-
* element {
|
|
20841
|
-
* background: "rgba(255,255,255,0.9)";
|
|
20842
|
-
* background: "rgba(255,255,255,0.8)";
|
|
20843
|
-
* background: "rgba(255,0,0,0.3)";
|
|
20844
|
-
* }
|
|
20845
|
-
*/
|
|
20846
|
-
function transparentize(amount, color) {
|
|
20847
|
-
if (color === 'transparent') return color;
|
|
20848
|
-
var parsedColor = parseToRgb(color);
|
|
20849
|
-
var alpha = typeof parsedColor.alpha === 'number' ? parsedColor.alpha : 1;
|
|
20850
|
-
var colorWithAlpha = _extends$1({}, parsedColor, {
|
|
20851
|
-
alpha: guard(0, 1, +(alpha * 100 - parseFloat(amount) * 100).toFixed(2) / 100)
|
|
20852
|
-
});
|
|
20853
|
-
return rgba$1(colorWithAlpha);
|
|
20854
|
-
}
|
|
20855
20316
|
|
|
20856
|
-
|
|
20857
|
-
|
|
20317
|
+
var curriedTint = /*#__PURE__*/curry
|
|
20318
|
+
/* ::<number | string, string, string> */
|
|
20319
|
+
(tint);
|
|
20320
|
+
var curriedTint$1 = curriedTint;
|
|
20858
20321
|
|
|
20859
20322
|
var linkColor = MATISSE_BLUE;
|
|
20860
20323
|
var fallbackValues$8 = {
|
|
@@ -23545,19 +23008,32 @@ var toIndexedObject = function (it) {
|
|
|
23545
23008
|
return indexedObject(requireObjectCoercible(it));
|
|
23546
23009
|
};
|
|
23547
23010
|
|
|
23548
|
-
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
23549
23011
|
var documentAll = typeof document == 'object' && document.all;
|
|
23550
23012
|
|
|
23013
|
+
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
|
|
23014
|
+
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
|
|
23015
|
+
var IS_HTMLDDA = typeof documentAll == 'undefined' && documentAll !== undefined;
|
|
23016
|
+
|
|
23017
|
+
var documentAll_1 = {
|
|
23018
|
+
all: documentAll,
|
|
23019
|
+
IS_HTMLDDA: IS_HTMLDDA
|
|
23020
|
+
};
|
|
23021
|
+
|
|
23022
|
+
var documentAll$1 = documentAll_1.all;
|
|
23023
|
+
|
|
23551
23024
|
// `IsCallable` abstract operation
|
|
23552
23025
|
// https://tc39.es/ecma262/#sec-iscallable
|
|
23553
|
-
|
|
23554
|
-
|
|
23555
|
-
return typeof argument == 'function' || argument === documentAll;
|
|
23026
|
+
var isCallable = documentAll_1.IS_HTMLDDA ? function (argument) {
|
|
23027
|
+
return typeof argument == 'function' || argument === documentAll$1;
|
|
23556
23028
|
} : function (argument) {
|
|
23557
23029
|
return typeof argument == 'function';
|
|
23558
23030
|
};
|
|
23559
23031
|
|
|
23560
|
-
var
|
|
23032
|
+
var documentAll$2 = documentAll_1.all;
|
|
23033
|
+
|
|
23034
|
+
var isObject = documentAll_1.IS_HTMLDDA ? function (it) {
|
|
23035
|
+
return typeof it == 'object' ? it !== null : isCallable(it) || it === documentAll$2;
|
|
23036
|
+
} : function (it) {
|
|
23561
23037
|
return typeof it == 'object' ? it !== null : isCallable(it);
|
|
23562
23038
|
};
|
|
23563
23039
|
|
|
@@ -23693,10 +23169,10 @@ var shared = createCommonjsModule(function (module) {
|
|
|
23693
23169
|
(module.exports = function (key, value) {
|
|
23694
23170
|
return sharedStore[key] || (sharedStore[key] = value !== undefined ? value : {});
|
|
23695
23171
|
})('versions', []).push({
|
|
23696
|
-
version: '3.
|
|
23172
|
+
version: '3.33.3',
|
|
23697
23173
|
mode: 'global',
|
|
23698
|
-
copyright: '© 2014-
|
|
23699
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.
|
|
23174
|
+
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
23175
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.33.3/LICENSE',
|
|
23700
23176
|
source: 'https://github.com/zloirock/core-js'
|
|
23701
23177
|
});
|
|
23702
23178
|
});
|
|
@@ -23993,7 +23469,7 @@ var TEMPLATE = String(String).split('String');
|
|
|
23993
23469
|
|
|
23994
23470
|
var makeBuiltIn = module.exports = function (value, name, options) {
|
|
23995
23471
|
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
|
23996
|
-
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)
|
|
23472
|
+
name = '[' + replace($String(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
|
|
23997
23473
|
}
|
|
23998
23474
|
if (options && options.getter) name = 'get ' + name;
|
|
23999
23475
|
if (options && options.setter) name = 'set ' + name;
|
|
@@ -24081,8 +23557,7 @@ var min$1 = Math.min;
|
|
|
24081
23557
|
// `ToLength` abstract operation
|
|
24082
23558
|
// https://tc39.es/ecma262/#sec-tolength
|
|
24083
23559
|
var toLength = function (argument) {
|
|
24084
|
-
|
|
24085
|
-
return len > 0 ? min$1(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
23560
|
+
return argument > 0 ? min$1(toIntegerOrInfinity(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
|
|
24086
23561
|
};
|
|
24087
23562
|
|
|
24088
23563
|
// `LengthOfArrayLike` abstract operation
|
|
@@ -24242,7 +23717,7 @@ var _export = function (options, source) {
|
|
|
24242
23717
|
} else if (STATIC) {
|
|
24243
23718
|
target = global_1[TARGET] || defineGlobalProperty(TARGET, {});
|
|
24244
23719
|
} else {
|
|
24245
|
-
target = global_1[TARGET]
|
|
23720
|
+
target = (global_1[TARGET] || {}).prototype;
|
|
24246
23721
|
}
|
|
24247
23722
|
if (target) for (key in source) {
|
|
24248
23723
|
sourceProperty = source[key];
|
|
@@ -24505,15 +23980,11 @@ var functionUncurryThisAccessor = function (object, key, method) {
|
|
|
24505
23980
|
} catch (error) { /* empty */ }
|
|
24506
23981
|
};
|
|
24507
23982
|
|
|
24508
|
-
var isPossiblePrototype = function (argument) {
|
|
24509
|
-
return isObject(argument) || argument === null;
|
|
24510
|
-
};
|
|
24511
|
-
|
|
24512
23983
|
var $String$4 = String;
|
|
24513
23984
|
var $TypeError$6 = TypeError;
|
|
24514
23985
|
|
|
24515
23986
|
var aPossiblePrototype = function (argument) {
|
|
24516
|
-
if (
|
|
23987
|
+
if (typeof argument == 'object' || isCallable(argument)) return argument;
|
|
24517
23988
|
throw new $TypeError$6("Can't set " + $String$4(argument) + ' as a prototype');
|
|
24518
23989
|
};
|
|
24519
23990
|
|
|
@@ -28106,7 +27577,7 @@ var renderContent = function renderContent(_ref2) {
|
|
|
28106
27577
|
textDecoration: "none"
|
|
28107
27578
|
}
|
|
28108
27579
|
}, /*#__PURE__*/React__default.createElement(Box, {
|
|
28109
|
-
padding: "0
|
|
27580
|
+
padding: "0",
|
|
28110
27581
|
minHeight: "100%",
|
|
28111
27582
|
extraStyles: "cursor: pointer;"
|
|
28112
27583
|
}, children)) : /*#__PURE__*/React__default.createElement(Box, {
|
|
@@ -28166,9 +27637,10 @@ var Placeholder = function Placeholder(_ref4) {
|
|
|
28166
27637
|
border: "none",
|
|
28167
27638
|
minHeight: themeValues.height,
|
|
28168
27639
|
hiddenStyles: !visible,
|
|
28169
|
-
extraStyles: "\n display: flex;\n justify-content: center;\n align-items:center;\n
|
|
27640
|
+
extraStyles: "\n display: flex;\n justify-content: center;\n align-items:center;\n background-image: repeating-linear-gradient(0deg, ".concat(borderColor, ", ").concat(borderColor, " 2px, transparent 2px, transparent 4px, ").concat(borderColor, " 4px), repeating-linear-gradient(90deg, ").concat(borderColor, ", ").concat(borderColor, " 2px, transparent 2px, transparent 4px, ").concat(borderColor, " 4px), repeating-linear-gradient(180deg, ").concat(borderColor, ", ").concat(borderColor, " 2px, transparent 2px, transparent 4px, ").concat(borderColor, " 4px), repeating-linear-gradient(270deg, ").concat(borderColor, ", ").concat(borderColor, " 2px, transparent 2px, transparent 4px, ").concat(borderColor, " 4px);\n background-size: 2px 100%, 100% 2px, 2px 100% , 100% 2px;\n background-position: 0 0, 0 0, 100% 0, 0 100%;\n background-repeat: no-repeat;\n "),
|
|
28170
27641
|
hoverStyles: "background-color: ".concat(isDisabled ? TRANSPARENT : curriedTint$1(0.9, themeValues.color), ";"),
|
|
28171
|
-
|
|
27642
|
+
focusStyles: "background-color: ".concat(isDisabled ? TRANSPARENT : curriedTint$1(0.9, themeValues.color), ";"),
|
|
27643
|
+
activeStyles: "background-color: ".concat(isDisabled ? TRANSPARENT : curriedTint$1(0.8, themeValues.color), "; ").concat(!isDisabled && "background-image:none; border: 2px solid ".concat(borderColor, ";}"))
|
|
28172
27644
|
}, /*#__PURE__*/React__default.createElement(Center, {
|
|
28173
27645
|
maxWidth: "300px"
|
|
28174
27646
|
}, /*#__PURE__*/React__default.createElement(Box, {
|