@tesouro/embedded-components-react 0.11.116 → 0.11.119

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.
Files changed (48) hide show
  1. package/dist/index.css +81 -120
  2. package/dist/index.d.ts +4 -0
  3. package/dist/lib/AcceptDisclosuresWidget.d.ts +4 -0
  4. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +91 -88
  5. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +41 -59
  6. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +2 -0
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/AdditionalOwnersStep.js +7 -5
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +163 -160
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BusinessDetailsStep.js +18 -18
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/PersonalDetailsStep.js +25 -25
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/additionalOwnerDraft.js +34 -31
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/fieldInput/maxBirthDate.js +3 -2
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/personalDetailsPanelMapping.js +21 -18
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/testIds.js +3 -0
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +382 -275
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +2 -2
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +37 -42
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +56 -50
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index2.js +32 -69
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +3 -3
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +14 -25
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +36 -39
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +120 -116
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +14 -26
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +2 -2
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +41 -44
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index29.js +96 -115
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +14 -14
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index31.js +35 -57
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index33.js +37 -60
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index35.js +28 -42
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js +266 -259
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +51 -55
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js +42 -48
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +69 -70
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +2 -2
  39. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +3 -2
  41. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/ConsentBlock/ConsentBlock.js +51 -0
  42. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/EmptyState/EmptyState.js +5 -3
  43. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/InlineErrorAlert/InlineErrorAlert.js +1 -1
  44. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +84 -87
  45. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +1 -1
  46. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellStepper.js +35 -21
  47. package/dist/packages/shared-ui-shadcn/dist/index.js +29 -85
  48. package/package.json +1 -1
@@ -2,151 +2,154 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { personDisclosure as e } from "../../../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
6
- import { useAcceptWidgetDisclosures as t } from "../../../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
7
- import { useDisclosuresQuery as n } from "../../../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
8
- import { ErrorState as r } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
5
+ import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { personDisclosure as t } from "../../../../../shared/data-access/dist/lib/disclosures/personDisclosure.js";
7
+ import { useAcceptWidgetDisclosures as n } from "../../../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
8
+ import { useDisclosuresQuery as r } from "../../../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
9
+ import { EmbeddedToaster as i } from "../../../../../shared/ui/dist/lib/EmbeddedToaster.js";
10
+ import { ErrorState as a } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
9
11
  import "../../../../../shared/ui/dist/index.js";
10
- import { useAnalyticsTrack as i } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
11
- import { WidgetProvider as a } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
12
- import { useRefetchWidget as o, useWidgetConfig as s, useWidgetInitStaleForToken as c } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
+ import { useAnalyticsTrack as o } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
13
+ import { WidgetProvider as s } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
14
+ import { useRefetchWidget as c, useWidgetConfig as l, useWidgetInitStaleForToken as u } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
15
  import "../../../../../shared/feature/dist/index.js";
14
- import { AcceptDisclosuresWidgetAnalyticsEvent as l, WIDGET_NAME as u } from "../analytics/events.js";
15
- import { mergeAcceptDisclosuresWidgetLabels as d } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/labels.js";
16
- import { AcceptDisclosuresWidget as f } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
16
+ import { AcceptDisclosuresWidgetAnalyticsEvent as d, WIDGET_NAME as f } from "../analytics/events.js";
17
+ import { mergeAcceptDisclosuresWidgetLabels as p } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/labels.js";
18
+ import { AcceptDisclosuresWidget as m } from "../../../../ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
17
19
  import "../../../../ui/dist/index.js";
18
- import { resolveAcceptDisclosuresContent as p } from "./resolveAcceptDisclosuresContent.js";
19
- import { acceptDisclosuresWidgetTestIds as m } from "./testIds.js";
20
+ import { resolveAcceptDisclosuresContent as h } from "./resolveAcceptDisclosuresContent.js";
21
+ import { acceptDisclosuresWidgetTestIds as g } from "./testIds.js";
20
22
  import "../../../../data-access/dist/index.js";
21
- import { useCallback as h, useEffect as g, useRef as _, useState as v } from "react";
22
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
23
+ import { useCallback as _, useEffect as v, useRef as y, useState as b } from "react";
24
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
23
25
  // ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js
