# Add the "Exhibitions List" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/exhibitions-list) to this Pantheon Content Publisher (P1) Next.js project. Current shows as large editorial spreads, upcoming in a staggered grid, past in a ruled index, with status spelled out.

## Steps

1. Create `components/puck/exhibitions-list-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 { exhibitionsListBlock } from "./components/puck/exhibitions-list-block";`
3. Register it under `components` as `ExhibitionsListBlock: exhibitionsListBlock`.
4. Add `"ExhibitionsListBlock"` 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/exhibitions-list-block.tsx`

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

/**
 * Exhibitions List — a museum's current, upcoming and past exhibitions. Shows on view now run
 * large as alternating editorial features; upcoming shows sit in a staggered grid; past shows
 * collapse into a ruled index. Status is always spelled out in text.
 * Register: `ExhibitionsListBlock: exhibitionsListBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Status = "current" | "upcoming" | "past";

type Exhibition = {
  status: Status;
  title: string;
  subtitle: string;
  dates: string;
  location: string;
  imageUrl: string;
  imageAlt: string;
  description: string;
  linkHref: string;
};

export type ExhibitionsListProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  currentHeading: string;
  upcomingHeading: string;
  pastHeading: string;
  linkLabel: string;
  allLabel: string;
  allHref: string;
  exhibitions: Exhibition[];
};

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

const STATUS_LABEL: Record<Status, string> = { current: "On view", upcoming: "Opening soon", past: "Closed" };

const ring = "focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-indigo-600";

function Arrow() {
  return (
    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 transition group-hover:translate-x-0.5 motion-reduce:transition-none">
      <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>
  );
}

function StatusMark({ status }: { status: Status }) {
  const mark =
    status === "current"
      ? "size-2 rounded-full bg-indigo-600"
      : status === "upcoming"
        ? "size-2 rounded-full border border-indigo-600"
        : "h-px w-3 bg-neutral-500";
  return (
    <p className="inline-flex items-center gap-2 text-xs font-semibold tracking-widest text-neutral-900 uppercase">
      <span aria-hidden="true" className={mark} />
      {STATUS_LABEL[status] ?? STATUS_LABEL.current}
    </p>
  );
}

