{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "changelog-01",
  "title": "Release list with Load more",
  "description": "Dated releases with their kind of change as chips, a summary and a short list, and a Load more that adds the next releases while it is still needed.",
  "dependencies": [
    "date-fns",
    "motion"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/animated-size.json",
    "https://ui.ndekocode.dev/r/button.json",
    "https://ui.ndekocode.dev/r/chip.json",
    "https://ui.ndekocode.dev/r/motion-word-roll.json",
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/use-prefers-reduced-motion.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/blocks/changelog/changelog-01/index.tsx",
      "content": "'use client';\n\nimport {\n  AnimatePresence,\n  motion,\n  type Transition,\n  type Variants,\n} from 'motion/react';\nimport { useEffect, useState } from 'react';\n\nimport { WordRoll } from '@/components/core/word-roll';\nimport { usePrefersReducedMotion } from '@/registry/ndeko/hooks/use-prefers-reduced-motion';\nimport { AnimatedSize } from '@/registry/ndeko/ui/animated-size';\nimport { Button } from '@/registry/ndeko/ui/button';\n\nimport { PAGE_SIZE, RELEASES, SECTION } from './data';\nimport { ReleaseEntry, releaseAnchorOf } from './release-entry';\n\nconst PRESENCE_TRANSITION: Transition = {\n  duration: 0.2,\n  ease: [0.23, 1, 0.32, 1],\n};\n\nconst PRESENCE_VARIANTS: Variants = {\n  hidden: { opacity: 0, y: 8 },\n  shown: { opacity: 1, y: 0 },\n};\n\nconst FADE_VARIANTS: Variants = {\n  hidden: { opacity: 0 },\n  shown: { opacity: 1 },\n};\n\nfunction presenceVariantsOf(shouldReduceMotion: boolean | null) {\n  if (shouldReduceMotion) {\n    return FADE_VARIANTS;\n  }\n  return PRESENCE_VARIANTS;\n}\n\nfunction shownCountLabelOf(shown: number, total: number) {\n  if (total === 1) {\n    return 'Showing the only release';\n  }\n  return `Showing ${shown} of ${total} releases`;\n}\n\nfunction nextCountOf(count: number) {\n  const next = count + PAGE_SIZE;\n  return Math.min(next, RELEASES.length);\n}\n\nexport default function Changelog01() {\n  const [visibleCount, setVisibleCount] = useState(PAGE_SIZE);\n  const [focusTargetId, setFocusTargetId] = useState<string | null>(null);\n  const shouldReduceMotion = usePrefersReducedMotion();\n  const presenceVariants = presenceVariantsOf(shouldReduceMotion);\n  const visibleReleases = RELEASES.slice(0, visibleCount);\n  const hasMore = visibleCount < RELEASES.length;\n  const shownCountLabel = shownCountLabelOf(visibleCount, RELEASES.length);\n\n  useEffect(() => {\n    if (!focusTargetId) {\n      return;\n    }\n    const target = document.getElementById(focusTargetId);\n    target?.focus();\n  }, [focusTargetId]);\n\n  function loadMore() {\n    const firstNewRelease = RELEASES[visibleCount];\n    const nextCount = nextCountOf(visibleCount);\n    const anchor = releaseAnchorOf(firstNewRelease.version);\n    setVisibleCount(nextCount);\n    setFocusTargetId(anchor);\n  }\n\n  return (\n    <section className='px-4 py-16 sm:px-6 sm:py-24 lg:px-8'>\n      <div className='mx-auto flex max-w-4xl flex-col gap-12'>\n        <div className='flex flex-col gap-2 md:ps-[12rem]'>\n          <h2 className='text-2xl font-semibold text-balance sm:text-3xl'>\n            {SECTION.title}\n          </h2>\n          <p className='text-muted-foreground text-base'>\n            {SECTION.description}\n          </p>\n        </div>\n        <AnimatedSize>\n          <ol className='flex flex-col gap-14'>\n            <AnimatePresence initial={false}>\n              {visibleReleases.map((release) => (\n                <motion.li\n                  key={release.version}\n                  variants={presenceVariants}\n                  initial='hidden'\n                  animate='shown'\n                  transition={PRESENCE_TRANSITION}\n                >\n                  <ReleaseEntry release={release} />\n                </motion.li>\n              ))}\n            </AnimatePresence>\n          </ol>\n        </AnimatedSize>\n        <div className='flex flex-col items-start gap-3 md:ps-[12rem]'>\n          <p className='text-muted-foreground text-xs tabular-nums'>\n            <WordRoll text={shownCountLabel} value={visibleCount} />\n          </p>\n          {hasMore && (\n            <Button variant='outline' onClick={loadMore}>\n              Load more releases\n            </Button>\n          )}\n        </div>\n      </div>\n    </section>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/changelog-01/index.tsx"
    },
    {
      "path": "registry/ndeko/blocks/changelog/changelog-01/release-entry.tsx",
      "content": "import { format, parseISO } from 'date-fns';\n\nimport { Chip } from '@/registry/ndeko/ui/chip';\n\nimport { type Release, TAG_STYLES } from './data';\n\nconst DATE_PATTERN = 'd MMM yyyy';\n\nfunction readableDateOf(isoDate: string) {\n  const parsed = parseISO(isoDate);\n  return format(parsed, DATE_PATTERN);\n}\n\nexport function releaseAnchorOf(version: string) {\n  return `changelog-01-release-${version}`;\n}\n\nexport function ReleaseEntry({ release }: { release: Release }) {\n  const readableDate = readableDateOf(release.date);\n  const anchor = releaseAnchorOf(release.version);\n\n  return (\n    <article\n      id={anchor}\n      tabIndex={-1}\n      aria-labelledby={`${anchor}-title`}\n      className='focus-visible:ring-ring/25 grid gap-3 rounded-lg outline-none focus-visible:ring-[3px] md:grid-cols-[10rem_minmax(0,1fr)] md:gap-8'\n    >\n      <div className='flex items-baseline gap-3 md:flex-col md:gap-1'>\n        <time dateTime={release.date} className='text-[13px] font-medium'>\n          {readableDate}\n        </time>\n        <span className='text-muted-foreground text-xs tabular-nums'>\n          Version {release.version}\n        </span>\n      </div>\n      <div className='flex flex-col gap-3'>\n        <div className='flex flex-col gap-2'>\n          <h3\n            id={`${anchor}-title`}\n            className='text-lg font-semibold text-balance'\n          >\n            {release.title}\n          </h3>\n          <ul aria-label='Kind of change' className='flex flex-wrap gap-1.5'>\n            {release.tags.map((tag) => {\n              const tagStyle = TAG_STYLES[tag];\n\n              return (\n                <li key={tag}>\n                  <Chip color={tagStyle.color}>{tagStyle.label}</Chip>\n                </li>\n              );\n            })}\n          </ul>\n        </div>\n        <p className='text-muted-foreground max-w-2xl text-sm leading-relaxed text-pretty'>\n          {release.summary}\n        </p>\n        <ul className='flex flex-col gap-1.5 text-[13px]'>\n          {release.changes.map((change) => (\n            <li key={change} className='flex items-baseline gap-2.5'>\n              <span\n                aria-hidden='true'\n                className='bg-foreground/25 size-1 shrink-0 translate-y-[-0.2em] rounded-full'\n              />\n              {change}\n            </li>\n          ))}\n        </ul>\n      </div>\n    </article>\n  );\n}\n",
      "type": "registry:component",
      "target": "components/blocks/changelog-01/release-entry.tsx"
    },
    {
      "path": "registry/ndeko/blocks/changelog/changelog-01/data.ts",
      "content": "export type ChangeTag = 'new' | 'improved' | 'fixed';\n\nexport type Release = {\n  version: string;\n  date: string;\n  title: string;\n  tags: ChangeTag[];\n  summary: string;\n  changes: string[];\n};\n\nexport const TAG_STYLES: Record<ChangeTag, { label: string; color: string }> = {\n  new: { label: 'New', color: 'var(--primary)' },\n  improved: { label: 'Improved', color: 'var(--info)' },\n  fixed: { label: 'Fixed', color: 'var(--success)' },\n};\n\nexport const SECTION = {\n  title: 'Changelog',\n  description: 'What changed in Loomboard, newest first',\n};\n\nexport const PAGE_SIZE = 3;\n\nexport const RELEASES: Release[] = [\n  {\n    version: '4.12',\n    date: '2026-10-28',\n    title: 'Dependencies on the timeline',\n    tags: ['new', 'improved'],\n    summary:\n      'Link two cards and the second one moves when the first one slips. The timeline draws the link and warns you before a date collides.',\n    changes: [\n      'Drag from the edge of a bar to another bar to link them',\n      'Moving a card shifts every card that depends on it',\n      'The board shows a small mark on cards that wait for another',\n    ],\n  },\n  {\n    version: '4.11',\n    date: '2026-10-14',\n    title: 'Quieter notifications',\n    tags: ['improved'],\n    summary:\n      'Notifications about the same card are grouped, and nothing arrives outside the working hours you set in your profile.',\n    changes: [\n      'One notification per card instead of one per change',\n      'Working hours per person, with a catch-up summary in the morning',\n    ],\n  },\n  {\n    version: '4.10.2',\n    date: '2026-10-03',\n    title: 'Fixes for shared boards',\n    tags: ['fixed'],\n    summary:\n      'Guests invited to a single board could see the names of other boards in the search. They now only see the board they were invited to.',\n    changes: [\n      'Search results respect board access for guests',\n      'Archived lanes no longer reappear after a page refresh',\n    ],\n  },\n  {\n    version: '4.10',\n    date: '2026-09-22',\n    title: 'Rules that post to a channel',\n    tags: ['new'],\n    summary:\n      'An automation can now post a message in a team channel when a card reaches a lane, with the card title and its owner.',\n    changes: [\n      'New action: post in a channel',\n      'Pick which card fields appear in the message',\n    ],\n  },\n  {\n    version: '4.9',\n    date: '2026-09-08',\n    title: 'Weekly report by person',\n    tags: ['new', 'improved'],\n    summary:\n      'The weekly report splits the hours by person as well as by board, and exports to CSV with the same columns.',\n    changes: [\n      'A person filter on every report',\n      'CSV export keeps the grouping you see on screen',\n    ],\n  },\n  {\n    version: '4.8.1',\n    date: '2026-08-25',\n    title: 'Keyboard fixes',\n    tags: ['fixed'],\n    summary:\n      'Moving a card with the keyboard skipped empty lanes. Arrow keys now stop on every lane, empty or not.',\n    changes: ['Arrow keys stop on empty lanes', 'Escape closes the card panel'],\n  },\n  {\n    version: '4.8',\n    date: '2026-08-11',\n    title: 'Templates for recurring work',\n    tags: ['new'],\n    summary:\n      'Save a board as a template and start the next sprint, launch or onboarding from it with the lanes and rules already in place.',\n    changes: [\n      'Save any board as a template',\n      'Templates keep lanes, labels and automations',\n    ],\n  },\n  {\n    version: '4.7',\n    date: '2026-07-28',\n    title: 'Faster boards with many cards',\n    tags: ['improved'],\n    summary:\n      'Boards with several hundred cards open and scroll without the delay some teams reported on large launches.',\n    changes: [\n      'Lanes load the cards you can see first',\n      'Dragging stays smooth on long lanes',\n    ],\n  },\n];\n",
      "type": "registry:component",
      "target": "components/blocks/changelog-01/data.ts"
    }
  ],
  "categories": [
    "blocks",
    "changelog"
  ],
  "type": "registry:block"
}