1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//! UI Elements built using Savory
//!
//! Elements in this crate are built using `savory` ecosystem crates.
//!
//! # Features
//!
//!
//! - **Design System**: Elements are fully styled using [`DesignSystem`].
//! - **Reusability**: Elements are highly reusable/composable.
//! - **Decoupled Developemnt**: Design Systems can be developed in seprate crate
//!   without even touching elements code, and the same for elements developemnt,
//!   the are developed sepratedly from the design system, thanks to
//!   [`DesignSystemImpl`] trait.
//! - **Clean View**: build your view in a clean and declarative way, no more macros at
//!   all.
//! - **Trait Based**: embrace Rust trait system, all savory elements implments
//!   `Element` and/or `View` trait.
//! - **Typed HTML**: Use typed CSS and HTML attributes, Savory try hard not to rely
//!   on strings when creating CSS and HTML attributes since these can produce hard
//!   to debug bugs.
//! - **Collection of UI elements**: Savory ships with collection of resuable and
//!   themeable UI elements.
//! - **Enhance Seed API**: Enhancement on Seed API that makes working with `Node`,
//!   `Orders` fun.
//!
//! Savory tries to make writing UI elements fun and boilerplate free.
//!
//! # Layouts
//!
//! - [Flex](prelude::Flex)
//!
//! # Elements & Views
//!
//! - [Button](prelude::Button)
//! - [Switch](prelude::Switch)
//! - [Radio](prelude::Radio)
//! - [Text](prelude::Text)
//! - [TextInput](prelude::TextInput)
//! - [ProgressBar](prelude::ProgressBar)
//! - [Image](prelude::Image)
//! - [Svg](prelude::Svg)
//!
//! [`DesignSystem`]: prelude::DesignSystem
//! [`DesignSystemImpl`]: design_system::DesignSystemImpl
//! [`Modifier`]: prelude::Modifier

#![forbid(unsafe_code)]

#[macro_use]
extern crate derive_more;

// pub mod animator;
pub mod design_system;
pub mod element;
pub mod id;
pub mod layout;
// pub mod screen_info_notifier;
pub mod traits;
pub mod view;

pub use self::prelude::*;

// TODO: add:
// - ScrollBox layout element
// - Slider element

/// savory_elements prelude
pub mod prelude {
    pub use super::{
        design_system::{self, DesignSystem, DesignSystemChanged},
        // animator::{self, Animator},
        // screen_info_notifier::{self, NewScreenInfo, ScreenInfo, ScreenInfoNotifier},
        element::{
            button::{self, Button},
            progress_bar::{self, ProgressBar},
            radio::{self, Radio},
            switch::{self, Switch},
            text_input::{self, TextInput},
        },
        // id::Id,
        layout::flex::{self, Flex},
        traits::ExtendBuilder,
        view::{
            image::{self, Image},
            svg::{self, Svg},
            text::{self, Text},
        },
    };
    pub use derive_rich::Rich;
    pub use savory_elements_derive::Element;
}