1pub mod alert;
7pub mod badge;
8pub mod button;
9pub mod card;
10pub mod checkbox;
11pub mod container;
12pub mod date_picker;
13pub mod image_element;
14pub mod input_box;
15pub mod link;
16pub mod modal;
17pub mod radio;
18pub mod select;
19pub mod slider;
20pub mod table;
21pub mod text;
22pub mod text_align;
23pub mod text_area;
24pub mod toggle_switch;
25
26pub use alert::{Alert, AlertSeverity};
27pub use badge::Badge;
28pub use button::{Button, ButtonLabelAlign};
29pub use card::Card;
30pub use checkbox::Checkbox;
31pub use container::Container;
32pub use date_picker::DatePicker;
33pub use image_element::{ImageElement, ImageFit};
34pub use input_box::InputBox;
35pub use link::Link;
36pub use modal::{Modal, ModalButton, ModalClickResult};
37pub use radio::Radio;
38pub use select::Select;
39pub use slider::Slider;
40pub use table::Table;
41pub use text::Text;
42pub use text_align::TextAlign;
43pub use text_area::TextArea;
44pub use toggle_switch::ToggleSwitch;
45
46use jag_draw::Rect;
47use jag_surface::Canvas;
48
49use crate::event::EventHandler;
50use crate::focus::FocusId;
51
52pub trait Element: EventHandler {
57 fn rect(&self) -> Rect;
59
60 fn set_rect(&mut self, rect: Rect);
62
63 fn render(&self, canvas: &mut Canvas, z: i32);
65
66 fn focus_id(&self) -> Option<FocusId>;
68}