@thecb/components 9.1.7-beta.5 → 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 -54
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +15 -54
- 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 -62
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,44 +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
|
-
Function to calculate a new hex color given an original
|
|
18757
|
-
hex color, a hex background color, and an opacity number
|
|
18758
|
-
between 0 and 1 to apply to the background.
|
|
18759
|
-
|
|
18760
|
-
For example, to add a 20% black opacity (20% darker) to a green color
|
|
18761
|
-
("#00ff00"):
|
|
18762
|
-
addOpacityToHex("00ff00", "#000000", .2) => "rgb(0, 204, 0)"
|
|
18763
|
-
*/
|
|
18764
|
-
|
|
18765
|
-
|
|
18766
|
-
var addOpacityToHex = function addOpacityToHex(hexColor, background, opacity) {
|
|
18767
|
-
if (hexColor == TRANSPARENT) {
|
|
18768
|
-
return hexColor;
|
|
18769
|
-
}
|
|
18770
|
-
|
|
18771
|
-
var color = hexToRbg(hexColor);
|
|
18772
|
-
var backgroundRbg = hexToRbg(background);
|
|
18773
|
-
var newColor = color.map(function (colorElem, index) {
|
|
18774
|
-
return Math.floor(opacity * backgroundRbg[index] + (1 - opacity) * colorElem);
|
|
18775
|
-
});
|
|
18776
|
-
return "rgb(".concat(newColor[0], ", ").concat(newColor[1], ", ").concat(newColor[2], ")");
|
|
18777
|
-
};
|
|
18778
|
-
var darken = function darken(hexColor, opacity) {
|
|
18779
|
-
return addOpacityToHex(hexColor, "#000000", opacity);
|
|
18780
|
-
};
|
|
18781
18742
|
|
|
18782
18743
|
var Alert = function Alert(_ref) {
|
|
18783
18744
|
var _generateShadows, _generateShadows$inse;
|
|
@@ -23816,17 +23777,17 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23816
23777
|
var disabled = _ref6.disabled,
|
|
23817
23778
|
selected = _ref6.selected,
|
|
23818
23779
|
themeValues = _ref6.themeValues;
|
|
23819
|
-
return selected ?
|
|
23780
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23820
23781
|
}, function (_ref7) {
|
|
23821
23782
|
var selected = _ref7.selected,
|
|
23822
23783
|
disabled = _ref7.disabled,
|
|
23823
23784
|
themeValues = _ref7.themeValues;
|
|
23824
|
-
return selected ?
|
|
23785
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23825
23786
|
}, function (_ref8) {
|
|
23826
23787
|
var selected = _ref8.selected,
|
|
23827
23788
|
disabled = _ref8.disabled,
|
|
23828
23789
|
themeValues = _ref8.themeValues;
|
|
23829
|
-
return selected ?
|
|
23790
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23830
23791
|
}, function (_ref9) {
|
|
23831
23792
|
var themeValues = _ref9.themeValues;
|
|
23832
23793
|
return themeValues.selectedColor;
|
|
@@ -23834,7 +23795,7 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23834
23795
|
var selected = _ref10.selected,
|
|
23835
23796
|
disabled = _ref10.disabled,
|
|
23836
23797
|
themeValues = _ref10.themeValues;
|
|
23837
|
-
return selected ?
|
|
23798
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23838
23799
|
});
|
|
23839
23800
|
var DropdownItemBorder = styled__default.div.withConfig({
|
|
23840
23801
|
displayName: "Dropdown__DropdownItemBorder",
|