# Add the "Activity Guide" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/activity-guide) to this Pantheon Content Publisher (P1) Next.js project. The season's program guide: cover, registration dates by residency, browse, PDF and print links, and highlights.

## Steps

1. Create `components/puck/activity-guide-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 { activityGuideBlock } from "./components/puck/activity-guide-block";`
3. Register it under `components` as `ActivityGuideBlock: activityGuideBlock`.
4. Add `"ActivityGuideBlock"` to the best-fitting entry in `categories` (this block's library category is "Parks & rec"). 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/activity-guide-block.tsx`

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

/**
 * Activity Guide — the season's program guide: cover, registration dates by residency,
 * browse online, download the PDF (with its size) or request a printed copy, and a few
 * highlights with page numbers.
 * Register: `ActivityGuideBlock: activityGuideBlock` in puck.config.tsx.
 */

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

export type ActivityGuideProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  coverUrl: string;
  coverAlt: string;
  registrationHeading: string;
  registration: { group: string; date: string; detail: string }[];
  browseLabel: string;
  browseHref: string;
  pdfLabel: string;
  pdfSize: string;
  pdfHref: string;
  printLabel: string;
  printHref: string;
  highlightsHeading: string;
  highlights: { title: string; detail: string; page: string }[];
};

const down = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;

const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700";

