# Add the "Tribute Gift" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/tribute-gift) to this Pantheon Content Publisher (P1) Next.js project. Give in honor or memory of someone, with a sample e-card and a short form that hands off to your donation page.

## Steps

1. Create `components/puck/tribute-gift-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 { tributeGiftBlock } from "./components/puck/tribute-gift-block";`
3. Register it under `components` as `TributeGiftBlock: tributeGiftBlock`.
4. Add `"TributeGiftBlock"` 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/tribute-gift-block.tsx`

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

/**
 * Tribute Gift — give in honor or in memory of someone: a short explanation, a sample of
 * the e-card the family receives, and a form (honoree, honor/memory, who to notify) that
 * hands off to your donation form.
 * Register: `TributeGiftBlock: tributeGiftBlock` in puck.config.tsx.
 */

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

export type TributeGiftProps = {
  heading: string;
  headingLevel: Heading;
  body: string;
  steps: { text: string }[];
  cardHonorLine: string;
  cardMemoryLine: string;
  cardExampleName: string;
  cardMessage: string;
  cardSignature: string;
  cardCaption: string;
  formHeading: string;
  honoreeLabel: string;
  typeLabel: string;
  honorLabel: string;
  memoryLabel: string;
  notifyLabel: string;
  notifyHelp: string;
  submitLabel: string;
  action: string;
  method: "get" | "post";
  privacyNote: string;
};

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

const inputClass =
  "block min-h-11 w-full rounded-lg bg-white px-3.5 py-2.5 text-base text-neutral-950 ring-1 ring-neutral-300 ring-inset placeholder:text-neutral-500 focus:ring-2 focus:ring-indigo-600 focus:outline-none sm:text-sm";

export const tributeGiftBlock: ComponentConfig<TributeGiftProps> = {
  label: "Tribute Gift",
  fields: {
    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." },
    },
    body: { type: "textarea", label: "Body" },
    steps: {
      type: "array",
      label: "How it works",
      min: 0,
      max: 4,
      getItemSummary: (item) => item?.text?.slice(0, 40) || "Step",
      defaultItemProps: { text: "Describe this step." },
      arrayFields: { text: { type: "textarea", label: "Step" } },
      metadata: { help: "Short numbered steps. Remove them all to hide the list." },
    },
    cardHonorLine: { type: "text", label: "E-card honor line", metadata: { help: "Like A gift has been made in honor of." } },
    cardMemoryLine: { type: "text", label: "E-card memory line", metadata: { help: "Like A gift has been made in loving memory of. The sample card shows this one." } },
    cardExampleName: { type: "text", label: "E-card sample name", metadata: { help: "A clearly made-up name for the sample card." } },
    cardMessage: { type: "textarea", label: "E-card message" },
    cardSignature: { type: "text", label: "E-card signature" },
    cardCaption: { type: "text", label: "E-card caption", metadata: { help: "Small text under the sample, like Sample e-card. Leave blank to hide the sample card." } },
    formHeading: { type: "text", label: "Form heading" },
    honoreeLabel: { type: "text", label: "Honoree field label" },
    typeLabel: { type: "text", label: "Tribute type label" },
    honorLabel: { type: "text", label: "Honor option" },
    memoryLabel: { type: "text", label: "Memory option" },
    notifyLabel: { type: "text", label: "Notify field label" },
    notifyHelp: { type: "text", label: "Notify field hint", metadata: { help: "Short hint under the email field. Leave blank to hide it." } },
    submitLabel: { type: "text", label: "Button text" },
    action: {
      type: "text",
      label: "Form action URL",
      metadata: { help: "Your donation form. It receives honoree, tribute_type (honor or memory) and notify_email." },
    },
    method: {
      type: "radio",
      label: "Send as",
      options: [
        { label: "Link (GET)", value: "get" },
        { label: "Form post (POST)", value: "post" },
      ],
      metadata: { help: "Choose Link if your donation form reads its prefill from the URL. Choose Form post if it expects a POST." },
    },
    privacyNote: { type: "textarea", label: "Privacy note", metadata: { help: "What you'll do with the email address. Leave blank to hide it." } },
  },
  defaultProps: {
    heading: "Give in honor or in memory",
    headingLevel: "h2",
    body: "Mark a birthday, a retirement or a life well lived with a gift that keeps young people learning. We'll send a card to whoever you choose. The gift amount stays private.",
    steps: [
      { text: "Tell us who the gift honors and who should hear about it." },
      { text: "Choose your amount on the next page." },
      { text: "We email a card within one business day." },
    ],
    cardHonorLine: "A gift has been made in honor of",
    cardMemoryLine: "A gift has been made in loving memory of",
    cardExampleName: "Ruth Ellen Calder",
    cardMessage: "Ruth spent forty years teaching third graders to love books. This gift helps another student find their first favorite.",
    cardSignature: "With love, the Calder family",
    cardCaption: "Sample e-card",
    formHeading: "Start your tribute gift",
    honoreeLabel: "Honoree's full name",
    typeLabel: "This gift is",
    honorLabel: "In honor of",
    memoryLabel: "In memory of",
    notifyLabel: "Send the card to (email)",
    notifyHelp: "Optional. Leave blank to skip the card.",
    submitLabel: "Continue to gift amount",
    action: "/donate/tribute",
    method: "get",
    privacyNote: "We use this address only to send the card. Cedar Hollow Literacy Project never sells or shares contact details.",
  },
  render: ({ id, heading, headingLevel, body, steps, cardHonorLine, cardMemoryLine, cardExampleName, cardMessage, cardSignature, cardCaption, formHeading, honoreeLabel, typeLabel, honorLabel, memoryLabel, notifyLabel, notifyHelp, submitLabel, action, method, privacyNote }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const list = (steps ?? []).filter((s) => s?.text);
    const uid = id || "tribute";
    const showCard = Boolean(cardCaption && cardExampleName);

    return (
      <section className="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-7xl grid-cols-1 gap-12 lg:grid-cols-2 lg:gap-16">
          <div>
            {heading ? <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">{heading}</H> : null}
            {body ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{body}</p> : null}

            {list.length ? (
              <ol role="list" className="mt-8 space-y-4">
                {list.map((s, i) => (
                  <li key={`${s.text}-${i}`} className="flex gap-4">
                    <span aria-hidden="true" className="grid size-8 shrink-0 place-items-center rounded-full bg-white text-sm font-semibold text-indigo-700 ring-1 ring-neutral-200 tabular-nums">
                      {i + 1}
                    </span>
                    <span className="pt-1 text-base leading-6 text-neutral-700">{s.text}</span>
                  </li>
                ))}
              </ol>
            ) : null}

            {showCard ? (
              <figure className="mt-12 sm:px-6">
                <div className="relative mx-auto max-w-md rounded-2xl bg-white p-2 shadow-xl ring-1 shadow-neutral-900/10 ring-neutral-200 sm:-rotate-2">
                  <div className="relative overflow-hidden rounded-xl border border-indigo-100 bg-indigo-50/60 px-6 py-8 text-center sm:px-10 sm:py-10">
                    <svg aria-hidden="true" viewBox="0 0 64 24" fill="none" stroke="currentColor" strokeWidth={1.5} strokeLinecap="round" className="mx-auto h-6 w-16 text-indigo-400">
                      <path d="M2 12h18M44 12h18" />
                      <path d="M32 4c-3 4-3 12 0 16 3-4 3-12 0-16Z" />
                      <path d="M26 8c0 5 3 9 6 12M38 8c0 5-3 9-6 12" />
                    </svg>
                    <p className="mt-5 text-xs font-semibold tracking-widest text-indigo-700 uppercase">{cardMemoryLine || cardHonorLine}</p>
                    <p className="mt-3 font-serif text-3xl tracking-tight text-neutral-950 italic">{cardExampleName}</p>
                    {cardMessage ? <p className="mt-5 text-sm leading-6 text-pretty text-neutral-700">{cardMessage}</p> : null}
                    {cardSignature ? <p className="mt-5 text-sm font-medium text-neutral-950">{cardSignature}</p> : null}
                  </div>
                </div>
                <figcaption className="mt-5 text-center text-sm text-neutral-600">{cardCaption}</figcaption>
              </figure>
            ) : null}
          </div>

          <div className="lg:pt-2">
            <form
              action={action || "#"}
              method={method === "post" ? "post" : "get"}
              aria-labelledby={formHeading ? `${uid}-form` : undefined}
              className="rounded-2xl bg-white p-6 shadow-sm ring-1 ring-neutral-200 sm:p-8 lg:sticky lg:top-8"
            >
              {formHeading ? (
                <Sub id={`${uid}-form`} className="text-xl font-semibold tracking-tight text-neutral-950">
                  {formHeading}
                </Sub>
              ) : null}

              <div className={`space-y-6 ${formHeading ? "mt-6" : ""}`}>
                <fieldset>
                  <legend className="text-sm font-semibold text-neutral-950">{typeLabel || "This gift is"}</legend>
                  <div className="mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2">
                    {[
                      { value: "honor", label: honorLabel || "In honor of" },
                      { value: "memory", label: memoryLabel || "In memory of" },
                    ].map((o, i) => (
                      <label
                        key={o.value}
                        htmlFor={`${uid}-type-${o.value}`}
                        className="flex min-h-12 cursor-pointer items-center gap-3 rounded-lg px-4 py-3 text-sm font-medium text-neutral-950 ring-1 ring-neutral-300 ring-inset has-checked:bg-indigo-50 has-checked:ring-2 has-checked:ring-indigo-600 has-focus-visible:outline-2 has-focus-visible:outline-offset-2 has-focus-visible:outline-indigo-600"
                      >
                        <input
                          id={`${uid}-type-${o.value}`}
                          type="radio"
                          name="tribute_type"
                          value={o.value}
                          defaultChecked={i === 0}
                          className="size-4 shrink-0 accent-indigo-600 focus:outline-none"
                        />
                        {o.label}
                      </label>
                    ))}
                  </div>
                </fieldset>

                <div>
                  <label htmlFor={`${uid}-honoree`} className="block text-sm font-semibold text-neutral-950">
                    {honoreeLabel || "Honoree's full name"}
                  </label>
                  <input id={`${uid}-honoree`} name="honoree" type="text" required autoComplete="off" className={`mt-2 ${inputClass}`} />
                </div>

                <div>
                  <label htmlFor={`${uid}-notify`} className="block text-sm font-semibold text-neutral-950">
                    {notifyLabel || "Send the card to (email)"}
                  </label>
                  <input
                    id={`${uid}-notify`}
                    name="notify_email"
                    type="email"
                    autoComplete="off"
                    aria-describedby={notifyHelp ? `${uid}-notify-help` : undefined}
                    className={`mt-2 ${inputClass}`}
                  />
                  {notifyHelp ? (
                    <p id={`${uid}-notify-help`} className="mt-2 text-sm text-neutral-600">
                      {notifyHelp}
                    </p>
                  ) : null}
                </div>

                <button
                  type="submit"
                  className="group inline-flex min-h-12 w-full items-center justify-center gap-2 rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white transition hover:bg-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                >
                  {submitLabel || "Continue"}
                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 transition 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>
                </button>

                {privacyNote ? (
                  <p className="flex gap-2 text-xs leading-5 text-neutral-600">
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-4 shrink-0 text-neutral-500">
                      <path fillRule="evenodd" d="M10 1a4.5 4.5 0 0 0-4.5 4.5V9H5a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2h-.5V5.5A4.5 4.5 0 0 0 10 1Zm3 8V5.5a3 3 0 1 0-6 0V9h6Z" clipRule="evenodd" />
                    </svg>
                    {privacyNote}
                  </p>
                ) : null}
              </div>
            </form>
          </div>
        </div>
      </section>
    );
  },
};
```
