@mxenabled/connect-widget 0.13.0 → 0.13.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.es.js CHANGED
@@ -78674,6 +78674,7 @@ const RoutingNumber = (props) => {
78674
78674
  }
78675
78675
  };
78676
78676
  const containerRef = useRef(null);
78677
+ const routingNumberInputRef = useRef(null);
78677
78678
  useAnalyticsPath(...PageviewInfo.CONNECT_MICRODEPOSITS_ROUTING_NUMBER);
78678
78679
  const tokens = useTokens();
78679
78680
  const styles = getStyles$r(tokens);
@@ -78746,6 +78747,11 @@ const RoutingNumber = (props) => {
78746
78747
  useEffect(() => {
78747
78748
  if (institutions.length > 0) props.setShowSharedRoutingNumber(true);
78748
78749
  }, [institutions.length]);
78750
+ useEffect(() => {
78751
+ if (errors.routingNumber) {
78752
+ routingNumberInputRef.current.focus();
78753
+ }
78754
+ }, [errors]);
78749
78755
  const handleContinue = (newAccountDetails) => fadeOut(containerRef.current, "up", 300).then(() => onContinue(newAccountDetails));
78750
78756
  if (showFindDetails) {
78751
78757
  return /* @__PURE__ */ jsxRuntimeExports.jsx(FindAccountInfo, { onClose: () => setShowFindDetails(false), step: "routingNumber" });
@@ -78793,7 +78799,11 @@ const RoutingNumber = (props) => {
78793
78799
  error: !!errors.routingNumber || !!routingBlocked,
78794
78800
  fullWidth: true,
78795
78801
  helperText: errors.routingNumber ?? routingBlocked,
78796
- inputProps: { "data-test": "routing-number-input" },
78802
+ inputProps: {
78803
+ "data-test": "routing-number-input",
78804
+ "aria-describedby": errors.routingNumber ? "routingNumber-error" : void 0
78805
+ },
78806
+ inputRef: routingNumberInputRef,
78797
78807
  label: __("Routing number"),
78798
78808
  name: "routingNumber",
78799
78809
  onChange: handleTextInputChange,
@@ -79572,6 +79582,8 @@ const reducer$3 = (state, action) => {
79572
79582
  };
79573
79583
  const VerifyDeposits = ({ microdeposit, onSuccess }) => {
79574
79584
  const containerRef = useRef(null);
79585
+ const firstInputRef = useRef(null);
79586
+ const secondInputRef = useRef(null);
79575
79587
  useAnalyticsPath(...PageviewInfo.CONNECT_MICRODEPOSITS_VERIFY_DEPOSITS);
79576
79588
  const { api } = useApi();
79577
79589
  const initialForm = { firstAmount: "", secondAmount: "" };
@@ -79613,6 +79625,13 @@ const VerifyDeposits = ({ microdeposit, onSuccess }) => {
79613
79625
  );
79614
79626
  return () => subscription.unsubscribe();
79615
79627
  }, [state.isSubmitting]);
79628
+ useEffect(() => {
79629
+ if (errors.firstAmount) {
79630
+ firstInputRef.current.focus();
79631
+ } else if (errors.secondAmount) {
79632
+ secondInputRef.current.focus();
79633
+ }
79634
+ }, [errors]);
79616
79635
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: containerRef, children: [
79617
79636
  /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: styles.header, children: [
79618
79637
  /* @__PURE__ */ jsxRuntimeExports.jsx(x, { "data-test": "title-header", style: styles.title, truncate: false, variant: "H2", children: __("Enter deposit amounts") }),
@@ -79651,7 +79670,11 @@ const VerifyDeposits = ({ microdeposit, onSuccess }) => {
79651
79670
  error: !!errors.firstAmount,
79652
79671
  helperText: errors.firstAmount,
79653
79672
  id: schema.firstAmount.label,
79654
- inputProps: { "data-test": "amount-1-input" },
79673
+ inputProps: {
79674
+ "data-test": "amount-1-input",
79675
+ "aria-describedby": errors.firstAmount ? "firstAmount-error" : void 0
79676
+ },
79677
+ inputRef: firstInputRef,
79655
79678
  label: schema.firstAmount.label,
79656
79679
  name: "firstAmount",
79657
79680
  onChange: handleTextInputChange,
@@ -79667,7 +79690,11 @@ const VerifyDeposits = ({ microdeposit, onSuccess }) => {
79667
79690
  error: !!errors.secondAmount,
79668
79691
  helperText: errors.secondAmount,
79669
79692
  id: schema.secondAmount.label,
79670
- inputProps: { "data-test": "amount-2-input" },
79693
+ inputProps: {
79694
+ "data-test": "amount-2-input",
79695
+ "aria-describedby": errors.secondAmount ? "secondAmount-error" : void 0
79696
+ },
79697
+ inputRef: secondInputRef,
79671
79698
  label: schema.secondAmount.label,
79672
79699
  name: "secondAmount",
79673
79700
  onChange: handleTextInputChange,