@tesouro/embedded-components-react 0.11.274 → 0.11.276
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.css +61 -7
- package/dist/index.d.ts +1 -13
- package/dist/lib/RecentActivityWidget.d.ts +1 -13
- package/dist/lib/WidgetSuite.d.ts +1 -13
- package/dist/libs/tesouro-embedded-components-react/balance-history-widget/ui/dist/lib/BalanceHistoryCard/BalanceHistoryCard.js +114 -111
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/CreateAccountDialog.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index23.js +69 -69
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/ui/dist/lib/CreateCardWidget/CardControls/SpendLimitControl.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index4.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/RecentActivityWidgetFeature.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/RecentActivityWidget/labels.js +1 -4
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/feature/dist/lib/recentActivityView/buildRecentActivityRows.js +12 -19
- package/dist/libs/tesouro-embedded-components-react/recent-activity-widget/ui/dist/lib/RecentActivityCard/RecentActivityCard.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/ui/dist/index15.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index12.js +3 -2
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +106 -106
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +142 -146
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useOwnedQueryClient.js +31 -0
- 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/lib/AttentionStrip/AttentionStrip.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +16 -14
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +17 -14
- package/dist/packages/shared-ui-shadcn/dist/index.js +448 -417
- package/package.json +1 -1
|
@@ -5,46 +5,46 @@
|
|
|
5
5
|
import { installStyleNonce as e } from "../../../../util/dist/lib/csp.js";
|
|
6
6
|
import "../../../../util/dist/index.js";
|
|
7
7
|
import { createClientSecretInstaller as t } from "../../../../data-access/dist/lib/scopedClientSecret.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { EmbedApiProvider as a, useEmbedApi as o } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
8
|
+
import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
9
|
+
import { EmbedApiProvider as r, useEmbedApi as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
11
10
|
import "../../../../data-access/dist/index.js";
|
|
12
|
-
import { resolveUIFramework as
|
|
13
|
-
import { UIProvider as
|
|
14
|
-
import { useDesignSystemEnsurer as
|
|
15
|
-
import { HostIsolationScope as
|
|
11
|
+
import { resolveUIFramework as a } from "../../../../ui/dist/lib/UIContext/UIContext.js";
|
|
12
|
+
import { UIProvider as o } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
|
|
13
|
+
import { useDesignSystemEnsurer as ee, useFrameworkRenderer as te } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
|
|
14
|
+
import { HostIsolationScope as ne } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
|
|
16
15
|
import { ErrorState as s } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
|
|
17
16
|
import "../../../../ui/dist/index.js";
|
|
18
|
-
import { getGlobalSnapshot as
|
|
19
|
-
import { EmbeddedAnalyticsEvent as
|
|
20
|
-
import { configureEmbeddedClient as
|
|
21
|
-
import { generateCorrelationId as
|
|
22
|
-
import { WidgetContext as
|
|
17
|
+
import { getGlobalSnapshot as re, subscribeToGlobal as ie } from "./globalStore.js";
|
|
18
|
+
import { EmbeddedAnalyticsEvent as c } from "../analytics/events.js";
|
|
19
|
+
import { configureEmbeddedClient as ae } from "../analytics/client.js";
|
|
20
|
+
import { generateCorrelationId as oe } from "../analytics/ids.js";
|
|
21
|
+
import { WidgetContext as se } from "./WidgetContext.js";
|
|
23
22
|
import { noop as ce, resolveOrgId as le, useAuthEpoch as ue } from "./utils.js";
|
|
24
23
|
import { useWidgetFetch as de } from "./useWidgetFetch.js";
|
|
25
24
|
import { deriveOrganizationStatus as fe } from "./deriveOrganizationStatus.js";
|
|
26
25
|
import { deriveWidgetInitState as pe, useWidgetInitPublisher as me } from "./useWidgetInitPublisher.js";
|
|
27
26
|
import { useTokenRefreshRef as he } from "./useTokenRefreshRef.js";
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
27
|
+
import { useOwnedQueryClient as ge } from "./useOwnedQueryClient.js";
|
|
28
|
+
import { useAnalyticsTrack as l } from "../analytics/hooks.js";
|
|
29
|
+
import { resolveProviderLabels as _e } from "./labels.js";
|
|
30
|
+
import { WidgetErrorBoundary as ve } from "./WidgetErrorBoundary.js";
|
|
31
|
+
import { DISCLOSURES_REQUIRED_TEST_ID as u, hasRenderableAcceptanceSurface as d, resolveDisclosuresBlockedReason as f, shouldGateOnDisclosuresAcceptance as ye } from "./isDisclosuresAcceptanceRequired.js";
|
|
32
|
+
import { useContext as be, useEffect as p, useMemo as m, useRef as h, useState as g, useSyncExternalStore as xe } from "react";
|
|
33
|
+
import { jsx as _, jsxs as Se } from "react/jsx-runtime";
|
|
34
|
+
import { QueryClient as Ce, QueryClientProvider as we } from "@tanstack/react-query";
|
|
35
35
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
36
|
-
function
|
|
36
|
+
function v({ children: te, baseUrl: s, widgetToken: c, organizationId: l, configClient: u, gatewayRouting: d, linkComponent: f, uiFramework: v, errorFallback: Ee, onError: De, analytics: y, disclosuresAcceptance: Oe, providerLabels: ke, widgetName: b, header: Ae }) {
|
|
37
37
|
e();
|
|
38
|
-
let
|
|
38
|
+
let x = be(se), S = xe(ie, re, re), C = x?.resolved ?? S, je = x?.refetch ?? ce, Me = x?.loading ?? !1, Ne = x?.error ?? null, w = s ?? C.baseUrl, T = c === void 0 ? C.widgetToken : c, Pe = x ? x.cascadeOrgId : S.organizationId, E = l === void 0 ? Pe : l, D = u ?? C.configClient, O = d ?? C.gatewayRouting, k = f ?? C.linkComponent, A = v ?? C.uiFramework, j = Oe ?? x?.disclosuresAcceptance, M = ke ?? x?.providerLabels, N = m(() => _e(M), [M]), P = x === null, F = P ? y !== !1 : x.analytics.enabled, [Fe] = g(oe), I = P ? Fe : x.analytics.rootCorrelationId, [Ie] = g(oe), L = b === void 0 ? x?.analytics.widgetName : b, R = b === void 0 ? x?.analytics.widgetInstanceId : Ie, z = h({
|
|
39
39
|
enabled: F,
|
|
40
|
-
organizationId:
|
|
40
|
+
organizationId: E,
|
|
41
41
|
rootCorrelationId: I,
|
|
42
42
|
widgetName: L,
|
|
43
43
|
widgetInstanceId: R
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
P ||
|
|
47
|
-
}, [
|
|
44
|
+
}), Le = h(!1);
|
|
45
|
+
p(() => {
|
|
46
|
+
P || y === void 0 || Le.current || (Le.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
|
|
47
|
+
}, [y, P]), p(() => {
|
|
48
48
|
if (!P || !F || !("window" in globalThis)) return;
|
|
49
49
|
let e = !1;
|
|
50
50
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
@@ -53,186 +53,182 @@ function b({ children: re, baseUrl: s, widgetToken: l, organizationId: d, config
|
|
|
53
53
|
e = !0;
|
|
54
54
|
};
|
|
55
55
|
}, [P, F]);
|
|
56
|
-
let B =
|
|
57
|
-
|
|
56
|
+
let B = ee(a(A));
|
|
57
|
+
p(() => {
|
|
58
58
|
B && B().catch(() => {});
|
|
59
59
|
}, [B]);
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
let
|
|
63
|
-
if (!
|
|
64
|
-
let e =
|
|
65
|
-
tokenRef:
|
|
60
|
+
let Re = x === null || s !== void 0 || c !== void 0 || l !== void 0 || u != null || d !== void 0 || b !== void 0, ze = h(T);
|
|
61
|
+
ze.current = T;
|
|
62
|
+
let Be = he(), Ve = h(null), He = m(() => t(Ve), []), Ue = i(), We = ue(T), V = m(() => {
|
|
63
|
+
if (!Re) return null;
|
|
64
|
+
let e = ae(n(w), {
|
|
65
|
+
tokenRef: ze,
|
|
66
66
|
analyticsContextRef: z,
|
|
67
|
-
clientSecretRef:
|
|
68
|
-
gatewayRouting:
|
|
69
|
-
refreshTokenRef:
|
|
67
|
+
clientSecretRef: Ve,
|
|
68
|
+
gatewayRouting: O,
|
|
69
|
+
refreshTokenRef: Be
|
|
70
70
|
});
|
|
71
|
-
return
|
|
71
|
+
return D ? D(e) : e;
|
|
72
72
|
}, [
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
Re,
|
|
74
|
+
w,
|
|
75
|
+
D,
|
|
75
76
|
O,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
initStaleForToken: J
|
|
77
|
+
Be
|
|
78
|
+
]), H = x === null || s !== void 0 || c !== void 0, Ge = H ? We : Ue.authEpoch, { result: U, loading: W, error: G, clearedForAuthChange: Ke, initStaleForToken: K, initReplacementPending: qe, refetch: Je } = de(H ? V : null, H ? T : void 0, z), Ye = H ? Je : je, Xe = H ? W : Me, q = H ? G : Ne, Ze = x?.resolved.initResponse, Qe = !H || !Ke && !G && !U && !!T && !W, J = Qe ? Ze : U ?? void 0, Y = Qe ? H || (x?.initResponseStaleForToken ?? !1) : K, $e = x === null, et = m(() => $e ? pe({
|
|
79
|
+
hasToken: !!T,
|
|
80
|
+
loading: W,
|
|
81
|
+
error: G,
|
|
82
|
+
initResponse: U ?? void 0,
|
|
83
|
+
initStaleForToken: K
|
|
84
84
|
}) : null, [
|
|
85
85
|
$e,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
q,
|
|
86
|
+
T,
|
|
87
|
+
W,
|
|
89
88
|
G,
|
|
90
|
-
|
|
89
|
+
U,
|
|
90
|
+
K
|
|
91
91
|
]);
|
|
92
|
-
me(et,
|
|
93
|
-
let
|
|
94
|
-
organizationId:
|
|
95
|
-
cascadeOrgId:
|
|
96
|
-
ownsFetch:
|
|
97
|
-
parentStatus:
|
|
98
|
-
hasToken: !!
|
|
99
|
-
loading:
|
|
100
|
-
error:
|
|
101
|
-
hasResult: !!
|
|
102
|
-
initReplacementPending:
|
|
103
|
-
}),
|
|
92
|
+
me(et, T);
|
|
93
|
+
let X = le(E, Y ? void 0 : J?.organizationId), tt = fe({
|
|
94
|
+
organizationId: X,
|
|
95
|
+
cascadeOrgId: E,
|
|
96
|
+
ownsFetch: H,
|
|
97
|
+
parentStatus: Ue.organizationStatus,
|
|
98
|
+
hasToken: !!T,
|
|
99
|
+
loading: W,
|
|
100
|
+
error: G,
|
|
101
|
+
hasResult: !!U,
|
|
102
|
+
initReplacementPending: qe
|
|
103
|
+
}), Z = m(() => ({
|
|
104
104
|
enabled: F,
|
|
105
|
-
organizationId:
|
|
105
|
+
organizationId: X,
|
|
106
106
|
rootCorrelationId: I,
|
|
107
107
|
widgetName: L,
|
|
108
108
|
widgetInstanceId: R
|
|
109
109
|
}), [
|
|
110
110
|
F,
|
|
111
|
-
|
|
111
|
+
X,
|
|
112
112
|
I,
|
|
113
113
|
L,
|
|
114
114
|
R
|
|
115
115
|
]);
|
|
116
|
-
z.current =
|
|
117
|
-
let [
|
|
116
|
+
z.current = Z;
|
|
117
|
+
let [Q] = g(() => x === null ? new Ce({ defaultOptions: {
|
|
118
118
|
queries: {
|
|
119
119
|
retry: !1,
|
|
120
120
|
refetchOnWindowFocus: !1
|
|
121
121
|
},
|
|
122
122
|
mutations: { retry: !1 }
|
|
123
123
|
} }) : null);
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
let e = $;
|
|
127
|
-
return n(e), () => r(e);
|
|
128
|
-
}, [$]);
|
|
129
|
-
let nt = g(() => ({
|
|
124
|
+
ge(Q);
|
|
125
|
+
let nt = m(() => ({
|
|
130
126
|
baseUrl: s,
|
|
131
|
-
widgetToken:
|
|
132
|
-
organizationId:
|
|
133
|
-
configClient:
|
|
134
|
-
gatewayRouting:
|
|
135
|
-
linkComponent:
|
|
136
|
-
uiFramework:
|
|
127
|
+
widgetToken: c,
|
|
128
|
+
organizationId: l,
|
|
129
|
+
configClient: u,
|
|
130
|
+
gatewayRouting: d,
|
|
131
|
+
linkComponent: f,
|
|
132
|
+
uiFramework: v
|
|
137
133
|
}), [
|
|
138
134
|
s,
|
|
135
|
+
c,
|
|
139
136
|
l,
|
|
137
|
+
u,
|
|
140
138
|
d,
|
|
141
139
|
f,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
uiFramework: j,
|
|
153
|
-
initResponse: Y
|
|
140
|
+
v
|
|
141
|
+
]), rt = m(() => ({
|
|
142
|
+
baseUrl: w,
|
|
143
|
+
widgetToken: T,
|
|
144
|
+
organizationId: X,
|
|
145
|
+
configClient: D,
|
|
146
|
+
gatewayRouting: O,
|
|
147
|
+
linkComponent: k,
|
|
148
|
+
uiFramework: A,
|
|
149
|
+
initResponse: J
|
|
154
150
|
}), [
|
|
151
|
+
w,
|
|
155
152
|
T,
|
|
156
|
-
|
|
157
|
-
|
|
153
|
+
X,
|
|
154
|
+
D,
|
|
158
155
|
O,
|
|
159
156
|
k,
|
|
160
157
|
A,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
]), it = g(() => ({
|
|
158
|
+
J
|
|
159
|
+
]), it = m(() => ({
|
|
164
160
|
resolved: rt,
|
|
165
161
|
own: nt,
|
|
166
|
-
refetch:
|
|
167
|
-
loading:
|
|
168
|
-
error:
|
|
169
|
-
analytics:
|
|
170
|
-
cascadeOrgId:
|
|
171
|
-
initResponseStaleForToken:
|
|
172
|
-
disclosuresAcceptance:
|
|
173
|
-
providerLabels:
|
|
162
|
+
refetch: Ye,
|
|
163
|
+
loading: Xe,
|
|
164
|
+
error: q,
|
|
165
|
+
analytics: Z,
|
|
166
|
+
cascadeOrgId: E,
|
|
167
|
+
initResponseStaleForToken: Y,
|
|
168
|
+
disclosuresAcceptance: j,
|
|
169
|
+
providerLabels: M
|
|
174
170
|
}), [
|
|
175
171
|
rt,
|
|
176
172
|
nt,
|
|
177
|
-
Je,
|
|
178
173
|
Ye,
|
|
179
174
|
Xe,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
175
|
+
q,
|
|
176
|
+
Z,
|
|
177
|
+
E,
|
|
178
|
+
Y,
|
|
179
|
+
j,
|
|
180
|
+
M
|
|
181
|
+
]), at = /* @__PURE__ */ _(se.Provider, {
|
|
186
182
|
value: it,
|
|
187
|
-
children: /* @__PURE__ */
|
|
188
|
-
linkComponent:
|
|
189
|
-
uiFramework:
|
|
190
|
-
children: /* @__PURE__ */
|
|
191
|
-
resetKeys: [
|
|
192
|
-
errorFallback:
|
|
193
|
-
onError:
|
|
194
|
-
labels:
|
|
195
|
-
children:
|
|
196
|
-
disclosuresAcceptance:
|
|
197
|
-
initStaleForToken:
|
|
198
|
-
labels:
|
|
199
|
-
}) :
|
|
183
|
+
children: /* @__PURE__ */ _(o, {
|
|
184
|
+
linkComponent: k,
|
|
185
|
+
uiFramework: A,
|
|
186
|
+
children: /* @__PURE__ */ Se(ne, { children: [Ae, /* @__PURE__ */ _(ve, {
|
|
187
|
+
resetKeys: [T],
|
|
188
|
+
errorFallback: Ee,
|
|
189
|
+
onError: De,
|
|
190
|
+
labels: N,
|
|
191
|
+
children: ye(J, b) ? /* @__PURE__ */ _(Te, {
|
|
192
|
+
disclosuresAcceptance: j,
|
|
193
|
+
initStaleForToken: Y,
|
|
194
|
+
labels: N
|
|
195
|
+
}) : te
|
|
200
196
|
})] })
|
|
201
197
|
})
|
|
202
|
-
}),
|
|
203
|
-
client:
|
|
204
|
-
organizationId:
|
|
205
|
-
widgetToken:
|
|
206
|
-
installClientSecret:
|
|
207
|
-
authEpoch:
|
|
198
|
+
}), $ = V ? /* @__PURE__ */ _(r, {
|
|
199
|
+
client: V,
|
|
200
|
+
organizationId: X,
|
|
201
|
+
widgetToken: T,
|
|
202
|
+
installClientSecret: He,
|
|
203
|
+
authEpoch: Ge,
|
|
208
204
|
organizationStatus: tt,
|
|
209
205
|
children: at
|
|
210
206
|
}) : at;
|
|
211
|
-
return
|
|
212
|
-
client:
|
|
213
|
-
children:
|
|
214
|
-
}) :
|
|
207
|
+
return Q ? /* @__PURE__ */ _(we, {
|
|
208
|
+
client: Q,
|
|
209
|
+
children: $
|
|
210
|
+
}) : $;
|
|
215
211
|
}
|
|
216
|
-
function
|
|
217
|
-
let r =
|
|
212
|
+
function Te({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
|
|
213
|
+
let r = te("error-state") ?? s, i = l(), a = d(e), o = f({
|
|
218
214
|
initStaleForToken: t,
|
|
219
215
|
hasAcceptanceSurface: a
|
|
220
216
|
});
|
|
221
|
-
return
|
|
222
|
-
i(
|
|
223
|
-
}, [o, i]), t ? /* @__PURE__ */
|
|
217
|
+
return p(() => {
|
|
218
|
+
i(c.WidgetDisclosuresBlocked, { reason: o }), console.info(`[disclosures] widget blocked: ${o}`);
|
|
219
|
+
}, [o, i]), t ? /* @__PURE__ */ _(r, {
|
|
224
220
|
title: n.disclosuresRefreshingTitle,
|
|
225
221
|
description: n.disclosuresRefreshingDescription,
|
|
226
|
-
testId:
|
|
222
|
+
testId: u,
|
|
227
223
|
className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
|
|
228
|
-
}) : a ? /* @__PURE__ */
|
|
229
|
-
"data-testid":
|
|
224
|
+
}) : a ? /* @__PURE__ */ _("div", {
|
|
225
|
+
"data-testid": u,
|
|
230
226
|
className: "ttw:w-full",
|
|
231
227
|
children: e
|
|
232
|
-
}) : /* @__PURE__ */
|
|
228
|
+
}) : /* @__PURE__ */ _(r, {
|
|
233
229
|
title: n.disclosuresRequiredTitle,
|
|
234
|
-
testId:
|
|
230
|
+
testId: u,
|
|
235
231
|
className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
|
|
236
232
|
});
|
|
237
233
|
}
|
|
238
|
-
export {
|
|
234
|
+
export { v as WidgetProvider, v as default };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
6
|
+
import "../../../../data-access/dist/index.js";
|
|
7
|
+
import { useEffect as n, useRef as r } from "react";
|
|
8
|
+
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useOwnedQueryClient.js
|
|
9
|
+
function i(i) {
|
|
10
|
+
let a = r(void 0);
|
|
11
|
+
n(() => {
|
|
12
|
+
if (i) return a.current?.(), e(i), () => {
|
|
13
|
+
t(i);
|
|
14
|
+
let e = !1, n, r = setTimeout(() => {
|
|
15
|
+
i.cancelQueries().then(() => {
|
|
16
|
+
if (e) return;
|
|
17
|
+
for (let e of i.getMutationCache().getAll()) e.destroy();
|
|
18
|
+
i.clear();
|
|
19
|
+
let t = i.getQueryCache(), r = !1;
|
|
20
|
+
n = t.subscribe((e) => {
|
|
21
|
+
e.type === "added" && !r ? t.remove(e.query) : e.type === "observerAdded" && (r = !0, t.add(e.query));
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}, 0);
|
|
25
|
+
a.current = () => {
|
|
26
|
+
e = !0, clearTimeout(r), n?.();
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
}, [i]);
|
|
30
|
+
}
|
|
31
|
+
export { i as useOwnedQueryClient };
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.11.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.11.276", n = "906142414581e930d666b1e4c9960ddc711f9a99", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -5,7 +5,7 @@ var r = {
|
|
|
5
5
|
warning: "ttw:border-warning/40 ttw:bg-warning-subtle ttw:text-warning-foreground ttw:hover:border-warning",
|
|
6
6
|
destructive: "ttw:border-destructive/40 ttw:bg-destructive-subtle ttw:text-destructive-subtle-foreground ttw:hover:border-destructive"
|
|
7
7
|
}, i = {
|
|
8
|
-
warning: "ttw:border-warning ttw:bg-warning ttw:text-
|
|
8
|
+
warning: "ttw:border-warning-foreground ttw:bg-warning-subtle ttw:text-warning-foreground ttw:ring-1 ttw:ring-inset ttw:ring-warning-foreground",
|
|
9
9
|
destructive: "ttw:border-destructive ttw:bg-destructive ttw:text-destructive-foreground"
|
|
10
10
|
};
|
|
11
11
|
function a({ label: a, items: o, className: s }) {
|
|
@@ -3,7 +3,7 @@ import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
|
3
3
|
import { ChevronLeftIcon as a } from "lucide-react";
|
|
4
4
|
// ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js
|
|
5
5
|
var o = {
|
|
6
|
-
warning: "ttw:text-warning",
|
|
6
|
+
warning: "ttw:text-warning-foreground",
|
|
7
7
|
destructive: "ttw:text-destructive"
|
|
8
8
|
};
|
|
9
9
|
function s({ backLabel: s, backAccessibleLabel: c, title: l, tone: u, onBack: d }) {
|
package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js
CHANGED
|
@@ -5,7 +5,7 @@ function r({ label: r, overdueLabel: i, accessibleLabel: a }) {
|
|
|
5
5
|
return i ? /* @__PURE__ */ t(e, {
|
|
6
6
|
hint: r,
|
|
7
7
|
children: /* @__PURE__ */ n("span", {
|
|
8
|
-
className: "ttw:text-destructive",
|
|
8
|
+
className: "ttw:text-destructive-subtle-foreground",
|
|
9
9
|
children: [/* @__PURE__ */ t("span", {
|
|
10
10
|
"aria-hidden": !0,
|
|
11
11
|
children: i
|
|
@@ -23,27 +23,27 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
|
|
|
23
23
|
...R
|
|
24
24
|
}, [V, H] = u.useState(null), U = u.useCallback((e) => {
|
|
25
25
|
H(e);
|
|
26
|
-
}, []), W = u.useRef(null), G = u.useRef(b);
|
|
26
|
+
}, []), W = u.useRef(null), G = u.useId(), K = u.useRef(b);
|
|
27
27
|
u.useEffect(() => {
|
|
28
|
-
if (
|
|
28
|
+
if (K.current === b || (K.current = b, !V)) return;
|
|
29
29
|
let { activeElement: e, body: t } = V.ownerDocument;
|
|
30
30
|
(!e || e === t || V.contains(e)) && W.current?.focus({ preventScroll: !0 }), V.getBoundingClientRect().top < m(V) && V.scrollIntoView({ block: "start" });
|
|
31
31
|
}, [b, V]);
|
|
32
|
-
let
|
|
32
|
+
let q = u.useRef(v);
|
|
33
33
|
u.useEffect(() => {
|
|
34
|
-
|
|
34
|
+
q.current && W.current?.focus();
|
|
35
35
|
}, []);
|
|
36
|
-
let
|
|
36
|
+
let J = u.useMemo(() => ({ container: V }), [V]), Y = P || O, X = j ? /* @__PURE__ */ d(e, {
|
|
37
37
|
type: "button",
|
|
38
38
|
variant: "outline",
|
|
39
|
-
disabled: A ||
|
|
39
|
+
disabled: A || Y,
|
|
40
40
|
onClick: C,
|
|
41
41
|
"aria-label": M,
|
|
42
42
|
"data-testid": z?.back,
|
|
43
43
|
children: B.backButton
|
|
44
44
|
}) : null;
|
|
45
45
|
return /* @__PURE__ */ d(s.Provider, {
|
|
46
|
-
value:
|
|
46
|
+
value: J,
|
|
47
47
|
children: /* @__PURE__ */ f("div", {
|
|
48
48
|
ref: U,
|
|
49
49
|
className: "ttw:relative ttw:grid ttw:max-h-full ttw:w-full ttw:min-h-0 ttw:grid-rows-[auto_1fr_auto] ttw:gap-0 ttw:overflow-hidden ttw:bg-background",
|
|
@@ -54,6 +54,7 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
|
|
|
54
54
|
children: [
|
|
55
55
|
/* @__PURE__ */ d(t, {
|
|
56
56
|
variant: "page",
|
|
57
|
+
id: G,
|
|
57
58
|
ref: W,
|
|
58
59
|
tabIndex: -1,
|
|
59
60
|
className: r("ttw:outline-none", _ ? "ttw:sr-only" : "ttw:text-foreground"),
|
|
@@ -68,13 +69,14 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
|
|
|
68
69
|
activeStep: b,
|
|
69
70
|
labels: R,
|
|
70
71
|
onStepClick: x,
|
|
71
|
-
isStepClickDisabled:
|
|
72
|
+
isStepClickDisabled: Y,
|
|
72
73
|
stepButtonTestIdPrefix: z?.stepButton
|
|
73
74
|
})
|
|
74
75
|
]
|
|
75
76
|
}),
|
|
76
77
|
/* @__PURE__ */ d(l, {
|
|
77
78
|
activeStep: b,
|
|
79
|
+
labelledBy: G,
|
|
78
80
|
testIds: z?.scrollRegion,
|
|
79
81
|
children: L
|
|
80
82
|
}),
|
|
@@ -98,7 +100,7 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
|
|
|
98
100
|
children: [k ? /* @__PURE__ */ f(e, {
|
|
99
101
|
type: "button",
|
|
100
102
|
variant: "ghost",
|
|
101
|
-
disabled:
|
|
103
|
+
disabled: Y,
|
|
102
104
|
onClick: k,
|
|
103
105
|
className: "ttw:max-w-full ttw:whitespace-normal ttw:text-destructive ttw:hover:text-destructive",
|
|
104
106
|
"data-testid": z?.delete,
|
|
@@ -106,14 +108,14 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
|
|
|
106
108
|
className: "ttw:size-4",
|
|
107
109
|
"aria-hidden": !0
|
|
108
110
|
}), B.deleteButton]
|
|
109
|
-
}) :
|
|
111
|
+
}) : X, /* @__PURE__ */ f("div", {
|
|
110
112
|
className: "ttw:ml-auto ttw:flex ttw:min-w-0 ttw:max-w-full ttw:flex-wrap ttw:items-center ttw:justify-end ttw:gap-3",
|
|
111
113
|
children: [
|
|
112
|
-
k ?
|
|
114
|
+
k ? X : null,
|
|
113
115
|
T ? /* @__PURE__ */ d(e, {
|
|
114
116
|
type: "button",
|
|
115
117
|
variant: "ghost",
|
|
116
|
-
disabled:
|
|
118
|
+
disabled: Y,
|
|
117
119
|
onClick: T,
|
|
118
120
|
"data-testid": z?.cancel,
|
|
119
121
|
children: B.cancelButton
|
|
@@ -121,7 +123,7 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
|
|
|
121
123
|
E ? /* @__PURE__ */ d(e, {
|
|
122
124
|
type: "button",
|
|
123
125
|
variant: "secondary",
|
|
124
|
-
disabled: D ||
|
|
126
|
+
disabled: D || Y,
|
|
125
127
|
loading: O,
|
|
126
128
|
onClick: E,
|
|
127
129
|
"data-testid": z?.saveAndClose,
|
|
@@ -129,7 +131,7 @@ function h({ title: h, subtitle: g, isTitleVisuallyHidden: _ = !1, focusTitleOnM
|
|
|
129
131
|
}) : null,
|
|
130
132
|
/* @__PURE__ */ d(e, {
|
|
131
133
|
type: "button",
|
|
132
|
-
disabled: N ||
|
|
134
|
+
disabled: N || Y,
|
|
133
135
|
loading: P,
|
|
134
136
|
onClick: w,
|
|
135
137
|
"data-testid": z?.next,
|
|
@@ -20,26 +20,29 @@ function a(e) {
|
|
|
20
20
|
}, [e])
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
function o({ activeStep: o,
|
|
24
|
-
let { containerRef:
|
|
23
|
+
function o({ activeStep: o, labelledBy: s, children: c, testIds: l }) {
|
|
24
|
+
let { containerRef: u, hasOverflow: d, fadeVisible: f, fadeHeight: p, resetHint: m } = e(), { mounted: h, visible: g, onTransitionEnd: _ } = a(f);
|
|
25
25
|
return t.useEffect(() => {
|
|
26
|
-
|
|
27
|
-
}, [o,
|
|
28
|
-
ref:
|
|
29
|
-
|
|
30
|
-
"
|
|
26
|
+
m();
|
|
27
|
+
}, [o, m]), /* @__PURE__ */ r("div", {
|
|
28
|
+
ref: u,
|
|
29
|
+
role: "region",
|
|
30
|
+
"aria-labelledby": s,
|
|
31
|
+
tabIndex: 0,
|
|
32
|
+
className: "ttw:relative ttw:min-h-0 ttw:overflow-y-auto ttw:px-8 ttw:pt-2 ttw:outline-none ttw:focus-visible:outline-2 ttw:focus-visible:-outline-offset-2 ttw:focus-visible:outline-ring",
|
|
33
|
+
"data-testid": l?.root,
|
|
31
34
|
children: [/* @__PURE__ */ n("div", {
|
|
32
35
|
className: "ttw:pb-4",
|
|
33
|
-
children:
|
|
34
|
-
}),
|
|
36
|
+
children: c
|
|
37
|
+
}), d && h ? /* @__PURE__ */ n("div", {
|
|
35
38
|
"aria-hidden": !0,
|
|
36
|
-
"data-testid":
|
|
37
|
-
onTransitionEnd:
|
|
39
|
+
"data-testid": l?.fade,
|
|
40
|
+
onTransitionEnd: _,
|
|
38
41
|
className: "ttw:pointer-events-none ttw:sticky ttw:bottom-0 ttw:left-0 ttw:right-0 ttw:z-[1] ttw:transition-opacity ttw:ease-in-out",
|
|
39
42
|
style: {
|
|
40
|
-
height:
|
|
41
|
-
marginTop: `-${
|
|
42
|
-
opacity: +!!
|
|
43
|
+
height: p,
|
|
44
|
+
marginTop: `-${p}px`,
|
|
45
|
+
opacity: +!!g,
|
|
43
46
|
transitionDuration: `${i}ms`,
|
|
44
47
|
background: "linear-gradient(to bottom, transparent 0%, var(--ttw-background) 85%, var(--ttw-background) 100%)"
|
|
45
48
|
}
|