# Add the "Admissions Deadlines" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/admissions-deadlines) to this Pantheon Content Publisher (P1) Next.js project. Application rounds with deadline, decision release and a labeled open, closing soon or closed status.

## Steps

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

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

// spec: status-colors

/**
 * Admissions Deadlines — application rounds with deadline, decision date and a labeled
 * open / closing soon / closed status. Rows stack into cards on mobile.
 * Register: `AdmissionsDeadlinesBlock: admissionsDeadlinesBlock` in puck.config.tsx.
 */

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

type Status = "open" | "closing" | "closed";

type Round = {
  name: string;
  deadline: string;
  isoDate: string;
  decision: string;
  note: string;
  status: Status;
};

export type AdmissionsDeadlinesProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  rounds: Round[];
  timezoneNote: string;
  ctaLabel: string;
  ctaHref: string;
  secondaryLabel: string;
  secondaryHref: string;
};

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

const statusStyles: Record<Status, { label: string; pill: string; dot: string }> = {
  open: { label: "Open", pill: "bg-emerald-50 text-emerald-800 ring-emerald-600/20", dot: "bg-emerald-600" },
  closing: { label: "Closing soon", pill: "bg-amber-50 text-amber-900 ring-amber-600/25", dot: "bg-amber-500" },
  closed: { label: "Closed", pill: "bg-neutral-100 text-neutral-700 ring-neutral-500/20", dot: "bg-neutral-400" },
};

const isoPattern = /^\d{4}-\d{2}-\d{2}/;

