# Add the "Event Hero" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/hero-event) to this Pantheon Content Publisher (P1) Next.js project. One event up front: calendar-page date stamp over a photo, time, location, cost, register and add-to-calendar links.

## Steps

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

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

/**
 * Hero (Event) — puts one event up front: a calendar-page date stamp over the photo, the
 * title, when and where, a register button and an add-to-calendar link.
 * Register: `HeroEventBlock: heroEventBlock` in puck.config.tsx.
 */

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

export type HeroEventProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  body: string;
  date: string;
  month: string;
  day: string;
  weekday: string;
  time: string;
  venue: string;
  address: string;
  cost: string;
  registerLabel: string;
  registerHref: string;
  calendarLabel: string;
  calendarHref: string;
  imageUrl: string;
  imageAlt: string;
};

export const heroEventBlock: ComponentConfig<HeroEventProps> = {
  label: "Hero (Event)",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the title, like the event series. Leave blank to hide it." } },
    heading: { type: "textarea", label: "Event title" },
    headingLevel: {
      type: "select",
      label: "Heading level",
      options: [
        { label: "H1 (page title)", value: "h1" },
        { label: "H2", value: "h2" },
        { label: "H3", value: "h3" },
        { label: "H4", value: "h4" },
      ],
      metadata: { help: "Use H1 when this hero is the top of the page. The look doesn't change." },
    },
    body: { type: "textarea", label: "Description" },
    date: { type: "text", label: "Date (machine-readable)", metadata: { help: "The date as YYYY-MM-DD, like 2026-06-13. Not shown; it helps search engines and assistive tech." } },
    month: { type: "text", label: "Month", metadata: { help: "Short month for the date stamp, like Jun." } },
    day: { type: "text", label: "Day", metadata: { help: "Day of the month, like 13." } },
    weekday: { type: "text", label: "Weekday", metadata: { help: "Shown under the day, like Saturday. Leave blank to hide it." } },
    time: { type: "text", label: "Time", metadata: { help: "Like 9 a.m. – 2 p.m." } },
    venue: { type: "text", label: "Venue" },
    address: { type: "text", label: "Address", metadata: { help: "Shown under the venue. Leave blank to hide it." } },
    cost: { type: "text", label: "Cost", metadata: { help: "Like Free or $15 adults, kids free. Leave blank to hide it." } },
    registerLabel: { type: "text", label: "Register button text" },
    registerHref: { type: "text", label: "Register link" },
    calendarLabel: { type: "text", label: "Calendar link text", metadata: { help: "Leave blank to hide it." } },
    calendarHref: { type: "text", label: "Calendar link", metadata: { help: "Link to an .ics file or a Google Calendar event link." } },
    imageUrl: { type: "text", label: "Image URL", metadata: { help: "Leave blank and the date stamp sits beside the details instead." } },
    imageAlt: { type: "text", label: "Image alt text", metadata: { help: "Describe the photo for screen reader users. Leave blank only if it's purely decorative." } },
  },
  defaultProps: {
    eyebrow: "Annual community celebration",
    heading: "Riverside Park Earth Day Cleanup & Festival",
    headingLevel: "h1",
    body: "Spend the morning restoring the riverbank with neighbors, then stay for live music, food trucks, tree giveaways and hands-on nature activities for kids.",
    date: "2026-04-25",
    month: "Apr",
    day: "25",
    weekday: "Saturday",
    time: "9 a.m. – 2 p.m.",
    venue: "Riverside Park, Main Pavilion",
    address: "1400 River Road, Louisville, KY",
    cost: "Free · gloves and tools provided",
    registerLabel: "Register to volunteer",
    registerHref: "/events/earth-day/register",
    calendarLabel: "Add to calendar",
    calendarHref: "/events/earth-day.ics",
    imageUrl: "https://picsum.photos/seed/riverbank/1200/1000",
    imageAlt: "Volunteers in work gloves planting saplings along a riverbank",
  },
  render: ({ eyebrow, heading, headingLevel, body, date, month, day, weekday, time, venue, address, cost, registerLabel, registerHref, calendarLabel, calendarHref, imageUrl, imageAlt }) => {
    const H = headingLevel || "h1";
    const hasStamp = Boolean(month || day);
    const stamp = hasStamp ? (
      <time
        dateTime={date || undefined}
        className="flex w-28 shrink-0 flex-col overflow-hidden rounded-2xl bg-white text-center shadow-xl ring-1 ring-neutral-950/10 sm:w-32"
      >
        <span className="bg-indigo-600 py-1.5 text-sm font-semibold tracking-widest text-white uppercase">{month}</span>
        <span className="pt-2 text-5xl font-semibold tracking-tight text-neutral-950 tabular-nums sm:text-6xl">{day}</span>
        {weekday ? <span className="pb-3 text-sm font-medium text-neutral-600">{weekday}</span> : <span className="pb-3" />}
      </time>
    ) : null;

    const details = [
      {
        key: "time",
        label: "Time",
        value: time,
        icon: "M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm.75-13a.75.75 0 0 0-1.5 0v5c0 .414.336.75.75.75h4a.75.75 0 0 0 0-1.5h-3.25V5Z",
      },
      {
        key: "venue",
        label: "Location",
        value: venue,
        sub: address,
        icon: "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",
      },
      {
        key: "cost",
        label: "Cost",
        value: cost,
        icon: "M5.5 3A2.5 2.5 0 0 0 3 5.5v2.879a2.5 2.5 0 0 0 .732 1.767l6.5 6.5a2.5 2.5 0 0 0 3.536 0l2.878-2.878a2.5 2.5 0 0 0 0-3.536l-6.5-6.5A2.5 2.5 0 0 0 8.38 3H5.5ZM6 7a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
      },
    ].filter((d) => d.value);

    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 items-center gap-12 lg:grid-cols-12 lg:gap-16">
          <div className="lg:col-span-6">
            {!imageUrl && stamp ? <div className="mb-8">{stamp}</div> : null}
            {eyebrow ? <p className="text-sm font-semibold text-indigo-700">{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}
            {body ? <p className="mt-6 max-w-xl text-lg leading-8 text-pretty text-neutral-600">{body}</p> : null}

            {details.length ? (
              <dl className="mt-8 divide-y divide-neutral-200 border-y border-neutral-200">
                {details.map((d) => (
                  <div key={d.key} className="flex gap-4 py-4">
                    <dt className="flex shrink-0 items-start">
                      <span className="sr-only">{d.label}</span>
                      <span aria-hidden="true" className="grid size-10 place-items-center rounded-lg bg-indigo-50 text-indigo-700">
                        <svg viewBox="0 0 20 20" fill="currentColor" className="size-5">
                          <path fillRule="evenodd" d={d.icon} clipRule="evenodd" />
                        </svg>
                      </span>
                    </dt>
                    <dd className="min-w-0 self-center text-base leading-6">
                      <span className="block font-semibold text-neutral-950">{d.value}</span>
                      {"sub" in d && d.sub ? <span className="block text-neutral-600">{d.sub}</span> : null}
                    </dd>
                  </div>
                ))}
              </dl>
            ) : null}

            {registerLabel || calendarLabel ? (
              <div className="mt-8 flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4">
                {registerLabel ? (
                  <a
                    href={registerHref || "#"}
                    className="inline-flex min-h-11 items-center justify-center rounded-lg bg-indigo-600 px-5 py-3 text-base font-semibold text-white shadow-sm transition hover:bg-indigo-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                  >
                    {registerLabel}
                  </a>
                ) : null}
                {calendarLabel ? (
                  <a
                    href={calendarHref || "#"}
                    className="inline-flex min-h-11 items-center justify-center gap-2 rounded-lg bg-white px-5 py-3 text-base font-semibold text-neutral-900 shadow-xs ring-1 ring-neutral-300 transition ring-inset hover:bg-neutral-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                  >
                    <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-5 text-neutral-500">
                      <path fillRule="evenodd" d="M5.75 2a.75.75 0 0 1 .75.75V4h7V2.75a.75.75 0 0 1 1.5 0V4h.25A2.75 2.75 0 0 1 18 6.75v8.5A2.75 2.75 0 0 1 15.25 18H4.75A2.75 2.75 0 0 1 2 15.25v-8.5A2.75 2.75 0 0 1 4.75 4H5V2.75A.75.75 0 0 1 5.75 2Zm-1 5.5c-.69 0-1.25.56-1.25 1.25v6.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25v-6.5c0-.69-.56-1.25-1.25-1.25H4.75ZM10 9.25a.75.75 0 0 1 .75.75v1.25H12a.75.75 0 0 1 0 1.5h-1.25V14a.75.75 0 0 1-1.5 0v-1.25H8a.75.75 0 0 1 0-1.5h1.25V10a.75.75 0 0 1 .75-.75Z" clipRule="evenodd" />
                    </svg>
                    {calendarLabel}
                  </a>
                ) : null}
              </div>
            ) : null}
          </div>

          {imageUrl ? (
            <div className="relative order-first pb-8 pl-8 lg:order-last lg:col-span-6 lg:pb-12 lg:pl-12">
              <img src={imageUrl} alt={imageAlt || ""} className="aspect-4/3 w-full rounded-3xl bg-neutral-100 object-cover lg:aspect-5/6" />
              {stamp ? <div className="absolute bottom-0 left-0 -rotate-3">{stamp}</div> : null}
            </div>
          ) : null}
        </div>
      </section>
    );
  },
};
```
