import { LucideIcon } from 'lucide-react'; import { ReactNode } from 'react'; import { Box } from './Box'; import { Card } from './Card'; import { Icon } from './Icon'; import { Text } from './Text'; export interface StatCardProps { label: string; value: string | number; icon?: LucideIcon; intent?: 'primary' | 'success' | 'warning' | 'critical' | 'telemetry' | 'low' | 'high' | 'med'; variant?: 'default' | 'dark' | 'muted' | 'glass' | 'outline' | 'blue' | 'green' | 'orange'; font?: 'sans' | 'mono'; trend?: { value: number; isPositive: boolean; }; footer?: ReactNode; suffix?: string; prefix?: string; delay?: number; } export const StatCard = ({ label, value, icon, intent: intentProp, variant = 'default', font = 'sans', trend, footer, suffix, prefix, delay }: StatCardProps) => { const variantMap: Record = { blue: { variant: 'default', intent: 'primary' }, green: { variant: 'default', intent: 'success' }, orange: { variant: 'default', intent: 'warning' }, }; const mapped = variantMap[variant as string] || { variant, intent: intentProp || 'primary' }; const finalVariant = mapped.variant; const finalIntent = mapped.intent; return ( {label} {prefix}{value}{suffix} {icon && ( )} {trend && ( {trend.isPositive ? '+' : '-'}{Math.abs(trend.value)}% vs last period )} {footer && ( {footer} )} ); };