{
  "accessibility" : [
    "The system field brings its own label, clear and cancel controls.",
    "The inline field is labelled \"Search\", has the search-field trait, and its clear and cancel buttons are labelled and reachable with the keyboard.",
    "Suggestions are system rows with text; symbols are decorative.",
    "The Cancel button fades in with the theme's fast animation; with Reduce Motion it is a short cross-fade."
  ],
  "category" : "forms",
  "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-forms-support",
      "version" : "1.1.0"
    },
    {
      "id" : "glass-foundation",
      "version" : "1.1.0"
    }
  ],
  "description" : "Search with suggestions, cancellation and a cancellable debounce for asynchronous queries.",
  "examples" : [
    {
      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassSearchFieldExample: GlassExample {\n    public static let componentID = \"glass-search-field\"\n\n    private static let catalogue = [\"Café crème\", \"Cafetière italienne\", \"Thé vert\", \"Théière en fonte\", \"Chocolat chaud\", \"Citronnade\", \"Eau pétillante\", \"Jus d’orange\"]\n    private static let recent = [\n        GlassSearchSuggestion(title: \"café\", systemImage: \"clock\"),\n        GlassSearchSuggestion(title: \"thé\", systemImage: \"clock\"),\n        GlassSearchSuggestion(title: \"Hot drinks\", systemImage: \"cup.and.saucer\", completion: \"chaud\"),\n    ]\n\n    @State private var query = \"\"\n    @State private var inlineQuery = \"\"\n    @State private var results = GlassSearchFieldExample.catalogue\n    @State private var debouncer = GlassSearchDebouncer(delay: .milliseconds(250))\n\n    public init() {}\n\n    /// A stand-in for a remote search: it only filters a local list after a short pause.\n    private static func search(_ query: String) async throws -> [String] {\n        try await Task.sleep(for: .milliseconds(150))\n        let needle = query.folding(options: [.caseInsensitive, .diacriticInsensitive], locale: nil)\n        return needle.isEmpty ? catalogue : catalogue.filter { $0.folding(options: [.caseInsensitive, .diacriticInsensitive], locale: nil).contains(needle) }\n    }\n\n    public var body: some View {\n        NavigationStack {\n            List {\n                Section(\"Inline field\") {\n                    GlassSearchField(text: $inlineQuery, prompt: \"Filter this section\")\n                        .listRowSeparator(.hidden)\n                    ForEach(Self.catalogue.filter { inlineQuery.isEmpty || $0.localizedStandardContains(inlineQuery) }, id: \\.self) { item in\n                        Text(verbatim: item)\n                    }\n                }\n                Section {\n                    ForEach(results, id: \\.self) { item in\n                        Text(verbatim: item)\n                    }\n                    if results.isEmpty {\n                        Text(\"No results\").foregroundStyle(.secondary)\n                    }\n                } header: {\n                    HStack {\n                        Text(\"Debounced results\")\n                        if debouncer.isPending { ProgressView().controlSize(.small) }\n                    }\n                }\n            }\n            .navigationTitle(\"Drinks\")\n            .glassSearchable(text: $query, prompt: \"Search drinks\", suggestions: query.isEmpty ? Self.recent : [])\n            .onChange(of: query) { _, newValue in\n                debouncer.submit(newValue, search: Self.search) { results = $0 }\n            }\n            .onDisappear { debouncer.cancel() }\n        }\n    }\n}\n\n#Preview(\"GlassSearchField\") { GlassSearchFieldExample() }\n",
      "title" : "GlassSearchField example"
    }
  ],
  "files" : [
    {
      "bytes" : 9211,
      "path" : "Forms/Forms/GlassSearchField.swift",
      "sha256" : "f1ef28d1629f6b64fe812a00f8c706888eb587c5d3842a2369498118a820c2bb"
    }
  ],
  "frameworks" : [

  ],
  "id" : "glass-search-field",
  "kind" : "native-wrapper",
  "license" : "MIT",
  "minimumOS" : {
    "iOS" : "26.0",
    "iPadOS" : "26.0",
    "macOS" : "26.0"
  },
  "name" : "GlassSearchField",
  "platforms" : [
    "iOS",
    "iPadOS",
    "macOS"
  ],
  "schemaVersion" : 1,
  "sha256" : "ebd1cad0467fc907044217b3587186b5b9db9ce9cdbe6ef7345586444f692f9c",
  "symbols" : [
    "GlassSearchSuggestion",
    "GlassSearchField"
  ],
  "version" : "1.1.0"
}
