SPB Git

Repository Public MIT

manifest.json 3.6 KB 66 lines json

1{2  "accessibility" : [3    "Cells keep the accessibility of the host's content. Selectable cells are buttons with the `.isSelected` trait.",4    "Selection is shown by a checkmark symbol, not by colour alone.",5    "An adaptive layout reflows with the window width and with Dynamic Type if the host's `minimum` leaves room for larger text; prefer adaptive layouts."6  ],7  "category" : "data",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      "id" : "glass-table",24      "version" : "1.0.0"25    }26  ],27  "description" : "Lazy grid for large collections with stable identifiers and generic cells.",28  "examples" : [29    {30      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassDataGridExample: GlassExample {\n    public static let componentID = \"glass-data-grid\"\n\n    struct Sample: Identifiable {\n        let id: Int\n        var reading: Double { Double((id * 37) % 100) / 100 }\n    }\n\n    /// Thirty thousand fictitious samples, produced on demand: no array of that size is ever built.\n    struct Samples: RandomAccessCollection {\n        let count: Int\n        var startIndex: Int { 0 }\n        var endIndex: Int { count }\n        subscript(position: Int) -> Sample { Sample(id: position) }\n    }\n\n    @State private var selection: Set<Int> = [2]\n    @State private var fixedColumns = false\n\n    public init() {}\n\n    public var body: some View {\n        VStack(alignment: .leading, spacing: 12) {\n            Toggle(\"Three fixed columns\", isOn: $fixedColumns)\n            Text(\"\\(selection.count) of \\(Samples(count: 30_000).count) samples selected\")\n                .font(.callout)\n                .foregroundStyle(.secondary)\n            GlassDataGrid(\n                Samples(count: 30_000),\n                layout: fixedColumns ? .fixed(3) : .adaptive(minimum: 110),\n                selection: $selection\n            ) { sample, isSelected in\n                VStack(alignment: .leading, spacing: 4) {\n                    Text(\"Sample \\(sample.id + 1)\")\n                        .font(.headline)\n                    Text(sample.reading, format: .percent.precision(.fractionLength(0)))\n                        .font(.callout.monospacedDigit())\n                        .foregroundStyle(.secondary)\n                    Text(isSelected ? \"Selected\" : \"Tap to select\")\n                        .font(.caption)\n                        .foregroundStyle(.secondary)\n                }\n                .frame(maxWidth: .infinity, alignment: .leading)\n                .padding(12)\n                .background(.quaternary, in: RoundedRectangle(cornerRadius: 12, style: .continuous))\n            }\n        }\n        .padding()\n    }\n}\n\n#Preview(\"GlassDataGrid\") { GlassDataGridExample() }\n",31      "title" : "GlassDataGrid example"32    }33  ],34  "files" : [35    {36      "bytes" : 8143,37      "path" : "Data/Data/GlassDataGrid.swift",38      "sha256" : "00003512fd8dfaf5405d4d2e0010c0a63b992e8797bd5573d274392d0a407424"39    }40  ],41  "frameworks" : [4243  ],44  "id" : "glass-data-grid",45  "kind" : "content-component",46  "license" : "MIT",47  "minimumOS" : {48    "iOS" : "26.0",49    "iPadOS" : "26.0",50    "macOS" : "26.0"51  },52  "name" : "GlassDataGrid",53  "platforms" : [54    "iOS",55    "iPadOS",56    "macOS"57  ],58  "schemaVersion" : 1,59  "sha256" : "549249d49a7508e20f8f03e1c2a7b981e7cdb52dee6291ee6de9e325da945f1d",60  "symbols" : [61    "GlassGridLayout",62    "GlassDataGrid"63  ],64  "version" : "1.0.0"65}66
Files main
Menu

Theme