@tesouro/embedded-components-react 0.5.29 → 0.5.32

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 CHANGED
@@ -437,19 +437,20 @@ A self-contained widget that walks an applicant through the embedded bank-accoun
437
437
 
438
438
  #### Props
439
439
 
440
- | Prop | Type | Required | Description |
441
- | ------------------------------------------- | ----------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
442
- | `onEmbeddedOnboardingCompletedSuccessfully` | `() => void` | Yes | Called when the application is submitted and approved. |
443
- | `onNavigateToDashboard` | `() => void` | Yes | Called when the user clicks the dashboard CTA on the result screen. |
444
- | `initialBusinessDetails` | `Partial<BusinessDetailsValues>` | No | Prefills step 1 (business details). Unset fields start empty; the user can still edit before continuing. |
445
- | `initialPersonalDetails` | `Partial<PersonalDetailsValues>` | No | Prefills step 2 (personal / about-you details). Unset fields start empty; the user can still edit before continuing. |
446
- | `initialAdditionalOwners` | `AdditionalOwner[]` | No | Prefills step 3 (additional owners). Defaults to an empty list when omitted. |
447
- | `open` | `boolean` | No | Controlled open state for the modal. When provided the host owns open/close and must update it via `onOpenChange`. Omit for uncontrolled mode. |
448
- | `defaultOpen` | `boolean` | No | Initial open state when uncontrolled. Defaults to `false` so the modal stays closed until the host opens it. Ignored when `open` is set. |
449
- | `onOpenChange` | `(open: boolean) => void` | No | Notified whenever the modal opens or closes — fires on overlay click, escape key, the close button, and any controlled state update. Used both as the change handler in controlled mode and a side hook. |
450
- | `labels` | `BankAccountOnboardingWidgetLabels` | No | Per-step label overrides — see Labels section. Accepts a `modalTitle` override for the modal's accessible title (default: `Bank account onboarding`). |
451
- | `bankLogoSrc` | `string` | No | URL for the bank logo rendered on the result screen; falls back to bank name text. |
452
- | `disclosureLinks` | `DisclosureLinks` | No | Host-resolved URLs for Terms of Use, Privacy Policy, Electronic Communication, and Patriot Act on the business-details agreement step. Omit to leave those links unset. |
440
+ | Prop | Type | Required | Description |
441
+ | ------------------------------------------- | ----------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
442
+ | `onEmbeddedOnboardingCompletedSuccessfully` | `() => void` | Yes | Called when the application is submitted and approved. |
443
+ | `onNavigateToDashboard` | `() => void` | Yes | Called when the user clicks the dashboard CTA on the result screen. |
444
+ | `initialBusinessDetails` | `Partial<BusinessDetailsValues>` | No | Prefills step 1 (business details). Unset fields start empty; the user can still edit before continuing. |
445
+ | `initialPersonalDetails` | `Partial<PersonalDetailsValues>` | No | Prefills step 2 (personal / about-you details). Unset fields start empty; the user can still edit before continuing. |
446
+ | `initialAdditionalOwners` | `AdditionalOwner[]` | No | Prefills step 3 (additional owners). Defaults to an empty list when omitted. |
447
+ | `open` | `boolean` | No | Controlled open state for the modal. When provided the host owns open/close and must update it via `onOpenChange`. Omit for uncontrolled mode. |
448
+ | `defaultOpen` | `boolean` | No | Initial open state when uncontrolled. Defaults to `false` so the modal stays closed until the host opens it. Ignored when `open` is set. |
449
+ | `onOpenChange` | `(open: boolean) => void` | No | Notified whenever the modal opens or closes — fires on overlay click, escape key, the close button, and any controlled state update. Used both as the change handler in controlled mode and a side hook. |
450
+ | `labels` | `BankAccountOnboardingWidgetLabels` | No | Per-step label overrides — see Labels section. Accepts a `modalTitle` override for the modal's accessible title (default: `Bank account onboarding`). |
451
+ | `bankLogoSrc` | `string` | No | URL for the bank logo rendered on the result screen; falls back to bank name text. |
452
+ | `disclosureLinks` | `DisclosureLinks` | No | Host-resolved URLs for Terms of Use, Privacy Policy, Electronic Communication, and Patriot Act on the business-details agreement step. Omit to leave those links unset. |
453
+ | `isFullScreenInline` | `boolean` | No | Renders the widget inline — filling the width/height of its host container — instead of in a modal. `open` / `defaultOpen` are ignored in this mode; the widget always renders once mounted, and the host controls mounting instead. `onOpenChange` still fires for gestures like Cancel, so hosts can react (e.g. by unmounting the widget). Defaults to `false`. |
453
454
 
454
455
  ### MarketingWidget
455
456
 
package/dist/index.css CHANGED
@@ -1770,6 +1770,9 @@
1770
1770
  .ttw\:place-content-center {
1771
1771
  place-content: center;
1772
1772
  }
1773
+ .ttw\:place-items-center {
1774
+ place-items: center;
1775
+ }
1773
1776
  .ttw\:items-baseline {
1774
1777
  align-items: baseline;
1775
1778
  }
package/dist/index.d.ts CHANGED
@@ -4450,6 +4450,15 @@ interface BankAccountOnboardingWidgetInnerProps {
4450
4450
  * or other side effects without owning the open state.
4451
4451
  */
4452
4452
  onOpenChange?: (open: boolean) => void;
4453
+ /**
4454
+ * Renders the widget inline — filling the width/height of its host
4455
+ * container — instead of in a modal dialog. `open`/`defaultOpen` play no
4456
+ * part in whether the widget's content is shown in this mode; the widget
4457
+ * always renders once mounted, and the host controls mounting instead.
4458
+ * `onOpenChange` still fires for gestures like Cancel, so hosts can react
4459
+ * to them (e.g. by unmounting the widget).
4460
+ */
4461
+ isFullScreenInline?: boolean;
4453
4462
  }
4454
4463
  type BankAccountOnboardingWidgetProps = WidgetProviderProps & BankAccountOnboardingWidgetInnerProps;
4455
4464
  declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
@@ -947,6 +947,15 @@ interface BankAccountOnboardingWidgetInnerProps {
947
947
  * or other side effects without owning the open state.
948
948
  */
949
949
  onOpenChange?: (open: boolean) => void;
950
+ /**
951
+ * Renders the widget inline — filling the width/height of its host
952
+ * container — instead of in a modal dialog. `open`/`defaultOpen` play no
953
+ * part in whether the widget's content is shown in this mode; the widget
954
+ * always renders once mounted, and the host controls mounting instead.
955
+ * `onOpenChange` still fires for gestures like Cancel, so hosts can react
956
+ * to them (e.g. by unmounting the widget).
957
+ */
958
+ isFullScreenInline?: boolean;
950
959
  }
951
960
  type BankAccountOnboardingWidgetProps = WidgetProviderProps & BankAccountOnboardingWidgetInnerProps;
952
961
  declare function BankAccountOnboardingWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, disclosuresAcceptance, providerLabels, ...innerProps }: BankAccountOnboardingWidgetProps): React.JSX.Element;
@@ -14,18 +14,18 @@ import { useAnalyticsTrack as c } from "../../../shared/feature/dist/lib/analyti
14
14
  import { WidgetProvider as l } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
15
15
  import { getStateOptions as u } from "../../../shared/util/dist/lib/usStates.js";
16
16
  import { extractApiErrorMessage as ee } from "../../../shared/util/dist/lib/apiErrors.js";
17
- import { useRefetchWidget as te, useWidgetConfig as d } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
18
- import { getNaicsOptions as f } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
17
+ import { useRefetchWidget as d, useWidgetConfig as f } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
18
+ import { getNaicsOptions as p } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
19
19
  import "../../../shared/feature/dist/index.js";
