@microcosmmoney/portal-react 3.11.0 → 3.12.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.
Files changed (31) hide show
  1. package/dist/components/auction/auction-page.js +0 -2
  2. package/dist/components/dashboard/assets-summary.d.ts +1 -1
  3. package/dist/components/dashboard/assets-summary.js +21 -18
  4. package/dist/components/dashboard/dashboard-overview.js +1 -4
  5. package/dist/components/dashboard/ecosystem-stats.js +0 -1
  6. package/dist/components/dashboard/lock-periods.d.ts +1 -1
  7. package/dist/components/dashboard/lock-periods.js +4 -4
  8. package/dist/components/dashboard/market-overview-bar.js +110 -26
  9. package/dist/components/dashboard/mcc-token-stats.d.ts +1 -1
  10. package/dist/components/dashboard/mcc-token-stats.js +32 -18
  11. package/dist/components/dashboard/mcd-stats.d.ts +1 -1
  12. package/dist/components/dashboard/mcd-stats.js +32 -18
  13. package/dist/components/dashboard/mining-weight.js +11 -15
  14. package/dist/components/dashboard/minting-stats.js +10 -11
  15. package/dist/components/dashboard/my-mining.d.ts +2 -1
  16. package/dist/components/dashboard/my-mining.js +22 -14
  17. package/dist/components/dashboard/price-chart.js +44 -7
  18. package/dist/components/dashboard/quick-actions.js +35 -21
  19. package/dist/components/mcd/mcd-page.js +0 -4
  20. package/dist/components/mining/mining-page.js +1 -7
  21. package/dist/components/organization/organization-page.js +0 -7
  22. package/dist/components/queue/queue-status-page.d.ts +1 -2
  23. package/dist/components/queue/queue-status-page.js +3 -43
  24. package/dist/components/stations/station-list-page.d.ts +1 -2
  25. package/dist/components/stations/station-list-page.js +2 -14
  26. package/dist/components/territory/territory-page.js +0 -39
  27. package/dist/components/voting/voting-page.js +0 -1
  28. package/dist/components/wallet/wallet-page.js +1 -9
  29. package/dist/menu-config.d.ts +0 -2
  30. package/dist/menu-config.js +0 -2
  31. package/package.json +3 -3
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.MicrocosmVotingPage = MicrocosmVotingPage;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
6
  const i18n_context_1 = require("../../i18n-context");
7
- /* ── Inline SVG Icons (lucide style: 24x24, stroke 2, round caps) ── */
8
7
  const VoteIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: [(0, jsx_runtime_1.jsx)("path", { d: "M20 11.08V8l-6-6H6a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h6" }), (0, jsx_runtime_1.jsx)("path", { d: "M14 2v6h6" }), (0, jsx_runtime_1.jsx)("path", { d: "M18 21l-3-3 3-3" }), (0, jsx_runtime_1.jsx)("path", { d: "M22 18h-6" })] }));
9
8
  const SwordsIcon = ({ className }) => ((0, jsx_runtime_1.jsxs)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: [(0, jsx_runtime_1.jsx)("polyline", { points: "14.5 17.5 3 6 3 3 6 3 17.5 14.5" }), (0, jsx_runtime_1.jsx)("line", { x1: "13", y1: "19", x2: "19", y2: "13" }), (0, jsx_runtime_1.jsx)("line", { x1: "16", y1: "16", x2: "20", y2: "20" }), (0, jsx_runtime_1.jsx)("line", { x1: "19", y1: "21", x2: "21", y2: "19" }), (0, jsx_runtime_1.jsx)("polyline", { points: "14.5 6.5 18 3 21 3 21 6 17.5 9.5" }), (0, jsx_runtime_1.jsx)("line", { x1: "5", y1: "14", x2: "9", y2: "18" }), (0, jsx_runtime_1.jsx)("line", { x1: "7", y1: "17", x2: "4", y2: "20" }), (0, jsx_runtime_1.jsx)("line", { x1: "3", y1: "19", x2: "5", y2: "21" })] }));
10
9
  const HeartIcon = ({ className }) => ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: className, children: (0, jsx_runtime_1.jsx)("path", { d: "M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z" }) }));
@@ -7,10 +7,8 @@ const react_1 = require("react");
7
7
  const auth_react_1 = require("@microcosmmoney/auth-react");
8
8
  const mainstream_tokens_1 = require("../../config/mainstream-tokens");
9
9
  const i18n_context_1 = require("../../i18n-context");
10
- /* ── helpers ── */
11
10
  const fmt = (n, d = 2) => n.toLocaleString('en-US', { minimumFractionDigits: d, maximumFractionDigits: d });
12
11
  const fmtUSD = (n) => '$' + n.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
