{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"blog-cards-compact-list","type":"registry:component","title":"Blog cards · Compact list","description":"List of posts with reading-progress rings, a highlight that glides between rows and arrow-key navigation.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/geturui/examples/blog-cards/compact-list.tsx","type":"registry:component","target":"components/examples/blog-cards/compact-list.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { motion, useReducedMotion } from \"motion/react\";\nimport { ArrowRight, Check } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface CompactPost {\n  id: string;\n  title: string;\n  category: string;\n  /** ISO date (YYYY-MM-DD). */\n  date: string;\n  readingMinutes: number;\n  /** How much the reader has read, 0 to 1. */\n  progress?: number;\n  href?: string;\n}\n\nexport interface CompactBlogListProps {\n  heading?: string;\n  posts?: CompactPost[];\n  /** Link for the \"View all\" action. */\n  allHref?: string;\n  onSelect?: (post: CompactPost) => void;\n  className?: string;\n}\n\nconst DEFAULT_POSTS: CompactPost[] = [\n  { id: \"p1\", title: \"Designing empty states people actually read\", category: \"Product\", date: \"2026-09-30\", readingMinutes: 6, progress: 1 },\n  { id: \"p2\", title: \"A practical guide to spring easing in CSS\", category: \"Motion\", date: \"2026-09-26\", readingMinutes: 9, progress: 0.45 },\n  { id: \"p3\", title: \"What we learned shipping dark mode first\", category: \"Engineering\", date: \"2026-09-19\", readingMinutes: 7, progress: 0 },\n  { id: \"p4\", title: \"Tokens, not themes: naming color for scale\", category: \"Design systems\", date: \"2026-09-12\", readingMinutes: 11, progress: 0.2 },\n];\n\nconst shortDate = (iso: string) => new Date(`${iso}T12:00:00Z`).toLocaleDateString(\"en-US\", { month: \"short\", day: \"numeric\", timeZone: \"UTC\" });\n\nfunction ProgressRing({ value, reduce }: { value: number; reduce: boolean }) {\n  const done = value >= 1;\n  return (\n    <span className=\"relative grid size-8 shrink-0 place-items-center\">\n      <svg viewBox=\"0 0 32 32\" className=\"absolute inset-0 -rotate-90\" aria-hidden>\n        <circle cx=\"16\" cy=\"16\" r=\"13\" fill=\"none\" strokeWidth=\"2.5\" className=\"stroke-ink/10\" />\n        {value > 0 && (\n          <motion.circle\n            cx=\"16\"\n            cy=\"16\"\n            r=\"13\"\n            fill=\"none\"\n            strokeWidth=\"2.5\"\n            strokeLinecap=\"round\"\n            className=\"stroke-volt-ink\"\n            initial={{ pathLength: reduce ? value : 0 }}\n            animate={{ pathLength: value }}\n            transition={{ type: \"spring\", stiffness: 120, damping: 22, delay: 0.15 }}\n          />\n        )}\n      </svg>\n      {done ? (\n        <Check aria-hidden className=\"size-3.5 text-volt-ink\" strokeWidth={3} />\n      ) : value === 0 ? null : (\n        <span aria-hidden className=\"font-mono text-[9px] text-ink-subtle\">\n          {Math.round(value * 100)}\n        </span>\n      )}\n      <span className=\"sr-only\">{done ? \"Finished\" : value > 0 ? `${Math.round(value * 100)}% read` : \"Not started\"}</span>\n    </span>\n  );\n}\n\n/** Compact list of posts with reading-progress rings, a highlight that glides between rows and arrow-key navigation. */\nexport function CompactBlogList({ heading = \"Latest from the journal\", posts = DEFAULT_POSTS, allHref = \"#\", onSelect, className }: CompactBlogListProps) {\n  const reduce = useReducedMotion() ?? false;\n  const id = React.useId();\n  const [active, setActive] = React.useState<number | null>(null);\n  const links = React.useRef<(HTMLAnchorElement | null)[]>([]);\n\n  function onKeyDown(e: React.KeyboardEvent<HTMLUListElement>) {\n    const current = links.current.findIndex((el) => el === document.activeElement);\n    if (current < 0) return;\n    const next =\n      e.key === \"ArrowDown\" ? Math.min(posts.length - 1, current + 1) : e.key === \"ArrowUp\" ? Math.max(0, current - 1) : e.key === \"Home\" ? 0 : e.key === \"End\" ? posts.length - 1 : null;\n    if (next === null) return;\n    e.preventDefault();\n    links.current[next]?.focus();\n  }\n\n  return (\n    <section aria-labelledby={`${id}-h`} className={cn(\"w-full max-w-[460px] rounded-xl border border-border bg-surface-raised p-2 shadow-sm\", className)}>\n      <div className=\"flex items-center justify-between px-3 pb-2 pt-2.5\">\n        <h3 id={`${id}-h`} className=\"font-display text-[15px] font-semibold tracking-[-0.2px] text-ink\">\n          {heading}\n        </h3>\n        <a\n          href={allHref}\n          className=\"group inline-flex items-center gap-1 rounded-xs px-1.5 py-0.5 text-[12.5px] font-medium text-ink-muted outline-none transition-colors hover:text-ink focus-visible:shadow-[var(--focus-ring)]\"\n        >\n          View all\n          <ArrowRight aria-hidden className=\"size-3.5 transition-[translate] duration-200 group-hover:translate-x-0.5\" />\n        </a>\n      </div>\n      <ul onKeyDown={onKeyDown} onPointerLeave={() => setActive(null)} className=\"flex flex-col\">\n        {posts.map((post, i) => (\n          <li key={post.id} className=\"relative\">\n            {active === i && (\n              <motion.span\n                layoutId={reduce ? undefined : `${id}-hl`}\n                aria-hidden\n                className=\"absolute inset-0 rounded-lg bg-surface-hover\"\n                transition={{ type: \"spring\", stiffness: 420, damping: 34 }}\n              />\n            )}\n            <a\n              ref={(el) => {\n                links.current[i] = el;\n              }}\n              href={post.href ?? \"#\"}\n              onClick={() => onSelect?.(post)}\n              onPointerEnter={() => setActive(i)}\n              onFocus={() => setActive(i)}\n              className=\"relative flex items-center gap-3 rounded-lg px-3 py-3 outline-none focus-visible:shadow-[var(--focus-ring)]\"\n            >\n              <ProgressRing value={post.progress ?? 0} reduce={reduce} />\n              <span className=\"min-w-0 flex-1\">\n                <span className=\"line-clamp-2 text-[14px] font-medium leading-5 text-ink\">{post.title}</span>\n                <span className=\"mt-0.5 block text-xs text-ink-subtle\">\n                  {post.category} · <time dateTime={post.date}>{shortDate(post.date)}</time>\n                </span>\n              </span>\n              <span className=\"shrink-0 rounded-full bg-surface-sunken px-2 py-0.5 font-mono text-[11px] tabular-nums text-ink-muted\">{post.readingMinutes} min</span>\n            </a>\n            {i < posts.length - 1 && <span aria-hidden className=\"absolute inset-x-3 bottom-0 h-px bg-border\" />}\n          </li>\n        ))}\n      </ul>\n    </section>\n  );\n}\n"},{"path":"LICENSE-geturui.md","type":"registry:file","target":"LICENSE-geturui.md","content":"MIT License\n\nCopyright (c) 2026 geturui.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n"}],"categories":["examples","blog","article","post","card","journal","editorial","reading time","bookmark","series"],"meta":{"tier":"free","license":"MIT","docs":"https://geturui.com/docs/blog-cards#compact-list"}}