- Add VoiceOver labels, hints, and element grouping across all 60+ views - Add Reduce Motion support (Theme.Animation.prefersReducedMotion) to all animations - Replace fixed font sizes with semantic Dynamic Type styles - Hide decorative elements from VoiceOver with .accessibilityHidden(true) - Add .minimumHitTarget() modifier ensuring 44pt touch targets - Add AccessibilityAnnouncer utility for VoiceOver announcements - Improve color contrast values in Theme.swift for WCAG AA compliance - Extract CloudKitContainerConfig for explicit container identity - Remove PostHog debug console log from AnalyticsManager Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
65 lines
1.7 KiB
Swift
65 lines
1.7 KiB
Swift
//
|
|
// DayHeaderRow.swift
|
|
// SportsTime
|
|
//
|
|
// Header row for a day in the itinerary with day number, date, and add button.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct DayHeaderRow: View {
|
|
let dayNumber: Int
|
|
let date: Date
|
|
let isEmpty: Bool
|
|
let onAddTapped: () -> Void
|
|
|
|
@Environment(\.colorScheme) private var colorScheme
|
|
|
|
private var formattedDate: String {
|
|
date.formatted(.dateTime.weekday(.wide).month().day())
|
|
}
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
HStack {
|
|
Text("Day \(dayNumber) - \(formattedDate)")
|
|
.font(.title3)
|
|
.fontWeight(.semibold)
|
|
.foregroundStyle(Theme.textPrimary(colorScheme))
|
|
|
|
Spacer()
|
|
|
|
Button(action: onAddTapped) {
|
|
Image(systemName: "plus.circle.fill")
|
|
.font(.title2)
|
|
.foregroundStyle(Theme.warmOrange)
|
|
}
|
|
.minimumHitTarget()
|
|
.accessibilityLabel("Add item to this day")
|
|
}
|
|
|
|
if isEmpty {
|
|
Text("No items yet, tap + to add")
|
|
.font(.subheadline)
|
|
.foregroundStyle(Theme.textSecondary(colorScheme))
|
|
}
|
|
}
|
|
.padding(.vertical, Theme.Spacing.sm)
|
|
.padding(.horizontal, Theme.Spacing.md)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
VStack(spacing: 16) {
|
|
// Day with items (not empty)
|
|
DayHeaderRow(dayNumber: 1, date: Date(), isEmpty: false, onAddTapped: {})
|
|
|
|
Divider()
|
|
|
|
// Empty day
|
|
DayHeaderRow(dayNumber: 2, date: Date().addingTimeInterval(86400), isEmpty: true, onAddTapped: {})
|
|
}
|
|
.padding()
|
|
.background(Color.gray.opacity(0.1))
|
|
}
|