@burdenoff/microfe-brainyrich 2026.1101.2 → 2026.1101.3
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.d.ts.map +1 -1
- package/dist/brainyrich/BrainyRichRoot.js +22 -107
- package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.d.ts.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.js +65 -46
- package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
- package/dist/brainyrich/components/mobile/MobilePage.d.ts +44 -0
- package/dist/brainyrich/components/mobile/MobilePage.d.ts.map +1 -0
- package/dist/brainyrich/components/mobile/MobilePage.js +45 -0
- package/dist/brainyrich/components/mobile/MobilePage.js.map +1 -0
- package/dist/brainyrich/components/mobile/MobileTabBar.d.ts +20 -0
- package/dist/brainyrich/components/mobile/MobileTabBar.d.ts.map +1 -0
- package/dist/brainyrich/components/mobile/MobileTabBar.js +139 -0
- package/dist/brainyrich/components/mobile/MobileTabBar.js.map +1 -0
- package/dist/brainyrich/components/mobile/index.d.ts +8 -0
- package/dist/brainyrich/components/mobile/index.d.ts.map +1 -0
- package/dist/brainyrich/components/mobile/index.js +2 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +48 -12
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +120 -108
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/hooks/useIsMobileViewport.d.ts +14 -0
- package/dist/brainyrich/hooks/useIsMobileViewport.d.ts.map +1 -0
- package/dist/brainyrich/hooks/useIsMobileViewport.js +23 -0
- package/dist/brainyrich/hooks/useIsMobileViewport.js.map +1 -0
- package/dist/brainyrich/navItems.d.ts +36 -0
- package/dist/brainyrich/navItems.d.ts.map +1 -0
- package/dist/brainyrich/navItems.js +54 -0
- package/dist/brainyrich/navItems.js.map +1 -0
- package/dist/brainyrich/pages/AccountsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/AccountsPage.js +411 -390
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +220 -174
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +560 -551
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/mobile/MobileAccountsView.d.ts +28 -0
- package/dist/brainyrich/pages/mobile/MobileAccountsView.d.ts.map +1 -0
- package/dist/brainyrich/pages/mobile/MobileAccountsView.js +139 -0
- package/dist/brainyrich/pages/mobile/MobileAccountsView.js.map +1 -0
- package/dist/brainyrich/pages/mobile/MobileDashboardView.d.ts +24 -0
- package/dist/brainyrich/pages/mobile/MobileDashboardView.d.ts.map +1 -0
- package/dist/brainyrich/pages/mobile/MobileDashboardView.js +245 -0
- package/dist/brainyrich/pages/mobile/MobileDashboardView.js.map +1 -0
- package/dist/brainyrich/pages/mobile/MobileGoalsView.d.ts +30 -0
- package/dist/brainyrich/pages/mobile/MobileGoalsView.d.ts.map +1 -0
- package/dist/brainyrich/pages/mobile/MobileGoalsView.js +180 -0
- package/dist/brainyrich/pages/mobile/MobileGoalsView.js.map +1 -0
- package/dist/brainyrich/pages/mobile/mobileShared.d.ts +24 -0
- package/dist/brainyrich/pages/mobile/mobileShared.d.ts.map +1 -0
- package/dist/brainyrich/pages/mobile/mobileShared.js +25 -0
- package/dist/brainyrich/pages/mobile/mobileShared.js.map +1 -0
- package/dist/brainyrich/utils/cn.js +10 -0
- package/dist/brainyrich/utils/cn.js.map +1 -0
- package/dist/brainyrich/utils/goalMetrics.d.ts +13 -0
- package/dist/brainyrich/utils/goalMetrics.d.ts.map +1 -0
- package/dist/brainyrich/utils/goalMetrics.js +20 -0
- package/dist/brainyrich/utils/goalMetrics.js.map +1 -0
- package/dist/test/brainyrichFixtures.d.ts +7 -0
- package/dist/test/brainyrichFixtures.d.ts.map +1 -0
- package/dist/test/viewport.d.ts +8 -0
- package/dist/test/viewport.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region src/brainyrich/utils/goalMetrics.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
return (e.fundings ?? []).reduce((e, t) => e + (t.fixedAmount ?? 0), 0);
|
|
4
|
+
}
|
|
5
|
+
function t(t) {
|
|
6
|
+
return t.status === "ACHIEVED" ? 100 : t.targetAmount > 0 ? Math.max(0, Math.min(100, e(t) / t.targetAmount * 100)) : 0;
|
|
7
|
+
}
|
|
8
|
+
function n(e, t) {
|
|
9
|
+
if (e === "ACHIEVED") return "success";
|
|
10
|
+
switch (t) {
|
|
11
|
+
case "AHEAD":
|
|
12
|
+
case "ON_TRACK": return "brand";
|
|
13
|
+
case "BEHIND": return "warning";
|
|
14
|
+
default: return "error";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { t as fundedPercent, n as goalTone };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=goalMetrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"goalMetrics.js","names":[],"sources":["../../../src/brainyrich/utils/goalMetrics.ts"],"sourcesContent":["import type { BraGoal, BraGoalProjection, BraGoalStatus } from '../types/bra';\nimport type { VizTone } from '../components/viz';\n\n/** Sum of the fixed-amount funding links wired to a goal (real backend value). */\nexport function goalFixedFunded(goal: Pick<BraGoal, 'fundings'>): number {\n // List and detail queries both fetch `fundings`; goals returned by mutations\n // (e.g. a freshly created goal) do not, and have no funding links yet anyway.\n return (goal.fundings ?? []).reduce((s, f) => s + (f.fixedAmount ?? 0), 0);\n}\n\n/**\n * Funded-progress percentage for a goal. ACHIEVED goals read 100%; otherwise the\n * sum of fixed funding links over the target — every input is wired backend data,\n * never fabricated.\n */\nexport function fundedPercent(goal: Pick<BraGoal, 'fundings' | 'targetAmount' | 'status'>): number {\n if (goal.status === 'ACHIEVED') return 100;\n if (!(goal.targetAmount > 0)) return 0;\n return Math.max(0, Math.min(100, (goalFixedFunded(goal) / goal.targetAmount) * 100));\n}\n\n/** Ring/accent tone derived from the goal's real status + projection. */\nexport function goalTone(status: BraGoalStatus, projection: BraGoalProjection): VizTone {\n if (status === 'ACHIEVED') return 'success';\n switch (projection) {\n case 'AHEAD':\n case 'ON_TRACK':\n return 'brand';\n case 'BEHIND':\n return 'warning';\n case 'AT_RISK':\n default:\n return 'error';\n }\n}\n"],"mappings":";AAIA,SAAgB,EAAgB,GAAyC;CAGvE,QAAQ,EAAK,YAAY,CAAC,GAAG,QAAQ,GAAG,MAAM,KAAK,EAAE,eAAe,IAAI,CAAC;AAC3E;AAOA,SAAgB,EAAc,GAAqE;CAGjG,OAFI,EAAK,WAAW,aAAmB,MACjC,EAAK,eAAe,IACnB,KAAK,IAAI,GAAG,KAAK,IAAI,KAAM,EAAgB,CAAI,IAAI,EAAK,eAAgB,GAAG,CAAC,IAD9C;AAEvC;AAGA,SAAgB,EAAS,GAAuB,GAAwC;CACtF,IAAI,MAAW,YAAY,OAAO;CAClC,QAAQ,GAAR;EACE,KAAK;EACL,KAAK,YACH,OAAO;EACT,KAAK,UACH,OAAO;EAET,SACE,OAAO;CACX;AACF"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BraAccount, BraGoal, BraInsight, BraPortfolio } from '../brainyrich/types/bra';
|
|
2
|
+
export declare const translate: (_key: string, fallback: string, params?: Record<string, string | number>) => string;
|
|
3
|
+
export declare function makeGoal(overrides?: Partial<BraGoal>): BraGoal;
|
|
4
|
+
export declare function makeAccount(overrides?: Partial<BraAccount>): BraAccount;
|
|
5
|
+
export declare function makeInsight(overrides?: Partial<BraInsight>): BraInsight;
|
|
6
|
+
export declare function makePortfolio(overrides?: Partial<BraPortfolio>): BraPortfolio;
|
|
7
|
+
//# sourceMappingURL=brainyrichFixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brainyrichFixtures.d.ts","sourceRoot":"","sources":["../../src/test/brainyrichFixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAI7F,eAAO,MAAM,SAAS,GACpB,MAAM,MAAM,EACZ,UAAU,MAAM,EAChB,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KACvC,MAGW,CAAC;AAEf,wBAAgB,QAAQ,CAAC,SAAS,GAAE,OAAO,CAAC,OAAO,CAAM,GAAG,OAAO,CAsBlE;AAED,wBAAgB,WAAW,CAAC,SAAS,GAAE,OAAO,CAAC,UAAU,CAAM,GAAG,UAAU,CAoB3E;AAED,wBAAgB,WAAW,CAAC,SAAS,GAAE,OAAO,CAAC,UAAU,CAAM,GAAG,UAAU,CAmB3E;AAED,wBAAgB,aAAa,CAAC,SAAS,GAAE,OAAO,CAAC,YAAY,CAAM,GAAG,YAAY,CAmBjF"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replace `window.matchMedia` with a controllable fake whose
|
|
3
|
+
* `(max-width: …)` queries match when `mobile` is true. Returns a setter that
|
|
4
|
+
* flips the viewport and notifies every subscribed listener, mimicking a
|
|
5
|
+
* resize or rotation across the breakpoint.
|
|
6
|
+
*/
|
|
7
|
+
export declare function mockViewport(mobile: boolean): (next: boolean) => void;
|
|
8
|
+
//# sourceMappingURL=viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"viewport.d.ts","sourceRoot":"","sources":["../../src/test/viewport.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAuBrE"}
|