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
//! Structural section container for [`List::content`](super::List::content).
//!
//! [`Section<C>`] groups a sub-tree of [`super::ListContent`] under a header
//! (and optional footer). It compiles down to the existing wire-format on
//! [`super::ListItem`] (`section: Option<ListSection>`), tagging the first
//! item produced by its inner content. Backends translate that marker into
//! native chrome — iOS `UITableView` section header + footer, macOS
//! `NSTableView` group rows, Material section dividers — without any extra
//! FFI surface.
use ;
use ListSection;
use ;
/// Groups a sub-tree of [`ListContent`] under an optional header and footer.
///
/// `Section` is structurally typed in its inner content `C`, mirroring the
/// shape of [`Vec<C>`] / `[C; N]` — there is no type erasure and no `Box<dyn>`
/// at the call site. Compose sections with the existing tuple impls of
/// [`ListContent`].
///
/// The header and footer are semantic text, so a string literal localizes and
/// a signal-backed title updates in place: the backend repaints the chrome
/// without rebuilding the section's rows.
///
/// # Example
///
/// ```rust
/// use waterui::component::list::{List, Section, row};
/// use waterui::prelude::*;
///
/// let stalls = binding::<i32>(0);
/// let list = List::content((
/// Section::new("Connection").content((
/// row("Status", text!("Connected")),
/// row("Endpoint", text!("wss://example.invalid")),
/// )),
/// Section::new(text!("Activity ({stalls} stalled)"))
/// .footer("Updated every poll")
/// .content((
/// row("Polls", text!("12")),
/// row("Stalls", text!("0"))
/// ))
/// ));
/// ```