# Add the "Orientation Picker" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/orientation-picker) to this Pantheon Content Publisher (P1) Next.js project. Orientation sessions as date cards with format, audience and labelled seat status, waitlist links when full, then student details.

## Steps

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

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

// spec: status-colors

/**
 * Orientation Picker — new students choose an orientation session from large date cards with
 * format, audience and a labelled seats status (full sessions link to a waitlist), then confirm
 * their details. A plain HTML form that posts to your orientation endpoint, no JavaScript.
 * Register: `OrientationPickerBlock: orientationPickerBlock` in puck.config.tsx.
 */

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

type Status = "open" | "limited" | "full";

type Session = {
  code: string;
  month: string;
  day: string;
  weekday: string;
  time: string;
  format: string;
  audience: string;
  status: Status;
  statusText: string;
};

export type OrientationPickerProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  formAction: string;
  sessions: Session[];
  waitlistHref: string;
  studentTypeOptions: string;
  maxGuests: string;
  submitLabel: string;
  footnote: string;
};

const inputClass =
  "block min-h-11 w-full rounded-lg border-0 bg-white px-3.5 py-2.5 text-base text-neutral-950 shadow-xs ring-1 ring-neutral-300 ring-inset placeholder:text-neutral-500 focus:ring-2 focus:ring-indigo-600 focus:outline-none";
const labelClass = "block text-sm leading-6 font-medium text-neutral-900";

const statusStyle: Record<Status, { badge: string; dot: string; fallback: string }> = {
  open: { badge: "bg-emerald-50 text-emerald-800 ring-emerald-600/20", dot: "bg-emerald-600", fallback: "Seats open" },
  limited: { badge: "bg-amber-50 text-amber-900 ring-amber-600/30", dot: "bg-amber-500", fallback: "Few seats left" },
  full: { badge: "bg-red-50 text-red-800 ring-red-600/20", dot: "bg-red-600", fallback: "Full" },
};

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

const Optional = () => <span className="font-normal text-neutral-600">(optional)</span>;

const StepLabel = ({ n, children }: { n: number; children: React.ReactNode }) => (
  <span className="flex items-center gap-3">
    <span aria-hidden="true" className="font-mono text-sm font-semibold text-indigo-700 tabular-nums">
      {String(n).padStart(2, "0")}
    </span>
    <span aria-hidden="true" className="h-px w-8 bg-indigo-300" />
    <span className="text-lg leading-7 font-semibold text-neutral-950">{children}</span>
  </span>
);

