# Add the "Job Openings" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/job-openings) to this Pantheon Content Publisher (P1) Next.js project. Careers list with department, location, employment type and a posted pay range per role, plus a benefits summary.

## Steps

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

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

/**
 * Job Openings — a careers list with department, location or remote, employment type and
 * a posted salary range on every role (pay transparency), each with an apply link, plus a
 * short benefits summary.
 * Register: `JobOpeningsBlock: jobOpeningsBlock` in puck.config.tsx.
 */

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

export type JobOpeningsProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  jobs: { title: string; department: string; location: string; type: string; salary: string; href: string }[];
  applyLabel: string;
  emptyText: string;
  payNote: string;
  benefitsLabel: string;
  benefits: { text: string }[];
  eeoText: string;
};

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

const icons = {
  pin: "M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z",
  clock: "M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z",
  cash: "M2.25 18.75a60.07 60.07 0 0 1 15.797 2.101c.727.198 1.453-.342 1.453-1.096V18.75M3.75 4.5v.75A.75.75 0 0 1 3 6h-.75m0 0v-.375c0-.621.504-1.125 1.125-1.125H20.25M2.25 6v9m18-10.5v.75c0 .414.336.75.75.75h.75m-1.5-1.5h.375c.621 0 1.125.504 1.125 1.125v9.75c0 .621-.504 1.125-1.125 1.125h-.375m1.5-1.5H21a.75.75 0 0 0-.75.75v.75m0 0H3.75m0 0h-.375a1.125 1.125 0 0 1-1.125-1.125V15m1.5 1.5v-.75A.75.75 0 0 0 3 15h-.75M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Zm3 0h.008v.008H18V10.5Zm-12 0h.008v.008H6V10.5Z",
};

const Icon = ({ d }: { d: string }) => (
  <svg aria-hidden="true" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth={1.5} strokeLinecap="round" strokeLinejoin="round" className="size-5 shrink-0 text-neutral-500">
    <path d={d} />
  </svg>
);

