@thecb/components 9.1.7-beta.6 → 9.1.7-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 +15 -62
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +15 -62
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +1 -1
- package/src/components/atoms/dropdown/Dropdown.js +4 -5
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +1 -1
- package/src/util/{colorUtils.js → generateShadows.js} +10 -71
package/dist/index.cjs.js
CHANGED
|
@@ -18686,12 +18686,22 @@ var fallbackValues$4 = {
|
|
|
18686
18686
|
link: link
|
|
18687
18687
|
};
|
|
18688
18688
|
|
|
18689
|
+
/*
|
|
18690
|
+
|
|
18691
|
+
A utility function that can generate box-shadow values for components
|
|
18692
|
+
Takes a string representing an rgb color value and returns an object
|
|
18693
|
+
with values for standard, inset, and overlay shadows.
|
|
18694
|
+
|
|
18695
|
+
The objects for standard and inset shadows contain versions approiate
|
|
18696
|
+
for base, hover, and active interaction states.
|
|
18697
|
+
|
|
18698
|
+
*/
|
|
18699
|
+
|
|
18689
18700
|
/*
|
|
18690
18701
|
Function to convert string representing rgb color to rgba value with provided opacity
|
|
18691
18702
|
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
18692
18703
|
|
|
18693
18704
|
*/
|
|
18694
|
-
|
|
18695
18705
|
var rgbToRgba = function rgbToRgba() {
|
|
18696
18706
|
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
18697
18707
|
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
@@ -18702,17 +18712,6 @@ var rgbToRgba = function rgbToRgba() {
|
|
|
18702
18712
|
|
|
18703
18713
|
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
18704
18714
|
};
|
|
18705
|
-
/*
|
|
18706
|
-
|
|
18707
|
-
A utility function that can generate box-shadow values for components
|
|
18708
|
-
Takes a string representing an rgb color value and returns an object
|
|
18709
|
-
with values for standard, inset, and overlay shadows.
|
|
18710
|
-
|
|
18711
|
-
The objects for standard and inset shadows contain versions approiate
|
|
18712
|
-
for base, hover, and active interaction states.
|
|
18713
|
-
|
|
18714
|
-
*/
|
|
18715
|
-
|
|
18716
18715
|
|
|
18717
18716
|
var generateShadows = function generateShadows() {
|
|
18718
18717
|
var baseColorRGB = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(41, 42, 51)";
|
|
@@ -18740,52 +18739,6 @@ var generateShadows = function generateShadows() {
|
|
|
18740
18739
|
overlay: overlay
|
|
18741
18740
|
};
|
|
18742
18741
|
};
|
|
18743
|
-
/*
|
|
18744
|
-
Function to convert a string representing hex color to rgb color
|
|
18745
|
-
hexToRbg("#00ff00") => [0, 255, 0]
|
|
18746
|
-
*/
|
|
18747
|
-
|
|
18748
|
-
var hexToRbg = function hexToRbg(hexColor) {
|
|
18749
|
-
var hexArr = hexColor.replace("#", "");
|
|
18750
|
-
var red = parseInt(hexArr.slice(0, 2), 16);
|
|
18751
|
-
var green = parseInt(hexArr.slice(2, 4), 16);
|
|
18752
|
-
var blue = parseInt(hexArr.slice(4, 6), 16);
|
|
18753
|
-
return [red, green, blue];
|
|
18754
|
-
};
|
|
18755
|
-
|
|
18756
|
-
var rbgToHex = function rbgToHex(rbgColor) {
|
|
18757
|
-
hexCodes = rbgColor.map(function (c) {
|
|
18758
|
-
var hex = c.toString(16).toUpperCase();
|
|
18759
|
-
return hex.length == 1 ? "0" + hex : hex;
|
|
18760
|
-
});
|
|
18761
|
-
return "#" + hexCodes.join("");
|
|
18762
|
-
};
|
|
18763
|
-
/*
|
|
18764
|
-
Function to calculate a new hex color given an original
|
|
18765
|
-
hex color, a hex background color, and an opacity number
|
|
18766
|
-
between 0 and 1 to apply to the background.
|
|
18767
|
-
|
|
18768
|
-
For example, to add a 20% black opacity (20% darker) to a green color
|
|
18769
|
-
("#00ff00"):
|
|
18770
|
-
addOpacityToHex("00ff00", "#000000", .2) => "#00CC00"
|
|
18771
|
-
*/
|
|
18772
|
-
|
|
18773
|
-
|
|
18774
|
-
var addOpacityToHex = function addOpacityToHex(hexColor, background, opacity) {
|
|
18775
|
-
if (hexColor == TRANSPARENT) {
|
|
18776
|
-
return hexColor;
|
|
18777
|
-
}
|
|
18778
|
-
|
|
18779
|
-
var color = hexToRbg(hexColor);
|
|
18780
|
-
var backgroundRbg = hexToRbg(background);
|
|
18781
|
-
var newColor = color.map(function (colorElem, index) {
|
|
18782
|
-
return Math.floor(opacity * backgroundRbg[index] + (1 - opacity) * colorElem);
|
|
18783
|
-
});
|
|
18784
|
-
return rbgToHex(newColor);
|
|
18785
|
-
};
|
|
18786
|
-
var darken = function darken(hexColor, opacity) {
|
|
18787
|
-
return addOpacityToHex(hexColor, "#000000", opacity);
|
|
18788
|
-
};
|
|
18789
18742
|
|
|
18790
18743
|
var Alert = function Alert(_ref) {
|
|
18791
18744
|
var _generateShadows, _generateShadows$inse;
|
|
@@ -23824,17 +23777,17 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23824
23777
|
var disabled = _ref6.disabled,
|
|
23825
23778
|
selected = _ref6.selected,
|
|
23826
23779
|
themeValues = _ref6.themeValues;
|
|
23827
|
-
return selected ?
|
|
23780
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23828
23781
|
}, function (_ref7) {
|
|
23829
23782
|
var selected = _ref7.selected,
|
|
23830
23783
|
disabled = _ref7.disabled,
|
|
23831
23784
|
themeValues = _ref7.themeValues;
|
|
23832
|
-
return selected ?
|
|
23785
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23833
23786
|
}, function (_ref8) {
|
|
23834
23787
|
var selected = _ref8.selected,
|
|
23835
23788
|
disabled = _ref8.disabled,
|
|
23836
23789
|
themeValues = _ref8.themeValues;
|
|
23837
|
-
return selected ?
|
|
23790
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23838
23791
|
}, function (_ref9) {
|
|
23839
23792
|
var themeValues = _ref9.themeValues;
|
|
23840
23793
|
return themeValues.selectedColor;
|
|
@@ -23842,7 +23795,7 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23842
23795
|
var selected = _ref10.selected,
|
|
23843
23796
|
disabled = _ref10.disabled,
|
|
23844
23797
|
themeValues = _ref10.themeValues;
|
|
23845
|
-
return selected ?
|
|
23798
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23846
23799
|
});
|
|
23847
23800
|
var DropdownItemBorder = styled__default.div.withConfig({
|
|
23848
23801
|
displayName: "Dropdown__DropdownItemBorder",
|