# Add the "Getting Here" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/getting-here) to this Pantheon Content Publisher (P1) Next.js project. Arrival by air, car, train, bus and bike, a travel-time table, parking garages and local transit notes.

## Steps

1. Create `components/puck/getting-here-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 { gettingHereBlock } from "./components/puck/getting-here-block";`
3. Register it under `components` as `GettingHereBlock: gettingHereBlock`.
4. Add `"GettingHereBlock"` 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/getting-here-block.tsx`

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

/**
 * Getting Here — arrival options by air, car, train, bus and bike, a travel-time table from
 * nearby cities, downtown parking garages with rates, and local transit, bike share and
 * accessible-transportation notes. Register: `GettingHereBlock: gettingHereBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Mode = "air" | "car" | "train" | "bus" | "bike";

export type GettingHereProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  modes: { mode: Mode; title: string; text: string; linkLabel: string; linkHref: string }[];
  timesHeading: string;
  timesColumns: string;
  times: { city: string; values: string }[];
  timesNote: string;
  parkingHeading: string;
  garages: { name: string; address: string; rates: string; detail: string }[];
  transitHeading: string;
  transit: string;
  bikeShareHeading: string;
  bikeShare: string;
  accessHeading: string;
  access: string;
};

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";

// 24px stroke icons, one per mode.
const MODE_ICONS: Record<Mode, string[]> = {
  air: ["M6 12 3.269 3.125A59.769 59.769 0 0 1 21.485 12 59.768 59.768 0 0 1 3.27 20.875L5.999 12Zm0 0h7.5"],
  car: [
    "M8.25 18.75a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h6m-9 0H3.375a1.125 1.125 0 0 1-1.125-1.125V14.25m17.25 4.5a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h1.125c.621 0 1.129-.504 1.09-1.124a17.902 17.902 0 0 0-3.213-9.193 2.056 2.056 0 0 0-1.58-.86H14.25M16.5 18.75h-2.25m0-11.177v-.958c0-.568-.422-1.048-.987-1.106a48.554 48.554 0 0 0-10.026 0 1.106 1.106 0 0 0-.987 1.106v7.635m12-6.677v6.677m0 4.5v-4.5m0 0h-12",
  ],
  train: ["M7 16.5h10M8 19.5l-1.5 2.25M16 19.5l1.5 2.25M7.5 3h9A2.5 2.5 0 0 1 19 5.5v9a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3v-9A2.5 2.5 0 0 1 7.5 3ZM5 11h14M9 14h.01M15 14h.01"],
  bus: ["M6 17v2.5M18 17v2.5M5 4.5h14a1 1 0 0 1 1 1V16a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5.5a1 1 0 0 1 1-1ZM4 11h16M8 14h.01M16 14h.01"],
  bike: ["M5.5 17.5a3.5 3.5 0 1 0 0-.01M18.5 17.5a3.5 3.5 0 1 0 0-.01M5.5 17.5 9 9h6l3.5 8.5M9 9 7.5 6H5.5M12 17.5 15 9M14 6h2.5"],
};

const MODE_LABELS: Record<Mode, string> = { air: "By air", car: "By car", train: "By train", bus: "By bus", bike: "By bike" };

const LG_COLS = ["lg:grid-cols-1", "lg:grid-cols-1", "lg:grid-cols-2", "lg:grid-cols-3", "lg:grid-cols-4", "lg:grid-cols-5"];

const splitCells = (raw: string) => (raw || "").split("|").map((c) => c.trim());