export const orientationPickerBlock: ComponentConfig<OrientationPickerProps> = {
  label: "Orientation Picker",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    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" },
    formAction: {
      type: "text",
      label: "Form action URL",
      metadata: {
        help: "Where the form is sent with POST. Field names: session, student_type, student_id, first_name, last_name, email, guests, dietary_needs, accommodations and guardian_consent.",
      },
    },
    sessions: {
      type: "array",
      label: "Sessions",
      min: 1,
      max: 12,
      getItemSummary: (item) => [item?.month, item?.day, item?.audience].filter(Boolean).join(" ") || "Session",
      defaultItemProps: { code: "", month: "Aug", day: "1", weekday: "Friday", time: "9 a.m. – 3 p.m.", format: "In person", audience: "First-year", status: "open", statusText: "" },
      arrayFields: {
        code: { type: "text", label: "Session code", metadata: { help: "Sent with the form. Leave blank to send the date and time instead." } },
        month: { type: "text", label: "Month", metadata: { help: "Short form, such as Jul." } },
        day: { type: "text", label: "Day", metadata: { help: "The day of the month, such as 14." } },
        weekday: { type: "text", label: "Weekday" },
        time: { type: "text", label: "Time" },
        format: { type: "text", label: "Format", metadata: { help: "Such as In person or Virtual." } },
        audience: { type: "text", label: "Who it's for", metadata: { help: "Such as First-year, Transfer or Families." } },
        status: {
          type: "select",
          label: "Status",
          options: [
            { label: "Open", value: "open" },
            { label: "Few seats left", value: "limited" },
            { label: "Full", value: "full" },
          ],
          metadata: { help: "Full sessions can't be picked and show a waitlist link instead." },
        },
        statusText: { type: "text", label: "Status text", metadata: { help: "Optional wording such as \"12 seats left\", or a data-source token. Defaults to the status name." } },
      },
    },
    waitlistHref: { type: "text", label: "Waitlist link", metadata: { help: "Where the \"join the waitlist\" link on full sessions goes. Leave blank to hide it." } },
    studentTypeOptions: { type: "textarea", label: "Student type options", metadata: { help: "One choice per line, such as entering class or year." } },
    maxGuests: { type: "text", label: "Most guests", metadata: { help: "How many family members or guests one student can bring, such as 2. Use 0 to hide the question." } },
    submitLabel: { type: "text", label: "Button text" },
    footnote: { type: "textarea", label: "Footnote", metadata: { help: "Small print under the button. Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "New Student Orientation",
    heading: "Pick your orientation day",
    headingLevel: "h2",
    intro: "Orientation is where you register for fall classes, get your student ID and meet your advisor. Every new student attends one session.",
    formAction: "/orientation/reserve",
    sessions: [
      { code: "NSO-0614", month: "Jun", day: "14", weekday: "Monday", time: "8:30 a.m. – 4 p.m.", format: "In person", audience: "First-year", status: "full", statusText: "" },
      { code: "NSO-0622", month: "Jun", day: "22", weekday: "Tuesday", time: "8:30 a.m. – 4 p.m.", format: "In person", audience: "First-year", status: "limited", statusText: "6 seats left" },
      { code: "NSO-0709", month: "Jul", day: "9", weekday: "Friday", time: "9 a.m. – 1 p.m.", format: "In person", audience: "Transfer", status: "open", statusText: "40 seats left" },
      { code: "NSO-0715", month: "Jul", day: "15", weekday: "Thursday", time: "6 – 8:30 p.m.", format: "Virtual", audience: "Transfer and adult learners", status: "open", statusText: "" },
      { code: "NSO-0729", month: "Jul", day: "29", weekday: "Thursday", time: "8:30 a.m. – 4 p.m.", format: "In person", audience: "First-year", status: "open", statusText: "52 seats left" },
      { code: "NSO-0812", month: "Aug", day: "12", weekday: "Thursday", time: "9 a.m. – 3 p.m.", format: "In person", audience: "First-year and transfer", status: "limited", statusText: "11 seats left" },
    ],
    waitlistHref: "/orientation/waitlist",
    studentTypeOptions: "First-year, entering fall 2027\nTransfer, entering fall 2027\nDual-credit high school student\nReturning adult learner",
    maxGuests: "2",
    submitLabel: "Reserve my seat",
    footnote: "Seat counts are sample data. Can't make any date? Email orientation@example.edu and we'll set up a one-on-one session.",
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, formAction, sessions, waitlistHref, studentTypeOptions, maxGuests, submitLabel, footnote }) => {
    const H = headingLevel || "h2";
    const uid = `op-${id || "orientation"}`;
    const list = (sessions ?? []).filter((s) => s?.month || s?.day || s?.code);
    const types = lines(studentTypeOptions);
    const guestsMax = Number.parseInt((maxGuests || "").replace(/[^\d]/g, ""), 10);
    const showGuests = !(Number.isFinite(guestsMax) && guestsMax === 0);

    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">
          {eyebrow || heading || intro ? (
            <div className="grid grid-cols-1 gap-6 lg:grid-cols-12 lg:items-end lg:gap-12">
              <div className="lg:col-span-7">
                {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
                {heading ? <H className={`text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl ${eyebrow ? "mt-3" : ""}`}>{heading}</H> : null}
              </div>
              {intro ? <p className="text-lg leading-8 text-pretty text-neutral-600 lg:col-span-5">{intro}</p> : null}
            </div>
          ) : null}

          <form action={formAction || undefined} method="post" className={eyebrow || heading || intro ? "mt-12 sm:mt-16" : ""}>
            <p className="text-sm leading-6 text-neutral-600">All fields are required unless marked optional.</p>

            {list.length ? (
              <fieldset className="mt-8">
                <legend>
                  <StepLabel n={1}>Choose a session</StepLabel>
                </legend>
                <ul role="list" className="mt-6 grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
                  {list.map((s, i) => {
                    const status: Status = s.status === "full" || s.status === "limited" ? s.status : "open";
                    const st = statusStyle[status];
                    const full = status === "full";
                    const value = s.code || [s.weekday, s.month, s.day, s.time].filter(Boolean).join(" ");
                    return (
                      <li key={`${value}-${i}`} className="flex flex-col">
                        <label
                          className={`relative flex min-h-11 flex-1 gap-4 rounded-2xl p-5 ring-1 ring-inset select-none ${
                            full
                              ? "cursor-not-allowed bg-neutral-50 ring-neutral-200"
                              : "cursor-pointer bg-white ring-neutral-300 transition hover:-translate-y-0.5 hover:shadow-md hover:ring-indigo-400 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 motion-reduce:transition-none motion-reduce:hover:translate-y-0"
                          }`}
                        >
                          <input type="radio" name="session" value={value} required disabled={full} className="peer sr-only" />
                          <span
                            aria-hidden="true"
                            className={`flex w-16 shrink-0 flex-col items-center self-start overflow-hidden rounded-xl ring-1 ${full ? "ring-neutral-300" : "ring-neutral-950/10 peer-checked:ring-indigo-600"}`}
                          >
                            <span className={`w-full py-1 text-center text-xs font-semibold tracking-wider uppercase ${full ? "bg-neutral-300 text-neutral-800" : "bg-neutral-950 text-white"}`}>{s.month}</span>
                            <span className={`w-full bg-white py-1.5 text-center text-2xl font-semibold tabular-nums ${full ? "text-neutral-600" : "text-neutral-950"}`}>{s.day}</span>
                          </span>
                          <span className="min-w-0 flex-1">
                            <span className="sr-only">{[s.weekday, s.month, s.day].filter(Boolean).join(" ")}. </span>
                            {s.weekday ? <span aria-hidden="true" className="block text-sm leading-6 font-medium text-neutral-600">{s.weekday}</span> : null}
                            {s.audience ? <span className={`block text-base leading-6 font-semibold ${full ? "text-neutral-700" : "text-neutral-950"}`}>{s.audience}</span> : null}
                            {s.time || s.format ? <span className="mt-1 block text-sm leading-6 text-neutral-600">{[s.time, s.format].filter(Boolean).join(" · ")}</span> : null}
                            <span className={`mt-3 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 ${st.badge}`}>
                              <span aria-hidden="true" className={`size-1.5 rounded-full ${st.dot}`} />
                              {s.statusText || st.fallback}
                            </span>
                          </span>
                          {!full ? (
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="absolute top-4 right-4 hidden size-5 text-indigo-600 peer-checked:block">
                              <path fillRule="evenodd" d="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" clipRule="evenodd" />
                            </svg>
                          ) : null}
                        </label>
                        {full && waitlistHref ? (
                          <a
                            href={waitlistHref}
                            className="mt-1 inline-flex min-h-11 items-center gap-1.5 self-start rounded px-1 text-sm font-semibold text-indigo-700 underline-offset-4 hover:underline focus-visible:outline-2 focus-visible:outline-indigo-600"
                          >
                            Full — join the waitlist
                            <span className="sr-only"> for {[s.weekday, s.month, s.day].filter(Boolean).join(" ")}</span>
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4">
                              <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>
                    );
                  })}
                </ul>
              </fieldset>
            ) : null}

            <fieldset className="mt-14 rounded-3xl bg-neutral-50 p-6 ring-1 ring-neutral-200 sm:p-10">
              <legend className="float-left w-full">
                <StepLabel n={list.length ? 2 : 1}>Your details</StepLabel>
              </legend>
              <div className="clear-left grid grid-cols-1 gap-x-6 gap-y-6 pt-6 sm:grid-cols-2 lg:grid-cols-3">
                {types.length ? (
                  <div>
                    <label htmlFor={`${uid}-type`} className={labelClass}>I&rsquo;m a</label>
                    <select id={`${uid}-type`} name="student_type" required defaultValue="" className={`mt-2 ${inputClass}`}>
                      <option value="" disabled>
                        Choose one
                      </option>
                      {types.map((t, i) => (
                        <option key={`${t}-${i}`} value={t}>
                          {t}
                        </option>
                      ))}
                    </select>
                  </div>
                ) : null}
                <div>
                  <label htmlFor={`${uid}-sid`} className={labelClass}>Student ID</label>
                  <input id={`${uid}-sid`} name="student_id" type="text" required autoComplete="off" aria-describedby={`${uid}-sid-hint`} className={`mt-2 ${inputClass}`} />
                  <p id={`${uid}-sid-hint`} className="mt-2 text-sm leading-6 text-neutral-600">
                    It&rsquo;s on your admission letter.
                  </p>
                </div>
                <div>
                  <label htmlFor={`${uid}-email`} className={labelClass}>Email</label>
                  <input id={`${uid}-email`} name="email" type="email" required autoComplete="email" inputMode="email" className={`mt-2 ${inputClass}`} />
                </div>
                <div>
                  <label htmlFor={`${uid}-first`} className={labelClass}>First name</label>
                  <input id={`${uid}-first`} name="first_name" type="text" required autoComplete="given-name" className={`mt-2 ${inputClass}`} />
                </div>
                <div>
                  <label htmlFor={`${uid}-last`} className={labelClass}>Last name</label>
                  <input id={`${uid}-last`} name="last_name" type="text" required autoComplete="family-name" className={`mt-2 ${inputClass}`} />
                </div>
                {showGuests ? (
                  <div>
                    <label htmlFor={`${uid}-guests`} className={labelClass}>Family or guests attending</label>
                    <input
                      id={`${uid}-guests`}
                      name="guests"
                      type="number"
                      inputMode="numeric"
                      required
                      min={0}
                      max={Number.isFinite(guestsMax) && guestsMax > 0 ? guestsMax : undefined}
                      defaultValue={0}
                      aria-describedby={`${uid}-guests-hint`}
                      className={`mt-2 ${inputClass}`}
                    />
                    <p id={`${uid}-guests-hint`} className="mt-2 text-sm leading-6 text-neutral-600">
                      {Number.isFinite(guestsMax) && guestsMax > 0 ? `Up to ${guestsMax}. ` : ""}Families attend their own sessions in the morning.
                    </p>
                  </div>
                ) : null}
                <div className="sm:col-span-2 lg:col-span-1">
                  <label htmlFor={`${uid}-diet`} className={labelClass}>
                    Dietary needs <Optional />
                  </label>
                  <input id={`${uid}-diet`} name="dietary_needs" type="text" autoComplete="off" placeholder="Vegetarian, halal, nut allergy…" className={`mt-2 ${inputClass}`} />
                </div>
                <div className="sm:col-span-2">
                  <label htmlFor={`${uid}-access`} className={labelClass}>
                    Accessibility accommodations <Optional />
                  </label>
                  <textarea id={`${uid}-access`} name="accommodations" rows={3} aria-describedby={`${uid}-access-hint`} className={`mt-2 ${inputClass}`} />
                  <p id={`${uid}-access-hint`} className="mt-2 text-sm leading-6 text-neutral-600">
                    Such as captioning for virtual sessions, an interpreter, step-free routes or a lactation room.
                  </p>
                </div>
                <div className="flex gap-3 sm:col-span-2 lg:col-span-3">
                  <div className="flex h-11 shrink-0 items-center">
                    <input
                      id={`${uid}-consent`}
                      name="guardian_consent"
                      type="checkbox"
                      value="yes"
                      aria-describedby={`${uid}-consent-hint`}
                      className="size-5 rounded border-neutral-400 accent-indigo-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                    />
                  </div>
                  <div className="flex min-h-11 flex-col justify-center text-sm leading-6">
                    <label htmlFor={`${uid}-consent`} className="cursor-pointer font-medium text-neutral-900">
                      My parent or guardian approves my attendance
                    </label>
                    <p id={`${uid}-consent-hint`} className="text-neutral-600">
                      Required only if you&rsquo;ll be under 18 on your session date.
                    </p>
                  </div>
                </div>
              </div>

              <div className="mt-10 flex flex-col gap-4 border-t border-neutral-200 pt-8 sm:flex-row sm:items-center sm:gap-6">
                <button
                  type="submit"
                  className="inline-flex min-h-12 shrink-0 items-center justify-center rounded-lg bg-indigo-600 px-6 py-3 text-base font-semibold text-white shadow-xs transition hover:bg-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                >
                  {submitLabel || "Reserve my seat"}
                </button>
                {footnote ? <p className="text-sm leading-6 text-pretty text-neutral-600">{footnote}</p> : null}
              </div>
            </fieldset>
          </form>
        </div>
      </section>
    );
  },
};
```