24
- function S(e, t, n) {
25
- return /* @__PURE__ */ x(y, { children: [
26
+ function w(e, t, n) {
27
+ return /* @__PURE__ */ C(x, { children: [
26
28
  n.providerAttributionPrefix,
27
- /* @__PURE__ */ b("strong", { children: e }),
29
+ /* @__PURE__ */ S("strong", { children: e }),
28
30
  n.providerAttributionMiddle,
29
31
  t,
30
32
  n.providerAttributionSuffix
31
33
  ] });
32
34
  }
33
- function C({ labels: t, onAccepted: a }) {
34
- let o = i(), { initResponse: u } = s(), f = c(), m = d(t), { data: h, isError: _, refetch: v } = n({ userId: u?.userId ?? void 0 });
35
- if (g(() => {
36
- o(l.Mounted);
37
- }, [o]), _) return /* @__PURE__ */ b(r, {
35
+ function T({ labels: e, onAccepted: n }) {
36
+ let s = o(), { initResponse: c } = l(), f = u(), m = p(e), { data: g, isError: _, refetch: y } = r({ userId: c?.userId ?? void 0 });
37
+ if (v(() => {
38
+ s(d.Mounted);
39
+ }, [s]), _) return /* @__PURE__ */ S(a, {
38
40
  title: m.loadErrorTitle,
39
41
  description: m.loadErrorFallback,
40
42
  retryLabel: m.loadErrorRetryLabel,
41
43
  onRetry: () => {
42
- v();
44
+ y();
43
45
  },
44
46
  testId: "accept-disclosures-load-error"
45
47
  });
46
- let y = e(h), x = p({
47
- documents: h ? y?.documents ?? [] : void 0,
48
- vspName: u?.vspName,
49
- bankName: u?.bankName,
50
- labels: t
48
+ let b = t(g), w = h({
49
+ documents: g ? b?.documents ?? [] : void 0,
50
+ vspName: c?.vspName,
51
+ bankName: c?.bankName,
52
+ labels: e
51
53
  });
52
- if (!x) return null;
53
- let S = y?.disclosureId ?? null;
54
+ if (!w) return null;
55
+ let T = b?.disclosureId ?? null;
54
56
  if (f) return null;
55
- let C = `${`user:${u?.userId ?? ""}`}:${S}:${x.vspName}:${x.bankName}:${x.agreementText}:${x.disclosureLinks.map((e) => e.href).join("|")}`;
56
- return /* @__PURE__ */ b(w, {
57
- displayedVersion: S,
58
- labelOverrides: t,
59
- content: x,
57
+ let D = `${`user:${c?.userId ?? ""}`}:${T}:${w.vspName}:${w.bankName}:${w.agreementText}:${w.disclosureLinks.map((e) => e.href).join("|")}`;
58
+ return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(i, {}), /* @__PURE__ */ S(E, {
59
+ displayedVersion: T,
60
+ labelOverrides: e,
61
+ content: w,
60
62
  labels: m,
61
- onAccepted: a,
62
- onDisclosuresVersionChanged: v
63
- }, C);
63
+ onAccepted: n,
64
+ onDisclosuresVersionChanged: y
65
+ }, D)] });
64
66
  }
65
- function w({ displayedVersion: e, labelOverrides: n, content: r, labels: i, onAccepted: a, onDisclosuresVersionChanged: s }) {
66
- let [c, l] = v(!1), [u, d] = v(), [p, g] = v(!1), [y, x] = v(!1), C = _(!1), { mutateAsync: w } = t(), T = o(), E = h((e) => {
67
- d(void 0), l(e);
68
- }, []), D = h(async () => {
69
- if (!(!c || p || y)) {
70
- d(void 0), g(!0);
67
+ function E({ displayedVersion: t, labelOverrides: r, content: i, labels: a, onAccepted: o, onDisclosuresVersionChanged: s }) {
68
+ let [l, u] = b(!1), [d, f] = b(), [p, h] = b(!1), [v, x] = b(!1), C = y(!1), { mutateAsync: T } = n(), E = c(), D = _((e) => {
69
+ f(void 0), u(e);
70
+ }, []), O = _(async () => {
71
+ if (!(!l || p || v)) {
72
+ f(void 0), h(!0);
71
73
  try {
72
74
  if (!C.current) try {
73
- await w({ displayedVersion: e }), C.current = !0;
75
+ await T({ displayedVersion: t }), C.current = !0;
74
76
  } catch (e) {
75
77
  if (e instanceof Error && e.name === "DisclosuresVersionChangedError") {
76
- d(i.disclosuresUpdatedFallback), s();
78
+ f(a.disclosuresUpdatedFallback), s();
77
79
  return;
78
80
  }
79
- d(i.acceptErrorFallback);
81
+ f(a.acceptErrorFallback);
80
82
  return;
81
83
  }
82
84
  try {
83
- await a?.();
85
+ await o?.();
84
86
  } catch {
85
- d(i.continuationErrorFallback);
87
+ f(a.continuationErrorFallback);
86
88
  return;
87
89
  }
88
- T(), x(!0);
90
+ E(), x(!0), e.success(a.successToast);
89
91
  } finally {
90
- g(!1);
92
+ h(!1);
91
93
  }
92
94
  }
93
95
  }, [
94
- w,
95
- e,
96
- y,
97
- c,
96
+ T,
97
+ t,
98
+ v,
99
+ l,
98
100
  p,
99
- i.acceptErrorFallback,
100
- i.continuationErrorFallback,
101
- i.disclosuresUpdatedFallback,
102
- a,
101
+ a.acceptErrorFallback,
102
+ a.continuationErrorFallback,
103
+ a.successToast,
104
+ a.disclosuresUpdatedFallback,
105
+ o,
103
106
  s,
104
- T
107
+ E
105
108
  ]);
106
- return /* @__PURE__ */ b(f, {
109
+ return /* @__PURE__ */ S(m, {
107
110
  labels: {
108
- ...n,
109
- title: r.title,
110
- agreementCheckboxAriaLabel: r.agreementCheckboxAriaLabel
111
+ ...r,
112
+ title: i.title,
113
+ agreementCheckboxAriaLabel: i.agreementCheckboxAriaLabel
111
114
  },
112
- providerAttribution: S(r.vspName, r.bankName, i),
113
- agreementText: r.agreementText,
114
- disclosureLinks: r.disclosureLinks,
115
- isAgreed: c,
116
- onAgreedChange: E,
115
+ providerAttribution: w(i.vspName, i.bankName, a),
116
+ agreementText: i.agreementText,
117
+ disclosureLinks: i.disclosureLinks,
118
+ isAgreed: l,
119
+ onAgreedChange: D,
117
120
  onAccept: () => {
118
- D();
121
+ O();
119
122
  },
120
123
  isSubmitting: p,
121
- isAccepted: y,
122
- errorMessage: u,
124
+ isAccepted: v,
125
+ errorMessage: d,
123
126
  testIds: {
124
- root: m.root,
125
- providerAttribution: m.providerAttribution,
126
- disclosureLinks: m.disclosureLinks,
127
- agreeCheckbox: m.agreeCheckbox,
128
- agreementText: m.agreementText,
129
- acceptButton: m.acceptButton,
130
- error: m.error
127
+ root: g.root,
128
+ providerAttribution: g.providerAttribution,
129
+ disclosureLinks: g.disclosureLinks,
130
+ agreeCheckbox: g.agreeCheckbox,
131
+ agreementText: g.agreementText,
132
+ acceptButton: g.acceptButton,
133
+ error: g.error
131
134
  }
132
135
  });
133
136
  }
134
- function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, uiFramework: s, errorFallback: c, onError: l, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
135
- return /* @__PURE__ */ b(a, {
136
- widgetName: u,
137
+ function D({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, uiFramework: o, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: p, ...m }) {
138
+ return /* @__PURE__ */ S(s, {
139
+ widgetName: f,
137
140
  baseUrl: e,
138
141
  widgetToken: t,
139
142
  organizationId: n,
140
143
  configClient: r,
141
144
  gatewayRouting: i,
142
- linkComponent: o,
143
- uiFramework: s,
145
+ linkComponent: a,
146
+ uiFramework: o,
144
147
  errorFallback: c,
145
148
  onError: l,
146
- analytics: d,
147
- disclosuresAcceptance: f,
149
+ analytics: u,
150
+ disclosuresAcceptance: d,
148
151
  providerLabels: p,
149
- children: /* @__PURE__ */ b(C, { ...m })
152
+ children: /* @__PURE__ */ S(T, { ...m })
150
153
  });
151
154
  }
152
- export { T as AcceptDisclosuresWidget };
155
+ export { D as AcceptDisclosuresWidget };
@@ -1,72 +1,54 @@
1
- import { Button as e, Checkbox as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { mergeAcceptDisclosuresWidgetLabels as n } from "./labels.js";
3
- import { useId as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { Button as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { WidgetFrame as t } from "../../../../../shared/ui/dist/lib/WidgetFrame/WidgetFrame.js";
3
+ import { ConsentBlock as n } from "../../../../../shared/ui/dist/lib/ConsentBlock/ConsentBlock.js";
4
+ import "../../../../../shared/ui/dist/index.js";
5
+ import { mergeAcceptDisclosuresWidgetLabels as r } from "./labels.js";
6
+ import { useId as i } from "react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
5
8
  // ../../libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js
6
- function o({ providerAttribution: o, agreementText: s, disclosureLinks: c, isAgreed: l, onAgreedChange: u, onAccept: d, isSubmitting: f = !1, isAccepted: p = !1, errorMessage: m, labels: h, testIds: g }) {
7
- let _ = f || p, v = n(h), y = r(), b = `${y}-agree`, x = `${y}-agree-description`, S = `${y}-accept-error`;
8
- return /* @__PURE__ */ a("div", {
9
- "data-testid": g?.root,
10
- className: "ttw:block ttw:w-full ttw:rounded-lg ttw:border ttw:border-border ttw:bg-background ttw:p-6",
9
+ function s({ providerAttribution: s, agreementText: c, disclosureLinks: l, isAgreed: u, onAgreedChange: d, onAccept: f, isSubmitting: p = !1, isAccepted: m = !1, errorMessage: h, labels: g, testIds: _ }) {
10
+ let v = p || m, y = r(g), b = `${i()}-accept-error`;
11
+ return /* @__PURE__ */ o(t, {
12
+ "data-testid": _?.root,
13
+ title: y.title,
14
+ bodyClassName: "ttw:gap-4",
11
15
  children: [
12
- /* @__PURE__ */ i("h2", {
13
- className: "ttw:mb-2 ttw:text-lg ttw:font-semibold ttw:text-foreground",
14
- children: v.title
15
- }),
16
- /* @__PURE__ */ i("p", {
17
- "data-testid": g?.providerAttribution,
16
+ /* @__PURE__ */ a("p", {
17
+ "data-testid": _?.providerAttribution,
18
18
  className: "ttw:mb-4 ttw:text-sm ttw:text-foreground",
19
- children: o
19
+ children: s
20
20
  }),
21
- c.length > 0 ? /* @__PURE__ */ i("ul", {
22
- "data-testid": g?.disclosureLinks,
23
- className: "ttw:mb-4 ttw:list-disc ttw:space-y-2 ttw:pl-5",
24
- children: c.map((e) => /* @__PURE__ */ i("li", {
25
- className: "ttw:marker:text-primary",
26
- children: /* @__PURE__ */ i("a", {
27
- href: e.href,
28
- target: "_blank",
29
- rel: "noopener noreferrer",
30
- className: "ttw:text-sm ttw:text-primary ttw:underline ttw:underline-offset-2",
31
- children: e.label
32
- })
33
- }, e.href))
34
- }) : null,
35
- /* @__PURE__ */ a("div", {
36
- className: "ttw:mb-4 ttw:flex ttw:items-start ttw:gap-3",
37
- children: [/* @__PURE__ */ i(t, {
38
- id: b,
39
- "data-testid": g?.agreeCheckbox,
40
- checked: l,
41
- disabled: _,
42
- onCheckedChange: (e) => u(e === !0),
43
- "aria-label": v.agreementCheckboxAriaLabel,
44
- "aria-describedby": x,
45
- className: "ttw:mt-1 ttw:shrink-0"
46
- }), /* @__PURE__ */ i("p", {
47
- id: x,
48
- "data-testid": g?.agreementText,
49
- className: "ttw:text-sm ttw:font-normal ttw:leading-relaxed ttw:text-foreground",
50
- children: s
51
- })]
21
+ /* @__PURE__ */ a(n, {
22
+ links: l,
23
+ agreement: c,
24
+ checked: u,
25
+ disabled: v,
26
+ onCheckedChange: d,
27
+ checkboxAriaLabel: y.agreementCheckboxAriaLabel,
28
+ testIds: {
29
+ links: _?.disclosureLinks,
30
+ checkbox: _?.agreeCheckbox,
31
+ agreement: _?.agreementText
32
+ }
52
33
  }),
53
- /* @__PURE__ */ i(e, {
34
+ /* @__PURE__ */ a(e, {
35
+ className: "ttw:self-end",
54
36
  type: "button",
55
- "data-testid": g?.acceptButton,
56
- disabled: !l || _,
57
- "aria-busy": f || void 0,
58
- "aria-describedby": m ? S : void 0,
59
- onClick: d,
60
- children: v.acceptButton
37
+ "data-testid": _?.acceptButton,
38
+ disabled: !u || v,
39
+ "aria-busy": p || void 0,
40
+ "aria-describedby": h ? b : void 0,
41
+ onClick: f,
42
+ children: p ? y.submittingButton : y.acceptButton
61
43
  }),
62
- m ? /* @__PURE__ */ i("p", {
63
- id: S,
64
- "data-testid": g?.error,
44
+ h ? /* @__PURE__ */ a("p", {
45
+ id: b,
46
+ "data-testid": _?.error,
65
47
  role: "alert",
66
48
  className: "ttw:mt-3 ttw:text-sm ttw:text-destructive",
67
- children: m
49
+ children: h
68
50
  }) : null
69
51
  ]
70
52
  });
71
53
  }
72
- export { o as AcceptDisclosuresWidget, n as mergeAcceptDisclosuresWidgetLabels };
54
+ export { s as AcceptDisclosuresWidget, r as mergeAcceptDisclosuresWidgetLabels };
@@ -2,6 +2,8 @@
2
2
  var e = {
3
3
  title: "Review and accept these banking disclosures",
4
4
  acceptButton: "Accept",
5
+ submittingButton: "Accepting…",
6
+ successToast: "Disclosures accepted",
5
7
  agreementCheckboxAriaLabel: "Agree to banking disclosures",
6
8
  acceptErrorFallback: "Failed to accept disclosures",
7
9
  continuationErrorFallback: "Disclosures accepted, but we could not continue. Please try again.",
@@ -105,7 +105,10 @@ function _({ owners: t, onOwnersChange: h, primaryOwnerName: _, applicantOwnersh
105
105
  }, Ge = () => {
106
106
  if (!k) return;
107
107
  let e = D.safeParse(k);
108
- if (!e.success) return;
108
+ if (!e.success) {
109
+ q.reset([...p]);
110
+ return;
111
+ }
109
112
  let n = {
110
113
  ...e.data,
111
114
  reviewed: !0
@@ -148,13 +151,12 @@ function _({ owners: t, onOwnersChange: h, primaryOwnerName: _, applicantOwnersh
148
151
  ownershipPercentage: e
149
152
  });
150
153
  },
151
- error: xe || P ? ue(F.share, E) : void 0,
152
- onBlur: () => L(!0)
154
+ error: xe || P ? ue(F.share, E) : void 0
153
155
  },
154
156
  summary: ie(me, E),
155
157
  isValid: g(F.share),
156
158
  onSave: () => {
157
- F && g(F.share) && (y({
159
+ !F || !g(F.share) ? L(!0) : (y({
158
160
  ownsOver25Percent: !0,
159
161
  ownershipPercentage: F.share
160
162
  }), $());
@@ -177,7 +179,7 @@ function _({ owners: t, onOwnersChange: h, primaryOwnerName: _, applicantOwnersh
177
179
  },
178
180
  onEdit: () => Ve(U)
179
181
  } : null, Qe = k ? {
180
- fields: re(oe(k, we, { stateOptions: ge }), a(p, k, Ne?.error?.issues, E.requiredFieldError), P ? fe : q.touched, q.touch),
182
+ fields: re(oe(k, we, { stateOptions: ge }), a(p, k, Ne?.error?.issues, E.requiredFieldError), P ? fe : q.touched, () => void 0),
181
183
  display: ae(k, E),
182
184
  rowIndex: j,
183
185
  showMissingFieldsAlert: j !== null && Z[j] !== void 0,