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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
//! Pelican UI Standard provides a wide range of components, layouts, elements, utilities, and pages for building beautiful, consistently designed applications. You can download the starter template [here](<https://github.com/EllaCouch20/ramp_template>).
//!
//! Checkout the [website](<http://ramp-stack.com/pelican_ui>) for additional information, our [Quick Start Guide](<http://ramp-stack.com/pelican_ui/getting_started>) for setting up your first app, and interact with the [community](<https://discord.gg/cTRaRbUZ>) if you have any questions!
//!
//!
//! At its core, Pelican UI Standard revolves around **components**, which are composed from layouts and elements. Every structure implementing the [`Component`](pelican_ui::Component) trait must meet a few requirements:
//! - Its first element must implement [`Layout`](pelican_ui::layout::Layout), ensuring correct management of positioning, sizing, and nested layouts.
//! - It must implement [`OnEvent`](pelican_ui::events::OnEvent) and derive [`Debug`].
//!
//! Components are built from **elements**, the lowest-level primitives such as [`Text`], [`AspectRatioImage`], and [`Circle`], and can use different **layouts** like [`Column`], [`Row`], and [`Stack`] to arrange them.
//! Components are also often built from combining components.
//!
//! Pelican UI Standard includes multiple [`Events`](pelican_ui::events::Event) used and triggered by its components, as well as configuration variables for platform detection such as [`IS_MOBILE`] and [`IS_WEB`]. Additional utilities like [`Timestamp`] and [`ElementID`] are also provided.
//!
//! Beyond individual components, Pelican UI Standard ships with a few ready-to-use **pages** built entirely from its own system, including [`PelicanHome`], [`Error`], and [`Splash`]. These can be used directly or serve as references when creating custom pages.
//!
//! ### App Page Example
//!
//! ```rust
//! #[derive(Debug, Component)]
//! pub struct FirstScreen(Stack, Page);
//! impl OnEvent for FirstScreen {}
//!
//! impl AppPage for FirstScreen {
//! fn has_nav(&self) -> bool { false }
//! fn navigate(self: Box<Self>, _ctx: &mut Context, _index: usize) -> Result<Box<dyn AppPage>, Box<dyn AppPage>> { Err(self) }
//! }
//!
//! impl FirstScreen {
//! pub fn new(ctx: &mut Context) -> Self {
//! let color = ctx.theme.colors.text.heading;
//! let icon = Icon::new(ctx, "pelican_ui", color, 128.0);
//!
//! let font_size = ctx.theme.fonts.size;
//! let text = Text::new(ctx, "Hello World!", TextStyle::Heading, font_size.h2, Align::Center);
//! let subtext = ExpandableText::new(ctx, "First project loaded successfully.", TextStyle::Primary, font_size.md, Align::Center, None);
//!
//! let content = Content::new(ctx, Offset::Center, vec![Box::new(icon), Box::new(text), Box::new(subtext)]);
//!
//! let header = Header::home(ctx, "My Screen", None);
//!
//! FirstScreen(Stack::default(), Page::new(Some(header), content, None))
//! }
//! }
//!```
//!
// pub use events::{
// NavigateEvent,
// KeyboardActiveEvent,
// ClearActiveInput,
// SetActiveInput,
// TextInputSelect,
// ListItemSelect,
// NavigatorSelect,
// NavigatorEvent,
// SearchEvent,
// InputEditedEvent,
// AdjustScrollEvent,
// QRCodeScannedEvent,
// AttachmentEvent,
// };
pub use ;
// pub use layout::{
// Offset,
// Size,
// Padding,
// Column,
// Row,
// Wrap,
// Scroll,
// Stack,
// ScrollAnchor,
// Bin,
// Opt,
// EitherOr,
// UniformExpand
// };
// mod elements;
// pub use elements::{
// Text,
// ExpandableText,
// TextStyle,
// BulletedText,
// ExpandableImage,
// EncodedImage,
// AspectRatioImage,
// Icon,
// Circle,
// Rectangle,
// RoundedRectangle,
// OutlinedRectangle,
// Outline,
// };
// pub use components::{
// Button,
// ButtonStyle,
// ButtonSize,
// ButtonState,
// ButtonWidth,
// IconButton,
// QuickActions,
// Alert,
// Avatar,
// AvatarContent,
// AvatarIconStyle,
// DataItem,
// ListItem,
// ListItemGroup,
// ListItemSelector,
// TextInput,
// Searchbar,
// QRCode,
// QRCodeScanner,
// Slider,
// Interface,
// Page,
// Header,
// Bumper,
// Content,
// HeaderIcon,
// HeaderContent
// };
pub use ;
pub use ;
// mod themes;
// pub use themes::{
// PelicanColorThemes
// };
/*
How to create an app with Ramp
How to create a page with Ramp
How to create a component with Ramp
How to create a layout with Ramp
How to create a plugin with Ramp
How to create a messaging app with Ramp
How to create a bitcoin wallet with Ramp
How to create a AIR profile with Ramp
*/
/*
// ! ```rust
// ! #[derive(Debug, Component)]
// ! pub struct InfoCard(Column, Text, Text);
// ! impl OnEvent for InfoCard {}
// !
// ! impl InfoCard {
// ! pub fn new(ctx: &mut Context, title: &str, description: &str) -> Self {
// ! let font_size = ctx.theme.fonts.size;
// !
// ! InfoCard(
// ! Column::new(8.0, Offset::Center, Size::Fit, Padding::new(16.0)),
// ! Text::new(ctx, title, TextStyle::Header, font_size.h3, Align::Left),
// ! Text::new(ctx, description, TextStyle::Primary, font_size.md, Align::Left)
// ! )
// ! }
// ! }
// ! ```\
*/