@burdenoff/microfe-kadaikodi 2026.704.3 → 2026.704.5

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.
Files changed (145) hide show
  1. package/dist/kadaikodi/KadaikodiRoutes.js +34 -26
  2. package/dist/kadaikodi/KadaikodiRoutes.js.map +1 -1
  3. package/dist/kadaikodi/components/viz/AllocationBar.js +68 -0
  4. package/dist/kadaikodi/components/viz/AllocationBar.js.map +1 -0
  5. package/dist/kadaikodi/components/viz/AreaChart.js +102 -0
  6. package/dist/kadaikodi/components/viz/AreaChart.js.map +1 -0
  7. package/dist/kadaikodi/components/viz/AvatarStack.js +36 -0
  8. package/dist/kadaikodi/components/viz/AvatarStack.js.map +1 -0
  9. package/dist/kadaikodi/components/viz/BarChart.js +83 -0
  10. package/dist/kadaikodi/components/viz/BarChart.js.map +1 -0
  11. package/dist/kadaikodi/components/viz/CertificateCard.js +4 -0
  12. package/dist/kadaikodi/components/viz/DonutChart.js +109 -0
  13. package/dist/kadaikodi/components/viz/DonutChart.js.map +1 -0
  14. package/dist/kadaikodi/components/viz/HBarFunnel.js +54 -0
  15. package/dist/kadaikodi/components/viz/HBarFunnel.js.map +1 -0
  16. package/dist/kadaikodi/components/viz/Heatmap.js +3 -0
  17. package/dist/kadaikodi/components/viz/KanbanBoard.js +50 -0
  18. package/dist/kadaikodi/components/viz/KanbanBoard.js.map +1 -0
  19. package/dist/kadaikodi/components/viz/LineChart.js +4 -0
  20. package/dist/kadaikodi/components/viz/OrgTree.js +2 -0
  21. package/dist/kadaikodi/components/viz/PathSteps.js +3 -0
  22. package/dist/kadaikodi/components/viz/ProgressRing.js +68 -0
  23. package/dist/kadaikodi/components/viz/ProgressRing.js.map +1 -0
  24. package/dist/kadaikodi/components/viz/RatingStars.js +51 -0
  25. package/dist/kadaikodi/components/viz/RatingStars.js.map +1 -0
  26. package/dist/kadaikodi/components/viz/SegmentedTabs.js +69 -0
  27. package/dist/kadaikodi/components/viz/SegmentedTabs.js.map +1 -0
  28. package/dist/kadaikodi/components/viz/SkillBar.js +3 -0
  29. package/dist/kadaikodi/components/viz/Sparkline.js +74 -0
  30. package/dist/kadaikodi/components/viz/Sparkline.js.map +1 -0
  31. package/dist/kadaikodi/components/viz/StatCard.js +60 -0
  32. package/dist/kadaikodi/components/viz/StatCard.js.map +1 -0
  33. package/dist/kadaikodi/components/viz/StepProgress.js +64 -0
  34. package/dist/kadaikodi/components/viz/StepProgress.js.map +1 -0
  35. package/dist/kadaikodi/components/viz/Timeline.js +66 -0
  36. package/dist/kadaikodi/components/viz/Timeline.js.map +1 -0
  37. package/dist/kadaikodi/components/viz/index.js +23 -0
  38. package/dist/kadaikodi/components/viz/lib/Avatar.js +30 -0
  39. package/dist/kadaikodi/components/viz/lib/Avatar.js.map +1 -0
  40. package/dist/kadaikodi/components/viz/lib/CartesianFrame.js +119 -0
  41. package/dist/kadaikodi/components/viz/lib/CartesianFrame.js.map +1 -0
  42. package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js +35 -0
  43. package/dist/kadaikodi/components/viz/lib/ResponsiveSvg.js.map +1 -0
  44. package/dist/kadaikodi/components/viz/lib/format.js +21 -0
  45. package/dist/kadaikodi/components/viz/lib/format.js.map +1 -0
  46. package/dist/kadaikodi/components/viz/lib/geometry.js +61 -0
  47. package/dist/kadaikodi/components/viz/lib/geometry.js.map +1 -0
  48. package/dist/kadaikodi/components/viz/lib/hooks.js +39 -0
  49. package/dist/kadaikodi/components/viz/lib/hooks.js.map +1 -0
  50. package/dist/kadaikodi/components/viz/lib/palette.js +27 -0
  51. package/dist/kadaikodi/components/viz/lib/palette.js.map +1 -0
  52. package/dist/kadaikodi/hooks/useKadaikodiApi.js +84 -6
  53. package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
  54. package/dist/kadaikodi/pages/HomePage.js +373 -631
  55. package/dist/kadaikodi/pages/HomePage.js.map +1 -1
  56. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js +304 -169
  57. package/dist/kadaikodi/pages/admin/AdminAnalyticsPage.js.map +1 -1
  58. package/dist/kadaikodi/pages/admin/AdminDashboard.js +255 -271
  59. package/dist/kadaikodi/pages/admin/AdminDashboard.js.map +1 -1
  60. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js +185 -125
  61. package/dist/kadaikodi/pages/admin/AdminFinancialPage.js.map +1 -1
  62. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js +141 -102
  63. package/dist/kadaikodi/pages/admin/AdminOrdersPage.js.map +1 -1
  64. package/dist/kadaikodi/pages/admin/AdminProfilePage.js.map +1 -1
  65. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js +332 -276
  66. package/dist/kadaikodi/pages/admin/AdminSettingsPage.js.map +1 -1
  67. package/dist/kadaikodi/pages/admin/CartManagementPage.js +564 -729
  68. package/dist/kadaikodi/pages/admin/CartManagementPage.js.map +1 -1
  69. package/dist/kadaikodi/pages/admin/UserManagementPage.js +310 -366
  70. package/dist/kadaikodi/pages/admin/UserManagementPage.js.map +1 -1
  71. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js +201 -120
  72. package/dist/kadaikodi/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
  73. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js +290 -257
  74. package/dist/kadaikodi/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
  75. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js +173 -194
  76. package/dist/kadaikodi/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
  77. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js +270 -228
  78. package/dist/kadaikodi/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
  79. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js +194 -173
  80. package/dist/kadaikodi/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
  81. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js +428 -347
  82. package/dist/kadaikodi/pages/cart-owner/InventoryManagementPage.js.map +1 -1
  83. package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js +332 -0
  84. package/dist/kadaikodi/pages/cart-owner/InvestmentListingPage.js.map +1 -0
  85. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js +373 -0
  86. package/dist/kadaikodi/pages/cart-owner/MerchantOnboardingPage.js.map +1 -0
  87. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js +294 -162
  88. package/dist/kadaikodi/pages/cart-owner/OrderManagementPage.js.map +1 -1
  89. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js +180 -181
  90. package/dist/kadaikodi/pages/cart-owner/StaffManagementPage.js.map +1 -1
  91. package/dist/kadaikodi/pages/common/HelpSupportPage.js +310 -317
  92. package/dist/kadaikodi/pages/common/HelpSupportPage.js.map +1 -1
  93. package/dist/kadaikodi/pages/common/NotificationCenterPage.js.map +1 -1
  94. package/dist/kadaikodi/pages/common/SettingsPage.js +502 -586
  95. package/dist/kadaikodi/pages/common/SettingsPage.js.map +1 -1
  96. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js +239 -156
  97. package/dist/kadaikodi/pages/customer/BookingDetailsPage.js.map +1 -1
  98. package/dist/kadaikodi/pages/customer/CartDetailPage.js +405 -248
  99. package/dist/kadaikodi/pages/customer/CartDetailPage.js.map +1 -1
  100. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js +258 -232
  101. package/dist/kadaikodi/pages/customer/CartDiscoveryPage.js.map +1 -1
  102. package/dist/kadaikodi/pages/customer/CheckoutPage.js +254 -205
  103. package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
  104. package/dist/kadaikodi/pages/customer/CustomerDashboard.js +5 -5
  105. package/dist/kadaikodi/pages/customer/CustomerDashboard.js.map +1 -1
  106. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js +189 -199
  107. package/dist/kadaikodi/pages/customer/CustomerProfilePage.js.map +1 -1
  108. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js +272 -230
  109. package/dist/kadaikodi/pages/customer/DirectServiceBookingPage.js.map +1 -1
  110. package/dist/kadaikodi/pages/customer/FavoritesPage.js +150 -413
  111. package/dist/kadaikodi/pages/customer/FavoritesPage.js.map +1 -1
  112. package/dist/kadaikodi/pages/customer/OrderHistoryPage.js +173 -134
  113. package/dist/kadaikodi/pages/customer/OrderHistoryPage.js.map +1 -1
  114. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js +411 -305
  115. package/dist/kadaikodi/pages/customer/OrderTrackingPage.js.map +1 -1
  116. package/dist/kadaikodi/pages/customer/ReviewsPage.js +310 -406
  117. package/dist/kadaikodi/pages/customer/ReviewsPage.js.map +1 -1
  118. package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
  119. package/dist/kadaikodi/pages/customer/shared.js +181 -0
  120. package/dist/kadaikodi/pages/customer/shared.js.map +1 -0
  121. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js +438 -311
  122. package/dist/kadaikodi/pages/investor/InvestmentDetailsPage.js.map +1 -1
  123. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js +320 -293
  124. package/dist/kadaikodi/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
  125. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js +159 -91
  126. package/dist/kadaikodi/pages/investor/InvestorAnalyticsPage.js.map +1 -1
  127. package/dist/kadaikodi/pages/investor/InvestorDashboard.js +137 -107
  128. package/dist/kadaikodi/pages/investor/InvestorDashboard.js.map +1 -1
  129. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js +157 -135
  130. package/dist/kadaikodi/pages/investor/InvestorInvestmentsPage.js.map +1 -1
  131. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js +280 -206
  132. package/dist/kadaikodi/pages/investor/InvestorPortfolioPage.js.map +1 -1
  133. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js +441 -514
  134. package/dist/kadaikodi/pages/investor/InvestorProfilePage.js.map +1 -1
  135. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js +428 -431
  136. package/dist/kadaikodi/pages/worker/TaskDetailsPage.js.map +1 -1
  137. package/dist/kadaikodi/pages/worker/WorkerDashboard.js +328 -445
  138. package/dist/kadaikodi/pages/worker/WorkerDashboard.js.map +1 -1
  139. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js +141 -164
  140. package/dist/kadaikodi/pages/worker/WorkerOrdersPage.js.map +1 -1
  141. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js +360 -288
  142. package/dist/kadaikodi/pages/worker/WorkerProfilePage.js.map +1 -1
  143. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js +303 -281
  144. package/dist/kadaikodi/pages/worker/WorkerSchedulePage.js.map +1 -1
  145. package/package.json +1 -1
