euv_ui/component/navigation/struct.rs
1use super::*;
2
3/// Single sidebar navigation destination descriptor with optional category section header.
4#[derive(Clone, Data, Debug, Eq, New, PartialEq)]
5pub struct EuvNavItem {
6 /// Route path identifier.
7 pub(crate) path: String,
8 /// Human-readable navigation label.
9 pub(crate) label: String,
10 /// Optional uppercase sidebar section heading (e.g. `"WORKSPACE"`, `"ENGINE & MEDIA"`).
11 #[new(skip)]
12 pub(crate) section: String,
13}
14
15/// Vertical sidebar navigation list highlighting the active route reactively.
16#[derive(Clone, Data, Debug, New, Props)]
17pub struct EuvSidebarNav {
18 /// Ordered navigation items.
19 pub(crate) items: Vec<EuvNavItem>,
20 /// Reactive current route signal.
21 #[get(type(copy))]
22 pub(crate) active_route: Signal<String>,
23 /// Active theme tokens.
24 #[get(type(copy))]
25 pub(crate) tokens: ThemeTokens,
26}
27
28/// Horizontal tab bar switching active tab index reactively.
29#[derive(Clone, Data, Debug, New, Props)]
30pub struct EuvTabs {
31 /// Ordered tab labels.
32 pub(crate) labels: Vec<String>,
33 /// Reactive active tab index signal.
34 #[get(type(copy))]
35 pub(crate) active: Signal<usize>,
36 /// Active theme tokens.
37 #[get(type(copy))]
38 pub(crate) tokens: ThemeTokens,
39}
40
41/// Twitter/X-style persistent bottom navigation bar highlighting the active route reactively.
42#[derive(Clone, Data, Debug, New, Props)]
43pub struct EuvBottomNav {
44 /// Ordered primary bottom-tab items (uses `section` as compact icon glyph when provided).
45 pub(crate) items: Vec<EuvNavItem>,
46 /// Reactive current route signal.
47 #[get(type(copy))]
48 pub(crate) active_route: Signal<String>,
49 /// Active theme tokens.
50 #[get(type(copy))]
51 pub(crate) tokens: ThemeTokens,
52}
53
54/// Reactive tab node and visual-state cell bundle for `EuvBottomNav`.
55pub(crate) struct BottomNavTabEntry {
56 /// Zero-based tab index.
57 pub(crate) tab_idx: usize,
58 /// Hoverable inner pill column node.
59 pub(crate) tab_col: NodeId,
60 /// Vector icon canvas node.
61 pub(crate) icon_canvas: NodeId,
62 /// Tab caption text node.
63 pub(crate) label_node: NodeId,
64 /// Shared active-pill coverage flag read by the icon painter.
65 pub(crate) under_cell: Rc<Cell<bool>>,
66 /// Shared non-active hover flag read by the icon painter.
67 pub(crate) hover_cell: Rc<Cell<bool>>,
68}