{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comparator-stack",
  "title": "Comparator Stack",
  "description": "Stacked plan-card comparison Payload block: one card per plan with its own price, CTA, and feature checklist.",
  "registryDependencies": [
    "badge",
    "card"
  ],
  "files": [
    {
      "path": "payload-components/source/blocks/shared/comparatorFields.ts",
      "content": "import type { Field } from 'payload'\n\n/**\n * Shared field core for the Comparator component family.\n *\n * Every comparator variant (comparator-table, comparator-grid, comparator-stack)\n * spreads this optional section header first and then appends its own plan/feature\n * shape — the feature matrix for the table and grid layouts, or the per-plan\n * checklists for the stacked layout. Editing the shared title/description here\n * updates every installed comparator block at once, so the family never drifts\n * field-by-field across a repo.\n *\n * Installed once per repo at `src/blocks/shared/comparatorFields.ts`; re-running\n * `payload-components add comparator-*` never overwrites a copy you have already edited.\n */\nexport const comparatorFields: Field[] = [\n  {\n    name: 'title',\n    type: 'text',\n  },\n  {\n    name: 'description',\n    type: 'textarea',\n  },\n]\n",
      "type": "registry:file",
      "target": "~/src/blocks/shared/comparatorFields.ts"
    },
    {
      "path": "payload-components/source/blocks/ComparatorStack/config.ts",
      "content": "import type { Block } from 'payload'\n\nimport { comparatorFields } from '@/blocks/shared/comparatorFields'\nimport { linkGroup } from '@/fields/linkGroup'\n\nexport const ComparatorStack: Block = {\n  slug: 'comparatorStack',\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_com_sta',\n  interfaceName: 'ComparatorStackBlock',\n  fields: [\n    // Shared comparator header (title, description). Variant-specific fields\n    // follow; edit the shared shape in @/blocks/shared/comparatorFields.\n    ...comparatorFields,\n    {\n      name: 'plans',\n      type: 'array',\n      required: true,\n      minRows: 2,\n      maxRows: 4,\n      admin: {\n        initCollapsed: true,\n      },\n      fields: [\n        {\n          name: 'name',\n          type: 'text',\n          required: true,\n        },\n        {\n          name: 'description',\n          type: 'text',\n        },\n        {\n          name: 'price',\n          type: 'text',\n        },\n        {\n          name: 'period',\n          type: 'text',\n          admin: {\n            description: 'Shown next to the price, e.g. \"/month\".',\n          },\n        },\n        {\n          name: 'badge',\n          type: 'text',\n          admin: {\n            description: 'Optional pill beside the plan name, e.g. \"Most popular\".',\n          },\n        },\n        {\n          name: 'highlighted',\n          type: 'checkbox',\n          admin: {\n            description: 'Adds an accent ring to draw the eye to the recommended plan.',\n          },\n        },\n        linkGroup({\n          overrides: {\n            maxRows: 1,\n          },\n        }),\n        {\n          name: 'features',\n          type: 'array',\n          admin: {\n            initCollapsed: true,\n          },\n          fields: [\n            {\n              name: 'label',\n              type: 'text',\n              required: true,\n            },\n            {\n              name: 'included',\n              type: 'checkbox',\n            },\n            {\n              name: 'value',\n              type: 'text',\n              admin: {\n                description: 'Text value for this feature. Leave \"included\" unticked and this empty for an excluded feature.',\n              },\n            },\n          ],\n        },\n      ],\n    },\n  ],\n  labels: {\n    plural: 'Comparator Stack Blocks',\n    singular: 'Comparator Stack',\n  },\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/ComparatorStack/config.ts"
    },
    {
      "path": "payload-components/source/blocks/ComparatorStack/Component.tsx",
      "content": "import React from 'react'\n\nimport { Check, Minus } from 'lucide-react'\n\nimport type { ComparatorStackBlock as ComparatorStackBlockData } from '@/payload-types'\n\nimport { CMSLink } from '@/components/Link'\nimport { Badge } from '@/components/ui/badge'\nimport { Card } from '@/components/ui/card'\nimport { cn } from '@/utilities/ui'\n\ntype Props = ComparatorStackBlockData & {\n  id?: string\n  className?: string\n  disableInnerContainer?: boolean\n}\n\nexport const ComparatorStackBlock: React.FC<Props> = ({\n  className,\n  description,\n  disableInnerContainer,\n  id,\n  plans,\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-10', {\n            'mx-auto max-w-3xl': !disableInnerContainer,\n          })}\n        >\n          {title || description ? (\n            <div className=\"flex flex-col items-center gap-4 text-center\">\n              {title ? (\n                <h2 className=\"text-4xl font-medium tracking-display text-balance sm:text-5xl\">{title}</h2>\n              ) : null}\n\n              {description ? (\n                <p className=\"max-w-xl text-base leading-7 text-muted-foreground sm:text-lg\">{description}</p>\n              ) : null}\n            </div>\n          ) : null}\n\n          {plans && plans.length > 0 ? (\n            <div className=\"flex flex-col gap-4\">\n              {plans.map((plan, planIndex) => (\n                <Card\n                  key={plan.id ?? planIndex}\n                  className={cn('border-border/70 bg-background/60 p-6 shadow-none', {\n                    'ring-1 ring-primary': plan.highlighted,\n                  })}\n                >\n                  <div className=\"flex flex-col gap-6 lg:flex-row lg:items-start lg:justify-between\">\n                    <div className=\"lg:max-w-xs\">\n                      <div className=\"flex flex-wrap items-center gap-2\">\n                        <h3 className=\"text-lg font-medium text-foreground\">{plan.name}</h3>\n\n                        {plan.badge ? (\n                          <Badge\n                            variant=\"outline\"\n                            className=\"rounded-full px-2 py-0.5 text-xs uppercase tracking-eyebrow\"\n                          >\n                            {plan.badge}\n                          </Badge>\n                        ) : null}\n                      </div>\n\n                      {plan.description ? (\n                        <p className=\"mt-1 text-sm text-muted-foreground\">{plan.description}</p>\n                      ) : null}\n\n                      <div className=\"mt-4 flex items-baseline gap-1\">\n                        <span className=\"text-3xl font-medium tracking-title text-foreground\">{plan.price}</span>\n                        {plan.period ? <span className=\"text-sm text-muted-foreground\">{plan.period}</span> : null}\n                      </div>\n\n                      {plan.links && plan.links.length > 0 ? (\n                        <div className=\"mt-4 flex flex-col gap-2\">\n                          {plan.links.map(({ link }, linkIndex) => (\n                            <CMSLink\n                              key={linkIndex}\n                              appearance={link.appearance === 'outline' ? 'outline' : 'default'}\n                              {...link}\n                            />\n                          ))}\n                        </div>\n                      ) : null}\n                    </div>\n\n                    {plan.features && plan.features.length > 0 ? (\n                      <div className=\"w-full lg:w-72 lg:shrink-0\">\n                        {plan.features.map((feature, featureIndex) => (\n                          <div\n                            key={feature.id ?? featureIndex}\n                            className=\"flex items-center justify-between border-b border-border/70 py-3 text-sm last:border-b-0\"\n                          >\n                            <span className=\"text-muted-foreground\">{feature.label}</span>\n\n                            {feature.included ? (\n                              <Check aria-label=\"Included\" className=\"size-4 text-primary\" role=\"img\" />\n                            ) : feature.value ? (\n                              <span className=\"font-medium text-foreground\">{feature.value}</span>\n                            ) : (\n                              <Minus aria-label=\"Not included\" className=\"size-4 text-muted-foreground\" role=\"img\" />\n                            )}\n                          </div>\n                        ))}\n                      </div>\n                    ) : null}\n                  </div>\n                </Card>\n              ))}\n            </div>\n          ) : null}\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/ComparatorStack/Component.tsx"
    }
  ],
  "meta": {
    "payloadComponent": {
      "installCommand": "payload-components add comparator-stack",
      "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 comparator-stack\n```\n\nDirect shadcn install URL:\n\n```bash\npnpm dlx shadcn@latest add https://www.payload-components.xyz/r/comparator-stack.json\n```\n\nDirect shadcn installs only copy the block source files and shadcn UI dependencies. Use `payload-components add comparator-stack` when you also want Payload layout registration, `RenderBlocks` wiring, `generate:types`, and `generate:importmap` handled for you.",
  "type": "registry:block"
}