{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blockquote",
  "title": "Blockquote",
  "description": "A quote with its author: a rule on the left, a large quotation mark, a framed card or a big centred pull quote, revealed as it scrolls into view with a highlighter sweeping across the phrase that matters.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/blockquote/blockquote.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useInView, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport interface BlockquoteProps {\n  /** The quote. A string can have a phrase marked with highlight. */\n  children?: React.ReactNode;\n  author?: string;\n  role?: string;\n  /** Author photo URL; initials are used when it's missing. */\n  avatar?: string;\n  /** Source URL, linked from the author line and set as the cite attribute. */\n  cite?: string;\n  /** bar: rule on the left. mark: large quotation mark. card: framed. pull: large and centred. */\n  variant?: \"bar\" | \"mark\" | \"card\" | \"pull\";\n  /** A phrase inside the quote to mark with a highlighter sweep. */\n  highlight?: string;\n  /** Colour of the bar, mark and highlight. */\n  accent?: string;\n  /** Play the reveal the first time the quote scrolls into view. */\n  animateIn?: boolean;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.55)\", panel: \"#0E0E0E\", border: \"rgba(255,255,255,0.09)\", rule: \"#F5F4F1\", mark: \"rgba(245,244,241,0.14)\", hl: \"rgba(255,122,107,0.4)\", avatar: \"rgba(255,255,255,0.1)\", focus: \"rgba(245,244,241,0.85)\" },\n  light: { text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.55)\", panel: \"#FFFFFF\", border: \"rgba(10,10,10,0.1)\", rule: \"#0A0A0A\", mark: \"rgba(10,10,10,0.1)\", hl: \"rgba(255,122,107,0.3)\", avatar: \"rgba(10,10,10,0.07)\", focus: \"rgba(10,10,10,0.85)\" },\n};\n\nconst initials = (n: string) =>\n  n\n    .split(/\\s+/)\n    .map((w) => w[0])\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n\nexport function Blockquote({\n  children = \"The best interfaces disappear. People shouldn't notice the tool, only that the work got easier, faster and a little more fun.\",\n  author = \"Maya Chen\",\n  role = \"Head of Design, Northwind\",\n  avatar,\n  cite,\n  variant = \"bar\",\n  highlight = \"only that the work got easier\",\n  accent,\n  animateIn = true,\n  theme = \"dark\",\n  className,\n}: BlockquoteProps) {\n  const p = PALETTES[theme];\n  const reduce = Boolean(useReducedMotion());\n  const ref = React.useRef<HTMLElement>(null);\n  const inView = useInView(ref, { once: true, amount: 0.4 });\n  const show = !animateIn || reduce || inView;\n  const rule = accent ?? p.rule;\n  const hl = accent ? `color-mix(in srgb, ${accent} 30%, transparent)` : p.hl;\n  const pull = variant === \"pull\";\n\n  // Split a string quote around the highlighted phrase.\n  let body: React.ReactNode = children;\n  if (typeof children === \"string\" && highlight && children.includes(highlight)) {\n    const [before, ...rest] = children.split(highlight);\n    body = (\n      <>\n        {before}\n        <motion.mark\n          className=\"rounded-[3px] bg-no-repeat\"\n          style={{ color: \"inherit\", backgroundColor: \"transparent\", backgroundImage: `linear-gradient(${hl}, ${hl})`, backgroundPosition: \"0 88%\", padding: \"0 2px\", margin: \"0 -2px\", boxDecorationBreak: \"clone\", WebkitBoxDecorationBreak: \"clone\" }}\n          initial={false}\n          animate={{ backgroundSize: show ? \"100% 42%\" : \"0% 42%\" }}\n          transition={{ duration: reduce ? 0 : 0.9, delay: reduce ? 0 : 0.55, ease: [0.65, 0, 0.35, 1] }}\n        >\n          {highlight}\n        </motion.mark>\n        {rest.join(highlight)}\n      </>\n    );\n  }\n\n  const size = pull ? \"clamp(22px, 3.2vw, 30px)\" : variant === \"card\" ? \"18px\" : \"20px\";\n\n  return (\n    <motion.figure\n      ref={ref as React.Ref<HTMLElement>}\n      className={cn(\"relative m-0 flex flex-col\", pull && \"items-center text-center\", className)}\n      style={{\n        gap: 18,\n        fontFamily: \"Inter, sans-serif\",\n        color: p.text,\n        padding: variant === \"card\" ? \"28px 28px 24px\" : variant === \"bar\" ? \"4px 0 4px 26px\" : variant === \"mark\" ? \"30px 0 0 0\" : \"0\",\n        borderRadius: variant === \"card\" ? 18 : 0,\n        background: variant === \"card\" ? p.panel : \"transparent\",\n        border: variant === \"card\" ? `1px solid ${p.border}` : undefined,\n      }}\n      initial={animateIn && !reduce ? { opacity: 0, y: 12 } : false}\n      animate={show ? { opacity: 1, y: 0 } : undefined}\n      transition={{ duration: 0.6, ease: [0.22, 1, 0.36, 1] }}\n    >\n      {variant === \"bar\" && <motion.span aria-hidden=\"true\" className=\"absolute top-0 bottom-0 left-0 block origin-top rounded-full\" style={{ width: 3, background: rule }} initial={false} animate={{ scaleY: show ? 1 : 0 }} transition={{ duration: reduce ? 0 : 0.7, ease: [0.22, 1, 0.36, 1] }} />}\n      {(variant === \"mark\" || variant === \"card\" || pull) && (\n        <motion.svg\n          aria-hidden=\"true\"\n          width={pull ? 44 : variant === \"card\" ? 30 : 36}\n          height={pull ? 44 : variant === \"card\" ? 30 : 36}\n          viewBox=\"0 0 24 24\"\n          className={cn(variant === \"mark\" && \"absolute top-0 left-0\", variant === \"card\" && \"-mb-2\")}\n          style={{ color: accent ?? p.muted }}\n          initial={false}\n          animate={{ opacity: show ? 1 : 0, scale: show ? 1 : 0.6, rotate: show ? 0 : -12 }}\n          transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 260, damping: 16, delay: 0.1 }}\n        >\n          <path fill=\"currentColor\" d=\"M9.6 6.5C6.9 7.6 5 10 5 13.2V18h5.2v-5.1H7.8c0-1.9 1-3.4 2.9-4.3ZM18.4 6.5c-2.7 1.1-4.6 3.5-4.6 6.7V18H19v-5.1h-2.4c0-1.9 1-3.4 2.9-4.3Z\" />\n        </motion.svg>\n      )}\n      <blockquote cite={cite} className=\"m-0 font-medium tracking-[-0.015em]\" style={{ fontSize: size, lineHeight: 1.45, maxWidth: pull ? 640 : undefined, textWrap: \"pretty\" }}>\n        {body}\n      </blockquote>\n      {(author || role) && (\n        <figcaption className={cn(\"flex items-center\", pull && \"justify-center\")} style={{ gap: 12 }}>\n          <span className=\"flex shrink-0 items-center justify-center overflow-hidden rounded-full text-[12px] font-semibold\" style={{ width: 36, height: 36, background: p.avatar }} aria-hidden=\"true\">\n            {avatar ? (\n              // eslint-disable-next-line @next/next/no-img-element\n              <img src={avatar} alt=\"\" className=\"h-full w-full object-cover\" />\n            ) : (\n              author && initials(author)\n            )}\n          </span>\n          <span className={cn(\"flex min-w-0 flex-col\", pull ? \"items-start text-left\" : \"\")}>\n            {author &&\n              (cite ? (\n                <a href={cite} className=\"text-[14px] font-semibold no-underline outline-none hover:underline focus-visible:underline\" style={{ color: p.text }}>\n                  {author}\n                </a>\n              ) : (\n                <cite className=\"text-[14px] font-semibold not-italic\">{author}</cite>\n              ))}\n            {role && (\n              <span className=\"text-[13px]\" style={{ color: p.muted }}>\n                {role}\n              </span>\n            )}\n          </span>\n        </figcaption>\n      )}\n    </motion.figure>\n  );\n}\n\nexport default Blockquote;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}