@tesouro/embedded-components-react 0.2.280 → 0.2.281

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.
Files changed (68) hide show
  1. package/README.md +17 -14
  2. package/dist/experimental/WidgetSuite.d.ts +9 -1
  3. package/dist/experimental/index.d.ts +9 -1
  4. package/dist/index.css +3 -0
  5. package/dist/index.d.ts +46 -23
  6. package/dist/index.js +54 -53
  7. package/dist/lib/AcceptDisclosuresWidget.d.ts +9 -1
  8. package/dist/lib/BalancesWidget.d.ts +8 -0
  9. package/dist/lib/BankAccountOnboardingWidget.d.ts +9 -1
  10. package/dist/lib/BankAccountsWidget.d.ts +9 -1
  11. package/dist/lib/BillPayWidget.d.ts +8 -0
  12. package/dist/lib/CardDetailsWidget.d.ts +9 -1
  13. package/dist/lib/CardsWidget.d.ts +9 -1
  14. package/dist/lib/ChartOfAccountsWidget.d.ts +9 -1
  15. package/dist/lib/CounterpartsWidget.d.ts +9 -1
  16. package/dist/lib/CreateCardWidget.d.ts +9 -1
  17. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +9 -1
  18. package/dist/lib/ExpenseManagementWidget.d.ts +9 -1
  19. package/dist/lib/ExpenseRequirementsWidget.d.ts +9 -1
  20. package/dist/lib/HelpWidget.d.ts +9 -1
  21. package/dist/lib/InsightsWidget.d.ts +8 -0
  22. package/dist/lib/InvoicingWidget.d.ts +9 -1
  23. package/dist/lib/LinkedAccountsWidget.d.ts +9 -1
  24. package/dist/lib/ProductsWidget.d.ts +9 -1
  25. package/dist/lib/ProfileWidget.d.ts +9 -1
  26. package/dist/lib/ReceiptMatchWidget.d.ts +9 -1
  27. package/dist/lib/ReceivablesWidget.d.ts +9 -1
  28. package/dist/lib/SettingsWidget.d.ts +9 -1
  29. package/dist/lib/TagsWidget.d.ts +9 -1
  30. package/dist/lib/TeamWidget.d.ts +9 -1
  31. package/dist/lib/TransfersWidget.d.ts +8 -0
  32. package/dist/lib/WidgetProvider.d.ts +25 -2
  33. package/dist/lib/WidgetProvider.js +8 -7
  34. package/dist/lib/WidgetProviderPublic.d.ts +8 -0
  35. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +3 -2
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +54 -53
  37. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +3 -2
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +4 -3
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +3 -2
  40. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +3 -2
  41. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +3 -2
  42. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +3 -2
  43. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +30 -29
  44. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +2 -1
  45. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +3 -2
  46. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +7 -6
  47. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +2 -1
  48. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +5 -4
  49. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +3 -2
  50. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +3 -2
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +5 -4
  52. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +3 -2
  53. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +3 -2
  54. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +3 -2
  55. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +3 -2
  56. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +5 -5
  57. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +69 -67
  58. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +158 -132
  59. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js +7 -4
  60. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +20 -0
  61. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js +6 -1
  62. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  63. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +9 -9
  64. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/ErrorState/ErrorState.js +19 -18
  65. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +3 -2
  66. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +3 -2
  67. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +3 -2
  68. package/package.json +1 -1
