{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "testimonials-grid",
  "title": "Testimonials Grid",
  "description": "Payload testimonials block: a heading above a responsive grid of quote cards, each with author, optional role, and avatar.",
  "registryDependencies": [
    "badge"
  ],
  "files": [
    {
      "path": "payload-components/source/blocks/shared/testimonialFields.ts",
      "content": "import type { Field } from 'payload'\n\n/**\n * Shared field core for the Testimonials component family.\n *\n * Every testimonials variant spreads `testimonialFields` first for the shared\n * section heading (eyebrow + title + intro), then appends its own\n * variant-specific shape — a grid of cards, a star rating, a bento, or a dense\n * wall. Editing the shared heading here updates every installed testimonials\n * block at once, so the family never drifts field-by-field across a repo.\n *\n * `testimonialItemFields` is the one-quote shape (quote, author, optional role,\n * optional avatar upload) reused everywhere a testimonial appears — as the array\n * items in the grid/rating/bento/wall variants, and as the single subject of the\n * quote/spotlight variants — so a testimonial looks the same wherever it shows.\n * Each avatar is an editable Media upload, so editors manage social proof from\n * the admin instead of shipping hardcoded image URLs.\n *\n * Installed once per repo at `src/blocks/shared/testimonialFields.ts`; re-running\n * `payload-components add testimonials-*` never overwrites a copy you have\n * already edited.\n */\nexport const testimonialFields: Field[] = [\n  {\n    name: 'eyebrow',\n    type: 'text',\n  },\n  {\n    name: 'title',\n    type: 'text',\n    required: true,\n  },\n  {\n    name: 'description',\n    type: 'textarea',\n  },\n]\n\nexport const testimonialItemFields: Field[] = [\n  {\n    name: 'quote',\n    type: 'textarea',\n    required: true,\n  },\n  {\n    name: 'author',\n    type: 'text',\n    required: true,\n  },\n  {\n    name: 'role',\n    type: 'text',\n  },\n  {\n    name: 'avatar',\n    type: 'upload',\n    relationTo: 'media',\n  },\n]\n",
      "type": "registry:file",
      "target": "~/src/blocks/shared/testimonialFields.ts"
    },
    {
      "path": "payload-components/source/blocks/TestimonialsGrid/config.ts",
      "content": "import type { Block } from 'payload'\n\nimport { testimonialFields, testimonialItemFields } from '@/blocks/shared/testimonialFields'\n\nexport const TestimonialsGrid: Block = {\n  slug: 'testimonialsGrid',\n  // Existing apps must migrate stored data before adopting this identifier:\n  // https://www.payload-components.xyz/docs/registry#installed-source-and-migrations\n  dbName: 'pc_tes_gri',\n  interfaceName: 'TestimonialsGridBlock',\n  fields: [\n    // Shared testimonials heading (eyebrow, title, description). Edit the shared\n    // shape in @/blocks/shared/testimonialFields to update every variant.\n    ...testimonialFields,\n    {\n      name: 'testimonials',\n      type: 'array',\n      required: true,\n      minRows: 1,\n      maxRows: 12,\n      admin: {\n        initCollapsed: true,\n      },\n      // Shared one-quote shape — see @/blocks/shared/testimonialFields.\n      fields: testimonialItemFields,\n    },\n  ],\n  labels: {\n    plural: 'Testimonials Grid Blocks',\n    singular: 'Testimonials Grid',\n  },\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/TestimonialsGrid/config.ts"
    },
    {
      "path": "payload-components/source/blocks/TestimonialsGrid/Component.tsx",
      "content": "import React from 'react'\n\nimport type { TestimonialsGridBlock as TestimonialsGridBlockData } from '@/payload-types'\n\nimport { Media } from '@/components/Media'\nimport { Badge } from '@/components/ui/badge'\nimport { cn } from '@/utilities/ui'\n\n// Layout adapted from tailark/blocks (MIT) — re-implemented as a Payload block.\n\ntype Props = TestimonialsGridBlockData & {\n  id?: string\n  className?: string\n  disableInnerContainer?: boolean\n}\n\nexport const TestimonialsGridBlock: React.FC<Props> = ({\n  className,\n  description,\n  disableInnerContainer,\n  eyebrow,\n  id,\n  testimonials,\n  title,\n}) => {\n  return (\n    <section className={cn('container', className)} id={id ? `block-${id}` : undefined}>\n      <div className=\"overflow-hidden rounded-frame border border-border/70 bg-card/35 px-6 py-10 sm:px-8 lg:px-12 lg:py-14\">\n        <div\n          className={cn('flex flex-col gap-12', {\n            'mx-auto max-w-5xl': !disableInnerContainer,\n          })}\n        >\n          <div className=\"flex flex-col gap-4\">\n            {eyebrow ? (\n              <Badge variant=\"outline\" className=\"w-fit rounded-full px-3 py-1 uppercase tracking-eyebrow\">\n                {eyebrow}\n              </Badge>\n            ) : null}\n\n            <h2 className=\"text-3xl font-medium tracking-title text-balance sm:text-4xl\">{title}</h2>\n\n            {description ? (\n              <p className=\"max-w-2xl text-base leading-7 text-muted-foreground\">{description}</p>\n            ) : null}\n          </div>\n\n          {testimonials && testimonials.length > 0 ? (\n            <div className=\"grid gap-6 sm:grid-cols-2 lg:grid-cols-3\">\n              {testimonials.map((item, index) => (\n                <figure\n                  className=\"flex flex-col gap-4 rounded-2xl border border-border/70 bg-background/60 p-6\"\n                  key={item.id ?? index}\n                >\n                  <blockquote className=\"text-pretty text-sm leading-6 text-foreground\">\n                    {item.quote}\n                  </blockquote>\n                  <figcaption className=\"mt-auto flex items-center gap-3\">\n                    {item.avatar ? (\n                      <div className=\"flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full border border-border/70 bg-card\">\n                        <Media resource={item.avatar} imgClassName=\"size-full object-cover\" />\n                      </div>\n                    ) : null}\n                    <div className=\"flex flex-col\">\n                      <span className=\"text-sm font-medium text-foreground\">{item.author}</span>\n                      {item.role ? (\n                        <span className=\"text-xs text-muted-foreground\">{item.role}</span>\n                      ) : null}\n                    </div>\n                  </figcaption>\n                </figure>\n              ))}\n            </div>\n          ) : null}\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/TestimonialsGrid/Component.tsx"
    }
  ],
  "meta": {
    "payloadComponent": {
      "installCommand": "payload-components add testimonials-grid",
      "postInstall": [
        "generate:types",
        "generate:importmap"
      ],
      "requiresPayloadComponentWrapper": true,
      "supportedTargets": [
        "payload-website-starter",
        "payload-blocks-app"
      ]
    }
  },
  "docs": "Payload Components installs this as a Payload CMS block for the Payload website starter shape.\n\nRecommended install:\n\n```bash\npnpm payload-components add testimonials-grid\n```\n\nDirect shadcn install URL:\n\n```bash\npnpm dlx shadcn@latest add https://<your-domain>/r/testimonials-grid.json\n```\n\nDirect shadcn installs only copy the block source files and shadcn UI dependencies. Use `payload-components add testimonials-grid` when you also want Payload layout registration, `RenderBlocks` wiring, `generate:types`, and `generate:importmap` handled for you.",
  "type": "registry:block"
}