{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "testimonials-block",
  "type": "registry:block",
  "title": "Testimonials Block",
  "description": "A Testimonials Block component for displaying a testimonials section.",
  "files": [
    {
      "path": "src/registry/blocks/testimonials/testimonials-block.tsx",
      "type": "registry:block",
      "content": "\"use client\";\n\nimport { useId, useState, type ComponentProps, type KeyboardEvent } from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { ArrowLeft, ArrowRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport type Testimonial = {\n  quote: string;\n  name: string;\n  role: string;\n  company: string;\n  /** Square portrait URL. Falls back to an initials monogram when omitted. */\n  avatar?: string;\n};\n\nexport type TestimonialsBlockProps = {\n  eyebrow?: string;\n  title?: string;\n  testimonials?: Testimonial[];\n  footnote?: string;\n} & ComponentProps<\"section\">;\n\nconst DEFAULT_TESTIMONIALS: Testimonial[] = [\n  {\n    quote:\n      \"We used to block three full days for onboarding. With Fieldbook it's an afternoon — new hires open the runbook, click through, and ship a small fix before dinner. I honestly didn't believe it until the second cohort.\",\n    name: \"Maren Okafor\",\n    role: \"Head of Platform\",\n    company: \"Tidewater Freight\",\n    avatar:\n      \"https://images.unsplash.com/photo-1494790108377-be9c29b29330?w=160&h=160&fit=crop&crop=faces\",\n  },\n  {\n    quote:\n      \"The thing nobody tells you is that docs rot because nobody owns them. Fieldbook pings the last person who touched a page when the code under it changes. Our stale-page count went from 212 to 19 in a quarter.\",\n    name: \"Daniel Reyes\",\n    role: \"Staff Engineer\",\n    company: \"Corvid Health\",\n    avatar:\n      \"https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?w=160&h=160&fit=crop&crop=faces\",\n  },\n  {\n    quote:\n      \"I was the skeptic. We'd tried two wikis and a Notion graveyard already. What won me over was search that actually finds the incident write-up from 2023, not a meeting note that mentions it.\",\n    name: \"Priya Natarajan\",\n    role: \"Engineering Manager\",\n    company: \"Ashgrove Labs\",\n    avatar:\n      \"https://images.unsplash.com/photo-1487412720507-e7ab37603c6f?w=160&h=160&fit=crop&crop=faces\",\n  },\n  {\n    quote:\n      \"On-call handoffs are about four minutes now. Everything the next person needs is linked from one page, and it's the same page every time.\",\n    name: \"Tomasz Wiącek\",\n    role: \"SRE Lead\",\n    company: \"Brightline Payments\",\n    avatar:\n      \"https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=160&h=160&fit=crop&crop=faces\",\n  },\n  {\n    quote:\n      \"Small team, no dedicated writer. We still have docs people trust, mostly because Fieldbook makes the boring part — keeping them current — somebody's two-minute job instead of nobody's.\",\n    name: \"Hana Sato\",\n    role: \"Co-founder & CTO\",\n    company: \"Paperkite\",\n    avatar:\n      \"https://images.unsplash.com/photo-1438761681033-6461ffad8d80?w=160&h=160&fit=crop&crop=faces\",\n  },\n];\n\nconst pad = (n: number) => String(n).padStart(2, \"0\");\n\nconst initials = (name: string) =>\n  name\n    .split(\" \")\n    .map((part) => part[0])\n    .slice(0, 2)\n    .join(\"\");\n\nexport default function TestimonialsBlock({\n  eyebrow = \"Field reports\",\n  title = \"What changed after the first quarter\",\n  testimonials = DEFAULT_TESTIMONIALS,\n  footnote = \"Quotes lightly edited for length. Shared with permission, 2026.\",\n  className,\n  ...props\n}: TestimonialsBlockProps) {\n  const [index, setIndex] = useState(0);\n  const reduceMotion = useReducedMotion();\n  const titleId = useId();\n  const total = testimonials.length;\n  const current = testimonials[index] ?? testimonials[0];\n\n  const go = (delta: number) => {\n    if (total === 0) return;\n    setIndex((i) => (i + delta + total) % total);\n  };\n\n  const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n    if (event.key === \"ArrowRight\") {\n      event.preventDefault();\n      go(1);\n    } else if (event.key === \"ArrowLeft\") {\n      event.preventDefault();\n      go(-1);\n    }\n  };\n\n  return (\n    <section\n      data-slot=\"testimonials-block\"\n      aria-labelledby={titleId}\n      className={cn(\"w-full bg-background text-foreground\", className)}\n      {...props}\n    >\n      <div className=\"mx-auto max-w-6xl px-6 py-20 md:py-28\">\n        <div className=\"grid grid-cols-1 gap-x-8 gap-y-10 border-t pt-8 md:grid-cols-12\">\n          <div className=\"flex flex-col justify-between gap-8 md:col-span-4\">\n            <div>\n              <p className=\"font-mono text-xs uppercase tracking-wider text-muted-foreground\">\n                {eyebrow}\n              </p>\n              <h2\n                id={titleId}\n                className=\"mt-4 max-w-xs text-2xl font-medium tracking-tight text-balance md:text-3xl\"\n              >\n                {title}\n              </h2>\n            </div>\n\n            {total > 1 && (\n              <div className=\"flex items-center gap-4\">\n                <p\n                  className=\"font-mono text-sm tabular-nums text-muted-foreground\"\n                  aria-hidden=\"true\"\n                >\n                  <span className=\"text-foreground\">{pad(index + 1)}</span> /{\" \"}\n                  {pad(total)}\n                </p>\n                <div className=\"flex\">\n                  <button\n                    type=\"button\"\n                    onClick={() => go(-1)}\n                    aria-label=\"Previous testimonial\"\n                    className=\"inline-flex size-10 items-center justify-center border text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring\"\n                  >\n                    <ArrowLeft className=\"size-4\" aria-hidden=\"true\" />\n                  </button>\n                  <button\n                    type=\"button\"\n                    onClick={() => go(1)}\n                    aria-label=\"Next testimonial\"\n                    className=\"-ml-px inline-flex size-10 items-center justify-center border text-muted-foreground transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring\"\n                  >\n                    <ArrowRight className=\"size-4\" aria-hidden=\"true\" />\n                  </button>\n                </div>\n              </div>\n            )}\n          </div>\n\n          <div\n            role=\"region\"\n            aria-roledescription=\"carousel\"\n            aria-label=\"Customer testimonials\"\n            tabIndex={0}\n            onKeyDown={onKeyDown}\n            className=\"outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background md:col-span-8\"\n          >\n            <div aria-live=\"polite\" aria-atomic=\"true\">\n              <span className=\"sr-only\">\n                Testimonial {index + 1} of {total}\n              </span>\n              {current && (\n                <AnimatePresence mode=\"wait\" initial={false}>\n                  <motion.figure\n                    key={index}\n                    initial={{ opacity: 0, y: reduceMotion ? 0 : 8 }}\n                    animate={{ opacity: 1, y: 0 }}\n                    exit={{ opacity: 0, y: reduceMotion ? 0 : -8 }}\n                    transition={{\n                      duration: reduceMotion ? 0.12 : 0.32,\n                      ease: [0.22, 1, 0.36, 1],\n                    }}\n                    className=\"min-h-[22rem] md:min-h-[24rem]\"\n                  >\n                    <blockquote className=\"relative text-2xl leading-snug font-normal tracking-tight text-pretty sm:text-3xl md:text-[2.5rem] md:leading-[1.15]\">\n                      <span\n                        aria-hidden=\"true\"\n                        className=\"absolute top-0 -left-[0.45em] text-muted-foreground\"\n                      >\n                        &ldquo;\n                      </span>\n                      {current.quote}\n                      <span aria-hidden=\"true\" className=\"text-muted-foreground\">\n                        &rdquo;\n                      </span>\n                    </blockquote>\n                    <figcaption className=\"mt-10 flex items-center gap-4\">\n                      {current.avatar ? (\n                        // eslint-disable-next-line @next/next/no-img-element -- plain <img> keeps the block portable outside Next.js\n                        <img\n                          src={current.avatar}\n                          alt=\"\"\n                          width={48}\n                          height={48}\n                          className=\"size-12 rounded-sm object-cover grayscale\"\n                        />\n                      ) : (\n                        <span\n                          aria-hidden=\"true\"\n                          className=\"flex size-12 items-center justify-center rounded-sm bg-muted font-mono text-xs text-muted-foreground\"\n                        >\n                          {initials(current.name)}\n                        </span>\n                      )}\n                      <div className=\"font-mono text-xs uppercase tracking-wider\">\n                        <p className=\"text-foreground\">{current.name}</p>\n                        <p className=\"mt-1 text-muted-foreground\">\n                          {current.role}, {current.company}\n                        </p>\n                      </div>\n                    </figcaption>\n                  </motion.figure>\n                </AnimatePresence>\n              )}\n            </div>\n          </div>\n        </div>\n\n        {footnote && (\n          <div className=\"mt-12 grid grid-cols-1 gap-x-8 md:grid-cols-12\">\n            <p className=\"border-t pt-4 font-mono text-xs text-muted-foreground md:col-span-8 md:col-start-5\">\n              {footnote}\n            </p>\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n"
    }
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ]
}
