@tesouro/embedded-components-react 0.5.201 → 0.5.203

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 (61) hide show
  1. package/README.md +20 -6
  2. package/dist/index.css +3 -0
  3. package/dist/index.d.ts +82 -7
  4. package/dist/index.js +8 -7
  5. package/dist/lib/MarketingWidget.d.ts +66 -7
  6. package/dist/lib/MarketingWidget.js +5 -4
  7. package/dist/lib/ReceivablesWidget.d.ts +16 -0
  8. package/dist/lib/ReceivablesWidget.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +6 -6
  10. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index2.js +24 -18
  11. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index4.js +65 -2
  12. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +188 -45
  14. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +30 -265
  15. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +144 -64
  16. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +47 -109
  17. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +293 -216
  18. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +75 -0
  19. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +114 -0
  20. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +237 -0
  21. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index4.js +14 -1
  22. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +28 -243
  23. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index6.js +212 -375
  24. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +64 -62
  25. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +409 -187
  26. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +73 -40
  27. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +10 -9
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +0 -9
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +4 -1
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +10 -263
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +1 -72
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +241 -398
  33. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +66 -100
  34. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +406 -76
  35. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +92 -330
  36. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +93 -0
  37. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +344 -0
  38. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +6 -1
  39. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +157 -20
  40. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +24 -1
  41. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +1 -3
  42. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +3 -18
  43. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +2 -0
  44. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +18 -4
  45. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +5 -4
  46. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index3.js +1 -0
  47. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +33 -81
  48. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js +34 -0
  49. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js +20 -0
  50. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js +161 -0
  51. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +3 -3
  52. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js +5 -1
  53. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js +34 -81
  54. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index9.js +92 -0
  55. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +38 -37
  56. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +54 -54
  57. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +115 -94
  58. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationApplicationStatus.js +25 -0
  59. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js +9 -9
  60. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  61. package/package.json +1 -1
