| 40 | var initOnce sync.Once |
| 41 | |
| 42 | func InitCommonStyles(out io.Writer) { |
| 43 | initOnce.Do(func() { |
| 44 | theme.Init(out) |
| 45 | |
| 46 | helpStyleTUI = theme.Neutral().Italic(true) |
| 47 | errorStyleTUI = theme.Error() |
| 48 | warningStyleTUI = theme.Warning() |
| 49 | successStyle = theme.Success() |
| 50 | |
| 51 | primaryStyle = theme.Primary() |
| 52 | primaryTitleStyle = primaryStyle.Bold(true) |
| 53 | primaryCursorStyle = primaryStyle |
| 54 | primarySelectedStyle = primaryTitleStyle |
| 55 | labelStyle = theme.Label() |
| 56 | subtleTextStyle = theme.Neutral() |
| 57 | durationTextStyle = subtleTextStyle.Italic(true) |
| 58 | warningBoxStyle = warningStyleTUI. |
| 59 | Border(lipgloss.RoundedBorder()). |
| 60 | BorderForeground(lipgloss.Color(theme.WarningColor)). |
| 61 | Padding(1, 2) |
| 62 | }) |
| 63 | } |
| 64 | |
| 65 | func RenderWarningSimple(message string) string { |
| 66 | if message == "" { |