@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 +39 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +39 -12
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +6 -3
- package/src/components/atoms/checkbox/Checkbox.stories.js +1 -1
- package/src/components/molecules/modal/ModalControlV1.js +10 -2
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +8 -3
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +9 -3
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +7 -2
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
|
|
22238
|
-
|
|
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":
|
|
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
|
|
@@ -48102,7 +48110,12 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
|
|
|
48102
48110
|
linkVariant = _ref$linkVariant === void 0 ? "p" : _ref$linkVariant,
|
|
48103
48111
|
themeValues = _ref.themeValues,
|
|
48104
48112
|
_ref$initialFocusSele = _ref.initialFocusSelector,
|
|
48105
|
-
initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele
|
|
48113
|
+
initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele,
|
|
48114
|
+
_ref$linkExtraStyles = _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;
|
|
48106
48119
|
return /*#__PURE__*/React__default.createElement(Modal$3, {
|
|
48107
48120
|
modalOpen: isOpen,
|
|
48108
48121
|
hideModal: function hideModal() {
|
|
@@ -48129,7 +48142,9 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
|
|
|
48129
48142
|
toggleAccepted(true);
|
|
48130
48143
|
toggleOpen(false);
|
|
48131
48144
|
},
|
|
48132
|
-
initialFocusSelector: initialFocusSelector
|
|
48145
|
+
initialFocusSelector: initialFocusSelector,
|
|
48146
|
+
controlLabel: modalControlLabel,
|
|
48147
|
+
controlExtraStyles: modalControlExtraStyles
|
|
48133
48148
|
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48134
48149
|
variant: linkVariant,
|
|
48135
48150
|
onClick: function onClick() {
|
|
@@ -48143,7 +48158,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
|
|
|
48143
48158
|
weight: themeValues.fontWeight,
|
|
48144
48159
|
hoverStyles: themeValues.modalLinkHoverFocus,
|
|
48145
48160
|
textDecoration: themeValues.modalLinkTextDecoration,
|
|
48146
|
-
extraStyles: "display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px;",
|
|
48161
|
+
extraStyles: "display: inline-block; width: fit-content; cursor: pointer; min-height: 24px; line-height: 24px; ".concat(linkExtraStyles),
|
|
48147
48162
|
role: "button" // This should always be a "button" since it opens a modal
|
|
48148
48163
|
,
|
|
48149
48164
|
className: "modal-trigger"
|
|
@@ -48455,16 +48470,22 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
48455
48470
|
name: "bank checkbox",
|
|
48456
48471
|
dataQa: "Save checking account to wallet",
|
|
48457
48472
|
customAriaLabel: "Save checking account to wallet (optional).",
|
|
48458
|
-
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save checking account to wallet (optional).
|
|
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", {
|
|
48459
48474
|
onClick: function onClick(e) {
|
|
48460
48475
|
return e.stopPropagation();
|
|
48476
|
+
},
|
|
48477
|
+
style: {
|
|
48478
|
+
display: "inline"
|
|
48461
48479
|
}
|
|
48462
48480
|
}, "View", " ", /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
|
|
48463
48481
|
link: "Terms and Conditions",
|
|
48464
48482
|
terms: termsContent,
|
|
48465
48483
|
isOpen: showTermsModal,
|
|
48466
48484
|
toggleOpen: toggleTermsModal,
|
|
48467
|
-
initialFocusSelector: ".modal-close-button"
|
|
48485
|
+
initialFocusSelector: ".modal-close-button",
|
|
48486
|
+
linkExtraStyles: "display: inline;",
|
|
48487
|
+
modalControlLabel: "View Terms and Conditions",
|
|
48488
|
+
modalControlExtraStyles: "display: inline;"
|
|
48468
48489
|
}))),
|
|
48469
48490
|
checked: walletCheckboxMarked,
|
|
48470
48491
|
onChange: saveToWallet
|
|
@@ -48660,16 +48681,22 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48660
48681
|
name: "credit card checkbox",
|
|
48661
48682
|
dataQa: "Save credit card to wallet",
|
|
48662
48683
|
customAriaLabel: "Save credit card to wallet (optional).",
|
|
48663
|
-
title: /*#__PURE__*/React__default.createElement(React__default.Fragment, null, "Save credit card to wallet (optional).
|
|
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", {
|
|
48664
48685
|
onClick: function onClick(e) {
|
|
48665
48686
|
return e.stopPropagation();
|
|
48687
|
+
},
|
|
48688
|
+
style: {
|
|
48689
|
+
display: "inline-block"
|
|
48666
48690
|
}
|
|
48667
48691
|
}, "View", " ", /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
|
|
48668
48692
|
link: "Terms and Conditions",
|
|
48669
48693
|
terms: termsContent,
|
|
48670
48694
|
isOpen: showTermsModal,
|
|
48671
48695
|
toggleOpen: toggleTermsModal,
|
|
48672
|
-
initialFocusSelector: ".modal-close-button"
|
|
48696
|
+
initialFocusSelector: ".modal-close-button",
|
|
48697
|
+
linkExtraStyles: "display: inline;",
|
|
48698
|
+
modalControlLabel: "View Terms and Conditions",
|
|
48699
|
+
modalControlExtraStyles: "display: inline;"
|
|
48673
48700
|
}))),
|
|
48674
48701
|
checked: walletCheckboxMarked,
|
|
48675
48702
|
onChange: saveToWallet
|