@q3assets/ui 0.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/package.json +13 -0
- package/src/kpi-card.tsx +31 -0
- package/src/status-badge.tsx +26 -0
- package/tsconfig.json +8 -0
package/package.json
ADDED
package/src/kpi-card.tsx
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
interface KpiCardProps {
|
|
4
|
+
label: string
|
|
5
|
+
value: number | string
|
|
6
|
+
subtitle?: string
|
|
7
|
+
trend?: { value: number; label: string }
|
|
8
|
+
color?: "default" | "success" | "warning" | "danger"
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const colorMap = {
|
|
12
|
+
default: "text-indigo-400",
|
|
13
|
+
success: "text-emerald-400",
|
|
14
|
+
warning: "text-amber-400",
|
|
15
|
+
danger: "text-red-400",
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function KpiCard({ label, value, subtitle, trend, color = "default" }: KpiCardProps) {
|
|
19
|
+
return (
|
|
20
|
+
<div className="rounded-xl border border-[var(--border)] bg-[var(--bg-card)] p-5 transition-colors hover:bg-[var(--bg-card-hover)]">
|
|
21
|
+
<p className="text-sm text-[var(--text-muted)]">{label}</p>
|
|
22
|
+
<p className={`mt-1.5 text-3xl font-semibold tracking-tight ${colorMap[color]}`}>{value}</p>
|
|
23
|
+
{subtitle && <p className="mt-1 text-xs text-[var(--text-muted)]">{subtitle}</p>}
|
|
24
|
+
{trend && (
|
|
25
|
+
<p className={`mt-2 text-xs ${trend.value >= 0 ? "text-emerald-400" : "text-red-400"}`}>
|
|
26
|
+
{trend.value >= 0 ? "\u2191" : "\u2193"} {Math.abs(trend.value)}% {trend.label}
|
|
27
|
+
</p>
|
|
28
|
+
)}
|
|
29
|
+
</div>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
const statusStyles: Record<string, string> = {
|
|
4
|
+
researched: "bg-zinc-800 text-zinc-300",
|
|
5
|
+
pitched: "bg-blue-900/50 text-blue-300",
|
|
6
|
+
responded: "bg-cyan-900/50 text-cyan-300",
|
|
7
|
+
follow_up: "bg-amber-900/50 text-amber-300",
|
|
8
|
+
booked: "bg-emerald-900/50 text-emerald-300",
|
|
9
|
+
declined: "bg-red-900/50 text-red-300",
|
|
10
|
+
completed: "bg-purple-900/50 text-purple-300",
|
|
11
|
+
tentative: "bg-amber-900/50 text-amber-300",
|
|
12
|
+
confirmed: "bg-emerald-900/50 text-emerald-300",
|
|
13
|
+
cancelled: "bg-red-900/50 text-red-300",
|
|
14
|
+
pending: "bg-zinc-800 text-zinc-300",
|
|
15
|
+
active: "bg-emerald-900/50 text-emerald-300",
|
|
16
|
+
inactive: "bg-zinc-800 text-zinc-300",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function StatusBadge({ status }: { status: string }) {
|
|
20
|
+
const style = statusStyles[status] || "bg-zinc-800 text-zinc-300"
|
|
21
|
+
return (
|
|
22
|
+
<span className={`inline-block rounded-full px-2.5 py-0.5 text-xs font-medium ${style}`}>
|
|
23
|
+
{status.replace(/_/g, " ")}
|
|
24
|
+
</span>
|
|
25
|
+
)
|
|
26
|
+
}
|