# Add the "Stats Quote" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/stats-quote) to this Pantheon Content Publisher (P1) Next.js project. Split section pairing one oversized, sourced statistic with a pull quote that supports it.

## Steps

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

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

/**
 * Stats Quote — a split section that pairs one oversized number (with context and its source)
 * against a pull quote that gives the number a human face.
 * Register: `StatsQuoteBlock: statsQuoteBlock` in puck.config.tsx.
 */

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

export type StatsQuoteProps = {
  heading: string;
  headingLevel: Heading;
  stat: string;
  statLabel: string;
  context: string;
  source: string;
  quote: string;
  name: string;
  role: string;
  avatarUrl: string;
  avatarAlt: string;
  quoteSide: "right" | "left";
};

function initials(name?: string) {
  return (name || "")
    .trim()
    .split(/\s+/)
    .filter(Boolean)
    .map((part) => part[0])
    .slice(0, 2)
    .join("")
    .toUpperCase();
}

export const statsQuoteBlock: ComponentConfig<StatsQuoteProps> = {
  label: "Stats Quote",
  fields: {
    heading: { type: "text", label: "Heading", metadata: { help: "Short line above the number. Leave blank to hide it." } },
    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." },
    },
    stat: { type: "text", label: "Number", metadata: { help: "One figure, kept short: 73% or 4,100 or $1.2M." } },
    statLabel: { type: "text", label: "What it counts", metadata: { help: "Finishes the sentence the number starts." } },
    context: { type: "textarea", label: "Context", metadata: { help: "One or two sentences on why the number matters." } },
    source: { type: "text", label: "Source", metadata: { help: "Who measured it and when. Shown under the number." } },
    quote: { type: "textarea", label: "Quote", metadata: { help: "A short quote that backs up the number. Leave blank for a number-only section." } },
    name: { type: "text", label: "Name" },
    role: { type: "text", label: "Role" },
    avatarUrl: { type: "text", label: "Photo URL", metadata: { help: "Leave blank to show initials." } },
    avatarAlt: { type: "text", label: "Photo alt text", metadata: { help: "Usually blank, since the name sits beside the photo." } },
    quoteSide: {
      type: "radio",
      label: "Quote side",
      options: [
        { label: "Right", value: "right" },
        { label: "Left", value: "left" },
      ],
      metadata: { help: "Which side the quote sits on at desktop widths. On phones, the number always comes first." },
    },
  },
  defaultProps: {
    heading: "Summer reading, measured",
    headingLevel: "h2",
    stat: "73%",
    statLabel: "of Story Club kids started second grade reading at or above grade level",
    context: "That's up from 41% of the same children in the spring, before a summer of twice-weekly reading with volunteer buddies.",
    source: "Sample data · Source: Riverbend Literacy Project fall reading assessment, 2025 (n = 186)",
    quote: "I can tell the Story Club kids by the second week of school. They're not just reading. They're the ones asking if they can take the book home.",
    name: "Angela Moreau",
    role: "Second-grade teacher, Hillcrest Elementary",
    avatarUrl: "https://picsum.photos/seed/angela-teacher/200/200",
    avatarAlt: "",
    quoteSide: "right",
  },
  render: ({ heading, headingLevel, stat, statLabel, context, source, quote, name, role, avatarUrl, avatarAlt, quoteSide }) => {
    const H = headingLevel || "h2";
    const left = quoteSide === "left";
    const monogram = initials(name);
    const hasStat = Boolean(stat || statLabel || context);

    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 grid-cols-1 items-stretch gap-10 ${quote && hasStat ? "max-w-7xl lg:grid-cols-2 lg:gap-0" : "max-w-3xl"}`}>
          {hasStat || heading ? (
            <div className={`flex flex-col justify-center ${quote ? (left ? "lg:order-2 lg:pl-16" : "lg:pr-16") : ""}`}>
              {heading ? (
                <H className="flex items-center gap-3 text-sm font-semibold tracking-widest text-indigo-700 uppercase">
                  <span aria-hidden="true" className="h-px w-8 bg-indigo-600" />
                  {heading}
                </H>
              ) : null}
              {stat || statLabel ? (
                <p className={heading ? "mt-6" : ""}>
                  {stat ? (
                    <span className="block text-7xl leading-none font-semibold tracking-tighter break-words text-neutral-950 tabular-nums sm:text-8xl lg:text-9xl">
                      {stat}
                    </span>
                  ) : null}
                  {statLabel ? (
                    <span className="mt-5 block max-w-md text-xl leading-snug font-medium text-pretty text-neutral-950 sm:text-2xl sm:leading-snug">
                      {statLabel}
                    </span>
                  ) : null}
                </p>
              ) : null}
              {context ? <p className="mt-5 max-w-md text-base leading-7 text-pretty text-neutral-600">{context}</p> : null}
              {source ? <p className="mt-8 max-w-md border-t border-neutral-200 pt-4 text-xs leading-5 text-neutral-600">{source}</p> : null}
            </div>
          ) : null}

          {quote ? (
            <figure className={`relative flex flex-col justify-between overflow-hidden rounded-3xl bg-indigo-950 p-8 sm:p-10 lg:p-12 ${left ? "lg:order-1" : ""}`}>
              <svg aria-hidden="true" viewBox="0 0 24 18" fill="currentColor" className="pointer-events-none absolute top-6 right-6 h-24 w-auto text-indigo-900 sm:h-32">
                <path d="M6.7 18C3 18 0 15.3 0 11.4 0 6.2 3.7 1.8 9.6 0l1.1 2.2C7.4 3.5 5.5 5.7 5.2 8.4c.5-.2 1-.3 1.6-.3 2.9 0 5.1 2.2 5.1 4.9 0 2.9-2.3 5-5.2 5Zm12.2 0c-3.7 0-6.7-2.7-6.7-6.6 0-5.2 3.7-9.6 9.6-11.4l1.2 2.2c-3.4 1.3-5.3 3.5-5.6 6.2.5-.2 1-.3 1.6-.3 3 0 5.2 2.2 5.2 4.9 0 2.9-2.4 5-5.3 5Z" />
              </svg>
              <blockquote className="relative font-serif text-2xl leading-snug font-medium text-pretty text-white sm:text-3xl sm:leading-snug">
                <p>{quote}</p>
              </blockquote>
              {name || role ? (
                <figcaption className="relative mt-10 flex items-center gap-4">
                  {avatarUrl ? (
                    <img src={avatarUrl} alt={avatarAlt || ""} className="size-12 shrink-0 rounded-full bg-indigo-900 object-cover ring-2 ring-indigo-400/40" />
                  ) : monogram ? (
                    <span aria-hidden="true" className="grid size-12 shrink-0 place-items-center rounded-full bg-indigo-800 text-sm font-semibold text-white">
                      {monogram}
                    </span>
                  ) : null}
                  <div className="min-w-0">
                    {name ? <p className="text-base font-semibold text-white">{name}</p> : null}
                    {role ? <p className="text-sm leading-6 text-indigo-200">{role}</p> : null}
                  </div>
                </figcaption>
              ) : null}
            </figure>
          ) : null}
        </div>
      </section>
    );
  },
};
```
