# Add the "Angled Hero" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/hero-angled) to this Pantheon Content Publisher (P1) Next.js project. Copy beside an edge-to-edge photo cut on a diagonal with an accent band tracing the cut; image side flips.

## Steps

1. Create `components/puck/hero-angled-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 { heroAngledBlock } from "./components/puck/hero-angled-block";`
3. Register it under `components` as `HeroAngledBlock: heroAngledBlock`.
4. Add `"HeroAngledBlock"` 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-angled-block.tsx`

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

/**
 * Hero (Angled) — copy beside a photo cut on a diagonal, with a thin accent band tracing the
 * cut. The photo runs to the edge of the screen and can sit on either side.
 * Register: `HeroAngledBlock: heroAngledBlock` in puck.config.tsx.
 */

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

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

// clip-path has no Tailwind utility, so these are the block's only arbitrary values.
// Mobile cuts the photo's bottom edge; desktop cuts the edge that faces the copy.
const SIDES = {
  right: {
    wrap: "lg:right-0",
    band: "[clip-path:polygon(0_0,100%_0,100%_78%,0_100%)] lg:[clip-path:polygon(14%_0,100%_0,100%_100%,0_100%)]",
    photo: "[clip-path:polygon(0_0,100%_0,100%_72%,0_94%)] lg:[clip-path:polygon(18%_0,100%_0,100%_100%,4%_100%)]",
    copy: "lg:pr-16",
  },
  left: {
    wrap: "lg:left-0",
    band: "[clip-path:polygon(0_0,100%_0,100%_100%,0_78%)] lg:[clip-path:polygon(0_0,86%_0,100%_100%,0_100%)]",
    photo: "[clip-path:polygon(0_0,100%_0,100%_94%,0_72%)] lg:[clip-path:polygon(0_0,82%_0,96%_100%,0_100%)]",
    copy: "lg:col-start-2 lg:pl-16",
  },
} as const;

const ARROW = "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";

export const heroAngledBlock: ComponentConfig<HeroAngledProps> = {
  label: "Hero (Angled)",
  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" },
    footnote: { type: "text", label: "Footnote", metadata: { help: "Small line under the buttons, like a deadline. Leave blank to hide it." } },
    imageUrl: { type: "text", label: "Image URL", metadata: { help: "A tall or square photo works best. Keep the subject away from the cut edge." } },
    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" },
      ],
      metadata: { help: "On phones the photo always sits on top." },
    },
  },
  defaultProps: {
    eyebrow: "Graduate School of Public Health",
    heading: "Train to lead the next era of community health",
    headingLevel: "h1",
    body: "Our MPH and DrPH programs pair rigorous epidemiology and policy coursework with field placements at health departments and clinics across the state.",
    primaryLabel: "Request information",
    primaryHref: "/admissions/info",
    secondaryLabel: "Explore degrees",
    secondaryHref: "/programs",
    footnote: "Priority application deadline: January 15",
    imageUrl: "https://picsum.photos/seed/fieldclinic/1400/1600",
    imageAlt: "A public health student talking with a patient at a community clinic",
    imageSide: "right",
  },
  render: ({ eyebrow, heading, headingLevel, body, primaryLabel, primaryHref, secondaryLabel, secondaryHref, footnote, imageUrl, imageAlt, imageSide }) => {
    const H = headingLevel || "h1";
    const side = SIDES[imageSide === "left" ? "left" : "right"];
    return (
      <section className="relative isolate overflow-hidden bg-white">
        {imageUrl ? (
          <div className={`relative h-72 sm:h-96 lg:absolute lg:inset-y-0 lg:h-auto lg:w-1/2 ${side.wrap}`}>
            <div aria-hidden="true" className={`absolute inset-0 bg-indigo-600 ${side.band}`} />
            <img src={imageUrl} alt={imageAlt || ""} className={`absolute inset-0 size-full bg-neutral-100 object-cover ${side.photo}`} />
          </div>
        ) : null}

        <div className={`px-4 pb-16 sm:px-6 sm:pb-20 lg:px-8 lg:py-32 ${imageUrl ? "pt-6 sm:pt-8" : "pt-16 sm:pt-20"}`}>
          <div className="mx-auto grid max-w-7xl grid-cols-1 lg:grid-cols-2">
            <div className={imageUrl ? side.copy : undefined}>
              {eyebrow ? (
                <p className="inline-flex items-center gap-2 text-sm font-semibold text-indigo-700">
                  <svg aria-hidden="true" viewBox="0 0 12 12" className="size-3 fill-current">
                    <path d="M0 12 12 0v12H0Z" />
                  </svg>
                  {eyebrow}
                </p>
              ) : null}
              {heading ? (
                <H className={`${eyebrow ? "mt-4" : ""} 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={ARROW} clipRule="evenodd" />
                      </svg>
                    </a>
                  ) : null}
                </div>
              ) : null}
              {footnote ? <p className="mt-8 border-l-2 border-indigo-600 pl-3 text-sm leading-6 text-neutral-600">{footnote}</p> : null}
            </div>
          </div>
        </div>
      </section>
    );
  },
};
```
