@thecb/components 12.1.0-beta.6 → 12.1.0-beta.8

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
@@ -22242,8 +22242,9 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
22242
22242
  var normalizedName = name ? name.replace(/\s+/g, "-") : name;
22243
22243
  var checkboxId = "checkbox-".concat(normalizedName);
22244
22244
  var titleId = title ? "checkboxlabel-".concat(normalizedName) : undefined;
22245
- // aria-label fallback when no visible title or external labelledById is provided
22246
- var ariaLabel = !labelledById && !title ? name : undefined;
22245
+ // aria-label: customAriaLabel wins, but only when no external labelledById is provided
22246
+ // (aria-labelledby takes precedence per spec, so aria-label would be silently ignored)
22247
+ var resolvedAriaLabel = labelledById ? undefined : customAriaLabel || (!title ? name : undefined);
22247
22248
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22248
22249
  ref: ref,
22249
22250
  padding: "0",
@@ -22264,7 +22265,7 @@ var Checkbox = /*#__PURE__*/React.forwardRef(function (_ref5, ref) {
22264
22265
  tabIndex: "0",
22265
22266
  required: isRequired,
22266
22267
  "aria-invalid": error,
22267
- "aria-label": customAriaLabel || ariaLabel,
22268
+ "aria-label": resolvedAriaLabel,
22268
22269
  "aria-labelledby": labelledById,
22269
22270
  "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22270
22271
  onKeyDown: function onKeyDown(e) {
@@ -44857,7 +44858,10 @@ var Modal$1 = function Modal(_ref) {
44857
44858
  _ref$initialFocusSele = _ref.initialFocusSelector,
44858
44859
  initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
44859
44860
  _ref$blurUnderlay = _ref.blurUnderlay,
44860
- blurUnderlay = _ref$blurUnderlay === void 0 ? true : _ref$blurUnderlay;
44861
+ blurUnderlay = _ref$blurUnderlay === void 0 ? true : _ref$blurUnderlay,
44862
+ _ref$controlLabel = _ref.controlLabel,
44863
+ controlLabel = _ref$controlLabel === void 0 ? "" : _ref$controlLabel,
44864
+ _ref$controlExtraStyl = _ref.controlExtraStyles;
44861
44865
  var _useContext = React.useContext(styled.ThemeContext),
44862
44866
  isMobile = _useContext.isMobile;
44863
44867
 
@@ -44877,7 +44881,11 @@ var Modal$1 = function Modal(_ref) {
44877
44881
  return /*#__PURE__*/React__default.createElement("div", {
44878
44882
  ref: modalContainerRef,
44879
44883
  tabIndex: "-1",
44880
- "data-qa": dataQa
44884
+ "data-qa": dataQa,
44885
+ style: {
44886
+ display: "inline"
44887
+ },
44888
+ "aria-label": controlLabel
44881
44889
  }, modalOpen && /*#__PURE__*/React__default.createElement(reactAriaModal, {
44882
44890
  focusTrapOptions: {
44883
44891
  // fallback to resolve Jest unit test errors when tabbable doesn't exist in jsdom https://github.com/focus-trap/focus-trap-react/issues/91
@@ -48110,7 +48118,12 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
48110
48118
  linkVariant = _ref$linkVariant === void 0 ? "p" : _ref$linkVariant,
48111
48119
  themeValues = _ref.themeValues,
48112
48120
  _ref$initialFocusSele = _ref.initialFocusSelector,
48113
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
48121
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
48122
+ _ref$linkExtraStyles = _ref.linkExtraStyles,
48123
+ linkExtraStyles = _ref$linkExtraStyles === void 0 ? "" : _ref$linkExtraStyles,
48124
+ modalControlLabel = _ref.modalControlLabel,
48125
+ _ref$modalControlExtr = _ref.modalControlExtraStyles,
48126
+ modalControlExtraStyles = _ref$modalControlExtr === void 0 ? "" : _ref$modalControlExtr;
48114
48127
  return /*#__PURE__*/React__default.createElement(Modal$3, {
48115
48128
  modalOpen: isOpen,
48116
48129
  hideModal: function hideModal() {
@@ -48137,7 +48150,9 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
48137
48150
  toggleAccepted(true);
48138
48151
  toggleOpen(false);
48139
48152
  },
48140
- initialFocusSelector: initialFocusSelector
48153
+ initialFocusSelector: initialFocusSelector,
48154
+ controlLabel: modalControlLabel,
48155
+ controlExtraStyles: modalControlExtraStyles
48141
48156
  }, /*#__PURE__*/React__default.createElement(Text$1, {
48142
48157
  variant: linkVariant,
48143
48158
  onClick: function onClick() {
@@ -48151,7 +48166,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
48151
48166
  weight: themeValues.fontWeight,
48152
48167
  hoverStyles: themeValues.modalLinkHoverFocus,
48153
48168
  textDecoration: themeValues.modalLinkTextDecoration,
48154
- extraStyles: "display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px;",
48169
+ extraStyles: "display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px; ".concat(linkExtraStyles),
48155
48170
  role: "button" // This should always be a "button" since it opens a modal
48156
48171
  ,
48157
48172
  className: "modal-trigger"
@@ -48463,16 +48478,22 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48463
48478
  name: "bank checkbox",
48464
48479
  dataQa: "Save checking account to wallet",
48465
48480
  customAriaLabel: "Save checking account to wallet (optional).",
48466
- title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save checking account to wallet (optional).", " ", showTerms && /*#__PURE__*/React__default.createElement("span", {
48481
+ title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", null, "Save checking account to wallet (optional). "), showTerms && /*#__PURE__*/React__default.createElement("span", {
48467
48482
  onClick: function onClick(e) {
48468
48483
  return e.stopPropagation();
48484
+ },
48485
+ style: {
48486
+ display: "inline"
48469
48487
  }
48470
48488
  }, "View", " ", /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
48471
48489
  link: "Terms and Conditions",
48472
48490
  terms: termsContent,
48473
48491
  isOpen: showTermsModal,
48474
48492
  toggleOpen: toggleTermsModal,
48475
- initialFocusSelector: ".modal-close-button"
48493
+ initialFocusSelector: ".modal-close-button",
48494
+ linkExtraStyles: "display: inline;",
48495
+ modalControlLabel: "View Terms and Conditions",
48496
+ modalControlExtraStyles: "display: inline;"
48476
48497
  }))),
48477
48498
  checked: walletCheckboxMarked,
48478
48499
  onChange: saveToWallet
@@ -48668,16 +48689,22 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48668
48689
  name: "credit card checkbox",
48669
48690
  dataQa: "Save credit card to wallet",
48670
48691
  customAriaLabel: "Save credit card to wallet (optional).",
48671
- title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save credit card to wallet (optional).", " ", showTerms && /*#__PURE__*/React__default.createElement("span", {
48692
+ title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("span", null, "Save credit card to wallet (optional). "), showTerms && /*#__PURE__*/React__default.createElement("span", {
48672
48693
  onClick: function onClick(e) {
48673
48694
  return e.stopPropagation();
48695
+ },
48696
+ style: {
48697
+ display: "inline-block"
48674
48698
  }
48675
48699
  }, "View", " ", /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
48676
48700
  link: "Terms and Conditions",
48677
48701
  terms: termsContent,
48678
48702
  isOpen: showTermsModal,
48679
48703
  toggleOpen: toggleTermsModal,
48680
- initialFocusSelector: ".modal-close-button"
48704
+ initialFocusSelector: ".modal-close-button",
48705
+ linkExtraStyles: "display: inline;",
48706
+ modalControlLabel: "View Terms and Conditions",
48707
+ modalControlExtraStyles: "display: inline;"
48681
48708
  }))),
48682
48709
  checked: walletCheckboxMarked,
48683
48710
  onChange: saveToWallet