{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "tour",
  "title": "Tour",
  "description": "First-run tip card joined to a toolbar, plus a get-started checklist.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "@dgit/button"
  ],
  "files": [
    {
      "path": "registry/dgit/ui/tour.tsx",
      "content": "import { useState, type ReactNode } from \"react\";\nimport { Check, X, type LucideIcon } from \"lucide-react\";\nimport { Button } from \"@/registry/dgit/ui/button\";\nimport { cn } from \"@/lib/utils\";\n\n/** First-run tip: a dark card (preview, title, body, button) joined by a line to the toolbar below. Step dots show progress. */\nexport type TourStep = { title: string; body: string; preview: ReactNode };\nexport function TourTip({ steps, toolbar, onDone, nextLabel = \"Next\", doneLabel = \"Got it\", replayLabel = \"Show the tour again\", label = \"Tool tour\" }: { steps: TourStep[]; toolbar: LucideIcon[]; onDone?: () => void; nextLabel?: string; doneLabel?: string; replayLabel?: string; label?: string }) {\n  const [i, setI] = useState(0);\n  const [gone, setGone] = useState(false);\n  if (gone) return <Button autoFocus variant=\"outline\" size=\"sm\" onClick={() => { setI(0); setGone(false); }}>{replayLabel}</Button>;\n  const s = steps[i], last = i === steps.length - 1;\n  return (\n    <div className=\"mx-auto flex w-full max-w-[320px] flex-col items-center\">\n      <div role=\"dialog\" aria-label={label} className=\"w-full rounded-3xl bg-foreground p-3 text-background shadow-card\">\n        <div key={i} className=\"animate-menu overflow-hidden rounded-2xl bg-gray-100\">{s.preview}</div>\n        <div className=\"px-2 pt-3\">\n          <p className=\"text-heading-16\">{s.title}</p>\n          <p className=\"mt-1 text-copy-14 text-background/60\">{s.body}</p>\n        </div>\n        <div className=\"mt-3 flex items-center justify-between px-2 pb-1\">\n          <div className=\"flex gap-1.5\" aria-hidden>{steps.map((_, k) => <span key={k} className={cn(\"size-1.5 rounded-full transition-colors\", k === i ? \"bg-background\" : \"bg-background/30\")} />)}</div>\n          <button type=\"button\" onClick={() => (last ? (setGone(true), onDone?.()) : setI(i + 1))} className=\"active:scale-[0.97] rounded-full bg-background px-4 py-1.5 text-label-14 font-medium text-foreground\">{last ? doneLabel : nextLabel}</button>\n        </div>\n      </div>\n      <span aria-hidden className=\"h-5 w-0.5 bg-foreground\" /><span aria-hidden className=\"-mt-1 size-2 rounded-full bg-foreground\" />\n      <div className=\"bg-gray-100 shadow-card mt-1 flex gap-1 rounded-2xl p-1.5\">\n        {toolbar.map((Ic, k) => <span key={k} className={cn(\"flex size-10 items-center justify-center rounded-xl transition-colors\", k === i ? \"bg-background-100 text-foreground\" : \"text-gray-900\")}><Ic className=\"size-5\" /></span>)}\n      </div>\n    </div>\n  );\n}\n\n/** Get-started checklist: one item open at a time (preview + body), checkbox on the right, close button. */\nexport type CheckItem = { id: string; title: string; body: string; preview: ReactNode };\nexport function Checklist({ title, items, openLabel = \"Open checklist\", closeLabel = \"Close checklist\" }: { title: string; items: CheckItem[]; openLabel?: string; closeLabel?: string }) {\n  const [open, setOpen] = useState(items[0]?.id ?? \"\");\n  const [done, setDone] = useState<Record<string, boolean>>({});\n  const [shown, setShown] = useState(true);\n  if (!shown) return <Button autoFocus variant=\"outline\" size=\"sm\" onClick={() => setShown(true)}>{openLabel}</Button>;\n  const n = items.filter((x) => done[x.id]).length;\n  return (\n    <div className=\"shadow-card w-full max-w-[340px] rounded-3xl bg-background-100 p-2\">\n      <div className=\"flex items-center justify-between px-3 pt-2 pb-1\">\n        <p className=\"text-label-13 text-muted-foreground\">{title} · {n}/{items.length}</p>\n        <button type=\"button\" aria-label={closeLabel} onClick={() => setShown(false)} className=\"active:scale-[0.97] rounded-full p-1 text-muted-foreground hover:text-foreground\"><X className=\"size-4\" /></button>\n      </div>\n      {items.map((it) => {\n        const on = open === it.id;\n        return (\n          <div key={it.id} className={cn(\"rounded-2xl transition-colors\", on && \"bg-gray-100\")}>\n            <div className=\"flex items-center justify-between gap-3 px-3 py-2.5\">\n              <button type=\"button\" aria-expanded={on} aria-controls={`tour-${it.id}`} onClick={() => setOpen(on ? \"\" : it.id)} className=\"flex-1 text-left text-heading-14\">{it.title}</button>\n              <button type=\"button\" role=\"checkbox\" aria-checked={!!done[it.id]} aria-label={it.title} onClick={() => setDone({ ...done, [it.id]: !done[it.id] })}\n                className={cn(\"active:scale-[0.97] flex size-5 items-center justify-center rounded-md border transition-colors\", done[it.id] ? \"border-foreground bg-foreground text-background\" : \"border-gray-600\")}>{done[it.id] && <Check className=\"size-3.5\" />}</button>\n            </div>\n            <div className={cn(\"grid transition-[grid-template-rows] duration-300\", on ? \"grid-rows-[1fr]\" : \"grid-rows-[0fr]\")}>\n              <div id={`tour-${it.id}`} className=\"min-h-0 overflow-hidden\" inert={!on}><div className=\"px-3 pb-3\"><div className=\"overflow-hidden rounded-xl bg-background-100\">{it.preview}</div><p className=\"mt-2 text-copy-13 text-muted-foreground\">{it.body}</p></div></div>\n            </div>\n          </div>\n        );\n      })}\n    </div>\n  );\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}