# Add the "Field Trips" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/field-trips) to this Pantheon Content Publisher (P1) Next.js project. School programs led by big grade bands, with length, group size, cost, curriculum links, booking steps and bus note.

## Steps

1. Create `components/puck/field-trips-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 { fieldTripsBlock } from "./components/puck/field-trips-block";`
3. Register it under `components` as `FieldTripsBlock: fieldTripsBlock`.
4. Add `"FieldTripsBlock"` to the best-fitting entry in `categories` (this block's library category is "Arts & culture"). 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/field-trips-block.tsx`

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

/**
 * Field Trips — school and group programs for a museum or arts center: program cards led by an
 * oversized grade band, with length, capacity, cost and curriculum connections; numbered
 * booking steps; a bus-funding note; and a request link. Register:
 * `FieldTripsBlock: fieldTripsBlock` in puck.config.tsx.
 */

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

type Program = {
  grades: string;
  title: string;
  description: string;
  length: string;
  capacity: string;
  cost: string;
  curriculum: string;
  imageUrl: string;
  imageAlt: string;
};

export type FieldTripsProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  programs: Program[];
  stepsHeading: string;
  steps: { title: string; detail: string }[];
  busHeading: string;
  busNote: string;
  requestLabel: string;
  requestHref: string;
  contact: string;
};

const SUB = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" } as const;
const ring = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";

