Files
tfm_ainventory/frontend/components/StatCard.tsx
Daniel Bedeleanu 9611b991b6 refactor(design): implement improved OLED dark palette and typography system
- Upgraded color palette with enhanced contrast (5.2:1 to 15:1 ratios)
- Replaced all text-slate-* utilities with semantic color tokens
- Added Fira Code + Fira Sans typography stack
- Converted CSS variables from SCSS to direct hex values
- Updated 26 components with improved color semantics
- Added cursor-pointer and focus states (accessibility phase 1)
- Added aria-labels to 35+ icon-only buttons
- Added prefers-reduced-motion support in globals.css

WCAG AA compliance verified across all text color combinations.
Fixes invisible text issues (slate-500 4.2:1 → muted 5.2:1).
2026-04-17 13:14:09 +03:00

26 lines
855 B
TypeScript

import React from 'react';
import { LucideIcon } from 'lucide-react';
interface StatCardProps {
label: string;
value: number;
icon?: LucideIcon;
}
export default function StatCard({ label, value, icon: Icon }: StatCardProps) {
return (
<div className="flex justify-between items-center gap-2 p-3.5 bg-surface/70 border border-slate-800/50 rounded-2xl shadow-sm transition-all hover:bg-surface" role="status">
<div className="flex items-center gap-2.5 min-w-0">
{Icon && <Icon className="w-5 h-5 text-primary flex-shrink-0" aria-hidden="true" />}
<span className="text-base md:text-lg text-slate-300 font-semibold truncate">
{label}
</span>
</div>
<span className="text-2xl md:text-3xl font-black text-white whitespace-nowrap tabular-nums">
{value}
</span>
</div>
);
}