20
- import { bankAccountOnboardingTestIds as p } from "./index9.js";
21
- import { ADDITIONAL_OWNERS_LABELS_EN as ne } from "../../ui/dist/index4.js";
22
- import { interpolateBankName as m } from "../../ui/dist/index6.js";
23
- import { ResultStep as re } from "../../ui/dist/index11.js";
20
+ import { bankAccountOnboardingTestIds as m } from "./index9.js";
21
+ import { ADDITIONAL_OWNERS_LABELS_EN as te } from "../../ui/dist/index4.js";
22
+ import { interpolateBankName as h } from "../../ui/dist/index6.js";
23
+ import { ResultStep as ne } from "../../ui/dist/index11.js";
24
24
  import "../../ui/dist/index.js";
25
- import { BusinessDetailsStep as ie } from "./index10.js";
26
- import { PersonalDetailsStep as ae } from "./index12.js";
27
- import { AdditionalOwnersStep as oe } from "./index14.js";
28
- import { buildCreateApplicationBody as se, buildUpdateApplicationBody as h } from "./index15.js";
25
+ import { BusinessDetailsStep as re } from "./index10.js";
26
+ import { PersonalDetailsStep as ie } from "./index12.js";
27
+ import { AdditionalOwnersStep as ae } from "./index14.js";
28
+ import { buildCreateApplicationBody as oe, buildUpdateApplicationBody as se } from "./index15.js";
29
29
  import { OnboardingAnalyticsEvent as g, WIDGET_NAME as _ } from "./index16.js";
30
30
  import { DEFAULT_LABELS as v } from "./index17.js";
31
31
  import { ApplicationClientSecretProvider as y, useApplicationClientSecret as ce } from "../../data-access/dist/index2.js";
@@ -34,10 +34,10 @@ import { useUpdateApplication as ue } from "../../data-access/dist/index6.js";
34
34
  import { useSubmitApplication as de } from "../../data-access/dist/index7.js";
35
35
  import { usePollApplicationCompletion as fe } from "../../data-access/dist/index8.js";
36
36
  import "../../data-access/dist/index.js";
