# Add the "Trip Itinerary" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/itinerary) to this Pantheon Content Publisher (P1) Next.js project. A multi-day plan of time-blocked stops on a vertical timeline, with neighborhoods, local tips and a print link.

## Steps

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

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

/**
 * Itinerary — a "48 hours in…" plan: days of time-blocked stops on a vertical timeline,
 * each with a neighborhood, what to do, an insider tip and a link, plus a save/print link.
 * Register: `ItineraryBlock: itineraryBlock` in puck.config.tsx.
 */

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

type Stop = {
  time: string;
  place: string;
  activity: string;
  neighborhood: string;
  tip: string;
  linkLabel: string;
  linkHref: string;
};

export type ItineraryProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  imageUrl: string;
  imageAlt: string;
  saveLabel: string;
  saveHref: string;
  days: {
    label: string;
    title: string;
    stops: Stop[];
  }[];
};

const childHeading: Record<Heading, "h2" | "h3" | "h4" | "h5"> = { h1: "h2", h2: "h3", h3: "h4", h4: "h5" };
const grandchildHeading: Record<Heading, "h3" | "h4" | "h5" | "h6"> = { h1: "h3", h2: "h4", h3: "h5", h4: "h6" };

const FOCUS = "focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";
const ARROW = "M2 8a.75.75 0 0 1 .75-.75h8.69L8.22 4.03a.75.75 0 0 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 0 1-1.06-1.06l3.22-3.22H2.75A.75.75 0 0 1 2 8Z";

const blankStop: Stop = { time: "", place: "New stop", activity: "", neighborhood: "", tip: "", linkLabel: "", linkHref: "" };

