# Add the "Enrollment Steps" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/enrollment-steps) to this Pantheon Content Publisher (P1) Next.js project. Numbered new-student enrollment steps beside a documents checklist, kindergarten age note, office hours and language help.

## Steps

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

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

/**
 * Enrollment Steps — how to enroll a new student: numbered steps, a documents checklist,
 * a kindergarten age note, an enroll-online button, office hours and language help.
 * Register: `EnrollmentStepsBlock: enrollmentStepsBlock` in puck.config.tsx.
 */

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

type Step = { title: string; body: string; linkLabel: string; linkHref: string };

export type EnrollmentStepsProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  enrollLabel: string;
  enrollHref: string;
  steps: Step[];
  documentsHeading: string;
  documents: string;
  kindergartenNote: string;
  officeName: string;
  officeAddress: string;
  officeHours: string;
  officePhone: string;
  officeEmail: string;
  languageNote: string;
};

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

const icons = {
  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",
  check: "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",
  info: "M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",
  pin: "m9.69 18.933.003.001C9.89 19.02 10 19 10 19s.11.02.308-.066l.002-.001.006-.003.018-.008a5.741 5.741 0 0 0 .281-.14c.186-.096.446-.24.757-.433.62-.384 1.445-.966 2.274-1.765C15.302 14.988 17 12.493 17 9A7 7 0 1 0 3 9c0 3.492 1.698 5.988 3.355 7.584a13.731 13.731 0 0 0 2.273 1.765 11.842 11.842 0 0 0 .976.544l.062.029.018.008.006.003ZM10 11.25a2.25 2.25 0 1 0 0-4.5 2.25 2.25 0 0 0 0 4.5Z",
  clock: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z",
  phone: "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.33a.75.75 0 0 0-.41 1.03 11.5 11.5 0 0 0 5.663 5.663.75.75 0 0 0 1.03-.41l.33-.97a1.5 1.5 0 0 1 1.756-1.02l2.31.513A1.5 1.5 0 0 1 18 15.352V16.5a1.5 1.5 0 0 1-1.5 1.5H15c-7.18 0-13-5.82-13-13V3.5Z",
  mail: "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-2H3Zm16 4.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",
  chat: "M10 2c-2.236 0-4.43.18-6.57.524C1.993 2.755 1 4.014 1 5.426v5.148c0 1.413.993 2.67 2.43 2.902.848.137 1.705.248 2.57.331v3.443a.75.75 0 0 0 1.28.53l3.58-3.579a.78.78 0 0 1 .527-.224 41.202 41.202 0 0 0 5.183-.5c1.437-.232 2.43-1.49 2.43-2.903V5.426c0-1.413-.993-2.67-2.43-2.902A41.289 41.289 0 0 0 10 2Z",
};

function Icon({ d, className }: { d: string; className: string }) {
  return (
    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className={className}>
      <path fillRule="evenodd" d={d} clipRule="evenodd" />
    </svg>
  );
}

function parseDocs(raw: string) {
  return (raw || "")
    .split("\n")
    .map((line) => line.trim())
    .filter(Boolean)
    .map((line) => {
      const cut = line.indexOf("|");
      return cut === -1 ? { item: line, detail: "" } : { item: line.slice(0, cut).trim(), detail: line.slice(cut + 1).trim() };
    });
}

const contactLink =
  "inline-flex min-h-11 items-center gap-2.5 rounded-md text-sm font-semibold text-neutral-900 hover:text-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700";

