@@ -222,7 +222,7 @@ func (m *OAuth) headerContent() string {
textStyle = t.Dialog.PrimaryText
dialogStyle = t.Dialog.View.Width(m.width)
headerOffset = titleStyle.GetHorizontalFrameSize() + dialogStyle.GetHorizontalFrameSize()
- dialogTitle = fmt.Sprintf("Authenticate with %s", m.oAuthProvider.name())
+ dialogTitle = fmt.Sprintf("Letβs authenticate with %s", m.oAuthProvider.name())
)
if m.isOnboarding {
return textStyle.Render(dialogTitle)
@@ -232,13 +232,13 @@ func (m *OAuth) headerContent() string {
func (m *OAuth) innerDialogContent() string {
var (
- t = m.com.Styles
- whiteStyle = t.Dialog.OAuth.Instructions
- primaryStyle = t.Dialog.OAuth.Enter
- greenStyle = t.Dialog.OAuth.Success
- linkStyle = t.Dialog.OAuth.Link
- errorStyle = t.Dialog.OAuth.ErrorText
- mutedStyle = t.Dialog.OAuth.StatusText
+ t = m.com.Styles
+ instructionStyle = t.Dialog.OAuth.Instructions
+ enterKeyStyle = t.Dialog.OAuth.Enter
+ successStyle = t.Dialog.OAuth.Success
+ linkStyle = t.Dialog.OAuth.Link
+ errorStyle = t.Dialog.OAuth.ErrorText
+ statusTextStyle = t.Dialog.OAuth.StatusText
)
switch m.State {
@@ -248,8 +248,8 @@ func (m *OAuth) innerDialogContent() string {
Width(m.width - 2).
Align(lipgloss.Center).
Render(
- greenStyle.Render(m.spinner.View()) +
- mutedStyle.Render("Initializing..."),
+ successStyle.Render(m.spinner.View()) +
+ statusTextStyle.Render("Initializing..."),
)
case OAuthStateDisplay:
@@ -257,9 +257,9 @@ func (m *OAuth) innerDialogContent() string {
Margin(0, 1).
Width(m.width - 2).
Render(
- whiteStyle.Render("Press ") +
- primaryStyle.Render("enter") +
- whiteStyle.Render(" to copy the code below and open the browser."),
+ instructionStyle.Render("Press ") +
+ enterKeyStyle.Render("enter") +
+ instructionStyle.Render(" to copy the code below and open the browser."),
)
codeBox := lipgloss.NewStyle().
@@ -273,16 +273,16 @@ func (m *OAuth) innerDialogContent() string {
)
link := linkStyle.Hyperlink(m.verificationURL, "id=oauth-verify").Render(m.verificationURL)
- url := mutedStyle.
+ url := statusTextStyle.
Margin(0, 1).
Width(m.width - 2).
- Render("Browser not opening? Refer to\n" + link)
+ Render("Browser not opening? Pay a visit to:\n" + link)
waiting := lipgloss.NewStyle().
Margin(0, 1).
Width(m.width - 2).
Render(
- greenStyle.Render(m.spinner.View()) + mutedStyle.Render("Verifying..."),
+ successStyle.Render(m.spinner.View()) + statusTextStyle.Render("Verifying..."),
)
return lipgloss.JoinVertical(
@@ -299,7 +299,7 @@ func (m *OAuth) innerDialogContent() string {
)
case OAuthStateSuccess:
- return greenStyle.
+ return successStyle.
Margin(1).
Width(m.width - 2).
Render("Authentication successful!")
@@ -14,13 +14,14 @@ import (
"github.com/charmbracelet/x/exp/charmtone"
)
-// quickStyleOpts is the palette of colors used by quickStyle to build a
-// complete Styles value. Each field maps to a semantic role in the UI.
+// quickStyleOpts is the palette of colors used by quickStyle to simplify the
+// process of building a theme.
type quickStyleOpts struct {
// Brand.
primary color.Color
secondary color.Color
accent color.Color
+ keyword color.Color
// Default foreground and background colors.
fgBase color.Color
@@ -55,12 +56,11 @@ type quickStyleOpts struct {
successMostSubtle color.Color
}
-// quickStyle builds a complete Styles value from a palette of semantic
-// colors. Themes should populate quickStyleOpts and call this rather than
-// re-implementing every style rule.
+// quickStyle builds the default Styles (that is, the default theme, Charmtone
+// Pantera) from a palette of semi-semanticly-named colors.
//
-// The idea here is that you can do most of the work with quickStyle, then
-// add overrides as needed.
+// The idea here is that you can do most of the work on a theme with quickStyle,
+// then add overrides as needed.
func quickStyle(o quickStyleOpts) Styles {
var (
base = lipgloss.NewStyle().Foreground(o.fgBase)
@@ -863,11 +863,11 @@ func quickStyle(o quickStyleOpts) Styles {
// OAuth dialog
s.Dialog.OAuth.Spinner = base.Foreground(o.successMoreSubtle)
- s.Dialog.OAuth.Instructions = lipgloss.NewStyle().Foreground(o.primary)
- s.Dialog.OAuth.UserCode = lipgloss.NewStyle().Bold(true).Foreground(o.primary)
+ s.Dialog.OAuth.Instructions = lipgloss.NewStyle().Foreground(o.fgBase)
+ s.Dialog.OAuth.UserCode = lipgloss.NewStyle().Bold(true).Foreground(o.fgBase)
s.Dialog.OAuth.Success = lipgloss.NewStyle().Foreground(o.successMoreSubtle)
s.Dialog.OAuth.Link = lipgloss.NewStyle().Foreground(o.successMostSubtle).Underline(true)
- s.Dialog.OAuth.Enter = lipgloss.NewStyle().Foreground(o.primary)
+ s.Dialog.OAuth.Enter = lipgloss.NewStyle().Foreground(o.keyword)
s.Dialog.OAuth.ErrorText = lipgloss.NewStyle().Foreground(o.error)
s.Dialog.OAuth.StatusText = lipgloss.NewStyle().Foreground(o.fgMoreSubtle)
s.Dialog.OAuth.UserCodeBg = o.bgLeastVisible
@@ -21,6 +21,7 @@ func CharmtonePantera() Styles {
primary: charmtone.Charple,
secondary: charmtone.Dolly,
accent: charmtone.Bok,
+ keyword: charmtone.Blush,
fgBase: charmtone.Ash,
fgMoreSubtle: charmtone.Squid,