13
- /* ── inline SVG icons (16-20px, stroke-based, matching lucide style) ── */
14
12
  function IconWallet({ className = '' }) {
15
13
  return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M21 12V7H5a2 2 0 0 1 0-4h14v4" }), (0, jsx_runtime_1.jsx)("path", { d: "M3 5v14a2 2 0 0 0 2 2h16v-5" }), (0, jsx_runtime_1.jsx)("path", { d: "M18 12a1 1 0 0 0 0 4h4v-4Z" })] }));
16
14
  }
@@ -44,11 +42,9 @@ function IconExternalLink({ className = '' }) {
44
42
  function IconAlertTriangle({ className = '' }) {
45
43
  return ((0, jsx_runtime_1.jsxs)("svg", { className: className, width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 9v4" }), (0, jsx_runtime_1.jsx)("path", { d: "M12 17h.01" })] }));
46
44
  }
47
- /* ── spinner ── */
48
45
  function Spinner({ size = 'w-5 h-5' }) {
49
46
  return (0, jsx_runtime_1.jsx)("span", { className: `inline-block ${size} border-2 border-cyan-400 border-t-transparent rounded-full animate-spin` });
50
47
  }
51
- /* ── lock period card ── */
52
48
  function LockPeriodCard({ lock, hideBalance }) {
53
49
  const [progress, setProgress] = (0, react_1.useState)(0);
54
50
  (0, react_1.useEffect)(() => {
@@ -56,7 +52,6 @@ function LockPeriodCard({ lock, hideBalance }) {
56
52
  const end = new Date(lock.lock_end).getTime();
57
53
  const now = Date.now();
58
54
  const p = Math.min(100, Math.max(0, ((now - start) / (end - start)) * 100));
59
- // Animate in
60
55
  const timer = setTimeout(() => setProgress(p), 50);
61
56
  return () => clearTimeout(timer);
62
57
  }, [lock.lock_start, lock.lock_end]);
@@ -69,7 +64,6 @@ function LockPeriodCard({ lock, hideBalance }) {
69
64
  const fmtDT = (d) => d.toLocaleString('en-US', { year: 'numeric', month: '2-digit', day: '2-digit', hour: '2-digit', minute: '2-digit', hour12: false });
70
65
  return ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 bg-neutral-800 rounded border border-neutral-700", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-start mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: ["reason: ", lock.reason] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-white font-mono", children: [hideBalance ? '****' : fmt(lock.amount), " MCC"] })] }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] bg-cyan-400/20 text-cyan-400 border border-cyan-400/30 px-2 py-0.5 rounded font-mono", children: "LOCKED" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-neutral-400", children: [(0, jsx_runtime_1.jsx)("span", { children: "lock_start" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: fmtDT(start) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-neutral-400", children: [(0, jsx_runtime_1.jsx)("span", { children: "lock_end" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: fmtDT(end) })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between font-bold mt-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: "remaining" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400", children: [daysLeft, "d ", hoursLeft, "h"] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-3", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-700 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "bg-cyan-400 h-2 rounded-full transition-all duration-700", style: { width: `${progress}%` } }) }) })] }));
71
66
  }
72
- /* ── token icon ── */
73
67
  function TokenIcon({ symbol, color, logoURI }) {
74
68
  const [err, setErr] = (0, react_1.useState)(false);
75
69
  if (logoURI && !err) {
@@ -110,7 +104,6 @@ function MicrocosmWalletPage({ basePath = '', onNavigate }) {
110
104
  const lockedAmount = activeLocks.reduce((s, l) => s + (l.amount || 0), 0);
111
105
  const mask = (v) => (hideBalance ? '****' : v);
112
106
  const resolvePath = (p) => (basePath ? `${basePath.replace(/\/$/, '')}${p}` : p);
113
- /* ── build on-chain asset holdings from multiBalance ── */
114
107
  const TOKEN_PRICES = {
115
108
  SOL: 0,
116
109
  MCC: price,
@@ -197,7 +190,6 @@ function MicrocosmWalletPage({ basePath = '', onNavigate }) {
197
190
  const rawHoldings = isAllTab
198
191
  ? (walletList.length > 1 ? buildHoldings() : buildAggregatedHoldings())
199
192
  : buildHoldings(activeTab);
200
- // Only show assets >= $1 (matching portal)
201
193
  const activeHoldings = rawHoldings.filter((h) => h.usdValue >= 1);
202
194
  const activeUsdValue = isAllTab
203
195
  ? rawHoldings.reduce((s, h) => s + h.usdValue, 0)
@@ -211,7 +203,7 @@ function MicrocosmWalletPage({ basePath = '', onNavigate }) {
211
203
  setIsRefreshing(false);
212
204
  }
213
205
  };
214
- const anyError = false; // hooks don't expose combined error state cleanly
206
+ const anyError = false;
215
207
  return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto p-6 space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-2xl font-bold text-white tracking-wider", children: t('title', 'Wallet') }), (0, jsx_runtime_1.jsx)("p", { className: "text-sm text-neutral-400 mt-1", children: t('subtitle', 'On-chain assets & balances') })] }), (0, jsx_runtime_1.jsxs)("button", { className: "flex items-center gap-2 px-3 py-1.5 text-sm border border-neutral-700 rounded text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent transition-colors disabled:opacity-50", onClick: handleRefresh, disabled: isRefreshing || multiLoading, children: [(0, jsx_runtime_1.jsx)(IconRefresh, { className: isRefreshing || multiLoading ? 'animate-spin' : '' }), t('refresh', 'Refresh')] })] }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg hover:border-cyan-400/50 transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between mb-4", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-sm", children: [(0, jsx_runtime_1.jsx)(IconWallet, { className: "text-cyan-400" }), (0, jsx_runtime_1.jsx)("span", { children: isAllTab ? t('totalAssetValue', 'Total Asset Value') : t('walletAssetValue', 'Wallet Asset Value') }), (0, jsx_runtime_1.jsx)("button", { onClick: () => setHideBalance(!hideBalance), className: "hover:text-white transition-colors", children: hideBalance ? (0, jsx_runtime_1.jsx)(IconEyeOff, {}) : (0, jsx_runtime_1.jsx)(IconEye, {}) })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-baseline gap-2 mb-1", children: (0, jsx_runtime_1.jsx)("span", { className: "text-3xl font-bold text-white font-mono", children: hideBalance ? '****' : (activeUsdValue > 0 ? fmtUSD(activeUsdValue) : '--') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-neutral-500 text-xs", children: hideBalance ? '****' : t('aggregatedDesc', 'Aggregated from on-chain token balances') })] }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg transition-colors", children: (0, jsx_runtime_1.jsxs)("div", { className: "p-6", children: [walletList.length > 1 && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1 mb-4 overflow-x-auto pb-1", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab('all'), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors ${activeTab === 'all'
216
208
  ? 'bg-cyan-700 text-white'
217
209
  : 'bg-neutral-800 text-neutral-400 hover:text-white hover:bg-neutral-700'}`, children: [t('overview', 'Overview'), " (", walletList.length, " ", t('wallets', 'wallets'), ")"] }), walletList.map((w) => ((0, jsx_runtime_1.jsxs)("button", { onClick: () => setActiveTab(w.wallet_address), className: `px-3 py-1.5 text-xs rounded whitespace-nowrap transition-colors flex items-center gap-1 ${activeTab === w.wallet_address
@@ -17,12 +17,10 @@ export interface MicrocosmMenuGroup {
17
17
  icon: LucideIcon;
18
18
  items: MicrocosmMenuItem[];
19
19
  }
20
- /** Resolve localized title — falls back to `item.title` (English) */
21
20
  export declare function getMenuTitle(item: {
22
21
  title: string;
23
22
  titles?: Partial<Record<MenuLocale, string>>;
24
23
  }, locale?: MenuLocale): string;
25
- /** Resolve localized description */
26
24
  export declare function getMenuDescription(item: MicrocosmMenuItem, locale?: MenuLocale): string;
27
25
  export declare const dashboardMenu: MicrocosmMenuGroup;
28
26
  export declare const blockchainMenu: MicrocosmMenuGroup;
@@ -6,13 +6,11 @@ exports.getMenuDescription = getMenuDescription;
6
6
  exports.getAllMenuItems = getAllMenuItems;
7
7
  exports.resolveMenuPath = resolveMenuPath;
8
8
  const lucide_react_1 = require("lucide-react");
9
- /** Resolve localized title — falls back to `item.title` (English) */
10
9
  function getMenuTitle(item, locale) {
11
10
  if (!locale || !item.titles)
12
11
  return item.title;
13
12
  return item.titles[locale] ?? item.title;
14
13
  }
15
- /** Resolve localized description */
16
14
  function getMenuDescription(item, locale) {
17
15
  if (!locale || !item.descriptions)
18
16
  return item.description ?? '';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microcosmmoney/portal-react",
3
- "version": "3.11.0",
3
+ "version": "3.12.1",
4
4
  "description": "Microcosm Portal UI components for React/Next.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "lucide-react": ">=0.300.0"
19
19
  },
20
20
  "dependencies": {
21
- "@microcosmmoney/auth-core": "^2.3.2",
22
- "@microcosmmoney/auth-react": "^2.6.0"
21
+ "@microcosmmoney/auth-core": "^2.3.3",
22
+ "@microcosmmoney/auth-react": "^2.6.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/react": "^18.0.0",