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

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 CHANGED
@@ -22238,43 +22238,45 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
22238
22238
  func();
22239
22239
  }
22240
22240
  };
22241
- var normalizedName = name ? name.replace(/\s+/g, "-") : name;
22242
- var checkboxId = "checkbox-".concat(normalizedName);
22243
- var titleId = title ? "checkboxlabel-".concat(normalizedName) : undefined;
22244
- // aria-label fallback when no visible title or external labelledById is provided
22245
- var ariaLabel = !labelledById && !title ? name : undefined;
22241
+ var titleId = title ? "checkboxlabel-".concat(name) : undefined;
22242
+ var ariaLabelledById = labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
22243
+ var ariaLabel = ariaLabelledById ? undefined : name;
22246
22244
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22247
22245
  ref: ref,
22248
22246
  padding: "0",
22247
+ tabIndex: "0",
22248
+ role: "checkbox",
22249
+ "aria-checked": checked,
22250
+ "aria-required": isRequired || undefined,
22251
+ "aria-invalid": error,
22252
+ "aria-label": ariaLabel,
22253
+ "aria-labelledby": ariaLabelledById,
22254
+ "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22255
+ onFocus: function onFocus() {
22256
+ return setFocused(true);
22257
+ },
22258
+ onBlur: function onBlur() {
22259
+ return setFocused(false);
22260
+ },
22261
+ onKeyDown: function onKeyDown(e) {
22262
+ return handleClick(e, onChange);
22263
+ },
22249
22264
  hiddenStyles: hidden,
22250
22265
  background: themeValues.backgroundColor,
22251
- extraStyles: "\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22266
+ extraStyles: "\n :focus {\n outline: 0;\n }\n ".concat(extraStyles, "; \n margin: ").concat(checkboxMargin, ";\n ")
22252
22267
  }, rest), /*#__PURE__*/React__default.createElement(CheckboxLabelContainer, {
22253
- htmlFor: checkboxId,
22254
22268
  "data-qa": dataQa
22255
22269
  }, /*#__PURE__*/React__default.createElement(CheckboxContainer, {
22256
22270
  "data-qa": "Checkbox"
22257
22271
  }, /*#__PURE__*/React__default.createElement(HiddenCheckbox, {
22258
- id: checkboxId,
22272
+ id: "checkbox-".concat(name),
22259
22273
  disabled: disabled,
22260
22274
  name: name,
22261
22275
  checked: checked,
22262
22276
  onChange: onChange,
22263
- tabIndex: "0",
22277
+ tabIndex: "-1",
22264
22278
  required: isRequired,
22265
- "aria-invalid": error,
22266
- "aria-label": ariaLabel,
22267
- "aria-labelledby": labelledById,
22268
- "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22269
- onKeyDown: function onKeyDown(e) {
22270
- return handleClick(e, onChange);
22271
- },
22272
- onFocus: function onFocus() {
22273
- return setFocused(true);
22274
- },
22275
- onBlur: function onBlur() {
22276
- return setFocused(false);
22277
- }
22279
+ "aria-hidden": "true"
22278
22280
  }), /*#__PURE__*/React__default.createElement(StyledCheckbox, {
22279
22281
  "aria-hidden": "true",
22280
22282
  error: error,
@@ -47168,7 +47170,7 @@ var PartialAmountField = function PartialAmountField(_ref) {
47168
47170
  extraStyles: "display: block;",
47169
47171
  variant: themeValues.detailVariant,
47170
47172
  weight: "400"
47171
- }, lineItem.subDescription))),
47173
+ }, lineItem.subDescription, " payment amount"))),
47172
47174
  key: lineItem.id,
47173
47175
  field: field,
47174
47176
  fieldActions: fieldActions,
@@ -47180,6 +47182,7 @@ var PartialAmountField = function PartialAmountField(_ref) {
47180
47182
  placeholder: "$0.00",
47181
47183
  formatter: moneyFormat,
47182
47184
  isNum: true,
47185
+ isRequired: true,
47183
47186
  decorator: /*#__PURE__*/React__default.createElement(Text$1, {
47184
47187
  variant: "p"
47185
47188
  }, "Amount owed:", " ", /*#__PURE__*/React__default.createElement(Text$1, {
@@ -48452,7 +48455,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48452
48455
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48453
48456
  name: "bank checkbox",
48454
48457
  dataQa: "Save checking account to wallet",
48455
- title: "Save checking account to wallet (optional).",
48458
+ title: "Save checking account to wallet.",
48456
48459
  checked: walletCheckboxMarked,
48457
48460
  onChange: saveToWallet
48458
48461
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {
@@ -48641,7 +48644,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48641
48644
  }, showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48642
48645
  name: "credit card checkbox",
48643
48646
  dataQa: "Save credit card to wallet",
48644
- title: "Save credit card to wallet (optional).",
48647
+ title: "Save credit card to wallet.",
48645
48648
  checked: walletCheckboxMarked,
48646
48649
  onChange: saveToWallet
48647
48650
  }), showTerms && /*#__PURE__*/React__default.createElement(Cover, {