Skip to main content

euv_ui/component/shadcn_complete/
struct.rs

1use super::*;
2
3/// Single labeled value plotted inside `EuvChart`.
4#[derive(Clone, Data, Debug, New, PartialEq)]
5pub struct EuvChartPoint {
6    /// Short horizontal axis label (e.g. `"Mon"`).
7    pub(crate) label: String,
8    /// Numeric data point value.
9    #[get(type(copy))]
10    pub(crate) value: f32,
11}
12
13/// Pure-Rust vector chart widget (`ui.shadcn.com/docs/components/chart`).
14#[derive(Clone, Data, Debug, New, Props)]
15pub struct EuvChart {
16    /// Chart title heading.
17    pub(crate) title: String,
18    /// Chart style (`Bar`, `Line`, `Area`).
19    #[get(type(copy))]
20    pub(crate) kind: EuvChartKind,
21    /// Ordered data points.
22    pub(crate) data: Vec<EuvChartPoint>,
23    /// Active theme tokens.
24    #[get(type(copy))]
25    pub(crate) tokens: ThemeTokens,
26}
27
28/// Searchable dropdown combobox (`ui.shadcn.com/docs/components/combobox`).
29#[derive(Clone, Data, Debug, New, Props)]
30pub struct EuvCombobox {
31    /// Optional placeholder shown when search input is empty.
32    #[new(skip)]
33    #[prop(custom)]
34    pub(crate) placeholder: String,
35    /// Selectable option labels.
36    pub(crate) options: Vec<String>,
37    /// Optional controlled search query signal (creates internal state when omitted).
38    #[new(skip)]
39    #[get(skip)]
40    #[prop(custom)]
41    pub(crate) query: Option<Signal<String>>,
42    /// Controlled selected option index signal.
43    #[get(type(copy))]
44    pub(crate) selected: Signal<usize>,
45    /// Controlled popover open state signal.
46    #[get(type(copy))]
47    pub(crate) open: Signal<bool>,
48    /// Active theme tokens.
49    #[get(type(copy))]
50    pub(crate) tokens: ThemeTokens,
51}
52
53/// Production sortable, filterable, selectable data table (`ui.shadcn.com/docs/components/data-table`).
54#[derive(Clone, Data, Debug, New, Props)]
55pub struct EuvDataTable {
56    /// Column header titles.
57    pub(crate) headers: Vec<String>,
58    /// Row cell matrices.
59    pub(crate) rows: Vec<Vec<String>>,
60    /// Optional controlled search filter signal (creates internal state when omitted).
61    #[new(skip)]
62    #[get(skip)]
63    #[prop(custom)]
64    pub(crate) filter: Option<Signal<String>>,
65    /// Optional controlled ascending/descending sort toggle signal.
66    #[new(skip)]
67    #[get(skip)]
68    #[prop(custom)]
69    pub(crate) sort_ascending: Option<Signal<bool>>,
70    /// Optional controlled selected row index signal.
71    #[new(skip)]
72    #[get(skip)]
73    #[prop(custom)]
74    pub(crate) selected_row: Option<Signal<Option<usize>>>,
75    /// Active theme tokens.
76    #[get(type(copy))]
77    pub(crate) tokens: ThemeTokens,
78}
79
80/// Trigger button + popover calendar date picker (`ui.shadcn.com/docs/components/date-picker`).
81#[derive(Clone, Data, Debug, New, Props)]
82pub struct EuvDatePicker {
83    /// Month and year display label (e.g. `"November 2026"`).
84    pub(crate) month_label: String,
85    /// Controlled selected day of month (`1..=31`).
86    #[get(type(copy))]
87    pub(crate) selected_day: Signal<u32>,
88    /// Controlled popover open state.
89    #[get(type(copy))]
90    pub(crate) open: Signal<bool>,
91    /// Active theme tokens.
92    #[get(type(copy))]
93    pub(crate) tokens: ThemeTokens,
94}
95
96/// Input with leading/trailing visual addons (`ui.shadcn.com/docs/components/input-group`).
97#[derive(Clone, Data, Debug, New, Props)]
98pub struct EuvInputGroup {
99    /// Optional leading prefix addon text (e.g. `"https://"`).
100    #[new(skip)]
101    #[prop(custom)]
102    pub(crate) prefix: String,
103    /// Controlled input text signal.
104    #[get(type(copy))]
105    pub(crate) value: Signal<String>,
106    /// Optional placeholder text inside the input.
107    #[new(skip)]
108    #[prop(custom)]
109    pub(crate) placeholder: String,
110    /// Optional trailing suffix badge or unit text (e.g. `".dev"`).
111    #[new(skip)]
112    #[prop(custom)]
113    pub(crate) suffix: String,
114    /// Active theme tokens.
115    #[get(type(copy))]
116    pub(crate) tokens: ThemeTokens,
117}
118
119/// Rich list item row (`ui.shadcn.com/docs/components/item`).
120#[derive(Clone, CustomDebug, Data, New, Props)]
121pub struct EuvItem {
122    /// Optional leading short tag or avatar monogram.
123    #[new(skip)]
124    #[prop(custom)]
125    pub(crate) leading: String,
126    /// Primary item title.
127    pub(crate) title: String,
128    /// Optional secondary muted description.
129    #[new(skip)]
130    #[prop(custom)]
131    pub(crate) description: String,
132    /// Optional trailing metadata badge text.
133    #[new(skip)]
134    #[prop(custom)]
135    pub(crate) trailing: String,
136    /// Optional click handler.
137    #[new(skip)]
138    #[debug(skip)]
139    #[get(skip)]
140    #[prop(custom)]
141    pub(crate) on_click: Option<UiEventHandler>,
142    /// Active theme tokens.
143    #[get(type(copy))]
144    pub(crate) tokens: ThemeTokens,
145}
146
147/// Compact native-styled inline selector (`ui.shadcn.com/docs/components/native-select`).
148#[derive(Clone, Data, Debug, New, Props)]
149pub struct EuvNativeSelect {
150    /// Ordered selectable option labels.
151    pub(crate) options: Vec<String>,
152    /// Controlled selected index signal.
153    #[get(type(copy))]
154    pub(crate) selected: Signal<usize>,
155    /// Active theme tokens.
156    #[get(type(copy))]
157    pub(crate) tokens: ThemeTokens,
158}
159
160/// Top-level horizontal navigation menu (`ui.shadcn.com/docs/components/navigation-menu`).
161#[derive(Clone, Data, Debug, New, Props)]
162pub struct EuvNavigationMenu {
163    /// Ordered menu items `(label, detail_summary)`.
164    pub(crate) items: Vec<(String, String)>,
165    /// Controlled active expanded menu index.
166    #[get(type(copy))]
167    pub(crate) active: Signal<Option<usize>>,
168    /// Active theme tokens.
169    #[get(type(copy))]
170    pub(crate) tokens: ThemeTokens,
171}
172
173/// Draggable two-pane resizable split panel group (`ui.shadcn.com/docs/components/resizable`).
174#[derive(Clone, Data, Debug, New, Props)]
175pub struct EuvResizable {
176    /// Left panel node handle.
177    #[get(type(copy))]
178    pub(crate) left: NodeId,
179    /// Right panel node handle.
180    #[get(type(copy))]
181    pub(crate) right: NodeId,
182    /// Controlled split ratio in `[0.25, 0.75]`.
183    #[get(type(copy))]
184    pub(crate) split_ratio: Signal<f32>,
185    /// Active theme tokens.
186    #[get(type(copy))]
187    pub(crate) tokens: ThemeTokens,
188}
189
190/// Hairline separator with optional centered caption (`ui.shadcn.com/docs/components/separator`).
191#[derive(Clone, Data, Debug, New, Props)]
192pub struct EuvSeparator {
193    /// Optional inline label centered across the separator line.
194    pub(crate) label: String,
195    /// Active theme tokens.
196    #[get(type(copy))]
197    pub(crate) tokens: ThemeTokens,
198}
199
200/// Stacking rich Sonner toast deck with dismiss action (`ui.shadcn.com/docs/components/sonner`).
201#[derive(Clone, Data, Debug, New, Props)]
202pub struct EuvSonner {
203    /// Reactive stack of `(title, description)` toast entries.
204    #[get(type(copy))]
205    pub(crate) messages: Signal<Vec<(String, String)>>,
206    /// Active theme tokens.
207    #[get(type(copy))]
208    pub(crate) tokens: ThemeTokens,
209}
210
211/// Direction-aware container switching horizontal alignment cleanly between LTR and RTL (`ui.shadcn.com/docs/components/direction`).
212#[derive(Clone, Data, Debug, New, Props)]
213pub struct EuvDirection {
214    /// Active text direction mode.
215    #[get(type(copy))]
216    pub(crate) direction: EuvTextDirection,
217    /// Child content node handle.
218    #[get(type(copy))]
219    pub(crate) child: NodeId,
220    /// Active theme tokens.
221    #[get(type(copy))]
222    pub(crate) tokens: ThemeTokens,
223}
224
225/// Single execution span entry displayed inside `EuvTrace`.
226#[derive(Clone, Data, Debug, New, PartialEq)]
227pub struct EuvTraceSpan {
228    /// Span operation label (e.g. `"bvh.raytrace"`).
229    pub(crate) name: String,
230    /// Elapsed span duration in milliseconds.
231    #[get(type(copy))]
232    pub(crate) duration_ms: f32,
233    /// Relative start offset in `[0.0, 1.0]`.
234    #[get(type(copy))]
235    pub(crate) offset_frac: f32,
236    /// Relative width fraction in `[0.05, 1.0]`.
237    #[get(type(copy))]
238    pub(crate) width_frac: f32,
239    /// Semantic tone indicating healthy/warn/error status.
240    #[get(type(copy))]
241    pub(crate) tone: EuvTone,
242}
243
244/// Waterfall execution trace timeline (`ui.shadcn.com/docs/components/trace`).
245#[derive(Clone, Data, Debug, New, Props)]
246pub struct EuvTrace {
247    /// Trace header title.
248    pub(crate) title: String,
249    /// Ordered execution spans.
250    pub(crate) spans: Vec<EuvTraceSpan>,
251    /// Active theme tokens.
252    #[get(type(copy))]
253    pub(crate) tokens: ThemeTokens,
254}
255
256/// File or media attachment chip with size badge and optional remove callback (`ui.shadcn.com/docs/components/attachment`).
257#[derive(Clone, CustomDebug, Data, New, Props)]
258pub struct EuvAttachment {
259    /// Attachment file name.
260    pub(crate) filename: String,
261    /// Human-readable file size or MIME caption.
262    pub(crate) meta: String,
263    /// Reactive visibility signal set to `false` when removed.
264    #[get(type(copy))]
265    pub(crate) visible: Signal<bool>,
266    /// Active theme tokens.
267    #[get(type(copy))]
268    pub(crate) tokens: ThemeTokens,
269}
270
271/// Chat or assistant message bubble (`ui.shadcn.com/docs/components/bubble` / `message`).
272#[derive(Clone, Data, Debug, New, Props)]
273pub struct EuvBubble {
274    /// Sender display name.
275    pub(crate) author: String,
276    /// Message text body.
277    pub(crate) content: String,
278    /// Optional timestamp caption.
279    #[new(skip)]
280    #[prop(custom)]
281    pub(crate) timestamp: String,
282    /// When `true`, renders right-aligned primary outgoing bubble; otherwise left-aligned incoming surface.
283    #[new(skip)]
284    #[get(type(copy))]
285    #[prop(custom)]
286    pub(crate) outgoing: bool,
287    /// Active theme tokens.
288    #[get(type(copy))]
289    pub(crate) tokens: ThemeTokens,
290}
291
292/// Interactive status or annotation marker badge (`ui.shadcn.com/docs/components/marker`).
293#[derive(Clone, Data, Debug, New, Props)]
294pub struct EuvMarker {
295    /// Short marker index or code (e.g. `"01"`).
296    pub(crate) code: String,
297    /// Descriptive marker label.
298    pub(crate) label: String,
299    /// Semantic status tone.
300    #[get(type(copy))]
301    pub(crate) tone: EuvTone,
302    /// Active theme tokens.
303    #[get(type(copy))]
304    pub(crate) tokens: ThemeTokens,
305}
306
307/// Interactive single-choice questionnaire card (`ui.shadcn.com/docs/components/questionnaire`).
308#[derive(Clone, Data, Debug, New, Props)]
309pub struct EuvQuestionnaire {
310    /// Question prompt title.
311    pub(crate) prompt: String,
312    /// Selectable answer choices.
313    pub(crate) options: Vec<String>,
314    /// Controlled selected choice index signal.
315    #[get(type(copy))]
316    pub(crate) selected: Signal<Option<usize>>,
317    /// Active theme tokens.
318    #[get(type(copy))]
319    pub(crate) tokens: ThemeTokens,
320}
321
322/// Cross-platform context action menu (`ui.shadcn.com/docs/components/context-menu`) activated via click, secondary pointer button, or touch long-press.
323#[derive(Clone, Data, Debug, New, Props)]
324pub struct EuvContextMenu {
325    /// Trigger surface label displayed in the interactive target zone.
326    pub(crate) trigger_label: String,
327    /// Ordered context menu action labels.
328    pub(crate) items: Vec<String>,
329    /// Optional controlled menu open signal (creates internal state when omitted).
330    #[new(skip)]
331    #[get(skip)]
332    #[prop(custom)]
333    pub(crate) open: Option<Signal<bool>>,
334    /// Optional controlled last-selected action index signal.
335    #[new(skip)]
336    #[get(skip)]
337    #[prop(custom)]
338    pub(crate) selected: Option<Signal<Option<usize>>>,
339    /// Active theme tokens.
340    #[get(type(copy))]
341    pub(crate) tokens: ThemeTokens,
342}