{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-form-demo",
  "type": "registry:component",
  "title": "Contact form example",
  "description": "Usage example (demo) for Contact form: the code behind the preview on https://facadeui.dev/components/contact-form. Installs the items it uses.",
  "categories": [
    "example"
  ],
  "registryDependencies": [
    "https://facadeui.dev/r/contact-form.json"
  ],
  "files": [
    {
      "path": "contact-form.tsx",
      "type": "registry:component",
      "target": "components/examples/contact-form-demo.tsx",
      "content": "\"use client\"\n\n/** `\"use client\"` for the state that fakes a server round trip. */\n\nimport { useState } from \"react\"\n\nimport { ContactForm, type ContactFormStatus } from \"@/components/sections/contact-form\"\n\nconst FIELDS = [\n  {\n    name: \"name\",\n    label: \"Name\",\n    autoComplete: \"name\",\n    required: true,\n    width: \"half\" as const,\n  },\n  {\n    name: \"email\",\n    label: \"Work email\",\n    type: \"email\" as const,\n    autoComplete: \"email\",\n    required: true,\n    width: \"half\" as const,\n  },\n  {\n    name: \"topic\",\n    label: \"What is it about?\",\n    type: \"select\" as const,\n    placeholder: \"Choose a topic\",\n    options: [\n      { value: \"sales\", label: \"Pricing and plans\" },\n      { value: \"support\", label: \"Help with an install\" },\n      { value: \"press\", label: \"Press\" },\n    ],\n  },\n  {\n    name: \"message\",\n    label: \"Message\",\n    type: \"textarea\" as const,\n    rows: 5,\n    required: true,\n  },\n]\n\nexport function Demo() {\n  const [status, setStatus] = useState<ContactFormStatus>(\"idle\")\n  const [errors, setErrors] = useState<Record<string, string>>()\n\n  return (\n    <ContactForm\n      eyebrow=\"Contact\"\n      title=\"Talk to the team\"\n      description=\"Questions about a plan, an install or anything else. A person reads every message.\"\n      fields={FIELDS}\n      status={status}\n      errors={errors}\n      note=\"We only use your details to reply.\"\n      details={[\n        { label: \"Email\", value: \"hello@example.com\", href: \"mailto:hello@example.com\" },\n        { label: \"Phone\", value: \"+31 20 123 4567\", href: \"tel:+31201234567\" },\n        { label: \"Reply time\", value: \"Within two working days\" },\n      ]}\n      onSubmit={(values) => {\n        setStatus(\"submitting\")\n        // Stands in for a server: rejects example.com addresses.\n        setTimeout(() => {\n          if (values.email?.endsWith(\"@example.com\")) {\n            setErrors({ email: \"Use your work address, not example.com.\" })\n            setStatus(\"error\")\n          } else {\n            setErrors(undefined)\n            setStatus(\"success\")\n          }\n        }, 600)\n      }}\n    />\n  )\n}\n"
    }
  ],
  "docs": "Example only: components/examples/contact-form-demo.tsx renders Contact form with sample content from components/examples/content.tsx. Copy what you need into your page. Docs: https://facadeui.dev/components/contact-form"
}
