{
  "accessibility" : [
    "Each cell is a button labelled \"Image n of m, description\" with the image trait.",
    "In the viewer the image carries the same label and supports the VoiceOver zoom action; the buttons are labelled \"Previous\", \"Next\" and \"Close\".",
    "Keyboard: left and right arrows navigate, Escape closes.",
    "Failure is a symbol plus text. The double-tap zoom animation becomes a short fade with Reduce Motion."
  ],
  "category" : "media",
  "changelog" : [
    {
      "changes" : [
        "Release 1.1.0: see the project changelog."
      ],
      "date" : "2026-12-03",
      "version" : "1.1.0"
    },
    {
      "changes" : [
        "Initial release."
      ],
      "date" : "2026-12-02",
      "version" : "1.0.0"
    }
  ],
  "dependencies" : [
    {
      "id" : "glass-foundation",
      "version" : "1.1.0"
    },
    {
      "id" : "glass-icon-button",
      "version" : "1.1.0"
    },
    {
      "id" : "glass-media-support",
      "version" : "1.1.0"
    }
  ],
  "description" : "Lazy image grid with a zoomable viewer, navigation and cancellable loading.",
  "examples" : [
    {
      "code" : "import SwiftUI\nimport CoreGraphics\nimport SPGlassKit\n\npublic struct GlassGalleryExample: GlassExample {\n    public static let componentID = \"glass-gallery\"\n\n    public init() {}\n\n    public var body: some View {\n        VStack(alignment: .leading, spacing: 8) {\n            Text(\"Sample data · drawings and gradients generated in code, one slow image and one failing image.\")\n                .font(.caption)\n                .foregroundStyle(.secondary)\n                .padding(.horizontal)\n            GlassGallery(items: Self.items, cacheCapacity: 12, layout: .featured, selection: \"drawing-1\")\n        }\n    }\n\n    private struct SampleLoadingError: Error {}\n\n    static let items: [GlassGalleryItem] = {\n        let names = [\"Dawn\", \"Lagoon\", \"Orchard\", \"Ember\", \"Glacier\", \"Dusk\", \"Moss\", \"Coral\", \"Slate\", \"Saffron\", \"Iris\", \"Tundra\"]\n        var items = names.enumerated().map { index, name in\n            GlassGalleryItem(id: \"gradient-\\(index)\", description: \"\\(name) gradient\", loadCGImage: {\n                // Stands in for decoding a file; the sleep makes cancellation observable while scrolling.\n                try await Task.sleep(for: .milliseconds(index == 3 ? 1_500 : 120))\n                return try gradient(hue: Double(index) / Double(names.count))\n            })\n        }\n        // Local images, already in memory: the drawn compositions of the examples.\n        for index in (0..<6).reversed() {\n            items.insert(GlassGalleryItem(id: \"drawing-\\(index)\", description: SampleArtwork.title(index), image: SampleArtwork.image(index)), at: 0)\n        }\n        items.insert(GlassGalleryItem(id: \"broken\", description: \"An image that fails to load\", load: { throw SampleLoadingError() }), at: 8)\n        return items\n    }()\n\n    /// Draws a diagonal two-colour gradient into a bitmap.\n    nonisolated static func gradient(hue: Double, side: Int = 256) throws -> CGImage {\n        let space = CGColorSpaceCreateDeviceRGB()\n        guard let context = CGContext(data: nil, width: side, height: side, bitsPerComponent: 8, bytesPerRow: 0, space: space, bitmapInfo: CGImageAlphaInfo.premultipliedLast.rawValue) else {\n            throw SampleLoadingError()\n        }\n        let colors = [rgb(hue: hue), rgb(hue: (hue + 0.18).truncatingRemainder(dividingBy: 1))] as CFArray\n        guard let gradient = CGGradient(colorsSpace: space, colors: colors, locations: [0, 1]) else {\n            throw SampleLoadingError()\n        }\n        context.drawLinearGradient(gradient, start: .zero, end: CGPoint(x: side, y: side), options: [])\n        guard let image = context.makeImage() else { throw SampleLoadingError() }\n        return image\n    }\n\n    /// A saturated colour for a hue in 0…1, without any platform colour type.\n    nonisolated private static func rgb(hue: Double) -> CGColor {\n        let sector = hue * 6\n        let x = 1 - abs(sector.truncatingRemainder(dividingBy: 2) - 1)\n        let (r, g, b): (Double, Double, Double) = switch Int(sector) % 6 {\n        case 0: (1, x, 0)\n        case 1: (x, 1, 0)\n        case 2: (0, 1, x)\n        case 3: (0, x, 1)\n        case 4: (x, 0, 1)\n        default: (1, 0, x)\n        }\n        return CGColor(red: 0.25 + 0.6 * r, green: 0.25 + 0.6 * g, blue: 0.25 + 0.6 * b, alpha: 1)\n    }\n}\n\n#Preview(\"GlassGallery\") { GlassGalleryExample().glassTheme(.crystal) }\n",
      "title" : "GlassGallery example"
    }
  ],
  "files" : [
    {
      "bytes" : 9178,
      "path" : "Media/Media/GlassGallery+Viewer.swift",
      "sha256" : "737ca24a62cd279be92672f83b165b9625c2ee7e29e0b12df4f48c98a7c5501a"
    },
    {
      "bytes" : 14581,
      "path" : "Media/Media/GlassGallery.swift",
      "sha256" : "d01a56499f14100655c7f396bfa52d9e1f2ff7e279a77e15eb689659efd0cb75"
    }
  ],
  "frameworks" : [

  ],
  "id" : "glass-gallery",
  "kind" : "content-component",
  "license" : "MIT",
  "minimumOS" : {
    "iOS" : "26.0",
    "iPadOS" : "26.0",
    "macOS" : "26.0"
  },
  "name" : "GlassGallery",
  "platforms" : [
    "iOS",
    "iPadOS",
    "macOS"
  ],
  "schemaVersion" : 1,
  "sha256" : "b09a4f285cb037ca46ec39d06a1470084f40ab28c211cdb913bdb1a7e8c12e83",
  "symbols" : [
    "GlassGalleryZoom",
    "GlassGalleryItem",
    "GlassGalleryLoading",
    "GlassGalleryLayout",
    "GlassGallery"
  ],
  "version" : "1.1.0"
}
