{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dot-rail-changelog",
  "type": "registry:block",
  "title": "Dot Rail Changelog",
  "description": "Changelog Section built with Dot Rail (LED dot tab indicator): releases on a year-long LED rail. A take on the tabs (tab bar) and progress bar (loading bar). A changelog laid over a year. The rail is the year, with a tick at each release and the months under it; its lit dots sit on the newest release. Point at a release or tab to it and they run across the year to its date with a short comet tail, then back to the newest when you leave.",
  "author": "KeyframeUI <https://keyframeui.com>",
  "categories": [
    "blocks",
    "changelog-sections",
    "changelog",
    "tabs",
    "progress-bar"
  ],
  "docs": "Live preview and the components it's built with: https://keyframeui.com/blocks/changelog-sections/dot-rail-changelog",
  "registryDependencies": [
    "https://keyframeui.com/r/dot-rail.json"
  ],
  "files": [
    {
      "path": "components/dot-rail-changelog.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nimport { DotRail } from \"@/components/ui/dot-rail\";\n\n/* ── Content ─────────────────────────────────────────────────\n * Everything you'd change to make the section yours: the\n * palette, the copy, the year and the releases. The rail is the\n * year, with a tick at each release. Its lit dots sit on the\n * newest one; point at a release or tab to it and they run\n * across the year to its date, then back to the newest when you\n * leave.\n * ─────────────────────────────────────────────────────────── */\n\nconst PALETTE = {\n  light: { paper: \"#fafaf9\", ink: \"#0b0b0d\", accent: \"#2747ff\", signal: \"#ff5a1f\" },\n  dark: { paper: \"#07080c\", ink: \"#f4f4f6\", accent: \"#8292ff\", signal: \"#ff6a2b\" },\n};\n\nconst HEADLINE = { before: \"A year of\", accent: \"departures\" };\nconst BODY = \"A train leaves every Tuesday at ten. These are the ones worth knowing about.\";\nconst ALL_NOTES = { label: \"Every release\", href: \"#changelog\" };\nconst YEAR = 2026;\nconst MONTHS = [\"J\", \"F\", \"M\", \"A\", \"M\", \"J\", \"J\", \"A\", \"S\", \"O\", \"N\", \"D\"];\n/** Half the lit run's width, as a share of the year. */\nconst SPREAD = 0.011;\n\ntype Kind = \"New\" | \"Improved\" | \"Fixed\";\ntype Release = { train: string; date: string; kind: Kind; title: string; body: string; href: string };\n\n/** Oldest first; `date` is YYYY-MM-DD in `YEAR`. */\nconst RELEASES: Release[] = [\n  {\n    train: \"Train 171\",\n    date: \"2026-01-13\",\n    kind: \"New\",\n    title: \"Express trains\",\n    body: \"A hotfix can leave mid-week on its own two-stop route.\",\n    href: \"#train-171\",\n  },\n  {\n    train: \"Train 178\",\n    date: \"2026-03-03\",\n    kind: \"New\",\n    title: \"Canary limits per route\",\n    body: \"A slow export page can't stop the whole train any more.\",\n    href: \"#train-178\",\n  },\n  {\n    train: \"Train 189\",\n    date: \"2026-05-19\",\n    kind: \"Improved\",\n    title: \"Changelogs that write themselves\",\n    body: \"Every train's notes are drafted from the tickets that rode it.\",\n    href: \"#train-189\",\n  },\n  {\n    train: \"Train 199\",\n    date: \"2026-07-28\",\n    kind: \"New\",\n    title: \"Hold a change at the platform\",\n    body: \"It skips this train and boards the next one, checks intact.\",\n    href: \"#train-199\",\n  },\n  {\n    train: \"Train 207\",\n    date: \"2026-09-22\",\n    kind: \"Improved\",\n    title: \"Rollbacks in 11 minutes\",\n    body: \"Down from 26 at the median, without anyone paging the on-call.\",\n    href: \"#train-207\",\n  },\n  {\n    train: \"Train 213\",\n    date: \"2026-11-03\",\n    kind: \"Fixed\",\n    title: \"Checks run as changes board\",\n    body: \"Not all at once at the cut, so Tuesday mornings stay quiet.\",\n    href: \"#train-213\",\n  },\n];\n\n/* ── Section ─────────────────────────────────────────────── */\n\n/** Where a date falls in the year, from 0 to 1. */\nfunction along(date: string) {\n  const start = Date.UTC(YEAR, 0, 1);\n  const end = Date.UTC(YEAR + 1, 0, 1);\n  const [y, m, d] = date.split(\"-\").map(Number);\n  return (Date.UTC(y, m - 1, d) - start) / (end - start);\n}\n\nfunction shortDate(date: string) {\n  const [y, m, d] = date.split(\"-\").map(Number);\n  return new Date(Date.UTC(y, m - 1, d)).toLocaleDateString(\"en-US\", { month: \"short\", day: \"numeric\", timeZone: \"UTC\" });\n}\n\nexport function DotRailChangelog() {\n  const latest = RELEASES.length - 1;\n  const [pointed, setPointed] = React.useState<number | null>(null);\n  const [focused, setFocused] = React.useState<number | null>(null);\n  const shown = pointed ?? focused ?? latest;\n  const at = along(RELEASES[shown].date);\n\n  return (\n    <section\n      style={\n        {\n          \"--paper-light\": PALETTE.light.paper,\n          \"--ink-light\": PALETTE.light.ink,\n          \"--accent-light\": PALETTE.light.accent,\n          \"--signal-light\": PALETTE.light.signal,\n          \"--paper-dark\": PALETTE.dark.paper,\n          \"--ink-dark\": PALETTE.dark.ink,\n          \"--accent-dark\": PALETTE.dark.accent,\n          \"--signal-dark\": PALETTE.dark.signal,\n        } as React.CSSProperties\n      }\n      className=\"bg-(--paper) text-(--ink) [--accent:var(--accent-light)] [--dot-rail-accent:var(--signal)] [--ink:var(--ink-light)] [--paper:var(--paper-light)] [--signal:var(--signal-light)] dark:[--accent:var(--accent-dark)] dark:[--ink:var(--ink-dark)] dark:[--paper:var(--paper-dark)] dark:[--signal:var(--signal-dark)]\"\n    >\n      <div className=\"mx-auto max-w-4xl px-6 py-24 sm:py-28\">\n        <div className=\"flex flex-wrap items-end justify-between gap-x-10 gap-y-4\">\n          <div>\n            <h2 className=\"font-serif text-4xl leading-[1.05] font-normal tracking-[-0.02em] sm:text-5xl\">\n              {HEADLINE.before} <em className=\"text-(--accent)\">{HEADLINE.accent}</em>\n            </h2>\n            <p className=\"mt-3 text-base leading-relaxed opacity-70\">{BODY}</p>\n          </div>\n          <a\n            href={ALL_NOTES.href}\n            className=\"rounded-sm text-sm font-medium underline decoration-current/30 underline-offset-4 transition-[text-decoration-color] duration-150 hover:decoration-current focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--accent)\"\n          >\n            {ALL_NOTES.label}\n          </a>\n        </div>\n\n        {/* The year: the rail, a tick at each release and the months under it. */}\n        <div aria-hidden className=\"mt-12\">\n          <div className=\"relative h-2\">\n            {RELEASES.map((release, index) => (\n              <span\n                key={release.train}\n                className=\"absolute bottom-0 h-1.5 w-px -translate-x-1/2 bg-current transition-opacity duration-150\"\n                style={{ left: `${along(release.date) * 100}%`, opacity: index === shown ? 1 : 0.3 }}\n              />\n            ))}\n          </div>\n          <DotRail value={[at - SPREAD, at + SPREAD]} className=\"mt-1.5\" />\n          <div className=\"relative mt-2 h-4 font-mono text-[10px] tracking-[0.1em] opacity-45\">\n            {MONTHS.map((month, i) => (\n              <span key={i} className=\"absolute -translate-x-1/2\" style={{ left: `${((i + 0.5) / 12) * 100}%` }}>\n                {month}\n              </span>\n            ))}\n          </div>\n        </div>\n\n        <ol className=\"mt-10 divide-y divide-current/10 border-y border-current/10\" onPointerLeave={() => setPointed(null)}>\n          {[...RELEASES].reverse().map((release) => {\n            const index = RELEASES.indexOf(release);\n            return (\n              <li key={release.train}>\n                <a\n                  href={release.href}\n                  onPointerEnter={(e) => e.pointerType === \"mouse\" && setPointed(index)}\n                  onFocus={() => setFocused(index)}\n                  onBlur={() => setFocused((f) => (f === index ? null : f))}\n                  className=\"group grid grid-cols-[4.5rem_minmax(0,1fr)] items-baseline gap-x-4 gap-y-1 py-4 outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--accent) sm:grid-cols-[5.5rem_minmax(0,1fr)_auto]\"\n                >\n                  <time\n                    dateTime={release.date}\n                    className=\"font-mono text-[11px] tracking-[0.08em] uppercase tabular-nums opacity-55 transition-opacity duration-150 group-hover:opacity-100\"\n                  >\n                    {shortDate(release.date)}\n                  </time>\n                  <span className=\"min-w-0\">\n                    <span className=\"font-medium\">{release.title}</span>\n                    <span className=\"mt-0.5 block text-sm leading-relaxed text-pretty opacity-65\">{release.body}</span>\n                  </span>\n                  <span\n                    className={\n                      release.kind === \"New\"\n                        ? \"col-start-2 font-mono text-[10px] tracking-[0.1em] whitespace-nowrap text-(--accent) uppercase sm:col-start-3 sm:text-right\"\n                        : \"col-start-2 font-mono text-[10px] tracking-[0.1em] whitespace-nowrap uppercase opacity-50 sm:col-start-3 sm:text-right\"\n                    }\n                  >\n                    {release.kind} · {release.train.replace(\"Train \", \"#\")}\n                  </span>\n                </a>\n              </li>\n            );\n          })}\n        </ol>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}