export const itineraryBlock: ComponentConfig<ItineraryProps> = {
  label: "Itinerary",
  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. Day titles use the next level down, stops the level after." },
    },
    intro: { type: "textarea", label: "Intro" },
    imageUrl: { type: "text", label: "Image URL", metadata: { help: "Optional photo beside the intro on wide screens. Leave blank to hide it." } },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
    saveLabel: { type: "text", label: "Save / print link text", metadata: { help: "Leave blank to hide it." } },
    saveHref: { type: "text", label: "Save / print link", metadata: { help: "Usually a printable PDF of this itinerary." } },
    days: {
      type: "array",
      label: "Days",
      min: 1,
      max: 5,
      getItemSummary: (item) => `${item?.label ? `${item.label}: ` : ""}${item?.title || "Day"}`,
      defaultItemProps: { label: "Day three", title: "New day", stops: [blankStop] },
      arrayFields: {
        label: { type: "text", label: "Day label", metadata: { help: "Short tag like “Day one · Friday”." } },
        title: { type: "text", label: "Day title" },
        stops: {
          type: "array",
          label: "Stops",
          min: 1,
          max: 10,
          getItemSummary: (item) => `${item?.time ? `${item.time} · ` : ""}${item?.place || "Stop"}`,
          defaultItemProps: blankStop,
          arrayFields: {
            time: { type: "text", label: "Time", metadata: { help: "Like “9:00 AM” or “Late afternoon”." } },
            place: { type: "text", label: "Place" },
            activity: { type: "textarea", label: "What to do" },
            neighborhood: { type: "text", label: "Neighborhood", metadata: { help: "Leave blank to hide it." } },
            tip: { type: "textarea", label: "Local tip", metadata: { help: "Optional insider advice, shown in a highlighted note." } },
            linkLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to hide the link." } },
            linkHref: { type: "text", label: "Link" },
          },
        },
      },
    },
  },
  defaultProps: {
    eyebrow: "Itinerary",
    heading: "48 hours in Riverbend",
    headingLevel: "h2",
    intro: "Two days, one river, no car needed. This plan follows the water from the farmers market to the bluffs, with time built in to wander.",
    imageUrl: "https://picsum.photos/seed/riverbend-weekend/1200/900",
    imageAlt: "A pedestrian bridge strung with lights over a river at dusk",
    saveLabel: "Save or print this itinerary (PDF)",
    saveHref: "/itineraries/48-hours.pdf",
    days: [
      {
        label: "Day one · Saturday",
        title: "Market mornings and river evenings",
        stops: [
          {
            time: "8:30 AM",
            place: "Riverbend Farmers Market",
            activity: "Grab a sorghum biscuit and coffee, then browse 90 stalls of local produce, honey and pottery.",
            neighborhood: "Market Square",
            tip: "The bakers sell out by 10. Go straight to the north row first.",
            linkLabel: "Market hours",
            linkHref: "/places/farmers-market",
          },
          {
            time: "11:00 AM",
            place: "Levee Trail by bike",
            activity: "Rent a bike share and ride the flat, 6-mile loop past the lock and dam and Heron Marsh.",
            neighborhood: "Riverfront",
            tip: "",
            linkLabel: "",
            linkHref: "",
          },
          {
            time: "2:00 PM",
            place: "Tobacco Row galleries",
            activity: "Six studios in restored warehouses. Most artists are in on Saturdays and happy to talk shop.",
            neighborhood: "Warehouse District",
            tip: "",
            linkLabel: "Gallery map",
            linkHref: "/arts/tobacco-row",
          },
          {
            time: "7:00 PM",
            place: "Dinner on Front Street",
            activity: "Book a patio table at one of the riverfront kitchens, then walk the lit bridge to the Bluff side.",
            neighborhood: "Downtown",
            tip: "Reservations open 14 days out and patio seats go fast in summer.",
            linkLabel: "",
            linkHref: "",
          },
        ],
      },
      {
        label: "Day two · Sunday",
        title: "Bluffs, brunch and the long way home",
        stops: [
          {
            time: "9:00 AM",
            place: "Bluff Overlook hike",
            activity: "A 2-mile loop with stairs to the best view of the river bend that gave the town its name.",
            neighborhood: "Bluff Park",
            tip: "",
            linkLabel: "Trail details",
            linkHref: "/places/bluff-overlook",
          },
          {
            time: "11:30 AM",
            place: "Brunch in Old Mill",
            activity: "Settle into a long brunch in the converted grist mill neighborhood, then browse the bookshop next door.",
            neighborhood: "Old Mill",
            tip: "",
            linkLabel: "",
            linkHref: "",
          },
          {
            time: "2:30 PM",
            place: "Riverboat heritage cruise",
            activity: "A 75-minute narrated cruise past the old ferry landing and the island lighthouse.",
            neighborhood: "Riverfront",
            tip: "Sit on the upper deck, port side, for the lighthouse.",
            linkLabel: "Cruise tickets",
            linkHref: "/places/heritage-cruise",
          },
        ],
      },
    ],
  },
  render: ({ id, eyebrow, heading, headingLevel, intro, imageUrl, imageAlt, saveLabel, saveHref, days }) => {
    const H = headingLevel || "h2";
    const DayH = childHeading[H] ?? "h3";
    const StopH = grandchildHeading[H] ?? "h4";
    const dayList = (days ?? []).filter((d) => d?.title || d?.label || (d?.stops ?? []).length);
    const hasHeader = Boolean(eyebrow || heading || intro || saveLabel || imageUrl);
    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-6xl">
          {hasHeader ? (
            <div className="grid grid-cols-1 gap-10 lg:grid-cols-12 lg:items-center lg:gap-12">
              <div className={imageUrl ? "lg:col-span-7" : "lg:col-span-12 lg:max-w-3xl"}>
                {eyebrow ? <p className="text-sm font-semibold tracking-widest text-indigo-700 uppercase">{eyebrow}</p> : null}
                {heading ? (
                  <H className={`${eyebrow ? "mt-3" : ""} text-4xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-5xl lg:text-6xl`}>{heading}</H>
                ) : null}
                {intro ? <p className="mt-6 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
                {saveLabel ? (
                  <a
                    href={saveHref || "#"}
                    className={`mt-8 inline-flex min-h-11 items-center gap-2 rounded-lg bg-neutral-950 px-4 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-neutral-800 ${FOCUS}`}
                  >
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5">
                      <path fillRule="evenodd" d="M5 2.75C5 1.784 5.784 1 6.75 1h6.5c.966 0 1.75.784 1.75 1.75v3.552c.377.046.752.097 1.126.153A2.212 2.212 0 0 1 18 8.653v4.097A2.25 2.25 0 0 1 15.75 15h-.241l.305 1.984A1.75 1.75 0 0 1 14.084 19H5.915a1.75 1.75 0 0 1-1.73-2.016L4.492 15H4.25A2.25 2.25 0 0 1 2 12.75V8.653c0-1.082.775-2.034 1.874-2.198.374-.056.75-.107 1.127-.153L5 6.25v-3.5Zm8.5 3.397a41.533 41.533 0 0 0-7 0V2.75a.25.25 0 0 1 .25-.25h6.5a.25.25 0 0 1 .25.25v3.397ZM6.608 12.5a.25.25 0 0 0-.247.212l-.693 4.5a.25.25 0 0 0 .247.288h8.17a.25.25 0 0 0 .246-.288l-.692-4.5a.25.25 0 0 0-.247-.212H6.608Z" clipRule="evenodd" />
                    </svg>
                    {saveLabel}
                  </a>
                ) : null}
              </div>
              {imageUrl ? (
                <div className="lg:col-span-5">
                  <img src={imageUrl} alt={imageAlt || ""} className="aspect-4/3 w-full rounded-3xl bg-neutral-200 object-cover shadow-xl shadow-neutral-950/10 lg:rotate-1" />
                </div>
              ) : null}
            </div>
          ) : null}

          {dayList.length > 0 ? (
            <div className={`${hasHeader ? "mt-16 sm:mt-20" : ""} space-y-16 sm:space-y-20`}>
              {dayList.map((day, d) => {
                const stops = (day.stops ?? []).filter((s) => s?.place || s?.activity);
                const dayId = `${id || "itinerary"}-day-${d}`;
                return (
                  <article key={`${day.title}-${d}`} aria-labelledby={dayId} className="grid grid-cols-1 gap-8 lg:grid-cols-12 lg:gap-12">
                    <header className="lg:col-span-4">
                      <div className="lg:sticky lg:top-8">
                        <p aria-hidden="true" className="text-6xl font-semibold tracking-tighter text-indigo-600 tabular-nums sm:text-7xl">
                          {String(d + 1).padStart(2, "0")}
                        </p>
                        {day.label ? <p className="mt-3 text-sm font-semibold tracking-widest text-neutral-500 uppercase">{day.label}</p> : null}
                        <DayH id={dayId} className="mt-2 text-2xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-3xl">
                          {day.title || day.label || `Day ${d + 1}`}
                        </DayH>
                      </div>
                    </header>

                    {stops.length > 0 ? (
                      <ol role="list" className="relative lg:col-span-8">
                        {stops.map((stop, s) => {
                          const last = s === stops.length - 1;
                          return (
                            <li key={`${stop.place}-${s}`} className={`relative pl-9 sm:flex sm:gap-6 ${last ? "" : "pb-10"}`}>
                              {!last ? <span aria-hidden="true" className="absolute top-3 bottom-0 left-1.5 w-px -translate-x-1/2 bg-neutral-200" /> : null}
                              <span aria-hidden="true" className="absolute top-1.5 left-0 size-3 rounded-full bg-white ring-4 ring-indigo-600" />
                              <p className="text-sm font-semibold text-indigo-700 tabular-nums sm:w-24 sm:shrink-0 sm:pt-0.5">{stop.time}</p>
                              <div className="mt-1 min-w-0 sm:mt-0 sm:flex-1">
                                <StopH className="text-lg font-semibold tracking-tight text-neutral-950">{stop.place}</StopH>
                                {stop.neighborhood ? (
                                  <p className="mt-1 flex items-center gap-1.5 text-sm text-neutral-600">
                                    <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-4 shrink-0 text-neutral-400">
                                      <path fillRule="evenodd" d="m7.539 14.841.003.003.002.002a.755.755 0 0 0 .912 0l.002-.002.003-.003.012-.009a5.57 5.57 0 0 0 .19-.153 15.588 15.588 0 0 0 2.046-2.082c1.101-1.362 2.291-3.342 2.291-5.597A5 5 0 0 0 3 7c0 2.255 1.19 4.235 2.292 5.597a15.591 15.591 0 0 0 2.046 2.082 8.916 8.916 0 0 0 .189.153l.012.01ZM8 8.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" clipRule="evenodd" />
                                    </svg>
                                    <span className="sr-only">Neighborhood: </span>
                                    {stop.neighborhood}
                                  </p>
                                ) : null}
                                {stop.activity ? <p className="mt-3 text-base leading-7 text-pretty text-neutral-700">{stop.activity}</p> : null}
                                {stop.tip ? (
                                  <p className="mt-4 rounded-xl bg-indigo-50 px-4 py-3 text-sm leading-6 text-pretty text-indigo-950">
                                    <span className="font-semibold">Local tip: </span>
                                    {stop.tip}
                                  </p>
                                ) : null}
                                {stop.linkLabel ? (
                                  <a
                                    href={stop.linkHref || "#"}
                                    className={`group mt-2 inline-flex min-h-11 items-center gap-1.5 rounded-sm text-sm font-semibold text-indigo-700 hover:text-indigo-900 ${FOCUS}`}
                                  >
                                    {stop.linkLabel}
                                    <span className="sr-only"> for {stop.place}</span>
                                    <svg aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" className="size-4 transition group-hover:translate-x-0.5">
                                      <path fillRule="evenodd" d={ARROW} clipRule="evenodd" />
                                    </svg>
                                  </a>
                                ) : null}
                              </div>
                            </li>
                          );
                        })}
                      </ol>
                    ) : null}
                  </article>
                );
              })}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
