@thecb/components 12.1.0-beta.11 → 12.1.0-beta.12

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.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", "customAriaLabel"];
22151
+ var _excluded$x = ["title", "name", "checked", "onChange", "disabled", "themeValues", "hidden", "error", "isRequired", "checkboxMargin", "extraStyles", "textExtraStyles", "labelledById", "dataQa", "checkboxExtraStyles", "hasIconOverride", "icon"];
22152
22152
  var CheckboxContainer = styled.span.withConfig({
22153
22153
  displayName: "Checkbox__CheckboxContainer",
22154
22154
  componentId: "sc-36kqbv-0"
@@ -22220,7 +22220,6 @@ 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,
22224
22223
  rest = _objectWithoutProperties(_ref5, _excluded$x);
22225
22224
  var _useState = useState(false),
22226
22225
  _useState2 = _slicedToArray(_useState, 2),
@@ -22231,12 +22230,9 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22231
22230
  func();
22232
22231
  }
22233
22232
  };
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;
22233
+ var titleId = title ? "checkboxlabel-".concat(name) : undefined;
22234
+ var ariaLabelledById = labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
22235
+ var ariaLabel = ariaLabelledById ? undefined : name;
22240
22236
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22241
22237
  ref: ref,
22242
22238
  padding: "0",
@@ -22247,7 +22243,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22247
22243
  "aria-invalid": error,
22248
22244
  "aria-label": ariaLabel,
22249
22245
  "aria-labelledby": ariaLabelledById,
22250
- "aria-describedby": errorMessageNormalized,
22246
+ "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22251
22247
  onFocus: function onFocus() {
22252
22248
  return setFocused(true);
22253
22249
  },
@@ -22265,7 +22261,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22265
22261
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22266
22262
  "data-qa": "Checkbox"
22267
22263
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22268
- id: checkboxId,
22264
+ id: "checkbox-".concat(name),
22269
22265
  disabled: disabled,
22270
22266
  name: name,
22271
22267
  checked: checked,
@@ -48191,10 +48187,6 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
48191
48187
  };
48192
48188
 
48193
48189
  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;}"]);
48198
48190
  var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48199
48191
  var _ref$showCheckbox = _ref.showCheckbox,
48200
48192
  showCheckbox = _ref$showCheckbox === void 0 ? true : _ref$showCheckbox,
@@ -48236,21 +48228,6 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48236
48228
  useScrollTo("terms-body-text", 0, 0, "smooth", 100);
48237
48229
  }
48238
48230
  };
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
- }
48254
48231
  return /*#__PURE__*/React__default.createElement(Box, {
48255
48232
  padding: displayInline ? "0" : "1.5rem",
48256
48233
  minWidth: displayInline ? "0" : "100%",
@@ -48463,33 +48440,25 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48463
48440
  onChange: toggleCheckbox,
48464
48441
  checked: defaultMethod.value,
48465
48442
  hidden: hideDefaultPayment
48466
- }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48443
+ }), (showWalletCheckbox || showTerms) && /*#__PURE__*/React__default.createElement(Cluster, {
48444
+ childGap: "4px",
48445
+ align: "center",
48446
+ overflow: true
48447
+ }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48467
48448
  name: "bank checkbox",
48468
48449
  dataQa: "Save checking account to wallet",
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
- }))),
48450
+ title: "Save checking account to wallet.",
48484
48451
  checked: walletCheckboxMarked,
48485
48452
  onChange: saveToWallet
48486
- }), !showWalletCheckbox && showTerms && /*#__PURE__*/React__default.createElement(TermsAndConditions, {
48453
+ }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {
48454
+ singleChild: true
48455
+ }, /*#__PURE__*/React__default.createElement(TermsAndConditions, {
48487
48456
  version: "v2",
48488
48457
  showCheckbox: false,
48489
- description: "View ",
48458
+ description: "View",
48490
48459
  terms: termsContent,
48491
48460
  initialFocusSelector: ".modal-close-button"
48492
- })));
48461
+ })))));
48493
48462
  };
48494
48463
 
48495
48464
  var formConfig$6 = {
@@ -48661,33 +48630,25 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48661
48630
  },
48662
48631
  autocompleteValue: "billing postal-code",
48663
48632
  isRequired: true
48664
- })), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48665
- name: "bank checkbox",
48633
+ })), (showWalletCheckbox || showTerms) && /*#__PURE__*/React__default.createElement(Cluster, {
48634
+ childGap: "4px",
48635
+ align: "center",
48636
+ overflow: true
48637
+ }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48638
+ name: "credit card checkbox",
48666
48639
  dataQa: "Save credit card to wallet",
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
- }))),
48640
+ title: "Save credit card to wallet.",
48682
48641
  checked: walletCheckboxMarked,
48683
48642
  onChange: saveToWallet
48684
- }), !showWalletCheckbox && showTerms && /*#__PURE__*/React__default.createElement(TermsAndConditions, {
48643
+ }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {
48644
+ singleChild: true
48645
+ }, /*#__PURE__*/React__default.createElement(TermsAndConditions, {
48685
48646
  version: "v2",
48686
48647
  showCheckbox: false,
48687
- description: "View ",
48648
+ description: "View",
48688
48649
  terms: termsContent,
48689
48650
  initialFocusSelector: ".modal-close-button"
48690
- })));
48651
+ })))));
48691
48652
  };
48692
48653
  var PaymentFormCard$1 = withWindowSize(PaymentFormCard);
48693
48654