@thecb/components 12.1.0-beta.7 → 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.esm.js CHANGED
@@ -22234,8 +22234,9 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22234
22234
  var normalizedName = name ? name.replace(/\s+/g, "-") : name;
22235
22235
  var checkboxId = "checkbox-".concat(normalizedName);
22236
22236
  var titleId = title ? "checkboxlabel-".concat(normalizedName) : undefined;
22237
- // aria-label fallback when no visible title or external labelledById is provided
22238
- var ariaLabel = !labelledById && !title ? name : undefined;
22237
+ // aria-label: customAriaLabel wins, but only when no external labelledById is provided
22238
+ // (aria-labelledby takes precedence per spec, so aria-label would be silently ignored)
22239
+ var resolvedAriaLabel = labelledById ? undefined : customAriaLabel || (!title ? name : undefined);
22239
22240
  return /*#__PURE__*/React__default.createElement(Box, _extends({
22240
22241
  ref: ref,
22241
22242
  padding: "0",
@@ -22256,7 +22257,7 @@ var Checkbox = /*#__PURE__*/forwardRef(function (_ref5, ref) {
22256
22257
  tabIndex: "0",
22257
22258
  required: isRequired,
22258
22259
  "aria-invalid": error,
22259
- "aria-label": customAriaLabel || ariaLabel,
22260
+ "aria-label": resolvedAriaLabel,
22260
22261
  "aria-labelledby": labelledById,
22261
22262
  "aria-describedby": error ? "".concat(name, "-error-message") : undefined,
22262
22263
  onKeyDown: function onKeyDown(e) {
@@ -44849,7 +44850,10 @@ var Modal$1 = function Modal(_ref) {
44849
44850
  _ref$initialFocusSele = _ref.initialFocusSelector,
44850
44851
  initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
44851
44852
  _ref$blurUnderlay = _ref.blurUnderlay,
44852
- blurUnderlay = _ref$blurUnderlay === void 0 ? true : _ref$blurUnderlay;
44853
+ blurUnderlay = _ref$blurUnderlay === void 0 ? true : _ref$blurUnderlay,
44854
+ _ref$controlLabel = _ref.controlLabel,
44855
+ controlLabel = _ref$controlLabel === void 0 ? "" : _ref$controlLabel,
44856
+ _ref$controlExtraStyl = _ref.controlExtraStyles;
44853
44857
  var _useContext = useContext(ThemeContext),
44854
44858
  isMobile = _useContext.isMobile;
44855
44859
 
@@ -44869,7 +44873,11 @@ var Modal$1 = function Modal(_ref) {
44869
44873
  return /*#__PURE__*/React__default.createElement("div", {
44870
44874
  ref: modalContainerRef,
44871
44875
  tabIndex: "-1",
44872
- "data-qa": dataQa
44876
+ "data-qa": dataQa,
44877
+ style: {
44878
+ display: "inline"
44879
+ },
44880
+ "aria-label": controlLabel
44873
44881
  }, modalOpen && /*#__PURE__*/React__default.createElement(reactAriaModal, {
44874
44882
  focusTrapOptions: {
44875
44883
  // fallback to resolve Jest unit test errors when tabbable doesn't exist in jsdom https://github.com/focus-trap/focus-trap-react/issues/91
@@ -48104,7 +48112,10 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
48104
48112
  _ref$initialFocusSele = _ref.initialFocusSelector,
48105
48113
  initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
48106
48114
  _ref$linkExtraStyles = _ref.linkExtraStyles,
48107
- linkExtraStyles = _ref$linkExtraStyles === void 0 ? "" : _ref$linkExtraStyles;
48115
+ linkExtraStyles = _ref$linkExtraStyles === void 0 ? "" : _ref$linkExtraStyles,
48116
+ modalControlLabel = _ref.modalControlLabel,
48117
+ _ref$modalControlExtr = _ref.modalControlExtraStyles,
48118
+ modalControlExtraStyles = _ref$modalControlExtr === void 0 ? "" : _ref$modalControlExtr;
48108
48119
  return /*#__PURE__*/React__default.createElement(Modal$3, {
48109
48120
  modalOpen: isOpen,
48110
48121
  hideModal: function hideModal() {
@@ -48131,7 +48142,9 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
48131
48142
  toggleAccepted(true);
48132
48143
  toggleOpen(false);
48133
48144
  },
48134
- initialFocusSelector: initialFocusSelector
48145
+ initialFocusSelector: initialFocusSelector,
48146
+ controlLabel: modalControlLabel,
48147
+ controlExtraStyles: modalControlExtraStyles
48135
48148
  }, /*#__PURE__*/React__default.createElement(Text$1, {
48136
48149
  variant: linkVariant,
48137
48150
  onClick: function onClick() {
@@ -48457,9 +48470,12 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48457
48470
  name: "bank checkbox",
48458
48471
  dataQa: "Save checking account to wallet",
48459
48472
  customAriaLabel: "Save checking account to wallet (optional).",
48460
- title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save checking account to wallet (optional).", " ", showTerms && /*#__PURE__*/React__default.createElement("span", {
48473
+ 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", {
48461
48474
  onClick: function onClick(e) {
48462
48475
  return e.stopPropagation();
48476
+ },
48477
+ style: {
48478
+ display: "inline"
48463
48479
  }
48464
48480
  }, "View", " ", /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
48465
48481
  link: "Terms and Conditions",
@@ -48467,7 +48483,9 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48467
48483
  isOpen: showTermsModal,
48468
48484
  toggleOpen: toggleTermsModal,
48469
48485
  initialFocusSelector: ".modal-close-button",
48470
- linkExtraStyles: "display: inline-block;"
48486
+ linkExtraStyles: "display: inline;",
48487
+ modalControlLabel: "View Terms and Conditions",
48488
+ modalControlExtraStyles: "display: inline;"
48471
48489
  }))),
48472
48490
  checked: walletCheckboxMarked,
48473
48491
  onChange: saveToWallet
@@ -48663,9 +48681,12 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48663
48681
  name: "credit card checkbox",
48664
48682
  dataQa: "Save credit card to wallet",
48665
48683
  customAriaLabel: "Save credit card to wallet (optional).",
48666
- title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save credit card to wallet (optional).", " ", showTerms && /*#__PURE__*/React__default.createElement("span", {
48684
+ 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", {
48667
48685
  onClick: function onClick(e) {
48668
48686
  return e.stopPropagation();
48687
+ },
48688
+ style: {
48689
+ display: "inline-block"
48669
48690
  }
48670
48691
  }, "View", " ", /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
48671
48692
  link: "Terms and Conditions",
@@ -48673,7 +48694,9 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48673
48694
  isOpen: showTermsModal,
48674
48695
  toggleOpen: toggleTermsModal,
48675
48696
  initialFocusSelector: ".modal-close-button",
48676
- linkExtraStyles: "display: inline-block;"
48697
+ linkExtraStyles: "display: inline;",
48698
+ modalControlLabel: "View Terms and Conditions",
48699
+ modalControlExtraStyles: "display: inline;"
48677
48700
  }))),
48678
48701
  checked: walletCheckboxMarked,
48679
48702
  onChange: saveToWallet