{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "changelog-feed",
  "title": "Changelog Feed",
  "description": "A release notes feed with a date and version column, one card per release, change type labels, filter chips and a show more toggle for long releases.",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "files": [
    {
      "path": "registry/tealmac/changelog-feed.tsx",
      "content": "// Adapted from Ballmac UI (https://github.com/vamsiy78/ballmac-ui), MIT License, Copyright (c) 2026 Ballmac.\n\"use client\"\n\nimport * as React from \"react\"\nimport { Bug, ChevronDown, Sparkles, Trash2, Wand2 } from \"lucide-react\"\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst gentle = { type: \"spring\", stiffness: 180, damping: 24 } as const\n\ntype ChangeType = \"new\" | \"improved\" | \"fixed\" | \"removed\"\n\ntype ChangelogChange = {\n  type: ChangeType\n  /** One sentence describing the change. */\n  text: string\n}\n\ntype ChangelogEntry = {\n  /** Unique id. */\n  id: string\n  /** Release version, for example \"2.4.0\". */\n  version?: string\n  /** ISO date (YYYY-MM-DD). */\n  date: string\n  /** Headline of the release. */\n  title: string\n  /** One or two sentences about the release. */\n  summary?: string\n  /** The individual changes. */\n  changes: ChangelogChange[]\n  /** An image, video or illustration shown under the summary. */\n  media?: React.ReactNode\n}\n\ntype ChangelogFeedProps = Omit<React.ComponentProps<\"div\">, \"children\"> & {\n  /** Releases, newest first. */\n  entries: ChangelogEntry[]\n  /** Show filter chips with counts. */\n  filterable?: boolean\n  /** Changes shown before \"Show more\". */\n  collapsedCount?: number\n  /** Locale for dates. Fixed by default so server and browser match. */\n  locale?: string\n}\n\nconst TYPES: Record<\n  ChangeType,\n  { label: string; icon: typeof Sparkles; chip: string; tone: string }\n> = {\n  new: {\n    label: \"New\",\n    icon: Sparkles,\n    chip: \"bg-chart-3/12 text-foreground\",\n    tone: \"text-chart-3\",\n  },\n  improved: {\n    label: \"Improved\",\n    icon: Wand2,\n    chip: \"bg-chart-1/12 text-foreground\",\n    tone: \"text-chart-1\",\n  },\n  fixed: {\n    label: \"Fixed\",\n    icon: Bug,\n    chip: \"bg-chart-4/15 text-foreground\",\n    tone: \"text-chart-4\",\n  },\n  removed: {\n    label: \"Removed\",\n    icon: Trash2,\n    chip: \"bg-muted text-foreground\",\n    tone: \"text-muted-foreground\",\n  },\n}\n\nfunction EntryCard({\n  entry,\n  filter,\n  collapsedCount,\n  locale = \"en-US\",\n  latest,\n}: {\n  entry: ChangelogEntry\n  filter: ChangeType | \"all\"\n  collapsedCount: number\n  locale: string\n  latest: boolean\n}) {\n  const reduce = useReducedMotion()\n  const [expanded, setExpanded] = React.useState(false)\n  const listId = React.useId()\n  const changes =\n    filter === \"all\"\n      ? entry.changes\n      : entry.changes.filter((c) => c.type === filter)\n  const visible = expanded ? changes : changes.slice(0, collapsedCount)\n  const hidden = changes.length - visible.length\n  const date = new Intl.DateTimeFormat(locale, {\n    dateStyle: \"long\",\n    timeZone: \"UTC\",\n  }).format(new Date(`${entry.date}T00:00:00Z`))\n  const titleId = `${listId}-title`\n\n  return (\n    <motion.article\n      layout={!reduce}\n      initial={reduce ? false : { opacity: 0, y: 12 }}\n      animate={{ opacity: 1, y: 0 }}\n      exit={reduce ? { opacity: 0 } : { opacity: 0, y: -8 }}\n      transition={gentle}\n      aria-labelledby={titleId}\n      className=\"relative grid gap-4 md:grid-cols-[9.5rem_minmax(0,1fr)] md:gap-8\"\n    >\n      <div className=\"md:sticky md:top-6 md:self-start\">\n        <time\n          dateTime={entry.date}\n          className=\"text-sm font-medium tabular-nums\"\n        >\n          {date}\n        </time>\n        <div className=\"mt-2 flex flex-wrap items-center gap-1.5\">\n          {entry.version && (\n            <span className=\"bg-muted/60 rounded-md border px-1.5 py-0.5 font-mono text-xs font-medium\">\n              v{entry.version}\n            </span>\n          )}\n          {latest && (\n            <span className=\"bg-primary text-primary-foreground rounded-md px-1.5 py-0.5 text-[10px] font-semibold tracking-wide uppercase\">\n              {\"Latest\"}\n            </span>\n          )}\n        </div>\n      </div>\n\n      <div className=\"bg-card text-card-foreground rounded-2xl border p-5 shadow-[0_1px_2px_rgb(0_0_0/0.04)] sm:p-6\">\n        <h3\n          id={titleId}\n          className=\"text-lg font-semibold tracking-tight text-balance\"\n        >\n          {entry.title}\n        </h3>\n        {entry.summary && (\n          <p className=\"text-muted-foreground mt-1.5 text-sm leading-relaxed\">\n            {entry.summary}\n          </p>\n        )}\n        {entry.media && (\n          <div className=\"bg-muted/40 mt-4 overflow-hidden rounded-xl border\">\n            {entry.media}\n          </div>\n        )}\n        <ul id={listId} className=\"mt-4 grid gap-2.5\">\n          {visible.map((change, i) => {\n            const t = TYPES[change.type]\n            const Icon = t.icon\n            return (\n              <li\n                key={`${change.type}-${i}`}\n                className=\"flex items-start gap-3 text-sm leading-relaxed\"\n              >\n                <span\n                  className={cn(\n                    \"mt-0.5 inline-flex h-5 shrink-0 items-center gap-1 rounded-md px-1.5 text-[11px] font-semibold\",\n                    t.chip\n                  )}\n                >\n                  <Icon aria-hidden=\"true\" className={cn(\"size-3\", t.tone)} />\n                  {t.label}\n                </span>\n                <span>{change.text}</span>\n              </li>\n            )\n          })}\n        </ul>\n        {(hidden > 0 || expanded) && changes.length > collapsedCount && (\n          <button\n            type=\"button\"\n            aria-expanded={expanded}\n            aria-controls={listId}\n            onClick={() => setExpanded((v) => !v)}\n            className=\"text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:ring-ring/50 mt-4 inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-[13px] font-medium transition-colors outline-none focus-visible:ring-[3px]\"\n          >\n            {expanded\n              ? \"Show fewer changes\"\n              : `Show ${hidden} more change${hidden === 1 ? \"\" : \"s\"}`}\n            <ChevronDown\n              aria-hidden=\"true\"\n              className={cn(\n                \"size-4 transition-transform duration-200 motion-reduce:transition-none\",\n                expanded && \"rotate-180\"\n              )}\n            />\n          </button>\n        )}\n      </div>\n    </motion.article>\n  )\n}\n\n/**\n * A release-notes feed: a sticky date and version column beside a card per release, with change-type labels that pair\n * an icon and a word, optional media, filter chips with counts, and \"show more\" for long releases.\n */\nfunction ChangelogFeed({\n  entries,\n  filterable = true,\n  collapsedCount = 4,\n  locale = \"en-US\",\n  className,\n  ...props\n}: ChangelogFeedProps) {\n  const [filter, setFilter] = React.useState<ChangeType | \"all\">(\"all\")\n  const counts = entries.reduce(\n    (acc, e) => {\n      e.changes.forEach((c) => (acc[c.type] += 1))\n      return acc\n    },\n    { new: 0, improved: 0, fixed: 0, removed: 0 } as Record<ChangeType, number>\n  )\n  const shown = entries.filter(\n    (e) => filter === \"all\" || e.changes.some((c) => c.type === filter)\n  )\n  const types = (Object.keys(TYPES) as ChangeType[]).filter(\n    (t) => counts[t] > 0\n  )\n\n  return (\n    <div\n      data-slot=\"changelog-feed\"\n      className={cn(\"grid gap-8\", className)}\n      {...props}\n    >\n      {filterable && (\n        <div\n          role=\"group\"\n          aria-label={\"Filter changes\"}\n          className=\"flex flex-wrap gap-2\"\n        >\n          {([\"all\", ...types] as const).map((t) => {\n            const active = filter === t\n            return (\n              <button\n                key={t}\n                type=\"button\"\n                aria-pressed={active}\n                onClick={() => setFilter(t)}\n                className=\"hover:bg-accent focus-visible:ring-ring/50 aria-pressed:border-primary aria-pressed:bg-primary aria-pressed:text-primary-foreground inline-flex h-8 items-center gap-2 rounded-full border px-3.5 text-[13px] font-medium transition-colors outline-none focus-visible:ring-[3px]\"\n              >\n                {t === \"all\" ? \"All\" : TYPES[t].label}\n                <span className=\"text-xs tabular-nums opacity-85\">\n                  {t === \"all\"\n                    ? entries.reduce((n, e) => n + e.changes.length, 0)\n                    : counts[t]}\n                </span>\n              </button>\n            )\n          })}\n        </div>\n      )}\n      <div className=\"grid gap-10 md:gap-12\" aria-live=\"polite\">\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          {shown.map((entry) => (\n            <EntryCard\n              key={entry.id}\n              entry={entry}\n              filter={filter}\n              collapsedCount={collapsedCount}\n              locale={locale}\n              latest={entry.id === entries[0]?.id}\n            />\n          ))}\n        </AnimatePresence>\n        {shown.length === 0 && (\n          <p className=\"text-muted-foreground text-sm\">\n            {\"No releases match this filter.\"}\n          </p>\n        )}\n      </div>\n    </div>\n  )\n}\n\nexport {\n  ChangelogFeed,\n  type ChangelogFeedProps,\n  type ChangelogEntry,\n  type ChangelogChange,\n  type ChangeType,\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}