@thecb/components 12.0.6 → 12.1.0-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.esm.js CHANGED
@@ -22230,45 +22230,43 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22230
22230
  func();
22231
22231
  }
22232
22232
  };
22233
- var titleId = title ? "checkboxlabel-".concat(name) : undefined;
22234
- var ariaLabelledById = labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
22235
- var ariaLabel = ariaLabelledById ? undefined : name;
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;
22236
22238
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22237
22239
  ref: ref,
22238
22240
  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
- },
22256
22241
  hiddenStyles: hidden,
22257
22242
  background: themeValues.backgroundColor,
22258
- extraStyles: "\n :focus {\n outline: 0;\n }\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22243
+ extraStyles: "\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22259
22244
  }, rest), /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22245
+ htmlFor: checkboxId,
22260
22246
  "data-qa": dataQa
22261
22247
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22262
22248
  "data-qa": "Checkbox"
22263
22249
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22264
- id: "checkbox-".concat(name),
22250
+ id: checkboxId,
22265
22251
  disabled: disabled,
22266
22252
  name: name,
22267
22253
  checked: checked,
22268
22254
  onChange: onChange,
22269
- tabIndex: "-1",
22255
+ tabIndex: "0",
22270
22256
  required: isRequired,
22271
- "aria-hidden": "true"
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
+ }
22272
22270
  }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22273
22271
  "aria-hidden": "true",
22274
22272
  error: error,
@@ -48446,7 +48444,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48446
48444
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48447
48445
  name: "bank checkbox",
48448
48446
  dataQa: "Save checking account to wallet",
48449
- title: "Save checking account to wallet.",
48447
+ title: "Save checking account to wallet (optional).",
48450
48448
  checked: walletCheckboxMarked,
48451
48449
  onChange: saveToWallet
48452
48450
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {
@@ -48635,7 +48633,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48635
48633
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48636
48634
  name: "credit card checkbox",
48637
48635
  dataQa: "Save credit card to wallet",
48638
- title: "Save credit card to wallet.",
48636
+ title: "Save credit card to wallet (optional).",
48639
48637
  checked: walletCheckboxMarked,
48640
48638
  onChange: saveToWallet
48641
48639
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {