@thecb/components 9.0.4-beta.1 → 9.0.4-beta.2
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 +29 -48
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +29 -48
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +7 -3
- package/src/components/atoms/form-layouts/FormInput.js +27 -25
- package/src/components/molecules/partial-amount-form/PartialAmountForm.js +1 -0
- package/src/components/molecules/partial-amount-form/PartialAmountForm.stories.js +146 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +0 -10
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -11
- package/src/components/molecules/radio-section/RadioSection.js +1 -19
- package/src/components/molecules/radio-section/RadioSection.stories.js +6 -420
package/dist/index.cjs.js
CHANGED
|
@@ -18762,7 +18762,13 @@ var Alert = function Alert(_ref) {
|
|
|
18762
18762
|
_ref$iconPadding = _ref.iconPadding,
|
|
18763
18763
|
iconPadding = _ref$iconPadding === void 0 ? "0 0 0 1rem" : _ref$iconPadding,
|
|
18764
18764
|
_ref$contentFullHeigh = _ref.contentFullHeight,
|
|
18765
|
-
contentFullHeight = _ref$contentFullHeigh === void 0 ? false : _ref$contentFullHeigh
|
|
18765
|
+
contentFullHeight = _ref$contentFullHeigh === void 0 ? false : _ref$contentFullHeigh,
|
|
18766
|
+
_ref$ariaRole = _ref.ariaRole,
|
|
18767
|
+
ariaRole = _ref$ariaRole === void 0 ? "group" : _ref$ariaRole,
|
|
18768
|
+
_ref$ariaAtomic = _ref.ariaAtomic,
|
|
18769
|
+
ariaAtomic = _ref$ariaAtomic === void 0 ? true : _ref$ariaAtomic,
|
|
18770
|
+
_ref$ariaLive = _ref.ariaLive,
|
|
18771
|
+
ariaLive = _ref$ariaLive === void 0 ? "polite" : _ref$ariaLive;
|
|
18766
18772
|
var Icon = AlertIcons[variant];
|
|
18767
18773
|
var contentPadding = maxContentWidth ? "".concat(padding, " 1rem") : innerContentPadding;
|
|
18768
18774
|
var content = /*#__PURE__*/React__default.createElement(Sidebar, {
|
|
@@ -18819,8 +18825,9 @@ var Alert = function Alert(_ref) {
|
|
|
18819
18825
|
borderSize: noBorder ? "0px" : "1px",
|
|
18820
18826
|
boxShadow: enableBoxShadow ? (_generateShadows = generateShadows()) === null || _generateShadows === void 0 ? void 0 : (_generateShadows$inse = _generateShadows.inset) === null || _generateShadows$inse === void 0 ? void 0 : _generateShadows$inse.base : "",
|
|
18821
18827
|
extraStyles: extraStyles,
|
|
18822
|
-
role:
|
|
18823
|
-
"aria-atomic":
|
|
18828
|
+
role: ariaRole,
|
|
18829
|
+
"aria-atomic": ariaAtomic,
|
|
18830
|
+
"aria-live": ariaLive
|
|
18824
18831
|
}, maxContentWidth ? /*#__PURE__*/React__default.createElement(Center, {
|
|
18825
18832
|
maxWidth: maxContentWidth
|
|
18826
18833
|
}, content) : content);
|
|
@@ -26048,7 +26055,8 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26048
26055
|
$customHeight: customHeight,
|
|
26049
26056
|
$extraStyles: extraStyles,
|
|
26050
26057
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26051
|
-
autoComplete: autocompleteValue
|
|
26058
|
+
autoComplete: autocompleteValue,
|
|
26059
|
+
"aria-busy": true
|
|
26052
26060
|
}, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
|
|
26053
26061
|
"aria-labelledby": createIdFromString(labelTextWhenNoError),
|
|
26054
26062
|
"aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
|
|
@@ -26067,23 +26075,25 @@ var FormInput = function FormInput(_ref15) {
|
|
|
26067
26075
|
$customHeight: customHeight,
|
|
26068
26076
|
$extraStyles: extraStyles,
|
|
26069
26077
|
"data-qa": dataQa || labelTextWhenNoError,
|
|
26070
|
-
autoComplete: autocompleteValue
|
|
26071
|
-
|
|
26072
|
-
|
|
26073
|
-
|
|
26074
|
-
"aria-live": "polite",
|
|
26078
|
+
autoComplete: autocompleteValue,
|
|
26079
|
+
"aria-busy": true
|
|
26080
|
+
}, props))), /*#__PURE__*/React__default.createElement("div", {
|
|
26081
|
+
role: "status",
|
|
26075
26082
|
"aria-atomic": true
|
|
26083
|
+
}, /*#__PURE__*/React__default.createElement(Stack, {
|
|
26084
|
+
direction: "row",
|
|
26085
|
+
justify: "space-between"
|
|
26076
26086
|
}, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26077
26087
|
color: ERROR_COLOR,
|
|
26078
26088
|
variant: "pXS",
|
|
26079
26089
|
weight: themeValues.fontWeight,
|
|
26080
|
-
extraStyles: "word-break: break-word;\n
|
|
26090
|
+
extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
|
|
26081
26091
|
id: createIdFromString(labelTextWhenNoError, "error message")
|
|
26082
26092
|
}, errorMessages[field.errors[0]]) : /*#__PURE__*/React__default.createElement(Text$1, {
|
|
26083
26093
|
extraStyles: "height: ".concat(themeValues.lineHeight, ";")
|
|
26084
26094
|
}), !isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
|
|
26085
26095
|
padding: "0 0 0 auto"
|
|
26086
|
-
}, decorator)));
|
|
26096
|
+
}, decorator))));
|
|
26087
26097
|
};
|
|
26088
26098
|
|
|
26089
26099
|
var FormInput$1 = themeComponent(FormInput, "FormInput", fallbackValues$k, "default");
|
|
@@ -46754,7 +46764,8 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
|
|
|
46754
46764
|
}, "Amount owed:", " ", /*#__PURE__*/React__default.createElement(Text$1, {
|
|
46755
46765
|
variant: "p",
|
|
46756
46766
|
weight: "600"
|
|
46757
|
-
}, displayCurrency(li.amount)))
|
|
46767
|
+
}, displayCurrency(li.amount))),
|
|
46768
|
+
"aria-busy": true
|
|
46758
46769
|
});
|
|
46759
46770
|
})));
|
|
46760
46771
|
};
|
|
@@ -47859,13 +47870,6 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47859
47870
|
|
|
47860
47871
|
var accountTypeErrors = _defineProperty({}, required.error, "Account type is required");
|
|
47861
47872
|
|
|
47862
|
-
React.useEffect(function () {
|
|
47863
|
-
var firstFocusableField = document.getElementById("first-focusable-ach-input");
|
|
47864
|
-
|
|
47865
|
-
if (firstFocusableField) {
|
|
47866
|
-
firstFocusableField.focus();
|
|
47867
|
-
}
|
|
47868
|
-
}, []);
|
|
47869
47873
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
47870
47874
|
variant: variant,
|
|
47871
47875
|
role: "form",
|
|
@@ -47880,8 +47884,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
|
|
|
47880
47884
|
onKeyDown: function onKeyDown(e) {
|
|
47881
47885
|
return e.key === "Enter" && handleSubmit(e);
|
|
47882
47886
|
},
|
|
47883
|
-
autocompleteValue: "name"
|
|
47884
|
-
id: "first-focusable-ach-input"
|
|
47887
|
+
autocompleteValue: "name"
|
|
47885
47888
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
47886
47889
|
labelTextWhenNoError: "Routing number",
|
|
47887
47890
|
dataQa: "Routing number",
|
|
@@ -48066,20 +48069,13 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48066
48069
|
|
|
48067
48070
|
var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
|
|
48068
48071
|
|
|
48069
|
-
var creditCardNumberErrors = (_creditCardNumberErro = {}, _defineProperty(_creditCardNumberErro, required.error, "Credit card number is required"), _defineProperty(_creditCardNumberErro, hasLength.error, "Credit card number is invalid"), _defineProperty(_creditCardNumberErro, matchesRegex.error, "".concat(displayCardBrand(fields.creditCardNumber.rawValue), " is not accepted
|
|
48072
|
+
var creditCardNumberErrors = (_creditCardNumberErro = {}, _defineProperty(_creditCardNumberErro, required.error, "Credit card number is required"), _defineProperty(_creditCardNumberErro, hasLength.error, "Credit card number is invalid"), _defineProperty(_creditCardNumberErro, matchesRegex.error, "".concat(displayCardBrand(fields.creditCardNumber.rawValue), " is not accepted")), _creditCardNumberErro);
|
|
48070
48073
|
var expirationDateErrors = (_expirationDateErrors = {}, _defineProperty(_expirationDateErrors, required.error, "Expiration date is required"), _defineProperty(_expirationDateErrors, hasLength.error, "Expiration date is invalid"), _defineProperty(_expirationDateErrors, isValidMonth.error, "Expiration month is invalid"), _defineProperty(_expirationDateErrors, dateAfterToday.error, "Expiration date is invalid"), _expirationDateErrors);
|
|
48071
48074
|
var cvvErrors = (_cvvErrors = {}, _defineProperty(_cvvErrors, required.error, "CVV is required"), _defineProperty(_cvvErrors, hasLength.error, "CVV is invalid"), _cvvErrors);
|
|
48072
48075
|
var zipCodeErrors = (_zipCodeErrors = {}, _defineProperty(_zipCodeErrors, required.error, "Zip code is required"), _defineProperty(_zipCodeErrors, hasLength.error, "Zip code is invalid"), _zipCodeErrors);
|
|
48073
48076
|
|
|
48074
48077
|
var countryErrorMessages = _defineProperty({}, required.error, "Country is required");
|
|
48075
48078
|
|
|
48076
|
-
React.useEffect(function () {
|
|
48077
|
-
var firstFocusableField = document.getElementById("first-focusable-card-input");
|
|
48078
|
-
|
|
48079
|
-
if (firstFocusableField) {
|
|
48080
|
-
firstFocusableField.focus();
|
|
48081
|
-
}
|
|
48082
|
-
}, []);
|
|
48083
48079
|
var isUS = fields.country.rawValue === "US";
|
|
48084
48080
|
return /*#__PURE__*/React__default.createElement(FormContainer$1, {
|
|
48085
48081
|
variant: variant,
|
|
@@ -48109,8 +48105,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
|
|
|
48109
48105
|
onKeyDown: function onKeyDown(e) {
|
|
48110
48106
|
return e.key === "Enter" && handleSubmit(e);
|
|
48111
48107
|
},
|
|
48112
|
-
autocompleteValue: "cc-name"
|
|
48113
|
-
id: "first-focusable-card-input"
|
|
48108
|
+
autocompleteValue: "cc-name"
|
|
48114
48109
|
}), /*#__PURE__*/React__default.createElement(FormInput$1, {
|
|
48115
48110
|
labelTextWhenNoError: "Credit card number",
|
|
48116
48111
|
dataQa: "Credit card number",
|
|
@@ -48570,19 +48565,7 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48570
48565
|
var _useState = React.useState(null),
|
|
48571
48566
|
_useState2 = _slicedToArray(_useState, 2),
|
|
48572
48567
|
focused = _useState2[0],
|
|
48573
|
-
setFocused = _useState2[1];
|
|
48574
|
-
// if (toggledContentRef && toggledContentRef?.current) {
|
|
48575
|
-
// const inputEl = toggledContentRef.current?.querySelector(
|
|
48576
|
-
// `[tabindex="0"]`
|
|
48577
|
-
// );
|
|
48578
|
-
// if (inputEl) {
|
|
48579
|
-
// inputEl?.focus();
|
|
48580
|
-
// } else {
|
|
48581
|
-
// toggledContentRef.current.focus();
|
|
48582
|
-
// }
|
|
48583
|
-
// }
|
|
48584
|
-
// }, [toggledContentRef.current]);
|
|
48585
|
-
|
|
48568
|
+
setFocused = _useState2[1];
|
|
48586
48569
|
|
|
48587
48570
|
return /*#__PURE__*/React__default.createElement(Box, {
|
|
48588
48571
|
padding: "1px",
|
|
@@ -48656,13 +48639,11 @@ var RadioSection = function RadioSection(_ref) {
|
|
|
48656
48639
|
align: "center"
|
|
48657
48640
|
}, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
|
|
48658
48641
|
padding: section.titleIcon ? "0 0 0 8px" : "0"
|
|
48659
|
-
}, /*#__PURE__*/React__default.createElement(Text$1,
|
|
48642
|
+
}, /*#__PURE__*/React__default.createElement(Text$1, {
|
|
48660
48643
|
as: "label",
|
|
48661
48644
|
htmlFor: "radio-input-".concat(idString(section)),
|
|
48662
48645
|
color: CHARADE_GREY
|
|
48663
|
-
},
|
|
48664
|
-
"aria-label": section.titleLabel
|
|
48665
|
-
} : {})), section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48646
|
+
}, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
|
|
48666
48647
|
childGap: "0.5rem",
|
|
48667
48648
|
"aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
|
|
48668
48649
|
role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null
|