@tesouro/embedded-components-react 0.11.167 → 0.11.169
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.d.ts +3 -0
- package/dist/lib/BankAccountsWidget.d.ts +1 -0
- package/dist/lib/CreditCardsWidget.d.ts +1 -0
- package/dist/lib/DebitCardsWidget.d.ts +1 -0
- package/dist/lib/LinkedAccountsWidget.d.ts +1 -0
- package/dist/lib/WidgetSuite.d.ts +3 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/BankAccountsWidget/BankAccountsWidget.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +122 -121
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js +63 -59
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/useCardsWidget.js +161 -160
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +126 -122
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +192 -191
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index13.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index14.js +100 -96
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index6.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2537,6 +2537,7 @@ interface Labels$4 {
|
|
|
2537
2537
|
routingNumberLabel: string;
|
|
2538
2538
|
addAccountButton: string;
|
|
2539
2539
|
emptyAccountsLabel: string;
|
|
2540
|
+
accessRestrictedTitle: string;
|
|
2540
2541
|
createDialogTitle: string;
|
|
2541
2542
|
createDialogSubtitle: string;
|
|
2542
2543
|
createNicknameLabel: string;
|
|
@@ -2752,6 +2753,7 @@ interface CardsListLabels {
|
|
|
2752
2753
|
loadingLabel: string;
|
|
2753
2754
|
emptyTitle: string;
|
|
2754
2755
|
emptyDescription: string;
|
|
2756
|
+
accessRestrictedTitle: string;
|
|
2755
2757
|
errorTitle: string;
|
|
2756
2758
|
errorDescription: string;
|
|
2757
2759
|
retryButton: string;
|
|
@@ -5193,6 +5195,7 @@ interface Labels$1 {
|
|
|
5193
5195
|
verifyErrorTitle: string;
|
|
5194
5196
|
emptyTitle: string;
|
|
5195
5197
|
emptyDescription: string;
|
|
5198
|
+
accessRestrictedTitle: string;
|
|
5196
5199
|
}
|
|
5197
5200
|
|
|
5198
5201
|
interface FeatureLabels$2 {
|
|
@@ -1652,6 +1652,7 @@ interface Labels$4 {
|
|
|
1652
1652
|
routingNumberLabel: string;
|
|
1653
1653
|
addAccountButton: string;
|
|
1654
1654
|
emptyAccountsLabel: string;
|
|
1655
|
+
accessRestrictedTitle: string;
|
|
1655
1656
|
createDialogTitle: string;
|
|
1656
1657
|
createDialogSubtitle: string;
|
|
1657
1658
|
createNicknameLabel: string;
|
|
@@ -1866,6 +1867,7 @@ interface CardsListLabels {
|
|
|
1866
1867
|
loadingLabel: string;
|
|
1867
1868
|
emptyTitle: string;
|
|
1868
1869
|
emptyDescription: string;
|
|
1870
|
+
accessRestrictedTitle: string;
|
|
1869
1871
|
errorTitle: string;
|
|
1870
1872
|
errorDescription: string;
|
|
1871
1873
|
retryButton: string;
|
|
@@ -4089,6 +4091,7 @@ interface Labels$1 {
|
|
|
4089
4091
|
verifyErrorTitle: string;
|
|
4090
4092
|
emptyTitle: string;
|
|
4091
4093
|
emptyDescription: string;
|
|
4094
|
+
accessRestrictedTitle: string;
|
|
4092
4095
|
}
|
|
4093
4096
|
|
|
4094
4097
|
interface FeatureLabels$2 {
|
|
@@ -42,6 +42,7 @@ function l({ labels: e, accountDetailsLabels: r, featureLabels: l, isBankingTagl
|
|
|
42
42
|
return /* @__PURE__ */ c(o, { children: [/* @__PURE__ */ s(t, {}), /* @__PURE__ */ s(n, {
|
|
43
43
|
labels: e,
|
|
44
44
|
accountCardTestId: "bank-accounts-widget-account-card",
|
|
45
|
+
accessRestrictedTestId: "bank-accounts-widget-access-restricted",
|
|
45
46
|
...C
|
|
46
47
|
})] });
|
|
47
48
|
}
|
|
@@ -5,56 +5,56 @@
|
|
|
5
5
|
import { toast as e } from "../../../../../../node_modules/sonner/dist/index.js";
|
|
6
6
|
import { TESOURO_NEW_EMBEDDED_BANK_ACCOUNT_CREATED_SUCCESS_EVENT as t, emitWidgetDomEvent as n } from "../../../../shared/util/dist/lib/widgetDomEvents.js";
|
|
7
7
|
import "../../../../shared/util/dist/index.js";
|
|
8
|
-
import { OrganizationStatus as
|
|
9
|
-
import { useEmbedApi as
|
|
10
|
-
import { Scope as
|
|
8
|
+
import { OrganizationStatus as ee, isOrganizationOnItsWay as te } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
9
|
+
import { useEmbedApi as ne } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
10
|
+
import { Scope as r } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
11
11
|
import { useAllBankAccountsQuery as re } from "../../../../shared/data-access/dist/lib/bank-account/useAllBankAccountsQuery.js";
|
|
12
12
|
import { useAllOrganizationRolesQuery as ie } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
13
13
|
import "../../../../shared/data-access/dist/index.js";
|
|
14
14
|
import { BankAccountsWidgetAnalyticsEvent as i } from "./BankAccountsWidget/analytics/events.js";
|
|
15
|
-
import { accountNumberLast4 as
|
|
16
|
-
import { DEFAULT_FEATURE_LABELS as
|
|
17
|
-
import { getBankAccountsPermissions as
|
|
18
|
-
import { toAccessRows as
|
|
19
|
-
import { DEFAULT_LABELS as
|
|
15
|
+
import { accountNumberLast4 as ae, copyTextToClipboard as oe, formatAmountLabel as a, formatTotalAvailableBalanceLabel as se } from "./formatters.js";
|
|
16
|
+
import { DEFAULT_FEATURE_LABELS as ce } from "./labels.js";
|
|
17
|
+
import { getBankAccountsPermissions as le } from "./permissions.js";
|
|
18
|
+
import { toAccessRows as ue, toOrganizationRoleOptions as de, toTeamMembers as fe } from "./teamMembers.js";
|
|
19
|
+
import { DEFAULT_LABELS as pe } from "../../../ui/dist/lib/labels.js";
|
|
20
20
|
import "../../../../shared/ui/dist/index.js";
|
|
21
21
|
import "../../../ui/dist/index.js";
|
|
22
|
-
import { useAnalyticsTrack as
|
|
23
|
-
import { useRefetchWidget as
|
|
22
|
+
import { useAnalyticsTrack as me } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
23
|
+
import { useRefetchWidget as he, useWidgetConfig as ge, useWidgetError as _e, useWidgetInitStaleForToken as ve, useWidgetLoading as ye } from "../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
24
24
|
import "../../../../shared/feature/dist/index.js";
|
|
25
|
-
import { useCreateBankAccountMutation as
|
|
26
|
-
import { useGrantBankAccountAccessMutation as
|
|
27
|
-
import { useAllOrganizationUsersQuery as
|
|
25
|
+
import { useCreateBankAccountMutation as be } from "../../../data-access/dist/index3.js";
|
|
26
|
+
import { useGrantBankAccountAccessMutation as xe } from "../../../data-access/dist/index4.js";
|
|
27
|
+
import { useAllOrganizationUsersQuery as Se } from "../../../data-access/dist/index5.js";
|
|
28
28
|
import "../../../data-access/dist/index.js";
|
|
29
|
-
import { filterRolesForOrganization as
|
|
30
|
-
import { useCallback as
|
|
31
|
-
import { useControllableState as
|
|
29
|
+
import { filterRolesForOrganization as Ce } from "../../../../../shared/util-validation/dist/index6.js";
|
|
30
|
+
import { useCallback as we, useEffect as o, useMemo as s, useRef as Te, useState as c } from "react";
|
|
31
|
+
import { useControllableState as Ee } from "@radix-ui/react-use-controllable-state";
|
|
32
32
|
// ../../libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js
|
|
33
|
-
var l = { nickname: "" },
|
|
33
|
+
var l = { nickname: "" }, De = r.BankAccountWriteOrg;
|
|
34
34
|
function u(e, t) {
|
|
35
35
|
return e !== void 0 && t !== void 0 && e !== t;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let
|
|
39
|
-
...
|
|
40
|
-
...
|
|
37
|
+
function Oe({ labels: r, featureLabels: ae, isBankingTaglineVisible: a = !0, bankLogoSrc: Oe, bankLogoAlt: Ae, depositAgreementUrl: je, selectedAccountId: Me, defaultSelectedAccountId: Ne, onSelectedAccountIdChange: Pe, "data-testid": Fe } = {}) {
|
|
38
|
+
let Ie = {
|
|
39
|
+
...pe,
|
|
40
|
+
...r
|
|
41
41
|
}, d = {
|
|
42
|
-
...
|
|
43
|
-
...
|
|
44
|
-
}, f =
|
|
45
|
-
p !== void 0 && p !== S &&
|
|
46
|
-
let [C,
|
|
47
|
-
x !== void 0 && x !== C &&
|
|
48
|
-
let [
|
|
49
|
-
prop:
|
|
50
|
-
defaultProp:
|
|
51
|
-
onChange:
|
|
42
|
+
...ce,
|
|
43
|
+
...ae
|
|
44
|
+
}, f = me(), { organizationId: p, widgetToken: Le, initResponse: m } = ge(), Re = ye(), h = ve(), { organizationStatus: g } = ne(), _ = te(g), v = !!_e(), ze = he(), y = !!(p && Le), Be = y || !!Le && g === ee.Rotating, b = s(() => le(m?.scopes), [m?.scopes]), Ve = Be && b.canRead && !!m, x = m?.userId ?? void 0, [S, He] = c(p);
|
|
45
|
+
p !== void 0 && p !== S && He(p);
|
|
46
|
+
let [C, Ue] = c(x);
|
|
47
|
+
x !== void 0 && x !== C && Ue(x);
|
|
48
|
+
let [We, w] = Ee({
|
|
49
|
+
prop: Me,
|
|
50
|
+
defaultProp: Ne ?? null,
|
|
51
|
+
onChange: Pe,
|
|
52
52
|
caller: "BankAccountsWidget"
|
|
53
|
-
}), T =
|
|
53
|
+
}), T = Te({
|
|
54
54
|
organizationId: S,
|
|
55
55
|
userId: C
|
|
56
|
-
}),
|
|
57
|
-
|
|
56
|
+
}), Ge = u(T.current.organizationId, S) || u(T.current.userId, C);
|
|
57
|
+
o(() => {
|
|
58
58
|
let e = T.current;
|
|
59
59
|
T.current = {
|
|
60
60
|
organizationId: S,
|
|
@@ -65,142 +65,143 @@ function De({ labels: ne, featureLabels: a, isBankingTaglineVisible: o = !0, ban
|
|
|
65
65
|
C,
|
|
66
66
|
w
|
|
67
67
|
]);
|
|
68
|
-
let E =
|
|
68
|
+
let Ke = h && !b.canRead, E = !v && !h && !!m && !b.canRead, qe = Ge || E ? null : We, D = Ve && !qe, O = we((e) => {
|
|
69
69
|
w(e);
|
|
70
|
-
}, [w]), [k, A] = c(!1), [j, M] = c(l), [
|
|
71
|
-
|
|
70
|
+
}, [w]), [k, A] = c(!1), [j, M] = c(l), [N, P] = c([]), [Je, F] = c(!1), [Ye, I] = c(!1), [Xe, L] = c(), [Ze, Qe] = c({}), [R, $e] = c({});
|
|
71
|
+
o(() => {
|
|
72
72
|
f(i.Mounted);
|
|
73
73
|
}, [f]);
|
|
74
|
-
let
|
|
75
|
-
enabled:
|
|
76
|
-
permissions: [
|
|
77
|
-
}),
|
|
78
|
-
let e =
|
|
74
|
+
let z = re({ enabled: D }), B = be(), V = xe(), H = k && !E, U = Se({ enabled: H }), W = ie({ enabled: H }), G = Se({
|
|
75
|
+
enabled: H,
|
|
76
|
+
permissions: [De]
|
|
77
|
+
}), et = s(() => new Set((G.data?.data ?? []).filter((e) => e.organizationId === p).map((e) => e.id)), [G.data?.data, p]), K = s(() => {
|
|
78
|
+
let e = W.data?.data ?? [], t = p ? Ce(e, {
|
|
79
79
|
organizationId: p,
|
|
80
|
-
organizationTypes:
|
|
80
|
+
organizationTypes: m?.organizationTypes ?? []
|
|
81
81
|
}) : e;
|
|
82
|
-
return
|
|
82
|
+
return fe(U.data?.data ?? [], de(t), et);
|
|
83
83
|
}, [
|
|
84
|
-
|
|
84
|
+
et,
|
|
85
|
+
W.data?.data,
|
|
85
86
|
U.data?.data,
|
|
86
|
-
H.data?.data,
|
|
87
87
|
p,
|
|
88
|
-
|
|
89
|
-
]),
|
|
88
|
+
m?.organizationTypes
|
|
89
|
+
]), tt = U.isError && U.isFetching, nt = G.isError && G.isFetching, q = U.isLoading || U.isFetchingNextPage || !!U.hasNextPage || tt || W.isResolving || G.isLoading || G.isFetchingNextPage || !!G.hasNextPage || nt, rt = U.isError && !tt || G.isError && !nt, it = !q && !rt, at = () => {
|
|
90
90
|
for (let e of [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
U,
|
|
92
|
+
G,
|
|
93
|
+
W
|
|
94
94
|
]) e.isError && e.refetch();
|
|
95
|
-
},
|
|
96
|
-
await
|
|
95
|
+
}, J = D ? z.data?.data ?? [] : [], ot = [.../* @__PURE__ */ new Set([...K.filter((e) => e.locked).map((e) => e.id), ...N])], Y = m?.bankName?.trim() ?? "", st = m?.vspName?.trim() ?? "", ct = je?.trim() || void 0, X = y && b.canWrite && !E, Z = !z.hasNextPage && !z.isFetchingNextPage, lt = s(() => Z ? se(J) : void 0, [J, Z]), ut = J.length > 1 && b.canRead && Z, Q = we(async (e, t, n) => {
|
|
96
|
+
await oe(n) && ($e((n) => ({
|
|
97
97
|
...n,
|
|
98
98
|
[e]: t
|
|
99
99
|
})), window.setTimeout(() => {
|
|
100
|
-
|
|
100
|
+
$e((t) => ({
|
|
101
101
|
...t,
|
|
102
102
|
[e]: void 0
|
|
103
103
|
}));
|
|
104
104
|
}, 2e3));
|
|
105
|
-
}, []),
|
|
106
|
-
isAccountNumberVisible:
|
|
107
|
-
isAccountNumberCopied:
|
|
108
|
-
isRoutingNumberCopied:
|
|
109
|
-
onToggleAccountNumberVisibility: () =>
|
|
105
|
+
}, []), dt = s(() => J.map((e) => ke(e, d, {
|
|
106
|
+
isAccountNumberVisible: Ze[e.id] ?? !1,
|
|
107
|
+
isAccountNumberCopied: R[e.id] === "account",
|
|
108
|
+
isRoutingNumberCopied: R[e.id] === "routing",
|
|
109
|
+
onToggleAccountNumberVisibility: () => Qe((t) => ({
|
|
110
110
|
...t,
|
|
111
111
|
[e.id]: !t[e.id]
|
|
112
112
|
})),
|
|
113
|
-
onCopyAccountNumber: () => void
|
|
114
|
-
onCopyRoutingNumber: () => void
|
|
113
|
+
onCopyAccountNumber: () => void Q(e.id, "account", e.accountNumber),
|
|
114
|
+
onCopyRoutingNumber: () => void Q(e.id, "routing", e.routingNumber),
|
|
115
115
|
onSelect: () => {
|
|
116
116
|
O(e.id), f(i.AccountSelected, { accountId: e.id });
|
|
117
117
|
}
|
|
118
118
|
})), [
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
J,
|
|
120
|
+
Ze,
|
|
121
|
+
R,
|
|
122
122
|
d,
|
|
123
|
-
|
|
123
|
+
Q,
|
|
124
124
|
O,
|
|
125
125
|
f
|
|
126
|
-
]),
|
|
127
|
-
|
|
128
|
-
path: { id:
|
|
129
|
-
body: { userIds:
|
|
126
|
+
]), ft = (ee) => {
|
|
127
|
+
V.mutate({
|
|
128
|
+
path: { id: ee },
|
|
129
|
+
body: { userIds: ot }
|
|
130
130
|
}, { onSuccess: () => {
|
|
131
|
-
n(t), e.success(d.createSuccessToast), M(l),
|
|
131
|
+
n(t), e.success(d.createSuccessToast), M(l), P([]), L(void 0), F(!1), A(!1);
|
|
132
132
|
} });
|
|
133
|
-
},
|
|
134
|
-
if (!
|
|
135
|
-
if (!
|
|
136
|
-
|
|
133
|
+
}, pt = () => {
|
|
134
|
+
if (!X) return;
|
|
135
|
+
if (!it) {
|
|
136
|
+
q || at();
|
|
137
137
|
return;
|
|
138
138
|
}
|
|
139
|
-
let e = j.nickname.trim() === "", t =
|
|
140
|
-
|
|
141
|
-
f(i.AccountCreated, { accountId: e?.id }), e?.id && (
|
|
139
|
+
let e = j.nickname.trim() === "", t = ot.length === 0;
|
|
140
|
+
F(e), I(t), !(e || t) && (Xe ? ft(Xe) : B.mutate({ body: { nickname: j.nickname.trim() } }, { onSuccess: (e) => {
|
|
141
|
+
f(i.AccountCreated, { accountId: e?.id }), e?.id && (L(e.id), ft(e.id));
|
|
142
142
|
} }));
|
|
143
|
-
},
|
|
144
|
-
|
|
145
|
-
},
|
|
146
|
-
(!e ||
|
|
147
|
-
},
|
|
148
|
-
$ !==
|
|
149
|
-
let
|
|
150
|
-
selectedUserIds:
|
|
151
|
-
disabled:
|
|
152
|
-
fallbackTooltip:
|
|
153
|
-
onUserToggle:
|
|
143
|
+
}, mt = (e, t) => {
|
|
144
|
+
K.find((t) => t.id === e)?.locked || (I(!1), P((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e)));
|
|
145
|
+
}, ht = (e) => {
|
|
146
|
+
(!e || X) && (e && (M(l), P([]), L(void 0), F(!1), I(!1), B.reset(), V.reset()), A(e));
|
|
147
|
+
}, gt = B.isPending || V.isPending, _t = !y && _, $ = !y && !_ || E, [vt, yt] = c($);
|
|
148
|
+
$ !== vt && (yt($), $ && A(!1));
|
|
149
|
+
let bt = ue(K, {
|
|
150
|
+
selectedUserIds: N,
|
|
151
|
+
disabled: gt || !b.canWrite,
|
|
152
|
+
fallbackTooltip: Ie.teamMemberAccessTooltip,
|
|
153
|
+
onUserToggle: mt
|
|
154
154
|
});
|
|
155
155
|
return {
|
|
156
|
-
"data-testid":
|
|
157
|
-
selectedAccountId:
|
|
158
|
-
bankDisplayName:
|
|
159
|
-
bankLogoSrc:
|
|
160
|
-
bankLogoAlt:
|
|
161
|
-
availableBalanceLabel:
|
|
162
|
-
shouldDisplayAvailableBalance:
|
|
163
|
-
isBankingTaglineVisible:
|
|
164
|
-
accountCards:
|
|
156
|
+
"data-testid": Fe,
|
|
157
|
+
selectedAccountId: qe,
|
|
158
|
+
bankDisplayName: Y,
|
|
159
|
+
bankLogoSrc: Oe,
|
|
160
|
+
bankLogoAlt: Ae,
|
|
161
|
+
availableBalanceLabel: lt,
|
|
162
|
+
shouldDisplayAvailableBalance: ut,
|
|
163
|
+
isBankingTaglineVisible: a,
|
|
164
|
+
accountCards: dt,
|
|
165
165
|
shouldDisplayAddAccountCard: b.canWrite,
|
|
166
|
-
isLoading: !v && (_ && !
|
|
167
|
-
isError: v || D &&
|
|
168
|
-
|
|
166
|
+
isLoading: !v && (Ke || _ && !z.data || Re && !m || D && (z.isLoading || z.isFetchingNextPage || z.hasNextPage)),
|
|
167
|
+
isError: v || D && z.isError,
|
|
168
|
+
isAccessRestricted: E,
|
|
169
|
+
onRetry: v ? ze : () => void z.refetch(),
|
|
169
170
|
isCreateOpen: k,
|
|
170
171
|
createForm: j,
|
|
171
172
|
legalCopy: {
|
|
172
|
-
bankName:
|
|
173
|
-
vspName:
|
|
174
|
-
agreementUrl:
|
|
173
|
+
bankName: Y,
|
|
174
|
+
vspName: st,
|
|
175
|
+
agreementUrl: ct
|
|
175
176
|
},
|
|
176
|
-
accessRows:
|
|
177
|
-
isTeamMembersLoading:
|
|
178
|
-
isTeamMembersError:
|
|
179
|
-
isCreateError:
|
|
180
|
-
hasNicknameError:
|
|
181
|
-
hasTeamAccessError:
|
|
182
|
-
isSubmitting:
|
|
183
|
-
isAuthPending:
|
|
184
|
-
isCreateDisabled: !
|
|
185
|
-
onCreateOpenChange:
|
|
177
|
+
accessRows: bt,
|
|
178
|
+
isTeamMembersLoading: q,
|
|
179
|
+
isTeamMembersError: rt,
|
|
180
|
+
isCreateError: B.isError || V.isError,
|
|
181
|
+
hasNicknameError: Je,
|
|
182
|
+
hasTeamAccessError: Ye,
|
|
183
|
+
isSubmitting: gt,
|
|
184
|
+
isAuthPending: _t,
|
|
185
|
+
isCreateDisabled: !X,
|
|
186
|
+
onCreateOpenChange: ht,
|
|
186
187
|
onCreateFormChange: (e) => {
|
|
187
|
-
|
|
188
|
+
F(!1), M(e);
|
|
188
189
|
},
|
|
189
|
-
onCreateSubmit:
|
|
190
|
-
onTeamMembersRetry:
|
|
191
|
-
onAddAccountClick: () =>
|
|
190
|
+
onCreateSubmit: pt,
|
|
191
|
+
onTeamMembersRetry: at,
|
|
192
|
+
onAddAccountClick: () => ht(!0),
|
|
192
193
|
onSelectAccount: O
|
|
193
194
|
};
|
|
194
195
|
}
|
|
195
|
-
function
|
|
196
|
+
function ke(e, t, n) {
|
|
196
197
|
return {
|
|
197
198
|
id: e.id,
|
|
198
199
|
name: e.nickname?.trim() || t.accountFallback,
|
|
199
|
-
balanceLabel:
|
|
200
|
+
balanceLabel: a(e.balance),
|
|
200
201
|
accountNumberLabel: e.accountNumber,
|
|
201
|
-
accountNumberLast4:
|
|
202
|
+
accountNumberLast4: ae(e.accountNumber),
|
|
202
203
|
routingNumberLabel: e.routingNumber,
|
|
203
204
|
...n
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
|
-
export {
|
|
207
|
+
export { Oe as useBankAccountsWidget };
|
|
@@ -7,78 +7,82 @@ import { DEFAULT_LABELS as t } from "./labels.js";
|
|
|
7
7
|
import { AddTile as n } from "../../../../shared/ui/dist/lib/AddTile/AddTile.js";
|
|
8
8
|
import { EmptyState as r } from "../../../../shared/ui/dist/lib/EmptyState/EmptyState.js";
|
|
9
9
|
import { ErrorState as i } from "../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
10
|
-
import {
|
|
10
|
+
import { NoAccessState as a } from "../../../../shared/ui/dist/lib/StatePanel/NoAccessState.js";
|
|
11
|
+
import { LoadingRegion as o } from "../../../../shared/ui/dist/lib/LoadingRegion/LoadingRegion.js";
|
|
11
12
|
import "../../../../shared/ui/dist/index.js";
|
|
12
|
-
import { AccountCard as
|
|
13
|
-
import { BankingHeader as
|
|
14
|
-
import { CreateAccountDialog as
|
|
15
|
-
import { Fragment as
|
|
16
|
-
import { LandmarkIcon as
|
|
13
|
+
import { AccountCard as s, AccountCardSkeleton as c } from "./AccountCard.js";
|
|
14
|
+
import { BankingHeader as l } from "./BankingHeader.js";
|
|
15
|
+
import { CreateAccountDialog as u } from "./CreateAccountDialog.js";
|
|
16
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
17
|
+
import { LandmarkIcon as m } from "lucide-react";
|
|
17
18
|
// ../../libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js
|
|
18
|
-
function
|
|
19
|
-
let
|
|
19
|
+
function h({ labels: h, "data-testid": g, bankDisplayName: _, bankLogoSrc: v, bankLogoAlt: y, availableBalanceLabel: b, shouldDisplayAvailableBalance: x, isBankingTaglineVisible: S, accountCards: C, accountCardTestId: w, shouldDisplayAddAccountCard: T, isLoading: E, isError: D, isAccessRestricted: O = !1, accessRestrictedTestId: k, onRetry: A, isCreateOpen: j, createForm: M, legalCopy: N, accessRows: P, isTeamMembersLoading: F, isTeamMembersError: I, isCreateError: L, hasNicknameError: R, hasTeamAccessError: z, isSubmitting: B, isAuthPending: V = !1, isCreateDisabled: H, onCreateOpenChange: U, onCreateFormChange: W, onCreateSubmit: G, onTeamMembersRetry: K, onAddAccountClick: q }) {
|
|
20
|
+
let J = {
|
|
20
21
|
...t,
|
|
21
|
-
...
|
|
22
|
-
},
|
|
23
|
-
label:
|
|
24
|
-
disabled:
|
|
25
|
-
onClick:
|
|
22
|
+
...h
|
|
23
|
+
}, Y = !E && !D && C.length === 0, X = T ? /* @__PURE__ */ f(n, {
|
|
24
|
+
label: J.addAccountButton,
|
|
25
|
+
disabled: H,
|
|
26
|
+
onClick: q,
|
|
26
27
|
className: "ttw:w-80 ttw:max-w-full ttw:min-h-52"
|
|
27
28
|
}) : null;
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ p("section", {
|
|
29
30
|
className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-6",
|
|
30
|
-
"data-testid":
|
|
31
|
+
"data-testid": g,
|
|
31
32
|
children: [
|
|
32
|
-
/* @__PURE__ */
|
|
33
|
-
labels:
|
|
34
|
-
open:
|
|
35
|
-
form:
|
|
36
|
-
legalCopy:
|
|
37
|
-
accessRows:
|
|
38
|
-
isTeamMembersLoading:
|
|
39
|
-
isTeamMembersError:
|
|
40
|
-
isSubmitting:
|
|
41
|
-
isAuthPending:
|
|
42
|
-
isError:
|
|
43
|
-
hasNicknameError:
|
|
44
|
-
hasTeamAccessError:
|
|
45
|
-
onOpenChange:
|
|
46
|
-
onFormChange:
|
|
47
|
-
onSubmit:
|
|
48
|
-
onTeamMembersRetry:
|
|
33
|
+
/* @__PURE__ */ f(u, {
|
|
34
|
+
labels: J,
|
|
35
|
+
open: j,
|
|
36
|
+
form: M,
|
|
37
|
+
legalCopy: N,
|
|
38
|
+
accessRows: P,
|
|
39
|
+
isTeamMembersLoading: F,
|
|
40
|
+
isTeamMembersError: I,
|
|
41
|
+
isSubmitting: B,
|
|
42
|
+
isAuthPending: V,
|
|
43
|
+
isError: L,
|
|
44
|
+
hasNicknameError: R,
|
|
45
|
+
hasTeamAccessError: z,
|
|
46
|
+
onOpenChange: U,
|
|
47
|
+
onFormChange: W,
|
|
48
|
+
onSubmit: G,
|
|
49
|
+
onTeamMembersRetry: K
|
|
49
50
|
}),
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
labels:
|
|
52
|
-
bankDisplayName:
|
|
53
|
-
bankLogoSrc:
|
|
54
|
-
bankLogoAlt:
|
|
55
|
-
availableBalanceLabel:
|
|
56
|
-
shouldDisplayAvailableBalance:
|
|
57
|
-
isBankingTaglineVisible:
|
|
51
|
+
/* @__PURE__ */ f(l, {
|
|
52
|
+
labels: J,
|
|
53
|
+
bankDisplayName: _,
|
|
54
|
+
bankLogoSrc: v,
|
|
55
|
+
bankLogoAlt: y,
|
|
56
|
+
availableBalanceLabel: b,
|
|
57
|
+
shouldDisplayAvailableBalance: x,
|
|
58
|
+
isBankingTaglineVisible: S
|
|
58
59
|
}),
|
|
59
|
-
|
|
60
|
-
title:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
O ? /* @__PURE__ */ f(a, {
|
|
61
|
+
title: J.accessRestrictedTitle,
|
|
62
|
+
testId: k
|
|
63
|
+
}) : D ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(i, {
|
|
64
|
+
title: J.errorTitle,
|
|
65
|
+
retryLabel: J.retryButton,
|
|
66
|
+
onRetry: A
|
|
67
|
+
}), X ? /* @__PURE__ */ f("div", {
|
|
64
68
|
className: "ttw:flex ttw:flex-wrap ttw:gap-4",
|
|
65
|
-
children:
|
|
66
|
-
}) : null] }) :
|
|
67
|
-
icon: /* @__PURE__ */
|
|
68
|
-
title:
|
|
69
|
-
actionLabel:
|
|
70
|
-
onAction:
|
|
71
|
-
}) : /* @__PURE__ */
|
|
72
|
-
isLoading:
|
|
73
|
-
loadingLabel:
|
|
69
|
+
children: X
|
|
70
|
+
}) : null] }) : Y ? /* @__PURE__ */ f(r, {
|
|
71
|
+
icon: /* @__PURE__ */ f(m, {}),
|
|
72
|
+
title: J.emptyAccountsLabel,
|
|
73
|
+
actionLabel: T ? J.addAccountButton : void 0,
|
|
74
|
+
onAction: T && !H ? q : void 0
|
|
75
|
+
}) : /* @__PURE__ */ f(o, {
|
|
76
|
+
isLoading: E,
|
|
77
|
+
loadingLabel: J.loadingLabel,
|
|
74
78
|
className: "ttw:flex ttw:flex-wrap ttw:gap-4",
|
|
75
|
-
children:
|
|
76
|
-
labels:
|
|
79
|
+
children: E ? /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(c, {}), /* @__PURE__ */ f(c, {})] }) : /* @__PURE__ */ p(e, { children: [C.map((e) => /* @__PURE__ */ f(s, {
|
|
80
|
+
labels: J,
|
|
77
81
|
card: e,
|
|
78
|
-
testId:
|
|
79
|
-
}, e.id)),
|
|
82
|
+
testId: w
|
|
83
|
+
}, e.id)), X] })
|
|
80
84
|
})
|
|
81
85
|
]
|
|
82
86
|
});
|
|
83
87
|
}
|
|
84
|
-
export {
|
|
88
|
+
export { h as BankAccountsWidgetUi };
|
package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js
CHANGED
|
@@ -7,6 +7,7 @@ var e = {
|
|
|
7
7
|
routingNumberLabel: "Routing number",
|
|
8
8
|
addAccountButton: "Add account",
|
|
9
9
|
emptyAccountsLabel: "No accounts yet",
|
|
10
|
+
accessRestrictedTitle: "You don't have access to bank accounts",
|
|
10
11
|
createDialogTitle: "Create an account",
|
|
11
12
|
createDialogSubtitle: "The account gets its own account number.",
|
|
12
13
|
createNicknameLabel: "Account nickname",
|
package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js
CHANGED
|
@@ -4,11 +4,13 @@ var e = {
|
|
|
4
4
|
row: "cards-list-row",
|
|
5
5
|
empty: "cards-list-empty",
|
|
6
6
|
error: "cards-list-error",
|
|
7
|
+
accessRestricted: "cards-list-access-restricted",
|
|
7
8
|
detailsSheet: "cards-list-details-sheet"
|
|
8
9
|
}, t = {
|
|
9
10
|
root: e.list,
|
|
10
11
|
empty: e.empty,
|
|
11
12
|
error: e.error,
|
|
13
|
+
accessRestricted: e.accessRestricted,
|
|
12
14
|
row: e.row
|
|
13
15
|
}, n = { root: e.detailsSheet };
|
|
14
16
|
export { n as cardsListDetailsSheetTestIds, t as cardsListTestIds, e as cardsWidgetTestIds };
|