//! Themed span helpers. //! //! sysop-tui's `style.rs` offered the same set (`fg`, `dim`, `bold`, `ok`, //! `warn`, `fault`) against a const palette. Alloy's palette is loaded at //! runtime, so each helper takes the `&Theme` instead. The status-colored //! variants are gone: they collapse into [`Severity`](crate::Severity), which //! already owns the mapping from intent to `status.*` color. use ratatui::style::{Modifier, Style}; use ratatui::text::Span; use crate::theme::Theme; /// Body text in the primary content color. pub fn primary(theme: &Theme, s: impl Into) -> Span<'static> { Span::styled(s.into(), Style::default().fg(theme.content_primary)) } /// De-emphasized text — labels, units, inactive rows. pub fn muted(theme: &Theme, s: impl Into) -> Span<'static> { Span::styled(s.into(), Style::default().fg(theme.content_muted)) } /// Supporting text: dimmer than primary, louder than muted. pub fn secondary(theme: &Theme, s: impl Into) -> Span<'static> { Span::styled(s.into(), Style::default().fg(theme.content_secondary)) } /// Emphasized body text. pub fn bold(theme: &Theme, s: impl Into) -> Span<'static> { Span::styled( s.into(), Style::default() .fg(theme.content_primary) .add_modifier(Modifier::BOLD), ) } /// A key hint or other interactive affordance. The one accent-on-text use that /// is not a `Severity` — DESIGN-LANGUAGE.md allows the action color here /// because a key hint *is* the actionable element, not decoration. pub fn action(theme: &Theme, s: impl Into) -> Span<'static> { Span::styled(s.into(), Style::default().fg(theme.action_primary)) }