@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.esm.js CHANGED
@@ -18678,12 +18678,22 @@ var fallbackValues$4 = {
18678
18678
  link: link
18679
18679
  };
18680
18680
 
18681
+ /*
18682
+
18683
+ A utility function that can generate box-shadow values for components
18684
+ Takes a string representing an rgb color value and returns an object
18685
+ with values for standard, inset, and overlay shadows.
18686
+
18687
+ The objects for standard and inset shadows contain versions approiate
18688
+ for base, hover, and active interaction states.
18689
+
18690
+ */
18691
+
18681
18692
  /*
18682
18693
  Function to convert string representing rgb color to rgba value with provided opacity
18683
18694
  ("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
18684
18695
 
18685
18696
  */
18686
-
18687
18697
  var rgbToRgba = function rgbToRgba() {
18688
18698
  var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
18689
18699
  var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
@@ -18694,17 +18704,6 @@ var rgbToRgba = function rgbToRgba() {
18694
18704
 
18695
18705
  return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
18696
18706
  };
18697
- /*
18698
-
18699
- A utility function that can generate box-shadow values for components
18700
- Takes a string representing an rgb color value and returns an object
18701
- with values for standard, inset, and overlay shadows.
18702
-
18703
- The objects for standard and inset shadows contain versions approiate
18704
- for base, hover, and active interaction states.
18705
-
18706
- */
18707
-
18708
18707
 
18709
18708
  var generateShadows = function generateShadows() {
18710
18709
  var baseColorRGB = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "rgb(41, 42, 51)";
@@ -18732,52 +18731,6 @@ var generateShadows = function generateShadows() {
18732
18731
  overlay: overlay
18733
18732
  };
18734
18733
  };
18735
- /*
18736
- Function to convert a string representing hex color to rgb color
18737
- hexToRbg("#00ff00") => [0, 255, 0]
18738
- */
18739
-
18740
- var hexToRbg = function hexToRbg(hexColor) {
18741
- var hexArr = hexColor.replace("#", "");
18742
- var red = parseInt(hexArr.slice(0, 2), 16);
18743
- var green = parseInt(hexArr.slice(2, 4), 16);
18744
- var blue = parseInt(hexArr.slice(4, 6), 16);
18745
- return [red, green, blue];
18746
- };
18747
-
18748
- var rbgToHex = function rbgToHex(rbgColor) {
18749
- hexCodes = rbgColor.map(function (c) {
18750
- var hex = c.toString(16).toUpperCase();
18751
- return hex.length == 1 ? "0" + hex : hex;
18752
- });
18753
- return "#" + hexCodes.join("");
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) => "#00CC00"
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 rbgToHex(newColor);
18777
- };
18778
- var darken = function darken(hexColor, opacity) {
18779
- return addOpacityToHex(hexColor, "#000000", opacity);
18780
- };
18781
18734
 
18782
18735
  var Alert = function Alert(_ref) {
18783
18736
  var _generateShadows, _generateShadows$inse;
@@ -23816,17 +23769,17 @@ var DropdownItemWrapper = styled.li.withConfig({
23816
23769
  var disabled = _ref6.disabled,
23817
23770
  selected = _ref6.selected,
23818
23771
  themeValues = _ref6.themeValues;
23819
- return selected ? darken(themeValues.selectedColor, 0.2) : disabled ? WHITE : themeValues.hoverColor;
23772
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23820
23773
  }, function (_ref7) {
23821
23774
  var selected = _ref7.selected,
23822
23775
  disabled = _ref7.disabled,
23823
23776
  themeValues = _ref7.themeValues;
23824
- return selected ? darken(themeValues.selectedColor, 0.2) : disabled ? WHITE : themeValues.hoverColor;
23777
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23825
23778
  }, function (_ref8) {
23826
23779
  var selected = _ref8.selected,
23827
23780
  disabled = _ref8.disabled,
23828
23781
  themeValues = _ref8.themeValues;
23829
- return selected ? darken(themeValues.selectedColor, 0.2) : disabled ? WHITE : themeValues.hoverColor;
23782
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23830
23783
  }, function (_ref9) {
23831
23784
  var themeValues = _ref9.themeValues;
23832
23785
  return themeValues.selectedColor;
@@ -23834,7 +23787,7 @@ var DropdownItemWrapper = styled.li.withConfig({
23834
23787
  var selected = _ref10.selected,
23835
23788
  disabled = _ref10.disabled,
23836
23789
  themeValues = _ref10.themeValues;
23837
- return selected ? darken(themeValues.selectedColor, 0.2) : disabled ? WHITE : themeValues.hoverColor;
23790
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23838
23791
  });
23839
23792
  var DropdownItemBorder = styled.div.withConfig({
23840
23793
  displayName: "Dropdown__DropdownItemBorder",