{
  "accessibility" : [
    "The editor is labelled \"Message\"; the buttons are labelled \"Attach\", \"Send\" and \"Stop\" with tooltips on macOS and 44-point targets on iOS.",
    "Chips sit in a container labelled \"Attachments\"; each remove button reads \"Remove <name>\".",
    "The text follows Dynamic Type and the bar grows with the number of lines up to the limit.",
    "With Reduce Transparency the bar is an opaque themed surface."
  ],
  "category" : "ai",
  "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"
    }
  ],
  "description" : "Multiline prompt editor with send and stop, attachments through callbacks and keyboard shortcuts.",
  "examples" : [
    {
      "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassPromptBarExample: GlassExample {\n    public static let componentID = \"glass-prompt-bar\"\n    @State private var draft = \"\"\n    @State private var isResponding = false\n    @State private var sent: [String] = []\n    @State private var attachments = [\n        GlassPromptAttachment(id: \"a1\", name: \"sample-report.pdf\", systemImage: \"doc.richtext\"),\n        GlassPromptAttachment(id: \"a2\", name: \"a-sample-image-with-a-rather-long-file-name.png\", systemImage: \"photo\"),\n    ]\n    @State private var nextAttachment = 3\n    @State private var modelID: String? = \"sample-large\"\n    /// Fictitious models.\n    private let models = [\n        GlassModelInfo(id: \"sample-large\", name: \"Sample Large\", provider: \"Example Cloud (sample)\", capabilities: [.text, .tools], availability: .remote),\n        GlassModelInfo(id: \"sample-nano\", name: \"Sample Nano\", provider: \"On this device (sample)\", availability: .local),\n    ]\n\n    public init() {}\n\n    public var body: some View {\n        VStack(alignment: .leading, spacing: 12) {\n            Text(\"Sample data · nothing is sent anywhere; prompts are only listed below.\")\n                .font(.caption)\n                .foregroundStyle(.secondary)\n            ScrollView {\n                VStack(alignment: .leading, spacing: 8) {\n                    ForEach(Array(sent.enumerated()), id: \\.offset) { _, prompt in\n                        Text(prompt)\n                            .frame(maxWidth: .infinity, alignment: .leading)\n                    }\n                    if isResponding {\n                        GlassThinkingIndicator(.writing, label: \"Simulating a response\")\n                    }\n                }\n            }\n            GlassPromptBar(text: $draft, placeholder: \"Ask the sample assistant\", isResponding: isResponding, attachments: attachments) { prompt in\n                sent.append(prompt)\n                isResponding = true\n            } onStop: {\n                isResponding = false\n            } onAttach: {\n                // A real host presents its own file importer or photo picker here.\n                attachments.append(GlassPromptAttachment(id: \"a\\(nextAttachment)\", name: \"sample-\\(nextAttachment).txt\"))\n                nextAttachment += 1\n            } onRemoveAttachment: { attachment in\n                attachments.removeAll { $0.id == attachment.id }\n            } accessory: {\n                // Any small control fits here: a model picker, a context chip.\n                GlassModelPicker(models: models, selection: $modelID)\n            }\n        }\n        .padding()\n        .task(id: isResponding) {\n            guard isResponding else { return }\n            try? await Task.sleep(for: .seconds(3))\n            if !Task.isCancelled { isResponding = false }\n        }\n    }\n}\n\n#Preview(\"GlassPromptBar\") { GlassPromptBarExample().glassTheme(.aurora) }\n",
      "title" : "GlassPromptBar example"
    }
  ],
  "files" : [
    {
      "bytes" : 16083,
      "path" : "AI/AI/GlassPromptBar.swift",
      "sha256" : "4ad7395d95196b7f619b87847d2bf0a4100b0fb02fff27db5234f2282739e6aa"
    }
  ],
  "frameworks" : [

  ],
  "id" : "glass-prompt-bar",
  "kind" : "custom-glass",
  "license" : "MIT",
  "minimumOS" : {
    "iOS" : "26.0",
    "iPadOS" : "26.0",
    "macOS" : "26.0"
  },
  "name" : "GlassPromptBar",
  "platforms" : [
    "iOS",
    "iPadOS",
    "macOS"
  ],
  "schemaVersion" : 1,
  "sha256" : "4a63a97bbe6e9bc5517320dfc064e4e9daa0ce6f51a0f2f7a535c25b3597f61c",
  "symbols" : [
    "GlassPromptAttachment",
    "GlassPromptInput",
    "ReturnKeyAction",
    "GlassPromptBar"
  ],
  "version" : "1.1.0"
}
