"use client" import * as React from "react" import { toast } from "sonner" import { Example, ExampleWrapper, } from "@/registry/bases/base/components/example" import { Button } from "@/registry/bases/base/ui/button" import { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/registry/bases/base/ui/card" import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger, } from "@/registry/bases/base/ui/dialog" import { Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, } from "@/registry/bases/base/ui/questionnaire" const questionnaireItems = [ { choices: [ { value: "delegation" }, { value: "questions" }, { value: "both" }, ], name: "direction", required: true, }, { choices: [ { value: "progress" }, { value: "decisions" }, { value: "risks" }, ], name: "signals", }, { choices: [{ value: "week" }, { value: "cycle" }, { value: "later" }], name: "timing", required: true, }, ] as const const taskItems = [ { choices: [ { value: "inspect" }, { value: "implement" }, { value: "review" }, ], name: "task", required: true, }, ] as const const planItems = [ { choices: [ { value: "plus" }, { value: "pro" }, { value: "enterprise", disabled: true }, ], name: "plan", required: true, }, ] as const export default function QuestionnaireExample() { return ( ) } function QuestionnaireDisabled() { return ( Choose a plan Enterprise is not available on your account. Plus For individuals and small teams Pro For growing businesses Enterprise For large teams and enterprises ) } function QuestionnaireNoDescription() { return ( What should the agent do next? Inspect the codebase Implement the change Review the result ) } function QuestionnaireStandalone() { return ( ) } function QuestionnaireCard() { return ( ) } function QuestionnaireDialog() { return ( }> Open questionnaire Plan an agent interface Answer three questions to shape the next prototype. ( Question {state.current} of {state.total} )} /> ) } function QuestionnaireCardQuestions() { const directionTitleId = React.useId() const signalsTitleId = React.useId() const timingTitleId = React.useId() return ( <> }> What should we prototype next? }> Choose one direction or write another answer. Sub-agent delegation Show when work is delegated and what comes back. Question prompts Show choices while the agent waits for input. Both together Explore one unified interaction pattern. }> What should every progress update include? }> Select all that apply, or skip this question. Progress Decisions Risks }> When should this be revisited? }> Choose when this should be revisited. This week Next cycle Revisit later ) } function QuestionnaireQuestions() { return ( <> What should we prototype next? Choose one direction or write another answer. Sub-agent delegation Show when work is delegated and what comes back. Question prompts Show choices while the agent waits for input. Both together Explore one unified interaction pattern. What should every progress update include? Select all that apply, or skip this question. Progress Decisions Risks When should this be revisited? Choose when this should be revisited. This week Next cycle Revisit later ) } function QuestionnaireNavigation() { return ( Next Save answers ) } function handleSubmit(event: React.FormEvent) { event.preventDefault() const formData = new FormData(event.currentTarget) const values = { direction: formData.get("direction"), signals: formData.getAll("signals"), timing: formData.get("timing"), } toast("Questionnaire submitted", { description: `Direction: ${values.direction ?? "None"} · Progress signals: ${values.signals.join(", ") || "None"} · Timing: ${values.timing ?? "None"}`, }) }