# Add the "Sponsorship Packages" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/sponsorship-packages) to this Pantheon Content Publisher (P1) Next.js project. Event or corporate sponsorship levels with price, benefits checklist, slots remaining and a sponsorship contact card.

## Steps

1. Create `components/puck/sponsorship-packages-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 { sponsorshipPackagesBlock } from "./components/puck/sponsorship-packages-block";`
3. Register it under `components` as `SponsorshipPackagesBlock: sponsorshipPackagesBlock`.
4. Add `"SponsorshipPackagesBlock"` 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/sponsorship-packages-block.tsx`

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

/**
 * Sponsorship Packages — event or corporate sponsorship levels as stacked rows: price,
 * benefits checklist, how many slots remain, and a link to claim one, plus a contact card
 * for the sponsorship lead.
 * Register: `SponsorshipPackagesBlock: sponsorshipPackagesBlock` in puck.config.tsx.
 */

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

export type SponsorshipPackagesProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  levels: { name: string; price: string; summary: string; benefits: string; total: string; remaining: string; href: string }[];
  leftLabel: string;
  soldOutLabel: string;
  claimLabel: string;
  contactHeading: string;
  contactName: string;
  contactTitle: string;
  contactEmail: string;
  contactPhone: string;
  note: string;
};

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

const toInt = (v?: string) => {
  const n = parseInt(String(v ?? "").replace(/[^0-9-]/g, ""), 10);
  return Number.isFinite(n) ? n : null;
};

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

export const sponsorshipPackagesBlock: ComponentConfig<SponsorshipPackagesProps> = {
  label: "Sponsorship Packages",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Like the event name and date. 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" },
    levels: {
      type: "array",
      label: "Sponsorship levels",
      min: 1,
      max: 8,
      getItemSummary: (item) => [item?.name, item?.price].filter(Boolean).join(" · ") || "Level",
      defaultItemProps: { name: "New level", price: "$1,000", summary: "", benefits: "Logo on event signage", total: "", remaining: "", href: "/sponsor/apply" },
      arrayFields: {
        name: { type: "text", label: "Level name" },
        price: { type: "text", label: "Price", metadata: { help: "Include the symbol, like $10,000." } },
        summary: { type: "textarea", label: "Summary", metadata: { help: "Optional. One line on who this level suits." } },
        benefits: { type: "textarea", label: "Benefits", metadata: { help: "One per line. Each shows with a checkmark." } },
        total: { type: "text", label: "Total slots", metadata: { help: "How many of this level exist. Leave blank for unlimited." } },
        remaining: { type: "text", label: "Slots left", metadata: { help: "How many are still open. 0 marks the level sold out." } },
        href: { type: "text", label: "Claim link", metadata: { help: "Your sponsor form with this level preselected, if it supports that." } },
      },
    },
    leftLabel: { type: "text", label: "Slots-left wording", metadata: { help: "Shown after the count, like left, to read 2 of 4 left." } },
    soldOutLabel: { type: "text", label: "Sold out text" },
    claimLabel: { type: "text", label: "Claim link text", metadata: { help: "Like Reserve. The level name is added for screen readers." } },
    contactHeading: { type: "text", label: "Contact heading", metadata: { help: "Leave blank and clear the contact name to hide the contact card." } },
    contactName: { type: "text", label: "Contact name" },
    contactTitle: { type: "text", label: "Contact title" },
    contactEmail: { type: "text", label: "Contact email" },
    contactPhone: { type: "text", label: "Contact phone" },
    note: { type: "textarea", label: "Small print", metadata: { help: "Tax deductibility, deadlines for logo inclusion, or in-kind options." } },
  },
  defaultProps: {
    eyebrow: "Harvest Table Gala · Saturday, Oct. 17",
    heading: "Sponsor a night that feeds the valley",
    headingLevel: "h2",
    intro: "Last year's gala funded 410,000 meals. Sponsors put their name in front of 400 community leaders and help us do it again.",
    levels: [
      {
        name: "Presenting Sponsor",
        price: "$25,000",
        summary: "Exclusive top billing for one partner.",
        benefits: "Name in the event title\nRemarks from the stage\nTwo reserved tables of ten\nFull-page program ad\nLogo on all event media",
        total: "1",
        remaining: "0",
        href: "/sponsor/apply?level=presenting",
      },
      {
        name: "Harvest Sponsor",
        price: "$10,000",
        summary: "Our most popular level for local businesses.",
        benefits: "One reserved table of ten\nHalf-page program ad\nLogo on step-and-repeat\nRecognition in our annual report",
        total: "4",
        remaining: "2",
        href: "/sponsor/apply?level=harvest",
      },
      {
        name: "Pantry Sponsor",
        price: "$5,000",
        summary: "",
        benefits: "Four event tickets\nQuarter-page program ad\nLogo on event slideshow",
        total: "8",
        remaining: "5",
        href: "/sponsor/apply?level=pantry",
      },
      {
        name: "Table Host",
        price: "$2,500",
        summary: "",
        benefits: "One table of eight\nName listed in the program",
        total: "",
        remaining: "",
        href: "/sponsor/apply?level=table",
      },
    ],
    leftLabel: "left",
    soldOutLabel: "Sold out",
    claimLabel: "Reserve",
    contactHeading: "Questions about sponsoring?",
    contactName: "Camila Duarte",
    contactTitle: "Director of Development",
    contactEmail: "sponsors@larkspurfood.org",
    contactPhone: "(555) 014-2290",
    note: "Larkspur Valley Food Bank is a 501(c)(3) nonprofit. The deductible portion of each sponsorship is its price minus the fair market value of meals and tickets. Logo deadline: Sept. 26.",
  },
  render: ({ heading, headingLevel, eyebrow, intro, levels, leftLabel, soldOutLabel, claimLabel, contactHeading, contactName, contactTitle, contactEmail, contactPhone, note }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const list = (levels ?? []).filter((l) => l?.name);
    const showContact = Boolean(contactName || contactEmail || contactPhone);
    const tel = (contactPhone || "").replace(/[^0-9+]/g, "");

    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">
          <div className="max-w-2xl">
            {eyebrow ? <p className="text-sm font-semibold text-indigo-700">{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>

          {list.length ? (
            <ul role="list" className="mt-12 divide-y divide-neutral-200 border-y border-neutral-200 lg:mt-14">
              {list.map((l, i) => {
                const total = toInt(l.total);
                const remaining = toInt(l.remaining);
                const soldOut = remaining !== null && remaining <= 0;
                const benefits = (l.benefits || "")
                  .split("\n")
                  .map((b) => b.trim())
                  .filter(Boolean);
                const showSlots = total !== null && total > 0 && total <= 12 && remaining !== null;
                return (
                  <li key={`${l.name}-${i}`} className="grid grid-cols-1 gap-6 py-8 sm:py-10 lg:grid-cols-12 lg:gap-10">
                    <div className="lg:col-span-4">
                      <Sub className={`text-xl font-semibold tracking-tight ${soldOut ? "text-neutral-600" : "text-neutral-950"}`}>{l.name}</Sub>
                      {l.price ? (
                        <p className={`mt-2 text-4xl font-semibold tracking-tight tabular-nums ${soldOut ? "text-neutral-500 line-through decoration-2" : "text-neutral-950"}`}>
                          {l.price}
                        </p>
                      ) : null}
                      {l.summary ? <p className="mt-3 text-sm leading-6 text-neutral-600">{l.summary}</p> : null}
                    </div>

                    <div className="lg:col-span-5">
                      {benefits.length ? (
                        <ul role="list" className="grid grid-cols-1 gap-x-6 gap-y-2.5 text-sm leading-6 text-neutral-700 sm:grid-cols-2 lg:grid-cols-1">
                          {benefits.map((b, j) => (
                            <li key={`${b}-${j}`} className="flex gap-2.5">
                              <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className={`mt-0.5 size-5 shrink-0 ${soldOut ? "text-neutral-400" : "text-indigo-600"}`}>
                                <path fillRule="evenodd" d={check} clipRule="evenodd" />
                              </svg>
                              {b}
                            </li>
                          ))}
                        </ul>
                      ) : null}
                    </div>

                    <div className="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between lg:col-span-3 lg:flex-col lg:items-stretch lg:justify-start">
                      {soldOut ? (
                        <p className="inline-flex w-fit items-center gap-2 rounded-full bg-neutral-100 px-3 py-1 text-sm font-semibold text-neutral-700">
                          <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4">
                            <path d="M6.28 5.22a.75.75 0 0 0-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 1 0 1.06 1.06L10 11.06l3.72 3.72a.75.75 0 1 0 1.06-1.06L11.06 10l3.72-3.72a.75.75 0 0 0-1.06-1.06L10 8.94 6.28 5.22Z" />
                          </svg>
                          {soldOutLabel || "Sold out"}
                        </p>
                      ) : remaining !== null ? (
                        <div>
                          <p className="text-sm font-semibold text-neutral-950 tabular-nums">
                            {total !== null ? `${remaining} of ${total}` : remaining} {leftLabel || "left"}
                          </p>
                          {showSlots ? (
                            <div aria-hidden="true" className="mt-2 flex flex-wrap gap-1.5">
                              {Array.from({ length: total }, (_, k) => (
                                <span key={k} className={`h-2 w-5 rounded-full ${k < total - remaining ? "bg-neutral-300" : "bg-indigo-600"}`} />
                              ))}
                            </div>
                          ) : null}
                        </div>
                      ) : (
                        <span className="hidden lg:block" />
                      )}
                      {!soldOut && claimLabel ? (
                        <a
                          href={l.href || "#"}
                          className="inline-flex min-h-11 items-center justify-center gap-2 rounded-lg bg-neutral-950 px-5 py-2.5 text-sm font-semibold text-white transition hover:bg-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                        >
                          {claimLabel}
                          <span className="sr-only">: {l.name}</span>
                        </a>
                      ) : null}
                    </div>
                  </li>
                );
              })}
            </ul>
          ) : null}

          {showContact || note ? (
            <div className="mt-12 grid grid-cols-1 gap-8 lg:grid-cols-12 lg:gap-10">
              {showContact ? (
                <div className="rounded-2xl bg-indigo-50 p-6 ring-1 ring-indigo-600/15 ring-inset sm:p-8 lg:col-span-5">
                  {contactHeading ? <p className="text-base font-semibold text-indigo-950">{contactHeading}</p> : null}
                  {contactName ? (
                    <p className={`text-neutral-950 ${contactHeading ? "mt-4" : ""}`}>
                      <span className="font-semibold">{contactName}</span>
                      {contactTitle ? <span className="block text-sm text-neutral-600">{contactTitle}</span> : null}
                    </p>
                  ) : null}
                  <div className="mt-3 flex flex-col gap-1 text-sm">
                    {contactEmail ? (
                      <a href={`mailto:${contactEmail}`} className="inline-flex min-h-11 max-w-full items-center gap-2 font-semibold break-all text-indigo-700 hover:text-indigo-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
                        <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>
                        {contactEmail}
                      </a>
                    ) : null}
                    {contactPhone ? (
                      <a href={`tel:${tel}`} className="inline-flex min-h-11 items-center gap-2 font-semibold text-indigo-700 hover:text-indigo-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600">
                        <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0">
                          <path fillRule="evenodd" d="M2 3.5A1.5 1.5 0 0 1 3.5 2h1.148a1.5 1.5 0 0 1 1.465 1.175l.513 2.31a1.5 1.5 0 0 1-1.052 1.767l-.933.267c-.41.117-.643.555-.48.95a11.542 11.542 0 0 0 6.254 6.254c.395.163.833-.07.95-.48l.267-.933a1.5 1.5 0 0 1 1.767-1.052l2.31.513A1.5 1.5 0 0 1 18 15.352V16.5a1.5 1.5 0 0 1-1.5 1.5H15c-1.149 0-2.263-.15-3.326-.43A13.022 13.022 0 0 1 2.43 8.326 13.019 13.019 0 0 1 2 5V3.5Z" clipRule="evenodd" />
                        </svg>
                        {contactPhone}
                      </a>
                    ) : null}
                  </div>
                </div>
              ) : null}
              {note ? <p className={`text-sm leading-6 text-pretty text-neutral-600 ${showContact ? "lg:col-span-7 lg:pt-2" : "lg:col-span-12"}`}>{note}</p> : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
