SPB Git

Repository Public MIT

manifest.json 3.8 KB 65 lines json

1{2  "accessibility" : [3    "Rows are system list rows: selection, headers and badges are announced by the system; the list is fully keyboard navigable.",4    "Symbols are decorative; the title is always present.",5    "Search ignores case, accents and character width, and matches every word of the query in any order.",6    "Row titles wrap at large text sizes."7  ],8  "category" : "navigation",9  "changelog" : [10    {11      "changes" : [12        "Initial release."13      ],14      "date" : "2026-12-02",15      "version" : "1.0.0"16    }17  ],18  "dependencies" : [19    {20      "id" : "glass-foundation",21      "version" : "1.0.0"22    }23  ],24  "description" : "NavigationSplitView sidebar with sections, selection, search and adaptive collapse.",25  "examples" : [26    {27      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassSidebarExample: GlassExample {\n    public static let componentID = \"glass-sidebar\"\n    @State private var selection: String? = \"inbox\"\n    @State private var columnVisibility: NavigationSplitViewVisibility = .automatic\n\n    public init() {}\n\n    private let sections: [GlassSidebarSection<String>] = [\n        GlassSidebarSection(id: \"mailboxes\", title: \"Mailboxes\", items: [\n            GlassSidebarItem(id: \"inbox\", title: \"Inbox\", systemImage: \"tray\", badge: 12, keywords: [\"unread\"]),\n            GlassSidebarItem(id: \"drafts\", title: \"Drafts\", systemImage: \"doc\", badge: 2),\n            GlassSidebarItem(id: \"sent\", title: \"Sent\", systemImage: \"paperplane\"),\n            GlassSidebarItem(id: \"archive\", title: \"Archive\", systemImage: \"archivebox\"),\n        ]),\n        GlassSidebarSection(id: \"labels\", title: \"Labels\", items: [\n            GlassSidebarItem(id: \"travel\", title: \"Voyages et séjours\", systemImage: \"airplane\", keywords: [\"travel\", \"trips\"]),\n            GlassSidebarItem(id: \"receipts\", title: \"Reçus\", systemImage: \"receipt\", keywords: [\"receipts\"]),\n            GlassSidebarItem(id: \"long\", title: \"A label with a deliberately long name to check wrapping\", systemImage: \"tag\"),\n        ]),\n    ]\n\n    public var body: some View {\n        GlassSidebar(\"Mail\", sections: sections, selection: $selection, columnVisibility: $columnVisibility, searchPrompt: \"Search mailboxes\") { id in\n            if let id {\n                VStack(spacing: 12) {\n                    Text(verbatim: title(of: id)).font(.title2)\n                    Button(columnVisibility == .detailOnly ? \"Show sidebar\" : \"Hide sidebar\") {\n                        columnVisibility = columnVisibility == .detailOnly ? .all : .detailOnly\n                    }\n                }\n                .padding()\n                .navigationTitle(Text(verbatim: title(of: id)))\n            } else {\n                ContentUnavailableView(\"Select a mailbox\", systemImage: \"sidebar.left\")\n            }\n        }\n    }\n\n    private func title(of id: String) -> String {\n        sections.flatMap(\\.items).first { $0.id == id }?.title ?? id\n    }\n}\n\n#Preview(\"GlassSidebar\") { GlassSidebarExample() }\n",28      "title" : "GlassSidebar example"29    }30  ],31  "files" : [32    {33      "bytes" : 9115,34      "path" : "Navigation/Navigation/GlassSidebar.swift",35      "sha256" : "292ee5b8ca3818f660ff7afd92acc74e006b77daf6e49337c94a51ffd25198c7"36    }37  ],38  "frameworks" : [3940  ],41  "id" : "glass-sidebar",42  "kind" : "native-wrapper",43  "license" : "MIT",44  "minimumOS" : {45    "iOS" : "26.0",46    "iPadOS" : "26.0",47    "macOS" : "26.0"48  },49  "name" : "GlassSidebar",50  "platforms" : [51    "iOS",52    "iPadOS",53    "macOS"54  ],55  "schemaVersion" : 1,56  "sha256" : "d766dec44c1b64aa2f3ebcd20c1655249df8b55daedbf825781309433841957a",57  "symbols" : [58    "GlassSidebarItem",59    "GlassSidebarSection",60    "GlassSidebarFilter",61    "GlassSidebar"62  ],63  "version" : "1.0.0"64}65
Files main
Menu

Theme