uzor_core/widgets/button/defaults.rs
1//! Default parameters for button rendering
2//!
3//! ⚠️ **ВАЖНО / IMPORTANT** ⚠️
4//!
5//! ЭТО ЭКСПОРТНЫЕ ВАРИАНТЫ ДЛЯ БЫСТРОГО ПРОТОТИПИРОВАНИЯ НА ОСНОВЕ ЕНУМА!
6//! THIS IS FOR QUICK PROTOTYPING BASED ON THE ENUM CATALOG!
7//!
8//! Для конечной production реализации используйте КАСТОМНЫЕ ПАРАМЕТРЫ.
9//! For final production implementation, use CUSTOM PARAMETERS.
10//!
11//! Терминал (layout/render_ui.rs) НЕ использует эти дефолты - там кастомные значения.
12//! Terminal (layout/render_ui.rs) does NOT use these defaults - it has custom values.
13//!
14//! # Назначение / Purpose
15//!
16//! This module provides default sizes and prototype colors for each button variant.
17//! Prototype colors are fallback values used when theme is unavailable.
18//!
19//! # Архитектура / Architecture
20//!
21//! ```
22//! Enum (types.rs) → Defaults (THIS FILE) → Render (render.rs) → Production (custom)
23//! ↑ WHAT ↑ Fallback params ↑ Quick proto ↑ Full control
24//! ```
25
26// =============================================================================
27// Action::IconOnly Defaults
28// =============================================================================
29
30/// Default sizes for IconOnly action buttons
31pub struct IconOnlyDefaults {
32 pub icon_size: f64, // 16.0px (universal standard)
33 pub padding: f64, // 0.0px (no padding, icon only)
34 pub border_radius: f64, // 0.0px (transparent background)
35 pub hover_bg_radius: f64, // 4.0px (if hover background shown)
36 pub spacing_from_edge: f64, // 12.0px (distance from container edge)
37 pub icon_gap: f64, // 4.0-8.0px (gap between sequential icons)
38}
39
40impl Default for IconOnlyDefaults {
41 fn default() -> Self {
42 Self {
43 icon_size: 16.0,
44 padding: 0.0,
45 border_radius: 0.0,
46 hover_bg_radius: 4.0,
47 spacing_from_edge: 12.0,
48 icon_gap: 6.0,
49 }
50 }
51}
52
53/// Prototype colors for IconOnly action buttons (fallback when theme unavailable)
54pub struct IconOnlyPrototypeColors {
55 // Normal state
56 pub background_normal: &'static str, // "transparent"
57 pub icon_normal: &'static str, // "#787b86" (muted gray)
58
59 // Hover state
60 pub background_hover: &'static str, // "transparent" or "#2a2a2a"
61 pub icon_hover: &'static str, // "#e5e7eb" (bright gray)
62
63 // Active state (for toggle-like behavior)
64 pub background_active: &'static str, // "#1e3a5f" (blue-tinted)
65 pub icon_active: &'static str, // "#ffffff" (bright white)
66
67 // Disabled state
68 pub icon_disabled: &'static str, // "#4a4a4a" (very dim)
69}
70
71impl Default for IconOnlyPrototypeColors {
72 fn default() -> Self {
73 Self {
74 background_normal: "transparent",
75 icon_normal: "#787b86",
76 background_hover: "transparent",
77 icon_hover: "#e5e7eb",
78 background_active: "#1e3a5f",
79 icon_active: "#ffffff",
80 icon_disabled: "#4a4a4a",
81 }
82 }
83}
84
85// =============================================================================
86// Action::Text Defaults
87// =============================================================================
88
89/// Default sizes for Text action buttons
90pub struct TextDefaults {
91 pub height: f64, // 28.0px (standard button height)
92 pub min_width: f64, // 70.0px (minimum button width)
93 pub padding_x: f64, // 12.0px (horizontal text padding)
94 pub padding_y: f64, // 4.0px (vertical text padding)
95 pub font_size: f64, // 13.0px (text size)
96 pub border_radius: f64, // 4.0px (rounded corners)
97 pub border_width: f64, // 1.0px (border stroke)
98 pub button_gap: f64, // 8.0px (gap between buttons)
99}
100
101impl Default for TextDefaults {
102 fn default() -> Self {
103 Self {
104 height: 28.0,
105 min_width: 70.0,
106 padding_x: 12.0,
107 padding_y: 4.0,
108 font_size: 13.0,
109 border_radius: 4.0,
110 border_width: 1.0,
111 button_gap: 8.0,
112 }
113 }
114}
115
116/// Prototype colors for Text action buttons
117pub struct TextPrototypeColors {
118 // Normal state
119 pub background_normal: &'static str, // "transparent"
120 pub text_normal: &'static str, // "#d1d5db" (standard text)
121 pub border_normal: &'static str, // "#3a3a3a" (separator)
122
123 // Hover state
124 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
125 pub text_hover: &'static str, // "#d1d5db" (same as normal)
126 pub border_hover: &'static str, // "#e5e7eb" (brighter border)
127
128 // Pressed state
129 pub background_pressed: &'static str, // "#1e3a5f" (blue-tinted)
130 pub text_pressed: &'static str, // "#ffffff" (bright white)
131
132 // Disabled state
133 pub background_disabled: &'static str, // "#2a2a2a" (dim)
134 pub text_disabled: &'static str, // "#4a4a4a" (very dim)
135 pub border_disabled: &'static str, // "#3a3a3a" (separator)
136}
137
138impl Default for TextPrototypeColors {
139 fn default() -> Self {
140 Self {
141 background_normal: "transparent",
142 text_normal: "#d1d5db",
143 border_normal: "#3a3a3a",
144 background_hover: "#2a2a2a",
145 text_hover: "#d1d5db",
146 border_hover: "#e5e7eb",
147 background_pressed: "#1e3a5f",
148 text_pressed: "#ffffff",
149 background_disabled: "#2a2a2a",
150 text_disabled: "#4a4a4a",
151 border_disabled: "#3a3a3a",
152 }
153 }
154}
155
156// =============================================================================
157// Action::IconText Defaults
158// =============================================================================
159
160/// Default sizes for IconText action buttons
161pub struct IconTextDefaults {
162 pub height: f64, // 28.0px (standard button height)
163 pub min_width: f64, // 70.0px (minimum button width)
164 pub padding_x: f64, // 8.0px (horizontal padding)
165 pub padding_y: f64, // 4.0px (vertical padding)
166 pub icon_size: f64, // 16.0px (standard icon)
167 pub icon_text_gap: f64, // 6.0px (gap between icon and text)
168 pub font_size: f64, // 13.0px (text size)
169 pub border_radius: f64, // 4.0px (rounded corners)
170}
171
172impl Default for IconTextDefaults {
173 fn default() -> Self {
174 Self {
175 height: 28.0,
176 min_width: 70.0,
177 padding_x: 8.0,
178 padding_y: 4.0,
179 icon_size: 16.0,
180 icon_text_gap: 6.0,
181 font_size: 13.0,
182 border_radius: 4.0,
183 }
184 }
185}
186
187/// Prototype colors for IconText action buttons
188pub struct IconTextPrototypeColors {
189 // Primary style (default for IconText)
190 pub background_normal: &'static str, // "#2962ff" (primary blue)
191 pub background_hover: &'static str, // "#4080ff" (lighter blue)
192 pub text_normal: &'static str, // "#ffffff" (white)
193 pub icon_normal: &'static str, // "#ffffff" (white)
194
195 // Disabled state
196 pub background_disabled: &'static str, // "#2a2a2a" (dim)
197 pub text_disabled: &'static str, // "#4a4a4a" (very dim)
198 pub icon_disabled: &'static str, // "#4a4a4a" (very dim)
199}
200
201impl Default for IconTextPrototypeColors {
202 fn default() -> Self {
203 Self {
204 background_normal: "#2962ff",
205 background_hover: "#4080ff",
206 text_normal: "#ffffff",
207 icon_normal: "#ffffff",
208 background_disabled: "#2a2a2a",
209 text_disabled: "#4a4a4a",
210 icon_disabled: "#4a4a4a",
211 }
212 }
213}
214
215// =============================================================================
216// Action::LineText Defaults
217// =============================================================================
218
219/// Default sizes for LineText action buttons
220pub struct LineTextDefaults {
221 pub width: f64, // 36.0px (wider than standard to fit line)
222 pub height: f64, // 28.0px (standard toolbar button)
223 pub line_length_ratio: f64, // 0.6 (line length = width * 0.6)
224 pub line_offset_y: f64, // -8.0px (line above center)
225 pub number_offset_y: f64, // 6.0px (number below line)
226 pub number_font_size: f64, // 11.0px (small number text)
227 pub border_radius: f64, // 4.0px (rounded corners)
228}
229
230impl Default for LineTextDefaults {
231 fn default() -> Self {
232 Self {
233 width: 36.0,
234 height: 28.0,
235 line_length_ratio: 0.6,
236 line_offset_y: -8.0,
237 number_offset_y: 6.0,
238 number_font_size: 11.0,
239 border_radius: 4.0,
240 }
241 }
242}
243
244/// Prototype colors for LineText action buttons
245pub struct LineTextPrototypeColors {
246 // Normal state
247 pub background_normal: &'static str, // "transparent"
248 pub line_normal: &'static str, // "#787b86" (muted gray)
249 pub text_normal: &'static str, // "#787b86" (muted gray)
250
251 // Hover state
252 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
253 pub line_hover: &'static str, // "#ffffff" (bright white)
254 pub text_hover: &'static str, // "#ffffff" (bright white)
255
256 // Active state (selected width)
257 pub background_active: &'static str, // "#2962ff" (accent blue)
258 pub line_active: &'static str, // "#ffffff" (bright white)
259 pub text_active: &'static str, // "#ffffff" (bright white)
260
261 // Pressed state
262 pub background_pressed: &'static str, // "#1e3a5f" (blue-tinted)
263 pub line_pressed: &'static str, // "#ffffff" (bright white)
264 pub text_pressed: &'static str, // "#ffffff" (bright white)
265
266 // Disabled state
267 pub background_disabled: &'static str, // "transparent"
268 pub line_disabled: &'static str, // "#4a4a4a" (very dim)
269 pub text_disabled: &'static str, // "#4a4a4a" (very dim)
270}
271
272impl Default for LineTextPrototypeColors {
273 fn default() -> Self {
274 Self {
275 background_normal: "transparent",
276 line_normal: "#787b86",
277 text_normal: "#787b86",
278 background_hover: "#2a2a2a",
279 line_hover: "#ffffff",
280 text_hover: "#ffffff",
281 background_active: "#2962ff",
282 line_active: "#ffffff",
283 text_active: "#ffffff",
284 background_pressed: "#1e3a5f",
285 line_pressed: "#ffffff",
286 text_pressed: "#ffffff",
287 background_disabled: "transparent",
288 line_disabled: "#4a4a4a",
289 text_disabled: "#4a4a4a",
290 }
291 }
292}
293
294// =============================================================================
295// Action::CheckboxText Defaults
296// =============================================================================
297
298/// Default sizes for CheckboxText action buttons
299pub struct CheckboxTextDefaults {
300 pub height: f64, // 28.0px (standard button height)
301 pub padding_x: f64, // 8.0px (horizontal padding)
302 pub padding_y: f64, // 4.0px (vertical padding)
303 pub checkbox_size: f64, // 16.0px (checkbox square)
304 pub checkbox_text_gap: f64, // 6.0px (gap between checkbox and text)
305 pub font_size: f64, // 12.0px (text size)
306 pub border_radius: f64, // 4.0px (rounded corners)
307 pub button_margin: f64, // 4.0px (margin between buttons)
308}
309
310impl Default for CheckboxTextDefaults {
311 fn default() -> Self {
312 Self {
313 height: 28.0,
314 padding_x: 8.0,
315 padding_y: 4.0,
316 checkbox_size: 16.0,
317 checkbox_text_gap: 6.0,
318 font_size: 12.0,
319 border_radius: 4.0,
320 button_margin: 4.0,
321 }
322 }
323}
324
325/// Prototype colors for CheckboxText action buttons
326pub struct CheckboxTextPrototypeColors {
327 // Normal state (unchecked)
328 pub background_normal: &'static str, // "#1e222d" (toolbar bg)
329 pub text_normal: &'static str, // "#787b86" (muted text)
330 pub checkbox_bg: &'static str, // "transparent"
331 pub checkbox_border: &'static str, // "#3a3a3a" (separator)
332
333 // Hover state
334 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
335 pub text_hover: &'static str, // "#e5e7eb" (bright text)
336
337 // Active state (checked/selected)
338 pub background_active: &'static str, // "#1e3a5f" (blue-tinted)
339 pub text_active: &'static str, // "#ffffff" (bright white)
340 pub checkbox_bg_active: &'static str, // "#2962ff" (accent blue)
341 pub checkbox_check_active: &'static str, // "#ffffff" (white checkmark)
342 pub border_active: &'static str, // "#2962ff" (focused border)
343
344 // Disabled state
345 pub background_disabled: &'static str, // "#2a2a2a" (dim)
346 pub text_disabled: &'static str, // "#4a4a4a" (very dim)
347}
348
349impl Default for CheckboxTextPrototypeColors {
350 fn default() -> Self {
351 Self {
352 background_normal: "#1e222d",
353 text_normal: "#787b86",
354 checkbox_bg: "transparent",
355 checkbox_border: "#3a3a3a",
356 background_hover: "#2a2a2a",
357 text_hover: "#e5e7eb",
358 background_active: "#1e3a5f",
359 text_active: "#ffffff",
360 checkbox_bg_active: "#2962ff",
361 checkbox_check_active: "#ffffff",
362 border_active: "#2962ff",
363 background_disabled: "#2a2a2a",
364 text_disabled: "#4a4a4a",
365 }
366 }
367}
368
369// =============================================================================
370// Toggle::IconSwap Defaults
371// =============================================================================
372
373/// Default sizes for IconSwap toggle buttons
374pub struct IconSwapDefaults {
375 pub icon_size: f64, // 16.0px (standard icon)
376 pub padding: f64, // 0.0px (no padding)
377 pub button_area: f64, // 16.0px (icon size only)
378 pub icon_gap: f64, // 4.0px (gap between sequential icons)
379}
380
381impl Default for IconSwapDefaults {
382 fn default() -> Self {
383 Self {
384 icon_size: 16.0,
385 padding: 0.0,
386 button_area: 16.0,
387 icon_gap: 4.0,
388 }
389 }
390}
391
392/// Prototype colors for IconSwap toggle buttons
393pub struct IconSwapPrototypeColors {
394 // Normal state (both ON and OFF)
395 pub background: &'static str, // "transparent" (no background change)
396 pub icon_off: &'static str, // "#787b86" (muted gray)
397 pub icon_on: &'static str, // "#787b86" (same - only icon changes)
398
399 // Hover state
400 pub background_hover: &'static str, // "#2a2a2a" (optional, context-dependent)
401 pub icon_hover: &'static str, // "#e5e7eb" (brighter)
402
403 // Disabled state
404 pub icon_disabled: &'static str, // "#4a4a4a" (very dim)
405}
406
407impl Default for IconSwapPrototypeColors {
408 fn default() -> Self {
409 Self {
410 background: "transparent",
411 icon_off: "#787b86",
412 icon_on: "#787b86",
413 background_hover: "#2a2a2a",
414 icon_hover: "#e5e7eb",
415 icon_disabled: "#4a4a4a",
416 }
417 }
418}
419
420// =============================================================================
421// Toggle::ButtonToggle Defaults
422// =============================================================================
423
424/// Default sizes for ButtonToggle toggle buttons
425pub struct ButtonToggleDefaults {
426 pub button_size: f64, // 28.0px (square or height)
427 pub icon_size: f64, // 16.0px (standard icon)
428 pub padding: f64, // 4.0-6.0px (padding around icon)
429 pub border_radius: f64, // 3.0-4.0px (rounded corners)
430 pub active_border_width: f64, // 3.0px (left accent bar)
431}
432
433impl Default for ButtonToggleDefaults {
434 fn default() -> Self {
435 Self {
436 button_size: 28.0,
437 icon_size: 16.0,
438 padding: 6.0,
439 border_radius: 4.0,
440 active_border_width: 3.0,
441 }
442 }
443}
444
445/// Prototype colors for ButtonToggle toggle buttons
446pub struct ButtonTogglePrototypeColors {
447 // Normal state (OFF)
448 pub background_off: &'static str, // "transparent" or toolbar_bg
449 pub icon_off: &'static str, // "#787b86" (muted gray)
450 pub border_off: &'static str, // "transparent" or separator
451
452 // Normal state (ON)
453 pub background_on: &'static str, // "#1e3a5f" (blue-tinted active)
454 pub icon_on: &'static str, // "#ffffff" (bright white)
455 pub border_on: &'static str, // "#2962ff" (accent, 3px left bar)
456
457 // Hover state (OFF)
458 pub background_hover_off: &'static str, // "#2a2a2a" (subtle hover)
459 pub icon_hover_off: &'static str, // "#e5e7eb" (brighter)
460
461 // Hover state (ON)
462 pub background_hover_on: &'static str, // "#2655cc" (brighter active)
463 pub icon_hover_on: &'static str, // "#ffffff" (bright white)
464
465 // Disabled state
466 pub background_disabled: &'static str, // "transparent"
467 pub icon_disabled: &'static str, // "#4a4a4a" (very dim)
468}
469
470impl Default for ButtonTogglePrototypeColors {
471 fn default() -> Self {
472 Self {
473 background_off: "transparent",
474 icon_off: "#787b86",
475 border_off: "transparent",
476 background_on: "#1e3a5f",
477 icon_on: "#ffffff",
478 border_on: "#2962ff",
479 background_hover_off: "#2a2a2a",
480 icon_hover_off: "#e5e7eb",
481 background_hover_on: "#2655cc",
482 icon_hover_on: "#ffffff",
483 background_disabled: "transparent",
484 icon_disabled: "#4a4a4a",
485 }
486 }
487}
488
489// =============================================================================
490// Checkbox::Standard Defaults
491// =============================================================================
492
493/// Default sizes for standard checkboxes
494pub struct CheckboxDefaults {
495 pub checkbox_size: f64, // 16.0px × 16.0px (square)
496 pub border_radius: f64, // 3.0px (rounded corners)
497 pub border_width: f64, // 1.0px (border stroke)
498 pub checkmark_size: f64, // 10.0px (checkmark icon)
499 pub row_height: f64, // 32.0px (when in settings row)
500 pub label_offset_x: f64, // 12.0px (gap between checkbox and label)
501}
502
503impl Default for CheckboxDefaults {
504 fn default() -> Self {
505 Self {
506 checkbox_size: 16.0,
507 border_radius: 3.0,
508 border_width: 1.0,
509 checkmark_size: 10.0,
510 row_height: 32.0,
511 label_offset_x: 12.0,
512 }
513 }
514}
515
516/// Prototype colors for standard checkboxes
517pub struct CheckboxPrototypeColors {
518 // Normal state (unchecked)
519 pub background_unchecked: &'static str, // "transparent" or toolbar_bg
520 pub border_unchecked: &'static str, // "#3a3a3a" (separator)
521
522 // Normal state (checked)
523 pub background_checked: &'static str, // "#2962ff" (accent blue)
524 pub border_checked: &'static str, // "#2962ff" (accent blue)
525 pub checkmark: &'static str, // "#ffffff" (white ✓)
526
527 // Hover state (unchecked)
528 pub background_hover_unchecked: &'static str, // "#2a2a2a" (subtle hover)
529 pub border_hover_unchecked: &'static str, // "#e5e7eb" (brighter border)
530
531 // Hover state (checked)
532 pub background_hover_checked: &'static str, // "#4080ff" (lighter blue)
533 pub border_hover_checked: &'static str, // "#4080ff" (lighter blue)
534
535 // Disabled state
536 pub background_disabled: &'static str, // "#2a2a2a" (dim)
537 pub border_disabled: &'static str, // "#3a3a3a" (separator)
538 pub checkmark_disabled: &'static str, // "#4a4a4a" (dim checkmark if checked)
539}
540
541impl Default for CheckboxPrototypeColors {
542 fn default() -> Self {
543 Self {
544 background_unchecked: "transparent",
545 border_unchecked: "#3a3a3a",
546 background_checked: "#2962ff",
547 border_checked: "#2962ff",
548 checkmark: "#ffffff",
549 background_hover_unchecked: "#2a2a2a",
550 border_hover_unchecked: "#e5e7eb",
551 background_hover_checked: "#4080ff",
552 border_hover_checked: "#4080ff",
553 background_disabled: "#2a2a2a",
554 border_disabled: "#3a3a3a",
555 checkmark_disabled: "#4a4a4a",
556 }
557 }
558}
559
560// =============================================================================
561// Tab::Vertical Defaults
562// =============================================================================
563
564/// Default sizes for vertical tabs
565pub struct VerticalTabDefaults {
566 pub tab_width: f64, // 60.0-80.0px (sidebar width)
567 pub tab_height: f64, // 40.0-44.0px (tab height)
568 pub icon_size: f64, // 20.0px (larger than standard)
569 pub active_bar_width: f64, // 3.0px (left accent bar)
570 pub icon_centering_offset: f64, // (sidebar_width - icon_size) / 2.0
571}
572
573impl Default for VerticalTabDefaults {
574 fn default() -> Self {
575 Self {
576 tab_width: 70.0,
577 tab_height: 44.0,
578 icon_size: 20.0,
579 active_bar_width: 3.0,
580 icon_centering_offset: 25.0, // (70 - 20) / 2
581 }
582 }
583}
584
585/// Prototype colors for vertical tabs
586pub struct VerticalTabPrototypeColors {
587 // Normal state (inactive)
588 pub background_inactive: &'static str, // "transparent" or toolbar_bg
589 pub icon_inactive: &'static str, // "#787b86" (muted gray)
590
591 // Active state
592 pub background_active: &'static str, // "#1e3a5f" (blue-tinted)
593 pub icon_active: &'static str, // "#ffffff" (bright white)
594 pub bar_active: &'static str, // "#2962ff" (accent, 3px left bar)
595
596 // Hover state (inactive)
597 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
598 pub icon_hover: &'static str, // "#e5e7eb" (brighter)
599}
600
601impl Default for VerticalTabPrototypeColors {
602 fn default() -> Self {
603 Self {
604 background_inactive: "transparent",
605 icon_inactive: "#787b86",
606 background_active: "#1e3a5f",
607 icon_active: "#ffffff",
608 bar_active: "#2962ff",
609 background_hover: "#2a2a2a",
610 icon_hover: "#e5e7eb",
611 }
612 }
613}
614
615// =============================================================================
616// Tab::Horizontal Defaults
617// =============================================================================
618
619/// Default sizes for horizontal tabs
620pub struct HorizontalTabDefaults {
621 pub tab_height: f64, // 32.0px (tab height)
622 pub padding_x: f64, // 12.0px (horizontal text padding)
623 pub tab_gap: f64, // 2.0px (gap between tabs)
624 pub font_size: f64, // 13.0px (text size)
625 pub border_radius: f64, // 0.0px (rectangular tabs)
626 pub underline_height: f64, // 2.0px (bottom underline)
627}
628
629impl Default for HorizontalTabDefaults {
630 fn default() -> Self {
631 Self {
632 tab_height: 32.0,
633 padding_x: 12.0,
634 tab_gap: 2.0,
635 font_size: 13.0,
636 border_radius: 0.0,
637 underline_height: 2.0,
638 }
639 }
640}
641
642/// Prototype colors for horizontal tabs
643pub struct HorizontalTabPrototypeColors {
644 // Normal state (inactive)
645 pub background_inactive: &'static str, // "transparent"
646 pub text_inactive: &'static str, // "#787b86" (muted text)
647 pub border_bottom: &'static str, // "#3a3a3a" (shared separator line)
648
649 // Active state
650 pub background_active: &'static str, // "#1e3a5f" (full background fill)
651 pub text_active: &'static str, // "#ffffff" (bright white)
652
653 // Hover state (inactive)
654 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
655 pub text_hover: &'static str, // "#787b86" (same as inactive)
656}
657
658impl Default for HorizontalTabPrototypeColors {
659 fn default() -> Self {
660 Self {
661 background_inactive: "transparent",
662 text_inactive: "#787b86",
663 border_bottom: "#3a3a3a",
664 background_active: "#1e3a5f",
665 text_active: "#ffffff",
666 background_hover: "#2a2a2a",
667 text_hover: "#787b86",
668 }
669 }
670}
671
672// =============================================================================
673// ColorSwatch::Square Defaults
674// =============================================================================
675
676/// Default sizes for square color swatches
677pub struct ColorSwatchSquareDefaults {
678 pub swatch_size: f64, // 24.0px × 24.0px (square)
679 pub border_radius: f64, // 4.0px (rounded corners)
680 pub border_width: f64, // 1.0px (border stroke)
681 pub swatch_gap: f64, // 8.0px (gap between swatches)
682 pub row_height: f64, // 32.0px (when in settings row)
683}
684
685impl Default for ColorSwatchSquareDefaults {
686 fn default() -> Self {
687 Self {
688 swatch_size: 24.0,
689 border_radius: 4.0,
690 border_width: 1.0,
691 swatch_gap: 8.0,
692 row_height: 32.0,
693 }
694 }
695}
696
697/// Prototype colors for square color swatches
698pub struct ColorSwatchSquarePrototypeColors {
699 // Border colors (background is the color value itself)
700 pub border_normal: &'static str, // "#3a3a3a" (separator)
701 pub border_hover: &'static str, // "#e5e7eb" (brighter, 2px)
702 pub border_active: &'static str, // "#2962ff" (accent, 2px)
703 pub border_disabled: &'static str, // "#3a3a3a" (separator)
704}
705
706impl Default for ColorSwatchSquarePrototypeColors {
707 fn default() -> Self {
708 Self {
709 border_normal: "#3a3a3a",
710 border_hover: "#e5e7eb",
711 border_active: "#2962ff",
712 border_disabled: "#3a3a3a",
713 }
714 }
715}
716
717// =============================================================================
718// ColorSwatch::IconWithBar Defaults
719// =============================================================================
720
721/// Default sizes for icon with color bar swatches
722pub struct ColorSwatchIconBarDefaults {
723 pub button_size: f64, // 24.0px × 24.0px (button area)
724 pub icon_size: f64, // 16.0px (standard icon)
725 pub icon_padding: f64, // 4.0px (padding from edges)
726 pub bar_width: f64, // 16.0px (button_size - 8px)
727 pub bar_height: f64, // 3.0px (color bar height)
728 pub bar_position_y: f64, // 18.0px (button_size - 6px)
729 pub bar_padding_x: f64, // 4.0px (from left/right edges)
730}
731
732impl Default for ColorSwatchIconBarDefaults {
733 fn default() -> Self {
734 Self {
735 button_size: 24.0,
736 icon_size: 16.0,
737 icon_padding: 4.0,
738 bar_width: 16.0,
739 bar_height: 3.0,
740 bar_position_y: 18.0,
741 bar_padding_x: 4.0,
742 }
743 }
744}
745
746/// Prototype colors for icon with color bar swatches
747pub struct ColorSwatchIconBarPrototypeColors {
748 // Normal state
749 pub background_normal: &'static str, // "transparent"
750 pub icon_normal: &'static str, // "#787b86" (muted gray)
751
752 // Hover state
753 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
754 pub icon_hover: &'static str, // "#e5e7eb" (brighter)
755
756 // Active state
757 pub background_active: &'static str, // "#1e3a5f" (blue-tinted)
758 pub icon_active: &'static str, // "#ffffff" (bright white)
759}
760
761impl Default for ColorSwatchIconBarPrototypeColors {
762 fn default() -> Self {
763 Self {
764 background_normal: "transparent",
765 icon_normal: "#787b86",
766 background_hover: "#2a2a2a",
767 icon_hover: "#e5e7eb",
768 background_active: "#1e3a5f",
769 icon_active: "#ffffff",
770 }
771 }
772}
773
774// =============================================================================
775// Dropdown::TextChevron Defaults
776// =============================================================================
777
778/// Default sizes for text+chevron dropdowns
779pub struct DropdownTextChevronDefaults {
780 pub width: f64, // 140.0px (total dropdown width)
781 pub height: f64, // 28.0px (standard height)
782 pub chevron_area_width: f64, // 20.0px (right chevron area)
783 pub text_area_width: f64, // 120.0px (left text area, width - chevron_area)
784 pub text_padding_x: f64, // 8.0px (text padding from left)
785 pub chevron_size: f64, // 6.0px × 6.0px (chevron triangle)
786 pub separator_width: f64, // 1.0px (vertical separator)
787 pub border_radius: f64, // 4.0px (rounded corners)
788 pub border_width: f64, // 1.0px (border stroke)
789}
790
791impl Default for DropdownTextChevronDefaults {
792 fn default() -> Self {
793 Self {
794 width: 140.0,
795 height: 28.0,
796 chevron_area_width: 20.0,
797 text_area_width: 120.0,
798 text_padding_x: 8.0,
799 chevron_size: 6.0,
800 separator_width: 1.0,
801 border_radius: 4.0,
802 border_width: 1.0,
803 }
804 }
805}
806
807/// Prototype colors for text+chevron dropdowns
808pub struct DropdownTextChevronPrototypeColors {
809 // Normal state
810 pub background_normal: &'static str, // "#1e222d" (modal/content bg)
811 pub text_normal: &'static str, // "#d1d5db" (standard text)
812 pub chevron_normal: &'static str, // "#d1d5db" (standard text)
813 pub border_normal: &'static str, // "#3a3a3a" (separator)
814 pub separator: &'static str, // "#3a3a3a" (vertical separator)
815
816 // Hover state
817 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
818 pub text_hover: &'static str, // "#d1d5db" (same)
819 pub chevron_hover: &'static str, // "#d1d5db" (same)
820 pub border_hover: &'static str, // "#e5e7eb" (brighter)
821
822 // Active/Open state
823 pub background_active: &'static str, // "#1e3a5f" (blue-tinted)
824 pub text_active: &'static str, // "#ffffff" (bright white)
825 pub chevron_active: &'static str, // "#ffffff" (bright white)
826 pub border_active: &'static str, // "#2962ff" (accent)
827
828 // Disabled state
829 pub background_disabled: &'static str, // "#2a2a2a" (dim)
830 pub text_disabled: &'static str, // "#4a4a4a" (very dim)
831 pub chevron_disabled: &'static str, // "#4a4a4a" (very dim)
832 pub border_disabled: &'static str, // "#3a3a3a" (separator)
833}
834
835impl Default for DropdownTextChevronPrototypeColors {
836 fn default() -> Self {
837 Self {
838 background_normal: "#1e222d",
839 text_normal: "#d1d5db",
840 chevron_normal: "#d1d5db",
841 border_normal: "#3a3a3a",
842 separator: "#3a3a3a",
843 background_hover: "#2a2a2a",
844 text_hover: "#d1d5db",
845 chevron_hover: "#d1d5db",
846 border_hover: "#e5e7eb",
847 background_active: "#1e3a5f",
848 text_active: "#ffffff",
849 chevron_active: "#ffffff",
850 border_active: "#2962ff",
851 background_disabled: "#2a2a2a",
852 text_disabled: "#4a4a4a",
853 chevron_disabled: "#4a4a4a",
854 border_disabled: "#3a3a3a",
855 }
856 }
857}
858
859// =============================================================================
860// Dropdown::ChevronOnly Defaults
861// =============================================================================
862
863/// Default sizes for chevron-only dropdowns
864pub struct DropdownChevronOnlyDefaults {
865 pub button_width: f64, // 24.0-28.0px (padding + chevron)
866 pub button_height: f64, // 24.0-28.0px (standard height)
867 pub chevron_size: f64, // 12.0-16.0px (chevron icon)
868 pub padding_x: f64, // 4.0-6.0px (horizontal padding)
869 pub border_radius: f64, // 3.0-4.0px (rounded corners)
870 pub border_width: f64, // 0.5px (subtle border)
871}
872
873impl Default for DropdownChevronOnlyDefaults {
874 fn default() -> Self {
875 Self {
876 button_width: 24.0,
877 button_height: 24.0,
878 chevron_size: 12.0,
879 padding_x: 6.0,
880 border_radius: 3.0,
881 border_width: 0.5,
882 }
883 }
884}
885
886/// Prototype colors for chevron-only dropdowns
887pub struct DropdownChevronOnlyPrototypeColors {
888 // Normal state
889 pub background_normal: &'static str, // "transparent"
890 pub chevron_normal: &'static str, // "#787b86" with 0.7 opacity
891 pub border_normal: &'static str, // "#3a3a3a" with 0.8 opacity
892
893 // Hover state
894 pub background_hover: &'static str, // "#2a2a2a" (subtle hover)
895 pub chevron_hover: &'static str, // "#e5e7eb" (brighter)
896 pub border_hover: &'static str, // "#3a3a3a" with 0.8 opacity (same)
897
898 // Active/Pressed state
899 pub background_active: &'static str, // "#1e3a5f" (blue-tinted)
900 pub chevron_active: &'static str, // "#ffffff" (bright white)
901
902 // Disabled state
903 pub background_disabled: &'static str, // "transparent"
904 pub chevron_disabled: &'static str, // "#4a4a4a" with opacity
905}
906
907impl Default for DropdownChevronOnlyPrototypeColors {
908 fn default() -> Self {
909 Self {
910 background_normal: "transparent",
911 chevron_normal: "#787b86", // with 0.7 opacity applied at render
912 border_normal: "#3a3a3a", // with 0.8 opacity applied at render
913 background_hover: "#2a2a2a",
914 chevron_hover: "#e5e7eb",
915 border_hover: "#3a3a3a",
916 background_active: "#1e3a5f",
917 chevron_active: "#ffffff",
918 background_disabled: "transparent",
919 chevron_disabled: "#4a4a4a",
920 }
921 }
922}