Skip to main content

Crate hefesto_widgets

Crate hefesto_widgets 

Source
Expand description

§hefesto-widgets

Crates.io

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

WidgetTipoPropósito
PopupbaseCaja de diálogo configurable (tamaño, borde, posición, fondo)
ChoosePopupStatefulLista seleccionable con filtro inline y selección múltiple
ConfirmationPopupWidgetDiálogo confirmar/cancelar con estilos personalizables
ThemedConfirmationPopupWidgetConfirmación con variante semántica (Success/Warning/Danger/None)
FileBrowserStatefulNavegador de archivos (widget standalone, sin chrome de popup)
FileBrowserPopupStatefulNavegador de archivos con título, bordes y posición
TreePopupStatefulÁrbol expandible dentro de un popup
SpinPopupStatefulSpinner animado + comando + salida + mensaje de finalización
TextInputPopupStatefulCampo de texto centrado dentro de un popup
ScrollListStatefulLista desplazable con scrollbar vertical
TreeStatefulÁrbol expandible/colapsable con indentación
TextInputStatefulEditor de texto de una o varias líneas
SpinStatefulSpinner atómico mínimo
ThemedSpinStatefulSpinner con variantes predefinidas (Dots, Line, Pulse, …)

§Tipos auxiliares

TipoDescripción
AutoSizedTrait para popups con altura automática según su contenido
BorderTypeEstilos de borde (Plain, Rounded, Double, Thick, QuadrantInside, QuadrantOutside, None)
PopupSizeModos de tamaño (Fixed, Percent, Auto, Max)
ConfirmationVariantVariantes semánticas para ThemedConfirmationPopup
SpinVariantVariantes de animación para ThemedSpin
decorate_with_dotsHelper para pintar fondo decorativo de puntos (opt-in, color, symbol, density)
ScrollListState, ChoosePopupState, FileBrowserState, SpinState, TextInputState, TreeStateEstados para widgets stateful

§Breaking changes v0.4.x → v0.5.0

  • HefestoConfirmationPopup renombrado a ThemedConfirmationPopup
  • HefestoSpin renombrado a ThemedSpin
  • fill_bg renombrado a bg_color en todos los widgets
  • input_fill_bg renombrado a input_bg_color en TextInputPopup

Structs§

Badge
Un badge individual con borde, contenido y posición de anclaje.
BadgeStack
Contenedor que acumula múltiples Badges y los renderiza anclados a los bordes del área.
BadgeStackState
Estado mutable del BadgeStack.
ChoosePopup
ChoosePopupState
ConfirmationPopup
DotGridConfig
Configuration for the background dot grid pattern.
FileBrowser
Widget que renderiza una lista de archivos con iconos y estilos.
FileBrowserPopup
FileBrowserState
Popup
A configurable popup widget for ratatui.
ScrollList
Flexible scrollable list backed by Vec<ListItem>.
ScrollListState
Spin
SpinPopup
SpinState
State for the spinner widget.
TextInput
TextInputPopup
Popup que envuelve un TextInput para capturar texto del usuario.
TextInputState
ThemedConfirmationPopup
ThemedSpin
A widget wrapping Spin with pre-built animation variants.
Tree
Tree widget with expandable/collapsible branches.
TreeNode
A node in a tree. Children are recursively nested. id must be unique across the whole tree for expand/collapse tracking.
TreePopup
Popup que envuelve un Tree para mostrar una jerarquía expandible.
TreeState
State for the Tree widget.

Enums§

BadgeAnchor
Dónde se ancla un badge al borde de la pantalla.
BorderType
ConfirmationVariant
DotPattern
Distribution pattern for the background dot grid.
PopupSize
SpinVariant
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§

AutoSized
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_dots but with configurable DotPattern.
default_scrollbar
default_scrollbar_state