@@ -1,85 +1,37 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useOrganizationOnboardingSuppression as e } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
6
- import "../../../shared/data-access/dist/index.js";
7
- import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
8
- import { WidgetProvider as n } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
9
- import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
- import "../../../shared/feature/dist/index.js";
11
- import { MarketingWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index2.js";
12
- import { marketingWidgetTestIds as o } from "./index3.js";
13
- import { MARKETING_WIDGET_LABELS_EN as s } from "../../ui/dist/index2.js";
14
- import { MarketingBenefitIcon as c } from "../../ui/dist/index3.js";
15
- import { MarketingWidget as l } from "../../ui/dist/index8.js";
16
- import "../../ui/dist/index.js";
17
- import { useCallback as u, useEffect as d, useState as f } from "react";
18
- import { jsx as p } from "react/jsx-runtime";
19
1
  //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js
20
- var m = /* @__PURE__ */ new Set([
21
- "ACTIVE",
22
- "INACTIVE",
23
- "INVITED"
24
- ]);
25
- function h({ content: n, onPrimaryCtaClick: a, labels: s }) {
26
- let c = t(), { initResponse: h } = r(), g = e(), [_, v] = f(!1);
27
- d(() => {
28
- c(i.Mounted);
29
- }, [c]);
30
- let y = u(() => {
31
- c(i.OpenModal), v(!0);
32
- }, [c]), b = u(() => {
33
- v(!1);
34
- }, []), x = u(() => {
35
- c(i.PrimaryCta), v(!1), a();
36
- }, [a, c]);
37
- return !h?.status || m.has(h.status) || g.isSuppressed || !g.isResolved ? null : /* @__PURE__ */ p(l, {
38
- open: _,
39
- vspLogo: n.vspLogo,
40
- bankingText: n.bankingText,
41
- primaryCaption: n.primaryCaption,
42
- secondaryCaption: n.secondaryCaption,
43
- providedByCaption: n.providedByCaption,
44
- primaryModalHeader: n.primaryModalHeader,
45
- howItWorksHeader: n.howItWorksHeader,
46
- howItWorksSteps: n.howItWorksSteps,
47
- fromDayOneHeader: n.fromDayOneHeader,
48
- benefits: n.benefits,
49
- appearance: n.appearance,
50
- onOpenMarketingModal: y,
51
- onCloseMarketingModal: b,
52
- onPrimaryCtaClick: x,
53
- labels: s,
54
- testIds: {
55
- root: o.root,
56
- learnMoreButton: o.learnMoreButton,
57
- applyNowButton: o.applyNowButton,
58
- modal: {
59
- root: o.modal,
60
- primaryCtaButton: o.primaryCtaButton
61
- }
62
- }
63
- });
2
+ function e(e) {
3
+ return e.charAt(0).toUpperCase() + e.slice(1);
64
4
  }
65
- function g({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: m, providerLabels: g, ..._ }) {
66
- return /* @__PURE__ */ p(n, {
67
- widgetName: a,
68
- baseUrl: e,
69
- widgetToken: t,
70
- organizationId: r,
71
- configClient: i,
72
- gatewayRouting: o,
73
- linkComponent: s,
74
- implementation: c,
75
- uiFramework: l,
76
- errorFallback: u,
77
- onError: d,
78
- analytics: f,
79
- disclosuresAcceptance: m,
80
- providerLabels: g,
81
- children: /* @__PURE__ */ p(h, { ..._ })
82
- });
5
+ function t({ applicantName: e, submittedOn: t }) {
6
+ return e && t ? [`Submitted by ${e} on ${t}.`] : e ? [`Submitted by ${e}.`] : t ? [`Submitted on ${t}.`] : [];
83
7
  }
8
+ var n = {
9
+ chipLabel: "Under review",
10
+ heading: ({ bankName: e }) => `Your business's application is with ${e}.`,
11
+ body: (e) => [...t(e), `${e.applicantName ?? "The applicant"} will be contacted with updates.`]
12
+ }, r = {
13
+ resumeApplication: "Resume application",
14
+ bankNameFallback: "the bank",
15
+ formatDate: (e) => new Date(e).toLocaleDateString("en-US", {
16
+ month: "short",
17
+ day: "numeric",
18
+ year: "numeric"
19
+ }),
20
+ draftStartedByOther: {
21
+ chipLabel: "Application in progress",
22
+ heading: ({ startedOn: e }) => e ? `Your business already started applying on ${e}.` : "Your business already started applying.",
23
+ body: () => ["Only the user who started the application can finish it. If someone else needs to apply instead, the original applicant can cancel theirs so someone else can start one."]
24
+ },
25
+ submittedByYou: n,
26
+ submittedByOther: n,
27
+ deniedByYou: {
28
+ chipLabel: "Not approved",
29
+ body: ({ deniedOn: e }) => [e ? `Application denied on ${e}. Details have been sent to your email.` : "Application denied. Details have been sent to your email."]
30
+ },
31
+ deniedByOther: {
32
+ chipLabel: "Not approved",
33
+ body: ({ bankName: t, applicantName: n }) => [`${e(t)} was unable to approve your business's application.`, `${n ?? "The applicant"} has the details.`]
34
+ }
35
+ };
84
36
  //#endregion
85
- export { s as MARKETING_WIDGET_LABELS_EN, c as MarketingBenefitIcon, g as MarketingWidget };
37
+ export { r as MARKETING_WIDGET_STATUS_LABELS_EN };
@@ -0,0 +1,34 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index5.js
2
+ var e = {
3
+ Offer: "offer",
4
+ Resume: "resume",
5
+ DraftStartedByOther: "draftStartedByOther",
6
+ SubmittedByYou: "submittedByYou",
7
+ SubmittedByOther: "submittedByOther",
8
+ DeniedByYou: "deniedByYou",
9
+ DeniedByOther: "deniedByOther",
10
+ Hidden: "hidden"
11
+ }, t = 2592e6;
12
+ function n(e) {
13
+ if (e?.status !== "DENIED") return null;
14
+ let n = Date.parse(e.deniedAt ?? e.updatedAt);
15
+ return Number.isFinite(n) ? n + t : null;
16
+ }
17
+ function r(t, r = Date.now()) {
18
+ if (!t) return e.Offer;
19
+ let i = t.ownership === "STARTED_BY_YOU";
20
+ switch (t.status) {
21
+ case "COMPLETE": return e.Hidden;
22
+ case "DRAFT": return i ? e.Resume : e.DraftStartedByOther;
23
+ case "SUBMITTED": return i ? e.SubmittedByYou : e.SubmittedByOther;
24
+ case "DENIED": {
25
+ let a = n(t);
26
+ return a !== null && r > a ? e.Hidden : i ? e.DeniedByYou : e.DeniedByOther;
27
+ }
28
+ case "DELETED":
29
+ case "CANCELED": return e.Offer;
30
+ default: return e.Hidden;
31
+ }
32
+ }
33
+ //#endregion
34
+ export { t as DENIED_NOTICE_DURATION_MS, e as MarketingApplicationView, n as deniedNoticeExpiresAt, r as marketingApplicationViewFor };
@@ -0,0 +1,20 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index6.js
2
+ var e = [
3
+ "COMPLETE",
4
+ "SUBMITTED",
5
+ "DRAFT",
6
+ "DENIED"
7
+ ], t = /* @__PURE__ */ new Set(["DELETED", "CANCELED"]);
8
+ function n(e) {
9
+ return e.find((e) => e.ownership === "STARTED_BY_YOU") ?? e[0] ?? null;
10
+ }
11
+ function r(r) {
12
+ let i = r.filter((e) => e.product === "BANK_ACCOUNT" && !t.has(e.status));
13
+ for (let t of e) {
14
+ let e = i.filter((e) => e.status === t);
15
+ if (e.length > 0) return n(e);
16
+ }
17
+ return n(i);
18
+ }
19
+ //#endregion
20
+ export { r as selectBankAccountApplication };
@@ -0,0 +1,161 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useOrganizationApplicationStatus as e } from "../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.js";
6
+ import "../../../shared/data-access/dist/index.js";
7
+ import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
8
+ import { WidgetProvider as n } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
9
+ import { useWidgetConfig as r, useWidgetInitStaleForToken as i } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import "../../../shared/feature/dist/index.js";
11
+ import { MARKETING_WIDGET_STATUS_LABELS_EN as a } from "./index4.js";
12
+ import { MarketingWidgetAnalyticsEvent as o, WIDGET_NAME as s } from "./index2.js";
13
+ import { marketingWidgetTestIds as c } from "./index3.js";
14
+ import { MarketingApplicationView as l, deniedNoticeExpiresAt as u, marketingApplicationViewFor as d } from "./index5.js";
15
+ import { selectBankAccountApplication as f } from "./index6.js";
16
+ import { MARKETING_WIDGET_LABELS_EN as p } from "../../ui/dist/index2.js";
17
+ import { MarketingBenefitIcon as m, MarketingWidgetStatusTone as h } from "../../ui/dist/index3.js";
18
+ import { MarketingWidget as g } from "../../ui/dist/index9.js";
19
+ import "../../ui/dist/index.js";
20
+ import { useCallback as _, useEffect as v, useMemo as y, useReducer as b, useState as x } from "react";
21
+ import { jsx as S } from "react/jsx-runtime";
22
+ //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index7.js
23
+ var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
24
+ "ACTIVE",
25
+ "INACTIVE",
26
+ "INVITED"
27
+ ]), T = {
28
+ [l.DraftStartedByOther]: "draftStartedByOther",
29
+ [l.SubmittedByYou]: "submittedByYou",
30
+ [l.SubmittedByOther]: "submittedByOther",
31
+ [l.DeniedByYou]: "deniedByYou",
32
+ [l.DeniedByOther]: "deniedByOther"
33
+ }, E = {
34
+ [l.DraftStartedByOther]: h.Brand,
35
+ [l.SubmittedByYou]: h.Warning,
36
+ [l.SubmittedByOther]: h.Warning,
37
+ [l.DeniedByYou]: h.Danger,
38
+ [l.DeniedByOther]: h.Danger
39
+ };
40
+ function D(e) {
41
+ return e in T;
42
+ }
43
+ function O(e) {
44
+ let t = a, n = (n) => ({
45
+ ...t[n],
46
+ ...e?.[n]
47
+ });
48
+ return {
49
+ resumeApplication: e?.resumeApplication ?? t.resumeApplication,
50
+ bankNameFallback: e?.bankNameFallback ?? t.bankNameFallback,
51
+ formatDate: e?.formatDate ?? t.formatDate,
52
+ draftStartedByOther: n("draftStartedByOther"),
53
+ submittedByYou: n("submittedByYou"),
54
+ submittedByOther: n("submittedByOther"),
55
+ deniedByYou: n("deniedByYou"),
56
+ deniedByOther: n("deniedByOther")
57
+ };
58
+ }
59
+ function k(e, t, n) {
60
+ let r = (e) => e ? n(e) : void 0;
61
+ return {
62
+ bankName: t,
63
+ applicantName: [e?.applicantFirstName, e?.applicantLastName].map((e) => e?.trim()).filter(Boolean).join(" ") || void 0,
64
+ startedOn: r(e?.createdAt),
65
+ submittedOn: r(e?.submittedAt),
66
+ deniedOn: r(e?.deniedAt)
67
+ };
68
+ }
69
+ function A({ content: n, onPrimaryCtaClick: a, labels: s, statusLabels: p }) {
70
+ let m = t(), { initResponse: h } = r(), A = i(), j = e(), [M, N] = x(!1), [P, F] = b((e) => e + 1, 0), I = y(() => f(j.applications), [j.applications]), L = u(I), R = y(() => O(p), [p]), z = d(I), B = h?.bankName || R.bankNameFallback, V = y(() => {
71
+ if (!D(z)) return;
72
+ let e = R[T[z]], t = k(I, B, R.formatDate);
73
+ return {
74
+ chipLabel: e.chipLabel,
75
+ chipTone: E[z],
76
+ heading: e.heading?.(t),
77
+ body: e.body(t)
78
+ };
79
+ }, [
80
+ I,
81
+ B,
82
+ R,
83
+ z
84
+ ]), H = y(() => z === l.Resume ? {
85
+ ...s,
86
+ applyNow: R.resumeApplication,
87
+ primaryCta: R.resumeApplication
88
+ } : s, [
89
+ s,
90
+ R.resumeApplication,
91
+ z
92
+ ]);
93
+ v(() => {
94
+ m(o.Mounted);
95
+ }, [m]), v(() => {
96
+ if (L === null) return;
97
+ let e = L - Date.now();
98
+ if (e < 0) return;
99
+ let t = setTimeout(F, Math.min(e + 1, C));
100
+ return () => clearTimeout(t);
101
+ }, [L, P]);
102
+ let U = !V && z !== l.Hidden;
103
+ M && !U && N(!1);
104
+ let W = _(() => {
105
+ m(o.OpenModal), N(!0);
106
+ }, [m]), G = _(() => {
107
+ N(!1);
108
+ }, []), K = _(() => {
109
+ m(o.PrimaryCta), N(!1), a();
110
+ }, [a, m]);
111
+ return !h?.status || w.has(h.status) || A || !j.isResolved || z === l.Hidden ? null : /* @__PURE__ */ S(g, {
112
+ open: M,
113
+ vspLogo: n.vspLogo,
114
+ bankingText: n.bankingText,
115
+ primaryCaption: n.primaryCaption,
116
+ secondaryCaption: n.secondaryCaption,
117
+ providedByCaption: n.providedByCaption,
118
+ primaryModalHeader: n.primaryModalHeader,
119
+ howItWorksHeader: n.howItWorksHeader,
120
+ howItWorksSteps: n.howItWorksSteps,
121
+ fromDayOneHeader: n.fromDayOneHeader,
122
+ benefits: n.benefits,
123
+ appearance: n.appearance,
124
+ onOpenMarketingModal: W,
125
+ onCloseMarketingModal: G,
126
+ onPrimaryCtaClick: K,
127
+ statusMessage: V,
128
+ labels: H,
129
+ testIds: {
130
+ root: c.root,
131
+ learnMoreButton: c.learnMoreButton,
132
+ applyNowButton: c.applyNowButton,
133
+ statusMessage: c.statusMessage,
134
+ modal: {
135
+ root: c.modal,
136
+ primaryCtaButton: c.primaryCtaButton
137
+ }
138
+ }
139
+ });
140
+ }
141
+ function j({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, disclosuresAcceptance: p, providerLabels: m, ...h }) {
142
+ return /* @__PURE__ */ S(n, {
143
+ widgetName: s,
144
+ baseUrl: e,
145
+ widgetToken: t,
146
+ organizationId: r,
147
+ configClient: i,
148
+ gatewayRouting: a,
149
+ linkComponent: o,
150
+ implementation: c,
151
+ uiFramework: l,
152
+ errorFallback: u,
153
+ onError: d,
154
+ analytics: f,
155
+ disclosuresAcceptance: p,
156
+ providerLabels: m,
157
+ children: /* @__PURE__ */ S(A, { ...h })
158
+ });
159
+ }
160
+ //#endregion
161
+ export { p as MARKETING_WIDGET_LABELS_EN, a as MARKETING_WIDGET_STATUS_LABELS_EN, m as MarketingBenefitIcon, j as MarketingWidget };
@@ -1,5 +1,5 @@
1
1
  import { MARKETING_WIDGET_LABELS_EN as e } from "./index2.js";