@@ -2,185 +2,211 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { registerQueryClient as e, unregisterQueryClient as ee } from "../../../../data-access/dist/lib/clientRegistry.js";
6
- import { createEmbeddedClient as t } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
- import { EmbedApiProvider as te, useEmbedApi as ne } from "../../../../data-access/dist/lib/EmbedApiContext.js";
5
+ import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
6
+ import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
+ import { EmbedApiProvider as r, useEmbedApi as ee } from "../../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import "../../../../data-access/dist/index.js";
9
- import { getGlobalSnapshot as n, subscribeToGlobal as re } from "./globalStore.js";
10
- import { configureEmbeddedClient as ie } from "../analytics/client.js";
11
- import { generateCorrelationId as r } from "../analytics/ids.js";
12
- import { WidgetContext as i } from "./WidgetContext.js";
13
- import { noop as ae, resolveOrgId as oe, useAuthEpoch as se } from "./utils.js";
14
- import { useWidgetFetch as ce } from "./useWidgetFetch.js";
15
- import { deriveWidgetInitState as le, useWidgetInitPublisher as ue } from "./useWidgetInitPublisher.js";
16
- import { resolveUIFramework as de } from "../../../../ui/dist/lib/UIContext/UIContext.js";
17
- import { UIProvider as fe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
18
- import { useDesignSystemEnsurer as pe } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
19
- import { HostIsolationScope as me } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
9
+ import { getGlobalSnapshot as te, subscribeToGlobal as ne } from "./globalStore.js";
10
+ import { configureEmbeddedClient as re } from "../analytics/client.js";
11
+ import { generateCorrelationId as ie } from "../analytics/ids.js";
12
+ import { WidgetContext as ae } from "./WidgetContext.js";
13
+ import { noop as oe, resolveOrgId as se, useAuthEpoch as ce } from "./utils.js";
14
+ import { useWidgetFetch as le } from "./useWidgetFetch.js";
15
+ import { deriveWidgetInitState as ue, useWidgetInitPublisher as de } from "./useWidgetInitPublisher.js";
16
+ import { resolveUIFramework as fe } from "../../../../ui/dist/lib/UIContext/UIContext.js";
17
+ import { UIProvider as pe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
18
+ import { useDesignSystemEnsurer as me, useFrameworkRenderer as he } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
19
+ import { HostIsolationScope as ge } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
20
+ import { ErrorState as i } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
20
21
  import "../../../../ui/dist/index.js";
21
- import { WidgetErrorBoundary as he } from "./WidgetErrorBoundary.js";
22
- import { useContext as ge, useEffect as a, useMemo as o, useRef as s, useState as c, useSyncExternalStore as _e } from "react";
23
- import { jsx as l } from "react/jsx-runtime";
24
- import { QueryClient as ve, QueryClientProvider as ye } from "@tanstack/react-query";
22
+ import { DEFAULT_LABELS as a } from "./labels.js";
23
+ import { WidgetErrorBoundary as _e } from "./WidgetErrorBoundary.js";
24
+ import { DISCLOSURES_REQUIRED_TEST_ID as o, isAuthenticatedDisclosuresReacceptance as s, shouldGateOnDisclosuresAcceptance as ve } from "./isDisclosuresAcceptanceRequired.js";
25
+ import { useContext as ye, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as be } from "react";
26
+ import { jsx as f } from "react/jsx-runtime";
27
+ import { QueryClient as xe, QueryClientProvider as Se } from "@tanstack/react-query";
25
28
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
26
- function u({ children: u, baseUrl: d, widgetToken: f, organizationId: p, configClient: m, gatewayRouting: h, linkComponent: g, uiFramework: _, implementation: v, errorFallback: be, onError: xe, analytics: y, widgetName: b }) {
27
- let x = ge(i), Se = _e(re, n, n), S = x?.resolved ?? Se, Ce = x?.refetch ?? ae, we = x?.loading ?? !1, Te = x?.error ?? null, C = d ?? S.baseUrl, w = f === void 0 ? S.widgetToken : f, Ee = x ? x.cascadeOrgId : Se.organizationId, T = p === void 0 ? Ee : p, E = m ?? S.configClient, D = h ?? S.gatewayRouting, O = g ?? S.linkComponent, k = _ ?? S.uiFramework, A = v ?? S.implementation, j = x === null, M = j ? y !== !1 : x.analytics.enabled, [De] = c(r), N = j ? De : x.analytics.rootCorrelationId, [Oe] = c(r), P = b === void 0 ? x?.analytics.widgetName : b, F = b === void 0 ? x?.analytics.widgetInstanceId : Oe, I = s({
29
+ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, configClient: s, gatewayRouting: p, linkComponent: m, uiFramework: h, implementation: g, errorFallback: we, onError: Te, analytics: _, disclosuresAcceptance: Ee, widgetName: v }) {
30
+ let y = ye(ae), b = be(ne, te, te), x = y?.resolved ?? b, De = y?.refetch ?? oe, Oe = y?.loading ?? !1, ke = y?.error ?? null, S = i ?? x.baseUrl, C = a === void 0 ? x.widgetToken : a, Ae = y ? y.cascadeOrgId : b.organizationId, w = o === void 0 ? Ae : o, T = s ?? x.configClient, E = p ?? x.gatewayRouting, D = m ?? x.linkComponent, O = h ?? x.uiFramework, k = g ?? x.implementation, A = Ee ?? y?.disclosuresAcceptance, j = y === null, M = j ? _ !== !1 : y.analytics.enabled, [je] = d(ie), N = j ? je : y.analytics.rootCorrelationId, [Me] = d(ie), P = v === void 0 ? y?.analytics.widgetName : v, F = v === void 0 ? y?.analytics.widgetInstanceId : Me, I = u({
28
31
  enabled: M,
29
- organizationId: T,
32
+ organizationId: w,
30
33
  rootCorrelationId: N,
31
34
  widgetName: P,
32
35
  widgetInstanceId: F
33
- }), L = s(!1);
34
- a(() => {
35
- j || y === void 0 || L.current || (L.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."));
36
- }, [y, j]), a(() => {
36
+ }), Ne = u(!1);
37
+ c(() => {
38
+ j || _ === void 0 || Ne.current || (Ne.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."));
39
+ }, [_, j]), c(() => {
37
40
  if (!j || !M || !("window" in globalThis)) return;
38
41
  let e = !1;
39
- return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: ee }) => {
40
- e || ee();
42
+ return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
43
+ e || t();
41
44
  }), () => {
42
45
  e = !0;
43
46
  };
44
47
  }, [j, M]);
45
- let R = pe(de(k));
46
- a(() => {
47
- R && R().catch(() => {});
48
- }, [R]);
49
- let z = x === null || d !== void 0 || f !== void 0 || p !== void 0 || m != null || h !== void 0 || b !== void 0, B = s(w);
50
- B.current = w;
51
- let ke = ne(), Ae = se(w), V = o(() => {
52
- if (!z) return null;
53
- let e = ie(t(C), {
54
- tokenRef: B,
48
+ let L = me(fe(O));
49
+ c(() => {
50
+ L && L().catch(() => {});
51
+ }, [L]);
52
+ let R = y === null || i !== void 0 || a !== void 0 || o !== void 0 || s != null || p !== void 0 || v !== void 0, z = u(C);
53
+ z.current = C;
54
+ let Pe = ee(), Fe = ce(C), B = l(() => {
55
+ if (!R) return null;
56
+ let e = re(n(S), {
57
+ tokenRef: z,
55
58
  analyticsContextRef: I,
56
- gatewayRouting: D
59
+ gatewayRouting: E
57
60
  });
58
- return E ? E(e) : e;
61
+ return T ? T(e) : e;
59
62
  }, [
60
- z,
61
- C,
62
- E,
63
- D
64
- ]), H = x === null || d !== void 0 || f !== void 0, je = H ? Ae : ke.authEpoch, { result: U, loading: W, error: G, clearedForAuthChange: Me, initStaleForToken: K, refetch: Ne } = ce(H ? V : null, H ? w : void 0, I), Pe = H ? Ne : Ce, Fe = H ? W : we, Ie = H ? G : Te, Le = x?.resolved.initResponse, Re = !H || !Me && !G && !U && !!w && !W, q = Re ? Le : U ?? void 0, J = Re ? H || (x?.initResponseStaleForToken ?? !1) : K, Y = x === null, ze = o(() => Y ? le({
65
- hasToken: !!w,
66
- loading: W,
67
- error: G,
68
- initResponse: U ?? void 0,
69
- initStaleForToken: K
63
+ R,
64
+ S,
65
+ T,
66
+ E
67
+ ]), V = y === null || i !== void 0 || a !== void 0, Ie = V ? Fe : Pe.authEpoch, { result: H, loading: U, error: W, clearedForAuthChange: Le, initStaleForToken: G, refetch: Re } = le(V ? B : null, V ? C : void 0, I), K = V ? Re : De, q = V ? U : Oe, J = V ? W : ke, ze = y?.resolved.initResponse, Be = !V || !Le && !W && !H && !!C && !U, Y = Be ? ze : H ?? void 0, X = Be ? V || (y?.initResponseStaleForToken ?? !1) : G, Ve = y === null, He = l(() => Ve ? ue({
68
+ hasToken: !!C,
69
+ loading: U,
70
+ error: W,
71
+ initResponse: H ?? void 0,
72
+ initStaleForToken: G
70
73
  }) : null, [
71
- Y,
72
- w,
73
- W,
74
- G,
74
+ Ve,
75
+ C,
75
76
  U,
76
- K
77
+ W,
78
+ H,
79
+ G
77
80
  ]);
78
- ue(ze, w);
79
- let X = oe(T, J ? void 0 : q?.organizationId), Z = o(() => ({
81
+ de(He, C);
82
+ let Z = se(w, X ? void 0 : Y?.organizationId), Q = l(() => ({
80
83
  enabled: M,
81
- organizationId: X,
84
+ organizationId: Z,
82
85
  rootCorrelationId: N,
83
86
  widgetName: P,
84
87
  widgetInstanceId: F
85
88
  }), [
86
89
  M,
87
- X,
90
+ Z,
88
91
  N,
89
92
  P,
90
93
  F
91
94
  ]);
92
- I.current = Z;
93
- let [Q] = c(() => x === null ? new ve({ defaultOptions: {
95
+ I.current = Q;
96
+ let [$] = d(() => y === null ? new xe({ defaultOptions: {
94
97
  queries: {
95
98
  retry: !1,
96
99
  refetchOnWindowFocus: !1
97
100
  },
98
101
  mutations: { retry: !1 }
99
102
  } }) : null);
100
- a(() => {
101
- if (!Q) return;
102
- let t = Q;
103
- return e(t), () => ee(t);
104
- }, [Q]);
105
- let Be = o(() => ({
106
- baseUrl: d,
107
- widgetToken: f,
108
- organizationId: p,
109
- configClient: m,
110
- gatewayRouting: h,
111
- linkComponent: g,
112
- uiFramework: _,
113
- implementation: v
103
+ c(() => {
104
+ if (!$) return;
105
+ let n = $;
106
+ return e(n), () => t(n);
107
+ }, [$]);
108
+ let Ue = l(() => ({
109
+ baseUrl: i,
110
+ widgetToken: a,
111
+ organizationId: o,
112
+ configClient: s,
113
+ gatewayRouting: p,
114
+ linkComponent: m,
115
+ uiFramework: h,
116
+ implementation: g
114
117
  }), [
115
- d,
116
- f,
118
+ i,
119
+ a,
120
+ o,
121
+ s,
117
122
  p,
118
123
  m,
119
124
  h,
120
- g,
121
- _,
122
- v
123
- ]), Ve = o(() => ({
124
- baseUrl: C,
125
- widgetToken: w,
126
- organizationId: X,
127
- configClient: E,
128
- gatewayRouting: D,
129
- linkComponent: O,
130
- uiFramework: k,
131
- implementation: A,
132
- initResponse: q
125
+ g
126
+ ]), We = l(() => ({
127
+ baseUrl: S,
128
+ widgetToken: C,
129
+ organizationId: Z,
130
+ configClient: T,
131
+ gatewayRouting: E,
132
+ linkComponent: D,
133
+ uiFramework: O,
134
+ implementation: k,
135
+ initResponse: Y
133
136
  }), [
137
+ S,
134
138
  C,
135
- w,
136
- X,
139
+ Z,
140
+ T,
137
141
  E,
138
142
  D,
139
143
  O,
140
144
  k,
141
- A,
142
- q
143
- ]), He = o(() => ({
144
- resolved: Ve,
145
- own: Be,
146
- refetch: Pe,
147
- loading: Fe,
148
- error: Ie,
149
- analytics: Z,
150
- cascadeOrgId: T,
151
- initResponseStaleForToken: J
145
+ Y
146
+ ]), Ge = l(() => ({
147
+ resolved: We,
148
+ own: Ue,
149
+ refetch: K,
150
+ loading: q,
151
+ error: J,
152
+ analytics: Q,
153
+ cascadeOrgId: w,
154
+ initResponseStaleForToken: X,
155
+ disclosuresAcceptance: A
152
156
  }), [
153
- Ve,
154
- Be,
155
- Pe,
156
- Fe,
157
- Ie,
158
- Z,
159
- T,
160
- J
161
- ]), Ue = /* @__PURE__ */ l(i.Provider, {
162
- value: He,
163
- children: /* @__PURE__ */ l(fe, {
164
- linkComponent: O,
165
- uiFramework: k,
166
- children: /* @__PURE__ */ l(me, { children: /* @__PURE__ */ l(he, {
167
- resetKeys: [w],
168
- errorFallback: be,
169
- onError: xe,
170
- children: u
157
+ We,
158
+ Ue,
159
+ K,
160
+ q,
161
+ J,
162
+ Q,
163
+ w,
164
+ X,
165
+ A
166
+ ]), Ke = /* @__PURE__ */ f(ae.Provider, {
167
+ value: Ge,
168
+ children: /* @__PURE__ */ f(pe, {
169
+ linkComponent: D,
170
+ uiFramework: O,
171
+ children: /* @__PURE__ */ f(ge, { children: /* @__PURE__ */ f(_e, {
172
+ resetKeys: [C],
173
+ errorFallback: we,
174
+ onError: Te,
175
+ children: ve(Y, v) ? /* @__PURE__ */ f(Ce, {
176
+ init: Y,
177
+ disclosuresAcceptance: A,
178
+ initStaleForToken: X
179
+ }) : he
171
180
  }) })
172
181
  })
173
- }), $ = V ? /* @__PURE__ */ l(te, {
174
- client: V,
175
- organizationId: X,
176
- widgetToken: w,
177
- authEpoch: je,
178
- children: Ue
179
- }) : Ue;
180
- return Q ? /* @__PURE__ */ l(ye, {
181
- client: Q,
182
- children: $
183
- }) : $;
182
+ }), qe = B ? /* @__PURE__ */ f(r, {
183
+ client: B,
184
+ organizationId: Z,
185
+ widgetToken: C,
186
+ authEpoch: Ie,
187
+ children: Ke
188
+ }) : Ke;
189
+ return $ ? /* @__PURE__ */ f(Se, {
190
+ client: $,
191
+ children: qe
192
+ }) : qe;
193
+ }
194
+ function Ce({ init: e, disclosuresAcceptance: t, initStaleForToken: n }) {
195
+ let r = he("error-state") ?? i;
196
+ return n ? /* @__PURE__ */ f(r, {
197
+ title: a.disclosuresRefreshingTitle,
198
+ description: a.disclosuresRefreshingDescription,
199
+ testId: o,
200
+ 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"
201
+ }) : s(e) && t != null ? /* @__PURE__ */ f("div", {
202
+ "data-testid": o,
203
+ className: "ttw:w-full",
204
+ children: t
205
+ }) : /* @__PURE__ */ f(r, {
206
+ title: a.disclosuresRequiredTitle,
207
+ testId: o,
208
+ 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"
209
+ });
184
210
  }
185
211
  //#endregion
186
- export { u as WidgetProvider, u as default };
212
+ export { p as WidgetProvider, p as default };
@@ -12,16 +12,19 @@ function s() {
12
12
  return i(n)?.own ?? null;
13
13
  }
14
14
  function c() {
15
- return i(n)?.initResponseStaleForToken ?? !1;
15
+ return i(n)?.disclosuresAcceptance;
16
16
  }
17
17
  function l() {
18
- return i(n)?.refetch ?? r;
18
+ return i(n)?.initResponseStaleForToken ?? !1;
19
19
  }
20
20
  function u() {
21
- return i(n)?.loading ?? !1;
21
+ return i(n)?.refetch ?? r;
22
22
  }
23
23
  function d() {
24
+ return i(n)?.loading ?? !1;
25
+ }
26
+ function f() {
24
27
  return i(n)?.error ?? null;
25
28
  }
26
29
  //#endregion
27
- export { s as useOwnWidgetConfig, l as useRefetchWidget, o as useWidgetConfig, d as useWidgetError, c as useWidgetInitStaleForToken, u as useWidgetLoading };
30
+ export { c as useDisclosuresAcceptanceSurface, s as useOwnWidgetConfig, u as useRefetchWidget, o as useWidgetConfig, f as useWidgetError, l as useWidgetInitStaleForToken, d as useWidgetLoading };
@@ -0,0 +1,20 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js
2
+ var e = "widget-disclosures-required", t = /* @__PURE__ */ new Set([
3
+ "accept_disclosures",
4
+ "onboarding",
5
+ "widget_suite"
6
+ ]);
7
+ function n(e) {
8
+ return e?.disclosuresRequired === "REQUIRED" && e?.disclosuresAccepted === !1;
9
+ }
10
+ function r(e) {
11
+ return e !== void 0 && t.has(e);
12
+ }
13
+ function i(e, t) {
14
+ return t !== void 0 && n(e) && !r(t);
15
+ }
16
+ function a(e) {
17
+ return n(e) && e?.status === "ACTIVE";
18
+ }
19
+ //#endregion
20
+ export { e as DISCLOSURES_REQUIRED_TEST_ID, a as isAuthenticatedDisclosuresReacceptance, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, i as shouldGateOnDisclosuresAcceptance };
@@ -1,4 +1,9 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js
2
- var e = { errorBoundaryFallback: "Something went wrong loading this widget." };
2
+ var e = {
3
+ errorBoundaryFallback: "Something went wrong loading this widget.",
4
+ disclosuresRequiredTitle: "Accept disclosures to continue",
5
+ disclosuresRefreshingTitle: "Updating your session",
6
+ disclosuresRefreshingDescription: "Please wait while we load the latest disclosures for this session."
7
+ };
3
8
  //#endregion
4
9
  export { e as DEFAULT_LABELS };
@@ -1,5 +1,5 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.2.280", n = "ae40a14057aee11fe4101507cc328681e99bda36", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.2.281", n = "3edd9856a4389e08020d7acb2298be398fc4ce89", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -12,14 +12,14 @@ import { HostIsolationScope as l } from "./lib/HostIsolationScope/HostIsolationS
12
12
  import { Link as u } from "./lib/Link/Link.js";
13
13
  import { WidgetContainer as d } from "./lib/WidgetContainer/WidgetContainer.js";
14
14
  import { EmptyState as f } from "./lib/EmptyState/EmptyState.js";
15
- import { ErrorState as p } from "./lib/ErrorState/ErrorState.js";
16
- import { InlineErrorAlert as m } from "./lib/InlineErrorAlert/InlineErrorAlert.js";
17
- import { PAGINATION_FOOTER_LABELS_EN as h } from "./lib/PaginationFooter/labels.js";
18
- import { PaginationFooter as g } from "./lib/PaginationFooter/PaginationFooter.js";
19
- import { WidgetTitleWithIconAndChildren as _ } from "./lib/WidgetTitleWithIconAndChildren/WidgetTitleWithIconAndChildren.js";
15
+ import { ERROR_STATE_ID as p, ErrorState as m } from "./lib/ErrorState/ErrorState.js";
16
+ import { InlineErrorAlert as h } from "./lib/InlineErrorAlert/InlineErrorAlert.js";
17
+ import { PAGINATION_FOOTER_LABELS_EN as g } from "./lib/PaginationFooter/labels.js";
18
+ import { PaginationFooter as _ } from "./lib/PaginationFooter/PaginationFooter.js";
19
+ import { WidgetTitleWithIconAndChildren as v } from "./lib/WidgetTitleWithIconAndChildren/WidgetTitleWithIconAndChildren.js";
20
20
  import "./lib/OnboardingShell/labels.js";
21
21
  import "./lib/OnboardingShell/OnboardingShellStepper.js";
22
- import { OnboardingShellOverlayPortal as v } from "./lib/OnboardingShell/OnboardingShellOverlayPortal.js";
23
- import { OnboardingShell as y } from "./lib/OnboardingShell/OnboardingShell.js";
24
- import { SectionHeading as b } from "./lib/SectionHeading/SectionHeading.js";
25
- export { t as EmbeddedToaster, f as EmptyState, p as ErrorState, l as HostIsolationScope, m as InlineErrorAlert, u as Link, y as OnboardingShell, v as OnboardingShellOverlayPortal, h as PAGINATION_FOOTER_LABELS_EN, g as PaginationFooter, b as SectionHeading, n as UIFramework, i as UIProvider, d as WidgetContainer, _ as WidgetTitleWithIconAndChildren, e as avatarSwatchFor, a as registerDesignSystemEnsurer, o as registerUIRenderers, r as resolveUIFramework, s as useDesignSystemEnsurer, c as useFrameworkRenderer };
22
+ import { OnboardingShellOverlayPortal as y } from "./lib/OnboardingShell/OnboardingShellOverlayPortal.js";
23
+ import { OnboardingShell as b } from "./lib/OnboardingShell/OnboardingShell.js";
24
+ import { SectionHeading as x } from "./lib/SectionHeading/SectionHeading.js";
25
+ export { p as ERROR_STATE_ID, t as EmbeddedToaster, f as EmptyState, m as ErrorState, l as HostIsolationScope, h as InlineErrorAlert, u as Link, b as OnboardingShell, y as OnboardingShellOverlayPortal, g as PAGINATION_FOOTER_LABELS_EN, _ as PaginationFooter, x as SectionHeading, n as UIFramework, i as UIProvider, d as WidgetContainer, v as WidgetTitleWithIconAndChildren, e as avatarSwatchFor, a as registerDesignSystemEnsurer, o as registerUIRenderers, r as resolveUIFramework, s as useDesignSystemEnsurer, c as useFrameworkRenderer };
@@ -1,31 +1,32 @@
1
- import { Button as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- import { AlertCircleIcon as r } from "lucide-react";
1
+ import { Button as e, cn as t } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
+ import { AlertCircleIcon as i } from "lucide-react";
4
4
  //#region ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/ErrorState/ErrorState.js
5
- function i({ icon: i, title: a, description: o, retryLabel: s, onRetry: c, className: l, testId: u }) {
6
- return /* @__PURE__ */ n("div", {
7
- "data-testid": u,
8
- className: "ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:px-4 ttw:py-14 ttw:text-center" + (l ? ` ${l}` : ""),
5
+ var a = "error-state";
6
+ function o({ icon: a, title: o, description: s, retryLabel: c, onRetry: l, className: u, testId: d }) {
7
+ return /* @__PURE__ */ r("div", {
8
+ "data-testid": d,
9
+ className: t("ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:px-4 ttw:py-14 ttw:text-center", u),
9
10
  children: [
10
- /* @__PURE__ */ t("div", {
11
+ /* @__PURE__ */ n("div", {
11
12
  className: "ttw:mb-4 ttw:flex ttw:h-14 ttw:w-14 ttw:items-center ttw:justify-center ttw:rounded-2xl ttw:bg-destructive/10",
12
- children: i ?? /* @__PURE__ */ t(r, { className: "ttw:h-6 ttw:w-6 ttw:text-destructive" })
13
+ children: a ?? /* @__PURE__ */ n(i, { className: "ttw:h-6 ttw:w-6 ttw:text-destructive" })
13
14
  }),
14
- /* @__PURE__ */ t("h3", {
15
+ /* @__PURE__ */ n("h3", {
15
16
  className: "ttw:mb-2 ttw:text-lg ttw:font-bold ttw:tracking-tight ttw:text-foreground",
16
- children: a
17
- }),
18
- o && /* @__PURE__ */ t("p", {
19
- className: "ttw:mb-6 ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground",
20
17
  children: o
21
18
  }),
22
- s && c && /* @__PURE__ */ t(e, {
23
- variant: "outline",
24
- onClick: c,
19
+ s && /* @__PURE__ */ n("p", {
20
+ className: t("ttw:max-w-sm ttw:text-sm ttw:text-muted-foreground", c && l && "ttw:mb-6"),
25
21
  children: s
22
+ }),
23
+ c && l && /* @__PURE__ */ n(e, {
24
+ variant: "outline",
25
+ onClick: l,
26
+ children: c
26
27
  })
27
28
  ]
28
29
  });
29
30
  }
30
31
  //#endregion
31
- export { i as ErrorState, i as default };
32
+ export { a as ERROR_STATE_ID, o as ErrorState, o as default };
@@ -72,7 +72,7 @@ function p({ pageSizeOptions: t = i, screenLabels: r, formLabels: p, deleteLabel
72
72
  })
73
73
  ] });
74
74
  }
75
- function m({ baseUrl: e, widgetToken: n, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: f, analytics: m, ...h }) {
75
+ function m({ baseUrl: e, widgetToken: n, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: f, analytics: m, disclosuresAcceptance: h, ...g }) {
76
76
  return /* @__PURE__ */ d(t, {
77
77
  widgetName: r,
78
78
  baseUrl: e,
@@ -86,7 +86,8 @@ function m({ baseUrl: e, widgetToken: n, organizationId: i, configClient: a, gat
86
86
  errorFallback: u,
87
87
  onError: f,
88
88
  analytics: m,
89
- children: /* @__PURE__ */ d(p, { ...h })
89
+ disclosuresAcceptance: h,
90
+ children: /* @__PURE__ */ d(p, { ...g })
90
91
  });
91
92
  }
92
93
  //#endregion
@@ -344,7 +344,7 @@ function h({ labels: r, featureLabels: a, title: h, acceptInviteRedirectUri: g }
344
344
  })
345
345
  ] });
346
346
  }
347
- function g({ baseUrl: e, widgetToken: t, organizationId: ee, configClient: n, gatewayRouting: te, linkComponent: ne, implementation: re, uiFramework: ie, errorFallback: ae, onError: oe, analytics: i, ...o }) {
347
+ function g({ baseUrl: e, widgetToken: t, organizationId: ee, configClient: n, gatewayRouting: te, linkComponent: ne, implementation: re, uiFramework: ie, errorFallback: ae, onError: oe, analytics: i, disclosuresAcceptance: o, ...se }) {
348
348
  return /* @__PURE__ */ f(r, {
349
349
  widgetName: a,
350
350
  baseUrl: e,
@@ -358,7 +358,8 @@ function g({ baseUrl: e, widgetToken: t, organizationId: ee, configClient: n, ga
358
358
  errorFallback: ae,
359
359
  onError: oe,
360
360
  analytics: i,
361
- children: /* @__PURE__ */ f(h, { ...o })
361
+ disclosuresAcceptance: o,
362
+ children: /* @__PURE__ */ f(h, { ...se })
362
363
  });
363
364
  }
364
365
  //#endregion
@@ -110,7 +110,7 @@ function D({ sections: r, labels: m, sectionLabels: D, sectionTitleLabels: O, co
110
110
  labels: m
111
111
  });
112
112
  }
113
- function O({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, ...f }) {
113
+ function O({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, ...p }) {
114
114
  return /* @__PURE__ */ w(r, {
115
115
  widgetName: m,
116
116
  baseUrl: e,
@@ -124,7 +124,8 @@ function O({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gat
124
124
  errorFallback: l,
125
125
  onError: u,
126
126
  analytics: d,
127
- children: /* @__PURE__ */ w(D, { ...f })
127
+ disclosuresAcceptance: f,
128
+ children: /* @__PURE__ */ w(D, { ...p })
128
129
  });
129
130
  }
130
131
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.2.280",
3
+ "version": "0.2.281",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {