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
//! Prefab design widgets for Snora Design tokens.
//!
//! This module is available when the `design` feature is enabled. It
//! provides the token-styled prefab widgets — `button`, `card`,
//! `notice`, `chip`, `progress`, and `widget` (chrome geometry). Each
//! wraps a plain iced widget and applies [`snora_style`] styling
//! internally; none of them expose the underlying style functions
//! themselves.
//!
//! **The iced style bridge — the `Tokens → iced style struct` mapping
//! functions these widgets are built on — is [`snora_style`], not this
//! module.** It moved there in RFC-055 and the compatibility re-export
//! that used to live here (`snora_widgets::design::{style, theme}`) was
//! removed in RFC-056: `snora-widgets` never documented a supported
//! path to it, and the widgets in this module consume it internally, so
//! there was nothing here for an application to keep depending on.
//! Applications wanting the style functions directly use
//! `snora::design::style::*` / `snora::design::theme` (through the
//! `snora` facade) or depend on `snora-style` directly.
//!
//! # 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
//! → snora_style function (tokens + iced Status)
//! → iced::widget::button::Style / container::Style
//! → this module's prefab widgets
//! → iced rendering
//! ```
//!
//! # Usage
//!
//! ```rust,ignore
//! use snora_design::Tokens;
//! use snora_widgets::design::button;
//!
//! let tokens = Tokens::light();
//! let btn = button::primary(&tokens, "Save", Message::Save);
//! ```
/// 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).
/// Token-derived chrome geometry — styled variants of the prefab chrome
/// widgets (RFC-040).
///
/// See the module documentation for the full spacing/radius mapping.