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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
use *;
/// A generic left-side mobile drawer with overlay, aligned with common
/// component libraries and the euv example's overlay-stack behaviour.
///
/// The drawer and overlay are always mounted and slide/fade via reactive
/// classes driven by the caller-owned `open` signal; clicking the overlay
/// closes the drawer through [`Router::overlay_stack_close`], so the browser
/// / system back gesture history entry pushed when the drawer opened is
/// consumed and stays in sync.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerProps>` - The props node containing the open signal.
///
/// # Returns
///
/// - `VirtualNode` - The drawer virtual DOM tree.
/// Closes the drawer, consuming its overlay history entry.
///
/// Mirrors the euv example: `Router::overlay_stack_close()` pops the overlay
/// stack and consumes the history entry pushed when the drawer opened (see
/// [`Router::use_overlay_history`]), then the signal is set.
///
/// # Arguments
///
/// - `Signal<bool>` - The drawer-open signal.
///
/// # Returns
///
/// - `Option<Rc<dyn Fn(Event)>>` - The click handler.
/// Opens a drawer.
///
/// The trigger reports the state of the drawer through `aria-expanded`,
/// so a reader knows whether the panel is already on the page before
/// they press it.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerTriggerProps>` - The props node carrying the
/// state of the drawer.
///
/// # Returns
///
/// - `VirtualNode` - The euv drawer trigger virtual DOM tree.
/// Holds the panel of a drawer.
///
/// The panel is the sheet that rises from the bottom edge. It reports
/// the state of the drawer and takes itself out of the flow while the
/// drawer is closed.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerContentProps>` - The props node carrying the
/// state of the drawer.
///
/// # Returns
///
/// - `VirtualNode` - The euv drawer content virtual DOM tree.
/// Holds the heading of a drawer.
///
/// The header is centred on a narrow screen and left aligned on a wide
/// one, the way the reference lays it out.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerHeaderProps>` - The props node carrying the
/// settings of the header.
///
/// # Returns
///
/// - `VirtualNode` - The euv drawer header virtual DOM tree.
/// Holds the actions of a drawer.
///
/// The footer sits at the bottom of the panel, so the actions stay
/// reachable however long the content above them is.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerFooterProps>` - The props node carrying the
/// settings of the footer.
///
/// # Returns
///
/// - `VirtualNode` - The euv drawer footer virtual DOM tree.
/// Holds the title of a drawer.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerTitleProps>` - The props node carrying the
/// settings of the title.
///
/// # Returns
///
/// - `VirtualNode` - The euv drawer title virtual DOM tree.
/// Holds the description of a drawer.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerDescriptionProps>` - The props node carrying
/// the settings of the description.
///
/// # Returns
///
/// - `VirtualNode` - The euv drawer description virtual DOM tree.
/// Closes a drawer.
///
/// The close button consumes the overlay history entry the drawer pushed
/// when it opened, so the browser back gesture does not reopen the
/// drawer behind the reader's back.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerCloseProps>` - The props node carrying the
/// state of the drawer.
///
/// # Returns
///
/// - `VirtualNode` - The euv drawer close virtual DOM tree.
/// Builds the handler that opens the drawer.
///
/// # Arguments
///
/// - `Signal<bool>` - The drawer-open signal.
///
/// # Returns
///
/// - `Option<Rc<dyn Fn(Event)>>` - The press handler.
/// Dims the page behind the drawer.
///
/// The overlay covers the page and takes the click, so a click outside the
/// panel of the drawer does not reach the page behind it.
///
/// # Arguments
///
/// - `VirtualNode<EuvDrawerOverlayProps>` - The props node carrying whether
/// the drawer is open.
///
/// # Returns
///
/// - `VirtualNode` - The overlay element.