Skip to main content

repose_material/material3/
defaults.rs

1use repose_core::*;
2
3/// Default values for surface component.
4pub struct SurfaceDefaults;
5
6impl SurfaceDefaults {
7    pub fn color() -> Color {
8        theme().surface
9    }
10    pub fn content_color() -> Color {
11        theme().on_surface
12    }
13    pub const SHAPE_RADIUS: f32 = 0.0;
14    pub const TONAL_ELEVATION: f32 = 0.0;
15    pub const SHADOW_ELEVATION: f32 = 0.0;
16}
17
18/// Default values for toggle button components.
19pub struct ToggleButtonDefaults;
20
21impl ToggleButtonDefaults {
22    pub const HEIGHT: f32 = 40.0;
23    pub const HORIZONTAL_PADDING: f32 = 24.0;
24    pub const SHAPE_RADIUS: f32 = 20.0;
25    pub fn content_color() -> Color {
26        theme().on_surface_variant
27    }
28    pub fn checked_container_color() -> Color {
29        theme().primary
30    }
31    pub fn checked_content_color() -> Color {
32        theme().on_primary
33    }
34    pub fn tonal_content_color() -> Color {
35        theme().on_surface_variant
36    }
37    pub fn tonal_checked_container_color() -> Color {
38        theme().secondary_container
39    }
40    pub fn tonal_checked_content_color() -> Color {
41        theme().on_secondary_container
42    }
43    pub fn outlined_content_color() -> Color {
44        theme().on_surface_variant
45    }
46    pub fn outlined_border_color() -> Color {
47        theme().outline
48    }
49    pub fn outlined_checked_container_color() -> Color {
50        theme().secondary_container
51    }
52    pub fn outlined_checked_content_color() -> Color {
53        theme().on_secondary_container
54    }
55    pub fn elevated_content_color() -> Color {
56        theme().primary
57    }
58    pub fn elevated_checked_container_color() -> Color {
59        theme().surface_container_low
60    }
61    pub fn elevated_checked_content_color() -> Color {
62        theme().primary
63    }
64    pub fn state_colors_default() -> StateColors {
65        let th = theme();
66        StateColors {
67            default: Color::TRANSPARENT,
68            hovered: Color::TRANSPARENT,
69            focused: Color::TRANSPARENT,
70            pressed: Color::TRANSPARENT,
71            dragged: th.on_surface.with_alpha_f32(0.12),
72            disabled: th.on_surface.with_alpha_f32(0.12),
73        }
74    }
75    pub fn state_elevation_default() -> StateElevation {
76        StateElevation {
77            default: 0.0,
78            hovered: 1.0,
79            focused: 0.0,
80            pressed: 0.0,
81            dragged: 0.0,
82            disabled: 0.0,
83        }
84    }
85    pub fn elevated_state_elevation() -> StateElevation {
86        let th = theme();
87        StateElevation {
88            default: th.elevation.level1,
89            hovered: th.elevation.level2,
90            focused: th.elevation.level1,
91            pressed: th.elevation.level1,
92            dragged: th.elevation.level1,
93            disabled: 0.0,
94        }
95    }
96}
97
98/// Default values for progress indicator components.
99pub struct ProgressIndicatorDefaults;
100
101impl ProgressIndicatorDefaults {
102    pub fn linear_color() -> Color {
103        theme().primary
104    }
105    pub fn linear_track_color() -> Color {
106        theme().secondary_container
107    }
108    pub const LINEAR_INDICATOR_HEIGHT: f32 = 4.0;
109    pub const LINEAR_INDICATOR_GAP_SIZE: f32 = 4.0;
110    pub const LINEAR_TRACK_STOP_SIZE: f32 = 4.0;
111
112    pub fn circular_color() -> Color {
113        theme().primary
114    }
115    pub fn circular_track_color() -> Color {
116        theme().secondary_container
117    }
118    pub const CIRCULAR_INDICATOR_SIZE: f32 = 40.0;
119    pub const CIRCULAR_STROKE_WIDTH: f32 = 4.0;
120
121    /// M3 `ActiveHandleLeadingSpace` / `ActiveHandleTrailingSpace`
122    pub const SLIDER_THUMB_TRACK_GAP: f32 = 6.0;
123}
124
125/// Default values for button components.
126pub struct ButtonDefaults;
127
128impl ButtonDefaults {
129    pub fn content_color() -> Color {
130        theme().on_primary
131    }
132    pub fn container_color() -> Color {
133        theme().primary
134    }
135    pub fn tonal_container_color() -> Color {
136        theme().secondary_container
137    }
138    pub fn tonal_content_color() -> Color {
139        theme().on_secondary_container
140    }
141    pub fn elevated_container_color() -> Color {
142        theme().surface_container_low
143    }
144    pub fn elevated_content_color() -> Color {
145        theme().primary
146    }
147    pub fn outlined_content_color() -> Color {
148        theme().on_surface_variant
149    }
150    pub fn outlined_border_color() -> Color {
151        theme().outline_variant
152    }
153    pub fn text_content_color() -> Color {
154        theme().primary
155    }
156    pub const HEIGHT: f32 = 40.0;
157    pub const HORIZONTAL_PADDING: f32 = 24.0;
158    pub const TEXT_HORIZONTAL_PADDING: f32 = 12.0;
159    pub const SHAPE_RADIUS: f32 = 20.0;
160    pub fn state_colors_default() -> StateColors {
161        let th = theme();
162        StateColors {
163            default: Color::TRANSPARENT,
164            hovered: Color::TRANSPARENT,
165            focused: Color::TRANSPARENT,
166            pressed: Color::TRANSPARENT,
167            dragged: th.on_surface.with_alpha_f32(0.12),
168            disabled: th.on_surface.with_alpha_f32(0.12),
169        }
170    }
171    pub fn state_elevation_default() -> StateElevation {
172        StateElevation {
173            default: 0.0,
174            hovered: 1.0,
175            focused: 0.0,
176            pressed: 0.0,
177            dragged: 0.0,
178            disabled: 0.0,
179        }
180    }
181    pub fn elevated_state_elevation() -> StateElevation {
182        let th = theme();
183        StateElevation {
184            default: th.elevation.level1,
185            hovered: th.elevation.level2,
186            focused: th.elevation.level1,
187            pressed: th.elevation.level1,
188            dragged: th.elevation.level1,
189            disabled: 0.0,
190        }
191    }
192}
193
194/// Default values for snackbar components.
195pub struct SnackbarDefaults;
196
197impl SnackbarDefaults {
198    pub const MIN_HEIGHT: f32 = 48.0;
199    pub const MIN_WIDTH: f32 = 280.0;
200    pub const MAX_WIDTH: f32 = 600.0;
201    pub const SHAPE_RADIUS: f32 = 4.0;
202    pub fn container_color() -> Color {
203        theme().inverse_surface
204    }
205    pub fn content_color() -> Color {
206        theme().inverse_on_surface
207    }
208    pub fn action_color() -> Color {
209        theme().inverse_primary
210    }
211    pub fn dismiss_action_content_color() -> Color {
212        theme().inverse_on_surface
213    }
214}
215
216/// Default values for card components.
217pub struct CardDefaults;
218
219impl CardDefaults {
220    pub fn filled_container_color() -> Color {
221        theme().surface_container_highest
222    }
223    pub fn elevated_container_color() -> Color {
224        theme().surface_container_low
225    }
226    pub fn outlined_container_color() -> Color {
227        theme().surface
228    }
229    pub fn outlined_border_color() -> Color {
230        theme().outline_variant
231    }
232    pub fn filled_content_color() -> Color {
233        theme().on_surface
234    }
235    pub fn elevated_content_color() -> Color {
236        theme().on_surface
237    }
238    pub fn outlined_content_color() -> Color {
239        theme().on_surface
240    }
241    pub fn disabled_container_color() -> Color {
242        theme().on_surface.with_alpha_f32(0.04)
243    }
244    pub fn disabled_content_color() -> Color {
245        theme().on_surface.with_alpha_f32(0.38)
246    }
247    pub const SHAPE_RADIUS: f32 = 12.0;
248    pub const ELEVATION: f32 = 0.0;
249}
250
251/// Default values for dialog components.
252pub struct DialogDefaults;
253
254impl DialogDefaults {
255    pub fn container_color() -> Color {
256        theme().surface_container_high
257    }
258    pub const SHAPE_RADIUS: f32 = 28.0;
259    pub const MIN_WIDTH: f32 = 280.0;
260    pub const MAX_WIDTH: f32 = 560.0;
261    pub const HORIZONTAL_PADDING: f32 = 24.0;
262}
263
264/// Default values for icon button components.
265pub struct IconButtonDefaults;
266
267impl IconButtonDefaults {
268    pub const CONTAINER_SIZE: f32 = 48.0;
269    pub const FILLED_CONTAINER_SIZE: f32 = 40.0;
270    pub fn content_color() -> Color {
271        theme().on_surface_variant
272    }
273    pub fn disabled_content_color() -> Color {
274        theme().on_surface.with_alpha_f32(0.38)
275    }
276    pub fn filled_content_color() -> Color {
277        theme().on_primary
278    }
279    pub fn filled_container_color() -> Color {
280        theme().primary
281    }
282    pub fn filled_tonal_content_color() -> Color {
283        theme().on_secondary_container
284    }
285    pub fn filled_tonal_container_color() -> Color {
286        theme().secondary_container
287    }
288    pub fn state_colors_default() -> StateColors {
289        let th = theme();
290        StateColors {
291            default: Color::TRANSPARENT,
292            hovered: Color::TRANSPARENT,
293            focused: Color::TRANSPARENT,
294            pressed: Color::TRANSPARENT,
295            dragged: th.on_surface.with_alpha_f32(0.12),
296            disabled: Color::TRANSPARENT,
297        }
298    }
299}
300
301/// Default values for checkbox.
302pub struct CheckboxDefaults;
303
304impl CheckboxDefaults {
305    pub const TOUCH_TARGET_SIZE: f32 = 40.0;
306    pub const BOX_SIZE: f32 = 18.0;
307    pub const STROKE_WIDTH: f32 = 2.0;
308    pub const CORNER_RADIUS: f32 = 2.0;
309    pub const CHECK_ICON_SIZE: f32 = 14.0;
310    pub fn checked_color() -> Color {
311        theme().primary
312    }
313    pub fn unchecked_color() -> Color {
314        theme().on_surface_variant
315    }
316    pub fn checkmark_color() -> Color {
317        theme().on_primary
318    }
319    pub fn disabled_checked_box_color() -> Color {
320        theme().on_surface.with_alpha_f32(0.38)
321    }
322    pub fn disabled_checkmark_color() -> Color {
323        theme().surface
324    }
325    pub fn disabled_unchecked_border_color() -> Color {
326        theme().on_surface.with_alpha_f32(0.38)
327    }
328    pub fn state_colors_default() -> StateColors {
329        let th = theme();
330        StateColors {
331            default: Color::TRANSPARENT,
332            hovered: Color::TRANSPARENT,
333            focused: Color::TRANSPARENT,
334            pressed: Color::TRANSPARENT,
335            dragged: th.on_surface.with_alpha_f32(0.12),
336            disabled: Color::TRANSPARENT,
337        }
338    }
339}
340
341/// Default values for radio button.
342pub struct RadioButtonDefaults;
343
344impl RadioButtonDefaults {
345    pub const TOUCH_TARGET_SIZE: f32 = 40.0;
346    pub const OUTER_RADIUS: f32 = 10.0;
347    pub const DOT_RADIUS: f32 = 5.0;
348    pub const STROKE_WIDTH: f32 = 2.0;
349    pub fn selected_color() -> Color {
350        theme().primary
351    }
352    pub fn unselected_color() -> Color {
353        theme().on_surface_variant
354    }
355    pub fn disabled_selected_color() -> Color {
356        theme().on_surface.with_alpha_f32(0.38)
357    }
358    pub fn disabled_unselected_color() -> Color {
359        theme().on_surface.with_alpha_f32(0.38)
360    }
361    pub fn state_colors_default() -> StateColors {
362        let th = theme();
363        StateColors {
364            default: Color::TRANSPARENT,
365            hovered: Color::TRANSPARENT,
366            focused: Color::TRANSPARENT,
367            pressed: Color::TRANSPARENT,
368            dragged: th.on_surface.with_alpha_f32(0.12),
369            disabled: Color::TRANSPARENT,
370        }
371    }
372}
373
374/// Default values for switch.
375pub struct SwitchDefaults;
376
377impl SwitchDefaults {
378    pub const TRACK_WIDTH: f32 = 52.0;
379    pub const TRACK_HEIGHT: f32 = 32.0;
380    pub const THUMB_CHECKED_SIZE: f32 = 24.0;
381    pub const THUMB_UNCHECKED_SIZE: f32 = 16.0;
382    pub fn checked_track_color() -> Color {
383        theme().primary
384    }
385    pub fn unchecked_track_color() -> Color {
386        theme().surface_container_highest
387    }
388    pub fn checked_thumb_color() -> Color {
389        theme().on_primary
390    }
391    pub fn unchecked_thumb_color() -> Color {
392        theme().outline
393    }
394    pub fn checked_icon_color() -> Color {
395        theme().on_primary
396    }
397    pub fn unchecked_icon_color() -> Color {
398        theme().outline
399    }
400    pub fn unchecked_border_color() -> Color {
401        theme().outline
402    }
403    pub fn disabled_checked_thumb_color() -> Color {
404        theme().surface
405    }
406    pub fn disabled_checked_track_color() -> Color {
407        theme().on_surface.with_alpha_f32(0.12)
408    }
409    pub fn disabled_checked_icon_color() -> Color {
410        theme().on_surface.with_alpha_f32(0.38)
411    }
412    pub fn disabled_unchecked_thumb_color() -> Color {
413        theme().on_surface.with_alpha_f32(0.38)
414    }
415    pub fn disabled_unchecked_track_color() -> Color {
416        theme().surface_container_highest.with_alpha_f32(0.12)
417    }
418    pub fn disabled_unchecked_border_color() -> Color {
419        theme().on_surface.with_alpha_f32(0.12)
420    }
421    pub fn disabled_unchecked_icon_color() -> Color {
422        theme().surface_container_highest.with_alpha_f32(0.38)
423    }
424    pub fn state_colors_default() -> StateColors {
425        let th = theme();
426        StateColors {
427            default: Color::TRANSPARENT,
428            hovered: Color::TRANSPARENT,
429            focused: Color::TRANSPARENT,
430            pressed: Color::TRANSPARENT,
431            dragged: th.on_surface.with_alpha_f32(0.12),
432            disabled: Color::TRANSPARENT,
433        }
434    }
435}
436
437/// Default values for slider.
438pub struct SliderDefaults;
439
440impl SliderDefaults {
441    pub const TRACK_HEIGHT: f32 = 4.0;
442    pub const THUMB_SIZE: f32 = 20.0;
443    pub fn active_track_color() -> Color {
444        theme().primary
445    }
446    pub fn inactive_track_color() -> Color {
447        theme().secondary_container
448    }
449    pub fn thumb_color() -> Color {
450        theme().primary
451    }
452    pub fn active_tick_color() -> Color {
453        theme().secondary_container
454    }
455    pub fn inactive_tick_color() -> Color {
456        theme().primary
457    }
458    pub fn disabled_thumb_color() -> Color {
459        theme().on_surface.with_alpha_f32(0.38)
460    }
461    pub fn disabled_active_track_color() -> Color {
462        theme().on_surface.with_alpha_f32(0.38)
463    }
464    pub fn disabled_inactive_track_color() -> Color {
465        theme().on_surface.with_alpha_f32(0.12)
466    }
467    pub fn disabled_active_tick_color() -> Color {
468        theme().on_surface.with_alpha_f32(0.12)
469    }
470    pub fn disabled_inactive_tick_color() -> Color {
471        theme().on_surface.with_alpha_f32(0.38)
472    }
473    pub fn state_colors_default() -> StateColors {
474        let th = theme();
475        StateColors {
476            default: Color::TRANSPARENT,
477            hovered: th.on_surface.with_alpha_f32(0.08),
478            focused: th.on_surface.with_alpha_f32(0.12),
479            pressed: th.on_surface.with_alpha_f32(0.12),
480            dragged: th.on_surface.with_alpha_f32(0.12),
481            disabled: Color::TRANSPARENT,
482        }
483    }
484}
485
486/// Default values for divider.
487pub struct DividerDefaults;
488
489impl DividerDefaults {
490    pub const THICKNESS: f32 = 1.0;
491    pub fn color() -> Color {
492        theme().outline_variant
493    }
494}
495
496/// Default values for badge.
497pub struct BadgeDefaults;
498
499impl BadgeDefaults {
500    pub const DOT_SIZE: f32 = 6.0;
501    pub const LABEL_MIN_WIDTH: f32 = 16.0;
502    pub const LABEL_HEIGHT: f32 = 16.0;
503    pub const DOT_OFFSET_X: f32 = 6.0;
504    pub const DOT_OFFSET_Y: f32 = 6.0;
505    pub const CONTENT_OFFSET_X: f32 = 12.0;
506    pub const CONTENT_OFFSET_Y: f32 = 14.0;
507    pub fn container_color() -> Color {
508        theme().error
509    }
510    pub fn content_color() -> Color {
511        theme().on_error
512    }
513}
514
515/// Default values for list item.
516pub struct ListItemDefaults;
517
518impl ListItemDefaults {
519    pub const ONE_LINE_HEIGHT: f32 = 56.0;
520    pub const TWO_LINE_HEIGHT: f32 = 72.0;
521    pub const THREE_LINE_HEIGHT: f32 = 88.0;
522    pub const HORIZONTAL_PADDING: f32 = 16.0;
523    pub const TRAILING_PADDING: f32 = 24.0;
524    pub fn headline_color() -> Color {
525        theme().on_surface
526    }
527    pub fn supporting_color() -> Color {
528        theme().on_surface_variant
529    }
530    pub fn overline_color() -> Color {
531        theme().on_surface_variant
532    }
533    pub fn leading_icon_color() -> Color {
534        theme().on_surface_variant
535    }
536    pub fn trailing_icon_color() -> Color {
537        theme().on_surface_variant
538    }
539    // disabled
540    pub fn disabled_container_color() -> Color {
541        theme().on_surface.with_alpha_f32(0.04)
542    }
543    pub fn disabled_headline_color() -> Color {
544        theme().on_surface.with_alpha_f32(0.38)
545    }
546    pub fn disabled_supporting_color() -> Color {
547        theme().on_surface.with_alpha_f32(0.38)
548    }
549    pub fn disabled_overline_color() -> Color {
550        theme().on_surface.with_alpha_f32(0.38)
551    }
552    pub fn disabled_leading_icon_color() -> Color {
553        theme().on_surface.with_alpha_f32(0.38)
554    }
555    pub fn disabled_trailing_icon_color() -> Color {
556        theme().on_surface.with_alpha_f32(0.38)
557    }
558    // selected
559    pub fn selected_container_color() -> Color {
560        theme().surface_container_high
561    }
562    pub fn selected_headline_color() -> Color {
563        theme().on_surface
564    }
565    pub fn selected_supporting_color() -> Color {
566        theme().on_surface_variant
567    }
568    pub fn selected_overline_color() -> Color {
569        theme().on_surface_variant
570    }
571    pub fn selected_leading_icon_color() -> Color {
572        theme().on_surface_variant
573    }
574    pub fn selected_trailing_icon_color() -> Color {
575        theme().on_surface_variant
576    }
577    // dragged
578    pub fn dragged_container_color() -> Color {
579        theme().surface_container_high
580    }
581    pub fn dragged_headline_color() -> Color {
582        theme().on_surface
583    }
584    pub fn dragged_supporting_color() -> Color {
585        theme().on_surface_variant
586    }
587    pub fn dragged_overline_color() -> Color {
588        theme().on_surface_variant
589    }
590    pub fn dragged_leading_icon_color() -> Color {
591        theme().on_surface_variant
592    }
593    pub fn dragged_trailing_icon_color() -> Color {
594        theme().on_surface_variant
595    }
596    pub fn state_colors_default() -> StateColors {
597        let th = theme();
598        StateColors {
599            default: Color::TRANSPARENT,
600            hovered: Color::TRANSPARENT,
601            focused: Color::TRANSPARENT,
602            pressed: Color::TRANSPARENT,
603            dragged: th.on_surface.with_alpha_f32(0.12),
604            disabled: Color::TRANSPARENT,
605        }
606    }
607}
608
609/// Default values for top app bar.
610pub struct TopAppBarDefaults;
611
612impl TopAppBarDefaults {
613    pub const HEIGHT: f32 = 64.0;
614    pub fn container_color() -> Color {
615        theme().surface
616    }
617    pub fn scrolled_container_color() -> Color {
618        theme().surface_container
619    }
620    pub fn title_content_color() -> Color {
621        theme().on_surface
622    }
623    pub fn subtitle_content_color() -> Color {
624        theme().on_surface_variant
625    }
626    pub fn navigation_icon_content_color() -> Color {
627        theme().on_surface
628    }
629    pub fn action_icon_content_color() -> Color {
630        theme().on_surface_variant
631    }
632}
633
634/// Default values for tab row.
635pub struct TabDefaults;
636
637impl TabDefaults {
638    pub const HEIGHT: f32 = 48.0;
639    pub const INDICATOR_HEIGHT: f32 = 3.0;
640    pub const INDICATOR_CORNER: f32 = 1.5;
641    pub fn container_color() -> Color {
642        theme().surface
643    }
644    pub fn selected_content_color() -> Color {
645        theme().primary
646    }
647    pub fn unselected_content_color() -> Color {
648        theme().on_surface_variant
649    }
650    pub fn indicator_color() -> Color {
651        theme().primary
652    }
653}
654
655/// Default values for navigation bar.
656pub struct NavigationBarDefaults;
657
658impl NavigationBarDefaults {
659    pub const HEIGHT: f32 = 80.0;
660    pub const TONAL_ELEVATION: f32 = 0.0;
661    pub const ITEM_ACTIVE_INDICATOR_OPACITY: f32 = 1.0;
662    pub const ITEM_SPACING: f32 = 8.0;
663    pub const ACTIVE_INDICATOR_WIDTH: f32 = 56.0;
664    pub const ACTIVE_INDICATOR_HEIGHT: f32 = 32.0;
665    pub fn container_color() -> Color {
666        theme().surface_container
667    }
668    pub fn content_color() -> Color {
669        theme().on_surface
670    }
671    pub fn selected_icon_color() -> Color {
672        theme().on_secondary_container
673    }
674    pub fn selected_text_color() -> Color {
675        theme().secondary
676    }
677    pub fn unselected_icon_color() -> Color {
678        theme().on_surface_variant
679    }
680    pub fn unselected_text_color() -> Color {
681        theme().on_surface_variant
682    }
683    pub fn indicator_color() -> Color {
684        theme().secondary_container
685    }
686    pub const INDICATOR_RADIUS: f32 = 16.0;
687}
688
689/// Default values for navigation rail.
690pub struct NavigationRailDefaults;
691
692impl NavigationRailDefaults {
693    pub const WIDTH: f32 = 80.0;
694    pub const ITEM_RADIUS: f32 = 16.0;
695    pub const ITEM_MIN_HEIGHT: f32 = 56.0;
696    pub const ITEM_ACTIVE_INDICATOR_OPACITY: f32 = 1.0;
697    pub const ITEM_SPACING: f32 = 4.0;
698    pub const ACTIVE_INDICATOR_WIDTH: f32 = 56.0;
699    pub const ACTIVE_INDICATOR_HEIGHT: f32 = 32.0;
700    pub fn container_color() -> Color {
701        theme().surface
702    }
703    pub fn selected_icon_color() -> Color {
704        theme().on_secondary_container
705    }
706    pub fn selected_text_color() -> Color {
707        theme().secondary
708    }
709    pub fn unselected_icon_color() -> Color {
710        theme().on_surface_variant
711    }
712    pub fn unselected_text_color() -> Color {
713        theme().on_surface_variant
714    }
715    pub fn indicator_color() -> Color {
716        theme().secondary_container
717    }
718}
719
720/// Default values for segmented button.
721pub struct SegmentedButtonDefaults;
722
723impl SegmentedButtonDefaults {
724    pub const HEIGHT: f32 = 40.0;
725    pub const SHAPE_RADIUS: f32 = 20.0;
726    pub const CONTENT_PADDING: PaddingValues = PaddingValues {
727        left: 12.0,
728        right: 12.0,
729        top: 0.0,
730        bottom: 0.0,
731    };
732    pub fn border_color() -> Color {
733        theme().outline
734    }
735    pub fn selected_container_color() -> Color {
736        theme().secondary_container
737    }
738    pub fn selected_content_color() -> Color {
739        theme().on_secondary_container
740    }
741    pub fn unselected_content_color() -> Color {
742        theme().on_surface
743    }
744    pub fn state_colors_default() -> StateColors {
745        let th = theme();
746        StateColors {
747            default: Color::TRANSPARENT,
748            hovered: Color::TRANSPARENT,
749            focused: Color::TRANSPARENT,
750            pressed: Color::TRANSPARENT,
751            dragged: th.on_surface.with_alpha_f32(0.12),
752            disabled: Color::TRANSPARENT,
753        }
754    }
755}
756
757/// Default values for FAB.
758pub struct FABDefaults;
759
760impl FABDefaults {
761    pub const SMALL_SIZE: f32 = 40.0;
762    pub const SMALL_SHAPE_RADIUS: f32 = 12.0;
763    pub const SIZE: f32 = 56.0;
764    pub const LARGE_SIZE: f32 = 96.0;
765    pub const SHAPE_RADIUS: f32 = 28.0;
766    pub const LARGE_SHAPE_RADIUS: f32 = 28.0;
767    pub fn container_color() -> Color {
768        theme().primary_container
769    }
770    pub fn content_color() -> Color {
771        theme().on_primary_container
772    }
773    pub fn state_elevation() -> StateElevation {
774        StateElevation {
775            default: theme().elevation.level3,
776            hovered: theme().elevation.level4,
777            focused: theme().elevation.level3,
778            pressed: theme().elevation.level5,
779            dragged: theme().elevation.level5,
780            disabled: 0.0,
781        }
782    }
783}
784
785/// Default values for chip components.
786pub struct ChipDefaults;
787
788impl ChipDefaults {
789    pub const HEIGHT: f32 = 32.0;
790    pub const HORIZONTAL_PADDING: f32 = 16.0;
791    pub const SHAPE_RADIUS: f32 = 8.0;
792    pub const BORDER_WIDTH: f32 = 1.0;
793
794    // Colors for non-selected state
795    pub fn container_color() -> Color {
796        Color::TRANSPARENT
797    }
798    pub fn label_color() -> Color {
799        theme().on_surface_variant
800    }
801    pub fn leading_icon_color() -> Color {
802        theme().primary
803    }
804    pub fn trailing_icon_color() -> Color {
805        theme().primary
806    }
807
808    // Disabled colors (non-selected)
809    pub fn disabled_container_color() -> Color {
810        Color::TRANSPARENT
811    }
812    pub fn disabled_label_color() -> Color {
813        theme().on_surface.with_alpha_f32(0.38)
814    }
815    pub fn disabled_leading_icon_color() -> Color {
816        theme().on_surface.with_alpha_f32(0.38)
817    }
818    pub fn disabled_trailing_icon_color() -> Color {
819        theme().on_surface.with_alpha_f32(0.38)
820    }
821
822    // Colors for selected state
823    pub fn selected_container_color() -> Color {
824        theme().secondary_container
825    }
826    pub fn selected_label_color() -> Color {
827        theme().on_secondary_container
828    }
829    pub fn selected_leading_icon_color() -> Color {
830        theme().primary
831    }
832    pub fn selected_trailing_icon_color() -> Color {
833        theme().on_secondary_container
834    }
835
836    // Disabled selected container
837    pub fn disabled_selected_container_color() -> Color {
838        theme()
839            .on_surface
840            .with_alpha_f32(0.12)
841            .composite_over(theme().secondary_container)
842    }
843
844    // Border colors
845    pub fn border_color() -> Color {
846        theme().outline_variant
847    }
848    pub fn selected_border_color() -> Color {
849        Color::TRANSPARENT
850    }
851    pub fn disabled_border_color() -> Color {
852        theme().on_surface.with_alpha_f32(0.12)
853    }
854    pub fn disabled_selected_border_color() -> Color {
855        Color::TRANSPARENT
856    }
857
858    // Elevation defaults (flat chip - no elevation)
859    pub fn elevation_default() -> f32 {
860        0.0
861    }
862    pub fn elevation_hovered() -> f32 {
863        0.0
864    }
865    pub fn elevation_focused() -> f32 {
866        0.0
867    }
868    pub fn elevation_pressed() -> f32 {
869        0.0
870    }
871    pub fn elevation_dragged() -> f32 {
872        0.0
873    }
874    pub fn elevation_disabled() -> f32 {
875        0.0
876    }
877
878    // Elevated chip defaults
879    pub fn elevated_elevation_default() -> f32 {
880        theme().elevation.level1
881    }
882    pub fn elevated_elevation_hovered() -> f32 {
883        theme().elevation.level2
884    }
885    pub fn elevated_elevation_focused() -> f32 {
886        theme().elevation.level1
887    }
888    pub fn elevated_elevation_pressed() -> f32 {
889        theme().elevation.level1
890    }
891    pub fn elevated_elevation_dragged() -> f32 {
892        // M3 elevated chip dragged container elevation is Level 4 (8dp).
893        theme().elevation.level4
894    }
895    pub fn elevated_elevation_disabled() -> f32 {
896        0.0
897    }
898
899    // Elevated chip container colors
900    pub fn elevated_container_color() -> Color {
901        theme().surface_container_low
902    }
903    pub fn elevated_selected_container_color() -> Color {
904        theme().secondary_container
905    }
906    pub fn disabled_elevated_container_color() -> Color {
907        theme()
908            .on_surface
909            .with_alpha_f32(0.12)
910            .composite_over(theme().surface_container_low)
911    }
912}
913
914/// Default values for scaffold layout.
915pub struct ScaffoldDefaults;
916
917impl ScaffoldDefaults {
918    pub fn container_color() -> Color {
919        theme().background
920    }
921    pub fn content_color() -> Color {
922        theme().on_background
923    }
924    pub const TOP_BAR_HEIGHT: f32 = 64.0;
925    pub const BOTTOM_BAR_HEIGHT: f32 = 80.0;
926    pub const FAB_MARGIN: f32 = 16.0;
927}
928
929/// Default values for navigation drawer.
930pub struct NavigationDrawerDefaults;
931
932impl NavigationDrawerDefaults {
933    pub const WIDTH: f32 = 300.0;
934    pub const TONAL_ELEVATION: f32 = 0.0;
935    pub fn container_color() -> Color {
936        theme().surface_container_low
937    }
938    pub fn content_color() -> Color {
939        theme().on_surface_variant
940    }
941    pub fn scrim_color() -> Color {
942        theme().scrim.with_alpha(82)
943    }
944    pub const SHAPE_RADIUS: f32 = 16.0;
945}
946
947/// Default values for bottom sheet / modal bottom sheet.
948pub struct BottomSheetDefaults;
949
950impl BottomSheetDefaults {
951    pub const TONAL_ELEVATION: f32 = 0.0;
952    pub fn container_color() -> Color {
953        theme().surface_container_low
954    }
955    pub fn content_color() -> Color {
956        theme().on_surface
957    }
958    pub fn drag_handle_color() -> Color {
959        theme().on_surface_variant
960    }
961    pub fn scrim_color() -> Color {
962        theme().scrim.with_alpha(85)
963    }
964    pub const DRAG_HANDLE_WIDTH: f32 = 32.0;
965    pub const DRAG_HANDLE_HEIGHT: f32 = 4.0;
966    pub const SHAPE_RADIUS: f32 = 16.0;
967    pub const PEEK_HEIGHT: f32 = 56.0;
968    pub const MAX_WIDTH: f32 = 640.0;
969}
970
971/// Default values for search bar.
972pub struct SearchBarDefaults;
973
974impl SearchBarDefaults {
975    pub const HEIGHT: f32 = 56.0;
976    pub const EXPANDED_WIDTH: f32 = 360.0;
977    pub const COLLAPSED_WIDTH: f32 = 240.0;
978    pub const DOCKED_HEIGHT: f32 = 400.0;
979    pub const TONAL_ELEVATION: f32 = 0.0;
980    pub const SHADOW_ELEVATION: f32 = 0.0;
981    pub const SHAPE_RADIUS: f32 = 28.0; // full round
982    pub const ACTIVE_SHAPE_RADIUS: f32 = 28.0;
983    pub const DOCKED_SHAPE_RADIUS: f32 = 28.0;
984    pub const DROPDOWN_SHAPE_RADIUS: f32 = 12.0;
985    pub const DROPDOWN_GAP_SIZE: f32 = 2.0;
986    pub const MIN_WIDTH: f32 = Self::COLLAPSED_WIDTH;
987    pub const MAX_WIDTH: f32 = 720.0;
988    pub const VERTICAL_PADDING: f32 = 8.0;
989
990    pub const CONTENT_PADDING: PaddingValues = PaddingValues {
991        left: 16.0,
992        right: 16.0,
993        top: 0.0,
994        bottom: 0.0,
995    };
996
997    pub fn container_color() -> Color {
998        theme().surface_container
999    }
1000    pub fn active_container_color() -> Color {
1001        theme().surface_container_high
1002    }
1003    pub fn content_color() -> Color {
1004        theme().on_surface
1005    }
1006    pub fn placeholder_color() -> Color {
1007        theme().on_surface_variant
1008    }
1009    pub fn divider_color() -> Color {
1010        theme().outline_variant
1011    }
1012    pub fn scrim_color() -> Color {
1013        theme().scrim.with_alpha(85)
1014    }
1015    pub fn scrolled_container_color() -> Color {
1016        theme().surface_container_highest
1017    }
1018    pub fn app_bar_container_color() -> Color {
1019        theme().surface
1020    }
1021    pub fn scrolled_app_bar_container_color() -> Color {
1022        theme().surface_container
1023    }
1024    pub fn navigation_icon_content_color() -> Color {
1025        theme().on_surface
1026    }
1027    pub fn action_icon_content_color() -> Color {
1028        theme().on_surface_variant
1029    }
1030    pub fn dropdown_scrim_color() -> Color {
1031        Color::TRANSPARENT
1032    }
1033}
1034
1035/// Default values for dropdown menu.
1036pub struct DropdownMenuDefaults;
1037
1038impl DropdownMenuDefaults {
1039    pub const MIN_WIDTH: f32 = 112.0;
1040    pub const ITEM_HEIGHT: f32 = 48.0;
1041    pub const VERTICAL_MARGIN: f32 = 48.0;
1042    pub const HORIZONTAL_MARGIN: f32 = 8.0;
1043    pub const MAX_WIDTH: f32 = 280.0;
1044    pub fn container_color() -> Color {
1045        theme().surface_container
1046    }
1047    pub fn item_text_color() -> Color {
1048        theme().on_surface
1049    }
1050    pub fn disabled_item_text_color() -> Color {
1051        theme().on_surface.with_alpha_f32(0.38)
1052    }
1053    pub fn divider_color() -> Color {
1054        theme().outline_variant
1055    }
1056}
1057
1058/// Default values for tooltip.
1059pub struct TooltipDefaults;
1060
1061impl TooltipDefaults {
1062    pub const OFFSET_Y: f32 = -28.0;
1063    pub const HORIZONTAL_PADDING: f32 = 8.0;
1064    pub const VERTICAL_PADDING: f32 = 4.0;
1065    pub const MAX_WIDTH: f32 = 200.0;
1066    pub fn container_color() -> Color {
1067        theme().inverse_surface
1068    }
1069    pub fn content_color() -> Color {
1070        theme().inverse_on_surface
1071    }
1072}
1073
1074/// Default values for pull-to-refresh.
1075pub struct PullToRefreshDefaults;
1076
1077impl PullToRefreshDefaults {
1078    pub const THRESHOLD: f32 = 64.0;
1079    pub fn indicator_color() -> Color {
1080        theme().primary
1081    }
1082    pub fn container_color() -> Color {
1083        Color::TRANSPARENT
1084    }
1085}
1086
1087/// Default values for alert dialog.
1088pub struct AlertDialogDefaults;
1089
1090impl AlertDialogDefaults {
1091    pub const MIN_WIDTH: f32 = 280.0;
1092    pub const MAX_WIDTH: f32 = 560.0;
1093    pub const HORIZONTAL_PADDING: f32 = 24.0;
1094    pub fn scrim_color() -> Color {
1095        theme().scrim.with_alpha(82)
1096    }
1097}
1098
1099/// Default values for outlined text field.
1100pub struct OutlinedTextFieldDefaults;
1101
1102impl OutlinedTextFieldDefaults {
1103    pub const MIN_HEIGHT: f32 = 56.0;
1104    pub const MIN_WIDTH: f32 = 280.0;
1105    pub const UNFOCUSED_BORDER_THICKNESS: f32 = 1.0;
1106    pub const FOCUSED_BORDER_THICKNESS: f32 = 2.0;
1107    pub const TEXT_FIELD_PADDING: f32 = 16.0;
1108    pub const VERTICAL_PADDING_WITH_LABEL: f32 = 8.0;
1109
1110    pub fn label_color() -> Color {
1111        theme().on_surface_variant
1112    }
1113    pub fn focused_label_color() -> Color {
1114        theme().primary
1115    }
1116    pub fn error_label_color() -> Color {
1117        theme().error
1118    }
1119    pub fn input_color() -> Color {
1120        theme().on_surface
1121    }
1122    pub fn disabled_input_color() -> Color {
1123        theme().on_surface.with_alpha_f32(0.38)
1124    }
1125    pub fn supporting_color() -> Color {
1126        theme().on_surface_variant
1127    }
1128    pub fn placeholder_color() -> Color {
1129        theme().on_surface_variant
1130    }
1131    pub fn leading_icon_color() -> Color {
1132        theme().on_surface_variant
1133    }
1134    pub fn trailing_icon_color() -> Color {
1135        theme().on_surface_variant
1136    }
1137    pub fn unfocused_border_color() -> Color {
1138        theme().outline
1139    }
1140    pub fn focused_border_color() -> Color {
1141        theme().primary
1142    }
1143    pub fn error_border_color() -> Color {
1144        theme().error
1145    }
1146    pub fn cursor_color() -> Color {
1147        theme().primary
1148    }
1149    pub fn container_color() -> Color {
1150        theme().surface
1151    }
1152}
1153
1154/// Default values for date picker.
1155pub struct DatePickerDefaults;
1156
1157impl DatePickerDefaults {
1158    pub const CONTAINER_WIDTH: f32 = 360.0;
1159    pub const CONTAINER_HEIGHT: f32 = 568.0;
1160    pub const HEADER_CONTAINER_HEIGHT: f32 = 120.0;
1161    pub const DATE_CELL_SIZE: f32 = 40.0;
1162    pub const YEAR_CELL_HEIGHT: f32 = 36.0;
1163    pub const YEAR_CELL_WIDTH: f32 = 72.0;
1164    pub const TODAY_BORDER_WIDTH: f32 = 1.0;
1165    pub const HORIZONTAL_PADDING: f32 = 12.0;
1166
1167    pub fn container_color() -> Color {
1168        theme().surface_container_high
1169    }
1170    pub fn header_color() -> Color {
1171        theme().on_surface_variant
1172    }
1173    pub fn weekday_color() -> Color {
1174        theme().on_surface
1175    }
1176    pub fn day_color() -> Color {
1177        theme().on_surface
1178    }
1179    pub fn selected_day_color() -> Color {
1180        theme().on_primary
1181    }
1182    pub fn selected_day_container_color() -> Color {
1183        theme().primary
1184    }
1185    pub fn today_content_color() -> Color {
1186        theme().primary
1187    }
1188    pub fn today_border_color() -> Color {
1189        theme().primary
1190    }
1191    pub fn year_selected_container_color() -> Color {
1192        theme().primary
1193    }
1194    pub fn year_selected_content_color() -> Color {
1195        theme().on_primary
1196    }
1197    pub fn year_unselected_content_color() -> Color {
1198        theme().on_surface_variant
1199    }
1200}
1201
1202/// Default values for time picker.
1203pub struct TimePickerDefaults;
1204
1205impl TimePickerDefaults {
1206    pub const CLOCK_DIAL_CONTAINER_SIZE: f32 = 256.0;
1207    pub const CLOCK_DIAL_MIN_CONTAINER_SIZE: f32 = 200.0;
1208    pub const PERIOD_SELECTOR_HORIZONTAL_WIDTH: f32 = 216.0;
1209    pub const PERIOD_SELECTOR_HORIZONTAL_HEIGHT: f32 = 38.0;
1210    pub const PERIOD_SELECTOR_VERTICAL_WIDTH: f32 = 52.0;
1211    pub const PERIOD_SELECTOR_VERTICAL_HEIGHT: f32 = 80.0;
1212    pub const TIME_SELECTOR_CONTAINER_WIDTH: f32 = 96.0;
1213    pub const TIME_SELECTOR_CONTAINER_HEIGHT: f32 = 80.0;
1214    pub const TIME_SELECTOR_24H_WIDTH: f32 = 114.0;
1215    pub const MAX_HEIGHT: f32 = 384.0;
1216
1217    pub fn clock_dial_color() -> Color {
1218        theme().surface_container_highest
1219    }
1220    pub fn clock_dial_selected_content_color() -> Color {
1221        theme().on_primary
1222    }
1223    pub fn clock_dial_unselected_content_color() -> Color {
1224        theme().on_surface
1225    }
1226    pub fn selector_color() -> Color {
1227        theme().primary
1228    }
1229    pub fn container_color() -> Color {
1230        theme().surface_container_high
1231    }
1232    pub fn period_selector_selected_container_color() -> Color {
1233        theme().tertiary_container
1234    }
1235    pub fn period_selector_unselected_container_color() -> Color {
1236        Color::TRANSPARENT
1237    }
1238    pub fn period_selector_selected_content_color() -> Color {
1239        theme().on_tertiary_container
1240    }
1241    pub fn period_selector_unselected_content_color() -> Color {
1242        theme().on_surface_variant
1243    }
1244    pub fn period_selector_border_color() -> Color {
1245        theme().outline
1246    }
1247    pub fn time_selector_selected_container_color() -> Color {
1248        theme().primary_container
1249    }
1250    pub fn time_selector_selected_content_color() -> Color {
1251        theme().on_primary_container
1252    }
1253    pub fn time_selector_unselected_container_color() -> Color {
1254        theme().surface_container_highest
1255    }
1256    pub fn time_selector_unselected_content_color() -> Color {
1257        theme().on_surface
1258    }
1259    pub fn time_selector_separator_color() -> Color {
1260        theme().on_surface
1261    }
1262}
1263
1264/// Default values for swipe-to-dismiss.
1265pub struct SwipeToDismissDefaults;
1266
1267impl SwipeToDismissDefaults {
1268    pub const POSITIONAL_THRESHOLD: f32 = 56.0;
1269    pub const DISMISS_THRESHOLD: f32 = 150.0;
1270    pub const DISMISSED_OFFSET: f32 = 300.0;
1271    pub const MAX_WIDTH: f32 = 400.0;
1272}
1273
1274/// Default values for split button.
1275///
1276/// Token values sourced from `SplitButton{Small,XSmall,Medium,Large,XLarge}Tokens`.
1277pub struct SplitButtonDefaults;
1278
1279impl SplitButtonDefaults {
1280    /// Between-space from `SplitButtonSmallTokens.BetweenSpace` (2.0.dp).
1281    pub const SPACING: f32 = 2.0;
1282    pub const LEADING_BUTTON_MIN_WIDTH: f32 = 48.0;
1283
1284    pub const XSMALL_CONTAINER_HEIGHT: f32 = 32.0;
1285    pub const SMALL_CONTAINER_HEIGHT: f32 = 40.0; // SplitButtonSmallTokens.ContainerHeight
1286    pub const MEDIUM_CONTAINER_HEIGHT: f32 = 56.0;
1287    pub const LARGE_CONTAINER_HEIGHT: f32 = 64.0; // estimate -> no LargeTokens in repo
1288    pub const XLARGE_CONTAINER_HEIGHT: f32 = 72.0; // estimate
1289
1290    /// Outer corners are fully rounded (50% -> effectively full radius).
1291    pub const OUTER_CORNER_SIZE: f32 = f32::INFINITY; // ShapeDefaults.CornerFull equivalent
1292    /// Small inner corner size from `SplitButtonSmallTokens.InnerCornerCornerSize`.
1293    pub const SMALL_INNER_CORNER_SIZE: f32 = 4.0;
1294    /// Extra-small inner corner size from `SplitButtonXSmallTokens.InnerCornerCornerSize`.
1295    pub const XSMALL_INNER_CORNER_SIZE: f32 = 4.0;
1296    /// Medium inner corner size from `SplitButtonMediumTokens.InnerCornerCornerSize`.
1297    pub const MEDIUM_INNER_CORNER_SIZE: f32 = 4.0;
1298    /// Large inner corner size (estimate).
1299    pub const LARGE_INNER_CORNER_SIZE: f32 = 4.0;
1300    /// Extra-large inner corner size (estimate).
1301    pub const XLARGE_INNER_CORNER_SIZE: f32 = 4.0;
1302
1303    /// Pressed inner corner sizes (from tokens).
1304    pub const XSMALL_INNER_CORNER_SIZE_PRESSED: f32 = 6.0;
1305    pub const SMALL_INNER_CORNER_SIZE_PRESSED: f32 = 6.0;
1306    pub const MEDIUM_INNER_CORNER_SIZE_PRESSED: f32 = 6.0;
1307    pub const LARGE_INNER_CORNER_SIZE_PRESSED: f32 = 6.0;
1308    pub const XLARGE_INNER_CORNER_SIZE_PRESSED: f32 = 6.0;
1309
1310    /// Leading icon size from `ButtonSmallTokens.IconSize`.
1311    pub const LEADING_ICON_SIZE: f32 = 18.0;
1312    /// Trailing icon size from `SplitButtonSmallTokens.TrailingIconSize`.
1313    pub const TRAILING_ICON_SIZE: f32 = 22.0;
1314    pub const XSMALL_TRAILING_ICON_SIZE: f32 = 22.0;
1315    pub const MEDIUM_TRAILING_ICON_SIZE: f32 = 26.0;
1316    pub const LARGE_TRAILING_ICON_SIZE: f32 = 26.0;
1317    pub const XLARGE_TRAILING_ICON_SIZE: f32 = 26.0;
1318
1319    /// Content padding for a small leading button.
1320    /// `SplitButtonSmallTokens.LeadingButtonLeadingSpace` (16.0) /
1321    /// `LeadingButtonTrailingSpace` (12.0).
1322    pub fn small_leading_content_padding() -> PaddingValues {
1323        PaddingValues {
1324            left: 16.0,
1325            right: 12.0,
1326            top: 0.0,
1327            bottom: 0.0,
1328        }
1329    }
1330
1331    /// Content padding for a small trailing button.
1332    /// `SplitButtonSmallTokens.TrailingButtonLeadingSpace` (13.0) /
1333    /// `TrailingButtonTrailingSpace` (13.0).
1334    pub fn small_trailing_content_padding() -> PaddingValues {
1335        PaddingValues {
1336            left: 13.0,
1337            right: 13.0,
1338            top: 0.0,
1339            bottom: 0.0,
1340        }
1341    }
1342
1343    /// Content padding for an extra-small leading button.
1344    /// `SplitButtonXSmallTokens.LeadingButtonLeadingSpace` (12.0) /
1345    /// `LeadingButtonTrailingSpace` (10.0).
1346    pub fn xsmall_leading_content_padding() -> PaddingValues {
1347        PaddingValues {
1348            left: 12.0,
1349            right: 10.0,
1350            top: 0.0,
1351            bottom: 0.0,
1352        }
1353    }
1354
1355    /// Content padding for an extra-small trailing button.
1356    /// `SplitButtonXSmallTokens.TrailingButtonLeadingSpace` (13.0) /
1357    /// `TrailingButtonTrailingSpace` (13.0).
1358    pub fn xsmall_trailing_content_padding() -> PaddingValues {
1359        PaddingValues {
1360            left: 13.0,
1361            right: 13.0,
1362            top: 0.0,
1363            bottom: 0.0,
1364        }
1365    }
1366
1367    /// Content padding for a medium leading button.
1368    /// `SplitButtonMediumTokens.LeadingButtonLeadingSpace` (24.0) /
1369    /// `LeadingButtonTrailingSpace` (24.0).
1370    pub fn medium_leading_content_padding() -> PaddingValues {
1371        PaddingValues {
1372            left: 24.0,
1373            right: 24.0,
1374            top: 0.0,
1375            bottom: 0.0,
1376        }
1377    }
1378
1379    /// Content padding for a medium trailing button.
1380    /// `SplitButtonMediumTokens.TrailingButtonLeadingSpace` (15.0) /
1381    /// `TrailingButtonTrailingSpace` (15.0).
1382    pub fn medium_trailing_content_padding() -> PaddingValues {
1383        PaddingValues {
1384            left: 15.0,
1385            right: 15.0,
1386            top: 0.0,
1387            bottom: 0.0,
1388        }
1389    }
1390
1391    /// Content padding for a large leading button (estimate).
1392    pub fn large_leading_content_padding() -> PaddingValues {
1393        PaddingValues {
1394            left: 32.0,
1395            right: 32.0,
1396            top: 0.0,
1397            bottom: 0.0,
1398        }
1399    }
1400
1401    /// Content padding for a large trailing button (estimate).
1402    pub fn large_trailing_content_padding() -> PaddingValues {
1403        PaddingValues {
1404            left: 24.0,
1405            right: 24.0,
1406            top: 0.0,
1407            bottom: 0.0,
1408        }
1409    }
1410
1411    /// Content padding for an extra-large leading button (estimate).
1412    pub fn xlarge_leading_content_padding() -> PaddingValues {
1413        PaddingValues {
1414            left: 32.0,
1415            right: 32.0,
1416            top: 0.0,
1417            bottom: 0.0,
1418        }
1419    }
1420
1421    /// Content padding for an extra-large trailing button (estimate).
1422    pub fn xlarge_trailing_content_padding() -> PaddingValues {
1423        PaddingValues {
1424            left: 24.0,
1425            right: 24.0,
1426            top: 0.0,
1427            bottom: 0.0,
1428        }
1429    }
1430}
1431
1432/// Default values for button group.
1433///
1434/// Token values sourced from `ButtonGroupSmallTokens` and
1435/// `ConnectedButtonGroupSmallTokens`.
1436pub struct ButtonGroupDefaults;
1437
1438impl ButtonGroupDefaults {
1439    /// The default percentage (15%) by which a pressed item expands.
1440    pub const EXPANDED_RATIO: f32 = 0.15;
1441
1442    /// Between-space from `ButtonGroupSmallTokens.BetweenSpace` (12.0.dp)
1443    /// -> used for unconnected (standard) button groups.
1444    pub const STANDARD_GAP: f32 = 12.0;
1445
1446    /// Between-space from `ConnectedButtonGroupSmallTokens.BetweenSpace` (2.0.dp)
1447    /// -> used for connected button groups.
1448    pub const CONNECTED_GAP: f32 = 2.0;
1449
1450    pub const CONTAINER_HEIGHT: f32 = 40.0;
1451
1452    // Connected button group shape helpers (shapes for leading/middle/trailing items)
1453
1454    /// Inner corner size for connected button group.
1455    pub const CONNECTED_INNER_CORNER: f32 = 8.0; // ConnectedButtonGroupSmallTokens.InnerCornerCornerSize
1456    /// Pressed inner corner size for connected button group.
1457    pub const CONNECTED_PRESSED_INNER_CORNER: f32 = 4.0; // PressedInnerCornerCornerSize
1458    /// Full corner size for checked state.
1459    pub const CONNECTED_CHECKED_CORNER: f32 = f32::INFINITY;
1460    /// Full corner size for outer edges.
1461    pub const CONNECTED_OUTER_CORNER: f32 = f32::INFINITY;
1462}
1463
1464/// Default values for carousel.
1465pub struct CarouselDefaults;
1466
1467impl CarouselDefaults {
1468    pub const MIN_SMALL_ITEM_SIZE: f32 = 40.0;
1469    pub const MAX_SMALL_ITEM_SIZE: f32 = 56.0;
1470    pub const ANCHOR_SIZE: f32 = 10.0;
1471}