feat: nuevos componentes UI — accordion, avatar, breadcrumb, checkbox, command, dropdown, pagination, popover, radio, sheet, select, switch, textarea, toast
Componentes React accesibles basados en Radix UI con soporte de temas via CSS variables. Incluye barrel export en index.ts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
---
|
||||
name: checkbox
|
||||
kind: component
|
||||
lang: ts
|
||||
domain: ui
|
||||
version: "1.0.0"
|
||||
purity: impure
|
||||
signature: "Checkbox(props: CheckboxProps): JSX.Element"
|
||||
description: "Input booleano accesible con label opcional y variante indeterminate. Base-UI Checkbox primitive."
|
||||
tags: [checkbox, component, ui, interactive, form, base-ui]
|
||||
uses_functions: [cn_ts_core]
|
||||
uses_types: []
|
||||
returns: []
|
||||
returns_optional: false
|
||||
error_type: ""
|
||||
imports: ["@base-ui/react/checkbox", "class-variance-authority"]
|
||||
tested: false
|
||||
tests: []
|
||||
test_file_path: ""
|
||||
file_path: "frontend/functions/ui/checkbox.tsx"
|
||||
props:
|
||||
- name: label
|
||||
type: "string"
|
||||
required: false
|
||||
description: "Texto de etiqueta visible junto al checkbox"
|
||||
- name: indeterminate
|
||||
type: "boolean"
|
||||
required: false
|
||||
description: "Estado indeterminate (guion) en vez de checked/unchecked"
|
||||
- name: checked
|
||||
type: "boolean"
|
||||
required: false
|
||||
description: "Estado controlado del checkbox"
|
||||
- name: defaultChecked
|
||||
type: "boolean"
|
||||
required: false
|
||||
description: "Estado inicial no controlado"
|
||||
- name: disabled
|
||||
type: "boolean"
|
||||
required: false
|
||||
description: "Deshabilita el checkbox"
|
||||
- name: onCheckedChange
|
||||
type: "(checked: boolean) => void"
|
||||
required: false
|
||||
description: "Callback cuando cambia el estado"
|
||||
emits: [onCheckedChange]
|
||||
has_state: false
|
||||
framework: react
|
||||
variant: []
|
||||
---
|
||||
|
||||
## Ejemplo
|
||||
|
||||
```tsx
|
||||
// Basico
|
||||
<Checkbox label="Acepto los terminos" />
|
||||
|
||||
// Controlado
|
||||
<Checkbox
|
||||
label="Seleccionar todos"
|
||||
checked={allSelected}
|
||||
indeterminate={someSelected}
|
||||
onCheckedChange={setAllSelected}
|
||||
/>
|
||||
|
||||
// Sin label
|
||||
<Checkbox checked={isActive} onCheckedChange={setIsActive} />
|
||||
```
|
||||
|
||||
## Notas
|
||||
|
||||
Usa Base-UI Checkbox primitive para accesibilidad completa (keyboard, ARIA). El estado indeterminate se muestra con un guion horizontal. El id se genera automaticamente con useId si no se provee.
|
||||
Reference in New Issue
Block a user