alert_rs/
common.rs

1/// Alert icon types
2#[derive(Debug, PartialEq, Clone, Default)]
3pub enum IconType {
4    Warning,
5    Error,
6    Success,
7    Info,
8    #[default]
9    Question,
10}
11
12/// Alert positions
13#[derive(Debug, PartialEq, Clone, Default)]
14pub enum Position {
15    TopLeft,
16    TopCenter,
17    TopRight,
18    LeftCenter,
19    #[default]
20    Center,
21    RightCenter,
22    BottomLeft,
23    BottomCenter,
24    BottomRight,
25    Custom(&'static str, &'static str),
26}
27
28/// Default styles
29pub const DEFAULT_ALERT_STYLE: &str =
30    "position: fixed; width: 100vw; height: 100vh; top: 0; left: 0; background: rgba(0, 0, 0, 0.75); z-index: 10; display: flex; justify-content: center; align-items: center;";
31pub const DEFAULT_CLOSE_BUTTON_STYLE: &str = "position: absolute; top: 10px; right: 10px;";
32pub const DEFAULT_CONFIRM_BUTTON_STYLE: &str =
33    "margin: 5px; padding: 5px 10px; background-color: green; color: white; border: none; border-radius: 5px;";
34pub const DEFAULT_CANCEL_BUTTON_STYLE: &str =
35    "margin: 5px; padding: 5px 10px; background-color: red; color: white; border: none; border-radius: 5px;";
36pub const DEFAULT_ICON_STYLE: &str =
37    "display: flex; justify-content: center; align-items: center; padding: 2px; margin: 2px;";
38pub const DEFAULT_TITLE_STYLE: &str =
39    "justify-content: center; align-items: center; font-size: 26px;";
40pub const DEFAULT_SEPARATOR_STYLE: &str = "margin: 10px 0;";
41pub const DEFAULT_MESSAGE_STYLE: &str = "font-size: 14px;";