@thecb/components 9.1.7-beta.0 → 9.1.7-beta.2

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 CHANGED
@@ -18739,6 +18739,10 @@ var generateShadows = function generateShadows() {
18739
18739
  overlay: overlay
18740
18740
  };
18741
18741
  };
18742
+ var addOpacity = function addOpacity(color, opacity, r, g, b) {
18743
+ var rgba = "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(opacity, ")");
18744
+ return "linear-gradient(0deg, ".concat(rgba, ", ").concat(rgba, "), linear-gradient(0deg, ").concat(color, ", ").concat(color, ");");
18745
+ };
18742
18746
 
18743
18747
  var Alert = function Alert(_ref) {
18744
18748
  var _generateShadows, _generateShadows$inse;
@@ -23766,58 +23770,81 @@ var DropdownContentWrapper = styled__default.div.withConfig({
23766
23770
  var DropdownItemWrapper = styled__default.li.withConfig({
23767
23771
  displayName: "Dropdown__DropdownItemWrapper",
23768
23772
  componentId: "sc-pn6m0h-2"
23769
- })(["text-align:start;border-width:2px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{border-color:themeValues.selectedColor;}&:focus{outline:none;border-color:themeValues.selectedColor;}"], function (_ref4) {
23770
- var disabled = _ref4.disabled;
23773
+ })(["text-align:start;border-width:2px;border-style:solid;border-color:", ";box-shadow:none;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{background:", ";> *{background:", ";border-color:", ";}}&:focus{outline:none;background:", ";border-color:", ";> *{background:", ";border-color:white;outline:none;}}"], function (_ref4) {
23774
+ var selected = _ref4.selected,
23775
+ themeValues = _ref4.themeValues;
23776
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : TRANSPARENT;
23777
+ }, function (_ref5) {
23778
+ var disabled = _ref5.disabled;
23771
23779
  return disabled ? "default" : "pointer";
23772
- }); // ${({ selected, themeValues }) =>
23773
- // selected ? themeValues.selectedColor : TRANSPARENT};
23774
-
23775
- var DropdownItemBorder = styled__default.div.withConfig({
23776
- displayName: "Dropdown__DropdownItemBorder",
23777
- componentId: "sc-pn6m0h-3"
23778
- })(["background-color:", ";border-width:2px;border-color:white;width:100%;&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref5) {
23779
- var selected = _ref5.selected,
23780
- themeValues = _ref5.themeValues;
23781
- return selected ? themeValues.selectedColor : WHITE;
23782
23780
  }, function (_ref6) {
23783
23781
  var selected = _ref6.selected,
23784
23782
  disabled = _ref6.disabled,
23785
23783
  themeValues = _ref6.themeValues;
23786
- return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
23784
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : disabled ? WHITE : themeValues.hoverColor;
23787
23785
  }, function (_ref7) {
23788
23786
  var selected = _ref7.selected,
23789
23787
  disabled = _ref7.disabled,
23790
23788
  themeValues = _ref7.themeValues;
23791
- return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
23789
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : disabled ? WHITE : themeValues.hoverColor;
23790
+ }, function (_ref8) {
23791
+ var selected = _ref8.selected,
23792
+ themeValues = _ref8.themeValues;
23793
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : themeValues.hoverColor;
23794
+ }, function (_ref9) {
23795
+ var selected = _ref9.selected,
23796
+ themeValues = _ref9.themeValues;
23797
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : "";
23798
+ }, function (_ref10) {
23799
+ var selected = _ref10.selected,
23800
+ themeValues = _ref10.themeValues;
23801
+ return selected ? TRANSPARENT : themeValues.selectedColor;
23802
+ }, function (_ref11) {
23803
+ var selected = _ref11.selected,
23804
+ disabled = _ref11.disabled,
23805
+ themeValues = _ref11.themeValues;
23806
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : disabled ? WHITE : themeValues.hoverColor;
23807
+ });
23808
+ var DropdownItemBorder = styled__default.div.withConfig({
23809
+ displayName: "Dropdown__DropdownItemBorder",
23810
+ componentId: "sc-pn6m0h-3"
23811
+ })(["background:", ";border-color:", ";border-width:2px;border-style:solid;padding:12px;"], function (_ref12) {
23812
+ var selected = _ref12.selected,
23813
+ themeValues = _ref12.themeValues;
23814
+ return selected ? themeValues.selectedColor : WHITE;
23815
+ }, function (_ref13) {
23816
+ var selected = _ref13.selected,
23817
+ themeValues = _ref13.themeValues;
23818
+ return selected ? themeValues.selectedColor : WHITE;
23792
23819
  });
23793
23820
 
23794
- var Dropdown = function Dropdown(_ref8) {
23795
- var placeholder = _ref8.placeholder,
23796
- options = _ref8.options,
23797
- value = _ref8.value,
23798
- isOpen = _ref8.isOpen,
23799
- isError = _ref8.isError,
23800
- onSelect = _ref8.onSelect,
23801
- _ref8$disabledValues = _ref8.disabledValues,
23802
- disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
23803
- _ref8$onClick = _ref8.onClick,
23804
- _onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
23805
- themeValues = _ref8.themeValues,
23806
- maxHeight = _ref8.maxHeight,
23807
- _ref8$widthFitOptions = _ref8.widthFitOptions,
23808
- widthFitOptions = _ref8$widthFitOptions === void 0 ? false : _ref8$widthFitOptions,
23809
- disabled = _ref8.disabled,
23810
- _ref8$hasTitles = _ref8.hasTitles,
23811
- hasTitles = _ref8$hasTitles === void 0 ? false : _ref8$hasTitles,
23812
- _ref8$autoEraseTypeAh = _ref8.autoEraseTypeAhead,
23813
- autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
23814
- ariaLabelledby = _ref8.ariaLabelledby,
23815
- ariaDescribedby = _ref8.ariaDescribedby,
23816
- autocompleteValue = _ref8.autocompleteValue,
23817
- _ref8$smoothScroll = _ref8.smoothScroll,
23818
- smoothScroll = _ref8$smoothScroll === void 0 ? true : _ref8$smoothScroll,
23819
- _ref8$ariaInvalid = _ref8.ariaInvalid,
23820
- ariaInvalid = _ref8$ariaInvalid === void 0 ? false : _ref8$ariaInvalid;
23821
+ var Dropdown = function Dropdown(_ref14) {
23822
+ var placeholder = _ref14.placeholder,
23823
+ options = _ref14.options,
23824
+ value = _ref14.value,
23825
+ isOpen = _ref14.isOpen,
23826
+ isError = _ref14.isError,
23827
+ onSelect = _ref14.onSelect,
23828
+ _ref14$disabledValues = _ref14.disabledValues,
23829
+ disabledValues = _ref14$disabledValues === void 0 ? [] : _ref14$disabledValues,
23830
+ _ref14$onClick = _ref14.onClick,
23831
+ _onClick = _ref14$onClick === void 0 ? noop : _ref14$onClick,
23832
+ themeValues = _ref14.themeValues,
23833
+ maxHeight = _ref14.maxHeight,
23834
+ _ref14$widthFitOption = _ref14.widthFitOptions,
23835
+ widthFitOptions = _ref14$widthFitOption === void 0 ? false : _ref14$widthFitOption,
23836
+ disabled = _ref14.disabled,
23837
+ _ref14$hasTitles = _ref14.hasTitles,
23838
+ hasTitles = _ref14$hasTitles === void 0 ? false : _ref14$hasTitles,
23839
+ _ref14$autoEraseTypeA = _ref14.autoEraseTypeAhead,
23840
+ autoEraseTypeAhead = _ref14$autoEraseTypeA === void 0 ? true : _ref14$autoEraseTypeA,
23841
+ ariaLabelledby = _ref14.ariaLabelledby,
23842
+ ariaDescribedby = _ref14.ariaDescribedby,
23843
+ autocompleteValue = _ref14.autocompleteValue,
23844
+ _ref14$smoothScroll = _ref14.smoothScroll,
23845
+ smoothScroll = _ref14$smoothScroll === void 0 ? true : _ref14$smoothScroll,
23846
+ _ref14$ariaInvalid = _ref14.ariaInvalid,
23847
+ ariaInvalid = _ref14$ariaInvalid === void 0 ? false : _ref14$ariaInvalid;
23821
23848
 
23822
23849
  var _useState = React.useState(""),
23823
23850
  _useState2 = _slicedToArray(_useState, 2),
@@ -24140,7 +24167,9 @@ var Dropdown = function Dropdown(_ref8) {
24140
24167
  return setFocusedRef(optionRefs.current[i]);
24141
24168
  }
24142
24169
  }, /*#__PURE__*/React__default.createElement(DropdownItemBorder, {
24143
- selected: choice.value === value
24170
+ disabled: disabledValues.includes(choice.value),
24171
+ selected: choice.value === value,
24172
+ themeValues: themeValues
24144
24173
  }, /*#__PURE__*/React__default.createElement(Text$1, {
24145
24174
  variant: "p",
24146
24175
  color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,