@microcosmmoney/portal-react 3.0.0 → 3.2.0

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 (27) hide show
  1. package/dist/components/dashboard/assets-summary.d.ts +2 -1
  2. package/dist/components/dashboard/assets-summary.js +11 -6
  3. package/dist/components/dashboard/dashboard-overview.d.ts +2 -1
  4. package/dist/components/dashboard/dashboard-overview.js +11 -2
  5. package/dist/components/dashboard/ecosystem-stats.d.ts +4 -1
  6. package/dist/components/dashboard/ecosystem-stats.js +12 -9
  7. package/dist/components/dashboard/lock-periods.d.ts +4 -1
  8. package/dist/components/dashboard/lock-periods.js +2 -2
  9. package/dist/components/dashboard/market-overview-bar.d.ts +4 -1
  10. package/dist/components/dashboard/market-overview-bar.js +9 -6
  11. package/dist/components/dashboard/mcc-token-stats.d.ts +4 -1
  12. package/dist/components/dashboard/mcc-token-stats.js +12 -9
  13. package/dist/components/dashboard/mcd-stats.d.ts +4 -1
  14. package/dist/components/dashboard/mcd-stats.js +14 -11
  15. package/dist/components/dashboard/mining-weight.d.ts +4 -1
  16. package/dist/components/dashboard/mining-weight.js +10 -7
  17. package/dist/components/dashboard/minting-stats.d.ts +4 -1
  18. package/dist/components/dashboard/minting-stats.js +6 -3
  19. package/dist/components/dashboard/my-mining.d.ts +2 -1
  20. package/dist/components/dashboard/my-mining.js +4 -2
  21. package/dist/components/dashboard/price-chart.d.ts +4 -1
  22. package/dist/components/dashboard/price-chart.js +6 -4
  23. package/dist/components/dashboard/quick-actions.d.ts +2 -1
  24. package/dist/components/dashboard/quick-actions.js +52 -37
  25. package/dist/components/territory/territory-page.js +191 -119
  26. package/dist/index.d.ts +8 -0
  27. package/package.json +4 -4
@@ -12,9 +12,11 @@ const timeRanges = [
12
12
  { label: '7D', value: '7D' },
13
13
  { label: '30D', value: '30D' },
14
14
  ];
