Expand description
§hefesto-widgets
Widgets reutilizables para interfaces TUI construidas con ratatui, orientados al ecosistema Hefesto. Proporcionan componentes modulares, stateful y configurables.
§Quickstart
use hefesto_widgets::{Popup, PopupSize};
use ratatui::{style::Color, text::Line};
let _popup = Popup::new(Color::White)
.title("Aviso")
.content(vec![Line::from("Operación completada")])
.width(PopupSize::Fixed(44));§Índice de widgets
| Widget | Tipo | Propósito |
|---|---|---|
Popup | base | Caja de diálogo configurable (tamaño, borde, posición, fondo) |
ChoosePopup | Stateful | Lista seleccionable con filtro inline y selección múltiple |
ConfirmationPopup | Widget | Diálogo confirmar/cancelar con estilos personalizables |
ThemedConfirmationPopup | Widget | Confirmación con variante semántica (Success/Warning/Danger/None) |
FileBrowser | Stateful | Navegador de archivos (widget standalone, sin chrome de popup) |
FileBrowserPopup | Stateful | Navegador de archivos con título, bordes y posición |
TreePopup | Stateful | Árbol expandible dentro de un popup |
SpinPopup | Stateful | Spinner animado + comando + salida + mensaje de finalización |
TextInputPopup | Stateful | Campo de texto centrado dentro de un popup |
ScrollList | Stateful | Lista desplazable con scrollbar vertical |
Tree | Stateful | Árbol expandible/colapsable con indentación |
TextInput | Stateful | Editor de texto de una o varias líneas |
Spin | Stateful | Spinner atómico mínimo |
ThemedSpin | Stateful | Spinner con variantes predefinidas (Dots, Line, Pulse, …) |
§Tipos auxiliares
| Tipo | Descripción |
|---|---|
AutoSized | Trait para popups con altura automática según su contenido |
BorderType | Estilos de borde (Plain, Rounded, Double, Thick, QuadrantInside, QuadrantOutside, None) |
PopupSize | Modos de tamaño (Fixed, Percent, Auto, Max) |
ConfirmationVariant | Variantes semánticas para ThemedConfirmationPopup |
SpinVariant | Variantes de animación para ThemedSpin |
decorate_with_dots | Helper para pintar fondo decorativo de puntos (opt-in, color, symbol, density) |
ScrollListState, ChoosePopupState, FileBrowserState, SpinState, TextInputState, TreeState | Estados para widgets stateful |
§Breaking changes v0.4.x → v0.5.0
HefestoConfirmationPopuprenombrado aThemedConfirmationPopupHefestoSpinrenombrado aThemedSpinfill_bgrenombrado abg_coloren todos los widgetsinput_fill_bgrenombrado ainput_bg_colorenTextInputPopup
Structs§
- Badge
- Un badge individual con borde, contenido y posición de anclaje.
- Badge
Stack - Contenedor que acumula múltiples
Badges y los renderiza anclados a los bordes del área. - Badge
Stack State - Estado mutable del
BadgeStack. - Choose
Popup - Choose
Popup State - Confirmation
Popup - DotGrid
Config - Configuration for the background dot grid pattern.
- File
Browser - Widget que renderiza una lista de archivos con iconos y estilos.
- File
Browser Popup - File
Browser State - Popup
- A configurable popup widget for ratatui.
- Scroll
List - Flexible scrollable list backed by
Vec<ListItem>. - Scroll
List State - Spin
- Spin
Popup - Spin
State - State for the spinner widget.
- Text
Input - Text
Input Popup - Popup que envuelve un
TextInputpara capturar texto del usuario. - Text
Input State - Themed
Confirmation Popup - Themed
Spin - A widget wrapping
Spinwith pre-built animation variants. - Tree
- Tree widget with expandable/collapsible branches.
- Tree
Node - A node in a tree. Children are recursively nested.
idmust be unique across the whole tree for expand/collapse tracking. - Tree
Popup - Popup que envuelve un
Treepara mostrar una jerarquía expandible. - Tree
State - State for the Tree widget.
Enums§
- Badge
Anchor - Dónde se ancla un badge al borde de la pantalla.
- Border
Type - Confirmation
Variant - DotPattern
- Distribution pattern for the background dot grid.
- Popup
Size - Spin
Variant - Pre-built animation frame sets.
Constants§
- BORDER_
GRAY - CHECK
- CROSS
- DEFAULT_
FRAMES - DEFAULT_
HIGHLIGHT - FOOTER_
GRAY - HIGHLIGHT_
SYMBOL - OUTPUT_
GRAY - POPUP_
WIDTH - TEXT_
PADDING
Traits§
- Auto
Sized - Trait for popups whose default height depends on their content and state.
Functions§
- decorate_
with_ dots - Paints a dot pattern on empty cells in the given area.
- decorate_
with_ dots_ with_ pattern - Same as
decorate_with_dotsbut with configurableDotPattern. - default_
scrollbar - default_
scrollbar_ state