export const exhibitionsListBlock: ComponentConfig<ExhibitionsListProps> = {
  label: "Exhibitions List",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading, like the museum's name. 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." } },
    currentHeading: { type: "text", label: "On view label", metadata: { help: "Heading over exhibitions marked On view." } },
    upcomingHeading: { type: "text", label: "Upcoming label", metadata: { help: "Heading over exhibitions marked Opening soon." } },
    pastHeading: { type: "text", label: "Past label", metadata: { help: "Heading over closed exhibitions." } },
    linkLabel: { type: "text", label: "Exhibition link text", metadata: { help: "Shown on each exhibition that has a link, like Explore the exhibition." } },
    allLabel: { type: "text", label: "All exhibitions link text", metadata: { help: "Leave blank to hide it." } },
    allHref: { type: "text", label: "All exhibitions link" },
    exhibitions: {
      type: "array",
      label: "Exhibitions",
      min: 1,
      max: 16,
      getItemSummary: (item) => [item?.title || "Exhibition", item?.status ? STATUS_LABEL[item.status] : ""].filter(Boolean).join(" · "),
      defaultItemProps: {
        status: "upcoming",
        title: "New exhibition",
        subtitle: "",
        dates: "Opens March 2027",
        location: "Gallery 4",
        imageUrl: "https://picsum.photos/seed/gallerywall/1200/1500",
        imageAlt: "",
        description: "",
        linkHref: "",
      },
      arrayFields: {
        status: {
          type: "select",
          label: "Status",
          options: [
            { label: "On view", value: "current" },
            { label: "Opening soon", value: "upcoming" },
            { label: "Closed", value: "past" },
          ],
          metadata: { help: "On view exhibitions are shown large at the top. Closed ones move to a compact list." },
        },
        title: { type: "text", label: "Title" },
        subtitle: { type: "text", label: "Subtitle", metadata: { help: "Shown in italics under the title. Leave blank to hide it." } },
        dates: { type: "text", label: "Dates", metadata: { help: "As people should read it, like September 12, 2026 – January 10, 2027." } },
        location: { type: "text", label: "Gallery", metadata: { help: "Where in the building, like Galleries 201–204, second floor." } },
        imageUrl: { type: "text", label: "Image URL", metadata: { help: "Not shown for closed exhibitions." } },
        imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the image for screen reader users." } },
        description: { type: "textarea", label: "Short description", metadata: { help: "One or two sentences. Leave blank to hide it." } },
        linkHref: { type: "text", label: "Link", metadata: { help: "The exhibition's page. Leave blank for no link." } },
      },
    },
  },
  defaultProps: {
    eyebrow: "Halvorsen Museum of Art",
    heading: "Exhibitions",
    headingLevel: "h2",
    intro: "Admission to every exhibition is included with general admission and always free for members. Galleries open at 10 a.m., Tuesday through Sunday.",
    currentHeading: "Now on view",
    upcomingHeading: "Coming soon",
    pastHeading: "Recently closed",
    linkLabel: "Explore the exhibition",
    allLabel: "Exhibition archive",
    allHref: "/exhibitions/archive",
    exhibitions: [
      {
        status: "current",
        title: "The Weight of Water",
        subtitle: "Ines Okonkwo-Lindqvist, 1994–2026",
        dates: "September 12, 2026 – January 10, 2027",
        location: "Galleries 201–204, second floor",
        imageUrl: "https://picsum.photos/seed/weightofwater/1400/1100",
        imageAlt: "A vast blue-grey canvas hung alone on a white gallery wall, a visitor standing before it",
        description: "Three decades of paintings, river-silt drawings and sound pieces from an artist who has spent her life listening to the Mississippi. The first full survey of her work.",
        linkHref: "/exhibitions/the-weight-of-water",
      },
      {
        status: "current",
        title: "Small Hours",
        subtitle: "Photographs from the night shift",
        dates: "Through November 29, 2026",
        location: "Ellery Gallery, ground floor",
        imageUrl: "https://picsum.photos/seed/smallhours/1400/1100",
        imageAlt: "Black-and-white photograph of a lit diner window on an empty street at night",
        description: "Seventy photographs of nurses, bakers, bus drivers and security guards, drawn from the museum's collection and a community open call.",
        linkHref: "/exhibitions/small-hours",
      },
      {
        status: "upcoming",
        title: "Paper Kingdoms",
        subtitle: "Cut paper from four continents",
        dates: "Opens February 6, 2027",
        location: "Galleries 105–106",
        imageUrl: "https://picsum.photos/seed/paperkingdoms/1200/1500",
        imageAlt: "Intricate white cut-paper lattice casting shadows on a dark wall",
        description: "",
        linkHref: "/exhibitions/paper-kingdoms",
      },
      {
        status: "upcoming",
        title: "Mara Velasquez-Hoff: Field Notes",
        subtitle: "",
        dates: "Opens March 20, 2027",
        location: "Sculpture Court",
        imageUrl: "https://picsum.photos/seed/fieldnotes/1200/1500",
        imageAlt: "Bronze forms resembling seed pods arranged on a pale stone floor",
        description: "",
        linkHref: "/exhibitions/field-notes",
      },
      {
        status: "upcoming",
        title: "Annual Student Exhibition",
        subtitle: "Halvorsen School Partners",
        dates: "Opens April 17, 2027",
        location: "Community Gallery",
        imageUrl: "https://picsum.photos/seed/studentshow/1200/1500",
        imageAlt: "Brightly colored student paintings hung salon-style on a gallery wall",
        description: "",
        linkHref: "/exhibitions/student-exhibition",
      },
      { status: "past", title: "A Thousand Looms", subtitle: "", dates: "March 7 – August 2, 2026", location: "Galleries 201–204", imageUrl: "", imageAlt: "", description: "", linkHref: "/exhibitions/a-thousand-looms" },
      { status: "past", title: "Northern Light: Landscapes 1880–1920", subtitle: "", dates: "January 17 – June 14, 2026", location: "Ellery Gallery", imageUrl: "", imageAlt: "", description: "", linkHref: "/exhibitions/northern-light" },
      { status: "past", title: "Tomasz Brandt: Clay Speaks", subtitle: "", dates: "October 4, 2025 – February 22, 2026", location: "Galleries 105–106", imageUrl: "", imageAlt: "", description: "", linkHref: "" },
    ],
  },
  render: ({ eyebrow, heading, headingLevel, intro, currentHeading, upcomingHeading, pastHeading, linkLabel, allLabel, allHref, exhibitions }) => {
    const H = headingLevel || "h2";
    const Sub = SUB[H] ?? "h3";
    const Item = SUB2[H] ?? "h4";
    const list = (exhibitions ?? []).filter((e) => e?.title);
    const current = list.filter((e) => (e.status || "current") === "current");
    const upcoming = list.filter((e) => e.status === "upcoming");
    const past = list.filter((e) => e.status === "past");

    const groupHeading = (text: string, count: number) =>
      text ? (
        <div className="flex items-baseline justify-between gap-4 border-t border-neutral-950 pt-4">
          <Sub className="text-xs font-semibold tracking-widest text-neutral-950 uppercase">{text}</Sub>
          <p aria-hidden="true" className="font-serif text-sm text-neutral-500 italic tabular-nums">
            {String(count).padStart(2, "0")}
          </p>
        </div>
      ) : (
        <div aria-hidden="true" className="border-t border-neutral-950" />
      );

    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-7xl lg:text-8xl`}>
                    {heading}
                  </H>
                ) : null}
              </div>
              {intro || allLabel ? (
                <div className="lg:col-span-4 lg:col-start-9">
                  {intro ? <p className="text-base leading-7 text-pretty text-neutral-600">{intro}</p> : null}
                  {allLabel ? (
                    <a href={allHref || "#"} className={`group mt-4 inline-flex min-h-11 items-center gap-2 text-sm font-semibold text-neutral-950 underline decoration-indigo-600 underline-offset-4 hover:decoration-2 ${ring}`}>
                      {allLabel}
                      <Arrow />
                    </a>
                  ) : null}
                </div>
              ) : null}
            </header>
          ) : null}

          {current.length ? (
            <div className="mt-14 lg:mt-20">
              {groupHeading(currentHeading, current.length)}
              <ul role="list" className="mt-10 space-y-16 lg:space-y-24">
                {current.map((ex, i) => (
                  <li key={`${ex.title}-${i}`}>
                    <article className="grid grid-cols-1 gap-8 lg:grid-cols-12 lg:items-end lg:gap-12">
                      {ex.imageUrl ? (
                        <div className={`relative lg:col-span-7 ${i % 2 ? "lg:order-2 lg:col-start-6" : ""}`}>
                          <img src={ex.imageUrl} alt={ex.imageAlt || ""} className="aspect-4/5 w-full bg-neutral-100 object-cover sm:aspect-4/3" />
                          <p aria-hidden="true" className={`absolute -bottom-5 font-serif text-6xl leading-none text-indigo-600 tabular-nums sm:text-7xl ${i % 2 ? "left-4 sm:-left-6" : "right-4 sm:-right-6"}`}>
                            {String(i + 1).padStart(2, "0")}
                          </p>
                        </div>
                      ) : null}
                      <div className={`${ex.imageUrl ? "lg:col-span-5" : "lg:col-span-8"} ${i % 2 && ex.imageUrl ? "lg:order-1 lg:col-start-1" : ""}`}>
                        <StatusMark status="current" />
                        <Item className="mt-4 font-serif text-4xl leading-none font-normal tracking-tight text-balance text-neutral-950 sm:text-5xl lg:text-6xl">
                          {ex.linkHref ? (
                            <a href={ex.linkHref} className={`hover:text-indigo-700 ${ring}`}>
                              {ex.title}
                            </a>
                          ) : (
                            ex.title
                          )}
                        </Item>
                        {ex.subtitle ? <p className="mt-3 font-serif text-xl leading-snug text-pretty text-neutral-600 italic sm:text-2xl">{ex.subtitle}</p> : null}
                        {ex.dates || ex.location ? (
                          <dl className="mt-8 grid grid-cols-1 gap-4 border-y border-neutral-200 py-5 sm:grid-cols-2">
                            {ex.dates ? (
                              <div>
                                <dt className="text-xs font-semibold tracking-widest text-neutral-500 uppercase">Dates</dt>
                                <dd className="mt-1 text-sm leading-6 font-medium text-neutral-950">{ex.dates}</dd>
                              </div>
                            ) : null}
                            {ex.location ? (
                              <div>
                                <dt className="text-xs font-semibold tracking-widest text-neutral-500 uppercase">Location</dt>
                                <dd className="mt-1 text-sm leading-6 font-medium text-neutral-950">{ex.location}</dd>
                              </div>
                            ) : null}
                          </dl>
                        ) : null}
                        {ex.description ? <p className="mt-6 text-base leading-7 text-pretty text-neutral-600">{ex.description}</p> : null}
                        {ex.linkHref && linkLabel ? (
                          <a href={ex.linkHref} className={`group mt-6 inline-flex min-h-11 items-center gap-2 text-sm font-semibold text-neutral-950 underline decoration-indigo-600 underline-offset-4 hover:decoration-2 ${ring}`}>
                            {linkLabel}
                            <span className="sr-only">: {ex.title}</span>
                            <Arrow />
                          </a>
                        ) : null}
                      </div>
                    </article>
                  </li>
                ))}
              </ul>
            </div>
          ) : null}

          {upcoming.length ? (
            <div className="mt-20 lg:mt-28">
              {groupHeading(upcomingHeading, upcoming.length)}
              <ul role="list" className="mt-10 grid grid-cols-1 gap-x-8 gap-y-12 sm:grid-cols-2 lg:grid-cols-3">
                {upcoming.map((ex, i) => (
                  <li key={`${ex.title}-${i}`} className={i % 3 === 1 ? "lg:mt-16" : i % 3 === 2 ? "lg:mt-8" : ""}>
                    <article className="group relative">
                      {ex.imageUrl ? <img src={ex.imageUrl} alt={ex.imageAlt || ""} loading="lazy" className="aspect-3/4 w-full bg-neutral-100 object-cover" /> : null}
                      <div className={ex.imageUrl ? "mt-5" : ""}>
                        <StatusMark status="upcoming" />
                        <Item className="mt-3 font-serif text-2xl leading-tight font-normal tracking-tight text-balance text-neutral-950 sm:text-3xl">
                          {ex.linkHref ? (
                            <a href={ex.linkHref} className={`decoration-indigo-600 underline-offset-4 hover:underline ${ring}`}>
                              {ex.title}
                            </a>
                          ) : (
                            ex.title
                          )}
                        </Item>
                        {ex.subtitle ? <p className="mt-1 font-serif text-lg text-neutral-600 italic">{ex.subtitle}</p> : null}
                        {ex.dates || ex.location ? (
                          <p className="mt-3 text-sm leading-6 text-neutral-600">
                            {ex.dates ? <span className="font-medium text-neutral-950">{ex.dates}</span> : null}
                            {ex.dates && ex.location ? <span aria-hidden="true"> · </span> : null}
                            {ex.location}
                          </p>
                        ) : null}
                        {ex.description ? <p className="mt-3 text-sm leading-6 text-pretty text-neutral-600">{ex.description}</p> : null}
                      </div>
                    </article>
                  </li>
                ))}
              </ul>
            </div>
          ) : null}

          {past.length ? (
            <div className="mt-20 lg:mt-28">
              {groupHeading(pastHeading, past.length)}
              <ul role="list" className="mt-2 divide-y divide-neutral-200">
                {past.map((ex, i) => (
                  <li key={`${ex.title}-${i}`} className="grid grid-cols-1 gap-1 py-5 sm:grid-cols-12 sm:items-baseline sm:gap-6">
                    <Item className="font-serif text-xl leading-snug font-normal text-neutral-950 italic sm:col-span-5">
                      {ex.linkHref ? (
                        <a href={ex.linkHref} className={`inline-flex min-h-11 items-center decoration-indigo-600 underline-offset-4 hover:underline sm:min-h-0 ${ring}`}>
                          {ex.title}
                        </a>
                      ) : (
                        ex.title
                      )}
                    </Item>
                    <p className="text-sm text-neutral-600 sm:col-span-3">{ex.dates}</p>
                    <p className="text-sm text-neutral-600 sm:col-span-2">{ex.location}</p>
                    <div className="sm:col-span-2 sm:justify-self-end">
                      <StatusMark status="past" />
                    </div>
                  </li>
                ))}
              </ul>
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
