@tesouro/embedded-components-react 0.11.0 → 0.11.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.
Files changed (56) hide show
  1. package/dist/experimental/QuickViewWidget.d.ts +11 -0
  2. package/dist/experimental/RemoteCheckCapture.d.ts +11 -0
  3. package/dist/experimental/index.d.ts +11 -0
  4. package/dist/index.css +509 -61
  5. package/dist/index.d.ts +54 -13
  6. package/dist/lib/AcceptDisclosuresWidget.d.ts +11 -0
  7. package/dist/lib/BalancesWidget.d.ts +11 -0
  8. package/dist/lib/BankAccountOnboardingWidget.d.ts +11 -0
  9. package/dist/lib/BankAccountsWidget.d.ts +11 -0
  10. package/dist/lib/BankingComplianceBannerWidget.d.ts +11 -0
  11. package/dist/lib/BillPayWidget.d.ts +11 -0
  12. package/dist/lib/CardDetailsWidget.d.ts +11 -0
  13. package/dist/lib/CounterpartsWidget.d.ts +11 -0
  14. package/dist/lib/CounterpartsWidgetPublic.d.ts +11 -0
  15. package/dist/lib/CreditCardsWidget.d.ts +11 -0
  16. package/dist/lib/CustomersWidget.d.ts +11 -0
  17. package/dist/lib/DebitCardsWidget.d.ts +11 -0
  18. package/dist/lib/ExpenseManagementWidget.d.ts +11 -0
  19. package/dist/lib/InsightsWidget.d.ts +11 -0
  20. package/dist/lib/LinkedAccountsWidget.d.ts +11 -0
  21. package/dist/lib/OfferWidget.d.ts +11 -0
  22. package/dist/lib/ProductsWidget.d.ts +11 -0
  23. package/dist/lib/ReceivablesWidget.d.ts +11 -0
  24. package/dist/lib/SettingsWidget.d.ts +11 -0
  25. package/dist/lib/TransfersWidget.d.ts +54 -13
  26. package/dist/lib/WidgetProvider.d.ts +11 -0
  27. package/dist/lib/WidgetProviderPublic.d.ts +11 -0
  28. package/dist/lib/WidgetSuite.d.ts +54 -13
  29. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +15 -12
  31. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AmountInput/AmountInput.js +30 -0
  32. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/LoadingRegion/LoadingRegion.js +14 -1
  33. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/MaskedAccountNumber/MaskedAccountNumber.js +57 -0
  34. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/MaskedAccountNumber/labels.js +7 -0
  35. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +4 -2
  36. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/testIds.js +2 -2
  37. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +10 -17
  38. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +159 -218
  39. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js +37 -88
  41. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModal.js +184 -245
  42. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferResultStep.js +43 -58
  43. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/reviewTransferStepLabels.js +6 -5
  44. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/transferResultStepLabels.js +7 -6
  45. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/useFocusFirstInvalidField.js +9 -0
  46. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountValue.js +32 -0
  47. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferDetailSheet.js +68 -101
  48. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +155 -153
  49. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +20 -11
  50. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/maskLabels.js +7 -0
  51. package/dist/packages/shared-ui-shadcn/dist/index.js +1850 -1607
  52. package/package.json +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModalHeader.js +0 -29
  54. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferReviewAccountCard.js +0 -64
  55. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountTile.js +0 -14
  56. package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferStatusBadge.js +0 -17
