Repository Public MIT
1{2 "accessibility" : [3 "Day titles are headers, so VoiceOver users can jump from day to day with the rotor.",4 "Each event is one element reading its time, title and detail.",5 "Markers and the connecting line are decorative and hidden from assistive technologies.",6 "Dates and times are formatted with `Date.FormatStyle` in the environment's locale, calendar and time zone; text follows Dynamic Type and wraps.",7 "Layout uses leading and trailing only, so it mirrors in right-to-left languages."8 ],9 "category" : "data",10 "changelog" : [11 {12 "changes" : [13 "Initial release."14 ],15 "date" : "2026-12-02",16 "version" : "1.0.0"17 }18 ],19 "dependencies" : [20 {21 "id" : "glass-foundation",22 "version" : "1.0.0"23 }24 ],25 "description" : "Dated events in order, grouped by day and localised, with an empty state.",26 "examples" : [27 {28 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassTimelineExample: GlassExample {\n public static let componentID = \"glass-timeline\"\n\n // Fictitious delivery log, relative to a fixed instant so that the example is reproducible.\n private static let events: [GlassTimelineEvent] = {\n let start = Date(timeIntervalSince1970: 1_780_300_800)\n func at(_ hours: Double) -> Date { start.addingTimeInterval(hours * 3600) }\n return [\n GlassTimelineEvent(id: \"ordered\", date: at(0), title: \"Order placed\", detail: \"Order A-1042, three items\", systemImage: \"cart\"),\n GlassTimelineEvent(id: \"paid\", date: at(0.2), title: \"Payment confirmed\"),\n GlassTimelineEvent(id: \"packed\", date: at(21), title: \"Parcel packed\", detail: \"Warehouse 4, aisle 12 — a long note that wraps over several lines on a narrow screen without being cut off.\"),\n GlassTimelineEvent(id: \"shipped\", date: at(27.5), title: \"Handed to the carrier\", systemImage: \"shippingbox\"),\n GlassTimelineEvent(id: \"transit\", date: at(52), title: \"In transit 🚚\", detail: \"مركز الفرز · Centre de tri\"),\n GlassTimelineEvent(id: \"delivered\", date: at(76), title: \"Delivered\", systemImage: \"checkmark.circle\"),\n ]\n }()\n\n @State private var order = GlassTimelineOrder.descending\n @State private var showsEmpty = false\n\n public init() {}\n\n public var body: some View {\n ScrollView {\n VStack(alignment: .leading, spacing: 16) {\n Picker(\"Order\", selection: $order) {\n Text(\"Newest first\").tag(GlassTimelineOrder.descending)\n Text(\"Oldest first\").tag(GlassTimelineOrder.ascending)\n }\n .pickerStyle(.segmented)\n Toggle(\"Show the empty state\", isOn: $showsEmpty)\n GlassTimeline(showsEmpty ? [] : Self.events, order: order, emptyTitle: \"Nothing has happened yet\")\n }\n .padding()\n }\n }\n}\n\n#Preview(\"GlassTimeline\") { GlassTimelineExample() }\n#Preview(\"GlassTimeline — français, Tokyo\") {\n GlassTimelineExample()\n .environment(\\.locale, Locale(identifier: \"fr_CA\"))\n .environment(\\.timeZone, TimeZone(identifier: \"Asia/Tokyo\") ?? .gmt)\n}\n",29 "title" : "GlassTimeline example"30 }31 ],32 "files" : [33 {34 "bytes" : 10311,35 "path" : "Data/Data/GlassTimeline.swift",36 "sha256" : "68a889575cffe3666bba9172e386a6412bd23271c2f3edec18b047ec0b50a5df"37 }38 ],39 "frameworks" : [4041 ],42 "id" : "glass-timeline",43 "kind" : "content-component",44 "license" : "MIT",45 "minimumOS" : {46 "iOS" : "26.0",47 "iPadOS" : "26.0",48 "macOS" : "26.0"49 },50 "name" : "GlassTimeline",51 "platforms" : [52 "iOS",53 "iPadOS",54 "macOS"55 ],56 "schemaVersion" : 1,57 "sha256" : "ce65e6b5047d728f1a420832e6b7c85a0c6cd7f0803f5bb10259e17ad776c1f8",58 "symbols" : [59 "GlassTimelineEvent",60 "GlassTimelineOrder",61 "GlassTimelineDay",62 "GlassTimelineLogic",63 "GlassTimeline"64 ],65 "version" : "1.0.0"66}67