@tesouro/embedded-components-react 0.3.43 → 0.3.44
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 +18 -2
- package/dist/experimental/index.d.ts +1 -975
- package/dist/experimental/index.js +0 -6
- package/dist/index.d.ts +1730 -1425
- package/dist/index.js +65 -61
- package/dist/lib/WidgetProvider.js +7 -7
- package/dist/lib/WidgetSuite.d.ts +2081 -0
- package/dist/lib/WidgetSuite.js +5 -0
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +60 -60
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/lib/BankAccountsWidgetUi.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +45 -45
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +18 -18
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +118 -118
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index.js +6 -5
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index10.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index11.js +23 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index12.js +19 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index13.js +16 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index14.js +21 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index15.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +116 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +46 -23
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +20 -88
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +31 -34
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +12 -132
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +11 -137
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js +33 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index3.js +12 -12
- package/package.json +1 -1
- package/dist/experimental/WidgetSuite.d.ts +0 -976
- package/dist/experimental/WidgetSuite.js +0 -6
|
@@ -2,144 +2,18 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
5
|
+
import { Scope as e } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
6
6
|
import "../../../shared/data-access/dist/index.js";
|
|
7
|
-
import {
|
|
8
|
-
import "../../../
|
|
9
|
-
import {
|
|
10
|
-
import { WidgetProvider as r } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
11
|
-
import { useRefetchWidget as i, useWidgetConfig as a, useWidgetError as o, useWidgetInitStaleForToken as s } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
12
|
-
import "../../../shared/feature/dist/index.js";
|
|
13
|
-
import { AcceptDisclosuresWidget as c } from "../../../accept-disclosures-widget/feature/dist/index5.js";
|
|
14
|
-
import "../../../accept-disclosures-widget/feature/dist/index.js";
|
|
15
|
-
import { WIDGET_SUITE_CONTENT_LABELS_EN as l, WIDGET_SUITE_DISCLOSURE_LABELS_EN as u, WIDGET_SUITE_SECTION_LABELS_EN as d, WIDGET_SUITE_SECTION_TITLE_LABELS_EN as f } from "./index4.js";
|
|
16
|
-
import { WidgetSuiteProvider as p, useWidgetSuiteProvider as m } from "./index6.js";
|
|
17
|
-
import { WIDGET_SUITE_SECTIONS as h, WidgetSuiteSectionId as g } from "./index7.js";
|
|
18
|
-
import { WIDGET_NAME as _, WidgetSuiteAnalyticsEvent as v } from "./index2.js";
|
|
19
|
-
import { needsDisclosureAcceptance as y } from "./index3.js";
|
|
20
|
-
import { WidgetSuiteShell as b } from "../../ui/dist/index3.js";
|
|
21
|
-
import { SectionPageTitle as x } from "../../ui/dist/index4.js";
|
|
22
|
-
import "../../ui/dist/index.js";
|
|
23
|
-
import { useCallback as S, useEffect as C, useMemo as w, useState as T } from "react";
|
|
24
|
-
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
import { BillPayWidget as t } from "../../../bill-pay-widget/feature/dist/index75.js";
|
|
8
|
+
import "../../../bill-pay-widget/feature/dist/index.js";
|
|
9
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
25
10
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed"
|
|
29
|
-
};
|
|
30
|
-
function A({ labels: e, sectionLabels: n, sectionTitleLabels: r, disclosureLabels: l, showSectionTitle: p = !0 }) {
|
|
31
|
-
let { availableSections: _, activeSection: v, navigate: w } = m(), { initResponse: A } = a(), j = o(), M = s(), N = i(), P = {
|
|
32
|
-
...d,
|
|
33
|
-
...n
|
|
34
|
-
}, F = S((e) => w({ section: e }), [w]), [I, L] = T(!1), R = S(() => L(!0), []), z = y(A), B = {
|
|
35
|
-
...u,
|
|
36
|
-
...l,
|
|
37
|
-
initFailedState: {
|
|
38
|
-
...u.initFailedState,
|
|
39
|
-
...l?.initFailedState
|
|
40
|
-
},
|
|
41
|
-
refreshFailedState: {
|
|
42
|
-
...u.refreshFailedState,
|
|
43
|
-
...l?.refreshFailedState
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
C(() => {
|
|
47
|
-
!z && I && L(!1);
|
|
48
|
-
}, [I, z]);
|
|
49
|
-
let V = !!(A && M);
|
|
50
|
-
if (!A && !j || V && !j) return /* @__PURE__ */ D(b, {
|
|
51
|
-
isLoading: !0,
|
|
52
|
-
sections: [],
|
|
53
|
-
selectedSectionId: "",
|
|
54
|
-
onSectionChange: F,
|
|
55
|
-
labels: e
|
|
56
|
-
});
|
|
57
|
-
if ((!A || V) && j) return /* @__PURE__ */ D(t, {
|
|
58
|
-
title: B.initFailedState.title,
|
|
59
|
-
description: B.initFailedState.body,
|
|
60
|
-
retryLabel: B.initFailedState.retryButton,
|
|
61
|
-
onRetry: N,
|
|
62
|
-
testId: k.initFailed
|
|
63
|
-
});
|
|
64
|
-
if (z) return I && j ? /* @__PURE__ */ D(t, {
|
|
65
|
-
title: B.refreshFailedState.title,
|
|
66
|
-
description: B.refreshFailedState.body,
|
|
67
|
-
retryLabel: B.refreshFailedState.retryButton,
|
|
68
|
-
onRetry: N,
|
|
69
|
-
testId: k.disclosuresRefreshFailed
|
|
70
|
-
}) : /* @__PURE__ */ D(c, { onAccepted: R });
|
|
71
|
-
let H = A?.bankName?.trim(), U = H ? {
|
|
72
|
-
...f,
|
|
73
|
-
...r
|
|
74
|
-
}.bankTagline.replaceAll("{bankName}", H) : void 0, W = _.map((e) => {
|
|
75
|
-
let { Content: t } = h[e], n = P[e], r = e === g.Accounts ? void 0 : U;
|
|
76
|
-
return {
|
|
77
|
-
id: e,
|
|
78
|
-
label: n,
|
|
79
|
-
content: p ? /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(x, {
|
|
80
|
-
title: n,
|
|
81
|
-
bankTagline: r
|
|
82
|
-
}), /* @__PURE__ */ D(t, {})] }) : /* @__PURE__ */ D(t, {})
|
|
83
|
-
};
|
|
84
|
-
});
|
|
85
|
-
return /* @__PURE__ */ D(b, {
|
|
86
|
-
sections: W,
|
|
87
|
-
selectedSectionId: v ?? "",
|
|
88
|
-
onSectionChange: F,
|
|
89
|
-
labels: e
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
function j({ sections: t, selection: r, defaultSelection: i, onSelectionChange: o, contentLabels: s, ...c }) {
|
|
93
|
-
let u = n();
|
|
94
|
-
C(() => {
|
|
95
|
-
u(v.Mounted);
|
|
96
|
-
}, [u]);
|
|
97
|
-
let { initResponse: d } = a(), f = d?.scopes, m = w(() => ({
|
|
98
|
-
creditCards: {
|
|
99
|
-
...l.creditCards,
|
|
100
|
-
...s?.creditCards
|
|
101
|
-
},
|
|
102
|
-
debitCards: {
|
|
103
|
-
...l.debitCards,
|
|
104
|
-
...s?.debitCards
|
|
105
|
-
},
|
|
106
|
-
expensePlaceholders: {
|
|
107
|
-
...l.expensePlaceholders,
|
|
108
|
-
...s?.expensePlaceholders
|
|
109
|
-
}
|
|
110
|
-
}), [s]), g = t.filter((t) => {
|
|
111
|
-
let n = h[t];
|
|
112
|
-
return !!n && (!n.anyOfScopes || e(f, n.anyOfScopes));
|
|
113
|
-
});
|
|
114
|
-
return /* @__PURE__ */ D(p, {
|
|
115
|
-
sections: t,
|
|
116
|
-
availableSections: g,
|
|
117
|
-
grantedScopes: f,
|
|
118
|
-
contentLabels: m,
|
|
119
|
-
selection: r,
|
|
120
|
-
defaultSelection: i,
|
|
121
|
-
onSelectionChange: o,
|
|
122
|
-
children: /* @__PURE__ */ D(A, { ...c })
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
function M({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, gatewayRouting: a, linkComponent: o, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
|
|
126
|
-
return /* @__PURE__ */ D(r, {
|
|
127
|
-
widgetName: _,
|
|
128
|
-
baseUrl: e,
|
|
129
|
-
widgetToken: t,
|
|
130
|
-
organizationId: n,
|
|
131
|
-
configClient: i,
|
|
132
|
-
gatewayRouting: a,
|
|
133
|
-
linkComponent: o,
|
|
134
|
-
implementation: s,
|
|
135
|
-
uiFramework: c,
|
|
136
|
-
errorFallback: l,
|
|
137
|
-
onError: u,
|
|
138
|
-
analytics: d,
|
|
139
|
-
disclosuresAcceptance: f,
|
|
140
|
-
providerLabels: p,
|
|
141
|
-
children: /* @__PURE__ */ D(j, { ...m })
|
|
142
|
-
});
|
|
11
|
+
function r() {
|
|
12
|
+
return /* @__PURE__ */ n(t, {});
|
|
143
13
|
}
|
|
14
|
+
var i = {
|
|
15
|
+
anyOfScopes: [e.PayableReadOrg],
|
|
16
|
+
Content: r
|
|
17
|
+
};
|
|
144
18
|
//#endregion
|
|
145
|
-
export {
|
|
19
|
+
export { r as BillPaySection, i as billPaySection };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useWidgetSuiteProvider as e } from "./index6.js";
|
|
6
|
+
import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
7
|
+
import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
8
|
+
import "../../../shared/data-access/dist/index.js";
|
|
9
|
+
import { CardProgram as r } from "../../../shared/feature/dist/lib/card/cardProgram.js";
|
|
10
|
+
import "../../../shared/feature/dist/index.js";
|
|
11
|
+
import { CardsWidget as i } from "../../../cards-widget/feature/dist/index9.js";
|
|
12
|
+
import "../../../cards-widget/feature/dist/index.js";
|
|
13
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
14
|
+
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index9.js
|
|
15
|
+
function s() {
|
|
16
|
+
let { grantedScopes: s, labels: c } = e();
|
|
17
|
+
return /* @__PURE__ */ o("div", {
|
|
18
|
+
className: "ttw:grid ttw:gap-8",
|
|
19
|
+
children: [t(s, [n.CreditCardReadOrg]) && /* @__PURE__ */ a(i, {
|
|
20
|
+
cardProgram: r.Credit,
|
|
21
|
+
...c.sections.cards.creditCards
|
|
22
|
+
}), t(s, [n.DebitCardReadOrg]) && /* @__PURE__ */ a(i, {
|
|
23
|
+
cardProgram: r.Debit,
|
|
24
|
+
...c.sections.cards.debitCards
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
var c = {
|
|
29
|
+
anyOfScopes: [n.CreditCardReadOrg, n.DebitCardReadOrg],
|
|
30
|
+
Content: s
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { s as CardsSection, c as cardsSection };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { WIDGET_SUITE_SHELL_LABELS_EN as e } from "./index2.js";
|
|
6
|
+
import { Skeleton as t, Typography as n, cn as r } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
7
7
|
import { useRef as i } from "react";
|
|
8
8
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
9
9
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/ui/dist/index3.js
|
|
@@ -14,10 +14,10 @@ var s = [
|
|
|
14
14
|
];
|
|
15
15
|
function c({ sections: c, selectedSectionId: l, onSectionChange: u, isLoading: d = !1, labels: f }) {
|
|
16
16
|
let p = {
|
|
17
|
-
...
|
|
17
|
+
...e,
|
|
18
18
|
...f,
|
|
19
19
|
emptyState: {
|
|
20
|
-
...
|
|
20
|
+
...e.emptyState,
|
|
21
21
|
...f?.emptyState
|
|
22
22
|
}
|
|
23
23
|
}, m = i([]), h = c.find((e) => e.id === l), g = (e, t) => {
|
|
@@ -45,17 +45,17 @@ function c({ sections: c, selectedSectionId: l, onSectionChange: u, isLoading: d
|
|
|
45
45
|
className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-6",
|
|
46
46
|
children: [/* @__PURE__ */ a("div", {
|
|
47
47
|
className: "ttw:flex ttw:items-center ttw:gap-1 ttw:overflow-x-auto ttw:border-b ttw:border-border",
|
|
48
|
-
children: s.map((
|
|
48
|
+
children: s.map((e) => /* @__PURE__ */ a("div", {
|
|
49
49
|
className: "ttw:px-4 ttw:py-2.5",
|
|
50
|
-
children: /* @__PURE__ */ a(
|
|
51
|
-
},
|
|
50
|
+
children: /* @__PURE__ */ a(t, { className: "ttw:h-5 ttw:w-20" })
|
|
51
|
+
}, e))
|
|
52
52
|
}), /* @__PURE__ */ a("div", { className: "ttw:min-h-[432px] ttw:min-w-0" })]
|
|
53
53
|
}) : c.length === 0 ? /* @__PURE__ */ o("section", {
|
|
54
54
|
className: "ttw:flex ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:rounded-lg ttw:border ttw:border-border ttw:p-10 ttw:text-center",
|
|
55
|
-
children: [/* @__PURE__ */ a(
|
|
55
|
+
children: [/* @__PURE__ */ a(n, {
|
|
56
56
|
variant: "h5",
|
|
57
57
|
children: p.emptyState.title
|
|
58
|
-
}), /* @__PURE__ */ a(
|
|
58
|
+
}), /* @__PURE__ */ a(n, {
|
|
59
59
|
variant: "body2",
|
|
60
60
|
color: "muted",
|
|
61
61
|
children: p.emptyState.body
|
|
@@ -68,7 +68,7 @@ function c({ sections: c, selectedSectionId: l, onSectionChange: u, isLoading: d
|
|
|
68
68
|
children: /* @__PURE__ */ a("ul", {
|
|
69
69
|
className: "ttw:-mb-px ttw:flex ttw:items-center ttw:gap-1 ttw:overflow-x-auto",
|
|
70
70
|
children: c.map((e, t) => {
|
|
71
|
-
let
|
|
71
|
+
let n = e.id === l;
|
|
72
72
|
return /* @__PURE__ */ a("li", {
|
|
73
73
|
className: "ttw:shrink-0",
|
|
74
74
|
children: /* @__PURE__ */ a("button", {
|
|
@@ -76,10 +76,10 @@ function c({ sections: c, selectedSectionId: l, onSectionChange: u, isLoading: d
|
|
|
76
76
|
ref: (e) => {
|
|
77
77
|
m.current[t] = e;
|
|
78
78
|
},
|
|
79
|
-
"aria-current":
|
|
79
|
+
"aria-current": n ? "page" : void 0,
|
|
80
80
|
onClick: () => u(e.id),
|
|
81
81
|
onKeyDown: (e) => g(e, t),
|
|
82
|
-
className:
|
|
82
|
+
className: r("ttw:cursor-pointer ttw:border-b-2 ttw:px-4 ttw:py-2.5 ttw:text-sm ttw:font-medium ttw:whitespace-nowrap ttw:focus-visible:-outline-offset-2 ttw:focus-visible:outline-2 ttw:focus-visible:outline-ring", n ? "ttw:border-primary ttw:text-primary" : "ttw:border-transparent ttw:text-muted-foreground ttw:hover:border-border ttw:hover:text-foreground"),
|
|
83
83
|
children: e.label
|
|
84
84
|
})
|
|
85
85
|
}, e.id);
|