2
- import { MarketingBenefitIcon as t } from "./index3.js";
2
+ import { MarketingBenefitIcon as t, MarketingWidgetStatusTone as n } from "./index3.js";
3
3
  import "./index7.js";
4
- import { MarketingWidget as n } from "./index8.js";
5
- export { e as MARKETING_WIDGET_LABELS_EN, t as MarketingBenefitIcon, n as MarketingWidget };
4
+ import { MarketingWidget as r } from "./index9.js";
5
+ export { e as MARKETING_WIDGET_LABELS_EN, t as MarketingBenefitIcon, r as MarketingWidget, n as MarketingWidgetStatusTone };
@@ -5,6 +5,10 @@ var e = {
5
5
  Document: "document",
6
6
  Dollar: "dollar",
7
7
  Card: "card"
8
+ }, t = {
9
+ Brand: "brand",
10
+ Warning: "warning",
11
+ Danger: "danger"
8
12
  };
9
13
  //#endregion
10
- export { e as MarketingBenefitIcon };
14
+ export { e as MarketingBenefitIcon, t as MarketingWidgetStatusTone };
@@ -1,88 +1,41 @@
1
- import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MARKETING_WIDGET_LABELS_EN as t } from "./index2.js";
3
- import { MarketingWidgetModal as n } from "./index7.js";
4
- import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
1
+ import { Badge as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { MarketingWidgetStatusTone as n } from "./index3.js";
3
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
4
  //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js
6
- function o({ open: o, vspLogo: s, bankingText: c, primaryCaption: l, secondaryCaption: u, providedByCaption: d, primaryModalHeader: f, howItWorksHeader: p, howItWorksSteps: m, fromDayOneHeader: h, benefits: g, appearance: _, onOpenMarketingModal: v, onCloseMarketingModal: y, onPrimaryCtaClick: b, labels: x, testIds: S }) {
7
- let C = {
8
- ...t,
9
- ...x
10
- };
11
- return /* @__PURE__ */ a(r, { children: [/* @__PURE__ */ a("div", {
12
- "data-testid": S?.root,
13
- className: "ttw:relative ttw:flex ttw:w-full ttw:flex-col ttw:items-start ttw:overflow-hidden ttw:border ttw:border-border ttw:p-6",
14
- style: {
15
- backgroundColor: _.cardBackgroundColor,
16
- borderRadius: _.borderRadius,
17
- boxShadow: _.boxShadow
18
- },
5
+ var a = {
6
+ [n.Brand]: "ttw:border-transparent",
7
+ [n.Warning]: "ttw:border-amber-100 ttw:bg-amber-100 ttw:text-amber-700",
8
+ [n.Danger]: "ttw:border-destructive/20 ttw:bg-destructive/20 ttw:text-destructive"
9
+ };
10
+ function o({ statusMessage: o, primaryColor: s, testId: c }) {
11
+ let { chipLabel: l, chipTone: u, heading: d, body: f } = o, p = u === n.Brand;
12
+ return /* @__PURE__ */ i("div", {
13
+ "data-testid": c,
14
+ className: "ttw:flex ttw:flex-col ttw:items-start",
19
15
  children: [
20
- /* @__PURE__ */ a("div", {
21
- className: "ttw:mb-2 ttw:flex ttw:items-center ttw:gap-3",
22
- children: [/* @__PURE__ */ i("img", {
23
- src: s.src,
24
- alt: s.alt,
25
- height: 40,
26
- width: s.width,
27
- className: "ttw:h-10 ttw:w-auto ttw:object-contain"
28
- }), /* @__PURE__ */ i("p", {
29
- className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
30
- children: c
31
- })]
16
+ /* @__PURE__ */ i(e, {
17
+ variant: "outline",
18
+ className: t("ttw:mb-2 ttw:gap-2 ttw:rounded-full ttw:px-3 ttw:py-1 ttw:text-sm", a[u]),
19
+ style: p ? {
20
+ color: s,
21
+ backgroundColor: `color-mix(in srgb, ${s} 12%, transparent)`
22
+ } : void 0,
23
+ children: [/* @__PURE__ */ r("span", {
24
+ "aria-hidden": "true",
25
+ className: "ttw:size-2 ttw:rounded-full ttw:bg-current"
26
+ }), l]
32
27
  }),
33
- /* @__PURE__ */ i("p", {
34
- className: "ttw:mb-2 ttw:text-sm ttw:text-muted-foreground",
28
+ d ? /* @__PURE__ */ r("p", {
29
+ className: "ttw:text-xl ttw:font-semibold",
30
+ style: { color: s },
35
31
  children: d
36
- }),
37
- /* @__PURE__ */ a("div", {
38
- className: "ttw:mb-2 ttw:flex ttw:flex-col",
39
- children: [/* @__PURE__ */ i("p", {
40
- className: "ttw:text-xl ttw:font-semibold",
41
- style: { color: _.primaryColor },
42
- children: l
43
- }), /* @__PURE__ */ i("p", {
44
- className: "ttw:leading-snug",
45
- style: { color: _.primaryColor },
46
- children: u
47
- })]
48
- }),
49
- /* @__PURE__ */ a("div", {
50
- className: "ttw:flex ttw:flex-wrap ttw:gap-3",
51
- children: [/* @__PURE__ */ i(e, {
52
- type: "button",
53
- "data-testid": S?.applyNowButton,
54
- onClick: b,
55
- className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light ttw:transition-[filter] ttw:hover:brightness-90",
56
- style: {
57
- backgroundColor: _.primaryColor,
58
- color: _.primaryContrastColor
59
- },
60
- children: C.applyNow
61
- }), /* @__PURE__ */ i(e, {
62
- type: "button",
63
- variant: "outline",
64
- "data-testid": S?.learnMoreButton,
65
- onClick: v,
66
- className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light",
67
- children: C.learnMore
68
- })]
69
- })
32
+ }) : null,
33
+ f.map((e) => /* @__PURE__ */ r("p", {
34
+ className: "ttw:mt-1 ttw:text-sm ttw:text-muted-foreground",
35
+ children: e
36
+ }, e))
70
37
  ]
71
- }), /* @__PURE__ */ i(n, {
72
- open: o,
73
- vspLogo: s,
74
- providedByCaption: d,
75
- primaryModalHeader: f,
76
- howItWorksHeader: p,
77
- howItWorksSteps: m,
78
- fromDayOneHeader: h,
79
- benefits: g,
80
- appearance: _,
81
- onClose: y,
82
- onPrimaryCtaClick: b,
83
- labels: x,
84
- testIds: S?.modal
85
- })] });
38
+ });
86
39
  }
87
40
  //#endregion
88
- export { o as MarketingWidget };
41
+ export { o as MarketingWidgetStatus };
@@ -0,0 +1,92 @@
1
+ import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
+ import { MARKETING_WIDGET_LABELS_EN as t } from "./index2.js";
3
+ import { MarketingWidgetModal as n } from "./index7.js";
4
+ import { MarketingWidgetStatus as r } from "./index8.js";
5
+ import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
6
+ //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index9.js
7
+ function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _, appearance: v, onOpenMarketingModal: y, onCloseMarketingModal: b, onPrimaryCtaClick: x, statusMessage: S, labels: C, testIds: w }) {
8
+ let T = {
9
+ ...t,
10
+ ...C
11
+ };
12
+ return /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("div", {
13
+ "data-testid": w?.root,
14
+ className: "ttw:relative ttw:flex ttw:w-full ttw:flex-col ttw:items-start ttw:overflow-hidden ttw:border ttw:border-border ttw:p-6",
15
+ style: {
16
+ backgroundColor: v.cardBackgroundColor,
17
+ borderRadius: v.borderRadius,
18
+ boxShadow: v.boxShadow
19
+ },
20
+ children: [
21
+ /* @__PURE__ */ o("div", {
22
+ className: "ttw:mb-2 ttw:flex ttw:items-center ttw:gap-3",
23
+ children: [/* @__PURE__ */ a("img", {
24
+ src: c.src,
25
+ alt: c.alt,
26
+ height: 40,
27
+ width: c.width,
28
+ className: "ttw:h-10 ttw:w-auto ttw:object-contain"
29
+ }), /* @__PURE__ */ a("p", {
30
+ className: "ttw:text-xl ttw:font-semibold ttw:text-foreground",
31
+ children: l
32
+ })]
33
+ }),
34
+ /* @__PURE__ */ a("p", {
35
+ className: "ttw:mb-2 ttw:text-sm ttw:text-muted-foreground",
36
+ children: f
37
+ }),
38
+ S ? /* @__PURE__ */ a(r, {
39
+ statusMessage: S,
40
+ primaryColor: v.primaryColor,
41
+ testId: w?.statusMessage
42
+ }) : /* @__PURE__ */ o(i, { children: [/* @__PURE__ */ o("div", {
43
+ className: "ttw:mb-2 ttw:flex ttw:flex-col",
44
+ children: [/* @__PURE__ */ a("p", {
45
+ className: "ttw:text-xl ttw:font-semibold",
46
+ style: { color: v.primaryColor },
47
+ children: u
48
+ }), /* @__PURE__ */ a("p", {
49
+ className: "ttw:leading-snug",
50
+ style: { color: v.primaryColor },
51
+ children: d
52
+ })]
53
+ }), /* @__PURE__ */ o("div", {
54
+ className: "ttw:flex ttw:flex-wrap ttw:gap-3",
55
+ children: [/* @__PURE__ */ a(e, {
56
+ type: "button",
57
+ "data-testid": w?.applyNowButton,
58
+ onClick: x,
59
+ className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light ttw:transition-[filter] ttw:hover:brightness-90",
60
+ style: {
61
+ backgroundColor: v.primaryColor,
62
+ color: v.primaryContrastColor
63
+ },
64
+ children: T.applyNow
65
+ }), /* @__PURE__ */ a(e, {
66
+ type: "button",
67
+ variant: "outline",
68
+ "data-testid": w?.learnMoreButton,
69
+ onClick: y,
70
+ className: "ttw:h-auto ttw:rounded-xl ttw:px-6 ttw:py-2 ttw:text-base ttw:font-light",
71
+ children: T.learnMore
72
+ })]
73
+ })] })
74
+ ]
75
+ }), /* @__PURE__ */ a(n, {
76
+ open: s,
77
+ vspLogo: c,
78
+ providedByCaption: f,
79
+ primaryModalHeader: p,
80
+ howItWorksHeader: m,
81
+ howItWorksSteps: h,
82
+ fromDayOneHeader: g,
83
+ benefits: _,
84
+ appearance: v,
85
+ onClose: b,
86
+ onPrimaryCtaClick: x,
87
+ labels: C,
88
+ testIds: w?.modal
89
+ })] });
90
+ }
91
+ //#endregion
92
+ export { s as MarketingWidget };