# Add the "Passport Program" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/passport-program) to this Pantheon Content Publisher (P1) Next.js project. A local deals trail: how it works, participating stops and offers, prize tiers by check-ins and fine print.

## Steps

1. Create `components/puck/passport-program-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 { passportProgramBlock } from "./components/puck/passport-program-block";`
3. Register it under `components` as `PassportProgramBlock: passportProgramBlock`.
4. Add `"PassportProgramBlock"` to the best-fitting entry in `categories` (this block's library category is "Tourism"). 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/passport-program-block.tsx`

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

/**
 * Passport Program — a local deals or check-in trail: how it works, participating stops
 * with their offers, prize tiers by number of check-ins, a sign-up link and fine print.
 * Register: `PassportProgramBlock: passportProgramBlock` in puck.config.tsx.
 */

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

export type PassportProgramProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  imageUrl: string;
  imageAlt: string;
  signupLabel: string;
  signupHref: string;
  signupNote: string;
  steps: { title: string; text: string }[];
  stopsHeading: string;
  stops: { name: string; offer: string; category: string }[];
  prizesHeading: string;
  prizes: { checkins: string; prize: string }[];
  termsLabel: string;
  terms: string;
};

const childHeading: Record<Heading, "h2" | "h3" | "h4" | "h5"> = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" };
const grandchildHeading: Record<Heading, "h3" | "h4" | "h5" | "h6"> = { h1: "h3", h2: "h4", h3: "h5", h4: "h6" };
const FOCUS = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";

