mod asset;
mod color;
mod confirm;
#[cfg(feature = "data")]
mod explore;
mod file;
mod form;
mod input;
mod pager;
mod select;
mod textarea;
mod theme;
mod views;
pub use asset::{emoji, AssetKind, AssetPicker, BOX_STYLES};
pub use color::{ColorFormat, ColorPicker};
pub use confirm::{Choice, Confirm};
#[cfg(feature = "data")]
pub use explore::{explore_keymap, json_path, DataExplorer};
pub use file::{display_name, display_path, FileMode, FilePicker};
pub use form::{Answers, Form, Value};
pub use input::{input_keymap, Input, Provider, Suggestion};
pub use pager::Pager;
pub use select::{select_keymap, MultiSelect, PreviewLayout, Select};
pub use textarea::TextArea;
pub use theme::{ThemePicker, THEME_SAMPLE};
pub use views::{table_keymap, tree_keymap, TableSelect, TreeSelect};
use rich::Style;
#[derive(Clone, Debug)]
pub struct Theme {
pub question: String,
pub question_style: Style,
pub prompt: Style,
pub pointer: String,
pub pointer_style: Style,
pub focused: Style,
pub matched: Style,
pub checked: String,
pub unchecked: String,
pub checked_style: Style,
pub hint: Style,
pub error: Style,
pub answer: Style,
pub border: Style,
}
fn style(definition: &str) -> Style {
Style::parse(definition).expect("a built-in style")
}
impl Default for Theme {
fn default() -> Self {
Theme {
question: "?".into(),
question_style: style("bold green"),
prompt: style("bold"),
pointer: "❯".into(),
pointer_style: style("bold magenta"),
focused: style("bold"),
matched: style("bold magenta"),
checked: "◉".into(),
unchecked: "○".into(),
checked_style: style("green"),
hint: style("dim"),
error: style("red"),
answer: style("cyan"),
border: style("dim"),
}
}
}
pub(crate) use crate::kit::{fit, highlight, pad, pasted, plain, question, shown, text, width};