export const admissionsDeadlinesBlock: ComponentConfig<AdmissionsDeadlinesProps> = {
  label: "Admissions Deadlines",
  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" },
    rounds: {
      type: "array",
      label: "Application rounds",
      min: 1,
      max: 8,
      getItemSummary: (item) => `${item?.name || "Round"}${item?.deadline ? ` · ${item.deadline}` : ""}`,
      defaultItemProps: {
        name: "New round",
        deadline: "March 1, 2027",
        isoDate: "2027-03-01",
        decision: "April 1, 2027",
        note: "",
        status: "open",
      },
      arrayFields: {
        name: { type: "text", label: "Round name", metadata: { help: "Such as Early Action or Regular Decision." } },
        deadline: { type: "text", label: "Deadline", metadata: { help: "Type it as it should appear, such as November 1, 2026." } },
        isoDate: {
          type: "text",
          label: "Deadline (machine date)",
          metadata: { help: "Optional. The same date as YYYY-MM-DD so browsers and search engines can read it. Leave blank if unsure." },
        },
        decision: { type: "text", label: "Decisions released", metadata: { help: "Such as Mid-December. Leave blank to hide it." } },
        note: { type: "textarea", label: "Note", metadata: { help: "One short line, such as Non-binding. Leave blank to hide it." } },
        status: {
          type: "select",
          label: "Status",
          options: [
            { label: "Open", value: "open" },
            { label: "Closing soon", value: "closing" },
            { label: "Closed", value: "closed" },
          ],
          metadata: { help: "Update this by hand as deadlines pass. It doesn't change on its own." },
        },
      },
    },
    timezoneNote: { type: "text", label: "Fine print", metadata: { help: "Shown under the list, such as the time zone deadlines use. Leave blank to hide it." } },
    ctaLabel: { type: "text", label: "Button text" },
    ctaHref: { type: "text", label: "Button link", metadata: { help: "A path (/apply), full URL, #anchor, mailto: or tel:." } },
    secondaryLabel: { type: "text", label: "Secondary link text", metadata: { help: "Leave blank to hide it." } },
    secondaryHref: { type: "text", label: "Secondary link" },
  },
  defaultProps: {
    heading: "First-year application deadlines",
    headingLevel: "h2",
    intro: "Apply in the round that fits your timeline. Every round gets the same careful review and full consideration for merit scholarships.",
    rounds: [
      {
        name: "Early Action",
        deadline: "November 1, 2026",
        isoDate: "2026-11-01",
        decision: "By December 15",
        note: "Non-binding. Apply early and keep your options open until May 1.",
        status: "closed",
      },
      {
        name: "Early Action II",
        deadline: "December 1, 2026",
        isoDate: "2026-12-01",
        decision: "By January 31",
        note: "Same priority scholarship review as Early Action.",
        status: "closing",
      },
      {
        name: "Regular Decision",
        deadline: "February 1, 2027",
        isoDate: "2027-02-01",
        decision: "By March 20",
        note: "",
        status: "open",
      },
      {
        name: "Rolling Admission",
        deadline: "July 15, 2027",
        isoDate: "2027-07-15",
        decision: "Within three weeks",
        note: "Reviewed as received while space remains in the entering class.",
        status: "open",
      },
    ],
    timezoneNote: "Applications are due by 11:59 p.m. Central Time on the deadline date.",
    ctaLabel: "Start your application",
    ctaHref: "/apply",
    secondaryLabel: "Transfer deadlines",
    secondaryHref: "/admissions/transfer",
  },
  render: ({ heading, headingLevel, intro, rounds, timezoneNote, ctaLabel, ctaHref, secondaryLabel, secondaryHref }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (rounds ?? []).filter((r) => r?.name);
    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 max-w-5xl">
          {heading || intro ? (
            <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}
          {list.length ? (
            <ol role="list" className={`overflow-hidden rounded-2xl bg-white shadow-sm ring-1 ring-neutral-200 ${heading || intro ? "mt-10 sm:mt-12" : ""}`}>
              {list.map((round, i) => {
                const status = statusStyles[round.status] ?? statusStyles.open;
                const closed = round.status === "closed";
                const iso = round.isoDate && isoPattern.test(round.isoDate.trim()) ? round.isoDate.trim() : "";
                return (
                  <li
                    key={`${round.name}-${i}`}
                    className={`grid gap-4 border-neutral-200 p-5 sm:grid-cols-12 sm:items-center sm:gap-6 sm:px-8 sm:py-7 ${i > 0 ? "border-t" : ""} ${closed ? "bg-neutral-50/60" : ""}`}
                  >
                    <div className="sm:col-span-5">
                      <div className="flex flex-wrap items-center gap-x-3 gap-y-2">
                        <Sub className={`text-lg leading-7 font-semibold ${closed ? "text-neutral-600" : "text-neutral-950"}`}>{round.name}</Sub>
                        <p className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-xs leading-5 font-semibold ring-1 ring-inset sm:hidden ${status.pill}`}>
                          <span aria-hidden="true" className={`size-1.5 rounded-full ${status.dot}`} />
                          {status.label}
                        </p>
                      </div>
                      {round.note ? <p className="mt-1 text-sm leading-6 text-pretty text-neutral-600">{round.note}</p> : null}
                    </div>
                    <dl className="grid grid-cols-2 gap-4 border-t border-neutral-100 pt-4 sm:col-span-5 sm:border-0 sm:pt-0">
                      {round.deadline ? (
                        <div>
                          <dt className="text-xs font-semibold tracking-wide text-neutral-600 uppercase">Deadline</dt>
                          <dd className={`mt-1 text-base font-semibold tabular-nums ${closed ? "text-neutral-600 line-through decoration-neutral-400" : "text-neutral-950"}`}>
                            {iso ? <time dateTime={iso}>{round.deadline}</time> : round.deadline}
                          </dd>
                        </div>
                      ) : null}
                      {round.decision ? (
                        <div>
                          <dt className="text-xs font-semibold tracking-wide text-neutral-600 uppercase">Decisions</dt>
                          <dd className="mt-1 text-base text-neutral-700 tabular-nums">{round.decision}</dd>
                        </div>
                      ) : null}
                    </dl>
                    <div className="hidden sm:col-span-2 sm:flex sm:justify-end">
                      <p className={`inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs leading-5 font-semibold whitespace-nowrap ring-1 ring-inset ${status.pill}`}>
                        <span aria-hidden="true" className={`size-1.5 rounded-full ${status.dot}`} />
                        {status.label}
                      </p>
                    </div>
                  </li>
                );
              })}
            </ol>
          ) : null}
          {timezoneNote || ctaLabel || secondaryLabel ? (
            <div className="mt-8 flex flex-col gap-6 sm:flex-row sm:items-center sm:justify-between">
              {timezoneNote ? <p className="max-w-md text-sm leading-6 text-pretty text-neutral-600">{timezoneNote}</p> : <span />}
              {ctaLabel || secondaryLabel ? (
                <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6">
                  {secondaryLabel ? (
                    <a
                      href={secondaryHref || "#"}
                      className="inline-flex min-h-11 items-center justify-center rounded-lg px-1 text-base font-semibold text-neutral-900 underline decoration-neutral-300 underline-offset-4 hover:decoration-neutral-900 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 sm:order-first"
                    >
                      {secondaryLabel}
                    </a>
                  ) : null}
                  {ctaLabel ? (
                    <a
                      href={ctaHref || "#"}
                      className="inline-flex min-h-11 items-center justify-center rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                    >
                      {ctaLabel}
                    </a>
                  ) : null}
                </div>
              ) : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
