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

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,19 +23770,13 @@ 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 ? themeValues.selectedColor : 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,
@@ -23789,35 +23787,63 @@ var DropdownItemBorder = styled__default.div.withConfig({
23789
23787
  disabled = _ref7.disabled,
23790
23788
  themeValues = _ref7.themeValues;
23791
23789
  return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
23790
+ }, function (_ref8) {
23791
+ var themeValues = _ref8.themeValues;
23792
+ return themeValues.hoverColor;
23793
+ }, function (_ref9) {
23794
+ var selected = _ref9.selected,
23795
+ themeValues = _ref9.themeValues;
23796
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : "";
23797
+ }, function (_ref10) {
23798
+ var selected = _ref10.selected,
23799
+ themeValues = _ref10.themeValues;
23800
+ return selected ? TRANSPARENT : themeValues.selectedColor;
23801
+ }, function (_ref11) {
23802
+ var selected = _ref11.selected,
23803
+ disabled = _ref11.disabled,
23804
+ themeValues = _ref11.themeValues;
23805
+ return selected ? addOpacity(themeValues.selectedColor, 0.2, 0, 0, 0) : disabled ? WHITE : themeValues.hoverColor;
23806
+ });
23807
+ var DropdownItemBorder = styled__default.div.withConfig({
23808
+ displayName: "Dropdown__DropdownItemBorder",
23809
+ componentId: "sc-pn6m0h-3"
23810
+ })(["background:", ";border-color:", ";border-width:2px;border-style:solid;padding:12px;"], function (_ref12) {
23811
+ var selected = _ref12.selected,
23812
+ themeValues = _ref12.themeValues;
23813
+ return selected ? themeValues.selectedColor : WHITE;
23814
+ }, function (_ref13) {
23815
+ var selected = _ref13.selected,
23816
+ themeValues = _ref13.themeValues;
23817
+ return selected ? themeValues.selectedColor : WHITE;
23792
23818
  });
23793
23819
 
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;
23820
+ var Dropdown = function Dropdown(_ref14) {
23821
+ var placeholder = _ref14.placeholder,
23822
+ options = _ref14.options,
23823
+ value = _ref14.value,
23824
+ isOpen = _ref14.isOpen,
23825
+ isError = _ref14.isError,
23826
+ onSelect = _ref14.onSelect,
23827
+ _ref14$disabledValues = _ref14.disabledValues,
23828
+ disabledValues = _ref14$disabledValues === void 0 ? [] : _ref14$disabledValues,
23829
+ _ref14$onClick = _ref14.onClick,
23830
+ _onClick = _ref14$onClick === void 0 ? noop : _ref14$onClick,
23831
+ themeValues = _ref14.themeValues,
23832
+ maxHeight = _ref14.maxHeight,
23833
+ _ref14$widthFitOption = _ref14.widthFitOptions,
23834
+ widthFitOptions = _ref14$widthFitOption === void 0 ? false : _ref14$widthFitOption,
23835
+ disabled = _ref14.disabled,
23836
+ _ref14$hasTitles = _ref14.hasTitles,
23837
+ hasTitles = _ref14$hasTitles === void 0 ? false : _ref14$hasTitles,
23838
+ _ref14$autoEraseTypeA = _ref14.autoEraseTypeAhead,
23839
+ autoEraseTypeAhead = _ref14$autoEraseTypeA === void 0 ? true : _ref14$autoEraseTypeA,
23840
+ ariaLabelledby = _ref14.ariaLabelledby,
23841
+ ariaDescribedby = _ref14.ariaDescribedby,
23842
+ autocompleteValue = _ref14.autocompleteValue,
23843
+ _ref14$smoothScroll = _ref14.smoothScroll,
23844
+ smoothScroll = _ref14$smoothScroll === void 0 ? true : _ref14$smoothScroll,
23845
+ _ref14$ariaInvalid = _ref14.ariaInvalid,
23846
+ ariaInvalid = _ref14$ariaInvalid === void 0 ? false : _ref14$ariaInvalid;
23821
23847
 
23822
23848
  var _useState = React.useState(""),
23823
23849
  _useState2 = _slicedToArray(_useState, 2),
@@ -24140,7 +24166,9 @@ var Dropdown = function Dropdown(_ref8) {
24140
24166
  return setFocusedRef(optionRefs.current[i]);
24141
24167
  }
24142
24168
  }, /*#__PURE__*/React__default.createElement(DropdownItemBorder, {
24143
- selected: choice.value === value
24169
+ disabled: disabledValues.includes(choice.value),
24170
+ selected: choice.value === value,
24171
+ themeValues: themeValues
24144
24172
  }, /*#__PURE__*/React__default.createElement(Text$1, {
24145
24173
  variant: "p",
24146
24174
  color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,