Documentation
¶
Index ¶
- func RoundedBorder() lipgloss.Border
- type Provider
- func (p *Provider) ClampToSize(s string, width, height int) string
- func (p *Provider) GetCurrentTheme() domain.Theme
- func (p *Provider) GetHeight(s string) int
- func (p *Provider) GetSpinnerStyle() lipgloss.Style
- func (p *Provider) GetThemeColor(colorName string) string
- func (p *Provider) GetThemeService() domain.ThemeService
- func (p *Provider) GetWidth(s string) int
- func (p *Provider) JoinHorizontal(strs ...string) string
- func (p *Provider) JoinVertical(strs ...string) string
- func (p *Provider) PlaceCenter(width, height int, content string) string
- func (p *Provider) PlaceCenterTop(width, height int, content string) string
- func (p *Provider) PlaceHorizontal(width int, left string, right string) string
- func (p *Provider) RenderApprovalButton(text string, selected bool, isApprove bool) string
- func (p *Provider) RenderAssistantText(text string) string
- func (p *Provider) RenderBold(text string) string
- func (p *Provider) RenderBoldText(text string) string
- func (p *Provider) RenderBordered(content string, width int) string
- func (p *Provider) RenderBorderedBox(text, borderColor string, paddingV, paddingH int) string
- func (p *Provider) RenderButton(text string, selected bool) string
- func (p *Provider) RenderCenteredBoldWithColor(text, hexColor string, width int) string
- func (p *Provider) RenderCenteredBorderedBox(text, borderColor string, width, height, paddingV, paddingH int) string
- func (p *Provider) RenderCodeBlock(code string, width int) string
- func (p *Provider) RenderCreatedText(text string) string
- func (p *Provider) RenderCursor(text string) string
- func (p *Provider) RenderDiffAddition(content string) string
- func (p *Provider) RenderDiffRemoval(content string) string
- func (p *Provider) RenderDimText(text string) string
- func (p *Provider) RenderErrorIcon(text string) string
- func (p *Provider) RenderErrorText(text string) string
- func (p *Provider) RenderHeader(text string, width int) string
- func (p *Provider) RenderInputField(content string, width int, focused bool, branchLabel string) string
- func (p *Provider) RenderInputPlaceholder(text string) string
- func (p *Provider) RenderLeftAlignedBorderedBox(text, borderColor string, width, height, paddingV, paddingH int) string
- func (p *Provider) RenderListItem(content string, selected bool) string
- func (p *Provider) RenderListItemWithDescription(title, description string, selected bool) string
- func (p *Provider) RenderMetricText(text string) string
- func (p *Provider) RenderModal(content string, width int) string
- func (p *Provider) RenderModalTitle(title string) string
- func (p *Provider) RenderPathText(text string) string
- func (p *Provider) RenderSelectedIndicator(text string) string
- func (p *Provider) RenderSeparator(width int, char string) string
- func (p *Provider) RenderSpinner(frame string) string
- func (p *Provider) RenderStatusBadge(text string, positive bool) string
- func (p *Provider) RenderStatusLine(content string) string
- func (p *Provider) RenderStyledText(text string, opts StyleOptions) string
- func (p *Provider) RenderSuccessIcon(text string) string
- func (p *Provider) RenderSuccessText(text string) string
- func (p *Provider) RenderTitledCard(content, title, borderColor, titleColor string, width int) string
- func (p *Provider) RenderTopAlignedBorderedBox(text, borderColor string, width, height, paddingV, paddingH int) string
- func (p *Provider) RenderUpdatedText(text string) string
- func (p *Provider) RenderUserText(text string) string
- func (p *Provider) RenderWarningText(text string) string
- func (p *Provider) RenderWithColor(text, hexColor string) string
- func (p *Provider) RenderWithColorAndBold(text, hexColor string) string
- func (p *Provider) ToolTitleColor(toolName string) string
- type StyleOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RoundedBorder ¶
RoundedBorder returns a rounded border style for lipgloss
Types ¶
type Provider ¶ added in v0.56.0
type Provider struct {
// contains filtered or unexported fields
}
Provider centralizes all styling logic and provides complete abstraction from Lipgloss. Components should NEVER import lipgloss directly - they interact with styling through this provider.
func NewProvider ¶ added in v0.56.0
func NewProvider(themeService domain.ThemeService) *Provider
NewProvider creates a new style provider
func (*Provider) ClampToSize ¶ added in v0.122.1
ClampToSize hard-truncates s to width columns and height rows (ANSI-aware) so a frame containing an over-wide or over-tall line cannot wrap and corrupt the inline (non-alt-screen) render. MaxWidth/MaxHeight truncate rather than pad or wrap.
func (*Provider) GetCurrentTheme ¶ added in v0.118.0
GetCurrentTheme returns the active theme, exposing it for callers that need to derive colors outside of Provider's pre-baked render methods (e.g. the diffview Style selector).
func (*Provider) GetSpinnerStyle ¶ added in v0.56.0
GetSpinnerStyle returns a lipgloss.Style for use with third-party components like Bubbles spinner This is an exception to complete abstraction, needed for library compatibility
func (*Provider) GetThemeColor ¶ added in v0.56.0
GetThemeColor returns a theme color for custom styling (use sparingly)
func (*Provider) GetThemeService ¶ added in v0.61.0
func (p *Provider) GetThemeService() domain.ThemeService
GetThemeService returns the underlying theme service for advanced integrations This is needed for components like the markdown renderer that need direct theme access
func (*Provider) JoinHorizontal ¶ added in v0.56.0
JoinHorizontal joins strings horizontally
func (*Provider) JoinVertical ¶ added in v0.56.0
JoinVertical joins strings vertically
func (*Provider) PlaceCenter ¶ added in v0.56.0
PlaceCenter places content in the center of the given dimensions
func (*Provider) PlaceCenterTop ¶ added in v0.56.0
PlaceCenterTop places content in the center-top of the given dimensions
func (*Provider) PlaceHorizontal ¶ added in v0.56.0
PlaceHorizontal places two components horizontally with the second one on the right
func (*Provider) RenderApprovalButton ¶ added in v0.56.0
RenderApprovalButton renders an approval-style button with custom colors and fixed width
func (*Provider) RenderAssistantText ¶ added in v0.56.0
RenderAssistantText renders text in the assistant color
func (*Provider) RenderBold ¶ added in v0.56.0
RenderBold renders text with bold styling
func (*Provider) RenderBoldText ¶ added in v0.56.0
RenderBoldText renders bold text
func (*Provider) RenderBordered ¶ added in v0.56.0
RenderBordered renders content with a border
func (*Provider) RenderBorderedBox ¶ added in v0.56.0
RenderBorderedBox renders text inside a rounded border with padding
func (*Provider) RenderButton ¶ added in v0.56.0
RenderButton renders a button or selectable option
func (*Provider) RenderCenteredBoldWithColor ¶ added in v0.56.0
RenderCenteredBoldWithColor renders text centered, bold, and with a specific color
func (*Provider) RenderCenteredBorderedBox ¶ added in v0.56.0
func (p *Provider) RenderCenteredBorderedBox(text, borderColor string, width, height, paddingV, paddingH int) string
RenderCenteredBorderedBox renders text in a centered bordered box with specified dimensions
func (*Provider) RenderCodeBlock ¶ added in v0.56.0
RenderCodeBlock renders a code block with subtle background
func (*Provider) RenderCreatedText ¶ added in v0.60.0
RenderCreatedText renders "created" status text (success color, bold)
func (*Provider) RenderCursor ¶ added in v0.56.0
RenderCursor renders text with cursor styling. It uses lipgloss Reverse, which swaps the foreground/background of whatever theme colours are in effect, so the cursor stays legible on every theme instead of relying on a hardcoded grey-on-black pair.
func (*Provider) RenderDiffAddition ¶ added in v0.56.0
RenderDiffAddition renders a diff addition line
func (*Provider) RenderDiffRemoval ¶ added in v0.56.0
RenderDiffRemoval renders a diff removal line
func (*Provider) RenderDimText ¶ added in v0.56.0
RenderDimText renders text in a dimmed style
func (*Provider) RenderErrorIcon ¶ added in v0.60.0
RenderErrorIcon renders an error icon (X mark, etc.)
func (*Provider) RenderErrorText ¶ added in v0.56.0
RenderErrorText renders text in the error color
func (*Provider) RenderHeader ¶ added in v0.56.0
RenderHeader renders a centered header
func (*Provider) RenderInputField ¶ added in v0.56.0
func (p *Provider) RenderInputField(content string, width int, focused bool, branchLabel string) string
RenderInputField renders an input field with border. When branchLabel is non-empty it is embedded in the top border, right-aligned, as a titled border (e.g. "╭──────── ⎇ main ─╮"); pass "" for a plain border.
func (*Provider) RenderInputPlaceholder ¶ added in v0.56.0
RenderInputPlaceholder renders placeholder text
func (*Provider) RenderLeftAlignedBorderedBox ¶ added in v0.56.0
func (p *Provider) RenderLeftAlignedBorderedBox(text, borderColor string, width, height, paddingV, paddingH int) string
RenderLeftAlignedBorderedBox renders text in a left-aligned bordered box with specified dimensions
func (*Provider) RenderListItem ¶ added in v0.56.0
RenderListItem renders a list item (selected or unselected)
func (*Provider) RenderListItemWithDescription ¶ added in v0.56.0
RenderListItemWithDescription renders a list item with a description
func (*Provider) RenderMetricText ¶ added in v0.60.0
RenderMetricText renders metric/info text (e.g., byte counts, line counts)
func (*Provider) RenderModal ¶ added in v0.56.0
RenderModal renders a modal with rounded border
func (*Provider) RenderModalTitle ¶ added in v0.56.0
RenderModalTitle renders a modal title with emphasis
func (*Provider) RenderPathText ¶ added in v0.60.0
RenderPathText renders a file path with accent color and bold
func (*Provider) RenderSelectedIndicator ¶ added in v0.128.0
RenderSelectedIndicator renders the status-bar indicator holding the selection as a padded pill: reverse video paints the cell background in the accent color with the terminal background as text color, which works on any theme (Theme exposes no background color). The one-column side padding adds two columns of width - splitPartsIntoLines accounts for it.
func (*Provider) RenderSeparator ¶ added in v0.56.0
RenderSeparator renders a horizontal separator line
func (*Provider) RenderSpinner ¶ added in v0.56.0
RenderSpinner renders a spinner with status color
func (*Provider) RenderStatusBadge ¶ added in v0.56.0
RenderStatusBadge renders a status badge (e.g., "ENABLED", "DISABLED")
func (*Provider) RenderStatusLine ¶ added in v0.76.5
RenderStatusLine renders a status line with no padding
func (*Provider) RenderStyledText ¶ added in v0.56.0
func (p *Provider) RenderStyledText(text string, opts StyleOptions) string
RenderStyledText renders text with custom Lipgloss-compatible styling This is an escape hatch for complex styling not covered by other methods
func (*Provider) RenderSuccessIcon ¶ added in v0.60.0
RenderSuccessIcon renders a success icon (checkmark, etc.)
func (*Provider) RenderSuccessText ¶ added in v0.56.0
RenderSuccessText renders text in the success color
func (*Provider) RenderTitledCard ¶ added in v0.143.0
func (p *Provider) RenderTitledCard(content, title, borderColor, titleColor string, width int) string
RenderTitledCard renders content in a rounded, width-set, padded box with title spliced into the top border (right-aligned). Reuses the same top-border splice as RenderInputField. Pass "" for title to get a plain bordered box at the given width.
func (*Provider) RenderTopAlignedBorderedBox ¶ added in v0.56.0
func (p *Provider) RenderTopAlignedBorderedBox(text, borderColor string, width, height, paddingV, paddingH int) string
RenderTopAlignedBorderedBox renders text in a top-left aligned bordered box with specified dimensions
func (*Provider) RenderUpdatedText ¶ added in v0.60.0
RenderUpdatedText renders "updated" status text (status/warning color, bold)
func (*Provider) RenderUserText ¶ added in v0.56.0
RenderUserText renders text in the user color
func (*Provider) RenderWarningText ¶ added in v0.56.0
RenderWarningText renders text in the warning/status color
func (*Provider) RenderWithColor ¶ added in v0.56.0
RenderWithColor renders text with a specific hex color
func (*Provider) RenderWithColorAndBold ¶ added in v0.56.0
RenderWithColorAndBold renders text with color and bold
func (*Provider) ToolTitleColor ¶ added in v0.143.0
ToolTitleColor returns the accent hex color used to differentiate a tool type on its card's titled border (AC8, no emoji): shells, file mutations, A2A, and generic each get a distinct theme color.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package tree wraps charm.land/lipgloss/v2/tree so packages outside the styling layer (notably internal/domain formatters) can render rounded-connector trees without importing lipgloss directly — the same leaf-package convention as internal/ui/styles/{colors,icons}.
|
Package tree wraps charm.land/lipgloss/v2/tree so packages outside the styling layer (notably internal/domain formatters) can render rounded-connector trees without importing lipgloss directly — the same leaf-package convention as internal/ui/styles/{colors,icons}. |