export const passportProgramBlock: ComponentConfig<PassportProgramProps> = {
  label: "Passport Program",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    heading: { type: "text", label: "Heading" },
    headingLevel: {
      type: "select",
      label: "Heading level",
      options: [
        { label: "H1", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Sets the page outline for screen readers and search. The look doesn't change. Section titles use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    imageUrl: { type: "text", label: "Image URL", metadata: { help: "Shown as a tilted passport-style photo beside the intro. Leave blank to hide it." } },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
    signupLabel: { type: "text", label: "Sign-up button text" },
    signupHref: { type: "text", label: "Sign-up link", metadata: { help: "Usually the passport app or a sign-up page." } },
    signupNote: { type: "text", label: "Sign-up note", metadata: { help: "Small line under the button, like “Free · No app download needed”." } },
    steps: {
      type: "array",
      label: "How it works",
      min: 0,
      max: 4,
      getItemSummary: (item) => item?.title || "Step",
      defaultItemProps: { title: "New step", text: "" },
      arrayFields: {
        title: { type: "text", label: "Title" },
        text: { type: "textarea", label: "Text" },
      },
    },
    stopsHeading: { type: "text", label: "Stops heading" },
    stops: {
      type: "array",
      label: "Participating stops",
      min: 0,
      max: 30,
      getItemSummary: (item) => `${item?.name || "Stop"}${item?.category ? ` · ${item.category}` : ""}`,
      defaultItemProps: { name: "New stop", offer: "", category: "" },
      arrayFields: {
        name: { type: "text", label: "Name" },
        offer: { type: "text", label: "Offer", metadata: { help: "Like “$1 off any pint” or “Free cookie with a coffee”." } },
        category: { type: "text", label: "Category", metadata: { help: "Like “Brewery” or “Coffee”. Leave blank to hide it." } },
      },
    },
    prizesHeading: { type: "text", label: "Prizes heading" },
    prizes: {
      type: "array",
      label: "Prize tiers",
      min: 0,
      max: 5,
      getItemSummary: (item) => `${item?.checkins || "?"} check-ins: ${item?.prize || "Prize"}`,
      defaultItemProps: { checkins: "20", prize: "New prize" },
      arrayFields: {
        checkins: { type: "text", label: "Check-ins needed", metadata: { help: "A number, like “5”." } },
        prize: { type: "text", label: "Prize" },
      },
    },
    termsLabel: { type: "text", label: "Terms toggle text" },
    terms: { type: "textarea", label: "Terms", metadata: { help: "Fine print, shown when someone opens the toggle. One paragraph per line. Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "Riverbend Taproom Passport",
    heading: "Sip, stamp, win",
    headingLevel: "h2",
    intro: "Check in at local breweries, cideries and coffee roasters with your free mobile passport. Every stop has a deal, and every few stamps earn you Riverbend swag.",
    imageUrl: "https://picsum.photos/seed/riverbend-passport/900/1100",
    imageAlt: "Friends raising glasses at a long table in a sunlit brewery taproom",
    signupLabel: "Get your free passport",
    signupHref: "/passport",
    signupNote: "Free · Works in your phone's browser, no app needed",
    steps: [
      { title: "Sign up", text: "Enter your phone number or email and your passport arrives by text or email instantly." },
      { title: "Check in", text: "At each stop, open your passport and tap Check in. Your phone's location confirms you're there." },
      { title: "Collect prizes", text: "Pick up prizes at the Welcome Center, 200 Front Street, with the passport on your phone." },
    ],
    stopsHeading: "Participating stops",
    stops: [
      { name: "Lock & Dam Brewing", offer: "$1 off your first pint", category: "Brewery" },
      { name: "Heron Marsh Cider Co.", offer: "Free tasting flight upgrade", category: "Cidery" },
      { name: "Front Street Roasters", offer: "Free pastry with any coffee", category: "Coffee" },
      { name: "Ferryman's Ale House", offer: "10% off growler fills", category: "Brewery" },
      { name: "Old Mill Distilling", offer: "Free tour on Saturdays", category: "Distillery" },
      { name: "Bluffside Coffee Bar", offer: "Size up any drink", category: "Coffee" },
    ],
    prizesHeading: "Prizes",
    prizes: [
      { checkins: "4", prize: "Riverbend sticker pack" },
      { checkins: "8", prize: "Passport pint glass" },
      { checkins: "12", prize: "Riverbend Trail Crew T-shirt" },
    ],
    termsLabel: "Terms & conditions",
    terms:
      "Must be 21 or older to redeem alcohol offers; coffee stops are open to all ages.\nOne check-in per stop per day. Offers are valid during each business's regular hours and can't be combined with other discounts.\nPrizes are while supplies last and must be picked up in person at the Riverbend Welcome Center. Program runs through December 31, 2026.\nPlease drink responsibly. Free rides home are available through the Riverbend Trolley until 11 PM.",
  },
  render: ({
    eyebrow,
    heading,
    headingLevel,
    intro,
    imageUrl,
    imageAlt,
    signupLabel,
    signupHref,
    signupNote,
    steps,
    stopsHeading,
    stops,
    prizesHeading,
    prizes,
    termsLabel,
    terms,
  }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const Item = grandchildHeading[H] ?? "h4";
    const stepList = (steps ?? []).filter((s) => s?.title);
    const stopList = (stops ?? []).filter((s) => s?.name);
    const prizeList = (prizes ?? []).filter((p) => p?.prize);
    const termLines = (terms || "").split("\n").map((l) => l.trim()).filter(Boolean);
    return (
      <section className="overflow-hidden bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto max-w-7xl">
          <div className="grid grid-cols-1 items-center gap-12 lg:grid-cols-12">
            <div className="lg:col-span-7">
              {eyebrow ? (
                <p className="inline-flex items-center gap-2 rounded-full border border-dashed border-indigo-400 px-3 py-1 text-xs font-semibold tracking-widest text-indigo-700 uppercase">
                  <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-3.5">
                    <path fillRule="evenodd" d="M8 1.75a.75.75 0 0 1 .692.462l1.41 3.393 3.664.293a.75.75 0 0 1 .428 1.317l-2.791 2.39.853 3.575a.75.75 0 0 1-1.12.814L7.998 12.08l-3.135 1.915a.75.75 0 0 1-1.12-.814l.852-3.574-2.79-2.39a.75.75 0 0 1 .427-1.318l3.663-.293 1.41-3.393A.75.75 0 0 1 8 1.75Z" clipRule="evenodd" />
                  </svg>
                  {eyebrow}
                </p>
              ) : null}
              {heading ? <H className={`${eyebrow ? "mt-5" : ""} text-5xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-6xl lg:text-7xl`}>{heading}</H> : null}
              {intro ? <p className="mt-6 max-w-xl text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
              {signupLabel ? (
                <div className="mt-8">
                  <a
                    href={signupHref || "#"}
                    className={`inline-flex min-h-12 items-center justify-center rounded-lg bg-indigo-600 px-6 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-700 ${FOCUS}`}
                  >
                    {signupLabel}
                  </a>
                  {signupNote ? <p className="mt-3 text-sm text-neutral-600">{signupNote}</p> : null}
                </div>
              ) : null}
            </div>
            {imageUrl ? (
              <div className="relative mx-auto w-full max-w-sm lg:col-span-5 lg:max-w-none">
                <div aria-hidden="true" className="absolute inset-0 translate-x-3 translate-y-3 -rotate-3 rounded-3xl border-2 border-dashed border-indigo-300" />
                <img src={imageUrl} alt={imageAlt || ""} className="relative aspect-4/5 w-full rotate-2 rounded-3xl bg-neutral-200 object-cover shadow-xl shadow-neutral-950/10" />
                {prizeList.length > 0 ? (
                  <span
                    aria-hidden="true"
                    className="absolute -bottom-4 -left-2 grid size-24 -rotate-12 place-items-center rounded-full border-4 border-double border-indigo-600 bg-white text-center text-xs leading-tight font-bold tracking-widest text-indigo-700 uppercase shadow-lg sm:-left-6"
                  >
                    Stamp
                    <br />
                    &amp; win
                  </span>
                ) : null}
              </div>
            ) : null}
          </div>

          {stepList.length > 0 ? (
            <ol role="list" className="mt-16 grid grid-cols-1 gap-8 border-t border-neutral-200 pt-10 sm:mt-20 md:grid-cols-3">
              {stepList.map((s, i) => (
                <li key={`${s.title}-${i}`} className="flex gap-4">
                  <span aria-hidden="true" className="grid size-11 shrink-0 place-items-center rounded-full bg-neutral-950 text-base font-semibold text-white tabular-nums">
                    {i + 1}
                  </span>
                  <div className="min-w-0">
                    <Sub className="text-lg font-semibold tracking-tight text-neutral-950">
                      <span className="sr-only">Step {i + 1}: </span>
                      {s.title}
                    </Sub>
                    {s.text ? <p className="mt-1 text-sm leading-6 text-pretty text-neutral-600">{s.text}</p> : null}
                  </div>
                </li>
              ))}
            </ol>
          ) : null}

          {stopList.length > 0 || prizeList.length > 0 ? (
            <div className="mt-16 grid grid-cols-1 gap-8 sm:mt-20 lg:grid-cols-12 lg:gap-12">
              {stopList.length > 0 ? (
                <div className={prizeList.length > 0 ? "lg:col-span-8" : "lg:col-span-12"}>
                  {stopsHeading ? <Sub className="text-2xl font-semibold tracking-tight text-neutral-950">{stopsHeading}</Sub> : null}
                  <ul role="list" className="mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2">
                    {stopList.map((s, i) => (
                      <li key={`${s.name}-${i}`} className="rounded-2xl bg-neutral-50 p-5 ring-1 ring-neutral-950/5">
                        {s.category ? <p className="text-xs font-semibold tracking-widest text-neutral-500 uppercase">{s.category}</p> : null}
                        <Item className={`${s.category ? "mt-1" : ""} text-base font-semibold text-neutral-950`}>{s.name}</Item>
                        {s.offer ? (
                          <p className="mt-2 flex items-start gap-2 text-sm text-indigo-800">
                            <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="mt-0.5 size-4 shrink-0">
                              <path fillRule="evenodd" d="M4.5 2A2.5 2.5 0 0 0 2 4.5v2.879a2.5 2.5 0 0 0 .732 1.767l4.5 4.5a2.5 2.5 0 0 0 3.536 0l2.878-2.878a2.5 2.5 0 0 0 0-3.536l-4.5-4.5A2.5 2.5 0 0 0 7.38 2H4.5ZM5 6a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clipRule="evenodd" />
                            </svg>
                            <span>
                              <span className="sr-only">Offer: </span>
                              {s.offer}
                            </span>
                          </p>
                        ) : null}
                      </li>
                    ))}
                  </ul>
                </div>
              ) : null}
              {prizeList.length > 0 ? (
                <div className={stopList.length > 0 ? "lg:col-span-4" : "lg:col-span-12"}>
                  <div className="rounded-3xl bg-neutral-950 p-6 sm:p-8">
                    {prizesHeading ? <Sub className="text-2xl font-semibold tracking-tight text-white">{prizesHeading}</Sub> : null}
                    <ol role="list" className="mt-6 space-y-5">
                      {prizeList.map((p, i) => (
                        <li key={`${p.prize}-${i}`} className="flex items-center gap-4">
                          <span className="grid size-14 shrink-0 place-items-center rounded-full border-2 border-dashed border-indigo-300 text-center leading-none text-white">
                            <span>
                              <span className="block text-lg font-semibold tabular-nums">{p.checkins}</span>
                              <span className="block text-xs text-indigo-200">stamps</span>
                            </span>
                          </span>
                          <p className="min-w-0 text-base font-semibold text-white">{p.prize}</p>
                        </li>
                      ))}
                    </ol>
                  </div>
                </div>
              ) : null}
            </div>
          ) : null}

          {termLines.length > 0 ? (
            <details className="group mt-10 rounded-2xl ring-1 ring-neutral-200">
              <summary className={`flex min-h-11 cursor-pointer list-none items-center justify-between gap-4 rounded-2xl px-5 py-3 text-sm font-semibold text-neutral-900 [&::-webkit-details-marker]:hidden ${FOCUS}`}>
                {termsLabel || "Terms & conditions"}
                <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-4 text-neutral-500 transition group-open:rotate-180">
                  <path fillRule="evenodd" d="M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z" clipRule="evenodd" />
                </svg>
              </summary>
              <div className="space-y-3 px-5 pb-5 text-sm leading-6 text-neutral-600">
                {termLines.map((line, i) => (
                  <p key={i}>{line}</p>
                ))}
              </div>
            </details>
          ) : null}
        </div>
      </section>
    );
  },
};
```
