{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-split",
  "title": "Hero Split",
  "description": "Two-column Payload hero block with an editor-placed visual.",
  "registryDependencies": [
    "badge"
  ],
  "files": [
    {
      "path": "payload-components/source/blocks/shared/heroFields.ts",
      "content": "import type { Field } from 'payload'\n\nimport { linkGroup } from '@/fields/linkGroup'\n\n/**\n * Shared field core for the Hero component family.\n *\n * Every hero variant spreads these fields first and then appends its own\n * variant-specific ones. Editing the\n * shared headline/eyebrow/description/CTA shape here updates every installed\n * hero block at once, so the family never drifts field-by-field across a repo.\n *\n * Installed once per repo at `src/blocks/shared/heroFields.ts`; re-running\n * `payload-components add hero-*` never overwrites a copy you have already edited.\n */\nexport const heroFields: 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    required: true,\n  },\n  linkGroup({\n    overrides: {\n      admin: {\n        initCollapsed: true,\n      },\n      maxRows: 2,\n      minRows: 1,\n    },\n  }),\n]\n",
      "type": "registry:file",
      "target": "~/src/blocks/shared/heroFields.ts"
    },
    {
      "path": "payload-components/source/blocks/HeroSplit/config.ts",
      "content": "import type { Block } from 'payload'\n\nimport { heroFields } from '@/blocks/shared/heroFields'\n\nexport const HeroSplit: Block = {\n  slug: 'heroSplit',\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_hero_spl',\n  interfaceName: 'HeroSplitBlock',\n  fields: [\n    // Shared hero core (eyebrow, title, description, CTA links). Variant-specific\n    // fields follow; edit the shared shape in @/blocks/shared/heroFields.\n    ...heroFields,\n    {\n      name: 'image',\n      type: 'upload',\n      relationTo: 'media',\n      required: true,\n    },\n    {\n      // Which side the visual sits on. A field rather than a second component,\n      // because alternating sides down a page is a layout decision an editor\n      // makes per block, not a different kind of hero.\n      name: 'imagePosition',\n      type: 'select',\n      defaultValue: 'right',\n      options: [\n        { label: 'Left', value: 'left' },\n        { label: 'Right', value: 'right' },\n      ],\n    },\n    {\n      name: 'highlights',\n      type: 'array',\n      admin: {\n        initCollapsed: true,\n      },\n      fields: [\n        {\n          name: 'label',\n          type: 'text',\n          required: true,\n        },\n      ],\n      maxRows: 3,\n    },\n  ],\n  labels: {\n    plural: 'Hero Split Blocks',\n    singular: 'Hero Split',\n  },\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/HeroSplit/config.ts"
    },
    {
      "path": "payload-components/source/blocks/HeroSplit/Component.tsx",
      "content": "import React from 'react'\n\nimport type { HeroSplitBlock as HeroSplitBlockData } from '@/payload-types'\n\nimport { CMSLink } from '@/components/Link'\nimport { Media } from '@/components/Media'\nimport { Badge } from '@/components/ui/badge'\nimport { cn } from '@/utilities/ui'\n\ntype Props = HeroSplitBlockData & {\n  id?: string\n  className?: string\n  disableInnerContainer?: boolean\n}\n\nexport const HeroSplitBlock: React.FC<Props> = ({\n  className,\n  description,\n  disableInnerContainer,\n  eyebrow,\n  highlights,\n  id,\n  image,\n  imagePosition,\n  links,\n  title,\n}) => {\n  /* The visual leads on mobile whichever side it takes on desktop: a stacked\n     hero that opens with prose pushes the image below the fold for no gain. */\n  const imageFirst = imagePosition === 'left'\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('grid items-center gap-10 lg:grid-cols-2 lg:gap-16', {\n            'mx-auto max-w-6xl': !disableInnerContainer,\n          })}\n        >\n          <div className={cn('flex flex-col gap-8', { 'lg:order-2': imageFirst })}>\n            <div className=\"flex flex-col gap-4\">\n              {eyebrow ? (\n                <Badge\n                  variant=\"outline\"\n                  className=\"w-fit rounded-full px-3 py-1 uppercase tracking-eyebrow\"\n                >\n                  {eyebrow}\n                </Badge>\n              ) : null}\n\n              <div className=\"flex flex-col gap-4\">\n                <h2 className=\"text-4xl font-medium tracking-display text-balance sm:text-5xl\">\n                  {title}\n                </h2>\n                <p className=\"text-base leading-7 text-muted-foreground sm:text-lg\">{description}</p>\n              </div>\n            </div>\n\n            {links && links.length > 0 ? (\n              <div className=\"flex flex-col gap-3 sm:flex-row\">\n                {links.map(({ link }, index) => (\n                  <CMSLink\n                    key={index}\n                    appearance={link.appearance === 'outline' ? 'outline' : 'default'}\n                    {...link}\n                  />\n                ))}\n              </div>\n            ) : null}\n\n            {highlights && highlights.length > 0 ? (\n              <ul className=\"flex flex-col gap-3 border-t border-border/70 pt-6\">\n                {highlights.map(({ label }, index) => (\n                  <li\n                    key={`${label}-${index}`}\n                    className=\"flex items-baseline gap-3 text-sm text-muted-foreground\"\n                  >\n                    <span className=\"size-1.5 shrink-0 rounded-full bg-brand\" aria-hidden=\"true\" />\n                    {label}\n                  </li>\n                ))}\n              </ul>\n            ) : null}\n          </div>\n\n          <div\n            className={cn(\n              'order-first relative overflow-hidden rounded-card border border-border/70 bg-muted',\n              imageFirst ? 'lg:order-1' : 'lg:order-none',\n            )}\n          >\n            <Media resource={image} imgClassName=\"aspect-[4/3] h-full w-full object-cover\" />\n          </div>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:file",
      "target": "~/src/blocks/HeroSplit/Component.tsx"
    }
  ],
  "meta": {
    "payloadComponent": {
      "installCommand": "payload-components add hero-split",
      "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 hero-split\n```\n\nDirect shadcn install URL:\n\n```bash\npnpm dlx shadcn@latest add https://www.payload-components.xyz/r/hero-split.json\n```\n\nDirect shadcn installs only copy the block source files and shadcn UI dependencies. Use `payload-components add hero-split` when you also want Payload layout registration, `RenderBlocks` wiring, `generate:types`, and `generate:importmap` handled for you.",
  "type": "registry:block"
}