Repository Public MIT
1{2 "accessibility" : [3 "The visible label is the accessibility label of the field; \"Required\" is appended for required fields.",4 "An error is an icon plus a sentence, read as \"Error: …\"; a confirmation is a check mark plus a sentence. Neither is colour alone.",5 "The leading symbol is decorative and hidden from VoiceOver.",6 "Label, value and messages follow Dynamic Type and wrap.",7 "Default messages are localised (English, French); lengths count user-perceived characters."8 ],9 "category" : "forms",10 "changelog" : [11 {12 "changes" : [13 "Release 1.1.0: see the project changelog."14 ],15 "date" : "2026-12-03",16 "version" : "1.1.0"17 },18 {19 "changes" : [20 "Initial release."21 ],22 "date" : "2026-12-02",23 "version" : "1.0.0"24 }25 ],26 "dependencies" : [27 {28 "id" : "glass-forms-support",29 "version" : "1.1.0"30 },31 {32 "id" : "glass-foundation",33 "version" : "1.1.0"34 }35 ],36 "description" : "Text field with label, validation message, focus handling and keyboard configuration.",37 "examples" : [38 {39 "code" : "import SwiftUI\nimport SPGlassKit\n\npublic struct GlassTextFieldExample: GlassExample {\n public static let componentID = \"glass-text-field\"\n @State private var name = \"\"\n @State private var email = \"\"\n @State private var handle = \"taken\"\n @State private var locked = \"Read-only value\"\n @FocusState private var emailFocused: Bool\n\n public init() {}\n\n public var body: some View {\n ScrollView {\n VStack(alignment: .leading, spacing: 20) {\n GlassTextField(\n \"Full name\",\n text: $name,\n prompt: \"Ada Lovelace\",\n validation: GlassFieldValidation(.required(), .minLength(2)),\n input: .name\n )\n .onSubmit { emailFocused = true }\n\n GlassTextField(\n \"Email\",\n text: $email,\n prompt: \"name@example.com\",\n helper: \"Used only for the receipt.\",\n systemImage: \"envelope\",\n validation: GlassFieldValidation(.required(), .custom(message: \"Enter an address such as name@example.com\") { $0.contains(\"@\") && $0.contains(\".\") }),\n input: .email,\n focus: $emailFocused\n )\n\n GlassTextField(\n \"Username\",\n text: $handle,\n validation: GlassFieldValidation(.maxLength(12)),\n validateOn: .always,\n errorMessage: handle == \"taken\" ? \"This username is already taken.\" : nil,\n input: .username\n )\n\n GlassTextField(\"Account\", text: $locked)\n .disabled(true)\n\n Button(\"Focus the email field\") { emailFocused = true }\n }\n .padding()\n }\n }\n}\n\n#Preview(\"GlassTextField\") { GlassTextFieldExample().glassTheme(.aurora) }\n",40 "title" : "GlassTextField example"41 }42 ],43 "files" : [44 {45 "bytes" : 6000,46 "path" : "Forms/Forms/GlassTextField.swift",47 "sha256" : "61b3b6a03fcb040ce464b9264850ed5dbf3ef4b56a52c75c3c40d2ddc905f407"48 }49 ],50 "frameworks" : [5152 ],53 "id" : "glass-text-field",54 "kind" : "content-component",55 "license" : "MIT",56 "minimumOS" : {57 "iOS" : "26.0",58 "iPadOS" : "26.0",59 "macOS" : "26.0"60 },61 "name" : "GlassTextField",62 "platforms" : [63 "iOS",64 "iPadOS",65 "macOS"66 ],67 "schemaVersion" : 1,68 "sha256" : "6775efc9534a194d455d1e0c5f7bdb63718c80263577011b9b35c6914bc237cc",69 "symbols" : [70 "GlassTextField"71 ],72 "version" : "1.1.0"73}74