# Add the "Scholarship Interest" block to this P1 project

Add a Puck component from P1 Blocks (https://p1-blocks.prolificdigital.io/blocks/scholarship-interest) to this Pantheon Content Publisher (P1) Next.js project. Short scholarship interest form with field of study, first-gen status, GPA range and a short answer, beside key dates.

## Steps

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

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

/**
 * Scholarship Interest — a short interest form (grade, field of study, first-generation status,
 * GPA range, interests and a brief about-you answer) beside a dates-and-eligibility card.
 * A plain HTML form that posts to your scholarship office, no JavaScript.
 * Register: `ScholarshipInterestBlock: scholarshipInterestBlock` in puck.config.tsx.
 */

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

type Option = { label: string };
type Deadline = { label: string; date: string };

export type ScholarshipInterestProps = {
  eyebrow: string;
  heading: string;
  headingLevel: Heading;
  intro: string;
  formAction: string;
  gradeOptions: string;
  studyFields: Option[];
  gpaOptions: string;
  interests: Option[];
  essayPrompt: string;
  essayLimit: string;
  showGuardian: boolean;
  submitLabel: string;
  privacyNote: string;
  sidebarHeading: string;
  deadlines: Deadline[];
  eligibility: string;
  sidebarNote: string;
};

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

const inputClass =
  "block min-h-11 w-full rounded-lg border-0 bg-white px-3.5 py-2.5 text-base text-neutral-950 shadow-xs ring-1 ring-neutral-300 ring-inset placeholder:text-neutral-500 focus:ring-2 focus:ring-indigo-600 focus:outline-none";
const labelClass = "block text-sm leading-6 font-medium text-neutral-900";
const legendClass = "text-sm leading-6 font-medium text-neutral-900";
const choiceClass = "size-5 shrink-0 accent-indigo-600 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600";

const lines = (s?: string) =>
  (s || "")
    .split("\n")
    .map((l) => l.trim())
    .filter(Boolean);

const Optional = () => <span className="font-normal text-neutral-600">(optional)</span>;

const Select = ({ id, name, label, options, placeholder }: { id: string; name: string; label: string; options: string[]; placeholder: string }) => (
  <div>
    <label htmlFor={id} className={labelClass}>
      {label}
    </label>
    <select id={id} name={name} required defaultValue="" className={`mt-2 ${inputClass}`}>
      <option value="" disabled>
        {placeholder}
      </option>
      {options.map((o, i) => (
        <option key={`${o}-${i}`} value={o}>
          {o}
        </option>
      ))}
    </select>
  </div>
);

export const scholarshipInterestBlock: ComponentConfig<ScholarshipInterestProps> = {
  label: "Scholarship Interest",
  fields: {
    eyebrow: { type: "text", label: "Eyebrow", metadata: { help: "Small line above the heading. Leave blank to hide it." } },
    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" },
    formAction: {
      type: "text",
      label: "Form action URL",
      metadata: {
        help: "Where the form is sent with POST. Field names: first_name, last_name, email, school, grade, field_of_study, first_generation, gpa_range, interests (one per checked box), about, accommodations, guardian_name and guardian_consent.",
      },
    },
    gradeOptions: { type: "textarea", label: "Grade or year options", metadata: { help: "One choice per line for the grade or year menu." } },
    studyFields: {
      type: "array",
      label: "Fields of study",
      min: 1,
      max: 20,
      getItemSummary: (item) => item?.label || "Field",
      defaultItemProps: { label: "New field" },
      arrayFields: { label: { type: "text", label: "Field of study" } },
      metadata: { help: "Choices in the \"What do you want to study?\" menu." },
    },
    gpaOptions: { type: "textarea", label: "GPA ranges", metadata: { help: "One range per line. Leave blank to hide the GPA question." } },
    interests: {
      type: "array",
      label: "Interests",
      min: 0,
      max: 10,
      getItemSummary: (item) => item?.label || "Interest",
      defaultItemProps: { label: "New interest" },
      arrayFields: { label: { type: "text", label: "Interest" } },
      metadata: { help: "Checkboxes for the kinds of support a student wants to hear about. Remove them all to hide the question." },
    },
    essayPrompt: { type: "text", label: "Short-answer prompt", metadata: { help: "Leave blank to hide the short answer." } },
    essayLimit: { type: "text", label: "Character limit", metadata: { help: "Most characters allowed in the short answer, such as 600." } },
    showGuardian: {
      type: "radio",
      label: "Ask for guardian consent",
      options: [
        { label: "Yes", value: true },
        { label: "No", value: false },
      ],
      metadata: { help: "Adds parent or guardian fields for students under 18." },
    },
    submitLabel: { type: "text", label: "Button text" },
    privacyNote: { type: "textarea", label: "Privacy note", metadata: { help: "Shown under the button. Leave blank to hide it." } },
    sidebarHeading: { type: "text", label: "Card heading", metadata: { help: "Leave the card heading, dates, eligibility and note blank to hide the card." } },
    deadlines: {
      type: "array",
      label: "Key dates",
      min: 0,
      max: 6,
      getItemSummary: (item) => item?.label || "Date",
      defaultItemProps: { label: "New date", date: "" },
      arrayFields: {
        label: { type: "text", label: "What" },
        date: { type: "text", label: "Date", metadata: { help: "Shown as typed, or bind a data-source token." } },
      },
    },
    eligibility: { type: "textarea", label: "Eligibility", metadata: { help: "One requirement per line, shown as a checklist." } },
    sidebarNote: { type: "textarea", label: "Card note", metadata: { help: "Small print at the bottom of the card." } },
  },
  defaultProps: {
    eyebrow: "Scholarships",
    heading: "Tell us about yourself and we'll match you with funding",
    headingLevel: "h2",
    intro: "This isn't the application. It takes about five minutes, and our scholarship advisors use it to send you the awards you're most likely to win.",
    formAction: "/scholarships/interest",
    gradeOptions: "10th grade\n11th grade\n12th grade\nCommunity college transfer\nCurrent university student",
    studyFields: [
      { label: "Undecided" },
      { label: "Business and entrepreneurship" },
      { label: "Education and teaching" },
      { label: "Engineering and computing" },
      { label: "Health sciences and nursing" },
      { label: "Arts, music and design" },
      { label: "Public service and social work" },
      { label: "Skilled trades" },
    ],
    gpaOptions: "Below 2.5\n2.5 – 2.9\n3.0 – 3.4\n3.5 – 4.0\nMy school doesn't use GPA",
    interests: [
      { label: "Need-based aid" },
      { label: "Merit awards" },
      { label: "Community service scholarships" },
      { label: "Paid internships" },
      { label: "Study abroad funding" },
    ],
    essayPrompt: "In a few sentences, what are you hoping to do after school?",
    essayLimit: "600",
    showGuardian: true,
    submitLabel: "Send my interest form",
    privacyNote: "We share your answers only with our scholarship committee, never with outside lenders.",
    sidebarHeading: "At a glance",
    deadlines: [
      { label: "Interest forms reviewed", date: "Weekly, year-round" },
      { label: "Priority application deadline", date: "February 1" },
      { label: "Award notices sent", date: "April 15" },
    ],
    eligibility: "Kentucky or Indiana resident\nEnrolling full or part time next fall\nFamilies of every income level may apply",
    sidebarNote: "Dates and requirements shown are sample content. Replace them with your own scholarship calendar.",
  },
  render: ({
    id,
    eyebrow,
    heading,
    headingLevel,
    intro,
    formAction,
    gradeOptions,
    studyFields,
    gpaOptions,
    interests,
    essayPrompt,
    essayLimit,
    showGuardian,
    submitLabel,
    privacyNote,
    sidebarHeading,
    deadlines,
    eligibility,
    sidebarNote,
  }) => {
    const H = headingLevel || "h2";
    const Sub = childHeading[H] || "h3";
    const uid = `si-${id || "scholarship"}`;
    const grades = lines(gradeOptions);
    const fieldList = (studyFields ?? []).map((f) => f?.label?.trim()).filter(Boolean) as string[];
    const gpas = lines(gpaOptions);
    const interestList = (interests ?? []).map((f) => f?.label?.trim()).filter(Boolean) as string[];
    const limit = Number.parseInt((essayLimit || "").replace(/[^\d]/g, ""), 10);
    const hasLimit = Number.isFinite(limit) && limit > 0;
    const dates = (deadlines ?? []).filter((d) => d?.label || d?.date);
    const checks = lines(eligibility);
    const hasSidebar = Boolean(sidebarHeading || dates.length || checks.length || sidebarNote);
    const guardian = showGuardian !== false;

    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 ${hasSidebar ? "max-w-6xl" : "max-w-3xl"}`}>
          {eyebrow || heading || intro ? (
            <div className="max-w-3xl border-l-4 border-indigo-600 pl-5 sm:pl-6">
              {eyebrow ? <p className="text-sm font-semibold tracking-wide text-indigo-700 uppercase">{eyebrow}</p> : null}
              {heading ? <H className={`text-3xl font-semibold tracking-tight text-balance text-neutral-950 sm:text-4xl ${eyebrow ? "mt-3" : ""}`}>{heading}</H> : null}
              {intro ? <p className="mt-4 text-lg leading-8 text-pretty text-neutral-600">{intro}</p> : null}
            </div>
          ) : null}

          <div className={`grid grid-cols-1 items-start gap-8 lg:gap-12 ${hasSidebar ? "lg:grid-cols-12" : ""} ${eyebrow || heading || intro ? "mt-10 sm:mt-12" : ""}`}>
            <form action={formAction || undefined} method="post" className={`rounded-2xl bg-white p-6 shadow-sm ring-1 ring-neutral-200 sm:p-8 ${hasSidebar ? "lg:col-span-8" : ""}`}>
              <p className="text-sm leading-6 text-neutral-600">All fields are required unless marked optional.</p>

              <fieldset className="mt-8">
                <legend className="text-base leading-7 font-semibold text-neutral-950">Contact details</legend>
                <div className="mt-4 grid grid-cols-1 gap-x-6 gap-y-6 sm:grid-cols-2">
                  <div>
                    <label htmlFor={`${uid}-first`} className={labelClass}>First name</label>
                    <input id={`${uid}-first`} name="first_name" type="text" required autoComplete="given-name" className={`mt-2 ${inputClass}`} />
                  </div>
                  <div>
                    <label htmlFor={`${uid}-last`} className={labelClass}>Last name</label>
                    <input id={`${uid}-last`} name="last_name" type="text" required autoComplete="family-name" className={`mt-2 ${inputClass}`} />
                  </div>
                  <div>
                    <label htmlFor={`${uid}-email`} className={labelClass}>Email</label>
                    <input id={`${uid}-email`} name="email" type="email" required autoComplete="email" inputMode="email" className={`mt-2 ${inputClass}`} />
                  </div>
                  <div>
                    <label htmlFor={`${uid}-school`} className={labelClass}>Current school</label>
                    <input id={`${uid}-school`} name="school" type="text" required autoComplete="off" className={`mt-2 ${inputClass}`} />
                  </div>
                </div>
              </fieldset>

              <fieldset className="mt-10 border-t border-neutral-200 pt-8">
                <legend className="text-base leading-7 font-semibold text-neutral-950">Your studies</legend>
                <div className="mt-4 grid grid-cols-1 gap-x-6 gap-y-6 sm:grid-cols-2">
                  {grades.length ? <Select id={`${uid}-grade`} name="grade" label="Grade or year" options={grades} placeholder="Choose one" /> : null}
                  {fieldList.length ? <Select id={`${uid}-field`} name="field_of_study" label="What do you want to study?" options={fieldList} placeholder="Choose a field" /> : null}
                  {gpas.length ? <Select id={`${uid}-gpa`} name="gpa_range" label="Unweighted GPA" options={gpas} placeholder="Choose a range" /> : null}
                  <fieldset className="sm:col-span-2">
                    <legend className={legendClass}>Will you be the first in your family to earn a four-year degree?</legend>
                    <div className="mt-2 flex flex-col gap-1 sm:flex-row sm:gap-6">
                      {["Yes", "No", "Not sure"].map((o) => (
                        <label key={o} className="flex min-h-11 cursor-pointer items-center gap-3 text-sm leading-6 text-neutral-900">
                          <input type="radio" name="first_generation" value={o.toLowerCase()} required className={choiceClass} />
                          {o}
                        </label>
                      ))}
                    </div>
                  </fieldset>
                  {interestList.length ? (
                    <fieldset className="sm:col-span-2">
                      <legend className={legendClass}>
                        Send me information about <Optional />
                      </legend>
                      <div className="mt-2 grid grid-cols-1 gap-x-6 sm:grid-cols-2">
                        {interestList.map((o, i) => (
                          <label key={`${o}-${i}`} className="flex min-h-11 cursor-pointer items-center gap-3 text-sm leading-6 text-neutral-900">
                            <input type="checkbox" name="interests" value={o} className={`rounded ${choiceClass}`} />
                            {o}
                          </label>
                        ))}
                      </div>
                    </fieldset>
                  ) : null}
                  {essayPrompt ? (
                    <div className="sm:col-span-2">
                      <label htmlFor={`${uid}-about`} className={labelClass}>{essayPrompt}</label>
                      <textarea
                        id={`${uid}-about`}
                        name="about"
                        rows={5}
                        required
                        maxLength={hasLimit ? limit : undefined}
                        aria-describedby={`${uid}-about-hint`}
                        className={`mt-2 ${inputClass}`}
                      />
                      <p id={`${uid}-about-hint`} className="mt-2 text-sm leading-6 text-neutral-600">
                        {hasLimit ? `Up to ${limit} characters, about ${Math.max(1, Math.round(limit / 6))} words. ` : ""}
                        Plain and honest beats polished.
                      </p>
                    </div>
                  ) : null}
                  <div className="sm:col-span-2">
                    <label htmlFor={`${uid}-access`} className={labelClass}>
                      Accessibility accommodations <Optional />
                    </label>
                    <textarea id={`${uid}-access`} name="accommodations" rows={2} aria-describedby={`${uid}-access-hint`} className={`mt-2 ${inputClass}`} />
                    <p id={`${uid}-access-hint`} className="mt-2 text-sm leading-6 text-neutral-600">
                      Let us know if you need materials in another format or extra time for interviews.
                    </p>
                  </div>
                </div>
              </fieldset>

              {guardian ? (
                <fieldset className="mt-10 border-t border-neutral-200 pt-8" aria-describedby={`${uid}-guardian-hint`}>
                  <legend className="text-base leading-7 font-semibold text-neutral-950">Parent or guardian</legend>
                  <p id={`${uid}-guardian-hint`} className="mt-1 text-sm leading-6 text-neutral-600">
                    Required if you&rsquo;re under 18. Students 18 and older can skip this part.
                  </p>
                  <div className="mt-4 grid grid-cols-1 gap-6">
                    <div>
                      <label htmlFor={`${uid}-gname`} className={labelClass}>
                        Parent or guardian name <Optional />
                      </label>
                      <input id={`${uid}-gname`} name="guardian_name" type="text" autoComplete="off" className={`mt-2 ${inputClass}`} />
                    </div>
                    <div className="flex gap-3">
                      <div className="flex h-11 shrink-0 items-center">
                        <input id={`${uid}-consent`} name="guardian_consent" type="checkbox" value="yes" className={`rounded ${choiceClass}`} />
                      </div>
                      <label htmlFor={`${uid}-consent`} className="flex min-h-11 cursor-pointer items-center text-sm leading-6 text-neutral-900">
                        I&rsquo;m this student&rsquo;s parent or guardian, and the scholarship office may contact them about awards.
                      </label>
                    </div>
                  </div>
                </fieldset>
              ) : null}

              <div className="mt-10 flex flex-col gap-4 border-t border-neutral-200 pt-8 sm:flex-row sm:items-center sm:gap-6">
                <button
                  type="submit"
                  className="inline-flex min-h-12 shrink-0 items-center justify-center rounded-lg bg-indigo-600 px-6 py-3 text-base font-semibold text-white shadow-xs transition hover:bg-indigo-700 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600"
                >
                  {submitLabel || "Send my interest form"}
                </button>
                {privacyNote ? <p className="text-sm leading-6 text-pretty text-neutral-600">{privacyNote}</p> : null}
              </div>
            </form>

            {hasSidebar ? (
              <aside aria-labelledby={sidebarHeading ? `${uid}-aside` : undefined} aria-label={sidebarHeading ? undefined : "Scholarship details"} className="lg:sticky lg:top-8 lg:col-span-4">
                <div className="rounded-2xl bg-indigo-950 p-6 text-white sm:p-8">
                  {sidebarHeading ? (
                    <Sub id={`${uid}-aside`} className="text-lg leading-7 font-semibold text-white">
                      {sidebarHeading}
                    </Sub>
                  ) : null}
                  {dates.length ? (
                    <dl className={`divide-y divide-white/10 ${sidebarHeading ? "mt-5" : ""}`}>
                      {dates.map((d, i) => (
                        <div key={`${d.label}-${i}`} className="py-3 first:pt-0">
                          <dt className="text-sm leading-6 text-indigo-200">{d.label}</dt>
                          <dd className="text-base leading-7 font-semibold text-white tabular-nums">{d.date || "—"}</dd>
                        </div>
                      ))}
                    </dl>
                  ) : null}
                  {checks.length ? (
                    <div className={dates.length || sidebarHeading ? "mt-6 border-t border-white/10 pt-6" : ""}>
                      <p className="text-sm leading-6 font-semibold text-white">Who can apply</p>
                      <ul role="list" className="mt-3 space-y-2 text-sm leading-6 text-indigo-100">
                        {checks.map((c, i) => (
                          <li key={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-300">
                              <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>
                            {c}
                          </li>
                        ))}
                      </ul>
                    </div>
                  ) : null}
                  {sidebarNote ? <p className="mt-6 border-t border-white/10 pt-6 text-xs leading-5 text-pretty text-indigo-200">{sidebarNote}</p> : null}
                </div>
              </aside>
            ) : null}
          </div>
        </div>
      </section>
    );
  },
};
```