37
- import { useCallback as pe, useEffect as b, useMemo as x, useRef as me, useState as S } from "react";
38
- import { Fragment as he, jsx as C, jsxs as ge } from "react/jsx-runtime";
37
+ import { useCallback as b, useEffect as x, useMemo as S, useRef as pe, useState as C } from "react";
38
+ import { Fragment as me, jsx as w, jsxs as he } from "react/jsx-runtime";
39
39
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js
40
- var _e = {
40
+ var ge = {
41
41
  companyLegalName: "",
42
42
  companyDbaName: "",
43
43
  businessAddress: "",
@@ -51,7 +51,7 @@ var _e = {
51
51
  naicsCode: "",
52
52
  isAuthorized: null,
53
53
  isCheckboxChecked: !1
54
- }, ve = {
54
+ }, _e = {
55
55
  firstName: "",
56
56
  lastName: "",
57
57
  dateOfBirth: void 0,
@@ -65,7 +65,7 @@ var _e = {
65
65
  ownsOver25Percent: null,
66
66
  ownershipPercentage: null
67
67
  };
68
- function ye(e, t) {
68
+ function ve(e, t) {
69
69
  if (e === 0) return {
70
70
  title: t.businessReviewTitle,
71
71
  subtitle: t.businessReviewSubtitle
@@ -75,7 +75,7 @@ function ye(e, t) {
75
75
  subtitle: t.personalReviewSubtitle
76
76
  };
77
77
  let n = {
78
- ...ne,
78
+ ...te,
79
79
  ...t.additionalOwners
80
80
  };
81
81
  return {
@@ -83,12 +83,12 @@ function ye(e, t) {
83
83
  subtitle: n.subheading
84
84
  };
85
85
  }
86
- function w({ onEmbeddedOnboardingCompletedSuccessfully: l, onNavigateToDashboard: ne, labels: _, initialBusinessDetails: y, initialPersonalDetails: w, initialAdditionalOwners: T, bankLogoSrc: E, disclosureLinks: be, open: D, defaultOpen: O, onOpenChange: k }) {
87
- let A = c();
88
- b(() => {
89
- A(g.Mounted);
90
- }, [A]);
91
- let j = {
86
+ function ye({ onEmbeddedOnboardingCompletedSuccessfully: l, onNavigateToDashboard: te, labels: _, initialBusinessDetails: y, initialPersonalDetails: ye, initialAdditionalOwners: T, bankLogoSrc: E, disclosureLinks: be, open: D, defaultOpen: O, onOpenChange: k, isFullScreenInline: A = !1 }) {
87
+ let j = c();
88
+ x(() => {
89
+ j(g.Mounted);
90
+ }, [j]);
91
+ let M = {
92
92
  ...v,
93
93
  ..._,
94
94
  stepIndicator: {
@@ -102,43 +102,43 @@ function w({ onEmbeddedOnboardingCompletedSuccessfully: l, onNavigateToDashboard
102
102
  ...v.result,
103
103
  ..._?.result
104
104
  }
105
- }, M = d().initResponse, { termsHref: xe, privacyHref: Se, electronicCommunicationHref: Ce, patriotActHref: we } = be ?? {}, N = D === void 0, [Te, Ee] = S(() => O ?? !1), P = N ? Te : D, De = O ?? !1, F = pe((e) => {
106
- N && Ee(e), k?.(e);
107
- }, [k, N]), Oe = pe(() => {
105
+ }, N = f().initResponse, { termsHref: xe, privacyHref: Se, electronicCommunicationHref: Ce, patriotActHref: we } = be ?? {}, P = D === void 0, [Te, Ee] = C(() => O ?? !1), F = P ? Te : D, De = O ?? !1, I = b((e) => {
106
+ P && Ee(e), k?.(e);
107
+ }, [k, P]), Oe = b(() => {
108
108
  l();
109
- }, [l]), ke = te(), [I, L] = S(0), [Ae, je] = S(() => ({
110
- ..._e,
109
+ }, [l]), ke = d(), [L, R] = C(0), [Ae, je] = C(() => ({
110
+ ...ge,
111
111
  ...y
112
- })), [R, Me] = S(() => ({
113
- ...ve,
114
- ...w
115
- })), [Ne, Pe] = S(() => T ?? []), [z, Fe] = S(null), [B, Ie] = S(null), [V, Le] = S(null), [H, Re] = S(null), [ze, U] = S(null), [W, Be] = S(!1), [Ve, G] = S(null), He = le(), K = ue(), Ue = de(), We = fe(), { setClientSecret: Ge } = ce(), { data: Ke, refetch: qe } = i(), { mutateAsync: Je } = r(), q = o(), J = me(null);
116
- b(() => () => J.current?.abort(), []);
117
- let Ye = x(() => f(j.businessDetails.naicsTitles), [j.businessDetails.naicsTitles]), Xe = x(() => u(j.businessDetails.stateTitles), [j.businessDetails.stateTitles]), Ze = x(() => u(j.personalDetails.stateTitles), [j.personalDetails.stateTitles]), Qe = x(() => u(j.additionalOwners.stateTitles), [j.additionalOwners.stateTitles]), Y = W || Ve !== null, $e = M?.status === "ACTIVE" || M?.status === "INACTIVE", et = M?.status === "INVITED", X = !!M && !Y && ($e || et || q.isSuppressed), Z = X ? $e ? a.UserAlreadyOnboarded : et ? a.UserInvitedToOrganization : q.reason : null;
118
- if (b(() => {
119
- !X || !Z || (A(g.Suppressed, { reason: Z }), console.info(`[onboarding] not shown: ${Z}`));
112
+ })), [z, Me] = C(() => ({
113
+ ..._e,
114
+ ...ye
115
+ })), [Ne, Pe] = C(() => T ?? []), [B, Fe] = C(null), [V, Ie] = C(null), [H, Le] = C(null), [U, Re] = C(null), [ze, W] = C(null), [G, Be] = C(!1), [Ve, K] = C(null), He = le(), q = ue(), Ue = de(), We = fe(), { setClientSecret: Ge } = ce(), { data: Ke, refetch: qe } = i(), { mutateAsync: Je } = r(), J = o(), Y = pe(null);
116
+ x(() => () => Y.current?.abort(), []);
117
+ let Ye = S(() => p(M.businessDetails.naicsTitles), [M.businessDetails.naicsTitles]), Xe = S(() => u(M.businessDetails.stateTitles), [M.businessDetails.stateTitles]), Ze = S(() => u(M.personalDetails.stateTitles), [M.personalDetails.stateTitles]), Qe = S(() => u(M.additionalOwners.stateTitles), [M.additionalOwners.stateTitles]), X = G || Ve !== null, $e = N?.status === "ACTIVE" || N?.status === "INACTIVE", et = N?.status === "INVITED", Z = !!N && !X && ($e || et || J.isSuppressed), Q = Z ? $e ? a.UserAlreadyOnboarded : et ? a.UserInvitedToOrganization : J.reason : null;
118
+ if (x(() => {
119
+ !Z || !Q || (j(g.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
120
120
  }, [
121
- X,
122
121
  Z,
123
- A
124
- ]), !M || !Y && (X || !q.isResolved)) return null;
125
- let tt = z?.companyStructure === "SOLE_PROPRIETORSHIP", nt = [
126
- j.stepIndicator.business,
127
- j.stepIndicator.personal,
128
- j.stepIndicator.ownership
129
- ], rt = I === 0 ? z : I === 1 ? B : I === 2 ? V : null, Q = He.isPending || K.isPending || Ue.isPending || W, it = () => {
130
- U(null), L((e) => e === 0 ? 0 : e - 1);
131
- }, $ = () => {
132
- F(!1);
133
- }, at = async (e) => {
134
- Be(!0), F(!0);
122
+ Q,
123
+ j
124
+ ]), !N || !X && (Z || !J.isResolved)) return null;
125
+ let tt = B?.companyStructure === "SOLE_PROPRIETORSHIP", nt = [
126
+ M.stepIndicator.business,
127
+ M.stepIndicator.personal,
128
+ M.stepIndicator.ownership
129
+ ], rt = L === 0 ? B : L === 1 ? V : L === 2 ? H : null, $ = He.isPending || q.isPending || Ue.isPending || G, it = () => {
130
+ W(null), R((e) => e === 0 ? 0 : e - 1);
131
+ }, at = () => {
132
+ I(!1);
133
+ }, ot = async (e) => {
134
+ Be(!0), I(!0);
135
135
  let t = new AbortController();
136
- J.current = t;
136
+ Y.current = t;
137
137
  let n = !1;
138
138
  try {
139
139
  let r = await Ue.mutateAsync({ path: { id: e } });
140
140
  if (t.signal.aborted) return;
141
- if (!r.id) throw Error(j.submitFailedError);
141
+ if (!r.id) throw Error(M.submitFailedError);
142
142
  if (n = !0, (await We(e, { signal: t.signal })).status === "complete") {
143
143
  let e = Ke;
144
144
  if (e === void 0 && (e = (await qe()).data), t.signal.aborted) return;
@@ -146,155 +146,159 @@ function w({ onEmbeddedOnboardingCompletedSuccessfully: l, onNavigateToDashboard
146
146
  await Je({ displayedVersion: e.version ?? null });
147
147
  } catch {}
148
148
  if (t.signal.aborted) return;
149
- G("success"), ke(), Oe();
150
- } else G("pending");
149
+ K("success"), ke(), Oe();
150
+ } else K("pending");
151
151
  } catch (e) {
152
152
  if (e instanceof DOMException && e.name === "AbortError") return;
153
153
  if (!n) throw e;
154
- G("pending");
154
+ K("pending");
155
155
  } finally {
156
- J.current = null, Be(!1);
156
+ Y.current = null, Be(!1);
157
157
  }
158
- }, ot = async () => {
159
- U(null);
158
+ }, st = async () => {
159
+ W(null);
160
160
  try {
161
- if (I === 0) {
162
- if (!z) return;
163
- let e = H;
161
+ if (L === 0) {
162
+ if (!B) return;
163
+ let e = U;
164
164
  if (!e) {
165
- let t = await He.mutateAsync({ body: se(z) });
165
+ let t = await He.mutateAsync({ body: oe(B) });
166
166
  e = t.id, Re(e), t.clientSecret && Ge(t.clientSecret);
167
167
  }
168
- L(1);
169
- } else if (I === 1) {
170
- if (!B || !z || !H) return;
171
- await K.mutateAsync({
172
- path: { id: H },
173
- body: h({
174
- businessDetails: z,
175
- applicant: B
168
+ R(1);
169
+ } else if (L === 1) {
170
+ if (!V || !B || !U) return;
171
+ await q.mutateAsync({
172
+ path: { id: U },
173
+ body: se({
174
+ businessDetails: B,
175
+ applicant: V
176
176
  })
177
- }), L(2);
178
- } else if (I === 2) {
179
- if (!V || !H) return;
180
- await K.mutateAsync({
181
- path: { id: H },
182
- body: h({ businessOwners: V })
183
- }), await at(H);
177
+ }), R(2);
178
+ } else if (L === 2) {
179
+ if (!H || !U) return;
180
+ await q.mutateAsync({
181
+ path: { id: U },
182
+ body: se({ businessOwners: H })
183
+ }), await ot(U);
184
184
  }
185
185
  } catch (e) {
186
- let t = ee(e) ?? (e instanceof Error ? e.message : void 0) ?? j.genericRetryError;
187
- U(t);
186
+ let t = ee(e) ?? (e instanceof Error ? e.message : void 0) ?? M.genericRetryError;
187
+ W(t);
188
188
  }
189
- }, st = ye(Math.min(I, 2), j), ct = M.bankName?.trim() || j.fallbackBankName, lt = m(j.shellFdicDisclaimer, ct);
190
- if (Y) {
191
- let r = z?.companyLegalName ?? "", i = M.bankName?.trim() || j.fallbackBankName, a = Ve ?? "pending", o = a === "success", s = {
189
+ }, ct = ve(Math.min(L, 2), M), lt = N.bankName?.trim() || M.fallbackBankName, ut = h(M.shellFdicDisclaimer, lt);
190
+ if (X) {
191
+ let r = B?.companyLegalName ?? "", i = N.bankName?.trim() || M.fallbackBankName, a = Ve ?? "pending", o = a === "success", s = {
192
192
  ...v.result,
193
- ...j.result
194
- };
195
- return /* @__PURE__ */ C(e, {
196
- open: P,
197
- onOpenChange: F,
198
- children: /* @__PURE__ */ ge(t, {
193
+ ...M.result
194
+ }, c = /* @__PURE__ */ w(ne, {
195
+ testIds: {
196
+ processing: m.resultProcessing,
197
+ dashboardButton: m.resultDashboardButton
198
+ },
199
+ status: a,
200
+ isLoading: G,
201
+ loadingMessage: s.loadingMessage,
202
+ headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
203
+ headingLine2: `${r}!`,
204
+ body: o ? s.successBody : s.pendingBody,
205
+ followUpEmail: V?.workEmail ?? "",
206
+ emailBoxLead: s.pendingEmailBoxLead,
207
+ navigateToDashboardLabel: s.navigateToDashboard,
208
+ bankLogoSrc: E,
209
+ bankLogoAlt: h(s.bankLogoAlt, i),
210
+ fdicDisclaimer: h(s.fdicDisclaimer, i),
211
+ onNavigateToDashboard: te
212
+ });
213
+ return A ? /* @__PURE__ */ w("div", {
214
+ className: "ttw:grid ttw:h-full ttw:w-full ttw:grid-rows-[1fr] ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
215
+ children: c
216
+ }) : /* @__PURE__ */ w(e, {
217
+ open: F,
218
+ onOpenChange: I,
219
+ children: /* @__PURE__ */ he(t, {
199
220
  className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
200
- children: [/* @__PURE__ */ C(n, {
221
+ children: [/* @__PURE__ */ w(n, {
201
222
  className: "ttw:sr-only",
202
- children: j.modalTitle
203
- }), /* @__PURE__ */ C(re, {
204
- testIds: {
205
- processing: p.resultProcessing,
206
- dashboardButton: p.resultDashboardButton
207
- },
208
- status: a,
209
- isLoading: W,
210
- loadingMessage: s.loadingMessage,
211
- headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
212
- headingLine2: `${r}!`,
213
- body: o ? s.successBody : s.pendingBody,
214
- followUpEmail: B?.workEmail ?? "",
215
- emailBoxLead: s.pendingEmailBoxLead,
216
- navigateToDashboardLabel: s.navigateToDashboard,
217
- bankLogoSrc: E,
218
- bankLogoAlt: m(s.bankLogoAlt, i),
219
- fdicDisclaimer: m(s.fdicDisclaimer, i),
220
- onNavigateToDashboard: ne
221
- })]
223
+ children: M.modalTitle
224
+ }), c]
222
225
  })
223
226
  });
224
227
  }
225
- let ut = I === 2 ? j.submit : j.next, dt = rt === null || Q;
226
- return /* @__PURE__ */ C(he, { children: /* @__PURE__ */ ge(s, {
227
- open: P,
228
+ let dt = L === 2 ? M.submit : M.next, ft = rt === null || $;
229
+ return /* @__PURE__ */ w(me, { children: /* @__PURE__ */ he(s, {
230
+ open: F,
228
231
  defaultOpen: De,
229
- onOpenChange: F,
230
- title: st.title,
231
- subtitle: st.subtitle,
232
+ onOpenChange: I,
233
+ isFullScreenInline: A,
234
+ title: ct.title,
235
+ subtitle: ct.subtitle,
232
236
  stepLabels: nt,
233
- activeStep: I,
234
- disclaimerText: lt,
235
- onBack: I === 0 ? $ : it,
236
- onCancel: I > 0 ? $ : void 0,
237
- onNext: ot,
237
+ activeStep: L,
238
+ disclaimerText: ut,
239
+ onBack: L === 0 ? at : it,
240
+ onCancel: L > 0 ? at : void 0,
241
+ onNext: st,
238
242
  showDismissButton: !1,
239
- isNextDisabled: dt,
240
- isNextLoading: Q,
241
- nextLabel: ut,
243
+ isNextDisabled: ft,
244
+ isNextLoading: $,
245
+ nextLabel: dt,
242
246
  nextIcon: null,
243
247
  errorMessage: ze,
244
248
  labels: {
245
- backButton: I === 0 ? j.cancel : j.back,
246
- cancelButton: j.cancel
249
+ backButton: L === 0 ? M.cancel : M.back,
250
+ cancelButton: M.cancel
247
251
  },
248
252
  testIds: {
249
- root: p.shell,
250
- dismiss: p.shellDismiss,
251
- back: p.shellBack,
252
- cancel: p.shellCancel,
253
- next: p.shellNext,
253
+ root: m.shell,
254
+ dismiss: m.shellDismiss,
255
+ back: m.shellBack,
256
+ cancel: m.shellCancel,
257
+ next: m.shellNext,
254
258
  scrollRegion: {
255
- root: p.shellScrollRegion,
256
- fade: p.shellScrollFade,
257
- hint: p.shellScrollHint
259
+ root: m.shellScrollRegion,
260
+ fade: m.shellScrollFade,
261
+ hint: m.shellScrollHint
258
262
  }
259
263
  },
260
264
  children: [
261
- I === 0 ? /* @__PURE__ */ C(ie, {
265
+ L === 0 ? /* @__PURE__ */ w(re, {
262
266
  value: Ae,
263
267
  onValueChange: je,
264
268
  onSnapshotChange: Fe,
265
269
  naicsOptions: Ye,
266
270
  stateOptions: Xe,
267
- isSubmitting: Q,
268
- labels: j.businessDetails,
269
- bankName: ct,
271
+ isSubmitting: $,
272
+ labels: M.businessDetails,
273
+ bankName: lt,
270
274
  termsHref: xe,
271
275
  privacyHref: Se,
272
276
  electronicCommunicationHref: Ce,
273
277
  patriotActHref: we
274
278
  }, "business") : null,
275
- I === 1 ? /* @__PURE__ */ C(ae, {
276
- value: R,
279
+ L === 1 ? /* @__PURE__ */ w(ie, {
280
+ value: z,
277
281
  onValueChange: Me,
278
282
  onSnapshotChange: Ie,
279
283
  stateOptions: Ze,
280
- isSubmitting: Q,
281
- labels: j.personalDetails
284
+ isSubmitting: $,
285
+ labels: M.personalDetails
282
286
  }, "personal") : null,
283
- I === 2 ? /* @__PURE__ */ C(oe, {
287
+ L === 2 ? /* @__PURE__ */ w(ae, {
284
288
  owners: Ne,
285
289
  onOwnersChange: Pe,
286
- primaryOwnerName: `${R.firstName} ${R.lastName}`.trim(),
287
- primaryOwnerPercentage: tt ? 100 : B?.ownsOver25Percent === !0 ? B.ownershipPercentage ?? 0 : 0,
290
+ primaryOwnerName: `${z.firstName} ${z.lastName}`.trim(),
291
+ primaryOwnerPercentage: tt ? 100 : V?.ownsOver25Percent === !0 ? V.ownershipPercentage ?? 0 : 0,
288
292
  stateOptions: Qe,
289
293
  onSnapshotChange: Le,
290
- isSubmitting: Q,
291
- labels: j.additionalOwners
294
+ isSubmitting: $,
295
+ labels: M.additionalOwners
292
296
  }) : null
293
297
  ]
294
298
  }) });
295
299
  }
296
- function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: u, analytics: ee, disclosuresAcceptance: te, providerLabels: d, ...f }) {
297
- return /* @__PURE__ */ C(l, {
300
+ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: u, analytics: ee, disclosuresAcceptance: d, providerLabels: f, ...p }) {
301
+ return /* @__PURE__ */ w(l, {
298
302
  baseUrl: e,
299
303
  widgetToken: t,
300
304
  organizationId: n,
@@ -306,15 +310,15 @@ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
306
310
  errorFallback: c,
307
311
  onError: u,
308
312
  analytics: ee,
309
- disclosuresAcceptance: te,
310
- providerLabels: d,
313
+ disclosuresAcceptance: d,
314
+ providerLabels: f,
311
315
  widgetName: _,
312
- children: /* @__PURE__ */ C(E, { ...f })
316
+ children: /* @__PURE__ */ w(E, { ...p })
313
317
  });
314
318
  }
315
319
  function E(e) {
316
- let { initResponse: t } = d(), n = t?.userId ?? null, [r, i] = S(n), [a, o] = S(0);
317
- return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ C(y, { children: /* @__PURE__ */ C(w, { ...e }, a) }, a);
320
+ let { initResponse: t } = f(), n = t?.userId ?? null, [r, i] = C(n), [a, o] = C(0);
321
+ return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ w(y, { children: /* @__PURE__ */ w(ye, { ...e }, a) }, a);
318
322
  }
319
323
  //#endregion
320
324
  export { T as BankAccountOnboardingWidget, T as default };
@@ -46,7 +46,7 @@ function m({ isOpen: e, onClose: t, ...n }) {
46
46
  ...n
47
47
  }) : null;
48
48
  }
49
- function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: f, disclosuresAcceptance: p, providerLabels: h, isOpen: g, preSelectedReceiptIds: _, onClose: v, targetTransactionId: y, onSingleTransactionUpdate: b }) {
49
+ function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: f, analytics: p, disclosuresAcceptance: h, providerLabels: g, isOpen: _, preSelectedReceiptIds: v, onClose: y, targetTransactionId: b, onSingleTransactionUpdate: x }) {
50
50
  return /* @__PURE__ */ d(n, {
51
51
  widgetName: o,
52
52
  baseUrl: e,
@@ -59,14 +59,15 @@ function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gat
59
59
  uiFramework: l,
60
60
  errorFallback: u,
61
61
  onError: f,
62
- disclosuresAcceptance: p,
63
- providerLabels: h,
62
+ analytics: p,
63
+ disclosuresAcceptance: h,
64
+ providerLabels: g,
64
65
  children: /* @__PURE__ */ d(m, {
65
- isOpen: g,
66
- preSelectedReceiptIds: _,
67
- onClose: v,
68
- targetTransactionId: y,
69
- onSingleTransactionUpdate: b
66
+ isOpen: _,
67
+ preSelectedReceiptIds: v,
68
+ onClose: y,
69
+ targetTransactionId: b,
70
+ onSingleTransactionUpdate: x
70
71
  })
71
72
  });
72
73
  }
@@ -10,12 +10,12 @@ import { ReceiptMatchLabels as r } from "../../ui/dist/lib/ReceiptMatchWidget/li
10
10
  import "../../ui/dist/index.js";
11
11
  import { useGetReceiptsQuery as i } from "../../data-access/dist/index2.js";
12
12
  import { useGetTransactionsQuery as a } from "../../data-access/dist/index3.js";
13
- import { usePatchReceiptMutation as ee } from "../../data-access/dist/index5.js";
14
- import { useDeleteReceiptMutation as te } from "../../data-access/dist/index6.js";
13
+ import { usePatchReceiptMutation as o } from "../../data-access/dist/index5.js";
14
+ import { useDeleteReceiptMutation as ee } from "../../data-access/dist/index6.js";
15
15
  import "../../data-access/dist/index.js";
16
- import { useCallback as o, useEffect as ne, useMemo as s, useState as c } from "react";
16
+ import { useCallback as s, useEffect as c, useMemo as l, useState as u } from "react";
17
17
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js
18
- function l(e, t) {
18
+ function d(e, t) {
19
19
  if (typeof e == "object" && e) {
20
20
  let t = e.error;
21
21
  if (typeof t == "object" && t) {
@@ -25,7 +25,7 @@ function l(e, t) {
25
25
  }
26
26
  return e instanceof Error && e.message ? e.message : t;
27
27
  }
28
- function u(e, t) {
28
+ function f(e, t) {
29
29
  let n = e / 100;
30
30
  try {
31
31
  return new Intl.NumberFormat("en-US", {
@@ -36,7 +36,7 @@ function u(e, t) {
36
36
  return `${t} ${n.toFixed(2)}`;
37
37
  }
38
38
  }
39
- function d(e) {
39
+ function p(e) {
40
40
  if (!e) return "";
41
41
  let t = new Date(e);
42
42
  return Number.isNaN(t.getTime()) ? "" : t.toLocaleDateString("en-US", {
@@ -45,7 +45,7 @@ function d(e) {
45
45
  year: "numeric"
46
46
  });
47
47
  }
48
- function re(e) {
48
+ function te(e) {
49
49
  if (!e) return "";
50
50
  let t = new Date(e);
51
51
  return Number.isNaN(t.getTime()) ? "" : t.toLocaleDateString("en-US", {
@@ -54,7 +54,7 @@ function re(e) {
54
54
  year: "numeric"
55
55
  });
56
56
  }
57
- function f(e) {
57
+ function m(e) {
58
58
  if (!e) return "";
59
59
  let t = new Date(e);
60
60
  return Number.isNaN(t.getTime()) ? "" : t.toLocaleTimeString("en-US", {
@@ -64,26 +64,26 @@ function f(e) {
64
64
  hour12: !0
65
65
  });
66
66
  }
67
- function ie(e) {
67
+ function ne(e) {
68
68
  let t = e.ocr_status === "processing";
69
69
  return {
70
70
  id: e.id,
71
71
  primaryText: t ? r.ReceiptScanningTitle : e.merchant_name?.trim() || r.ReceiptScanningTitle,
72
- secondaryText: t ? r.ReceiptScanningSubtitle : d(e.issued_at),
72
+ secondaryText: t ? r.ReceiptScanningSubtitle : p(e.issued_at),
73
73
  thumbnailUrl: e.file_url ?? void 0
74
74
  };
75
75
  }
76
- function p(e) {
76
+ function re(e) {
77
77
  return {
78
78
  id: e.id,
79
79
  merchantName: e.merchant_name,
80
- date: d(e.started_at),
81
- formattedAmount: u(e.amount, e.currency)
80
+ date: p(e.started_at),
81
+ formattedAmount: f(e.amount, e.currency)
82
82
  };
83
83
  }
84
- var m = .5, h = 3, g = .25, _ = 5e3, v = !1;
85
- function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTransactionUpdate: x }) {
86
- let { initResponse: S } = t(), C = n(), w = S?.userId ?? void 0, T = !!w && !C, [E, D] = c(1), [O, k] = c(0), [A, j] = c([]), [M, N] = c(() => d), [P, F] = c(""), [I, L] = c([]), R = s(() => I.map((e) => e.id), [I]), [z, B] = c(1), V = i({
84
+ var h = .5, g = 3, _ = .25, ie = 5e3, v = !1;
85
+ function y({ preSelectedIds: p, onClose: y, targetTransactionId: b, onSingleTransactionUpdate: x }) {
86
+ let { initResponse: S } = t(), C = n(), w = S?.userId ?? void 0, T = !!w && !C, [E, D] = u(1), [O, k] = u(0), [A, j] = u([]), [M, N] = u(() => p), [P, F] = u(""), [I, L] = u([]), R = l(() => I.map((e) => e.id), [I]), [z, B] = u(1), V = i({
87
87
  has_transaction: !1,
88
88
  created_by_entity_user_id: w,
89
89
  enabled: T
@@ -91,49 +91,49 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
91
91
  merchant_name__icontains: P || void 0,
92
92
  has_receipt: !1,
93
93
  enabled: E === 2
94
- }), U = ee(), W = te(), G = V.data?.data ?? [], K = s(() => w ? G.filter((e) => e.created_by_entity_user_id == null || e.created_by_entity_user_id === w) : [], [G, w]);
95
- ne(() => {
94
+ }), U = o(), W = ee(), G = V.data?.data ?? [], K = l(() => w ? G.filter((e) => e.created_by_entity_user_id == null || e.created_by_entity_user_id === w) : [], [G, w]);
95
+ c(() => {
96
96
  if (!K.some((e) => e.ocr_status === "processing")) return;
97
97
  let e = window.setInterval(() => {
98
98
  V.isFetching || V.refetch();
99
- }, _);
99
+ }, ie);
100
100
  return () => window.clearInterval(e);
101
101
  }, [
102
102
  V.isFetching,
103
103
  V.refetch,
104
104
  K
105
105
  ]);
106
- let q = s(() => K.map(ie), [K]), J = s(() => new Set(A.flatMap((e) => e.transactionIds)), [A]), ae = s(() => (H.data?.data ?? []).filter((e) => !J.has(e.id)).map(p), [H.data, J]), Y = H.data?.data ?? [], X = M[O], Z = s(() => K.find((e) => e.id === X), [K, X]), oe = Z?.file_url ?? void 0, se = Z?.file_name ?? void 0, ce = s(() => {
106
+ let q = l(() => K.map(ne), [K]), J = l(() => new Set(A.flatMap((e) => e.transactionIds)), [A]), ae = l(() => (H.data?.data ?? []).filter((e) => !J.has(e.id)).map(re), [H.data, J]), Y = H.data?.data ?? [], X = M[O], Z = l(() => K.find((e) => e.id === X), [K, X]), oe = Z?.file_url ?? void 0, se = Z?.file_name ?? void 0, ce = l(() => {
107
107
  if (b) return "Attach";
108
108
  if (!(M.length <= 1)) return `Review (${O + 1}/${M.length})`;
109
109
  }, [
110
110
  b,
111
111
  M.length,
112
112
  O
113
- ]), le = s(() => A.filter((e) => e.receiptId === X).flatMap((e) => e.transactionDetails), [A, X]), ue = O >= M.length - 1 ? r.Done : r.ReviewNextReceipt(O + 2, M.length), Q = o(() => {
113
+ ]), le = l(() => A.filter((e) => e.receiptId === X).flatMap((e) => e.transactionDetails), [A, X]), ue = O >= M.length - 1 ? r.Done : r.ReviewNextReceipt(O + 2, M.length), Q = s(() => {
114
114
  F(""), L([]), B(1);
115
- }, []), de = o((e) => {
115
+ }, []), de = s((e) => {
116
116
  if (b) {
117
117
  N((t) => t.includes(e) ? [] : [e]);
118
118
  return;
119
119
  }
120
120
  N((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
121
- }, [b]), fe = o(() => {
121
+ }, [b]), fe = s(() => {
122
122
  N(q.map((e) => e.id));
123
- }, [q]), pe = o(() => {
123
+ }, [q]), pe = s(() => {
124
124
  N([]);
125
- }, []), me = o((e) => {
125
+ }, []), me = s((e) => {
126
126
  let t = K.find((t) => t.id === e);
127
127
  t?.file_url && window.open(t.file_url, "_blank", "noopener,noreferrer");
128
- }, [K]), $ = o(async (t) => {
128
+ }, [K]), $ = s(async (t) => {
129
129
  try {
130
130
  await W.mutateAsync({ path: { receipt_id: t } });
131
131
  } catch (t) {
132
- e.error(l(t, "Failed to delete receipt"));
132
+ e.error(d(t, "Failed to delete receipt"));
133
133
  return;
134
134
  }
135
135
  N((e) => e.filter((e) => e !== t));
136
- }, [W]), he = o(async () => {
136
+ }, [W]), he = s(async () => {
137
137
  if (M.length !== 0) {
138
138
  if (b) {
139
139
  try {
@@ -142,7 +142,7 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
142
142
  body: { transaction_id: b }
143
143
  }), x?.(), y();
144
144
  } catch (t) {
145
- e.error(l(t, "Failed to attach receipt"));
145
+ e.error(d(t, "Failed to attach receipt"));
146
146
  }
147
147
  return;
148
148
  }
@@ -155,21 +155,21 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
155
155
  x,
156
156
  y,
157
157
  Q
158
- ]), ge = o((e) => {
158
+ ]), ge = s((e) => {
159
159
  F(e);
160
- }, []), _e = o((e) => {
160
+ }, []), _e = s((e) => {
161
161
  L((t) => {
162
162
  let n = t.find((t) => t.id === e), r = Y.find((t) => t.id === e);
163
163
  return n ? [] : r ? [r] : [];
164
164
  });
165
- }, [Y]), ve = o(async () => {
165
+ }, [Y]), ve = s(async () => {
166
166
  if (I.length === 0 || !X) return;
167
167
  let t = I, n = (e) => ({
168
168
  merchant: e.merchant_name,
169
169
  location: e.merchant_location,
170
- date: re(e.started_at),
171
- time: f(e.started_at),
172
- formattedAmount: u(e.amount, e.currency)
170
+ date: te(e.started_at),
171
+ time: m(e.started_at),
172
+ formattedAmount: f(e.amount, e.currency)
173
173
  }), r = [], i = [];
174
174
  for (let a of t) try {
175
175
  await U.mutateAsync({
@@ -181,7 +181,7 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
181
181
  receiptId: X,
182
182
  transactionIds: r,
183
183
  transactionDetails: i
184
- }]), L((e) => e.filter((e) => !r.includes(e.id))), e.error(l(t, "Failed to match receipt"));
184
+ }]), L((e) => e.filter((e) => !r.includes(e.id))), e.error(d(t, "Failed to match receipt"));
185
185
  return;
186
186
  }
187
187
  j((e) => [...e, {
@@ -193,11 +193,11 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
193
193
  I,
194
194
  X,
195
195
  U
196
- ]), ye = o(() => {
197
- B((e) => Math.min(e + g, h));
198
- }, []), be = o(() => {
199
- B((e) => Math.max(e - g, m));
200
- }, []), xe = o(() => {
196
+ ]), ye = s(() => {
197
+ B((e) => Math.min(e + _, g));
198
+ }, []), be = s(() => {
199
+ B((e) => Math.max(e - _, h));
200
+ }, []), xe = s(() => {
201
201
  let e = O + 1;
202
202
  if (e < M.length) {
203
203
  k(e), Q(), D(2);
@@ -209,7 +209,7 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
209
209
  M.length,
210
210
  Q,
211
211
  y
212
- ]), Se = o(() => {
212
+ ]), Se = s(() => {
213
213
  if (A.length > 0) {
214
214
  let e = new Set(A.map((e) => e.receiptId));
215
215
  N((t) => t.filter((t) => !e.has(t)));
@@ -226,7 +226,7 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
226
226
  onViewAttachment: me,
227
227
  onDeleteReceipt: $,
228
228
  onReview: he,
229
- isReceiptsLoading: V.isLoading,
229
+ isReceiptsLoading: V.isLoading || C && !S,
230
230
  showSelectAllButton: !b,
231
231
  receiptPreviewUrl: oe,
232
232
  receiptFileName: se,
@@ -242,8 +242,8 @@ function y({ preSelectedIds: d, onClose: y, targetTransactionId: b, onSingleTran
242
242
  zoom: z,
243
243
  onZoomIn: ye,
244
244
  onZoomOut: be,
245
- canZoomIn: z < h,
246
- canZoomOut: z > m,
245
+ canZoomIn: z < g,
246
+ canZoomOut: z > h,
247
247
  matchedTransactions: le,
248
248
  primaryLabel: ue,
249
249
  onPrimary: xe,
@@ -43,7 +43,14 @@ function u({ receipts: t, selectedReceiptIds: u, onSelectAll: f, onReset: p, onR
43
43
  }),
44
44
  /* @__PURE__ */ i("div", {
45
45
  className: "ttw:flex-1 ttw:overflow-y-auto ttw:flex ttw:flex-col ttw:gap-2 ttw:px-6 ttw:py-3",
46
- children: b ? Array.from({ length: l }).map((e, t) => /* @__PURE__ */ i(d, {}, t)) : t.length === 0 ? /* @__PURE__ */ a("div", {
46
+ children: b ? /* @__PURE__ */ a("div", {
47
+ role: "status",
48
+ className: "ttw:flex ttw:flex-col ttw:gap-2",
49
+ children: [/* @__PURE__ */ i("span", {
50
+ className: "ttw:sr-only",
51
+ children: n.LoadingReceipts
52
+ }), Array.from({ length: l }).map((e, t) => /* @__PURE__ */ i(d, {}, t))]
53
+ }) : t.length === 0 ? /* @__PURE__ */ a("div", {
47
54
  className: "ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-3 ttw:flex-1 ttw:py-12",
48
55
  children: [/* @__PURE__ */ i("div", {
49
56
  className: "ttw:w-14 ttw:h-14 ttw:rounded-full ttw:bg-muted ttw:flex ttw:items-center ttw:justify-center",
@@ -97,7 +97,13 @@ function m({ receiptPreviewUrl: n, receiptFileName: m, transactions: g, selected
97
97
  /* @__PURE__ */ a("div", {
98
98
  className: "ttw:flex-1 ttw:overflow-y-auto",
99
99
  children: [
100
- N && Array.from({ length: p }).map((e, t) => /* @__PURE__ */ i(h, {}, t)),
100
+ N && /* @__PURE__ */ a("div", {
101
+ role: "status",
102
+ children: [/* @__PURE__ */ i("span", {
103
+ className: "ttw:sr-only",
104
+ children: r.LoadingTransactions
105
+ }), Array.from({ length: p }).map((e, t) => /* @__PURE__ */ i(h, {}, t))]
106
+ }),
101
107
  !N && g.length === 0 && /* @__PURE__ */ a("div", {
102
108
  className: "ttw:flex ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-3 ttw:h-full ttw:py-12",
103
109
  children: [/* @__PURE__ */ i("div", {
@@ -36,6 +36,8 @@ var e = {
36
36
  NoTransactionsSubtitle: "Go directly to transactions to modify receipt data if necessary.",
37
37
  MatchConfirmedTitle: "Match confirmed",
38
38
  MatchConfirmedSubtitle: "Your receipt has been matched to",
39
+ LoadingReceipts: "Loading receipts",
40
+ LoadingTransactions: "Loading transactions",
39
41
  Close: "Close",
40
42
  ZoomIn: "Zoom in",
41
43
  ZoomOut: "Zoom out",
@@ -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.5.29", n = "69af42cb160efa02114e82e8a3504856fe161f66", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.32", n = "b173c22974bd1325f16c2944cccf6ab072572670", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -10,120 +10,141 @@ import { jsx as m, jsxs as h } from "react/jsx-runtime";
10
10
  import { useControllableState as g } from "@radix-ui/react-use-controllable-state";
11
11
  import { Check as _, X as v } from "lucide-react";
12
12
  //#region ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js
13
- function y({ open: y, defaultOpen: b = !0, onOpenChange: x, title: S, subtitle: C, stepLabels: w, activeStep: T, disclaimerText: E, onBack: D, onNext: O, onCancel: k, isBackDisabled: A = !1, showDismissButton: j = !0, isNextDisabled: M = !1, isNextLoading: N = !1, nextLabel: P, nextIcon: F, errorMessage: I, children: L, labels: R, testIds: z }) {
14
- let B = {
13
+ function y({ isFullScreenInline: e, className: t, children: n }) {
14
+ return m(e ? "h2" : a, {
15
+ className: t,
16
+ children: n
17
+ });
18
+ }
19
+ function b({ isFullScreenInline: e, className: t, children: n }) {
20
+ return m(e ? "p" : i, {
21
+ className: t,
22
+ children: n
23
+ });
24
+ }
25
+ function x({ open: i, defaultOpen: a = !0, onOpenChange: x, isFullScreenInline: S = !1, title: C, subtitle: w, stepLabels: T, activeStep: E, disclaimerText: D, onBack: O, onNext: k, onCancel: A, isBackDisabled: j = !1, showDismissButton: M = !0, isNextDisabled: N = !1, isNextLoading: P = !1, nextLabel: F, nextIcon: I, errorMessage: L, children: R, labels: z, testIds: B }) {
26
+ let V = {
15
27
  ...c,
16
- ...R
17
- }, [V, H] = g({
18
- prop: y,
19
- defaultProp: b,
28
+ ...z
29
+ }, [H, U] = g({
30
+ prop: i,
31
+ defaultProp: a,
20
32
  onChange: x
21
- }), [U, W] = p.useState(null), G = p.useCallback((e) => {
22
- W(e);
23
- }, []), K = !N && (F === void 0 ? /* @__PURE__ */ m(_, {
33
+ }), [W, G] = p.useState(null), K = p.useCallback((e) => {
34
+ G(e);
35
+ }, []), q = p.useMemo(() => ({
36
+ container: W,
37
+ isFullScreenInline: S
38
+ }), [W, S]), J = !P && (I === void 0 ? /* @__PURE__ */ m(_, {
24
39
  className: "ttw:size-5",
25
40
  "aria-hidden": !0
26
- }) : F);
27
- return /* @__PURE__ */ m(t, {
28
- open: V,
29
- onOpenChange: H,
41
+ }) : I), Y = M && !S, X = /* @__PURE__ */ h("div", {
42
+ ref: K,
43
+ className: S ? "ttw:relative ttw:grid ttw:h-full ttw:w-full ttw:min-h-0 ttw:grid-rows-[auto_1fr_auto] ttw:gap-0 ttw:overflow-hidden ttw:bg-background" : "ttw:relative ttw:grid ttw:max-h-[95vh] ttw:min-h-0 ttw:grid-rows-[auto_1fr_auto] ttw:gap-0",
44
+ "data-testid": S ? B?.root : void 0,
45
+ children: [
46
+ Y ? /* @__PURE__ */ h(n, {
47
+ className: "ttw:absolute ttw:right-4 ttw:top-4 ttw:cursor-pointer ttw:rounded-sm ttw:opacity-70 ttw:ring-offset-background ttw:transition-opacity ttw:hover:opacity-100 ttw:focus:outline-hidden ttw:focus:ring-2 ttw:focus:ring-ring ttw:focus:ring-offset-2 ttw:disabled:pointer-events-none ttw:data-[state=open]:bg-accent ttw:data-[state=open]:text-muted-foreground",
48
+ "data-testid": B?.dismiss,
49
+ children: [/* @__PURE__ */ m(v, {
50
+ className: "ttw:size-4",
51
+ "aria-hidden": !0
52
+ }), /* @__PURE__ */ m("span", {
53
+ className: "ttw:sr-only",
54
+ children: V.dismissAriaLabel
55
+ })]
56
+ }) : null,
57
+ /* @__PURE__ */ h("header", {
58
+ className: Y ? "ttw:px-8 ttw:pt-8 ttw:pr-14" : "ttw:px-8 ttw:pt-8",
59
+ children: [
60
+ /* @__PURE__ */ m(y, {
61
+ isFullScreenInline: S,
62
+ className: "ttw:text-2xl ttw:font-bold ttw:leading-tight ttw:text-foreground",
63
+ children: C
64
+ }),
65
+ /* @__PURE__ */ m(b, {
66
+ isFullScreenInline: S,
67
+ className: "ttw:mt-1 ttw:mb-4 ttw:text-sm ttw:text-muted-foreground",
68
+ children: w
69
+ }),
70
+ /* @__PURE__ */ m(l, {
71
+ stepLabels: T,
72
+ activeStep: E,
73
+ labels: z
74
+ })
75
+ ]
76
+ }),
77
+ /* @__PURE__ */ m(f, {
78
+ activeStep: E,
79
+ scrollForMoreLabel: V.scrollForMore,
80
+ testIds: B?.scrollRegion,
81
+ children: R
82
+ }),
83
+ /* @__PURE__ */ h("footer", {
84
+ className: "ttw:px-8 ttw:pb-8",
85
+ children: [
86
+ /* @__PURE__ */ m(o, { className: "ttw:mb-3" }),
87
+ /* @__PURE__ */ h("div", {
88
+ className: "ttw:mb-4 ttw:flex ttw:items-center ttw:gap-1",
89
+ children: [/* @__PURE__ */ m("p", {
90
+ className: "ttw:text-sm ttw:text-muted-foreground",
91
+ children: D
92
+ }), /* @__PURE__ */ m(d, {})]
93
+ }),
94
+ L ? /* @__PURE__ */ m(s, {
95
+ className: "ttw:mb-3",
96
+ children: L
97
+ }) : null,
98
+ /* @__PURE__ */ h("div", {
99
+ className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
100
+ children: [/* @__PURE__ */ m(e, {
101
+ type: "button",
102
+ variant: "outline",
103
+ disabled: j || P,
104
+ onClick: O,
105
+ className: "ttw:h-auto ttw:rounded-2xl ttw:border-border ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium ttw:text-foreground ttw:hover:bg-muted ttw:hover:text-foreground",
106
+ "data-testid": B?.back,
107
+ children: V.backButton
108
+ }), /* @__PURE__ */ h("div", {
109
+ className: "ttw:flex ttw:items-center ttw:gap-3",
110
+ children: [A ? /* @__PURE__ */ m(e, {
111
+ type: "button",
112
+ variant: "outline",
113
+ disabled: P,
114
+ onClick: A,
115
+ className: "ttw:h-auto ttw:rounded-2xl ttw:border-border ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium ttw:text-foreground ttw:hover:bg-muted ttw:hover:text-foreground",
116
+ "data-testid": B?.cancel,
117
+ children: V.cancelButton
118
+ }) : null, /* @__PURE__ */ h(e, {
119
+ type: "button",
120
+ disabled: N || P,
121
+ loading: P,
122
+ onClick: k,
123
+ className: "ttw:h-auto ttw:rounded-2xl ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium",
124
+ "data-testid": B?.next,
125
+ children: [F, J]
126
+ })]
127
+ })]
128
+ })
129
+ ]
130
+ })
131
+ ]
132
+ });
133
+ return S ? /* @__PURE__ */ m(u.Provider, {
134
+ value: q,
135
+ children: X
136
+ }) : /* @__PURE__ */ m(t, {
137
+ open: H,
138
+ onOpenChange: U,
30
139
  children: /* @__PURE__ */ m(u.Provider, {
31
- value: U,
140
+ value: q,
32
141
  children: /* @__PURE__ */ m(r, {
33
142
  className: "ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
34
- "data-testid": z?.root,
35
- children: /* @__PURE__ */ h("div", {
36
- ref: G,
37
- className: "ttw:relative ttw:grid ttw:max-h-[95vh] ttw:min-h-0 ttw:grid-rows-[auto_1fr_auto] ttw:gap-0",
38
- children: [
39
- j ? /* @__PURE__ */ h(n, {
40
- className: "ttw:absolute ttw:right-4 ttw:top-4 ttw:cursor-pointer ttw:rounded-sm ttw:opacity-70 ttw:ring-offset-background ttw:transition-opacity ttw:hover:opacity-100 ttw:focus:outline-hidden ttw:focus:ring-2 ttw:focus:ring-ring ttw:focus:ring-offset-2 ttw:disabled:pointer-events-none ttw:data-[state=open]:bg-accent ttw:data-[state=open]:text-muted-foreground",
41
- "data-testid": z?.dismiss,
42
- children: [/* @__PURE__ */ m(v, {
43
- className: "ttw:size-4",
44
- "aria-hidden": !0
45
- }), /* @__PURE__ */ m("span", {
46
- className: "ttw:sr-only",
47
- children: B.dismissAriaLabel
48
- })]
49
- }) : null,
50
- /* @__PURE__ */ h("header", {
51
- className: j ? "ttw:px-8 ttw:pt-8 ttw:pr-14" : "ttw:px-8 ttw:pt-8",
52
- children: [
53
- /* @__PURE__ */ m(a, {
54
- className: "ttw:text-2xl ttw:font-bold ttw:leading-tight ttw:text-foreground",
55
- children: S
56
- }),
57
- /* @__PURE__ */ m(i, {
58
- className: "ttw:mt-1 ttw:mb-4 ttw:text-sm ttw:text-muted-foreground",
59
- children: C
60
- }),
61
- /* @__PURE__ */ m(l, {
62
- stepLabels: w,
63
- activeStep: T,
64
- labels: R
65
- })
66
- ]
67
- }),
68
- /* @__PURE__ */ m(f, {
69
- activeStep: T,
70
- scrollForMoreLabel: B.scrollForMore,
71
- testIds: z?.scrollRegion,
72
- children: L
73
- }),
74
- /* @__PURE__ */ h("footer", {
75
- className: "ttw:px-8 ttw:pb-8",
76
- children: [
77
- /* @__PURE__ */ m(o, { className: "ttw:mb-3" }),
78
- /* @__PURE__ */ h("div", {
79
- className: "ttw:mb-4 ttw:flex ttw:items-center ttw:gap-1",
80
- children: [/* @__PURE__ */ m("p", {
81
- className: "ttw:text-sm ttw:text-muted-foreground",
82
- children: E
83
- }), /* @__PURE__ */ m(d, {})]
84
- }),
85
- I ? /* @__PURE__ */ m(s, {
86
- className: "ttw:mb-3",
87
- children: I
88
- }) : null,
89
- /* @__PURE__ */ h("div", {
90
- className: "ttw:flex ttw:items-center ttw:justify-between ttw:gap-3",
91
- children: [/* @__PURE__ */ m(e, {
92
- type: "button",
93
- variant: "outline",
94
- disabled: A || N,
95
- onClick: D,
96
- className: "ttw:h-auto ttw:rounded-2xl ttw:border-border ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium ttw:text-foreground ttw:hover:bg-muted ttw:hover:text-foreground",
97
- "data-testid": z?.back,
98
- children: B.backButton
99
- }), /* @__PURE__ */ h("div", {
100
- className: "ttw:flex ttw:items-center ttw:gap-3",
101
- children: [k ? /* @__PURE__ */ m(e, {
102
- type: "button",
103
- variant: "outline",
104
- disabled: N,
105
- onClick: k,
106
- className: "ttw:h-auto ttw:rounded-2xl ttw:border-border ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium ttw:text-foreground ttw:hover:bg-muted ttw:hover:text-foreground",
107
- "data-testid": z?.cancel,
108
- children: B.cancelButton
109
- }) : null, /* @__PURE__ */ h(e, {
110
- type: "button",
111
- disabled: M || N,
112
- loading: N,
113
- onClick: O,
114
- className: "ttw:h-auto ttw:rounded-2xl ttw:px-5 ttw:py-3 ttw:text-base ttw:font-medium",
115
- "data-testid": z?.next,
116
- children: [P, K]
117
- })]
118
- })]
119
- })
120
- ]
121
- })
122
- ]
123
- })
143
+ "data-testid": B?.root,
144
+ children: X
124
145
  })
125
146
  })
126
147
  });
127
148
  }
128
149
  //#endregion
129
- export { c as ONBOARDING_SHELL_LABELS_EN, y as OnboardingShell, l as OnboardingShellStepper };
150
+ export { c as ONBOARDING_SHELL_LABELS_EN, x as OnboardingShell, l as OnboardingShellStepper };
@@ -6,22 +6,29 @@ import * as e from "react";
6
6
  import { createPortal as t } from "react-dom";
7
7
  import { jsx as n } from "react/jsx-runtime";
8
8
  //#region ../../libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellOverlayPortal.js
9
- var r = e.createContext(null);
9
+ var r = e.createContext({
10
+ container: null,
11
+ isFullScreenInline: !1
12
+ });
10
13
  function i({ children: i, expandContainer: a = !1, testIds: o }) {
11
- let s = e.useContext(r);
14
+ let { container: s, isFullScreenInline: c } = e.useContext(r);
12
15
  e.useEffect(() => {
13
- if (!s || !a) return;
16
+ if (!s || !a || c) return;
14
17
  let e = s.style.minHeight;
15
18
  return s.style.minHeight = "min(840px, 92vh)", () => {
16
19
  s.style.minHeight = e;
17
20
  };
18
- }, [s, a]);
19
- let c = /* @__PURE__ */ n("div", {
21
+ }, [
22
+ s,
23
+ a,
24
+ c
25
+ ]);
26
+ let l = /* @__PURE__ */ n("div", {
20
27
  className: "ttw:absolute ttw:inset-0 ttw:z-20 ttw:flex ttw:flex-col ttw:overflow-hidden ttw:rounded-2xl ttw:bg-background",
21
28
  "data-testid": o?.root,
22
29
  children: i
23
30
  });
24
- return s ? t(c, s) : c;
31
+ return s ? t(l, s) : l;
25
32
  }
26
33
  //#endregion
27
34
  export { r as OnboardingShellOverlayContainerContext, i as OnboardingShellOverlayPortal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.29",
3
+ "version": "0.5.32",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {