{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "whats-new",
  "title": "What's new",
  "description": "Changelog launcher with an unread badge that opens illustrated release slides and a full changelog view.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "button",
    "checkbox",
    "dialog",
    "label"
  ],
  "files": [
    {
      "path": "registry/blocks/notifications/whats-new.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { ArrowLeft, ArrowRight, Bell, Gift, LayoutList, Megaphone, Rocket, Sparkles, Wrench } from \"lucide-react\"\nimport { Button } from \"@/components/ui/button\"\nimport { Checkbox } from \"@/components/ui/checkbox\"\nimport { Dialog, DialogContent, DialogDescription, DialogTitle } from \"@/components/ui/dialog\"\nimport { Label } from \"@/components/ui/label\"\nimport { cn } from \"@/lib/utils\"\n\ntype Slide = { id: string; tag: string; title: string; body: string; points: string[]; art: React.ReactNode; tint: string }\n\nconst SLIDES: Slide[] = [\n  {\n    id: \"recurring\",\n    tag: \"New\",\n    title: \"Recurring bookings\",\n    body: \"Book a client every 2, 4 or 6 weeks in one step. Clashes are flagged before anything is saved.\",\n    points: [\"Repeat by week, month or custom interval\", \"Skip or move a single visit without breaking the series\"],\n    art: <RecurringArt />,\n    tint: \"text-violet-700 bg-violet-500/10 dark:text-violet-300\",\n  },\n  {\n    id: \"whatsapp\",\n    tag: \"New\",\n    title: \"WhatsApp reminders\",\n    body: \"Clients get a friendly reminder 24 hours before and can confirm or reschedule with one tap.\",\n    points: [\"No-shows dropped 38% in our beta studios\", \"Replies land straight in your client inbox\"],\n    art: <ChatArt />,\n    tint: \"text-emerald-700 bg-emerald-500/10 dark:text-emerald-300\",\n  },\n  {\n    id: \"waitlist\",\n    tag: \"Improved\",\n    title: \"Smart waitlist\",\n    body: \"When someone cancels, the next best match on the waitlist is offered the slot automatically.\",\n    points: [\"Matches on service, staff and preferred time\", \"First to accept gets it, the rest are notified\"],\n    art: <WaitlistArt />,\n    tint: \"text-amber-700 bg-amber-500/10 dark:text-amber-300\",\n  },\n]\n\ntype ChangeKind = \"New\" | \"Improved\" | \"Fixed\"\n\nconst CHANGELOG: { version: string; date: string; items: { kind: ChangeKind; text: string }[] }[] = [\n  {\n    version: \"4.2\",\n    date: \"Nov 3, 2026\",\n    items: [\n      { kind: \"New\", text: \"Recurring bookings with clash detection\" },\n      { kind: \"New\", text: \"WhatsApp reminders with one-tap confirm\" },\n      { kind: \"Improved\", text: \"Smart waitlist now matches preferred staff\" },\n      { kind: \"Fixed\", text: \"Deposits showed twice on split payments\" },\n    ],\n  },\n  {\n    version: \"4.1\",\n    date: \"Oct 20, 2026\",\n    items: [\n      { kind: \"New\", text: \"Resource timeline for rooms and chairs\" },\n      { kind: \"Improved\", text: \"Calendar loads 2× faster on large teams\" },\n      { kind: \"Fixed\", text: \"Time zone drift on daylight-saving weekends\" },\n    ],\n  },\n  {\n    version: \"4.0\",\n    date: \"Oct 6, 2026\",\n    items: [\n      { kind: \"New\", text: \"Client inbox for SMS, WhatsApp and email\" },\n      { kind: \"Improved\", text: \"Redesigned booking page with your brand colours\" },\n    ],\n  },\n]\n\nconst KIND_STYLE: Record<ChangeKind, { cls: string; icon: React.ElementType }> = {\n  New: { cls: \"bg-violet-500/10 text-violet-700 dark:text-violet-300\", icon: Rocket },\n  Improved: { cls: \"bg-sky-500/10 text-sky-700 dark:text-sky-300\", icon: Sparkles },\n  Fixed: { cls: \"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300\", icon: Wrench },\n}\n\nexport default function WhatsNew() {\n  const [open, setOpen] = React.useState(false)\n  const [index, setIndex] = React.useState(0)\n  const [seen, setSeen] = React.useState<string[]>([])\n  const [view, setView] = React.useState<\"slides\" | \"list\">(\"slides\")\n  const [mute, setMute] = React.useState(false)\n  const [release, setRelease] = React.useState(0)\n\n  const unread = SLIDES.length - seen.length\n  const slide = SLIDES[index]!\n\n  const go = (i: number) => {\n    const next = SLIDES[i]\n    if (!next) return\n    setIndex(i)\n    setSeen((s) => (s.includes(next.id) ? s : [...s, next.id]))\n  }\n  const launch = () => {\n    setView(\"slides\")\n    go(0)\n    setOpen(true)\n  }\n  const simulateRelease = () => {\n    setRelease((r) => r + 1)\n    setSeen([])\n    if (!mute) {\n      setView(\"slides\")\n      setIndex(0)\n      setSeen([SLIDES[0]!.id])\n      setOpen(true)\n    }\n  }\n\n  return (\n    <div className=\"p-4 md:p-6\">\n      <div className=\"mx-auto flex max-w-3xl flex-col gap-4\">\n        {/* Mock app header with launcher */}\n        <div className=\"flex items-center gap-3 rounded-xl border bg-card px-4 py-3 shadow-xs\">\n          <span className=\"flex size-8 items-center justify-center rounded-lg bg-primary text-sm font-bold text-primary-foreground\">N</span>\n          <span className=\"hidden font-semibold sm:inline\">Northside Studio</span>\n          <div className=\"ml-auto flex items-center gap-2\">\n            <button\n              type=\"button\"\n              onClick={launch}\n              className=\"group relative inline-flex h-9 items-center gap-2 rounded-full border bg-background pr-3 pl-2 text-sm font-medium transition-colors hover:bg-muted\"\n            >\n              <span className=\"flex size-6 items-center justify-center rounded-full bg-gradient-to-br from-violet-500 to-fuchsia-500 text-white\">\n                <Gift className=\"size-3.5\" />\n              </span>\n              What&apos;s new\n              {unread > 0 && (\n                <span className=\"absolute -top-1.5 -right-1.5 flex h-5 min-w-5 items-center justify-center rounded-full bg-rose-500 px-1 text-[10px] font-bold text-white ring-2 ring-card\">\n                  <span className=\"absolute inset-0 animate-ping rounded-full bg-rose-500 opacity-40\" />\n                  <span className=\"relative\">{unread}</span>\n                </span>\n              )}\n            </button>\n          </div>\n        </div>\n\n        {/* Teaser */}\n        <button type=\"button\" onClick={launch} className=\"group relative overflow-hidden rounded-2xl border text-left\">\n          <div className=\"absolute inset-0 bg-gradient-to-br from-violet-600 via-fuchsia-600 to-rose-500\" />\n          <div className=\"absolute -top-16 -right-10 size-56 rounded-full bg-white/15 blur-2xl\" />\n          <div className=\"relative flex flex-col gap-4 p-6 text-white sm:flex-row sm:items-center\">\n            <div className=\"flex size-12 shrink-0 items-center justify-center rounded-2xl bg-white/15 ring-1 ring-white/30 backdrop-blur\">\n              <Megaphone className=\"size-6\" />\n            </div>\n            <div className=\"flex-1\">\n              <div className=\"text-xs font-semibold tracking-widest text-white/70 uppercase\">Release 4.2{release ? `.${release}` : \"\"}</div>\n              <div className=\"text-xl font-semibold\">Recurring bookings, WhatsApp reminders and a smarter waitlist</div>\n            </div>\n            <span className=\"inline-flex items-center gap-1 self-start rounded-full bg-white px-3 py-1.5 text-sm font-semibold text-violet-700 transition-transform group-hover:translate-x-0.5 sm:self-auto\">\n              See what&apos;s new <ArrowRight className=\"size-4\" />\n            </span>\n          </div>\n        </button>\n\n        <div className=\"flex flex-col gap-3 rounded-xl border border-dashed p-4 text-sm sm:flex-row sm:items-center\">\n          <Bell className=\"size-4 shrink-0 text-muted-foreground\" />\n          <p className=\"flex-1 text-muted-foreground\">\n            {mute ? \"Release notes won't pop up. You'll only see the badge.\" : \"Release notes open automatically the next time we ship.\"}\n          </p>\n          <Button variant=\"outline\" size=\"sm\" onClick={simulateRelease}>Simulate a new release</Button>\n        </div>\n      </div>\n\n      <Dialog open={open} onOpenChange={setOpen}>\n        <DialogContent className=\"gap-0 overflow-hidden p-0 sm:max-w-lg\">\n          {view === \"slides\" ? (\n            <>\n              <div key={slide.id} className=\"animate-in fade-in-0\">{slide.art}</div>\n              <div className=\"flex flex-col gap-3 p-6\">\n                <div className=\"flex items-center gap-2\">\n                  <span className={cn(\"rounded-full px-2 py-0.5 text-xs font-semibold\", slide.tint)}>{slide.tag}</span>\n                  <span className=\"text-xs text-muted-foreground\">Release 4.2 · {index + 1} of {SLIDES.length}</span>\n                </div>\n                <DialogTitle className=\"text-xl\">{slide.title}</DialogTitle>\n                <DialogDescription>{slide.body}</DialogDescription>\n                <ul className=\"flex flex-col gap-1.5 text-sm\">\n                  {slide.points.map((p) => (\n                    <li key={p} className=\"flex gap-2\">\n                      <span className=\"mt-1.5 size-1.5 shrink-0 rounded-full bg-primary\" /> {p}\n                    </li>\n                  ))}\n                </ul>\n              </div>\n            </>\n          ) : (\n            <div className=\"flex flex-col\">\n              <div className=\"border-b p-6 pb-4\">\n                <DialogTitle className=\"text-xl\">Changelog</DialogTitle>\n                <DialogDescription>Everything we shipped in the last month.</DialogDescription>\n              </div>\n              <div className=\"max-h-[360px] overflow-y-auto px-6 py-4\">\n                {CHANGELOG.map((r) => (\n                  <div key={r.version} className=\"relative border-l pb-5 pl-5 last:pb-0\">\n                    <span className=\"absolute top-1 -left-[5px] size-2.5 rounded-full bg-primary ring-4 ring-popover\" />\n                    <div className=\"flex items-baseline gap-2\">\n                      <span className=\"font-mono text-sm font-semibold\">v{r.version}</span>\n                      <span className=\"text-xs text-muted-foreground\">{r.date}</span>\n                    </div>\n                    <ul className=\"mt-2 flex flex-col gap-1.5\">\n                      {r.items.map((it) => {\n                        const K = KIND_STYLE[it.kind]\n                        return (\n                          <li key={it.text} className=\"flex items-start gap-2 text-sm\">\n                            <span className={cn(\"mt-0.5 inline-flex shrink-0 items-center gap-1 rounded px-1.5 text-[10px] leading-4 font-semibold uppercase\", K.cls)}>\n                              <K.icon className=\"size-2.5\" /> {it.kind}\n                            </span>\n                            {it.text}\n                          </li>\n                        )\n                      })}\n                    </ul>\n                  </div>\n                ))}\n              </div>\n            </div>\n          )}\n\n          <div className=\"flex flex-col gap-3 border-t bg-muted/40 px-6 py-4\">\n            <div className=\"flex items-center justify-between gap-3\">\n              <div className=\"flex items-center gap-2\">\n                <Checkbox id=\"wn-mute\" checked={mute} onCheckedChange={(v) => setMute(!!v)} />\n                <Label htmlFor=\"wn-mute\" className=\"text-sm font-normal\">Don&apos;t show again</Label>\n              </div>\n              <button\n                type=\"button\"\n                onClick={() => setView((v) => (v === \"slides\" ? \"list\" : \"slides\"))}\n                className=\"inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground hover:text-foreground\"\n              >\n                {view === \"slides\" ? <LayoutList className=\"size-4\" /> : <Sparkles className=\"size-4\" />}\n                {view === \"slides\" ? \"Full changelog\" : \"Highlights\"}\n              </button>\n            </div>\n            {view === \"slides\" && (\n              <div className=\"flex items-center justify-between\">\n                <div className=\"flex gap-1.5\" role=\"tablist\" aria-label=\"Slides\">\n                  {SLIDES.map((s, i) => (\n                    <button\n                      key={s.id}\n                      type=\"button\"\n                      role=\"tab\"\n                      aria-selected={i === index}\n                      aria-label={`Go to ${s.title}`}\n                      onClick={() => go(i)}\n                      className={cn(\"h-2 rounded-full transition-all\", i === index ? \"w-6 bg-primary\" : \"w-2 bg-muted-foreground/30 hover:bg-muted-foreground/60\")}\n                    />\n                  ))}\n                </div>\n                <div className=\"flex gap-2\">\n                  <Button variant=\"ghost\" size=\"sm\" disabled={index === 0} onClick={() => go(index - 1)}>\n                    <ArrowLeft /> Back\n                  </Button>\n                  {index < SLIDES.length - 1 ? (\n                    <Button size=\"sm\" onClick={() => go(index + 1)}>\n                      Next <ArrowRight />\n                    </Button>\n                  ) : (\n                    <Button size=\"sm\" onClick={() => setOpen(false)}>Got it</Button>\n                  )}\n                </div>\n              </div>\n            )}\n          </div>\n        </DialogContent>\n      </Dialog>\n    </div>\n  )\n}\n\n/* ---------- Illustrations: pure divs + SVG so they inherit no assets ---------- */\n\nfunction RecurringArt() {\n  const on = new Set([1, 8, 15, 22, 4, 18])\n  return (\n    <div className=\"relative flex h-48 items-center justify-center overflow-hidden bg-gradient-to-br from-violet-600 via-indigo-600 to-fuchsia-500\">\n      <div className=\"absolute -top-10 -left-10 size-40 rounded-full bg-white/10 blur-xl\" />\n      <div className=\"relative w-56 rotate-[-4deg] rounded-xl bg-white/95 p-3 shadow-2xl dark:bg-white/90\">\n        <div className=\"mb-2 flex items-center justify-between\">\n          <div className=\"h-2 w-16 rounded-full bg-violet-300\" />\n          <div className=\"h-2 w-6 rounded-full bg-zinc-200\" />\n        </div>\n        <div className=\"grid grid-cols-7 gap-1\">\n          {Array.from({ length: 28 }, (_, i) => (\n            <div key={i} className={cn(\"aspect-square rounded-[3px]\", on.has(i) ? \"bg-violet-500\" : \"bg-zinc-100\")} />\n          ))}\n        </div>\n      </div>\n      <svg viewBox=\"0 0 80 80\" className=\"absolute right-8 bottom-6 size-20 text-white drop-shadow-lg sm:right-16\" aria-hidden>\n        <path d=\"M58 26a24 24 0 1 0 4 22\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"6\" strokeLinecap=\"round\" />\n        <path d=\"M60 10v18H42\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n      </svg>\n    </div>\n  )\n}\n\nfunction ChatArt() {\n  return (\n    <div className=\"relative flex h-48 items-end justify-center overflow-hidden bg-gradient-to-br from-emerald-500 via-teal-500 to-cyan-600\">\n      <svg viewBox=\"0 0 400 200\" className=\"absolute inset-0 size-full opacity-20\" preserveAspectRatio=\"none\" aria-hidden>\n        <path d=\"M0 140 C 100 80, 200 200, 400 110 L 400 200 L 0 200 Z\" fill=\"white\" />\n      </svg>\n      <div className=\"relative h-40 w-44 rounded-t-[28px] border-[6px] border-b-0 border-zinc-900 bg-white p-3 shadow-2xl\">\n        <div className=\"mx-auto mb-3 h-1.5 w-10 rounded-full bg-zinc-200\" />\n        <div className=\"flex flex-col gap-2\">\n          <div className=\"w-[85%] rounded-xl rounded-bl-sm bg-zinc-100 p-2\">\n            <div className=\"h-1.5 w-full rounded-full bg-zinc-300\" />\n            <div className=\"mt-1 h-1.5 w-2/3 rounded-full bg-zinc-300\" />\n          </div>\n          <div className=\"flex gap-1.5\">\n            <span className=\"rounded-full bg-emerald-500 px-2 py-0.5 text-[9px] font-semibold text-white\">Confirm</span>\n            <span className=\"rounded-full border border-zinc-300 px-2 py-0.5 text-[9px] font-semibold text-zinc-600\">Reschedule</span>\n          </div>\n          <div className=\"ml-auto w-[60%] rounded-xl rounded-br-sm bg-emerald-100 p-2\">\n            <div className=\"h-1.5 w-full rounded-full bg-emerald-400\" />\n          </div>\n        </div>\n      </div>\n      <div className=\"absolute top-6 right-6 flex size-11 items-center justify-center rounded-full bg-white text-emerald-600 shadow-lg sm:right-20\">\n        <Bell className=\"size-5\" />\n        <span className=\"absolute -top-0.5 -right-0.5 size-3 rounded-full bg-rose-500 ring-2 ring-white\" />\n      </div>\n    </div>\n  )\n}\n\nfunction WaitlistArt() {\n  const people = [\"bg-rose-400\", \"bg-sky-400\", \"bg-violet-400\"]\n  return (\n    <div className=\"relative flex h-48 items-center justify-center gap-3 overflow-hidden bg-gradient-to-br from-amber-400 sm:gap-6 via-orange-500 to-rose-500\">\n      <div className=\"absolute inset-0 bg-[radial-gradient(circle_at_20%_20%,rgba(255,255,255,.35),transparent_45%)]\" />\n      <div className=\"relative flex flex-col gap-2\">\n        {people.map((c, i) => (\n          <div key={c} className=\"flex items-center gap-2 rounded-lg bg-white/90 py-1.5 pr-4 pl-1.5 shadow-md\" style={{ marginLeft: i * 10, opacity: 1 - i * 0.2 }}>\n            <span className={cn(\"size-6 rounded-full\", c)} />\n            <span className=\"h-1.5 w-14 rounded-full bg-zinc-300\" />\n          </div>\n        ))}\n      </div>\n      <svg viewBox=\"0 0 60 24\" className=\"relative w-14 text-white\" aria-hidden>\n        <path d=\"M2 12h48M40 3l10 9-10 9\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n      </svg>\n      <div className=\"relative rounded-xl bg-white p-3 shadow-2xl\">\n        <div className=\"text-[10px] font-semibold tracking-wide text-zinc-500 uppercase\">Thu 3:00 PM</div>\n        <div className=\"mt-1.5 flex items-center gap-2\">\n          <span className=\"size-7 rounded-full bg-rose-400 ring-2 ring-emerald-400\" />\n          <span className=\"text-xs font-semibold text-emerald-600\">Slot filled</span>\n        </div>\n      </div>\n    </div>\n  )\n}\n",
      "type": "registry:component",
      "target": "components/goodui/whats-new.tsx"
    }
  ],
  "categories": [
    "notifications"
  ],
  "type": "registry:block"
}