{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "testimonials",
  "title": "Testimonials",
  "description": "A section of customer quotes with names, roles and avatars, in a masonry or grid layout.",
  "registryDependencies": [
    "@corsair-ui/utils",
    "@corsair-ui/avatar",
    "@corsair-ui/card"
  ],
  "files": [
    {
      "path": "registry/default/components/blocks/testimonials.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"@/registry/default/lib/utils\";\nimport { Avatar, AvatarFallback, AvatarImage } from \"@/registry/default/ui/avatar\";\nimport { Card } from \"@/registry/default/ui/card\";\n\ninterface Testimonial {\n  /** Used as the React key; falls back to the index. */\n  id?: string;\n  quote: ReactNode;\n  name: string;\n  role?: ReactNode;\n  /** Image URL. Without one, the initials of `name` are shown. */\n  avatar?: string;\n}\n\ninterface TestimonialsProps extends Omit<ComponentProps<\"section\">, \"title\"> {\n  eyebrow?: ReactNode;\n  title?: ReactNode;\n  description?: ReactNode;\n  testimonials?: Testimonial[];\n  /** \"masonry\" flows cards of different heights into columns; \"grid\" aligns them in rows. */\n  variant?: \"grid\" | \"masonry\";\n}\n\nconst DEFAULT_TESTIMONIALS: Testimonial[] = [\n  {\n    id: \"1\",\n    quote:\n      \"We moved our whole team over in an afternoon. Planning meetings are shorter because everyone already knows where things stand.\",\n    name: \"Nadia Brooks\",\n    role: \"Engineering manager\",\n  },\n  {\n    id: \"2\",\n    quote: \"The setup took five minutes and it just works.\",\n    name: \"Tomás Rivera\",\n    role: \"Founder\",\n  },\n  {\n    id: \"3\",\n    quote:\n      \"I used to keep three spreadsheets to track releases. Now it is one shared view that updates itself, and I finally trust the numbers.\",\n    name: \"Hannah Lindqvist\",\n    role: \"Product lead\",\n  },\n  {\n    id: \"4\",\n    quote: \"Support answered within the hour, every time we asked.\",\n    name: \"Kofi Mensah\",\n    role: \"Head of operations\",\n  },\n  {\n    id: \"5\",\n    quote:\n      \"Clear pricing, a clean interface and no surprises. It is the rare tool the whole company actually likes using.\",\n    name: \"Mei Tanaka\",\n    role: \"Product designer\",\n  },\n  {\n    id: \"6\",\n    quote: \"Our onboarding checklist went from a document nobody read to something people finish.\",\n    name: \"Ravi Iyer\",\n    role: \"Customer success lead\",\n  },\n];\n\n/** First letter of the first and last word, uppercased: \"Ada Lovelace\" → \"AL\". */\nfunction getInitials(name: string) {\n  const words = name.trim().split(/\\s+/).filter(Boolean);\n  const first = words[0];\n  if (first === undefined) return \"\";\n  const last = words.length > 1 ? words[words.length - 1] : undefined;\n  const letter = (word: string | undefined) => (word ? (Array.from(word)[0] ?? \"\") : \"\");\n  return (letter(first) + letter(last)).toUpperCase();\n}\n\n// Full class names so Tailwind picks them up.\nconst LIST_VARIANTS = {\n  masonry: \"columns-1 gap-6 sm:columns-2 lg:columns-3\",\n  grid: \"grid gap-6 sm:grid-cols-2 lg:grid-cols-3\",\n} as const;\n\n/**\n * A wall of customer quotes under a centred header. Each quote is a\n * `<figure>` with a `<blockquote>` and a `<figcaption>` holding an avatar,\n * the person's name and an optional role. Without an `avatar` image the\n * avatar shows the initials of `name`. The default \"masonry\" variant flows\n * quotes of different lengths into columns; \"grid\" lines them up in rows.\n *\n * Accessibility: the title is an `<h2>` and the quotes are a list. The\n * avatar is hidden from screen readers because the name is right next to\n * it.\n *\n * @example\n * <Testimonials\n *   title=\"What people say\"\n *   variant=\"grid\"\n *   testimonials={[{ quote: \"It saves us hours.\", name: \"Sam Carter\", role: \"Team lead\" }]}\n * />\n */\nfunction Testimonials({\n  className,\n  eyebrow = \"Testimonials\",\n  title = \"Loved by teams who ship\",\n  description = \"Here is what people say after switching their work over.\",\n  testimonials = DEFAULT_TESTIMONIALS,\n  variant = \"masonry\",\n  ...props\n}: TestimonialsProps) {\n  const hasHeader = eyebrow != null || title != null || description != null;\n\n  return (\n    <section\n      data-slot=\"testimonials\"\n      data-variant={variant}\n      className={cn(\"py-16 sm:py-24\", className)}\n      {...props}\n    >\n      <div data-slot=\"testimonials-container\" className=\"mx-auto w-full max-w-6xl px-4 sm:px-6\">\n        {hasHeader ? (\n          <div data-slot=\"testimonials-header\" className=\"mx-auto max-w-2xl text-center\">\n            {eyebrow != null ? (\n              <p\n                data-slot=\"testimonials-eyebrow\"\n                className=\"text-muted-foreground text-sm font-medium\"\n              >\n                {eyebrow}\n              </p>\n            ) : null}\n            {title != null ? (\n              <h2\n                data-slot=\"testimonials-title\"\n                className={cn(\n                  \"text-3xl font-semibold tracking-tight text-balance sm:text-4xl\",\n                  eyebrow != null && \"mt-2\"\n                )}\n              >\n                {title}\n              </h2>\n            ) : null}\n            {description != null ? (\n              <p\n                data-slot=\"testimonials-description\"\n                className=\"text-muted-foreground mt-4 text-lg text-pretty\"\n              >\n                {description}\n              </p>\n            ) : null}\n          </div>\n        ) : null}\n        <ul\n          data-slot=\"testimonials-list\"\n          className={cn(LIST_VARIANTS[variant], hasHeader && \"mt-12\")}\n        >\n          {testimonials.map((testimonial, index) => (\n            <li\n              key={testimonial.id ?? index}\n              data-slot=\"testimonials-item\"\n              className={cn(variant === \"masonry\" ? \"mb-6 break-inside-avoid\" : \"flex\")}\n            >\n              <Card data-slot=\"testimonial-card\" className=\"w-full px-6\">\n                <figure data-slot=\"testimonial\" className=\"flex h-full flex-col gap-6\">\n                  <blockquote data-slot=\"testimonial-quote\" className=\"flex-1 text-pretty\">\n                    {testimonial.quote}\n                  </blockquote>\n                  <figcaption data-slot=\"testimonial-author\" className=\"flex items-center gap-3\">\n                    <Avatar aria-hidden=\"true\" size=\"lg\" data-slot=\"testimonial-avatar\">\n                      {testimonial.avatar ? <AvatarImage src={testimonial.avatar} alt=\"\" /> : null}\n                      <AvatarFallback>{getInitials(testimonial.name)}</AvatarFallback>\n                    </Avatar>\n                    <div className=\"flex min-w-0 flex-col text-sm\">\n                      <span data-slot=\"testimonial-name\" className=\"font-medium\">\n                        {testimonial.name}\n                      </span>\n                      {testimonial.role != null ? (\n                        <span data-slot=\"testimonial-role\" className=\"text-muted-foreground\">\n                          {testimonial.role}\n                        </span>\n                      ) : null}\n                    </div>\n                  </figcaption>\n                </figure>\n              </Card>\n            </li>\n          ))}\n        </ul>\n      </div>\n    </section>\n  );\n}\n\nexport { Testimonials, type Testimonial, type TestimonialsProps };\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:block"
}