feat: mejoras componentes UI — card variants, kpi_card slots, sparkline colors, bar_chart horizontal radius
- card: variantes default/borderless/ghost con ring condicional - kpi_card: props unit, action, chart y delta con label/suffix personalizable - sparkline: prop colors para colores por barra en variant bar - bar_chart: radius condicional según orientación horizontal/vertical Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,11 +3,11 @@ name: card
|
||||
kind: component
|
||||
lang: ts
|
||||
domain: ui
|
||||
version: "1.0.0"
|
||||
version: "1.1.0"
|
||||
purity: impure
|
||||
signature: "Card(props: { size?: 'default' | 'sm'; className?: string; children: ReactNode }): JSX.Element"
|
||||
description: "Contenedor card con header, title, description, action, content y footer. Sistema de slots composable."
|
||||
tags: [card, container, layout, component, ui]
|
||||
signature: "Card(props: { size?: 'default' | 'sm'; variant?: 'default' | 'borderless' | 'ghost'; className?: string; children: ReactNode }): JSX.Element"
|
||||
description: "Contenedor card con header, title, description, action, content y footer. Sistema de slots composable. Variantes default, borderless y ghost para dashboards dark."
|
||||
tags: [card, container, layout, component, ui, dashboard, dark]
|
||||
uses_functions: [cn_typescript_core]
|
||||
uses_types: []
|
||||
returns: []
|
||||
@@ -23,6 +23,10 @@ props:
|
||||
type: "'default' | 'sm'"
|
||||
required: false
|
||||
description: "Tamaño del card"
|
||||
- name: variant
|
||||
type: "'default' | 'borderless' | 'ghost'"
|
||||
required: false
|
||||
description: "Variante visual. borderless quita borde/shadow, ghost además hace bg transparente"
|
||||
- name: className
|
||||
type: "string"
|
||||
required: false
|
||||
@@ -30,7 +34,7 @@ props:
|
||||
emits: []
|
||||
has_state: false
|
||||
framework: react
|
||||
variant: [default, sm]
|
||||
variant: [default, sm, borderless, ghost]
|
||||
source_repo: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/Bl4cksmith/Frontend_Library"
|
||||
source_license: "MIT"
|
||||
source_file: "frontend/src/components/ui/card.tsx"
|
||||
@@ -47,8 +51,20 @@ source_file: "frontend/src/components/ui/card.tsx"
|
||||
<CardContent>Contenido</CardContent>
|
||||
<CardFooter>Footer</CardFooter>
|
||||
</Card>
|
||||
|
||||
{/* Dashboard dark — sin bordes */}
|
||||
<Card variant="borderless">
|
||||
<CardContent>Widget sin marco</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Completamente transparente */}
|
||||
<Card variant="ghost">
|
||||
<CardContent>Sin fondo ni borde</CardContent>
|
||||
</Card>
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Sistema de slots via data-slot attributes. Card detecta automáticamente la presencia de CardFooter y ajusta el padding. Exporta 7 subcomponentes composables.
|
||||
|
||||
Las variantes `borderless` y `ghost` eliminan el `ring-1` del borde por defecto. `ghost` además hace el fondo transparente. Alternativa con CSS global: `[data-slot="card"] { --tw-ring-opacity: 0; }` o `[data-variant="borderless"] { ring: 0 }` via `data-variant` attribute expuesto.
|
||||
|
||||
Reference in New Issue
Block a user