{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "expand-card-changelog-demo",
  "type": "registry:block",
  "title": "Expand Card: Changelog With Links",
  "description": "Expandable Card Modal example, Changelog With Links: Each post has its own link. Opening one updates the URL, the back button closes it, and loading a post's link opens it directly. The notes load while the cover grows. A take on the modal (dialog). Fits changelog, features, portfolio, blog, shop and team sections.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "changelog",
    "features",
    "portfolio",
    "blog",
    "shop",
    "team",
    "modal",
    "image-gallery",
    "card",
    "gesture",
    "motion"
  ],
  "docs": "Live preview, examples and props: https://keyframeui.com/components/expand-card#expand-card-changelog-demo",
  "registryDependencies": [
    "https://keyframeui.com/r/expand-card.json"
  ],
  "files": [
    {
      "path": "components/expand-card-changelog-demo.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion } from \"motion/react\";\n\nimport { ExpandCard } from \"@/components/ui/expand-card\";\n\ntype Release = {\n  slug: string;\n  version: string;\n  date: string;\n  title: string;\n  summary: string;\n  tone: string;\n  glyph: string;\n  intro: string;\n  notes: { heading: string; items: string[] }[];\n};\n\nconst releases: Release[] = [\n  {\n    slug: \"relay-2-4\",\n    version: \"2.4\",\n    date: \"Oct 2, 2026\",\n    title: \"Shared inboxes\",\n    summary: \"One address, the whole team, nobody answering twice.\",\n    tone: \"from-zinc-600 to-zinc-900\",\n    glyph: \"M3 13h5l2 3h4l2-3h5M5 5h14l2 8v6H3v-6z\",\n    intro:\n      \"Support, sales and billing can now share one inbox. Everyone sees the same threads, and Relay shows who's replying so two people never answer the same customer.\",\n    notes: [\n      { heading: \"New\", items: [\"Shared inboxes for any address on your domain\", \"Live “typing” indicator on threads someone else has open\", \"Assign a thread with a single keystroke: A\"] },\n      { heading: \"Improved\", items: [\"Threads load twice as fast on large inboxes\", \"Mentions now notify on every device you're signed in on\"] },\n      { heading: \"Fixed\", items: [\"Attachments over 20 MB no longer fail silently\"] },\n    ],\n  },\n  {\n    slug: \"relay-2-3\",\n    version: \"2.3\",\n    date: \"Sep 4, 2026\",\n    title: \"Snooze, rethought\",\n    summary: \"Put a thread away until it's actually useful again.\",\n    tone: \"from-amber-400 to-orange-600\",\n    glyph: \"M12 7v5l3 2M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z\",\n    intro:\n      \"Snooze now understands more than times. Bring a thread back when someone replies, when a date in it arrives, or the next time you open your laptop.\",\n    notes: [\n      { heading: \"New\", items: [\"Snooze until a reply, a date, or your next session\", \"A Later view that shows everything waiting to come back\"] },\n      { heading: \"Improved\", items: [\"Natural-language times: “Monday morning”, “in 3 days”\", \"Snoozed threads keep their place in shared inboxes\"] },\n    ],\n  },\n  {\n    slug: \"relay-2-2\",\n    version: \"2.2\",\n    date: \"Aug 7, 2026\",\n    title: \"Keyboard everything\",\n    summary: \"Every action, two keys away. Press ? to see them all.\",\n    tone: \"from-emerald-400 to-teal-700\",\n    glyph: \"M3 6h18v12H3zM7 10h.01M11 10h.01M15 10h.01M7 14h10\",\n    intro:\n      \"Everything you can click, you can now reach from the keyboard. Shortcuts are listed in a sheet you open with ?, and you can rebind any of them.\",\n    notes: [\n      { heading: \"New\", items: [\"A shortcut for every action, listed under ?\", \"Rebind any shortcut in Settings → Keyboard\", \"Vim-style J and K to move between threads\"] },\n      { heading: \"Fixed\", items: [\"Escape now closes the composer without losing the draft\"] },\n    ],\n  },\n  {\n    slug: \"relay-2-1\",\n    version: \"2.1\",\n    date: \"Jul 10, 2026\",\n    title: \"Search in a blink\",\n    summary: \"Results as you type, across every inbox you can see.\",\n    tone: \"from-sky-400 to-blue-700\",\n    glyph: \"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14ZM20 20l-4-4\",\n    intro:\n      \"Search was rebuilt from the index up. Results arrive as you type, filters stack, and attachments are searched by their contents, not just their names.\",\n    notes: [\n      { heading: \"New\", items: [\"Filters: from:, has:attachment, before: and after:\", \"Search inside PDFs and documents\"] },\n      { heading: \"Improved\", items: [\"First results in under 50 ms on most inboxes\"] },\n    ],\n  },\n];\n\n// Stands in for fetching each post's notes. The cover animates straight away,\n// since it's already on the card; the notes arrive while it grows.\nconst loaded = new Map<string, Promise<Release>>();\nfunction load(release: Release) {\n  let promise = loaded.get(release.slug);\n  if (!promise) {\n    promise = new Promise((resolve) => setTimeout(() => resolve(release), 650));\n    loaded.set(release.slug, promise);\n  }\n  return promise;\n}\n\nexport function ExpandCardChangelogDemo() {\n  const [current, setCurrent] = React.useState<string | null>(null);\n\n  return (\n    <div className=\"w-full overflow-hidden rounded-xl border border-zinc-200 bg-white dark:border-zinc-800 dark:bg-zinc-950\">\n      <div className=\"h-[var(--demo-height,36rem)] overflow-y-auto overscroll-contain [scroll-padding-top:3.5rem]\">\n        <AddressBar hash={current ? `#${current}` : \"\"} />\n\n        <div className=\"mx-auto max-w-2xl px-5 pt-10 pb-16 sm:px-8\">\n          <p className=\"font-mono text-xs tracking-widest text-zinc-500 uppercase\">Changelog</p>\n          <h2 className=\"mt-2 text-3xl font-semibold tracking-tight text-zinc-900 dark:text-zinc-50\">\n            What&apos;s new in Relay\n          </h2>\n          <p className=\"mt-2 text-sm text-pretty text-zinc-500\">\n            Every post has its own link. Open one, then use the back button to close it.\n          </p>\n\n          <ol className=\"mt-10 space-y-8\">\n            {releases.map((release) => (\n              <li key={release.slug} className=\"grid gap-3 sm:grid-cols-[6.5rem_minmax(0,1fr)]\">\n                <time className=\"pt-1 font-mono text-xs text-zinc-500 tabular-nums\">{release.date}</time>\n                <ExpandCard\n                  id={release.slug}\n                  width={680}\n                  className=\"h-44 rounded-2xl shadow-[0_10px_30px_-14px_rgb(0_0_0/0.45)]\"\n                  articleClassName=\"bg-white text-zinc-900 dark:bg-zinc-950 dark:text-zinc-50\"\n                  onOpenChange={(open) =>\n                    setCurrent((slug) => (open ? release.slug : slug === release.slug ? null : slug))\n                  }\n                  cover={<ReleaseCover release={release} />}\n                >\n                  <ReleaseNotes release={release} />\n                </ExpandCard>\n              </li>\n            ))}\n          </ol>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nfunction AddressBar({ hash }: { hash: string }) {\n  return (\n    <div className=\"sticky top-0 z-10 flex items-center gap-3 border-b border-zinc-200/80 bg-white/80 px-4 py-2.5 backdrop-blur-md dark:border-zinc-800/80 dark:bg-zinc-950/80\">\n      <div aria-hidden className=\"flex gap-1.5\">\n        {[0, 1, 2].map((dot) => (\n          <span key={dot} className=\"size-2.5 rounded-full bg-zinc-200 dark:bg-zinc-800\" />\n        ))}\n      </div>\n      <p className=\"flex min-w-0 flex-1 items-center gap-1.5 rounded-lg bg-zinc-100 px-3 py-1.5 font-mono text-xs text-zinc-500 dark:bg-zinc-900\">\n        <svg aria-hidden viewBox=\"0 0 24 24\" className=\"size-3 shrink-0\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2.25} strokeLinecap=\"round\">\n          <path d=\"M6 11h12v9H6zM8.5 11V8a3.5 3.5 0 0 1 7 0v3\" />\n        </svg>\n        <span className=\"truncate\">\n          relay.app/changelog\n          <AnimatePresence initial={false} mode=\"popLayout\">\n            {hash ? (\n              <motion.span\n                key={hash}\n                initial={{ opacity: 0, x: -4 }}\n                animate={{ opacity: 1, x: 0 }}\n                exit={{ opacity: 0 }}\n                transition={{ duration: 0.2, ease: \"easeOut\" }}\n                className=\"inline-block text-zinc-900 dark:text-zinc-100\"\n              >\n                {hash}\n              </motion.span>\n            ) : null}\n          </AnimatePresence>\n        </span>\n      </p>\n    </div>\n  );\n}\n\nfunction ReleaseCover({ release }: { release: Release }) {\n  return (\n    <div className={`relative flex size-full flex-col justify-between overflow-hidden bg-linear-to-br p-5 text-white ${release.tone}`}>\n      <svg\n        aria-hidden\n        viewBox=\"0 0 24 24\"\n        className=\"absolute -right-6 -bottom-8 size-44 text-white/15\"\n        fill=\"none\"\n        stroke=\"currentColor\"\n        strokeWidth={1.5}\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      >\n        <path d={release.glyph} />\n      </svg>\n      <p className=\"relative w-fit rounded-full bg-white/20 px-2.5 py-0.5 font-mono text-xs font-medium backdrop-blur-sm\">\n        Relay {release.version}\n      </p>\n      <div className=\"relative\">\n        <h3 className=\"text-[22px] leading-tight font-semibold tracking-tight\">{release.title}</h3>\n        <p className=\"mt-1 max-w-[19rem] text-sm leading-snug text-white/80\">{release.summary}</p>\n      </div>\n    </div>\n  );\n}\n\nfunction ReleaseNotes({ release }: { release: Release }) {\n  const { intro, notes, date } = React.use(load(release));\n\n  return (\n    <div className=\"mx-auto max-w-[34rem] px-6 pt-6 pb-12 sm:px-8\">\n      <div className=\"flex items-center justify-between gap-4\">\n        <time className=\"font-mono text-xs text-zinc-500 tabular-nums\">{date}</time>\n        <CopyLink />\n      </div>\n      <p className=\"mt-4 text-[16px] leading-relaxed text-pretty text-zinc-600 dark:text-zinc-400\">{intro}</p>\n      {notes.map((section) => (\n        <section key={section.heading} className=\"mt-8\">\n          <h4 className=\"font-mono text-xs tracking-widest text-zinc-500 uppercase\">{section.heading}</h4>\n          <ul className=\"mt-3 space-y-2.5\">\n            {section.items.map((item) => (\n              <li key={item} className=\"flex gap-3 text-[15px] leading-snug text-zinc-800 dark:text-zinc-200\">\n                <span aria-hidden className=\"mt-[7px] size-1.5 shrink-0 rounded-full bg-zinc-300 dark:bg-zinc-700\" />\n                {item}\n              </li>\n            ))}\n          </ul>\n        </section>\n      ))}\n    </div>\n  );\n}\n\nfunction CopyLink() {\n  const [copied, setCopied] = React.useState(false);\n\n  React.useEffect(() => {\n    if (!copied) return;\n    const timer = window.setTimeout(() => setCopied(false), 1600);\n    return () => window.clearTimeout(timer);\n  }, [copied]);\n\n  return (\n    <button\n      type=\"button\"\n      onClick={() => {\n        navigator.clipboard?.writeText(window.location.href).then(() => setCopied(true), () => {});\n      }}\n      className=\"flex items-center gap-1.5 rounded-full bg-zinc-100 px-3 py-1 text-xs font-medium text-zinc-700 transition-[background-color,scale] duration-150 ease-out hover:bg-zinc-200 active:scale-95 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:bg-zinc-800\"\n    >\n      <svg aria-hidden viewBox=\"0 0 24 24\" className=\"size-3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth={2} strokeLinecap=\"round\" strokeLinejoin=\"round\">\n        <path d={copied ? \"M5 12l5 5L20 7\" : \"M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1\"} />\n      </svg>\n      <span aria-live=\"polite\">{copied ? \"Copied\" : \"Copy link\"}</span>\n    </button>\n  );\n}\n"
    }
  ]
}