{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "gallery25",
  "title": "Pick The Frames Taste Profile",
  "description": "A gallery finder whose questions are photographs rather than sentences: three rows of frames are chosen by eye, and the result names the leading way of looking, shows the series that goes with it, and breaks the picks down as a share bar.",
  "dependencies": [
    "clsx",
    "tailwind-merge",
    "lucide-react",
    "@radix-ui/react-slot"
  ],
  "registryDependencies": [
    "questionnaire"
  ],
  "files": [
    {
      "path": "registry/gallery25/gallery25.tsx",
      "content": "\"use client\";\n\nimport { Check, RotateCcw } from \"lucide-react\";\nimport Link from \"next/link\";\nimport { type FormEvent, useState } from \"react\";\nimport { Badge7 } from \"@/components/beste/component/badge7\";\nimport { Button12 } from \"@/components/beste/component/button12\";\nimport {\n  Questionnaire,\n  QuestionnaireActions,\n  QuestionnaireChoice,\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 ActionButton {\n  label: string;\n  href: string;\n}\n\ninterface Frame {\n  src: string;\n  alt: string;\n}\n\ninterface PhotoChoice {\n  value: string;\n  label: string;\n  image: Frame;\n  /** Which style this frame counts towards. Matches a `Style` key. */\n  style: string;\n}\n\ninterface PhotoQuestion {\n  /** Form field name. Must be unique across the flow. */\n  name: string;\n  title: string;\n  description?: string;\n  choices?: PhotoChoice[];\n}\n\ninterface Style {\n  /** Referenced by every frame that counts towards it */\n  key: string;\n  title: string;\n  description: string;\n  /** The set shown once this style leads */\n  strip?: Frame[];\n  button?: ActionButton;\n}\n\ninterface Gallery25Labels {\n  previous?: string;\n  next?: string;\n  submit?: string;\n  restart?: string;\n  leadLabel?: string;\n  breakdownTitle?: string;\n}\n\ninterface Gallery25Props {\n  badge?: Badge;\n  heading?: string;\n  description?: string;\n  questions?: PhotoQuestion[];\n  /** Counted from the frames that were picked; the largest share leads. */\n  styles?: Style[];\n  labels?: Gallery25Labels;\n  className?: string;\n}\n\nexport const gallery25Demo: Gallery25Props = {\n  badge: { label: \"What do you actually like\" },\n  heading: \"Choose pictures, not adjectives.\",\n  description:\n    \"Nobody knows what they mean by warm or timeless. Pick the frames you would hang and we will tell you what you have been choosing.\",\n  labels: {\n    submit: \"Read my picks\",\n    restart: \"Pick again\",\n    leadLabel: \"of your picks\",\n    breakdownTitle: \"How it broke down\",\n  },\n  questions: [\n    {\n      name: \"one\",\n      title: \"Which of these would you hang?\",\n      description: \"First instinct. There is no wrong frame here.\",\n      choices: [\n        {\n          value: \"a\",\n          label: \"Empty foreground, long light\",\n          style: \"quiet\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1758094651721-2381a3b2d553?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n            alt: \"Frame from the quiet selection\",\n          },\n        },\n        {\n          value: \"b\",\n          label: \"Somebody caught mid-sentence\",\n          style: \"documentary\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1771838230544-aac51a5fcd24?q=80&w=2235&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n            alt: \"Frame from the documentary selection\",\n          },\n        },\n        {\n          value: \"c\",\n          label: \"Everything squared to the wall\",\n          style: \"formal\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1649930691189-df5fe1c1483b?q=80&w=2940&auto=format&fit=crop&ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D\",\n            alt: \"Frame from the formal selection\",\n          },\n        },\n      ],\n    },\n    {\n      name: \"two\",\n      title: \"And of these?\",\n      choices: [\n        {\n          value: \"a\",\n          label: \"Fog doing most of the work\",\n          style: \"quiet\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1464207687429-7505649dae38?w=900&h=1100&fit=crop\",\n            alt: \"Second frame from the quiet selection\",\n          },\n        },\n        {\n          value: \"b\",\n          label: \"A room full of people, none of them posing\",\n          style: \"documentary\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=900&h=1100&fit=crop\",\n            alt: \"Second frame from the documentary selection\",\n          },\n        },\n        {\n          value: \"c\",\n          label: \"One object, centred, nothing else\",\n          style: \"formal\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1505373877841-8d25f7d46678?w=900&h=1100&fit=crop\",\n            alt: \"Second frame from the formal selection\",\n          },\n        },\n      ],\n    },\n    {\n      name: \"three\",\n      title: \"Last one.\",\n      choices: [\n        {\n          value: \"a\",\n          label: \"Nothing happening, beautifully\",\n          style: \"quiet\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1465101046530-73398c7f28ca?w=900&h=1100&fit=crop\",\n            alt: \"Third frame from the quiet selection\",\n          },\n        },\n        {\n          value: \"b\",\n          label: \"The moment just after the moment\",\n          style: \"documentary\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1511578314322-379afb476865?w=900&h=1100&fit=crop\",\n            alt: \"Third frame from the documentary selection\",\n          },\n        },\n        {\n          value: \"c\",\n          label: \"Light used like a ruler\",\n          style: \"formal\",\n          image: {\n            src: \"https://images.unsplash.com/photo-1531058020387-3be344556be6?w=900&h=1100&fit=crop\",\n            alt: \"Third frame from the formal selection\",\n          },\n        },\n      ],\n    },\n  ],\n  styles: [\n    {\n      key: \"quiet\",\n      title: \"The quiet eye\",\n      description:\n        \"You keep choosing frames where very little is happening. They are the hardest to sell and the easiest to live with, which is why they end up in hallways rather than above sofas.\",\n      strip: [\n        {\n          src: \"https://images.unsplash.com/photo-1441974231531-c6227db76b6e?w=800&h=800&fit=crop\",\n          alt: \"Print from the quiet series\",\n        },\n        {\n          src: \"https://images.unsplash.com/photo-1464207687429-7505649dae38?w=800&h=800&fit=crop\",\n          alt: \"Second print from the quiet series\",\n        },\n        {\n          src: \"https://images.unsplash.com/photo-1465101046530-73398c7f28ca?w=800&h=800&fit=crop\",\n          alt: \"Third print from the quiet series\",\n        },\n      ],\n      button: { label: \"See the quiet series\", href: \"https://beste.co\" },\n    },\n    {\n      key: \"documentary\",\n      title: \"The documentary eye\",\n      description:\n        \"You pick the frames with somebody in them, usually caught between two intentions. These date faster and mean more, and nobody ever asks what they are of.\",\n      strip: [\n        {\n          src: \"https://images.unsplash.com/photo-1519741497674-611481863552?w=800&h=800&fit=crop\",\n          alt: \"Print from the documentary series\",\n        },\n        {\n          src: \"https://images.unsplash.com/photo-1492684223066-81342ee5ff30?w=800&h=800&fit=crop\",\n          alt: \"Second print from the documentary series\",\n        },\n        {\n          src: \"https://images.unsplash.com/photo-1511578314322-379afb476865?w=800&h=800&fit=crop\",\n          alt: \"Third print from the documentary series\",\n        },\n      ],\n      button: { label: \"See the documentary series\", href: \"https://beste.co\" },\n    },\n    {\n      key: \"formal\",\n      title: \"The formal eye\",\n      description:\n        \"Squared, centred, and lit deliberately. You are choosing composition over subject, which means these will still look right when the room around them changes.\",\n      strip: [\n        {\n          src: \"https://images.unsplash.com/photo-1520607162513-77705c0f0d4a?w=800&h=800&fit=crop\",\n          alt: \"Print from the formal series\",\n        },\n        {\n          src: \"https://images.unsplash.com/photo-1505373877841-8d25f7d46678?w=800&h=800&fit=crop\",\n          alt: \"Second print from the formal series\",\n        },\n        {\n          src: \"https://images.unsplash.com/photo-1531058020387-3be344556be6?w=800&h=800&fit=crop\",\n          alt: \"Third print from the formal series\",\n        },\n      ],\n      button: { label: \"See the formal series\", href: \"https://beste.co\" },\n    },\n  ],\n};\n\n/** Segment shades for the breakdown bar, strongest first. */\nconst shades = [\"bg-foreground\", \"bg-foreground/45\", \"bg-foreground/20\"];\n\nexport function Gallery25({\n  badge,\n  heading,\n  description,\n  questions = [],\n  styles = [],\n  labels = {},\n  className,\n}: Gallery25Props) {\n  const {\n    previous: previousLabel,\n    next: nextLabel,\n    submit: submitLabel,\n    restart: restartLabel,\n    leadLabel,\n    breakdownTitle,\n  } = labels;\n\n  const [result, setResult] = useState<{ key: string; count: number; percent: number }[] | null>(\n    null\n  );\n\n  const handleSubmit = (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    const data = new FormData(event.currentTarget);\n\n    const counts: Record<string, number> = {};\n    let total = 0;\n    for (const question of questions) {\n      const value = String(data.get(question.name) ?? \"\");\n      const choice = question.choices?.find((entry) => entry.value === value);\n      if (!choice) continue;\n      counts[choice.style] = (counts[choice.style] ?? 0) + 1;\n      total += 1;\n    }\n    if (total === 0) return;\n\n    const tally = styles\n      .map((style) => ({\n        key: style.key,\n        count: counts[style.key] ?? 0,\n        percent: Math.round(((counts[style.key] ?? 0) / total) * 100),\n      }))\n      .sort((a, b) => b.count - a.count);\n\n    setResult(tally);\n  };\n\n  const restart = () => setResult(null);\n\n  const styleFor = (key: string) => styles.find((style) => style.key === key);\n  const lead = result ? styleFor(result[0]?.key ?? \"\") : undefined;\n\n  return (\n    <section className={cn(\"w-full py-16 md:py-24\", className)}>\n      <div className=\"mx-auto max-w-7xl px-4 md:px-6\">\n        <div className=\"grid gap-8 md:grid-cols-[1.2fr_1fr] md:items-end md:gap-16\">\n          <div>\n            {badge && <Badge7 label={badge.label} />}\n            {heading && (\n              <h2 className=\"mt-6 max-w-2xl text-balance text-3xl font-bold leading-tight tracking-tight text-foreground md:text-4xl lg:text-5xl\">\n                {heading}\n              </h2>\n            )}\n          </div>\n          {description && (\n            <p className=\"max-w-md text-lg leading-relaxed text-muted-foreground md:text-xl\">\n              {description}\n            </p>\n          )}\n        </div>\n\n        {result && lead ? (\n          <div className=\"mt-12 md:mt-16\">\n            <div className=\"grid gap-10 lg:grid-cols-[1fr_1.1fr] lg:gap-16\">\n              <div>\n                <p className=\"mt-6 text-3xl font-bold leading-tight tracking-tight text-foreground md:text-4xl\">\n                  {lead.title}\n                </p>\n                <p className=\"mt-4 text-lg leading-relaxed text-muted-foreground md:text-xl\">\n                  {lead.description}\n                </p>\n\n                <p className=\"mt-8 text-4xl font-bold tabular-nums tracking-tight text-foreground md:text-5xl\">\n                  {result[0]?.percent}%\n                  <span className=\"ml-3 text-lg font-bold text-muted-foreground md:text-xl\">\n                    {leadLabel ?? \"of your picks\"}\n                  </span>\n                </p>\n\n                {lead.button && (\n                  <div className=\"mt-8 flex flex-wrap items-center gap-4\">\n                    <Button12 asChild label={lead.button.label}>\n                      <Link href={lead.button.href} />\n                    </Button12>\n                    <Button12\n                      label={restartLabel ?? \"Pick again\"}\n                      tone=\"outline\"\n                      icon={RotateCcw}\n                      onClick={restart}\n                    />\n                  </div>\n                )}\n              </div>\n\n              <div>\n                <div className=\"grid grid-cols-3 gap-4\">\n                  {lead.strip?.map((frame, index) => (\n                    <div key={index} className=\"rounded-md bg-muted p-3\">\n                      <div className=\"relative h-52 overflow-hidden rounded-md md:h-64\">\n                        <img\n                          className=\"absolute inset-0 size-full object-cover\"\n                          src={frame.src}\n                          alt={frame.alt}\n                        />\n                      </div>\n                    </div>\n                  ))}\n                </div>\n\n                <div className=\"mt-10\">\n                  {breakdownTitle && (\n                    <p className=\"text-lg font-bold tracking-tight text-foreground\">\n                      {breakdownTitle}\n                    </p>\n                  )}\n\n                  <div className=\"mt-5 flex h-2 w-full overflow-hidden rounded-full bg-current/10\">\n                    {result.map((entry, index) => (\n                      <div\n                        key={index}\n                        className={cn(\"h-full\", shades[index] ?? \"bg-foreground/10\")}\n                        style={{ width: `${entry.percent}%` }}\n                      />\n                    ))}\n                  </div>\n\n                  <dl className=\"mt-6 flex flex-col\">\n                    {result.map((entry, index) => (\n                      <div\n                        key={index}\n                        className=\"flex items-baseline justify-between gap-6 border-t border-current/10 py-4 first:border-t-0 first:pt-0\"\n                      >\n                        <dt className=\"flex items-center gap-3 text-base text-muted-foreground md:text-lg\">\n                          <span\n                            aria-hidden=\"true\"\n                            className={cn(\n                              \"size-3 shrink-0 rounded-full\",\n                              shades[index] ?? \"bg-foreground/10\"\n                            )}\n                          />\n                          {styleFor(entry.key)?.title}\n                        </dt>\n                        <dd className=\"text-base font-bold tabular-nums text-foreground md:text-lg\">\n                          {entry.percent}%\n                        </dd>\n                      </div>\n                    ))}\n                  </dl>\n                </div>\n              </div>\n            </div>\n          </div>\n        ) : (\n          <div className=\"mt-12 md:mt-16\">\n            <Questionnaire defaultItem={questions[0]?.name} onSubmit={handleSubmit} className=\"gap-8\">\n              {questions.length > 0 && <QuestionnaireProgress className=\"text-base\" />}\n\n              {questions.map((question, index) => (\n                <QuestionnaireItem key={index} name={question.name} required>\n                  <QuestionnaireTitle className=\"text-2xl font-bold tracking-tight text-foreground md:text-3xl\">\n                    {question.title}\n                  </QuestionnaireTitle>\n                  {question.description && (\n                    <QuestionnaireDescription className=\"text-lg text-muted-foreground md:text-xl\">\n                      {question.description}\n                    </QuestionnaireDescription>\n                  )}\n                  <QuestionnaireChoices className=\"mt-2 gap-4 sm:grid-cols-3\">\n                    {question.choices?.map((choice, choiceIndex) => (\n                      <QuestionnaireChoice\n                        key={choiceIndex}\n                        value={choice.value}\n                        className=\"flex-col items-stretch gap-0 rounded-md border-0 bg-muted p-3 hover:bg-muted data-checked:bg-foreground dark:bg-muted dark:data-checked:bg-foreground [&>[data-slot=questionnaire-choice-indicator]]:hidden [&>[data-slot=questionnaire-choice-shortcut]]:hidden\"\n                      >\n                        <span className=\"relative block h-52 w-full overflow-hidden rounded-md md:h-64\">\n                          <img\n                            className=\"absolute inset-0 size-full object-cover\"\n                            src={choice.image.src}\n                            alt={choice.image.alt}\n                          />\n                          <span\n                            aria-hidden=\"true\"\n                            className=\"absolute right-3 top-3 flex size-8 items-center justify-center rounded-full bg-background text-foreground opacity-0 transition-opacity group-data-checked/questionnaire-choice:opacity-100\"\n                          >\n                            <Check className=\"size-4\" />\n                          </span>\n                        </span>\n                        <span className=\"block px-1 pt-4 pb-1 text-base font-bold text-foreground group-data-checked/questionnaire-choice:text-background md:text-lg\">\n                          {choice.label}\n                        </span>\n                      </QuestionnaireChoice>\n                    ))}\n                  </QuestionnaireChoices>\n                  <QuestionnaireError className=\"text-base\" />\n                </QuestionnaireItem>\n              ))}\n\n              <QuestionnaireActions>\n                <QuestionnairePrevious className=\"cursor-pointer rounded-full border-current/15 bg-background text-base\">\n                  {previousLabel}\n                </QuestionnairePrevious>\n                <QuestionnaireNext className=\"cursor-pointer rounded-full bg-foreground text-base text-background hover:bg-foreground/90\">\n                  {nextLabel}\n                </QuestionnaireNext>\n                <QuestionnaireSubmit className=\"cursor-pointer rounded-full bg-foreground text-base text-background hover:bg-foreground/90\">\n                  {submitLabel}\n                </QuestionnaireSubmit>\n              </QuestionnaireActions>\n            </Questionnaire>\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/block/gallery25.tsx"
    },
    {
      "path": "registry-components/badge7/badge7.tsx",
      "content": "import { cn } from \"@/lib/utils\";\n\n/** Allowed wrapper styles, a fixed set, not arbitrary characters. */\ntype Badge7Bracket = \"round\" | \"square\" | \"curly\" | \"angle\" | \"none\";\n\nconst BRACKETS: Record<Badge7Bracket, [open: string, close: string]> = {\n  round: [\"(\", \")\"],\n  square: [\"[\", \"]\"],\n  curly: [\"{\", \"}\"],\n  angle: [\"<\", \">\"],\n  none: [\"\", \"\"],\n};\n\ntype Tone = \"muted\" | \"foreground\" | \"primary\";\n\ninterface Badge7Props {\n  /** Eyebrow label */\n  label: string;\n  /** Which characters wrap the label. Limited to the BRACKETS set. */\n  bracket?: Badge7Bracket;\n  /** Label color */\n  tone?: Tone;\n  /** Render rotated for vertical edge placement (e.g. along a hero side) */\n  vertical?: boolean;\n  /** Additional classes merged onto the root */\n  className?: string;\n}\n\nconst toneStyles: Record<Tone, string> = {\n  muted: \"text-muted-foreground\",\n  foreground: \"text-foreground\",\n  primary: \"text-primary\",\n};\n\nexport const badge7Demo: Badge7Props = {\n  label: \"About\",\n};\n\nexport function Badge7({\n  label,\n  bracket = \"round\",\n  tone = \"muted\",\n  vertical = false,\n  className,\n}: Badge7Props) {\n  const [open, close] = BRACKETS[bracket];\n\n  return (\n    <span\n      className={cn(\n        \"text-base font-medium\",\n        toneStyles[tone],\n        vertical ? \"rotate-180 [writing-mode:vertical-rl]\" : \"inline-block\",\n        className\n      )}\n    >\n      {`${open}${label}${close}`}\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/component/badge7.tsx"
    },
    {
      "path": "registry-components/button12/button12.tsx",
      "content": "\"use client\";\n\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { ArrowUpRight, type LucideIcon } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"@/lib/utils\";\n\ntype Tone = \"dark\" | \"primary\" | \"outline\";\n\ninterface Button12Props {\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  /** Seal icon (defaults to ArrowUpRight) */\n  icon?: LucideIcon;\n  /** Surface tone: solid dark (default), solid primary, or bordered 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, { pill: string; seal: string }> = {\n  dark: {\n    pill: \"bg-foreground text-background hover:bg-foreground/90\",\n    seal: \"bg-background text-foreground\",\n  },\n  primary: {\n    pill: \"bg-primary text-primary-foreground hover:bg-primary/90\",\n    seal: \"bg-primary-foreground text-primary\",\n  },\n  outline: {\n    pill: \"border bg-background text-foreground hover:bg-muted\",\n    seal: \"bg-foreground text-background\",\n  },\n};\n\nexport const button12Demo: Button12Props = {\n  label: \"Book an intro call\",\n};\n\nexport function Button12({\n  label,\n  asChild = false,\n  children,\n  href,\n  icon: Icon = ArrowUpRight,\n  tone = \"dark\",\n  onClick,\n  className,\n}: Button12Props) {\n  const styles = toneStyles[tone];\n\n  const classes = cn(\n    \"group/button12 inline-flex w-fit cursor-pointer items-center gap-3 rounded-full py-2 pl-8 pr-2 text-base font-bold transition-colors\",\n    styles.pill,\n    className\n  );\n\n  const inner = (\n    <>\n      {/* Label slides out the bottom while a copy drops in from the top */}\n      <span className=\"relative block overflow-hidden\">\n        <span className=\"block transition-transform duration-300 ease-out motion-safe:group-hover/button12:translate-y-full\">\n          {label}\n        </span>\n        <span\n          aria-hidden=\"true\"\n          className=\"absolute inset-0 block -translate-y-full transition-transform duration-300 ease-out motion-safe:group-hover/button12:translate-y-0\"\n        >\n          {label}\n        </span>\n      </span>\n\n      {/* Seal: icon exits the top-right corner as a copy enters from bottom-left */}\n      <span\n        className={cn(\n          \"relative flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full\",\n          styles.seal\n        )}\n      >\n        <Icon className=\"size-4 transition-transform duration-300 ease-out motion-safe:group-hover/button12:translate-x-[160%] motion-safe:group-hover/button12:-translate-y-[160%]\" />\n        <Icon\n          aria-hidden=\"true\"\n          className=\"absolute size-4 -translate-x-[160%] translate-y-[160%] transition-transform duration-300 ease-out motion-safe:group-hover/button12:translate-x-0 motion-safe:group-hover/button12:translate-y-0\"\n        />\n      </span>\n    </>\n  );\n\n  if (asChild && React.isValidElement(children)) {\n    return (\n      <Slot className={classes}>\n        {React.cloneElement(children, undefined, inner)}\n      </Slot>\n    );\n  }\n\n  if (href) {\n    return (\n      <a href={href} className={classes}>\n        {inner}\n      </a>\n    );\n  }\n\n  return (\n    <button type=\"button\" onClick={onClick} className={classes}>\n      {inner}\n    </button>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/beste/component/button12.tsx"
    }
  ],
  "type": "registry:block"
}