# Add the "Funding Priorities" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/funding-priorities) to this Pantheon Content Publisher (P1) Next.js project. Focus areas with a goal statement, what we fund and don't fund, typical grant size and a program officer contact.

## Steps

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

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

/**
 * Funding Priorities — each focus area with its goal, what we fund and don't fund,
 * typical grant size and the program officer to call. Numbered, with jump links.
 * Register: `FundingPrioritiesBlock: fundingPrioritiesBlock` in puck.config.tsx.
 */

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

type Area = {
  name: string;
  goal: string;
  fund: string;
  dontFund: string;
  grantSize: string;
  officerName: string;
  officerTitle: string;
  officerEmail: string;
  officerPhone: string;
};

export type FundingPrioritiesProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  areas: Area[];
  fundLabel: string;
  dontFundLabel: string;
  grantSizeLabel: string;
  footnote: 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 focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const lines = (s?: string) => (s || "").split("\n").map((l) => l.trim()).filter(Boolean);
const pad = (n: number) => String(n).padStart(2, "0");

export const fundingPrioritiesBlock: ComponentConfig<FundingPrioritiesProps> = {
  label: "Funding Priorities",
  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." },
    },
    intro: { type: "textarea", label: "Intro" },
    areas: {
      type: "array",
      label: "Focus areas",
      min: 1,
      max: 8,
      getItemSummary: (item) => item?.name || "Focus area",
      defaultItemProps: {
        name: "New focus area",
        goal: "",
        fund: "First thing we fund\nSecond thing we fund",
        dontFund: "First thing we don't fund",
        grantSize: "$10,000–$25,000",
        officerName: "",
        officerTitle: "",
        officerEmail: "",
        officerPhone: "",
      },
      arrayFields: {
        name: { type: "text", label: "Focus area" },
        goal: { type: "textarea", label: "Goal statement", metadata: { help: "One sentence on the change you want to see." } },
        fund: { type: "textarea", label: "What we fund", metadata: { help: "One item per line." } },
        dontFund: { type: "textarea", label: "What we don't fund", metadata: { help: "One item per line. Leave blank to hide the list." } },
        grantSize: { type: "text", label: "Typical grant size", metadata: { help: "Such as $15,000–$40,000 over one to two years." } },
        officerName: { type: "text", label: "Program officer", metadata: { help: "Leave blank to hide the contact." } },
        officerTitle: { type: "text", label: "Officer title" },
        officerEmail: { type: "text", label: "Officer email" },
        officerPhone: { type: "text", label: "Officer phone" },
      },
    },
    fundLabel: { type: "text", label: "Fund list label" },
    dontFundLabel: { type: "text", label: "Don't fund list label" },
    grantSizeLabel: { type: "text", label: "Grant size label" },
    footnote: { type: "textarea", label: "Footnote", metadata: { help: "Small print under the list. Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "Funding priorities",
    heading: "Where we focus our grantmaking",
    headingLevel: "h2",
    intro: "Our board sets four priorities every three years, informed by the Harlow County community needs assessment. Requests that fit squarely inside one of them are the most competitive.",
    areas: [
      {
        name: "Housing & neighborhoods",
        goal: "Every Harlow County family has a safe, stable, affordable place to live in a neighborhood where they can thrive.",
        fund: "Eviction prevention and tenant legal aid\nHome repair for owners age 62 and older\nResident-led neighborhood planning\nPredevelopment costs for affordable housing",
        dontFund: "Market-rate development\nEmergency shelter operations (see our Basic Needs Fund)",
        grantSize: "$25,000–$75,000 per year",
        officerName: "Marcus Bell",
        officerTitle: "Program Officer, Housing",
        officerEmail: "mbell@harlowfoundation.example.org",
        officerPhone: "(555) 555-0131",
      },
      {
        name: "Early learning",
        goal: "Children enter kindergarten ready to learn, and the adults who care for them are well paid and well supported.",
        fund: "Child care workforce wages and credentials\nHome visiting and family literacy\nExpanding infant and toddler care slots",
        dontFund: "Private school tuition\nOne-day events or book giveaways on their own",
        grantSize: "$10,000–$40,000 per year",
        officerName: "Renée Okafor",
        officerTitle: "Senior Program Officer, Education",
        officerEmail: "rokafor@harlowfoundation.example.org",
        officerPhone: "(555) 555-0142",
      },
      {
        name: "Arts & culture",
        goal: "Every resident can make, see and share art close to home, whatever their income or neighborhood.",
        fund: "Free and low-cost public programs\nArtist fees for community-based projects\nArts education in under-resourced schools",
        dontFund: "Capital campaigns for new buildings\nFundraising galas and sponsorships",
        grantSize: "$2,500–$15,000",
        officerName: "Dana Whitfield",
        officerTitle: "Program Officer, Arts",
        officerEmail: "dwhitfield@harlowfoundation.example.org",
        officerPhone: "(555) 555-0157",
      },
    ],
    fundLabel: "What we fund",
    dontFundLabel: "What we don't fund",
    grantSizeLabel: "Typical grant",
    footnote: "Grant sizes are sample figures and vary by cycle. Across all areas, we do not fund individuals, political activity, religious instruction or debt retirement.",
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, areas, fundLabel, dontFundLabel, grantSizeLabel, footnote }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const Sub2 = grandchildHeading[H] ?? "h4";
    const uid = `fp-${id || "areas"}`;
    const list = (areas ?? []).filter((a) => a?.name);
    const hasHeader = Boolean(eyebrow || heading || intro);

    return (
      <section 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">
          {hasHeader ? (
            <div className="max-w-3xl">
              {eyebrow ? <p className="text-sm font-semibold tracking-widest text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? <H className={`text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl ${eyebrow ? "mt-3" : ""}`}>{heading}</H> : null}
              {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {list.length > 1 ? (
            <nav aria-label="Focus areas" className={hasHeader ? "mt-8" : ""}>
              <ul role="list" className="flex flex-wrap gap-2">
                {list.map((a, i) => (
                  <li key={`${a.name}-${i}`}>
                    <a href={`#${uid}-${i}`} className={`inline-flex min-h-11 items-center gap-2 rounded-full px-4 py-2 text-sm font-medium text-neutral-800 ring-1 ring-neutral-200 transition ring-inset hover:bg-indigo-50 hover:text-indigo-800 hover:ring-indigo-300 ${focusRing}`}>
                      <span aria-hidden="true" className="text-xs font-semibold text-indigo-700 tabular-nums">{pad(i + 1)}</span>
                      {a.name}
                    </a>
                  </li>
                ))}
              </ul>
            </nav>
          ) : null}

          {list.length ? (
            <div className={`divide-y divide-neutral-200 border-t border-neutral-200 ${hasHeader || list.length > 1 ? "mt-12 sm:mt-14" : ""}`}>
              {list.map((a, i) => {
                const fund = lines(a.fund);
                const dont = lines(a.dontFund);
                const tel = (a.officerPhone || "").replace(/[^\d+]/g, "");
                return (
                  <article key={`${a.name}-${i}`} id={`${uid}-${i}`} aria-labelledby={`${uid}-${i}-h`} className="grid scroll-mt-8 grid-cols-1 gap-8 py-12 lg:grid-cols-12 lg:gap-12 lg:py-16">
                    <div className="lg:col-span-4">
                      <p aria-hidden="true" className="text-sm font-semibold text-indigo-700 tabular-nums">{pad(i + 1)}</p>
                      <Sub id={`${uid}-${i}-h`} className="mt-2 text-2xl leading-8 font-semibold tracking-tight text-balance text-neutral-950">{a.name}</Sub>
                      {a.goal ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-700">{a.goal}</p> : null}

                      <dl className="mt-6 space-y-5 border-t border-neutral-200 pt-6 text-sm leading-6">
                        {a.grantSize ? (
                          <div>
                            <dt className="font-medium text-neutral-600">{grantSizeLabel || "Typical grant"}</dt>
                            <dd className="mt-0.5 text-lg font-semibold tracking-tight text-neutral-950 tabular-nums">{a.grantSize}</dd>
                          </div>
                        ) : null}
                        {a.officerName ? (
                          <div>
                            <dt className="font-medium text-neutral-600">Program officer</dt>
                            <dd className="mt-0.5">
                              <span className="block font-semibold text-neutral-950">{a.officerName}</span>
                              {a.officerTitle ? <span className="block text-neutral-600">{a.officerTitle}</span> : null}
                              {a.officerEmail ? (
                                <a href={`mailto:${a.officerEmail}`} className={`-mx-1 flex min-h-11 items-center rounded px-1 font-medium break-all text-indigo-700 hover:text-indigo-900 ${focusRing}`}>
                                  {a.officerEmail}
                                </a>
                              ) : null}
                              {a.officerPhone ? (
                                <a href={`tel:${tel}`} className={`-mx-1 -mt-2 flex min-h-11 items-center rounded px-1 font-medium text-indigo-700 tabular-nums hover:text-indigo-900 ${focusRing}`}>
                                  {a.officerPhone}
                                </a>
                              ) : null}
                            </dd>
                          </div>
                        ) : null}
                      </dl>
                    </div>

                    <div className={`grid grid-cols-1 gap-6 lg:col-span-8 ${dont.length ? "md:grid-cols-2" : ""}`}>
                      {fund.length ? (
                        <div className="rounded-2xl bg-indigo-50/70 p-6 ring-1 ring-indigo-600/10 ring-inset sm:p-7">
                          <Sub2 className="flex items-center gap-2 text-sm font-semibold tracking-wide text-indigo-900 uppercase">
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 text-indigo-700">
                              <path fillRule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z" clipRule="evenodd" />
                            </svg>
                            {fundLabel || "What we fund"}
                          </Sub2>
                          <ul role="list" className="mt-4 space-y-3">
                            {fund.map((f, j) => (
                              <li key={j} className="flex gap-3 text-base leading-7 text-pretty text-neutral-800">
                                <span aria-hidden="true" className="mt-3 h-px w-3 shrink-0 bg-indigo-600" />
                                <span className="min-w-0">{f}</span>
                              </li>
                            ))}
                          </ul>
                        </div>
                      ) : null}
                      {dont.length ? (
                        <div className="rounded-2xl p-6 ring-1 ring-neutral-200 ring-inset sm:p-7">
                          <Sub2 className="flex items-center gap-2 text-sm font-semibold tracking-wide text-neutral-800 uppercase">
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 text-neutral-500">
                              <path fillRule="evenodd" d="M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z" clipRule="evenodd" />
                            </svg>
                            {dontFundLabel || "What we don't fund"}
                          </Sub2>
                          <ul role="list" className="mt-4 space-y-3">
                            {dont.map((f, j) => (
                              <li key={j} className="flex gap-3 text-base leading-7 text-pretty text-neutral-600">
                                <span aria-hidden="true" className="mt-3 h-px w-3 shrink-0 bg-neutral-400" />
                                <span className="min-w-0">{f}</span>
                              </li>
                            ))}
                          </ul>
                        </div>
                      ) : null}
                    </div>
                  </article>
                );
              })}
            </div>
          ) : null}

          {footnote ? <p className="mt-4 max-w-3xl border-t border-neutral-200 pt-6 text-sm leading-6 text-pretty text-neutral-600">{footnote}</p> : null}
        </div>
      </section>
    );
  },
};
```
