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
//! # Floem components
//!
//! `floem-components` is a component crate for [floem](https://lap.dev/floem/).
//! It is split into multiple modules:
//! 1. `theme` for color theming
//! 2. `views` for standard floem views
//! 3. `classes` for floem classes
//!
//! ## Quickstart
//!
//! ```no_run
//! use floem::{
//! peniko::Color,
//! reactive::create_signal,
//! views::{button, label, Decorators},
//! IntoView,
//! };
//! use mottes_floem_components::classes::{construct_theme, Button, Label};
//! use mottes_floem_components::theme::Theme;
//!
//! fn app_view() -> impl IntoView {
//! let (counter, mut set_counter) = create_signal(0);
//!
//! (
//! label(move || format!("Value: {counter}")).class(Label),
//! (
//! button("Increment")
//! .action(move || set_counter += 1)
//! .class(Button),
//! button("Decrement")
//! .action(move || set_counter -= 1)
//! .class(Button),
//! ),
//! )
//! .style(|_| {
//! construct_theme(Theme::dark())
//! .flex_col()
//! .width_full()
//! .height_full()
//! .background(Color::parse(Theme::dark().base00).unwrap())
//! })
//! }
//!
//! fn main() {
//! floem::launch(app_view);
//! }
//! ```
//!
//! If you want to see all components in action, look at the [gallery
//! example](https://codeberg.org/motte/floem-components/src/branch/main/examples/gallery.rs).
use Color;
const BORDER_RADIUS: f32 = 7.5;