@burdenoff/microfe-brainyrich 2026.525.1 → 2026.706.1
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/brainyrich/BrainyRichRoot.js +55 -90
- package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.js +15 -35
- package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
- package/dist/brainyrich/components/ActorName.js +38 -0
- package/dist/brainyrich/components/ActorName.js.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.js +25 -0
- package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
- package/dist/brainyrich/components/LoadMore.js +24 -0
- package/dist/brainyrich/components/LoadMore.js.map +1 -0
- package/dist/brainyrich/components/index.js +5 -0
- package/dist/brainyrich/components/notify.js +38 -0
- package/dist/brainyrich/components/notify.js.map +1 -0
- package/dist/brainyrich/components/pickers.js +232 -0
- package/dist/brainyrich/components/pickers.js.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
- package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.js +206 -0
- package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
- package/dist/brainyrich/components/reuse/transport.js +24 -0
- package/dist/brainyrich/components/reuse/transport.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +815 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
- package/dist/brainyrich/index.js +0 -1
- package/dist/brainyrich/pages/AccountsPage.js +743 -160
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +556 -363
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +601 -268
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +375 -231
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +599 -337
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +810 -141
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js +410 -311
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +867 -156
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +421 -251
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +557 -194
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +655 -221
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js +222 -41
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/index.js +2 -3
- package/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +3 -2
- package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
- package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
- package/dist/brainyrich/pages/AssistantPage.js +0 -332
- package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
- package/dist/brainyrich/pages/EstatePage.js +0 -269
- package/dist/brainyrich/pages/EstatePage.js.map +0 -1
- package/dist/brainyrich/pages/InsurancePage.js +0 -181
- package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
- package/dist/brainyrich/pages/MarketplacePage.js +0 -450
- package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
- package/dist/brainyrich/store/brainyrichStore.js +0 -272
- package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
|
@@ -1,161 +1,126 @@
|
|
|
1
1
|
import { BrainyRichProvider as e } from "./providers/BrainyRichProvider.js";
|
|
2
2
|
import { tWithFallback as t } from "./utils/i18n.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { joinPath as n } from "./utils/navigation.js";
|
|
4
|
+
import { BrainyRichRoutes as r } from "./BrainyRichRoutes.js";
|
|
5
5
|
import { useEffect as i } from "react";
|
|
6
|
-
import { BarChart3 as a, Bot as o, Briefcase as s, Calculator as c, FileBarChart as l,
|
|
7
|
-
import { useI18n as
|
|
8
|
-
import { jsx as
|
|
9
|
-
import { FeatureFlagProvider as
|
|
6
|
+
import { BarChart3 as a, Bot as o, Briefcase as s, Calculator as c, FileBarChart as l, Landmark as u, LayoutDashboard as d, ShieldAlert as f, Target as p, TrendingUp as m, UsersRound as h } from "lucide-react";
|
|
7
|
+
import { useI18n as g } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
8
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
9
|
+
import { FeatureFlagProvider as v } from "@burdenoff/fe-libs/shared/feature-flags";
|
|
10
10
|
//#region src/brainyrich/BrainyRichRoot.tsx
|
|
11
|
-
var
|
|
12
|
-
let { registerNavItems:
|
|
11
|
+
var y = (y) => {
|
|
12
|
+
let { registerNavItems: b, registerFooterItems: x, basePath: S = "/" } = y, { t: C } = g(), w = (e, n) => t(C, e, n);
|
|
13
13
|
return i(() => {
|
|
14
|
-
if (
|
|
14
|
+
if (b) return b({
|
|
15
15
|
id: "brainyrich",
|
|
16
|
-
label:
|
|
17
|
-
path:
|
|
18
|
-
icon: /* @__PURE__ */
|
|
16
|
+
label: w("brainyrich.nav.root", "BrainyRich"),
|
|
17
|
+
path: S,
|
|
18
|
+
icon: /* @__PURE__ */ _(d, { size: 20 }),
|
|
19
19
|
order: 80,
|
|
20
20
|
group: "products",
|
|
21
21
|
children: [
|
|
22
22
|
{
|
|
23
23
|
id: "brainyrich-dashboard",
|
|
24
|
-
label:
|
|
25
|
-
path:
|
|
26
|
-
icon: /* @__PURE__ */
|
|
24
|
+
label: w("brainyrich.nav.dashboard", "Dashboard"),
|
|
25
|
+
path: S,
|
|
26
|
+
icon: /* @__PURE__ */ _(d, { size: 16 }),
|
|
27
27
|
order: 0
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
id: "brainyrich-portfolios",
|
|
31
|
-
label:
|
|
32
|
-
path:
|
|
33
|
-
icon: /* @__PURE__ */
|
|
31
|
+
label: w("brainyrich.nav.portfolios", "Portfolios"),
|
|
32
|
+
path: n(S, "portfolios"),
|
|
33
|
+
icon: /* @__PURE__ */ _(s, { size: 16 }),
|
|
34
34
|
order: 10
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
id: "brainyrich-investments",
|
|
38
|
-
label:
|
|
39
|
-
path:
|
|
40
|
-
icon: /* @__PURE__ */
|
|
38
|
+
label: w("brainyrich.nav.investments", "Investments"),
|
|
39
|
+
path: n(S, "investments"),
|
|
40
|
+
icon: /* @__PURE__ */ _(m, { size: 16 }),
|
|
41
41
|
order: 11
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
id: "brainyrich-goals",
|
|
45
|
-
label:
|
|
46
|
-
path:
|
|
47
|
-
icon: /* @__PURE__ */
|
|
45
|
+
label: w("brainyrich.nav.goals", "Goals"),
|
|
46
|
+
path: n(S, "goals"),
|
|
47
|
+
icon: /* @__PURE__ */ _(p, { size: 16 }),
|
|
48
48
|
order: 12
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
id: "brainyrich-accounts",
|
|
52
|
-
label:
|
|
53
|
-
path:
|
|
54
|
-
icon: /* @__PURE__ */
|
|
52
|
+
label: w("brainyrich.nav.accounts", "Accounts"),
|
|
53
|
+
path: n(S, "accounts"),
|
|
54
|
+
icon: /* @__PURE__ */ _(u, { size: 16 }),
|
|
55
55
|
order: 13
|
|
56
56
|
},
|
|
57
|
-
{
|
|
58
|
-
id: "brainyrich-advisors",
|
|
59
|
-
label: k("brainyrich.nav.advisors", "Advisors"),
|
|
60
|
-
path: r(D, "advisors"),
|
|
61
|
-
icon: /* @__PURE__ */ S(y, { size: 16 }),
|
|
62
|
-
order: 20
|
|
63
|
-
},
|
|
64
57
|
{
|
|
65
58
|
id: "brainyrich-analytics",
|
|
66
|
-
label:
|
|
67
|
-
path:
|
|
68
|
-
icon: /* @__PURE__ */
|
|
59
|
+
label: w("brainyrich.nav.analytics", "Analytics"),
|
|
60
|
+
path: n(S, "analytics"),
|
|
61
|
+
icon: /* @__PURE__ */ _(a, { size: 16 }),
|
|
69
62
|
order: 21
|
|
70
63
|
},
|
|
71
64
|
{
|
|
72
65
|
id: "brainyrich-risk",
|
|
73
|
-
label:
|
|
74
|
-
path:
|
|
75
|
-
icon: /* @__PURE__ */
|
|
66
|
+
label: w("brainyrich.nav.risk", "Rebalancing"),
|
|
67
|
+
path: n(S, "risk"),
|
|
68
|
+
icon: /* @__PURE__ */ _(f, { size: 16 }),
|
|
76
69
|
order: 22
|
|
77
70
|
},
|
|
78
71
|
{
|
|
79
72
|
id: "brainyrich-tax",
|
|
80
|
-
label:
|
|
81
|
-
path:
|
|
82
|
-
icon: /* @__PURE__ */
|
|
73
|
+
label: w("brainyrich.nav.tax", "Tax"),
|
|
74
|
+
path: n(S, "tax"),
|
|
75
|
+
icon: /* @__PURE__ */ _(c, { size: 16 }),
|
|
83
76
|
order: 30
|
|
84
77
|
},
|
|
85
|
-
{
|
|
86
|
-
id: "brainyrich-insurance",
|
|
87
|
-
label: k("brainyrich.nav.insurance", "Insurance"),
|
|
88
|
-
path: r(D, "insurance"),
|
|
89
|
-
icon: /* @__PURE__ */ S(m, { size: 16 }),
|
|
90
|
-
order: 31
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
id: "brainyrich-estate",
|
|
94
|
-
label: k("brainyrich.nav.estate", "Estate"),
|
|
95
|
-
path: r(D, "estate"),
|
|
96
|
-
icon: /* @__PURE__ */ S(u, { size: 16 }),
|
|
97
|
-
order: 32
|
|
98
|
-
},
|
|
99
78
|
{
|
|
100
79
|
id: "brainyrich-family",
|
|
101
|
-
label:
|
|
102
|
-
path:
|
|
103
|
-
icon: /* @__PURE__ */
|
|
80
|
+
label: w("brainyrich.nav.family", "Households"),
|
|
81
|
+
path: n(S, "family"),
|
|
82
|
+
icon: /* @__PURE__ */ _(h, { size: 16 }),
|
|
104
83
|
order: 40
|
|
105
84
|
},
|
|
106
|
-
{
|
|
107
|
-
id: "brainyrich-marketplace",
|
|
108
|
-
label: k("brainyrich.nav.marketplace", "Marketplace"),
|
|
109
|
-
path: r(D, "marketplace"),
|
|
110
|
-
icon: /* @__PURE__ */ S(g, { size: 16 }),
|
|
111
|
-
order: 41
|
|
112
|
-
},
|
|
113
85
|
{
|
|
114
86
|
id: "brainyrich-reports",
|
|
115
|
-
label:
|
|
116
|
-
path:
|
|
117
|
-
icon: /* @__PURE__ */
|
|
87
|
+
label: w("brainyrich.nav.reports", "Reports"),
|
|
88
|
+
path: n(S, "reports"),
|
|
89
|
+
icon: /* @__PURE__ */ _(l, { size: 16 }),
|
|
118
90
|
order: 42
|
|
119
91
|
},
|
|
120
92
|
{
|
|
121
93
|
id: "brainyrich-ai-assistant",
|
|
122
|
-
label:
|
|
123
|
-
path:
|
|
124
|
-
icon: /* @__PURE__ */
|
|
94
|
+
label: w("brainyrich.nav.aiAssistant", "Insights"),
|
|
95
|
+
path: n(S, "ai-assistant"),
|
|
96
|
+
icon: /* @__PURE__ */ _(o, { size: 16 }),
|
|
125
97
|
order: 50
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
id: "brainyrich-assistant",
|
|
129
|
-
label: k("brainyrich.nav.assistant", "Assistant"),
|
|
130
|
-
path: r(D, "assistant"),
|
|
131
|
-
icon: /* @__PURE__ */ S(p, { size: 16 }),
|
|
132
|
-
order: 51
|
|
133
98
|
}
|
|
134
99
|
]
|
|
135
100
|
});
|
|
136
101
|
}, [
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
102
|
+
b,
|
|
103
|
+
S,
|
|
104
|
+
C
|
|
140
105
|
]), i(() => {
|
|
141
|
-
if (
|
|
106
|
+
if (x) return x([{
|
|
142
107
|
id: "brainyrich-status",
|
|
143
|
-
label:
|
|
108
|
+
label: w("brainyrich.footer.ready", "BrainyRich Ready"),
|
|
144
109
|
type: "status",
|
|
145
110
|
section: "left",
|
|
146
111
|
order: 10
|
|
147
112
|
}]);
|
|
148
|
-
}, [
|
|
113
|
+
}, [x, C]), /* @__PURE__ */ _(v, {
|
|
149
114
|
workspaceId: null,
|
|
150
115
|
gateway: "global",
|
|
151
116
|
defaultEnabled: !0,
|
|
152
|
-
children: /* @__PURE__ */
|
|
153
|
-
...
|
|
154
|
-
children: /* @__PURE__ */
|
|
117
|
+
children: /* @__PURE__ */ _(e, {
|
|
118
|
+
...y,
|
|
119
|
+
children: /* @__PURE__ */ _(r, {})
|
|
155
120
|
})
|
|
156
121
|
});
|
|
157
122
|
};
|
|
158
123
|
//#endregion
|
|
159
|
-
export {
|
|
124
|
+
export { y as BrainyRichRoot };
|
|
160
125
|
|
|
161
126
|
//# sourceMappingURL=BrainyRichRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrainyRichRoot.js","names":[],"sources":["../../src/brainyrich/BrainyRichRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n LayoutDashboard,\n Briefcase,\n TrendingUp,\n Target,\n Landmark,\n
|
|
1
|
+
{"version":3,"file":"BrainyRichRoot.js","names":[],"sources":["../../src/brainyrich/BrainyRichRoot.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect } from 'react';\nimport {\n LayoutDashboard,\n Briefcase,\n TrendingUp,\n Target,\n Landmark,\n BarChart3,\n ShieldAlert,\n Calculator,\n UsersRound,\n FileBarChart,\n Bot,\n} from 'lucide-react';\nimport { useI18n } from '@burdenoff/fe-libs/shared/providers/shell/I18nProvider';\nimport { BrainyRichProvider } from './providers/BrainyRichProvider';\nimport { FeatureFlagProvider } from '@burdenoff/fe-libs/shared/feature-flags';\nimport type { NavItem, BrainyRichRootProps } from './types';\nimport { tWithFallback } from './utils/i18n';\nimport { BrainyRichRoutes } from './BrainyRichRoutes';\nimport { joinPath } from './utils/navigation';\n\nexport const BrainyRichRoot: FC<BrainyRichRootProps> = (props) => {\n const { registerNavItems, registerFooterItems, basePath = '/' } = props;\n const { t } = useI18n();\n const translate = (key: string, fallback: string) => tWithFallback(t, key, fallback);\n\n useEffect(() => {\n if (!registerNavItems) return;\n const navItem: NavItem = {\n id: 'brainyrich',\n label: translate('brainyrich.nav.root', 'BrainyRich'),\n path: basePath,\n icon: <LayoutDashboard size={20} />,\n order: 80,\n group: 'products',\n children: [\n // Overview\n {\n id: 'brainyrich-dashboard',\n label: translate('brainyrich.nav.dashboard', 'Dashboard'),\n path: basePath,\n icon: <LayoutDashboard size={16} />,\n order: 0,\n },\n\n // Wealth Management\n {\n id: 'brainyrich-portfolios',\n label: translate('brainyrich.nav.portfolios', 'Portfolios'),\n path: joinPath(basePath, 'portfolios'),\n icon: <Briefcase size={16} />,\n order: 10,\n },\n {\n id: 'brainyrich-investments',\n label: translate('brainyrich.nav.investments', 'Investments'),\n path: joinPath(basePath, 'investments'),\n icon: <TrendingUp size={16} />,\n order: 11,\n },\n {\n id: 'brainyrich-goals',\n label: translate('brainyrich.nav.goals', 'Goals'),\n path: joinPath(basePath, 'goals'),\n icon: <Target size={16} />,\n order: 12,\n },\n {\n id: 'brainyrich-accounts',\n label: translate('brainyrich.nav.accounts', 'Accounts'),\n path: joinPath(basePath, 'accounts'),\n icon: <Landmark size={16} />,\n order: 13,\n },\n\n // Advisory & Insights\n {\n id: 'brainyrich-analytics',\n label: translate('brainyrich.nav.analytics', 'Analytics'),\n path: joinPath(basePath, 'analytics'),\n icon: <BarChart3 size={16} />,\n order: 21,\n },\n {\n id: 'brainyrich-risk',\n label: translate('brainyrich.nav.risk', 'Rebalancing'),\n path: joinPath(basePath, 'risk'),\n icon: <ShieldAlert size={16} />,\n order: 22,\n },\n\n // Tax\n {\n id: 'brainyrich-tax',\n label: translate('brainyrich.nav.tax', 'Tax'),\n path: joinPath(basePath, 'tax'),\n icon: <Calculator size={16} />,\n order: 30,\n },\n\n // Households & Reports\n {\n id: 'brainyrich-family',\n label: translate('brainyrich.nav.family', 'Households'),\n path: joinPath(basePath, 'family'),\n icon: <UsersRound size={16} />,\n order: 40,\n },\n {\n id: 'brainyrich-reports',\n label: translate('brainyrich.nav.reports', 'Reports'),\n path: joinPath(basePath, 'reports'),\n icon: <FileBarChart size={16} />,\n order: 42,\n },\n\n // Insights\n {\n id: 'brainyrich-ai-assistant',\n label: translate('brainyrich.nav.aiAssistant', 'Insights'),\n path: joinPath(basePath, 'ai-assistant'),\n icon: <Bot size={16} />,\n order: 50,\n },\n ],\n };\n return registerNavItems(navItem);\n }, [registerNavItems, basePath, t]);\n\n useEffect(() => {\n if (!registerFooterItems) return;\n return registerFooterItems([\n {\n id: 'brainyrich-status',\n label: translate('brainyrich.footer.ready', 'BrainyRich Ready'),\n type: 'status',\n section: 'left',\n order: 10,\n },\n ]);\n }, [registerFooterItems, t]);\n\n return (\n <FeatureFlagProvider workspaceId={null} gateway=\"global\" defaultEnabled={true}>\n <BrainyRichProvider {...props}>\n <BrainyRichRoutes />\n </BrainyRichProvider>\n </FeatureFlagProvider>\n );\n};\n"],"mappings":";;;;;;;;;;AAuBA,IAAa,KAA2C,MAAU;CAChE,IAAM,EAAE,qBAAkB,wBAAqB,cAAW,QAAQ,GAC5D,EAAE,SAAM,GAAS,EACjB,KAAa,GAAa,MAAqB,EAAc,GAAG,GAAK,EAAS;AAsHpF,QApHA,QAAgB;AACT,QAmGL,QAAO,EAlGkB;GACvB,IAAI;GACJ,OAAO,EAAU,uBAAuB,aAAa;GACrD,MAAM;GACN,MAAM,kBAAC,GAAD,EAAiB,MAAM,IAAM,CAAA;GACnC,OAAO;GACP,OAAO;GACP,UAAU;IAER;KACE,IAAI;KACJ,OAAO,EAAU,4BAA4B,YAAY;KACzD,MAAM;KACN,MAAM,kBAAC,GAAD,EAAiB,MAAM,IAAM,CAAA;KACnC,OAAO;KACR;IAGD;KACE,IAAI;KACJ,OAAO,EAAU,6BAA6B,aAAa;KAC3D,MAAM,EAAS,GAAU,aAAa;KACtC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAC7B,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAU,8BAA8B,cAAc;KAC7D,MAAM,EAAS,GAAU,cAAc;KACvC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;KAC9B,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAU,wBAAwB,QAAQ;KACjD,MAAM,EAAS,GAAU,QAAQ;KACjC,MAAM,kBAAC,GAAD,EAAQ,MAAM,IAAM,CAAA;KAC1B,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAU,2BAA2B,WAAW;KACvD,MAAM,EAAS,GAAU,WAAW;KACpC,MAAM,kBAAC,GAAD,EAAU,MAAM,IAAM,CAAA;KAC5B,OAAO;KACR;IAGD;KACE,IAAI;KACJ,OAAO,EAAU,4BAA4B,YAAY;KACzD,MAAM,EAAS,GAAU,YAAY;KACrC,MAAM,kBAAC,GAAD,EAAW,MAAM,IAAM,CAAA;KAC7B,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAU,uBAAuB,cAAc;KACtD,MAAM,EAAS,GAAU,OAAO;KAChC,MAAM,kBAAC,GAAD,EAAa,MAAM,IAAM,CAAA;KAC/B,OAAO;KACR;IAGD;KACE,IAAI;KACJ,OAAO,EAAU,sBAAsB,MAAM;KAC7C,MAAM,EAAS,GAAU,MAAM;KAC/B,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;KAC9B,OAAO;KACR;IAGD;KACE,IAAI;KACJ,OAAO,EAAU,yBAAyB,aAAa;KACvD,MAAM,EAAS,GAAU,SAAS;KAClC,MAAM,kBAAC,GAAD,EAAY,MAAM,IAAM,CAAA;KAC9B,OAAO;KACR;IACD;KACE,IAAI;KACJ,OAAO,EAAU,0BAA0B,UAAU;KACrD,MAAM,EAAS,GAAU,UAAU;KACnC,MAAM,kBAAC,GAAD,EAAc,MAAM,IAAM,CAAA;KAChC,OAAO;KACR;IAGD;KACE,IAAI;KACJ,OAAO,EAAU,8BAA8B,WAAW;KAC1D,MAAM,EAAS,GAAU,eAAe;KACxC,MAAM,kBAAC,GAAD,EAAK,MAAM,IAAM,CAAA;KACvB,OAAO;KACR;IACF;GACF,CAC+B;IAC/B;EAAC;EAAkB;EAAU;EAAE,CAAC,EAEnC,QAAgB;AACT,QACL,QAAO,EAAoB,CACzB;GACE,IAAI;GACJ,OAAO,EAAU,2BAA2B,mBAAmB;GAC/D,MAAM;GACN,SAAS;GACT,OAAO;GACR,CACF,CAAC;IACD,CAAC,GAAqB,EAAE,CAAC,EAG1B,kBAAC,GAAD;EAAqB,aAAa;EAAM,SAAQ;EAAS,gBAAgB;YACvE,kBAAC,GAAD;GAAoB,GAAI;aACtB,kBAAC,GAAD,EAAoB,CAAA;GACD,CAAA;EACD,CAAA"}
|
|
@@ -4,80 +4,60 @@ import { Loader2 as r } from "lucide-react";
|
|
|
4
4
|
import { Navigate as i, Route as a, Routes as o } from "react-router-dom";
|
|
5
5
|
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
6
6
|
//#region src/brainyrich/BrainyRichRoutes.tsx
|
|
7
|
-
var l = n(() => import("./pages/
|
|
8
|
-
function
|
|
7
|
+
var l = n(() => import("./pages/AiAssistantPage.js").then((e) => ({ default: e.AiAssistantPage }))), u = n(() => import("./pages/AnalyticsPage.js").then((e) => ({ default: e.AnalyticsPage }))), d = n(() => import("./pages/AccountsPage.js").then((e) => ({ default: e.AccountsPage }))), f = n(() => import("./pages/FamilyPage.js").then((e) => ({ default: e.FamilyPage }))), p = n(() => import("./pages/GoalsPage.js").then((e) => ({ default: e.GoalsPage }))), m = n(() => import("./pages/InvestmentsPage.js").then((e) => ({ default: e.InvestmentsPage }))), h = n(() => import("./pages/PortfoliosPage.js").then((e) => ({ default: e.PortfoliosPage }))), g = n(() => import("./pages/ReportsPage.js").then((e) => ({ default: e.ReportsPage }))), _ = n(() => import("./pages/RiskPage.js").then((e) => ({ default: e.RiskPage }))), v = n(() => import("./pages/TaxPage.js").then((e) => ({ default: e.TaxPage })));
|
|
8
|
+
function y() {
|
|
9
9
|
return /* @__PURE__ */ s("div", {
|
|
10
10
|
className: "flex min-h-[320px] items-center justify-center",
|
|
11
11
|
children: /* @__PURE__ */ s(r, { className: "h-8 w-8 animate-spin text-primary" })
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function b() {
|
|
15
15
|
return /* @__PURE__ */ s(t, {
|
|
16
|
-
fallback: /* @__PURE__ */ s(
|
|
16
|
+
fallback: /* @__PURE__ */ s(y, {}),
|
|
17
17
|
children: /* @__PURE__ */ c(o, { children: [
|
|
18
18
|
/* @__PURE__ */ s(a, {
|
|
19
19
|
index: !0,
|
|
20
20
|
element: /* @__PURE__ */ s(e, {})
|
|
21
21
|
}),
|
|
22
|
-
/* @__PURE__ */ s(a, {
|
|
23
|
-
path: "advisors",
|
|
24
|
-
element: /* @__PURE__ */ s(l, {})
|
|
25
|
-
}),
|
|
26
22
|
/* @__PURE__ */ s(a, {
|
|
27
23
|
path: "ai-assistant",
|
|
28
|
-
element: /* @__PURE__ */ s(
|
|
24
|
+
element: /* @__PURE__ */ s(l, {})
|
|
29
25
|
}),
|
|
30
26
|
/* @__PURE__ */ s(a, {
|
|
31
27
|
path: "analytics",
|
|
32
|
-
element: /* @__PURE__ */ s(
|
|
33
|
-
}),
|
|
34
|
-
/* @__PURE__ */ s(a, {
|
|
35
|
-
path: "assistant",
|
|
36
|
-
element: /* @__PURE__ */ s(f, {})
|
|
28
|
+
element: /* @__PURE__ */ s(u, {})
|
|
37
29
|
}),
|
|
38
30
|
/* @__PURE__ */ s(a, {
|
|
39
31
|
path: "accounts",
|
|
40
|
-
element: /* @__PURE__ */ s(
|
|
41
|
-
}),
|
|
42
|
-
/* @__PURE__ */ s(a, {
|
|
43
|
-
path: "estate",
|
|
44
|
-
element: /* @__PURE__ */ s(m, {})
|
|
32
|
+
element: /* @__PURE__ */ s(d, {})
|
|
45
33
|
}),
|
|
46
34
|
/* @__PURE__ */ s(a, {
|
|
47
35
|
path: "family",
|
|
48
|
-
element: /* @__PURE__ */ s(
|
|
36
|
+
element: /* @__PURE__ */ s(f, {})
|
|
49
37
|
}),
|
|
50
38
|
/* @__PURE__ */ s(a, {
|
|
51
39
|
path: "goals",
|
|
52
|
-
element: /* @__PURE__ */ s(
|
|
53
|
-
}),
|
|
54
|
-
/* @__PURE__ */ s(a, {
|
|
55
|
-
path: "insurance",
|
|
56
|
-
element: /* @__PURE__ */ s(_, {})
|
|
40
|
+
element: /* @__PURE__ */ s(p, {})
|
|
57
41
|
}),
|
|
58
42
|
/* @__PURE__ */ s(a, {
|
|
59
43
|
path: "investments",
|
|
60
|
-
element: /* @__PURE__ */ s(
|
|
61
|
-
}),
|
|
62
|
-
/* @__PURE__ */ s(a, {
|
|
63
|
-
path: "marketplace",
|
|
64
|
-
element: /* @__PURE__ */ s(y, {})
|
|
44
|
+
element: /* @__PURE__ */ s(m, {})
|
|
65
45
|
}),
|
|
66
46
|
/* @__PURE__ */ s(a, {
|
|
67
47
|
path: "portfolios",
|
|
68
|
-
element: /* @__PURE__ */ s(
|
|
48
|
+
element: /* @__PURE__ */ s(h, {})
|
|
69
49
|
}),
|
|
70
50
|
/* @__PURE__ */ s(a, {
|
|
71
51
|
path: "reports",
|
|
72
|
-
element: /* @__PURE__ */ s(
|
|
52
|
+
element: /* @__PURE__ */ s(g, {})
|
|
73
53
|
}),
|
|
74
54
|
/* @__PURE__ */ s(a, {
|
|
75
55
|
path: "risk",
|
|
76
|
-
element: /* @__PURE__ */ s(
|
|
56
|
+
element: /* @__PURE__ */ s(_, {})
|
|
77
57
|
}),
|
|
78
58
|
/* @__PURE__ */ s(a, {
|
|
79
59
|
path: "tax",
|
|
80
|
-
element: /* @__PURE__ */ s(
|
|
60
|
+
element: /* @__PURE__ */ s(v, {})
|
|
81
61
|
}),
|
|
82
62
|
/* @__PURE__ */ s(a, {
|
|
83
63
|
path: "*",
|
|
@@ -90,6 +70,6 @@ function T() {
|
|
|
90
70
|
});
|
|
91
71
|
}
|
|
92
72
|
//#endregion
|
|
93
|
-
export {
|
|
73
|
+
export { b as BrainyRichRoutes };
|
|
94
74
|
|
|
95
75
|
//# sourceMappingURL=BrainyRichRoutes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrainyRichRoutes.js","names":[],"sources":["../../src/brainyrich/BrainyRichRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\nimport { Loader2 } from 'lucide-react';\nimport { DashboardPage as IndexPage } from './pages/DashboardPage';\n\nconst
|
|
1
|
+
{"version":3,"file":"BrainyRichRoutes.js","names":[],"sources":["../../src/brainyrich/BrainyRichRoutes.tsx"],"sourcesContent":["import { lazy, Suspense } from 'react';\nimport { Navigate, Route, Routes } from 'react-router-dom';\nimport { Loader2 } from 'lucide-react';\nimport { DashboardPage as IndexPage } from './pages/DashboardPage';\n\nconst AiAssistantPage = lazy(() =>\n import('./pages/AiAssistantPage').then((m) => ({ default: m.AiAssistantPage }))\n);\nconst AnalyticsPage = lazy(() =>\n import('./pages/AnalyticsPage').then((m) => ({ default: m.AnalyticsPage }))\n);\nconst AccountsPage = lazy(() =>\n import('./pages/AccountsPage').then((m) => ({ default: m.AccountsPage }))\n);\nconst FamilyPage = lazy(() =>\n import('./pages/FamilyPage').then((m) => ({ default: m.FamilyPage }))\n);\nconst GoalsPage = lazy(() => import('./pages/GoalsPage').then((m) => ({ default: m.GoalsPage })));\nconst InvestmentsPage = lazy(() =>\n import('./pages/InvestmentsPage').then((m) => ({ default: m.InvestmentsPage }))\n);\nconst PortfoliosPage = lazy(() =>\n import('./pages/PortfoliosPage').then((m) => ({ default: m.PortfoliosPage }))\n);\nconst ReportsPage = lazy(() =>\n import('./pages/ReportsPage').then((m) => ({ default: m.ReportsPage }))\n);\nconst RiskPage = lazy(() => import('./pages/RiskPage').then((m) => ({ default: m.RiskPage })));\nconst TaxPage = lazy(() => import('./pages/TaxPage').then((m) => ({ default: m.TaxPage })));\n\nfunction PageLoader() {\n return (\n <div className=\"flex min-h-[320px] items-center justify-center\">\n <Loader2 className=\"h-8 w-8 animate-spin text-primary\" />\n </div>\n );\n}\n\nexport function BrainyRichRoutes() {\n return (\n <Suspense fallback={<PageLoader />}>\n <Routes>\n <Route index element={<IndexPage />} />\n <Route path=\"ai-assistant\" element={<AiAssistantPage />} />\n <Route path=\"analytics\" element={<AnalyticsPage />} />\n <Route path=\"accounts\" element={<AccountsPage />} />\n <Route path=\"family\" element={<FamilyPage />} />\n <Route path=\"goals\" element={<GoalsPage />} />\n <Route path=\"investments\" element={<InvestmentsPage />} />\n <Route path=\"portfolios\" element={<PortfoliosPage />} />\n <Route path=\"reports\" element={<ReportsPage />} />\n <Route path=\"risk\" element={<RiskPage />} />\n <Route path=\"tax\" element={<TaxPage />} />\n <Route path=\"*\" element={<Navigate to=\"\" replace />} />\n </Routes>\n </Suspense>\n );\n}\n"],"mappings":";;;;;;AAKA,IAAM,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAgB,QACpB,OAAO,4BAAyB,MAAM,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,CAC5E,EACK,IAAe,QACnB,OAAO,2BAAwB,MAAM,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAC1E,EACK,IAAa,QACjB,OAAO,yBAAsB,MAAM,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CACtE,EACK,IAAY,QAAW,OAAO,wBAAqB,MAAM,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC,EAC3F,IAAkB,QACtB,OAAO,8BAA2B,MAAM,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAChF,EACK,IAAiB,QACrB,OAAO,6BAA0B,MAAM,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAC9E,EACK,IAAc,QAClB,OAAO,0BAAuB,MAAM,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CACxE,EACK,IAAW,QAAW,OAAO,uBAAoB,MAAM,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC,EACxF,IAAU,QAAW,OAAO,sBAAmB,MAAM,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;AAE3F,SAAS,IAAa;AACpB,QACE,kBAAC,OAAD;EAAK,WAAU;YACb,kBAAC,GAAD,EAAS,WAAU,qCAAsC,CAAA;EACrD,CAAA;;AAIV,SAAgB,IAAmB;AACjC,QACE,kBAAC,GAAD;EAAU,UAAU,kBAAC,GAAD,EAAc,CAAA;YAChC,kBAAC,GAAD,EAAA,UAAA;GACE,kBAAC,GAAD;IAAO,OAAA;IAAM,SAAS,kBAAC,GAAD,EAAa,CAAA;IAAI,CAAA;GACvC,kBAAC,GAAD;IAAO,MAAK;IAAe,SAAS,kBAAC,GAAD,EAAmB,CAAA;IAAI,CAAA;GAC3D,kBAAC,GAAD;IAAO,MAAK;IAAY,SAAS,kBAAC,GAAD,EAAiB,CAAA;IAAI,CAAA;GACtD,kBAAC,GAAD;IAAO,MAAK;IAAW,SAAS,kBAAC,GAAD,EAAgB,CAAA;IAAI,CAAA;GACpD,kBAAC,GAAD;IAAO,MAAK;IAAS,SAAS,kBAAC,GAAD,EAAc,CAAA;IAAI,CAAA;GAChD,kBAAC,GAAD;IAAO,MAAK;IAAQ,SAAS,kBAAC,GAAD,EAAa,CAAA;IAAI,CAAA;GAC9C,kBAAC,GAAD;IAAO,MAAK;IAAc,SAAS,kBAAC,GAAD,EAAmB,CAAA;IAAI,CAAA;GAC1D,kBAAC,GAAD;IAAO,MAAK;IAAa,SAAS,kBAAC,GAAD,EAAkB,CAAA;IAAI,CAAA;GACxD,kBAAC,GAAD;IAAO,MAAK;IAAU,SAAS,kBAAC,GAAD,EAAe,CAAA;IAAI,CAAA;GAClD,kBAAC,GAAD;IAAO,MAAK;IAAO,SAAS,kBAAC,GAAD,EAAY,CAAA;IAAI,CAAA;GAC5C,kBAAC,GAAD;IAAO,MAAK;IAAM,SAAS,kBAAC,GAAD,EAAW,CAAA;IAAI,CAAA;GAC1C,kBAAC,GAAD;IAAO,MAAK;IAAI,SAAS,kBAAC,GAAD;KAAU,IAAG;KAAG,SAAA;KAAU,CAAA;IAAI,CAAA;GAChD,EAAA,CAAA;EACA,CAAA"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useBrainyRich as e } from "../providers/BrainyRichProvider.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { useActorProfiles as i } from "@burdenoff/fe-libs/shared";
|
|
5
|
+
//#region src/brainyrich/components/ActorName.tsx
|
|
6
|
+
function a({ id: a, actorType: o = "user", className: s = "", fallback: c = "—", withSecondary: l = !1 }) {
|
|
7
|
+
let { apiGatewayUrl: u, authToken: d, workspaceId: f } = e(), p = i(t(() => a ? [{
|
|
8
|
+
actorId: a,
|
|
9
|
+
actorType: o
|
|
10
|
+
}] : [], [a, o]), {
|
|
11
|
+
apiGatewayUrl: u,
|
|
12
|
+
authToken: d,
|
|
13
|
+
workspaceId: f
|
|
14
|
+
});
|
|
15
|
+
if (!a) return /* @__PURE__ */ n("span", {
|
|
16
|
+
className: s,
|
|
17
|
+
children: c
|
|
18
|
+
});
|
|
19
|
+
let m = p[a], h = m?.displayName ?? a;
|
|
20
|
+
return l && m?.secondaryLabel && m.secondaryLabel !== h ? /* @__PURE__ */ r("span", {
|
|
21
|
+
className: s,
|
|
22
|
+
children: [/* @__PURE__ */ n("span", {
|
|
23
|
+
className: "text-text-primary",
|
|
24
|
+
children: h
|
|
25
|
+
}), /* @__PURE__ */ n("span", {
|
|
26
|
+
className: "block text-xs text-text-secondary",
|
|
27
|
+
children: m.secondaryLabel
|
|
28
|
+
})]
|
|
29
|
+
}) : /* @__PURE__ */ n("span", {
|
|
30
|
+
className: s,
|
|
31
|
+
title: m?.email ?? a,
|
|
32
|
+
children: h
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { a as ActorName };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=ActorName.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActorName.js","names":[],"sources":["../../../src/brainyrich/components/ActorName.tsx"],"sourcesContent":["/**\n * Render an actor UUID (owner / advisor / proposedBy / acknowledgedBy …) as a\n * human-readable display name.\n * @module brainyrich/components/ActorName\n *\n * Wraps fe-libs `useActorProfiles`, which resolves identities via the GLOBAL\n * gateway (workspace-member → org-member → admin lookup → local fallback) with\n * an internal 5-minute cache. The MFE is handed a *workspace* `apiGatewayUrl`;\n * `useActorProfiles` detects that and only uses it for the workspace-scoped\n * tier, resolving the global gateway from the hostname itself — so forwarding\n * our workspace URL is safe. Network failures degrade to a short-id fallback,\n * never an error.\n */\n\nimport { useMemo } from 'react';\nimport { useActorProfiles, type ActorInput } from '@burdenoff/fe-libs/shared';\nimport { useBrainyRich } from '../providers/BrainyRichProvider';\n\nexport interface ActorNameProps {\n /** Actor id (usually a user UUID). */\n id?: string | null;\n /** Actor type — 'user' (default), 'app', 'service', 'super_admin'. */\n actorType?: string;\n className?: string;\n /** Shown when `id` is absent/empty (default \"—\"). */\n fallback?: string;\n /** Also render the secondary label (email / short id) under the name. */\n withSecondary?: boolean;\n}\n\nexport function ActorName({\n id,\n actorType = 'user',\n className = '',\n fallback = '—',\n withSecondary = false,\n}: ActorNameProps) {\n const { apiGatewayUrl, authToken, workspaceId } = useBrainyRich();\n\n // Stable single-actor input list. Hook is always called (never conditional).\n const actors = useMemo<ActorInput[]>(\n () => (id ? [{ actorId: id, actorType }] : []),\n [id, actorType]\n );\n const profiles = useActorProfiles(actors, { apiGatewayUrl, authToken, workspaceId });\n\n if (!id) return <span className={className}>{fallback}</span>;\n\n const profile = profiles[id];\n const displayName = profile?.displayName ?? id;\n\n if (withSecondary && profile?.secondaryLabel && profile.secondaryLabel !== displayName) {\n return (\n <span className={className}>\n <span className=\"text-text-primary\">{displayName}</span>\n <span className=\"block text-xs text-text-secondary\">{profile.secondaryLabel}</span>\n </span>\n );\n }\n\n return (\n <span className={className} title={profile?.email ?? id}>\n {displayName}\n </span>\n );\n}\n"],"mappings":";;;;;AA8BA,SAAgB,EAAU,EACxB,OACA,eAAY,QACZ,eAAY,IACZ,cAAW,KACX,mBAAgB,MACC;CACjB,IAAM,EAAE,kBAAe,cAAW,mBAAgB,GAAe,EAO3D,IAAW,EAJF,QACN,IAAK,CAAC;EAAE,SAAS;EAAI;EAAW,CAAC,GAAG,EAAE,EAC7C,CAAC,GAAI,EAAU,CAChB,EACyC;EAAE;EAAe;EAAW;EAAa,CAAC;AAEpF,KAAI,CAAC,EAAI,QAAO,kBAAC,QAAD;EAAiB;YAAY;EAAgB,CAAA;CAE7D,IAAM,IAAU,EAAS,IACnB,IAAc,GAAS,eAAe;AAW5C,QATI,KAAiB,GAAS,kBAAkB,EAAQ,mBAAmB,IAEvE,kBAAC,QAAD;EAAiB;YAAjB,CACE,kBAAC,QAAD;GAAM,WAAU;aAAqB;GAAmB,CAAA,EACxD,kBAAC,QAAD;GAAM,WAAU;aAAqC,EAAQ;GAAsB,CAAA,CAC9E;MAKT,kBAAC,QAAD;EAAiB;EAAW,OAAO,GAAS,SAAS;YAClD;EACI,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
2
|
+
import { Button as n, ResponsiveDialog as r, ResponsiveDialogContent as i, ResponsiveDialogDescription as a, ResponsiveDialogFooter as o, ResponsiveDialogHeader as s, ResponsiveDialogTitle as c } from "@burdenoff/fe-libs/ui";
|
|
3
|
+
//#region src/brainyrich/components/ConfirmDialog.tsx
|
|
4
|
+
function l({ open: l, onOpenChange: u, title: d, description: f, confirmLabel: p = "Confirm", pendingLabel: m = "Working…", cancelLabel: h = "Cancel", destructive: g = !1, pending: _ = !1, onConfirm: v }) {
|
|
5
|
+
return /* @__PURE__ */ e(r, {
|
|
6
|
+
open: l,
|
|
7
|
+
onOpenChange: (e) => !_ && u(e),
|
|
8
|
+
children: /* @__PURE__ */ t(i, { children: [/* @__PURE__ */ t(s, { children: [/* @__PURE__ */ e(c, { children: d }), f ? /* @__PURE__ */ e(a, { children: f }) : null] }), /* @__PURE__ */ t(o, { children: [/* @__PURE__ */ e(n, {
|
|
9
|
+
variant: "outline",
|
|
10
|
+
onClick: () => u(!1),
|
|
11
|
+
disabled: _,
|
|
12
|
+
children: h
|
|
13
|
+
}), /* @__PURE__ */ e(n, {
|
|
14
|
+
variant: g ? "destructive" : "default",
|
|
15
|
+
onClick: v,
|
|
16
|
+
disabled: _,
|
|
17
|
+
"aria-busy": _,
|
|
18
|
+
children: _ ? m : p
|
|
19
|
+
})] })] })
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { l as ConfirmDialog };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=ConfirmDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConfirmDialog.js","names":[],"sources":["../../../src/brainyrich/components/ConfirmDialog.tsx"],"sourcesContent":["/**\n * Shared confirmation dialog for destructive / irreversible actions.\n * @module brainyrich/components/ConfirmDialog\n *\n * Modeled on the archive-confirm dialog previously inlined in AccountsPage so\n * every destructive action (archive account/portfolio/goal/household, delete\n * holding, unlink funding, dismiss insight, reject rebalance) shares one\n * accessible, pending-aware surface.\n */\n\nimport type { ReactNode } from 'react';\nimport {\n Button,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n} from '@burdenoff/fe-libs/ui';\n\nexport interface ConfirmDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n title: string;\n description?: ReactNode;\n /** Label for the confirm button (default \"Confirm\"). */\n confirmLabel?: string;\n /** Label shown while `pending` (default \"Working…\"). */\n pendingLabel?: string;\n cancelLabel?: string;\n /** Render the confirm button with the destructive variant. */\n destructive?: boolean;\n /** Confirm action in flight — disables buttons + swaps the label. */\n pending?: boolean;\n onConfirm: () => void;\n}\n\nexport function ConfirmDialog({\n open,\n onOpenChange,\n title,\n description,\n confirmLabel = 'Confirm',\n pendingLabel = 'Working…',\n cancelLabel = 'Cancel',\n destructive = false,\n pending = false,\n onConfirm,\n}: ConfirmDialogProps) {\n return (\n <ResponsiveDialog open={open} onOpenChange={(next) => !pending && onOpenChange(next)}>\n <ResponsiveDialogContent>\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>{title}</ResponsiveDialogTitle>\n {description ? (\n <ResponsiveDialogDescription>{description}</ResponsiveDialogDescription>\n ) : null}\n </ResponsiveDialogHeader>\n <ResponsiveDialogFooter>\n <Button variant=\"outline\" onClick={() => onOpenChange(false)} disabled={pending}>\n {cancelLabel}\n </Button>\n <Button\n variant={destructive ? 'destructive' : 'default'}\n onClick={onConfirm}\n disabled={pending}\n aria-busy={pending}\n >\n {pending ? pendingLabel : confirmLabel}\n </Button>\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n"],"mappings":";;;AAsCA,SAAgB,EAAc,EAC5B,SACA,iBACA,UACA,gBACA,kBAAe,WACf,kBAAe,YACf,iBAAc,UACd,iBAAc,IACd,aAAU,IACV,gBACqB;AACrB,QACE,kBAAC,GAAD;EAAwB;EAAM,eAAe,MAAS,CAAC,KAAW,EAAa,EAAK;YAClF,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD,EAAA,UAAwB,GAA8B,CAAA,EACrD,IACC,kBAAC,GAAD,EAAA,UAA8B,GAA0C,CAAA,GACtE,KACmB,EAAA,CAAA,EACzB,kBAAC,GAAD,EAAA,UAAA,CACE,kBAAC,GAAD;GAAQ,SAAQ;GAAU,eAAe,EAAa,GAAM;GAAE,UAAU;aACrE;GACM,CAAA,EACT,kBAAC,GAAD;GACE,SAAS,IAAc,gBAAgB;GACvC,SAAS;GACT,UAAU;GACV,aAAW;aAEV,IAAU,IAAe;GACnB,CAAA,CACc,EAAA,CAAA,CACD,EAAA,CAAA;EACT,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Loader2 as e } from "lucide-react";
|
|
2
|
+
import { Fragment as t, jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
3
|
+
import { Button as i } from "@burdenoff/fe-libs/ui";
|
|
4
|
+
//#region src/brainyrich/components/LoadMore.tsx
|
|
5
|
+
function a({ hasMore: a, onClick: o, loading: s = !1, label: c = "Load more", loadingLabel: l = "Loading…", className: u = "" }) {
|
|
6
|
+
return a ? /* @__PURE__ */ n("div", {
|
|
7
|
+
className: `flex justify-center pt-4 ${u}`,
|
|
8
|
+
children: /* @__PURE__ */ n(i, {
|
|
9
|
+
variant: "outline",
|
|
10
|
+
size: "sm",
|
|
11
|
+
onClick: o,
|
|
12
|
+
disabled: s,
|
|
13
|
+
"aria-busy": s,
|
|
14
|
+
children: s ? /* @__PURE__ */ r(t, { children: [/* @__PURE__ */ n(e, {
|
|
15
|
+
className: "size-4 motion-safe:animate-spin",
|
|
16
|
+
"aria-hidden": "true"
|
|
17
|
+
}), l] }) : c
|
|
18
|
+
})
|
|
19
|
+
}) : null;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { a as LoadMore };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=LoadMore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LoadMore.js","names":[],"sources":["../../../src/brainyrich/components/LoadMore.tsx"],"sourcesContent":["/**\n * \"Load more\" button for cursor-paginated list pages.\n * @module brainyrich/components/LoadMore\n *\n * Pair with the `usePaged*` hooks in `../hooks/useBrainyRichApi` (they expose\n * `hasMore`, `loadMore`, `isFetchingNextPage`). Renders nothing when there is\n * no next page, so it can be dropped unconditionally at the end of a list.\n */\n\nimport { Loader2 } from 'lucide-react';\nimport { Button } from '@burdenoff/fe-libs/ui';\n\nexport interface LoadMoreProps {\n /** Whether another page exists. Component renders null when false. */\n hasMore: boolean;\n /** Fetch the next page. */\n onClick: () => void;\n /** Next-page fetch in flight. */\n loading?: boolean;\n label?: string;\n loadingLabel?: string;\n className?: string;\n}\n\nexport function LoadMore({\n hasMore,\n onClick,\n loading = false,\n label = 'Load more',\n loadingLabel = 'Loading…',\n className = '',\n}: LoadMoreProps) {\n if (!hasMore) return null;\n return (\n <div className={`flex justify-center pt-4 ${className}`}>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={onClick}\n disabled={loading}\n aria-busy={loading}\n >\n {loading ? (\n <>\n <Loader2 className=\"size-4 motion-safe:animate-spin\" aria-hidden=\"true\" />\n {loadingLabel}\n </>\n ) : (\n label\n )}\n </Button>\n </div>\n );\n}\n"],"mappings":";;;;AAwBA,SAAgB,EAAS,EACvB,YACA,YACA,aAAU,IACV,WAAQ,aACR,kBAAe,YACf,eAAY,MACI;AAEhB,QADK,IAEH,kBAAC,OAAD;EAAK,WAAW,4BAA4B;YAC1C,kBAAC,GAAD;GACE,SAAQ;GACR,MAAK;GACI;GACT,UAAU;GACV,aAAW;aAEV,IACC,kBAAA,GAAA,EAAA,UAAA,CACE,kBAAC,GAAD;IAAS,WAAU;IAAkC,eAAY;IAAS,CAAA,EACzE,EACA,EAAA,CAAA,GAEH;GAEK,CAAA;EACL,CAAA,GAnBa"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { toast as e } from "../../node_modules/sonner/dist/index.js";
|
|
2
|
+
import { extractBackendError as t } from "@burdenoff/fe-libs/shared/utils";
|
|
3
|
+
//#region src/brainyrich/components/notify.ts
|
|
4
|
+
var n = {
|
|
5
|
+
success(t, n) {
|
|
6
|
+
e.success(t, {
|
|
7
|
+
description: n,
|
|
8
|
+
duration: 4e3
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
info(t, n) {
|
|
12
|
+
e.info(t, {
|
|
13
|
+
description: n,
|
|
14
|
+
duration: 4e3
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
warning(t, n) {
|
|
18
|
+
e.warning(t, {
|
|
19
|
+
description: n,
|
|
20
|
+
duration: 8e3
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
error(t, n) {
|
|
24
|
+
e.error(t, {
|
|
25
|
+
description: n,
|
|
26
|
+
duration: Infinity,
|
|
27
|
+
closeButton: !0
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
function r(e, n = "Something went wrong. Please try again.") {
|
|
32
|
+
let r = t(e);
|
|
33
|
+
return r?.message ? r.message : e instanceof Error && e.message.trim() ? e.message : n;
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { r as errorMessage, n as notify };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=notify.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notify.js","names":[],"sources":["../../../src/brainyrich/components/notify.ts"],"sourcesContent":["/**\n * Centralized user-feedback surface for the BrainyRich MFE.\n * @module brainyrich/components/notify\n *\n * WHY sonner `toast()` and NOT a scoped `<Toaster/>`:\n * sonner exposes a *module-level singleton* store — every `toast()` call\n * renders through whichever `<Toaster/>` is mounted. The host application\n * shell (`AppShellProvider` in `@burdenoff/fe-libs`) already mounts exactly\n * one `<Toaster/>` (see `AppShellProvider.tsx`), so calling `toast()` from\n * here renders through it. Mounting a SECOND `<Toaster/>` in BrainyRichRoot\n * would produce the documented double-toast regression, so we deliberately\n * do not. `sonner` is pinned to the same `^2.0.7` fe-libs uses so the bundler\n * dedupes to a single instance (a duplicated copy would break the singleton).\n *\n * Every page/component and every mutation hook emits feedback through these\n * helpers instead of hand-rolling markup. Durations follow the platform\n * notification spec: success/info auto-dismiss; errors stay until dismissed\n * (sonner renders a close button + announces via aria-live for WCAG AA).\n */\n\nimport { toast } from 'sonner';\nimport { extractBackendError } from '@burdenoff/fe-libs/shared/utils';\n\nexport const notify = {\n success(message: string, description?: string): void {\n toast.success(message, { description, duration: 4000 });\n },\n info(message: string, description?: string): void {\n toast.info(message, { description, duration: 4000 });\n },\n warning(message: string, description?: string): void {\n toast.warning(message, { description, duration: 8000 });\n },\n error(message: string, description?: string): void {\n toast.error(message, { description, duration: Infinity, closeButton: true });\n },\n};\n\n/**\n * Resolve a human-friendly message from any thrown value. The bra transport\n * throws `new Error(<graphql error message>)`, so this runs that message through\n * fe-libs' `extractBackendError` (which maps known codes to friendly copy and\n * hides technical/prisma strings) and falls back to the raw message.\n */\nexport function errorMessage(\n error: unknown,\n fallback = 'Something went wrong. Please try again.'\n): string {\n const extracted = extractBackendError(error);\n if (extracted?.message) return extracted.message;\n if (error instanceof Error && error.message.trim()) return error.message;\n return fallback;\n}\n"],"mappings":";;;AAuBA,IAAa,IAAS;CACpB,QAAQ,GAAiB,GAA4B;AACnD,IAAM,QAAQ,GAAS;GAAE;GAAa,UAAU;GAAM,CAAC;;CAEzD,KAAK,GAAiB,GAA4B;AAChD,IAAM,KAAK,GAAS;GAAE;GAAa,UAAU;GAAM,CAAC;;CAEtD,QAAQ,GAAiB,GAA4B;AACnD,IAAM,QAAQ,GAAS;GAAE;GAAa,UAAU;GAAM,CAAC;;CAEzD,MAAM,GAAiB,GAA4B;AACjD,IAAM,MAAM,GAAS;GAAE;GAAa,UAAU;GAAU,aAAa;GAAM,CAAC;;CAE/E;AAQD,SAAgB,EACd,GACA,IAAW,2CACH;CACR,IAAM,IAAY,EAAoB,EAAM;AAG5C,QAFI,GAAW,UAAgB,EAAU,UACrC,aAAiB,SAAS,EAAM,QAAQ,MAAM,GAAS,EAAM,UAC1D"}
|