@thecb/components 9.0.4-beta.1 → 9.0.4-beta.3

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
@@ -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 ? null : _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, {
@@ -18808,7 +18814,7 @@ var Alert = function Alert(_ref) {
18808
18814
  minHeight: "100%",
18809
18815
  onClick: onLinkClick
18810
18816
  }, /*#__PURE__*/React__default.createElement(IconQuit, null))))));
18811
- return /*#__PURE__*/React__default.createElement(Box, {
18817
+ return /*#__PURE__*/React__default.createElement(Box, _extends({
18812
18818
  padding: padding,
18813
18819
  width: "100%",
18814
18820
  minHeight: height && parseInt(height) < 100 ? height : "100px",
@@ -18818,10 +18824,14 @@ var Alert = function Alert(_ref) {
18818
18824
  borderColor: themeValues.border,
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
- extraStyles: extraStyles,
18822
- role: "alert",
18823
- "aria-atomic": true
18824
- }, maxContentWidth ? /*#__PURE__*/React__default.createElement(Center, {
18827
+ extraStyles: extraStyles
18828
+ }, ariaAtomic !== null ? {
18829
+ "aria-atomic": ariaAtomic
18830
+ } : {}, ariaLive !== null ? {
18831
+ "aria-live": ariaLive
18832
+ } : {}, ariaRole !== null ? {
18833
+ role: ariaRole
18834
+ } : {}), maxContentWidth ? /*#__PURE__*/React__default.createElement(Center, {
18825
18835
  maxWidth: maxContentWidth
18826
18836
  }, content) : content);
18827
18837
  };
@@ -26048,7 +26058,8 @@ var FormInput = function FormInput(_ref15) {
26048
26058
  $customHeight: customHeight,
26049
26059
  $extraStyles: extraStyles,
26050
26060
  "data-qa": dataQa || labelTextWhenNoError,
26051
- autoComplete: autocompleteValue
26061
+ autoComplete: autocompleteValue,
26062
+ "aria-busy": true
26052
26063
  }, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
26053
26064
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26054
26065
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
@@ -26067,23 +26078,25 @@ var FormInput = function FormInput(_ref15) {
26067
26078
  $customHeight: customHeight,
26068
26079
  $extraStyles: extraStyles,
26069
26080
  "data-qa": dataQa || labelTextWhenNoError,
26070
- autoComplete: autocompleteValue
26071
- }, props))), /*#__PURE__*/React__default.createElement(Stack, {
26072
- direction: "row",
26073
- justify: "space-between",
26074
- "aria-live": "polite",
26081
+ autoComplete: autocompleteValue,
26082
+ "aria-busy": true
26083
+ }, props))), /*#__PURE__*/React__default.createElement("div", {
26084
+ role: "status",
26075
26085
  "aria-atomic": true
26086
+ }, /*#__PURE__*/React__default.createElement(Stack, {
26087
+ direction: "row",
26088
+ justify: "space-between"
26076
26089
  }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
26077
26090
  color: ERROR_COLOR,
26078
26091
  variant: "pXS",
26079
26092
  weight: themeValues.fontWeight,
26080
- extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
26093
+ extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
26081
26094
  id: createIdFromString(labelTextWhenNoError, "error message")
26082
26095
  }, errorMessages[field.errors[0]]) : /*#__PURE__*/React__default.createElement(Text$1, {
26083
26096
  extraStyles: "height: ".concat(themeValues.lineHeight, ";")
26084
26097
  }), !isMobile && decorator && /*#__PURE__*/React__default.createElement(Box, {
26085
26098
  padding: "0 0 0 auto"
26086
- }, decorator)));
26099
+ }, decorator))));
26087
26100
  };
26088
26101
 
26089
26102
  var FormInput$1 = themeComponent(FormInput, "FormInput", fallbackValues$k, "default");
@@ -47859,13 +47872,6 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47859
47872
 
47860
47873
  var accountTypeErrors = _defineProperty({}, required.error, "Account type is required");
47861
47874
 
