@thecb/components 7.10.0 → 7.10.1-beta.0
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 +150 -27
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +151 -27
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/checkbox/Checkbox.js +20 -17
- package/src/components/atoms/icons/icons.stories.js +0 -2
- package/src/components/atoms/icons/index.js +0 -2
- package/src/components/molecules/.DS_Store +0 -0
- package/src/components/molecules/terms-and-conditions/TermsAndConditions.js +10 -41
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV1.js +45 -0
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +89 -0
- package/src/util/generateShadows.js +60 -0
- package/src/components/atoms/icons/PencilIcon.js +0 -22
- /package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -14740,26 +14740,6 @@ var FailedIcon = function FailedIcon() {
|
|
|
14740
14740
|
}))));
|
|
14741
14741
|
};
|
|
14742
14742
|
|
|
14743
|
-
var PencilIcon = function PencilIcon(_ref) {
|
|
14744
|
-
var _ref$ariaLabel = _ref.ariaLabel,
|
|
14745
|
-
ariaLabel = _ref$ariaLabel === void 0 ? "Edit" : _ref$ariaLabel,
|
|
14746
|
-
themeValues = _ref.themeValues;
|
|
14747
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
14748
|
-
"aria-label": ariaLabel,
|
|
14749
|
-
width: "24px",
|
|
14750
|
-
height: "24px",
|
|
14751
|
-
fill: "none",
|
|
14752
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
14753
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
14754
|
-
fillRule: "evenodd",
|
|
14755
|
-
clipRule: "evenodd",
|
|
14756
|
-
d: "M19.74 6.84a.885.885 0 0 1 0 1.253l-1.626 1.626-3.333-3.333 1.626-1.626a.885.885 0 0 1 1.253 0l2.08 2.08ZM4 20.5v-3.333l9.83-9.83 3.333 3.333-9.83 9.83H4Z",
|
|
14757
|
-
fill: themeValues.subIconColor
|
|
14758
|
-
}));
|
|
14759
|
-
};
|
|
14760
|
-
|
|
14761
|
-
var PencilIcon$1 = themeComponent(PencilIcon, "Icons", fallbackValues$2, "info");
|
|
14762
|
-
|
|
14763
14743
|
var PendingIcon = function PendingIcon() {
|
|
14764
14744
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
14765
14745
|
width: "32px",
|
|
@@ -21009,7 +20989,7 @@ var CheckboxContainer = styled__default.div.withConfig({
|
|
|
21009
20989
|
var CheckboxLabelContainer = styled__default.label.withConfig({
|
|
21010
20990
|
displayName: "Checkbox__CheckboxLabelContainer",
|
|
21011
20991
|
componentId: "sc-36kqbv-1"
|
|
21012
|
-
})(["display:flex;align-items:center;"]);
|
|
20992
|
+
})(["display:flex;align-items:center;column-gap:1rem;"]);
|
|
21013
20993
|
var CheckboxIcon = styled__default.svg.withConfig({
|
|
21014
20994
|
displayName: "Checkbox__CheckboxIcon",
|
|
21015
20995
|
componentId: "sc-36kqbv-2"
|
|
@@ -21028,7 +21008,7 @@ var HiddenCheckbox = styled__default.input.attrs({
|
|
|
21028
21008
|
var StyledCheckbox = styled__default.div.withConfig({
|
|
21029
21009
|
displayName: "Checkbox__StyledCheckbox",
|
|
21030
21010
|
componentId: "sc-36kqbv-4"
|
|
21031
|
-
})(["display:inline-block;
|
|
21011
|
+
})(["display:inline-block;width:24px;height:24px;border-radius:2px;transition:all 150ms;", "{visibility:", ";}", ";"], CheckboxIcon, function (_ref2) {
|
|
21032
21012
|
var checked = _ref2.checked;
|
|
21033
21013
|
return checked ? "visible" : "hidden";
|
|
21034
21014
|
}, function (_ref3) {
|
|
@@ -21058,6 +21038,8 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21058
21038
|
hidden = _ref4$hidden === void 0 ? false : _ref4$hidden,
|
|
21059
21039
|
_ref4$error = _ref4.error,
|
|
21060
21040
|
error = _ref4$error === void 0 ? false : _ref4$error,
|
|
21041
|
+
_ref4$checkboxMargin = _ref4.checkboxMargin,
|
|
21042
|
+
checkboxMargin = _ref4$checkboxMargin === void 0 ? "0 16px 0 0" : _ref4$checkboxMargin,
|
|
21061
21043
|
extraStyles = _ref4.extraStyles,
|
|
21062
21044
|
textExtraStyles = _ref4.textExtraStyles;
|
|
21063
21045
|
|
|
@@ -21086,7 +21068,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21086
21068
|
},
|
|
21087
21069
|
hiddenStyles: hidden,
|
|
21088
21070
|
background: themeValues.backgroundColor,
|
|
21089
|
-
extraStyles: "outline: none; ".concat(extraStyles)
|
|
21071
|
+
extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
|
|
21090
21072
|
}, /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, null, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
|
|
21091
21073
|
"data-qa": "Checkbox"
|
|
21092
21074
|
}, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
|
|
@@ -21098,7 +21080,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21098
21080
|
onChange: onChange,
|
|
21099
21081
|
tabIndex: "-1",
|
|
21100
21082
|
"aria-invalid": error,
|
|
21101
|
-
"aria-describedby": "".concat(name, "-error-message")
|
|
21083
|
+
"aria-describedby": error ? "".concat(name, "-error-message") : ""
|
|
21102
21084
|
}), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
|
|
21103
21085
|
error: error,
|
|
21104
21086
|
disabled: disabled,
|
|
@@ -21117,7 +21099,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21117
21099
|
checkColor: themeValues.checkColor
|
|
21118
21100
|
}, /*#__PURE__*/React__default.createElement("polyline", {
|
|
21119
21101
|
points: "20 6 9 17 4 12"
|
|
21120
|
-
})))), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
21102
|
+
})))), title && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
21121
21103
|
variant: "p",
|
|
21122
21104
|
weight: themeValues.textFontWeight,
|
|
21123
21105
|
color: themeValues.textColor,
|
|
@@ -48560,7 +48542,7 @@ var TabSidebar = function TabSidebar(_ref) {
|
|
|
48560
48542
|
|
|
48561
48543
|
var TabSidebar$1 = themeComponent(TabSidebar, "ProfileTab", fallbackValues$P);
|
|
48562
48544
|
|
|
48563
|
-
var
|
|
48545
|
+
var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
48564
48546
|
var onCheck = _ref.onCheck,
|
|
48565
48547
|
isChecked = _ref.isChecked,
|
|
48566
48548
|
html = _ref.html,
|
|
@@ -48593,6 +48575,148 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
|
|
|
48593
48575
|
})))));
|
|
48594
48576
|
};
|
|
48595
48577
|
|
|
48578
|
+
/*
|
|
48579
|
+
|
|
48580
|
+
A utility function that can generate box-shadow values for components
|
|
48581
|
+
Takes a string representing an rgb color value and returns an object
|
|
48582
|
+
with values for standard, inset, and overlay shadows.
|
|
48583
|
+
|
|
48584
|
+
The objects for standard and inset shadows contain versions approiate
|
|
48585
|
+
for base, hover, and active interaction states.
|
|
48586
|
+
|
|
48587
|
+
*/
|
|
48588
|
+
|
|
48589
|
+
/*
|
|
48590
|
+
Function to convert string representing rgb color to rgba value with provided opacity
|
|
48591
|
+
("rgb(41, 42, 51)", "0.1") => "rgba(41, 42, 51, 0.1)"
|
|
48592
|
+
|
|
48593
|
+
*/
|
|
48594
|
+
var rgbToRgba = function rgbToRgba() {
|
|
48595
|
+
var rgbValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";
|
|
48596
|
+
var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";
|
|
48597
|
+
|
|
48598
|
+
if (typeof rgbValue !== "string" || typeof opacity !== "string" || rgbValue.charAt(0) === "#") {
|
|
48599
|
+
return "";
|
|
48600
|
+
}
|
|
48601
|
+
|
|
48602
|
+
return "".concat(rgbValue.slice(0, 3), "a").concat(rgbValue.slice(3, -1), ", ").concat(opacity).concat(rgbValue.slice(-1));
|
|
48603
|
+
};
|
|
48604
|
+
|
|
48605
|
+
var generateShadows = function generateShadows(baseColorRGB) {
|
|
48606
|
+
var colorTen = rgbToRgba(baseColorRGB, "0.1") || "rgba(41, 42, 51, 0.1)";
|
|
48607
|
+
var colorTwenty = rgbToRgba(baseColorRGB, "0.2") || "rgba(41, 42, 51, 0.2)";
|
|
48608
|
+
var colorTwentyFive = rgbToRgba(baseColorRGB, "0.25") || "rgba(41, 42, 51, 0.25)";
|
|
48609
|
+
var colorThirty = rgbToRgba(baseColorRGB, "0.3") || "rgba(41, 42, 51, 0.3)";
|
|
48610
|
+
var blackTwentyFive = "rgba(0, 0, 0, 0.25)";
|
|
48611
|
+
var standard = {
|
|
48612
|
+
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 6px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
48613
|
+
hover: "0px 1px 2px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(blackTwentyFive, ", 0px 6px 12px 0px ").concat(colorTen),
|
|
48614
|
+
active: "0px 2px 8px 0px ".concat(colorTwenty, ", 0px 4px 8px 0px ").concat(colorThirty, ", 0px 6px 12px 0px ").concat(colorTwentyFive)
|
|
48615
|
+
};
|
|
48616
|
+
var inset = {
|
|
48617
|
+
base: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwenty, ", inset 0px 1px 0px 0px ").concat(colorTen),
|
|
48618
|
+
hover: "0px 1px 2px 0px ".concat(colorTen, ", 0px 2px 4px 0px ").concat(colorTwentyFive, ", 0px 4px 8px 0px ").concat(colorTen),
|
|
48619
|
+
active: "0px 1px 2px 2px ".concat(colorTwenty, ", 0px 3px 6px 0px ").concat(colorThirty, ", 0px 4px 8px 0px ").concat(colorTwenty)
|
|
48620
|
+
};
|
|
48621
|
+
var overlay = {
|
|
48622
|
+
base: "0px 7px 32px 0px ".concat(colorTwenty, ", 0px 1px 4px 0px ").concat(colorTwenty, ", 0px 1px 8px -1px ").concat(colorThirty)
|
|
48623
|
+
};
|
|
48624
|
+
return {
|
|
48625
|
+
standard: standard,
|
|
48626
|
+
inset: inset,
|
|
48627
|
+
overlay: overlay
|
|
48628
|
+
};
|
|
48629
|
+
};
|
|
48630
|
+
|
|
48631
|
+
var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
48632
|
+
var _ref$showCheckbox = _ref.showCheckbox,
|
|
48633
|
+
showCheckbox = _ref$showCheckbox === void 0 ? true : _ref$showCheckbox,
|
|
48634
|
+
onCheck = _ref.onCheck,
|
|
48635
|
+
isChecked = _ref.isChecked,
|
|
48636
|
+
hasError = _ref.hasError,
|
|
48637
|
+
_ref$errorMessage = _ref.errorMessage,
|
|
48638
|
+
errorMessage = _ref$errorMessage === void 0 ? "Please accept Terms and Conditions" : _ref$errorMessage,
|
|
48639
|
+
_ref$description = _ref.description,
|
|
48640
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
48641
|
+
_ref$linkText = _ref.linkText,
|
|
48642
|
+
linkText = _ref$linkText === void 0 ? "Terms and Conditions" : _ref$linkText,
|
|
48643
|
+
html = _ref.html,
|
|
48644
|
+
terms = _ref.terms,
|
|
48645
|
+
_ref$id = _ref.id,
|
|
48646
|
+
id = _ref$id === void 0 ? "terms-and-conditions" : _ref$id,
|
|
48647
|
+
_ref$displayInline = _ref.displayInline,
|
|
48648
|
+
displayInline = _ref$displayInline === void 0 ? true : _ref$displayInline,
|
|
48649
|
+
_ref$modalVariant = _ref.modalVariant,
|
|
48650
|
+
modalVariant = _ref$modalVariant === void 0 ? "default" : _ref$modalVariant,
|
|
48651
|
+
_ref$containerBackgro = _ref.containerBackground,
|
|
48652
|
+
containerBackground = _ref$containerBackgro === void 0 ? ATHENS_GREY : _ref$containerBackgro,
|
|
48653
|
+
_ref$checkboxMargin = _ref.checkboxMargin,
|
|
48654
|
+
checkboxMargin = _ref$checkboxMargin === void 0 ? "4px 8px 4px 4px" : _ref$checkboxMargin,
|
|
48655
|
+
_ref$modalTitle = _ref.modalTitle,
|
|
48656
|
+
modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle;
|
|
48657
|
+
|
|
48658
|
+
var _useState = React.useState(false),
|
|
48659
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
48660
|
+
showTerms = _useState2[0],
|
|
48661
|
+
toggleShowTerms = _useState2[1];
|
|
48662
|
+
|
|
48663
|
+
var standardBoxShadow = generateShadows().standard.base;
|
|
48664
|
+
return /*#__PURE__*/React__default.createElement(Box, {
|
|
48665
|
+
padding: displayInline ? "0" : "1.5rem",
|
|
48666
|
+
minWidth: displayInline ? "0" : "100%",
|
|
48667
|
+
background: displayInline ? "transparent" : containerBackground,
|
|
48668
|
+
boxShadow: displayInline ? "none" : standardBoxShadow,
|
|
48669
|
+
borderRadius: displayInline ? "0" : "4px"
|
|
48670
|
+
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
48671
|
+
childGap: "0"
|
|
48672
|
+
}, html && /*#__PURE__*/React__default.createElement(Box, {
|
|
48673
|
+
padding: "0"
|
|
48674
|
+
}, html), /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48675
|
+
justify: "flex-start",
|
|
48676
|
+
align: "center",
|
|
48677
|
+
nowrap: true
|
|
48678
|
+
}, showCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48679
|
+
name: id,
|
|
48680
|
+
error: hasError,
|
|
48681
|
+
checked: isChecked,
|
|
48682
|
+
onChange: onCheck,
|
|
48683
|
+
checkboxMargin: checkboxMargin,
|
|
48684
|
+
extraStyles: "align-self: flex-start;"
|
|
48685
|
+
}), /*#__PURE__*/React__default.createElement(Stack, {
|
|
48686
|
+
childGap: "0.25rem",
|
|
48687
|
+
fullHeight: true
|
|
48688
|
+
}, /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48689
|
+
justify: "flex-start",
|
|
48690
|
+
align: "center",
|
|
48691
|
+
nowrap: true,
|
|
48692
|
+
extraStyles: "padding-right: 2px; > div > * { margin: 4px 2px; };"
|
|
48693
|
+
}, description && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48694
|
+
color: CHARADE_GREY
|
|
48695
|
+
}, description), terms && /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
|
|
48696
|
+
link: linkText,
|
|
48697
|
+
terms: terms,
|
|
48698
|
+
isOpen: showTerms,
|
|
48699
|
+
toggleOpen: toggleShowTerms,
|
|
48700
|
+
linkVariant: modalVariant,
|
|
48701
|
+
title: modalTitle
|
|
48702
|
+
})), showCheckbox && hasError && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48703
|
+
variant: "pXS",
|
|
48704
|
+
color: ERROR_COLOR,
|
|
48705
|
+
id: "".concat(id, "-error-message")
|
|
48706
|
+
}, errorMessage)))));
|
|
48707
|
+
};
|
|
48708
|
+
|
|
48709
|
+
var _excluded$y = ["version"];
|
|
48710
|
+
|
|
48711
|
+
var TermsAndConditions = function TermsAndConditions(_ref) {
|
|
48712
|
+
var _ref$version = _ref.version,
|
|
48713
|
+
version = _ref$version === void 0 ? "v1" : _ref$version,
|
|
48714
|
+
rest = _objectWithoutProperties(_ref, _excluded$y);
|
|
48715
|
+
|
|
48716
|
+
var TermsAndConditionsControl = version === "v1" ? TermsAndConditionsControlV1 : TermsAndConditionsControlV2;
|
|
48717
|
+
return /*#__PURE__*/React__default.createElement(TermsAndConditionsControl, rest);
|
|
48718
|
+
};
|
|
48719
|
+
|
|
48596
48720
|
var Timeout = function Timeout(_ref) {
|
|
48597
48721
|
var onLogout = _ref.onLogout;
|
|
48598
48722
|
|
|
@@ -49121,7 +49245,6 @@ exports.PaymentMethodAddIcon = PaymentMethodAddIcon$1;
|
|
|
49121
49245
|
exports.PaymentMethodIcon = PaymentMethodIcon$1;
|
|
49122
49246
|
exports.PaymentSearchIcon = PaymentSearchIcon;
|
|
49123
49247
|
exports.PaymentsIconSmall = PaymentsIconSmall$1;
|
|
49124
|
-
exports.PencilIcon = PencilIcon$1;
|
|
49125
49248
|
exports.PendingIcon = PendingIcon;
|
|
49126
49249
|
exports.PeriscopeDashboardIframe = PeriscopeDashboardIframe;
|
|
49127
49250
|
exports.PeriscopeFailedIcon = PeriscopeFailedIcon;
|