47fac22230
- .claude/CLAUDE.md - .claude/commands/subagentes.md - .claude/rules/INDEX.md - .mcp.json - bash/functions/cybersecurity/analyze_dns.md - bash/functions/cybersecurity/audit_http_headers.md - bash/functions/cybersecurity/audit_ssh_config.md - bash/functions/cybersecurity/check_firewall.md - bash/functions/cybersecurity/detect_suspicious_users.md - bash/functions/cybersecurity/encrypt_file.md - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2.7 KiB
2.7 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
| 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 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| toast | component | ts | ui | 1.0.0 | impure | Toast(props: ToastProps): JSX.Element | Notificaciones temporales con variantes semanticas (success, error, warning, info), iconos automaticos, auto-dismiss y provider con hook useToast. |
|
false |
|
Componente Toast que renderiza notificación temporal con variantes semánticas, auto-dismiss y hook useToast | false | frontend/functions/ui/toast.tsx |
|
|
true | react |
|
Ejemplo
// 1. Envolver la app con el provider
<ToastProvider position="bottom-right">
<App />
</ToastProvider>
// 2. Usar el hook en cualquier componente
function MyComponent() {
const { toast } = useToast()
return (
<Button onClick={() => toast({
variant: "success",
title: "Guardado",
description: "Los cambios se guardaron correctamente.",
})}>
Guardar
</Button>
)
}
// Toast con accion
toast({
variant: "error",
title: "Error al guardar",
description: "Intenta de nuevo.",
action: <Button size="sm" variant="outline">Reintentar</Button>,
duration: 0, // persistente hasta cerrar manualmente
})
// Toast individual sin provider
<Toast variant="info" title="Informacion" description="Texto descriptivo" onClose={() => {}} />
Notas
Migrado a @mantine/notifications. useToast() delega a notifications.show(). ToastProvider es un passthrough (Mantine maneja el estado globalmente via Notifications en mantine_provider). Toast puede usarse como componente inline con Paper. Variantes mapean a colores Mantine: success→teal, error→red, warning→yellow, info→blue.