{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "waitlist-hero",
  "title": "Waitlist: Hero",
  "description": "The ask set as large as the canvas over the brand's week, seven vermilion bars with yours lifted; under it the product in its own app window, a week Wendle planned with its totals counted from the blocks, beside the count of people waiting and the email form; join and the count rolls to your place as your bar rises, your referral link slides in, and copying it rolls you up ten places and your bar again.",
  "dependencies": [
    "motion"
  ],
  "registryDependencies": [
    "https://eased.dev/r/eased-tokens.json",
    "https://eased.dev/r/eased-motion.json",
    "https://eased.dev/r/waitlist-core.json",
    "https://eased.dev/r/template-core.json",
    "https://eased.dev/r/number-roll.json",
    "https://eased.dev/r/shimmer-text.json",
    "https://eased.dev/r/text-swap.json"
  ],
  "files": [
    {
      "path": "src/registry/eased/templates/waitlist/hero.tsx",
      "content": "\"use client\";\n\nimport { AnimatePresence, motion } from \"motion/react\";\nimport { useState, type ReactNode } from \"react\";\nimport { enter, exitFast, reducedFade, useSafeReducedMotion } from \"../../lib/motion\";\nimport { NumberRoll } from \"../../number-roll/number-roll\";\nimport { ShimmerText } from \"../../shimmer-text/shimmer-text\";\nimport { TextSwap } from \"../../text-swap/text-swap\";\nimport { EmailCapture } from \"../_shared/email-capture\";\nimport { demoSubmit, type SubmitHandler } from \"../_shared/send\";\nimport { capture, hero, joined, press } from \"./content\";\nimport { FieldArt, MotionToggle } from \"./field\";\nimport { COLUMN, formatCount, formatPlace, LABEL } from \"./kit\";\nimport { creditFrom, useLine } from \"./line\";\nimport { Referral } from \"./referral\";\nimport { Week } from \"./week\";\n\n/**\n * The first screen, and the template's signature: the ask set as large as the canvas allows\n * over the week, the count of people waiting ticking up above the form, and the product, a\n * week Wendle planned, beside it from lg and under it below. Join and the count rolls to your\n * place while your bar in the week rises, the form gives way to one line of thanks and your\n * referral link rises in under it; copy the link and, a beat later, your place rolls up ten\n * and your bar rises again. Nothing leaves the page unless you pass `onSubmit`.\n */\nexport function Hero({ onSubmit = demoSubmit }: { onSubmit?: SubmitHandler<string> }) {\n  const line = useLine();\n  const [pending, setPending] = useState(false);\n  // Joined on this visit: the form shows its own thanks. Joined before (a reload, another\n  // page): the thanks stands in its place from the start, and takes no focus.\n  const [here, setHere] = useState(false);\n\n  const join: SubmitHandler<string> = async (email) => {\n    setPending(true);\n    try {\n      await onSubmit(email);\n      setHere(true);\n      line.join();\n    } finally {\n      setPending(false);\n    }\n  };\n\n  return (\n    <section aria-labelledby=\"hero-title\" data-wl-field=\"\" className=\"relative isolate flex min-h-dvh flex-col overflow-hidden text-text\">\n      <FieldArt step={line.place === null ? 0 : line.credited ? 2 : 1} />\n      <div\n        className={`${COLUMN} relative flex flex-1 flex-col items-center justify-center gap-pad-lg pt-[calc(var(--wl-header)+2rem)] pb-pad-xl text-center lg:gap-pad-base lg:pt-[calc(var(--wl-header)+1rem)] lg:pb-pad-base [@media(max-height:700px)]:gap-pad-sm [@media(max-height:700px)]:pt-[calc(var(--wl-header)+0.5rem)]`}\n      >\n        <p className={`wl-rise ${LABEL} rounded-full border border-line bg-surface px-3 py-1 text-text`}>{hero.label}</p>\n        {/* Below 380px the floor drops with the width, so the ask stays on one line. */}\n        <h1\n          id=\"hero-title\"\n          className=\"wl-rise font-display text-[clamp(min(4.5rem,19vw),min(14vw,21svh),11.5rem)] leading-[0.92] font-semibold tracking-[-0.045em] text-balance [--i:1]\"\n        >\n          {hero.title}\n        </h1>\n        <p className=\"wl-rise max-w-xl text-ui-md text-pretty text-text-secondary [--i:2] sm:text-ui-lg lg:max-w-5xl [@media(max-height:700px)]:text-ui\">{hero.lead}</p>\n        {/* From lg the product sits on the left and the count and form beside it, the whole of it\n            inside the first screen with the press lines; below lg the product follows the form,\n            so the form and its answer stay in the first screen on phones. */}\n        <div className=\"grid w-full max-w-6xl gap-pad-base sm:gap-pad-xl lg:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] lg:items-center lg:gap-group-lg\">\n          <div className=\"flex min-w-0 flex-col items-center lg:order-last lg:items-start lg:text-left\">\n            <div data-wl-restore=\"\" className=\"wl-rise flex w-full max-w-lg flex-col items-center gap-pad-base [--i:3] lg:items-start\">\n              <Count pending={pending} />\n              {/* One box for the form and what follows it, as tall as its tallest state (the stacked\n                  form with an error on phones, the credited link): nothing outside it ever moves. */}\n              <div id=\"join\" className=\"flex h-60 w-full flex-col gap-pad-base sm:h-40\">\n                <div data-wl-paper=\"\" className=\"w-full text-left text-text\">\n                  {line.place !== null && !here ? (\n                    <p className={`${CAPSULE} flex items-center`}>\n                      <Joined />\n                    </p>\n                  ) : (\n                    <EmailCapture {...capture} sent={<Joined spoken />} onSubmit={join} size=\"lg\" className={`${CAPSULE} max-sm:flex-col max-sm:items-stretch`} />\n                  )}\n                </div>\n                <Next />\n              </div>\n            </div>\n          </div>\n          <Week className=\"wl-rise h-[22rem] [--i:4] sm:h-[24rem] lg:h-[min(21rem,40svh)]\" />\n        </div>\n      </div>\n      <Proof />\n    </section>\n  );\n}\n\n/** The form's paper capsule: its radius is the controls' plus its padding, so the corners nest. */\nconst CAPSULE = \"w-full rounded-[calc(var(--eased-radius-control)+--spacing(1.5))] bg-surface p-1.5 shadow-floating\";\n\n/**\n * The count above the form, in the serif: people waiting, ticking up on its own; then, from\n * the moment you join, your place. The digits are hidden from screen readers, which get the\n * count as plain text that is never live (the place is read once, by the thanks). Below sm,\n * and in the column beside the product from lg, the caption sits under the number on one\n * line, so the block never changes height.\n */\nfunction Count({ pending }: { pending: boolean }) {\n  const { waiting, place, live } = useLine();\n  const caption = place !== null ? `${hero.yours} · ${hero.behind(Math.max(0, waiting - place))}` : hero.waiting;\n  return (\n    <div className=\"flex flex-col items-center gap-1 sm:flex-row sm:items-baseline sm:gap-x-3 lg:flex-col lg:items-start lg:gap-1\">\n      {/* A tall line for the digits' feathered mask, pulled back so the block keeps its height. */}\n      <NumberRoll\n        value={place ?? waiting}\n        formatter={place !== null ? formatPlace : formatCount}\n        animated={live}\n        aria-hidden\n        className=\"-my-[0.15em] font-serif text-display-6xl leading-[1.3] font-normal tracking-display tabular-nums\"\n      />\n      <span aria-hidden className=\"text-ui whitespace-nowrap text-text-secondary sm:text-ui-md\">\n        {pending ? <ShimmerText className=\"text-text-secondary\">{hero.saving}</ShimmerText> : live ? <TextSwap>{caption}</TextSwap> : caption}\n      </span>\n      <span className=\"sr-only\">{place !== null ? `${hero.yours}: ${formatPlace(place)}` : `${formatCount(waiting)} ${hero.waiting}`}</span>\n    </div>\n  );\n}\n\n/** The thanks in the form's place. Said with the place when it arrives (it takes focus then); shown only when it was already there. */\nfunction Joined({ spoken = false }: { spoken?: boolean }) {\n  const { place } = useLine();\n  const said: ReactNode = spoken && place !== null ? <span className=\"sr-only\">{joined.spoken(formatPlace(place))}</span> : null;\n  return (\n    <span className=\"inline-flex min-h-control-lg items-center gap-2 px-2.5\">\n      <svg viewBox=\"0 0 16 16\" fill=\"none\" className=\"size-4 shrink-0 text-brand-text\" aria-hidden>\n        <path d=\"M3.25 8.5 6.5 11.75 12.75 4.75\" stroke=\"currentColor\" strokeWidth=\"1.75\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n      </svg>\n      <span aria-hidden={spoken || undefined}>{joined.shown}</span>\n      {said}\n    </span>\n  );\n}\n\n/** Under the form: the promise before you join, your link after. The link waits for the place to finish rolling before it rises in. */\nfunction Next() {\n  const { place, credited, credit, live } = useLine();\n  const reduced = useSafeReducedMotion();\n  const after = place === null ? 1 : creditFrom(place);\n  return (\n    <div className=\"grid w-full min-w-0 text-left *:col-start-1 *:row-start-1\">\n      <AnimatePresence initial={false}>\n        {place === null ? (\n          <motion.p key=\"promise\" className=\"justify-self-center text-ui text-text-muted lg:justify-self-start\" exit={{ opacity: 0, transition: exitFast }}>\n            {hero.promise}\n          </motion.p>\n        ) : (\n          <motion.div\n            key=\"referral\"\n            className=\"min-w-0\"\n            initial={!live ? false : reduced ? { opacity: 0 } : { opacity: 0, y: 8 }}\n            animate={{ opacity: 1, y: 0 }}\n            transition={reduced ? reducedFade : { ...enter, duration: 0.4, delay: 0.45 }}\n          >\n            <Referral credited={credited} onCredit={credit} moved={place - after} creditedPlace={formatPlace(after)} />\n          </motion.div>\n        )}\n      </AnimatePresence>\n    </div>\n  );\n}\n\n/** The press lines along the foot of the field, with the motion switch at the end; padded clear of a docked bar. */\nfunction Proof() {\n  return (\n    <div className={`${COLUMN} relative flex flex-col gap-pad-md pb-20 sm:flex-row sm:items-end sm:justify-between`}>\n      <span aria-hidden className=\"absolute inset-x-4 top-0 h-px bg-line sm:inset-x-6 xl:inset-x-10\" />\n      <figure className=\"wl-rise flex flex-col gap-in pt-pad-md [--i:4]\">\n        <figcaption className={LABEL}>{press.label}</figcaption>\n        <ul className=\"grid gap-x-pad-lg gap-y-pad-sm sm:grid-cols-3\">\n          {press.lines.map((l, i) => (\n            <li key={l.source} className=\"flex max-w-64 flex-col gap-1 text-left\">\n              <q className=\"text-ui text-pretty text-text-secondary\">{l.quote}</q>\n              <span className={`text-ui-md text-text ${SOURCE[i]}`}>{l.source}</span>\n            </li>\n          ))}\n        </ul>\n      </figure>\n      <MotionToggle className=\"-ms-3 self-start sm:ms-0 sm:-me-3 sm:self-end\" />\n    </div>\n  );\n}\n\n/** Each invented publication gets its own set of the name, so they read as three mastheads. */\nconst SOURCE = [\"font-serif italic\", \"font-mono text-ui-sm uppercase tracking-caps\", \"font-semibold tracking-[-0.03em]\"];\n",
      "type": "registry:component",
      "target": "@components/eased/templates/waitlist/hero.tsx"
    },
    {
      "path": "src/registry/eased/templates/waitlist/week.tsx",
      "content": "import { product } from \"./content\";\nimport { LABEL, Mark } from \"./kit\";\n\n/**\n * The product beside the form: Wendle's week for a sample person, drawn in code in the app's\n * own window, with its rail of views down the left. Meetings come from the calendars, Wendle\n * places the work around them and keeps the hours it was asked to keep; the totals in the bar\n * and each task's hours are counted from the blocks. It is a picture of the product, so it\n * reads as one image with a description and nothing in it takes focus. Below sm the rail and\n * the task list give their width to the five days.\n */\n\ntype Kind = keyof typeof product.kinds;\nconst [START, END] = product.day;\nconst SPAN = END - START;\n\n/** \"13h 30m\", \"2h\", \"30m\". */\nconst hours = (h: number) => {\n  const whole = Math.floor(h);\n  const minutes = Math.round((h - whole) * 60);\n  return [whole && `${whole}h`, minutes && `${minutes}m`].filter(Boolean).join(\" \") || \"0h\";\n};\nconst clock = (h: number) => `${Math.floor(h)}:${String(Math.round((h % 1) * 60)).padStart(2, \"0\")}`;\n\nconst total = (kind: Kind) => product.blocks.reduce((sum, b) => sum + (b.kind === kind ? b.to - b.from : 0), 0);\nconst placed = (task: string) => product.blocks.reduce((sum, b) => sum + (\"task\" in b && b.task === task ? b.to - b.from : 0), 0);\nconst busy = total(\"meeting\") + total(\"planned\") + total(\"kept\");\nconst TOTALS: Record<Kind, number> = {\n  meeting: total(\"meeting\"),\n  planned: total(\"planned\"),\n  kept: total(\"kept\"),\n  free: SPAN * product.days.length - busy,\n};\n\n/** Each kind's block, over an opaque backing so the hour lines never show through. */\nconst BLOCK: Record<Exclude<Kind, \"free\">, string> = {\n  meeting: \"bg-surface-sunken text-text-secondary shadow-[inset_0_0_0_1px_var(--eased-line-subtle)]\",\n  planned: \"bg-brand-subtle text-brand-text shadow-[inset_2px_0_0_var(--eased-brand)]\",\n  kept: \"bg-[repeating-linear-gradient(135deg,var(--eased-line-subtle)_0_1px,transparent_1px_6px)] text-text-muted shadow-[inset_0_0_0_1px_var(--eased-line)]\",\n};\nconst SWATCH: Record<Kind, string> = {\n  meeting: \"bg-surface-sunken shadow-[inset_0_0_0_1px_var(--eased-line)]\",\n  planned: \"bg-brand\",\n  kept: \"bg-[repeating-linear-gradient(135deg,var(--eased-line-strong)_0_1px,transparent_1px_3px)] shadow-[inset_0_0_0_1px_var(--eased-line)]\",\n  free: \"shadow-[inset_0_0_0_1px_var(--eased-line-strong)]\",\n};\n\n/** The hour lines down the grid, every hour; labelled every other one. */\nconst LINES = Array.from({ length: SPAN + 1 }, (_, i) => START + i);\n\n/** The rail's glyphs for the views, in order: the week, the plans, the kept hours. */\nconst VIEW_ICONS = [\n  <path key=\"week\" d=\"M3 4.5h10v8H3zM3 7h10M6 3v3M10 3v3\" />,\n  <path key=\"plans\" d=\"M6 5h7M6 8h7M6 11h5M3.5 5h.01M3.5 8h.01M3.5 11h.01\" />,\n  <path key=\"kept\" d=\"M8 2.75 12.5 4.5v3.25c0 2.6-1.9 4.6-4.5 5.5-2.6-.9-4.5-2.9-4.5-5.5V4.5Z\" />,\n];\n\nexport function Week({ className = \"\" }: { className?: string }) {\n  return (\n    <div\n      role=\"img\"\n      aria-label={product.label}\n      data-wl-paper=\"\"\n      className={`flex min-w-0 overflow-hidden rounded-panel bg-bg text-left text-text shadow-floating ${className}`}\n    >\n      <div aria-hidden className=\"flex min-w-0 flex-1\">\n        <Rail />\n        <div className=\"flex min-w-0 flex-1 flex-col bg-surface\">\n          <Bar />\n          <div className=\"flex min-h-0 min-w-0 flex-1\">\n            <Grid />\n            <Side />\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n\n/** The app's rail: the mark, the views with the week open, and the signed-in person. */\nfunction Rail() {\n  return (\n    <div className=\"flex w-11 shrink-0 flex-col items-center gap-1.5 border-e border-line-subtle py-2.5 max-sm:hidden\">\n      <Mark className=\"mb-2 size-4 text-brand\" />\n      {product.views.map((v, i) => (\n        <span key={v} className={`grid size-7 place-items-center rounded-control-xs ${i === 0 ? \"bg-surface-active text-text\" : \"text-text-muted\"}`}>\n          <svg viewBox=\"0 0 16 16\" className=\"size-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.3\" strokeLinecap=\"round\" strokeLinejoin=\"round\">\n            {VIEW_ICONS[i]}\n          </svg>\n        </span>\n      ))}\n      <span className=\"mt-auto grid size-6 place-items-center rounded-full bg-brand-subtle font-mono text-[0.5625rem] text-brand-text\">{product.initials}</span>\n    </div>\n  );\n}\n\n/** The window's top: the week, and its totals. */\nfunction Bar() {\n  return (\n    <div className=\"flex min-w-0 flex-wrap items-center gap-x-pad-base gap-y-1.5 border-b border-line-subtle px-3 py-2.5\">\n      <div className=\"flex shrink-0 items-center gap-2 whitespace-nowrap\">\n        <Mark className=\"size-4 text-brand sm:hidden\" />\n        <span className=\"text-ui-sm font-semibold tracking-display\">{product.title}</span>\n        <span className=\"text-ui-xs text-text-muted\">{product.range}</span>\n      </div>\n      <ul className=\"flex flex-wrap items-center gap-x-3 gap-y-1 xl:ms-auto\">\n        {(Object.keys(product.kinds) as Kind[]).map((k) => (\n          <li key={k} className=\"flex items-center gap-1.5 text-ui-xs whitespace-nowrap text-text-muted\">\n            <span className={`size-2.5 rounded-[3px] ${SWATCH[k]}`} />\n            {product.kinds[k]}\n            <span className=\"font-medium text-text tabular-nums\">{hours(TOTALS[k])}</span>\n          </li>\n        ))}\n      </ul>\n    </div>\n  );\n}\n\n/** The days side by side, each block placed by its hours. */\nfunction Grid() {\n  return (\n    <div className=\"flex min-w-0 flex-1 flex-col px-2 pb-2\">\n      <div className=\"grid grid-cols-[1.25rem_repeat(5,minmax(0,1fr))] sm:grid-cols-[1.5rem_repeat(5,minmax(0,1fr))] gap-x-1 py-1.5\">\n        <span />\n        {product.days.map((d) => (\n          <span key={d} className={`${LABEL} text-[0.625rem]`}>\n            {d}\n          </span>\n        ))}\n      </div>\n      <div className=\"relative grid min-h-0 flex-1 grid-cols-[1.25rem_repeat(5,minmax(0,1fr))] sm:grid-cols-[1.5rem_repeat(5,minmax(0,1fr))] gap-x-1\">\n        {/* The hour lines and their labels, behind the days. */}\n        <div className=\"pointer-events-none absolute inset-0\">\n          {LINES.map((h, i) => (\n            <div key={h} className=\"absolute inset-x-0 flex items-center gap-1\" style={{ top: `${(i / SPAN) * 100}%` }}>\n              <span className=\"w-5 -translate-y-1/2 sm:w-6 text-[0.625rem] leading-none text-text-muted tabular-nums\">{i % 2 === 0 && i < SPAN ? h : \"\"}</span>\n              <span className=\"h-px flex-1 bg-line-subtle\" />\n            </div>\n          ))}\n        </div>\n        <span />\n        {product.days.map((d, day) => (\n          <div key={d} className=\"relative\">\n            {product.blocks\n              .filter((b) => b.day === day)\n              .map((b) => {\n                // A second line for the start time only where there is room for it.\n                const tall = b.to - b.from >= 1.5;\n                return (\n                  <div\n                    key={b.from}\n                    className=\"absolute inset-x-0 overflow-hidden rounded-[5px] bg-surface\"\n                    style={{ top: `calc(${((b.from - START) / SPAN) * 100}% + 1px)`, height: `calc(${((b.to - b.from) / SPAN) * 100}% - 2px)` }}\n                  >\n                    <div className={`flex size-full px-1 sm:px-1.5 ${tall ? \"flex-col pt-1\" : \"items-center\"} ${BLOCK[b.kind]}`}>\n                      <span className=\"truncate text-[0.625rem] leading-tight font-medium sm:text-ui-2xs\">{b.title}</span>\n                      {tall && <span className=\"truncate text-[0.625rem] leading-tight opacity-80 tabular-nums\">{clock(b.from)}</span>}\n                    </div>\n                  </div>\n                );\n              })}\n          </div>\n        ))}\n      </div>\n    </div>\n  );\n}\n\n/** What Wendle was asked to fit in, with the hours it found for each. From sm. */\nfunction Side() {\n  return (\n    <div className=\"flex w-40 shrink-0 flex-col gap-2.5 border-s border-line-subtle p-3 max-sm:hidden xl:w-48\">\n      <p className={`${LABEL} text-[0.625rem]`}>{product.tasksLabel}</p>\n      <ul className=\"flex flex-col gap-2\">\n        {product.tasks.map((t) => {\n          const got = placed(t.id);\n          const short = t.hours - got;\n          return (\n            <li key={t.id} className=\"flex min-w-0 flex-col gap-1\">\n              <div className=\"flex items-baseline justify-between gap-2\">\n                <span className=\"truncate text-ui-xs font-medium\">{t.title}</span>\n                <span className=\"shrink-0 text-ui-2xs text-text-muted tabular-nums\">\n                  {hours(got)}/{hours(t.hours)}\n                </span>\n              </div>\n              <span className=\"relative h-1 overflow-hidden rounded-full bg-surface-sunken\">\n                <span className=\"absolute inset-y-0 left-0 rounded-full bg-brand\" style={{ width: `${Math.min(1, got / t.hours) * 100}%` }} />\n              </span>\n              <span className={`text-ui-2xs ${short > 0 ? \"text-brand-text\" : \"text-text-muted\"}`}>\n                {short > 0 ? product.short(hours(short)) : product.due(t.due)}\n              </span>\n            </li>\n          );\n        })}\n      </ul>\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/eased/templates/waitlist/week.tsx"
    }
  ],
  "meta": {
    "template": "waitlist",
    "kind": "template-section",
    "industries": [
      "saas"
    ]
  },
  "type": "registry:block"
}