@thecb/components 12.1.0-beta.12 → 12.1.0-beta.13
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 +67 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +67 -28
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +13 -5
- package/src/components/atoms/checkbox/Checkbox.stories.js +25 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +36 -24
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +36 -23
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +29 -0
- package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.stories.js +166 -0
package/dist/index.esm.js
CHANGED
|
@@ -22148,7 +22148,7 @@ var ENTER = 13;
|
|
|
22148
22148
|
var ESCAPE = 27;
|
|
22149
22149
|
var SPACEBAR = 32;
|
|
22150
22150
|
|
|
22151
|
-
var _excluded$x = ["title", "name", "checked", "onChange", "disabled", "themeValues", "hidden", "error", "isRequired", "checkboxMargin", "extraStyles", "textExtraStyles", "labelledById", "dataQa", "checkboxExtraStyles", "hasIconOverride", "icon"];
|
|
22151
|
+
var _excluded$x = ["title", "name", "checked", "onChange", "disabled", "themeValues", "hidden", "error", "isRequired", "checkboxMargin", "extraStyles", "textExtraStyles", "labelledById", "dataQa", "checkboxExtraStyles", "hasIconOverride", "icon", "customAriaLabel"];
|
|
22152
22152
|
var CheckboxContainer = styled.span.withConfig({
|
|
22153
22153
|
displayName: "Checkbox__CheckboxContainer",
|
|
22154
22154
|
componentId: "sc-36kqbv-0"
|
|
@@ -22220,6 +22220,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
22220
22220
|
_ref5$hasIconOverride = _ref5.hasIconOverride,
|
|
22221
22221
|
hasIconOverride = _ref5$hasIconOverride === void 0 ? false : _ref5$hasIconOverride,
|
|
22222
22222
|
Icon = _ref5.icon,
|
|
22223
|
+
customAriaLabel = _ref5.customAriaLabel,
|
|
22223
22224
|
rest = _objectWithoutProperties(_ref5, _excluded$x);
|
|
22224
22225
|
var _useState = useState(false),
|
|
22225
22226
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -22230,9 +22231,12 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
22230
22231
|
func();
|
|
22231
22232
|
}
|
|
22232
22233
|
};
|
|
22233
|
-
var
|
|
22234
|
-
var
|
|
22235
|
-
var
|
|
22234
|
+
var normalizeName = name ? name.replace(/\s+/g, "-") : "";
|
|
22235
|
+
var checkboxId = "checkbox-".concat(normalizeName);
|
|
22236
|
+
var titleId = title ? "checkboxlabel-".concat(normalizeName) : undefined;
|
|
22237
|
+
var ariaLabelledById = customAriaLabel ? undefined : labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
|
|
22238
|
+
var ariaLabel = ariaLabelledById ? undefined : customAriaLabel !== null && customAriaLabel !== void 0 ? customAriaLabel : name;
|
|
22239
|
+
var errorMessageNormalized = error ? "".concat(normalizeName, "-error-message") : undefined;
|
|
22236
22240
|
return /*#__PURE__*/React__default.createElement(Box, _extends({
|
|
22237
22241
|
ref: ref,
|
|
22238
22242
|
padding: "0",
|
|
@@ -22243,7 +22247,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
22243
22247
|
"aria-invalid": error,
|
|
22244
22248
|
"aria-label": ariaLabel,
|
|
22245
22249
|
"aria-labelledby": ariaLabelledById,
|
|
22246
|
-
"aria-describedby":
|
|
22250
|
+
"aria-describedby": errorMessageNormalized,
|
|
22247
22251
|
onFocus: function onFocus() {
|
|
22248
22252
|
return setFocused(true);
|
|
22249
22253
|
},
|
|
@@ -22261,7 +22265,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
22261
22265
|
}, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
|
|
22262
22266
|
"data-qa": "Checkbox"
|
|
22263
22267
|
}, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
|
|
22264
|
-
id:
|
|
22268
|
+
id: checkboxId,
|
|
22265
22269
|
disabled: disabled,
|
|
22266
22270
|
name: name,
|
|
22267
22271
|
checked: checked,
|
|
@@ -48187,6 +48191,10 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
|
|
|
48187
48191
|
};
|
|
48188
48192
|
|
|
48189
48193
|
var TermsAndConditionsTitleDivId = "terms-and-conditions-title";
|
|
48194
|
+
var InlineTermsWrapper = styled.span.withConfig({
|
|
48195
|
+
displayName: "TermsAndConditionsControlV2__InlineTermsWrapper",
|
|
48196
|
+
componentId: "sc-16np073-0"
|
|
48197
|
+
})(["display:inline;> div{display:inline;}.modal-trigger{display:inline !important;}"]);
|
|
48190
48198
|
var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
48191
48199
|
var _ref$showCheckbox = _ref.showCheckbox,
|
|
48192
48200
|
showCheckbox = _ref$showCheckbox === void 0 ? true : _ref$showCheckbox,
|
|
@@ -48228,6 +48236,21 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
|
|
|
48228
48236
|
useScrollTo("terms-body-text", 0, 0, "smooth", 100);
|
|
48229
48237
|
}
|
|
48230
48238
|
};
|
|
48239
|
+
if (!showCheckbox && displayInline) {
|
|
48240
|
+
return /*#__PURE__*/React__default.createElement(InlineTermsWrapper, {
|
|
48241
|
+
id: TermsAndConditionsTitleDivId
|
|
48242
|
+
}, description && /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48243
|
+
color: CHARADE_GREY
|
|
48244
|
+
}, description), terms && /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
|
|
48245
|
+
link: linkText,
|
|
48246
|
+
terms: terms,
|
|
48247
|
+
isOpen: showTerms,
|
|
48248
|
+
toggleOpen: toggleTerms,
|
|
48249
|
+
linkVariant: modalVariant,
|
|
48250
|
+
title: modalTitle,
|
|
48251
|
+
initialFocusSelector: initialFocusSelector
|
|
48252
|
+
}));
|
|
48253
|
+
}
|
|
48231
48254
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
48232
48255
|
padding: displayInline ? "0" : "1.5rem",
|
|
48233
48256
|
minWidth: displayInline ? "0" : "100%",
|
|
@@ -48440,25 +48463,33 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48440
48463
|
onChange: toggleCheckbox,
|
|
48441
48464
|
checked: defaultMethod.value,
|
|
48442
48465
|
hidden: hideDefaultPayment
|
|
48443
|
-
}),
|
|
48444
|
-
childGap: "4px",
|
|
48445
|
-
align: "center",
|
|
48446
|
-
overflow: true
|
|
48447
|
-
}, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48466
|
+
}), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48448
48467
|
name: "bank checkbox",
|
|
48449
48468
|
dataQa: "Save checking account to wallet",
|
|
48450
|
-
|
|
48469
|
+
customAriaLabel: "Save checking account to wallet (optional).",
|
|
48470
|
+
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save checking account to wallet (optional).", " ", showTerms && /*#__PURE__*/React__default.createElement("span", {
|
|
48471
|
+
onClick: function onClick(e) {
|
|
48472
|
+
return e.stopPropagation();
|
|
48473
|
+
},
|
|
48474
|
+
style: {
|
|
48475
|
+
display: "inline"
|
|
48476
|
+
}
|
|
48477
|
+
}, /*#__PURE__*/React__default.createElement(TermsAndConditions, {
|
|
48478
|
+
version: "v2",
|
|
48479
|
+
showCheckbox: false,
|
|
48480
|
+
description: "View ",
|
|
48481
|
+
terms: termsContent,
|
|
48482
|
+
initialFocusSelector: ".modal-close-button"
|
|
48483
|
+
}))),
|
|
48451
48484
|
checked: walletCheckboxMarked,
|
|
48452
48485
|
onChange: saveToWallet
|
|
48453
|
-
}), showTerms && /*#__PURE__*/React__default.createElement(
|
|
48454
|
-
singleChild: true
|
|
48455
|
-
}, /*#__PURE__*/React__default.createElement(TermsAndConditions, {
|
|
48486
|
+
}), !showWalletCheckbox && showTerms && /*#__PURE__*/React__default.createElement(TermsAndConditions, {
|
|
48456
48487
|
version: "v2",
|
|
48457
48488
|
showCheckbox: false,
|
|
48458
|
-
description: "View",
|
|
48489
|
+
description: "View ",
|
|
48459
48490
|
terms: termsContent,
|
|
48460
48491
|
initialFocusSelector: ".modal-close-button"
|
|
48461
|
-
})))
|
|
48492
|
+
})));
|
|
48462
48493
|
};
|
|
48463
48494
|
|
|
48464
48495
|
var formConfig$6 = {
|
|
@@ -48630,25 +48661,33 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48630
48661
|
},
|
|
48631
48662
|
autocompleteValue: "billing postal-code",
|
|
48632
48663
|
isRequired: true
|
|
48633
|
-
})),
|
|
48634
|
-
childGap: "4px",
|
|
48635
|
-
align: "center",
|
|
48636
|
-
overflow: true
|
|
48637
|
-
}, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48664
|
+
})), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
|
|
48638
48665
|
name: "credit card checkbox",
|
|
48639
48666
|
dataQa: "Save credit card to wallet",
|
|
48640
|
-
|
|
48667
|
+
customAriaLabel: "Save credit card to wallet (optional).",
|
|
48668
|
+
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save credit card to wallet (optional).", " ", showTerms && /*#__PURE__*/React__default.createElement("span", {
|
|
48669
|
+
onClick: function onClick(e) {
|
|
48670
|
+
return e.stopPropagation();
|
|
48671
|
+
},
|
|
48672
|
+
style: {
|
|
48673
|
+
display: "inline"
|
|
48674
|
+
}
|
|
48675
|
+
}, /*#__PURE__*/React__default.createElement(TermsAndConditions, {
|
|
48676
|
+
version: "v2",
|
|
48677
|
+
showCheckbox: false,
|
|
48678
|
+
description: "View ",
|
|
48679
|
+
terms: termsContent,
|
|
48680
|
+
initialFocusSelector: ".modal-close-button"
|
|
48681
|
+
}))),
|
|
48641
48682
|
checked: walletCheckboxMarked,
|
|
48642
48683
|
onChange: saveToWallet
|
|
48643
|
-
}), showTerms && /*#__PURE__*/React__default.createElement(
|
|
48644
|
-
singleChild: true
|
|
48645
|
-
}, /*#__PURE__*/React__default.createElement(TermsAndConditions, {
|
|
48684
|
+
}), !showWalletCheckbox && showTerms && /*#__PURE__*/React__default.createElement(TermsAndConditions, {
|
|
48646
48685
|
version: "v2",
|
|
48647
48686
|
showCheckbox: false,
|
|
48648
|
-
description: "View",
|
|
48687
|
+
description: "View ",
|
|
48649
48688
|
terms: termsContent,
|
|
48650
48689
|
initialFocusSelector: ".modal-close-button"
|
|
48651
|
-
})))
|
|
48690
|
+
})));
|
|
48652
48691
|
};
|
|
48653
48692
|
var PaymentFormCard$1 = withWindowSize(PaymentFormCard);
|
|
48654
48693
|
|