# Add the "Visit Info" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/visit-info) to this Pantheon Content Publisher (P1) Next.js project. Plan-your-visit guide with hours and admission tables, free days, parking, transit, access services and a ticket link.

## Steps

1. Create `components/puck/visit-info-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 { visitInfoBlock } from "./components/puck/visit-info-block";`
3. Register it under `components` as `VisitInfoBlock: visitInfoBlock`.
4. Add `"VisitInfoBlock"` 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/visit-info-block.tsx`

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

/**
 * Visit Info — a museum's plan-your-visit page in one section: hours and admission as real
 * tables, free days, parking and transit, accessibility services and a ticket link, set like
 * a printed visitor guide. Register: `VisitInfoBlock: visitInfoBlock` in puck.config.tsx.
 */

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

export type VisitInfoProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  address: string;
  mapLabel: string;
  mapHref: string;
  ticketLabel: string;
  ticketHref: string;
  ticketNote: string;
  hoursHeading: string;
  hours: { days: string; time: string }[];
  hoursNote: string;
  admissionHeading: string;
  admission: { category: string; price: string; note: string }[];
  freeDaysHeading: string;
  freeDays: string;
  gettingHereHeading: string;
  parking: string;
  transit: string;
  accessHeading: string;
  access: { title: string; detail: string }[];
  accessContact: string;
};

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

const ring = "focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-indigo-600";
const label = "text-xs font-semibold tracking-widest text-neutral-950 uppercase";

const ICONS = {
  car: "M3.5 8.5 5 4.6A2 2 0 0 1 6.9 3.3h6.2a2 2 0 0 1 1.9 1.3l1.5 3.9A2 2 0 0 1 18 10.5v3.75a.75.75 0 0 1-.75.75H16.5v1a1 1 0 0 1-2 0v-1h-9v1a1 1 0 0 1-2 0v-1h-.75a.75.75 0 0 1-.75-.75V10.5a2 2 0 0 1 1.5-2ZM5.6 8h8.8l-1.2-3.05a.5.5 0 0 0-.47-.32H7.27a.5.5 0 0 0-.47.32L5.6 8ZM5.5 12.5a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm9 0a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
  bus: "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",
  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",
  ticket: "M1 4.75C1 3.784 1.784 3 2.75 3h14.5c.966 0 1.75.784 1.75 1.75v2.43a.75.75 0 0 1-.629.74 2.112 2.112 0 0 0 0 4.16.75.75 0 0 1 .629.74v2.43A1.75 1.75 0 0 1 17.25 17H2.75A1.75 1.75 0 0 1 1 15.25v-2.43a.75.75 0 0 1 .629-.74 2.112 2.112 0 0 0 0-4.16A.75.75 0 0 1 1 7.18V4.75ZM13 6.25a.75.75 0 0 1 1.5 0v1a.75.75 0 0 1-1.5 0v-1Zm.75 3a.75.75 0 0 0-.75.75v1a.75.75 0 0 0 1.5 0v-1a.75.75 0 0 0-.75-.75Zm-.75 4.5a.75.75 0 0 1 1.5 0v1a.75.75 0 0 1-1.5 0v-1Z",
};

function Icon({ d, className = "size-5 text-indigo-600" }: { d: string; className?: string }) {
  return (
    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className={`shrink-0 ${className}`}>
      <path fillRule="evenodd" clipRule="evenodd" d={d} />
    </svg>
  );
}

export const visitInfoBlock: ComponentConfig<VisitInfoProps> = {
  label: "Visit Info",
  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", metadata: { help: "Leave blank to hide it." } },
    address: { type: "textarea", label: "Address", metadata: { help: "One line per line of the address. Leave blank to hide it." } },
    mapLabel: { type: "text", label: "Map link text", metadata: { help: "Leave blank to hide it." } },
    mapHref: { type: "text", label: "Map link", metadata: { help: "A link to the museum on a map service." } },
    ticketLabel: { type: "text", label: "Ticket button text", metadata: { help: "Leave blank to hide the button." } },
    ticketHref: { type: "text", label: "Ticket link" },
    ticketNote: { type: "text", label: "Ticket note", metadata: { help: "Small print under the button. Leave blank to hide it." } },
    hoursHeading: { type: "text", label: "Hours heading" },
    hours: {
      type: "array",
      label: "Hours",
      min: 0,
      max: 10,
      getItemSummary: (item) => [item?.days, item?.time].filter(Boolean).join(": ") || "Hours row",
      defaultItemProps: { days: "Monday", time: "Closed" },
      arrayFields: {
        days: { type: "text", label: "Days", metadata: { help: "Like Tuesday – Sunday, or Thursday." } },
        time: { type: "text", label: "Hours", metadata: { help: "Like 10 a.m. – 5 p.m., or Closed." } },
      },
      metadata: { help: "Shown as a table. Leave empty to hide it." },
    },
    hoursNote: { type: "textarea", label: "Hours note", metadata: { help: "Holiday closures and similar. Leave blank to hide it." } },
    admissionHeading: { type: "text", label: "Admission heading" },
    admission: {
      type: "array",
      label: "Admission prices",
      min: 0,
      max: 10,
      getItemSummary: (item) => [item?.category, item?.price].filter(Boolean).join(": ") || "Price row",
      defaultItemProps: { category: "Adults", price: "$20", note: "" },
      arrayFields: {
        category: { type: "text", label: "Category" },
        price: { type: "text", label: "Price", metadata: { help: "Like $20 or Free." } },
        note: { type: "text", label: "Note", metadata: { help: "Who qualifies, like With valid ID. Leave blank to hide it." } },
      },
      metadata: { help: "Shown as a table. Leave empty to hide it." },
    },
    freeDaysHeading: { type: "text", label: "Free days heading" },
    freeDays: { type: "textarea", label: "Free days", metadata: { help: "One per line. Leave blank to hide this part." } },
    gettingHereHeading: { type: "text", label: "Getting here heading" },
    parking: { type: "textarea", label: "Parking", metadata: { help: "Leave blank to hide it." } },
    transit: { type: "textarea", label: "Transit", metadata: { help: "Bus, rail and bike details. Leave blank to hide it." } },
    accessHeading: { type: "text", label: "Accessibility heading" },
    access: {
      type: "array",
      label: "Accessibility services",
      min: 0,
      max: 10,
      getItemSummary: (item) => item?.title || "Service",
      defaultItemProps: { title: "Service", detail: "" },
      arrayFields: {
        title: { type: "text", label: "Service" },
        detail: { type: "textarea", label: "Details" },
      },
    },
    accessContact: { type: "textarea", label: "Accessibility contact", metadata: { help: "How to arrange services in advance. Leave blank to hide it." } },
  },
  defaultProps: {
    eyebrow: "Plan your visit",
    heading: "Come see for yourself",
    headingLevel: "h2",
    intro: "The Halvorsen sits at the north end of Riverside Park, a ten-minute walk from downtown. Most visitors spend two to three hours with us.",
    address: "Halvorsen Museum of Art\n400 Lindgren Avenue\nCedar Falls, MN 55401",
    mapLabel: "Get directions",
    mapHref: "/visit/directions",
    ticketLabel: "Buy tickets",
    ticketHref: "/tickets",
    ticketNote: "Timed tickets are recommended on weekends. Members never need one.",
    hoursHeading: "Hours",
    hours: [
      { days: "Monday", time: "Closed" },
      { days: "Tuesday – Wednesday", time: "10 a.m. – 5 p.m." },
      { days: "Thursday", time: "10 a.m. – 9 p.m." },
      { days: "Friday – Sunday", time: "10 a.m. – 5 p.m." },
    ],
    hoursNote: "Closed Thanksgiving, December 25 and January 1. Galleries begin closing 15 minutes before close.",
    admissionHeading: "Admission",
    admission: [
      { category: "Adults", price: "$20", note: "" },
      { category: "Seniors", price: "$15", note: "Ages 65 and up" },
      { category: "Students", price: "$10", note: "With a current student ID" },
      { category: "Members", price: "Free", note: "Plus one guest on weekdays" },
      { category: "Kids", price: "Free", note: "Ages 17 and under, always" },
    ],
    freeDaysHeading: "Free days",
    freeDays: "Every Thursday, 5 – 9 p.m.\nFirst Sunday of every month\nEBT, WIC and Medicaid cardholders: free for up to four people, any day",
    gettingHereHeading: "Getting here",
    parking: "The Lindgren Avenue garage is $8 for the day, with 12 accessible spaces on level one by the elevator. Free street parking after 6 p.m. Bike racks at both entrances.",
    transit: "Metro Bus routes 6 and 22 stop at Lindgren & 4th, steps from the front doors. The Blue Line's Riverside Station is a six-minute walk.",
    accessHeading: "Accessibility",
    access: [
      { title: "Wheelchairs and stools", detail: "Free to borrow at coat check, first come, first served. Every gallery is step-free." },
      { title: "ASL-interpreted tours", detail: "First Saturday of each month at 11 a.m., or by request with two weeks' notice." },
      { title: "Sensory kits", detail: "Noise-reducing headphones, fidgets and a quiet-room map, free at the welcome desk." },
      { title: "Assistive listening", detail: "Induction loops in the auditorium and at the welcome desk; receivers available for tours." },
    ],
    accessContact: "To arrange services ahead of your visit, call 555-0148 or email access@halvorsen.example.org.",
  },
  render: ({
    eyebrow,
    heading,
    headingLevel,
    intro,
    address,
    mapLabel,
    mapHref,
    ticketLabel,
    ticketHref,
    ticketNote,
    hoursHeading,
    hours,
    hoursNote,
    admissionHeading,
    admission,
    freeDaysHeading,
    freeDays,
    gettingHereHeading,
    parking,
    transit,
    accessHeading,
    access,
    accessContact,
  }) => {
    const H = headingLevel || "h2";
    const Sub = SUB[H] ?? "h3";
    const hourRows = (hours ?? []).filter((r) => r?.days || r?.time);
    const priceRows = (admission ?? []).filter((r) => r?.category || r?.price);
    const freeList = (freeDays || "").split("\n").map((s) => s.trim()).filter(Boolean);
    const accessList = (access ?? []).filter((a) => a?.title);
    const addressLines = (address || "").split("\n").map((s) => s.trim()).filter(Boolean);
    const isClosed = (t: string) => /closed/i.test(t || "");
    const isFree = (t: string) => /^free$/i.test((t || "").trim());

    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 grid max-w-7xl grid-cols-1 gap-12 lg:grid-cols-12 lg:gap-16">
          <div className="lg:col-span-5">
            <div className="lg:sticky lg:top-8">
              {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}
              {intro ? <p className="mt-6 max-w-md text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}

              {addressLines.length ? (
                <address className="mt-8 flex gap-3 border-t border-neutral-950 pt-6 text-base leading-7 text-neutral-950 not-italic">
                  <Icon d={ICONS.pin} className="mt-1 size-5 text-indigo-600" />
                  <span>
                    {addressLines.map((line, i) => (
                      <span key={i} className={`block ${i === 0 ? "font-semibold" : ""}`}>
                        {line}
                      </span>
                    ))}
                    {mapLabel ? (
                      <a href={mapHref || "#"} className={`mt-1 inline-flex min-h-11 items-center text-sm font-semibold text-indigo-700 underline underline-offset-4 hover:decoration-2 ${ring}`}>
                        {mapLabel}
                      </a>
                    ) : null}
                  </span>
                </address>
              ) : null}

              {ticketLabel ? (
                <div className="mt-8">
                  <a
                    href={ticketHref || "#"}
                    className="inline-flex min-h-12 w-full items-center justify-center gap-2 bg-neutral-950 px-7 py-3 text-base font-semibold text-white transition hover:bg-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 motion-reduce:transition-none sm:w-auto"
                  >
                    <Icon d={ICONS.ticket} className="size-5 text-white" />
                    {ticketLabel}
                  </a>
                  {ticketNote ? <p className="mt-3 max-w-sm text-sm leading-6 text-neutral-600">{ticketNote}</p> : null}
                </div>
              ) : null}
            </div>
          </div>

          <div className="min-w-0 space-y-14 lg:col-span-7">
            {hourRows.length || priceRows.length ? (
              <div className="grid grid-cols-1 gap-12 md:grid-cols-2 md:gap-10">
                {hourRows.length ? (
                  <div className="min-w-0">
                    <table className="w-full text-left">
                      <caption className="border-b border-neutral-950 pb-3 text-left">
                        <Sub className={label}>{hoursHeading || "Hours"}</Sub>
                      </caption>
                      <thead className="sr-only">
                        <tr>
                          <th scope="col">Days</th>
                          <th scope="col">Hours</th>
                        </tr>
                      </thead>
                      <tbody className="divide-y divide-neutral-200">
                        {hourRows.map((r, i) => (
                          <tr key={`${r.days}-${i}`}>
                            <th scope="row" className="py-3 pr-4 align-top text-sm leading-6 font-medium text-neutral-950">{r.days}</th>
                            <td className={`py-3 text-right align-top text-sm leading-6 tabular-nums ${isClosed(r.time) ? "font-serif text-neutral-500 italic" : "text-neutral-950"}`}>{r.time}</td>
                          </tr>
                        ))}
                      </tbody>
                    </table>
                    {hoursNote ? <p className="mt-4 text-sm leading-6 text-pretty text-neutral-600">{hoursNote}</p> : null}
                  </div>
                ) : null}

                {priceRows.length ? (
                  <div className="min-w-0">
                    <table className="w-full text-left">
                      <caption className="border-b border-neutral-950 pb-3 text-left">
                        <Sub className={label}>{admissionHeading || "Admission"}</Sub>
                      </caption>
                      <thead className="sr-only">
                        <tr>
                          <th scope="col">Visitor</th>
                          <th scope="col">Price</th>
                        </tr>
                      </thead>
                      <tbody className="divide-y divide-neutral-200">
                        {priceRows.map((r, i) => (
                          <tr key={`${r.category}-${i}`}>
                            <th scope="row" className="py-3 pr-4 align-top text-sm leading-6 font-medium text-neutral-950">
                              {r.category}
                              {r.note ? <span className="block text-xs leading-5 font-normal text-neutral-600">{r.note}</span> : null}
                            </th>
                            <td className={`py-3 text-right align-top font-serif text-xl leading-6 tabular-nums ${isFree(r.price) ? "text-indigo-700 italic" : "text-neutral-950"}`}>{r.price}</td>
                          </tr>
                        ))}
                      </tbody>
                    </table>
                  </div>
                ) : null}
              </div>
            ) : null}

            {freeList.length ? (
              <div className="relative overflow-hidden bg-indigo-50 p-6 sm:p-8">
                {/* Decorative watermark: generated content, so it isn't text that needs contrast. */}
                <span aria-hidden="true" className="pointer-events-none absolute -top-6 -right-2 font-serif text-9xl leading-none text-indigo-100 italic select-none before:content-['free']" />
                <Sub className={`relative ${label}`}>{freeDaysHeading || "Free days"}</Sub>
                <ul role="list" className="relative mt-4 space-y-3">
                  {freeList.map((f, i) => (
                    <li key={`${f}-${i}`} className="flex gap-3 font-serif text-lg leading-snug text-neutral-950 sm:text-xl">
                      <span aria-hidden="true" className="mt-2.5 h-px w-4 shrink-0 bg-indigo-600" />
                      {f}
                    </li>
                  ))}
                </ul>
              </div>
            ) : null}

            {parking || transit ? (
              <div>
                <Sub className={`border-b border-neutral-950 pb-3 ${label}`}>{gettingHereHeading || "Getting here"}</Sub>
                <dl className="mt-6 grid grid-cols-1 gap-8 sm:grid-cols-2">
                  {parking ? (
                    <div>
                      <dt className="flex items-center gap-2 text-sm font-semibold text-neutral-950">
                        <Icon d={ICONS.car} />
                        Parking
                      </dt>
                      <dd className="mt-2 text-sm leading-6 text-pretty text-neutral-600">{parking}</dd>
                    </div>
                  ) : null}
                  {transit ? (
                    <div>
                      <dt className="flex items-center gap-2 text-sm font-semibold text-neutral-950">
                        <Icon d={ICONS.bus} />
                        Transit
                      </dt>
                      <dd className="mt-2 text-sm leading-6 text-pretty text-neutral-600">{transit}</dd>
                    </div>
                  ) : null}
                </dl>
              </div>
            ) : null}

            {accessList.length || accessContact ? (
              <div>
                <Sub className={`border-b border-neutral-950 pb-3 ${label}`}>{accessHeading || "Accessibility"}</Sub>
                {accessList.length ? (
                  <dl className="mt-6 grid grid-cols-1 gap-x-8 gap-y-6 sm:grid-cols-2">
                    {accessList.map((a, i) => (
                      <div key={`${a.title}-${i}`} className="border-l border-indigo-600 pl-4">
                        <dt className="font-serif text-lg leading-snug text-neutral-950">{a.title}</dt>
                        {a.detail ? <dd className="mt-1 text-sm leading-6 text-pretty text-neutral-600">{a.detail}</dd> : null}
                      </div>
                    ))}
                  </dl>
                ) : null}
                {accessContact ? <p className="mt-8 text-sm leading-6 font-medium text-pretty text-neutral-950">{accessContact}</p> : null}
              </div>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
