# Add the "Accessibility Statement" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/accessibility-statement) to this Pantheon Content Publisher (P1) Next.js project. Your commitment, WCAG conformance status, known issues with workarounds, and how to report a barrier.

## Steps

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

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

/**
 * Accessibility Statement — your commitment, WCAG conformance status, known limitations with
 * workarounds, and how to report a barrier. Follows the W3C WAI statement structure.
 * Register: `AccessibilityStatementBlock: accessibilityStatementBlock` in puck.config.tsx.
 */

type Heading = "h1" | "h2" | "h3" | "h4";
type Standard = "wcag22" | "wcag21" | "wcag20";
type Level = "A" | "AA" | "AAA";
type Status = "full" | "partial" | "non";

export type AccessibilityStatementProps = {
  heading: string;
  headingLevel: Heading;
  orgName: string;
  commitment: string;
  standard: Standard;
  level: Level;
  status: Status;
  assessment: string;
  lastReviewed: string;
  limitationsHeading: string;
  limitations: { area: string; issue: string; workaround: string; fixBy: string }[];
  feedbackHeading: string;
  feedbackBody: string;
  email: string;
  phone: string;
  responseTime: string;
};

const childLevel = { 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";
const textLink = `inline-flex min-h-11 items-center rounded font-semibold text-indigo-700 underline decoration-indigo-300 underline-offset-4 hover:decoration-indigo-700 ${focusRing}`;

const standards: Record<Standard, { name: string; href: string }> = {
  wcag22: { name: "WCAG 2.2", href: "https://www.w3.org/TR/WCAG22/" },
  wcag21: { name: "WCAG 2.1", href: "https://www.w3.org/TR/WCAG21/" },
  wcag20: { name: "WCAG 2.0", href: "https://www.w3.org/TR/WCAG20/" },
};

// Wording follows the W3C WAI Accessibility Statement Generator.
const statuses: Record<Status, { name: string; meaning: string }> = {
  full: { name: "Fully conformant", meaning: "The content fully conforms to the standard without any exceptions." },
  partial: { name: "Partially conformant", meaning: "Some parts of the content do not fully conform to the standard." },
  non: { name: "Non-conformant", meaning: "The content does not conform to the standard." },
};

export const accessibilityStatementBlock: ComponentConfig<AccessibilityStatementProps> = {
  label: "Accessibility Statement",
  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." },
    },
    orgName: { type: "text", label: "Organization name" },
    commitment: { type: "textarea", label: "Commitment", metadata: { help: "A short paragraph on why accessibility matters to you and what you do about it." } },
    standard: {
      type: "select",
      label: "Standard",
      options: [
        { label: "WCAG 2.2", value: "wcag22" },
        { label: "WCAG 2.1", value: "wcag21" },
        { label: "WCAG 2.0", value: "wcag20" },
      ],
      metadata: { help: "The version you test against. Links to the official W3C standard." },
    },
    level: {
      type: "select",
      label: "Level",
      options: [
        { label: "A", value: "A" },
        { label: "AA", value: "AA" },
        { label: "AAA", value: "AAA" },
      ],
      metadata: { help: "AA is the usual target, and the level the ADA Title II rule for state and local governments adopts (WCAG 2.1 AA)." },
    },
    status: {
      type: "select",
      label: "Conformance status",
      options: [
        { label: "Fully conformant", value: "full" },
        { label: "Partially conformant", value: "partial" },
        { label: "Non-conformant", value: "non" },
      ],
      metadata: { help: "Be honest. Partially conformant with a clear list of known issues builds more trust than an unsupported claim." },
    },
    assessment: { type: "textarea", label: "How it was checked", metadata: { help: "Like: Self-evaluation by staff plus an independent audit in August 2026. Leave blank to hide." } },
    lastReviewed: { type: "text", label: "Last reviewed", metadata: { help: "Free text, like September 15, 2026." } },
    limitationsHeading: { type: "text", label: "Known issues heading" },
    limitations: {
      type: "array",
      label: "Known issues",
      min: 0,
      max: 20,
      getItemSummary: (item) => item?.area || "Issue",
      defaultItemProps: { area: "New issue", issue: "", workaround: "", fixBy: "" },
      arrayFields: {
        area: { type: "text", label: "Where", metadata: { help: "The page or feature, like Online registration." } },
        issue: { type: "textarea", label: "Problem", metadata: { help: "What doesn't work, in plain words." } },
        workaround: { type: "textarea", label: "Workaround", metadata: { help: "How people can get the same thing done today. Leave blank to hide." } },
        fixBy: { type: "text", label: "Planned fix", metadata: { help: "Free text, like Spring 2027. Leave blank to hide." } },
      },
    },
    feedbackHeading: { type: "text", label: "Feedback heading" },
    feedbackBody: { type: "textarea", label: "Feedback text" },
    email: { type: "text", label: "Email" },
    phone: { type: "text", label: "Phone", metadata: { help: "Shown as typed. The tap-to-call link is built from the digits." } },
    responseTime: { type: "text", label: "Response time", metadata: { help: "Like: We reply within 5 business days. Leave blank to hide." } },
  },
  defaultProps: {
    heading: "Accessibility statement",
    headingLevel: "h1",
    orgName: "Riverbend Parks & Recreation",
    commitment:
      "Parks are for everyone, and so is this website. We design, build and test our pages so people can use them with a keyboard, screen reader, magnifier, voice control or captions, and we fix barriers as soon as we learn about them.",
    standard: "wcag22",
    level: "AA",
    status: "partial",
    assessment: "Self-evaluation by our web team with automated and manual testing, plus an independent audit completed in August 2026.",
    lastReviewed: "September 15, 2026",
    limitationsHeading: "Known issues",
    limitations: [
      {
        area: "Online program registration",
        issue: "The registration system is run by a vendor, and its date picker can't be used with a keyboard alone.",
        workaround: "Call (513) 555-0187 and staff will register you over the phone at the online price.",
        fixBy: "Vendor update expected spring 2027",
      },
      {
        area: "Board meeting minutes before 2020",
        issue: "Older minutes are scanned PDFs without searchable text.",
        workaround: "Email us and we'll send an accessible version within 3 business days.",
        fixBy: "",
      },
      {
        area: "Embedded trail maps",
        issue: "The interactive map doesn't describe trail routes in text.",
        workaround: "Each park page lists trail lengths, surfaces and entry points as text.",
        fixBy: "Text directions added by December 2026",
      },
    ],
    feedbackHeading: "Report a barrier",
    feedbackBody: "If something on this site doesn't work for you, tell us what page you were on and what happened. We'll help you get what you need and fix the problem.",
    email: "access@riverbendparks.org",
    phone: "(513) 555-0187",
    responseTime: "We reply within 5 business days.",
  },
  render: ({ heading, headingLevel, orgName, commitment, standard, level, status, assessment, lastReviewed, limitationsHeading, limitations, feedbackHeading, feedbackBody, email, phone, responseTime }) => {
    const H = headingLevel || "h1";
    const Sub = childLevel[H] ?? "h2";
    const std = standards[standard] ?? standards.wcag22;
    const st = statuses[status] ?? statuses.partial;
    const lvl: Level = level || "AA";
    const issues = (limitations ?? []).filter((l) => l?.area || l?.issue);
    const tel = (phone || "").replace(/[^\d+]/g, "");
    const mail = (email || "").trim();

    return (
      <section className="bg-white px-4 py-16 sm:px-6 sm:py-20 lg:px-8 lg:py-24">
        <article className="mx-auto max-w-3xl">
          {heading ? <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl">{heading}</H> : null}
          {commitment ? <p className="mt-6 text-lg leading-8 text-pretty text-neutral-700">{commitment}</p> : null}

          <div className="mt-10 overflow-hidden rounded-2xl ring-1 ring-neutral-200">
            <div className="flex flex-col gap-4 bg-indigo-50 p-6 sm:flex-row sm:items-center sm:justify-between sm:p-8">
              <div>
                <p className="text-xs font-semibold tracking-widest text-indigo-800 uppercase">Conformance status</p>
                <p className="mt-1 text-2xl font-semibold tracking-tight text-neutral-950">{st.name}</p>
              </div>
              <p className="inline-flex items-center gap-2 self-start rounded-full bg-white px-4 py-2 text-sm font-semibold text-indigo-800 ring-1 ring-indigo-600/20 sm:self-auto">
                <svg aria-hidden="true" viewBox="0 0 24 24" fill="currentColor" className="size-5">
                  <circle cx="12" cy="4" r="2" />
                  <path d="M19 9.5a1 1 0 0 0-1-1H6a1 1 0 1 0 0 2h4v3.2l-2.4 6.4a1 1 0 1 0 1.9.7L11.6 15h.8l2.1 5.8a1 1 0 0 0 1.9-.7L14 13.7v-3.2h4a1 1 0 0 0 1-1Z" />
                </svg>
                {std.name} Level {lvl}
              </p>
            </div>
            <dl className="grid grid-cols-1 divide-y divide-neutral-200 text-sm leading-6 sm:grid-cols-3 sm:divide-x sm:divide-y-0">
              <div className="p-6">
                <dt className="font-semibold text-neutral-950">What this means</dt>
                <dd className="mt-1 text-neutral-600">
                  {orgName ? `${orgName}'s website: ` : ""}
                  {st.meaning}
                </dd>
              </div>
              <div className="p-6">
                <dt className="font-semibold text-neutral-950">Standard</dt>
                <dd className="mt-1 text-neutral-600">
                  <a href={std.href} className={textLink}>
                    Web Content Accessibility Guidelines {std.name.replace("WCAG ", "")}
                  </a>
                  , Level {lvl}
                </dd>
              </div>
              <div className="p-6">
                <dt className="font-semibold text-neutral-950">Last reviewed</dt>
                <dd className="mt-1 text-neutral-600">{lastReviewed || "Not yet reviewed"}</dd>
              </div>
            </dl>
            {assessment ? (
              <p className="border-t border-neutral-200 bg-neutral-50 px-6 py-4 text-sm leading-6 text-neutral-700">
                <span className="font-semibold text-neutral-950">How we checked: </span>
                {assessment}
              </p>
            ) : null}
          </div>
          <p className="mt-3 text-xs leading-5 text-neutral-600">
            Status definitions:{" "}
            <a href="https://www.w3.org/WAI/planning/statements/generator/" className={`${focusRing} rounded underline underline-offset-2 hover:text-indigo-700`}>
              W3C Web Accessibility Initiative
            </a>
          </p>

          {issues.length ? (
            <div className="mt-14">
              {limitationsHeading ? <Sub className="text-2xl font-semibold tracking-tight text-neutral-950">{limitationsHeading}</Sub> : null}
              <ul role="list" className="mt-6 space-y-4">
                {issues.map((it, i) => (
                  <li key={`${it.area}-${i}`} className="rounded-2xl p-6 ring-1 ring-neutral-200">
                    <div className="flex flex-wrap items-baseline justify-between gap-x-4 gap-y-2">
                      {it.area ? <p className="text-base font-semibold text-neutral-950">{it.area}</p> : null}
                      {it.fixBy ? (
                        <p className="rounded-full bg-neutral-100 px-3 py-1 text-xs font-medium text-neutral-700">
                          <span className="sr-only">Planned fix: </span>
                          {it.fixBy}
                        </p>
                      ) : null}
                    </div>
                    {it.issue ? <p className="mt-2 text-sm leading-6 text-pretty text-neutral-700">{it.issue}</p> : null}
                    {it.workaround ? (
                      <p className="mt-4 border-l-2 border-indigo-600 pl-4 text-sm leading-6 text-pretty text-neutral-700">
                        <span className="font-semibold text-neutral-950">Workaround: </span>
                        {it.workaround}
                      </p>
                    ) : null}
                  </li>
                ))}
              </ul>
            </div>
          ) : null}

          {feedbackHeading || feedbackBody || mail || tel ? (
            <div className="mt-14 rounded-2xl bg-neutral-950 p-6 text-white sm:p-10">
              {feedbackHeading ? <Sub className="text-2xl font-semibold tracking-tight">{feedbackHeading}</Sub> : null}
              {feedbackBody ? <p className="mt-3 text-base leading-7 text-pretty text-neutral-300">{feedbackBody}</p> : null}
              {mail || tel ? (
                <ul role="list" className="mt-6 flex flex-col gap-3 sm:flex-row sm:flex-wrap">
                  {mail ? (
                    <li className="min-w-0">
                      <a
                        href={`mailto:${mail}`}
                        className="inline-flex min-h-11 max-w-full items-center gap-2 rounded-lg bg-white px-4 py-2.5 text-sm font-semibold break-all text-neutral-950 transition hover:bg-indigo-50 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
                      >
                        <span className="sr-only">Email </span>
                        {mail}
                      </a>
                    </li>
                  ) : null}
                  {tel ? (
                    <li>
                      <a
                        href={`tel:${tel}`}
                        className="inline-flex min-h-11 items-center gap-2 rounded-lg px-4 py-2.5 text-sm font-semibold text-white tabular-nums ring-1 ring-white/30 transition ring-inset hover:bg-white/10 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white"
                      >
                        <span className="sr-only">Call </span>
                        {phone}
                      </a>
                    </li>
                  ) : null}
                </ul>
              ) : null}
              {responseTime ? <p className="mt-6 text-sm text-neutral-400">{responseTime}</p> : null}
            </div>
          ) : null}
        </article>
      </section>
    );
  },
};
```
