1pub mod dialog;
2pub mod input;
3pub mod select;
4pub mod theme;
5pub mod yes_no;
6
7pub use ratatui::style;
8pub use ratatui::text;
9
10macro_rules! key_event_pattern {
11 ($code:pat) => {
12 ratatui::crossterm::event::KeyEvent {
13 code: $code,
14 modifiers: _,
15 kind: ratatui::crossterm::event::KeyEventKind::Press,
16 state: _,
17 }
18 };
19 ($code:pat, $modifier:pat) => {
20 ratatui::crossterm::event::KeyEvent {
21 code: $code,
22 modifiers: $modifier,
23 kind: ratatui::crossterm::event::KeyEventKind::Press,
24 state: _,
25 }
26 };
27 ($code:pat, $modifier:pat, $kind:pat) => {
28 ratatui::crossterm::event::KeyEvent {
29 code: $code,
30 modifiers: $modifier,
31 kind: $kind,
32 state: _,
33 }
34 };
35 ($code:pat, $modifier:pat, $kind:pat, $state:pat) => {
36 ratatui::crossterm::event::KeyEvent {
37 code: $code,
38 modifiers: $modifier,
39 kind: $kind,
40 state: $state,
41 }
42 };
43}
44pub(crate) use key_event_pattern;
45
46macro_rules! cancel_key_event {
47 () => {
48 crate::key_event_pattern!(KeyCode::Esc)
49 | crate::key_event_pattern!(KeyCode::Char('c'), KeyModifiers::CONTROL)
50 };
51}
52pub(crate) use cancel_key_event;