@thecb/components 12.1.0-beta.0 → 12.1.0-beta.10

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
@@ -22230,43 +22230,45 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22230
22230
  func();
22231
22231
  }
22232
22232
  };
22233
- var normalizedName = name ? name.replace(/\s+/g, "-") : name;
22234
- var checkboxId = "checkbox-".concat(normalizedName);
22235
- var titleId = title ? "checkboxlabel-".concat(normalizedName) : undefined;
22236
- // aria-label fallback when no visible title or external labelledById is provided
22237
- var ariaLabel = !labelledById && !title ? name : 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;
22238
22236
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22239
22237
  ref: ref,
22240
22238
  padding: "0",
22239
+ tabIndex: "0",
22240
+ role: "checkbox",
22241
+ "aria-checked": checked,
22242
+ "aria-required": isRequired || undefined,
22243
+ "aria-invalid": error,
22244
+ "aria-label": ariaLabel,
22245
+ "aria-labelledby": ariaLabelledById,
22246
+ "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22247
+ onFocus: function onFocus() {
22248
+ return setFocused(true);
22249
+ },
22250
+ onBlur: function onBlur() {
22251
+ return setFocused(false);
22252
+ },
22253
+ onKeyDown: function onKeyDown(e) {
22254
+ return handleClick(e, onChange);
22255
+ },
22241
22256
  hiddenStyles: hidden,
22242
22257
  background: themeValues.backgroundColor,
22243
- extraStyles: "\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22258
+ extraStyles: "\n :focus {\n outline: 0;\n }\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22244
22259
  }, rest), /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22245
- htmlFor: checkboxId,
22246
22260
  "data-qa": dataQa
22247
22261
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22248
22262
  "data-qa": "Checkbox"
22249
22263
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22250
- id: checkboxId,
22264
+ id: "checkbox-".concat(name),
22251
22265
  disabled: disabled,
22252
22266
  name: name,
22253
22267
  checked: checked,
22254
22268
  onChange: onChange,
22255
- tabIndex: "0",
22269
+ tabIndex: "-1",
22256
22270
  required: isRequired,
22257
- "aria-invalid": error,
22258
- "aria-label": ariaLabel,
22259
- "aria-labelledby": labelledById,
22260
- "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22261
- onKeyDown: function onKeyDown(e) {
22262
- return handleClick(e, onChange);
22263
- },
22264
- onFocus: function onFocus() {
22265
- return setFocused(true);
22266
- },
22267
- onBlur: function onBlur() {
22268
- return setFocused(false);
22269
- }
22271
+ "aria-hidden": "true"
22270
22272
  }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22271
22273
  "aria-hidden": "true",
22272
22274
  error: error,
@@ -27019,7 +27021,7 @@ var NavFooter = function NavFooter(_ref) {
27019
27021
  background: backgroundColor,
27020
27022
  minHeight: footerMinHeight,
27021
27023
  minWidth: "100%",
27022
- extraStyles: isMobile ? "overflow: hidden;" : "height: ".concat(footerMinHeight, "; > * { height: 100%; };")
27024
+ extraStyles: isMobile ? "" : "min-height: ".concat(footerMinHeight, "; > * { min-height: 100%; };")
27023
27025
  }, rest), /*#__PURE__*/React__default.createElement(Center, {
27024
27026
  maxWidth: footerWidth || "76.5rem"
27025
27027
  }, /*#__PURE__*/React__default.createElement(Cover, {
@@ -48239,7 +48241,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
48239
48241
  }, html), /*#__PURE__*/React__default.createElement(Cluster, {
48240
48242
  justify: "flex-start",
48241
48243
  align: "center",
48242
- nowrap: true
48244
+ nowrap: true,
48245
+ overflow: true
48243
48246
  }, showCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48244
48247
  name: id,
48245
48248
  error: hasError,
@@ -48444,7 +48447,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48444
48447
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48445
48448
  name: "bank checkbox",
48446
48449
  dataQa: "Save checking account to wallet",
48447
- title: "Save checking account to wallet (optional).",
48450
+ title: "Save checking account to wallet.",
48448
48451
  checked: walletCheckboxMarked,
48449
48452
  onChange: saveToWallet
48450
48453
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {
@@ -48633,7 +48636,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48633
48636
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48634
48637
  name: "credit card checkbox",
48635
48638
  dataQa: "Save credit card to wallet",
48636
- title: "Save credit card to wallet (optional).",
48639
+ title: "Save credit card to wallet.",
48637
48640
  checked: walletCheckboxMarked,
48638
48641
  onChange: saveToWallet
48639
48642
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {