feat: 11 tipos TUI — componentes Bubble Tea del dominio tui
Tipos producto para ListItem, ListModel, FilteredListModel, SpinnerModel, SpinnerWithTimeoutModel, ProgressModel, MultiProgressModel, Theme, Styles, BaseModel y ConfirmModel. Stubs que documentan las definiciones de devfactory/tui para el registry.
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
// BaseModel provee funcionalidad comun a todas las vistas TUI:
|
||||||
|
// dimensiones de terminal, estilos y manejo de errores.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type BaseModel struct {
|
||||||
|
Width int
|
||||||
|
Height int
|
||||||
|
Styles Styles
|
||||||
|
Err error
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: base_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type BaseModel struct { Width int; Height int; Styles Styles; Err error }
|
||||||
|
description: "Modelo base que provee dimensiones de terminal, estilos y manejo de errores comunes a todas las vistas TUI."
|
||||||
|
tags: [tui, base, model, component]
|
||||||
|
uses_types: [styles_go_tui]
|
||||||
|
file_path: "types/tui/base_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
// ConfirmModel es un dialogo de confirmacion Si/No interactivo.
|
||||||
|
// Implementa tea.Model del framework Bubble Tea.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type ConfirmModel struct {
|
||||||
|
BaseModel
|
||||||
|
prompt string
|
||||||
|
selected bool
|
||||||
|
done bool
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: confirm_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type ConfirmModel struct { BaseModel; prompt string; selected bool; done bool }
|
||||||
|
description: "Dialogo de confirmacion Si/No interactivo. Embeds BaseModel. Implementa tea.Model."
|
||||||
|
tags: [tui, confirm, dialog, component, interactive]
|
||||||
|
uses_types: [base_model_go_tui]
|
||||||
|
file_path: "types/tui/confirm_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
// FilteredListModel extiende ListModel con filtrado por texto en tiempo real.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type FilteredListModel struct {
|
||||||
|
ListModel
|
||||||
|
query string
|
||||||
|
allItems []ListItem
|
||||||
|
placeholder string
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: filtered_list_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type FilteredListModel struct { ListModel; query string; allItems []ListItem; placeholder string }
|
||||||
|
description: "Lista con filtrado por texto en tiempo real. Embeds ListModel y añade busqueda interactiva."
|
||||||
|
tags: [tui, list, filter, component, interactive]
|
||||||
|
uses_types: [list_model_go_tui, list_item_go_tui]
|
||||||
|
file_path: "types/tui/filtered_list_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
// ListItem representa un item individual en una lista TUI.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type ListItem struct {
|
||||||
|
Title string
|
||||||
|
Description string
|
||||||
|
Value interface{}
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: list_item
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type ListItem struct { Title string; Description string; Value interface{} }
|
||||||
|
description: "Item individual de una lista TUI con titulo, descripcion y valor arbitrario."
|
||||||
|
tags: [tui, list, component]
|
||||||
|
uses_types: []
|
||||||
|
file_path: "types/tui/list_item.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
// ListModel es un componente lista seleccionable con cursor, scroll y seleccion.
|
||||||
|
// Implementa tea.Model del framework Bubble Tea.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type ListModel struct {
|
||||||
|
items []ListItem
|
||||||
|
cursor int
|
||||||
|
selected map[int]struct{}
|
||||||
|
multi bool
|
||||||
|
styles Styles
|
||||||
|
height int
|
||||||
|
width int
|
||||||
|
offset int
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: list_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type ListModel struct { items []ListItem; cursor int; selected map[int]struct{}; multi bool; styles Styles; height int; width int; offset int }
|
||||||
|
description: "Componente lista seleccionable con cursor, scroll y seleccion simple o multiple. Implementa tea.Model."
|
||||||
|
tags: [tui, list, component, interactive]
|
||||||
|
uses_types: [list_item_go_tui, styles_go_tui]
|
||||||
|
file_path: "types/tui/list_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
// MultiProgressModel gestiona multiples barras de progreso simultaneas.
|
||||||
|
// Implementa tea.Model del framework Bubble Tea.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type MultiProgressModel struct {
|
||||||
|
bars []ProgressModel
|
||||||
|
styles Styles
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: multi_progress_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type MultiProgressModel struct { bars []ProgressModel; styles Styles }
|
||||||
|
description: "Gestor de multiples barras de progreso simultaneas. Implementa tea.Model."
|
||||||
|
tags: [tui, progress, multi, component]
|
||||||
|
uses_types: [progress_model_go_tui, styles_go_tui]
|
||||||
|
file_path: "types/tui/multi_progress_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"github.com/charmbracelet/bubbles/progress"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProgressModel es una barra de progreso con porcentaje, ETA y tiempo transcurrido.
|
||||||
|
// Implementa tea.Model del framework Bubble Tea.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type ProgressModel struct {
|
||||||
|
progress progress.Model
|
||||||
|
current float64
|
||||||
|
total float64
|
||||||
|
label string
|
||||||
|
styles Styles
|
||||||
|
showPct bool
|
||||||
|
showETA bool
|
||||||
|
started time.Time
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: progress_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type ProgressModel struct { progress progress.Model; current float64; total float64; label string; styles Styles; showPct bool; showETA bool; started time.Time }
|
||||||
|
description: "Barra de progreso con porcentaje, ETA y tiempo transcurrido. Implementa tea.Model."
|
||||||
|
tags: [tui, progress, component, interactive]
|
||||||
|
uses_types: [styles_go_tui]
|
||||||
|
file_path: "types/tui/progress_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/charmbracelet/bubbles/spinner"
|
||||||
|
"github.com/charmbracelet/lipgloss"
|
||||||
|
)
|
||||||
|
|
||||||
|
// SpinnerModel es un indicador de carga animado con mensaje personalizable.
|
||||||
|
// Implementa tea.Model del framework Bubble Tea.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type SpinnerModel struct {
|
||||||
|
spinner spinner.Model
|
||||||
|
message string
|
||||||
|
style lipgloss.Style
|
||||||
|
active bool
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: spinner_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type SpinnerModel struct { spinner spinner.Model; message string; style lipgloss.Style; active bool }
|
||||||
|
description: "Indicador de carga animado con mensaje personalizable. Implementa tea.Model."
|
||||||
|
tags: [tui, spinner, loading, component]
|
||||||
|
uses_types: []
|
||||||
|
file_path: "types/tui/spinner_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
import "time"
|
||||||
|
|
||||||
|
// SpinnerWithTimeoutModel es un spinner que se auto-detiene tras un timeout.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type SpinnerWithTimeoutModel struct {
|
||||||
|
SpinnerModel
|
||||||
|
timeout time.Duration
|
||||||
|
started time.Time
|
||||||
|
finished bool
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: spinner_with_timeout_model
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type SpinnerWithTimeoutModel struct { SpinnerModel; timeout time.Duration; started time.Time; finished bool }
|
||||||
|
description: "Spinner que se auto-detiene tras un timeout configurable. Embeds SpinnerModel."
|
||||||
|
tags: [tui, spinner, timeout, component]
|
||||||
|
uses_types: [spinner_model_go_tui]
|
||||||
|
file_path: "types/tui/spinner_with_timeout_model.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
import "github.com/charmbracelet/lipgloss"
|
||||||
|
|
||||||
|
// Styles contiene todos los estilos lipgloss pre-configurados para una aplicacion TUI.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type Styles struct {
|
||||||
|
Theme Theme
|
||||||
|
Title lipgloss.Style
|
||||||
|
Subtitle lipgloss.Style
|
||||||
|
Header lipgloss.Style
|
||||||
|
Label lipgloss.Style
|
||||||
|
Text lipgloss.Style
|
||||||
|
Muted lipgloss.Style
|
||||||
|
Code lipgloss.Style
|
||||||
|
Success lipgloss.Style
|
||||||
|
Error lipgloss.Style
|
||||||
|
Warning lipgloss.Style
|
||||||
|
Info lipgloss.Style
|
||||||
|
Border lipgloss.Style
|
||||||
|
Box lipgloss.Style
|
||||||
|
List lipgloss.Style
|
||||||
|
ListItem lipgloss.Style
|
||||||
|
Selected lipgloss.Style
|
||||||
|
Unselected lipgloss.Style
|
||||||
|
Button lipgloss.Style
|
||||||
|
ButtonActive lipgloss.Style
|
||||||
|
Input lipgloss.Style
|
||||||
|
Cursor lipgloss.Style
|
||||||
|
Container lipgloss.Style
|
||||||
|
Section lipgloss.Style
|
||||||
|
Divider lipgloss.Style
|
||||||
|
StatusBar lipgloss.Style
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: styles
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type Styles struct { Theme Theme; Title lipgloss.Style; Subtitle lipgloss.Style; Header lipgloss.Style; Label lipgloss.Style; Text lipgloss.Style; Muted lipgloss.Style; Code lipgloss.Style; Success lipgloss.Style; Error lipgloss.Style; Warning lipgloss.Style; Info lipgloss.Style; Border lipgloss.Style; Box lipgloss.Style; List lipgloss.Style; ListItem lipgloss.Style; Selected lipgloss.Style; Unselected lipgloss.Style; Button lipgloss.Style; ButtonActive lipgloss.Style; Input lipgloss.Style; Cursor lipgloss.Style; Container lipgloss.Style; Section lipgloss.Style; Divider lipgloss.Style; StatusBar lipgloss.Style }
|
||||||
|
description: "Coleccion completa de estilos lipgloss pre-configurados para tipografia, estados, componentes y layout."
|
||||||
|
tags: [tui, styles, lipgloss, theme]
|
||||||
|
uses_types: [theme_go_tui]
|
||||||
|
file_path: "types/tui/styles.go"
|
||||||
|
---
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
package tui
|
||||||
|
|
||||||
|
import "github.com/charmbracelet/lipgloss"
|
||||||
|
|
||||||
|
// Theme define una paleta de 9 colores semanticos para terminal.
|
||||||
|
// Implementation: github.com/lucasdataproyects/devfactory/tui
|
||||||
|
type Theme struct {
|
||||||
|
Primary lipgloss.Color
|
||||||
|
Secondary lipgloss.Color
|
||||||
|
Success lipgloss.Color
|
||||||
|
Error lipgloss.Color
|
||||||
|
Warning lipgloss.Color
|
||||||
|
Info lipgloss.Color
|
||||||
|
Muted lipgloss.Color
|
||||||
|
Text lipgloss.Color
|
||||||
|
Border lipgloss.Color
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
name: theme
|
||||||
|
lang: go
|
||||||
|
domain: tui
|
||||||
|
version: "1.0.0"
|
||||||
|
algebraic: product
|
||||||
|
definition: |
|
||||||
|
type Theme struct { Primary lipgloss.Color; Secondary lipgloss.Color; Success lipgloss.Color; Error lipgloss.Color; Warning lipgloss.Color; Info lipgloss.Color; Muted lipgloss.Color; Text lipgloss.Color; Border lipgloss.Color }
|
||||||
|
description: "Paleta de colores para terminal con 9 colores semanticos. Base del sistema de estilos."
|
||||||
|
tags: [tui, theme, styles, colors]
|
||||||
|
uses_types: []
|
||||||
|
file_path: "types/tui/theme.go"
|
||||||
|
---
|
||||||
Reference in New Issue
Block a user