# Add the "Permit Guide" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/permit-guide) to this Pantheon Content Publisher (P1) Next.js project. Permits and licenses as expandable cards with fee, processing time, required documents and how to apply.

## Steps

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

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

/**
 * Permit Guide — permits and licenses as expandable cards. Each summary shows the fee and
 * typical processing time; opening it shows when you need it, what to bring and how to apply.
 * Register: `PermitGuideBlock: permitGuideBlock` in puck.config.tsx.
 */

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

export type PermitGuideProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  permits: {
    name: string;
    whenNeeded: string;
    fee: string;
    processingTime: string;
    documents: string;
    applyHref: string;
    infoHref: string;
  }[];
  contactLabel: string;
  contactText: string;
  contactPhone: string;
  contactEmail: string;
};

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

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

export const permitGuideBlock: ComponentConfig<PermitGuideProps> = {
  label: "Permit Guide",
  fields: {
    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" },
    permits: {
      type: "array",
      label: "Permits and licenses",
      min: 1,
      max: 20,
      getItemSummary: (item) => item?.name || "Permit",
      defaultItemProps: { name: "New permit", whenNeeded: "", fee: "", processingTime: "", documents: "", applyHref: "", infoHref: "" },
      arrayFields: {
        name: { type: "text", label: "Permit name" },
        whenNeeded: { type: "textarea", label: "When you need it", metadata: { help: "One or two plain sentences. Name the most common projects or situations." } },
        fee: { type: "text", label: "Fee", metadata: { help: "Like $85, or $50 plus $0.10 per square foot. Leave blank to hide it." } },
        processingTime: { type: "text", label: "Typical processing time", metadata: { help: "Like 5–10 business days." } },
        documents: { type: "textarea", label: "Required documents", metadata: { help: "One document per line. Each line becomes a checklist item." } },
        applyHref: { type: "text", label: "Apply link", metadata: { help: "The online application or a fillable form. Leave blank to hide the button." } },
        infoHref: { type: "text", label: "More info link", metadata: { help: "A page with full rules and FAQs. Leave blank to hide it." } },
      },
    },
    contactLabel: { type: "text", label: "Contact heading", metadata: { help: "Like Permit desk. Leave blank to hide the contact panel." } },
    contactText: { type: "textarea", label: "Contact details", metadata: { help: "Office location and hours." } },
    contactPhone: { type: "text", label: "Phone", metadata: { help: "Shown as a tap-to-call link." } },
    contactEmail: { type: "text", label: "Email" },
  },
  defaultProps: {
    heading: "Permits and licenses",
    headingLevel: "h2",
    intro: "Find the permit you need, what it costs and what to bring. Most applications can be filed online. If you aren't sure which permit applies, call the permit desk before you start work.",
    permits: [
      {
        name: "Residential building permit",
        whenNeeded: "Additions, decks over 30 inches high, finished basements, new garages, and any change to load-bearing walls.",
        fee: "From $150",
        processingTime: "10–15 business days",
        documents: "Site plan showing property lines and setbacks\nConstruction drawings with dimensions\nContractor license number, or homeowner affidavit\nProof of property ownership",
        applyHref: "/permits/building/apply",
        infoHref: "/permits/building",
      },
      {
        name: "Fence permit",
        whenNeeded: "Any new or replacement fence. Fences in front yards can be no taller than 4 feet.",
        fee: "$45",
        processingTime: "3–5 business days",
        documents: "Site plan showing the fence location\nFence height and material\nHOA approval letter, if your neighborhood has one",
        applyHref: "/permits/fence/apply",
        infoHref: "/permits/fence",
      },
      {
        name: "Special event permit",
        whenNeeded: "Block parties, races, festivals, or any gathering that closes a street or uses a city park for more than 50 people.",
        fee: "$75 plus park rental",
        processingTime: "30 days before the event",
        documents: "Event map showing street closures\nCertificate of liability insurance\nTrash and restroom plan",
        applyHref: "/permits/special-event/apply",
        infoHref: "/permits/special-event",
      },
      {
        name: "Business license",
        whenNeeded: "Every business operating in Millbrook, including home-based businesses. Renew each year by January 31.",
        fee: "$60 per year",
        processingTime: "2–3 business days",
        documents: "State business registration or DBA filing\nFederal EIN, or SSN for sole proprietors\nZoning approval for the business address",
        applyHref: "/licenses/business/apply",
        infoHref: "/licenses/business",
      },
    ],
    contactLabel: "Permit desk",
    contactText: "City Hall, Room 104. Open Monday to Friday, 8 a.m. to 4:30 p.m. Walk-ins welcome until 4 p.m.",
    contactPhone: "(555) 555-0142",
    contactEmail: "permits@millbrook.example.gov",
  },
  render: ({ heading, headingLevel, intro, permits, contactLabel, contactText, contactPhone, contactEmail }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (permits ?? []).filter((p) => p?.name);
    const hasContact = Boolean(contactLabel && (contactText || contactPhone || contactEmail));
    return (
      <section className="bg-neutral-50 px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <div className="mx-auto max-w-4xl">
          {heading || intro ? (
            <div className="max-w-2xl">
              {heading ? <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">{heading}</H> : null}
              {intro ? <p className="mt-4 text-base leading-7 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          {list.length ? (
            <div className={`space-y-3 ${heading || intro ? "mt-10 sm:mt-12" : ""}`}>
              {list.map((permit, i) => {
                const docs = (permit.documents ?? "")
                  .split("\n")
                  .map((d) => d.trim())
                  .filter(Boolean);
                return (
                  <details
                    key={`${permit.name}-${i}`}
                    className="group rounded-2xl bg-white shadow-sm ring-1 ring-neutral-200 transition open:shadow-md open:ring-neutral-300"
                  >
                    <summary
                      className={`relative block min-h-11 cursor-pointer list-none rounded-2xl p-5 pr-16 sm:p-6 sm:pr-20 [&::-webkit-details-marker]:hidden ${focusRing}`}
                    >
                        <Sub className="text-lg leading-snug font-semibold text-pretty text-neutral-950">{permit.name}</Sub>
                        {permit.fee || permit.processingTime ? (
                          <span className="mt-2 flex flex-wrap gap-x-5 gap-y-1 text-sm leading-6 text-neutral-700">
                            {permit.fee ? (
                              <span className="inline-flex items-center gap-1.5">
                                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 text-indigo-600">
                                  <path d="M10.75 10.818v2.614A3.13 3.13 0 0 0 11.888 13c.482-.315.612-.648.612-.875 0-.227-.13-.56-.612-.875a3.13 3.13 0 0 0-1.138-.432ZM8.33 8.62c.053.055.115.11.184.164.208.16.46.284.736.363V6.603a2.45 2.45 0 0 0-.35.13c-.14.065-.27.143-.386.233-.377.292-.514.627-.514.909 0 .184.058.39.202.592.037.051.08.102.128.152Z" />
                                  <path fillRule="evenodd" d="M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-6a.75.75 0 0 1 .75.75v.316a3.78 3.78 0 0 1 1.653.713c.426.33.744.74.925 1.2a.75.75 0 0 1-1.395.55 1.35 1.35 0 0 0-.447-.563 2.187 2.187 0 0 0-.736-.363V9.3c.698.093 1.383.32 1.959.696.787.514 1.29 1.27 1.29 2.13 0 .86-.504 1.616-1.29 2.13-.576.377-1.261.603-1.96.696v.299a.75.75 0 1 1-1.5 0v-.3c-.697-.092-1.382-.318-1.958-.695-.482-.315-.857-.717-1.078-1.188a.75.75 0 1 1 1.359-.636c.08.173.245.376.54.569.313.205.706.353 1.138.432v-2.748a3.782 3.782 0 0 1-1.653-.713C6.9 9.433 6.5 8.681 6.5 7.875c0-.805.4-1.558 1.097-2.096a3.78 3.78 0 0 1 1.653-.713V4.75A.75.75 0 0 1 10 4Z" clipRule="evenodd" />
                                </svg>
                                <span className="sr-only">Fee: </span>
                                <span className="font-medium text-neutral-900">{permit.fee}</span>
                              </span>
                            ) : null}
                            {permit.processingTime ? (
                              <span className="inline-flex items-center gap-1.5">
                                <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 text-indigo-600">
                                  <path fillRule="evenodd" d="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" clipRule="evenodd" />
                                </svg>
                                <span className="sr-only">Typical processing time: </span>
                                {permit.processingTime}
                              </span>
                            ) : null}
                          </span>
                        ) : null}
                      <span
                        aria-hidden="true"
                        className="absolute top-5 right-5 grid size-9 sm:top-1/2 sm:right-6 sm:-translate-y-1/2 shrink-0 place-items-center rounded-full bg-neutral-100 text-neutral-600 transition group-open:rotate-180 group-open:bg-indigo-600 group-open:text-white"
                      >
                        <svg viewBox="0 0 20 20" fill="currentColor" className="size-5">
                          <path fillRule="evenodd" d="M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z" clipRule="evenodd" />
                        </svg>
                      </span>
                    </summary>

                    <div className="border-t border-neutral-200 px-5 pt-5 pb-6 sm:px-6">
                      <div className="grid gap-6 sm:grid-cols-2 sm:gap-8">
                        {permit.whenNeeded ? (
                          <div>
                            <p className="text-sm font-semibold text-neutral-950">When you need it</p>
                            <p className="mt-2 text-sm leading-6 text-pretty text-neutral-700">{permit.whenNeeded}</p>
                          </div>
                        ) : null}
                        {docs.length ? (
                          <div>
                            <p className="text-sm font-semibold text-neutral-950">What to bring</p>
                            <ul role="list" className="mt-2 space-y-2">
                              {docs.map((doc, j) => (
                                <li key={j} className="flex gap-2.5 text-sm leading-6 text-neutral-700">
                                  <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="mt-0.5 size-5 shrink-0 text-indigo-600">
                                    <path fillRule="evenodd" d="M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z" clipRule="evenodd" />
                                  </svg>
                                  <span className="min-w-0">{doc}</span>
                                </li>
                              ))}
                            </ul>
                          </div>
                        ) : null}
                      </div>
                      {permit.applyHref || permit.infoHref ? (
                        <div className="mt-6 flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-6">
                          {permit.applyHref ? (
                            <a
                              href={permit.applyHref}
                              className={`inline-flex min-h-11 items-center justify-center rounded-lg bg-indigo-600 px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:bg-indigo-500 ${focusRing}`}
                            >
                              Apply online<span className="sr-only">: {permit.name}</span>
                            </a>
                          ) : null}
                          {permit.infoHref ? (
                            <a
                              href={permit.infoHref}
                              className={`inline-flex min-h-11 items-center justify-center gap-1.5 rounded-lg px-1 text-sm font-semibold text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}
                            >
                              Full requirements<span className="sr-only"> for {permit.name}</span>
                            </a>
                          ) : null}
                        </div>
                      ) : null}
                    </div>
                  </details>
                );
              })}
            </div>
          ) : null}

          {hasContact ? (
            <aside
              aria-label={contactLabel}
              className="mt-8 flex flex-col gap-4 rounded-2xl border border-dashed border-neutral-300 p-5 sm:flex-row sm:items-start sm:gap-5 sm:p-6"
            >
              <span aria-hidden="true" className="grid size-11 shrink-0 place-items-center rounded-full bg-indigo-50 text-indigo-700 ring-1 ring-indigo-600/15">
                <svg viewBox="0 0 20 20" fill="currentColor" className="size-5">
                  <path fillRule="evenodd" d="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" clipRule="evenodd" />
                </svg>
              </span>
              <div className="min-w-0 flex-1">
                <p className="text-base font-semibold text-neutral-950">{contactLabel}</p>
                {contactText ? <p className="mt-1 text-sm leading-6 text-pretty text-neutral-700">{contactText}</p> : null}
                {contactPhone || contactEmail ? (
                  <p className="mt-1 flex flex-wrap gap-x-6 text-sm font-semibold">
                    {contactPhone ? (
                      <a href={`tel:${contactPhone.replace(/[^\d+]/g, "")}`} className={`inline-flex min-h-11 items-center rounded text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}>
                        {contactPhone}
                      </a>
                    ) : null}
                    {contactEmail ? (
                      <a href={`mailto:${contactEmail}`} className={`inline-flex min-h-11 items-center rounded break-all text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`}>
                        {contactEmail}
                      </a>
                    ) : null}
                  </p>
                ) : null}
              </div>
            </aside>
          ) : null}
        </div>
      </section>
    );
  },
};
```
