{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pricing-ribbon-highlight",
  "type": "registry:component",
  "title": "Pricing Ribbon Highlight",
  "description": "One spinning gradient frame glides between plan cards as you hover or tab, then springs back to the selected plan. The best value plan wears a corner ribbon with a passing shine and the cards work as a radio group.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "pricing",
    "pricing",
    "ribbon",
    "animated border",
    "highlight",
    "radio group",
    "plans"
  ],
  "docs": "https://hyperblur.dev/effects/pricing-ribbon-highlight",
  "files": [
    {
      "path": "registry/hyperblur/pricing-ribbon-highlight.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/pricing-ribbon-highlight.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface PricingRibbonTier {\n  name: string;\n  summary: string;\n  price: number;\n  period: string;\n  features: string[];\n  cta: { label: string; href: string };\n  ribbon?: string;\n}\n\nexport interface PricingRibbonHighlightProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSelect\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  tiers?: PricingRibbonTier[];\n  currency?: string;\n  locale?: string;\n  selected?: number;\n  defaultSelected?: number;\n  onSelect?: (index: number, tier: PricingRibbonTier) => void;\n  accent?: string;\n  accentTo?: string;\n}\n\nconst defaultTiers: PricingRibbonTier[] = [\n  {\n    name: \"Essentials\",\n    summary: \"Bookkeeping for freelancers and sole traders.\",\n    price: 15,\n    period: \"per month\",\n    features: [\"Bank feeds from 2 accounts\", \"Invoices and receipts\", \"Quarterly tax estimate\", \"Mobile receipt capture\"],\n    cta: { label: \"Choose Essentials\", href: \"#\" },\n  },\n  {\n    name: \"Growth\",\n    summary: \"Payroll and reporting for teams up to 25.\",\n    price: 42,\n    period: \"per month\",\n    features: [\"Unlimited bank feeds\", \"Payroll for 25 people\", \"Profit and cash forecasts\", \"Multi-currency invoicing\", \"Accountant access\"],\n    cta: { label: \"Choose Growth\", href: \"#\" },\n    ribbon: \"Best value\",\n  },\n  {\n    name: \"Premium\",\n    summary: \"Multi-entity books with approvals and audit trail.\",\n    price: 89,\n    period: \"per month\",\n    features: [\"Everything in Growth\", \"Up to 5 entities\", \"Spend approvals\", \"Audit trail and locks\", \"Dedicated onboarding\"],\n    cta: { label: \"Choose Premium\", href: \"#\" },\n  },\n];\n\nconst css = `\n.hb-vh6 {\n  --hb-vh6-a: #2f7bff;\n  --hb-vh6-b: #a78bfa;\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-vh6 *, .hb-vh6 *::before, .hb-vh6 *::after { box-sizing: border-box; }\n.hb-vh6-inner { max-width: 1040px; margin: 0 auto; padding: 72px 20px; }\n.hb-vh6-head { display: grid; justify-items: center; gap: 10px; text-align: center; }\n.hb-vh6-eyebrow { margin: 0; font-family: var(--font-mono), ui-monospace, monospace; color: #8f8f8f; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }\n.hb-vh6-title { margin: 0; max-width: 620px; font-size: clamp(30px, 4.8cqi, 46px); font-weight: 650; line-height: 1.06; letter-spacing: -.035em; text-wrap: balance; }\n.hb-vh6-sub { margin: 0; max-width: 500px; color: #8f8f8f; font-size: 15.5px; line-height: 1.6; }\n.hb-vh6-row { position: relative; display: grid; grid-template-columns: 1fr; gap: 14px; margin: 48px 0 0; }\n@container (min-width: 760px) { .hb-vh6-row { grid-template-columns: repeat(var(--n), 1fr); gap: 16px; } }\n.hb-vh6-frame {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 2;\n  border-radius: 22px;\n  padding: 1.5px;\n  pointer-events: none;\n  overflow: hidden;\n  transition: transform .6s cubic-bezier(.3, 1.25, .4, 1), width .6s cubic-bezier(.3, 1.25, .4, 1), height .6s cubic-bezier(.3, 1.25, .4, 1), opacity .3s ease;\n  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n  -webkit-mask-composite: xor;\n  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);\n}\n.hb-vh6-frame::before {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  width: 200%;\n  aspect-ratio: 1;\n  background: conic-gradient(from 0deg, transparent 0 40%, var(--hb-vh6-a) 55%, var(--hb-vh6-b) 70%, transparent 85%);\n  transform: translate(-50%, -50%);\n  animation: hb-vh6-spin 4.5s linear infinite;\n}\n.hb-vh6-frame::after { content: \"\"; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hb-vh6-a) 35%, transparent); }\n@keyframes hb-vh6-spin { to { transform: translate(-50%, -50%) rotate(1turn); } }\n.hb-vh6-glow {\n  position: absolute;\n  left: 0;\n  top: 0;\n  z-index: 0;\n  border-radius: 22px;\n  background: radial-gradient(70% 50% at 50% 0%, color-mix(in srgb, var(--hb-vh6-a) 22%, transparent), transparent 70%);\n  box-shadow: 0 40px 80px -40px color-mix(in srgb, var(--hb-vh6-a) 60%, transparent);\n  pointer-events: none;\n  transition: transform .6s cubic-bezier(.3, 1.25, .4, 1), width .6s cubic-bezier(.3, 1.25, .4, 1), height .6s cubic-bezier(.3, 1.25, .4, 1);\n}\n.hb-vh6-card {\n  position: relative;\n  z-index: 1;\n  display: flex;\n  flex-direction: column;\n  padding: 30px 24px 24px;\n  border-radius: 22px;\n  border: 1px solid rgba(255, 255, 255, .07);\n  background: linear-gradient(180deg, rgba(20, 20, 23, .92), rgba(13, 13, 15, .92));\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);\n  overflow: hidden;\n  cursor: pointer;\n  outline: none;\n  transition: border-color .3s ease;\n}\n.hb-vh6-card[data-lit=\"true\"] { border-color: transparent; }\n.hb-vh6-ribbon {\n  position: absolute;\n  top: 22px;\n  right: -38px;\n  width: 150px;\n  padding: 6px 0;\n  background: linear-gradient(90deg, var(--hb-vh6-a), var(--hb-vh6-b));\n  color: #fff;\n  font-size: 11px;\n  font-weight: 700;\n  letter-spacing: .08em;\n  text-align: center;\n  text-transform: uppercase;\n  transform: rotate(45deg);\n  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .35);\n  overflow: hidden;\n}\n.hb-vh6-ribbon::after {\n  content: \"\";\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: -40%;\n  width: 30%;\n  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);\n  transform: skewX(-20deg);\n  animation: hb-vh6-shine 3.6s cubic-bezier(.4, 0, .2, 1) infinite;\n}\n@keyframes hb-vh6-shine { 0%, 55% { left: -40%; } 100% { left: 130%; } }\n.hb-vh6-name { margin: 0; font-size: 16px; font-weight: 600; }\n.hb-vh6-sum { margin: 8px 0 0; min-height: 42px; max-width: 230px; color: #8f8f8f; font-size: 13.5px; line-height: 1.55; }\n.hb-vh6-price { display: flex; align-items: baseline; gap: 8px; margin-top: 20px; }\n.hb-vh6-price strong { font-size: 46px; font-weight: 650; letter-spacing: -.045em; line-height: 1; font-variant-numeric: tabular-nums; }\n.hb-vh6-price span { color: #8f8f8f; font-size: 13.5px; }\n.hb-vh6-list { display: grid; gap: 11px; margin: 24px 0 26px; padding: 0; list-style: none; }\n.hb-vh6-list li { display: flex; gap: 10px; color: #b5b5b5; font-size: 13.5px; line-height: 1.4; }\n.hb-vh6-list svg { flex: none; width: 16px; height: 16px; margin-top: 1px; color: #5f5f66; transition: color .35s ease; }\n.hb-vh6-card[data-lit=\"true\"] .hb-vh6-list svg { color: var(--hb-vh6-a); }\n.hb-vh6-cta {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  height: 44px;\n  margin-top: auto;\n  border-radius: 12px;\n  border: 1px solid rgba(255, 255, 255, .12);\n  background: rgba(255, 255, 255, .03);\n  color: #ededed;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: background .3s ease, border-color .3s ease, color .3s ease, transform .15s ease, box-shadow .3s ease;\n}\n.hb-vh6-cta:hover { border-color: rgba(255, 255, 255, .22); }\n.hb-vh6-cta:active { transform: scale(.98); }\n.hb-vh6-cta:focus-visible { outline: 2px solid var(--hb-vh6-a); outline-offset: 2px; }\n.hb-vh6-card[data-selected=\"true\"] .hb-vh6-cta {\n  border-color: transparent;\n  background: linear-gradient(90deg, var(--hb-vh6-a), var(--hb-vh6-b));\n  color: #fff;\n  box-shadow: 0 12px 28px -12px var(--hb-vh6-a), inset 0 1px 0 rgba(255, 255, 255, .3);\n}\n.hb-vh6-sel {\n  display: inline-flex;\n  align-items: center;\n  gap: 6px;\n  margin-top: 12px;\n  color: #6f6f6f;\n  font-size: 12px;\n  justify-content: center;\n}\n.hb-vh6-sel i { width: 14px; height: 14px; border-radius: 999px; border: 1.5px solid #3f3f46; font-style: normal; display: grid; place-items: center; transition: border-color .3s ease, background-color .3s ease; }\n.hb-vh6-sel i::after { content: \"\"; width: 6px; height: 6px; border-radius: 999px; background: #fff; transform: scale(0); transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }\n.hb-vh6-card[data-selected=\"true\"] .hb-vh6-sel { color: #ededed; }\n.hb-vh6-card[data-selected=\"true\"] .hb-vh6-sel i { border-color: var(--hb-vh6-a); background: var(--hb-vh6-a); }\n.hb-vh6-card[data-selected=\"true\"] .hb-vh6-sel i::after { transform: scale(1); }\n.hb-vh6-card:focus-visible { box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 4px var(--hb-vh6-a); }\n@media (prefers-reduced-motion: reduce) {\n  .hb-vh6 *, .hb-vh6 *::before, .hb-vh6 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nexport function PricingRibbonHighlight({\n  eyebrow = \"Pricing\",\n  title = \"Books that close themselves every month\",\n  subtitle = \"Hover to compare, click to choose. All plans include bank-grade encryption and free migration from your old tool.\",\n  tiers = defaultTiers,\n  currency = \"USD\",\n  locale = \"en-US\",\n  selected,\n  defaultSelected,\n  onSelect,\n  accent = \"#2f7bff\",\n  accentTo = \"#a78bfa\",\n  className = \"\",\n  style,\n  ...rest\n}: PricingRibbonHighlightProps) {\n  const ribbonIndex = Math.max(0, tiers.findIndex((t) => t.ribbon));\n  const [inner, setInner] = React.useState(defaultSelected ?? ribbonIndex);\n  const [hover, setHover] = React.useState<number | null>(null);\n  const [rect, setRect] = React.useState<{ x: number; y: number; w: number; h: number } | null>(null);\n  const rowRef = React.useRef<HTMLDivElement>(null);\n  const cardRefs = React.useRef<(HTMLDivElement | null)[]>([]);\n  const current = selected ?? inner;\n  const lit = hover ?? current;\n\n  const money = React.useMemo(\n    () => new Intl.NumberFormat(locale, { style: \"currency\", currency, maximumFractionDigits: 0 }),\n    [locale, currency],\n  );\n\n  const measure = React.useCallback(() => {\n    const el = cardRefs.current[lit];\n    if (!el) return;\n    setRect({ x: el.offsetLeft, y: el.offsetTop, w: el.offsetWidth, h: el.offsetHeight });\n  }, [lit]);\n\n  React.useLayoutEffect(() => {\n    measure();\n  }, [measure]);\n\n  React.useEffect(() => {\n    const row = rowRef.current;\n    if (!row || typeof ResizeObserver === \"undefined\") return;\n    const ro = new ResizeObserver(() => measure());\n    ro.observe(row);\n    return () => ro.disconnect();\n  }, [measure]);\n\n  const choose = (i: number) => {\n    if (selected === undefined) setInner(i);\n    onSelect?.(i, tiers[i]);\n  };\n\n  const frameStyle: React.CSSProperties = rect\n    ? { width: rect.w, height: rect.h, transform: `translate(${rect.x}px, ${rect.y}px)` }\n    : { opacity: 0 };\n\n  return (\n    <section\n      className={`hb-vh6 ${className}`}\n      style={{ \"--hb-vh6-a\": accent, \"--hb-vh6-b\": accentTo, \"--n\": tiers.length, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-pricing-ribbon-highlight\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vh6-inner\">\n        <div className=\"hb-vh6-head\">\n          {eyebrow ? <p className=\"hb-vh6-eyebrow\">{eyebrow}</p> : null}\n          <h2 className=\"hb-vh6-title\">{title}</h2>\n          {subtitle ? <p className=\"hb-vh6-sub\">{subtitle}</p> : null}\n        </div>\n        <div ref={rowRef} className=\"hb-vh6-row\" role=\"radiogroup\" aria-label=\"Plans\" onPointerLeave={() => setHover(null)}>\n          <span className=\"hb-vh6-glow\" style={frameStyle} aria-hidden=\"true\" />\n          {tiers.map((t, i) => (\n            <div\n              key={t.name}\n              ref={(el) => { cardRefs.current[i] = el; }}\n              className=\"hb-vh6-card\"\n              role=\"radio\"\n              aria-checked={current === i}\n              tabIndex={current === i ? 0 : -1}\n              data-lit={lit === i ? \"true\" : undefined}\n              data-selected={current === i ? \"true\" : undefined}\n              onPointerEnter={() => setHover(i)}\n              onFocus={() => setHover(i)}\n              onBlur={() => setHover(null)}\n              onClick={() => choose(i)}\n              onKeyDown={(e) => {\n                if (e.key === \"Enter\" || e.key === \" \") {\n                  if (e.target === e.currentTarget) { e.preventDefault(); choose(i); }\n                } else if (e.key === \"ArrowRight\" || e.key === \"ArrowDown\") {\n                  e.preventDefault();\n                  const n = (i + 1) % tiers.length;\n                  choose(n);\n                  cardRefs.current[n]?.focus();\n                } else if (e.key === \"ArrowLeft\" || e.key === \"ArrowUp\") {\n                  e.preventDefault();\n                  const n = (i - 1 + tiers.length) % tiers.length;\n                  choose(n);\n                  cardRefs.current[n]?.focus();\n                }\n              }}\n            >\n              {t.ribbon ? <span className=\"hb-vh6-ribbon\" aria-hidden=\"true\">{t.ribbon}</span> : null}\n              <h3 className=\"hb-vh6-name\">{t.name}</h3>\n              <p className=\"hb-vh6-sum\">{t.summary}</p>\n              <div className=\"hb-vh6-price\">\n                <strong>{money.format(t.price)}</strong>\n                <span>{t.period}</span>\n              </div>\n              <ul className=\"hb-vh6-list\">\n                {t.features.map((f) => (\n                  <li key={f}>\n                    <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                      <path d=\"M3.5 8.5l3 3 6-7\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                    </svg>\n                    {f}\n                  </li>\n                ))}\n              </ul>\n              <a className=\"hb-vh6-cta\" href={t.cta.href} tabIndex={current === i ? 0 : -1} onClick={(e) => e.stopPropagation()}>\n                {t.cta.label}\n              </a>\n              <span className=\"hb-vh6-sel\" aria-hidden=\"true\"><i />{current === i ? \"Selected\" : \"Select\"}</span>\n            </div>\n          ))}\n          <span className=\"hb-vh6-frame\" style={frameStyle} aria-hidden=\"true\" />\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}