@thecb/components 9.1.7-beta.6 → 9.1.7-beta.8
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 +20 -63
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +20 -63
- 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/atoms/dropdown/Dropdown.theme.js +8 -2
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +1 -1
- package/src/constants/colors.js +2 -0
- package/src/util/{colorUtils.js → generateShadows.js} +10 -71
package/dist/index.cjs.js
CHANGED
|
@@ -5019,6 +5019,7 @@ var INFO_BLUE = "#E4F4FD";
|
|
|
5019
5019
|
var CORNFLOWER_BLUE = "#EBEFFB";
|
|
5020
5020
|
var HOVER_LIGHT_BLUE = "#EFFAFF";
|
|
5021
5021
|
var MATISSE_BLUE = "#15749D";
|
|
5022
|
+
var MATISSE_BLUE_DARK = "#105C7D";
|
|
5022
5023
|
var ROYAL_BLUE = "#3181E3";
|
|
5023
5024
|
var ROYAL_BLUE_VIVID = "#3B5BDB";
|
|
5024
5025
|
var ASTRAL_BLUE = "#3176AA";
|
|
@@ -5153,6 +5154,7 @@ var colors = /*#__PURE__*/Object.freeze({
|
|
|
5153
5154
|
BOSTON_BLUE: BOSTON_BLUE,
|
|
5154
5155
|
HOVER_LIGHT_BLUE: HOVER_LIGHT_BLUE,
|
|
5155
5156
|
MATISSE_BLUE: MATISSE_BLUE,
|
|
5157
|
+
MATISSE_BLUE_DARK: MATISSE_BLUE_DARK,
|
|
5156
5158
|
ROYAL_BLUE: ROYAL_BLUE,
|
|
5157
5159
|
ROYAL_BLUE_VIVID: ROYAL_BLUE_VIVID,
|
|
5158
5160
|
ASTRAL_BLUE: ASTRAL_BLUE,
|
|
@@ -18686,12 +18688,22 @@ var fallbackValues$4 = {
|
|
|
18686
18688
|
link: link
|
|
18687
18689
|
};
|
|
18688
18690
|
|
|
18691
|
+
/*
|
|
18692
|
+
|
|
18693
|
+
A utility function that can generate box-shadow values for components
|
|
18694
|
+
Takes a string representing an rgb color value and returns an object
|
|
18695
|
+
with values for standard, inset, and overlay shadows.
|
|
18696
|
+
|
|
18697
|
+
The objects for standard and inset shadows contain versions approiate
|
|
18698
|
+
for base, hover, and active interaction states.
|
|
18699
|
+
|
|
18700
|
+
*/
|
|
18701
|
+
|
|
18689
18702
|
/*
|
|
18690
18703
|
Function to convert string representing rgb color to rgba value with provided opacity
|
|
18691
18704
|
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
18692
18705
|
|
|
18693
18706
|
*/
|
|
18694
|
-
|
|
18695
18707
|
var rgbToRgba = function rgbToRgba() {
|
|
18696
18708
|
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
18697
18709
|
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
@@ -18702,17 +18714,6 @@ var rgbToRgba = function rgbToRgba() {
|
|
|
18702
18714
|
|
|
18703
18715
|
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
18704
18716
|
};
|
|
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
18717
|
|
|
18717
18718
|
var generateShadows = function generateShadows() {
|
|
18718
18719
|
var baseColorRGB = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(41, 42, 51)";
|
|
@@ -18740,52 +18741,6 @@ var generateShadows = function generateShadows() {
|
|
|
18740
18741
|
overlay: overlay
|
|
18741
18742
|
};
|
|
18742
18743
|
};
|
|
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
18744
|
|
|
18790
18745
|
var Alert = function Alert(_ref) {
|
|
18791
18746
|
var _generateShadows, _generateShadows$inse;
|
|
@@ -23788,9 +23743,11 @@ exportTypedArrayMethod$1('at', function at(index) {
|
|
|
23788
23743
|
|
|
23789
23744
|
var selectedColor = "".concat(MATISSE_BLUE);
|
|
23790
23745
|
var hoverColor$3 = "".concat(HOVER_LIGHT_BLUE);
|
|
23746
|
+
var focusColor = "".concat(MATISSE_BLUE_DARK);
|
|
23791
23747
|
var fallbackValues$f = {
|
|
23792
23748
|
selectedColor: selectedColor,
|
|
23793
|
-
hoverColor: hoverColor$3
|
|
23749
|
+
hoverColor: hoverColor$3,
|
|
23750
|
+
focusColor: focusColor
|
|
23794
23751
|
};
|
|
23795
23752
|
|
|
23796
23753
|
var IconWrapper = styled__default.div.withConfig({
|
|
@@ -23824,17 +23781,17 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23824
23781
|
var disabled = _ref6.disabled,
|
|
23825
23782
|
selected = _ref6.selected,
|
|
23826
23783
|
themeValues = _ref6.themeValues;
|
|
23827
|
-
return selected ?
|
|
23784
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23828
23785
|
}, function (_ref7) {
|
|
23829
23786
|
var selected = _ref7.selected,
|
|
23830
23787
|
disabled = _ref7.disabled,
|
|
23831
23788
|
themeValues = _ref7.themeValues;
|
|
23832
|
-
return selected ?
|
|
23789
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23833
23790
|
}, function (_ref8) {
|
|
23834
23791
|
var selected = _ref8.selected,
|
|
23835
23792
|
disabled = _ref8.disabled,
|
|
23836
23793
|
themeValues = _ref8.themeValues;
|
|
23837
|
-
return selected ?
|
|
23794
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23838
23795
|
}, function (_ref9) {
|
|
23839
23796
|
var themeValues = _ref9.themeValues;
|
|
23840
23797
|
return themeValues.selectedColor;
|
|
@@ -23842,7 +23799,7 @@ var DropdownItemWrapper = styled__default.li.withConfig({
|
|
|
23842
23799
|
var selected = _ref10.selected,
|
|
23843
23800
|
disabled = _ref10.disabled,
|
|
23844
23801
|
themeValues = _ref10.themeValues;
|
|
23845
|
-
return selected ?
|
|
23802
|
+
return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
|
|
23846
23803
|
});
|
|
23847
23804
|
var DropdownItemBorder = styled__default.div.withConfig({
|
|
23848
23805
|
displayName: "Dropdown__DropdownItemBorder",
|