# Add the "Hero — Split" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/hero-split) to this Pantheon Content Publisher (P1) Next.js project. Headline, supporting copy and two calls to action beside a large photo. Image side is switchable.

## Steps

1. Create `components/puck/hero-split-block.tsx` with the exact file contents below. If `components/puck/` doesn't exist, find the folder where this project keeps its Puck components (look at the imports in `puck.config.tsx`) and put it there.
2. In `puck.config.tsx`, import it: `import { heroSplitBlock } from "./components/puck/hero-split-block";`
3. Register it under `components` as `HeroSplitBlock: heroSplitBlock`.
4. Add `"HeroSplitBlock"` to the best-fitting entry in `categories` (this block's library category is "Heroes"). Create a category only if none fits.
5. Run the project's type check (usually `pnpm typecheck`) and resolve anything project-specific.
6. If `package.json` has a `sync:registry` script, tell the user it must run (or that CI will run it) before the new component appears in the P1 editor.

## Rules

- Do not add dependencies. The block is self-contained by design: one type-only import from `@puckeditor/core`, Tailwind v4 classes, no client JavaScript.
- Keep the files as-is unless the user asks for changes. The accent color is `indigo-*`; if the project has brand colors, offer to swap them with a find-and-replace on `indigo-`.
- Images are plain `imageUrl` + `imageAlt` text fields. If this project defines a P1 media-library field (search for `"p1-media"`), offer to switch to it.
- Don't change prop names in `defaultProps`. Content editors' saved pages depend on them.

## File: `components/puck/hero-split-block.tsx`

```tsx
import type { ComponentConfig } from "@puckeditor/core";

/**
 * Hero (Split) — headline, supporting copy and two calls to action beside a photo.
 * Stacks image-first on mobile. Register: `HeroSplitBlock: heroSplitBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";

export type HeroSplitProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  primaryLabel: string;
  primaryHref: string;
  secondaryLabel: string;
  secondaryHref: string;
  imageUrl: string;
  imageAlt: string;
  imageSide: "left" | "right";
};

export const heroSplitBlock: ComponentConfig<HeroSplitProps> = {
  label: "Hero (Split)",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    heading: { type: "textarea", label: "Heading" },
    headingLevel: {
      type: "select",
      label: "Heading level",
      options: [
        { label: "H1 (page title)", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Use H1 when this hero is the top of the page. The look doesn't change." },
    },
    body: { type: "textarea", label: "Body" },
    primaryLabel: { type: "text", label: "Primary button text" },
    primaryHref: { type: "text", label: "Primary button link", metadata: { help: "A path (/donate), full URL, #anchor, mailto: or tel:." } },
    secondaryLabel: { type: "text", label: "Secondary link text", metadata: { help: "Leave blank to hide it." } },
    secondaryHref: { type: "text", label: "Secondary link" },
    imageUrl: { type: "text", label: "Image URL" },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
    imageSide: {
      type: "radio",
      label: "Image side",
      options: [
        { label: "Right", value: "right" },
        { label: "Left", value: "left" },
      ],
    },
  },
  defaultProps: {
    eyebrow: "Spring programs now open",
    heading: "Parks and programs for every neighbor",
    headingLevel: "h1",
    body: "From toddler swim lessons to senior walking clubs, find something to love at more than forty parks and community centers across the county.",
    primaryLabel: "Browse programs",
    primaryHref: "/programs",
    secondaryLabel: "Find a park near you",
    secondaryHref: "/parks",
    imageUrl: "https://picsum.photos/seed/parkday/1200/1400",
    imageAlt: "Families walking along a tree-lined path in a city park",
    imageSide: "right",
  },
  render: ({ eyebrow, heading, headingLevel, body, primaryLabel, primaryHref, secondaryLabel, secondaryHref, imageUrl, imageAlt, imageSide }) => {
    const H = headingLevel || "h1";
    const imageLeft = imageSide === "left";
    return (
      <section className="bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto grid max-w-7xl items-center gap-10 lg:grid-cols-2 lg:gap-16">
          <div className={imageLeft ? "lg:order-2" : undefined}>
            {eyebrow ? (
              <p className="inline-flex items-center gap-2 rounded-full bg-indigo-50 px-3 py-1 text-sm font-medium text-indigo-700 ring-1 ring-indigo-600/15 ring-inset">
                <span aria-hidden="true" className="size-1.5 rounded-full bg-indigo-600" />
                {eyebrow}
              </p>
            ) : null}
            {heading ? (
              <H className="mt-5 text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl lg:text-6xl">{heading}</H>
            ) : null}
            {body ? <p className="mt-6 max-w-xl text-lg leading-8 text-pretty text-neutral-600">{body}</p> : null}
            {primaryLabel || secondaryLabel ? (
              <div className="mt-8 flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6">
                {primaryLabel ? (
                  <a
                    href={primaryHref || "#"}
                    className="inline-flex min-h-11 items-center justify-center rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                  >
                    {primaryLabel}
                  </a>
                ) : null}
                {secondaryLabel ? (
                  <a
                    href={secondaryHref || "#"}
                    className="group inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg px-1 text-base font-semibold text-neutral-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                  >
                    {secondaryLabel}
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 transition group-hover:translate-x-0.5">
                      <path fillRule="evenodd" d="M3 10a.75.75 0 0 1 .75-.75h10.64l-3.22-3.22a.75.75 0 1 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H3.75A.75.75 0 0 1 3 10Z" clipRule="evenodd" />
                    </svg>
                  </a>
                ) : null}
              </div>
            ) : null}
          </div>
          {imageUrl ? (
            <div className={`order-first ${imageLeft ? "lg:order-1" : "lg:order-last"}`}>
              <img
                src={imageUrl}
                alt={imageAlt || ""}
                className="aspect-[4/3] w-full rounded-2xl bg-neutral-100 object-cover shadow-xl ring-1 ring-neutral-900/5 lg:aspect-[6/7]"
              />
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