export const gettingHereBlock: ComponentConfig<GettingHereProps> = {
  label: "Getting Here",
  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. Panel titles use the next level down." },
    },
    intro: { type: "textarea", label: "Intro" },
    modes: {
      type: "array",
      label: "Ways to arrive",
      min: 0,
      max: 5,
      getItemSummary: (item) => item?.title || MODE_LABELS[item?.mode as Mode] || "Mode",
      defaultItemProps: { mode: "car", title: "By car", text: "", linkLabel: "", linkHref: "" },
      arrayFields: {
        mode: {
          type: "select",
          label: "Mode",
          options: [
            { label: "Air", value: "air" },
            { label: "Car", value: "car" },
            { label: "Train", value: "train" },
            { label: "Bus", value: "bus" },
            { label: "Bike", value: "bike" },
          ],
          metadata: { help: "Picks the icon." },
        },
        title: { type: "text", label: "Title" },
        text: { type: "textarea", label: "Text" },
        linkLabel: { type: "text", label: "Link text", metadata: { help: "Leave blank to hide the link." } },
        linkHref: { type: "text", label: "Link" },
      },
    },
    timesHeading: { type: "text", label: "Travel times heading", metadata: { help: "Leave blank and remove all rows to hide the table." } },
    timesColumns: { type: "text", label: "Travel time columns", metadata: { help: "Column headers after the city, separated by “|”, like “By car | By train | By air”." } },
    times: {
      type: "array",
      label: "Travel times",
      min: 0,
      max: 10,
      getItemSummary: (item) => item?.city || "City",
      defaultItemProps: { city: "New city", values: "— | — | —" },
      arrayFields: {
        city: { type: "text", label: "From city" },
        values: { type: "text", label: "Times", metadata: { help: "One per column, separated by “|”, like “2 hr 10 min | 3 hr | —”. Use — when there's no option." } },
      },
    },
    timesNote: { type: "text", label: "Travel times note", metadata: { help: "Source or caveat under the table, like “Typical drive times; traffic varies.”" } },
    parkingHeading: { type: "text", label: "Parking heading" },
    garages: {
      type: "array",
      label: "Parking garages",
      min: 0,
      max: 8,
      getItemSummary: (item) => item?.name || "Garage",
      defaultItemProps: { name: "New garage", address: "", rates: "", detail: "" },
      arrayFields: {
        name: { type: "text", label: "Name" },
        address: { type: "text", label: "Address" },
        rates: { type: "text", label: "Rates", metadata: { help: "Like “$2/hr · $12 daily max”." } },
        detail: { type: "text", label: "Detail", metadata: { help: "Optional, like “EV charging, 24/7”." } },
      },
    },
    transitHeading: { type: "text", label: "Local transit heading" },
    transit: { type: "textarea", label: "Local transit" },
    bikeShareHeading: { type: "text", label: "Bike share heading" },
    bikeShare: { type: "textarea", label: "Bike share" },
    accessHeading: { type: "text", label: "Accessibility heading" },
    access: { type: "textarea", label: "Accessible transportation" },
  },
  defaultProps: {
    eyebrow: "Plan your trip",
    heading: "Getting to Riverbend",
    headingLevel: "h2",
    intro: "Riverbend sits where two interstates meet the river, with a regional airport 15 minutes from downtown and daily trains on the River Valley line.",
    modes: [
      { mode: "air", title: "By air", text: "Riverbend Regional Airport (RBR) has nonstop flights to six hubs. Rideshare and the Route 10 bus reach downtown in about 15 minutes.", linkLabel: "Airport info", linkHref: "https://flyrbr.example.org" },
      { mode: "car", title: "By car", text: "Take I-64 to Exit 12 (Front Street) for downtown, or Exit 14 for Old Mill and the Warehouse District.", linkLabel: "", linkHref: "" },
      { mode: "train", title: "By train", text: "The River Valley line stops twice daily at Union Depot, a 5-minute walk from Front Street.", linkLabel: "Train schedule", linkHref: "/getting-here/train" },
      { mode: "bus", title: "By bus", text: "Intercity buses arrive at the Market Street Transit Center, with connections to every local route.", linkLabel: "", linkHref: "" },
      { mode: "bike", title: "By bike", text: "The 40-mile River Valley Trail ends at the Riverfront trailhead, with bike lockers and a repair stand.", linkLabel: "Trail map", linkHref: "/places/river-valley-trail" },
    ],
    timesHeading: "Travel times from nearby cities",
    timesColumns: "By car | By train | By air",
    times: [
      { city: "Lakeport", values: "1 hr 40 min | 2 hr 15 min | —" },
      { city: "Capital City", values: "2 hr 30 min | 3 hr | 50 min" },
      { city: "Granite Falls", values: "3 hr 15 min | — | 1 hr 5 min" },
      { city: "Port Meridian", values: "4 hr 45 min | 5 hr 30 min | 1 hr 20 min" },
    ],
    timesNote: "Sample figures. Typical times without traffic or layovers; check carriers for current schedules.",
    parkingHeading: "Downtown parking",
    garages: [
      { name: "Market Street Garage", address: "120 Market Street", rates: "$2/hr · $12 daily max", detail: "EV charging, open 24/7" },
      { name: "Convention Center Garage", address: "500 Convention Way", rates: "$3/hr · $18 daily max", detail: "Event rates may apply" },
      { name: "Riverfront Surface Lot", address: "Front Street at Ferry Landing", rates: "Free on weekends", detail: "Accessible spaces near the riverwalk" },
    ],
    transitHeading: "Getting around",
    transit: "The free Riverbend Trolley loops Downtown, Old Mill and the Warehouse District every 15 minutes, 7 AM–11 PM. City buses take contactless cards; a day pass is $3.",
    bikeShareHeading: "Bike share",
    bikeShare: "Bend Bikes has 30 docks across downtown. Unlock with the app or a credit card: $1 to start, then 15¢ a minute, with e-bikes on every dock.",
    accessHeading: "Accessible transportation",
    access: "Every trolley and bus is wheelchair accessible with a ramp. Riverbend Access paratransit offers door-to-door rides for visitors with an eligibility card from any U.S. transit agency; call (555) 555-0187 a day ahead.",
  },
  render: ({
    id,
    eyebrow,
    heading,
    headingLevel,
    intro,
    modes,
    timesHeading,
    timesColumns,
    times,
    timesNote,
    parkingHeading,
    garages,
    transitHeading,
    transit,
    bikeShareHeading,
    bikeShare,
    accessHeading,
    access,
  }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const Item = grandchildHeading[H] ?? "h4";
    const uid = id || "getting-here";
    const modeList = (modes ?? []).filter((m) => m?.title || m?.text);
    const rows = (times ?? []).filter((t) => t?.city);
    const cols = splitCells(timesColumns).filter(Boolean);
    const garageList = (garages ?? []).filter((g) => g?.name);
    const notes = [
      { title: transitHeading, text: transit, icon: "M8.25 18.75a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m3 0h6m-9 0H3.375a1.125 1.125 0 0 1-1.125-1.125V5.625c0-.621.504-1.125 1.125-1.125h17.25c.621 0 1.125.504 1.125 1.125v12a1.125 1.125 0 0 1-1.125 1.125H18.75m-4.5 0a1.5 1.5 0 0 0 3 0m-3 0a1.5 1.5 0 0 1 3 0M2.25 11.25h19.5" },
      { title: bikeShareHeading, text: bikeShare, icon: MODE_ICONS.bike[0] },
      { title: accessHeading, text: access, icon: "M12 4.5a1.5 1.5 0 1 0 0-.01M7.5 8.25h9M12 8.25v5.25m0 0-3 6m3-6 3 6" },
    ].filter((n) => n.text);
    const hasHeader = Boolean(eyebrow || heading || intro);
    const capId = `${uid}-times`;
    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">
          {hasHeader ? (
            <div className="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`}>{heading}</H> : null}
              {intro ? <p className="mt-5 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {modeList.length > 0 ? (
            <ul role="list" className={`${hasHeader ? "mt-12" : ""} grid grid-cols-1 gap-px overflow-hidden rounded-3xl bg-neutral-200 ring-1 ring-neutral-200 sm:grid-cols-2 ${LG_COLS[modeList.length] ?? "lg:grid-cols-5"}`}>
              {modeList.map((m, i) => {
                const mode: Mode = MODE_ICONS[m.mode] ? m.mode : "car";
                return (
                  <li
                    key={`${m.title}-${i}`}
                    className={`flex flex-col bg-white p-6 ${modeList.length % 2 === 1 && i === modeList.length - 1 ? "sm:col-span-2 lg:col-span-1" : ""}`}
                  >
                    <span aria-hidden="true" className="grid size-11 place-items-center rounded-xl bg-indigo-50 text-indigo-700">
                      <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" className="size-6">
                        {MODE_ICONS[mode].map((d) => (
                          <path key={d} d={d} />
                        ))}
                      </svg>
                    </span>
                    <Sub className="mt-4 text-lg font-semibold tracking-tight text-neutral-950">{m.title || MODE_LABELS[mode]}</Sub>
                    {m.text ? <p className="mt-2 text-sm leading-6 text-pretty text-neutral-600">{m.text}</p> : null}
                    {m.linkLabel ? (
                      <a href={m.linkHref || "#"} className={`group mt-auto inline-flex min-h-11 items-center gap-1.5 self-start rounded-sm pt-3 text-sm font-semibold text-indigo-700 hover:text-indigo-900 ${FOCUS}`}>
                        {m.linkLabel}
                        <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}
                  </li>
                );
              })}
            </ul>
          ) : null}

          {rows.length > 0 || garageList.length > 0 ? (
            <div className="mt-12 grid grid-cols-1 gap-8 sm:mt-16 lg:grid-cols-12 lg:gap-12">
              {rows.length > 0 ? (
                <div className={garageList.length > 0 ? "min-w-0 lg:col-span-7" : "min-w-0 lg:col-span-12"}>
                  {timesHeading ? <Sub id={capId} className="text-2xl font-semibold tracking-tight text-neutral-950">{timesHeading}</Sub> : null}
                  <div
                    role="region"
                    aria-labelledby={timesHeading ? capId : undefined}
                    aria-label={timesHeading ? undefined : "Travel times"}
                    tabIndex={0}
                    className={`relative mt-5 overflow-x-auto rounded-2xl ring-1 ring-neutral-200 ${FOCUS}`}
                  >
                    <table className="w-full min-w-md text-left text-sm">
                      <thead className="bg-neutral-50 text-neutral-700">
                        <tr>
                          <th scope="col" className="px-5 py-3 font-semibold">From</th>
                          {cols.map((c, k) => (
                            <th key={`${c}-${k}`} scope="col" className="px-4 py-3 font-semibold">{c}</th>
                          ))}
                        </tr>
                      </thead>
                      <tbody className="divide-y divide-neutral-100">
                        {rows.map((r, i) => {
                          const cells = splitCells(r.values);
                          return (
                            <tr key={`${r.city}-${i}`}>
                              <th scope="row" className="px-5 py-3.5 font-semibold text-neutral-950">{r.city}</th>
                              {cols.map((c, k) => {
                                const v = cells[k] || "—";
                                const none = v === "—" || v === "-";
                                return (
                                  <td key={`${c}-${k}`} className={`px-4 py-3.5 tabular-nums ${none ? "text-neutral-500" : "text-neutral-800"}`}>
                                    {none ? (
                                      <>
                                        <span aria-hidden="true">—</span>
                                        <span className="sr-only">Not available</span>
                                      </>
                                    ) : (
                                      v
                                    )}
                                  </td>
                                );
                              })}
                            </tr>
                          );
                        })}
                      </tbody>
                    </table>
                  </div>
                  {timesNote ? <p className="mt-3 text-sm text-neutral-600">{timesNote}</p> : null}
                </div>
              ) : null}

              {garageList.length > 0 ? (
                <div className={rows.length > 0 ? "lg:col-span-5" : "lg:col-span-12"}>
                  {parkingHeading ? <Sub className="text-2xl font-semibold tracking-tight text-neutral-950">{parkingHeading}</Sub> : null}
                  <ul role="list" className="mt-5 space-y-3">
                    {garageList.map((g, i) => (
                      <li key={`${g.name}-${i}`} className="flex gap-4 rounded-2xl bg-neutral-50 p-4 ring-1 ring-neutral-950/5">
                        <span aria-hidden="true" className="grid size-10 shrink-0 place-items-center rounded-lg bg-indigo-600 text-lg font-bold text-white">
                          P
                        </span>
                        <div className="min-w-0 flex-1">
                          <div className="flex flex-wrap items-baseline justify-between gap-x-3">
                            <Item className="text-base font-semibold text-neutral-950">{g.name}</Item>
                            {g.rates ? <p className="text-sm font-semibold text-indigo-700 tabular-nums">{g.rates}</p> : null}
                          </div>
                          {g.address ? <p className="mt-0.5 text-sm text-neutral-600">{g.address}</p> : null}
                          {g.detail ? <p className="mt-1 text-sm text-neutral-600">{g.detail}</p> : null}
                        </div>
                      </li>
                    ))}
                  </ul>
                </div>
              ) : null}
            </div>
          ) : null}

          {notes.length > 0 ? (
            <div className="mt-12 grid grid-cols-1 gap-6 border-t border-neutral-200 pt-10 sm:mt-16 md:grid-cols-3">
              {notes.map((n, i) => (
                <div key={`${n.title}-${i}`}>
                  {n.title ? (
                  <Sub className="flex items-center gap-2 text-base font-semibold text-neutral-950">
                    <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" className="size-5 text-indigo-600">
                      <path d={n.icon} />
                    </svg>
                    {n.title}
                  </Sub>
                  ) : null}
                  <p className="mt-2 text-sm leading-6 text-pretty text-neutral-600">{n.text}</p>
                </div>
              ))}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