export const fieldTripsBlock: ComponentConfig<FieldTripsProps> = {
  label: "Field Trips",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "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", metadata: { help: "Leave blank to hide it." } },
    programs: {
      type: "array",
      label: "Programs",
      min: 1,
      max: 6,
      getItemSummary: (item) => [item?.grades, item?.title].filter(Boolean).join(" · ") || "Program",
      defaultItemProps: { grades: "6–8", title: "New program", description: "", length: "90 minutes", capacity: "Up to 60 students", cost: "Free", curriculum: "", imageUrl: "", imageAlt: "" },
      arrayFields: {
        grades: { type: "text", label: "Grades", metadata: { help: "Shown large, so keep it short, like K–2, 3–5 or 9–12." } },
        title: { type: "text", label: "Program name" },
        description: { type: "textarea", label: "Description" },
        length: { type: "text", label: "Length", metadata: { help: "Like 90 minutes." } },
        capacity: { type: "text", label: "Group size", metadata: { help: "Like Up to 60 students." } },
        cost: { type: "text", label: "Cost", metadata: { help: "Write it out, like Free for Title I schools, otherwise $4 per student." } },
        curriculum: { type: "text", label: "Curriculum connections", metadata: { help: "Separate with commas, like Visual Arts, ELA, Social Studies." } },
        imageUrl: { type: "text", label: "Image URL", metadata: { help: "Leave blank for a text-only card." } },
        imageAlt: { type: "text", label: "Image alt text" },
      },
    },
    stepsHeading: { type: "text", label: "Steps heading" },
    steps: {
      type: "array",
      label: "Booking steps",
      min: 0,
      max: 5,
      getItemSummary: (item, i) => item?.title || `Step ${(i ?? 0) + 1}`,
      defaultItemProps: { title: "Step", detail: "" },
      arrayFields: {
        title: { type: "text", label: "Step" },
        detail: { type: "textarea", label: "Details" },
      },
      metadata: { help: "Leave empty to hide the steps." },
    },
    busHeading: { type: "text", label: "Bus note heading" },
    busNote: { type: "textarea", label: "Bus funding note", metadata: { help: "Leave blank to hide it." } },
    requestLabel: { type: "text", label: "Request button text", metadata: { help: "Leave blank to hide it." } },
    requestHref: { type: "text", label: "Request link" },
    contact: { type: "text", label: "Contact line", metadata: { help: "Shown beside the button, like a phone number and email. Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "Schools & groups",
    heading: "Bring your class to the museum",
    headingLevel: "h2",
    intro: "Every program is led by a trained gallery teacher, built around close looking and conversation, and free for schools in our five-county region.",
    programs: [
      {
        grades: "K–2",
        title: "Look, Wonder, Make",
        description: "A first visit built on noticing: color hunts in the galleries, a story told through one painting, and a hands-on collage in the studio.",
        length: "75 minutes",
        capacity: "Up to 50 students",
        cost: "Free",
        curriculum: "Visual Arts, Early Literacy, Social-Emotional Learning",
        imageUrl: "https://picsum.photos/seed/kidsgallery/900/700",
        imageAlt: "Young students sitting cross-legged on a gallery floor, pointing at a large painting",
      },
      {
        grades: "3–5",
        title: "Stories in Objects",
        description: "Students investigate artworks as primary sources, asking who made them, for whom, and what they tell us about a time and place.",
        length: "90 minutes",
        capacity: "Up to 75 students",
        cost: "Free",
        curriculum: "Social Studies, ELA, Visual Arts",
        imageUrl: "https://picsum.photos/seed/sketchinggallery/900/700",
        imageAlt: "Students sketching on clipboards in front of a sculpture",
      },
      {
        grades: "9–12",
        title: "Critique & Context",
        description: "Discussion-based tours of a current exhibition, with a writing prompt that meets AP Art History and Studio Art goals.",
        length: "2 hours",
        capacity: "Up to 60 students",
        cost: "Free for Title I schools; $4 per student otherwise",
        curriculum: "AP Art History, Studio Art, ELA",
        imageUrl: "https://picsum.photos/seed/teentour/900/700",
        imageAlt: "High school students in conversation with a gallery teacher in a contemporary art gallery",
      },
    ],
    stepsHeading: "How to book",
    steps: [
      { title: "Request a date", detail: "Send the request form at least four weeks ahead. Tuesday to Friday mornings, September through May." },
      { title: "Plan with us", detail: "A gallery teacher calls within three school days to match the visit to your unit." },
      { title: "Prepare your class", detail: "We send a pre-visit slideshow, chaperone guide and lunchroom details." },
      { title: "Visit and follow up", detail: "Take home a classroom activity and a free family pass for every student." },
    ],
    busHeading: "Bus funding",
    busNote: "The Arneson Family Fund covers bus costs for any public school in Cedar, Pine and Lindgren counties, up to two buses per school per year. Check the box on the request form and we handle the rest.",
    requestLabel: "Request a field trip",
    requestHref: "/learn/field-trips/request",
    contact: "Questions? Call 555-0171 or email schools@halvorsen.example.org",
  },
  render: ({ eyebrow, heading, headingLevel, intro, programs, stepsHeading, steps, busHeading, busNote, requestLabel, requestHref, contact }) => {
    const H = headingLevel || "h2";
    const Sub = SUB[H] ?? "h3";
    const list = (programs ?? []).filter((p) => p?.title);
    const stepList = (steps ?? []).filter((s) => s?.title);

    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 ? (
            <header 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-xs font-semibold tracking-widest text-indigo-700 uppercase">{eyebrow}</p> : null}
                {heading ? <H className={`${eyebrow ? "mt-4" : ""} font-serif text-5xl leading-none font-normal tracking-tight text-balance text-neutral-950 sm:text-6xl lg:text-7xl`}>{heading}</H> : null}
              </div>
              {intro ? <p className="text-lg leading-8 text-pretty text-neutral-600 lg:col-span-5">{intro}</p> : null}
            </header>
          ) : null}

          {list.length ? (
            <ul role="list" className="mt-12 grid grid-cols-1 gap-px border border-neutral-950 bg-neutral-950 md:grid-cols-2 lg:mt-16 lg:grid-cols-3">
              {list.map((p, i) => {
                const tags = (p.curriculum || "").split(",").map((t) => t.trim()).filter(Boolean);
                return (
                  <li key={`${p.title}-${i}`} className="flex flex-col bg-white">
                    <article className="flex flex-1 flex-col">
                      <div className="relative">
                        {p.imageUrl ? <img src={p.imageUrl} alt={p.imageAlt || ""} loading="lazy" className="aspect-3/2 w-full bg-neutral-100 object-cover" /> : null}
                        {p.grades ? (
                          <p className={`${p.imageUrl ? "absolute -bottom-6 left-5 bg-white pt-2 pr-4" : "px-5 pt-6"} font-serif leading-none text-indigo-700`}>
                            <span className="block text-xs font-semibold tracking-widest text-neutral-950 uppercase not-italic">Grades</span>
                            <span className="mt-1 block text-6xl tracking-tight tabular-nums sm:text-7xl">{p.grades}</span>
                          </p>
                        ) : null}
                      </div>
                      <div className={`flex flex-1 flex-col px-5 pb-6 ${p.imageUrl && p.grades ? "pt-10" : "pt-5"}`}>
                        <Sub className="font-serif text-2xl leading-tight font-normal text-neutral-950">{p.title}</Sub>
                        {p.description ? <p className="mt-3 text-sm leading-6 text-pretty text-neutral-600">{p.description}</p> : null}
                        {p.length || p.capacity || p.cost ? (
                          <dl className="mt-6 divide-y divide-neutral-200 border-y border-neutral-200 text-sm">
                            {[
                              ["Length", p.length],
                              ["Group size", p.capacity],
                              ["Cost", p.cost],
                            ]
                              .filter(([, v]) => v)
                              .map(([k, v]) => (
                                <div key={k} className="flex justify-between gap-4 py-2.5">
                                  <dt className="shrink-0 text-neutral-600">{k}</dt>
                                  <dd className={`text-right font-medium ${k === "Cost" && /^free$/i.test(v.trim()) ? "font-serif text-base text-indigo-700 italic" : "text-neutral-950"}`}>{v}</dd>
                                </div>
                              ))}
                          </dl>
                        ) : null}
                        {tags.length ? (
                          <div className="mt-auto pt-6">
                            <p className="text-xs font-semibold tracking-widest text-neutral-950 uppercase">Curriculum connections</p>
                            <ul role="list" className="mt-2 flex flex-wrap gap-1.5">
                              {tags.map((t) => (
                                <li key={t} className="bg-indigo-50 px-2 py-1 text-xs font-medium text-indigo-800">
                                  {t}
                                </li>
                              ))}
                            </ul>
                          </div>
                        ) : null}
                      </div>
                    </article>
                  </li>
                );
              })}
            </ul>
          ) : null}

          {stepList.length || busNote ? (
            <div className="mt-20 grid grid-cols-1 gap-12 lg:mt-24 lg:grid-cols-12 lg:gap-12">
              {stepList.length ? (
                <div className={busNote ? "lg:col-span-8" : "lg:col-span-12"}>
                  <Sub className="border-b border-neutral-950 pb-3 text-xs font-semibold tracking-widest text-neutral-950 uppercase">{stepsHeading || "How to book"}</Sub>
                  <ol role="list" className="mt-8 grid grid-cols-1 gap-x-8 gap-y-10 sm:grid-cols-2">
                    {stepList.map((s, i) => (
                      <li key={`${s.title}-${i}`} className="flex gap-5">
                        <span aria-hidden="true" className="font-serif text-5xl leading-none text-indigo-600 italic tabular-nums">
                          {i + 1}
                        </span>
                        <div className="min-w-0 border-l border-neutral-200 pl-5">
                          <p className="text-base font-semibold text-neutral-950">
                            <span className="sr-only">Step {i + 1}: </span>
                            {s.title}
                          </p>
                          {s.detail ? <p className="mt-1 text-sm leading-6 text-pretty text-neutral-600">{s.detail}</p> : null}
                        </div>
                      </li>
                    ))}
                  </ol>
                </div>
              ) : null}
              {busNote ? (
                <aside className={`${stepList.length ? "lg:col-span-4" : "lg:col-span-12"} self-start bg-indigo-50 p-6 sm:p-8`}>
                  <Sub className="flex items-center gap-2 text-xs font-semibold tracking-widest text-indigo-800 uppercase">
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5">
                      <path fillRule="evenodd" d="M4 3.75A2.75 2.75 0 0 1 6.75 1h6.5A2.75 2.75 0 0 1 16 3.75v10.5a1.75 1.75 0 0 1-1 1.58V17a1 1 0 0 1-2 0v-1H7v1a1 1 0 0 1-2 0v-1.17a1.75 1.75 0 0 1-1-1.58V3.75ZM5.5 5v4h9V5h-9Zm1.25 8.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm6.5 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" clipRule="evenodd" />
                    </svg>
                    {busHeading || "Bus funding"}
                  </Sub>
                  <p className="mt-4 font-serif text-lg leading-snug text-pretty text-neutral-950">{busNote}</p>
                </aside>
              ) : null}
            </div>
          ) : null}

          {requestLabel || contact ? (
            <div className="mt-14 flex flex-col gap-4 border-t border-neutral-950 pt-8 sm:flex-row sm:items-center sm:gap-8">
              {requestLabel ? (
                <a href={requestHref || "#"} className={`inline-flex min-h-12 items-center justify-center bg-neutral-950 px-7 text-base font-semibold text-white transition hover:bg-indigo-700 motion-reduce:transition-none ${ring}`}>
                  {requestLabel}
                </a>
              ) : null}
              {contact ? <p className="text-sm leading-6 break-words text-neutral-600">{contact}</p> : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
