{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "contact-18",
  "type": "registry:block",
  "description": "Net promoter feedback form with a 0-10 score scale, adaptive follow-up prompt, reason chips and success state.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "textarea"
  ],
  "files": [
    {
      "path": "registry/designali/blocks/contact/contact-18.tsx",
      "content": "\"use client\"\n\nimport { useState } from \"react\"\nimport {\n  Check,\n} from \"@designali/icons\"\n\nimport { Button } from \"@workspace/ui/components/button\"\nimport { Textarea } from \"@workspace/ui/components/textarea\"\nimport { cn } from \"@workspace/ui/lib/utils\"\n\nconst tags = [\"Blocks\", \"Templates\", \"Icons\", \"Design\", \"Docs\", \"Support\"]\n\nexport default function Contact18() {\n  const [score, setScore] = useState<number | null>(null)\n  const [picked, setPicked] = useState<string[]>([])\n  const [sent, setSent] = useState(false)\n\n  const prompt =\n    score === null\n      ? \"Select a score to continue\"\n      : score >= 9\n        ? \"Wonderful! What do you love most?\"\n        : score >= 7\n          ? \"Thanks. What would make it a 10?\"\n          : \"Sorry to hear that. What let you down?\"\n\n  return (\n    <section className=\"w-full bg-muted/40 py-20 md:py-28\">\n      <div className=\"mx-auto max-w-3xl px-6\">\n        <div className=\"border bg-background p-6 md:p-12\">\n          {sent ? (\n            <div className=\"flex flex-col items-center py-12 text-center\">\n              <Check className=\"size-8 text-primary dark:text-primary\" />\n              <h2 className=\"mt-4 text-2xl font-semibold\">Feedback received</h2>\n              <p className=\"mt-2 text-sm text-muted-foreground\">\n                The Designali studio reads every response on Fridays.\n              </p>\n            </div>\n          ) : (\n            <form\n              onSubmit={(event) => {\n                event.preventDefault()\n                if (score !== null) setSent(true)\n              }}\n            >\n              <p className=\"text-xs font-medium tracking-widest text-muted-foreground uppercase\">\n                Feedback\n              </p>\n              <h2 className=\"mt-3 text-2xl font-semibold tracking-tight md:text-3xl\">\n                How likely are you to recommend Designali to a colleague?\n              </h2>\n\n              <div className=\"mt-8 grid grid-cols-6 gap-1.5 sm:grid-cols-11\">\n                {Array.from({ length: 11 }).map((_, n) => (\n                  <button\n                    key={n}\n                    type=\"button\"\n                    onClick={() => setScore(n)}\n                    aria-pressed={score === n}\n                    className={cn(\n                      \"h-11 border text-sm font-medium tabular-nums transition-colors\",\n                      score === n\n                        ? n >= 9\n                          ? \"border-chart-2 bg-chart-2 text-white\"\n                          : n >= 7\n                            ? \"border-primary bg-primary text-black\"\n                            : \"border-chart-2 bg-chart-2 text-white\"\n                        : \"hover:bg-muted\"\n                    )}\n                  >\n                    {n}\n                  </button>\n                ))}\n              </div>\n              <div className=\"mt-2 flex justify-between text-xs text-muted-foreground\">\n                <span>Not likely</span>\n                <span>Extremely likely</span>\n              </div>\n\n              <fieldset\n                disabled={score === null}\n                className=\"mt-10 space-y-4 transition-opacity disabled:opacity-40\"\n              >\n                <legend className=\"text-sm font-medium\">{prompt}</legend>\n                <div className=\"flex flex-wrap gap-2\">\n                  {tags.map((tag) => {\n                    const on = picked.includes(tag)\n                    return (\n                      <button\n                        key={tag}\n                        type=\"button\"\n                        onClick={() =>\n                          setPicked((p) => (on ? p.filter((t) => t !== tag) : [...p, tag]))\n                        }\n                        className={cn(\n                          \"rounded-full border px-3.5 py-1.5 text-sm transition-colors\",\n                          on ? \"border-foreground bg-foreground text-background\" : \"hover:bg-muted\"\n                        )}\n                      >\n                        {tag}\n                      </button>\n                    )\n                  })}\n                </div>\n                <Textarea placeholder=\"Tell us more (optional)\" className=\"min-h-28\" />\n              </fieldset>\n\n              <div className=\"mt-8 flex items-center justify-between gap-4 border-t pt-6\">\n                <p className=\"text-xs text-muted-foreground\">Takes about 30 seconds</p>\n                <Button type=\"submit\" size=\"lg\" disabled={score === null}>\n                  Submit feedback\n                </Button>\n              </div>\n            </form>\n          )}\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "700px"
  },
  "categories": [
    "contact"
  ]
}