@tesouro/embedded-components-react 0.2.252 → 0.2.254
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/experimental/WidgetSuite.d.ts +649 -25
- package/dist/experimental/WidgetSuite.js +5 -2
- package/dist/experimental/index.d.ts +649 -25
- package/dist/experimental/index.js +5 -2
- package/dist/index.css +22 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/{index3.js → lib/AccountCard.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/{index6.js → lib/BankAccountsWidgetUi.js} +7 -7
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/{index4.js → lib/BankingHeader.js} +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/{index5.js → lib/CreateAccountDialog.js} +4 -4
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/ui/dist/{index2.js → lib/labels.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/{index3.js → lib/SettingsWidgetUi/SettingsWidgetUi.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/lib/SettingsWidgetUi/index.js +2 -0
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/{index2.js → lib/SettingsWidgetUi/labels.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/EmbedApiContext.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/zod.gen.js +463 -456
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UIContext/UIProvider.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index.js +5 -2
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index2.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +34 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +59 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index2.js +6 -3
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index3.js +70 -18
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/settings-widget/ui/dist/index4.js +0 -2
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
1
5
|
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
2
6
|
import { createEmbeddedClient as ee } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
3
7
|
import { EmbedApiProvider as n } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
1
5
|
import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
|
|
2
6
|
import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
|
|
3
7
|
import { EmbedApiProvider as ee, useEmbedApi as te } from "../../../../data-access/dist/lib/EmbedApiContext.js";
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.2.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.2.254", n = "c1c7c5e52df18c550e730176711a1949f6c73ea5", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/UIContext/UIProvider.js
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
1
5
|
import { DefaultLinkComponent as e, UIContext as t, resolveUIFramework as n } from "./UIContext.js";
|
|
2
6
|
import { useContext as r, useMemo as i } from "react";
|
|
3
7
|
import { jsx as a } from "react/jsx-runtime";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { WIDGET_SUITE_SECTION_LABELS_EN as e } from "./index3.js";
|
|
2
|
+
import { WidgetSuiteSectionId as t } from "./index4.js";
|
|
3
|
+
import { WIDGET_SUITE_SHELL_LABELS_EN as n } from "../../ui/dist/index2.js";
|
|
2
4
|
import "../../ui/dist/index.js";
|
|
3
|
-
|
|
5
|
+
import { WidgetSuite as r } from "./index5.js";
|
|
6
|
+
export { e as WIDGET_SUITE_SECTION_LABELS_EN, n as WIDGET_SUITE_SHELL_LABELS_EN, r as WidgetSuite, t as WidgetSuiteSectionId };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
|
|
6
|
+
import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
|
|
7
|
+
import "../../../shared/data-access/dist/index.js";
|
|
8
|
+
import { CardProgram as n } from "../../../shared/feature/dist/lib/card/cardProgram.js";
|
|
9
|
+
import "../../../shared/feature/dist/index.js";
|
|
10
|
+
import { BankAccountsWidget as r } from "../../../bank-accounts-widget/feature/dist/index8.js";
|
|
11
|
+
import "../../../bank-accounts-widget/feature/dist/index.js";
|
|
12
|
+
import { CardsWidget as i } from "../../../cards-widget/feature/dist/index8.js";
|
|
13
|
+
import "../../../cards-widget/feature/dist/index.js";
|
|
14
|
+
import { SettingsWidget as a } from "../../../settings-widget/feature/dist/index5.js";
|
|
15
|
+
import "../../../settings-widget/feature/dist/index.js";
|
|
16
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
17
|
+
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js
|
|
18
|
+
var s = {
|
|
19
|
+
Accounts: "accounts",
|
|
20
|
+
Cards: "cards",
|
|
21
|
+
Settings: "settings"
|
|
22
|
+
}, c = {
|
|
23
|
+
[s.Accounts]: {
|
|
24
|
+
anyOfScopes: [t.BankAccountReadOrg, t.ExternalBankAccountReadOrg],
|
|
25
|
+
render: () => /* @__PURE__ */ o(r, {})
|
|
26
|
+
},
|
|
27
|
+
[s.Cards]: {
|
|
28
|
+
anyOfScopes: [t.CreditCardReadOrg, t.DebitCardReadOrg],
|
|
29
|
+
render: (r) => /* @__PURE__ */ o(i, { cardProgram: e(r, [t.CreditCardReadOrg]) ? n.Credit : n.Debit })
|
|
30
|
+
},
|
|
31
|
+
[s.Settings]: { render: () => /* @__PURE__ */ o(a, {}) }
|
|
32
|
+
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { c as WIDGET_SUITE_SECTIONS, s as WidgetSuiteSectionId };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.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 { WIDGET_SUITE_SECTION_LABELS_EN as i } from "./index3.js";
|
|
12
|
+
import { WIDGET_SUITE_SECTIONS as a } from "./index4.js";
|
|
13
|
+
import { WIDGET_NAME as o, WidgetSuiteAnalyticsEvent as s } from "./index2.js";
|
|
14
|
+
import { WidgetSuiteShell as c } from "../../ui/dist/index3.js";
|
|
15
|
+
import "../../ui/dist/index.js";
|
|
16
|
+
import { useEffect as l, useState as u } from "react";
|
|
17
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
18
|
+
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js
|
|
19
|
+
function f({ sections: n, labels: o, sectionLabels: f }) {
|
|
20
|
+
let p = t();
|
|
21
|
+
l(() => {
|
|
22
|
+
p(s.Mounted);
|
|
23
|
+
}, [p]);
|
|
24
|
+
let m = {
|
|
25
|
+
...i,
|
|
26
|
+
...f
|
|
27
|
+
}, { initResponse: h } = r(), g = h?.scopes, _ = n.flatMap((t) => {
|
|
28
|
+
let n = a[t];
|
|
29
|
+
return !n || n.anyOfScopes && !e(g, n.anyOfScopes) ? [] : [{
|
|
30
|
+
id: t,
|
|
31
|
+
label: m[t],
|
|
32
|
+
content: n.render(g)
|
|
33
|
+
}];
|
|
34
|
+
}), [v, y] = u(n[0] ?? ""), b = _.some((e) => e.id === v) ? v : _[0]?.id ?? "";
|
|
35
|
+
return /* @__PURE__ */ d(c, {
|
|
36
|
+
sections: _,
|
|
37
|
+
selectedSectionId: b,
|
|
38
|
+
onSectionChange: y,
|
|
39
|
+
labels: o
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
function p({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, linkComponent: a, implementation: s, uiFramework: c, errorFallback: l, onError: u, analytics: p, ...m }) {
|
|
43
|
+
return /* @__PURE__ */ d(n, {
|
|
44
|
+
widgetName: o,
|
|
45
|
+
baseUrl: e,
|
|
46
|
+
widgetToken: t,
|
|
47
|
+
organizationId: r,
|
|
48
|
+
configClient: i,
|
|
49
|
+
linkComponent: a,
|
|
50
|
+
implementation: s,
|
|
51
|
+
uiFramework: c,
|
|
52
|
+
errorFallback: l,
|
|
53
|
+
onError: u,
|
|
54
|
+
analytics: p,
|
|
55
|
+
children: /* @__PURE__ */ d(f, { ...m })
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { p as WidgetSuite, p as default };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "./index2.js";
|
|
2
|
-
import {
|
|
3
|
-
export { e as
|
|
1
|
+
import { WIDGET_SUITE_SHELL_LABELS_EN as e } from "./index2.js";
|
|
2
|
+
import { WidgetSuiteShell as t } from "./index3.js";
|
|
3
|
+
export { e as WIDGET_SUITE_SHELL_LABELS_EN, t as WidgetSuiteShell };
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/ui/dist/index2.js
|
|
2
2
|
var e = {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
navAriaLabel: "Sections",
|
|
4
|
+
emptyState: {
|
|
5
|
+
title: "Nothing available here",
|
|
6
|
+
body: "This account doesn't have access to any of this page's sections."
|
|
7
|
+
}
|
|
5
8
|
};
|
|
6
9
|
//#endregion
|
|
7
|
-
export { e as
|
|
10
|
+
export { e as WIDGET_SUITE_SHELL_LABELS_EN };
|
|
@@ -1,25 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { Typography as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { WIDGET_SUITE_SHELL_LABELS_EN as n } from "./index2.js";
|
|
7
|
+
import { useRef as r } from "react";
|
|
8
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
9
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/ui/dist/index3.js
|
|
6
|
-
|
|
7
|
-
let
|
|
8
|
-
...
|
|
9
|
-
...
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
function o({ sections: o, selectedSectionId: s, onSectionChange: c, labels: l }) {
|
|
11
|
+
let u = {
|
|
12
|
+
...n,
|
|
13
|
+
...l,
|
|
14
|
+
emptyState: {
|
|
15
|
+
...n.emptyState,
|
|
16
|
+
...l?.emptyState
|
|
17
|
+
}
|
|
18
|
+
}, d = r([]), f = o.find((e) => e.id === s), p = (e, t) => {
|
|
19
|
+
let n = o.length - 1, r;
|
|
20
|
+
switch (e.key) {
|
|
21
|
+
case "ArrowRight":
|
|
22
|
+
r = t === n ? 0 : t + 1;
|
|
23
|
+
break;
|
|
24
|
+
case "ArrowLeft":
|
|
25
|
+
r = t === 0 ? n : t - 1;
|
|
26
|
+
break;
|
|
27
|
+
case "Home":
|
|
28
|
+
r = 0;
|
|
29
|
+
break;
|
|
30
|
+
case "End":
|
|
31
|
+
r = n;
|
|
32
|
+
break;
|
|
33
|
+
default: return;
|
|
34
|
+
}
|
|
35
|
+
e.preventDefault(), d.current[r]?.focus();
|
|
36
|
+
};
|
|
37
|
+
return o.length === 0 ? /* @__PURE__ */ a("section", {
|
|
38
|
+
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",
|
|
39
|
+
children: [/* @__PURE__ */ i(e, {
|
|
15
40
|
variant: "h5",
|
|
16
|
-
children:
|
|
17
|
-
}), /* @__PURE__ */
|
|
41
|
+
children: u.emptyState.title
|
|
42
|
+
}), /* @__PURE__ */ i(e, {
|
|
18
43
|
variant: "body2",
|
|
19
44
|
color: "muted",
|
|
20
|
-
children:
|
|
45
|
+
children: u.emptyState.body
|
|
46
|
+
})]
|
|
47
|
+
}) : /* @__PURE__ */ a("section", {
|
|
48
|
+
className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-6",
|
|
49
|
+
children: [/* @__PURE__ */ i("nav", {
|
|
50
|
+
"aria-label": u.navAriaLabel,
|
|
51
|
+
children: /* @__PURE__ */ i("ul", {
|
|
52
|
+
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-1 ttw:border-b ttw:border-border",
|
|
53
|
+
children: o.map((e, n) => {
|
|
54
|
+
let r = e.id === s;
|
|
55
|
+
return /* @__PURE__ */ i("li", { children: /* @__PURE__ */ i("button", {
|
|
56
|
+
type: "button",
|
|
57
|
+
ref: (e) => {
|
|
58
|
+
d.current[n] = e;
|
|
59
|
+
},
|
|
60
|
+
"aria-current": r ? "page" : void 0,
|
|
61
|
+
onClick: () => c(e.id),
|
|
62
|
+
onKeyDown: (e) => p(e, n),
|
|
63
|
+
className: t("ttw:-mb-px 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-2 ttw:focus-visible:outline-offset-2 ttw:focus-visible:outline-ring", r ? "ttw:border-primary ttw:text-primary" : "ttw:border-transparent ttw:text-muted-foreground ttw:hover:border-border ttw:hover:text-foreground"),
|
|
64
|
+
children: e.label
|
|
65
|
+
}) }, e.id);
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
}), /* @__PURE__ */ i("div", {
|
|
69
|
+
role: "region",
|
|
70
|
+
"aria-label": f?.label,
|
|
71
|
+
className: "ttw:min-h-[432px] ttw:min-w-0",
|
|
72
|
+
children: f?.content
|
|
21
73
|
})]
|
|
22
74
|
});
|
|
23
|
-
}
|
|
75
|
+
}
|
|
24
76
|
//#endregion
|
|
25
|
-
export {
|
|
77
|
+
export { o as WidgetSuiteShell };
|
package/package.json
CHANGED