SPB Git

Repository Public MIT

manifest.json 4.6 KB 80 lines json

1{2  "accessibility" : [3    "Each button is a `Label`: the bar shows the symbol, VoiceOver reads the title, macOS shows it as a tooltip.",4    "The overflow menu is labelled \"More actions\" (localised) and lists titles with symbols; the destructive role is conveyed by the system.",5    "Shortcuts are attached to the buttons themselves, in the bar or in the menu.",6    "At accessibility text sizes fewer controls are kept in the bar."7  ],8  "category" : "navigation",9  "changelog" : [10    {11      "changes" : [12        "Release 1.1.0: see the project changelog."13      ],14      "date" : "2026-12-03",15      "version" : "1.1.0"16    },17    {18      "changes" : [19        "Initial release."20      ],21      "date" : "2026-12-02",22      "version" : "1.0.0"23    }24  ],25  "dependencies" : [26    {27      "id" : "glass-foundation",28      "version" : "1.1.0"29    }30  ],31  "description" : "Groups of toolbar actions with system placements, overflow and keyboard shortcuts.",32  "examples" : [33    {34      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassToolbarExample: GlassExample {\n    public static let componentID = \"glass-toolbar\"\n    @State private var log = [\"Nothing yet\"]\n    @State private var isPinned = false\n\n    public init() {}\n\n    private func record(_ entry: String) {\n        log.insert(entry, at: 0)\n    }\n\n    private var groups: [GlassToolbarGroup] {\n        [\n            GlassToolbarGroup(id: \"document\", placement: .trailing, capacity: 3, actions: [\n                GlassToolbarAction(id: \"share\", title: \"Share\", systemImage: \"square.and.arrow.up\", shortcut: KeyboardShortcut(\"s\", modifiers: [.command, .shift]), priority: .high) { record(\"Shared\") },\n                GlassToolbarAction(id: \"pin\", title: isPinned ? \"Unpin\" : \"Pin\", systemImage: isPinned ? \"pin.fill\" : \"pin\") {\n                    isPinned.toggle()\n                    record(isPinned ? \"Pinned\" : \"Unpinned\")\n                },\n                GlassToolbarAction(id: \"duplicate\", title: \"Duplicate\", systemImage: \"plus.square.on.square\", shortcut: KeyboardShortcut(\"d\")) { record(\"Duplicated\") },\n                GlassToolbarAction(id: \"archive\", title: \"Archive\", systemImage: \"archivebox\", isEnabled: log.count > 1, priority: .low) { record(\"Archived\") },\n                GlassToolbarAction(id: \"delete\", title: \"Delete\", systemImage: \"trash\", role: .destructive, priority: .low) { log = [\"Nothing yet\"] },\n            ]),\n            GlassToolbarGroup(id: \"export\", placement: .secondary, actions: [\n                GlassToolbarAction(id: \"pdf\", title: \"Export as PDF\", systemImage: \"doc.richtext\") { record(\"Exported as PDF\") },\n                GlassToolbarAction(id: \"print\", title: \"Print\", systemImage: \"printer\", shortcut: KeyboardShortcut(\"p\")) { record(\"Printed\") },\n            ]),\n            GlassToolbarGroup(id: \"format\", placement: .bottom, actions: [\n                GlassToolbarAction(id: \"bold\", title: \"Bold\", systemImage: \"bold\", shortcut: KeyboardShortcut(\"b\")) { record(\"Bold\") },\n                GlassToolbarAction(id: \"italic\", title: \"Italic\", systemImage: \"italic\", shortcut: KeyboardShortcut(\"i\")) { record(\"Italic\") },\n            ]),\n        ]\n    }\n\n    public var body: some View {\n        NavigationStack {\n            List(Array(log.enumerated()), id: \\.offset) { _, entry in\n                Text(verbatim: entry)\n            }\n            .navigationTitle(\"Document\")\n            .glassToolbar(groups)\n        }\n    }\n}\n\n#Preview(\"GlassToolbar\") { GlassToolbarExample() }\n",35      "title" : "GlassToolbar example"36    }37  ],38  "files" : [39    {40      "bytes" : 6054,41      "path" : "Navigation/Navigation/GlassToolbar.swift",42      "sha256" : "11bc027ca5e584d354d11c7925af4a17e6b3bc1d8f96a9ed88bd6102aa69eace"43    },44    {45      "bytes" : 8101,46      "path" : "Navigation/Navigation/GlassToolbarAction.swift",47      "sha256" : "ee1353ccb7b6ed41650b3cd92697abfc69035d3af8fc0cccc00082eec820b8c7"48    }49  ],50  "frameworks" : [5152  ],53  "id" : "glass-toolbar",54  "kind" : "native-wrapper",55  "license" : "MIT",56  "minimumOS" : {57    "iOS" : "26.0",58    "iPadOS" : "26.0",59    "macOS" : "26.0"60  },61  "name" : "GlassToolbar",62  "platforms" : [63    "iOS",64    "iPadOS",65    "macOS"66  ],67  "schemaVersion" : 1,68  "sha256" : "4b40480b9a2d867f05cc2012fb18640fdddfe2f70b213c6c0beb16d1b8483197",69  "symbols" : [70    "GlassToolbarPlacement",71    "GlassToolbarGroup",72    "GlassToolbar",73    "GlassToolbarActionPriority",74    "GlassToolbarAction",75    "GlassToolbarLayout",76    "Split"77  ],78  "version" : "1.1.0"79}80
Files main
Menu

Theme