{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "image-accordion-stagger",
  "type": "registry:component",
  "title": "Image Accordion Stagger",
  "description": "Product panels set at staggered heights with titles running up their edges. The open panel levels out, its title swings from vertical to horizontal on a spring and the product rises into view.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "components",
    "accordion",
    "stagger",
    "product",
    "rotate",
    "gallery",
    "spring"
  ],
  "docs": "https://hyperblur.dev/effects/image-accordion-stagger",
  "files": [
    {
      "path": "registry/hyperblur/image-accordion-stagger.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/image-accordion-stagger.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface StaggerPanel {\n  title: string;\n  notes: string;\n  price: string;\n  colors?: [string, string, string];\n}\n\nexport interface ImageAccordionStaggerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"onChange\"> {\n  items?: StaggerPanel[];\n  value?: number;\n  defaultValue?: number;\n  onChange?: (index: number) => void;\n  openOn?: \"hover\" | \"click\";\n  height?: number;\n  stagger?: number;\n  accent?: string;\n}\n\nconst defaultItems: StaggerPanel[] = [\n  { title: \"Vetiver Noir\", notes: \"Bergamot, vetiver, birch smoke\", price: \"$148 / 50 ml\", colors: [\"#1d2a22\", \"#6d8f5a\", \"#d9e8b0\"] },\n  { title: \"Fig Leaf\", notes: \"Green fig, milk, cedarwood\", price: \"$132 / 50 ml\", colors: [\"#1f2b1c\", \"#a3b86c\", \"#f1f5d0\"] },\n  { title: \"Salt & Cedar\", notes: \"Sea salt, sage, atlas cedar\", price: \"$140 / 50 ml\", colors: [\"#13232c\", \"#5f93a8\", \"#d8f0f4\"] },\n  { title: \"Amber Dusk\", notes: \"Saffron, labdanum, tonka\", price: \"$156 / 50 ml\", colors: [\"#2b170d\", \"#d07a3a\", \"#ffe0b8\"] },\n  { title: \"Yuzu Rain\", notes: \"Yuzu, white tea, vetiver\", price: \"$124 / 50 ml\", colors: [\"#2a2a12\", \"#d4c24a\", \"#fff8c4\"] },\n];\n\nconst offsets = [0, 0.75, 0.25, 1, 0.45, 0.85, 0.15];\n\nconst css = `\n.hb-vl3 {\n  position: relative;\n  display: flex;\n  gap: 8px;\n  width: 100%;\n  height: var(--hb-vl3-h);\n  color: #ededed;\n  font-family: inherit;\n  box-sizing: border-box;\n}\n.hb-vl3 *, .hb-vl3 *::before, .hb-vl3 *::after { box-sizing: border-box; }\n.hb-vl3-p {\n  position: relative;\n  flex: 1 1 0;\n  min-width: 46px;\n  height: calc(var(--hb-vl3-h) - var(--hb-vl3-s));\n  margin: 0;\n  padding: 0;\n  overflow: hidden;\n  border: 0;\n  border-radius: 18px;\n  background: var(--hb-vl3-c0);\n  color: inherit;\n  font: inherit;\n  text-align: left;\n  cursor: pointer;\n  transform: translateY(calc(var(--hb-vl3-o) * var(--hb-vl3-s)));\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 20px 40px -28px rgba(0, 0, 0, 0.9);\n  transition: flex-grow 0.8s cubic-bezier(0.65, 0, 0.35, 1), transform 0.8s cubic-bezier(0.65, 0, 0.35, 1);\n  -webkit-tap-highlight-color: transparent;\n}\n.hb-vl3-p[data-active=\"true\"] { flex-grow: 4.2; transform: translateY(calc(var(--hb-vl3-s) * 0.5)); }\n.hb-vl3-p:focus-visible { outline: 2px solid var(--hb-vl3-a); outline-offset: 3px; }\n.hb-vl3-art {\n  position: absolute;\n  inset: -20%;\n  background:\n    radial-gradient(40% 32% at 30% 30%, color-mix(in srgb, var(--hb-vl3-c2) 70%, transparent), transparent 70%),\n    radial-gradient(46% 40% at 75% 70%, color-mix(in srgb, var(--hb-vl3-c1) 85%, transparent), transparent 72%),\n    radial-gradient(60% 50% at 50% 110%, var(--hb-vl3-c1), transparent 70%),\n    linear-gradient(160deg, var(--hb-vl3-c0), color-mix(in srgb, var(--hb-vl3-c0) 60%, #000000));\n  transition: transform 1.4s cubic-bezier(0.22, 1, 0.36, 1);\n  transform: scale(1.1) rotate(-6deg);\n}\n.hb-vl3-p[data-active=\"true\"] .hb-vl3-art { transform: none; animation: hb-vl3-drift 9s ease-in-out 1.2s infinite alternate; }\n@keyframes hb-vl3-drift { to { transform: translate3d(4%, -3%, 0) rotate(4deg); } }\n.hb-vl3-grain {\n  position: absolute;\n  inset: 0;\n  opacity: 0.16;\n  background-image: repeating-radial-gradient(circle at 17% 23%, rgba(255, 255, 255, 0.5) 0 0.6px, transparent 0.6px 3px);\n  mix-blend-mode: overlay;\n}\n.hb-vl3-bottle {\n  position: absolute;\n  left: 50%;\n  top: 46%;\n  width: 70px;\n  height: 120px;\n  opacity: 0;\n  transform: translate(-50%, -40%) scale(0.9);\n  transition: opacity 0.35s ease, transform 0.6s ease;\n}\n.hb-vl3-p[data-active=\"true\"] .hb-vl3-bottle {\n  opacity: 1;\n  transform: translate(-30%, -58%);\n  transition: opacity 0.7s ease 0.25s, transform 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;\n}\n.hb-vl3-shade {\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.62) 100%);\n}\n.hb-vl3-idx {\n  position: absolute;\n  left: 15px;\n  bottom: 14px;\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 10px;\n  letter-spacing: 0.06em;\n  color: rgba(255, 255, 255, 0.62);\n}\n.hb-vl3-t {\n  position: absolute;\n  left: 14px;\n  bottom: 34px;\n  margin: 0;\n  font-family: var(--font-grotesk, inherit);\n  font-size: 18px;\n  font-weight: 600;\n  line-height: 1.2;\n  letter-spacing: -0.01em;\n  white-space: nowrap;\n  transform-origin: 0 100%;\n  transform: translateX(1.2em) rotate(-90deg);\n  transition: transform 0.9s cubic-bezier(0.34, 1.32, 0.64, 1), bottom 0.6s cubic-bezier(0.22, 1, 0.36, 1);\n}\n.hb-vl3-p[data-active=\"true\"] .hb-vl3-t { transform: none; bottom: 52px; transition-delay: 0.12s; }\n.hb-vl3-info {\n  position: absolute;\n  left: 14px;\n  right: 14px;\n  bottom: 12px;\n  display: flex;\n  align-items: baseline;\n  justify-content: space-between;\n  gap: 10px;\n  opacity: 0;\n  transform: translateY(8px);\n  transition: opacity 0.2s ease, transform 0.3s ease;\n}\n.hb-vl3-p[data-active=\"true\"] .hb-vl3-info {\n  opacity: 1;\n  transform: none;\n  transition: opacity 0.5s ease 0.45s, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.45s;\n}\n.hb-vl3-p[data-active=\"true\"] .hb-vl3-idx { opacity: 0; }\n.hb-vl3-notes {\n  min-width: 0;\n  overflow: hidden;\n  font-size: 11.5px;\n  color: rgba(255, 255, 255, 0.78);\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n.hb-vl3-price {\n  flex: none;\n  padding: 3px 8px;\n  border-radius: 999px;\n  background: rgba(255, 255, 255, 0.14);\n  backdrop-filter: blur(6px);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 10.5px;\n  white-space: nowrap;\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vl3 *, .hb-vl3 *::before, .hb-vl3 *::after { transition: none !important; animation: none !important; }\n}\n`;\n\nexport function ImageAccordionStagger({\n  items = defaultItems,\n  value,\n  defaultValue = 0,\n  onChange,\n  openOn = \"hover\",\n  height = 360,\n  stagger = 28,\n  accent = \"#2f7bff\",\n  className,\n  style,\n  ...rest\n}: ImageAccordionStaggerProps) {\n  const [inner, setInner] = React.useState(defaultValue);\n  const active = value ?? inner;\n  const refs = React.useRef<(HTMLButtonElement | null)[]>([]);\n  const uid = React.useId().replace(/:/g, \"\");\n\n  const select = (index: number) => {\n    if (index === active) return;\n    if (value === undefined) setInner(index);\n    onChange?.(index);\n  };\n\n  const onKey = (event: React.KeyboardEvent, index: number) => {\n    const n = items.length;\n    let next = -1;\n    if (event.key === \"ArrowRight\") next = (index + 1) % n;\n    else if (event.key === \"ArrowLeft\") next = (index - 1 + n) % n;\n    else if (event.key === \"Home\") next = 0;\n    else if (event.key === \"End\") next = n - 1;\n    if (next < 0) return;\n    event.preventDefault();\n    select(next);\n    refs.current[next]?.focus();\n  };\n\n  return (\n    <div\n      className={[\"hb-vl3\", className].filter(Boolean).join(\" \")}\n      style={{ \"--hb-vl3-a\": accent, \"--hb-vl3-h\": `${height}px`, \"--hb-vl3-s\": `${stagger}px`, ...style } as React.CSSProperties}\n      role=\"tablist\"\n      aria-label=\"Collection\"\n      {...rest}\n    >\n      <style href=\"hb-image-accordion-stagger\" precedence=\"default\">{css}</style>\n      {items.map((item, i) => {\n        const on = i === active;\n        const [c0, c1, c2] = item.colors ?? [\"#1d2a22\", \"#6d8f5a\", \"#d9e8b0\"];\n        const gid = `${uid}-g${i}`;\n        return (\n          <button\n            key={item.title + i}\n            ref={(node) => {\n              refs.current[i] = node;\n            }}\n            type=\"button\"\n            role=\"tab\"\n            aria-selected={on}\n            tabIndex={on ? 0 : -1}\n            className=\"hb-vl3-p\"\n            data-active={on ? \"true\" : \"false\"}\n            style={{ \"--hb-vl3-o\": offsets[i % offsets.length], \"--hb-vl3-c0\": c0, \"--hb-vl3-c1\": c1, \"--hb-vl3-c2\": c2 } as React.CSSProperties}\n            onPointerEnter={openOn === \"hover\" ? () => select(i) : undefined}\n            onClick={() => select(i)}\n            onKeyDown={(event) => onKey(event, i)}\n          >\n            <span className=\"hb-vl3-art\" />\n            <span className=\"hb-vl3-grain\" />\n            <svg className=\"hb-vl3-bottle\" viewBox=\"0 0 70 120\" aria-hidden=\"true\">\n              <defs>\n                <linearGradient id={gid} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n                  <stop offset=\"0\" stopColor=\"#ffffff\" stopOpacity=\"0.5\" />\n                  <stop offset=\"0.35\" stopColor=\"#ffffff\" stopOpacity=\"0.12\" />\n                  <stop offset=\"1\" stopColor=\"#ffffff\" stopOpacity=\"0.28\" />\n                </linearGradient>\n              </defs>\n              <rect x=\"26\" y=\"4\" width=\"18\" height=\"18\" rx=\"3\" fill={c0} stroke=\"rgba(255,255,255,0.4)\" />\n              <rect x=\"30\" y=\"20\" width=\"10\" height=\"8\" fill=\"rgba(255,255,255,0.35)\" />\n              <rect x=\"8\" y=\"28\" width=\"54\" height=\"88\" rx=\"12\" fill={`url(#${gid})`} stroke=\"rgba(255,255,255,0.45)\" />\n              <rect x=\"20\" y=\"62\" width=\"30\" height=\"20\" rx=\"2\" fill=\"rgba(255,255,255,0.85)\" />\n              <rect x=\"25\" y=\"68\" width=\"20\" height=\"2\" fill={c0} />\n              <rect x=\"28\" y=\"74\" width=\"14\" height=\"1.5\" fill={c0} opacity=\"0.6\" />\n              <rect x=\"14\" y=\"34\" width=\"5\" height=\"70\" rx=\"2.5\" fill=\"#ffffff\" opacity=\"0.35\" />\n            </svg>\n            <span className=\"hb-vl3-shade\" />\n            <span className=\"hb-vl3-idx\">{String(i + 1).padStart(2, \"0\")}</span>\n            <span className=\"hb-vl3-t\">{item.title}</span>\n            <span className=\"hb-vl3-info\" aria-hidden={!on}>\n              <span className=\"hb-vl3-notes\">{item.notes}</span>\n              <span className=\"hb-vl3-price\">{item.price}</span>\n            </span>\n          </button>\n        );\n      })}\n    </div>\n  );\n}\n"
    }
  ]
}