@burdenoff/microfe-subscriberbot 2026.624.1 → 2026.626.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/subscriberbot/components/EmptyState.js +17 -10
- package/dist/subscriberbot/components/EmptyState.js.map +1 -1
- package/dist/subscriberbot/components/InvestmentCard.js +23 -22
- package/dist/subscriberbot/components/InvestmentCard.js.map +1 -1
- package/dist/subscriberbot/components/MetricsCard.js +15 -12
- package/dist/subscriberbot/components/MetricsCard.js.map +1 -1
- package/dist/subscriberbot/components/PageLayout.js +27 -15
- package/dist/subscriberbot/components/PageLayout.js.map +1 -1
- package/dist/subscriberbot/components/RatingDisplay.js +3 -3
- package/dist/subscriberbot/components/RatingDisplay.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +25 -13
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/context/SubscriberBotContext.js.map +1 -1
- package/dist/subscriberbot/pages/HomePage.js +72 -63
- package/dist/subscriberbot/pages/HomePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js +106 -100
- package/dist/subscriberbot/pages/admin/AdminAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminDashboard.js +125 -85
- package/dist/subscriberbot/pages/admin/AdminDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js +51 -45
- package/dist/subscriberbot/pages/admin/AdminFinancialPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js +246 -241
- package/dist/subscriberbot/pages/admin/AdminOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js +131 -129
- package/dist/subscriberbot/pages/admin/AdminProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js +247 -242
- package/dist/subscriberbot/pages/admin/AdminSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/CartManagementPage.js +307 -302
- package/dist/subscriberbot/pages/admin/CartManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/admin/UserManagementPage.js +308 -303
- package/dist/subscriberbot/pages/admin/UserManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js +89 -84
- package/dist/subscriberbot/pages/cart-owner/AnalyticsDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js +269 -264
- package/dist/subscriberbot/pages/cart-owner/BusinessSettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js +269 -227
- package/dist/subscriberbot/pages/cart-owner/CartOwnerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js +191 -186
- package/dist/subscriberbot/pages/cart-owner/CartOwnerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js +168 -166
- package/dist/subscriberbot/pages/cart-owner/CartServiceConfigPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js +344 -347
- package/dist/subscriberbot/pages/cart-owner/InventoryManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js +270 -272
- package/dist/subscriberbot/pages/cart-owner/OrderManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js +294 -289
- package/dist/subscriberbot/pages/cart-owner/StaffManagementPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/HelpSupportPage.js +156 -158
- package/dist/subscriberbot/pages/common/HelpSupportPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js +94 -87
- package/dist/subscriberbot/pages/common/NotificationCenterPage.js.map +1 -1
- package/dist/subscriberbot/pages/common/SettingsPage.js +749 -740
- package/dist/subscriberbot/pages/common/SettingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js +357 -324
- package/dist/subscriberbot/pages/customer/BookingDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDetailPage.js +281 -247
- package/dist/subscriberbot/pages/customer/CartDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js +106 -98
- package/dist/subscriberbot/pages/customer/CartDiscoveryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CheckoutPage.js +235 -238
- package/dist/subscriberbot/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js +426 -390
- package/dist/subscriberbot/pages/customer/CustomerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js +488 -479
- package/dist/subscriberbot/pages/customer/CustomerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js +522 -512
- package/dist/subscriberbot/pages/customer/DirectServiceBookingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/FavoritesPage.js +73 -66
- package/dist/subscriberbot/pages/customer/FavoritesPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js +75 -67
- package/dist/subscriberbot/pages/customer/OrderHistoryPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js +82 -76
- package/dist/subscriberbot/pages/customer/OrderTrackingPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js +100 -93
- package/dist/subscriberbot/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/ReviewsPage.js +97 -90
- package/dist/subscriberbot/pages/customer/ReviewsPage.js.map +1 -1
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js +86 -79
- package/dist/subscriberbot/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js +330 -293
- package/dist/subscriberbot/pages/investor/InvestmentDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js +269 -261
- package/dist/subscriberbot/pages/investor/InvestmentOpportunitiesPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js +97 -91
- package/dist/subscriberbot/pages/investor/InvestorAnalyticsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js +354 -322
- package/dist/subscriberbot/pages/investor/InvestorDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js +118 -111
- package/dist/subscriberbot/pages/investor/InvestorInvestmentsPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js +75 -69
- package/dist/subscriberbot/pages/investor/InvestorPortfolioPage.js.map +1 -1
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js +435 -430
- package/dist/subscriberbot/pages/investor/InvestorProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js +328 -289
- package/dist/subscriberbot/pages/worker/TaskDetailsPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js +135 -103
- package/dist/subscriberbot/pages/worker/WorkerDashboard.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js +120 -114
- package/dist/subscriberbot/pages/worker/WorkerOrdersPage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js +125 -120
- package/dist/subscriberbot/pages/worker/WorkerProfilePage.js.map +1 -1
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js +354 -344
- package/dist/subscriberbot/pages/worker/WorkerSchedulePage.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,28 +1,35 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { IllustratedEmptyState as r } from "@burdenoff/fe-libs/ui";
|
|
3
4
|
//#region src/subscriberbot/components/EmptyState.tsx
|
|
4
|
-
var
|
|
5
|
-
|
|
5
|
+
var i = ({ icon: i, illustration: a, title: o, description: s, action: c, className: l }) => a ? /* @__PURE__ */ t(r, {
|
|
6
|
+
illustration: a,
|
|
7
|
+
title: o,
|
|
8
|
+
description: s,
|
|
9
|
+
action: c,
|
|
10
|
+
className: l
|
|
11
|
+
}) : /* @__PURE__ */ n("div", {
|
|
12
|
+
className: e("flex flex-col items-center justify-center py-12 px-4 text-center", l),
|
|
6
13
|
children: [
|
|
7
|
-
|
|
14
|
+
i && /* @__PURE__ */ t("div", {
|
|
8
15
|
className: "mb-4 text-text-secondary opacity-50",
|
|
9
|
-
children:
|
|
16
|
+
children: i
|
|
10
17
|
}),
|
|
11
18
|
/* @__PURE__ */ t("h3", {
|
|
12
19
|
className: "text-lg font-medium text-text-primary",
|
|
13
|
-
children:
|
|
20
|
+
children: o
|
|
14
21
|
}),
|
|
15
|
-
|
|
22
|
+
s && /* @__PURE__ */ t("p", {
|
|
16
23
|
className: "mt-2 text-sm text-text-secondary max-w-sm",
|
|
17
|
-
children:
|
|
24
|
+
children: s
|
|
18
25
|
}),
|
|
19
|
-
|
|
26
|
+
c && /* @__PURE__ */ t("div", {
|
|
20
27
|
className: "mt-6",
|
|
21
|
-
children:
|
|
28
|
+
children: c
|
|
22
29
|
})
|
|
23
30
|
]
|
|
24
31
|
});
|
|
25
32
|
//#endregion
|
|
26
|
-
export {
|
|
33
|
+
export { i as EmptyState };
|
|
27
34
|
|
|
28
35
|
//# sourceMappingURL=EmptyState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/subscriberbot/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module subscriberbot/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({\n icon,\n title,\n description,\n action,\n className,\n}) => {\n return (\n <div\n className={cn('flex flex-col items-center justify-center py-12 px-4 text-center', className)}\n >\n {icon && <div className=\"mb-4 text-text-secondary opacity-50\">{icon}</div>}\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {description && <p className=\"mt-2 text-sm text-text-secondary max-w-sm\">{description}</p>}\n {action && <div className=\"mt-6\">{action}</div>}\n </div>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/subscriberbot/components/EmptyState.tsx"],"sourcesContent":["/**\n * Empty State Component\n * @module subscriberbot/components\n *\n * Boff UI 2.0 zero-state. When an `illustration` name is provided it renders the\n * fe-libs {@link IllustratedEmptyState} (on-brand glass illustration); otherwise\n * it falls back to the icon-based layout. Host shell serves illustrations from\n * `/illustrations/<name>.webp`.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { IllustratedEmptyState } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface EmptyStateProps {\n icon?: ReactNode;\n /**\n * On-brand illustration name → `/illustrations/<name>.webp`. Standard names:\n * empty-data, empty-search, empty-files, empty-people, empty-notifications,\n * onboarding, empty-generic.\n */\n illustration?: string;\n title: string;\n description?: string;\n action?: ReactNode;\n className?: string;\n}\n\nexport const EmptyState: FC<EmptyStateProps> = ({\n icon,\n illustration,\n title,\n description,\n action,\n className,\n}) => {\n if (illustration) {\n return (\n <IllustratedEmptyState\n illustration={illustration}\n title={title}\n description={description}\n action={action}\n className={className}\n />\n );\n }\n\n return (\n <div\n className={cn('flex flex-col items-center justify-center py-12 px-4 text-center', className)}\n >\n {icon && <div className=\"mb-4 text-text-secondary opacity-50\">{icon}</div>}\n <h3 className=\"text-lg font-medium text-text-primary\">{title}</h3>\n {description && <p className=\"mt-2 text-sm text-text-secondary max-w-sm\">{description}</p>}\n {action && <div className=\"mt-6\">{action}</div>}\n </div>\n );\n};\n"],"mappings":";;;;AA4BA,IAAa,KAAmC,EAC9C,SACA,iBACA,UACA,gBACA,WACA,mBAEI,IAEA,kBAAC,GAAD;CACgB;CACP;CACM;CACL;CACG;CACX,CAAA,GAKJ,kBAAC,OAAD;CACE,WAAW,EAAG,oEAAoE,EAAU;WAD9F;EAGG,KAAQ,kBAAC,OAAD;GAAK,WAAU;aAAuC;GAAW,CAAA;EAC1E,kBAAC,MAAD;GAAI,WAAU;aAAyC;GAAW,CAAA;EACjE,KAAe,kBAAC,KAAD;GAAG,WAAU;aAA6C;GAAgB,CAAA;EACzF,KAAU,kBAAC,OAAD;GAAK,WAAU;aAAQ;GAAa,CAAA;EAC3C"}
|
|
@@ -2,44 +2,45 @@ import { cn as e } from "../utils/cn.js";
|
|
|
2
2
|
import { StatusBadge as t } from "./StatusBadge.js";
|
|
3
3
|
import { AlertTriangle as n, Shield as r, TrendingUp as i } from "lucide-react";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
import { GlassCard as s } from "@burdenoff/fe-libs/ui";
|
|
5
6
|
//#region src/subscriberbot/components/InvestmentCard.tsx
|
|
6
|
-
var
|
|
7
|
+
var c = {
|
|
7
8
|
low: {
|
|
8
9
|
label: "Low Risk",
|
|
9
10
|
icon: r,
|
|
10
|
-
color: "text-
|
|
11
|
+
color: "text-status-success-text"
|
|
11
12
|
},
|
|
12
13
|
medium: {
|
|
13
14
|
label: "Medium Risk",
|
|
14
15
|
icon: n,
|
|
15
|
-
color: "text-
|
|
16
|
+
color: "text-status-warning-text"
|
|
16
17
|
},
|
|
17
18
|
high: {
|
|
18
19
|
label: "High Risk",
|
|
19
20
|
icon: n,
|
|
20
|
-
color: "text-
|
|
21
|
+
color: "text-status-error-text"
|
|
21
22
|
}
|
|
22
|
-
},
|
|
23
|
-
let
|
|
23
|
+
}, l = ({ id: n, cartName: r, targetAmount: l, raisedAmount: u, currency: d = "INR", expectedReturns: f, riskLevel: p, status: m, onClick: h, className: g }) => {
|
|
24
|
+
let _ = l > 0 ? Math.min(u / l * 100, 100) : 0, v = c[p], y = v.icon, b = (e) => new Intl.NumberFormat(void 0, {
|
|
24
25
|
style: "currency",
|
|
25
|
-
currency:
|
|
26
|
+
currency: d,
|
|
26
27
|
maximumFractionDigits: 0
|
|
27
28
|
}).format(e);
|
|
28
|
-
return /* @__PURE__ */ o(
|
|
29
|
+
return /* @__PURE__ */ o(s, {
|
|
29
30
|
role: "button",
|
|
30
31
|
tabIndex: 0,
|
|
31
|
-
onClick: () =>
|
|
32
|
+
onClick: () => h?.(n),
|
|
32
33
|
onKeyDown: (e) => {
|
|
33
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
34
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), h?.(n));
|
|
34
35
|
},
|
|
35
|
-
className: e("
|
|
36
|
+
className: e("p-4 cursor-pointer", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", g),
|
|
36
37
|
children: [
|
|
37
38
|
/* @__PURE__ */ o("div", {
|
|
38
39
|
className: "flex items-start justify-between",
|
|
39
40
|
children: [/* @__PURE__ */ a("h3", {
|
|
40
41
|
className: "text-base font-semibold text-text-primary truncate",
|
|
41
42
|
children: r
|
|
42
|
-
}), /* @__PURE__ */ a(t, { status:
|
|
43
|
+
}), /* @__PURE__ */ a(t, { status: m })]
|
|
43
44
|
}),
|
|
44
45
|
/* @__PURE__ */ o("div", {
|
|
45
46
|
className: "mt-4",
|
|
@@ -50,20 +51,20 @@ var s = {
|
|
|
50
51
|
className: "text-text-secondary",
|
|
51
52
|
children: "Raised"
|
|
52
53
|
}), /* @__PURE__ */ o("span", {
|
|
53
|
-
className: "font-medium text-text-primary",
|
|
54
|
-
children: [Math.round(
|
|
54
|
+
className: "font-medium text-text-primary tabular-nums",
|
|
55
|
+
children: [Math.round(_), "%"]
|
|
55
56
|
})]
|
|
56
57
|
}),
|
|
57
58
|
/* @__PURE__ */ a("div", {
|
|
58
59
|
className: "mt-1.5 h-2 w-full rounded-full bg-bg-sunken overflow-hidden",
|
|
59
60
|
children: /* @__PURE__ */ a("div", {
|
|
60
61
|
className: "h-full rounded-full bg-action-primary-bg transition-all duration-300",
|
|
61
|
-
style: { width: `${
|
|
62
|
+
style: { width: `${_}%` }
|
|
62
63
|
})
|
|
63
64
|
}),
|
|
64
65
|
/* @__PURE__ */ o("div", {
|
|
65
|
-
className: "mt-1.5 flex items-center justify-between text-xs text-text-secondary",
|
|
66
|
-
children: [/* @__PURE__ */ a("span", { children:
|
|
66
|
+
className: "mt-1.5 flex items-center justify-between text-xs text-text-secondary tabular-nums",
|
|
67
|
+
children: [/* @__PURE__ */ a("span", { children: b(u) }), /* @__PURE__ */ a("span", { children: b(l) })]
|
|
67
68
|
})
|
|
68
69
|
]
|
|
69
70
|
}),
|
|
@@ -72,10 +73,10 @@ var s = {
|
|
|
72
73
|
children: [/* @__PURE__ */ o("div", {
|
|
73
74
|
className: "flex items-center gap-1.5 text-sm",
|
|
74
75
|
children: [
|
|
75
|
-
/* @__PURE__ */ a(i, { className: "h-3.5 w-3.5 text-
|
|
76
|
+
/* @__PURE__ */ a(i, { className: "h-3.5 w-3.5 text-status-success-text" }),
|
|
76
77
|
/* @__PURE__ */ a("span", {
|
|
77
78
|
className: "font-medium text-text-primary",
|
|
78
|
-
children:
|
|
79
|
+
children: f
|
|
79
80
|
}),
|
|
80
81
|
/* @__PURE__ */ a("span", {
|
|
81
82
|
className: "text-text-secondary",
|
|
@@ -83,14 +84,14 @@ var s = {
|
|
|
83
84
|
})
|
|
84
85
|
]
|
|
85
86
|
}), /* @__PURE__ */ o("div", {
|
|
86
|
-
className: e("flex items-center gap-1 text-xs font-medium",
|
|
87
|
-
children: [/* @__PURE__ */ a(
|
|
87
|
+
className: e("flex items-center gap-1 text-xs font-medium", v.color),
|
|
88
|
+
children: [/* @__PURE__ */ a(y, { className: "h-3.5 w-3.5" }), /* @__PURE__ */ a("span", { children: v.label })]
|
|
88
89
|
})]
|
|
89
90
|
})
|
|
90
91
|
]
|
|
91
92
|
});
|
|
92
93
|
};
|
|
93
94
|
//#endregion
|
|
94
|
-
export {
|
|
95
|
+
export { l as InvestmentCard };
|
|
95
96
|
|
|
96
97
|
//# sourceMappingURL=InvestmentCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvestmentCard.js","names":[],"sources":["../../../src/subscriberbot/components/InvestmentCard.tsx"],"sourcesContent":["/**\n * Investment Card Component\n * @module subscriberbot/components\n *\n * Displays an investment opportunity with cart name, target/raised amounts,\n * progress bar, expected returns, risk level, and status.\n */\n\nimport type { FC } from 'react';\nimport { TrendingUp, AlertTriangle, Shield } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport { StatusBadge } from './StatusBadge';\nimport type { InvestmentStatus, RiskLevel } from '../types';\n\ninterface InvestmentCardProps {\n id: string;\n cartName: string;\n targetAmount: number;\n raisedAmount: number;\n currency?: string;\n expectedReturns: string;\n riskLevel: RiskLevel;\n status: InvestmentStatus;\n onClick?: (id: string) => void;\n className?: string;\n}\n\nconst riskConfig: Record<RiskLevel, { label: string; icon: typeof Shield; color: string }> = {\n low: {\n label: 'Low Risk',\n icon: Shield,\n color: 'text-
|
|
1
|
+
{"version":3,"file":"InvestmentCard.js","names":[],"sources":["../../../src/subscriberbot/components/InvestmentCard.tsx"],"sourcesContent":["/**\n * Investment Card Component\n * @module subscriberbot/components\n *\n * Displays an investment opportunity with cart name, target/raised amounts,\n * progress bar, expected returns, risk level, and status.\n */\n\nimport type { FC } from 'react';\nimport { TrendingUp, AlertTriangle, Shield } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport { StatusBadge } from './StatusBadge';\nimport type { InvestmentStatus, RiskLevel } from '../types';\n\ninterface InvestmentCardProps {\n id: string;\n cartName: string;\n targetAmount: number;\n raisedAmount: number;\n currency?: string;\n expectedReturns: string;\n riskLevel: RiskLevel;\n status: InvestmentStatus;\n onClick?: (id: string) => void;\n className?: string;\n}\n\nconst riskConfig: Record<RiskLevel, { label: string; icon: typeof Shield; color: string }> = {\n low: {\n label: 'Low Risk',\n icon: Shield,\n color: 'text-status-success-text',\n },\n medium: {\n label: 'Medium Risk',\n icon: AlertTriangle,\n color: 'text-status-warning-text',\n },\n high: {\n label: 'High Risk',\n icon: AlertTriangle,\n color: 'text-status-error-text',\n },\n};\n\nexport const InvestmentCard: FC<InvestmentCardProps> = ({\n id,\n cartName,\n targetAmount,\n raisedAmount,\n currency = 'INR',\n expectedReturns,\n riskLevel,\n status,\n onClick,\n className,\n}) => {\n const progress = targetAmount > 0 ? Math.min((raisedAmount / targetAmount) * 100, 100) : 0;\n const risk = riskConfig[riskLevel];\n const RiskIcon = risk.icon;\n\n const formatAmount = (amount: number) =>\n new Intl.NumberFormat(undefined, {\n style: 'currency',\n currency,\n maximumFractionDigits: 0,\n }).format(amount);\n\n return (\n <GlassCard\n role=\"button\"\n tabIndex={0}\n onClick={() => onClick?.(id)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onClick?.(id);\n }\n }}\n className={cn(\n 'p-4 cursor-pointer',\n 'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]',\n className\n )}\n >\n {/* Header */}\n <div className=\"flex items-start justify-between\">\n <h3 className=\"text-base font-semibold text-text-primary truncate\">{cartName}</h3>\n <StatusBadge status={status} />\n </div>\n\n {/* Progress Bar */}\n <div className=\"mt-4\">\n <div className=\"flex items-center justify-between text-sm\">\n <span className=\"text-text-secondary\">Raised</span>\n <span className=\"font-medium text-text-primary tabular-nums\">\n {Math.round(progress)}%\n </span>\n </div>\n <div className=\"mt-1.5 h-2 w-full rounded-full bg-bg-sunken overflow-hidden\">\n <div\n className=\"h-full rounded-full bg-action-primary-bg transition-all duration-300\"\n style={{ width: `${progress}%` }}\n />\n </div>\n <div className=\"mt-1.5 flex items-center justify-between text-xs text-text-secondary tabular-nums\">\n <span>{formatAmount(raisedAmount)}</span>\n <span>{formatAmount(targetAmount)}</span>\n </div>\n </div>\n\n {/* Details */}\n <div className=\"mt-4 flex items-center justify-between\">\n <div className=\"flex items-center gap-1.5 text-sm\">\n <TrendingUp className=\"h-3.5 w-3.5 text-status-success-text\" />\n <span className=\"font-medium text-text-primary\">{expectedReturns}</span>\n <span className=\"text-text-secondary\">returns</span>\n </div>\n <div className={cn('flex items-center gap-1 text-xs font-medium', risk.color)}>\n <RiskIcon className=\"h-3.5 w-3.5\" />\n <span>{risk.label}</span>\n </div>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;;AA4BA,IAAM,IAAuF;CAC3F,KAAK;EACH,OAAO;EACP,MAAM;EACN,OAAO;EACR;CACD,QAAQ;EACN,OAAO;EACP,MAAM;EACN,OAAO;EACR;CACD,MAAM;EACJ,OAAO;EACP,MAAM;EACN,OAAO;EACR;CACF,EAEY,KAA2C,EACtD,OACA,aACA,iBACA,iBACA,cAAW,OACX,oBACA,cACA,WACA,YACA,mBACI;CACJ,IAAM,IAAW,IAAe,IAAI,KAAK,IAAK,IAAe,IAAgB,KAAK,IAAI,GAAG,GACnF,IAAO,EAAW,IAClB,IAAW,EAAK,MAEhB,KAAgB,MACpB,IAAI,KAAK,aAAa,KAAA,GAAW;EAC/B,OAAO;EACP;EACA,uBAAuB;EACxB,CAAC,CAAC,OAAO,EAAO;AAEnB,QACE,kBAAC,GAAD;EACE,MAAK;EACL,UAAU;EACV,eAAe,IAAU,EAAG;EAC5B,YAAY,MAAM;AAChB,IAAI,EAAE,QAAQ,WAAW,EAAE,QAAQ,SACjC,EAAE,gBAAgB,EAClB,IAAU,EAAG;;EAGjB,WAAW,EACT,sBACA,gGACA,EACD;YAdH;GAiBE,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,MAAD;KAAI,WAAU;eAAsD;KAAc,CAAA,EAClF,kBAAC,GAAD,EAAqB,WAAU,CAAA,CAC3B;;GAGN,kBAAC,OAAD;IAAK,WAAU;cAAf;KACE,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD;OAAM,WAAU;iBAAsB;OAAa,CAAA,EACnD,kBAAC,QAAD;OAAM,WAAU;iBAAhB,CACG,KAAK,MAAM,EAAS,EAAC,IACjB;SACH;;KACN,kBAAC,OAAD;MAAK,WAAU;gBACb,kBAAC,OAAD;OACE,WAAU;OACV,OAAO,EAAE,OAAO,GAAG,EAAS,IAAI;OAChC,CAAA;MACE,CAAA;KACN,kBAAC,OAAD;MAAK,WAAU;gBAAf,CACE,kBAAC,QAAD,EAAA,UAAO,EAAa,EAAa,EAAQ,CAAA,EACzC,kBAAC,QAAD,EAAA,UAAO,EAAa,EAAa,EAAQ,CAAA,CACrC;;KACF;;GAGN,kBAAC,OAAD;IAAK,WAAU;cAAf,CACE,kBAAC,OAAD;KAAK,WAAU;eAAf;MACE,kBAAC,GAAD,EAAY,WAAU,wCAAyC,CAAA;MAC/D,kBAAC,QAAD;OAAM,WAAU;iBAAiC;OAAuB,CAAA;MACxE,kBAAC,QAAD;OAAM,WAAU;iBAAsB;OAAc,CAAA;MAChD;QACN,kBAAC,OAAD;KAAK,WAAW,EAAG,+CAA+C,EAAK,MAAM;eAA7E,CACE,kBAAC,GAAD,EAAU,WAAU,eAAgB,CAAA,EACpC,kBAAC,QAAD,EAAA,UAAO,EAAK,OAAa,CAAA,CACrB;OACF;;GACI"}
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { Minus as t, TrendingDown as n, TrendingUp as r } from "lucide-react";
|
|
3
3
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
import { GlassCard as o } from "@burdenoff/fe-libs/ui";
|
|
4
5
|
//#region src/subscriberbot/components/MetricsCard.tsx
|
|
5
|
-
var
|
|
6
|
+
var s = {
|
|
6
7
|
up: {
|
|
7
8
|
icon: r,
|
|
8
|
-
color: "text-
|
|
9
|
+
color: "text-status-success-text"
|
|
9
10
|
},
|
|
10
11
|
down: {
|
|
11
12
|
icon: n,
|
|
12
|
-
color: "text-
|
|
13
|
+
color: "text-status-error-text"
|
|
13
14
|
},
|
|
14
15
|
neutral: {
|
|
15
16
|
icon: t,
|
|
16
17
|
color: "text-text-secondary"
|
|
17
18
|
}
|
|
18
|
-
},
|
|
19
|
-
let
|
|
20
|
-
return /* @__PURE__ */ a(
|
|
21
|
-
|
|
19
|
+
}, c = ({ icon: t, value: n, label: r, trend: c, trendValue: l, className: u, featured: d = !1 }) => {
|
|
20
|
+
let f = c ? s[c] : null, p = f?.icon;
|
|
21
|
+
return /* @__PURE__ */ a(o, {
|
|
22
|
+
treatment: d ? "glass" : "metric",
|
|
23
|
+
glow: d,
|
|
24
|
+
className: e("p-6", u),
|
|
22
25
|
children: [/* @__PURE__ */ a("div", {
|
|
23
26
|
className: "flex items-center justify-between",
|
|
24
27
|
children: [/* @__PURE__ */ i("div", {
|
|
25
28
|
className: "text-text-secondary",
|
|
26
29
|
children: t
|
|
27
|
-
}),
|
|
28
|
-
className: e("flex items-center gap-1 text-xs font-medium",
|
|
29
|
-
children: [/* @__PURE__ */ i(
|
|
30
|
+
}), c && f && p && /* @__PURE__ */ a("div", {
|
|
31
|
+
className: e("flex items-center gap-1 text-xs font-medium", f.color),
|
|
32
|
+
children: [/* @__PURE__ */ i(p, { className: "h-3.5 w-3.5" }), l && /* @__PURE__ */ i("span", { children: l })]
|
|
30
33
|
})]
|
|
31
34
|
}), /* @__PURE__ */ a("div", {
|
|
32
35
|
className: "mt-3",
|
|
33
36
|
children: [/* @__PURE__ */ i("p", {
|
|
34
|
-
className: "text-2xl font-bold text-text-primary",
|
|
37
|
+
className: "text-2xl font-bold text-text-primary tabular-nums",
|
|
35
38
|
children: n
|
|
36
39
|
}), /* @__PURE__ */ i("p", {
|
|
37
40
|
className: "mt-1 text-sm text-text-secondary",
|
|
@@ -41,6 +44,6 @@ var o = {
|
|
|
41
44
|
});
|
|
42
45
|
};
|
|
43
46
|
//#endregion
|
|
44
|
-
export {
|
|
47
|
+
export { c as MetricsCard };
|
|
45
48
|
|
|
46
49
|
//# sourceMappingURL=MetricsCard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MetricsCard.js","names":[],"sources":["../../../src/subscriberbot/components/MetricsCard.tsx"],"sourcesContent":["/**\n * Metrics Card Component\n * @module subscriberbot/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { TrendingUp, TrendingDown, Minus } from 'lucide-react';\nimport { cn } from '../utils/cn';\nimport type { TrendDirection } from '../types';\n\ninterface MetricsCardProps {\n icon: ReactNode;\n value: string | number;\n label: string;\n trend?: TrendDirection;\n trendValue?: string;\n className?: string;\n}\n\nconst trendConfig: Record<TrendDirection, { icon: typeof TrendingUp; color: string }> = {\n up: { icon: TrendingUp, color: 'text-
|
|
1
|
+
{"version":3,"file":"MetricsCard.js","names":[],"sources":["../../../src/subscriberbot/components/MetricsCard.tsx"],"sourcesContent":["/**\n * Metrics Card Component\n * @module subscriberbot/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { TrendingUp, TrendingDown, Minus } from 'lucide-react';\nimport { GlassCard } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\nimport type { TrendDirection } from '../types';\n\ninterface MetricsCardProps {\n icon: ReactNode;\n value: string | number;\n label: string;\n trend?: TrendDirection;\n trendValue?: string;\n className?: string;\n /** Render as the page's hero metric (glass treatment + accent glow). */\n featured?: boolean;\n}\n\nconst trendConfig: Record<TrendDirection, { icon: typeof TrendingUp; color: string }> = {\n up: { icon: TrendingUp, color: 'text-status-success-text' },\n down: { icon: TrendingDown, color: 'text-status-error-text' },\n neutral: { icon: Minus, color: 'text-text-secondary' },\n};\n\nexport const MetricsCard: FC<MetricsCardProps> = ({\n icon,\n value,\n label,\n trend,\n trendValue,\n className,\n featured = false,\n}) => {\n const trendInfo = trend ? trendConfig[trend] : null;\n const TrendIcon = trendInfo?.icon;\n\n return (\n <GlassCard\n treatment={featured ? 'glass' : 'metric'}\n glow={featured}\n className={cn('p-6', className)}\n >\n <div className=\"flex items-center justify-between\">\n <div className=\"text-text-secondary\">{icon}</div>\n {trend && trendInfo && TrendIcon && (\n <div className={cn('flex items-center gap-1 text-xs font-medium', trendInfo.color)}>\n <TrendIcon className=\"h-3.5 w-3.5\" />\n {trendValue && <span>{trendValue}</span>}\n </div>\n )}\n </div>\n <div className=\"mt-3\">\n <p className=\"text-2xl font-bold text-text-primary tabular-nums\">{value}</p>\n <p className=\"mt-1 text-sm text-text-secondary\">{label}</p>\n </div>\n </GlassCard>\n );\n};\n"],"mappings":";;;;;AAsBA,IAAM,IAAkF;CACtF,IAAI;EAAE,MAAM;EAAY,OAAO;EAA4B;CAC3D,MAAM;EAAE,MAAM;EAAc,OAAO;EAA0B;CAC7D,SAAS;EAAE,MAAM;EAAO,OAAO;EAAuB;CACvD,EAEY,KAAqC,EAChD,SACA,UACA,UACA,UACA,eACA,cACA,cAAW,SACP;CACJ,IAAM,IAAY,IAAQ,EAAY,KAAS,MACzC,IAAY,GAAW;AAE7B,QACE,kBAAC,GAAD;EACE,WAAW,IAAW,UAAU;EAChC,MAAM;EACN,WAAW,EAAG,OAAO,EAAU;YAHjC,CAKE,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,OAAD;IAAK,WAAU;cAAuB;IAAW,CAAA,EAChD,KAAS,KAAa,KACrB,kBAAC,OAAD;IAAK,WAAW,EAAG,+CAA+C,EAAU,MAAM;cAAlF,CACE,kBAAC,GAAD,EAAW,WAAU,eAAgB,CAAA,EACpC,KAAc,kBAAC,QAAD,EAAA,UAAO,GAAkB,CAAA,CACpC;MAEJ;MACN,kBAAC,OAAD;GAAK,WAAU;aAAf,CACE,kBAAC,KAAD;IAAG,WAAU;cAAqD;IAAU,CAAA,EAC5E,kBAAC,KAAD;IAAG,WAAU;cAAoC;IAAU,CAAA,CACvD;KACI"}
|
|
@@ -1,26 +1,38 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
2
|
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
|
+
import { AuroraBackground as r, GradientText as i } from "@burdenoff/fe-libs/ui";
|
|
3
4
|
//#region src/subscriberbot/components/PageLayout.tsx
|
|
4
|
-
var
|
|
5
|
-
className: e("flex flex-col h-full",
|
|
5
|
+
var a = ({ title: a, description: o, actions: s, children: c, className: l, titleGradient: u = !1, aurora: d = !1 }) => /* @__PURE__ */ n("div", {
|
|
6
|
+
className: e("flex flex-col h-full", l),
|
|
6
7
|
children: [/* @__PURE__ */ n("div", {
|
|
7
|
-
className: "flex items-center justify-between px-6 py-4 border-b border-border-
|
|
8
|
-
children: [
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
className: e("relative flex items-center justify-between gap-4 px-6 py-4 border-b border-border-seam", d ? "overflow-hidden bg-gloss-card" : "bg-bg-surface"),
|
|
9
|
+
children: [
|
|
10
|
+
d && /* @__PURE__ */ t(r, { intensity: "subtle" }),
|
|
11
|
+
/* @__PURE__ */ n("div", {
|
|
12
|
+
className: "min-w-0",
|
|
13
|
+
children: [u && typeof a == "string" ? /* @__PURE__ */ t(i, {
|
|
14
|
+
as: "h1",
|
|
15
|
+
className: "text-2xl font-semibold tracking-tight",
|
|
16
|
+
children: a
|
|
17
|
+
}) : /* @__PURE__ */ t("h1", {
|
|
18
|
+
className: "text-2xl font-semibold text-text-primary",
|
|
19
|
+
children: a
|
|
20
|
+
}), o && /* @__PURE__ */ t("p", {
|
|
21
|
+
className: "mt-1 text-sm text-text-secondary",
|
|
22
|
+
children: o
|
|
23
|
+
})]
|
|
24
|
+
}),
|
|
25
|
+
s && /* @__PURE__ */ t("div", {
|
|
26
|
+
className: "flex items-center gap-3 shrink-0",
|
|
27
|
+
children: s
|
|
28
|
+
})
|
|
29
|
+
]
|
|
18
30
|
}), /* @__PURE__ */ t("div", {
|
|
19
31
|
className: "flex-1 overflow-auto p-6",
|
|
20
|
-
children:
|
|
32
|
+
children: c
|
|
21
33
|
})]
|
|
22
34
|
});
|
|
23
35
|
//#endregion
|
|
24
|
-
export {
|
|
36
|
+
export { a as PageLayout };
|
|
25
37
|
|
|
26
38
|
//# sourceMappingURL=PageLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/subscriberbot/components/PageLayout.tsx"],"sourcesContent":["/**\n * Page Layout Component\n * @module subscriberbot/components\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: string;\n actions?: ReactNode;\n children: ReactNode;\n className?: string;\n}\n\nexport const PageLayout: FC<PageLayoutProps> = ({\n title,\n description,\n actions,\n children,\n className,\n}) => {\n return (\n <div className={cn('flex flex-col h-full', className)}>\n {/* Page Header */}\n <div
|
|
1
|
+
{"version":3,"file":"PageLayout.js","names":[],"sources":["../../../src/subscriberbot/components/PageLayout.tsx"],"sourcesContent":["/**\n * Page Layout Component\n * @module subscriberbot/components\n *\n * Boff UI 2.0 page wrapper. Supports a living-glass {@link AuroraBackground}\n * hero backdrop and a gradient hero title for the MFE's primary page.\n */\n\nimport type { FC, ReactNode } from 'react';\nimport { AuroraBackground, GradientText } from '@burdenoff/fe-libs/ui';\nimport { cn } from '../utils/cn';\n\ninterface PageLayoutProps {\n title: ReactNode;\n description?: string;\n actions?: ReactNode;\n children: ReactNode;\n className?: string;\n /**\n * Render the title as a gradient hero heading (Boff UI 2.0). Reserve for the\n * ONE primary page of the MFE so it stays a hero accent, never body copy.\n */\n titleGradient?: boolean;\n /**\n * Drop a subtle living-glass {@link AuroraBackground} behind the header.\n * Use on the MFE's primary page only (one aurora per MFE). Sits at -z-10 and\n * never moves content; auto-static under reduced motion.\n */\n aurora?: boolean;\n}\n\nexport const PageLayout: FC<PageLayoutProps> = ({\n title,\n description,\n actions,\n children,\n className,\n titleGradient = false,\n aurora = false,\n}) => {\n return (\n <div className={cn('flex flex-col h-full', className)}>\n {/* Page Header — optionally on a living-glass aurora hero backdrop. The\n aurora layer sits at -z-10 and never moves content. */}\n <div\n className={cn(\n 'relative flex items-center justify-between gap-4 px-6 py-4 border-b border-border-seam',\n aurora ? 'overflow-hidden bg-gloss-card' : 'bg-bg-surface'\n )}\n >\n {aurora && <AuroraBackground intensity=\"subtle\" />}\n <div className=\"min-w-0\">\n {titleGradient && typeof title === 'string' ? (\n <GradientText as=\"h1\" className=\"text-2xl font-semibold tracking-tight\">\n {title}\n </GradientText>\n ) : (\n <h1 className=\"text-2xl font-semibold text-text-primary\">{title}</h1>\n )}\n {description && <p className=\"mt-1 text-sm text-text-secondary\">{description}</p>}\n </div>\n {actions && <div className=\"flex items-center gap-3 shrink-0\">{actions}</div>}\n </div>\n\n {/* Page Content */}\n <div className=\"flex-1 overflow-auto p-6\">{children}</div>\n </div>\n );\n};\n"],"mappings":";;;;AA+BA,IAAa,KAAmC,EAC9C,UACA,gBACA,YACA,aACA,cACA,mBAAgB,IAChB,YAAS,SAGP,kBAAC,OAAD;CAAK,WAAW,EAAG,wBAAwB,EAAU;WAArD,CAGE,kBAAC,OAAD;EACE,WAAW,EACT,0FACA,IAAS,kCAAkC,gBAC5C;YAJH;GAMG,KAAU,kBAAC,GAAD,EAAkB,WAAU,UAAW,CAAA;GAClD,kBAAC,OAAD;IAAK,WAAU;cAAf,CACG,KAAiB,OAAO,KAAU,WACjC,kBAAC,GAAD;KAAc,IAAG;KAAK,WAAU;eAC7B;KACY,CAAA,GAEf,kBAAC,MAAD;KAAI,WAAU;eAA4C;KAAW,CAAA,EAEtE,KAAe,kBAAC,KAAD;KAAG,WAAU;eAAoC;KAAgB,CAAA,CAC7E;;GACL,KAAW,kBAAC,OAAD;IAAK,WAAU;cAAoC;IAAc,CAAA;GACzE;KAGN,kBAAC,OAAD;EAAK,WAAU;EAA4B;EAAe,CAAA,CACtD"}
|
|
@@ -11,15 +11,15 @@ var i = ({ value: i, count: a, maxStars: o = 5, size: s = "sm", className: c })
|
|
|
11
11
|
className: "flex items-center",
|
|
12
12
|
children: Array.from({ length: o }, (r, i) => {
|
|
13
13
|
let a = i < Math.floor(u);
|
|
14
|
-
return /* @__PURE__ */ n(t, { className: e(l, a ? "fill-
|
|
14
|
+
return /* @__PURE__ */ n(t, { className: e(l, a ? "fill-status-warning-text text-status-warning-text" : !a && i < u ? "fill-status-warning-text/50 text-status-warning-text" : "fill-none text-text-secondary/40") }, i);
|
|
15
15
|
})
|
|
16
16
|
}),
|
|
17
17
|
/* @__PURE__ */ n("span", {
|
|
18
|
-
className: "text-xs font-medium text-text-primary",
|
|
18
|
+
className: "text-xs font-medium text-text-primary tabular-nums",
|
|
19
19
|
children: u.toFixed(1)
|
|
20
20
|
}),
|
|
21
21
|
a !== void 0 && /* @__PURE__ */ r("span", {
|
|
22
|
-
className: "text-xs text-text-secondary",
|
|
22
|
+
className: "text-xs text-text-secondary tabular-nums",
|
|
23
23
|
children: [
|
|
24
24
|
"(",
|
|
25
25
|
a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RatingDisplay.js","names":[],"sources":["../../../src/subscriberbot/components/RatingDisplay.tsx"],"sourcesContent":["/**\n * Rating Display Component\n * @module subscriberbot/components\n *\n * Star rating display with value and review count.\n */\n\nimport type { FC } from 'react';\nimport { Star } from 'lucide-react';\nimport { cn } from '../utils/cn';\n\ninterface RatingDisplayProps {\n value: number;\n count?: number;\n maxStars?: number;\n size?: 'sm' | 'md';\n className?: string;\n}\n\nexport const RatingDisplay: FC<RatingDisplayProps> = ({\n value,\n count,\n maxStars = 5,\n size = 'sm',\n className,\n}) => {\n const starSize = size === 'sm' ? 'h-3.5 w-3.5' : 'h-4.5 w-4.5';\n const clampedValue = Math.min(Math.max(value, 0), maxStars);\n\n return (\n <div className={cn('flex items-center gap-1', className)}>\n <div className=\"flex items-center\">\n {Array.from({ length: maxStars }, (_, i) => {\n const filled = i < Math.floor(clampedValue);\n const halfFilled = !filled && i < clampedValue;\n\n return (\n <Star\n key={i}\n className={cn(\n starSize,\n filled\n ? 'fill-
|
|
1
|
+
{"version":3,"file":"RatingDisplay.js","names":[],"sources":["../../../src/subscriberbot/components/RatingDisplay.tsx"],"sourcesContent":["/**\n * Rating Display Component\n * @module subscriberbot/components\n *\n * Star rating display with value and review count.\n */\n\nimport type { FC } from 'react';\nimport { Star } from 'lucide-react';\nimport { cn } from '../utils/cn';\n\ninterface RatingDisplayProps {\n value: number;\n count?: number;\n maxStars?: number;\n size?: 'sm' | 'md';\n className?: string;\n}\n\nexport const RatingDisplay: FC<RatingDisplayProps> = ({\n value,\n count,\n maxStars = 5,\n size = 'sm',\n className,\n}) => {\n const starSize = size === 'sm' ? 'h-3.5 w-3.5' : 'h-4.5 w-4.5';\n const clampedValue = Math.min(Math.max(value, 0), maxStars);\n\n return (\n <div className={cn('flex items-center gap-1', className)}>\n <div className=\"flex items-center\">\n {Array.from({ length: maxStars }, (_, i) => {\n const filled = i < Math.floor(clampedValue);\n const halfFilled = !filled && i < clampedValue;\n\n return (\n <Star\n key={i}\n className={cn(\n starSize,\n filled\n ? 'fill-status-warning-text text-status-warning-text'\n : halfFilled\n ? 'fill-status-warning-text/50 text-status-warning-text'\n : 'fill-none text-text-secondary/40'\n )}\n />\n );\n })}\n </div>\n <span className=\"text-xs font-medium text-text-primary tabular-nums\">\n {clampedValue.toFixed(1)}\n </span>\n {count !== undefined && (\n <span className=\"text-xs text-text-secondary tabular-nums\">({count})</span>\n )}\n </div>\n );\n};\n"],"mappings":";;;;AAmBA,IAAa,KAAyC,EACpD,UACA,UACA,cAAW,GACX,UAAO,MACP,mBACI;CACJ,IAAM,IAAW,MAAS,OAAO,gBAAgB,eAC3C,IAAe,KAAK,IAAI,KAAK,IAAI,GAAO,EAAE,EAAE,EAAS;AAE3D,QACE,kBAAC,OAAD;EAAK,WAAW,EAAG,2BAA2B,EAAU;YAAxD;GACE,kBAAC,OAAD;IAAK,WAAU;cACZ,MAAM,KAAK,EAAE,QAAQ,GAAU,GAAG,GAAG,MAAM;KAC1C,IAAM,IAAS,IAAI,KAAK,MAAM,EAAa;AAG3C,YACE,kBAAC,GAAD,EAEE,WAAW,EACT,GACA,IACI,sDARS,CAAC,KAAU,IAAI,IAUtB,yDACA,mCACP,EACD,EATK,EASL;MAEJ;IACE,CAAA;GACN,kBAAC,QAAD;IAAM,WAAU;cACb,EAAa,QAAQ,EAAE;IACnB,CAAA;GACN,MAAU,KAAA,KACT,kBAAC,QAAD;IAAM,WAAU;cAAhB;KAA2D;KAAE;KAAM;KAAQ;;GAEzE"}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import { cn as e } from "../utils/cn.js";
|
|
2
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as t, jsxs as n } from "react/jsx-runtime";
|
|
3
3
|
//#region src/subscriberbot/components/StatusBadge.tsx
|
|
4
|
-
var
|
|
5
|
-
success: "bg-
|
|
6
|
-
warning: "bg-
|
|
4
|
+
var r = {
|
|
5
|
+
success: "bg-status-success-bg/20 text-status-success-text",
|
|
6
|
+
warning: "bg-status-warning-bg/20 text-status-warning-text",
|
|
7
7
|
destructive: "bg-status-error-bg/20 text-status-error-text",
|
|
8
8
|
secondary: "bg-secondary text-secondary-foreground",
|
|
9
|
-
info: "bg-
|
|
10
|
-
outline: "border border-border-
|
|
11
|
-
},
|
|
9
|
+
info: "bg-status-info-bg/20 text-status-info-text",
|
|
10
|
+
outline: "border border-border-seam text-text-primary"
|
|
11
|
+
}, i = new Set([
|
|
12
|
+
"open",
|
|
13
|
+
"active",
|
|
14
|
+
"out_for_delivery",
|
|
15
|
+
"preparing",
|
|
16
|
+
"processing"
|
|
17
|
+
]), a = {
|
|
12
18
|
open: "success",
|
|
13
19
|
closed: "destructive",
|
|
14
20
|
busy: "warning",
|
|
@@ -32,14 +38,20 @@ var n = {
|
|
|
32
38
|
processing: "warning",
|
|
33
39
|
completed: "success"
|
|
34
40
|
};
|
|
35
|
-
function
|
|
41
|
+
function o(e) {
|
|
36
42
|
return e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
|
|
37
43
|
}
|
|
38
|
-
var
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
44
|
+
var s = ({ status: s, className: c }) => {
|
|
45
|
+
let l = a[s.toLowerCase()] || "secondary", u = i.has(s.toLowerCase());
|
|
46
|
+
return /* @__PURE__ */ n("span", {
|
|
47
|
+
className: e("inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium", r[l], c),
|
|
48
|
+
children: [u && /* @__PURE__ */ t("span", {
|
|
49
|
+
"aria-hidden": "true",
|
|
50
|
+
className: "inline-block h-1.5 w-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse"
|
|
51
|
+
}), o(s)]
|
|
52
|
+
});
|
|
53
|
+
};
|
|
42
54
|
//#endregion
|
|
43
|
-
export {
|
|
55
|
+
export { s as StatusBadge };
|
|
44
56
|
|
|
45
57
|
//# sourceMappingURL=StatusBadge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/subscriberbot/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module subscriberbot/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-
|
|
1
|
+
{"version":3,"file":"StatusBadge.js","names":[],"sources":["../../../src/subscriberbot/components/StatusBadge.tsx"],"sourcesContent":["/**\n * Status Badge Component\n * @module subscriberbot/components\n *\n * A colored badge based on status value with semantic color mapping\n * for various order, cart, and investment statuses.\n */\n\nimport type { FC } from 'react';\nimport { cn } from '../utils/cn';\n\ninterface StatusBadgeProps {\n status: string;\n className?: string;\n}\n\ntype BadgeVariant = 'success' | 'warning' | 'destructive' | 'secondary' | 'info' | 'outline';\n\nconst variantStyles: Record<BadgeVariant, string> = {\n success: 'bg-status-success-bg/20 text-status-success-text',\n warning: 'bg-status-warning-bg/20 text-status-warning-text',\n destructive: 'bg-status-error-bg/20 text-status-error-text',\n secondary: 'bg-secondary text-secondary-foreground',\n info: 'bg-status-info-bg/20 text-status-info-text',\n outline: 'border border-border-seam text-text-primary',\n};\n\n/** Statuses that read as \"live\"/active — get a subtle opacity glow-pulse dot. */\nconst liveStatuses = new Set(['open', 'active', 'out_for_delivery', 'preparing', 'processing']);\n\nconst statusVariantMap: Record<string, BadgeVariant> = {\n // Cart statuses\n open: 'success',\n closed: 'destructive',\n busy: 'warning',\n temporarily_closed: 'warning',\n\n // Order statuses\n pending: 'secondary',\n confirmed: 'info',\n preparing: 'warning',\n ready: 'success',\n out_for_delivery: 'info',\n delivered: 'success',\n cancelled: 'destructive',\n refunded: 'outline',\n\n // Investment statuses\n funded: 'success',\n returning: 'info',\n\n // Generic statuses\n active: 'success',\n inactive: 'secondary',\n draft: 'secondary',\n archived: 'outline',\n error: 'destructive',\n failed: 'destructive',\n processing: 'warning',\n completed: 'success',\n};\n\nfunction formatStatusLabel(status: string): string {\n return status.replace(/_/g, ' ').replace(/\\b\\w/g, (char) => char.toUpperCase());\n}\n\nexport const StatusBadge: FC<StatusBadgeProps> = ({ status, className }) => {\n const variant = statusVariantMap[status.toLowerCase()] || 'secondary';\n\n const isLive = liveStatuses.has(status.toLowerCase());\n\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs font-medium',\n variantStyles[variant],\n className\n )}\n >\n {isLive && (\n <span\n aria-hidden=\"true\"\n className=\"inline-block h-1.5 w-1.5 rounded-full bg-current motion-safe:animate-vc-glow-pulse\"\n />\n )}\n {formatStatusLabel(status)}\n </span>\n );\n};\n"],"mappings":";;;AAkBA,IAAM,IAA8C;CAClD,SAAS;CACT,SAAS;CACT,aAAa;CACb,WAAW;CACX,MAAM;CACN,SAAS;CACV,EAGK,IAAe,IAAI,IAAI;CAAC;CAAQ;CAAU;CAAoB;CAAa;CAAa,CAAC,EAEzF,IAAiD;CAErD,MAAM;CACN,QAAQ;CACR,MAAM;CACN,oBAAoB;CAGpB,SAAS;CACT,WAAW;CACX,WAAW;CACX,OAAO;CACP,kBAAkB;CAClB,WAAW;CACX,WAAW;CACX,UAAU;CAGV,QAAQ;CACR,WAAW;CAGX,QAAQ;CACR,UAAU;CACV,OAAO;CACP,UAAU;CACV,OAAO;CACP,QAAQ;CACR,YAAY;CACZ,WAAW;CACZ;AAED,SAAS,EAAkB,GAAwB;AACjD,QAAO,EAAO,QAAQ,MAAM,IAAI,CAAC,QAAQ,UAAU,MAAS,EAAK,aAAa,CAAC;;AAGjF,IAAa,KAAqC,EAAE,WAAQ,mBAAgB;CAC1E,IAAM,IAAU,EAAiB,EAAO,aAAa,KAAK,aAEpD,IAAS,EAAa,IAAI,EAAO,aAAa,CAAC;AAErD,QACE,kBAAC,QAAD;EACE,WAAW,EACT,mFACA,EAAc,IACd,EACD;YALH,CAOG,KACC,kBAAC,QAAD;GACE,eAAY;GACZ,WAAU;GACV,CAAA,EAEH,EAAkB,EAAO,CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriberBotContext.js","names":[],"sources":["../../../src/subscriberbot/context/SubscriberBotContext.tsx"],"sourcesContent":["/**\n * SubscriberBot Context Provider\n * @module subscriberbot/context\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { SubscriberBotRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface SubscriberBotContextValue extends Omit<\n SubscriberBotRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst SubscriberBotContext = createContext<SubscriberBotContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useSubscriberBot(): SubscriberBotContextValue {\n const context = useContext(SubscriberBotContext);\n if (!context) {\n throw new Error('useSubscriberBot must be used within a SubscriberBotProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<SubscriberBotRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<SubscriberBotContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <SubscriberBotContext.Provider value={contextValue}>{children}</SubscriberBotContext.Provider
|
|
1
|
+
{"version":3,"file":"SubscriberBotContext.js","names":[],"sources":["../../../src/subscriberbot/context/SubscriberBotContext.tsx"],"sourcesContent":["/**\n * SubscriberBot Context Provider\n * @module subscriberbot/context\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router-dom';\nimport type { SubscriberBotRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface SubscriberBotContextValue extends Omit<\n SubscriberBotRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst SubscriberBotContext = createContext<SubscriberBotContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useSubscriberBot(): SubscriberBotContextValue {\n const context = useContext(SubscriberBotContext);\n if (!context) {\n throw new Error('useSubscriberBot must be used within a SubscriberBotProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<SubscriberBotRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n}) => {\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<SubscriberBotContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <SubscriberBotContext.Provider value={contextValue}>{children}</SubscriberBotContext.Provider>\n );\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<SubscriberBotContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n onCartSelect,\n onOrderSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return (\n <SubscriberBotContext.Provider value={contextValue}>{children}</SubscriberBotContext.Provider>\n );\n};\n\nexport const SubscriberBotProvider: FC<PropsWithChildren<SubscriberBotRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {children}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {children}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;AA4BA,IAAM,IAAuB,EAAgD,KAAK;AAMlF,SAAgB,IAA8C;CAC5D,IAAM,IAAU,EAAW,EAAqB;AAChD,KAAI,CAAC,EACH,OAAU,MAAM,+DAA+D;AAEjF,QAAO;;AAYT,IAAM,KAAiE,EACrE,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,iBACA,uBACI;CACJ,IAAM,IAAiB,GAAmB,EACpC,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CAClC;IAE1B,CAAC,GAAmB,EAAe,CACpC,EAEK,IAAe,SACZ;EACL,UAAU;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAK5F,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,gBACA,kBACA,cACA,iBACA,uBACI;CACJ,IAAM,IAAoB,KAAY,KAEhC,IAAU,GACb,MAAyB,EAAS,GAAmB,EAAa,EACnE,CAAC,EAAkB,CACpB,EAEK,IAAa,GAChB,MAAyB;AAExB,IADiB,EAAS,GAAmB,EAAa,CACxC;IAEpB,CAAC,GAAmB,EAAS,CAC9B,EAEK,IAAe,SACZ;EACL,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;EACD,GACD;EACE;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD,CACF;AAED,QACE,kBAAC,EAAqB,UAAtB;EAA+B,OAAO;EAAe;EAAyC,CAAA;GAIrF,KAAwE,MAAU;CAC7F,IAAM,EAAE,aAAU,gBAAa;AAiB/B,QAdsB,IAepB,kBAAC,GAAD;EAAyB,GAAI;EAAiB;EAAU,cAAc;EACnE;EACuB,CAAA,GAZxB,kBAAC,GAAD,EAAA,UACE,kBAAC,GAAD;EAAyB,GAAI;EAAO,cAAc;EAC/C;EACuB,CAAA,EACb,CAAA"}
|