@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.
- package/dist/experimental/QuickViewWidget.d.ts +11 -0
- package/dist/experimental/RemoteCheckCapture.d.ts +11 -0
- package/dist/experimental/index.d.ts +11 -0
- package/dist/index.css +509 -61
- package/dist/index.d.ts +54 -13
- package/dist/lib/AcceptDisclosuresWidget.d.ts +11 -0
- package/dist/lib/BalancesWidget.d.ts +11 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +11 -0
- package/dist/lib/BankAccountsWidget.d.ts +11 -0
- package/dist/lib/BankingComplianceBannerWidget.d.ts +11 -0
- package/dist/lib/BillPayWidget.d.ts +11 -0
- package/dist/lib/CardDetailsWidget.d.ts +11 -0
- package/dist/lib/CounterpartsWidget.d.ts +11 -0
- package/dist/lib/CounterpartsWidgetPublic.d.ts +11 -0
- package/dist/lib/CreditCardsWidget.d.ts +11 -0
- package/dist/lib/CustomersWidget.d.ts +11 -0
- package/dist/lib/DebitCardsWidget.d.ts +11 -0
- package/dist/lib/ExpenseManagementWidget.d.ts +11 -0
- package/dist/lib/InsightsWidget.d.ts +11 -0
- package/dist/lib/LinkedAccountsWidget.d.ts +11 -0
- package/dist/lib/OfferWidget.d.ts +11 -0
- package/dist/lib/ProductsWidget.d.ts +11 -0
- package/dist/lib/ReceivablesWidget.d.ts +11 -0
- package/dist/lib/SettingsWidget.d.ts +11 -0
- package/dist/lib/TransfersWidget.d.ts +54 -13
- package/dist/lib/WidgetProvider.d.ts +11 -0
- package/dist/lib/WidgetProviderPublic.d.ts +11 -0
- package/dist/lib/WidgetSuite.d.ts +54 -13
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +15 -12
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AmountInput/AmountInput.js +30 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/LoadingRegion/LoadingRegion.js +14 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/MaskedAccountNumber/MaskedAccountNumber.js +57 -0
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/MaskedAccountNumber/labels.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/TransfersWidgetInner.js +4 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/testIds.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/transferViews.js +10 -17
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/lib/TransfersWidget/useTransferMoneyModalController.js +159 -218
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js +37 -88
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModal.js +184 -245
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferResultStep.js +43 -58
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/reviewTransferStepLabels.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/transferResultStepLabels.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/useFocusFirstInvalidField.js +9 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountValue.js +32 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferDetailSheet.js +68 -101
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +155 -153
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/labels.js +20 -11
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/maskLabels.js +7 -0
- package/dist/packages/shared-ui-shadcn/dist/index.js +1850 -1607
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModalHeader.js +0 -29
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferReviewAccountCard.js +0 -64
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransferAccountTile.js +0 -14
- 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 {
|
|
6
|
-
import { coerceAmountValueToMinorUnits as
|
|
7
|
-
import { amountOutputToMajorUnits as
|
|
8
|
-
import { currencySymbolForCode as
|
|
9
|
-
import { parseDecimalAmountToMinorUnits as
|
|
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
|
|
13
|
-
import { useCreateBookTransferMutation as
|
|
14
|
-
import { useCreateAchMoneyMovementMutation as
|
|
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
|
|
17
|
-
import { useControllableState as
|
|
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
|
|
24
|
-
if (!
|
|
25
|
-
let i =
|
|
26
|
-
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
|
|
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
|
|
41
|
-
let r =
|
|
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:
|
|
45
|
-
|
|
46
|
-
balanceLabel:
|
|
44
|
+
primaryLabel: r,
|
|
45
|
+
number: { last4: m(e.accountNumber) },
|
|
46
|
+
balanceLabel: i
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
50
|
-
let
|
|
49
|
+
function v(e) {
|
|
50
|
+
let t = e.nickname?.trim() || e.nameOnAccount;
|
|
51
51
|
return {
|
|
52
52
|
optionValue: e.id,
|
|
53
|
-
primaryLabel:
|
|
54
|
-
|
|
53
|
+
primaryLabel: t,
|
|
54
|
+
number: { last4: m(e.accountNumber) }
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function y(e, t) {
|
|
58
58
|
return {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
name: e?.primaryLabel ?? "",
|
|
60
|
+
...t && { number: {
|
|
61
|
+
last4: m(t),
|
|
62
|
+
fullNumber: t
|
|
63
|
+
} }
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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] =
|
|
78
|
-
N("
|
|
79
|
-
}, []),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}, [
|
|
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
|
-
|
|
91
|
-
|
|
92
|
-
]),
|
|
93
|
-
|
|
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
|
-
|
|
106
|
+
T,
|
|
107
|
+
P,
|
|
96
108
|
Y
|
|
97
|
-
]),
|
|
98
|
-
k,
|
|
109
|
+
]), pe = f(() => M ? J ? D.filter((e) => e.optionValue !== M) : T.filter((e) => e.optionValue !== M) : D, [
|
|
99
110
|
D,
|
|
100
|
-
|
|
111
|
+
T,
|
|
112
|
+
M,
|
|
101
113
|
J
|
|
102
|
-
]),
|
|
103
|
-
|
|
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
|
-
|
|
135
|
-
h,
|
|
136
|
-
m.defaultCurrencyCode,
|
|
117
|
+
I,
|
|
137
118
|
P,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
|
|
144
|
-
|
|
145
|
-
]),
|
|
146
|
-
|
|
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 =
|
|
151
|
-
return
|
|
138
|
+
let t = i(X);
|
|
139
|
+
return o(e / 10 ** t, {
|
|
152
140
|
currencyCode: X,
|
|
153
141
|
includeSpaceAfterCurrencySymbol: !1
|
|
154
142
|
});
|
|
155
|
-
}, [
|
|
156
|
-
|
|
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
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
]),
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
166
|
+
t.error(r.modalUnsupportedPairError);
|
|
229
167
|
return;
|
|
230
168
|
}
|
|
231
|
-
let
|
|
232
|
-
|
|
169
|
+
let n;
|
|
170
|
+
n = J && Y ? "INTERNAL_TO_INTERNAL" : J && !Y ? "INTERNAL_TO_EXTERNAL" : "EXTERNAL_TO_INTERNAL";
|
|
233
171
|
try {
|
|
234
|
-
|
|
235
|
-
fromBankAccountId:
|
|
236
|
-
toBankAccountId:
|
|
237
|
-
amount:
|
|
172
|
+
n === "INTERNAL_TO_INTERNAL" ? await S.mutateAsync({ body: {
|
|
173
|
+
fromBankAccountId: M,
|
|
174
|
+
toBankAccountId: P,
|
|
175
|
+
amount: e,
|
|
238
176
|
currencyCode: X
|
|
239
|
-
} }) : await
|
|
240
|
-
fromBankAccountId:
|
|
241
|
-
toBankAccountId:
|
|
242
|
-
amount:
|
|
177
|
+
} }) : await C.mutateAsync({ body: {
|
|
178
|
+
fromBankAccountId: M,
|
|
179
|
+
toBankAccountId: P,
|
|
180
|
+
amount: e,
|
|
243
181
|
currencyCode: X,
|
|
244
|
-
type:
|
|
182
|
+
type: n,
|
|
245
183
|
secCode: m.defaultSecCode
|
|
246
|
-
} }),
|
|
184
|
+
} }), j("result"), x(c.TransferSubmitted, { transferType: n });
|
|
247
185
|
} catch {
|
|
248
|
-
|
|
186
|
+
t.error(r.modalSubmitFailedError);
|
|
249
187
|
}
|
|
250
188
|
}, [
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
189
|
+
I,
|
|
190
|
+
C,
|
|
191
|
+
S,
|
|
254
192
|
J,
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
193
|
+
M,
|
|
194
|
+
r.modalSubmitFailedError,
|
|
195
|
+
r.modalUnsupportedPairError,
|
|
196
|
+
r.modalAmountInvalidError,
|
|
259
197
|
Y,
|
|
260
|
-
|
|
261
|
-
|
|
198
|
+
P,
|
|
199
|
+
x,
|
|
262
200
|
X,
|
|
263
201
|
m.defaultSecCode
|
|
264
202
|
]);
|
|
265
203
|
return {
|
|
266
204
|
modalProps: {
|
|
267
|
-
open:
|
|
268
|
-
onOpenChange:
|
|
269
|
-
step:
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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:
|
|
234
|
+
openModal: de
|
|
294
235
|
};
|
|
295
236
|
}
|
|
296
|
-
export {
|
|
237
|
+
export { b as useTransferMoneyModalController };
|
package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/mocks/labels.js
CHANGED
|
@@ -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.
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { DEFAULT_REVIEW_TRANSFER_STEP_LABELS as
|
|
4
|
-
import {
|
|
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
|
|
8
|
-
let
|
|
9
|
-
...
|
|
10
|
-
...
|
|
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__ */
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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 {
|
|
41
|
+
export { i as ReviewTransferStep };
|