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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
//! # snora
//!
//! The iced engine for the Snora GUI framework.
//!
//! This crate binds [`snora_core`] vocabulary to iced. It exposes a single
//! entry point, [`render`], a toast lifecycle helper module, and — when
//! the `widgets` feature is enabled (the default) — a re-exported set of
//! prefab `iced::Element` builders from the [`snora-widgets`] crate.
//!
//! # Layering
//!
//! ```text
//! Your application
//! │
//! ▼
//! snora::render(AppLayout<Element, Message>) -> Element
//! │
//! ├─► snora-widgets (optional, prefab UI parts)
//! ▼
//! snora-core (vocabulary: Toast, Dialog, Sheet, SheetSize, …)
//! ```
//!
//! The dependency graph above is strict and the only way crates relate
//! to each other:
//!
//! * `snora-core` has zero iced dependency. It owns the vocabulary
//! (what choices exist).
//! * `snora-widgets` depends on `snora-core` and `iced`. It owns the
//! prefab widget visuals.
//! * `snora` depends on `snora-core` and (optionally) `snora-widgets`.
//! It owns the engine — `render`, the layer composition, and the
//! toast lifecycle helpers.
//!
//! Applications normally only depend on `snora` and use it as the single
//! umbrella crate; the workspace split exists so each layer can evolve
//! at its own pace.
//!
//! # A minimal application view
//!
//! ```ignore
//! use iced::{Element, widget::text};
//! use snora::{AppLayout, render, LayoutDirection};
//!
//! fn view(state: &MyState) -> Element<'_, Message> {
//! let body: Element<'_, Message> = text("Hello, snora!").into();
//!
//! let layout = AppLayout::new(body)
//! .direction(LayoutDirection::Ltr);
//!
//! render(layout)
//! }
//! ```
//!
//! # Engine-only builds
//!
//! Applications that supply 100 % of their UI parts and do not want the
//! prefab widgets compiled in can opt out:
//!
//! ```toml
//! [dependencies]
//! snora = { version = "0.18", default-features = false }
//! ```
//!
//! In this configuration `snora-widgets` is not pulled in and the
//! `snora::widget` module does not exist.
//!
//! [`snora-widgets`]: https://docs.rs/snora-widgets
// ---- Re-export the vocabulary from snora-core --------------------------
//
// Users should only need to import from `snora`. We forward the whole
// contract surface so that a single `use snora::*` (or targeted imports)
// suffices.
pub use ;
// ---- Engine modules (always present) ----------------------------------
/// The single rendering entry point: [`render`].
/// Toast rendering and lifecycle helpers
/// ([`subscription`](toast::subscription), [`sweep_expired`](toast::sweep_expired)).
/// Keyboard dismissal helper: [`keyboard::dismiss_on_escape`].
pub use render;
// ---- Widget re-exports (feature-gated) --------------------------------
//
// When `widgets` is enabled (the default), expose the prefab widget set
// from `snora-widgets` under `snora::widget` and `snora::direction` /
// `snora::style`. These import paths preserve the 0.5.x shape so most
// applications need no change.
/// Direction-aware row helpers. Re-exported from `snora-widgets`.
pub use direction;
/// Shared style functions used by the prefab widgets.
/// Re-exported from `snora-widgets`.
pub use style;
/// Optional prefab `iced::Element` builders for header / sidebar / footer
/// / menu / icon. Re-exported from `snora-widgets`.
///
/// This module is only available when the `widgets` feature is enabled
/// (which is the default).
/// Convenience re-export of Lucide icon constants. Available when both
/// `widgets` and `lucide-icons` features are enabled.
pub use lucide;
// ---- Design re-exports (feature-gated) --------------------------------
//
// When `design` is enabled (opt-in, requires `widgets`), expose the Snora
// Design token types and iced style bridge under `snora::design`.
/// Snora Design token types and iced style bridge.
///
/// Available when the `design` feature is enabled. Exposes:
///
/// * Token vocabulary from [`snora_design`]: [`design::Tokens`],
/// [`design::Palette`], [`design::Color`], and the full variant /
/// sub-token set.
/// * The iced style bridge under [`design::style`]: color conversion,
/// semantic button styles, and card/container styles.
///
/// # iced 0.14 focus limitation
///
/// Standard `button` / `container` styles in iced 0.14 do not expose
/// keyboard-focus state. The style bridge maps every status iced does expose
/// (hover, pressed, disabled); custom focus rings on standard controls are
/// not deliverable in v0.20 through this path. See RFC-025 and
/// `docs/src/contributing/semantic-accessibility.md` for detail.