package ui import "charm.land/bubbles/v2/textinput" // textInput is a local alias purely to keep the many field declarations in // model.go from repeating the full package-qualified name. type textInput = textinput.Model // newTextInput is a method (not a free function) so every input picks up // the current theme's colors via styles.TextInputStyles — otherwise inputs // would render in bubbles' hard-coded default palette regardless of the // user's theme/appearance settings. func (m *Model) newTextInput(f fieldSpec) textInput { ti := textinput.New() ti.Placeholder = f.label ti.SetStyles(m.styles.TextInputStyles()) if f.secret { ti.EchoMode = textinput.EchoPassword ti.EchoCharacter = '•' } ti.SetValue(f.value) return ti } func (m *Model) textInputWithValue(label, val string) textInput { return m.newTextInput(fieldSpec{label: label, value: val}) } // fieldSpec is the minimal shape newTextInput needs; kept separate from // auth.Field so this file has no dependency on the auth package. type fieldSpec struct { label string secret bool value string }