SPB Git

Repository Public MIT

manifest.json 2.9 KB 63 lines json

1{2  "accessibility" : [3    "The picker is a system control: label, current value, the list of options and keyboard navigation come from the system.",4    "Option labels built with `Label` keep their text for VoiceOver.",5    "Long option names wrap in the inline presentation and are shown in full in menus."6  ],7  "category" : "selection",8  "changelog" : [9    {10      "changes" : [11        "Initial release."12      ],13      "date" : "2026-12-02",14      "version" : "1.0.0"15    }16  ],17  "dependencies" : [18    {19      "id" : "glass-foundation",20      "version" : "1.0.0"21    }22  ],23  "description" : "Generic picker over Hashable options, as a menu or a wheel depending on the platform.",24  "examples" : [25    {26      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassPickerExample: GlassExample {\n    public static let componentID = \"glass-picker\"\n\n    struct Plan: Hashable {\n        let name: String\n        let symbol: String\n    }\n\n    private static let plans = [\n        Plan(name: \"Starter\", symbol: \"leaf\"),\n        Plan(name: \"Team\", symbol: \"person.3\"),\n        Plan(name: \"Enterprise with a long name\", symbol: \"building.2\"),\n    ]\n\n    @State private var plan = GlassPickerExample.plans[0]\n    @State private var currency = \"CAD\"\n    @State private var hour = 9\n    @State private var priority = \"Normal\"\n\n    public init() {}\n\n    public var body: some View {\n        Form {\n            GlassPicker(\"Plan\", selection: $plan, options: Self.plans) { plan in\n                Label(plan.name, systemImage: plan.symbol)\n            }\n            GlassPicker(\"Currency\", selection: $currency, options: [\"CAD\", \"EUR\", \"JPY\", \"USD\"])\n            GlassPicker(\"Reminder hour\", selection: $hour, options: Array(6...22), presentation: .wheel) { hour in\n                \"\\(hour.formatted(.number.precision(.integerLength(2)))):00\"\n            }\n            GlassPicker(\"Priority\", selection: $priority, options: [\"Low\", \"Normal\", \"High\"], presentation: .inline)\n            GlassPicker(\"Region\", selection: .constant(\"Canada\"), options: [\"Canada\"])\n                .disabled(true)\n        }\n    }\n}\n\n#Preview(\"GlassPicker\") { GlassPickerExample() }\n",27      "title" : "GlassPicker example"28    }29  ],30  "files" : [31    {32      "bytes" : 5826,33      "path" : "Forms/Selection/GlassPicker.swift",34      "sha256" : "ba7dc8cd32f4dc0a5bbfc2c92172e37ad59417aab4eb763baaebbc7e9da806af"35    }36  ],37  "frameworks" : [3839  ],40  "id" : "glass-picker",41  "kind" : "native-wrapper",42  "license" : "MIT",43  "minimumOS" : {44    "iOS" : "26.0",45    "iPadOS" : "26.0",46    "macOS" : "26.0"47  },48  "name" : "GlassPicker",49  "platforms" : [50    "iOS",51    "iPadOS",52    "macOS"53  ],54  "schemaVersion" : 1,55  "sha256" : "6c6ead716af4d6976b82ddf2908ec0ffe67849d119921a00f979c85f355cd0c7",56  "symbols" : [57    "GlassPickerPresentation",58    "Resolved",59    "GlassPicker"60  ],61  "version" : "1.0.0"62}63
Files main
Menu

Theme