@microcosmmoney/portal-react 1.0.0 → 1.1.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.
- package/dist/components/kpi-radial-chart.d.ts +12 -0
- package/dist/components/kpi-radial-chart.js +15 -0
- package/dist/components/menu-section.d.ts +5 -1
- package/dist/components/menu-section.js +61 -45
- package/dist/components/mining-progress-bar.d.ts +9 -0
- package/dist/components/mining-progress-bar.js +22 -0
- package/dist/components/terminal-countdown.d.ts +8 -0
- package/dist/components/terminal-countdown.js +38 -0
- package/dist/components/terminal-dialog.d.ts +11 -0
- package/dist/components/terminal-dialog.js +27 -0
- package/dist/components/terminal-input.d.ts +9 -0
- package/dist/components/terminal-input.js +15 -0
- package/dist/components/terminal-table.d.ts +18 -0
- package/dist/components/terminal-table.js +14 -0
- package/dist/components/terminal-tabs.d.ts +16 -0
- package/dist/components/terminal-tabs.js +20 -0
- package/dist/components/terminal-tooltip.d.ts +9 -0
- package/dist/components/terminal-tooltip.js +27 -0
- package/dist/components/terminal.d.ts +50 -0
- package/dist/components/terminal.js +56 -0
- package/dist/components/territory-card.d.ts +14 -0
- package/dist/components/territory-card.js +27 -0
- package/dist/components/vote-result-bar.d.ts +13 -0
- package/dist/components/vote-result-bar.js +23 -0
- package/dist/index.d.ts +22 -1
- package/dist/index.js +33 -1
- package/dist/lib/cn.d.ts +1 -0
- package/dist/lib/cn.js +7 -0
- package/dist/menu-config.d.ts +2 -0
- package/dist/menu-config.js +32 -17
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface KPIRadialChartProps {
|
|
2
|
+
value: number;
|
|
3
|
+
max?: number;
|
|
4
|
+
size?: number;
|
|
5
|
+
strokeWidth?: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
unit?: string;
|
|
8
|
+
color?: string;
|
|
9
|
+
trackColor?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function KPIRadialChart({ value, max, size, strokeWidth, label, unit, color, trackColor, className, }: KPIRadialChartProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.KPIRadialChart = KPIRadialChart;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const cn_1 = require("../lib/cn");
|
|
8
|
+
function KPIRadialChart({ value, max = 100, size = 120, strokeWidth = 8, label, unit, color = '#6366f1', trackColor = '#27272a', className, }) {
|
|
9
|
+
const radius = (size - strokeWidth) / 2;
|
|
10
|
+
const circumference = 2 * Math.PI * radius;
|
|
11
|
+
const percentage = Math.min(value / max, 1);
|
|
12
|
+
const offset = circumference * (1 - percentage);
|
|
13
|
+
const center = size / 2;
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("inline-flex flex-col items-center font-mono", className), children: [(0, jsx_runtime_1.jsxs)("svg", { width: size, height: size, className: "-rotate-90", children: [(0, jsx_runtime_1.jsx)("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: trackColor, strokeWidth: strokeWidth }), (0, jsx_runtime_1.jsx)("circle", { cx: center, cy: center, r: radius, fill: "none", stroke: color, strokeWidth: strokeWidth, strokeDasharray: circumference, strokeDashoffset: offset, strokeLinecap: "round", className: "transition-all duration-700" })] }), (0, jsx_runtime_1.jsxs)("div", { className: "absolute flex flex-col items-center justify-center", style: { width: size, height: size }, children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-bold text-lg", children: typeof value === 'number' ? value.toLocaleString() : value }), unit && (0, jsx_runtime_1.jsx)("span", { className: "text-zinc-500 text-xs", children: unit })] }), label && (0, jsx_runtime_1.jsx)("span", { className: "text-zinc-500 text-xs mt-2", children: label })] }));
|
|
15
|
+
}
|
|
@@ -4,9 +4,13 @@ export interface MicrocosmMenuSectionProps {
|
|
|
4
4
|
basePath?: string;
|
|
5
5
|
currentPath?: string;
|
|
6
6
|
onNavigate?: (path: string) => void;
|
|
7
|
+
onItemClick?: (item: MicrocosmMenuItem, resolvedPath: string) => void;
|
|
7
8
|
groups?: MicrocosmMenuGroup[];
|
|
8
9
|
className?: string;
|
|
10
|
+
filterItems?: (item: MicrocosmMenuItem) => boolean;
|
|
11
|
+
extraItems?: MicrocosmMenuItem[];
|
|
12
|
+
extraItemsPosition?: 'top' | 'bottom';
|
|
9
13
|
renderItem?: (item: MicrocosmMenuItem, resolvedPath: string, isActive: boolean) => React.ReactNode;
|
|
10
14
|
renderSectionHeader?: (group: MicrocosmMenuGroup) => React.ReactNode;
|
|
11
15
|
}
|
|
12
|
-
export declare function MicrocosmMenuSection({ basePath, currentPath, onNavigate, groups, className, renderItem, renderSectionHeader, }: MicrocosmMenuSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function MicrocosmMenuSection({ basePath, currentPath, onNavigate, onItemClick, groups, className, filterItems, extraItems, extraItemsPosition, renderItem, renderSectionHeader, }: MicrocosmMenuSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -15,49 +15,65 @@ function isActive(itemPath, currentPath) {
|
|
|
15
15
|
return currentPath === '/';
|
|
16
16
|
return currentPath.startsWith(itemPath);
|
|
17
17
|
}
|
|
18
|
-
function MicrocosmMenuSection({ basePath, currentPath, onNavigate, groups = menu_config_1.microcosmMenuGroups, className = '', renderItem, renderSectionHeader, }) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
18
|
+
function MicrocosmMenuSection({ basePath, currentPath, onNavigate, onItemClick, groups = menu_config_1.microcosmMenuGroups, className = '', filterItems, extraItems, extraItemsPosition = 'bottom', renderItem, renderSectionHeader, }) {
|
|
19
|
+
const renderMenuItem = (item) => {
|
|
20
|
+
const resolved = (0, menu_config_1.resolveMenuPath)(item.path, basePath);
|
|
21
|
+
const active = isActive(resolved, currentPath);
|
|
22
|
+
if (renderItem) {
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: renderItem(item, resolved, active) }, item.key));
|
|
24
|
+
}
|
|
25
|
+
return ((0, jsx_runtime_1.jsxs)("button", { onClick: () => {
|
|
26
|
+
onItemClick?.(item, resolved);
|
|
27
|
+
onNavigate?.(resolved);
|
|
28
|
+
}, title: item.description, style: {
|
|
29
|
+
display: 'flex',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
gap: '8px',
|
|
32
|
+
width: '100%',
|
|
33
|
+
padding: '8px 12px',
|
|
34
|
+
border: 'none',
|
|
35
|
+
background: active ? 'rgba(255,255,255,0.08)' : 'transparent',
|
|
36
|
+
color: active ? '#fff' : 'rgba(255,255,255,0.7)',
|
|
37
|
+
cursor: 'pointer',
|
|
38
|
+
fontSize: '13px',
|
|
39
|
+
fontFamily: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',
|
|
40
|
+
textAlign: 'left',
|
|
41
|
+
borderRadius: '6px',
|
|
42
|
+
transition: 'background 0.15s, color 0.15s',
|
|
43
|
+
}, onMouseEnter: (e) => {
|
|
44
|
+
if (!active) {
|
|
45
|
+
e.currentTarget.style.background = 'rgba(255,255,255,0.05)';
|
|
46
|
+
e.currentTarget.style.color = '#fff';
|
|
47
|
+
}
|
|
48
|
+
}, onMouseLeave: (e) => {
|
|
49
|
+
if (!active) {
|
|
50
|
+
e.currentTarget.style.background = 'transparent';
|
|
51
|
+
e.currentTarget.style.color = 'rgba(255,255,255,0.7)';
|
|
52
|
+
}
|
|
53
|
+
}, children: [(0, jsx_runtime_1.jsx)(item.icon, { size: 16 }), (0, jsx_runtime_1.jsx)("span", { style: { flex: 1 }, children: item.title }), item.badge && ((0, jsx_runtime_1.jsx)("span", { style: {
|
|
54
|
+
fontSize: '10px',
|
|
55
|
+
padding: '1px 6px',
|
|
56
|
+
borderRadius: '9999px',
|
|
57
|
+
background: 'rgba(99,102,241,0.2)',
|
|
58
|
+
color: 'rgb(129,140,248)',
|
|
59
|
+
}, children: item.badge }))] }, item.key));
|
|
60
|
+
};
|
|
61
|
+
const extraElements = extraItems?.map(renderMenuItem) || [];
|
|
62
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: `microcosm-menu ${className}`, children: [extraItemsPosition === 'top' && extraElements, groups.map((group) => {
|
|
63
|
+
const items = filterItems ? group.items.filter(filterItems) : group.items;
|
|
64
|
+
if (!items.length)
|
|
65
|
+
return null;
|
|
66
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "microcosm-menu-group", children: [renderSectionHeader ? (renderSectionHeader(group)) : ((0, jsx_runtime_1.jsxs)("div", { style: {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
alignItems: 'center',
|
|
69
|
+
gap: '8px',
|
|
70
|
+
padding: '8px 12px',
|
|
71
|
+
fontSize: '11px',
|
|
72
|
+
fontWeight: 600,
|
|
73
|
+
textTransform: 'uppercase',
|
|
74
|
+
letterSpacing: '0.05em',
|
|
75
|
+
opacity: 0.5,
|
|
76
|
+
fontFamily: 'ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace',
|
|
77
|
+
}, children: [(0, jsx_runtime_1.jsx)(group.icon, { size: 14 }), (0, jsx_runtime_1.jsx)("span", { children: group.title })] })), items.map(renderMenuItem)] }, group.key));
|
|
78
|
+
}), extraItemsPosition === 'bottom' && extraElements] }));
|
|
63
79
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface MiningProgressBarProps {
|
|
2
|
+
mined: number;
|
|
3
|
+
total: number;
|
|
4
|
+
halving?: number;
|
|
5
|
+
label?: string;
|
|
6
|
+
showStats?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function MiningProgressBar({ mined, total, halving, label, showStats, className, }: MiningProgressBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.MiningProgressBar = MiningProgressBar;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const cn_1 = require("../lib/cn");
|
|
8
|
+
const halvingColors = [
|
|
9
|
+
'bg-indigo-500',
|
|
10
|
+
'bg-emerald-500',
|
|
11
|
+
'bg-amber-500',
|
|
12
|
+
'bg-purple-500',
|
|
13
|
+
'bg-rose-500',
|
|
14
|
+
];
|
|
15
|
+
function MiningProgressBar({ mined, total, halving = 0, label, showStats = true, className, }) {
|
|
16
|
+
const percentage = total > 0 ? Math.min((mined / total) * 100, 100) : 0;
|
|
17
|
+
const barColor = halvingColors[halving % halvingColors.length];
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("font-mono", className), children: [label && (0, jsx_runtime_1.jsx)("div", { className: "text-zinc-500 text-xs mb-1", children: label }), (0, jsx_runtime_1.jsxs)("div", { className: "w-full bg-zinc-800 rounded h-3 relative overflow-hidden", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("h-3 rounded transition-all", barColor), style: { width: `${percentage}%` } }), halving > 0 && Array.from({ length: halving }, (_, i) => {
|
|
19
|
+
const pos = ((i + 1) / (halving + 1)) * 100;
|
|
20
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "absolute top-0 h-full w-px bg-zinc-600/50", style: { left: `${pos}%` } }, i));
|
|
21
|
+
})] }), showStats && ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between mt-1 text-xs", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-zinc-500", children: [mined.toLocaleString(), " / ", total.toLocaleString(), " MCC"] }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white", children: [percentage.toFixed(2), "%"] })] }))] }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface TerminalCountdownProps {
|
|
2
|
+
targetTime: number | Date;
|
|
3
|
+
onComplete?: () => void;
|
|
4
|
+
label?: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
format?: 'full' | 'compact';
|
|
7
|
+
}
|
|
8
|
+
export declare function TerminalCountdown({ targetTime, onComplete, label, className, format, }: TerminalCountdownProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerminalCountdown = TerminalCountdown;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const cn_1 = require("../lib/cn");
|
|
9
|
+
function calcRemaining(target) {
|
|
10
|
+
const diff = Math.max(0, target - Date.now());
|
|
11
|
+
return {
|
|
12
|
+
days: Math.floor(diff / 86400000),
|
|
13
|
+
hours: Math.floor((diff % 86400000) / 3600000),
|
|
14
|
+
minutes: Math.floor((diff % 3600000) / 60000),
|
|
15
|
+
seconds: Math.floor((diff % 60000) / 1000),
|
|
16
|
+
total: diff,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function TerminalCountdown({ targetTime, onComplete, label, className, format = 'full', }) {
|
|
20
|
+
const target = typeof targetTime === 'number' ? targetTime : targetTime.getTime();
|
|
21
|
+
const [remaining, setRemaining] = (0, react_1.useState)(() => calcRemaining(target));
|
|
22
|
+
(0, react_1.useEffect)(() => {
|
|
23
|
+
const id = setInterval(() => {
|
|
24
|
+
const r = calcRemaining(target);
|
|
25
|
+
setRemaining(r);
|
|
26
|
+
if (r.total <= 0) {
|
|
27
|
+
clearInterval(id);
|
|
28
|
+
onComplete?.();
|
|
29
|
+
}
|
|
30
|
+
}, 1000);
|
|
31
|
+
return () => clearInterval(id);
|
|
32
|
+
}, [target, onComplete]);
|
|
33
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
34
|
+
const timeStr = format === 'compact'
|
|
35
|
+
? `${remaining.days > 0 ? remaining.days + 'd ' : ''}${pad(remaining.hours)}:${pad(remaining.minutes)}:${pad(remaining.seconds)}`
|
|
36
|
+
: `${remaining.days}d ${pad(remaining.hours)}h ${pad(remaining.minutes)}m ${pad(remaining.seconds)}s`;
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("font-mono", className), children: [label && (0, jsx_runtime_1.jsx)("div", { className: "text-zinc-500 text-xs mb-1", children: label }), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("text-xl font-bold tabular-nums", remaining.total <= 0 ? "text-red-400" : "text-white"), children: remaining.total <= 0 ? 'EXPIRED' : timeStr })] }));
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TerminalDialogProps {
|
|
3
|
+
open: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
filename?: string;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
width?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function TerminalDialog({ open, onClose, title, filename, children, className, width, }: TerminalDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerminalDialog = TerminalDialog;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const cn_1 = require("../lib/cn");
|
|
9
|
+
function TerminalDialog({ open, onClose, title, filename, children, className, width = 'max-w-lg', }) {
|
|
10
|
+
const handleEsc = (0, react_1.useCallback)((e) => {
|
|
11
|
+
if (e.key === 'Escape')
|
|
12
|
+
onClose();
|
|
13
|
+
}, [onClose]);
|
|
14
|
+
(0, react_1.useEffect)(() => {
|
|
15
|
+
if (open) {
|
|
16
|
+
document.addEventListener('keydown', handleEsc);
|
|
17
|
+
document.body.style.overflow = 'hidden';
|
|
18
|
+
}
|
|
19
|
+
return () => {
|
|
20
|
+
document.removeEventListener('keydown', handleEsc);
|
|
21
|
+
document.body.style.overflow = '';
|
|
22
|
+
};
|
|
23
|
+
}, [open, handleEsc]);
|
|
24
|
+
if (!open)
|
|
25
|
+
return null;
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm", onClick: onClose }), (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("relative w-full mx-4 bg-zinc-900 border border-zinc-700 rounded-lg overflow-hidden shadow-2xl", width, className), children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-between px-4 py-2 bg-zinc-800/50 border-b border-zinc-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("button", { onClick: onClose, className: "w-3 h-3 rounded-full bg-red-500 hover:bg-red-400 transition-colors" }), (0, jsx_runtime_1.jsx)("div", { className: "w-3 h-3 rounded-full bg-yellow-500" }), (0, jsx_runtime_1.jsx)("div", { className: "w-3 h-3 rounded-full bg-green-500" }), (filename || title) && ((0, jsx_runtime_1.jsx)("span", { className: "ml-2 text-zinc-500 text-xs font-mono", children: filename || title }))] }) }), (0, jsx_runtime_1.jsx)("div", { className: "p-6 font-mono", children: children })] })] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TerminalInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
3
|
+
label?: string;
|
|
4
|
+
error?: string;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
suffix?: React.ReactNode;
|
|
7
|
+
inputSize?: 'sm' | 'md' | 'lg';
|
|
8
|
+
}
|
|
9
|
+
export declare function TerminalInput({ label, error, prefix, suffix, inputSize, className, ...props }: TerminalInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerminalInput = TerminalInput;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const cn_1 = require("../lib/cn");
|
|
8
|
+
const sizeClasses = {
|
|
9
|
+
sm: 'px-2 py-1 text-xs',
|
|
10
|
+
md: 'px-3 py-2 text-sm',
|
|
11
|
+
lg: 'px-4 py-3 text-base',
|
|
12
|
+
};
|
|
13
|
+
function TerminalInput({ label, error, prefix = '$', suffix, inputSize = 'md', className, ...props }) {
|
|
14
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "font-mono", children: [label && (0, jsx_runtime_1.jsx)("div", { className: "text-zinc-500 text-xs mb-1", children: label }), (0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("flex items-center bg-zinc-950 border rounded", error ? "border-red-500/50" : "border-zinc-800 focus-within:border-indigo-500/50", className), children: [prefix && (0, jsx_runtime_1.jsx)("span", { className: "text-indigo-400 pl-3 select-none", children: prefix }), (0, jsx_runtime_1.jsx)("input", { ...props, className: (0, cn_1.cn)("flex-1 bg-transparent text-white outline-none font-mono placeholder:text-zinc-600", sizeClasses[inputSize]) }), suffix && (0, jsx_runtime_1.jsx)("span", { className: "pr-3 text-zinc-500", children: suffix })] }), error && (0, jsx_runtime_1.jsx)("div", { className: "text-red-400 text-xs mt-1", children: error })] }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TerminalTableColumn<T> {
|
|
3
|
+
key: string;
|
|
4
|
+
header: string;
|
|
5
|
+
render?: (row: T, index: number) => React.ReactNode;
|
|
6
|
+
align?: 'left' | 'center' | 'right';
|
|
7
|
+
width?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TerminalTableProps<T> {
|
|
10
|
+
columns: TerminalTableColumn<T>[];
|
|
11
|
+
data: T[];
|
|
12
|
+
rowKey?: (row: T, index: number) => string;
|
|
13
|
+
onRowClick?: (row: T, index: number) => void;
|
|
14
|
+
className?: string;
|
|
15
|
+
emptyMessage?: string;
|
|
16
|
+
striped?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function TerminalTable<T extends Record<string, any>>({ columns, data, rowKey, onRowClick, className, emptyMessage, striped, }: TerminalTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerminalTable = TerminalTable;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const cn_1 = require("../lib/cn");
|
|
8
|
+
function TerminalTable({ columns, data, rowKey, onRowClick, className, emptyMessage = 'no records found', striped = true, }) {
|
|
9
|
+
const alignClass = (align) => align === 'right' ? 'text-right' : align === 'center' ? 'text-center' : 'text-left';
|
|
10
|
+
if (!data.length) {
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-8 text-zinc-500 font-mono text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-yellow-400", children: "warning:" }), " ", emptyMessage] }));
|
|
12
|
+
}
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("overflow-x-auto", className), children: (0, jsx_runtime_1.jsxs)("table", { className: "w-full font-mono text-sm", children: [(0, jsx_runtime_1.jsx)("thead", { children: (0, jsx_runtime_1.jsx)("tr", { className: "border-b border-zinc-700", children: columns.map((col) => ((0, jsx_runtime_1.jsx)("th", { className: (0, cn_1.cn)("px-3 py-2 text-zinc-500 font-normal text-xs uppercase tracking-wider", alignClass(col.align)), style: col.width ? { width: col.width } : undefined, children: col.header }, col.key))) }) }), (0, jsx_runtime_1.jsx)("tbody", { children: data.map((row, i) => ((0, jsx_runtime_1.jsx)("tr", { className: (0, cn_1.cn)("border-b border-zinc-800/50 last:border-0 transition-colors", striped && i % 2 === 1 && "bg-zinc-900/30", onRowClick && "cursor-pointer hover:bg-zinc-800/50"), onClick: () => onRowClick?.(row, i), children: columns.map((col) => ((0, jsx_runtime_1.jsx)("td", { className: (0, cn_1.cn)("px-3 py-2 text-white", alignClass(col.align)), children: col.render ? col.render(row, i) : row[col.key] }, col.key))) }, rowKey ? rowKey(row, i) : i))) })] }) }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TerminalTab {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface TerminalTabsProps {
|
|
9
|
+
tabs: TerminalTab[];
|
|
10
|
+
activeKey?: string;
|
|
11
|
+
defaultKey?: string;
|
|
12
|
+
onChange?: (key: string) => void;
|
|
13
|
+
children?: (activeKey: string) => React.ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function TerminalTabs({ tabs, activeKey: controlledKey, defaultKey, onChange, children, className, }: TerminalTabsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerminalTabs = TerminalTabs;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const cn_1 = require("../lib/cn");
|
|
9
|
+
function TerminalTabs({ tabs, activeKey: controlledKey, defaultKey, onChange, children, className, }) {
|
|
10
|
+
const [internalKey, setInternalKey] = (0, react_1.useState)(defaultKey || tabs[0]?.key || '');
|
|
11
|
+
const activeKey = controlledKey ?? internalKey;
|
|
12
|
+
const handleSelect = (key) => {
|
|
13
|
+
if (controlledKey === undefined)
|
|
14
|
+
setInternalKey(key);
|
|
15
|
+
onChange?.(key);
|
|
16
|
+
};
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("font-mono", className), children: [(0, jsx_runtime_1.jsx)("div", { className: "flex border-b border-zinc-800 gap-1", children: tabs.map((tab) => ((0, jsx_runtime_1.jsxs)("button", { disabled: tab.disabled, onClick: () => !tab.disabled && handleSelect(tab.key), className: (0, cn_1.cn)("px-4 py-2 text-sm transition-colors border-b-2 -mb-px", activeKey === tab.key
|
|
18
|
+
? "border-indigo-400 text-white"
|
|
19
|
+
: "border-transparent text-zinc-500 hover:text-zinc-300", tab.disabled && "opacity-40 cursor-not-allowed"), children: [tab.icon && (0, jsx_runtime_1.jsx)("span", { className: "mr-2 inline-flex", children: tab.icon }), tab.label] }, tab.key))) }), children && (0, jsx_runtime_1.jsx)("div", { className: "pt-4", children: children(activeKey) })] }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TerminalTooltipProps {
|
|
3
|
+
content: React.ReactNode;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
side?: 'top' | 'bottom' | 'left' | 'right';
|
|
6
|
+
className?: string;
|
|
7
|
+
delay?: number;
|
|
8
|
+
}
|
|
9
|
+
export declare function TerminalTooltip({ content, children, side, className, delay, }: TerminalTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerminalTooltip = TerminalTooltip;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const react_1 = require("react");
|
|
8
|
+
const cn_1 = require("../lib/cn");
|
|
9
|
+
const positionStyles = {
|
|
10
|
+
top: { bottom: '100%', left: '50%', transform: 'translateX(-50%)', marginBottom: 6 },
|
|
11
|
+
bottom: { top: '100%', left: '50%', transform: 'translateX(-50%)', marginTop: 6 },
|
|
12
|
+
left: { right: '100%', top: '50%', transform: 'translateY(-50%)', marginRight: 6 },
|
|
13
|
+
right: { left: '100%', top: '50%', transform: 'translateY(-50%)', marginLeft: 6 },
|
|
14
|
+
};
|
|
15
|
+
function TerminalTooltip({ content, children, side = 'top', className, delay = 200, }) {
|
|
16
|
+
const [visible, setVisible] = (0, react_1.useState)(false);
|
|
17
|
+
const timerRef = (0, react_1.useRef)();
|
|
18
|
+
const show = () => {
|
|
19
|
+
timerRef.current = setTimeout(() => setVisible(true), delay);
|
|
20
|
+
};
|
|
21
|
+
const hide = () => {
|
|
22
|
+
clearTimeout(timerRef.current);
|
|
23
|
+
setVisible(false);
|
|
24
|
+
};
|
|
25
|
+
(0, react_1.useEffect)(() => () => clearTimeout(timerRef.current), []);
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("span", { className: "relative inline-flex", onMouseEnter: show, onMouseLeave: hide, onFocus: show, onBlur: hide, children: [children, visible && ((0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.cn)("absolute z-50 px-2 py-1 text-xs font-mono bg-zinc-800 text-zinc-200 border border-zinc-700 rounded shadow-lg whitespace-nowrap pointer-events-none", className), style: positionStyles[side], role: "tooltip", children: content }))] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare function TerminalCard({ title, filename, children, className, }: {
|
|
3
|
+
title?: string;
|
|
4
|
+
filename?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function StatBox({ label, value, unit, color, className, }: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string | number;
|
|
11
|
+
unit?: string;
|
|
12
|
+
color?: string;
|
|
13
|
+
className?: string;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function TerminalCommand({ command, className, }: {
|
|
16
|
+
command: string;
|
|
17
|
+
className?: string;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export declare function TerminalPageHeader({ command, title, description, }: {
|
|
20
|
+
command: string;
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export declare function TerminalLoading({ message }: {
|
|
25
|
+
message?: string;
|
|
26
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare function TerminalError({ error, suggestion, }: {
|
|
28
|
+
error: string;
|
|
29
|
+
suggestion?: string;
|
|
30
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
export declare function TerminalEmpty({ message }: {
|
|
32
|
+
message?: string;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
export declare function TerminalBadge({ children, variant, className, }: {
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
variant?: "default" | "success" | "warning" | "error" | "info";
|
|
37
|
+
className?: string;
|
|
38
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export declare function TerminalDataRow({ label, value, valueColor, }: {
|
|
40
|
+
label: string;
|
|
41
|
+
value: React.ReactNode;
|
|
42
|
+
valueColor?: string;
|
|
43
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare function TerminalProgress({ value, max, label, showPercentage, color, }: {
|
|
45
|
+
value: number;
|
|
46
|
+
max?: number;
|
|
47
|
+
label?: string;
|
|
48
|
+
showPercentage?: boolean;
|
|
49
|
+
color?: string;
|
|
50
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerminalCard = TerminalCard;
|
|
6
|
+
exports.StatBox = StatBox;
|
|
7
|
+
exports.TerminalCommand = TerminalCommand;
|
|
8
|
+
exports.TerminalPageHeader = TerminalPageHeader;
|
|
9
|
+
exports.TerminalLoading = TerminalLoading;
|
|
10
|
+
exports.TerminalError = TerminalError;
|
|
11
|
+
exports.TerminalEmpty = TerminalEmpty;
|
|
12
|
+
exports.TerminalBadge = TerminalBadge;
|
|
13
|
+
exports.TerminalDataRow = TerminalDataRow;
|
|
14
|
+
exports.TerminalProgress = TerminalProgress;
|
|
15
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
const cn_1 = require("../lib/cn");
|
|
17
|
+
function TerminalCard({ title, filename, children, className, }) {
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("bg-zinc-900 border border-zinc-800 rounded-lg overflow-hidden", className), children: [(title || filename) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 px-4 py-2 bg-zinc-800/50 border-b border-zinc-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-2 h-2 rounded-full bg-red-500" }), (0, jsx_runtime_1.jsx)("div", { className: "w-2 h-2 rounded-full bg-yellow-500" }), (0, jsx_runtime_1.jsx)("div", { className: "w-2 h-2 rounded-full bg-green-500" }), (0, jsx_runtime_1.jsx)("span", { className: "ml-2 text-zinc-500 text-xs font-mono", children: filename || title })] })), (0, jsx_runtime_1.jsx)("div", { className: "p-4", children: children })] }));
|
|
19
|
+
}
|
|
20
|
+
function StatBox({ label, value, unit, color = 'text-white', className, }) {
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("bg-zinc-950 border border-zinc-800 rounded p-4", className), children: [(0, jsx_runtime_1.jsx)("div", { className: "text-zinc-500 text-xs mb-1 font-mono", children: label }), (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("text-2xl font-bold font-mono", color), children: typeof value === 'number'
|
|
22
|
+
? value.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })
|
|
23
|
+
: value }), unit && (0, jsx_runtime_1.jsx)("div", { className: "text-zinc-600 text-xs mt-1", children: unit })] }));
|
|
24
|
+
}
|
|
25
|
+
function TerminalCommand({ command, className, }) {
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("text-zinc-500 text-sm mb-4 font-mono", className), children: [(0, jsx_runtime_1.jsx)("span", { className: "text-indigo-400", children: "$" }), " ", command] }));
|
|
27
|
+
}
|
|
28
|
+
function TerminalPageHeader({ command, title, description, }) {
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "mb-6 font-mono", children: [(0, jsx_runtime_1.jsx)(TerminalCommand, { command: command, className: "mb-2" }), (0, jsx_runtime_1.jsxs)("h1", { className: "text-2xl text-white mb-2", children: ["# ", title] }), description && ((0, jsx_runtime_1.jsx)("p", { className: "text-zinc-500 text-sm", children: description }))] }));
|
|
30
|
+
}
|
|
31
|
+
function TerminalLoading({ message = "loading..." }) {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center min-h-[60vh] font-mono", children: (0, jsx_runtime_1.jsxs)("div", { className: "text-center space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-8 h-8 border-2 border-indigo-400 border-t-transparent rounded-full animate-spin mx-auto" }), (0, jsx_runtime_1.jsxs)("div", { className: "text-zinc-500", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-indigo-400", children: "$" }), " ", message] })] }) }));
|
|
33
|
+
}
|
|
34
|
+
function TerminalError({ error, suggestion = "Please refresh and try again", }) {
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center min-h-[60vh] font-mono", children: (0, jsx_runtime_1.jsxs)(TerminalCard, { filename: "error.log", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-red-400 mb-2", children: ["error: ", error] }), (0, jsx_runtime_1.jsx)("div", { className: "text-zinc-500 text-sm", children: suggestion })] }) }));
|
|
36
|
+
}
|
|
37
|
+
function TerminalEmpty({ message = "no data" }) {
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "text-center py-12 text-zinc-500 font-mono", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-yellow-400", children: "warning:" }), " ", message] }));
|
|
39
|
+
}
|
|
40
|
+
function TerminalBadge({ children, variant = "default", className, }) {
|
|
41
|
+
const variants = {
|
|
42
|
+
default: "bg-zinc-800 text-zinc-400",
|
|
43
|
+
success: "bg-emerald-500/20 text-emerald-400",
|
|
44
|
+
warning: "bg-yellow-500/20 text-yellow-400",
|
|
45
|
+
error: "bg-red-500/20 text-red-400",
|
|
46
|
+
info: "bg-indigo-500/20 text-indigo-400",
|
|
47
|
+
};
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.cn)("px-2 py-0.5 text-xs rounded font-mono", variants[variant], className), children: children }));
|
|
49
|
+
}
|
|
50
|
+
function TerminalDataRow({ label, value, valueColor, }) {
|
|
51
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between py-2 border-b border-zinc-800 last:border-0 font-mono text-sm", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-zinc-500", children: [label, ":"] }), (0, jsx_runtime_1.jsx)("span", { className: (0, cn_1.cn)("text-white", valueColor), children: value })] }));
|
|
52
|
+
}
|
|
53
|
+
function TerminalProgress({ value, max = 100, label, showPercentage = true, color = "bg-indigo-500", }) {
|
|
54
|
+
const percentage = Math.min((value / max) * 100, 100);
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: "font-mono", children: [(label || showPercentage) && ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-2 text-sm", children: [label && (0, jsx_runtime_1.jsx)("span", { className: "text-zinc-500", children: label }), showPercentage && (0, jsx_runtime_1.jsxs)("span", { className: "text-white", children: [percentage.toFixed(1), "%"] })] })), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-zinc-800 rounded h-2", children: (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("h-2 rounded transition-all", color), style: { width: `${percentage}%` } }) })] }));
|
|
56
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TerritoryCardProps {
|
|
2
|
+
territoryId: string;
|
|
3
|
+
name: string;
|
|
4
|
+
type: 'station' | 'matrix' | 'sector' | 'system';
|
|
5
|
+
level?: number;
|
|
6
|
+
memberCount?: number;
|
|
7
|
+
capacity?: number;
|
|
8
|
+
magistrate?: string;
|
|
9
|
+
mcdBalance?: number;
|
|
10
|
+
status?: 'active' | 'inactive' | 'full';
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
className?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function TerritoryCard({ territoryId, name, type, level, memberCount, capacity, magistrate, mcdBalance, status, onClick, className, }: TerritoryCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.TerritoryCard = TerritoryCard;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const cn_1 = require("../lib/cn");
|
|
8
|
+
const typeLabels = {
|
|
9
|
+
station: 'Station',
|
|
10
|
+
matrix: 'Matrix',
|
|
11
|
+
sector: 'Sector',
|
|
12
|
+
system: 'System',
|
|
13
|
+
};
|
|
14
|
+
const typeColors = {
|
|
15
|
+
station: 'text-indigo-400',
|
|
16
|
+
matrix: 'text-emerald-400',
|
|
17
|
+
sector: 'text-amber-400',
|
|
18
|
+
system: 'text-purple-400',
|
|
19
|
+
};
|
|
20
|
+
const statusColors = {
|
|
21
|
+
active: 'bg-emerald-500',
|
|
22
|
+
inactive: 'bg-zinc-500',
|
|
23
|
+
full: 'bg-amber-500',
|
|
24
|
+
};
|
|
25
|
+
function TerritoryCard({ territoryId, name, type, level, memberCount, capacity, magistrate, mcdBalance, status = 'active', onClick, className, }) {
|
|
26
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("bg-zinc-900 border border-zinc-800 rounded-lg p-4 font-mono", onClick && "cursor-pointer hover:border-zinc-600 transition-colors", className), onClick: onClick, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsxs)("span", { className: (0, cn_1.cn)("text-xs font-bold uppercase", typeColors[type]), children: ["[", typeLabels[type] || type, "]"] }), (0, jsx_runtime_1.jsx)("span", { className: "text-white font-bold", children: name })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("w-2 h-2 rounded-full", statusColors[status]) }), (0, jsx_runtime_1.jsx)("span", { className: "text-zinc-600 text-xs", children: territoryId })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [level !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-zinc-500", children: [(0, jsx_runtime_1.jsx)("span", { children: "Level:" }), (0, jsx_runtime_1.jsx)("span", { className: "text-white", children: level })] })), memberCount !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-zinc-500", children: [(0, jsx_runtime_1.jsx)("span", { children: "Members:" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white", children: [memberCount, capacity ? `/${capacity}` : ''] })] })), magistrate && ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-zinc-500", children: [(0, jsx_runtime_1.jsx)("span", { children: "Magistrate:" }), (0, jsx_runtime_1.jsx)("span", { className: "text-indigo-400 truncate ml-1 max-w-[100px]", children: magistrate })] })), mcdBalance !== undefined && ((0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between text-zinc-500", children: [(0, jsx_runtime_1.jsx)("span", { children: "MCD Vault:" }), (0, jsx_runtime_1.jsx)("span", { className: "text-emerald-400", children: mcdBalance.toLocaleString('en-US', { minimumFractionDigits: 2 }) })] }))] }), capacity !== undefined && memberCount !== undefined && ((0, jsx_runtime_1.jsx)("div", { className: "mt-3", children: (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-zinc-800 rounded h-1.5", children: (0, jsx_runtime_1.jsx)("div", { className: "h-1.5 rounded bg-indigo-500 transition-all", style: { width: `${Math.min((memberCount / capacity) * 100, 100)}%` } }) }) }))] }));
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface VoteOption {
|
|
2
|
+
label: string;
|
|
3
|
+
votes: number;
|
|
4
|
+
color?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface VoteResultBarProps {
|
|
7
|
+
options: VoteOption[];
|
|
8
|
+
totalVotes?: number;
|
|
9
|
+
showPercentage?: boolean;
|
|
10
|
+
showCount?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function VoteResultBar({ options, totalVotes: explicitTotal, showPercentage, showCount, className, }: VoteResultBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AI-generated · AI-managed · AI-maintained
|
|
3
|
+
"use client";
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.VoteResultBar = VoteResultBar;
|
|
6
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const cn_1 = require("../lib/cn");
|
|
8
|
+
const defaultColors = [
|
|
9
|
+
'bg-indigo-500',
|
|
10
|
+
'bg-emerald-500',
|
|
11
|
+
'bg-amber-500',
|
|
12
|
+
'bg-rose-500',
|
|
13
|
+
'bg-purple-500',
|
|
14
|
+
'bg-cyan-500',
|
|
15
|
+
];
|
|
16
|
+
function VoteResultBar({ options, totalVotes: explicitTotal, showPercentage = true, showCount = true, className, }) {
|
|
17
|
+
const totalVotes = explicitTotal ?? options.reduce((s, o) => s + o.votes, 0);
|
|
18
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: (0, cn_1.cn)("font-mono space-y-3", className), children: [options.map((opt, i) => {
|
|
19
|
+
const pct = totalVotes > 0 ? (opt.votes / totalVotes) * 100 : 0;
|
|
20
|
+
const color = opt.color || defaultColors[i % defaultColors.length];
|
|
21
|
+
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center mb-1 text-sm", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-zinc-300", children: opt.label }), (0, jsx_runtime_1.jsxs)("span", { className: "text-zinc-500", children: [showCount && (0, jsx_runtime_1.jsx)("span", { children: opt.votes.toLocaleString() }), showCount && showPercentage && (0, jsx_runtime_1.jsx)("span", { className: "mx-1", children: "\u00B7" }), showPercentage && (0, jsx_runtime_1.jsxs)("span", { children: [pct.toFixed(1), "%"] })] })] }), (0, jsx_runtime_1.jsx)("div", { className: "w-full bg-zinc-800 rounded h-2", children: (0, jsx_runtime_1.jsx)("div", { className: (0, cn_1.cn)("h-2 rounded transition-all", color), style: { width: `${pct}%` } }) })] }, i));
|
|
22
|
+
}), totalVotes > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-zinc-600 text-right", children: ["Total: ", totalVotes.toLocaleString(), " votes"] }))] }));
|
|
23
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,25 @@
|
|
|
1
1
|
export { MicrocosmMenuSection } from './components/menu-section';
|
|
2
2
|
export type { MicrocosmMenuSectionProps } from './components/menu-section';
|
|
3
|
-
export { blockchainMenu, web3OsMenu, microcosmMenuGroups, getAllMenuItems, resolveMenuPath, } from './menu-config';
|
|
3
|
+
export { blockchainMenu, web3OsMenu, dashboardMenu, microcosmMenuGroups, getAllMenuItems, resolveMenuPath, } from './menu-config';
|
|
4
4
|
export type { MicrocosmMenuItem, MicrocosmMenuGroup } from './menu-config';
|
|
5
|
+
export { TerminalCard, StatBox, TerminalCommand, TerminalPageHeader, TerminalLoading, TerminalError, TerminalEmpty, TerminalBadge, TerminalDataRow, TerminalProgress, } from './components/terminal';
|
|
6
|
+
export { TerminalTable } from './components/terminal-table';
|
|
7
|
+
export type { TerminalTableColumn, TerminalTableProps } from './components/terminal-table';
|
|
8
|
+
export { TerminalTabs } from './components/terminal-tabs';
|
|
9
|
+
export type { TerminalTab, TerminalTabsProps } from './components/terminal-tabs';
|
|
10
|
+
export { TerminalDialog } from './components/terminal-dialog';
|
|
11
|
+
export type { TerminalDialogProps } from './components/terminal-dialog';
|
|
12
|
+
export { TerminalCountdown } from './components/terminal-countdown';
|
|
13
|
+
export type { TerminalCountdownProps } from './components/terminal-countdown';
|
|
14
|
+
export { TerminalInput } from './components/terminal-input';
|
|
15
|
+
export type { TerminalInputProps } from './components/terminal-input';
|
|
16
|
+
export { TerminalTooltip } from './components/terminal-tooltip';
|
|
17
|
+
export type { TerminalTooltipProps } from './components/terminal-tooltip';
|
|
18
|
+
export { TerritoryCard } from './components/territory-card';
|
|
19
|
+
export type { TerritoryCardProps } from './components/territory-card';
|
|
20
|
+
export { MiningProgressBar } from './components/mining-progress-bar';
|
|
21
|
+
export type { MiningProgressBarProps } from './components/mining-progress-bar';
|
|
22
|
+
export { VoteResultBar } from './components/vote-result-bar';
|
|
23
|
+
export type { VoteOption, VoteResultBarProps } from './components/vote-result-bar';
|
|
24
|
+
export { KPIRadialChart } from './components/kpi-radial-chart';
|
|
25
|
+
export type { KPIRadialChartProps } from './components/kpi-radial-chart';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveMenuPath = exports.getAllMenuItems = exports.microcosmMenuGroups = exports.web3OsMenu = exports.blockchainMenu = exports.MicrocosmMenuSection = void 0;
|
|
3
|
+
exports.KPIRadialChart = exports.VoteResultBar = exports.MiningProgressBar = exports.TerritoryCard = exports.TerminalTooltip = exports.TerminalInput = exports.TerminalCountdown = exports.TerminalDialog = exports.TerminalTabs = exports.TerminalTable = exports.TerminalProgress = exports.TerminalDataRow = exports.TerminalBadge = exports.TerminalEmpty = exports.TerminalError = exports.TerminalLoading = exports.TerminalPageHeader = exports.TerminalCommand = exports.StatBox = exports.TerminalCard = exports.resolveMenuPath = exports.getAllMenuItems = exports.microcosmMenuGroups = exports.dashboardMenu = exports.web3OsMenu = exports.blockchainMenu = exports.MicrocosmMenuSection = void 0;
|
|
4
4
|
// AI-generated · AI-managed · AI-maintained
|
|
5
5
|
var menu_section_1 = require("./components/menu-section");
|
|
6
6
|
Object.defineProperty(exports, "MicrocosmMenuSection", { enumerable: true, get: function () { return menu_section_1.MicrocosmMenuSection; } });
|
|
7
7
|
var menu_config_1 = require("./menu-config");
|
|
8
8
|
Object.defineProperty(exports, "blockchainMenu", { enumerable: true, get: function () { return menu_config_1.blockchainMenu; } });
|
|
9
9
|
Object.defineProperty(exports, "web3OsMenu", { enumerable: true, get: function () { return menu_config_1.web3OsMenu; } });
|
|
10
|
+
Object.defineProperty(exports, "dashboardMenu", { enumerable: true, get: function () { return menu_config_1.dashboardMenu; } });
|
|
10
11
|
Object.defineProperty(exports, "microcosmMenuGroups", { enumerable: true, get: function () { return menu_config_1.microcosmMenuGroups; } });
|
|
11
12
|
Object.defineProperty(exports, "getAllMenuItems", { enumerable: true, get: function () { return menu_config_1.getAllMenuItems; } });
|
|
12
13
|
Object.defineProperty(exports, "resolveMenuPath", { enumerable: true, get: function () { return menu_config_1.resolveMenuPath; } });
|
|
14
|
+
var terminal_1 = require("./components/terminal");
|
|
15
|
+
Object.defineProperty(exports, "TerminalCard", { enumerable: true, get: function () { return terminal_1.TerminalCard; } });
|
|
16
|
+
Object.defineProperty(exports, "StatBox", { enumerable: true, get: function () { return terminal_1.StatBox; } });
|
|
17
|
+
Object.defineProperty(exports, "TerminalCommand", { enumerable: true, get: function () { return terminal_1.TerminalCommand; } });
|
|
18
|
+
Object.defineProperty(exports, "TerminalPageHeader", { enumerable: true, get: function () { return terminal_1.TerminalPageHeader; } });
|
|
19
|
+
Object.defineProperty(exports, "TerminalLoading", { enumerable: true, get: function () { return terminal_1.TerminalLoading; } });
|
|
20
|
+
Object.defineProperty(exports, "TerminalError", { enumerable: true, get: function () { return terminal_1.TerminalError; } });
|
|
21
|
+
Object.defineProperty(exports, "TerminalEmpty", { enumerable: true, get: function () { return terminal_1.TerminalEmpty; } });
|
|
22
|
+
Object.defineProperty(exports, "TerminalBadge", { enumerable: true, get: function () { return terminal_1.TerminalBadge; } });
|
|
23
|
+
Object.defineProperty(exports, "TerminalDataRow", { enumerable: true, get: function () { return terminal_1.TerminalDataRow; } });
|
|
24
|
+
Object.defineProperty(exports, "TerminalProgress", { enumerable: true, get: function () { return terminal_1.TerminalProgress; } });
|
|
25
|
+
var terminal_table_1 = require("./components/terminal-table");
|
|
26
|
+
Object.defineProperty(exports, "TerminalTable", { enumerable: true, get: function () { return terminal_table_1.TerminalTable; } });
|
|
27
|
+
var terminal_tabs_1 = require("./components/terminal-tabs");
|
|
28
|
+
Object.defineProperty(exports, "TerminalTabs", { enumerable: true, get: function () { return terminal_tabs_1.TerminalTabs; } });
|
|
29
|
+
var terminal_dialog_1 = require("./components/terminal-dialog");
|
|
30
|
+
Object.defineProperty(exports, "TerminalDialog", { enumerable: true, get: function () { return terminal_dialog_1.TerminalDialog; } });
|
|
31
|
+
var terminal_countdown_1 = require("./components/terminal-countdown");
|
|
32
|
+
Object.defineProperty(exports, "TerminalCountdown", { enumerable: true, get: function () { return terminal_countdown_1.TerminalCountdown; } });
|
|
33
|
+
var terminal_input_1 = require("./components/terminal-input");
|
|
34
|
+
Object.defineProperty(exports, "TerminalInput", { enumerable: true, get: function () { return terminal_input_1.TerminalInput; } });
|
|
35
|
+
var terminal_tooltip_1 = require("./components/terminal-tooltip");
|
|
36
|
+
Object.defineProperty(exports, "TerminalTooltip", { enumerable: true, get: function () { return terminal_tooltip_1.TerminalTooltip; } });
|
|
37
|
+
var territory_card_1 = require("./components/territory-card");
|
|
38
|
+
Object.defineProperty(exports, "TerritoryCard", { enumerable: true, get: function () { return territory_card_1.TerritoryCard; } });
|
|
39
|
+
var mining_progress_bar_1 = require("./components/mining-progress-bar");
|
|
40
|
+
Object.defineProperty(exports, "MiningProgressBar", { enumerable: true, get: function () { return mining_progress_bar_1.MiningProgressBar; } });
|
|
41
|
+
var vote_result_bar_1 = require("./components/vote-result-bar");
|
|
42
|
+
Object.defineProperty(exports, "VoteResultBar", { enumerable: true, get: function () { return vote_result_bar_1.VoteResultBar; } });
|
|
43
|
+
var kpi_radial_chart_1 = require("./components/kpi-radial-chart");
|
|
44
|
+
Object.defineProperty(exports, "KPIRadialChart", { enumerable: true, get: function () { return kpi_radial_chart_1.KPIRadialChart; } });
|
package/dist/lib/cn.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cn(...inputs: (string | undefined | null | false)[]): string;
|
package/dist/lib/cn.js
ADDED
package/dist/menu-config.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export interface MicrocosmMenuItem {
|
|
|
5
5
|
path: string;
|
|
6
6
|
icon: LucideIcon;
|
|
7
7
|
description?: string;
|
|
8
|
+
badge?: string;
|
|
8
9
|
}
|
|
9
10
|
export interface MicrocosmMenuGroup {
|
|
10
11
|
title: string;
|
|
@@ -12,6 +13,7 @@ export interface MicrocosmMenuGroup {
|
|
|
12
13
|
icon: LucideIcon;
|
|
13
14
|
items: MicrocosmMenuItem[];
|
|
14
15
|
}
|
|
16
|
+
export declare const dashboardMenu: MicrocosmMenuGroup;
|
|
15
17
|
export declare const blockchainMenu: MicrocosmMenuGroup;
|
|
16
18
|
export declare const web3OsMenu: MicrocosmMenuGroup;
|
|
17
19
|
export declare const microcosmMenuGroups: MicrocosmMenuGroup[];
|
package/dist/menu-config.js
CHANGED
|
@@ -1,42 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.microcosmMenuGroups = exports.web3OsMenu = exports.blockchainMenu = void 0;
|
|
3
|
+
exports.microcosmMenuGroups = exports.web3OsMenu = exports.blockchainMenu = exports.dashboardMenu = void 0;
|
|
4
4
|
exports.getAllMenuItems = getAllMenuItems;
|
|
5
5
|
exports.resolveMenuPath = resolveMenuPath;
|
|
6
6
|
// AI-generated · AI-managed · AI-maintained
|
|
7
7
|
const lucide_react_1 = require("lucide-react");
|
|
8
|
+
exports.dashboardMenu = {
|
|
9
|
+
title: 'Overview',
|
|
10
|
+
key: 'overview',
|
|
11
|
+
icon: lucide_react_1.LayoutDashboard,
|
|
12
|
+
items: [
|
|
13
|
+
{
|
|
14
|
+
title: 'Dashboard',
|
|
15
|
+
key: 'dashboard',
|
|
16
|
+
path: '/user-system/dashboard',
|
|
17
|
+
icon: lucide_react_1.LayoutDashboard,
|
|
18
|
+
description: 'Account overview and statistics',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
};
|
|
8
22
|
exports.blockchainMenu = {
|
|
9
23
|
title: 'Blockchain',
|
|
10
24
|
key: 'blockchain',
|
|
11
25
|
icon: lucide_react_1.Coins,
|
|
12
26
|
items: [
|
|
13
27
|
{
|
|
14
|
-
title: '
|
|
28
|
+
title: 'Mining',
|
|
15
29
|
key: 'mining',
|
|
16
30
|
path: '/mcc/mining',
|
|
17
31
|
icon: lucide_react_1.Pickaxe,
|
|
18
|
-
description: '
|
|
32
|
+
description: 'Mine MCC with stablecoin',
|
|
19
33
|
},
|
|
20
34
|
{
|
|
21
|
-
title: '
|
|
35
|
+
title: 'Reincarnation',
|
|
22
36
|
key: 'reincarnation',
|
|
23
37
|
path: '/mcc/reincarnation',
|
|
24
38
|
icon: lucide_react_1.ArrowDownUp,
|
|
25
|
-
description: 'MCC
|
|
39
|
+
description: 'Buyback MCC for stablecoin',
|
|
26
40
|
},
|
|
27
41
|
{
|
|
28
|
-
title: '
|
|
42
|
+
title: 'Wallet',
|
|
29
43
|
key: 'wallet',
|
|
30
44
|
path: '/mcc/wallet',
|
|
31
45
|
icon: lucide_react_1.Wallet,
|
|
32
|
-
description: 'MCC
|
|
46
|
+
description: 'MCC asset overview',
|
|
33
47
|
},
|
|
34
48
|
{
|
|
35
|
-
title: 'MCD
|
|
49
|
+
title: 'MCD Credits',
|
|
36
50
|
key: 'mcd',
|
|
37
51
|
path: '/mcc/mcd',
|
|
38
52
|
icon: lucide_react_1.Ticket,
|
|
39
|
-
description: 'MCD
|
|
53
|
+
description: 'MCD balance and records',
|
|
40
54
|
},
|
|
41
55
|
],
|
|
42
56
|
};
|
|
@@ -46,36 +60,37 @@ exports.web3OsMenu = {
|
|
|
46
60
|
icon: lucide_react_1.Users,
|
|
47
61
|
items: [
|
|
48
62
|
{
|
|
49
|
-
title: '
|
|
63
|
+
title: 'Auctions',
|
|
50
64
|
key: 'auctions',
|
|
51
65
|
path: '/mcc/auctions',
|
|
52
66
|
icon: lucide_react_1.Gift,
|
|
53
|
-
description: '
|
|
67
|
+
description: 'Territory auction bidding',
|
|
54
68
|
},
|
|
55
69
|
{
|
|
56
|
-
title: '
|
|
70
|
+
title: 'Territories',
|
|
57
71
|
key: 'territory',
|
|
58
72
|
path: '/user-system/territory',
|
|
59
73
|
icon: lucide_react_1.Building2,
|
|
60
|
-
description: '
|
|
74
|
+
description: 'Territory list and details',
|
|
61
75
|
},
|
|
62
76
|
{
|
|
63
|
-
title: '
|
|
77
|
+
title: 'Voting',
|
|
64
78
|
key: 'voting',
|
|
65
79
|
path: '/mcc/voting',
|
|
66
80
|
icon: lucide_react_1.Vote,
|
|
67
|
-
description: '
|
|
81
|
+
description: 'Community proposal voting',
|
|
68
82
|
},
|
|
69
83
|
{
|
|
70
|
-
title: '
|
|
84
|
+
title: 'Organization',
|
|
71
85
|
key: 'organization',
|
|
72
86
|
path: '/user-system/organization',
|
|
73
87
|
icon: lucide_react_1.Users,
|
|
74
|
-
description: '
|
|
88
|
+
description: 'Organization structure',
|
|
75
89
|
},
|
|
76
90
|
],
|
|
77
91
|
};
|
|
78
92
|
exports.microcosmMenuGroups = [
|
|
93
|
+
exports.dashboardMenu,
|
|
79
94
|
exports.blockchainMenu,
|
|
80
95
|
exports.web3OsMenu,
|
|
81
96
|
];
|