{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "onboarding-01",
  "type": "registry:block",
  "description": "A three-step health profile with body measurements, activity, and sharing settings.",
  "files": [
    {
      "path": "registry/predict/blocks/onboarding-01/page.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ArrowLeftIcon, ArrowRightIcon, CheckIcon } from \"lucide-react\"\n\nimport { Button } from \"@workspace/ui/components/button\"\nimport {\n  Card,\n  CardContent,\n  CardDescription,\n  CardFooter,\n  CardHeader,\n  CardTitle,\n} from \"@workspace/ui/components/card\"\nimport { Label } from \"@workspace/ui/components/label\"\nimport {\n  NumberField,\n  NumberFieldDecrement,\n  NumberFieldGroup,\n  NumberFieldIncrement,\n  NumberFieldInput,\n  NumberFieldScrubArea,\n} from \"@workspace/ui/components/number-field\"\nimport {\n  Progress,\n  ProgressLabel,\n  ProgressValue,\n} from \"@workspace/ui/components/progress\"\nimport { RadioGroup, RadioGroupItem } from \"@workspace/ui/components/radio-group\"\nimport { Switch } from \"@workspace/ui/components/switch\"\nimport { PredictMascot } from \"@workspace/ui/predict/predict-mascot\"\n\nconst steps = [\n  { title: \"Your body\", description: \"Used for BMI and body surface area.\" },\n  { title: \"Your week\", description: \"How active you are on a normal week.\" },\n  { title: \"Your results\", description: \"Choose who can see your results.\" },\n]\n\nconst activity = [\n  { value: \"low\", title: \"Mostly sitting\", description: \"Under 30 minutes of exercise a week.\" },\n  { value: \"moderate\", title: \"Some exercise\", description: \"Two or three sessions a week.\" },\n  { value: \"high\", title: \"Very active\", description: \"Four or more sessions a week.\" },\n]\n\nexport default function Page() {\n  const [step, setStep] = React.useState(0)\n  const [done, setDone] = React.useState(false)\n  const current = steps[step]!\n  const isLast = step === steps.length - 1\n\n  return (\n    <div className=\"flex min-h-svh items-center justify-center p-4\">\n      <Card className=\"w-full max-w-md\">\n        {done ? (\n          <CardContent className=\"flex flex-col items-center gap-4 py-8 text-center\">\n            <PredictMascot className=\"size-24\" aria-hidden />\n            <div className=\"flex flex-col gap-1\">\n              <h1 className=\"text-base font-medium\">You're all set</h1>\n              <p className=\"text-muted-foreground\">\n                We'll use your profile to read your first panel.\n              </p>\n            </div>\n            <Button\n              variant=\"outline\"\n              size=\"sm\"\n              onClick={() => {\n                setDone(false)\n                setStep(0)\n              }}\n            >\n              Start again\n            </Button>\n          </CardContent>\n        ) : (\n          <>\n            <CardHeader>\n              <Progress value={step + 1} max={steps.length}>\n                <ProgressLabel>Health profile</ProgressLabel>\n                <ProgressValue>{(_, value) => `Step ${value} of ${steps.length}`}</ProgressValue>\n              </Progress>\n              <CardTitle className=\"pt-4 text-base\">{current.title}</CardTitle>\n              <CardDescription>{current.description}</CardDescription>\n            </CardHeader>\n\n            <CardContent>\n              {step === 0 && (\n                <div className=\"grid gap-4 sm:grid-cols-2\">\n                  <NumberField defaultValue={70} min={20} max={300}>\n                    <NumberFieldScrubArea label=\"Weight (kg)\" />\n                    <NumberFieldGroup>\n                      <NumberFieldDecrement />\n                      <NumberFieldInput />\n                      <NumberFieldIncrement />\n                    </NumberFieldGroup>\n                  </NumberField>\n                  <NumberField defaultValue={170} min={100} max={230}>\n                    <NumberFieldScrubArea label=\"Height (cm)\" />\n                    <NumberFieldGroup>\n                      <NumberFieldDecrement />\n                      <NumberFieldInput />\n                      <NumberFieldIncrement />\n                    </NumberFieldGroup>\n                  </NumberField>\n                </div>\n              )}\n\n              {step === 1 && (\n                <RadioGroup defaultValue=\"moderate\" aria-label=\"Activity level\">\n                  {activity.map((option) => (\n                    <label\n                      key={option.value}\n                      className=\"flex items-start gap-3 rounded-lg border p-3 has-data-checked:border-primary\"\n                    >\n                      <RadioGroupItem value={option.value} className=\"mt-0.5\" />\n                      <span className=\"grid gap-1\">\n                        <span className=\"text-sm font-medium\">{option.title}</span>\n                        <span className=\"text-xs text-muted-foreground\">{option.description}</span>\n                      </span>\n                    </label>\n                  ))}\n                </RadioGroup>\n              )}\n\n              {step === 2 && (\n                <div className=\"flex flex-col gap-4\">\n                  <Label className=\"justify-between\">\n                    Share results with my clinician\n                    <Switch defaultChecked />\n                  </Label>\n                  <Label className=\"justify-between\">\n                    Email me when results are ready\n                    <Switch defaultChecked />\n                  </Label>\n                  <Label className=\"justify-between\">\n                    Use my data for research\n                    <Switch />\n                  </Label>\n                </div>\n              )}\n            </CardContent>\n\n            <CardFooter className=\"justify-between\">\n              <Button\n                variant=\"ghost\"\n                size=\"sm\"\n                disabled={step === 0}\n                onClick={() => setStep((s) => s - 1)}\n              >\n                <ArrowLeftIcon data-icon=\"inline-start\" />\n                Back\n              </Button>\n              <Button\n                size=\"sm\"\n                onClick={() => (isLast ? setDone(true) : setStep((s) => s + 1))}\n              >\n                {isLast ? \"Finish\" : \"Continue\"}\n                {isLast ? (\n                  <CheckIcon data-icon=\"inline-end\" />\n                ) : (\n                  <ArrowRightIcon data-icon=\"inline-end\" />\n                )}\n              </Button>\n            </CardFooter>\n          </>\n        )}\n      </Card>\n    </div>\n  )\n}\n",
      "type": "registry:page",
      "target": "app/onboarding/page.tsx"
    }
  ],
  "meta": {
    "iframeHeight": "720px"
  },
  "categories": [
    "onboarding"
  ]
}