# Add the "Adopt-a-Park" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/adopt-a-park) to this Pantheon Content Publisher (P1) Next.js project. A stewardship program pitch: adopters count, steps, commitment, perks, sites open for adoption and an apply link.

## Steps

1. Create `components/puck/adopt-a-park-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 { adoptAParkBlock } from "./components/puck/adopt-a-park-block";`
3. Register it under `components` as `AdoptAParkBlock: adoptAParkBlock`.
4. Add `"AdoptAParkBlock"` 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/adopt-a-park-block.tsx`

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

/**
 * Adopt-a-Park — a stewardship program pitch: current adopters count, how-it-works steps, the
 * commitment, perks like sign recognition, sites open for adoption (status in words) and an
 * apply link. Register: `AdoptAParkBlock: adoptAParkBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type SiteStatus = "available" | "pending" | "adopted";

export type AdoptAParkProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  statValue: string;
  statLabel: string;
  statNote: string;
  steps: { title: string; text: string }[];
  commitment: { term: string; detail: string }[];
  perks: { text: string }[];
  sites: { name: string; kind: string; area: string; status: SiteStatus }[];
  applyLabel: string;
  applyHref: string;
  contactText: string;
  contactEmail: string;
};

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

const siteStatuses: Record<SiteStatus, { label: string; pill: string; icon: string }> = {
  available: {
    label: "Available",
    pill: "bg-indigo-700 text-white ring-indigo-700",
    icon: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-11.25a.75.75 0 0 0-1.5 0v2.5h-2.5a.75.75 0 0 0 0 1.5h2.5v2.5a.75.75 0 0 0 1.5 0v-2.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-2.5Z",
  },
  pending: {
    label: "Application pending",
    pill: "bg-white text-neutral-800 ring-neutral-300",
    icon: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z",
  },
  adopted: {
    label: "Adopted",
    pill: "bg-neutral-100 text-neutral-700 ring-neutral-200",
    icon: "m9.653 16.915-.005-.003-.019-.01a20.759 20.759 0 0 1-1.162-.682 22.045 22.045 0 0 1-2.582-1.9C4.045 12.733 2 10.352 2 7.5a4.5 4.5 0 0 1 8-2.828A4.5 4.5 0 0 1 18 7.5c0 2.852-2.044 5.233-3.885 6.82a22.049 22.049 0 0 1-3.744 2.582l-.019.01-.005.003h-.002a.739.739 0 0 1-.69.001l-.002-.001Z",
  },
};

const statusOrder: SiteStatus[] = ["available", "pending", "adopted"];

