@thecb/components 7.10.0-beta.1 → 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 -24
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +151 -24
- 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 -20
- /package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +0 -0
package/dist/index.cjs.js
CHANGED
|
@@ -14740,23 +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
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
14747
|
-
"aria-label": ariaLabel,
|
|
14748
|
-
width: "24px",
|
|
14749
|
-
height: "24px",
|
|
14750
|
-
fill: "none",
|
|
14751
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
14752
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
14753
|
-
fillRule: "evenodd",
|
|
14754
|
-
clipRule: "evenodd",
|
|
14755
|
-
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",
|
|
14756
|
-
fill: "#15749D"
|
|
14757
|
-
}));
|
|
14758
|
-
};
|
|
14759
|
-
|
|
14760
14743
|
var PendingIcon = function PendingIcon() {
|
|
14761
14744
|
return /*#__PURE__*/React__default.createElement("svg", {
|
|
14762
14745
|
width: "32px",
|
|
@@ -21006,7 +20989,7 @@ var CheckboxContainer = styled__default.div.withConfig({
|
|
|
21006
20989
|
var CheckboxLabelContainer = styled__default.label.withConfig({
|
|
21007
20990
|
displayName: "Checkbox__CheckboxLabelContainer",
|
|
21008
20991
|
componentId: "sc-36kqbv-1"
|
|
21009
|
-
})(["display:flex;align-items:center;"]);
|
|
20992
|
+
})(["display:flex;align-items:center;column-gap:1rem;"]);
|
|
21010
20993
|
var CheckboxIcon = styled__default.svg.withConfig({
|
|
21011
20994
|
displayName: "Checkbox__CheckboxIcon",
|
|
21012
20995
|
componentId: "sc-36kqbv-2"
|
|
@@ -21025,7 +21008,7 @@ var HiddenCheckbox = styled__default.input.attrs({
|
|
|
21025
21008
|
var StyledCheckbox = styled__default.div.withConfig({
|
|
21026
21009
|
displayName: "Checkbox__StyledCheckbox",
|
|
21027
21010
|
componentId: "sc-36kqbv-4"
|
|
21028
|
-
})(["display:inline-block;
|
|
21011
|
+
})(["display:inline-block;width:24px;height:24px;border-radius:2px;transition:all 150ms;", "{visibility:", ";}", ";"], CheckboxIcon, function (_ref2) {
|
|
21029
21012
|
var checked = _ref2.checked;
|
|
21030
21013
|
return checked ? "visible" : "hidden";
|
|
21031
21014
|
}, function (_ref3) {
|
|
@@ -21055,6 +21038,8 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21055
21038
|
hidden = _ref4$hidden === void 0 ? false : _ref4$hidden,
|
|
21056
21039
|
_ref4$error = _ref4.error,
|
|
21057
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,
|
|
21058
21043
|
extraStyles = _ref4.extraStyles,
|
|
21059
21044
|
textExtraStyles = _ref4.textExtraStyles;
|
|
21060
21045
|
|
|
@@ -21083,7 +21068,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21083
21068
|
},
|
|
21084
21069
|
hiddenStyles: hidden,
|
|
21085
21070
|
background: themeValues.backgroundColor,
|
|
21086
|
-
extraStyles: "outline: none; ".concat(extraStyles)
|
|
21071
|
+
extraStyles: "outline: none; ".concat(extraStyles, "; margin: ").concat(checkboxMargin, ";")
|
|
21087
21072
|
}, /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, null, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
|
|
21088
21073
|
"data-qa": "Checkbox"
|
|
21089
21074
|
}, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
|
|
@@ -21095,7 +21080,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21095
21080
|
onChange: onChange,
|
|
21096
21081
|
tabIndex: "-1",
|
|
21097
21082
|
"aria-invalid": error,
|
|
21098
|
-
"aria-describedby": "".concat(name, "-error-message")
|
|
21083
|
+
"aria-describedby": error ? "".concat(name, "-error-message") : ""
|
|
21099
21084
|
}), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
|
|
21100
21085
|
error: error,
|
|
21101
21086
|
disabled: disabled,
|
|
@@ -21114,7 +21099,7 @@ var Checkbox = function Checkbox(_ref4) {
|
|
|
21114
21099
|
checkColor: themeValues.checkColor
|
|
21115
21100
|
}, /*#__PURE__*/React__default.createElement("polyline", {
|
|
21116
21101
|
points: "20 6 9 17 4 12"
|
|
21117
|
-
})))), /*#__PURE__*/React__default.createElement(Text$1, {
|
|
21102
|
+
})))), title && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
21118
21103
|
variant: "p",
|
|
21119
21104
|
weight: themeValues.textFontWeight,
|
|
21120
21105
|
color: themeValues.textColor,
|
|
@@ -48557,7 +48542,7 @@ var TabSidebar = function TabSidebar(_ref) {
|
|
|
48557
48542
|
|
|
48558
48543
|
var TabSidebar$1 = themeComponent(TabSidebar, "ProfileTab", fallbackValues$P);
|
|
48559
48544
|
|
|
48560
|
-
var
|
|
48545
|
+
var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
48561
48546
|
var onCheck = _ref.onCheck,
|
|
48562
48547
|
isChecked = _ref.isChecked,
|
|
48563
48548
|
html = _ref.html,
|
|
@@ -48590,6 +48575,148 @@ var TermsAndConditions = function TermsAndConditions(_ref) {
|
|
|
48590
48575
|
})))));
|
|
48591
48576
|
};
|
|
48592
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
|
+
|
|
48593
48720
|
var Timeout = function Timeout(_ref) {
|
|
48594
48721
|
var onLogout = _ref.onLogout;
|
|
48595
48722
|
|
|
@@ -49118,7 +49245,6 @@ exports.PaymentMethodAddIcon = PaymentMethodAddIcon$1;
|
|
|
49118
49245
|
exports.PaymentMethodIcon = PaymentMethodIcon$1;
|
|
49119
49246
|
exports.PaymentSearchIcon = PaymentSearchIcon;
|
|
49120
49247
|
exports.PaymentsIconSmall = PaymentsIconSmall$1;
|
|
49121
|
-
exports.PencilIcon = PencilIcon;
|
|
49122
49248
|
exports.PendingIcon = PendingIcon;
|
|
49123
49249
|
exports.PeriscopeDashboardIframe = PeriscopeDashboardIframe;
|
|
49124
49250
|
exports.PeriscopeFailedIcon = PeriscopeFailedIcon;
|