15
- function MicrocosmPriceChart() {
15
+ function MicrocosmPriceChart({ accentColor } = {}) {
16
16
  const [range, setRange] = (0, react_1.useState)('7D');
17
17
  const { data, loading } = (0, auth_react_1.usePriceHistory)(range);
18
+ const gradientId = (0, react_1.useId)().replace(/:/g, '_') + '_mcPriceGradient';
19
+ const ac = accentColor || '#22d3ee';
18
20
  const raw = data;
19
21
  const items = Array.isArray(raw) ? raw : raw?.records ?? [];
20
22
  const chartData = items.map((item) => ({
@@ -33,12 +35,12 @@ function MicrocosmPriceChart() {
33
35
  return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
34
36
  };
35
37
  return ((0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-900 border border-neutral-700 rounded-lg overflow-hidden 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.jsx)("div", { className: "flex gap-1 bg-black p-0.5 rounded", children: timeRanges.map((tr) => ((0, jsx_runtime_1.jsx)("button", { onClick: () => setRange(tr.value), className: `px-2.5 py-1 text-[10px] font-mono font-bold rounded transition-colors ${range === tr.value
36
- ? 'bg-cyan-700 text-white'
37
- : 'text-neutral-500 hover:text-neutral-300'}`, children: tr.label }, tr.value))) }) }), (0, jsx_runtime_1.jsx)("div", { className: "h-[360px]", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full bg-neutral-800 rounded animate-pulse" })) : chartData.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full flex items-center justify-center text-neutral-500 font-mono text-sm", children: "No price data available" })) : ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.AreaChart, { data: chartData, margin: { top: 5, right: 5, left: -15, bottom: 0 }, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: "mcPriceGradient", x1: "0", y1: "0", x2: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "5%", stopColor: "#22d3ee", stopOpacity: 0.3 }), (0, jsx_runtime_1.jsx)("stop", { offset: "95%", stopColor: "#22d3ee", stopOpacity: 0 })] }) }), (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { vertical: false, strokeDasharray: "3 3", stroke: "#404040" }), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: "time", tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: formatTime }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: (v) => `$${v.toFixed(3)}`, domain: [minPrice, maxPrice] }), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { contentStyle: {
38
+ ? (accentColor ? 'text-white' : 'bg-cyan-700 text-white')
39
+ : 'text-neutral-500 hover:text-neutral-300'}`, style: range === tr.value && accentColor ? { backgroundColor: accentColor, opacity: 0.8 } : undefined, children: tr.label }, tr.value))) }) }), (0, jsx_runtime_1.jsx)("div", { className: "h-[360px]", children: loading ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full bg-neutral-800 rounded animate-pulse" })) : chartData.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "h-full flex items-center justify-center text-neutral-500 font-mono text-sm", children: "No price data available" })) : ((0, jsx_runtime_1.jsx)(recharts_1.ResponsiveContainer, { width: "100%", height: "100%", children: (0, jsx_runtime_1.jsxs)(recharts_1.AreaChart, { data: chartData, margin: { top: 5, right: 5, left: -15, bottom: 0 }, children: [(0, jsx_runtime_1.jsx)("defs", { children: (0, jsx_runtime_1.jsxs)("linearGradient", { id: gradientId, x1: "0", y1: "0", x2: "0", y2: "1", children: [(0, jsx_runtime_1.jsx)("stop", { offset: "5%", stopColor: ac, stopOpacity: 0.3 }), (0, jsx_runtime_1.jsx)("stop", { offset: "95%", stopColor: ac, stopOpacity: 0 })] }) }), (0, jsx_runtime_1.jsx)(recharts_1.CartesianGrid, { vertical: false, strokeDasharray: "3 3", stroke: "#404040" }), (0, jsx_runtime_1.jsx)(recharts_1.XAxis, { dataKey: "time", tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: formatTime }), (0, jsx_runtime_1.jsx)(recharts_1.YAxis, { tick: { fill: '#737373', fontSize: 10, fontFamily: 'monospace' }, tickLine: false, axisLine: false, tickFormatter: (v) => `$${v.toFixed(3)}`, domain: [minPrice, maxPrice] }), (0, jsx_runtime_1.jsx)(recharts_1.Tooltip, { contentStyle: {
38
40
  backgroundColor: '#171717',
39
41
  border: '1px solid #404040',
40
42
  borderRadius: '6px',
41
43
  fontFamily: 'monospace',
42
44
  fontSize: '11px',
43
- }, labelFormatter: (ts) => new Date(ts).toLocaleString(), formatter: (value) => [`$${Number(value).toFixed(4)}`, 'Price'] }), (0, jsx_runtime_1.jsx)(recharts_1.Area, { type: "monotone", dataKey: "price", stroke: "#22d3ee", strokeWidth: 2, fill: "url(#mcPriceGradient)" })] }) })) })] }) }));
45
+ }, labelFormatter: (ts) => new Date(ts).toLocaleString(), formatter: (value) => [`$${Number(value).toFixed(4)}`, 'Price'] }), (0, jsx_runtime_1.jsx)(recharts_1.Area, { type: "monotone", dataKey: "price", stroke: ac, strokeWidth: 2, fill: `url(#${gradientId})` })] }) })) })] }) }));
44
46
  }
@@ -1,5 +1,6 @@
1
1
  export interface MicrocosmQuickActionsProps {
2
2
  basePath?: string;
3
3
  onNavigate?: (path: string) => void;
4
+ accentColor?: string;
4
5
  }
5
- export declare function MicrocosmQuickActions({ basePath, onNavigate }: MicrocosmQuickActionsProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function MicrocosmQuickActions({ basePath, onNavigate, accentColor }: MicrocosmQuickActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -8,46 +8,61 @@ const MCC_MINT = 'MCCn6eqiTGzaiPKECg3viPmkdkS9YmkguqKvRcTxCsb';
8
8
  const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
9
9
  const POOL_ID = '4AiaTd9bAWf3u8ScZWhXadJF1roc8bJKEKvaDudKacZd';
10
10
  /* Inline SVG icons matching lucide-react style (20x20, stroke-based) */
11
- const IconDroplets = () => ((0, jsx_runtime_1.jsxs)("svg", { 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: "M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z" }), (0, jsx_runtime_1.jsx)("path", { d: "M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97" })] }));
11
+ const IconDroplets = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05z" }), (0, jsx_runtime_1.jsx)("path", { d: "M12.56 6.6A10.97 10.97 0 0 0 14 3.02c.5 2.5 2 4.9 4 6.5s3 3.5 3 5.5a6.98 6.98 0 0 1-11.91 4.97" })] }));
12
12
  const IconRepeat = () => ((0, jsx_runtime_1.jsxs)("svg", { 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: "m17 1 4 4-4 4" }), (0, jsx_runtime_1.jsx)("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), (0, jsx_runtime_1.jsx)("path", { d: "m7 23-4-4 4-4" }), (0, jsx_runtime_1.jsx)("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })] }));
