{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"blog-cards-featured-split","type":"registry:component","title":"Blog cards · Featured series","description":"Split card for a multi-part series: step through parts while the art and copy crossfade in the direction of travel.","author":"GetUrUI <hello@geturui.dev>","dependencies":["motion","lucide-react"],"registryDependencies":[],"files":[{"path":"registry/geturui/examples/blog-cards/featured-split.tsx","type":"registry:component","target":"components/examples/blog-cards/featured-split.tsx","content":"\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { ArrowRight, ChevronLeft, ChevronRight, Clock } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SeriesPart {\n  title: string;\n  excerpt: string;\n  readingMinutes: number;\n  href?: string;\n}\n\nexport interface FeaturedBlogCardProps {\n  /** Small label above the title. */\n  eyebrow?: string;\n  series?: string;\n  parts?: SeriesPart[];\n  defaultIndex?: number;\n  onRead?: (part: SeriesPart, index: number) => void;\n  className?: string;\n}\n\nconst DEFAULT_PARTS: SeriesPart[] = [\n  { title: \"Start with the smallest token\", excerpt: \"Before components, before themes: how a single spacing scale shaped every decision that came after it.\", readingMinutes: 7 },\n  { title: \"Motion that explains itself\", excerpt: \"Springs, distances and durations that tell people what just happened without asking them to watch.\", readingMinutes: 9 },\n  { title: \"Layers, not lightboxes\", excerpt: \"Why we replaced most modals with panels that keep context in view, and what broke along the way.\", readingMinutes: 8 },\n  { title: \"Shipping the system to 40 teams\", excerpt: \"Versioning, codemods and the release notes nobody skipped. The rollout playbook, step by step.\", readingMinutes: 12 },\n];\n\nfunction Art({ index }: { index: number }) {\n  const k = index % 4;\n  return (\n    <svg viewBox=\"0 0 200 160\" className=\"size-full\" aria-hidden>\n      {k === 0 &&\n        Array.from({ length: 20 }, (_, i) => (\n          <rect key={i} x={28 + (i % 5) * 30} y={22 + Math.floor(i / 5) * 30} width=\"22\" height=\"22\" rx=\"6\" className={i === 12 ? \"fill-volt\" : \"fill-ink/10\"} />\n        ))}\n      {k === 1 && (\n        <g fill=\"none\" strokeWidth=\"2\">\n          {[64, 48, 32].map((r) => (\n            <circle key={r} cx=\"100\" cy=\"80\" r={r} className=\"stroke-ink/15\" />\n          ))}\n          <circle cx=\"148\" cy=\"56\" r=\"9\" className=\"fill-volt stroke-none\" />\n          <circle cx=\"100\" cy=\"80\" r=\"6\" className=\"fill-ink/40 stroke-none\" />\n        </g>\n      )}\n      {k === 2 &&\n        [0, 1, 2].map((i) => (\n          <rect key={i} x={46 + i * 18} y={30 + i * 18} width=\"92\" height=\"70\" rx=\"12\" className={i === 2 ? \"fill-volt\" : i === 1 ? \"fill-ink/20\" : \"fill-ink/10\"} />\n        ))}\n      {k === 3 &&\n        Array.from({ length: 6 }, (_, i) => (\n          <path\n            key={i}\n            d={`M10 ${40 + i * 16} C 60 ${20 + i * 16}, 120 ${70 + i * 16}, 190 ${36 + i * 16}`}\n            fill=\"none\"\n            strokeWidth=\"3\"\n            strokeLinecap=\"round\"\n            className={i === 3 ? \"stroke-volt\" : \"stroke-ink/15\"}\n          />\n        ))}\n    </svg>\n  );\n}\n\n/** Featured split card for a multi-part series: step through parts with arrows while art and copy crossfade in the direction of travel. */\nexport function FeaturedBlogCard({\n  eyebrow = \"Featured series\",\n  series = \"Building a design system in public\",\n  parts = DEFAULT_PARTS,\n  defaultIndex = 1,\n  onRead,\n  className,\n}: FeaturedBlogCardProps) {\n  const reduce = useReducedMotion() ?? false;\n  const [[index, dir], setState] = React.useState<[number, number]>([Math.min(defaultIndex, parts.length - 1), 0]);\n  const part = parts[index];\n  const id = React.useId();\n\n  function go(delta: number) {\n    const next = index + delta;\n    if (next < 0 || next >= parts.length) return;\n    setState([next, delta]);\n  }\n\n  const offset = reduce ? 0 : 16;\n  const swap = {\n    initial: (d: number) => ({ opacity: 0, x: d * offset, filter: \"blur(8px)\" }),\n    animate: { opacity: 1, x: 0, filter: \"blur(0px)\" },\n    exit: (d: number) => ({ opacity: 0, x: d * -offset, filter: \"blur(8px)\" }),\n  };\n  const btn =\n    \"grid size-9 place-items-center rounded-full border border-border-strong text-ink outline-none transition-colors hover:bg-surface-hover focus-visible:shadow-[var(--focus-ring)] disabled:opacity-35 disabled:hover:bg-transparent\";\n\n  return (\n    <section\n      aria-labelledby={`${id}-series`}\n      onKeyDown={(e) => {\n        if (e.key === \"ArrowRight\") go(1);\n        if (e.key === \"ArrowLeft\") go(-1);\n      }}\n      className={cn(\"grid w-full max-w-[680px] overflow-hidden rounded-xl border border-border bg-surface-raised shadow-sm sm:grid-cols-[1fr_1.1fr]\", className)}\n    >\n      <div className=\"relative m-2 h-48 overflow-hidden rounded-lg bg-surface-sunken sm:h-auto sm:min-h-[260px]\">\n        <AnimatePresence mode=\"popLayout\" initial={false} custom={dir}>\n          <motion.div\n            key={index}\n            custom={dir}\n            variants={swap}\n            initial=\"initial\"\n            animate=\"animate\"\n            exit=\"exit\"\n            transition={{ type: \"spring\", stiffness: 300, damping: 30 }}\n            className=\"absolute inset-0 p-4\"\n          >\n            <Art index={index} />\n          </motion.div>\n        </AnimatePresence>\n        <span className=\"absolute left-3 top-3 rounded-full bg-glass px-2.5 py-1 font-mono text-[11px] text-ink-muted backdrop-blur\">\n          Part {index + 1} of {parts.length}\n        </span>\n      </div>\n\n      <div className=\"flex flex-col p-5 sm:p-6\">\n        <p className=\"text-xs font-medium text-ink-subtle\">{eyebrow}</p>\n        <p id={`${id}-series`} className=\"mt-0.5 text-[13px] text-ink-muted\">\n          {series}\n        </p>\n        <div aria-live=\"polite\" className=\"relative mt-4 min-h-[132px]\">\n          <AnimatePresence mode=\"wait\" initial={false} custom={dir}>\n            <motion.div key={index} custom={dir} variants={swap} initial=\"initial\" animate=\"animate\" exit=\"exit\" transition={{ duration: 0.22 }}>\n              <h3 className=\"text-balance font-display text-[22px] font-semibold leading-[1.15] tracking-[-0.5px] text-ink\">{part.title}</h3>\n              <p className=\"mt-2 text-[13.5px] leading-5 text-ink-muted\">{part.excerpt}</p>\n              <p className=\"mt-3 inline-flex items-center gap-1 text-xs text-ink-subtle\">\n                <Clock aria-hidden className=\"size-3.5\" />\n                {part.readingMinutes} min read\n              </p>\n            </motion.div>\n          </AnimatePresence>\n        </div>\n\n        <div aria-hidden className=\"mt-4 flex gap-1.5\">\n          {parts.map((_, i) => (\n            <span key={i} className=\"relative h-1 flex-1 overflow-hidden rounded-full bg-ink/10\">\n              <motion.span\n                className=\"absolute inset-0 origin-left rounded-full bg-ink\"\n                initial={false}\n                animate={{ scaleX: i <= index ? 1 : 0, opacity: i === index ? 1 : 0.35 }}\n                transition={{ type: \"spring\", stiffness: 260, damping: 30 }}\n              />\n            </span>\n          ))}\n        </div>\n\n        <div className=\"mt-5 flex items-center gap-2\">\n          <motion.a\n            href={part.href ?? \"#\"}\n            onClick={() => onRead?.(part, index)}\n            whileTap={reduce ? undefined : { scale: 0.96 }}\n            className=\"mr-auto inline-flex h-9 items-center gap-1.5 rounded-full bg-volt px-4 text-[13px] font-medium text-on-volt outline-none transition-shadow hover:shadow-glow focus-visible:shadow-[var(--focus-ring)]\"\n          >\n            Read part {index + 1}\n            <ArrowRight aria-hidden className=\"size-3.5\" />\n          </motion.a>\n          <button type=\"button\" aria-label=\"Previous part\" disabled={index === 0} onClick={() => go(-1)} className={btn}>\n            <ChevronLeft aria-hidden className=\"size-4\" />\n          </button>\n          <button type=\"button\" aria-label=\"Next part\" disabled={index === parts.length - 1} onClick={() => go(1)} className={btn}>\n            <ChevronRight aria-hidden className=\"size-4\" />\n          </button>\n        </div>\n      </div>\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#featured-split"}}