export const enrollmentStepsBlock: ComponentConfig<EnrollmentStepsProps> = {
  label: "Enrollment Steps",
  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." } },
    enrollLabel: { type: "text", label: "Enroll button text", metadata: { help: "Leave blank to hide the button." } },
    enrollHref: { type: "text", label: "Enroll button link", metadata: { help: "Your online enrollment system." } },
    steps: {
      type: "array",
      label: "Steps",
      min: 1,
      max: 8,
      getItemSummary: (item, i) => (item?.title ? `${(i ?? 0) + 1}. ${item.title}` : "Step"),
      defaultItemProps: { title: "New step", body: "", linkLabel: "", linkHref: "" },
      arrayFields: {
        title: { type: "text", label: "Step" },
        body: { type: "textarea", label: "Details" },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to hide the link." } },
        linkHref: { type: "text", label: "Link" },
      },
    },
    documentsHeading: { type: "text", label: "Documents heading", metadata: { help: "Leave blank to use \"Documents you'll need\"." } },
    documents: {
      type: "textarea",
      label: "Documents",
      metadata: { help: "One per line. Add details after a | character. Example: Birth certificate | Or a passport. Leave blank to hide the list." },
    },
    kindergartenNote: { type: "textarea", label: "Kindergarten note", metadata: { help: "Age cutoff and any exceptions. Leave blank to hide it." } },
    officeName: { type: "text", label: "Office name", metadata: { help: "Leave blank to hide the office card." } },
    officeAddress: { type: "textarea", label: "Office address" },
    officeHours: { type: "textarea", label: "Office hours", metadata: { help: "One line per set of days." } },
    officePhone: { type: "text", label: "Office phone" },
    officeEmail: { type: "text", label: "Office email" },
    languageNote: { type: "textarea", label: "Language help", metadata: { help: "How families can get an interpreter or translated forms. Leave blank to hide it." } },
  },
  defaultProps: {
    heading: "Enroll a new student",
    headingLevel: "h2",
    intro: "New to Riverbend? Welcome. Most families finish enrollment online in about 30 minutes, and your school will reach out within three school days.",
    enrollLabel: "Start enrolling online",
    enrollHref: "/enroll/start",
    steps: [
      { title: "Find your school", body: "Your home address decides which school your child attends. Look it up before you start.", linkLabel: "Find your school by address", linkHref: "/schools/boundary-lookup" },
      { title: "Gather your documents", body: "Take a photo or scan of each one. Phone pictures are fine as long as the words are easy to read.", linkLabel: "", linkHref: "" },
      { title: "Fill out the online form", body: "Create a parent account and answer questions about your child, their health and past schools. You can save and come back later.", linkLabel: "", linkHref: "" },
      { title: "Hear from your school", body: "Within three school days, the school office will confirm a start date and your child's teacher or schedule.", linkLabel: "", linkHref: "" },
    ],
    documentsHeading: "Documents you'll need",
    documents:
      "Proof of address | A recent utility bill, lease or mortgage statement in your name\nYour child's birth certificate | Or a passport or other record of birth date\nImmunization records | From your doctor or your child's last school\nParent or guardian photo ID\nLast report card or transcript | Grades 1–12 only\nCustody papers | Only if they apply to your family",
    kindergartenNote: "Children must turn 5 on or before September 1, 2026 to start kindergarten this fall. Transitional kindergarten is open to children who turn 4 by the same date.",
    officeName: "Welcome Center",
    officeAddress: "District Office, 500 Main Street, Room 110, Riverbend",
    officeHours: "Monday–Friday, 8:00 a.m.–4:30 p.m.\nTuesdays until 6:30 p.m., August and January",
    officePhone: "555-0150",
    officeEmail: "enroll@riverbendusd.example.org",
    languageNote: "Free interpreters are available in any language. Forms come in English, Spanish, Vietnamese and Arabic. Ask at the Welcome Center or call us.",
  },
  render: ({
    id,
    heading,
    headingLevel,
    intro,
    enrollLabel,
    enrollHref,
    steps,
    documentsHeading,
    documents,
    kindergartenNote,
    officeName,
    officeAddress,
    officeHours,
    officePhone,
    officeEmail,
    languageNote,
  }) => {
    const H = headingLevel || "h2";
    const Sub = lower[H] || "h3";
    const uid = id || "enrollment-steps";
    const list = (steps ?? []).filter((s) => s?.title || s?.body);
    const docs = parseDocs(documents);
    const hours = (officeHours || "").split("\n").map((l) => l.trim()).filter(Boolean);
    const hasAside = Boolean(docs.length || kindergartenNote || officeName || languageNote);

    return (
      <section aria-labelledby={heading ? `${uid}-heading` : 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">
          {heading || intro || enrollLabel ? (
            <div className="flex flex-col gap-6 md:flex-row md:items-end md:justify-between md:gap-12">
              <div className="max-w-2xl">
                {heading ? (
                  <H id={`${uid}-heading`} 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>
              {enrollLabel ? (
                <a
                  href={enrollHref || "#"}
                  className="group inline-flex min-h-12 shrink-0 items-center gap-2 self-start rounded-lg bg-indigo-700 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-800 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700 md:self-auto"
                >
                  {enrollLabel}
                  <Icon d={icons.arrow} className="size-5 shrink-0 transition motion-safe:group-hover:translate-x-0.5" />
                </a>
              ) : null}
            </div>
          ) : null}

          <div className={`grid grid-cols-1 gap-10 lg:gap-14 ${hasAside ? "lg:grid-cols-5" : ""} ${heading || intro || enrollLabel ? "mt-12" : ""}`}>
            {list.length ? (
              <ol role="list" className={`relative space-y-8 ${hasAside ? "lg:col-span-3" : ""}`}>
                {list.map((s, i) => (
                  <li key={`${s.title}-${i}`} className="relative flex gap-4 sm:gap-6">
                    {i < list.length - 1 ? <span aria-hidden="true" className="absolute top-12 -bottom-8 left-5 w-px bg-neutral-200 sm:top-14 sm:left-6" /> : null}
                    <span aria-hidden="true" className="relative flex size-10 shrink-0 items-center justify-center rounded-full bg-indigo-50 text-base font-semibold text-indigo-800 ring-1 ring-indigo-200 tabular-nums sm:size-12 sm:text-lg">
                      {i + 1}
                    </span>
                    <div className="min-w-0 pt-1.5 sm:pt-2.5">
                      <Sub className="text-lg leading-7 font-semibold text-neutral-950">
                        <span className="sr-only">Step {i + 1}: </span>
                        {s.title}
                      </Sub>
                      {s.body ? <p className="mt-1.5 text-base leading-7 text-pretty text-neutral-600">{s.body}</p> : null}
                      {s.linkLabel ? (
                        <a
                          href={s.linkHref || "#"}
                          className="group mt-1 inline-flex min-h-11 items-center gap-1.5 rounded-md text-sm font-semibold text-indigo-700 hover:text-indigo-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-700"
                        >
                          {s.linkLabel}
                          <Icon d={icons.arrow} className="size-4 shrink-0 transition motion-safe:group-hover:translate-x-0.5" />
                        </a>
                      ) : null}
                    </div>
                  </li>
                ))}
              </ol>
            ) : null}

            {hasAside ? (
              <div className={`min-w-0 space-y-6 ${list.length ? "lg:col-span-2" : ""}`}>
                {docs.length ? (
                  <div className="rounded-2xl bg-neutral-50 p-6 ring-1 ring-neutral-200 sm:p-7">
                    <Sub className="text-base font-semibold text-neutral-950">{documentsHeading || "Documents you'll need"}</Sub>
                    <ul role="list" className="mt-4 space-y-3">
                      {docs.map((d, i) => (
                        <li key={i} className="flex gap-3">
                          <Icon d={icons.check} className="mt-0.5 size-5 shrink-0 text-indigo-700" />
                          <div className="min-w-0 text-sm leading-6">
                            <p className="font-medium text-neutral-950">{d.item}</p>
                            {d.detail ? <p className="text-pretty text-neutral-600">{d.detail}</p> : null}
                          </div>
                        </li>
                      ))}
                    </ul>
                    {kindergartenNote ? (
                      <div className="mt-6 flex gap-3 rounded-xl bg-white p-4 ring-1 ring-indigo-200">
                        <Icon d={icons.info} className="mt-0.5 size-5 shrink-0 text-indigo-700" />
                        <p className="text-sm leading-6 text-pretty text-neutral-800">
                          <span className="font-semibold text-neutral-950">Starting kindergarten? </span>
                          {kindergartenNote}
                        </p>
                      </div>
                    ) : null}
                  </div>
                ) : kindergartenNote ? (
                  <div className="flex gap-3 rounded-2xl bg-indigo-50 p-5 ring-1 ring-indigo-100">
                    <Icon d={icons.info} className="mt-0.5 size-5 shrink-0 text-indigo-700" />
                    <p className="text-sm leading-6 text-pretty text-indigo-950">
                      <span className="font-semibold">Starting kindergarten? </span>
                      {kindergartenNote}
                    </p>
                  </div>
                ) : null}

                {officeName || languageNote ? (
                  <div className="rounded-2xl p-6 ring-1 ring-neutral-200 sm:p-7">
                    {officeName ? (
                      <>
                        <Sub className="text-base font-semibold text-neutral-950">{officeName}</Sub>
                        <ul role="list" className="mt-3 space-y-2 text-sm leading-6 text-neutral-700">
                          {officeAddress ? (
                            <li className="flex gap-2.5">
                              <Icon d={icons.pin} className="mt-0.5 size-5 shrink-0 text-neutral-400" />
                              <span className="sr-only">Address: </span>
                              <span className="min-w-0 text-pretty">{officeAddress}</span>
                            </li>
                          ) : null}
                          {hours.length ? (
                            <li className="flex gap-2.5">
                              <Icon d={icons.clock} className="mt-0.5 size-5 shrink-0 text-neutral-400" />
                              <span className="sr-only">Hours: </span>
                              <span className="min-w-0">
                                {hours.map((h, i) => (
                                  <span key={i} className="block">
                                    {h}
                                  </span>
                                ))}
                              </span>
                            </li>
                          ) : null}
                        </ul>
                        {officePhone || officeEmail ? (
                          <div className="mt-2 flex flex-col">
                            {officePhone ? (
                              <a href={`tel:${officePhone.replace(/[^\d+]/g, "")}`} className={`${contactLink} tabular-nums`}>
                                <Icon d={icons.phone} className="size-5 shrink-0 text-indigo-700" />
                                {officePhone}
                              </a>
                            ) : null}
                            {officeEmail ? (
                              <a href={`mailto:${officeEmail}`} className={`${contactLink} break-all`}>
                                <Icon d={icons.mail} className="size-5 shrink-0 text-indigo-700" />
                                {officeEmail}
                              </a>
                            ) : null}
                          </div>
                        ) : null}
                      </>
                    ) : null}
                    {languageNote ? (
                      <div className={officeName ? "mt-5 border-t border-neutral-200 pt-5" : undefined}>
                        <p className="flex items-center gap-2 text-sm font-semibold text-neutral-950">
                          <Icon d={icons.chat} className="size-5 shrink-0 text-indigo-700" />
                          Help in your language
                        </p>
                        <p className="mt-1.5 text-sm leading-6 text-pretty text-neutral-700">{languageNote}</p>
                      </div>
                    ) : null}
                  </div>
                ) : null}
              </div>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
