@tesouro/embedded-components-react 0.11.60 → 0.11.62
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/README.md +21 -21
- package/dist/index.css +37 -160
- package/dist/index.d.ts +50 -17
- package/dist/lib/BankAccountsWidget.d.ts +20 -7
- package/dist/lib/LinkedAccountsWidget.d.ts +30 -10
- package/dist/lib/WidgetSuite.d.ts +50 -17
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index3.js +21 -26
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index4.js +18 -16
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index5.js +22 -35
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index6.js +29 -14
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index7.js +20 -24
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/data-access/dist/index8.js +31 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index10.js +296 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index12.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index5.js +5 -10
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index9.js +42 -281
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index.js +5 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index10.js +180 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index2.js +16 -184
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index3.js +9 -93
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index4.js +136 -81
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index5.js +64 -101
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index6.js +54 -81
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index7.js +90 -65
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index8.js +108 -183
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/ui/dist/index9.js +76 -0
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/BankAccountsWidget/BankAccountsWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/labels.js +6 -8
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js +137 -120
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/mocks/labels.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js +47 -60
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js +71 -72
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankingHeader.js +22 -37
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/CreateAccountDialog.js +119 -133
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/labels.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/labels.js +9 -7
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/rows.js +46 -27
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useAdminEligibleUserIds.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +248 -224
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/labels.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index10.js +22 -36
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index11.js +23 -70
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index12.js +91 -27
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index13.js +80 -63
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index14.js +145 -125
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index2.js +61 -9
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index3.js +77 -50
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index4.js +180 -65
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +22 -178
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index6.js +6 -75
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index7.js +48 -11
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index8.js +45 -7
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index9.js +8 -82
- 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 -14
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AddTile/AddTile.js +17 -0
- package/dist/packages/shared-ui-shadcn/dist/index.js +3603 -3518
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/account-details/feature/dist/index11.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +0 -67
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index16.js +0 -138
|
@@ -20,162 +20,179 @@ import { DEFAULT_LABELS as fe } from "../../../ui/dist/lib/labels.js";
|
|
|
20
20
|
import "../../../../shared/ui/dist/index.js";
|
|
21
21
|
import "../../../ui/dist/index.js";
|
|
22
22
|
import { useAnalyticsTrack as pe } from "../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
23
|
-
import {
|
|
23
|
+
import { useRefetchWidget as me, useWidgetConfig as he, useWidgetError as ge, useWidgetLoading as _e } 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 ve } from "../../../data-access/dist/index3.js";
|
|
26
|
+
import { useGrantBankAccountAccessMutation as ye } from "../../../data-access/dist/index4.js";
|
|
27
|
+
import { useAllOrganizationUsersQuery as be } 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 xe } from "../../../../../shared/util-validation/dist/index6.js";
|
|
30
|
+
import { useCallback as Se, useEffect as Ce, useMemo as s, useRef as we, useState as c } from "react";
|
|
31
|
+
import { useControllableState as Te } from "@radix-ui/react-use-controllable-state";
|
|
32
32
|
// ../../libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/useBankAccountsWidget.js
|
|
33
|
-
var
|
|
34
|
-
function
|
|
33
|
+
var l = { nickname: "" }, Ee = ne.BankAccountWriteOrg;
|
|
34
|
+
function u(e, t) {
|
|
35
35
|
return e !== void 0 && t !== void 0 && e !== t;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
let
|
|
37
|
+
function De({ labels: ne, featureLabels: a, isBankingTaglineVisible: o = !0, bankLogoSrc: De, bankLogoAlt: ke, depositAgreementUrl: Ae, selectedAccountId: je, defaultSelectedAccountId: Me, onSelectedAccountIdChange: Ne, "data-testid": Pe } = {}) {
|
|
38
|
+
let Fe = {
|
|
39
39
|
...fe,
|
|
40
40
|
...ne
|
|
41
|
-
},
|
|
41
|
+
}, d = {
|
|
42
42
|
...se,
|
|
43
43
|
...a
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
let [
|
|
47
|
-
|
|
48
|
-
let [
|
|
49
|
-
prop:
|
|
50
|
-
defaultProp:
|
|
51
|
-
onChange:
|
|
44
|
+
}, f = pe(), { organizationId: p, widgetToken: m, initResponse: h } = he(), Ie = _e(), { organizationStatus: g } = te(), _ = ee(g), v = !!ge(), Le = me(), y = !!(p && m), Re = y || !!m && g === r.Rotating, b = s(() => ce(h?.scopes), [h?.scopes]), ze = Re && b.canRead && !!h, x = h?.userId ?? void 0, [S, Be] = c(p);
|
|
45
|
+
p !== void 0 && p !== S && Be(p);
|
|
46
|
+
let [C, Ve] = c(x);
|
|
47
|
+
x !== void 0 && x !== C && Ve(x);
|
|
48
|
+
let [He, w] = Te({
|
|
49
|
+
prop: je,
|
|
50
|
+
defaultProp: Me ?? null,
|
|
51
|
+
onChange: Ne,
|
|
52
52
|
caller: "BankAccountsWidget"
|
|
53
|
-
}),
|
|
54
|
-
organizationId:
|
|
55
|
-
userId:
|
|
56
|
-
}),
|
|
57
|
-
|
|
58
|
-
let e =
|
|
59
|
-
|
|
60
|
-
organizationId:
|
|
61
|
-
userId:
|
|
62
|
-
}, (
|
|
53
|
+
}), T = we({
|
|
54
|
+
organizationId: S,
|
|
55
|
+
userId: C
|
|
56
|
+
}), Ue = u(T.current.organizationId, S) || u(T.current.userId, C);
|
|
57
|
+
Ce(() => {
|
|
58
|
+
let e = T.current;
|
|
59
|
+
T.current = {
|
|
60
|
+
organizationId: S,
|
|
61
|
+
userId: C
|
|
62
|
+
}, (u(e.organizationId, S) || u(e.userId, C)) && w(null);
|
|
63
63
|
}, [
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
S,
|
|
65
|
+
C,
|
|
66
|
+
w
|
|
67
67
|
]);
|
|
68
|
-
let
|
|
69
|
-
|
|
70
|
-
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, [
|
|
74
|
-
let
|
|
75
|
-
enabled:
|
|
76
|
-
permissions: [
|
|
77
|
-
}),
|
|
78
|
-
let e =
|
|
79
|
-
organizationId:
|
|
80
|
-
organizationTypes:
|
|
68
|
+
let E = Ue ? null : He, D = ze && !E, O = Se((e) => {
|
|
69
|
+
w(e);
|
|
70
|
+
}, [w]), [k, A] = c(!1), [j, M] = c(l), [We, N] = c([]), [Ge, P] = c(!1), [Ke, F] = c(!1), [qe, I] = c(), [Je, Ye] = c({}), [L, Xe] = c({});
|
|
71
|
+
Ce(() => {
|
|
72
|
+
f(i.Mounted);
|
|
73
|
+
}, [f]);
|
|
74
|
+
let R = re({ enabled: D }), z = ve(), B = ye(), V = k, H = be({ enabled: V }), U = ie({ enabled: V }), W = be({
|
|
75
|
+
enabled: V,
|
|
76
|
+
permissions: [Ee]
|
|
77
|
+
}), Ze = s(() => new Set((W.data?.data ?? []).filter((e) => e.organizationId === p).map((e) => e.id)), [W.data?.data, p]), G = s(() => {
|
|
78
|
+
let e = U.data?.data ?? [], t = p ? xe(e, {
|
|
79
|
+
organizationId: p,
|
|
80
|
+
organizationTypes: h?.organizationTypes ?? []
|
|
81
81
|
}) : e;
|
|
82
|
-
return de(
|
|
82
|
+
return de(H.data?.data ?? [], ue(t), Ze);
|
|
83
83
|
}, [
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
]),
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
Ze,
|
|
85
|
+
U.data?.data,
|
|
86
|
+
H.data?.data,
|
|
87
|
+
p,
|
|
88
|
+
h?.organizationTypes
|
|
89
|
+
]), Qe = H.isError && H.isFetching, $e = W.isError && W.isFetching, K = H.isLoading || H.isFetchingNextPage || !!H.hasNextPage || Qe || U.isResolving || W.isLoading || W.isFetchingNextPage || !!W.hasNextPage || $e, et = H.isError && !Qe || W.isError && !$e, tt = !K && !et, nt = () => {
|
|
90
|
+
for (let e of [
|
|
91
|
+
H,
|
|
92
|
+
W,
|
|
93
|
+
U
|
|
94
|
+
]) e.isError && e.refetch();
|
|
95
|
+
}, q = D ? R.data?.data ?? [] : [], J = [.../* @__PURE__ */ new Set([...G.filter((e) => e.locked).map((e) => e.id), ...We])], rt = h?.bankName?.trim() ?? "", it = h?.vspName?.trim() ?? "", at = Ae?.trim() || void 0, Y = y && b.canWrite, X = !R.hasNextPage && !R.isFetchingNextPage, ot = s(() => X ? oe(q) : void 0, [q, X]), st = q.length > 1 && b.canRead && X, Z = Se(async (e, t, n) => {
|
|
96
|
+
await ae(n) && (Xe((n) => ({
|
|
97
|
+
...n,
|
|
98
|
+
[e]: t
|
|
93
99
|
})), window.setTimeout(() => {
|
|
94
|
-
|
|
95
|
-
...
|
|
96
|
-
[
|
|
100
|
+
Xe((t) => ({
|
|
101
|
+
...t,
|
|
102
|
+
[e]: void 0
|
|
97
103
|
}));
|
|
98
104
|
}, 2e3));
|
|
99
|
-
}, [
|
|
100
|
-
isAccountNumberVisible:
|
|
101
|
-
isAccountNumberCopied:
|
|
102
|
-
isRoutingNumberCopied:
|
|
103
|
-
onToggleAccountNumberVisibility: () =>
|
|
105
|
+
}, []), ct = s(() => q.map((e) => Oe(e, d, {
|
|
106
|
+
isAccountNumberVisible: Je[e.id] ?? !1,
|
|
107
|
+
isAccountNumberCopied: L[e.id] === "account",
|
|
108
|
+
isRoutingNumberCopied: L[e.id] === "routing",
|
|
109
|
+
onToggleAccountNumberVisibility: () => Ye((t) => ({
|
|
104
110
|
...t,
|
|
105
111
|
[e.id]: !t[e.id]
|
|
106
112
|
})),
|
|
107
|
-
onCopyAccountNumber: () => void
|
|
108
|
-
onCopyRoutingNumber: () => void
|
|
113
|
+
onCopyAccountNumber: () => void Z(e.id, "account", e.accountNumber),
|
|
114
|
+
onCopyRoutingNumber: () => void Z(e.id, "routing", e.routingNumber),
|
|
109
115
|
onSelect: () => {
|
|
110
|
-
|
|
116
|
+
O(e.id), f(i.AccountSelected, { accountId: e.id });
|
|
111
117
|
}
|
|
112
118
|
})), [
|
|
113
|
-
|
|
119
|
+
q,
|
|
120
|
+
Je,
|
|
114
121
|
L,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
H.mutate({
|
|
122
|
+
d,
|
|
123
|
+
Z,
|
|
124
|
+
O,
|
|
125
|
+
f
|
|
126
|
+
]), lt = (r) => {
|
|
127
|
+
B.mutate({
|
|
122
128
|
path: { id: r },
|
|
123
|
-
body: { userIds:
|
|
129
|
+
body: { userIds: J }
|
|
124
130
|
}, { onSuccess: () => {
|
|
125
|
-
n(t), e.success(
|
|
131
|
+
n(t), e.success(d.createSuccessToast), M(l), N([]), I(void 0), P(!1), A(!1);
|
|
126
132
|
} });
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
}, ut = () => {
|
|
134
|
+
if (!Y) return;
|
|
135
|
+
if (!tt) {
|
|
136
|
+
K || nt();
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
let e = j.nickname.trim() === "", t = J.length === 0;
|
|
140
|
+
P(e), F(t), !(e || t) && (qe ? lt(qe) : z.mutate({ body: { nickname: j.nickname.trim() } }, { onSuccess: (e) => {
|
|
141
|
+
f(i.AccountCreated, { accountId: e?.id }), e?.id && (I(e.id), lt(e.id));
|
|
130
142
|
} }));
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
(!e ||
|
|
135
|
-
},
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
143
|
+
}, dt = (e, t) => {
|
|
144
|
+
G.find((t) => t.id === e)?.locked || (F(!1), N((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e)));
|
|
145
|
+
}, ft = (e) => {
|
|
146
|
+
(!e || Y) && (e && (M(l), N([]), I(void 0), P(!1), F(!1), z.reset(), B.reset()), A(e));
|
|
147
|
+
}, Q = z.isPending || B.isPending, pt = !y && _, $ = !y && !_, [mt, ht] = c($);
|
|
148
|
+
$ !== mt && (ht($), $ && A(!1));
|
|
149
|
+
let gt = le(G, {
|
|
150
|
+
selectedUserIds: We,
|
|
151
|
+
disabled: Q || !b.canWrite,
|
|
152
|
+
fallbackTooltip: Fe.teamMemberAccessTooltip,
|
|
153
|
+
onUserToggle: dt
|
|
140
154
|
});
|
|
141
155
|
return {
|
|
142
|
-
"data-testid":
|
|
143
|
-
selectedAccountId:
|
|
144
|
-
bankDisplayName:
|
|
145
|
-
bankLogoSrc:
|
|
146
|
-
bankLogoAlt:
|
|
147
|
-
availableBalanceLabel:
|
|
148
|
-
shouldDisplayAvailableBalance:
|
|
156
|
+
"data-testid": Pe,
|
|
157
|
+
selectedAccountId: E,
|
|
158
|
+
bankDisplayName: rt,
|
|
159
|
+
bankLogoSrc: De,
|
|
160
|
+
bankLogoAlt: ke,
|
|
161
|
+
availableBalanceLabel: ot,
|
|
162
|
+
shouldDisplayAvailableBalance: st,
|
|
149
163
|
isBankingTaglineVisible: o,
|
|
150
|
-
accountCards:
|
|
151
|
-
shouldDisplayAddAccountCard:
|
|
152
|
-
isLoading: !
|
|
153
|
-
isError:
|
|
154
|
-
|
|
155
|
-
|
|
164
|
+
accountCards: ct,
|
|
165
|
+
shouldDisplayAddAccountCard: b.canWrite,
|
|
166
|
+
isLoading: !v && (_ && !R.data || Ie && !h || D && (R.isLoading || R.isFetchingNextPage || R.hasNextPage)),
|
|
167
|
+
isError: v || D && R.isError,
|
|
168
|
+
onRetry: v ? Le : () => void R.refetch(),
|
|
169
|
+
isCreateOpen: k,
|
|
170
|
+
createForm: j,
|
|
156
171
|
legalCopy: {
|
|
157
|
-
bankName:
|
|
158
|
-
vspName:
|
|
159
|
-
agreementUrl:
|
|
172
|
+
bankName: rt,
|
|
173
|
+
vspName: it,
|
|
174
|
+
agreementUrl: at
|
|
160
175
|
},
|
|
161
|
-
accessRows:
|
|
162
|
-
isTeamMembersLoading:
|
|
163
|
-
isTeamMembersError:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
isSubmitting:
|
|
168
|
-
|
|
169
|
-
|
|
176
|
+
accessRows: gt,
|
|
177
|
+
isTeamMembersLoading: K,
|
|
178
|
+
isTeamMembersError: et,
|
|
179
|
+
isCreateError: z.isError || B.isError,
|
|
180
|
+
hasNicknameError: Ge,
|
|
181
|
+
hasTeamAccessError: Ke,
|
|
182
|
+
isSubmitting: Q,
|
|
183
|
+
isAuthPending: pt,
|
|
184
|
+
isCreateDisabled: !Y,
|
|
185
|
+
onCreateOpenChange: ft,
|
|
170
186
|
onCreateFormChange: (e) => {
|
|
171
|
-
|
|
187
|
+
P(!1), M(e);
|
|
172
188
|
},
|
|
173
|
-
onCreateSubmit:
|
|
174
|
-
|
|
175
|
-
|
|
189
|
+
onCreateSubmit: ut,
|
|
190
|
+
onTeamMembersRetry: nt,
|
|
191
|
+
onAddAccountClick: () => ft(!0),
|
|
192
|
+
onSelectAccount: O
|
|
176
193
|
};
|
|
177
194
|
}
|
|
178
|
-
function
|
|
195
|
+
function Oe(e, t, n) {
|
|
179
196
|
return {
|
|
180
197
|
id: e.id,
|
|
181
198
|
name: e.nickname?.trim() || t.accountFallback,
|
|
@@ -186,4 +203,4 @@ function we(e, t, n) {
|
|
|
186
203
|
...n
|
|
187
204
|
};
|
|
188
205
|
}
|
|
189
|
-
export {
|
|
206
|
+
export { De as useBankAccountsWidget };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/mocks/labels.js
|
|
2
2
|
var e = {
|
|
3
3
|
blurbs: {
|
|
4
|
-
populated: "Three accounts with a total, and
|
|
5
|
-
empty: "The organization has no accounts and the session cannot create one, so the widget says so. With bank_account:write:org
|
|
4
|
+
populated: "Three accounts with a total, and Add account in the header. Open an account for its transactions, then try Export, the Statements tab (two pages; View opens a PDF), and Edit account nickname. Add account creates a fourth account.",
|
|
5
|
+
empty: "The organization has no accounts and the session cannot create one, so the widget says so. With bank_account:write:org the empty state would offer Add account.",
|
|
6
6
|
loading: "The accounts read is held open, so two card-shaped skeletons stay on screen.",
|
|
7
|
-
error: "The accounts read fails with a 500. The widget
|
|
8
|
-
"control-hidden": "The same accounts, read by a session without bank_account:write:org.
|
|
7
|
+
error: "The accounts read fails with a 500. The widget says it couldn't load the accounts and offers Try again; Add account stays because it depends on scope, not on the read.",
|
|
8
|
+
"control-hidden": "The same accounts, read by a session without bank_account:write:org. Add account is absent, and an opened account offers no nickname edit."
|
|
9
9
|
},
|
|
10
10
|
scenarios: { "team-access-failed": {
|
|
11
11
|
label: "Team access fails",
|
|
12
|
-
blurb: "The accounts load, but the user roster behind the create dialog fails. Press Add account: the Team member access section reports the failure and Create account
|
|
12
|
+
blurb: "The accounts load, but the user roster behind the create dialog fails. Press Add account: the Team member access section reports the failure and Create account does nothing until it loads."
|
|
13
13
|
} }
|
|
14
14
|
};
|
|
15
15
|
export { e as BANK_ACCOUNTS_LABELS };
|
package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js
CHANGED
|
@@ -2,82 +2,79 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { Skeleton as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { formatOpenAccountAriaLabel as t } from "./labels.js";
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
7
|
+
import { IconActionButton as n } from "../../../account-details/ui/dist/index2.js";
|
|
8
|
+
import "../../../account-details/ui/dist/index.js";
|
|
9
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
10
|
+
import { CheckIcon as a, CopyIcon as o, EyeIcon as s, EyeOffIcon as c } from "lucide-react";
|
|
9
11
|
// ../../libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/AccountCard.js
|
|
10
|
-
var l = "ttw:absolute ttw:inset-0 ttw:z-0 ttw:cursor-pointer ttw:rounded-
|
|
11
|
-
function d({ labels:
|
|
12
|
-
|
|
12
|
+
var l = "ttw:absolute ttw:inset-0 ttw:z-0 ttw:cursor-pointer ttw:rounded-lg ttw:outline-none ttw:focus-visible:outline-solid ttw:focus-visible:outline-2 ttw:focus-visible:outline-offset-2 ttw:focus-visible:outline-ring", u = "ttw:pointer-events-auto ttw:relative ttw:z-10";
|
|
13
|
+
function d({ labels: e, card: d, testId: f }) {
|
|
14
|
+
let p = d.isAccountNumberCopied ? e.copiedLabel : e.copyAccountNumber, m = d.isRoutingNumberCopied ? e.copiedLabel : e.copyRoutingNumber;
|
|
15
|
+
return /* @__PURE__ */ i("article", {
|
|
13
16
|
"data-testid": f,
|
|
14
|
-
className: "ttw:relative ttw:flex ttw:
|
|
15
|
-
children: [/* @__PURE__ */
|
|
17
|
+
className: "ttw:relative ttw:flex ttw:w-80 ttw:max-w-full ttw:cursor-pointer ttw:flex-col ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:transition-colors ttw:duration-150 ttw:hover:bg-muted",
|
|
18
|
+
children: [/* @__PURE__ */ r("button", {
|
|
16
19
|
type: "button",
|
|
17
20
|
className: l,
|
|
18
|
-
"aria-label": t(d.name,
|
|
21
|
+
"aria-label": t(d.name, e),
|
|
19
22
|
onClick: d.onSelect
|
|
20
|
-
}), /* @__PURE__ */
|
|
23
|
+
}), /* @__PURE__ */ i("div", {
|
|
21
24
|
className: "ttw:pointer-events-none ttw:relative ttw:z-10 ttw:flex ttw:min-h-0 ttw:flex-1 ttw:flex-col ttw:gap-3",
|
|
22
25
|
children: [
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
className: "ttw:truncate ttw:text-base ttw:font-bold ttw:text-foreground",
|
|
25
|
-
children: d.name
|
|
26
|
-
}), /* @__PURE__ */ n("p", {
|
|
27
|
-
className: "ttw:truncate ttw:text-2xl ttw:font-bold ttw:text-primary",
|
|
28
|
-
children: d.balanceLabel
|
|
29
|
-
})] }),
|
|
30
|
-
/* @__PURE__ */ r("div", {
|
|
26
|
+
/* @__PURE__ */ i("div", {
|
|
31
27
|
className: "ttw:space-y-1",
|
|
32
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ r("p", {
|
|
29
|
+
className: "ttw:truncate ttw:text-sm ttw:font-semibold ttw:text-foreground",
|
|
30
|
+
children: d.name
|
|
31
|
+
}), /* @__PURE__ */ r("p", {
|
|
32
|
+
className: "ttw:truncate ttw:text-xl ttw:font-semibold ttw:tabular-nums ttw:text-foreground",
|
|
33
|
+
children: d.balanceLabel
|
|
34
|
+
})]
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ i("div", {
|
|
37
|
+
className: "ttw:space-y-1",
|
|
38
|
+
children: [/* @__PURE__ */ r("p", {
|
|
33
39
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
34
|
-
children:
|
|
35
|
-
}), /* @__PURE__ */
|
|
40
|
+
children: e.accountNumberLabel
|
|
41
|
+
}), /* @__PURE__ */ i("div", {
|
|
36
42
|
className: "ttw:flex ttw:items-center ttw:gap-1",
|
|
37
43
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
className: "ttw:text-sm ttw:
|
|
44
|
+
/* @__PURE__ */ r("span", {
|
|
45
|
+
className: "ttw:text-sm ttw:tabular-nums",
|
|
40
46
|
children: d.isAccountNumberVisible ? d.accountNumberLabel : d.maskedAccountNumberLabel
|
|
41
47
|
}),
|
|
42
|
-
/* @__PURE__ */ n
|
|
43
|
-
|
|
44
|
-
variant: "ghost",
|
|
45
|
-
size: "icon",
|
|
48
|
+
/* @__PURE__ */ r(n, {
|
|
49
|
+
label: d.isAccountNumberVisible ? e.hideAccountNumber : e.showAccountNumber,
|
|
46
50
|
className: u,
|
|
47
|
-
"aria-label": c.toggleAccountNumberVisibility,
|
|
48
51
|
onClick: d.onToggleAccountNumberVisibility,
|
|
49
|
-
children: d.isAccountNumberVisible ? /* @__PURE__ */
|
|
52
|
+
children: d.isAccountNumberVisible ? /* @__PURE__ */ r(c, {}) : /* @__PURE__ */ r(s, {})
|
|
50
53
|
}),
|
|
51
|
-
/* @__PURE__ */ n
|
|
52
|
-
|
|
53
|
-
variant: "ghost",
|
|
54
|
-
size: "icon",
|
|
54
|
+
/* @__PURE__ */ r(n, {
|
|
55
|
+
label: p,
|
|
55
56
|
className: u,
|
|
56
|
-
"aria-label": c.copyAccountNumber,
|
|
57
57
|
onClick: d.onCopyAccountNumber,
|
|
58
|
-
children: d.isAccountNumberCopied ? /* @__PURE__ */
|
|
58
|
+
children: d.isAccountNumberCopied ? /* @__PURE__ */ r(a, {}) : /* @__PURE__ */ r(o, {})
|
|
59
59
|
})
|
|
60
60
|
]
|
|
61
61
|
})]
|
|
62
62
|
}),
|
|
63
|
-
/* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ i("div", {
|
|
64
64
|
className: "ttw:space-y-1",
|
|
65
|
-
children: [/* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ r("p", {
|
|
66
66
|
className: "ttw:text-xs ttw:text-muted-foreground",
|
|
67
|
-
children:
|
|
68
|
-
}), /* @__PURE__ */
|
|
67
|
+
children: e.routingNumberLabel
|
|
68
|
+
}), /* @__PURE__ */ i("div", {
|
|
69
69
|
className: "ttw:flex ttw:items-center ttw:gap-1",
|
|
70
|
-
children: [/* @__PURE__ */
|
|
71
|
-
className: "ttw:text-sm",
|
|
70
|
+
children: [/* @__PURE__ */ r("span", {
|
|
71
|
+
className: "ttw:text-sm ttw:tabular-nums",
|
|
72
72
|
children: d.routingNumberLabel
|
|
73
|
-
}), /* @__PURE__ */ n
|
|
74
|
-
|
|
75
|
-
variant: "ghost",
|
|
76
|
-
size: "icon",
|
|
73
|
+
}), /* @__PURE__ */ r(n, {
|
|
74
|
+
label: m,
|
|
77
75
|
className: u,
|
|
78
|
-
"aria-label": c.copyRoutingNumber,
|
|
79
76
|
onClick: d.onCopyRoutingNumber,
|
|
80
|
-
children: d.isRoutingNumberCopied ? /* @__PURE__ */
|
|
77
|
+
children: d.isRoutingNumberCopied ? /* @__PURE__ */ r(a, {}) : /* @__PURE__ */ r(o, {})
|
|
81
78
|
})]
|
|
82
79
|
})]
|
|
83
80
|
})
|
|
@@ -85,17 +82,7 @@ function d({ labels: c, card: d, testId: f }) {
|
|
|
85
82
|
})]
|
|
86
83
|
});
|
|
87
84
|
}
|
|
88
|
-
function f(
|
|
89
|
-
return /* @__PURE__ */
|
|
90
|
-
className: "ttw:flex ttw:h-[214px] ttw:w-80 ttw:items-center ttw:justify-center ttw:rounded-xl ttw:border ttw:border-dashed ttw:border-primary ttw:bg-card ttw:p-4",
|
|
91
|
-
children: /* @__PURE__ */ r(e, {
|
|
92
|
-
type: "button",
|
|
93
|
-
variant: "outline",
|
|
94
|
-
className: "ttw:rounded-xl ttw:border-primary ttw:text-primary",
|
|
95
|
-
disabled: i,
|
|
96
|
-
onClick: a,
|
|
97
|
-
children: [/* @__PURE__ */ n(c, { className: "ttw:size-4" }), t.addAccountButton]
|
|
98
|
-
})
|
|
99
|
-
});
|
|
85
|
+
function f() {
|
|
86
|
+
return /* @__PURE__ */ r(e, { className: "ttw:h-52 ttw:w-80 ttw:max-w-full ttw:rounded-lg" });
|
|
100
87
|
}
|
|
101
|
-
export { d as AccountCard, f as
|
|
88
|
+
export { d as AccountCard, f as AccountCardSkeleton };
|