{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "travel42",
  "title": "Narrowing Destination Shortlist",
  "description": "A destination finder that eliminates in the open: a grid of six photographs sits beside the questions and dims the places each answer rules out, with a live count under it, before the survivors are listed with their notes and links.",
  "dependencies": [
    "clsx",
    "tailwind-merge",
    "lucide-react"
  ],
  "registryDependencies": [
    "questionnaire",
    "button"
  ],
  "files": [
    {
      "path": "registry/travel42/travel42.tsx",
      "content": "\"use client\";\n\nimport { ArrowUpRight, RotateCcw } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { type ChangeEvent, type FormEvent, useState } from \"react\";\nimport { Badge23 } from \"@/components/beste/component/badge23\";\nimport { Button21 } from \"@/components/beste/component/button21\";\nimport {\n  Questionnaire,\n  QuestionnaireActions,\n  QuestionnaireChoice,\n  QuestionnaireChoiceDescription,\n  QuestionnaireChoices,\n  QuestionnaireDescription,\n  QuestionnaireError,\n  QuestionnaireItem,\n  QuestionnaireNext,\n  QuestionnairePrevious,\n  QuestionnaireProgress,\n  QuestionnaireSubmit,\n  QuestionnaireTitle,\n} from \"@/components/ui/questionnaire\";\nimport { cn } from \"@/lib/utils\";\n\ninterface Badge {\n  label: string;\n}\n\ninterface ActionLink {\n  label: string;\n  href: string;\n}\n\ninterface DestinationImage {\n  src: string;\n  alt: string;\n}\n\ninterface Destination {\n  name: string;\n  note: string;\n  image: DestinationImage;\n  /** Matched against the tags each answer keeps */\n  tags?: string[];\n  link?: ActionLink;\n}\n\ninterface FilterChoice {\n  value: string;\n  label: string;\n  description?: string;\n  /** A destination survives this answer when it carries one of these tags */\n  keeps?: string[];\n}\n\ninterface FilterQuestion {\n  /** Form field name. Must be unique across the flow. */\n  name: string;\n  title: string;\n  description?: string;\n  choices?: FilterChoice[];\n}\n\ninterface Travel42Labels {\n  previous?: string;\n  next?: string;\n  submit?: string;\n  restart?: string;\n  countSuffix?: string;\n  shortlistTitle?: string;\n  emptyTitle?: string;\n  emptyBody?: string;\n}\n\ninterface Travel42Props {\n  badge?: Badge;\n  heading?: string;\n  description?: string;\n  questions?: FilterQuestion[];\n  /** Prints a scoped shortcut on every choice and binds it while the question is active */\n  shortcuts?: \"letters\" | \"numbers\";\n  /** The grid that narrows as the questions are answered */\n  destinations?: Destination[];\n  labels?: Travel42Labels;\n  className?: string;\n}\n\nexport const travel42Demo: Travel42Props = {\n  badge: { label: \"Where to\" },\n  heading: \"Watch the list get shorter as you answer\",\n  description:\n    \"Six places we book often. Every answer strikes the ones that no longer apply, so you can see what each question is costing you before the end.\",\n  shortcuts: \"numbers\",\n  labels: {\n    submit: \"Keep what is left\",\n    restart: \"Start the list again\",\n    countSuffix: \"still fit\",\n    shortlistTitle: \"What survived\",\n    emptyTitle: \"Nothing survived that combination\",\n    emptyBody:\n      \"The three answers together rule out everything on the list. Loosen one of them, usually the season, and something comes back.\",\n  },\n  questions: [\n    {\n      name: \"pace\",\n      title: \"What is the trip for?\",\n      description: \"One of these is always the real reason.\",\n      choices: [\n        {\n          value: \"quiet\",\n          label: \"Doing very little\",\n          description: \"A view, a book, and short distances.\",\n          keeps: [\"quiet\"],\n        },\n        {\n          value: \"outdoors\",\n          label: \"Being outside all day\",\n          description: \"Boots on at nine, back after dark.\",\n          keeps: [\"outdoors\"],\n        },\n        {\n          value: \"culture\",\n          label: \"Looking at things people made\",\n          description: \"Buildings, food, and a lot of walking.\",\n          keeps: [\"culture\"],\n        },\n      ],\n    },\n    {\n      name: \"length\",\n      title: \"How long have you got?\",\n      choices: [\n        { value: \"short\", label: \"A long weekend\", keeps: [\"short\"] },\n        { value: \"long\", label: \"A week or more\", keeps: [\"long\"] },\n      ],\n    },\n    {\n      name: \"season\",\n      title: \"When are you going?\",\n      choices: [\n        { value: \"winter\", label: \"Deep winter\", keeps: [\"winter\"] },\n        { value: \"shoulder\", label: \"Spring or autumn\", keeps: [\"shoulder\"] },\n        { value: \"summer\", label: \"Height of summer\", keeps: [\"summer\"] },\n      ],\n    },\n  ],\n  destinations: [\n    {\n      name: \"Yosemite Valley\",\n      note: \"Granite walls, a river underneath them, and more trail than a week can cover.\",\n      tags: [\"outdoors\", \"long\", \"winter\"],\n      image: {\n        src: \"https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&h=800&fit=crop\",\n        alt: \"A river running through a valley between granite cliffs at dawn\",\n      },\n      link: { label: \"See the Yosemite week\", href: \"https://beste.co\" },\n    },\n    {\n      name: \"Venice\",\n      note: \"Water instead of streets, and a week is not too long to spend on it.\",\n      tags: [\"culture\", \"long\", \"shoulder\"],\n      image: {\n        src: \"https://images.unsplash.com/photo-1523906834658-6e24ef2386f9?w=800&h=800&fit=crop\",\n        alt: \"A stone bridge over a canal with gondolas passing beneath it\",\n      },\n      link: { label: \"See the Venice week\", href: \"https://beste.co\" },\n    },\n    {\n      name: \"London\",\n      note: \"Three days of galleries, and the river to walk between them.\",\n      tags: [\"culture\", \"short\", \"summer\"],\n      image: {\n        src: \"https://images.unsplash.com/photo-1533929736458-ca588d08c8be?w=800&h=800&fit=crop\",\n        alt: \"A twin-towered bridge over a river with the city behind it\",\n      },\n      link: { label: \"See the London weekend\", href: \"https://beste.co\" },\n    },\n    {\n      name: \"Isle of Skye\",\n      note: \"One ridge, one road, and weather that changes twice an afternoon.\",\n      tags: [\"outdoors\", \"short\", \"shoulder\"],\n      image: {\n        src: \"https://images.unsplash.com/photo-1470071459604-3b5ec3a7fe05?w=800&h=800&fit=crop\",\n        alt: \"Green ridges under low cloud with a single road running through them\",\n      },\n      link: { label: \"See the Skye weekend\", href: \"https://beste.co\" },\n    },\n    {\n      name: \"Lago di Braies\",\n      note: \"A rowing boat, a shoreline path, and nothing else asked of you.\",\n      tags: [\"quiet\", \"short\", \"summer\"],\n      image: {\n        src: \"https://images.unsplash.com/photo-1501785888041-af3ef285b470?w=800&h=800&fit=crop\",\n        alt: \"Rowing boats on a green lake below limestone peaks\",\n      },\n      link: { label: \"See the Braies weekend\", href: \"https://beste.co\" },\n    },\n    {\n      name: \"Moraine Lake\",\n      note: \"Turquoise water under ten peaks, and a shoreline you can walk before breakfast.\",\n      tags: [\"quiet\", \"long\", \"winter\"],\n      image: {\n        src: \"https://images.unsplash.com/photo-1493246507139-91e8fad9978e?w=800&h=800&fit=crop\",\n        alt: \"A turquoise lake below snow-streaked peaks at first light\",\n      },\n      link: { label: \"See the Moraine Lake week\", href: \"https://beste.co\" },\n    },\n  ],\n};\n\nexport function Travel42({\n  badge,\n  heading,\n  description,\n  questions = [],\n  shortcuts,\n  destinations = [],\n  labels = {},\n  className,\n}: Travel42Props) {\n  const {\n    previous: previousLabel,\n    next: nextLabel,\n    submit: submitLabel,\n    restart: restartLabel,\n    countSuffix,\n    shortlistTitle,\n    emptyTitle,\n    emptyBody,\n  } = labels;\n\n  const [picked, setPicked] = useState<Record<string, string>>({});\n  const [settled, setSettled] = useState(false);\n\n  /**\n   * A destination survives every question that has been answered. An\n   * unanswered question rules nothing out, which is what makes the grid\n   * narrow one step at a time.\n   */\n  const survives = (destination: Destination) =>\n    questions.every((question) => {\n      const value = picked[question.name];\n      if (!value) return true;\n      const keeps = question.choices?.find((choice) => choice.value === value)?.keeps ?? [];\n      return keeps.some((tag) => destination.tags?.includes(tag));\n    });\n\n  const survivors = destinations.filter(survives);\n\n  const record = (question: FilterQuestion, value: string) => (event: ChangeEvent<HTMLInputElement>) => {\n    if (!event.target.checked) return;\n    setSettled(false);\n    setPicked((previous) => ({ ...previous, [question.name]: value }));\n  };\n\n  const handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    setSettled(true);\n  };\n\n  const restart = () => {\n    setPicked({});\n    setSettled(false);\n  };\n\n  return (\n    <section className={cn(\"w-full bg-background py-16 md:py-24\", className)}>\n      <div className=\"mx-auto max-w-7xl px-4 md:px-6\">\n        {badge && <Badge23 label={badge.label} />}\n\n        <div className=\"mt-6 border-t border-border pt-8 md:pt-10\">\n          <div className=\"grid gap-6 md:grid-cols-2 md:gap-12\">\n            {heading && (\n              <h2 className=\"text-3xl font-light leading-[1.1] tracking-tight text-foreground md:text-5xl\">\n                {heading}\n              </h2>\n            )}\n            {description && (\n              <div className=\"flex md:justify-end\">\n                <p className=\"max-w-md text-base leading-relaxed text-muted-foreground\">\n                  {description}\n                </p>\n              </div>\n            )}\n          </div>\n        </div>\n\n        <div className=\"mt-12 grid gap-8 md:mt-16 lg:grid-cols-[minmax(0,1fr)_minmax(0,1.2fr)] lg:gap-12\">\n          <div>\n            {settled ? (\n              <>\n                {survivors.length > 0 ? (\n                  <>\n                    {shortlistTitle && (\n                      <p className=\"text-sm text-muted-foreground\">{shortlistTitle}</p>\n                    )}\n                    <p className=\"mt-3 text-4xl font-light tracking-tight text-foreground\">\n                      {survivors.length}\n                      <span className=\"text-muted-foreground\"> of {destinations.length}</span>\n                    </p>\n\n                    <div className=\"mt-8\">\n                      {survivors.map((destination, index) => (\n                        <div\n                          key={index}\n                          className=\"flex items-start gap-4 border-t border-border py-5 first:border-t-0 first:pt-0\"\n                        >\n                          <img\n                            className=\"size-16 shrink-0 rounded-md object-cover\"\n                            src={destination.image.src}\n                            alt={destination.image.alt}\n                          />\n                          <div className=\"min-w-0 flex-1\">\n                            <p className=\"text-lg font-medium text-foreground\">\n                              {destination.name}\n                            </p>\n                            <p className=\"mt-1 text-sm leading-relaxed text-muted-foreground\">\n                              {destination.note}\n                            </p>\n                            {destination.link && (\n                              <Link\n                                href={destination.link.href}\n                                className=\"group/travel42 mt-2 inline-flex items-center gap-2 text-sm text-foreground transition-colors hover:text-primary\"\n                              >\n                                {destination.link.label}\n                                <ArrowUpRight\n                                  className=\"size-4 transition-transform motion-safe:group-hover/travel42:-translate-y-0.5 motion-safe:group-hover/travel42:translate-x-0.5\"\n                                  aria-hidden=\"true\"\n                                />\n                              </Link>\n                            )}\n                          </div>\n                        </div>\n                      ))}\n                    </div>\n                  </>\n                ) : (\n                  <>\n                    <p className=\"text-2xl font-light tracking-tight text-foreground md:text-3xl\">\n                      {emptyTitle ?? \"Nothing survived that combination\"}\n                    </p>\n                    {emptyBody && (\n                      <p className=\"mt-4 text-base leading-relaxed text-muted-foreground\">\n                        {emptyBody}\n                      </p>\n                    )}\n                  </>\n                )}\n\n                <div className=\"mt-8\">\n                  <Button21\n                    label={restartLabel ?? \"Start the list again\"}\n                    tone=\"outline\"\n                    icon={RotateCcw}\n                    onClick={restart}\n                  />\n                </div>\n              </>\n            ) : (\n              <Questionnaire\n                defaultItem={questions[0]?.name}\n                shortcuts={shortcuts}\n                onSubmit={handleSubmit}\n                className=\"gap-6\"\n              >\n                {questions.length > 0 && (\n                  <QuestionnaireProgress className=\"text-sm font-normal tracking-normal\" />\n                )}\n\n                {questions.map((question, index) => (\n                  <QuestionnaireItem key={index} name={question.name} required>\n                    <QuestionnaireTitle className=\"text-xl font-medium text-foreground\">\n                      {question.title}\n                    </QuestionnaireTitle>\n                    {question.description && (\n                      <QuestionnaireDescription className=\"text-base leading-relaxed\">\n                        {question.description}\n                      </QuestionnaireDescription>\n                    )}\n                    <QuestionnaireChoices>\n                      {question.choices?.map((choice, choiceIndex) => (\n                        <QuestionnaireChoice\n                          key={choiceIndex}\n                          value={choice.value}\n                          onChange={record(question, choice.value)}\n                          className=\"rounded-md border-border p-4 text-base\"\n                        >\n                          <span className=\"font-medium text-foreground\">{choice.label}</span>\n                          {choice.description && (\n                            <QuestionnaireChoiceDescription className=\"text-sm\">\n                              {choice.description}\n                            </QuestionnaireChoiceDescription>\n                          )}\n                        </QuestionnaireChoice>\n                      ))}\n                    </QuestionnaireChoices>\n                    <QuestionnaireError className=\"text-sm\" />\n                  </QuestionnaireItem>\n                ))}\n\n                <QuestionnaireActions>\n                  <QuestionnairePrevious className=\"cursor-pointer rounded-md border-border text-sm font-medium\">\n                    {previousLabel}\n                  </QuestionnairePrevious>\n                  <QuestionnaireNext className=\"cursor-pointer rounded-md bg-primary text-sm font-medium text-primary-foreground hover:bg-primary/90\">\n                    {nextLabel}\n                  </QuestionnaireNext>\n                  <QuestionnaireSubmit className=\"cursor-pointer rounded-md bg-primary text-sm font-medium text-primary-foreground hover:bg-primary/90\">\n                    {submitLabel}\n                  </QuestionnaireSubmit>\n                </QuestionnaireActions>\n              </Questionnaire>\n            )}\n          </div>\n\n          <div>\n            <div className=\"grid grid-cols-2 gap-4\">\n              {destinations.map((destination, index) => {\n                const kept = survives(destination);\n                return (\n                  <div\n                    key={index}\n                    aria-hidden={kept ? undefined : \"true\"}\n                    className={cn(\n                      \"relative h-44 overflow-hidden rounded-md bg-muted transition-opacity duration-300 md:h-56\",\n                      kept ? \"opacity-100\" : \"opacity-25\"\n                    )}\n                  >\n                    <img\n                      className=\"absolute inset-0 size-full object-cover\"\n                      src={destination.image.src}\n                      alt={destination.image.alt}\n                    />\n                    <div className=\"absolute inset-0 bg-gradient-to-t from-foreground/85 via-foreground/30 to-transparent\" />\n                    <div className=\"absolute inset-x-0 bottom-0 p-4\">\n                      <p className=\"text-base font-medium text-background\">{destination.name}</p>\n                    </div>\n                  </div>\n                );\n              })}\n            </div>\n\n            <p className=\"mt-5 border-t border-border pt-5 text-base text-muted-foreground\">\n              <span className=\"text-primary\">\n                {survivors.length} of {destinations.length}\n              </span>{\" \"}\n              {countSuffix ?? \"still fit\"}\n            </p>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/block/travel42.tsx"
    },
    {
      "path": "registry-components/badge23/badge23.tsx",
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/utils\";\n\ntype Tone = \"muted\" | \"foreground\" | \"primary\";\n\ninterface Badge23Props {\n  /** Eyebrow label */\n  label: string;\n  /** Text/border tone */\n  tone?: Tone;\n  /** Additional classes merged onto the root */\n  className?: string;\n}\n\nconst toneStyles: Record<Tone, string> = {\n  muted: \"border-border text-muted-foreground\",\n  foreground: \"border-foreground/30 text-foreground\",\n  primary: \"border-primary/40 text-primary\",\n};\n\nexport const badge23Demo: Badge23Props = {\n  label: \"Product\",\n};\n\nexport function Badge23({ label, tone = \"muted\", className }: Badge23Props) {\n  return (\n    <span\n      className={cn(\n        \"inline-flex items-center rounded-md border bg-transparent px-2.5 py-1 text-sm font-medium leading-none\",\n        toneStyles[tone],\n        className\n      )}\n    >\n      {label}\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/component/badge23.tsx"
    },
    {
      "path": "registry-components/button21/button21.tsx",
      "content": "\"use client\";\n\nimport type { LucideIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\ntype Tone = \"primary\" | \"neutral\" | \"outline\";\n\ninterface Button21Props {\n  /** Button label */\n  label: string;\n  /**\n   * Compose the rendered element shadcn-style (radix asChild): your element\n   * (e.g. a router Link) becomes the root and the button content is injected\n   * as its children. Pass the element without children of its own.\n   */\n  asChild?: boolean;\n  /** The element to render when `asChild` is set (e.g. your framework's Link) */\n  children?: React.ReactElement;\n  /**\n   * Fallback link: renders a plain `<a>`. Prefer `asChild` with your\n   * framework's Link component for client-side navigation.\n   */\n  href?: string;\n  /** Optional trailing icon */\n  icon?: LucideIcon;\n  /** Surface tone: solid accent (default), soft neutral pill, or hairline outline */\n  tone?: Tone;\n  /** Click handler (used when there is no href and no asChild) */\n  onClick?: React.MouseEventHandler<HTMLButtonElement>;\n  /** Additional classes merged onto the button */\n  className?: string;\n}\n\nconst toneStyles: Record<Tone, string> = {\n  primary: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n  neutral: \"bg-muted text-foreground hover:bg-muted/70\",\n  outline: \"border border-border bg-transparent text-foreground hover:bg-muted\",\n};\n\nexport const button21Demo: Button21Props = {\n  label: \"Book a demo\",\n};\n\nexport function Button21({\n  label,\n  asChild = false,\n  children,\n  href,\n  icon: Icon,\n  tone = \"primary\",\n  onClick,\n  className,\n}: Button21Props) {\n  const classes = cn(\n    \"group/button21 h-auto w-fit gap-2 rounded-md px-5 py-2.5 text-sm font-medium tracking-tight transition-colors\",\n    toneStyles[tone],\n    className\n  );\n\n  const inner = (\n    <>\n      {label}\n      {Icon && (\n        <Icon className=\"size-4 transition-transform motion-safe:group-hover/button21:translate-x-0.5\" />\n      )}\n    </>\n  );\n\n  if (asChild && React.isValidElement(children)) {\n    return (\n      <Button asChild className={classes}>\n        {React.cloneElement(children, undefined, inner)}\n      </Button>\n    );\n  }\n\n  if (href) {\n    return (\n      <Button asChild className={classes}>\n        <a href={href}>{inner}</a>\n      </Button>\n    );\n  }\n\n  return (\n    <Button type=\"button\" className={classes} onClick={onClick}>\n      {inner}\n    </Button>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/component/button21.tsx"
    }
  ],
  "type": "registry:block"
}