New framework: - AccessibilityLabels.swift: centralized A11y struct with VoiceOver strings - AccessibilityModifiers.swift: reusable .a11yHeader, .a11yDecorative, .a11yButton, .a11yCard, .a11yStatValue View extensions Shared components: decorative elements hidden, stat views combined, status/priority badges labeled, error views announced, empty states grouped Cards: ResidenceCard, TaskCard, DynamicTaskCard, ContractorCard, DocumentCard, WarrantyCard — all grouped with combined labels, chevrons hidden, action buttons labeled Main screens: Login, Register, Residences, Tasks, Contractors, Documents — toolbar buttons labeled, section headers marked, form field hints added Onboarding: all 10 views — header traits, button hints, task selection state, progress indicator, decorative backgrounds hidden Profile/Subscription: toggle hints, theme selection state, feature comparison table accessibility, subscription button labels iOS build verified: BUILD SUCCEEDED
54 lines
1.2 KiB
Swift
54 lines
1.2 KiB
Swift
import SwiftUI
|
|
|
|
struct TaskStatChip: View {
|
|
let icon: String
|
|
let value: String
|
|
let label: String
|
|
let color: Color
|
|
|
|
var body: some View {
|
|
HStack(spacing: 4) {
|
|
Image(systemName: icon)
|
|
.font(.caption)
|
|
.foregroundColor(color)
|
|
|
|
Text(value)
|
|
.font(.subheadline)
|
|
.fontWeight(.bold)
|
|
.foregroundColor(color)
|
|
|
|
Text(label)
|
|
.font(.caption)
|
|
.foregroundColor(Color.appTextSecondary)
|
|
}
|
|
.accessibilityElement(children: .combine)
|
|
.accessibilityLabel(A11y.Common.stat(value: value, label: label))
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
VStack(spacing: 16) {
|
|
TaskStatChip(
|
|
icon: "list.bullet",
|
|
value: "10",
|
|
label: "Tasks",
|
|
color: .blue
|
|
)
|
|
|
|
TaskStatChip(
|
|
icon: "checkmark.circle.fill",
|
|
value: "3",
|
|
label: "Done",
|
|
color: .green
|
|
)
|
|
|
|
TaskStatChip(
|
|
icon: "clock.fill",
|
|
value: "5",
|
|
label: "Pending",
|
|
color: .orange
|
|
)
|
|
}
|
|
.padding()
|
|
}
|