118 lines
3.5 KiB
Swift
118 lines
3.5 KiB
Swift
// ── ChronoMind Design Tokens ───────────────────────────────────
|
|
// Colors from PRD Section 9 (--cm-* CSS vars → Swift Color literals)
|
|
// Typography from PRD Section 9.2
|
|
|
|
import SwiftUI
|
|
|
|
// MARK: - Colors
|
|
|
|
enum CMColors {
|
|
// Backgrounds
|
|
static let bg = Color(hex: 0x0A0B0F)
|
|
static let surface = Color(hex: 0x12141D)
|
|
static let surfaceHover = Color(hex: 0x1A1D2A)
|
|
static let border = Color(hex: 0x2A2D3A)
|
|
|
|
// Text
|
|
static let text = Color(hex: 0xE8ECF4)
|
|
static let textSecondary = Color(hex: 0x8A92A6)
|
|
static let textMuted = Color(hex: 0x5A6178)
|
|
|
|
// Urgency
|
|
static let critical = Color(hex: 0xFF4757)
|
|
static let important = Color(hex: 0xFF9F43)
|
|
static let standard = Color(hex: 0xFECA57)
|
|
static let gentle = Color(hex: 0x2ED573)
|
|
static let passive = Color(hex: 0x5B8DEE)
|
|
|
|
// Accent
|
|
static let accent = Color(hex: 0x5B8DEE)
|
|
static let accentGlow = Color(hex: 0x5B8DEE, alpha: 0.2)
|
|
|
|
// Semantic
|
|
static let success = Color(hex: 0x2ED573)
|
|
static let warning = Color(hex: 0xFECA57)
|
|
static let error = Color(hex: 0xFF4757)
|
|
|
|
// Light theme variants
|
|
static let lightBg = Color(hex: 0xF8F9FC)
|
|
static let lightSurface = Color.white
|
|
static let lightSurfaceHover = Color(hex: 0xF0F2F8)
|
|
static let lightBorder = Color(hex: 0xE2E5EE)
|
|
static let lightText = Color(hex: 0x1A1D2A)
|
|
static let lightTextSecondary = Color(hex: 0x5A6178)
|
|
static let lightTextMuted = Color(hex: 0x8A92A6)
|
|
|
|
/// Get urgency color for a given level
|
|
static func urgencyColor(_ level: UrgencyLevel) -> Color {
|
|
switch level {
|
|
case .critical: return critical
|
|
case .important: return important
|
|
case .standard: return standard
|
|
case .gentle: return gentle
|
|
case .passive: return passive
|
|
}
|
|
}
|
|
|
|
/// Get urgency background color (15% opacity)
|
|
static func urgencyBg(_ level: UrgencyLevel) -> Color {
|
|
urgencyColor(level).opacity(0.15)
|
|
}
|
|
|
|
/// Get urgency border color (40% opacity)
|
|
static func urgencyBorder(_ level: UrgencyLevel) -> Color {
|
|
urgencyColor(level).opacity(0.4)
|
|
}
|
|
}
|
|
|
|
// MARK: - Typography
|
|
|
|
enum CMFonts {
|
|
/// Display font — Space Grotesk (clock face, timer digits)
|
|
static func display(size: CGFloat, weight: Font.Weight = .bold) -> Font {
|
|
.system(size: size, weight: weight, design: .rounded)
|
|
}
|
|
|
|
/// Body font — Inter/SF Pro equivalent
|
|
static func body(size: CGFloat, weight: Font.Weight = .regular) -> Font {
|
|
.system(size: size, weight: weight, design: .default)
|
|
}
|
|
|
|
/// Mono font — JetBrains Mono (countdown digits, time displays)
|
|
static func mono(size: CGFloat, weight: Font.Weight = .regular) -> Font {
|
|
.system(size: size, weight: weight, design: .monospaced)
|
|
}
|
|
}
|
|
|
|
// MARK: - Spacing
|
|
|
|
enum CMSpacing {
|
|
static let xxs: CGFloat = 2
|
|
static let xs: CGFloat = 4
|
|
static let sm: CGFloat = 8
|
|
static let md: CGFloat = 12
|
|
static let lg: CGFloat = 16
|
|
static let xl: CGFloat = 24
|
|
static let xxl: CGFloat = 32
|
|
static let xxxl: CGFloat = 48
|
|
}
|
|
|
|
// MARK: - Corner Radius
|
|
|
|
enum CMRadius {
|
|
static let sm: CGFloat = 8
|
|
static let md: CGFloat = 12
|
|
static let lg: CGFloat = 16
|
|
static let xl: CGFloat = 20
|
|
static let full: CGFloat = 999
|
|
}
|
|
|
|
// MARK: - Shadows
|
|
|
|
enum CMShadow {
|
|
static let sm = Color.black.opacity(0.1)
|
|
static let md = Color.black.opacity(0.2)
|
|
static let lg = Color.black.opacity(0.3)
|
|
static let glow = CMColors.accent.opacity(0.3)
|
|
}
|