@tesouro/embedded-components-react 0.11.59 → 0.11.61
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 +37 -37
- package/dist/index.css +77 -230
- package/dist/index.d.ts +69 -23
- package/dist/lib/BankAccountsWidget.d.ts +20 -7
- package/dist/lib/CardDetailsWidget.d.ts +11 -3
- package/dist/lib/CreditCardsWidget.d.ts +19 -6
- package/dist/lib/DebitCardsWidget.d.ts +19 -6
- package/dist/lib/LinkedAccountsWidget.d.ts +30 -10
- package/dist/lib/WidgetSuite.d.ts +69 -23
- 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/card-details-widget/feature/dist/lib/CardDetailsWidget.js +112 -110
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/cardDetailsView.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardPanel.js +94 -83
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/ActivateCardSuccessView.js +32 -31
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/ActivateCardPanel/labels.js +5 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialRow.js +41 -23
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardCredentialsFace.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +30 -25
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsPanel.js +162 -190
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardFace.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyButton.js +35 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CopyableValue.js +18 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameEditor.js +43 -0
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/cardFaceSurface.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/labels.js +12 -8
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index5.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +110 -104
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CreateCardWidget.js +74 -68
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/PreparingView.js +19 -18
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SetupView.js +110 -108
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/SuccessView.js +33 -42
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/labels.js +10 -7
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/testIds.js +2 -6
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/useCardsWidget.js +159 -145
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +255 -112
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/labels.js +4 -4
- 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/card-details-widget/ui/dist/lib/CardDetailsPanel/AddressLine.js +0 -22
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/DetailCopyRow.js +0 -28
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/NicknameRow.js +0 -64
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/statusBadge.js +0 -11
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +0 -11
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +0 -103
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/statusBadge.js +0 -11
- 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
package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js
CHANGED
|
@@ -74,57 +74,57 @@ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose
|
|
|
74
74
|
}, {
|
|
75
75
|
value: d.Physical,
|
|
76
76
|
label: w.setup.cardFormatPhysical
|
|
77
|
-
}], [w.setup.cardFormatPhysical, w.setup.cardFormatVirtual]), Fe = m(() => t(), []), [Ie, T] = g(l.Setup), [E, Le] = g(null), [D, Re] = g(null), [ze, Be] = g(null), [O,
|
|
78
|
-
Le(null), Re(null), Be(null),
|
|
79
|
-
},
|
|
80
|
-
x && x !==
|
|
81
|
-
let
|
|
82
|
-
p(() => (
|
|
83
|
-
|
|
77
|
+
}], [w.setup.cardFormatPhysical, w.setup.cardFormatVirtual]), Fe = m(() => t(), []), [Ie, T] = g(l.Setup), [E, Le] = g(null), [D, Re] = g(null), [ze, Be] = g(null), [O, k] = g(null), [A, Ve] = g(Te), [He, Ue] = g(null), [We, Ge] = g(null), [Ke, qe] = g(null), [j, M] = g(!1), [N, P] = g(""), [F, I] = g(null), [L, R] = g(!1), [z, B] = g(""), [V, H] = g(!1), [U, W] = g([]), Je = () => {
|
|
78
|
+
Le(null), Re(null), Be(null), k(null), Ve(Te), Ue(null), Ge(null), qe(null), M(!1), P(""), I(null), R(!1), B(""), H(!1), W([]), T(l.Setup);
|
|
79
|
+
}, Ye = h(x);
|
|
80
|
+
x && x !== Ye.current && (Ye.current = x, Je());
|
|
81
|
+
let G = h(!0);
|
|
82
|
+
p(() => (G.current = !0, () => {
|
|
83
|
+
G.current = !1;
|
|
84
84
|
}), []), p(() => {
|
|
85
85
|
Me(de.Mounted);
|
|
86
86
|
}, [Me]);
|
|
87
|
-
let { options:
|
|
87
|
+
let { options: Xe, isError: K, refetch: Ze } = _e({ enabled: b && S.canReadUsers }), q = o({
|
|
88
88
|
enabled: b && S.canReadUsers,
|
|
89
89
|
permissions: [we]
|
|
90
|
-
}),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
}), Qe = m(() => !b || !S.canReadUsers || q.isResolving || q.isError ? [] : re(q.data?.data ?? [], x).map((e) => e.id), [
|
|
91
|
+
q.data?.data,
|
|
92
|
+
q.isError,
|
|
93
|
+
q.isResolving,
|
|
94
94
|
b,
|
|
95
95
|
x,
|
|
96
96
|
S.canReadUsers
|
|
97
|
-
]),
|
|
97
|
+
]), J = !!q.isError && b && S.canReadUsers, $e = b && S.canReadUsers && q.isResolving, Y = h(null);
|
|
98
98
|
p(() => {
|
|
99
|
-
if (!
|
|
100
|
-
else return
|
|
99
|
+
if (!J) Y.current !== null && (e.dismiss(Y.current), Y.current = null);
|
|
100
|
+
else return Y.current = e.error(C.toast.debitCardIssuersError, {
|
|
101
101
|
duration: Infinity,
|
|
102
102
|
action: {
|
|
103
103
|
label: C.toast.retry,
|
|
104
104
|
onClick: () => {
|
|
105
|
-
|
|
105
|
+
q.refetch();
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
}), () => {
|
|
109
|
-
|
|
109
|
+
Y.current !== null && (e.dismiss(Y.current), Y.current = null);
|
|
110
110
|
};
|
|
111
111
|
}, [
|
|
112
|
-
|
|
112
|
+
q.refetch,
|
|
113
113
|
C.toast.debitCardIssuersError,
|
|
114
114
|
C.toast.retry,
|
|
115
|
-
|
|
115
|
+
J
|
|
116
116
|
]);
|
|
117
|
-
let
|
|
117
|
+
let et = a({ enabled: b && S.canReadOrganization }), X = r({ enabled: b && S.canReadFundingAccounts }), tt = i({ enabled: b && S.canReadMerchantCategoryGroups }), nt = ye(), rt = be(), it = xe(), Z = !!X.isError && b && S.canReadFundingAccounts, Q = m(() => Z ? [] : (X.data?.data ?? []).map((e) => ({
|
|
118
118
|
value: e.id,
|
|
119
119
|
label: ke(e, C.untitledFundingAccount)
|
|
120
120
|
})), [
|
|
121
|
-
|
|
121
|
+
X.data?.data,
|
|
122
122
|
C.untitledFundingAccount,
|
|
123
|
-
|
|
124
|
-
]),
|
|
123
|
+
Z
|
|
124
|
+
]), $ = m(() => (tt.data?.data ?? []).map((e) => ({
|
|
125
125
|
value: e.id,
|
|
126
126
|
label: e.name
|
|
127
|
-
})), [
|
|
127
|
+
})), [tt.data?.data]), at = ze ?? (Q.length === 1 ? Q[0].value : null), ot = et.data?.address, st = se(ot), ct = ce(ot), lt = D === d.Physical, ut = lt && O === u.BusinessAddress && !!st, dt = lt && O === u.DifferentAddress, ft = Z || Q.length > 0, pt = b && S.canWriteAuthorizationControls, mt = m(() => [
|
|
128
128
|
{
|
|
129
129
|
value: f.OneTime,
|
|
130
130
|
label: C.spendLimit.periodOneTime
|
|
@@ -141,7 +141,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose
|
|
|
141
141
|
C.spendLimit.periodDaily,
|
|
142
142
|
C.spendLimit.periodMonthly,
|
|
143
143
|
C.spendLimit.periodOneTime
|
|
144
|
-
]),
|
|
144
|
+
]), ht = m(() => [
|
|
145
145
|
{
|
|
146
146
|
value: f.OneTime,
|
|
147
147
|
variant: "warning",
|
|
@@ -163,45 +163,45 @@ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose
|
|
|
163
163
|
C.spendLimit.monthlyResetNotice,
|
|
164
164
|
C.spendLimit.oneTimeWarningDescription,
|
|
165
165
|
C.spendLimit.oneTimeWarningTitle
|
|
166
|
-
]),
|
|
167
|
-
|
|
168
|
-
let
|
|
169
|
-
isSpendLimitEnabled:
|
|
166
|
+
]), gt = j && (he(N) === null || F === null), _t = L && he(z) === null, vt = V && U.length === 0, yt = $.length === 0 && !V;
|
|
167
|
+
pt || (j && M(!1), N !== "" && P(""), F !== null && I(null), L && R(!1), z !== "" && B(""), V && H(!1), U.length > 0 && W([]));
|
|
168
|
+
let bt = m(() => ({
|
|
169
|
+
isSpendLimitEnabled: j,
|
|
170
170
|
onSpendLimitEnabledChange: (e) => {
|
|
171
|
-
|
|
171
|
+
M(e), e && I((e) => e ?? f.Monthly);
|
|
172
172
|
},
|
|
173
|
-
spendLimitAmount:
|
|
174
|
-
onSpendLimitAmountChange:
|
|
175
|
-
spendLimitPeriodOptions:
|
|
176
|
-
selectedSpendLimitPeriod:
|
|
177
|
-
onSpendLimitPeriodSelect:
|
|
178
|
-
spendLimitPeriodNotices:
|
|
179
|
-
isMerchantCategoriesEnabled:
|
|
180
|
-
onMerchantCategoriesEnabledChange:
|
|
181
|
-
merchantCategoryOptions:
|
|
182
|
-
selectedMerchantCategories:
|
|
173
|
+
spendLimitAmount: N,
|
|
174
|
+
onSpendLimitAmountChange: P,
|
|
175
|
+
spendLimitPeriodOptions: mt,
|
|
176
|
+
selectedSpendLimitPeriod: F,
|
|
177
|
+
onSpendLimitPeriodSelect: I,
|
|
178
|
+
spendLimitPeriodNotices: ht,
|
|
179
|
+
isMerchantCategoriesEnabled: V,
|
|
180
|
+
onMerchantCategoriesEnabledChange: H,
|
|
181
|
+
merchantCategoryOptions: $,
|
|
182
|
+
selectedMerchantCategories: U,
|
|
183
183
|
onMerchantCategoryToggle: (e) => {
|
|
184
|
-
|
|
184
|
+
W((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
185
185
|
},
|
|
186
|
-
isMerchantCategoriesToggleDisabled:
|
|
187
|
-
isPerTransactionMaximumEnabled:
|
|
188
|
-
onPerTransactionMaximumEnabledChange:
|
|
189
|
-
perTransactionMaximumAmount:
|
|
190
|
-
onPerTransactionMaximumAmountChange:
|
|
186
|
+
isMerchantCategoriesToggleDisabled: yt,
|
|
187
|
+
isPerTransactionMaximumEnabled: L,
|
|
188
|
+
onPerTransactionMaximumEnabledChange: R,
|
|
189
|
+
perTransactionMaximumAmount: z,
|
|
190
|
+
onPerTransactionMaximumAmountChange: B
|
|
191
191
|
}), [
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
]),
|
|
204
|
-
let e = De(
|
|
192
|
+
V,
|
|
193
|
+
yt,
|
|
194
|
+
L,
|
|
195
|
+
j,
|
|
196
|
+
$,
|
|
197
|
+
z,
|
|
198
|
+
U,
|
|
199
|
+
F,
|
|
200
|
+
N,
|
|
201
|
+
ht,
|
|
202
|
+
mt
|
|
203
|
+
]), xt = !b || !S.canIssue || nt.isPending || rt.isPending || it.isPending || K || Z || J || $e || !E || !D || !at || gt || _t || vt || D === d.Physical && (!O || O === u.BusinessAddress && !ct || O === u.DifferentAddress && !le(A)), St = m(() => {
|
|
204
|
+
let e = De(We, C);
|
|
205
205
|
return {
|
|
206
206
|
...s,
|
|
207
207
|
success: {
|
|
@@ -210,45 +210,48 @@ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose
|
|
|
210
210
|
}
|
|
211
211
|
};
|
|
212
212
|
}, [
|
|
213
|
-
|
|
213
|
+
We,
|
|
214
214
|
C,
|
|
215
215
|
s
|
|
216
|
-
]),
|
|
216
|
+
]), Ct = async () => {
|
|
217
217
|
if (!b) return;
|
|
218
218
|
let t = oe(), n = ae({
|
|
219
219
|
cardholderUserId: E,
|
|
220
220
|
format: D,
|
|
221
|
-
bankAccountId:
|
|
221
|
+
bankAccountId: at,
|
|
222
222
|
reference: t,
|
|
223
223
|
mailingOption: O,
|
|
224
|
-
orgAddress:
|
|
225
|
-
manualAddress:
|
|
224
|
+
orgAddress: ot,
|
|
225
|
+
manualAddress: A
|
|
226
226
|
});
|
|
227
227
|
if (!n) return;
|
|
228
228
|
T(l.Preparing);
|
|
229
229
|
let r = e.loading(C.toast.creating);
|
|
230
230
|
try {
|
|
231
|
-
let t = await
|
|
232
|
-
if (!
|
|
231
|
+
let t = await nt.mutateAsync({ body: n });
|
|
232
|
+
if (!G.current) {
|
|
233
233
|
e.dismiss(r);
|
|
234
234
|
return;
|
|
235
235
|
}
|
|
236
|
-
|
|
236
|
+
Ue(t.id), Ge(t.cardStatus), qe({
|
|
237
|
+
cardholder: t.cardholderName,
|
|
238
|
+
lastFour: t.lastFourDigits
|
|
239
|
+
});
|
|
237
240
|
let i = [];
|
|
238
|
-
if (
|
|
241
|
+
if (j) {
|
|
239
242
|
let e = me({
|
|
240
243
|
cardId: t.id,
|
|
241
|
-
amount:
|
|
242
|
-
period:
|
|
244
|
+
amount: N,
|
|
245
|
+
period: F,
|
|
243
246
|
id: crypto.randomUUID(),
|
|
244
247
|
name: C.velocityControlNames.spendLimit
|
|
245
248
|
});
|
|
246
249
|
e && i.push(e);
|
|
247
250
|
}
|
|
248
|
-
if (
|
|
251
|
+
if (L) {
|
|
249
252
|
let e = pe({
|
|
250
253
|
cardId: t.id,
|
|
251
|
-
amount:
|
|
254
|
+
amount: z,
|
|
252
255
|
id: crypto.randomUUID(),
|
|
253
256
|
name: C.velocityControlNames.perTransactionMaximum
|
|
254
257
|
});
|
|
@@ -256,25 +259,25 @@ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose
|
|
|
256
259
|
}
|
|
257
260
|
let a = !1;
|
|
258
261
|
if (i.length > 0) try {
|
|
259
|
-
await Promise.all(i.map((e) =>
|
|
262
|
+
await Promise.all(i.map((e) => rt.mutateAsync({ body: e })));
|
|
260
263
|
} catch {
|
|
261
264
|
a = !0;
|
|
262
265
|
}
|
|
263
|
-
if (!
|
|
266
|
+
if (!G.current) {
|
|
264
267
|
e.dismiss(r);
|
|
265
268
|
return;
|
|
266
269
|
}
|
|
267
270
|
let o = !1;
|
|
268
|
-
if (
|
|
269
|
-
await
|
|
271
|
+
if (Qe.length > 0) try {
|
|
272
|
+
await it.mutateAsync({ body: {
|
|
270
273
|
debitCardIds: [t.id],
|
|
271
274
|
type: "GRANT",
|
|
272
|
-
userIds:
|
|
275
|
+
userIds: Qe
|
|
273
276
|
} });
|
|
274
277
|
} catch {
|
|
275
278
|
o = !0;
|
|
276
279
|
}
|
|
277
|
-
if (!
|
|
280
|
+
if (!G.current) {
|
|
278
281
|
e.dismiss(r);
|
|
279
282
|
return;
|
|
280
283
|
}
|
|
@@ -304,7 +307,7 @@ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose
|
|
|
304
307
|
duration: Ee
|
|
305
308
|
});
|
|
306
309
|
} catch {
|
|
307
|
-
if (!
|
|
310
|
+
if (!G.current) {
|
|
308
311
|
e.dismiss(r);
|
|
309
312
|
return;
|
|
310
313
|
}
|
|
@@ -317,51 +320,54 @@ function y({ cardArtSrc: n, labels: s, featureLabels: fe, className: Oe, onClose
|
|
|
317
320
|
return /* @__PURE__ */ Ce(Se, { children: [/* @__PURE__ */ _(ee, {}), /* @__PURE__ */ _(ie, {
|
|
318
321
|
view: Ie,
|
|
319
322
|
cardArtSrc: n,
|
|
320
|
-
labels:
|
|
323
|
+
labels: St,
|
|
321
324
|
className: Oe,
|
|
322
|
-
cardholderOptions:
|
|
325
|
+
cardholderOptions: Xe,
|
|
323
326
|
selectedCardholder: E,
|
|
324
327
|
onCardholderSelect: Le,
|
|
325
|
-
isCardholderError:
|
|
326
|
-
onCardholderRetry:
|
|
328
|
+
isCardholderError: K,
|
|
329
|
+
onCardholderRetry: K ? Ze : void 0,
|
|
327
330
|
cardFormatOptions: Pe,
|
|
328
331
|
selectedCardFormat: D,
|
|
329
332
|
onCardFormatSelect: (e) => {
|
|
330
|
-
Re(e),
|
|
333
|
+
Re(e), k(null);
|
|
331
334
|
},
|
|
332
|
-
isFundingAccountVisible:
|
|
333
|
-
fundingAccountOptions:
|
|
334
|
-
selectedFundingAccount:
|
|
335
|
+
isFundingAccountVisible: ft,
|
|
336
|
+
fundingAccountOptions: Q,
|
|
337
|
+
selectedFundingAccount: at,
|
|
335
338
|
onFundingAccountSelect: Be,
|
|
336
|
-
isFundingAccountError:
|
|
337
|
-
onFundingAccountRetry:
|
|
338
|
-
|
|
339
|
+
isFundingAccountError: Z,
|
|
340
|
+
onFundingAccountRetry: Z ? () => {
|
|
341
|
+
X.refetch();
|
|
339
342
|
} : void 0,
|
|
340
|
-
isMailingSectionVisible:
|
|
343
|
+
isMailingSectionVisible: lt,
|
|
341
344
|
selectedMailingOption: O,
|
|
342
|
-
onMailingOptionSelect:
|
|
343
|
-
businessAddress:
|
|
344
|
-
isBusinessAddressVisible:
|
|
345
|
-
isManualAddressVisible:
|
|
346
|
-
manualAddress:
|
|
347
|
-
onManualAddressChange: (e) =>
|
|
345
|
+
onMailingOptionSelect: k,
|
|
346
|
+
businessAddress: st,
|
|
347
|
+
isBusinessAddressVisible: ut,
|
|
348
|
+
isManualAddressVisible: dt,
|
|
349
|
+
manualAddress: A,
|
|
350
|
+
onManualAddressChange: (e) => Ve((t) => ({
|
|
348
351
|
...t,
|
|
349
352
|
...e
|
|
350
353
|
})),
|
|
351
354
|
stateOptions: Fe,
|
|
352
|
-
isCardControlsSectionVisible:
|
|
353
|
-
cardControls:
|
|
354
|
-
isCreateDisabled:
|
|
355
|
+
isCardControlsSectionVisible: pt,
|
|
356
|
+
cardControls: bt,
|
|
357
|
+
isCreateDisabled: xt,
|
|
355
358
|
onCreateClick: () => {
|
|
356
|
-
|
|
359
|
+
Ct();
|
|
357
360
|
},
|
|
358
361
|
onCancelClick: () => {
|
|
359
362
|
Ae?.(), y?.();
|
|
360
363
|
},
|
|
361
364
|
onClose: y,
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
+
onDoneClick: y ?? Je,
|
|
366
|
+
createdCardholder: Ke?.cardholder || void 0,
|
|
367
|
+
createdLastFour: Ke?.lastFour || void 0,
|
|
368
|
+
createdFormat: Pe.find((e) => e.value === D)?.label,
|
|
369
|
+
onViewCardClick: je && He ? () => {
|
|
370
|
+
je(He);
|
|
365
371
|
} : void 0
|
|
366
372
|
})] });
|
|
367
373
|
}
|
|
@@ -2,100 +2,106 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import { Button as e,
|
|
6
|
-
import { resolveCreateCardWidgetLabels as
|
|
7
|
-
import { CreateCardView as
|
|
8
|
-
import { PreparingView as
|
|
5
|
+
import { Button as e, Heading as t, cn as n } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { resolveCreateCardWidgetLabels as r } from "./labels.js";
|
|
7
|
+
import { CreateCardView as i } from "./types.js";
|
|
8
|
+
import { PreparingView as a } from "./PreparingView.js";
|
|
9
9
|
import "./CardControls/CardControls.js";
|
|
10
|
-
import { SetupView as
|
|
10
|
+
import { SetupView as ee } from "./SetupView.js";
|
|
11
11
|
import { SuccessView as o } from "./SuccessView.js";
|
|
12
12
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
13
|
-
import {
|
|
13
|
+
import { XIcon as u } from "lucide-react";
|
|
14
14
|
// ../../libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CreateCardWidget.js
|
|
15
|
-
var
|
|
15
|
+
var d = {
|
|
16
16
|
street: "",
|
|
17
17
|
city: "",
|
|
18
18
|
state: "",
|
|
19
19
|
zip: ""
|
|
20
|
-
},
|
|
21
|
-
function
|
|
22
|
-
return e ===
|
|
20
|
+
}, f = () => void 0;
|
|
21
|
+
function p(e) {
|
|
22
|
+
return e === i.Setup || e === i.Preparing || e === i.Success ? e : (console.error(`[CreateCardWidget] unexpected view ${JSON.stringify(e)}; falling back to "${i.Setup}"`), i.Setup);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
let
|
|
24
|
+
function m({ view: m, cardArtSrc: h, labels: g, className: _, cardholderOptions: v = [], selectedCardholder: y = null, onCardholderSelect: b = f, isCardholderError: x = !1, onCardholderRetry: S, cardFormatOptions: C = [], selectedCardFormat: w = null, onCardFormatSelect: T = f, isFundingAccountVisible: E = !1, fundingAccountOptions: D = [], selectedFundingAccount: O = null, onFundingAccountSelect: k = f, isFundingAccountError: A = !1, onFundingAccountRetry: j, isMailingSectionVisible: te = !1, selectedMailingOption: M = null, onMailingOptionSelect: N = f, businessAddress: P = "", isBusinessAddressVisible: F = !1, isManualAddressVisible: I = !1, manualAddress: L = d, onManualAddressChange: R = f, stateOptions: z = [], isCardControlsSectionVisible: B = !1, cardControls: V, isCreateDisabled: H = !1, onCreateClick: U = f, onCancelClick: W = f, onClose: G, onDoneClick: K = f, onViewCardClick: q, createdCardholder: J, createdLastFour: Y, createdFormat: X }) {
|
|
25
|
+
let Z = r(g), Q = p(m), $ = Q === i.Setup;
|
|
26
26
|
return /* @__PURE__ */ l("div", {
|
|
27
|
-
className:
|
|
27
|
+
className: n("ttw:relative ttw:flex ttw:h-full ttw:w-full ttw:min-h-0 ttw:flex-col ttw:bg-background", _),
|
|
28
28
|
children: [
|
|
29
29
|
/* @__PURE__ */ l("div", {
|
|
30
|
-
className:
|
|
31
|
-
children: [
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
className: "ttw:flex ttw:shrink-0 ttw:items-start ttw:gap-2 ttw:px-6 ttw:pt-5 ttw:pb-4",
|
|
31
|
+
children: [$ ? /* @__PURE__ */ c(t, {
|
|
32
|
+
variant: "sheet",
|
|
33
|
+
level: 2,
|
|
34
|
+
className: "ttw:min-w-0 ttw:flex-1 ttw:text-foreground",
|
|
35
|
+
children: Z.header.title
|
|
36
|
+
}) : /* @__PURE__ */ c("span", { className: "ttw:flex-1" }), G ? /* @__PURE__ */ c(e, {
|
|
35
37
|
type: "button",
|
|
36
38
|
variant: "ghost",
|
|
37
|
-
size: "icon",
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
size: "icon-sm",
|
|
40
|
+
className: "ttw:shrink-0 ttw:text-muted-foreground",
|
|
41
|
+
"aria-label": Z.header.closeAriaLabel,
|
|
42
|
+
onClick: G,
|
|
43
|
+
children: /* @__PURE__ */ c(u, { className: "ttw:size-4" })
|
|
41
44
|
}) : null]
|
|
42
45
|
}),
|
|
43
|
-
|
|
46
|
+
$ ? /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", {
|
|
44
47
|
className: "ttw:min-h-0 ttw:flex-1 ttw:overflow-y-auto",
|
|
45
|
-
children: /* @__PURE__ */ c(
|
|
46
|
-
cardArtSrc:
|
|
47
|
-
labels:
|
|
48
|
-
cardholderOptions:
|
|
49
|
-
selectedCardholder:
|
|
50
|
-
onCardholderSelect:
|
|
51
|
-
isCardholderError:
|
|
52
|
-
onCardholderRetry:
|
|
53
|
-
cardFormatOptions:
|
|
54
|
-
selectedCardFormat:
|
|
55
|
-
onCardFormatSelect:
|
|
56
|
-
isFundingAccountVisible:
|
|
57
|
-
fundingAccountOptions:
|
|
58
|
-
selectedFundingAccount:
|
|
59
|
-
onFundingAccountSelect:
|
|
60
|
-
isFundingAccountError:
|
|
61
|
-
onFundingAccountRetry:
|
|
62
|
-
isMailingSectionVisible:
|
|
63
|
-
selectedMailingOption:
|
|
64
|
-
onMailingOptionSelect:
|
|
65
|
-
businessAddress:
|
|
66
|
-
isBusinessAddressVisible:
|
|
67
|
-
isManualAddressVisible:
|
|
68
|
-
manualAddress:
|
|
69
|
-
onManualAddressChange:
|
|
70
|
-
stateOptions:
|
|
71
|
-
isCardControlsSectionVisible:
|
|
72
|
-
cardControls:
|
|
48
|
+
children: /* @__PURE__ */ c(ee, {
|
|
49
|
+
cardArtSrc: h,
|
|
50
|
+
labels: Z,
|
|
51
|
+
cardholderOptions: v,
|
|
52
|
+
selectedCardholder: y,
|
|
53
|
+
onCardholderSelect: b,
|
|
54
|
+
isCardholderError: x,
|
|
55
|
+
onCardholderRetry: S,
|
|
56
|
+
cardFormatOptions: C,
|
|
57
|
+
selectedCardFormat: w,
|
|
58
|
+
onCardFormatSelect: T,
|
|
59
|
+
isFundingAccountVisible: E,
|
|
60
|
+
fundingAccountOptions: D,
|
|
61
|
+
selectedFundingAccount: O,
|
|
62
|
+
onFundingAccountSelect: k,
|
|
63
|
+
isFundingAccountError: A,
|
|
64
|
+
onFundingAccountRetry: j,
|
|
65
|
+
isMailingSectionVisible: te,
|
|
66
|
+
selectedMailingOption: M,
|
|
67
|
+
onMailingOptionSelect: N,
|
|
68
|
+
businessAddress: P,
|
|
69
|
+
isBusinessAddressVisible: F,
|
|
70
|
+
isManualAddressVisible: I,
|
|
71
|
+
manualAddress: L,
|
|
72
|
+
onManualAddressChange: R,
|
|
73
|
+
stateOptions: z,
|
|
74
|
+
isCardControlsSectionVisible: B,
|
|
75
|
+
cardControls: V
|
|
73
76
|
})
|
|
74
77
|
}), /* @__PURE__ */ l("div", {
|
|
75
|
-
className: "ttw:flex ttw:shrink-0 ttw:
|
|
78
|
+
className: "ttw:flex ttw:shrink-0 ttw:flex-col-reverse ttw:gap-2 ttw:border-t ttw:border-border ttw:px-6 ttw:py-4 ttw:sm:flex-row ttw:sm:justify-end",
|
|
76
79
|
children: [/* @__PURE__ */ c(e, {
|
|
77
80
|
type: "button",
|
|
78
|
-
variant: "
|
|
79
|
-
onClick:
|
|
80
|
-
children:
|
|
81
|
-
}), /* @__PURE__ */
|
|
81
|
+
variant: "ghost",
|
|
82
|
+
onClick: W,
|
|
83
|
+
children: Z.footer.cancel
|
|
84
|
+
}), /* @__PURE__ */ c(e, {
|
|
82
85
|
type: "button",
|
|
83
|
-
disabled:
|
|
84
|
-
onClick:
|
|
85
|
-
children:
|
|
86
|
+
disabled: H,
|
|
87
|
+
onClick: U,
|
|
88
|
+
children: Z.footer.createCard
|
|
86
89
|
})]
|
|
87
90
|
})] }) : null,
|
|
88
|
-
|
|
89
|
-
cardArtSrc:
|
|
90
|
-
labels:
|
|
91
|
+
Q === i.Preparing ? /* @__PURE__ */ c(a, {
|
|
92
|
+
cardArtSrc: h,
|
|
93
|
+
labels: Z
|
|
91
94
|
}) : null,
|
|
92
|
-
|
|
93
|
-
cardArtSrc:
|
|
94
|
-
labels:
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
Q === i.Success ? /* @__PURE__ */ c(o, {
|
|
96
|
+
cardArtSrc: h,
|
|
97
|
+
labels: Z,
|
|
98
|
+
cardholder: J,
|
|
99
|
+
lastFour: Y,
|
|
100
|
+
format: X,
|
|
101
|
+
onDoneClick: K,
|
|
102
|
+
onViewCardClick: q
|
|
97
103
|
}) : null
|
|
98
104
|
]
|
|
99
105
|
});
|
|
100
106
|
}
|
|
101
|
-
export {
|
|
107
|
+
export { i as CreateCardView, m as CreateCardWidget, r as resolveCreateCardWidgetLabels };
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CardArt as
|
|
3
|
-
import { jsx as
|
|
1
|
+
import { Heading as e, Spinner as t } from "../../../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
2
|
+
import { CardArt as n } from "./CardArt.js";
|
|
3
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
4
4
|
// ../../libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/PreparingView.js
|
|
5
|
-
function
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
className: "ttw:flex ttw:min-h-full ttw:flex-1 ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-6 ttw:
|
|
5
|
+
function a({ cardArtSrc: a, labels: o }) {
|
|
6
|
+
return /* @__PURE__ */ i("div", {
|
|
7
|
+
className: "ttw:flex ttw:min-h-full ttw:flex-1 ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-6 ttw:px-6 ttw:py-12",
|
|
8
8
|
children: [
|
|
9
|
-
/* @__PURE__ */ n
|
|
10
|
-
src:
|
|
11
|
-
alt:
|
|
9
|
+
/* @__PURE__ */ r(n, {
|
|
10
|
+
src: a,
|
|
11
|
+
alt: o.cardArtAlt
|
|
12
12
|
}),
|
|
13
|
-
/* @__PURE__ */
|
|
13
|
+
/* @__PURE__ */ i("div", {
|
|
14
14
|
className: "ttw:flex ttw:flex-col ttw:items-center ttw:gap-2 ttw:text-center",
|
|
15
|
-
children: [/* @__PURE__ */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
children: [/* @__PURE__ */ r(e, {
|
|
16
|
+
variant: "sheet",
|
|
17
|
+
level: 2,
|
|
18
|
+
children: o.preparing.title
|
|
19
|
+
}), /* @__PURE__ */ r("p", {
|
|
19
20
|
className: "ttw:text-sm ttw:text-muted-foreground",
|
|
20
|
-
children:
|
|
21
|
+
children: o.preparing.description
|
|
21
22
|
})]
|
|
22
23
|
}),
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ r(t, {
|
|
24
25
|
className: "ttw:size-8 ttw:text-primary",
|
|
25
|
-
"aria-label":
|
|
26
|
+
"aria-label": o.preparing.title
|
|
26
27
|
})
|
|
27
28
|
]
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
|
-
export {
|
|
31
|
+
export { a as PreparingView };
|