# Add the "Annual Report Highlights" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/annual-report-highlights) to this Pantheon Content Publisher (P1) Next.js project. Year-in-review section with an oversized year, headline figures, three highlight stories and a full-report download.

## Steps

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

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

/**
 * Annual Report Highlights — a year in review: an oversized year, headline figures with a
 * source line, three highlight stories, and a link to download the full report.
 * Register: `AnnualReportHighlightsBlock: annualReportHighlightsBlock` in puck.config.tsx.
 */

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

export type AnnualReportHighlightsProps = {
  year: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  stats: { value: string; label: string }[];
  statsSource: string;
  stories: { kicker: string; title: string; summary: string; imageUrl: string; imageAlt: string; href: string }[];
  storyLinkLabel: string;
  reportLabel: string;
  reportHref: string;
  reportMeta: string;
};

const childHeading: Record<Heading, "h2" | "h3" | "h4" | "h5"> = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" };

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 annualReportHighlightsBlock: ComponentConfig<AnnualReportHighlightsProps> = {
  label: "Annual Report Highlights",
  fields: {
    year: { type: "text", label: "Year", metadata: { help: "Shown very large, like 2025 or FY2025. Leave blank to hide it." } },
    heading: { type: "textarea", 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" },
    stats: {
      type: "array",
      label: "Headline figures",
      min: 0,
      max: 4,
      getItemSummary: (item) => [item?.value, item?.label].filter(Boolean).join(" · ") || "Figure",
      defaultItemProps: { value: "1,000", label: "what this number counts" },
      arrayFields: {
        value: { type: "text", label: "Figure", metadata: { help: "Keep it short, like 2.4M or 96%." } },
        label: { type: "text", label: "Label", metadata: { help: "What the figure counts, in a few words." } },
      },
    },
    statsSource: { type: "text", label: "Source line", metadata: { help: "Where the figures come from, like Source: FY2025 audited financials." } },
    stories: {
      type: "array",
      label: "Highlight stories",
      min: 0,
      max: 3,
      getItemSummary: (item) => item?.title || "Story",
      defaultItemProps: {
        kicker: "Program",
        title: "A milestone from this year",
        summary: "Two or three sentences on what happened and why it mattered.",
        imageUrl: "https://picsum.photos/seed/report/800/600",
        imageAlt: "",
        href: "",
      },
      arrayFields: {
        kicker: { type: "text", label: "Kicker", metadata: { help: "A short label above the title, like a program or month." } },
        title: { type: "text", label: "Title" },
        summary: { type: "textarea", label: "Summary" },
        imageUrl: { type: "text", label: "Image URL", metadata: { help: "Landscape works best. Leave blank for a text-only card." } },
        imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for people who can't see it. Leave blank only if it's decorative." } },
        href: { type: "text", label: "Link", metadata: { help: "Optional. The full story." } },
      },
    },
    storyLinkLabel: { type: "text", label: "Story link text", metadata: { help: "Like Read the story. Only shows on stories with a link." } },
    reportLabel: { type: "text", label: "Download link text", metadata: { help: "Leave blank to hide the download panel." } },
    reportHref: { type: "text", label: "Download link", metadata: { help: "The full report PDF in your media library, or a full URL." } },
    reportMeta: { type: "text", label: "File details", metadata: { help: "Like PDF · 32 pages · 4.1 MB, so readers know what they're downloading." } },
  },
  defaultProps: {
    year: "2025",
    heading: "A year of open land and open doors",
    headingLevel: "h2",
    intro: "Thanks to 3,100 members and neighbors, Fernbrook Land Trust protected more ground, restored more river and welcomed more people outside than in any year since our founding.",
    stats: [
      { value: "1,240", label: "acres permanently protected" },
      { value: "6.2 mi", label: "of riverbank restored" },
      { value: "18,500", label: "trail visits logged" },
      { value: "3,100", label: "member households" },
    ],
    statsSource: "Sample figures. Source: Fernbrook Land Trust 2025 stewardship records and membership database.",
    stories: [
      {
        kicker: "Conservation",
        title: "The Harlan farm stays a farm",
        summary: "A conservation easement on 410 acres keeps the Harlan family's orchard working and closes the last gap in the Millbrook wildlife corridor.",
        imageUrl: "https://picsum.photos/seed/orchard/800/600",
        imageAlt: "Rows of apple trees on a rolling hillside in early autumn",
        href: "/stories/harlan-farm",
      },
      {
        kicker: "Restoration",
        title: "Brook trout return to Cold Spring Run",
        summary: "Two years after we removed a failing culvert, volunteers counted native brook trout spawning upstream for the first time in decades.",
        imageUrl: "https://picsum.photos/seed/creek/800/600",
        imageAlt: "A clear, shallow stream running over stones beneath overhanging trees",
        href: "/stories/cold-spring-run",
      },
      {
        kicker: "Community",
        title: "A trail everyone can use",
        summary: "Our new 1.2-mile accessible loop at Weller Meadow opened in June with firm-surface paths, benches every 300 feet and a tactile trail map.",
        imageUrl: "https://picsum.photos/seed/meadowpath/800/600",
        imageAlt: "A wide, level gravel path curving through a summer meadow",
        href: "/stories/weller-meadow",
      },
    ],
    storyLinkLabel: "Read the story",
    reportLabel: "Download the 2025 annual report",
    reportHref: "/files/annual-report-2025.pdf",
    reportMeta: "PDF · 28 pages · 3.6 MB",
  },
  render: ({ id, year, heading, headingLevel, intro, stats, statsSource, stories, storyLinkLabel, reportLabel, reportHref, reportMeta }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const figures = (stats ?? []).filter((s) => s?.value);
    const list = (stories ?? []).filter((s) => s?.title);
    const statCols = figures.length >= 4 ? "lg:grid-cols-4" : figures.length === 3 ? "lg:grid-cols-3" : "";
    const storyCols = list.length >= 3 ? "lg:grid-cols-3" : list.length === 2 ? "md:grid-cols-2" : "";
    const headingId = `${id || "annual-report"}-heading`;

    return (
      <section aria-labelledby={heading ? headingId : 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-8 lg:grid-cols-12 lg:items-end lg:gap-12">
            {year ? (
              <p aria-hidden="true" className="text-7xl leading-none font-semibold tracking-tighter text-indigo-700 tabular-nums sm:text-8xl lg:col-span-5 lg:text-9xl">
                {year}
              </p>
            ) : null}
            <div className={year ? "lg:col-span-7 lg:pb-2" : "max-w-3xl lg:col-span-12"}>
              {heading ? (
                <H id={headingId} className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">
                  {year ? <span className="sr-only">{year}: </span> : null}
                  {heading}
                </H>
              ) : null}
              {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          </div>

          {figures.length ? (
            <div className="mt-12 lg:mt-16">
              <dl className={`grid grid-cols-1 gap-px overflow-hidden rounded-2xl bg-neutral-200 ring-1 ring-neutral-200 sm:grid-cols-2 ${statCols}`}>
                {figures.map((s, i) => (
                  <div key={`${s.label}-${i}`} className="flex flex-col-reverse gap-1 bg-neutral-50 px-6 py-7 sm:px-7">
                    <dt className="text-sm leading-6 text-neutral-600">{s.label}</dt>
                    <dd className="text-4xl font-semibold tracking-tight text-neutral-950 tabular-nums">{s.value}</dd>
                  </div>
                ))}
              </dl>
              {statsSource ? <p className="mt-3 text-sm text-neutral-600">{statsSource}</p> : null}
            </div>
          ) : null}

          {list.length ? (
            <ul role="list" className={`mt-14 grid grid-cols-1 gap-x-8 gap-y-12 lg:mt-20 ${storyCols}`}>
              {list.map((s, i) => (
                <li key={`${s.title}-${i}`}>
                  <article className="group relative flex h-full flex-col">
                    {s.imageUrl ? (
                      <div className="aspect-4/3 overflow-hidden rounded-2xl bg-neutral-100">
                        <img src={s.imageUrl} alt={s.imageAlt || ""} loading="lazy" className="size-full object-cover transition duration-500 group-hover:scale-103" />
                      </div>
                    ) : null}
                    <div className={`flex items-center gap-3 text-sm font-semibold text-indigo-700 ${s.imageUrl ? "mt-6" : ""}`}>
                      <span aria-hidden="true" className="font-mono text-neutral-500 tabular-nums">
                        {String(i + 1).padStart(2, "0")}
                      </span>
                      {s.kicker ? <span>{s.kicker}</span> : null}
                    </div>
                    <Sub className="mt-2 text-xl font-semibold tracking-tight text-balance text-neutral-950">
                      {s.href ? (
                        <a href={s.href} className="focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-indigo-600">
                          <span aria-hidden="true" className="absolute inset-0 rounded-2xl" />
                          {s.title}
                        </a>
                      ) : (
                        s.title
                      )}
                    </Sub>
                    {s.summary ? <p className="mt-3 text-base leading-7 text-pretty text-neutral-600">{s.summary}</p> : null}
                    {s.href && storyLinkLabel ? (
                      <p aria-hidden="true" className="mt-auto inline-flex items-center gap-1.5 pt-5 text-sm font-semibold text-neutral-950 group-hover:text-indigo-700">
                        {storyLinkLabel}
                        <svg viewBox="0 0 20 20" fill="currentColor" className="size-4 transition group-hover:translate-x-0.5">
                          <path fillRule="evenodd" d={arrow} clipRule="evenodd" />
                        </svg>
                      </p>
                    ) : null}
                  </article>
                </li>
              ))}
            </ul>
          ) : null}

          {reportLabel ? (
            <div className="mt-16 flex flex-col gap-6 rounded-2xl bg-indigo-700 p-6 sm:flex-row sm:items-center sm:justify-between sm:p-8 lg:mt-20">
              <div className="flex items-start gap-4">
                <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round" className="size-8 shrink-0 text-indigo-200">
                  <path d="M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25" />
                </svg>
                <div>
                  <p className="text-lg font-semibold text-white">{reportLabel}</p>
                  {reportMeta ? <p className="mt-1 text-sm text-indigo-100">{reportMeta}</p> : null}
                </div>
              </div>
              <a
                href={reportHref || "#"}
                className="inline-flex min-h-11 shrink-0 items-center justify-center gap-2 rounded-lg bg-white px-5 py-2.5 text-sm font-semibold text-indigo-700 transition hover:bg-indigo-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
              >
                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4">
                  <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>
                Download
                <span className="sr-only">: {reportLabel}</span>
              </a>
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
