{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "list-timeline-vertical",
  "type": "registry:component",
  "title": "List Timeline Vertical",
  "description": "A vertical timeline of events with icon nodes, a connecting line that draws in, relative timestamps and expandable details.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "lists",
    "timeline",
    "events",
    "tracking",
    "history",
    "steps",
    "expand"
  ],
  "docs": "https://hyperblur.dev/effects/list-timeline-vertical",
  "files": [
    {
      "path": "registry/hyperblur/list-timeline-vertical.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/list-timeline-vertical.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nconst ICONS = {\n  check: \"M4.5 10.5l3.5 3.5 7.5-8\",\n  box: \"M3.5 6.5L10 3l6.5 3.5v7L10 17l-6.5-3.5zM3.5 6.5L10 10l6.5-3.5M10 10v7\",\n  truck: \"M2.5 5.5h8v8h-8zM10.5 8h4l3 3v2.5h-7M5.5 15.5a1.4 1.4 0 1 0 0-.01zM13.5 15.5a1.4 1.4 0 1 0 0-.01z\",\n  pin: \"M10 17.5s5-4.4 5-8.5a5 5 0 1 0-10 0c0 4.1 5 8.5 5 8.5zM10 11a2 2 0 1 0 0-4 2 2 0 0 0 0 4z\",\n  card: \"M3.5 5.5h13a1 1 0 0 1 1 1v7a1 1 0 0 1-1 1h-13a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1zM2.5 8.5h15M5.5 12h3\",\n  mail: \"M3.5 5h13a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1h-13a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zM3 6l7 5 7-5\",\n  flag: \"M5 17V3.5M5 4.5h9l-1.8 3 1.8 3H5\",\n  clock: \"M10 17a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM10 6.5V10l2.5 1.5\",\n  user: \"M10 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM3.8 16.5c.6-2.8 3-4.3 6.2-4.3s5.6 1.5 6.2 4.3\",\n} as const;\n\nexport type TimelineIconName = keyof typeof ICONS;\nexport type TimelineTone = \"done\" | \"active\" | \"pending\";\n\nexport function TimelineIcon({ name }: { name: TimelineIconName }) {\n  return (\n    <svg viewBox=\"0 0 20 20\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d={ICONS[name]} />\n    </svg>\n  );\n}\n\nexport interface TimelineEvent {\n  id: string;\n  title: string;\n  time: string;\n  icon?: TimelineIconName;\n  tone?: TimelineTone;\n  description?: string;\n  details?: React.ReactNode;\n}\n\nexport interface ListTimelineVerticalProps\n  extends Omit<React.HTMLAttributes<HTMLOListElement>, \"onChange\" | \"children\" | \"defaultValue\"> {\n  items?: TimelineEvent[];\n  open?: string[];\n  defaultOpen?: string[];\n  onOpenChange?: (open: string[]) => void;\n  multiple?: boolean;\n  gap?: number;\n  accent?: string;\n}\n\nconst defaultItems: TimelineEvent[] = [\n  {\n    id: \"placed\",\n    title: \"Order placed\",\n    time: \"3 days ago\",\n    icon: \"card\",\n    tone: \"done\",\n    description: \"Order #48213 confirmed.\",\n    details: \"Paid with Visa ending 4821. A receipt was sent to maya@northwind.io.\",\n  },\n  {\n    id: \"packed\",\n    title: \"Packed at Reno warehouse\",\n    time: \"2 days ago\",\n    icon: \"box\",\n    tone: \"done\",\n    details: \"Two items packed in one box and handed to Northline Freight.\",\n  },\n  {\n    id: \"shipped\",\n    title: \"Left the regional hub\",\n    time: \"Yesterday\",\n    icon: \"truck\",\n    tone: \"done\",\n  },\n  {\n    id: \"delivery\",\n    title: \"Out for delivery\",\n    time: \"2 hours ago\",\n    icon: \"pin\",\n    tone: \"active\",\n    description: \"Your driver is on the way.\",\n    details: \"Marcus is 6 stops away. Estimated arrival is 4:30 PM.\",\n  },\n  {\n    id: \"delivered\",\n    title: \"Delivered\",\n    time: \"Expected today\",\n    icon: \"flag\",\n    tone: \"pending\",\n  },\n];\n\nconst css = `\n.hb-yc6 {\n  --hb-yc6-a: #2f7bff;\n  box-sizing: border-box;\n  width: 100%;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n  color: #ededed;\n  font-family: inherit;\n  font-size: 13px;\n  line-height: 18px;\n}\n.hb-yc6 *, .hb-yc6 *::before, .hb-yc6 *::after { box-sizing: border-box; }\n.hb-yc6-li { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 12px; }\n.hb-yc6-rail { position: relative; }\n.hb-yc6-node {\n  position: relative;\n  z-index: 1;\n  display: grid;\n  place-items: center;\n  width: 28px;\n  height: 28px;\n  border: 1px solid #2a2a2a;\n  border-radius: 999px;\n  background: #151515;\n  color: #6f6f6f;\n  animation: hb-yc6-pop .5s cubic-bezier(.3, 1.4, .5, 1) both;\n  animation-delay: calc(var(--hb-yc6-i, 0) * 170ms);\n}\n.hb-yc6-node svg { width: 15px; height: 15px; }\n.hb-yc6-li[data-tone=\"done\"] .hb-yc6-node {\n  border-color: var(--hb-yc6-a);\n  background: var(--hb-yc6-a);\n  color: #ffffff;\n  box-shadow: 0 4px 14px color-mix(in srgb, var(--hb-yc6-a) 40%, transparent);\n}\n.hb-yc6-li[data-tone=\"active\"] .hb-yc6-node {\n  border-color: var(--hb-yc6-a);\n  background: color-mix(in srgb, var(--hb-yc6-a) 14%, #111111);\n  color: var(--hb-yc6-a);\n}\n.hb-yc6-li[data-tone=\"active\"] .hb-yc6-node::after {\n  content: \"\";\n  position: absolute;\n  inset: -1px;\n  border: 1px solid var(--hb-yc6-a);\n  border-radius: inherit;\n  animation: hb-yc6-ping 2.4s ease-out infinite;\n  animation-delay: calc(var(--hb-yc6-i, 0) * 170ms + 600ms);\n}\n.hb-yc6-line {\n  position: absolute;\n  top: 32px;\n  bottom: 4px;\n  left: 13px;\n  width: 2px;\n  border-radius: 2px;\n  background: #2a2a2a;\n  transform-origin: top;\n  animation: hb-yc6-draw .55s cubic-bezier(.4, 0, .2, 1) both;\n  animation-delay: calc(var(--hb-yc6-i, 0) * 170ms + 150ms);\n}\n.hb-yc6-li[data-tone=\"done\"] .hb-yc6-line { background: linear-gradient(var(--hb-yc6-a), color-mix(in srgb, var(--hb-yc6-a) 45%, #2a2a2a)); }\n.hb-yc6-li[data-tone=\"active\"] .hb-yc6-line { background: repeating-linear-gradient(#2a2a2a 0 4px, transparent 4px 8px); }\n.hb-yc6-li[data-tone=\"pending\"] .hb-yc6-line { background: repeating-linear-gradient(#232323 0 4px, transparent 4px 8px); }\n.hb-yc6-li[data-last=\"true\"] .hb-yc6-line { display: none; }\n.hb-yc6-main { min-width: 0; padding-bottom: var(--hb-yc6-gap, 14px); animation: hb-yc6-in .5s cubic-bezier(.2, .9, .2, 1) both; animation-delay: calc(var(--hb-yc6-i, 0) * 170ms + 80ms); }\n.hb-yc6-li[data-last=\"true\"] .hb-yc6-main { padding-bottom: 0; }\n.hb-yc6-head {\n  display: flex;\n  align-items: center;\n  gap: 8px;\n  width: 100%;\n  min-height: 28px;\n  margin: 0;\n  padding: 0;\n  border: 0;\n  background: transparent;\n  color: inherit;\n  font: inherit;\n  text-align: left;\n}\nbutton.hb-yc6-head { margin-left: -6px; width: calc(100% + 6px); padding: 0 6px; border-radius: 8px; cursor: pointer; transition: background-color .15s ease; }\nbutton.hb-yc6-head:hover { background: #161616; }\nbutton.hb-yc6-head:focus-visible { outline: 2px solid var(--hb-yc6-a); outline-offset: 0; }\n.hb-yc6-ttl { flex: 1; min-width: 0; overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }\n.hb-yc6-li[data-tone=\"pending\"] .hb-yc6-ttl { color: #8f8f8f; font-weight: 500; }\n.hb-yc6-time { flex: none; color: #77777f; font-size: 11.5px; line-height: 16px; white-space: nowrap; }\n.hb-yc6-chev { width: 14px; height: 14px; flex: none; color: #6f6f6f; transition: transform .28s cubic-bezier(.2, .9, .2, 1), color .15s ease; }\n.hb-yc6-li[data-open=\"true\"] .hb-yc6-chev { color: #ededed; transform: rotate(180deg); }\n.hb-yc6-desc { margin: 0; color: #8f8f8f; font-size: 12px; line-height: 17px; }\n.hb-yc6-panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s cubic-bezier(.2, .9, .2, 1); }\n.hb-yc6-li[data-open=\"true\"] .hb-yc6-panel { grid-template-rows: 1fr; }\n.hb-yc6-in { min-height: 0; overflow: hidden; }\n.hb-yc6-box {\n  margin-top: 6px;\n  padding: 8px 10px;\n  border: 1px solid #232323;\n  border-radius: 9px;\n  background: #121212;\n  color: #b4b4b4;\n  font-size: 12px;\n  line-height: 17px;\n  opacity: 0;\n  transform: translateY(-4px);\n  transition: opacity .25s ease, transform .3s cubic-bezier(.2, .9, .2, 1);\n}\n.hb-yc6-li[data-open=\"true\"] .hb-yc6-box { opacity: 1; transform: none; transition-delay: .06s; }\n@keyframes hb-yc6-pop {\n  from { opacity: 0; transform: scale(.4); }\n  to { opacity: 1; transform: none; }\n}\n@keyframes hb-yc6-draw {\n  from { transform: scaleY(0); }\n  to { transform: scaleY(1); }\n}\n@keyframes hb-yc6-in {\n  from { opacity: 0; transform: translateX(-8px); }\n  to { opacity: 1; transform: none; }\n}\n@keyframes hb-yc6-ping {\n  0% { opacity: .7; transform: scale(1); }\n  70%, 100% { opacity: 0; transform: scale(1.7); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yc6-node, .hb-yc6-line, .hb-yc6-main, .hb-yc6-li[data-tone=\"active\"] .hb-yc6-node::after { animation: none; }\n  .hb-yc6-panel, .hb-yc6-box, .hb-yc6-chev, button.hb-yc6-head { transition: none; }\n}\n`;\n\nexport function ListTimelineVertical({\n  items = defaultItems,\n  open,\n  defaultOpen = [],\n  onOpenChange,\n  multiple = false,\n  gap = 14,\n  accent = \"#2f7bff\",\n  className = \"\",\n  style,\n  onKeyDown,\n  ...rest\n}: ListTimelineVerticalProps) {\n  const uid = React.useId();\n  const rootRef = React.useRef<HTMLOListElement>(null);\n  const [innerOpen, setInnerOpen] = React.useState(defaultOpen);\n  const openIds = open ?? innerOpen;\n\n  function toggle(id: string) {\n    const has = openIds.includes(id);\n    const next = has ? openIds.filter((x) => x !== id) : multiple ? [...openIds, id] : [id];\n    if (open === undefined) setInnerOpen(next);\n    onOpenChange?.(next);\n  }\n\n  function handleKeyDown(e: React.KeyboardEvent<HTMLOListElement>) {\n    onKeyDown?.(e);\n    if (e.defaultPrevented) return;\n    const target = e.target as HTMLElement;\n    if (!target.hasAttribute(\"data-yc6-head\")) return;\n    const id = target.dataset.yc6Head ?? \"\";\n    if (e.key === \"Escape\") {\n      if (openIds.includes(id)) {\n        e.preventDefault();\n        toggle(id);\n      } else target.blur();\n      return;\n    }\n    const list = Array.from(rootRef.current?.querySelectorAll<HTMLElement>(\"[data-yc6-head]\") ?? []);\n    const at = list.indexOf(target);\n    let next = -1;\n    if (e.key === \"ArrowDown\") next = Math.min(list.length - 1, at + 1);\n    else if (e.key === \"ArrowUp\") next = Math.max(0, at - 1);\n    else if (e.key === \"Home\") next = 0;\n    else if (e.key === \"End\") next = list.length - 1;\n    if (next >= 0) {\n      e.preventDefault();\n      list[next]?.focus();\n    }\n  }\n\n  const vars = { \"--hb-yc6-a\": accent, \"--hb-yc6-gap\": `${gap}px`, ...style } as React.CSSProperties;\n\n  return (\n    <ol ref={rootRef} className={`hb-yc6 ${className}`} style={vars} onKeyDown={handleKeyDown} {...rest}>\n      <style href=\"hb-list-timeline-vertical\" precedence=\"default\">{css}</style>\n      {items.map((item, i) => {\n        const tone = item.tone ?? \"done\";\n        const iconName: TimelineIconName = item.icon ?? (tone === \"done\" ? \"check\" : tone === \"active\" ? \"clock\" : \"flag\");\n        const isOpen = openIds.includes(item.id);\n        const hasDetails = item.details !== undefined && item.details !== null && item.details !== \"\";\n        const panelId = `${uid}-${item.id}`;\n        const head = (\n          <>\n            <span className=\"hb-yc6-ttl\">{item.title}</span>\n            <span className=\"hb-yc6-time\">{item.time}</span>\n            {hasDetails ? (\n              <svg className=\"hb-yc6-chev\" viewBox=\"0 0 14 14\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                <path d=\"M3.5 5.5L7 9l3.5-3.5\" />\n              </svg>\n            ) : null}\n          </>\n        );\n        return (\n          <li\n            key={item.id}\n            className=\"hb-yc6-li\"\n            data-tone={tone}\n            data-open={isOpen}\n            data-last={i === items.length - 1}\n            style={{ \"--hb-yc6-i\": i } as React.CSSProperties}\n          >\n            <div className=\"hb-yc6-rail\">\n              <span className=\"hb-yc6-node\">\n                <TimelineIcon name={iconName} />\n              </span>\n              <span className=\"hb-yc6-line\" aria-hidden=\"true\" />\n            </div>\n            <div className=\"hb-yc6-main\">\n              {hasDetails ? (\n                <button type=\"button\" className=\"hb-yc6-head\" data-yc6-head={item.id} aria-expanded={isOpen} aria-controls={panelId} onClick={() => toggle(item.id)}>\n                  {head}\n                </button>\n              ) : (\n                <div className=\"hb-yc6-head\">{head}</div>\n              )}\n              {item.description ? <p className=\"hb-yc6-desc\">{item.description}</p> : null}\n              {hasDetails ? (\n                <div id={panelId} className=\"hb-yc6-panel\" role=\"region\" aria-label={item.title}>\n                  <div className=\"hb-yc6-in\" inert={!isOpen}>\n                    <div className=\"hb-yc6-box\">{item.details}</div>\n                  </div>\n                </div>\n              ) : null}\n            </div>\n          </li>\n        );\n      })}\n    </ol>\n  );\n}\n"
    }
  ]
}