// // BuildTokens.swift // BuildApp // // Adapted from CA Votes Config/DesignSystem.swift v4.0. // Existing spacing aliases retain their values to avoid changing unrelated layouts. // import SwiftUI enum BuildTokens { // MARK: - Spacing /// Use these instead of hardcoded values for consistent spacing enum Spacing { static let xxxs: CGFloat = 2 static let xxs: CGFloat = 4 static let xs: CGFloat = 8 static let sm: CGFloat = 12 static let md: CGFloat = 16 static let lg: CGFloat = 20 static let xl: CGFloat = 24 static let xxl: CGFloat = 32 static let section: CGFloat = 24 static let screen: CGFloat = 16 static let card: CGFloat = 16 static let spacious: CGFloat = 40 static let hero: CGFloat = 48 } // MARK: - Typography /// Dynamic Type-aware typography that scales with user preferences static func profileName() -> Font { .title.weight(.bold) // Scales automatically with Dynamic Type } static func profileUsername() -> Font { .subheadline } static func profileHeadline() -> Font { .body.weight(.medium) } static func profileBio() -> Font { .body } // MARK: - Layout enum Layout { /// Minimum tap target size per Apple HIG (44pt) static let minTapTarget: CGFloat = 44 static let primaryHit: CGFloat = 56 static let buttonHeight: CGFloat = 50 static let iconBubble: CGFloat = 50 static let readableWidth: CGFloat = 520 } // MARK: - Corner Radius /// Uses @ScaledMetric for accessibility scaling enum CornerRadius { static var sm: CGFloat { 8 } static var md: CGFloat { 12 } static var lg: CGFloat { 16 } static var xl: CGFloat { 20 } static var hero: CGFloat { 24 } } enum BorderWidth { static let hairline: CGFloat = 0.5 static let thin: CGFloat = 1 static let medium: CGFloat = 2 static let focus: CGFloat = 3 } enum Typography { static let hero = Font.largeTitle.weight(.bold) static let section = Font.title2.weight(.bold) static let cardTitle = Font.headline.weight(.semibold) static let body = Font.body static let supporting = Font.subheadline static let button = Font.body.weight(.semibold) static let caption = Font.caption } // MARK: - Colors (Now using BuildColors) enum Colors { static var accent: Color { BuildColors.Brand.primary } static var success: Color { BuildColors.Semantic.success } static var warning: Color { BuildColors.Semantic.warning } static var error: Color { BuildColors.Semantic.error } static var neutral: Color { BuildColors.Text.secondary } /// Gradient for enhanced follow button - Blue to Violet static var followGradient: LinearGradient { BuildColors.Gradient.followButton } /// Dark mode aware follow gradient (now uses same gradient - colors adapt via assets) static func followGradientAdaptive(colorScheme: ColorScheme) -> LinearGradient { // Colors are now adaptive via asset catalog, so same gradient works for both modes return BuildColors.Gradient.followButton } /// "Currently Building" badge gradient - Orange to Yellow static var currentlyBuildingGradient: LinearGradient { BuildColors.Gradient.currentlyBuilding } } // MARK: - Shadows (Neutral black, no blue glow) enum Shadows { /// Shadow for buttons (color, radius, y-offset) static let button: (Color, CGFloat, CGFloat) = ( BuildColors.Shadow.button.color, BuildColors.Shadow.button.radius, BuildColors.Shadow.button.y ) /// Shadow for avatar (color, radius, y-offset) static let avatar: (Color, CGFloat, CGFloat) = ( BuildColors.Shadow.avatar.color, BuildColors.Shadow.avatar.radius, BuildColors.Shadow.avatar.y ) /// Shadow for cards (color, radius, y-offset) static let card: (Color, CGFloat, CGFloat) = ( BuildColors.Shadow.card.color, BuildColors.Shadow.card.radius, BuildColors.Shadow.card.y ) } // MARK: - Animations enum Animation { static let quick = SwiftUI.Animation.easeOut(duration: 0.2) static let standard = SwiftUI.Animation.easeInOut(duration: 0.3) static let spring = SwiftUI.Animation.spring(response: 0.3, dampingFraction: 0.7) static let springBouncy = SwiftUI.Animation.spring(response: 0.4, dampingFraction: 0.6) /// Returns nil if reduce motion is enabled, otherwise returns the animation static func respectingReduceMotion(_ animation: SwiftUI.Animation, reduceMotion: Bool) -> SwiftUI.Animation? { reduceMotion ? nil : animation } } } // Note: Color(hex:), String.formatNumber(), and String.initials are defined in // Color+Extensions.swift and String+Extensions.swift respectively