# Add the "Membership Tiers" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/membership-tiers) to this Pantheon Content Publisher (P1) Next.js project. Pricing, membership or giving levels with a featured tier and feature checklists.

## Steps

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

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

/**
 * Membership Tiers — membership, giving or pricing levels side by side, with one tier
 * optionally featured. Stacks on mobile, three across on desktop.
 * Register: `MembershipTiersBlock: membershipTiersBlock` in puck.config.tsx.
 */

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

type Tier = {
  name: string;
  price: string;
  period: string;
  description: string;
  features: string;
  ctaLabel: string;
  ctaHref: string;
  featured: boolean;
  badge: string;
};

export type MembershipTiersProps = {
  heading: string;
  headingLevel: Heading;
  intro: string;
  tiers: Tier[];
  note: string;
};

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

export const membershipTiersBlock: ComponentConfig<MembershipTiersProps> = {
  label: "Membership Tiers",
  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" },
    tiers: {
      type: "array",
      label: "Tiers",
      min: 1,
      max: 6,
      getItemSummary: (item) => `${item?.name || "Tier"}${item?.featured ? " (featured)" : ""}`,
      defaultItemProps: {
        name: "New tier",
        price: "$100",
        period: "/year",
        description: "",
        features: "First benefit\nSecond benefit",
        ctaLabel: "Join now",
        ctaHref: "/join",
        featured: false,
        badge: "",
      },
      arrayFields: {
        name: { type: "text", label: "Name" },
        price: { type: "text", label: "Price", metadata: { help: "Type it as it should appear, such as $60 or Free." } },
        period: { type: "text", label: "Period", metadata: { help: "Shown after the price, such as /year or /month. Leave blank for one-time amounts." } },
        description: { type: "textarea", label: "Description" },
        features: { type: "textarea", label: "Benefits", metadata: { help: "One benefit per line." } },
        ctaLabel: { type: "text", label: "Button text" },
        ctaHref: { type: "text", label: "Button link", metadata: { help: "A path (/join), full URL, #anchor, mailto: or tel:." } },
        featured: {
          type: "radio",
          label: "Featured",
          options: [
            { label: "Yes", value: true },
            { label: "No", value: false },
          ],
          metadata: { help: "Highlights this tier. Feature one tier at most." },
        },
        badge: { type: "text", label: "Badge", metadata: { help: "Short label such as \"Most popular\". Leave blank to hide it." } },
      },
    },
    note: { type: "textarea", label: "Footnote", metadata: { help: "Small print under the tiers. Leave blank to hide it." } },
  },
  defaultProps: {
    heading: "Become a member",
    headingLevel: "h2",
    intro: "Members keep the conservatory open year-round. Every level includes free admission and the satisfaction of knowing the orchids are in good hands.",
    tiers: [
      {
        name: "Individual",
        price: "$60",
        period: "/year",
        description: "For the regular visitor who wants to drop in whenever the mood strikes.",
        features: "Free admission for one adult\n10% off at the garden shop\nMember newsletter, four times a year",
        ctaLabel: "Join as an individual",
        ctaHref: "/membership/individual",
        featured: false,
        badge: "",
      },
      {
        name: "Household",
        price: "$120",
        period: "/year",
        description: "Two adults and every child under 18 in your home, all year long.",
        features: "Free admission for two adults and children\nTwo guest passes each year\nEarly registration for summer camps\n10% off at the garden shop",
        ctaLabel: "Join as a household",
        ctaHref: "/membership/household",
        featured: true,
        badge: "Most popular",
      },
      {
        name: "Patron",
        price: "$500",
        period: "/year",
        description: "For supporters who want to make a deeper investment in our living collections.",
        features: "Everything in Household\nSix guest passes each year\nInvitation to the spring preview evening\nBehind-the-scenes greenhouse tour",
        ctaLabel: "Become a patron",
        ctaHref: "/membership/patron",
        featured: false,
        badge: "",
      },
    ],
    note: "Membership dues support our programs and are tax-deductible to the extent allowed by law, less the value of benefits received.",
  },
  render: ({ heading, headingLevel, intro, tiers, note }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[headingLevel] || "h3";
    const list = (tiers ?? []).filter((t) => t?.name);
    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-7xl">
          {heading || intro ? (
            <div className="mx-auto max-w-2xl text-center">
              {heading ? <H className="text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl lg:text-5xl">{heading}</H> : null}
              {intro ? <p className="mt-5 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}
          {list.length ? (
            <ul role="list" className={`mx-auto grid max-w-md gap-6 lg:max-w-none lg:grid-cols-3 lg:items-stretch lg:gap-8 ${heading || intro ? "mt-12 sm:mt-16" : ""}`}>
              {list.map((tier, i) => {
                const featured = Boolean(tier.featured);
                const features = (tier.features || "")
                  .split("\n")
                  .map((f) => f.trim())
                  .filter(Boolean);
                return (
                  <li
                    key={`${tier.name}-${i}`}
                    className={`flex flex-col rounded-3xl p-8 sm:p-10 ${
                      featured ? "bg-neutral-950 text-white shadow-2xl ring-1 ring-neutral-950 lg:-my-4 lg:py-14" : "bg-white ring-1 ring-neutral-200"
                    }`}
                  >
                    <div className="flex flex-wrap items-center justify-between gap-3">
                      <Sub className={`text-lg leading-7 font-semibold ${featured ? "text-white" : "text-neutral-950"}`}>{tier.name}</Sub>
                      {tier.badge ? (
                        <p
                          className={`rounded-full px-3 py-1 text-xs leading-5 font-semibold ${
                            featured ? "bg-indigo-400/15 text-indigo-200 ring-1 ring-indigo-300/30 ring-inset" : "bg-indigo-50 text-indigo-700 ring-1 ring-indigo-600/15 ring-inset"
                          }`}
                        >
                          {tier.badge}
                        </p>
                      ) : null}
                    </div>
                    {tier.price ? (
                      <p className="mt-6 flex items-baseline gap-x-1">
                        <span className={`text-5xl font-semibold tracking-tight tabular-nums ${featured ? "text-white" : "text-neutral-950"}`}>{tier.price}</span>
                        {tier.period ? <span className={`text-sm font-medium ${featured ? "text-neutral-300" : "text-neutral-600"}`}>{tier.period}</span> : null}
                      </p>
                    ) : null}
                    {tier.description ? (
                      <p className={`mt-4 text-base leading-7 text-pretty ${featured ? "text-neutral-300" : "text-neutral-600"}`}>{tier.description}</p>
                    ) : null}
                    {features.length ? (
                      <ul role="list" className={`mt-8 space-y-3 border-t pt-8 text-sm leading-6 ${featured ? "border-white/10 text-neutral-200" : "border-neutral-200 text-neutral-700"}`}>
                        {features.map((feature, j) => (
                          <li key={j} className="flex gap-x-3">
                            <svg aria-hidden="true" viewBox="0 0 20 20" fill="currentColor" className={`h-6 w-5 flex-none ${featured ? "text-indigo-300" : "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>
                            {feature}
                          </li>
                        ))}
                      </ul>
                    ) : null}
                    {tier.ctaLabel ? (
                      <div className="mt-auto pt-10">
                        <a
                          href={tier.ctaHref || "#"}
                          className={`flex min-h-11 w-full items-center justify-center rounded-lg px-5 py-3 text-center text-base font-semibold transition focus-visible:outline-2 focus-visible:outline-offset-2 ${
                            featured
                              ? "bg-white text-neutral-950 hover:bg-indigo-50 focus-visible:outline-white"
                              : "bg-white text-indigo-700 ring-1 ring-indigo-200 ring-inset hover:bg-indigo-50 hover:ring-indigo-300 focus-visible:outline-indigo-600"
                          }`}
                        >
                          {tier.ctaLabel}
                        </a>
                      </div>
                    ) : null}
                  </li>
                );
              })}
            </ul>
          ) : null}
          {note ? <p className="mx-auto mt-12 max-w-2xl text-center text-sm leading-6 text-pretty text-neutral-600 sm:mt-16">{note}</p> : null}
        </div>
      </section>
    );
  },
};
```
