use ratatui::crossterm::event::KeyEvent;
use ratatui::style::{Color, Modifier, Style};
pub use legume_tui::hist::{
compact, median, BarValue, Binned, Binning, HistPlot, MirrorPlot, MirrorSide, Scale,
};
pub use legume_tui::view::{
header, help_line, input_line, modes_of, notify, panel, run_screen_in, run_screen_in_with,
title_bar, Screen, Tui, TICK,
};
pub use legume_tui::Look;
const ACCENT: Color = Color::Rgb(217, 119, 87);
pub const LOOK: Look = Look::new(
Style::new(),
Style::new().add_modifier(Modifier::BOLD),
Style::new().add_modifier(Modifier::DIM),
Style::new().add_modifier(Modifier::REVERSED),
Style::new().add_modifier(Modifier::DIM),
Style::new().fg(ACCENT),
);
pub fn copy(text: &str) {
let _ = legume_tui::keys::copy(text, true);
}
pub fn run_screen<S: Screen>(screen: &mut S) -> anyhow::Result<()> {
Ok(legume_tui::view::run_screen(&super::TOOL, screen)?)
}
pub fn run_screen_with<S: Screen>(
screen: &mut S,
on_key: impl FnMut(&mut S, KeyEvent),
) -> anyhow::Result<()> {
Ok(legume_tui::view::run_screen_with(
&super::TOOL,
screen,
on_key,
)?)
}