@@ -2,31 +2,31 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { coerceAmountValueToMinorUnits as t } from "../../../../../shared/util/dist/lib/coerceAmountValueToMinorUnits.js";
7
- import { amountOutputToMajorUnits as n, minorExponentForCurrency as r } from "../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
8
- import { currencySymbolForCode as i, formatMoneyExact as a } from "../../../../../shared/util/dist/lib/formatMoneyExact.js";
9
- import { parseDecimalAmountToMinorUnits as o } from "../../../../../shared/util/dist/lib/parseDecimalAmountToMinorUnits.js";
5
+ import { formatLabel as e, toast as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { coerceAmountValueToMinorUnits as n } from "../../../../../shared/util/dist/lib/coerceAmountValueToMinorUnits.js";
7
+ import { amountOutputToMajorUnits as r, minorExponentForCurrency as i } from "../../../../../shared/util/dist/lib/amountOutputToMajorUnits.js";
8
+ import { currencySymbolForCode as a, formatMoneyExact as o } from "../../../../../shared/util/dist/lib/formatMoneyExact.js";
9
+ import { parseDecimalAmountToMinorUnits as s } from "../../../../../shared/util/dist/lib/parseDecimalAmountToMinorUnits.js";
10
10
  import "../../../../../shared/util/dist/index.js";
11
11
  import "../../../../../shared/ui/dist/index.js";
12
- import { TRANSFERS_ANALYTICS_EVENTS as s } from "../analytics/events.js";
13
- import { useCreateBookTransferMutation as c } from "../../../../data-access/dist/index7.js";
14
- import { useCreateAchMoneyMovementMutation as ee } from "../../../../data-access/dist/index8.js";
12
+ import { TRANSFERS_ANALYTICS_EVENTS as c } from "../analytics/events.js";
13
+ import { useCreateBookTransferMutation as ee } from "../../../../data-access/dist/index7.js";
14
+ import { useCreateAchMoneyMovementMutation as l } from "../../../../data-access/dist/index8.js";
15
15
  import "../../../../data-access/dist/index.js";
16
- import { useCallback as l, useEffect as u, useMemo as d, useState as f } from "react";
17
- import { useControllableState as p } from "@radix-ui/react-use-controllable-state";
16
+ import { useCallback as u, useEffect as d, useMemo as f, useState as p } from "react";
17
+ import { useControllableState as te } from "@radix-ui/react-use-controllable-state";
18
18
  // ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js
19
19
  function m(e) {
20
20
  return e.slice(-4);
21
21
  }
22
22
  function h(e, t) {
23
- let r = e.balance;
24
- if (!r || r.value === void 0 || r.value === null) return;
25
- let i = r.currencyCode ?? t, o = n({
26
- value: r.value,
23
+ let n = e.balance;
24
+ if (!n || n.value === void 0 || n.value === null) return;
25
+ let i = n.currencyCode ?? t, a = r({
26
+ value: n.value,
27
27
  currencyCode: i
28
28
  });
29
- return a(o, {
29
+ return o(a, {
30
30
  currencyCode: i,
31
31
  includeSpaceAfterCurrencySymbol: !1
32
32
  });
@@ -37,260 +37,201 @@ function g(e, t, n, r) {
37
37
  let a = n.find((e) => e.id === t);
38
38
  return a?.balance?.currencyCode ? a.balance.currencyCode : r;
39
39
  }
40
- function te(e, t, n) {
41
- let r = m(e.accountNumber), i = e.nickname?.trim() || t.accountFallbackName, a = h(e, n.defaultCurrencyCode);
40
+ function _(e, t, n) {
41
+ let r = e.nickname?.trim() || t.accountFallbackName, i = h(e, n.defaultCurrencyCode);
42
42
  return {
43
43
  optionValue: e.id,
44
- primaryLabel: i,
45
- secondaryLabel: `${t.embeddedAccountMaskPrefix}${r}`,
46
- balanceLabel: a
44
+ primaryLabel: r,
45
+ number: { last4: m(e.accountNumber) },
46
+ balanceLabel: i
47
47
  };
48
48
  }
49
- function _(e, t) {
50
- let n = m(e.accountNumber), r = e.nickname?.trim() || e.nameOnAccount;
49
+ function v(e) {
50
+ let t = e.nickname?.trim() || e.nameOnAccount;
51
51
  return {
52
52
  optionValue: e.id,
53
- primaryLabel: r,
54
- secondaryLabel: `${t.embeddedAccountMaskPrefix}${n}`
53
+ primaryLabel: t,
54
+ number: { last4: m(e.accountNumber) }
55
55
  };
56
56
  }
57
- function v(e, t, n, r, i) {
57
+ function y(e, t) {
58
58
  return {
59
- primaryLabel: e?.primaryLabel ?? "",
60
- accountDetailLabel: t ? `${i} ${t}` : e?.secondaryLabel ?? "",
61
- balanceLabel: e?.balanceLabel,
62
- availableBalanceCaption: e?.balanceLabel ? r : void 0,
63
- showInstitutionIcon: n
59
+ name: e?.primaryLabel ?? "",
60
+ ...t && { number: {
61
+ last4: m(t),
62
+ fullNumber: t
63
+ } }
64
64
  };
65
65
  }
66
- function y({ labels: n, featureLabels: m, embeddedBankAccounts: h, verifiedExternalBankAccounts: y, track: b, isTransferMoneyOpen: x, defaultIsTransferMoneyOpen: S, onTransferMoneyOpenChange: C }) {
67
- let w = c(), T = ee(), E = d(() => new Set(h.map((e) => e.id)), [h]), D = d(() => h.map((e) => te(e, n, m)), [
66
+ var ne = 2;
67
+ function b({ labels: r, featureLabels: m, embeddedBankAccounts: h, verifiedExternalBankAccounts: b, track: x, isTransferMoneyOpen: re, defaultIsTransferMoneyOpen: ie, onTransferMoneyOpenChange: ae }) {
68
+ let S = ee(), C = l(), w = f(() => new Set(h.map((e) => e.id)), [h]), T = f(() => h.map((e) => _(e, r, m)), [
68
69
  h,
69
70
  m,
70
- n.accountFallbackName,
71
- n.embeddedAccountMaskPrefix
72
- ]), O = d(() => y.map((e) => _(e, n)), [n.embeddedAccountMaskPrefix, y]), k = d(() => [...D, ...O], [D, O]), [A, j] = p({
73
- prop: x,
74
- defaultProp: S ?? !1,
75
- onChange: C,
71
+ r.accountFallbackName
72
+ ]), E = f(() => b.map((e) => v(e)), [b]), D = f(() => [...T, ...E], [T, E]), [O, k] = te({
73
+ prop: re,
74
+ defaultProp: ie ?? !1,
75
+ onChange: ae,
76
76
  caller: "TransfersWidget"
77
- }), [M, N] = f("accounts"), [P, F] = f(""), [I, L] = f(""), [R, z] = f(""), [ne, B] = f(null), [V, H] = f(!1), U = l(() => {
78
- N("accounts"), F(""), L(""), z(""), B(null), H(!1);
79
- }, []), [W, G] = f(A);
80
- A !== W && (G(A), A && U()), u(() => {
81
- A && b(s.TransferMoneyOpened);
82
- }, [A, b]);
83
- let K = l((e) => {
84
- j(e);
85
- }, [j]), q = l(() => {
86
- j(!0);
87
- }, [j]), J = E.has(P), Y = E.has(I), X = d(() => g(P, I, h, m.defaultCurrencyCode), [
77
+ }), [A, j] = p("accounts"), [M, N] = p(""), [P, F] = p(""), [I, L] = p(""), [oe, R] = p(null), [z, B] = p(null), [V, H] = p(null), [U, W] = p(!1), [G, K] = p(0), q = u(() => {
78
+ N(""), F(""), L(""), R(null), B(null), H(null), W(!1);
79
+ }, []), se = u(() => {
80
+ j("accounts"), q();
81
+ }, [q]), [ce, le] = p(O);
82
+ O !== ce && (le(O), O && se()), d(() => {
83
+ O && x(c.TransferMoneyOpened);
84
+ }, [O, x]);
85
+ let ue = u((e) => {
86
+ k(e);
87
+ }, [k]), de = u(() => {
88
+ k(!0);
89
+ }, [k]), J = w.has(M), Y = w.has(P), X = f(() => g(M, P, h, m.defaultCurrencyCode), [
88
90
  h,
89
91
  m.defaultCurrencyCode,
90
- P,
91
- I
92
- ]), re = d(() => i(X), [X]), ie = d(() => I ? Y ? k.filter((e) => e.optionValue !== I) : D.filter((e) => e.optionValue !== I) : k, [
93
- k,
92
+ M,
93
+ P
94
+ ]), Z = u((e, t, i) => {
95
+ let a = s(e, g(t, i, h, m.defaultCurrencyCode));
96
+ if (a === null) return r.modalAmountInvalidError;
97
+ let o = h.find((e) => e.id === t);
98
+ return o && a > n(o.balance?.value) ? r.modalInsufficientFundsError : null;
99
+ }, [
100
+ h,
101
+ m.defaultCurrencyCode,
102
+ r.modalAmountInvalidError,
103
+ r.modalInsufficientFundsError
104
+ ]), Q = f(() => a(X), [X]), fe = f(() => P ? Y ? D.filter((e) => e.optionValue !== P) : T.filter((e) => e.optionValue !== P) : D, [
94
105
  D,
95
- I,
106
+ T,
107
+ P,
96
108
  Y
97
- ]), ae = d(() => P ? J ? k.filter((e) => e.optionValue !== P) : D.filter((e) => e.optionValue !== P) : k, [
98
- k,
109
+ ]), pe = f(() => M ? J ? D.filter((e) => e.optionValue !== M) : T.filter((e) => e.optionValue !== M) : D, [
99
110
  D,
100
- P,
111
+ T,
112
+ M,
101
113
  J
102
- ]), Z = !!(P && I && P !== I), oe = d(() => o(R, X) !== null, [R, X]), Q = l((e, r, i) => {
103
- let a = o(r, i);
104
- if (a === null || !E.has(e)) {
105
- B(null);
106
- return;
107
- }
108
- let s = h.find((t) => t.id === e);
109
- if (!s) {
110
- B(null);
111
- return;
112
- }
113
- let c = t(s.balance?.value);
114
- B(a > c ? n.modalInsufficientFundsError : null);
115
- }, [
116
- h,
117
- E,
118
- n.modalInsufficientFundsError
119
- ]), se = l((e) => {
120
- F(e);
121
- let t = g(e, I, h, m.defaultCurrencyCode);
122
- Q(e, R, t);
123
- }, [
124
- R,
125
- h,
126
- m.defaultCurrencyCode,
127
- Q,
128
- I
129
- ]), ce = l((e) => {
130
- L(e);
131
- let t = g(P, e, h, m.defaultCurrencyCode);
132
- Q(P, R, t);
114
+ ]), me = u((e) => {
115
+ N(e), R(null), H(U ? Z(I, e, P) : null);
133
116
  }, [
134
- R,
135
- h,
136
- m.defaultCurrencyCode,
117
+ I,
137
118
  P,
138
- Q
139
- ]), le = l((e) => {
140
- z(e), Q(P, e, X);
119
+ Z,
120
+ U
121
+ ]), he = u((e) => {
122
+ F(e), B(null), H(U ? Z(I, M, e) : null);
141
123
  }, [
124
+ I,
125
+ M,
126
+ Z,
127
+ U
128
+ ]), ge = u((e) => {
129
+ L(e), H(U ? Z(e, M, P) : null);
130
+ }, [
131
+ M,
142
132
  P,
143
- Q,
144
- X
145
- ]), ue = l(() => {
146
- F(""), L(""), z(""), B(null);
147
- }, []), de = d(() => {
148
- let e = o(R, X);
133
+ Z,
134
+ U
135
+ ]), _e = f(() => {
136
+ let e = s(I, X);
149
137
  if (e === null) return "";
150
- let t = r(X);
151
- return a(e / 10 ** t, {
138
+ let t = i(X);
139
+ return o(e / 10 ** t, {
152
140
  currencyCode: X,
153
141
  includeSpaceAfterCurrencySymbol: !1
154
142
  });
155
- }, [R, X]), fe = d(() => {
156
- let e = k.find((e) => e.optionValue === P), t = h.find((e) => e.id === P), r = y.find((e) => e.id === P);
157
- return v(e, t?.accountNumber ?? r?.accountNumber, !!r, n.modalAvailableBalanceCaption, n.modalReviewAccountNumberPrefix);
158
- }, [
159
- k,
143
+ }, [I, X]), $ = u((e) => y(D.find((t) => t.optionValue === e), h.find((t) => t.id === e)?.accountNumber ?? b.find((t) => t.id === e)?.accountNumber), [
144
+ D,
160
145
  h,
161
- P,
162
- n.modalAvailableBalanceCaption,
163
- n.modalReviewAccountNumberPrefix,
164
- y
165
- ]), $ = d(() => {
166
- let e = k.find((e) => e.optionValue === I), t = h.find((e) => e.id === I), r = y.find((e) => e.id === I);
167
- return v(e, t?.accountNumber ?? r?.accountNumber, !!r, n.modalAvailableBalanceCaption, n.modalReviewAccountNumberPrefix);
146
+ b
147
+ ]), ve = u(() => {
148
+ let e = M ? null : r.modalFromRequiredError, t = P ? null : r.modalToRequiredError, n = Z(I, M, P);
149
+ W(!0), R(e), B(t), H(n), e || t || n ? K((e) => e + 1) : j("review");
168
150
  }, [
169
- k,
170
- h,
171
- n.modalAvailableBalanceCaption,
172
- n.modalReviewAccountNumberPrefix,
173
151
  I,
174
- y
175
- ]), pe = l(() => {
176
- if (!Z) return;
177
- let e = o(R, X);
178
- if (e === null) B(n.modalAmountInvalidError);
179
- else {
180
- if (J) {
181
- let r = h.find((e) => e.id === P);
182
- if (r && e > t(r.balance?.value)) {
183
- B(n.modalInsufficientFundsError);
184
- return;
185
- }
186
- }
187
- B(null), N("review");
188
- }
189
- }, [
190
- R,
191
- Z,
192
- h,
193
- J,
194
- P,
195
- n.modalAmountInvalidError,
196
- n.modalInsufficientFundsError,
197
- X
198
- ]), me = l(() => {
199
- let e = o(R, X);
200
- if (e === null) B(n.modalAmountInvalidError);
201
- else {
202
- if (J) {
203
- let r = h.find((e) => e.id === P);
204
- if (r && e > t(r.balance?.value)) {
205
- B(n.modalInsufficientFundsError);
206
- return;
207
- }
208
- }
209
- B(null), N("review");
210
- }
211
- }, [
212
- R,
213
- h,
214
- J,
152
+ M,
153
+ r.modalFromRequiredError,
154
+ r.modalToRequiredError,
215
155
  P,
216
- n.modalAmountInvalidError,
217
- n.modalInsufficientFundsError,
218
- X
219
- ]), he = l(() => {
220
- (M === "amount" || M === "review") && N("accounts");
221
- }, [M]), ge = l(async () => {
222
- let t = o(R, X);
223
- if (t === null) {
224
- B(n.modalAmountInvalidError);
156
+ Z
157
+ ]), ye = u(() => {
158
+ j("accounts");
159
+ }, []), be = u(async () => {
160
+ let e = s(I, X);
161
+ if (e === null) {
162
+ H(r.modalAmountInvalidError);
225
163
  return;
226
164
  }
227
165
  if (!J && !Y) {
228
- e.error(n.modalUnsupportedPairError);
166
+ t.error(r.modalUnsupportedPairError);
229
167
  return;
230
168
  }
231
- let r;
232
- r = J && Y ? "INTERNAL_TO_INTERNAL" : J && !Y ? "INTERNAL_TO_EXTERNAL" : "EXTERNAL_TO_INTERNAL";
169
+ let n;
170
+ n = J && Y ? "INTERNAL_TO_INTERNAL" : J && !Y ? "INTERNAL_TO_EXTERNAL" : "EXTERNAL_TO_INTERNAL";
233
171
  try {
234
- r === "INTERNAL_TO_INTERNAL" ? await w.mutateAsync({ body: {
235
- fromBankAccountId: P,
236
- toBankAccountId: I,
237
- amount: t,
172
+ n === "INTERNAL_TO_INTERNAL" ? await S.mutateAsync({ body: {
173
+ fromBankAccountId: M,
174
+ toBankAccountId: P,
175
+ amount: e,
238
176
  currencyCode: X
239
- } }) : await T.mutateAsync({ body: {
240
- fromBankAccountId: P,
241
- toBankAccountId: I,
242
- amount: t,
177
+ } }) : await C.mutateAsync({ body: {
178
+ fromBankAccountId: M,
179
+ toBankAccountId: P,
180
+ amount: e,
243
181
  currencyCode: X,
244
- type: r,
182
+ type: n,
245
183
  secCode: m.defaultSecCode
246
- } }), H(!0), N("result"), b(s.TransferSubmitted, { transferType: r });
184
+ } }), j("result"), x(c.TransferSubmitted, { transferType: n });
247
185
  } catch {
248
- e.error(n.modalSubmitFailedError);
186
+ t.error(r.modalSubmitFailedError);
249
187
  }
250
188
  }, [
251
- R,
252
- T,
253
- w,
189
+ I,
190
+ C,
191
+ S,
254
192
  J,
255
- P,
256
- n.modalSubmitFailedError,
257
- n.modalUnsupportedPairError,
258
- n.modalAmountInvalidError,
193
+ M,
194
+ r.modalSubmitFailedError,
195
+ r.modalUnsupportedPairError,
196
+ r.modalAmountInvalidError,
259
197
  Y,
260
- I,
261
- b,
198
+ P,
199
+ x,
262
200
  X,
263
201
  m.defaultSecCode
264
202
  ]);
265
203
  return {
266
204
  modalProps: {
267
- open: A,
268
- onOpenChange: K,
269
- step: M,
270
- fromOptions: ie,
271
- toOptions: ae,
272
- fromValue: P,
273
- toValue: I,
274
- onFromValueChange: se,
275
- onToValueChange: ce,
276
- amountValue: R,
277
- onAmountValueChange: le,
278
- amountError: ne,
279
- amountInputPrefix: re,
280
- reviewFromAccount: fe,
281
- reviewToAccount: $,
282
- reviewAmountLabel: de,
283
- isSubmitting: w.isPending || T.isPending,
284
- isSuccess: V,
285
- canContinueFromAccounts: Z,
286
- canContinueFromAmount: oe,
287
- onContinueFromAccounts: pe,
288
- onContinueFromAmount: me,
289
- onBack: he,
290
- onSubmit: () => void ge(),
291
- onClearSelections: ue
205
+ open: O,
206
+ onOpenChange: ue,
207
+ step: A,
208
+ stepLabel: A === "result" ? void 0 : e(r.modalStepLabel, {
209
+ current: String(A === "review" ? 2 : 1),
210
+ total: String(ne)
211
+ }),
212
+ fromOptions: fe,
213
+ toOptions: pe,
214
+ fromValue: M,
215
+ toValue: P,
216
+ onFromValueChange: me,
217
+ onToValueChange: he,
218
+ fromError: oe,
219
+ toError: z,
220
+ amountValue: I,
221
+ onAmountValueChange: ge,
222
+ amountError: V,
223
+ amountInputPrefix: Q,
224
+ reviewFromAccount: $(M),
225
+ reviewToAccount: $(P),
226
+ reviewAmountLabel: _e,
227
+ isSubmitting: S.isPending || C.isPending,
228
+ onContinueFromAccounts: ve,
229
+ onBack: ye,
230
+ onSubmit: () => void be(),
231
+ onClearSelections: q,
232
+ scrollToErrorToken: G
292
233
  },
293
- openModal: q
234
+ openModal: de
294
235
  };
295
236
  }
296
- export { y as useTransferMoneyModalController };
237
+ export { b as useTransferMoneyModalController };
@@ -1,7 +1,7 @@
1
1
  // ../../libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js
2
2
  var e = {
3
3
  blurbs: {
4
- populated: "Recent transfers across three accounts: completed, pending and failed, internal and to or from an external account. Hover a row for its status and type. Transfer money moves money between your accounts or to and from Operating reserve, and the new transfer lands in the list as pending.",
4
+ populated: "Recent transfers across three accounts: completed, pending and failed, internal and to or from an external account. Each account shows its masked number under it, and every transfer carries a status badge. Transfer money moves money between your accounts or to and from Operating reserve, and the new transfer lands in the list as pending.",
5
5
  empty: "Three accounts and no transfers yet. Transfer money is enabled, and a submitted transfer becomes the first row.",
6
6
  loading: "The accounts read is held open, so the list skeleton stays on screen.",
7
7
  error: "The transfers read fails with a 500. The widget shows its own error with Try again; Transfer money still works, because the accounts themselves loaded.",
@@ -1,92 +1,41 @@
1
- import { Button as e, Separator as t, Typography as n } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { TransferReviewAccountCard as r } from "./TransferReviewAccountCard.js";
3
- import { DEFAULT_REVIEW_TRANSFER_STEP_LABELS as i } from "./reviewTransferStepLabels.js";
4
- import { Fragment as a, jsx as o, jsxs as s } from "react/jsx-runtime";
5
- import { ArrowLeft as c, ArrowRight as l } from "lucide-react";
1
+ import { DescriptionList as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { TransferAccountValue as t } from "../TransfersWidget/TransferAccountValue.js";
3
+ import { DEFAULT_REVIEW_TRANSFER_STEP_LABELS as n } from "./reviewTransferStepLabels.js";
4
+ import { jsx as r } from "react/jsx-runtime";
6
5
  // ../../libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js
7
- function u({ fromAccount: u, toAccount: d, amountLabel: f, isSubmitting: p, onConfirm: m, onGoBack: h, labels: g, testIds: _ }) {
8
- let v = {
9
- ...i,
10
- ...g
6
+ function i({ fromAccount: i, toAccount: a, amountLabel: o, labels: s }) {
7
+ let c = {
8
+ ...n,
9
+ ...s
10
+ }, l = {
11
+ endingIn: c.endingIn,
12
+ showNumber: c.showNumber,
13
+ hideNumber: c.hideNumber
11
14
  };
12
- return /* @__PURE__ */ s(a, { children: [
13
- /* @__PURE__ */ s("div", {
14
- className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:py-5",
15
- children: [
16
- /* @__PURE__ */ s("div", {
17
- className: "ttw:flex ttw:flex-col ttw:gap-2",
18
- children: [/* @__PURE__ */ o(n, {
19
- variant: "body2",
20
- color: "muted",
21
- component: "p",
22
- className: "ttw:font-medium",
23
- children: v.fromAccountSection
24
- }), /* @__PURE__ */ o(r, { account: u })]
25
- }),
26
- /* @__PURE__ */ o("div", {
27
- className: "ttw:flex ttw:justify-center",
28
- "aria-hidden": !0,
29
- children: /* @__PURE__ */ o(n, {
30
- component: "p",
31
- className: "ttw:text-[30px] ttw:leading-none ttw:text-primary",
32
- children: "↓"
33
- })
34
- }),
35
- /* @__PURE__ */ s("div", {
36
- className: "ttw:flex ttw:flex-col ttw:gap-2",
37
- children: [/* @__PURE__ */ o(n, {
38
- variant: "body2",
39
- color: "muted",
40
- component: "p",
41
- className: "ttw:font-medium",
42
- children: v.toAccountSection
43
- }), /* @__PURE__ */ o(r, { account: d })]
44
- }),
45
- /* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o(n, {
46
- variant: "body2",
47
- color: "muted",
48
- component: "p",
49
- className: "ttw:font-medium",
50
- children: v.amountSection
51
- }), /* @__PURE__ */ o(n, {
52
- component: "p",
53
- className: "ttw:text-2xl ttw:font-bold ttw:text-foreground",
54
- children: f
55
- })] })
56
- ]
57
- }),
58
- /* @__PURE__ */ o(t, {
59
- decorative: !0,
60
- orientation: "horizontal",
61
- className: "ttw:-mx-6",
62
- style: { width: "calc(100% + 3rem)" }
63
- }),
64
- /* @__PURE__ */ s("div", {
65
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-2 ttw:pt-4",
66
- children: [/* @__PURE__ */ s(e, {
67
- type: "button",
68
- variant: "default",
69
- className: "ttw:h-11 ttw:w-full ttw:cursor-pointer ttw:gap-2 ttw:rounded-lg ttw:font-medium",
70
- disabled: p,
71
- onClick: m,
72
- "data-testid": _?.confirm,
73
- children: [v.confirmTransfer, /* @__PURE__ */ o(l, {
74
- className: "ttw:size-4",
75
- "aria-hidden": !0
76
- })]
77
- }), /* @__PURE__ */ s(e, {
78
- type: "button",
79
- variant: "link",
80
- className: "ttw:h-auto ttw:cursor-pointer ttw:px-0 ttw:py-0 ttw:text-base ttw:font-medium",
81
- disabled: p,
82
- onClick: h,
83
- "data-testid": _?.goBack,
84
- children: [/* @__PURE__ */ o(c, {
85
- className: "ttw:size-4",
86
- "aria-hidden": !0
87
- }), v.goBack]
88
- })]
89
- })
15
+ return /* @__PURE__ */ r(e, { items: [
16
+ {
17
+ label: c.from,
18
+ value: /* @__PURE__ */ r(t, {
19
+ name: i.name,
20
+ number: i.number,
21
+ numberLabels: l
22
+ })
23
+ },
24
+ {
25
+ label: c.to,
26
+ value: /* @__PURE__ */ r(t, {
27
+ name: a.name,
28
+ number: a.number,
29
+ numberLabels: l
30
+ })
31
+ },
32
+ {
33
+ label: c.amount,
34
+ value: /* @__PURE__ */ r("span", {
35
+ className: "ttw:tabular-nums",
36
+ children: o
37
+ })
38
+ }
90
39
  ] });
91
40
  }
92
- export { u as ReviewTransferStep };
41
+ export { i as ReviewTransferStep };