{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "field-demo",
  "title": "Field: Validated username",
  "description": "Type a space to see the error.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.cuelark.com/r/field.json",
    "https://ui.cuelark.com/r/input.json"
  ],
  "files": [
    {
      "path": "src/registry/cuelark/examples/field-demo.tsx",
      "content": "import * as React from \"react\";\n\nimport { Field, FieldControl, FieldDescription, FieldError, FieldLabel } from \"@/registry/cuelark/ui/field\";\nimport { Input } from \"@/registry/cuelark/ui/input\";\n\nexport default function FieldDemo() {\n  const [handle, setHandle] = React.useState(\"ada lovelace\");\n  const invalid = /\\s/.test(handle);\n  return (\n    <Field invalid={invalid} className=\"w-full max-w-sm\">\n      <FieldLabel>Username</FieldLabel>\n      <FieldControl>\n        <Input value={handle} onChange={(e) => setHandle(e.target.value)} leading=\"@\" />\n      </FieldControl>\n      <FieldDescription>Your public handle. Letters, numbers and dashes.</FieldDescription>\n      <FieldError>Spaces aren't allowed. Try “{handle.replace(/\\s+/g, \"-\")}”.</FieldError>\n    </Field>\n  );\n}\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "field",
    "example"
  ],
  "type": "registry:component"
}