{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-seats-slider",
  "type": "registry:component",
  "title": "Pricing Seats Slider",
  "description": "Per seat pricing on paper: a team size slider with a filling crowd of dots, volume bands, and three plans whose totals roll digit by digit with a per seat breakdown.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "pricing",
    "pricing",
    "seats",
    "slider",
    "volume discount",
    "calculator",
    "light"
  ],
  "docs": "https://hyperblur.dev/effects/pricing-seats-slider",
  "files": [
    {
      "path": "registry/hyperblur/pricing-seats-slider.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/pricing-seats-slider.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type PricingSeatsBilling = \"monthly\" | \"yearly\";\n\nexport interface PricingSeatsPlan {\n  name: string;\n  description: string;\n  seatPrice: number;\n  maxSeats?: number;\n  features: string[];\n  cta: string;\n}\n\nexport interface PricingSeatsBand {\n  upTo: number;\n  discount: number;\n}\n\nexport interface PricingSeatsSliderProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onChange\" | \"defaultValue\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  plans?: PricingSeatsPlan[];\n  bands?: PricingSeatsBand[];\n  min?: number;\n  max?: number;\n  seats?: number;\n  defaultSeats?: number;\n  onSeatsChange?: (seats: number) => void;\n  defaultBilling?: PricingSeatsBilling;\n  yearlyDiscount?: number;\n  currency?: string;\n  onPlanSelect?: (plan: PricingSeatsPlan, seats: number, total: number, billing: PricingSeatsBilling) => void;\n  accent?: string;\n}\n\nconst defaultPlans: PricingSeatsPlan[] = [\n  { name: \"Starter\", description: \"For small crews getting organized.\", seatPrice: 12, maxSeats: 10, features: [\"Unlimited projects\", \"5 GB per seat\", \"Email support\"], cta: \"Start free trial\" },\n  { name: \"Team\", description: \"Shared workflows for growing teams.\", seatPrice: 20, features: [\"Everything in Starter\", \"Approvals and roles\", \"50 GB per seat\", \"Priority chat\"], cta: \"Choose Team\" },\n  { name: \"Business\", description: \"Controls for regulated operations.\", seatPrice: 32, features: [\"Everything in Team\", \"SSO and SCIM\", \"Audit log export\", \"Named success manager\"], cta: \"Choose Business\" },\n];\n\nconst defaultBands: PricingSeatsBand[] = [\n  { upTo: 10, discount: 0 },\n  { upTo: 50, discount: 0.15 },\n  { upTo: Infinity, discount: 0.3 },\n];\n\nconst css = `\n.hb-yi9 {\n  --hb-yi9-accent: #6d4aff;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  background: #f7f5ef;\n  color: #15141a;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yi9 *, .hb-yi9 *::before, .hb-yi9 *::after { box-sizing: border-box; }\n.hb-yi9-inner { max-width: 1120px; margin: 0 auto; padding: 72px 20px 80px; }\n.hb-yi9-head { display: grid; justify-items: center; text-align: center; }\n.hb-yi9-eyebrow { margin: 0 0 14px; font-size: 13px; font-weight: 600; color: var(--hb-yi9-accent); }\n.hb-yi9-title { margin: 0; font-size: clamp(30px, 5cqi, 52px); line-height: 1.04; letter-spacing: -.04em; font-weight: 650; max-width: 18ch; }\n.hb-yi9-sub { margin: 14px 0 0; max-width: 520px; font-size: 16px; line-height: 1.6; color: #66625a; }\n.hb-yi9-bill { position: relative; display: inline-flex; margin-top: 26px; padding: 4px; border-radius: 999px; background: #ebe8df; border: 1px solid rgba(21, 20, 26, .06); }\n.hb-yi9-bill::before {\n  content: \"\"; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: #fff;\n  box-shadow: 0 1px 2px rgba(21, 20, 26, .12), 0 0 0 1px rgba(21, 20, 26, .05); transition: transform .4s cubic-bezier(.3, 1.3, .5, 1);\n}\n.hb-yi9-bill[data-v=\"yearly\"]::before { transform: translateX(100%); }\n.hb-yi9-bill button { position: relative; width: 130px; height: 36px; border: 0; background: transparent; font: inherit; font-size: 14px; font-weight: 500; color: #66625a; cursor: pointer; border-radius: 999px; }\n.hb-yi9-bill button[aria-pressed=\"true\"] { color: #15141a; }\n.hb-yi9-bill b { margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-size: 11px; color: #0f7a4f; background: #d8f3e6; }\n.hb-yi9-panel {\n  margin-top: 40px; padding: 24px; border-radius: 22px; background: #fff; border: 1px solid rgba(21, 20, 26, .08);\n  box-shadow: 0 1px 0 #fff inset, 0 24px 50px -32px rgba(21, 20, 26, .3); display: grid; gap: 20px;\n}\n.hb-yi9-q { margin: 0; font-size: 14px; color: #66625a; }\n.hb-yi9-seats { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }\n.hb-yi9-seats strong { font-size: 44px; line-height: 1; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }\n.hb-yi9-seats span { font-size: 15px; color: #66625a; }\n.hb-yi9-range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; cursor: pointer; margin: 0; }\n.hb-yi9-range::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--hb-yi9-accent) calc(var(--hb-yi9-p) * 1%), #ebe8df 0); }\n.hb-yi9-range::-moz-range-track { height: 8px; border-radius: 99px; background: linear-gradient(90deg, var(--hb-yi9-accent) calc(var(--hb-yi9-p) * 1%), #ebe8df 0); }\n.hb-yi9-range::-webkit-slider-thumb {\n  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%; background: #fff; border: 0;\n  box-shadow: 0 0 0 6px color-mix(in srgb, var(--hb-yi9-accent) 18%, transparent), 0 2px 8px rgba(21, 20, 26, .3); transition: box-shadow .2s, transform .2s;\n}\n.hb-yi9-range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 6px color-mix(in srgb, var(--hb-yi9-accent) 18%, transparent), 0 2px 8px rgba(21, 20, 26, .3); }\n.hb-yi9-range:active::-webkit-slider-thumb { transform: scale(1.1); }\n.hb-yi9-range:focus-visible { outline: none; }\n.hb-yi9-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--hb-yi9-accent); }\n.hb-yi9-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--hb-yi9-accent); }\n.hb-yi9-ticks { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12px; color: #9a958a; font-variant-numeric: tabular-nums; }\n.hb-yi9-crowd { display: flex; flex-wrap: wrap; gap: 5px; align-content: flex-start; }\n.hb-yi9-dot { width: 16px; height: 16px; border-radius: 50%; background: #ebe8df; transition: background .3s, transform .35s cubic-bezier(.3, 1.6, .5, 1); }\n.hb-yi9-dot[data-on=\"true\"] { transform: scale(1); }\n.hb-yi9-dot[data-on=\"false\"] { transform: scale(.6); }\n.hb-yi9-more { font-size: 12px; font-weight: 600; color: var(--hb-yi9-accent); align-self: center; margin-left: 4px; }\n.hb-yi9-bands { display: flex; flex-wrap: wrap; gap: 8px; }\n.hb-yi9-band { padding: 6px 10px; border-radius: 10px; font-size: 12px; color: #66625a; background: #f7f5ef; border: 1px solid transparent; transition: background .3s, color .3s, border-color .3s; }\n.hb-yi9-band[data-on=\"true\"] { color: color-mix(in srgb, var(--hb-yi9-accent) 80%, #000); background: color-mix(in srgb, var(--hb-yi9-accent) 9%, #fff); border-color: color-mix(in srgb, var(--hb-yi9-accent) 30%, transparent); }\n.hb-yi9-plans { display: grid; gap: 14px; margin-top: 18px; }\n.hb-yi9-plan {\n  position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 20px; background: #fff; border: 1px solid rgba(21, 20, 26, .08);\n  transition: border-color .3s, box-shadow .3s, opacity .3s, transform .3s;\n}\n.hb-yi9-plan[data-best=\"true\"] { border-color: var(--hb-yi9-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-yi9-accent) 14%, transparent), 0 30px 60px -36px color-mix(in srgb, var(--hb-yi9-accent) 70%, #000); }\n.hb-yi9-plan[data-off=\"true\"] { opacity: .55; }\n.hb-yi9-flag { position: absolute; top: -11px; left: 24px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; color: #fff; background: var(--hb-yi9-accent); animation: hb-yi9-pop .4s cubic-bezier(.3, 1.6, .5, 1) both; }\n.hb-yi9-plan h3 { margin: 0; font-size: 17px; font-weight: 600; }\n.hb-yi9-plan > p { margin: 4px 0 0; font-size: 14px; color: #66625a; }\n.hb-yi9-price { display: flex; align-items: baseline; gap: 6px; margin-top: 18px; }\n.hb-yi9-total { display: inline-flex; font-size: 40px; line-height: 1; letter-spacing: -.04em; font-weight: 650; font-variant-numeric: tabular-nums; }\n.hb-yi9-per { font-size: 14px; color: #66625a; }\n.hb-yi9-col { display: inline-block; height: 1em; overflow: hidden; }\n.hb-yi9-strip { display: flex; flex-direction: column; transition: transform .6s cubic-bezier(.2, .9, .25, 1); }\n.hb-yi9-strip span { height: 1em; line-height: 1; }\n.hb-yi9-each { margin: 6px 0 0; font-size: 13px; color: #8a857a; }\n.hb-yi9-rows { list-style: none; margin: 16px 0 0; padding: 12px 0 0; border-top: 1px dashed rgba(21, 20, 26, .14); display: grid; gap: 6px; }\n.hb-yi9-rows li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: #66625a; font-variant-numeric: tabular-nums; }\n.hb-yi9-rows li b { color: #15141a; font-weight: 600; }\n.hb-yi9-feat { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }\n.hb-yi9-feat li { display: flex; gap: 8px; font-size: 14px; color: #34322c; }\n.hb-yi9-feat svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--hb-yi9-accent); }\n.hb-yi9-cta {\n  margin-top: auto; padding-top: 22px;\n}\n.hb-yi9-cta button {\n  width: 100%; height: 44px; border-radius: 12px; border: 1px solid rgba(21, 20, 26, .14); background: #fff; color: #15141a; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;\n  transition: background .2s, color .2s, border-color .2s, transform .2s;\n}\n.hb-yi9-cta button:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(21, 20, 26, .3); }\n.hb-yi9-plan[data-best=\"true\"] .hb-yi9-cta button { background: var(--hb-yi9-accent); border-color: transparent; color: #fff; }\n.hb-yi9-cta button:disabled { cursor: not-allowed; }\n.hb-yi9-cta button:focus-visible, .hb-yi9-bill button:focus-visible { outline: 2px solid var(--hb-yi9-accent); outline-offset: 2px; }\n.hb-yi9-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@keyframes hb-yi9-pop { from { opacity: 0; transform: translateY(6px) scale(.9); } to { opacity: 1; transform: none; } }\n@container (min-width: 820px) {\n  .hb-yi9-inner { padding: 104px 32px 112px; }\n  .hb-yi9-panel { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding: 28px 32px; gap: 36px; align-items: center; }\n  .hb-yi9-plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yi9-strip, .hb-yi9-dot, .hb-yi9-plan, .hb-yi9-bill::before, .hb-yi9-band, .hb-yi9-cta button, .hb-yi9-range::-webkit-slider-thumb { transition: none; }\n  .hb-yi9-flag { animation: none; }\n}\n`;\n\nfunction group(n: number) {\n  return Math.round(n).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n}\n\nfunction Roll({ text }: { text: string }) {\n  const chars = text.split(\"\");\n  return (\n    <span className=\"hb-yi9-total\" aria-hidden=\"true\">\n      {chars.map((c, i) => {\n        const key = chars.length - i;\n        if (c < \"0\" || c > \"9\") return <span key={`s${key}`}>{c}</span>;\n        const d = Number(c);\n        return (\n          <span key={`d${key}`} className=\"hb-yi9-col\">\n            <span className=\"hb-yi9-strip\" style={{ transform: `translateY(${(-d * 10).toFixed(0)}%)` }}>\n              {[0, 1, 2, 3, 4, 5, 6, 7, 8, 9].map((n) => (\n                <span key={n}>{n}</span>\n              ))}\n            </span>\n          </span>\n        );\n      })}\n    </span>\n  );\n}\n\nfunction breakdown(seats: number, base: number, bands: PricingSeatsBand[]) {\n  let from = 0;\n  const rows: { from: number; to: number; count: number; rate: number }[] = [];\n  for (const b of bands) {\n    const to = Math.min(seats, b.upTo);\n    const count = Math.max(0, to - from);\n    if (count > 0) rows.push({ from: from + 1, to, count, rate: base * (1 - b.discount) });\n    from = Math.max(from, b.upTo);\n    if (from >= seats) break;\n  }\n  return rows;\n}\n\nconst crowdColors = [\"#6d4aff\", \"#e2553f\", \"#1f8a5b\", \"#d4a017\", \"#2f7bff\", \"#c04fd8\"];\n\nexport function PricingSeatsSlider({\n  eyebrow = \"Pricing that scales down\",\n  title = \"Pay per seat. The more people, the less each costs.\",\n  subtitle = \"Seats 11 to 50 are 15 percent off, every seat after 50 is 30 percent off. Drag to see your exact bill.\",\n  plans = defaultPlans,\n  bands = defaultBands,\n  min = 1,\n  max = 200,\n  seats,\n  defaultSeats = 24,\n  onSeatsChange,\n  defaultBilling = \"yearly\",\n  yearlyDiscount = 0.2,\n  currency = \"$\",\n  onPlanSelect,\n  accent = \"#6d4aff\",\n  className = \"\",\n  style,\n  ...rest\n}: PricingSeatsSliderProps) {\n  const [inner, setInner] = React.useState(defaultSeats);\n  const [billing, setBilling] = React.useState<PricingSeatsBilling>(defaultBilling);\n  const count = Math.min(max, Math.max(min, seats ?? inner));\n  const factor = billing === \"yearly\" ? 1 - yearlyDiscount : 1;\n  const pct = ((count - min) / Math.max(1, max - min)) * 100;\n  const id = React.useId();\n\n  const change = (v: number) => {\n    if (seats === undefined) setInner(v);\n    onSeatsChange?.(v);\n  };\n\n  const priced = plans.map((p) => {\n    const rows = breakdown(count, p.seatPrice * factor, bands);\n    const total = rows.reduce((s, r) => s + r.count * r.rate, 0);\n    return { p, rows, total, off: p.maxSeats !== undefined && count > p.maxSeats };\n  });\n  const bestIndex = (() => {\n    const open = priced.map((x, i) => ({ ...x, i })).filter((x) => !x.off);\n    if (!open.length) return -1;\n    if (count <= 10) return open[0].i;\n    if (count > 100) return open[open.length - 1].i;\n    return open[Math.min(1, open.length - 1)].i;\n  })();\n\n  const shown = Math.min(count, 40);\n  const vars = { \"--hb-yi9-accent\": accent, \"--hb-yi9-p\": pct.toFixed(2), ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-yi9 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-pricing-seats-slider\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yi9-inner\">\n        <div className=\"hb-yi9-head\">\n          {eyebrow ? <p className=\"hb-yi9-eyebrow\">{eyebrow}</p> : null}\n          <h2 className=\"hb-yi9-title\">{title}</h2>\n          {subtitle ? <p className=\"hb-yi9-sub\">{subtitle}</p> : null}\n          <div className=\"hb-yi9-bill\" data-v={billing} role=\"group\" aria-label=\"Billing period\">\n            <button type=\"button\" aria-pressed={billing === \"monthly\"} onClick={() => setBilling(\"monthly\")}>\n              Monthly\n            </button>\n            <button type=\"button\" aria-pressed={billing === \"yearly\"} onClick={() => setBilling(\"yearly\")}>\n              Yearly<b>{`-${Math.round(yearlyDiscount * 100)}%`}</b>\n            </button>\n          </div>\n        </div>\n\n        <div className=\"hb-yi9-panel\">\n          <div>\n            <label className=\"hb-yi9-q\" htmlFor={`${id}-seats`}>\n              How many people are on your team?\n            </label>\n            <p className=\"hb-yi9-seats\">\n              <strong>{count}</strong>\n              <span>{count === 1 ? \"seat\" : \"seats\"}</span>\n            </p>\n            <input\n              id={`${id}-seats`}\n              className=\"hb-yi9-range\"\n              type=\"range\"\n              min={min}\n              max={max}\n              value={count}\n              aria-valuetext={`${count} seats`}\n              onChange={(e) => change(Number(e.target.value))}\n            />\n            <div className=\"hb-yi9-ticks\" aria-hidden=\"true\">\n              <span>{min}</span>\n              <span>{Math.round((min + max) / 4)}</span>\n              <span>{Math.round((min + max) / 2)}</span>\n              <span>{max}</span>\n            </div>\n          </div>\n          <div style={{ display: \"grid\", gap: 14 }}>\n            <div className=\"hb-yi9-crowd\" aria-hidden=\"true\">\n              {Array.from({ length: 40 }, (_, i) => (\n                <span\n                  key={i}\n                  className=\"hb-yi9-dot\"\n                  data-on={i < shown}\n                  style={{ background: i < shown ? crowdColors[(i * 7) % crowdColors.length] : undefined, transitionDelay: `${(i % 10) * 12}ms` }}\n                />\n              ))}\n              {count > 40 ? <span className=\"hb-yi9-more\">{`+${count - 40}`}</span> : null}\n            </div>\n            <div className=\"hb-yi9-bands\">\n              {bands.map((b, i) => {\n                const lo = i === 0 ? 1 : bands[i - 1].upTo + 1;\n                const label = Number.isFinite(b.upTo) ? `Seats ${lo} to ${b.upTo}` : `Seats ${lo}+`;\n                return (\n                  <span key={label} className=\"hb-yi9-band\" data-on={count >= lo}>\n                    {label}\n                    {b.discount ? ` · ${Math.round(b.discount * 100)}% off` : \" · list price\"}\n                  </span>\n                );\n              })}\n            </div>\n          </div>\n        </div>\n\n        <div className=\"hb-yi9-plans\">\n          {priced.map(({ p, rows, total, off }, i) => {\n            const best = i === bestIndex;\n            const each = count > 0 ? total / count : 0;\n            return (\n              <article key={p.name} className=\"hb-yi9-plan\" data-best={best} data-off={off}>\n                {best ? <span className=\"hb-yi9-flag\">{`Best for ${count} seats`}</span> : null}\n                <h3>{p.name}</h3>\n                <p>{p.description}</p>\n                <div className=\"hb-yi9-price\">\n                  <span className=\"hb-yi9-sr\">\n                    {off ? `${p.name} is not available above ${p.maxSeats} seats` : `${currency}${group(total)} per month`}\n                  </span>\n                  <Roll text={off ? `${currency}0` : `${currency}${group(total)}`} />\n                  <span className=\"hb-yi9-per\">/ month</span>\n                </div>\n                <p className=\"hb-yi9-each\">\n                  {off ? `Up to ${p.maxSeats} seats` : `${currency}${each.toFixed(2)} per seat, billed ${billing}`}\n                </p>\n                {!off ? (\n                  <ul className=\"hb-yi9-rows\">\n                    {rows.map((r) => (\n                      <li key={r.from}>\n                        <span>{r.from === r.to ? `Seat ${r.from}` : `Seats ${r.from} to ${r.to}`}</span>\n                        <span>\n                          {`${r.count} × ${currency}${r.rate.toFixed(2)} = `}\n                          <b>{`${currency}${group(r.count * r.rate)}`}</b>\n                        </span>\n                      </li>\n                    ))}\n                  </ul>\n                ) : null}\n                <ul className=\"hb-yi9-feat\">\n                  {p.features.map((f) => (\n                    <li key={f}>\n                      <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                        <path d=\"M5 12.5l4.5 4.5L19 7.5\" />\n                      </svg>\n                      {f}\n                    </li>\n                  ))}\n                </ul>\n                <div className=\"hb-yi9-cta\">\n                  <button type=\"button\" disabled={off} onClick={() => onPlanSelect?.(p, count, total, billing)}>\n                    {off ? \"Too many seats\" : p.cta}\n                  </button>\n                </div>\n              </article>\n            );\n          })}\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}