use crate::tokens::dtcg::DimensionValue;
use crate::tokens::MacDesignTokens;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CheckboxSizeMetrics {
pub box_size: DimensionValue,
pub corner_radius: DimensionValue,
pub label_gap: DimensionValue,
pub font_size: DimensionValue,
pub checkmark_stroke: DimensionValue,
pub first_baseline_offset_from_top: DimensionValue,
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CheckboxMetrics {
pub regular: CheckboxSizeMetrics,
pub small: CheckboxSizeMetrics,
pub mini: CheckboxSizeMetrics,
pub border_width: DimensionValue,
pub check_p1_x: DimensionValue,
pub check_p1_y: DimensionValue,
pub check_p2_x: DimensionValue,
pub check_p2_y: DimensionValue,
pub check_p3_x: DimensionValue,
pub check_p3_y: DimensionValue,
pub mixed_bar_inset_ratio: DimensionValue,
}
impl Default for CheckboxMetrics {
fn default() -> Self {
MacDesignTokens::default_shared().checkbox_metrics().clone()
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LabelMetrics {
pub regular_font_size: DimensionValue,
pub regular_height: DimensionValue,
pub regular_baseline_from_top: DimensionValue,
pub regular_baseline_from_bottom: DimensionValue,
pub regular_ascender: DimensionValue,
pub regular_descender: DimensionValue,
pub regular_cap_height: DimensionValue,
pub small_font_size: DimensionValue,
pub small_height: DimensionValue,
pub small_baseline_from_top: DimensionValue,
pub small_baseline_from_bottom: DimensionValue,
pub small_ascender: DimensionValue,
pub small_descender: DimensionValue,
pub small_cap_height: DimensionValue,
pub mini_font_size: DimensionValue,
pub mini_height: DimensionValue,
pub mini_baseline_from_top: DimensionValue,
pub mini_baseline_from_bottom: DimensionValue,
pub mini_ascender: DimensionValue,
pub mini_descender: DimensionValue,
pub mini_cap_height: DimensionValue,
pub semibold_stroke_boost: DimensionValue,
pub bold_stroke_boost: DimensionValue,
pub wcag_aa_normal_ratio: DimensionValue,
pub wcag_aa_large_ratio: DimensionValue,
pub vibrancy_gain: DimensionValue,
}
impl Default for LabelMetrics {
fn default() -> Self {
MacDesignTokens::default_shared().label_metrics().clone()
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HelpButtonMetrics {
pub diameter: DimensionValue,
pub small_diameter: DimensionValue,
pub mini_diameter: DimensionValue,
pub font_size: DimensionValue,
pub small_font_size: DimensionValue,
pub mini_font_size: DimensionValue,
pub border_width: DimensionValue,
pub shadow_offset_y: DimensionValue,
}
impl Default for HelpButtonMetrics {
fn default() -> Self {
MacDesignTokens::default_shared()
.help_button_metrics()
.clone()
}
}
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct InlineActionButtonMetrics {
pub diameter: DimensionValue,
pub icon_size: DimensionValue,
pub border_width: DimensionValue,
pub icon_stroke_width: DimensionValue,
}
impl Default for InlineActionButtonMetrics {
fn default() -> Self {
MacDesignTokens::default_shared()
.inline_action_button_metrics()
.clone()
}
}