5f4f1f7508
Añade campos params y output al frontmatter YAML de las 506 funciones del registry. Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico) y cada función describe qué produce su output. Permite a agentes razonar sobre cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
51 lines
1.5 KiB
Markdown
51 lines
1.5 KiB
Markdown
---
|
|
name: alert
|
|
kind: component
|
|
lang: ts
|
|
domain: ui
|
|
version: "1.0.0"
|
|
purity: impure
|
|
signature: "Alert(props: { variant?: 'default' | 'destructive' }): JSX.Element"
|
|
description: "Alerta accesible con variantes default y destructive. Sistema de slots para título, descripción, icono y acción."
|
|
tags: [alert, feedback, component, ui, notification]
|
|
uses_functions: [cn_ts_core]
|
|
uses_types: []
|
|
returns: []
|
|
returns_optional: false
|
|
error_type: ""
|
|
imports: [react, class-variance-authority]
|
|
output: "Componente Alert que renderiza una alerta accesible con slots para título, descripción, icono y acción"
|
|
tested: false
|
|
tests: []
|
|
test_file_path: ""
|
|
file_path: "frontend/functions/ui/alert.tsx"
|
|
props:
|
|
- name: variant
|
|
type: "'default' | 'destructive'"
|
|
required: false
|
|
description: "Variante visual"
|
|
emits: []
|
|
has_state: false
|
|
framework: react
|
|
variant: [default, destructive]
|
|
source_repo: "https://gitea-dgg044oo04woo4ggcsws4gk0.organic-machine.com/Bl4cksmith/Frontend_Library"
|
|
source_license: "MIT"
|
|
source_file: "frontend/src/components/ui/alert.tsx"
|
|
---
|
|
|
|
## Ejemplo
|
|
|
|
```tsx
|
|
<Alert variant="destructive">
|
|
<AlertCircle />
|
|
<AlertTitle>Error</AlertTitle>
|
|
<AlertDescription>Something went wrong.</AlertDescription>
|
|
</Alert>
|
|
```
|
|
|
|
## Notas
|
|
|
|
Exporta 4 subcomponentes composables via data-slot: Alert, AlertTitle, AlertDescription, AlertAction.
|
|
El icono SVG se posiciona automáticamente en grid cuando es hijo directo de Alert.
|
|
AlertAction se posiciona absolute top-right para acciones secundarias (ej: botón cerrar).
|