# Add the "Registration Help" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/registration-help) to this Pantheon Content Publisher (P1) Next.js project. Numbered sign-up steps, what you'll need, fee assistance, the refund policy and who to call for help.

## Steps

1. Create `components/puck/registration-help-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 { registrationHelpBlock } from "./components/puck/registration-help-block";`
3. Register it under `components` as `RegistrationHelpBlock: registrationHelpBlock`.
4. Add `"RegistrationHelpBlock"` 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/registration-help-block.tsx`

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

/**
 * Registration Help — "how to register" for park district programs: numbered steps, what
 * you'll need, the fee assistance program (eligibility, how to apply, discount), the refund
 * policy in a disclosure, and who to call for help, with hours.
 * Register: `RegistrationHelpBlock: registrationHelpBlock` in puck.config.tsx.
 */

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

export type RegistrationHelpProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  steps: { title: string; body: string; linkLabel: string; linkHref: string }[];
  needsHeading: string;
  needs: string;
  aidHeading: string;
  aidDiscount: string;
  aidText: string;
  aidEligibility: string;
  aidHowTo: string;
  aidLabel: string;
  aidHref: string;
  refundHeading: string;
  refundPolicy: string;
  helpHeading: string;
  helpText: string;
  phone: string;
  email: string;
  hours: string;
};

const down = { h1: "h2", h2: "h3", h3: "h4", h4: "h5", h5: "h6" } as const;

const focusRing = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700";

const lines = (text?: string) =>
  (text || "")
    .split("\n")
    .map((l) => l.trim())
    .filter(Boolean);

const check = (
  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="h-6 w-5 flex-none text-indigo-600">
    <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>
);

export const registrationHelpBlock: ComponentConfig<RegistrationHelpProps> = {
  label: "Registration Help",
  fields: {
    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." } },
    steps: {
      type: "array",
      label: "Steps",
      min: 1,
      max: 6,
      getItemSummary: (item, i) => `${typeof i === "number" ? `${i + 1}. ` : ""}${item?.title || "Step"}`,
      defaultItemProps: { title: "New step", body: "", linkLabel: "", linkHref: "" },
      arrayFields: {
        title: { type: "text", label: "Title" },
        body: { type: "textarea", label: "Description" },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Optional. Leave blank to hide the link." } },
        linkHref: { type: "text", label: "Link" },
      },
    },
    needsHeading: { type: "text", label: "What you need heading", metadata: { help: "Leave blank to use What you'll need." } },
    needs: { type: "textarea", label: "What you need", metadata: { help: "One item per line. Leave blank to hide the list." } },
    aidHeading: { type: "text", label: "Fee assistance heading", metadata: { help: "Leave blank to hide the fee assistance panel." } },
    aidDiscount: { type: "text", label: "Discount", metadata: { help: "Shown large, like Up to 80% off." } },
    aidText: { type: "textarea", label: "Fee assistance intro" },
    aidEligibility: { type: "textarea", label: "Who qualifies", metadata: { help: "One rule per line. Leave blank to hide it." } },
    aidHowTo: { type: "textarea", label: "How to apply", metadata: { help: "One step per line. Leave blank to hide it." } },
    aidLabel: { type: "text", label: "Apply link text" },
    aidHref: { type: "text", label: "Apply link" },
    refundHeading: { type: "text", label: "Refund policy heading", metadata: { help: "Leave blank to use Refund and transfer policy." } },
    refundPolicy: { type: "textarea", label: "Refund policy", metadata: { help: "One rule per line. Shown in an expandable section. Leave blank to hide it." } },
    helpHeading: { type: "text", label: "Help heading", metadata: { help: "Leave blank to hide the help contact." } },
    helpText: { type: "textarea", label: "Help text" },
    phone: { type: "text", label: "Phone", metadata: { help: "As it should appear, like 555-0130." } },
    email: { type: "text", label: "Email" },
    hours: { type: "textarea", label: "Hours", metadata: { help: "One line per day range, written as Days | Hours. Example: Mon–Fri | 8 a.m. to 6 p.m." } },
  },
  defaultProps: {
    heading: "How to register",
    headingLevel: "h2",
    intro: "Sign up for classes, camps and leagues online in a few minutes. You only need to set up your account once; after that, registering takes about two minutes.",
    steps: [
      {
        title: "Create your account",
        body: "Use your email address and pick a password. One account covers your whole household.",
        linkLabel: "Create an account",
        linkHref: "/register/new-account",
      },
      {
        title: "Add your household",
        body: "Add each person who will take part, with their birth date, so we can show programs that fit their age.",
        linkLabel: "",
        linkHref: "",
      },
      {
        title: "Browse and pick",
        body: "Search by age, day or location, then add programs to your cart. Spots are held for 20 minutes.",
        linkLabel: "Browse programs",
        linkHref: "/register",
      },
      {
        title: "Check out",
        body: "Pay by card, or apply your fee assistance discount. You'll get a receipt and reminders by email.",
        linkLabel: "",
        linkHref: "",
      },
    ],
    needsHeading: "What you'll need",
    needs: "An email address you check\nBirth dates for everyone you're registering\nAn emergency contact who isn't registering\nProof of address the first time (a utility bill or lease)\nA debit or credit card, unless you have fee assistance",
    aidHeading: "Fee assistance",
    aidDiscount: "Up to 80% off",
    aidText: "Play It Forward helps Cedar Valley households pay for programs, camps, passes and swim lessons. Nobody is turned away because they can't pay.",
    aidEligibility: "You live in the Cedar Valley Park District\nYour household gets SNAP, WIC, Medicaid or free or reduced-price school meals, or meets the income guidelines\nAid renews each January",
    aidHowTo: "Fill out the short form online or at any rec center\nUpload or bring one proof of eligibility\nWe'll email your discount within five business days",
    aidLabel: "Apply for fee assistance",
    aidHref: "/register/fee-assistance",
    refundHeading: "Refund and transfer policy",
    refundPolicy:
      "Full refund if you cancel 7 or more days before the first class, minus a $5 processing fee.\nWithin 7 days of the start, you get a credit to your account instead of a refund.\nNo refunds after a program starts, except for medical reasons with a doctor's note.\nIf we cancel a program, you get a full refund automatically.\nYou can transfer to another session of the same program at no cost, if there's room.",
    helpHeading: "Need help registering?",
    helpText: "Our registration team can sign you up over the phone or walk you through the website.",
    phone: "555-0130",
    email: "register@cedarvalleyparks.example.org",
    hours: "Mon–Fri | 8 a.m. to 6 p.m.\nSaturday | 9 a.m. to 1 p.m.\nSunday | Closed",
  },
  render: ({
    id,
    heading,
    headingLevel,
    intro,
    steps,
    needsHeading,
    needs,
    aidHeading,
    aidDiscount,
    aidText,
    aidEligibility,
    aidHowTo,
    aidLabel,
    aidHref,
    refundHeading,
    refundPolicy,
    helpHeading,
    helpText,
    phone,
    email,
    hours,
  }) => {
    const H = headingLevel || "h2";
    const Sub = down[H] || "h3";
    const Minor = down[Sub] || "h4";
    const base = id || "registration-help";
    const stepList = (steps ?? []).filter((s) => s?.title);
    const needList = lines(needs);
    const eligibility = lines(aidEligibility);
    const howTo = lines(aidHowTo);
    const refunds = lines(refundPolicy);
    const hourList = lines(hours).map((l) => {
      const [days, ...rest] = l.split("|");
      return { days: days.trim(), time: rest.join("|").trim() };
    });
    const telHref = phone ? `tel:${phone.replace(/[^\d+]/g, "")}` : "";
    const hasHeader = Boolean(heading || intro);
    const stepCols = stepList.length >= 4 ? "lg:grid-cols-4" : stepList.length === 3 ? "lg:grid-cols-3" : stepList.length === 2 ? "sm:grid-cols-2" : "";

    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-2xl">
              {heading ? <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">{heading}</H> : null}
              {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {stepList.length ? (
            <ol role="list" className={`grid grid-cols-1 gap-x-8 gap-y-10 sm:grid-cols-2 ${stepCols} ${hasHeader ? "mt-12 sm:mt-14" : ""}`}>
              {stepList.map((s, i) => (
                <li key={`${s.title}-${i}`} className="relative border-t-2 border-neutral-200 pt-6">
                  <span aria-hidden="true" className="absolute -top-0.5 left-0 h-0.5 w-12 bg-indigo-600" />
                  <p className="text-sm font-semibold text-indigo-700 tabular-nums">
                    <span className="sr-only">Step </span>
                    {String(i + 1).padStart(2, "0")}
                  </p>
                  <Sub className="mt-2 text-lg font-semibold tracking-tight text-pretty text-neutral-950">{s.title}</Sub>
                  {s.body ? <p className="mt-2 text-sm leading-6 text-pretty text-neutral-600">{s.body}</p> : null}
                  {s.linkLabel ? (
                    <a
                      href={s.linkHref || "#"}
                      className={`group mt-3 inline-flex min-h-11 items-center gap-1.5 rounded text-sm font-semibold text-indigo-700 hover:text-indigo-900 ${focusRing}`}
                    >
                      {s.linkLabel}
                      <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 shrink-0 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}
                </li>
              ))}
            </ol>
          ) : null}

          {needList.length || aidHeading ? (
            <div className={`grid grid-cols-1 gap-8 lg:grid-cols-12 lg:gap-12 ${hasHeader || stepList.length ? "mt-14 sm:mt-20" : ""}`}>
              {needList.length ? (
                <div className={aidHeading ? "lg:col-span-5" : "lg:col-span-12"}>
                  <Sub id={`${base}-needs`} className="text-xl font-semibold tracking-tight text-neutral-950">
                    {needsHeading || "What you'll need"}
                  </Sub>
                  <ul role="list" aria-labelledby={`${base}-needs`} className="mt-5 space-y-3 text-base leading-7 text-neutral-700">
                    {needList.map((n, i) => (
                      <li key={`${n}-${i}`} className="flex gap-3">
                        {check}
                        <span className="text-pretty">{n}</span>
                      </li>
                    ))}
                  </ul>
                </div>
              ) : null}

              {aidHeading ? (
                <div className={`rounded-3xl bg-indigo-50 p-6 ring-1 ring-indigo-100 sm:p-8 lg:p-10 ${needList.length ? "lg:col-span-7" : "lg:col-span-12"}`}>
                  <div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between">
                    <div>
                      <Sub className="text-xl font-semibold tracking-tight text-neutral-950">{aidHeading}</Sub>
                      {aidText ? <p className="mt-2 max-w-lg text-base leading-7 text-pretty text-neutral-700">{aidText}</p> : null}
                    </div>
                    {aidDiscount ? (
                      <p className="shrink-0 rounded-2xl bg-white px-4 py-3 text-2xl font-semibold tracking-tight text-indigo-800 shadow-sm ring-1 ring-indigo-200 sm:text-right">
                        {aidDiscount}
                      </p>
                    ) : null}
                  </div>
                  {eligibility.length || howTo.length ? (
                    <div className="mt-8 grid grid-cols-1 gap-8 border-t border-indigo-200 pt-8 sm:grid-cols-2">
                      {eligibility.length ? (
                        <div>
                          <Minor className="text-sm font-semibold text-neutral-950">Who qualifies</Minor>
                          <ul role="list" className="mt-3 space-y-2.5 text-sm leading-6 text-neutral-700">
                            {eligibility.map((e, i) => (
                              <li key={`${e}-${i}`} className="flex gap-3">
                                <span aria-hidden="true" className="mt-2.5 size-1.5 shrink-0 rounded-full bg-indigo-600" />
                                <span className="text-pretty">{e}</span>
                              </li>
                            ))}
                          </ul>
                        </div>
                      ) : null}
                      {howTo.length ? (
                        <div>
                          <Minor className="text-sm font-semibold text-neutral-950">How to apply</Minor>
                          <ol role="list" className="mt-3 space-y-2.5 text-sm leading-6 text-neutral-700">
                            {howTo.map((h, i) => (
                              <li key={`${h}-${i}`} className="flex gap-3">
                                <span aria-hidden="true" className="flex size-6 shrink-0 items-center justify-center rounded-full bg-indigo-700 text-xs font-semibold text-white tabular-nums">
                                  {i + 1}
                                </span>
                                <span className="text-pretty">{h}</span>
                              </li>
                            ))}
                          </ol>
                        </div>
                      ) : null}
                    </div>
                  ) : null}
                  {aidLabel ? (
                    <a
                      href={aidHref || "#"}
                      className={`mt-8 inline-flex min-h-11 w-full items-center justify-center rounded-lg bg-indigo-700 px-5 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-600 sm:w-auto ${focusRing}`}
                    >
                      {aidLabel}
                    </a>
                  ) : null}
                </div>
              ) : null}
            </div>
          ) : null}

          {refunds.length || helpHeading ? (
            <div className="mt-12 grid grid-cols-1 gap-8 sm:mt-16 lg:grid-cols-12 lg:gap-12">
              {refunds.length ? (
                <details className={`group self-start rounded-2xl ring-1 ring-neutral-200 ${helpHeading ? "lg:col-span-7" : "lg:col-span-12"}`}>
                  <summary
                    className={`flex min-h-14 cursor-pointer list-none items-center justify-between gap-4 rounded-2xl px-5 py-4 text-base font-semibold text-neutral-950 hover:bg-neutral-50 sm:px-6 [&::-webkit-details-marker]:hidden ${focusRing}`}
                  >
                    {refundHeading || "Refund and transfer policy"}
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 shrink-0 text-neutral-500 transition group-open:rotate-180">
                      <path fillRule="evenodd" d="M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z" clipRule="evenodd" />
                    </svg>
                  </summary>
                  <ul role="list" className="space-y-3 border-t border-neutral-200 px-5 py-5 text-sm leading-6 text-neutral-700 sm:px-6">
                    {refunds.map((r, i) => (
                      <li key={`${r}-${i}`} className="flex gap-3">
                        <span aria-hidden="true" className="mt-2.5 size-1.5 shrink-0 rounded-full bg-neutral-400" />
                        <span className="text-pretty">{r}</span>
                      </li>
                    ))}
                  </ul>
                </details>
              ) : null}

              {helpHeading ? (
                <aside aria-labelledby={`${base}-help`} className={`rounded-2xl bg-neutral-950 p-6 text-white sm:p-8 ${refunds.length ? "lg:col-span-5" : "lg:col-span-12"}`}>
                  <Sub id={`${base}-help`} className="text-xl font-semibold tracking-tight">
                    {helpHeading}
                  </Sub>
                  {helpText ? <p className="mt-2 text-sm leading-6 text-pretty text-neutral-300">{helpText}</p> : null}
                  {phone || email ? (
                    <ul role="list" className="mt-5 space-y-1">
                      {phone ? (
                        <li>
                          <a href={telHref} className="inline-flex min-h-11 items-center gap-3 rounded text-lg font-semibold text-white tabular-nums hover:text-indigo-200 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-5 shrink-0 text-indigo-300">
                              <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.02 1.756l-.97.33a11.04 11.04 0 0 0 6.293 6.293l.33-.97a1.5 1.5 0 0 1 1.756-1.02l2.31.513A1.5 1.5 0 0 1 18 14.852V16.5a1.5 1.5 0 0 1-1.5 1.5H15C7.82 18 2 12.18 2 5V3.5Z" clipRule="evenodd" />
                            </svg>
                            <span className="sr-only">Call </span>
                            {phone}
                          </a>
                        </li>
                      ) : null}
                      {email ? (
                        <li>
                          <a href={`mailto:${email}`} className="inline-flex min-h-11 max-w-full items-center gap-3 rounded text-sm font-semibold break-all text-white hover:text-indigo-200 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-5 shrink-0 text-indigo-300">
                              <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>
                            <span className="sr-only">Email </span>
                            {email}
                          </a>
                        </li>
                      ) : null}
                    </ul>
                  ) : null}
                  {hourList.length ? (
                    <dl className="mt-5 space-y-1.5 border-t border-white/15 pt-5 text-sm leading-6">
                      {hourList.map((h, i) => (
                        <div key={`${h.days}-${i}`} className="flex justify-between gap-4">
                          <dt className="text-neutral-300">{h.days}</dt>
                          <dd className="text-right font-semibold text-white tabular-nums">{h.time}</dd>
                        </div>
                      ))}
                    </dl>
                  ) : null}
                </aside>
              ) : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
