From fdcde03382e830ebd22b2525f8ada81cdf315d6a Mon Sep 17 00:00:00 2001 From: Egutierrez Date: Sat, 28 Mar 2026 03:58:08 +0100 Subject: [PATCH] =?UTF-8?q?feat:=2011=20tipos=20TUI=20=E2=80=94=20componen?= =?UTF-8?q?tes=20Bubble=20Tea=20del=20dominio=20tui?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- types/tui/base_model.go | 11 ++++++++ types/tui/base_model.md | 13 ++++++++++ types/tui/confirm_model.go | 11 ++++++++ types/tui/confirm_model.md | 13 ++++++++++ types/tui/filtered_list_model.go | 10 ++++++++ types/tui/filtered_list_model.md | 13 ++++++++++ types/tui/list_item.go | 9 +++++++ types/tui/list_item.md | 13 ++++++++++ types/tui/list_model.go | 15 +++++++++++ types/tui/list_model.md | 13 ++++++++++ types/tui/multi_progress_model.go | 9 +++++++ types/tui/multi_progress_model.md | 13 ++++++++++ types/tui/progress_model.go | 21 +++++++++++++++ types/tui/progress_model.md | 13 ++++++++++ types/tui/spinner_model.go | 16 ++++++++++++ types/tui/spinner_model.md | 13 ++++++++++ types/tui/spinner_with_timeout_model.go | 12 +++++++++ types/tui/spinner_with_timeout_model.md | 13 ++++++++++ types/tui/styles.go | 34 +++++++++++++++++++++++++ types/tui/styles.md | 13 ++++++++++ types/tui/theme.go | 17 +++++++++++++ types/tui/theme.md | 13 ++++++++++ 22 files changed, 308 insertions(+) create mode 100644 types/tui/base_model.go create mode 100644 types/tui/base_model.md create mode 100644 types/tui/confirm_model.go create mode 100644 types/tui/confirm_model.md create mode 100644 types/tui/filtered_list_model.go create mode 100644 types/tui/filtered_list_model.md create mode 100644 types/tui/list_item.go create mode 100644 types/tui/list_item.md create mode 100644 types/tui/list_model.go create mode 100644 types/tui/list_model.md create mode 100644 types/tui/multi_progress_model.go create mode 100644 types/tui/multi_progress_model.md create mode 100644 types/tui/progress_model.go create mode 100644 types/tui/progress_model.md create mode 100644 types/tui/spinner_model.go create mode 100644 types/tui/spinner_model.md create mode 100644 types/tui/spinner_with_timeout_model.go create mode 100644 types/tui/spinner_with_timeout_model.md create mode 100644 types/tui/styles.go create mode 100644 types/tui/styles.md create mode 100644 types/tui/theme.go create mode 100644 types/tui/theme.md diff --git a/types/tui/base_model.go b/types/tui/base_model.go new file mode 100644 index 00000000..c1fd20b3 --- /dev/null +++ b/types/tui/base_model.go @@ -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 +} diff --git a/types/tui/base_model.md b/types/tui/base_model.md new file mode 100644 index 00000000..d6d099d7 --- /dev/null +++ b/types/tui/base_model.md @@ -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" +--- diff --git a/types/tui/confirm_model.go b/types/tui/confirm_model.go new file mode 100644 index 00000000..0af3a3eb --- /dev/null +++ b/types/tui/confirm_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 +} diff --git a/types/tui/confirm_model.md b/types/tui/confirm_model.md new file mode 100644 index 00000000..7678561a --- /dev/null +++ b/types/tui/confirm_model.md @@ -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" +--- diff --git a/types/tui/filtered_list_model.go b/types/tui/filtered_list_model.go new file mode 100644 index 00000000..72cd9679 --- /dev/null +++ b/types/tui/filtered_list_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 +} diff --git a/types/tui/filtered_list_model.md b/types/tui/filtered_list_model.md new file mode 100644 index 00000000..4736eccf --- /dev/null +++ b/types/tui/filtered_list_model.md @@ -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" +--- diff --git a/types/tui/list_item.go b/types/tui/list_item.go new file mode 100644 index 00000000..639b7ab4 --- /dev/null +++ b/types/tui/list_item.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{} +} diff --git a/types/tui/list_item.md b/types/tui/list_item.md new file mode 100644 index 00000000..abba26ff --- /dev/null +++ b/types/tui/list_item.md @@ -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" +--- diff --git a/types/tui/list_model.go b/types/tui/list_model.go new file mode 100644 index 00000000..431608d1 --- /dev/null +++ b/types/tui/list_model.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 +} diff --git a/types/tui/list_model.md b/types/tui/list_model.md new file mode 100644 index 00000000..ee5bee14 --- /dev/null +++ b/types/tui/list_model.md @@ -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" +--- diff --git a/types/tui/multi_progress_model.go b/types/tui/multi_progress_model.go new file mode 100644 index 00000000..739a55d5 --- /dev/null +++ b/types/tui/multi_progress_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 +} diff --git a/types/tui/multi_progress_model.md b/types/tui/multi_progress_model.md new file mode 100644 index 00000000..63eb507b --- /dev/null +++ b/types/tui/multi_progress_model.md @@ -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" +--- diff --git a/types/tui/progress_model.go b/types/tui/progress_model.go new file mode 100644 index 00000000..ed3f31ea --- /dev/null +++ b/types/tui/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 +} diff --git a/types/tui/progress_model.md b/types/tui/progress_model.md new file mode 100644 index 00000000..ab81521d --- /dev/null +++ b/types/tui/progress_model.md @@ -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" +--- diff --git a/types/tui/spinner_model.go b/types/tui/spinner_model.go new file mode 100644 index 00000000..ae791e09 --- /dev/null +++ b/types/tui/spinner_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 +} diff --git a/types/tui/spinner_model.md b/types/tui/spinner_model.md new file mode 100644 index 00000000..90e961ed --- /dev/null +++ b/types/tui/spinner_model.md @@ -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" +--- diff --git a/types/tui/spinner_with_timeout_model.go b/types/tui/spinner_with_timeout_model.go new file mode 100644 index 00000000..6769c71f --- /dev/null +++ b/types/tui/spinner_with_timeout_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 +} diff --git a/types/tui/spinner_with_timeout_model.md b/types/tui/spinner_with_timeout_model.md new file mode 100644 index 00000000..cc796d10 --- /dev/null +++ b/types/tui/spinner_with_timeout_model.md @@ -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" +--- diff --git a/types/tui/styles.go b/types/tui/styles.go new file mode 100644 index 00000000..e86b0a4b --- /dev/null +++ b/types/tui/styles.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 +} diff --git a/types/tui/styles.md b/types/tui/styles.md new file mode 100644 index 00000000..496aa8e2 --- /dev/null +++ b/types/tui/styles.md @@ -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" +--- diff --git a/types/tui/theme.go b/types/tui/theme.go new file mode 100644 index 00000000..0c0108ae --- /dev/null +++ b/types/tui/theme.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 +} diff --git a/types/tui/theme.md b/types/tui/theme.md new file mode 100644 index 00000000..def9e801 --- /dev/null +++ b/types/tui/theme.md @@ -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" +---