export const activityGuideBlock: ComponentConfig<ActivityGuideProps> = {
  label: "Activity Guide",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading, like Activity guide. Leave blank to hide it." } },
    heading: { type: "text", label: "Season title", metadata: { help: "Like Fall & Winter 2026." } },
    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." },
    },
    intro: { type: "textarea", label: "Intro", metadata: { help: "Leave blank to hide it." } },
    coverUrl: { type: "text", label: "Cover image URL", metadata: { help: "The guide's front cover, portrait (about 3:4). Leave blank to hide it." } },
    coverAlt: { type: "text", label: "Cover alt text", metadata: { help: "Describe what's on the cover, like Children planting a garden. Leave blank only if the cover is just the title." } },
    registrationHeading: { type: "text", label: "Registration heading", metadata: { help: "Leave blank to use Registration opens." } },
    registration: {
      type: "array",
      label: "Registration dates",
      min: 0,
      max: 6,
      getItemSummary: (item) => (item?.group ? `${item.group}${item.date ? ` · ${item.date}` : ""}` : "Registration date"),
      defaultItemProps: { group: "Residents", date: "", detail: "" },
      arrayFields: {
        group: { type: "text", label: "Who", metadata: { help: "Like Residents, or Non-residents. List residents first; dates show in this order." } },
        date: { type: "text", label: "Opens", metadata: { help: "Like Mon, Aug 17 at 8 a.m." } },
        detail: { type: "text", label: "Detail", metadata: { help: "Optional, like Online and at any rec center. Leave blank to hide it." } },
      },
    },
    browseLabel: { type: "text", label: "Browse link text", metadata: { help: "Leave blank to hide it." } },
    browseHref: { type: "text", label: "Browse link", metadata: { help: "Your online catalog or registration site." } },
    pdfLabel: { type: "text", label: "PDF link text", metadata: { help: "Leave blank to hide it." } },
    pdfSize: { type: "text", label: "PDF size", metadata: { help: "Like 8.4 MB, so people on phone data know what they're downloading." } },
    pdfHref: { type: "text", label: "PDF link" },
    printLabel: { type: "text", label: "Printed copy link text", metadata: { help: "Leave blank to hide it." } },
    printHref: { type: "text", label: "Printed copy link", metadata: { help: "A request form, or a mailto: or tel: link." } },
    highlightsHeading: { type: "text", label: "Highlights heading", metadata: { help: "Leave blank to use Inside this guide." } },
    highlights: {
      type: "array",
      label: "Highlights",
      min: 0,
      max: 8,
      getItemSummary: (item) => item?.title || "Highlight",
      defaultItemProps: { title: "New highlight", detail: "", page: "" },
      arrayFields: {
        title: { type: "text", label: "Title" },
        detail: { type: "text", label: "Detail", metadata: { help: "One short sentence. Leave blank to hide it." } },
        page: { type: "text", label: "Page", metadata: { help: "The page number in the printed guide, like 14. Leave blank to hide it." } },
      },
    },
  },
  defaultProps: {
    eyebrow: "Activity guide",
    heading: "Fall & Winter 2026",
    headingLevel: "h2",
    intro: "More than 400 classes, leagues and events from September through February, for toddlers to grandparents. Find something new, or come back to an old favorite.",
    coverUrl: "https://picsum.photos/seed/cedarvalleyguide/600/800",
    coverAlt: "Cover of the Cedar Valley Park District Fall & Winter 2026 activity guide",
    registrationHeading: "Registration opens",
    registration: [
      { group: "Residents", date: "Mon, Aug 17 at 8 a.m.", detail: "Online, by phone, or at any rec center front desk" },
      { group: "Non-residents", date: "Mon, Aug 24 at 8 a.m.", detail: "Online, by phone, or at any rec center front desk" },
    ],
    browseLabel: "Browse programs online",
    browseHref: "/register",
    pdfLabel: "Download the guide",
    pdfSize: "8.4 MB PDF",
    pdfHref: "/guides/fall-winter-2026.pdf",
    printLabel: "Request a printed copy",
    printHref: "/guides/request-a-copy",
    highlightsHeading: "Inside this guide",
    highlights: [
      { title: "New: adaptive swim lessons", detail: "Small classes with extra instructors, for swimmers with disabilities.", page: "12" },
      { title: "Winter break camps", detail: "Dec 21 to Jan 1 at three centers, with before and after care.", page: "18" },
      { title: "Pickleball for every level", detail: "Drop-in play, clinics and a new winter league.", page: "27" },
      { title: "Free family events", detail: "Pumpkin Float, the Holiday Lights Walk and more.", page: "40" },
    ],
  },
  render: ({
    id,
    eyebrow,
    heading,
    headingLevel,
    intro,
    coverUrl,
    coverAlt,
    registrationHeading,
    registration,
    browseLabel,
    browseHref,
    pdfLabel,
    pdfSize,
    pdfHref,
    printLabel,
    printHref,
    highlightsHeading,
    highlights,
  }) => {
    const H = headingLevel || "h2";
    const Sub = down[H] || "h3";
    const base = id || "activity-guide";
    const dates = (registration ?? []).filter((r) => r?.group || r?.date);
    const items = (highlights ?? []).filter((h) => h?.title);
    const hasActions = Boolean(browseLabel || pdfLabel || printLabel);

    return (
      <section className="overflow-hidden bg-neutral-50 px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto grid max-w-6xl grid-cols-1 gap-12 lg:grid-cols-12 lg:gap-16">
          {coverUrl ? (
            <div className="mx-auto w-full max-w-xs sm:max-w-sm lg:col-span-5 lg:mx-0 lg:max-w-none lg:pt-4">
              <div className="relative lg:sticky lg:top-8">
                <div aria-hidden="true" className="absolute inset-0 translate-x-3 translate-y-3 rotate-3 rounded-r-lg rounded-l-sm bg-indigo-200 lg:translate-x-5 lg:translate-y-4" />
                <div className="relative -rotate-1 overflow-hidden rounded-r-lg rounded-l-sm bg-white shadow-xl ring-1 ring-neutral-950/10 transition motion-safe:hover:rotate-0">
                  <img src={coverUrl} alt={coverAlt || ""} className="aspect-3/4 w-full object-cover" />
                  <div aria-hidden="true" className="absolute inset-y-0 left-0 w-3 bg-linear-to-r from-neutral-950/25 to-transparent" />
                </div>
              </div>
            </div>
          ) : null}

          <div className={coverUrl ? "lg:col-span-7" : "lg:col-span-12"}>
            {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
            {heading ? <H className={`text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl ${eyebrow ? "mt-2" : ""}`}>{heading}</H> : null}
            {intro ? <p className="mt-5 max-w-2xl text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}

            {dates.length ? (
              <div className="mt-10">
                <Sub id={`${base}-reg`} className="text-sm font-semibold tracking-wide text-neutral-950 uppercase">
                  {registrationHeading || "Registration opens"}
                </Sub>
                <ol role="list" aria-labelledby={`${base}-reg`} className="mt-4 grid grid-cols-1 gap-3 sm:grid-cols-2">
                  {dates.map((r, i) => (
                    <li key={`${r.group}-${i}`} className={`rounded-2xl p-5 ring-1 ${i === 0 ? "bg-white shadow-sm ring-indigo-200" : "bg-white/60 ring-neutral-200"}`}>
                      <div className="flex flex-wrap items-center gap-2">
                        <p className="text-sm font-semibold text-neutral-950">{r.group}</p>
                        {i === 0 && dates.length > 1 ? <p className="rounded-full bg-indigo-700 px-2 py-0.5 text-xs font-semibold text-white">First</p> : null}
                      </div>
                      {r.date ? <p className="mt-2 text-xl font-semibold tracking-tight text-indigo-800 tabular-nums">{r.date}</p> : null}
                      {r.detail ? <p className="mt-1 text-sm leading-6 text-pretty text-neutral-600">{r.detail}</p> : null}
                    </li>
                  ))}
                </ol>
              </div>
            ) : null}

            {hasActions ? (
              <div className="mt-8 flex flex-col gap-3 sm:flex-row sm:flex-wrap sm:items-center">
                {browseLabel ? (
                  <a
                    href={browseHref || "#"}
                    className={`group inline-flex min-h-12 items-center justify-center gap-2 rounded-lg bg-indigo-700 px-5 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-600 ${focusRing}`}
                  >
                    {browseLabel}
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 transition motion-safe: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}
                {pdfLabel ? (
                  <a
                    href={pdfHref || "#"}
                    className={`inline-flex min-h-12 items-center justify-center gap-2 rounded-lg bg-white px-5 text-base font-semibold text-neutral-950 ring-1 ring-neutral-300 transition ring-inset hover:bg-neutral-100 ${focusRing}`}
                  >
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 text-indigo-700">
                      <path d="M10.75 2.75a.75.75 0 0 0-1.5 0v8.614L6.295 8.235a.75.75 0 1 0-1.09 1.03l4.25 4.5a.75.75 0 0 0 1.09 0l4.25-4.5a.75.75 0 0 0-1.09-1.03l-2.955 3.129V2.75Z" />
                      <path d="M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z" />
                    </svg>
                    {pdfLabel}
                    {pdfSize ? <span className="text-sm font-medium text-neutral-600">({pdfSize})</span> : null}
                  </a>
                ) : null}
                {printLabel ? (
                  <a
                    href={printHref || "#"}
                    className={`inline-flex min-h-12 items-center justify-center gap-2 rounded-lg px-3 text-base font-semibold text-indigo-800 underline decoration-indigo-300 underline-offset-4 transition hover:decoration-indigo-700 ${focusRing}`}
                  >
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0">
                      <path d="M3 4a2 2 0 0 0-2 2v1.161l8.441 4.221a1.25 1.25 0 0 0 1.118 0L19 7.162V6a2 2 0 0 0-2-2H3Z" />
                      <path d="m19 8.839-7.77 3.885a2.75 2.75 0 0 1-2.46 0L1 8.839V14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.839Z" />
                    </svg>
                    {printLabel}
                  </a>
                ) : null}
              </div>
            ) : null}

            {items.length ? (
              <div className="mt-12 border-t border-neutral-300 pt-8">
                <Sub id={`${base}-inside`} className="text-sm font-semibold tracking-wide text-neutral-950 uppercase">
                  {highlightsHeading || "Inside this guide"}
                </Sub>
                <ul role="list" aria-labelledby={`${base}-inside`} className="mt-4 divide-y divide-neutral-200">
                  {items.map((h, i) => (
                    <li key={`${h.title}-${i}`} className="flex items-baseline gap-4 py-4">
                      <div className="min-w-0 flex-1">
                        <p className="text-base font-semibold text-pretty text-neutral-950">{h.title}</p>
                        {h.detail ? <p className="mt-1 text-sm leading-6 text-pretty text-neutral-600">{h.detail}</p> : null}
                      </div>
                      {h.page ? (
                        <p className="shrink-0 text-sm font-semibold text-indigo-800 tabular-nums">
                          <span className="sr-only">Page </span>
                          <span aria-hidden="true">p. </span>
                          {h.page}
                        </p>
                      ) : null}
                    </li>
                  ))}
                </ul>
              </div>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
