ui

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BorderStyle           = lipgloss.RoundedBorder()
	FocusColor            = lipgloss.Color("205")
	FocusForegroundColor  = lipgloss.Color("235")
	AccentColor           = lipgloss.Color("121")
	AccentForegroundColor = lipgloss.Color("239")
	BlurColor             = lipgloss.Color("243")

	ListWidth              = 35
	ListPreviewWidthMargin = ListWidth + 5
	ListContainer          = lipgloss.NewStyle().Width(ListWidth)

	FocusInputContainer = lipgloss.NewStyle().
						Border(BorderStyle).
						BorderForeground(FocusColor).Padding(0, 1)
	BlurInputContainer = lipgloss.NewStyle().
						Border(BorderStyle).
						BorderForeground(BlurColor).Padding(0, 1)
	FocusTextarea = lipgloss.NewStyle().
					Border(BorderStyle).
					BorderForeground(FocusColor)
	BlurTextarea = lipgloss.NewStyle().
					Border(BorderStyle).
					BorderForeground(BlurColor)
	FocusTextareaLineNumber = lipgloss.NewStyle().Foreground(BlurColor)
	BlurTextareaLineNumber  = lipgloss.NewStyle().Foreground(BlurColor)

	UrlPromptStyle = lipgloss.NewStyle().Foreground(FocusColor)

	PreviewHeaderStyle = lipgloss.NewStyle().
						Background(FocusColor).
						Padding(0, 1).
						MarginLeft(1)
	PreviewBodyStyle = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(FocusColor).
						Padding(0, 1)

	ListItemStyle      = lipgloss.NewStyle()
	FocusListItemStyle = ListItemStyle.Background(AccentColor).Foreground(AccentForegroundColor)
)

Functions

func BodyTextarea

func BodyTextarea() textarea.Model

func CommandList

func CommandList(items []list.Item) list.Model

func CreateList added in v0.0.3

func CreateList() list.Model

func EnvList

func EnvList() list.Model

func HeaderTextarea

func HeaderTextarea() textarea.Model

func Help

func Help() help.Model

func PipeInput

func PipeInput() textinput.Model

func PipedResponseTextarea

func PipedResponseTextarea() textarea.Model

func RenderWithHeader added in v0.0.3

func RenderWithHeader(base string, header string) string

func ResponseTextarea

func ResponseTextarea() textarea.Model

func SaveInput

func SaveInput() textinput.Model

func SelectMethod

func SelectMethod(items []list.Item) list.Model

func SessionList

func SessionList() list.Model

func Spinner

func Spinner() spinner.Model

func UrlInput

func UrlInput(method string, initValue string) textinput.Model

Types

type CompositeLayerPosition added in v0.0.3

type CompositeLayerPosition int
const (
	CompositeLayerTop CompositeLayerPosition = iota
	CompositeLayerBottom
	CompositeLayerLeft
	CompositeLayerRight
	CompositeLayerCenter
)

type CompositeView added in v0.0.3

type CompositeView struct {
	// contains filtered or unexported fields
}

func NewCompositeView added in v0.0.3

func NewCompositeView(base string) *CompositeView

func (*CompositeView) AddLayer added in v0.0.3

func (c *CompositeView) AddLayer(layer *CompositeViewLayer)

func (*CompositeView) RemoveLayer added in v0.0.3

func (c *CompositeView) RemoveLayer(id string)

func (*CompositeView) Render added in v0.0.3

func (c *CompositeView) Render() string

func (*CompositeView) SetBase added in v0.0.3

func (c *CompositeView) SetBase(base string)

type CompositeViewLayer added in v0.0.3

type CompositeViewLayer struct {
	Id        string
	View      string
	PositionX CompositeLayerPosition
	PositionY CompositeLayerPosition
	OffsetX   int
	OffsetY   int
}

func NewCompositeViewLayer added in v0.0.3

func NewCompositeViewLayer() *CompositeViewLayer

func (*CompositeViewLayer) SetId added in v0.0.3

func (*CompositeViewLayer) SetOffset added in v0.0.3

func (c *CompositeViewLayer) SetOffset(offsetX int, offsetY int) *CompositeViewLayer

func (*CompositeViewLayer) SetPositionX added in v0.0.3

func (c *CompositeViewLayer) SetPositionX(positionX CompositeLayerPosition) *CompositeViewLayer

func (*CompositeViewLayer) SetPositionY added in v0.0.3

func (c *CompositeViewLayer) SetPositionY(positionY CompositeLayerPosition) *CompositeViewLayer

func (*CompositeViewLayer) SetView added in v0.0.3

func (c *CompositeViewLayer) SetView(view string) *CompositeViewLayer

type ListDelegate added in v0.0.3

type ListDelegate struct {
	// contains filtered or unexported fields
}

func NewListDelegate added in v0.0.3

func NewListDelegate() ListDelegate

func (ListDelegate) Height added in v0.0.3

func (d ListDelegate) Height() int

func (ListDelegate) Render added in v0.0.3

func (d ListDelegate) Render(w io.Writer, m list.Model, index int, listItem list.Item)

func (ListDelegate) SetFocusTile added in v0.0.3

func (d ListDelegate) SetFocusTile(focusTile lipgloss.Style) ListDelegate

func (ListDelegate) SetHeight added in v0.0.3

func (d ListDelegate) SetHeight(height int) ListDelegate

func (ListDelegate) SetOnUpdate added in v0.0.3

func (d ListDelegate) SetOnUpdate(onUpdate func(msg tea.Msg, m *list.Model) tea.Cmd) ListDelegate

func (ListDelegate) SetSpacing added in v0.0.3

func (d ListDelegate) SetSpacing(spacing int) ListDelegate

func (ListDelegate) SetTile added in v0.0.3

func (d ListDelegate) SetTile(tile lipgloss.Style) ListDelegate

func (ListDelegate) Spacing added in v0.0.3

func (d ListDelegate) Spacing() int

func (ListDelegate) Update added in v0.0.3

func (d ListDelegate) Update(msg tea.Msg, m *list.Model) tea.Cmd

type ListItem added in v0.0.3

type ListItem struct {
	// contains filtered or unexported fields
}

func NewListItem added in v0.0.3

func NewListItem(title, desc string, value any) ListItem

func (ListItem) Description added in v0.0.3

func (l ListItem) Description() string

func (ListItem) FilterValue added in v0.0.3

func (l ListItem) FilterValue() string

func (ListItem) Title added in v0.0.3

func (l ListItem) Title() string

func (ListItem) Value added in v0.0.3

func (l ListItem) Value() any

type Preview

type Preview struct {
	Header    string
	Width     int
	MaxHeight int
	Body      string
}

func (*Preview) Render

func (p *Preview) Render() string

Jump to

Keyboard shortcuts

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