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
//! iced style bridge for Snora Design tokens.
//!
//! This module is available when the `design` feature is enabled. It provides:
//!
//! * [`style::color::to_iced_color`] — explicit `snora_design::Color` →
//! `iced::Color` conversion (no implicit `From` impl, to keep the iced
//! boundary intentional).
//! * [`style::button`] — semantic button style functions for `primary`,
//! `secondary`, `ghost`, and `danger` variants.
//! * [`style::container`] — card/container style functions for `surface`,
//! `raised`, and `selected` variants.
//! * [`style::text`] — text style helpers derived from [`snora_design::Tokens`].
//!
//! # iced 0.14 focus limitation
//!
//! `iced::widget::button::Status` exposes `Active | Hovered | Pressed |
//! Disabled` only — there is **no focused state**. The style bridge maps the
//! statuses iced does expose; custom focus rings on standard buttons/cards are
//! not deliverable in iced 0.14 through this path. `FocusTokens` remain valid
//! vocabulary for future iced versions or custom widgets that do expose focus.
//!
//! See `docs/src/contributing/semantic-accessibility.md` for the documented
//! limitation.
//!
//! # Data flow
//!
//! ```text
//! snora_design::Tokens
//! → style function (tokens + iced Status)
//! → iced::widget::button::Style / container::Style
//! → iced rendering
//! ```
//!
//! # Usage
//!
//! ```rust,ignore
//! use snora_design::Tokens;
//! use snora_widgets::design::style;
//!
//! let tokens = Tokens::light();
//! let btn = button("Save")
//! .style(move |_theme, status| style::button::primary(&tokens, status));
//! ```
/// Ergonomic pilot button helpers (RFC-028).
///
/// Wraps `iced::widget::button` with Snora Design token styling.
/// See [`button::primary`], [`button::secondary`], [`button::ghost`],
/// [`button::danger`], and their `*_maybe` disabled-state variants.
/// Ergonomic pilot card helpers (RFC-029).
///
/// Wraps `iced::widget::container` with Snora Design token styling.
/// See [`card::surface`], [`card::raised`], [`card::selected`].
/// Notice banner primitive (RFC-032).
///
/// Builder-style wrapper: tone, optional title, body, optional action
/// button, optional dismiss button. All interactive controls are native
/// iced buttons.
/// Filter and removable chip primitives (RFC-032).
///
/// See [`chip::filter`] and [`chip::removable`]. Both use
/// `iced::widget::button` and are keyboard-reachable.
/// Progress row and card primitives (RFC-032).
///
/// See [`progress::row`] and [`progress::card`]. Backed by
/// `iced::widget::progress_bar`. Indeterminate state is rendered as
/// 0% with a "…" suffix (iced 0.14 limitation).
/// iced style functions for Snora Design tokens.