{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-seat-stepper",
  "type": "registry:component",
  "title": "Pricing Seat Stepper",
  "description": "A press-and-hold seat stepper that fills a row of teammate avatars while a dot climbs down a volume staircase chart. Price per seat, savings and the next price break update live, with a jump to the break.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "pricing",
    "pricing",
    "seats",
    "stepper",
    "volume discount",
    "team",
    "chart"
  ],
  "docs": "https://hyperblur.dev/effects/pricing-seat-stepper",
  "files": [
    {
      "path": "registry/hyperblur/pricing-seat-stepper.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/pricing-seat-stepper.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface PricingSeatBand {\n  upTo: number | null;\n  price: number;\n}\n\nexport interface PricingSeatStepperProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onChange\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  bands?: PricingSeatBand[];\n  min?: number;\n  max?: number;\n  value?: number;\n  defaultValue?: number;\n  onChange?: (seats: number, monthly: number) => void;\n  names?: string[];\n  currency?: string;\n  locale?: string;\n  cta?: { label: string; href: string };\n  accent?: string;\n}\n\nconst defaultBands: PricingSeatBand[] = [\n  { upTo: 10, price: 16 },\n  { upTo: 25, price: 14 },\n  { upTo: 50, price: 12 },\n  { upTo: 100, price: 10 },\n  { upTo: null, price: 8 },\n];\n\nconst defaultNames = [\n  \"Maya Chen\", \"Leo Brandt\", \"Ana Souza\", \"Omar Haddad\", \"Ivy Park\", \"Noah Reyes\", \"Sara Lind\", \"Kai Tanaka\",\n  \"Zoe Martin\", \"Eli Novak\", \"Rosa Diaz\", \"Theo Laurent\", \"Nina Popov\", \"Jonah Weiss\", \"Lia Moreau\", \"Sam Okafor\",\n  \"Ada Kowal\", \"Ravi Shah\", \"Mila Costa\", \"Ben Arendt\", \"Yara Nasser\", \"Finn Doyle\", \"Iris Vance\", \"Tom Becker\",\n];\n\nconst hues = [212, 262, 152, 28, 338, 190, 46, 286];\nconst AVATARS = 21;\n\nconst css = `\n.hb-vh9 {\n  --hb-vh9-accent: #2f7bff;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vh9 *, .hb-vh9 *::before, .hb-vh9 *::after { box-sizing: border-box; }\n.hb-vh9-inner { max-width: 1040px; margin: 0 auto; padding: 64px 20px; }\n.hb-vh9-head { display: grid; gap: 10px; max-width: 600px; }\n.hb-vh9-eyebrow { margin: 0; color: #8f8f8f; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }\n.hb-vh9-title { margin: 0; font-size: clamp(28px, 4.4cqi, 42px); font-weight: 650; line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; }\n.hb-vh9-sub { margin: 0; color: #8f8f8f; font-size: 15px; line-height: 1.6; }\n.hb-vh9-card {\n  display: grid;\n  grid-template-columns: 1fr;\n  margin-top: 34px;\n  border-radius: 22px;\n  border: 1px solid rgba(255, 255, 255, .08);\n  background: linear-gradient(180deg, #121214, #0c0c0e);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);\n  overflow: hidden;\n}\n@container (min-width: 780px) { .hb-vh9-card { grid-template-columns: 1.15fr 1fr; } }\n.hb-vh9-left { padding: 26px; }\n.hb-vh9-right { display: flex; flex-direction: column; padding: 26px; border-top: 1px solid rgba(255, 255, 255, .07); }\n@container (min-width: 780px) { .hb-vh9-right { border-top: 0; border-left: 1px solid rgba(255, 255, 255, .07); } }\n.hb-vh9-ctl { display: flex; align-items: center; justify-content: space-between; gap: 16px; }\n.hb-vh9-ctl label { color: #a1a1a1; font-size: 14px; font-weight: 500; }\n.hb-vh9-stepper { display: inline-flex; align-items: center; padding: 4px; border-radius: 14px; background: #19191c; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }\n.hb-vh9-btn {\n  display: grid;\n  place-items: center;\n  width: 38px;\n  height: 38px;\n  padding: 0;\n  border: 0;\n  border-radius: 10px;\n  background: #242428;\n  color: #ededed;\n  cursor: pointer;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);\n  touch-action: manipulation;\n  user-select: none;\n  transition: background-color .2s ease, transform .15s cubic-bezier(.34, 1.56, .64, 1), opacity .2s ease;\n}\n.hb-vh9-btn svg { width: 14px; height: 14px; }\n.hb-vh9-btn:hover { background: #2e2e33; }\n.hb-vh9-btn:active { transform: scale(.9); }\n.hb-vh9-btn:disabled { opacity: .35; cursor: default; transform: none; }\n.hb-vh9-btn:focus-visible { outline: 2px solid var(--hb-vh9-accent); outline-offset: 2px; }\n.hb-vh9-num {\n  width: 72px;\n  height: 38px;\n  border: 0;\n  background: transparent;\n  color: #fff;\n  font: inherit;\n  font-size: 20px;\n  font-weight: 650;\n  text-align: center;\n  font-variant-numeric: tabular-nums;\n  outline: none;\n  -moz-appearance: textfield;\n  appearance: textfield;\n}\n.hb-vh9-num::-webkit-inner-spin-button, .hb-vh9-num::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }\n.hb-vh9-num:focus-visible { border-radius: 8px; box-shadow: 0 0 0 2px var(--hb-vh9-accent); }\n.hb-vh9-team { display: flex; flex-wrap: wrap; gap: 0; min-height: 76px; margin-top: 22px; padding-left: 8px; align-content: flex-start; }\n.hb-vh9-av {\n  display: grid;\n  place-items: center;\n  width: 34px;\n  height: 34px;\n  margin: 0 0 4px -8px;\n  border-radius: 999px;\n  border: 2px solid #111113;\n  background: linear-gradient(135deg, hsl(var(--h) 70% 62%), hsl(var(--h) 60% 38%));\n  color: #fff;\n  font-size: 11px;\n  font-weight: 650;\n  letter-spacing: .02em;\n  animation: hb-vh9-pop .45s cubic-bezier(.34, 1.7, .5, 1) both;\n}\n@keyframes hb-vh9-pop { from { opacity: 0; transform: scale(.2) translateY(8px); } to { opacity: 1; transform: none; } }\n.hb-vh9-more { background: #232326; color: #a1a1a1; font-size: 10.5px; }\n.hb-vh9-chart { position: relative; margin-top: 18px; }\n.hb-vh9-chart svg { display: block; width: 100%; height: auto; overflow: visible; }\n.hb-vh9-step { fill: rgba(255, 255, 255, .035); transition: fill .3s ease; }\n.hb-vh9-step[data-on=\"true\"] { fill: color-mix(in srgb, var(--hb-vh9-accent) 22%, transparent); }\n.hb-vh9-edge { fill: none; stroke: #3a3a40; stroke-width: 1.5; }\n.hb-vh9-edge-on { fill: none; stroke: var(--hb-vh9-accent); stroke-width: 2; }\n.hb-vh9-blabel { fill: #6f6f6f; font-size: 10px; font-family: var(--font-mono), ui-monospace, monospace; }\n.hb-vh9-bprice { fill: #a1a1a1; font-size: 11px; font-weight: 600; }\n.hb-vh9-step[data-on=\"true\"] + .hb-vh9-bprice, .hb-vh9-bprice[data-on=\"true\"] { fill: #fff; }\n.hb-vh9-dot { fill: #fff; stroke: var(--hb-vh9-accent); stroke-width: 3; transition: cx .45s cubic-bezier(.22, 1, .36, 1), cy .45s cubic-bezier(.22, 1, .36, 1); }\n.hb-vh9-halo { fill: var(--hb-vh9-accent); opacity: .25; transition: cx .45s cubic-bezier(.22, 1, .36, 1), cy .45s cubic-bezier(.22, 1, .36, 1); animation: hb-vh9-pulse 2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }\n@keyframes hb-vh9-pulse { 0%, 100% { transform: scale(1); opacity: .25; } 50% { transform: scale(1.6); opacity: .08; } }\n.hb-vh9-per { color: #8f8f8f; font-size: 13px; }\n.hb-vh9-per-row { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }\n.hb-vh9-per-row strong { font-size: 40px; font-weight: 650; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }\n.hb-vh9-per-row s { color: #6f6f6f; font-size: 15px; text-decoration-color: #f87171; text-decoration-thickness: 1.5px; font-variant-numeric: tabular-nums; }\n.hb-vh9-per-row span { color: #8f8f8f; font-size: 13px; }\n.hb-vh9-lines { display: grid; gap: 0; margin: 20px 0 0; padding: 0; list-style: none; }\n.hb-vh9-lines li { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .06); color: #a1a1a1; font-size: 13.5px; font-variant-numeric: tabular-nums; }\n.hb-vh9-lines li b { color: #ededed; font-weight: 600; }\n.hb-vh9-lines li[data-save=\"true\"] b { color: #6ee7b7; }\n.hb-vh9-hint {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  margin-top: 14px;\n  padding: 10px 12px;\n  border-radius: 12px;\n  background: color-mix(in srgb, var(--hb-vh9-accent) 9%, transparent);\n  color: #c4c4c4;\n  font-size: 12.5px;\n  line-height: 1.4;\n}\n.hb-vh9-hint svg { flex: none; width: 15px; height: 15px; color: var(--hb-vh9-accent); }\n.hb-vh9-hint b { color: #fff; font-weight: 600; }\n.hb-vh9-hint button { margin-left: auto; padding: 0; border: 0; background: none; color: color-mix(in srgb, var(--hb-vh9-accent) 50%, #fff); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }\n.hb-vh9-hint button:focus-visible { outline: 2px solid var(--hb-vh9-accent); outline-offset: 2px; border-radius: 4px; }\n.hb-vh9-cta {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  height: 46px;\n  margin-top: auto;\n  border-radius: 13px;\n  background: var(--hb-vh9-accent);\n  color: #fff;\n  font-size: 14.5px;\n  font-weight: 600;\n  text-decoration: none;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 26px -12px var(--hb-vh9-accent);\n  transition: filter .2s ease, transform .15s ease;\n}\n.hb-vh9-ctawrap { display: flex; flex-direction: column; flex: 1; justify-content: flex-end; margin-top: 18px; }\n.hb-vh9-cta:hover { filter: brightness(1.1); }\n.hb-vh9-cta:active { transform: scale(.985); }\n.hb-vh9-cta:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-vh9 *, .hb-vh9 *::before, .hb-vh9 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction bandFor(bands: PricingSeatBand[], seats: number) {\n  const i = bands.findIndex((b) => b.upTo === null || seats <= b.upTo);\n  return i === -1 ? bands.length - 1 : i;\n}\n\nfunction initials(name: string) {\n  return name.split(\" \").map((p) => p[0] ?? \"\").join(\"\").slice(0, 2).toUpperCase();\n}\n\nexport function PricingSeatStepper({\n  eyebrow = \"Team pricing\",\n  title = \"Add your whole team. Every seat gets cheaper.\",\n  subtitle = \"One price per seat, set by the size of your team. Cross a break and every seat drops to the lower rate, not just the new ones.\",\n  bands = defaultBands,\n  min = 1,\n  max = 500,\n  value,\n  defaultValue = 18,\n  onChange,\n  names = defaultNames,\n  currency = \"USD\",\n  locale = \"en-US\",\n  cta = { label: \"Start your team trial\", href: \"#\" },\n  accent = \"#2f7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: PricingSeatStepperProps) {\n  const uid = React.useId();\n  const [inner, setInner] = React.useState(defaultValue);\n  const [draft, setDraft] = React.useState<string | null>(null);\n  const seats = Math.max(min, Math.min(max, value ?? inner));\n  const timer = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n  const seatsRef = React.useRef(seats);\n\n  React.useEffect(() => {\n    seatsRef.current = seats;\n  }, [seats]);\n\n  const money = React.useMemo(\n    () => new Intl.NumberFormat(locale, { style: \"currency\", currency, maximumFractionDigits: 0 }),\n    [locale, currency],\n  );\n  const num = React.useMemo(() => new Intl.NumberFormat(locale), [locale]);\n\n  const bi = bandFor(bands, seats);\n  const band = bands[bi];\n  const list = bands[0]?.price ?? band.price;\n  const monthly = seats * band.price;\n  const saved = seats * (list - band.price);\n  const next = bands[bi + 1];\n  const nextAt = band.upTo !== null ? band.upTo + 1 : null;\n\n  const set = React.useCallback(\n    (n: number) => {\n      const v = Math.max(min, Math.min(max, Math.round(n)));\n      if (value === undefined) setInner(v);\n      const b = bands[bandFor(bands, v)];\n      onChange?.(v, v * b.price);\n    },\n    [min, max, value, bands, onChange],\n  );\n\n  const stop = () => {\n    if (timer.current) clearTimeout(timer.current);\n    timer.current = null;\n  };\n\n  const hold = (d: number) => {\n    stop();\n    set(seatsRef.current + d);\n    seatsRef.current = Math.max(min, Math.min(max, seatsRef.current + d));\n    let delay = 380;\n    let count = 0;\n    const tick = () => {\n      count += 1;\n      const step = count > 14 ? 5 : 1;\n      const nv = Math.max(min, Math.min(max, seatsRef.current + d * step));\n      if (nv === seatsRef.current) { stop(); return; }\n      set(nv);\n      seatsRef.current = nv;\n      delay = Math.max(50, delay * 0.8);\n      timer.current = setTimeout(tick, delay);\n    };\n    timer.current = setTimeout(tick, delay);\n  };\n\n  React.useEffect(() => stop, []);\n\n  const W = 420;\n  const H = 120;\n  const pad = 6;\n  const finite = bands.map((b, i) => b.upTo ?? Math.round((bands[i - 1]?.upTo ?? 10) * 2));\n  const cap = finite[finite.length - 1];\n  const sx = (s: number) => pad + (Math.log(Math.min(s, cap) + 1) / Math.log(cap + 1)) * (W - pad * 2);\n  const maxP = Math.max(...bands.map((b) => b.price));\n  const sy = (p: number) => 24 + (1 - p / maxP) * (H - 52);\n  const starts = bands.map((_, i) => (i === 0 ? 0 : finite[i - 1]));\n  const path = bands\n    .map((b, i) => `${i === 0 ? \"M\" : \"L\"}${sx(starts[i]).toFixed(1)} ${sy(b.price).toFixed(1)} L${sx(finite[i]).toFixed(1)} ${sy(b.price).toFixed(1)}`)\n    .join(\" \");\n  const onPath = bands\n    .slice(0, bi + 1)\n    .map((b, i) => {\n      const end = i === bi ? Math.min(seats, finite[i]) : finite[i];\n      return `${i === 0 ? \"M\" : \"L\"}${sx(starts[i]).toFixed(1)} ${sy(b.price).toFixed(1)} L${sx(end).toFixed(1)} ${sy(b.price).toFixed(1)}`;\n    })\n    .join(\" \");\n  const dx = sx(seats).toFixed(1);\n  const dy = sy(band.price).toFixed(1);\n\n  const shown = Math.min(seats, AVATARS);\n  const extra = seats - shown;\n\n  return (\n    <section className={`hb-vh9 ${className}`} style={{ \"--hb-vh9-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-pricing-seat-stepper\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vh9-inner\">\n        <div className=\"hb-vh9-head\">\n          {eyebrow ? <p className=\"hb-vh9-eyebrow\">{eyebrow}</p> : null}\n          <h2 className=\"hb-vh9-title\">{title}</h2>\n          {subtitle ? <p className=\"hb-vh9-sub\">{subtitle}</p> : null}\n        </div>\n        <div className=\"hb-vh9-card\">\n          <div className=\"hb-vh9-left\">\n            <div className=\"hb-vh9-ctl\">\n              <label htmlFor={`${uid}-n`}>Seats on your team</label>\n              <div className=\"hb-vh9-stepper\">\n                <button\n                  type=\"button\"\n                  className=\"hb-vh9-btn\"\n                  aria-label=\"Remove a seat\"\n                  disabled={seats <= min}\n                  onPointerDown={(e) => { if (e.button === 0) hold(-1); }}\n                  onPointerUp={stop}\n                  onPointerLeave={stop}\n                  onPointerCancel={stop}\n                  onClick={(e) => { if (e.detail === 0) set(seats - 1); }}\n                >\n                  <svg viewBox=\"0 0 14 14\" aria-hidden=\"true\"><path d=\"M3 7h8\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" /></svg>\n                </button>\n                <input\n                  id={`${uid}-n`}\n                  className=\"hb-vh9-num\"\n                  type=\"number\"\n                  inputMode=\"numeric\"\n                  min={min}\n                  max={max}\n                  value={draft ?? String(seats)}\n                  onChange={(e) => {\n                    setDraft(e.target.value);\n                    const n = Number(e.target.value);\n                    if (e.target.value !== \"\" && Number.isFinite(n)) set(n);\n                  }}\n                  onBlur={() => setDraft(null)}\n                  onKeyDown={(e) => {\n                    if (e.key === \"ArrowUp\") { e.preventDefault(); setDraft(null); set(seats + (e.shiftKey ? 10 : 1)); }\n                    if (e.key === \"ArrowDown\") { e.preventDefault(); setDraft(null); set(seats - (e.shiftKey ? 10 : 1)); }\n                  }}\n                />\n                <button\n                  type=\"button\"\n                  className=\"hb-vh9-btn\"\n                  aria-label=\"Add a seat\"\n                  disabled={seats >= max}\n                  onPointerDown={(e) => { if (e.button === 0) hold(1); }}\n                  onPointerUp={stop}\n                  onPointerLeave={stop}\n                  onPointerCancel={stop}\n                  onClick={(e) => { if (e.detail === 0) set(seats + 1); }}\n                >\n                  <svg viewBox=\"0 0 14 14\" aria-hidden=\"true\"><path d=\"M3 7h8M7 3v8\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" /></svg>\n                </button>\n              </div>\n            </div>\n            <div className=\"hb-vh9-team\" aria-hidden=\"true\">\n              {Array.from({ length: shown }, (_, i) => {\n                const name = names[i % Math.max(1, names.length)] ?? \"Team member\";\n                return (\n                  <span key={i} className=\"hb-vh9-av\" style={{ \"--h\": hues[i % hues.length], zIndex: AVATARS - i } as React.CSSProperties} title={name}>\n                    {initials(name)}\n                  </span>\n                );\n              })}\n              {extra > 0 ? <span key={`more-${extra > 99 ? \"x\" : extra}`} className=\"hb-vh9-av hb-vh9-more\">+{extra > 99 ? \"99\" : extra}</span> : null}\n            </div>\n            <div className=\"hb-vh9-chart\">\n              <svg viewBox={`0 0 ${W} ${H}`} role=\"img\" aria-label={`Price per seat drops from ${money.format(list)} to ${money.format(bands[bands.length - 1].price)} as the team grows`}>\n                {bands.map((b, i) => (\n                  <g key={i}>\n                    <rect\n                      className=\"hb-vh9-step\"\n                      data-on={i === bi ? \"true\" : undefined}\n                      x={sx(starts[i]).toFixed(1)}\n                      y={sy(b.price).toFixed(1)}\n                      width={Math.max(0, sx(finite[i]) - sx(starts[i]) - 2).toFixed(1)}\n                      height={(H - 22 - sy(b.price)).toFixed(1)}\n                      rx=\"3\"\n                    />\n                    <text className=\"hb-vh9-bprice\" data-on={i === bi ? \"true\" : undefined} x={((sx(starts[i]) + sx(finite[i])) / 2).toFixed(1)} y={(sy(b.price) - 7).toFixed(1)} textAnchor=\"middle\">\n                      {money.format(b.price)}\n                    </text>\n                    <text className=\"hb-vh9-blabel\" x={((sx(starts[i]) + sx(finite[i])) / 2).toFixed(1)} y={H - 6} textAnchor=\"middle\">\n                      {b.upTo === null ? `${num.format(starts[i] + 1)}+` : `${num.format(starts[i] + 1)}-${num.format(b.upTo)}`}\n                    </text>\n                  </g>\n                ))}\n                <path className=\"hb-vh9-edge\" d={path} />\n                <path className=\"hb-vh9-edge-on\" d={onPath} />\n                <circle className=\"hb-vh9-halo\" cx={dx} cy={dy} r=\"9\" />\n                <circle className=\"hb-vh9-dot\" cx={dx} cy={dy} r=\"5\" />\n              </svg>\n            </div>\n          </div>\n          <div className=\"hb-vh9-right\">\n            <span className=\"hb-vh9-per\">Price per seat</span>\n            <div className=\"hb-vh9-per-row\" aria-live=\"polite\">\n              <strong>{money.format(band.price)}</strong>\n              {band.price < list ? <s>{money.format(list)}</s> : null}\n              <span>/ month</span>\n            </div>\n            <ul className=\"hb-vh9-lines\">\n              <li><span>{num.format(seats)} seats x {money.format(band.price)}</span><b>{money.format(monthly)} / mo</b></li>\n              <li data-save={saved > 0 ? \"true\" : undefined}><span>Volume savings</span><b>{saved > 0 ? `${money.format(saved)} / mo` : `Starts at ${num.format((bands[0]?.upTo ?? 0) + 1)} seats`}</b></li>\n              <li><span>Billed yearly</span><b>{money.format(monthly * 12)}</b></li>\n            </ul>\n            {next && nextAt !== null ? (\n              <div className=\"hb-vh9-hint\">\n                <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M3 11l4-4 3 3 4-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n                <span>At <b>{num.format(nextAt)} seats</b> every seat drops to <b>{money.format(next.price)}</b>.</span>\n                <button type=\"button\" onClick={() => set(nextAt)}>Jump</button>\n              </div>\n            ) : null}\n            <div className=\"hb-vh9-ctawrap\">\n              <a className=\"hb-vh9-cta\" href={cta.href}>{cta.label}</a>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}