{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "page",
  "title": "Page",
  "description": "PageHeader, Section, List (rounded rows), Notice, and ago() for relative times.",
  "files": [
    {
      "path": "registry/dgit/ui/page.tsx",
      "content": "import type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n/** A page's title (30px, tight) with an optional line under it and an action on the right. */\nexport function PageHeader({ title, children, action, className }: { title: string; children?: ReactNode; action?: ReactNode; className?: string }) {\n  return (\n    <div className={cn(\"mb-8 flex items-start justify-between gap-4\", className)}>\n      <div className=\"min-w-0\">\n        <h1 className=\"text-heading-30 text-balance\">{title}</h1>\n        {children && <p className=\"mt-2 text-muted-foreground text-pretty\">{children}</p>}\n      </div>\n      {action}\n    </div>\n  );\n}\n\n/** A block of a page with a small muted heading. */\nexport function Section({ title, children, className }: { title?: string; children: ReactNode; className?: string }) {\n  return (\n    <section className={cn(\"mb-10\", className)}>\n      {title && <h2 className=\"mb-3 text-sm font-medium text-muted-foreground\">{title}</h2>}\n      {children}\n    </section>\n  );\n}\n\n/** Rows in a rounded, bordered box, divided by hairlines. */\nexport function List({ children, className }: { children: ReactNode; className?: string }) {\n  return <div className={cn(\"divide-y rounded-2xl border\", className)}>{children}</div>;\n}\n\n/** A short message: warn (amber), error, or ok (a plain outline). */\nexport function Notice({ tone = \"warn\", children, className }: { tone?: \"warn\" | \"error\" | \"ok\"; children: ReactNode; className?: string }) {\n  return (\n    <div\n      role={tone === \"error\" ? \"alert\" : \"status\"}\n      className={cn(\n        \"rounded-2xl px-4 py-3 text-[13px] leading-[1.45]\",\n        tone === \"warn\" && \"bg-warn-bg text-warn\",\n        tone === \"error\" && \"bg-destructive/10 text-destructive\",\n        tone === \"ok\" && \"border text-foreground\",\n        className,\n      )}\n    >\n      {children}\n    </div>\n  );\n}\n\nconst rtf = new Intl.RelativeTimeFormat(\"en\", { numeric: \"auto\" });\n\n/** \"3 days ago\", \"just now\". */\nexport function ago(ms: number, locale?: string): string {\n  const fmt = locale ? new Intl.RelativeTimeFormat(locale, { numeric: \"auto\" }) : rtf;\n  const s = Math.round((ms - Date.now()) / 1000);\n  const units: [Intl.RelativeTimeFormatUnit, number][] = [\n    [\"year\", 31536000],\n    [\"month\", 2592000],\n    [\"week\", 604800],\n    [\"day\", 86400],\n    [\"hour\", 3600],\n    [\"minute\", 60],\n  ];\n  for (const [unit, size] of units) if (Math.abs(s) >= size) return fmt.format(Math.round(s / size), unit);\n  return fmt.format(0, \"second\");\n}\n",
      "type": "registry:ui"
    }
  ],
  "type": "registry:ui"
}