13
- const IconEye = () => ((0, jsx_runtime_1.jsxs)("svg", { 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: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "3" })] }));
13
+ const IconEye = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" }), (0, jsx_runtime_1.jsx)("circle", { cx: "12", cy: "12", r: "3" })] }));
14
14
  const IconBarChart3 = () => ((0, jsx_runtime_1.jsxs)("svg", { 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: "M3 3v18h18" }), (0, jsx_runtime_1.jsx)("path", { d: "M18 17V9" }), (0, jsx_runtime_1.jsx)("path", { d: "M13 17V5" }), (0, jsx_runtime_1.jsx)("path", { d: "M8 17v-3" })] }));
15
- const IconLineChart = () => ((0, jsx_runtime_1.jsxs)("svg", { 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: "M3 3v18h18" }), (0, jsx_runtime_1.jsx)("path", { d: "m19 9-5 5-4-4-3 3" })] }));
16
- const exchanges = [
17
- {
18
- label: 'Raydium',
19
- href: `https://raydium.io/swap/?inputMint=${MCC_MINT}&outputMint=${USDC_MINT}`,
20
- color: 'text-cyan-300 border-cyan-400/30 hover:bg-cyan-950/30',
21
- icon: IconDroplets,
22
- },
23
- {
24
- label: 'Jupiter',
25
- href: `https://jup.ag/swap/USDT-${MCC_MINT}`,
26
- color: 'text-white border-neutral-700 hover:bg-neutral-800',
27
- icon: IconRepeat,
28
- },
29
- {
30
- label: 'BirdEye',
31
- href: `https://birdeye.so/token/${MCC_MINT}?chain=solana`,
32
- color: 'text-cyan-300 border-cyan-400/30 hover:bg-cyan-950/30',
33
- icon: IconEye,
34
- },
35
- {
36
- label: 'GMGN',
37
- href: `https://gmgn.ai/sol/token/${MCC_MINT}`,
38
- color: 'text-white border-neutral-700 hover:bg-neutral-800',
39
- icon: IconBarChart3,
40
- },
41
- {
42
- label: 'DexScreener',
43
- href: `https://dexscreener.com/solana/${POOL_ID}`,
44
- color: 'text-cyan-300 border-cyan-400/30 hover:bg-cyan-950/30',
45
- icon: IconLineChart,
46
- },
47
- ];
48
- function MicrocosmQuickActions({ basePath = '', onNavigate }) {
15
+ const IconLineChart = ({ stroke = 'currentColor' }) => ((0, jsx_runtime_1.jsxs)("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: stroke, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [(0, jsx_runtime_1.jsx)("path", { d: "M3 3v18h18" }), (0, jsx_runtime_1.jsx)("path", { d: "m19 9-5 5-4-4-3 3" })] }));
16
+ function buildExchanges(accentColor) {
17
+ const accentClass = accentColor ? 'border-neutral-700 hover:bg-neutral-800' : 'text-cyan-300 border-cyan-400/30 hover:bg-cyan-950/30';
18
+ return [
19
+ {
20
+ label: 'Raydium',
21
+ href: `https://raydium.io/swap/?inputMint=${MCC_MINT}&outputMint=${USDC_MINT}`,
22
+ color: accentClass,
23
+ colorStyle: accentColor ? { color: accentColor } : undefined,
24
+ icon: IconDroplets,
25
+ iconAccent: true,
26
+ },
27
+ {
28
+ label: 'Jupiter',
29
+ href: `https://jup.ag/swap/USDT-${MCC_MINT}`,
30
+ color: 'text-white border-neutral-700 hover:bg-neutral-800',
31
+ colorStyle: undefined,
32
+ icon: IconRepeat,
33
+ iconAccent: false,
34
+ },
35
+ {
36
+ label: 'BirdEye',
37
+ href: `https://birdeye.so/token/${MCC_MINT}?chain=solana`,
38
+ color: accentClass,
39
+ colorStyle: accentColor ? { color: accentColor } : undefined,
40
+ icon: IconEye,
41
+ iconAccent: true,
42
+ },
43
+ {
44
+ label: 'GMGN',
45
+ href: `https://gmgn.ai/sol/token/${MCC_MINT}`,
46
+ color: 'text-white border-neutral-700 hover:bg-neutral-800',
47
+ colorStyle: undefined,
48
+ icon: IconBarChart3,
49
+ iconAccent: false,
50
+ },
51
+ {
52
+ label: 'DexScreener',
53
+ href: `https://dexscreener.com/solana/${POOL_ID}`,
54
+ color: accentClass,
55
+ colorStyle: accentColor ? { color: accentColor } : undefined,
56
+ icon: IconLineChart,
57
+ iconAccent: true,
58
+ },
59
+ ];
60
+ }
61
+ function MicrocosmQuickActions({ basePath = '', onNavigate, accentColor }) {
62
+ const exchanges = buildExchanges(accentColor);
49
63
  return ((0, jsx_runtime_1.jsx)("div", { className: "mb-6", children: (0, jsx_runtime_1.jsx)("div", { className: "grid grid-cols-2 lg:grid-cols-5 gap-3", children: exchanges.map((ex) => {
50
64
  const Icon = ex.icon;
51
- return ((0, jsx_runtime_1.jsx)("a", { href: ex.href, target: "_blank", rel: "noopener noreferrer", children: (0, jsx_runtime_1.jsxs)("div", { className: `bg-neutral-900 border ${ex.color} rounded-lg p-4 flex items-center gap-3 cursor-pointer active:scale-[0.98] transition-colors`, children: [(0, jsx_runtime_1.jsx)(Icon, {}), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm font-bold tracking-wider", children: ex.label })] }) }, ex.label));
65
+ const iconStroke = ex.iconAccent && accentColor ? accentColor : undefined;
66
+ return ((0, jsx_runtime_1.jsx)("a", { href: ex.href, target: "_blank", rel: "noopener noreferrer", children: (0, jsx_runtime_1.jsxs)("div", { className: `bg-neutral-900 border ${ex.color} rounded-lg p-4 flex items-center gap-3 cursor-pointer active:scale-[0.98] transition-colors`, style: ex.colorStyle, children: [(0, jsx_runtime_1.jsx)(Icon, { stroke: iconStroke }), (0, jsx_runtime_1.jsx)("span", { className: "font-mono text-sm font-bold tracking-wider", children: ex.label })] }) }, ex.label));
52
67
  }) }) }));
53
68
  }