Skip to main content

euv_ui/component/layout/view/
struct.rs

1use super::*;
2
3/// Immutable configuration captured through a scope-owned, copyable signal handle.
4#[derive(Clone, Getter)]
5pub(crate) struct LayoutSettings {
6    /// Shared immutable shell configuration.
7    #[get(pub(crate))]
8    pub(crate) props: Rc<EuvLayoutProps>,
9}
10
11/// Caller-supplied class names. Every field defaults to an empty string.
12#[derive(Clone, Debug, Default)]
13pub struct EuvLayoutClasses {
14    /// Class names for the `root_extra` region or state.
15    pub root_extra: String,
16    /// Class names for the `header` region or state.
17    pub header: String,
18    /// Class names for the `header_left` region or state.
19    pub header_left: String,
20    /// Class names for the `brand` region or state.
21    pub brand: String,
22    /// Class names for the `header_navigation` region or state.
23    pub header_navigation: String,
24    /// Class names for the `header_actions` region or state.
25    pub header_actions: String,
26    /// Class names for the `body` region or state.
27    pub body: String,
28    /// Class names for the `sidebar` region or state.
29    pub sidebar: String,
30    /// Class names for the `sidebar_navigation` region or state.
31    pub sidebar_navigation: String,
32    /// Class names for the `sidebar_footer` region or state.
33    pub sidebar_footer: String,
34    /// Class names for the `main` region or state.
35    pub main: String,
36    /// Class names for the `menu_button` region or state.
37    pub menu_button: String,
38    /// Class names for the `menu_button_active` region or state.
39    pub menu_button_active: String,
40    /// Class names for the `overlay` region or state.
41    pub overlay: String,
42    /// Class names for the `overlay_hidden` region or state.
43    pub overlay_hidden: String,
44    /// Class names for the `drawer` region or state.
45    pub drawer: String,
46    /// Class names for the `drawer_closed` region or state.
47    pub drawer_closed: String,
48    /// Class names for the `drawer_header` region or state.
49    pub drawer_header: String,
50    /// Class names for the `drawer_close` region or state.
51    pub drawer_close: String,
52}
53
54/// Optional content factories; absent slots render no content.
55#[derive(Clone, CustomDebug, Default)]
56pub struct EuvLayoutSlots {
57    /// Content for the `brand` region.
58    #[debug(skip)]
59    pub brand: Option<EuvLayoutSlot>,
60    /// Content for the `header_navigation` region.
61    #[debug(skip)]
62    pub header_navigation: Option<EuvLayoutSlot>,
63    /// Content for the `selector` region.
64    #[debug(skip)]
65    pub selector: Option<EuvLayoutSlot>,
66    /// Content for the `theme_control` region.
67    #[debug(skip)]
68    pub theme_control: Option<EuvLayoutSlot>,
69    /// Content for the `navigation` region.
70    #[debug(skip)]
71    pub navigation: Option<EuvLayoutSlot>,
72    /// Content for the `navigation_footer` region.
73    #[debug(skip)]
74    pub navigation_footer: Option<EuvLayoutSlot>,
75    /// Content for the `content` region.
76    #[debug(skip)]
77    pub content: Option<EuvLayoutSlot>,
78    /// Content for the `extra` region.
79    #[debug(skip)]
80    pub extra: Option<EuvLayoutSlot>,
81}
82
83/// Controlled, unstyled application shell. Hosts retain resize and overlay-history setup.
84#[derive(Clone, CustomDebug, Default)]
85pub struct EuvLayoutProps {
86    /// Existing breakpoint signal: true selects mobile.
87    pub mobile: Signal<bool>,
88    /// Existing host-owned drawer state.
89    pub drawer_open: Signal<bool>,
90    /// Reactive root class names (for example host-owned theme classes).
91    pub root_class: Signal<String>,
92    /// Static region and state class names; no styles are generated.
93    pub classes: EuvLayoutClasses,
94    /// Content factories shared by both responsive modes.
95    pub slots: EuvLayoutSlots,
96    /// Localized accessible name for the menu control and navigation drawer.
97    pub menu_label: &'static str,
98    /// Localized accessible name for the close control.
99    pub close_label: &'static str,
100}