{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "survey-1",
  "title": "Product Feedback Questionnaire",
  "description": "Four-question product feedback survey card mixing single-choice, multi-select, and freeform answers, with progress and previous, skip, next, and submit controls.",
  "dependencies": [
    "@base-ui/react"
  ],
  "registryDependencies": [
    "card",
    "questionnaire",
    "sonner"
  ],
  "files": [
    {
      "path": "registry/blocks/survey/1/survey-block.tsx",
      "content": "\"use client\"\n\nimport { toast } from \"sonner\"\nimport {\n  Card,\n  CardAction,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@/components/ui/card\"\nimport {\n  Questionnaire,\n  QuestionnaireActions,\n  QuestionnaireChoice,\n  QuestionnaireChoiceDescription,\n  QuestionnaireChoices,\n  QuestionnaireDescription,\n  QuestionnaireError,\n  QuestionnaireInput,\n  QuestionnaireItem,\n  QuestionnaireNext,\n  QuestionnairePrevious,\n  QuestionnaireProgress,\n  QuestionnaireSkip,\n  QuestionnaireSubmit,\n  QuestionnaireTitle,\n} from \"@/components/ui/questionnaire\"\nimport { Toaster } from \"@/components/ui/sonner\"\n\ntype Choice = { value: string; label: string; description?: string }\n\ntype Question = {\n  name: string\n  prompt: string\n  description: string\n  choices: Choice[]\n  required?: boolean\n  multiple?: boolean\n  input?: { label: string; placeholder: string }\n}\n\nconst QUESTIONS: Question[] = [\n  {\n    name: \"role\",\n    required: true,\n    prompt: \"What Best Describes Your Role?\",\n    description: \"This tells us which team should read your answers.\",\n    choices: [\n      {\n        value: \"engineering\",\n        label: \"Engineering\",\n        description: \"You build and ship the product.\",\n      },\n      {\n        value: \"design\",\n        label: \"Design\",\n        description: \"You own how the product looks and behaves.\",\n      },\n      {\n        value: \"product\",\n        label: \"Product\",\n        description: \"You decide what gets built next.\",\n      },\n      {\n        value: \"operations\",\n        label: \"Operations\",\n        description: \"You keep the business running day to day.\",\n      },\n    ],\n  },\n  {\n    name: \"areas\",\n    required: true,\n    multiple: true,\n    prompt: \"Which Parts Of Acme Do You Use Most?\",\n    description: \"Select every area that applies.\",\n    choices: [\n      { value: \"dashboards\", label: \"Dashboards\" },\n      { value: \"automations\", label: \"Automations\" },\n      { value: \"reporting\", label: \"Reporting\" },\n      { value: \"integrations\", label: \"Integrations\" },\n    ],\n  },\n  {\n    name: \"friction\",\n    required: true,\n    prompt: \"What Slows You Down The Most?\",\n    description: \"Pick the closest match, or write your own.\",\n    choices: [\n      { value: \"setup\", label: \"Setting Up New Projects\" },\n      { value: \"search\", label: \"Finding The Right Data\" },\n      { value: \"handoff\", label: \"Sharing Work With The Team\" },\n    ],\n    input: {\n      label: \"Another Answer\",\n      placeholder: \"Tell us what slows you down\",\n    },\n  },\n  {\n    name: \"followup\",\n    prompt: \"Can We Follow Up On Your Answers?\",\n    description: \"Skip this one if you would rather stay anonymous.\",\n    choices: [\n      { value: \"email\", label: \"Yes, By Email\" },\n      { value: \"call\", label: \"Yes, On A Short Call\" },\n      { value: \"no\", label: \"No, Thanks\" },\n    ],\n  },\n]\n\nexport default function SurveyBlock() {\n  function handleSubmit(event: React.FormEvent<HTMLFormElement>) {\n    event.preventDefault()\n    const answers = new FormData(event.currentTarget)\n    const areas = answers.getAll(\"areas\").length\n\n    toast.success(\"Thanks For The Feedback\", {\n      description: `We logged your role and ${areas} product ${\n        areas === 1 ? \"area\" : \"areas\"\n      }. Someone reads every response.`,\n    })\n  }\n\n  return (\n    <section className=\"flex w-full items-center justify-center bg-background px-4 py-12 text-foreground sm:px-6 sm:py-16\">\n      <Questionnaire\n        items={QUESTIONS}\n        onSubmit={handleSubmit}\n        className=\"w-full max-w-xl\"\n      >\n        <Card>\n          <CardHeader>\n            <CardTitle>Product Feedback</CardTitle>\n            <CardDescription>\n              Four questions about how your team works in Acme. It takes about a\n              minute.\n            </CardDescription>\n            <CardAction>\n              <QuestionnaireProgress />\n            </CardAction>\n          </CardHeader>\n\n          {/* Floored to the tallest question so the actions row never jumps. */}\n          <CardContent className=\"min-h-80\">\n            {QUESTIONS.map((question) => (\n              <QuestionnaireItem\n                key={question.name}\n                name={question.name}\n                required={question.required}\n                multiple={question.multiple}\n              >\n                <QuestionnaireTitle>{question.prompt}</QuestionnaireTitle>\n                <QuestionnaireDescription>\n                  {question.description}\n                </QuestionnaireDescription>\n                <QuestionnaireChoices>\n                  {question.choices.map((choice) => (\n                    <QuestionnaireChoice\n                      key={choice.value}\n                      value={choice.value}\n                    >\n                      <span className=\"font-medium\">{choice.label}</span>\n                      {choice.description ? (\n                        <QuestionnaireChoiceDescription>\n                          {choice.description}\n                        </QuestionnaireChoiceDescription>\n                      ) : null}\n                    </QuestionnaireChoice>\n                  ))}\n                  {question.input ? (\n                    <QuestionnaireInput\n                      aria-label={question.input.label}\n                      placeholder={question.input.placeholder}\n                    />\n                  ) : null}\n                </QuestionnaireChoices>\n                <QuestionnaireError />\n              </QuestionnaireItem>\n            ))}\n          </CardContent>\n\n          <CardFooter>\n            <QuestionnaireActions>\n              <QuestionnairePrevious />\n              <QuestionnaireSkip variant=\"ghost\" />\n              <QuestionnaireNext />\n              <QuestionnaireSubmit />\n            </QuestionnaireActions>\n          </CardFooter>\n        </Card>\n      </Questionnaire>\n      <Toaster />\n    </section>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/blocks/survey-1.tsx"
    }
  ],
  "meta": {
    "height": "613px",
    "tier": "free"
  },
  "categories": [
    "survey"
  ],
  "type": "registry:block"
}