@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 +68 -40
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +68 -40
- 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 +44 -27
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +1 -1
- package/src/util/{generateShadows.js → colorUtils.js} +6 -0
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:
|
|
23770
|
-
var
|
|
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(
|
|
23795
|
-
var placeholder =
|
|
23796
|
-
options =
|
|
23797
|
-
value =
|
|
23798
|
-
isOpen =
|
|
23799
|
-
isError =
|
|
23800
|
-
onSelect =
|
|
23801
|
-
|
|
23802
|
-
disabledValues =
|
|
23803
|
-
|
|
23804
|
-
_onClick =
|
|
23805
|
-
themeValues =
|
|
23806
|
-
maxHeight =
|
|
23807
|
-
|
|
23808
|
-
widthFitOptions =
|
|
23809
|
-
disabled =
|
|
23810
|
-
|
|
23811
|
-
hasTitles =
|
|
23812
|
-
|
|
23813
|
-
autoEraseTypeAhead =
|
|
23814
|
-
ariaLabelledby =
|
|
23815
|
-
ariaDescribedby =
|
|
23816
|
-
autocompleteValue =
|
|
23817
|
-
|
|
23818
|
-
smoothScroll =
|
|
23819
|
-
|
|
23820
|
-
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
|
-
|
|
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,
|