@tesouro/embedded-components-react 0.2.264 → 0.2.267
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 +8 -6
- package/dist/experimental/WidgetSuite.d.ts +93 -2
- package/dist/experimental/WidgetSuite.js +5 -5
- package/dist/experimental/index.d.ts +93 -2
- package/dist/experimental/index.js +5 -5
- package/dist/index.css +45 -9
- package/dist/index.d.ts +29 -9
- package/dist/index.js +2 -2
- package/dist/lib/AcceptDisclosuresWidget.d.ts +17 -5
- package/dist/lib/AcceptDisclosuresWidget.js +1 -1
- package/dist/lib/BillPayWidget.js +1 -1
- package/dist/lib/WidgetProvider.d.ts +12 -4
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/data-access/dist/index2.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index3.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +36 -34
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/index.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/{index3.js → lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js} +3 -3
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/{index2.js → lib/AcceptDisclosuresWidget/labels.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +99 -7
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +7 -97
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +99 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +2 -41
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +43 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +1 -50
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +48 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +9 -5
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +8 -91
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +6 -2
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +7 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +100 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +6 -83
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +9 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +83 -6
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +2 -111
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +8 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +103 -16
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +25 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +37 -27
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +15 -116
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +126 -31
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +32 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +0 -3
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +34 -69
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +261 -181
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +32 -33
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +2 -2
- 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 +5 -5
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js +4 -15
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js +26 -91
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +87 -74
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +142 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index2.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/widget-suite/ui/dist/index3.js +49 -33
- package/package.json +1 -1
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index3.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
cards: "Cards",
|
|
6
|
-
transfers: "Transfers",
|
|
7
|
-
"bill-pay": "Bill Pay",
|
|
8
|
-
invoicing: "Invoicing",
|
|
9
|
-
expenses: "Expenses",
|
|
10
|
-
settings: "Settings"
|
|
11
|
-
}, t = { bankTagline: "Business Banking provided by {bankName}" }, n = {
|
|
12
|
-
creditCards: { title: "Credit cards" },
|
|
13
|
-
debitCards: { title: "Debit cards" },
|
|
14
|
-
expensePlaceholders: { expensesUnavailable: "Expenses are not available in this suite yet." }
|
|
15
|
-
};
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e ? e.disclosuresRequired === "REQUIRED" && !e.disclosuresAccepted : !1;
|
|
4
|
+
}
|
|
16
5
|
//#endregion
|
|
17
|
-
export {
|
|
6
|
+
export { e as needsDisclosureAcceptance };
|
|
@@ -1,97 +1,32 @@
|
|
|
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 { BillPayWidget as i } from "../../../bill-pay-widget/feature/dist/index28.js";
|
|
13
|
-
import "../../../bill-pay-widget/feature/dist/index.js";
|
|
14
|
-
import { CardsWidget as a } from "../../../cards-widget/feature/dist/index8.js";
|
|
15
|
-
import "../../../cards-widget/feature/dist/index.js";
|
|
16
|
-
import { BalancesWidget as o } from "../../../balances-widget/feature/dist/index5.js";
|
|
17
|
-
import "../../../balances-widget/feature/dist/index.js";
|
|
18
|
-
import { InsightsWidget as s } from "../../../insights-widget/feature/dist/index11.js";
|
|
19
|
-
import "../../../insights-widget/feature/dist/index.js";
|
|
20
|
-
import { InvoicingWidget as c } from "../../../invoicing-widget/feature/dist/index3.js";
|
|
21
|
-
import "../../../invoicing-widget/feature/dist/index.js";
|
|
22
|
-
import { SettingsWidget as l } from "../../../settings-widget/feature/dist/index6.js";
|
|
23
|
-
import "../../../settings-widget/feature/dist/index.js";
|
|
24
|
-
import { TransfersWidget as u } from "../../../transfers-widget/feature/dist/index6.js";
|
|
25
|
-
import "../../../transfers-widget/feature/dist/index.js";
|
|
26
|
-
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
27
1
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index4.js
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
m.Invoicing,
|
|
47
|
-
m.Expenses,
|
|
48
|
-
m.Settings
|
|
49
|
-
], g = {
|
|
50
|
-
[m.Dashboard]: { render: ({ grantedScopes: n }) => {
|
|
51
|
-
let r = e(n, [t.BankAccountReadOrg]);
|
|
52
|
-
return /* @__PURE__ */ f("div", {
|
|
53
|
-
className: r ? "ttw:grid ttw:gap-4 ttw:md:grid-cols-2" : "ttw:grid ttw:gap-4",
|
|
54
|
-
children: [r && /* @__PURE__ */ d(o, {}), /* @__PURE__ */ d(s, {})]
|
|
55
|
-
});
|
|
56
|
-
} },
|
|
57
|
-
[m.Accounts]: {
|
|
58
|
-
anyOfScopes: [t.BankAccountReadOrg, t.ExternalBankAccountReadOrg],
|
|
59
|
-
rendersOwnTitle: !0,
|
|
60
|
-
render: () => /* @__PURE__ */ d(r, {})
|
|
2
|
+
var e = {
|
|
3
|
+
dashboard: "Dashboard",
|
|
4
|
+
accounts: "Accounts",
|
|
5
|
+
cards: "Cards",
|
|
6
|
+
transfers: "Transfers",
|
|
7
|
+
"bill-pay": "Bill Pay",
|
|
8
|
+
invoicing: "Invoicing",
|
|
9
|
+
expenses: "Expenses",
|
|
10
|
+
settings: "Settings"
|
|
11
|
+
}, t = { bankTagline: "Business Banking provided by {bankName}" }, n = {
|
|
12
|
+
creditCards: { title: "Credit cards" },
|
|
13
|
+
debitCards: { title: "Debit cards" },
|
|
14
|
+
expensePlaceholders: { expensesUnavailable: "Expenses are not available in this suite yet." }
|
|
15
|
+
}, r = {
|
|
16
|
+
initFailedState: {
|
|
17
|
+
title: "We couldn't load this page",
|
|
18
|
+
body: "Please try again.",
|
|
19
|
+
retryButton: "Try again"
|
|
61
20
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
children: [e(r, [t.CreditCardReadOrg]) && /* @__PURE__ */ d(a, {
|
|
67
|
-
cardProgram: n.Credit,
|
|
68
|
-
labels: i.creditCards
|
|
69
|
-
}), e(r, [t.DebitCardReadOrg]) && /* @__PURE__ */ d(a, {
|
|
70
|
-
cardProgram: n.Debit,
|
|
71
|
-
labels: i.debitCards
|
|
72
|
-
})]
|
|
73
|
-
})
|
|
21
|
+
refreshFailedState: {
|
|
22
|
+
title: "We couldn't finish loading this page",
|
|
23
|
+
body: "Your disclosure acceptance was saved, so you won't need to accept again.",
|
|
24
|
+
retryButton: "Try again"
|
|
74
25
|
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
[m.BillPay]: {
|
|
80
|
-
anyOfScopes: [t.PayableReadOrg],
|
|
81
|
-
render: () => /* @__PURE__ */ d(i, {})
|
|
82
|
-
},
|
|
83
|
-
[m.Invoicing]: {
|
|
84
|
-
anyOfScopes: [t.InvoiceReadOrg],
|
|
85
|
-
render: () => /* @__PURE__ */ d(c, {})
|
|
86
|
-
},
|
|
87
|
-
[m.Expenses]: {
|
|
88
|
-
anyOfScopes: [t.ExpenseReadOrg, t.ExpenseReadSelf],
|
|
89
|
-
render: ({ labels: e }) => /* @__PURE__ */ d(p, { children: e.expensePlaceholders.expensesUnavailable })
|
|
90
|
-
},
|
|
91
|
-
[m.Settings]: {
|
|
92
|
-
rendersOwnTitle: !0,
|
|
93
|
-
render: () => /* @__PURE__ */ d(l, {})
|
|
26
|
+
unavailableState: {
|
|
27
|
+
title: "This account needs to accept disclosures",
|
|
28
|
+
body: "The documents are not available right now. Please contact support to continue."
|
|
94
29
|
}
|
|
95
30
|
};
|
|
96
31
|
//#endregion
|
|
97
|
-
export {
|
|
32
|
+
export { n as WIDGET_SUITE_CONTENT_LABELS_EN, r as WIDGET_SUITE_DISCLOSURE_LABELS_EN, e as WIDGET_SUITE_SECTION_LABELS_EN, t as WIDGET_SUITE_SECTION_TITLE_LABELS_EN };
|
|
@@ -3,82 +3,95 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
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";
|
|
6
7
|
import "../../../shared/data-access/dist/index.js";
|
|
7
|
-
import {
|
|
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";
|
|
8
|
+
import { CardProgram as n } from "../../../shared/feature/dist/lib/card/cardProgram.js";
|
|
10
9
|
import "../../../shared/feature/dist/index.js";
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
16
|
-
import "
|
|
17
|
-
import {
|
|
18
|
-
import
|
|
10
|
+
import { BankAccountsWidget as r } from "../../../bank-accounts-widget/feature/dist/index8.js";
|
|
11
|
+
import "../../../bank-accounts-widget/feature/dist/index.js";
|
|
12
|
+
import { BillPayWidget as i } from "../../../bill-pay-widget/feature/dist/index30.js";
|
|
13
|
+
import "../../../bill-pay-widget/feature/dist/index.js";
|
|
14
|
+
import { CardsWidget as a } from "../../../cards-widget/feature/dist/index8.js";
|
|
15
|
+
import "../../../cards-widget/feature/dist/index.js";
|
|
16
|
+
import { BalancesWidget as o } from "../../../balances-widget/feature/dist/index5.js";
|
|
17
|
+
import "../../../balances-widget/feature/dist/index.js";
|
|
18
|
+
import { InsightsWidget as s } from "../../../insights-widget/feature/dist/index11.js";
|
|
19
|
+
import "../../../insights-widget/feature/dist/index.js";
|
|
20
|
+
import { InvoicingWidget as c } from "../../../invoicing-widget/feature/dist/index3.js";
|
|
21
|
+
import "../../../invoicing-widget/feature/dist/index.js";
|
|
22
|
+
import { SettingsWidget as l } from "../../../settings-widget/feature/dist/index6.js";
|
|
23
|
+
import "../../../settings-widget/feature/dist/index.js";
|
|
24
|
+
import { TransfersWidget as u } from "../../../transfers-widget/feature/dist/index6.js";
|
|
25
|
+
import "../../../transfers-widget/feature/dist/index.js";
|
|
26
|
+
import { jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
19
27
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
let r = C[t], i = n.render({
|
|
48
|
-
grantedScopes: T,
|
|
49
|
-
labels: E
|
|
28
|
+
var p = ({ children: e }) => /* @__PURE__ */ d("div", {
|
|
29
|
+
className: "ttw:rounded-md ttw:border ttw:border-dashed ttw:border-border ttw:p-8 ttw:text-sm ttw:text-muted-foreground",
|
|
30
|
+
children: e
|
|
31
|
+
}), m = {
|
|
32
|
+
Dashboard: "dashboard",
|
|
33
|
+
Accounts: "accounts",
|
|
34
|
+
Cards: "cards",
|
|
35
|
+
Transfers: "transfers",
|
|
36
|
+
BillPay: "bill-pay",
|
|
37
|
+
Invoicing: "invoicing",
|
|
38
|
+
Expenses: "expenses",
|
|
39
|
+
Settings: "settings"
|
|
40
|
+
}, h = [
|
|
41
|
+
m.Dashboard,
|
|
42
|
+
m.Accounts,
|
|
43
|
+
m.Cards,
|
|
44
|
+
m.Transfers,
|
|
45
|
+
m.BillPay,
|
|
46
|
+
m.Invoicing,
|
|
47
|
+
m.Expenses,
|
|
48
|
+
m.Settings
|
|
49
|
+
], g = {
|
|
50
|
+
[m.Dashboard]: { render: ({ grantedScopes: n }) => {
|
|
51
|
+
let r = e(n, [t.BankAccountReadOrg]);
|
|
52
|
+
return /* @__PURE__ */ f("div", {
|
|
53
|
+
className: r ? "ttw:grid ttw:gap-4 ttw:md:grid-cols-2" : "ttw:grid ttw:gap-4",
|
|
54
|
+
children: [r && /* @__PURE__ */ d(o, {}), /* @__PURE__ */ d(s, {})]
|
|
50
55
|
});
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
|
|
56
|
+
} },
|
|
57
|
+
[m.Accounts]: {
|
|
58
|
+
anyOfScopes: [t.BankAccountReadOrg, t.ExternalBankAccountReadOrg],
|
|
59
|
+
rendersOwnTitle: !0,
|
|
60
|
+
render: () => /* @__PURE__ */ d(r, {})
|
|
61
|
+
},
|
|
62
|
+
[m.Cards]: {
|
|
63
|
+
anyOfScopes: [t.CreditCardReadOrg, t.DebitCardReadOrg],
|
|
64
|
+
render: ({ grantedScopes: r, labels: i }) => /* @__PURE__ */ f("div", {
|
|
65
|
+
className: "ttw:grid ttw:gap-8",
|
|
66
|
+
children: [e(r, [t.CreditCardReadOrg]) && /* @__PURE__ */ d(a, {
|
|
67
|
+
cardProgram: n.Credit,
|
|
68
|
+
labels: i.creditCards
|
|
69
|
+
}), e(r, [t.DebitCardReadOrg]) && /* @__PURE__ */ d(a, {
|
|
70
|
+
cardProgram: n.Debit,
|
|
71
|
+
labels: i.debitCards
|
|
72
|
+
})]
|
|
73
|
+
})
|
|
74
|
+
},
|
|
75
|
+
[m.Transfers]: {
|
|
76
|
+
anyOfScopes: [t.BankAccountReadOrg],
|
|
77
|
+
render: () => /* @__PURE__ */ d(u, {})
|
|
78
|
+
},
|
|
79
|
+
[m.BillPay]: {
|
|
80
|
+
anyOfScopes: [t.PayableReadOrg],
|
|
81
|
+
render: () => /* @__PURE__ */ d(i, {})
|
|
82
|
+
},
|
|
83
|
+
[m.Invoicing]: {
|
|
84
|
+
anyOfScopes: [t.InvoiceReadOrg],
|
|
85
|
+
render: () => /* @__PURE__ */ d(c, {})
|
|
86
|
+
},
|
|
87
|
+
[m.Expenses]: {
|
|
88
|
+
anyOfScopes: [t.ExpenseReadOrg, t.ExpenseReadSelf],
|
|
89
|
+
render: ({ labels: e }) => /* @__PURE__ */ d(p, { children: e.expensePlaceholders.expensesUnavailable })
|
|
90
|
+
},
|
|
91
|
+
[m.Settings]: {
|
|
92
|
+
rendersOwnTitle: !0,
|
|
93
|
+
render: () => /* @__PURE__ */ d(l, {})
|
|
94
|
+
}
|
|
95
|
+
};
|
|
83
96
|
//#endregion
|
|
84
|
-
export {
|
|
97
|
+
export { h as WIDGET_SUITE_DEFAULT_SECTIONS, g as WIDGET_SUITE_SECTIONS, m as WidgetSuiteSectionId };
|
|
@@ -0,0 +1,142 @@
|
|
|
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 { ErrorState as t } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
8
|
+
import "../../../shared/ui/dist/index.js";
|
|
9
|
+
import { useAnalyticsTrack as n } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
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/index4.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 { WIDGET_SUITE_SECTIONS as p } from "./index5.js";
|
|
17
|
+
import { WIDGET_NAME as m, WidgetSuiteAnalyticsEvent as h } from "./index2.js";
|
|
18
|
+
import { needsDisclosureAcceptance as g } from "./index3.js";
|
|
19
|
+
import { WidgetSuiteShell as _ } from "../../ui/dist/index3.js";
|
|
20
|
+
import { SectionPageTitle as v } from "../../ui/dist/index4.js";
|
|
21
|
+
import "../../ui/dist/index.js";
|
|
22
|
+
import { useCallback as y, useEffect as b, useMemo as x, useState as S } from "react";
|
|
23
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
24
|
+
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js
|
|
25
|
+
var E = {
|
|
26
|
+
initFailed: "widget-suite-init-failed",
|
|
27
|
+
disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed",
|
|
28
|
+
disclosuresUnavailable: "widget-suite-disclosures-unavailable"
|
|
29
|
+
};
|
|
30
|
+
function D({ sections: r, disclosureLinks: m, labels: D, sectionLabels: O, sectionTitleLabels: k, contentLabels: A, disclosureLabels: j, showSectionTitle: M = !0 }) {
|
|
31
|
+
let N = n();
|
|
32
|
+
b(() => {
|
|
33
|
+
N(h.Mounted);
|
|
34
|
+
}, [N]);
|
|
35
|
+
let P = {
|
|
36
|
+
...d,
|
|
37
|
+
...O
|
|
38
|
+
}, { initResponse: F } = a(), I = o(), L = s(), R = F?.scopes, z = x(() => ({
|
|
39
|
+
creditCards: {
|
|
40
|
+
...l.creditCards,
|
|
41
|
+
...A?.creditCards
|
|
42
|
+
},
|
|
43
|
+
debitCards: {
|
|
44
|
+
...l.debitCards,
|
|
45
|
+
...A?.debitCards
|
|
46
|
+
},
|
|
47
|
+
expensePlaceholders: {
|
|
48
|
+
...l.expensePlaceholders,
|
|
49
|
+
...A?.expensePlaceholders
|
|
50
|
+
}
|
|
51
|
+
}), [A]), [B, V] = S(r[0] ?? ""), H = i(), [U, W] = S(!1), G = y(() => W(!0), []), K = g(F), q = {
|
|
52
|
+
...u,
|
|
53
|
+
...j,
|
|
54
|
+
initFailedState: {
|
|
55
|
+
...u.initFailedState,
|
|
56
|
+
...j?.initFailedState
|
|
57
|
+
},
|
|
58
|
+
refreshFailedState: {
|
|
59
|
+
...u.refreshFailedState,
|
|
60
|
+
...j?.refreshFailedState
|
|
61
|
+
},
|
|
62
|
+
unavailableState: {
|
|
63
|
+
...u.unavailableState,
|
|
64
|
+
...j?.unavailableState
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
b(() => {
|
|
68
|
+
!K && U && W(!1);
|
|
69
|
+
}, [U, K]);
|
|
70
|
+
let J = !!(F && L);
|
|
71
|
+
if (!F && !I || J && !I) return /* @__PURE__ */ w(_, {
|
|
72
|
+
isLoading: !0,
|
|
73
|
+
sections: [],
|
|
74
|
+
selectedSectionId: "",
|
|
75
|
+
onSectionChange: V,
|
|
76
|
+
labels: D
|
|
77
|
+
});
|
|
78
|
+
if ((!F || J) && I) return /* @__PURE__ */ w(t, {
|
|
79
|
+
title: q.initFailedState.title,
|
|
80
|
+
description: q.initFailedState.body,
|
|
81
|
+
retryLabel: q.initFailedState.retryButton,
|
|
82
|
+
onRetry: H,
|
|
83
|
+
testId: E.initFailed
|
|
84
|
+
});
|
|
85
|
+
if (K) return U && I ? /* @__PURE__ */ w(t, {
|
|
86
|
+
title: q.refreshFailedState.title,
|
|
87
|
+
description: q.refreshFailedState.body,
|
|
88
|
+
retryLabel: q.refreshFailedState.retryButton,
|
|
89
|
+
onRetry: H,
|
|
90
|
+
testId: E.disclosuresRefreshFailed
|
|
91
|
+
}) : m ? /* @__PURE__ */ w(c, {
|
|
92
|
+
disclosureLinks: m,
|
|
93
|
+
onAccepted: G
|
|
94
|
+
}) : /* @__PURE__ */ w(t, {
|
|
95
|
+
title: q.unavailableState.title,
|
|
96
|
+
description: q.unavailableState.body,
|
|
97
|
+
testId: E.disclosuresUnavailable
|
|
98
|
+
});
|
|
99
|
+
let Y = F?.bankName?.trim(), X = Y ? {
|
|
100
|
+
...f,
|
|
101
|
+
...k
|
|
102
|
+
}.bankTagline.replaceAll("{bankName}", Y) : void 0, Z = r.flatMap((t) => {
|
|
103
|
+
let n = p[t];
|
|
104
|
+
if (!n || n.anyOfScopes && !e(R, n.anyOfScopes)) return [];
|
|
105
|
+
let r = P[t], i = n.render({
|
|
106
|
+
grantedScopes: R,
|
|
107
|
+
labels: z
|
|
108
|
+
});
|
|
109
|
+
return [{
|
|
110
|
+
id: t,
|
|
111
|
+
label: r,
|
|
112
|
+
content: M && !n.rendersOwnTitle ? /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(v, {
|
|
113
|
+
title: r,
|
|
114
|
+
bankTagline: X
|
|
115
|
+
}), i] }) : i
|
|
116
|
+
}];
|
|
117
|
+
}), Q = Z.some((e) => e.id === B) ? B : Z[0]?.id ?? "";
|
|
118
|
+
return /* @__PURE__ */ w(_, {
|
|
119
|
+
sections: Z,
|
|
120
|
+
selectedSectionId: Q,
|
|
121
|
+
onSectionChange: V,
|
|
122
|
+
labels: D
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function O({ baseUrl: e, widgetToken: t, organizationId: n, configClient: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, ...d }) {
|
|
126
|
+
return /* @__PURE__ */ w(r, {
|
|
127
|
+
widgetName: m,
|
|
128
|
+
baseUrl: e,
|
|
129
|
+
widgetToken: t,
|
|
130
|
+
organizationId: n,
|
|
131
|
+
configClient: i,
|
|
132
|
+
linkComponent: a,
|
|
133
|
+
implementation: o,
|
|
134
|
+
uiFramework: s,
|
|
135
|
+
errorFallback: c,
|
|
136
|
+
onError: l,
|
|
137
|
+
analytics: u,
|
|
138
|
+
children: /* @__PURE__ */ w(D, { ...d })
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
export { E as WIDGET_SUITE_TEST_IDS, O as WidgetSuite, O as default };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/ui/dist/index2.js
|
|
2
2
|
var e = {
|
|
3
3
|
navAriaLabel: "Sections",
|
|
4
|
+
loadingAriaLabel: "Loading sections",
|
|
4
5
|
emptyState: {
|
|
5
6
|
title: "Nothing available here",
|
|
6
7
|
body: "This account doesn't have access to any of this page's sections."
|
|
@@ -2,21 +2,26 @@
|
|
|
2
2
|
"use client";
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
|
-
import {
|
|
6
|
-
import { WIDGET_SUITE_SHELL_LABELS_EN as
|
|
7
|
-
import { useRef as
|
|
8
|
-
import { jsx as
|
|
5
|
+
import { Skeleton as e, Typography as t, cn as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
+
import { WIDGET_SUITE_SHELL_LABELS_EN as r } from "./index2.js";
|
|
7
|
+
import { useRef as i } from "react";
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var s = [
|
|
11
|
+
"first",
|
|
12
|
+
"second",
|
|
13
|
+
"third"
|
|
14
|
+
];
|
|
15
|
+
function c({ sections: c, selectedSectionId: l, onSectionChange: u, isLoading: d = !1, labels: f }) {
|
|
16
|
+
let p = {
|
|
17
|
+
...r,
|
|
18
|
+
...f,
|
|
14
19
|
emptyState: {
|
|
15
|
-
...
|
|
16
|
-
...
|
|
20
|
+
...r.emptyState,
|
|
21
|
+
...f?.emptyState
|
|
17
22
|
}
|
|
18
|
-
},
|
|
19
|
-
let n =
|
|
23
|
+
}, m = i([]), h = c.find((e) => e.id === l), g = (e, t) => {
|
|
24
|
+
let n = c.length - 1, r;
|
|
20
25
|
switch (e.key) {
|
|
21
26
|
case "ArrowRight":
|
|
22
27
|
r = t === n ? 0 : t + 1;
|
|
@@ -32,46 +37,57 @@ function o({ sections: o, selectedSectionId: s, onSectionChange: c, labels: l })
|
|
|
32
37
|
break;
|
|
33
38
|
default: return;
|
|
34
39
|
}
|
|
35
|
-
e.preventDefault(),
|
|
40
|
+
e.preventDefault(), m.current[r]?.focus();
|
|
36
41
|
};
|
|
37
|
-
return
|
|
42
|
+
return d ? /* @__PURE__ */ o("section", {
|
|
43
|
+
"aria-busy": "true",
|
|
44
|
+
"aria-label": p.loadingAriaLabel,
|
|
45
|
+
className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-6",
|
|
46
|
+
children: [/* @__PURE__ */ a("div", {
|
|
47
|
+
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-1 ttw:border-b ttw:border-border",
|
|
48
|
+
children: s.map((t) => /* @__PURE__ */ a("div", {
|
|
49
|
+
className: "ttw:px-4 ttw:py-2.5",
|
|
50
|
+
children: /* @__PURE__ */ a(e, { className: "ttw:h-5 ttw:w-20" })
|
|
51
|
+
}, t))
|
|
52
|
+
}), /* @__PURE__ */ a("div", { className: "ttw:min-h-[432px] ttw:min-w-0" })]
|
|
53
|
+
}) : c.length === 0 ? /* @__PURE__ */ o("section", {
|
|
38
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",
|
|
39
|
-
children: [/* @__PURE__ */
|
|
55
|
+
children: [/* @__PURE__ */ a(t, {
|
|
40
56
|
variant: "h5",
|
|
41
|
-
children:
|
|
42
|
-
}), /* @__PURE__ */
|
|
57
|
+
children: p.emptyState.title
|
|
58
|
+
}), /* @__PURE__ */ a(t, {
|
|
43
59
|
variant: "body2",
|
|
44
60
|
color: "muted",
|
|
45
|
-
children:
|
|
61
|
+
children: p.emptyState.body
|
|
46
62
|
})]
|
|
47
|
-
}) : /* @__PURE__ */
|
|
63
|
+
}) : /* @__PURE__ */ o("section", {
|
|
48
64
|
className: "ttw:flex ttw:w-full ttw:flex-col ttw:gap-6",
|
|
49
|
-
children: [/* @__PURE__ */
|
|
50
|
-
"aria-label":
|
|
51
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: [/* @__PURE__ */ a("nav", {
|
|
66
|
+
"aria-label": p.navAriaLabel,
|
|
67
|
+
children: /* @__PURE__ */ a("ul", {
|
|
52
68
|
className: "ttw:flex ttw:flex-wrap ttw:items-center ttw:gap-1 ttw:border-b ttw:border-border",
|
|
53
|
-
children:
|
|
54
|
-
let r = e.id ===
|
|
55
|
-
return /* @__PURE__ */
|
|
69
|
+
children: c.map((e, t) => {
|
|
70
|
+
let r = e.id === l;
|
|
71
|
+
return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ a("button", {
|
|
56
72
|
type: "button",
|
|
57
73
|
ref: (e) => {
|
|
58
|
-
|
|
74
|
+
m.current[t] = e;
|
|
59
75
|
},
|
|
60
76
|
"aria-current": r ? "page" : void 0,
|
|
61
|
-
onClick: () =>
|
|
62
|
-
onKeyDown: (e) =>
|
|
63
|
-
className:
|
|
77
|
+
onClick: () => u(e.id),
|
|
78
|
+
onKeyDown: (e) => g(e, t),
|
|
79
|
+
className: n("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
80
|
children: e.label
|
|
65
81
|
}) }, e.id);
|
|
66
82
|
})
|
|
67
83
|
})
|
|
68
|
-
}), /* @__PURE__ */
|
|
84
|
+
}), /* @__PURE__ */ a("div", {
|
|
69
85
|
role: "region",
|
|
70
|
-
"aria-label":
|
|
86
|
+
"aria-label": h?.label,
|
|
71
87
|
className: "ttw:min-h-[432px] ttw:min-w-0",
|
|
72
|
-
children:
|
|
88
|
+
children: h?.content
|
|
73
89
|
})]
|
|
74
90
|
});
|
|
75
91
|
}
|
|
76
92
|
//#endregion
|
|
77
|
-
export {
|
|
93
|
+
export { c as WidgetSuiteShell };
|