export const jobOpeningsBlock: ComponentConfig<JobOpeningsProps> = {
  label: "Job Openings",
  fields: {
    heading: { type: "textarea", 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" },
    jobs: {
      type: "array",
      label: "Open roles",
      min: 0,
      max: 20,
      getItemSummary: (item) => [item?.title, item?.department].filter(Boolean).join(" · ") || "Role",
      defaultItemProps: { title: "New role", department: "Programs", location: "On site", type: "Full-time", salary: "$50,000–$58,000", href: "/careers/apply" },
      arrayFields: {
        title: { type: "text", label: "Job title" },
        department: { type: "text", label: "Department" },
        location: { type: "text", label: "Location", metadata: { help: "City or site, or Remote, or Hybrid · City." } },
        type: { type: "text", label: "Employment type", metadata: { help: "Like Full-time, Part-time, or Contract, 6 months." } },
        salary: {
          type: "text",
          label: "Pay range",
          metadata: { help: "A real range, like $52,000–$60,000 a year or $21–$24/hr. Several states and cities require it in job postings." },
        },
        href: { type: "text", label: "Apply link", metadata: { help: "The full posting or application, a path or full URL." } },
      },
    },
    applyLabel: { type: "text", label: "Apply link text", metadata: { help: "Like View role. The job title is added for screen readers." } },
    emptyText: { type: "textarea", label: "No-openings text", metadata: { help: "Shown when the list is empty, so the section never looks broken." } },
    payNote: { type: "textarea", label: "Pay note", metadata: { help: "How you set pay ranges. Leave blank to hide it." } },
    benefitsLabel: { type: "text", label: "Benefits heading" },
    benefits: {
      type: "array",
      label: "Benefits",
      min: 0,
      max: 10,
      getItemSummary: (item) => item?.text?.slice(0, 40) || "Benefit",
      defaultItemProps: { text: "New benefit" },
      arrayFields: { text: { type: "text", label: "Benefit" } },
    },
    eeoText: { type: "textarea", label: "Equal opportunity statement", metadata: { help: "Leave blank to hide it." } },
  },
  defaultProps: {
    heading: "Work with us",
    headingLevel: "h2",
    intro: "Our 38-person team at Larkspur Valley Food Bank keeps 14,000 neighbors fed every month. Every posting lists its pay range up front.",
    jobs: [
      { title: "Warehouse Lead", department: "Operations", location: "Larkspur distribution center", type: "Full-time", salary: "$48,000–$54,000 a year", href: "/careers/warehouse-lead" },
      { title: "Community Partnerships Coordinator", department: "Programs", location: "Hybrid · Larkspur", type: "Full-time", salary: "$56,000–$63,000 a year", href: "/careers/partnerships-coordinator" },
      { title: "Grants Writer", department: "Development", location: "Remote (U.S.)", type: "Part-time, 24 hrs/week", salary: "$32–$38 an hour", href: "/careers/grants-writer" },
      { title: "Mobile Pantry Driver", department: "Operations", location: "Larkspur distribution center", type: "Full-time", salary: "$22–$25 an hour", href: "/careers/pantry-driver" },
    ],
    applyLabel: "View role",
    emptyText: "We don't have open roles right now. Check back soon, or volunteer with us in the meantime.",
    payNote: "Ranges reflect what we expect to offer; most new hires start near the middle. We publish ranges for every role, not just where the law requires it.",
    benefitsLabel: "What we offer",
    benefits: [
      { text: "Medical, dental and vision, 100% paid for employees" },
      { text: "5% retirement match from day one" },
      { text: "20 days paid time off plus 11 holidays" },
      { text: "12 weeks paid family leave" },
      { text: "$750 a year for training and conferences" },
    ],
    eeoText: "Larkspur Valley Food Bank is an equal opportunity employer. We especially encourage applications from people who have used food assistance themselves.",
  },
  render: ({ heading, headingLevel, intro, jobs, applyLabel, emptyText, payNote, benefitsLabel, benefits, eeoText }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] ?? "h3";
    const list = (jobs ?? []).filter((j) => j?.title);
    const perks = (benefits ?? []).filter((b) => b?.text);
    const apply = applyLabel || "View role";
    const hasAside = perks.length > 0 || Boolean(eeoText);

    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">
          <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-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
          </div>

          <div className={`mt-12 grid grid-cols-1 gap-12 lg:mt-14 ${hasAside ? "lg:grid-cols-12 lg:gap-16" : ""}`}>
            <div className={`min-w-0 ${hasAside ? "lg:col-span-8" : ""}`}>
              {list.length ? (
                <ul role="list" className="divide-y divide-neutral-200 border-y border-neutral-200">
                  {list.map((j, i) => (
                    <li key={`${j.title}-${i}`}>
                      <article className="flex flex-col gap-4 py-6 sm:flex-row sm:items-center sm:justify-between sm:gap-8">
                        <div className="min-w-0">
                          {j.department ? <p className="text-sm font-semibold text-indigo-700">{j.department}</p> : null}
                          <Sub className="mt-1 text-lg font-semibold tracking-tight text-neutral-950">{j.title}</Sub>
                          <dl className="mt-3 flex flex-col gap-2 text-sm text-neutral-700 sm:flex-row sm:flex-wrap sm:gap-x-5">
                            {j.location ? (
                              <div className="flex items-start gap-1.5">
                                <dt className="sr-only">Location</dt>
                                <Icon d={icons.pin} />
                                <dd>{j.location}</dd>
                              </div>
                            ) : null}
                            {j.type ? (
                              <div className="flex items-start gap-1.5">
                                <dt className="sr-only">Employment type</dt>
                                <Icon d={icons.clock} />
                                <dd>{j.type}</dd>
                              </div>
                            ) : null}
                            {j.salary ? (
                              <div className="flex items-start gap-1.5">
                                <dt className="sr-only">Pay range</dt>
                                <Icon d={icons.cash} />
                                <dd className="font-semibold text-neutral-950 tabular-nums">{j.salary}</dd>
                              </div>
                            ) : null}
                          </dl>
                        </div>
                        <a
                          href={j.href || "#"}
                          className="group inline-flex min-h-11 shrink-0 items-center gap-2 self-start rounded-lg px-4 py-2.5 text-sm font-semibold text-neutral-950 ring-1 ring-neutral-300 transition ring-inset hover:bg-neutral-950 hover:text-white hover:ring-neutral-950 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 sm:self-center"
                        >
                          {apply}
                          <span className="sr-only">: {j.title}</span>
                          <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className="size-4 transition group-hover:translate-x-0.5">
                            <path fillRule="evenodd" d="M3 10a.75.75 0 0 1 .75-.75h10.64l-3.22-3.22a.75.75 0 1 1 1.06-1.06l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H3.75A.75.75 0 0 1 3 10Z" clipRule="evenodd" />
                          </svg>
                        </a>
                      </article>
                    </li>
                  ))}
                </ul>
              ) : emptyText ? (
                <p className="rounded-2xl bg-neutral-50 p-6 text-base leading-7 text-neutral-700 ring-1 ring-neutral-200 sm:p-8">{emptyText}</p>
              ) : null}
              {payNote && list.length ? <p className="mt-4 text-sm leading-6 text-pretty text-neutral-600">{payNote}</p> : null}
            </div>

            {hasAside ? (
              <aside className="lg:col-span-4">
                <div className="rounded-2xl bg-neutral-50 p-6 ring-1 ring-neutral-200 sm:p-8">
                  {perks.length ? (
                    <>
                      {benefitsLabel ? <Sub className="text-base font-semibold text-neutral-950">{benefitsLabel}</Sub> : null}
                      <ul role="list" className={`space-y-3 text-sm leading-6 text-neutral-700 ${benefitsLabel ? "mt-4" : ""}`}>
                        {perks.map((b, i) => (
                          <li key={`${b.text}-${i}`} className="flex gap-3">
                            <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>
                            {b.text}
                          </li>
                        ))}
                      </ul>
                    </>
                  ) : null}
                  {eeoText ? <p className={`text-xs leading-5 text-neutral-600 ${perks.length ? "mt-6 border-t border-neutral-200 pt-6" : ""}`}>{eeoText}</p> : null}
                </div>
              </aside>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
