Skip to main content

euv_ui/component/overlay_extra/
struct.rs

1use super::*;
2
3/// Side slide-over drawer portal controlled by `Signal<bool>`.
4#[derive(Clone, Data, New, Props)]
5pub struct EuvDrawer {
6    /// Reactive open state.
7    #[get(type(copy))]
8    pub(crate) open: Signal<bool>,
9    /// Drawer header title.
10    pub(crate) title: String,
11    /// Mounted drawer body node.
12    #[get(type(copy))]
13    pub(crate) body: NodeId,
14    /// Active theme tokens.
15    #[get(type(copy))]
16    pub(crate) tokens: ThemeTokens,
17}
18
19/// Bottom sheet portal ideal for iOS / Android / iPadOS action flows.
20#[derive(Clone, Data, New, Props)]
21pub struct EuvSheet {
22    /// Reactive open state.
23    #[get(type(copy))]
24    pub(crate) open: Signal<bool>,
25    /// Sheet header title.
26    pub(crate) title: String,
27    /// Mounted sheet body node.
28    #[get(type(copy))]
29    pub(crate) body: NodeId,
30    /// Active theme tokens.
31    #[get(type(copy))]
32    pub(crate) tokens: ThemeTokens,
33}
34
35/// Anchored popover surface toggled by `Signal<bool>`.
36#[derive(Clone, Data, New, Props)]
37pub struct EuvPopover {
38    /// Reactive open state.
39    #[get(type(copy))]
40    pub(crate) open: Signal<bool>,
41    /// Trigger child node.
42    #[get(type(copy))]
43    pub(crate) trigger: NodeId,
44    /// Popover content node.
45    #[get(type(copy))]
46    pub(crate) content: NodeId,
47    /// Active theme tokens.
48    #[get(type(copy))]
49    pub(crate) tokens: ThemeTokens,
50}
51
52/// Compact floating tooltip label attached to a trigger node.
53#[derive(Clone, Data, New, Props)]
54pub struct EuvTooltip {
55    /// Tooltip help text.
56    pub(crate) text: String,
57    /// Trigger child node.
58    #[get(type(copy))]
59    pub(crate) trigger: NodeId,
60    /// When `true`, keeps the tooltip permanently displayed instead of toggling on hover.
61    #[new(skip)]
62    #[get(type(copy))]
63    #[prop(custom)]
64    pub(crate) always_visible: bool,
65    /// Active theme tokens.
66    #[get(type(copy))]
67    pub(crate) tokens: ThemeTokens,
68}
69
70/// Click-triggered dropdown action menu.
71#[derive(Clone, Data, New, Props)]
72pub struct EuvDropdown {
73    /// Trigger button label.
74    pub(crate) label: String,
75    /// Action item labels.
76    pub(crate) items: Vec<String>,
77    /// Optional controlled reactive open flag (creates internal state when omitted).
78    #[new(skip)]
79    #[get(skip)]
80    #[prop(custom)]
81    pub(crate) open: Option<Signal<bool>>,
82    /// Optional controlled last-selected item index signal.
83    #[new(skip)]
84    #[get(skip)]
85    pub(crate) last_selected: Option<Signal<Option<usize>>>,
86    /// Active theme tokens.
87    #[get(type(copy))]
88    pub(crate) tokens: ThemeTokens,
89}
90
91/// Rich corner notification card with title, message, and semantic tone.
92#[derive(Clone, Data, New, Props)]
93pub struct EuvNotification {
94    /// Reactive visibility signal.
95    #[get(type(copy))]
96    pub(crate) visible: Signal<bool>,
97    /// Notification heading.
98    pub(crate) title: String,
99    /// Notification detail message.
100    pub(crate) message: String,
101    /// Semantic tone (`Neutral` by default).
102    #[new(skip)]
103    #[get(type(copy))]
104    #[prop(custom)]
105    pub(crate) tone: EuvTone,
106    /// Active theme tokens.
107    #[get(type(copy))]
108    pub(crate) tokens: ThemeTokens,
109}
110
111/// Full-surface loading indicator overlay with spinner and caption.
112#[derive(Clone, Data, New, Props)]
113pub struct EuvLoading {
114    /// Reactive active loading state.
115    #[get(type(copy))]
116    pub(crate) active: Signal<bool>,
117    /// Status message.
118    pub(crate) label: String,
119    /// Active theme tokens.
120    #[get(type(copy))]
121    pub(crate) tokens: ThemeTokens,
122}