@@ -1,252 +1,326 @@
1
1
  import { useKadaikodi as e } from "../../context/KadaikodiContext.js";
2
2
  import { cn as t } from "../../utils/cn.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { MetricsCard as r } from "../../components/MetricsCard.js";
5
- import { EmptyState as i } from "../../components/EmptyState.js";
6
- import { useInvestments as a } from "../../hooks/useKadaikodiApi.js";
7
- import { formatCurrency as o, formatDate as s } from "../../utils/formatters.js";
8
- import { useMemo as c, useState as l } from "react";
9
- import { BarChart3 as u, Briefcase as d, CreditCard as f, Eye as p, IndianRupee as m, TrendingUp as h, Wallet as g } from "lucide-react";
10
- import { jsx as _, jsxs as v } from "react/jsx-runtime";
11
- import { EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
4
+ import { EmptyState as r } from "../../components/EmptyState.js";
5
+ import { useInvestments as i } from "../../hooks/useKadaikodiApi.js";
6
+ import { formatCurrency as a, formatDate as o } from "../../utils/formatters.js";
7
+ import { MetricsCard as s } from "../../components/MetricsCard.js";
8
+ import { AreaChart as c } from "../../components/viz/AreaChart.js";
9
+ import { DonutChart as l } from "../../components/viz/DonutChart.js";
10
+ import "../../components/viz/index.js";
11
+ import { useMemo as u } from "react";
12
+ import { Briefcase as d, CheckCircle2 as f, Download as p, Eye as m, IndianRupee as h, TrendingUp as g, Wallet as _ } from "lucide-react";
13
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
14
+ import { EmphasisPanel as x, GlassCard as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
12
15
  //#region src/kadaikodi/pages/investor/InvestorPortfolioPage.tsx
13
- function x(e) {
16
+ function w(e) {
14
17
  return `${e > 0 ? "+" : ""}${e.toFixed(1)}%`;
15
18
  }
16
- function S() {
17
- let { navigateTo: S, currentUser: C } = e(), { data: w = [], isLoading: T } = a(C?.id || ""), [E, D] = l("overview"), O = w.reduce((e, t) => e + t.investedAmount, 0), k = w.reduce((e, t) => e + t.currentValue, 0), A = k - O, j = O > 0 ? A / O * 100 : 0, M = w.filter((e) => e.status === "active").length, N = c(() => w.reduce((e, t) => (e[t.cartName] = (e[t.cartName] || 0) + t.currentValue, e), {}), [w]);
18
- return T ? /* @__PURE__ */ _(n, {
19
+ function T(e) {
20
+ return a(e, {
21
+ minimumFractionDigits: 0,
22
+ notation: "compact"
23
+ });
24
+ }
25
+ function E() {
26
+ let { navigateTo: E, currentUser: D } = e(), { data: O = [], isLoading: k } = i(D?.id || ""), A = O.reduce((e, t) => e + t.investedAmount, 0), j = O.reduce((e, t) => e + t.currentValue, 0), M = j - A, N = A > 0 ? M / A * 100 : 0, P = O.filter((e) => e.status === "active").length, F = u(() => {
27
+ let e = O.reduce((e, t) => (e[t.cartName] = (e[t.cartName] || 0) + t.currentValue, e), {});
28
+ return Object.entries(e).map(([e, t]) => ({
29
+ label: e,
30
+ value: t
31
+ })).sort((e, t) => t.value - e.value);
32
+ }, [O]), I = u(() => {
33
+ let e = [...O].sort((e, t) => new Date(e.investmentDate).getTime() - new Date(t.investmentDate).getTime()), t = 0, n = e.map((e) => (t += e.currentValue, {
34
+ label: o(e.investmentDate, {
35
+ day: void 0,
36
+ hour: void 0,
37
+ minute: void 0
38
+ }),
39
+ value: t
40
+ }));
41
+ return n.length === 1 ? [{
42
+ label: "Start",
43
+ value: 0
44
+ }, ...n] : n;
45
+ }, [O]), L = u(() => [...O].sort((e, t) => new Date(t.investmentDate).getTime() - new Date(e.investmentDate).getTime()).slice(0, 6), [O]);
46
+ if (k) return /* @__PURE__ */ y(n, {
19
47
  title: "My Portfolio",
20
48
  description: "Loading your portfolio...",
21
- children: /* @__PURE__ */ _("div", {
22
- className: "flex items-center justify-center py-20",
23
- children: /* @__PURE__ */ v("div", {
24
- className: "text-center",
25
- children: [/* @__PURE__ */ _("div", { className: "mx-auto mb-4 h-12 w-12 animate-spin rounded-full border-b-2 border-primary" }), /* @__PURE__ */ _("p", {
26
- className: "text-sm text-text-secondary",
27
- children: "Loading your portfolio..."
28
- })]
29
- })
49
+ children: /* @__PURE__ */ b("div", {
50
+ className: "space-y-4",
51
+ children: [/* @__PURE__ */ y("div", {
52
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
53
+ children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ y("div", { className: "h-28 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" }, t))
54
+ }), /* @__PURE__ */ y("div", { className: "h-72 animate-pulse rounded-[var(--radius-card)] bg-bg-sunken" })]
30
55
  })
31
- }) : /* @__PURE__ */ v(n, {
56
+ });
57
+ let R = O.length === 0;
58
+ return /* @__PURE__ */ b(n, {
32
59
  title: "My Portfolio",
33
- description: "Track your investment performance and holdings",
60
+ description: "View and manage your investments",
61
+ actions: /* @__PURE__ */ y("button", {
62
+ type: "button",
63
+ onClick: () => E("/investor/opportunities"),
64
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text hover:bg-action-primary-bg-hover transition-colors",
65
+ children: "Add Funds"
66
+ }),
34
67
  children: [
35
- /* @__PURE__ */ _(b, {
68
+ /* @__PURE__ */ y(C, {
36
69
  className: "mb-6",
37
- children: "The complete picture of your money on Kadaikodi. Use this page to see how your portfolio is performing overall, how it's split across the carts you've backed, and the details of each holding. Switch tabs to drill into your holdings, and open any holding to review it."
70
+ children: "The complete picture of your money on Kadaikodi. See how your portfolio is performing overall, how its value has grown as you've backed more carts, how it's split across holdings, and the detail of every position."
38
71
  }),
39
- /* @__PURE__ */ v(y, { children: [/* @__PURE__ */ _("h2", {
72
+ /* @__PURE__ */ b(x, { children: [/* @__PURE__ */ y("h2", {
40
73
  className: "mb-4 text-base font-semibold text-text-primary",
41
74
  children: "Portfolio at a Glance"
42
- }), /* @__PURE__ */ v("div", {
75
+ }), /* @__PURE__ */ b("div", {
43
76
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
44
77
  children: [
45
- /* @__PURE__ */ _(r, {
46
- icon: /* @__PURE__ */ _(g, { className: "h-5 w-5" }),
47
- value: o(O, { minimumFractionDigits: 0 }),
78
+ /* @__PURE__ */ y(s, {
79
+ featured: !0,
80
+ icon: /* @__PURE__ */ y(_, { className: "h-5 w-5" }),
81
+ value: a(A, { minimumFractionDigits: 0 }),
48
82
  label: "Total Invested",
49
83
  trend: "neutral",
50
- trendValue: `${M} active`
84
+ trendValue: `${P} active`
51
85
  }),
52
- /* @__PURE__ */ _(r, {
53
- icon: /* @__PURE__ */ _(m, { className: "h-5 w-5" }),
54
- value: o(k, { minimumFractionDigits: 0 }),
86
+ /* @__PURE__ */ y(s, {
87
+ icon: /* @__PURE__ */ y(h, { className: "h-5 w-5" }),
88
+ value: a(j, { minimumFractionDigits: 0 }),
55
89
  label: "Current Value",
56
- trend: j >= 0 ? "up" : "down",
57
- trendValue: x(j)
90
+ trend: N >= 0 ? "up" : "down",
91
+ trendValue: w(N)
58
92
  }),
59
- /* @__PURE__ */ _(r, {
60
- icon: /* @__PURE__ */ _(h, { className: "h-5 w-5" }),
61
- value: o(Math.abs(A), { minimumFractionDigits: 0 }),
62
- label: "Total Returns",
63
- trend: A >= 0 ? "up" : "down",
64
- trendValue: x(j)
93
+ /* @__PURE__ */ y(s, {
94
+ icon: /* @__PURE__ */ y(g, { className: "h-5 w-5" }),
95
+ value: w(N),
96
+ label: "Overall Returns",
97
+ trend: M >= 0 ? "up" : "down",
98
+ trendValue: a(Math.abs(M), { minimumFractionDigits: 0 })
65
99
  }),
66
- /* @__PURE__ */ _(r, {
67
- icon: /* @__PURE__ */ _(d, { className: "h-5 w-5" }),
68
- value: String(w.length),
69
- label: "Holdings"
100
+ /* @__PURE__ */ y(s, {
101
+ icon: /* @__PURE__ */ y(d, { className: "h-5 w-5" }),
102
+ value: String(P),
103
+ label: "Active Investments"
70
104
  })
71
105
  ]
72
106
  })] }),
73
- /* @__PURE__ */ v("div", {
74
- className: "mt-6 rounded-lg border border-border-subtle bg-bg-surface shadow-sm",
75
- children: [/* @__PURE__ */ _("div", {
76
- className: "flex border-b border-border-subtle overflow-x-auto",
77
- children: [
78
- {
79
- key: "overview",
80
- label: "Overview",
81
- Icon: u
82
- },
83
- {
84
- key: "investments",
85
- label: `Investments (${w.length})`,
86
- Icon: d
87
- },
88
- {
89
- key: "transactions",
90
- label: "Transactions",
91
- Icon: f
92
- }
93
- ].map(({ key: e, label: n, Icon: r }) => /* @__PURE__ */ v("button", {
107
+ R ? /* @__PURE__ */ y("div", {
108
+ className: "mt-6",
109
+ children: /* @__PURE__ */ y(r, {
110
+ illustration: "empty-data",
111
+ title: "No holdings yet",
112
+ description: "Once you back a cart, your portfolio value, allocation and holdings will appear here.",
113
+ action: /* @__PURE__ */ y("button", {
94
114
  type: "button",
95
- onClick: () => D(e),
96
- className: t("flex items-center gap-2 whitespace-nowrap px-4 py-3 text-sm font-medium transition-colors", E === e ? "border-b-2 border-primary text-text-primary" : "text-text-secondary hover:text-text-primary"),
97
- children: [/* @__PURE__ */ _(r, { className: "h-4 w-4" }), n]
98
- }, e))
99
- }), /* @__PURE__ */ v("div", {
100
- className: "p-4",
115
+ onClick: () => E("/investor/opportunities"),
116
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg-hover transition-colors",
117
+ children: "Browse Opportunities"
118
+ })
119
+ })
120
+ }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ b("div", {
121
+ className: "mt-6 grid gap-6 lg:grid-cols-3",
122
+ children: [/* @__PURE__ */ b(S, {
123
+ treatment: "plain",
124
+ className: "p-5 sm:p-6 lg:col-span-2",
125
+ children: [/* @__PURE__ */ b("div", {
126
+ className: "mb-4 flex items-center justify-between",
127
+ children: [/* @__PURE__ */ y("h2", {
128
+ className: "text-lg font-semibold text-text-primary",
129
+ children: "Portfolio Value Trend"
130
+ }), /* @__PURE__ */ y("span", {
131
+ className: "text-xs text-text-secondary",
132
+ children: "by holding date"
133
+ })]
134
+ }), /* @__PURE__ */ y(c, {
135
+ series: I,
136
+ height: 240,
137
+ valueFormatter: T,
138
+ title: "Cumulative portfolio value by holding date"
139
+ })]
140
+ }), /* @__PURE__ */ b(S, {
141
+ treatment: "plain",
142
+ className: "p-5 sm:p-6",
143
+ children: [/* @__PURE__ */ y("h2", {
144
+ className: "mb-4 text-lg font-semibold text-text-primary",
145
+ children: "Allocation"
146
+ }), /* @__PURE__ */ y("div", {
147
+ className: "flex flex-col items-center gap-4",
148
+ children: /* @__PURE__ */ y(l, {
149
+ segments: F,
150
+ size: 180,
151
+ centerLabel: T(j),
152
+ centerCaption: "total value",
153
+ valueFormatter: T
154
+ })
155
+ })]
156
+ })]
157
+ }), /* @__PURE__ */ b("div", {
158
+ className: "mt-6 grid gap-6 lg:grid-cols-3",
159
+ children: [/* @__PURE__ */ b(S, {
160
+ treatment: "plain",
161
+ className: "p-5 sm:p-6 lg:col-span-2",
101
162
  children: [
102
- E === "overview" && /* @__PURE__ */ _("div", {
103
- className: "space-y-6",
104
- children: w.length === 0 ? /* @__PURE__ */ _(i, {
105
- illustration: "empty-data",
106
- title: "No holdings yet",
107
- description: "Once you back a cart, your portfolio allocation will appear here.",
108
- action: /* @__PURE__ */ _("button", {
109
- type: "button",
110
- onClick: () => S("/investor/opportunities"),
111
- className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
112
- children: "Browse Opportunities"
113
- })
114
- }) : /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("h3", {
115
- className: "mb-4 text-base font-semibold text-text-primary",
116
- children: "Allocation by Cart"
117
- }), /* @__PURE__ */ _("div", {
118
- className: "space-y-3",
119
- children: Object.entries(N).map(([e, t]) => /* @__PURE__ */ v("div", {
120
- className: "flex items-center",
163
+ /* @__PURE__ */ y("h2", {
164
+ className: "mb-4 text-lg font-semibold text-text-primary",
165
+ children: "Your Holdings"
166
+ }),
167
+ /* @__PURE__ */ y("div", {
168
+ className: "hidden overflow-x-auto md:block",
169
+ children: /* @__PURE__ */ b("table", {
170
+ className: "w-full text-sm",
171
+ children: [/* @__PURE__ */ y("thead", { children: /* @__PURE__ */ b("tr", {
172
+ className: "border-b border-border-subtle text-left text-xs text-text-secondary",
121
173
  children: [
122
- /* @__PURE__ */ _("span", {
123
- className: "w-40 truncate text-sm text-text-primary",
124
- children: e
174
+ /* @__PURE__ */ y("th", {
175
+ className: "pb-3 pr-4 font-medium",
176
+ children: "Merchant"
125
177
  }),
126
- /* @__PURE__ */ _("div", {
127
- className: "mx-3 h-6 flex-1 rounded-full bg-bg-sunken overflow-hidden",
128
- children: /* @__PURE__ */ _("div", {
129
- className: "flex h-6 items-center justify-end rounded-full bg-action-primary-bg pr-2",
130
- style: { width: `${k > 0 ? t / k * 100 : 0}%` },
131
- children: /* @__PURE__ */ v("span", {
132
- className: "text-xs font-medium text-action-primary-text",
133
- children: [k > 0 ? (t / k * 100).toFixed(1) : 0, "%"]
134
- })
135
- })
178
+ /* @__PURE__ */ y("th", {
179
+ className: "pb-3 pr-4 text-right font-medium",
180
+ children: "Invested"
136
181
  }),
137
- /* @__PURE__ */ _("span", {
138
- className: "ml-2 text-sm font-medium text-text-primary",
139
- children: o(t, { minimumFractionDigits: 0 })
140
- })
141
- ]
142
- }, e))
143
- })] })
144
- }),
145
- E === "investments" && /* @__PURE__ */ _("div", { children: w.length === 0 ? /* @__PURE__ */ _(i, {
146
- illustration: "empty-data",
147
- title: "No holdings to show",
148
- description: "You don't hold any investments yet. Explore opportunities to start building your portfolio.",
149
- action: /* @__PURE__ */ _("button", {
150
- type: "button",
151
- onClick: () => S("/investor/opportunities"),
152
- className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:bg-action-primary-bg/90 transition-colors",
153
- children: "Browse Opportunities"
154
- })
155
- }) : /* @__PURE__ */ _("div", {
156
- className: "space-y-4",
157
- children: w.map((e) => {
158
- let n = e.currentValue - e.investedAmount, r = e.investedAmount > 0 ? n / e.investedAmount * 100 : 0;
159
- return /* @__PURE__ */ v("div", {
160
- className: "rounded-lg border border-border-subtle p-4 hover:bg-accent/50 transition-colors",
161
- children: [
162
- /* @__PURE__ */ v("div", {
163
- className: "mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
164
- children: [/* @__PURE__ */ v("div", {
165
- className: "flex-1",
166
- children: [/* @__PURE__ */ _("h4", {
167
- className: "text-base font-semibold text-text-primary",
168
- children: e.cartName
169
- }), /* @__PURE__ */ _("p", {
170
- className: "mt-1 text-sm capitalize text-text-secondary",
171
- children: e.status
172
- })]
173
- }), /* @__PURE__ */ v("div", {
174
- className: "text-left sm:text-right",
175
- children: [/* @__PURE__ */ _("p", {
176
- className: "text-xl font-bold text-text-primary",
177
- children: o(e.currentValue, { minimumFractionDigits: 0 })
178
- }), /* @__PURE__ */ v("p", {
179
- className: t("text-sm", n >= 0 ? "text-status-success-text" : "text-status-error-text"),
180
- children: [
181
- o(Math.abs(n), { minimumFractionDigits: 0 }),
182
- " (",
183
- x(r),
184
- ")"
185
- ]
186
- })]
187
- })]
182
+ /* @__PURE__ */ y("th", {
183
+ className: "pb-3 pr-4 text-right font-medium",
184
+ children: "Current Value"
188
185
  }),
189
- /* @__PURE__ */ v("div", {
190
- className: "mb-4 grid grid-cols-2 gap-3 lg:grid-cols-4",
191
- children: [
192
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
193
- className: "text-xs text-text-secondary",
194
- children: "Invested"
195
- }), /* @__PURE__ */ _("p", {
196
- className: "text-sm font-medium text-text-primary",
197
- children: o(e.investedAmount, { minimumFractionDigits: 0 })
198
- })] }),
199
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
200
- className: "text-xs text-text-secondary",
201
- children: "Returns"
202
- }), /* @__PURE__ */ _("p", {
203
- className: "text-sm font-medium text-text-primary",
204
- children: o(e.returns, { minimumFractionDigits: 0 })
205
- })] }),
206
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
207
- className: "text-xs text-text-secondary",
208
- children: "Expected Return"
209
- }), /* @__PURE__ */ v("p", {
210
- className: "text-sm font-medium text-text-primary",
211
- children: [e.returnsPercentage, "%"]
212
- })] }),
213
- /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("p", {
214
- className: "text-xs text-text-secondary",
215
- children: "Investment Date"
216
- }), /* @__PURE__ */ _("p", {
217
- className: "text-sm font-medium text-text-primary",
218
- children: s(e.investmentDate, {
219
- hour: void 0,
220
- minute: void 0
221
- })
222
- })] })
223
- ]
186
+ /* @__PURE__ */ y("th", {
187
+ className: "pb-3 pr-4 text-right font-medium",
188
+ children: "Returns"
224
189
  }),
225
- /* @__PURE__ */ _("div", {
226
- className: "flex flex-wrap gap-2",
227
- children: /* @__PURE__ */ v("button", {
228
- type: "button",
229
- onClick: () => S(`/investor/investments/${e.id}`),
230
- className: "flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
231
- children: [/* @__PURE__ */ _(p, { className: "h-4 w-4" }), "View Details"]
232
- })
190
+ /* @__PURE__ */ y("th", {
191
+ className: "pb-3 pr-4 font-medium",
192
+ children: "Status"
193
+ }),
194
+ /* @__PURE__ */ y("th", {
195
+ className: "pb-3 font-medium",
196
+ "aria-label": "actions"
233
197
  })
234
198
  ]
199
+ }) }), /* @__PURE__ */ y("tbody", { children: O.map((e) => {
200
+ let n = e.currentValue - e.investedAmount, r = e.investedAmount > 0 ? n / e.investedAmount * 100 : 0;
201
+ return /* @__PURE__ */ b("tr", {
202
+ className: "border-b border-border-subtle/60 last:border-0",
203
+ children: [
204
+ /* @__PURE__ */ y("td", {
205
+ className: "py-3 pr-4 font-medium text-text-primary",
206
+ children: e.cartName
207
+ }),
208
+ /* @__PURE__ */ y("td", {
209
+ className: "py-3 pr-4 text-right tabular-nums text-text-primary",
210
+ children: a(e.investedAmount, { minimumFractionDigits: 0 })
211
+ }),
212
+ /* @__PURE__ */ y("td", {
213
+ className: "py-3 pr-4 text-right tabular-nums text-text-primary",
214
+ children: a(e.currentValue, { minimumFractionDigits: 0 })
215
+ }),
216
+ /* @__PURE__ */ y("td", {
217
+ className: t("py-3 pr-4 text-right font-medium tabular-nums", n >= 0 ? "text-status-success-text" : "text-status-error-text"),
218
+ children: w(r)
219
+ }),
220
+ /* @__PURE__ */ y("td", {
221
+ className: "py-3 pr-4",
222
+ children: /* @__PURE__ */ b("span", {
223
+ className: "inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-xs font-medium capitalize text-status-success-text",
224
+ children: [/* @__PURE__ */ y("span", { className: "h-1.5 w-1.5 rounded-full bg-status-success-text" }), e.status]
225
+ })
226
+ }),
227
+ /* @__PURE__ */ y("td", {
228
+ className: "py-3 text-right",
229
+ children: /* @__PURE__ */ b("button", {
230
+ type: "button",
231
+ onClick: () => E(`/investor/investments/${e.id}`),
232
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-accent transition-colors",
233
+ children: [/* @__PURE__ */ y(m, { className: "h-3.5 w-3.5" }), "View"]
234
+ })
235
+ })
236
+ ]
237
+ }, e.id);
238
+ }) })]
239
+ })
240
+ }),
241
+ /* @__PURE__ */ y("div", {
242
+ className: "space-y-3 md:hidden",
243
+ children: O.map((e) => {
244
+ let n = e.currentValue - e.investedAmount, r = e.investedAmount > 0 ? n / e.investedAmount * 100 : 0;
245
+ return /* @__PURE__ */ b("button", {
246
+ type: "button",
247
+ onClick: () => E(`/investor/investments/${e.id}`),
248
+ className: "w-full rounded-lg border border-border-subtle p-4 text-left transition-colors hover:bg-accent/50",
249
+ children: [/* @__PURE__ */ b("div", {
250
+ className: "flex items-start justify-between gap-3",
251
+ children: [/* @__PURE__ */ y("span", {
252
+ className: "font-medium text-text-primary",
253
+ children: e.cartName
254
+ }), /* @__PURE__ */ y("span", {
255
+ className: t("text-sm font-semibold tabular-nums", n >= 0 ? "text-status-success-text" : "text-status-error-text"),
256
+ children: w(r)
257
+ })]
258
+ }), /* @__PURE__ */ b("div", {
259
+ className: "mt-3 grid grid-cols-2 gap-3 text-sm",
260
+ children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
261
+ className: "text-xs text-text-secondary",
262
+ children: "Invested"
263
+ }), /* @__PURE__ */ y("p", {
264
+ className: "font-medium text-text-primary",
265
+ children: a(e.investedAmount, { minimumFractionDigits: 0 })
266
+ })] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
267
+ className: "text-xs text-text-secondary",
268
+ children: "Current Value"
269
+ }), /* @__PURE__ */ y("p", {
270
+ className: "font-medium text-text-primary",
271
+ children: a(e.currentValue, { minimumFractionDigits: 0 })
272
+ })] })]
273
+ })]
235
274
  }, e.id);
236
275
  })
237
- }) }),
238
- E === "transactions" && /* @__PURE__ */ _(i, {
239
- illustration: "empty-data",
240
- title: "No transaction history yet",
241
- description: "A detailed ledger of your investments, dividends and withdrawals will appear here as your activity builds up."
242
276
  })
243
277
  ]
278
+ }), /* @__PURE__ */ b(S, {
279
+ treatment: "plain",
280
+ className: "p-5 sm:p-6",
281
+ children: [/* @__PURE__ */ y("h2", {
282
+ className: "mb-4 text-lg font-semibold text-text-primary",
283
+ children: "Recent Activity"
284
+ }), /* @__PURE__ */ y("ul", {
285
+ className: "space-y-4",
286
+ children: L.map((e) => /* @__PURE__ */ b("li", {
287
+ className: "flex items-start gap-3",
288
+ children: [/* @__PURE__ */ y("span", {
289
+ className: "mt-0.5 flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-[var(--color-accent-soft)]",
290
+ children: /* @__PURE__ */ y(p, { className: "h-4 w-4 text-text-primary" })
291
+ }), /* @__PURE__ */ b("div", {
292
+ className: "min-w-0 flex-1",
293
+ children: [/* @__PURE__ */ b("div", {
294
+ className: "flex items-baseline justify-between gap-2",
295
+ children: [/* @__PURE__ */ b("p", {
296
+ className: "truncate text-sm font-medium text-text-primary",
297
+ children: ["Invested · ", e.cartName]
298
+ }), /* @__PURE__ */ y("span", {
299
+ className: "shrink-0 text-sm font-semibold tabular-nums text-text-primary",
300
+ children: a(e.investedAmount, {
301
+ minimumFractionDigits: 0,
302
+ notation: "compact"
303
+ })
304
+ })]
305
+ }), /* @__PURE__ */ b("div", {
306
+ className: "mt-0.5 flex items-center gap-2 text-xs text-text-secondary",
307
+ children: [/* @__PURE__ */ y("span", { children: o(e.investmentDate, {
308
+ hour: void 0,
309
+ minute: void 0
310
+ }) }), /* @__PURE__ */ b("span", {
311
+ className: "inline-flex items-center gap-1 capitalize text-status-success-text",
312
+ children: [/* @__PURE__ */ y(f, { className: "h-3 w-3" }), e.status]
313
+ })]
314
+ })]
315
+ })]
316
+ }, e.id))
317
+ })]
244
318
  })]
245
- })
319
+ })] })
246
320
  ]
247
321
  });
248
322
  }
249
323
  //#endregion
250
- export { S as InvestorPortfolioPage };
324
+ export { E as InvestorPortfolioPage };
251
325
 
252
326
  //# sourceMappingURL=InvestorPortfolioPage.js.map