export const adoptAParkBlock: ComponentConfig<AdoptAParkProps> = {
  label: "Adopt-a-Park",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "A short label above the heading, like the program name. 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." },
    },
    intro: { type: "textarea", label: "Intro", metadata: { help: "Leave blank to hide it." } },
    statValue: { type: "text", label: "Adopters count", metadata: { help: "Like 148. Leave blank to hide the number." } },
    statLabel: { type: "text", label: "Count label", metadata: { help: "What the number counts, like \"groups caring for 63 parks and trails\"." } },
    statNote: { type: "text", label: "Count source", metadata: { help: "When the count was taken, like \"Program records, Sept 2026\"." } },
    steps: {
      type: "array",
      label: "How it works",
      min: 1,
      max: 6,
      getItemSummary: (item, i) => (item?.title ? `${(i ?? 0) + 1}. ${item.title}` : "Step"),
      defaultItemProps: { title: "New step", text: "" },
      arrayFields: {
        title: { type: "text", label: "Step" },
        text: { type: "textarea", label: "Details" },
      },
    },
    commitment: {
      type: "array",
      label: "Commitment",
      max: 6,
      getItemSummary: (item) => item?.term || "Commitment",
      defaultItemProps: { term: "Term", detail: "" },
      arrayFields: {
        term: { type: "text", label: "Label", metadata: { help: "Short, like \"Term\" or \"Clean-ups\"." } },
        detail: { type: "text", label: "Detail", metadata: { help: "Like \"Two years, renewable\"." } },
      },
    },
    perks: {
      type: "array",
      label: "Perks",
      max: 6,
      getItemSummary: (item) => item?.text?.slice(0, 50) || "Perk",
      defaultItemProps: { text: "" },
      arrayFields: {
        text: { type: "text", label: "Perk" },
      },
    },
    sites: {
      type: "array",
      label: "Sites",
      max: 20,
      getItemSummary: (item) => (item?.name ? `${siteStatuses[item.status]?.label ?? "Available"} · ${item.name}` : "Site"),
      defaultItemProps: { name: "New site", kind: "", area: "", status: "available" },
      arrayFields: {
        name: { type: "text", label: "Site name" },
        kind: { type: "text", label: "Type", metadata: { help: "Like Neighborhood park, Trail segment or Pocket garden." } },
        area: { type: "text", label: "Size or length", metadata: { help: "Like 2.5 acres or 1.2 mi." } },
        status: {
          type: "select",
          label: "Status",
          options: [
            { label: "Available", value: "available" },
            { label: "Application pending", value: "pending" },
            { label: "Adopted", value: "adopted" },
          ],
          metadata: { help: "Available sites are listed first. The status is shown as a word, not just a color." },
        },
      },
    },
    applyLabel: { type: "text", label: "Apply button text", metadata: { help: "Leave blank to hide the button." } },
    applyHref: { type: "text", label: "Apply link" },
    contactText: { type: "text", label: "Contact line", metadata: { help: "Shown next to the button, like \"Questions? Email the volunteer office.\"" } },
    contactEmail: { type: "text", label: "Contact email", metadata: { help: "Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "Adopt-a-Park & Trail",
    heading: "Make a park your own",
    headingLevel: "h2",
    intro:
      "Neighbors, scout troops, businesses and congregations keep Cedar Valley's parks and trails clean and welcoming. You pick a spot, we bring the gloves and bags, and your group's name goes on the sign.",
    statValue: "148",
    statLabel: "groups caring for 63 parks and trail segments",
    statNote: "Sample figure. Program records, Sept 2026.",
    steps: [
      { title: "Choose a site", text: "Pick an available park or trail segment below, or suggest one near you." },
      { title: "Apply online", text: "Tell us about your group. Staff reply within 10 business days and schedule a site walk." },
      { title: "Get trained and equipped", text: "A 45-minute safety orientation, plus vests, grabbers, gloves and bags on loan." },
      { title: "Care for it", text: "Hold clean-ups on your schedule and log them online. Staff haul away what you collect." },
    ],
    commitment: [
      { term: "Term", detail: "Two years, renewable" },
      { term: "Clean-ups", detail: "At least 4 a year" },
      { term: "Group size", detail: "4 or more volunteers" },
      { term: "Ages", detail: "All ages, adult supervision under 16" },
    ],
    perks: [
      { text: "Your group's name on a sign at the site" },
      { text: "Recognition at the annual volunteer picnic" },
      { text: "Service hours letters for students and scouts" },
      { text: "First pick of native plants for spring plantings" },
    ],
    sites: [
      { name: "Birchwood Pocket Park", kind: "Neighborhood park", area: "1.4 acres", status: "available" },
      { name: "Millrace Greenway, Mile 2–3", kind: "Trail segment", area: "1.0 mi", status: "available" },
      { name: "Prairie Hawks Playground", kind: "Neighborhood park", area: "2.1 acres", status: "pending" },
      { name: "Heron Marsh Loop", kind: "Trail", area: "1.9 mi", status: "available" },
      { name: "Lakeside Fields", kind: "Athletic complex", area: "18 acres", status: "adopted" },
    ],
    applyLabel: "Apply to adopt",
    applyHref: "/volunteer/adopt-a-park/apply",
    contactText: "Questions? Email the volunteer office at",
    contactEmail: "adopt@cedarvalleyparks.example.org",
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, statValue, statLabel, statNote, steps, commitment, perks, sites, applyLabel, applyHref, contactText, contactEmail }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const baseId = id || "adopt-a-park";
    const stepList = (steps ?? []).filter((s) => s?.title);
    const terms = (commitment ?? []).filter((c) => c?.term && c?.detail);
    const perkList = (perks ?? []).filter((p) => p?.text);
    const siteList = (sites ?? [])
      .filter((s) => s?.name)
      .map((s) => ({ ...s, status: (siteStatuses[s.status] ? s.status : "available") as SiteStatus }))
      .sort((a, b) => statusOrder.indexOf(a.status) - statusOrder.indexOf(b.status));
    const openCount = siteList.filter((s) => s.status === "available").length;

    return (
      <section aria-labelledby={heading ? `${baseId}-heading` : undefined} className="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 gap-10 lg:grid-cols-12 lg:items-end lg:gap-12">
            <div className="lg:col-span-7">
              {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700">{eyebrow}</p> : null}
              {heading ? (
                <H id={`${baseId}-heading`} className="mt-2 text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl">
                  {heading}
                </H>
              ) : null}
              {intro ? <p className="mt-5 max-w-2xl text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
            {statValue ? (
              <div className="border-l-2 border-indigo-700 pl-6 lg:col-span-4 lg:col-start-9">
                <p className="text-5xl font-semibold tracking-tight text-neutral-950 tabular-nums sm:text-6xl">{statValue}</p>
                {statLabel ? <p className="mt-2 text-base leading-7 text-pretty text-neutral-700">{statLabel}</p> : null}
                {statNote ? <p className="mt-2 text-xs leading-5 text-neutral-600">{statNote}</p> : null}
              </div>
            ) : null}
          </div>

          <div className="mt-14 grid grid-cols-1 gap-12 lg:mt-20 lg:grid-cols-12 lg:gap-12">
            <div className="min-w-0 lg:col-span-7">
              {stepList.length ? (
                <>
                  <Sub className="text-lg font-semibold tracking-tight text-neutral-950">How it works</Sub>
                  <ol role="list" className="mt-6 grid grid-cols-1 gap-x-8 gap-y-8 sm:grid-cols-2">
                    {stepList.map((s, i) => (
                      <li key={`${s.title}-${i}`} className="relative border-t border-neutral-200 pt-5">
                        <span aria-hidden="true" className="absolute -top-px left-0 h-0.5 w-10 bg-indigo-700" />
                        <p className="text-sm font-semibold text-indigo-700 tabular-nums">
                          <span className="sr-only">Step </span>
                          {String(i + 1).padStart(2, "0")}
                        </p>
                        <p className="mt-2 text-base font-semibold text-neutral-950">{s.title}</p>
                        {s.text ? <p className="mt-1.5 text-sm leading-6 text-pretty text-neutral-600">{s.text}</p> : null}
                      </li>
                    ))}
                  </ol>
                </>
              ) : null}

              {terms.length || perkList.length ? (
                <div className={`grid grid-cols-1 gap-8 rounded-2xl bg-neutral-50 p-6 ring-1 ring-neutral-200 ring-inset sm:grid-cols-2 sm:p-8 ${stepList.length ? "mt-12" : ""}`}>
                  {terms.length ? (
                    <div className="min-w-0">
                      <Sub className="text-base font-semibold text-neutral-950">What we ask</Sub>
                      <dl className="mt-4 divide-y divide-neutral-200 text-sm leading-6">
                        {terms.map((c, i) => (
                          <div key={`${c.term}-${i}`} className="flex flex-col py-2.5 first:pt-0 min-[400px]:flex-row min-[400px]:gap-4">
                            <dt className="shrink-0 text-neutral-600 min-[400px]:w-24">{c.term}</dt>
                            <dd className="min-w-0 font-medium text-neutral-950">{c.detail}</dd>
                          </div>
                        ))}
                      </dl>
                    </div>
                  ) : null}
                  {perkList.length ? (
                    <div className="min-w-0">
                      <Sub className="text-base font-semibold text-neutral-950">What you get</Sub>
                      <ul role="list" className="mt-4 space-y-3 text-sm leading-6 text-neutral-700">
                        {perkList.map((p, i) => (
                          <li key={`${p.text}-${i}`} className="flex gap-2.5">
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 shrink-0 text-indigo-700">
                              <path fillRule="evenodd" d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clipRule="evenodd" />
                            </svg>
                            <span className="min-w-0">{p.text}</span>
                          </li>
                        ))}
                      </ul>
                    </div>
                  ) : null}
                </div>
              ) : null}
            </div>

            <div className="min-w-0 lg:col-span-5">
              {siteList.length ? (
                <div className="rounded-2xl ring-1 ring-neutral-200">
                  <div className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 border-b border-neutral-200 px-5 py-4 sm:px-6">
                    <Sub className="text-base font-semibold text-neutral-950">Sites looking for adopters</Sub>
                    <p className="text-sm text-neutral-600 tabular-nums">
                      {openCount} of {siteList.length} available
                    </p>
                  </div>
                  <ul role="list" className="divide-y divide-neutral-200">
                    {siteList.map((s, i) => {
                      const st = siteStatuses[s.status];
                      const meta = [s.kind, s.area].filter(Boolean).join(" · ");
                      return (
                        <li key={`${s.name}-${i}`} className="flex flex-col gap-2 px-5 py-4 min-[400px]:flex-row min-[400px]:items-center min-[400px]:justify-between min-[400px]:gap-4 sm:px-6">
                          <div className="min-w-0">
                            <p className={`text-sm font-semibold ${s.status === "adopted" ? "text-neutral-700" : "text-neutral-950"}`}>{s.name}</p>
                            {meta ? <p className="mt-0.5 text-sm text-neutral-600">{meta}</p> : null}
                          </div>
                          <p className={`inline-flex shrink-0 items-center gap-1.5 self-start rounded-full px-2.5 py-1 text-xs font-semibold whitespace-nowrap ring-1 ring-inset min-[400px]:self-auto ${st.pill}`}>
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-3.5 shrink-0">
                              <path fillRule="evenodd" d={st.icon} clipRule="evenodd" />
                            </svg>
                            <span className="sr-only">Status: </span>
                            {st.label}
                          </p>
                        </li>
                      );
                    })}
                  </ul>
                </div>
              ) : null}

              {applyLabel || contactEmail ? (
                <div className={siteList.length ? "mt-6" : ""}>
                  {applyLabel ? (
                    <a
                      href={applyHref || "#"}
                      className={`group flex min-h-12 w-full items-center justify-center gap-2 rounded-xl bg-indigo-700 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-800 ${focusRing}`}
                    >
                      {applyLabel}
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 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}
                  {contactEmail ? (
                    <p className="mt-3 text-center text-sm leading-6 text-neutral-600">
                      {contactText ? `${contactText} ` : null}
                      <a
                        href={`mailto:${contactEmail}`}
                        className={`inline-flex min-h-11 items-center rounded font-semibold break-all text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}
                      >
                        {contactEmail}
                      </a>
                    </p>
                  ) : null}
                </div>
              ) : null}
            </div>
          </div>
        </div>
      </section>
    );
  },
};
```
