@thecb/components 12.0.6-beta.0 → 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
@@ -13930,7 +13930,8 @@ var ForgotPasswordIcon = function ForgotPasswordIcon(_ref) {
13930
13930
  xmlnsXlink: "http://www.w3.org/1999/xlink",
13931
13931
  width: "100",
13932
13932
  height: "100",
13933
- viewBox: "0 0 100 100"
13933
+ viewBox: "0 0 100 100",
13934
+ "aria-hidden": "true"
13934
13935
  }, /*#__PURE__*/React__default.createElement("defs", null, /*#__PURE__*/React__default.createElement("path", {
13935
13936
  id: "prefix__a",
13936
13937
  d: "M0 0h100v100H0z"
@@ -22229,45 +22230,43 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22229
22230
  func();
22230
22231
  }
22231
22232
  };
22232
- var titleId = title ? "checkboxlabel-".concat(name) : undefined;
22233
- var ariaLabelledById = labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
22234
- 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;
22235
22238
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22236
22239
  ref: ref,
22237
22240
  padding: "0",
22238
- tabIndex: "0",
22239
- role: "checkbox",
22240
- "aria-checked": checked,
22241
- "aria-required": isRequired || undefined,
22242
- "aria-invalid": error,
22243
- "aria-label": ariaLabel,
22244
- "aria-labelledby": ariaLabelledById,
22245
- "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22246
- onFocus: function onFocus() {
22247
- return setFocused(true);
22248
- },
22249
- onBlur: function onBlur() {
22250
- return setFocused(false);
22251
- },
22252
- onKeyDown: function onKeyDown(e) {
22253
- return handleClick(e, onChange);
22254
- },
22255
22241
  hiddenStyles: hidden,
22256
22242
  background: themeValues.backgroundColor,
22257
- 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 ")
22258
22244
  }, rest), /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22245
+ htmlFor: checkboxId,
22259
22246
  "data-qa": dataQa
22260
22247
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22261
22248
  "data-qa": "Checkbox"
22262
22249
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22263
- id: "checkbox-".concat(name),
22250
+ id: checkboxId,
22264
22251
  disabled: disabled,
22265
22252
  name: name,
22266
22253
  checked: checked,
22267
22254
  onChange: onChange,
22268
- tabIndex: "-1",
22255
+ tabIndex: "0",
22269
22256
  required: isRequired,
22270
- "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
+ }
22271
22270
  }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22272
22271
  "aria-hidden": "true",
22273
22272
  error: error,
@@ -48445,7 +48444,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48445
48444
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48446
48445
  name: "bank checkbox",
48447
48446
  dataQa: "Save checking account to wallet",
48448
- title: "Save checking account to wallet.",
48447
+ title: "Save checking account to wallet (optional).",
48449
48448
  checked: walletCheckboxMarked,
48450
48449
  onChange: saveToWallet
48451
48450
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {
@@ -48634,7 +48633,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48634
48633
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48635
48634
  name: "credit card checkbox",
48636
48635
  dataQa: "Save credit card to wallet",
48637
- title: "Save credit card to wallet.",
48636
+ title: "Save credit card to wallet (optional).",
48638
48637
  checked: walletCheckboxMarked,
48639
48638
  onChange: saveToWallet
48640
48639
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {