5a824c2eee
75 components + DESIGN_SYSTEM.md + sync script. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3.1 KiB
3.1 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, output, tested, tests, test_file_path, file_path, props, emits, has_state, framework, variant, source_repo, source_license, source_file
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | output | tested | tests | test_file_path | file_path | props | emits | has_state | framework | variant | source_repo | source_license | source_file | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| kpi_card | component | ts | ui | 2.0.0 | impure | KPICard(props: KPICardProps): JSX.Element | Card de KPI con label, valor+unidad, delta descriptivo con color semántico, icono, slot de chart inline y action. 3 tamaños. |
|
false |
|
Componente KPICard que renderiza card de métrica con label, valor, delta descriptivo, icono y slot de mini chart | false | frontend/functions/ui/kpi_card.tsx |
|
false | react |
|
https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/Bl4cksmith/Frontend_Library | MIT | frontend/src/components/ui/kpi-card.tsx |
Ejemplo
import { KPICard, Sparkline } from '@fn_library'
{/* Básico */}
<KPICard label="Revenue" value="$12,450" delta={{ value: 12.5, isPositive: true }} />
{/* Con unidad separada, delta descriptivo, y mini barras */}
<KPICard
label="Processed Prompts"
value="124"
unit="k"
icon={<ZapIcon className="h-4 w-4" />}
delta={{ value: 15, isPositive: true, label: "Prompts Increased by", suffix: "vs yesterday" }}
chart={<Sparkline data={[5, 8, 3, 9, 6, 12, 7]} variant="bar" colors={['#3b82f6', '#8b5cf6', '#f59e0b', '#10b981', '#ef4444', '#ec4899', '#06b6d4']} height={32} />}
action={<button className="text-muted-foreground hover:text-foreground">...</button>}
/>
{/* Dashboard dark sin bordes */}
<KPICard label="Sessions" value={9821} className="border-0 shadow-none" />
Notas
- El icono ahora se renderiza a la izquierda del label (antes estaba a la derecha).
unitsepara la unidad del valor con font menor para el efecto "124 k" del diseño.delta.labelydelta.suffixpermiten texto descriptivo: "Increased by ▲ +15% vs yesterday".chartes un slot genérico — pasar un<Sparkline variant="bar" colors={[...]} />para mini barras multicolor.actiones un slot top-right para menú contextual.- Usa
cn()para merge de clases.className="border-0 shadow-none"para dashboards dark.