47862
- React.useEffect(function () {
47863
- var firstFocusableField = document.getElementById("first-focusable-ach-input");
47864
-
47865
- if (firstFocusableField) {
47866
- firstFocusableField.focus();
47867
- }
47868
- }, []);
47869
47875
  return /*#__PURE__*/React__default.createElement(FormContainer$1, {
47870
47876
  variant: variant,
47871
47877
  role: "form",
@@ -47880,8 +47886,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47880
47886
  onKeyDown: function onKeyDown(e) {
47881
47887
  return e.key === "Enter" && handleSubmit(e);
47882
47888
  },
47883
- autocompleteValue: "name",
47884
- id: "first-focusable-ach-input"
47889
+ autocompleteValue: "name"
47885
47890
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
47886
47891
  labelTextWhenNoError: "Routing number",
47887
47892
  dataQa: "Routing number",
@@ -48066,20 +48071,13 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48066
48071
 
48067
48072
  var nameOnCardErrors = _defineProperty({}, required.error, "Name is required");
48068
48073
 
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.")), _creditCardNumberErro);
48074
+ 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
48075
  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
48076
  var cvvErrors = (_cvvErrors = {}, _defineProperty(_cvvErrors, required.error, "CVV is required"), _defineProperty(_cvvErrors, hasLength.error, "CVV is invalid"), _cvvErrors);
48072
48077
  var zipCodeErrors = (_zipCodeErrors = {}, _defineProperty(_zipCodeErrors, required.error, "Zip code is required"), _defineProperty(_zipCodeErrors, hasLength.error, "Zip code is invalid"), _zipCodeErrors);
48073
48078
 
48074
48079
  var countryErrorMessages = _defineProperty({}, required.error, "Country is required");
48075
48080
 
48076
- React.useEffect(function () {
48077
- var firstFocusableField = document.getElementById("first-focusable-card-input");
48078
-
48079
- if (firstFocusableField) {
48080
- firstFocusableField.focus();
48081
- }
48082
- }, []);
48083
48081
  var isUS = fields.country.rawValue === "US";
48084
48082
  return /*#__PURE__*/React__default.createElement(FormContainer$1, {
48085
48083
  variant: variant,
@@ -48109,8 +48107,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48109
48107
  onKeyDown: function onKeyDown(e) {
48110
48108
  return e.key === "Enter" && handleSubmit(e);
48111
48109
  },
48112
- autocompleteValue: "cc-name",
48113
- id: "first-focusable-card-input"
48110
+ autocompleteValue: "cc-name"
48114
48111
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
48115
48112
  labelTextWhenNoError: "Credit card number",
48116
48113
  dataQa: "Credit card number",
@@ -48570,19 +48567,7 @@ var RadioSection = function RadioSection(_ref) {
48570
48567
  var _useState = React.useState(null),
48571
48568
  _useState2 = _slicedToArray(_useState, 2),
48572
48569
  focused = _useState2[0],
48573
- setFocused = _useState2[1]; // useEffect(() => {
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
-
48570
+ setFocused = _useState2[1];
48586
48571
 
48587
48572
  return /*#__PURE__*/React__default.createElement(Box, {
48588
48573
  padding: "1px",
@@ -48656,13 +48641,11 @@ var RadioSection = function RadioSection(_ref) {
48656
48641
  align: "center"
48657
48642
  }, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
48658
48643
  padding: section.titleIcon ? "0 0 0 8px" : "0"
48659
- }, /*#__PURE__*/React__default.createElement(Text$1, _extends({
48644
+ }, /*#__PURE__*/React__default.createElement(Text$1, {
48660
48645
  as: "label",
48661
48646
  htmlFor: "radio-input-".concat(idString(section)),
48662
48647
  color: CHARADE_GREY
48663
- }, _objectSpread2({}, section !== null && section !== void 0 && section.titleLabel ? {
48664
- "aria-label": section.titleLabel
48665
- } : {})), section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
48648
+ }, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
48666
48649
  childGap: "0.5rem",
48667
48650
  "aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
48668
48651
  role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null