ui

package
v0.0.0-...-9137ed6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Styles
	TitleStyle = lipgloss.NewStyle().
				Bold(true).
				Foreground(primaryColor).
				MarginTop(1).
				MarginBottom(1)

	SubtitleStyle = lipgloss.NewStyle().
					Foreground(subtleColor).
					MarginBottom(1)

	PromptStyle = lipgloss.NewStyle().
				Foreground(primaryColor).
				Bold(true)

	InputStyle = lipgloss.NewStyle().
				Foreground(lipgloss.Color("15"))

	SuccessStyle = lipgloss.NewStyle().
					Foreground(successColor).
					Bold(true)

	ErrorStyle = lipgloss.NewStyle().
				Foreground(errorColor).
				Bold(true)

	HintStyle = lipgloss.NewStyle().
				Foreground(subtleColor).
				Italic(true)

	HelpStyle = lipgloss.NewStyle().
				Foreground(subtleColor).
				MarginTop(1)

	HighlightStyle = lipgloss.NewStyle().
					Foreground(highlightColor).
					Bold(true)

	FieldLabelStyle = lipgloss.NewStyle().
					Foreground(primaryColor)

	FieldValueStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("15"))

	ListItemStyle = lipgloss.NewStyle().
					PaddingLeft(2)

	SelectedItemStyle = lipgloss.NewStyle().
						Foreground(highlightColor).
						Bold(true).
						PaddingLeft(1)

	BoxStyle = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(primaryColor).
				Padding(1, 2)

	ConfirmBoxStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(successColor).
					Padding(1, 2)

	// Validation styles
	WarningStyle = lipgloss.NewStyle().
					Foreground(warningColor).
					Bold(true)

	ValidationOkStyle = lipgloss.NewStyle().
						Foreground(successColor)

	// Help overlay styles
	HelpTitleStyle = lipgloss.NewStyle().
					Foreground(primaryColor).
					Bold(true).
					Underline(true).
					Align(lipgloss.Center)

	HelpSectionStyle = lipgloss.NewStyle().
						Foreground(highlightColor).
						Bold(true).
						MarginTop(1)

	HelpKeyStyle = lipgloss.NewStyle().
					Foreground(primaryColor).
					Bold(true).
					Width(16)

	HelpDescStyle = lipgloss.NewStyle().
					Foreground(lipgloss.Color("252"))

	OverlayStyle = lipgloss.NewStyle().
					Border(lipgloss.RoundedBorder()).
					BorderForeground(primaryColor).
					BorderBackground(lipgloss.Color("235")).
					Background(lipgloss.Color("235")).
					Padding(2, 3).
					Align(lipgloss.Center)
)

Functions

func GenResourceInteractive

func GenResourceInteractive() error

func GenViewInteractive

func GenViewInteractive() error

func InferType

func InferType(fieldName string) string

InferType suggests a type based on the field name Uses common naming patterns to intelligently guess the most appropriate type

func IsValidGoIdentifier

func IsValidGoIdentifier(name string) (bool, string)

IsValidGoIdentifier validates if a string is a valid Go identifier

func NewAppInteractive

func NewAppInteractive() error

func ParseFieldInput

func ParseFieldInput(input string) (name, typ string)

ParseFieldInput parses user input which can be either: "fieldname" -> uses inferred type "fieldname:type" -> uses specified type

func RenderHelp

func RenderHelp(sections []HelpSection, width int) string

RenderHelp renders a help overlay with the given sections

func RenderHelpOverlay

func RenderHelpOverlay(background string, helpSections []HelpSection, termWidth, termHeight int) string

RenderHelpOverlay renders the help overlay on top of the current screen

Types

type HelpItem

type HelpItem struct {
	Key         string
	Description string
}

HelpItem represents a single help entry

type HelpSection

type HelpSection struct {
	Title string
	Items []HelpItem
}

HelpSection represents a group of help items

func GetGenResourceHelp

func GetGenResourceHelp() []HelpSection

GetGenResourceHelp returns help content for the resource generator wizard

func GetGenViewHelp

func GetGenViewHelp() []HelpSection

GetGenViewHelp returns help content for the view generator wizard

func GetNewAppHelp

func GetNewAppHelp() []HelpSection

GetNewAppHelp returns help content for the new app wizard

type ValidationResult

type ValidationResult struct {
	Valid   bool
	Error   string
	Warning string
}

ValidationResult represents the result of input validation

func IsValidAppName

func IsValidAppName(name string) ValidationResult

IsValidAppName validates app name

func IsValidFieldName

func IsValidFieldName(name string) ValidationResult

IsValidFieldName validates field name (lowercase, snake_case allowed)

func IsValidModulePath

func IsValidModulePath(path string) ValidationResult

IsValidModulePath validates Go module path

func IsValidResourceName

func IsValidResourceName(name string) ValidationResult

IsValidResourceName validates resource name (should be plural, lowercase)

func IsValidViewName

func IsValidViewName(name string) ValidationResult

IsValidViewName validates view name

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL