{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard",
  "type": "registry:block",
  "title": "Dashboard",
  "description": "A working console with metrics, members, activity, and settings.",
  "categories": [
    "blocks"
  ],
  "dependencies": [
    "@tabler/icons-react",
    "recharts@^2.15.1"
  ],
  "registryDependencies": [
    "card",
    "button",
    "input",
    "table"
  ],
  "files": [
    {
      "path": "src/registry/overtrue/dashboard.tsx",
      "type": "registry:component",
      "target": "components/overtrue/dashboard.tsx",
      "content": "\"use client\";\nimport { useId, useState } from \"react\";\nimport {\n  IconDownload as Download,\n  IconChartAreaLine as ChartAreaLine,\n  IconLayoutDashboard as LayoutDashboard,\n  IconSettings as Settings,\n  IconUsers as Users,\n  IconActivity as Activity,\n  IconChevronDown as ChevronDown,\n  IconArrowUpRight as ArrowUpRight,\n} from \"@tabler/icons-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { MetricGroup, MetricGroupItem } from \"./metric-group\";\nimport { MetricChart } from \"./metric-chart\";\nimport { ActivityFeed } from \"./activity-feed\";\nimport { DataTable, type DataColumn } from \"./data-table\";\nimport { StatusBadge } from \"./status-badge\";\nimport { SettingsPanel } from \"./settings-panel\";\nimport { AvatarStack, type TeamMember } from \"./avatar-stack\";\nimport { cn } from \"@/lib/utils\";\nimport { AnalyticsOverview } from \"./analytics-overview\";\n\nexport const dashboardActivity = [\n  {\n    id: \"1\",\n    initials: \"MO\",\n    content: (\n      <>\n        <strong className=\"font-medium\">Maya Okafor</strong> deployed a new\n        release.\n      </>\n    ),\n    time: \"12 minutes ago\",\n  },\n  {\n    id: \"2\",\n    initials: \"LN\",\n    content: (\n      <>\n        <strong className=\"font-medium\">Leo Nakamura</strong> invited two\n        teammates.\n      </>\n    ),\n    time: \"48 minutes ago\",\n  },\n  {\n    id: \"3\",\n    initials: \"ID\",\n    content: (\n      <>\n        <strong className=\"font-medium\">Ines Duarte</strong> upgraded to Pro.\n      </>\n    ),\n    time: \"2 hours ago\",\n  },\n];\nexport const dashboardRevenue = [\n  12, 18, 15, 24, 21, 32, 29, 38, 34, 46, 43, 56,\n].map((value, index) => ({\n  label: [\n    \"Jan\",\n    \"Feb\",\n    \"Mar\",\n    \"Apr\",\n    \"May\",\n    \"Jun\",\n    \"Jul\",\n    \"Aug\",\n    \"Sep\",\n    \"Oct\",\n    \"Nov\",\n    \"Dec\",\n  ][index],\n  value: value * 100,\n}));\nexport const dashboardMembers = [\n  \"Maya Okafor\",\n  \"Leo Nakamura\",\n  \"Ines Duarte\",\n  \"Samir Haddad\",\n  \"June Park\",\n  \"Alina Petrova\",\n  \"Nora Jensen\",\n].map((name, index) => ({\n  id: String(index),\n  name,\n  email: name.toLowerCase().replace(\" \", \".\") + \"@example.com\",\n  role: index === 0 ? \"Owner\" : \"Member\",\n  status: index === 4 ? \"Invited\" : \"Active\",\n}));\ntype Member = (typeof dashboardMembers)[number];\nconst columns: DataColumn<Member>[] = [\n  {\n    key: \"name\",\n    label: \"Member\",\n    value: (row) => row.name,\n    sortable: true,\n    render: (row) => (\n      <div className=\"flex items-center gap-2.5\">\n        <AvatarStack members={[row]} />\n        <div>\n          <p className=\"font-medium\">{row.name}</p>\n          <p className=\"text-xs text-muted-foreground\">{row.email}</p>\n        </div>\n      </div>\n    ),\n  },\n  { key: \"role\", label: \"Role\", value: (row) => row.role, sortable: true },\n  {\n    key: \"status\",\n    label: \"Status\",\n    value: (row) => row.status,\n    render: (row) => (\n      <StatusBadge variant={row.status === \"Active\" ? \"success\" : \"warning\"}>\n        {row.status}\n      </StatusBadge>\n    ),\n  },\n];\nexport function Dashboard({\n  compact = false,\n  workspaceName = \"Acme Studio\",\n  user = dashboardMembers[0],\n}: {\n  compact?: boolean;\n  workspaceName?: string;\n  user?: TeamMember;\n}) {\n  const periodId = useId();\n  const [view, setView] = useState(\"Overview\");\n  const [period, setPeriod] = useState(\"12 months\");\n  const data =\n    period === \"6 months\" ? dashboardRevenue.slice(6) : dashboardRevenue;\n  function exportReport() {\n    const blob = new Blob(\n      [\n        \"Month,Revenue\\n\" +\n          data.map((point) => `${point.label},${point.value}`).join(\"\\n\"),\n      ],\n      { type: \"text/csv;charset=utf-8\" },\n    );\n    const url = URL.createObjectURL(blob),\n      link = document.createElement(\"a\");\n    link.href = url;\n    link.download = \"revenue-report.csv\";\n    link.click();\n    setTimeout(() => URL.revokeObjectURL(url), 1000);\n  }\n  return (\n    <div\n      data-slot=\"dashboard\"\n      className=\"@container/dashboard overflow-hidden rounded-xl border border-border bg-background text-foreground shadow-none\"\n    >\n      <div className=\"flex items-center justify-between gap-4 border-b bg-card px-4 py-3 sm:px-6\">\n        <div className=\"flex items-center gap-3\">\n          <span className=\"flex size-8 items-center justify-center rounded-lg bg-primary/10 text-primary\">\n            <LayoutDashboard\n              aria-hidden=\"true\"\n              className=\"size-4\"\n              stroke={1.7}\n            />\n          </span>\n          <div>\n            <p className=\"text-sm font-semibold tracking-tight\">\n              {workspaceName}\n            </p>\n            <p className=\"mt-0.5 text-[11px] text-muted-foreground\">\n              Workspace\n            </p>\n          </div>\n        </div>\n        <div className=\"flex items-center gap-3\">\n          <span className=\"hidden text-xs font-medium text-muted-foreground sm:block\">\n            {user.name}\n          </span>\n          <AvatarStack members={[user]} />\n        </div>\n      </div>\n      <div className=\"flex flex-col @min-[56rem]/dashboard:flex-row\">\n        <aside className=\"shrink-0 border-b bg-card p-2.5 @min-[56rem]/dashboard:w-44 @min-[56rem]/dashboard:border-r @min-[56rem]/dashboard:border-b-0 @min-[56rem]/dashboard:p-3\">\n          <p className=\"hidden px-3 pt-3 pb-2 text-[11px] font-medium text-muted-foreground @min-[56rem]/dashboard:block\">\n            Workspace\n          </p>\n          <nav\n            aria-label=\"Dashboard\"\n            className=\"flex gap-1 overflow-auto @min-[56rem]/dashboard:flex-col\"\n          >\n            {[\n              { label: \"Overview\", icon: LayoutDashboard },\n              { label: \"Analytics\", icon: ChartAreaLine },\n              { label: \"Members\", icon: Users },\n              { label: \"Activity\", icon: Activity },\n              { label: \"Settings\", icon: Settings },\n            ].map(({ label, icon: Icon }) => (\n              <button\n                key={label}\n                type=\"button\"\n                aria-current={view === label ? \"page\" : undefined}\n                onClick={() => setView(label)}\n                className={cn(\n                  \"flex shrink-0 items-center gap-2.5 rounded-md px-3 py-2.5 text-left text-xs font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\",\n                  view === label\n                    ? \"bg-primary/8 text-primary\"\n                    : \"text-muted-foreground hover:bg-muted\",\n                )}\n              >\n                <Icon className=\"size-4 shrink-0\" />\n                {label}\n              </button>\n            ))}\n          </nav>\n        </aside>\n        <div className=\"min-w-0 flex-1 space-y-5 p-4 sm:p-6\">\n          {view !== \"Analytics\" && (\n            <header className=\"flex flex-wrap items-center justify-between gap-4\">\n              <div>\n                <h2 className=\"text-xl font-semibold tracking-tight\">{view}</h2>\n                <p className=\"mt-1 text-xs leading-5 text-muted-foreground\">\n                  {view === \"Overview\"\n                    ? \"A little perspective on your business.\"\n                    : `Your workspace ${view.toLowerCase()}, in one place.`}\n                </p>\n              </div>\n              {view === \"Overview\" && (\n                <div className=\"flex items-center gap-2\">\n                  <label className=\"sr-only\" htmlFor={periodId}>\n                    Report period\n                  </label>\n                  <div className=\"relative\">\n                    <select\n                      id={periodId}\n                      value={period}\n                      onChange={(event) => setPeriod(event.target.value)}\n                      className=\"h-8 appearance-none rounded-md border border-border bg-card py-0 pl-3 pr-8 text-xs font-medium leading-8 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\"\n                    >\n                      <option>12 months</option>\n                      <option>6 months</option>\n                    </select>\n                    <ChevronDown\n                      aria-hidden=\"true\"\n                      className=\"pointer-events-none absolute top-1/2 right-2.5 size-3.5 -translate-y-1/2 text-muted-foreground\"\n                      stroke={1.7}\n                    />\n                  </div>\n                  <Button\n                    size=\"sm\"\n                    variant=\"outline\"\n                    className=\"h-8 border-border bg-card px-3 text-xs font-medium text-foreground shadow-none hover:bg-muted\"\n                    onClick={exportReport}\n                  >\n                    <Download\n                      aria-hidden=\"true\"\n                      className=\"size-3.5\"\n                      stroke={1.7}\n                    />\n                    Export\n                  </Button>\n                </div>\n              )}\n            </header>\n          )}\n          {view === \"Analytics\" && (\n            <AnalyticsOverview className=\"border-0 p-0 sm:p-0\" />\n          )}\n          {view === \"Overview\" && (\n            <>\n              <MetricGroup className=\"grid-cols-3\">\n                {[\n                  {\n                    label: \"Revenue\",\n                    value: period === \"12 months\" ? \"$36,800\" : \"$24,600\",\n                    change: \"12.8%\",\n                  },\n                  { label: \"Subscribers\", value: \"2,420\", change: \"8.2%\" },\n                  { label: \"Conversion\", value: \"4.36%\", change: \"0.6%\" },\n                ].map((metric) => (\n                  <MetricGroupItem\n                    key={metric.label}\n                    label={metric.label}\n                    value={metric.value}\n                    className=\"px-2 py-4 sm:px-5 sm:py-5 [&>p:first-child]:text-[11px] sm:[&>p:first-child]:text-xs\"\n                    context={\n                      <span className=\"flex flex-wrap items-center gap-1.5\">\n                        <span className=\"inline-flex items-center gap-0.5 font-medium text-emerald-700 dark:text-emerald-400\">\n                          <ArrowUpRight aria-hidden=\"true\" className=\"size-3\" />\n                          <span className=\"sr-only\">Increase </span>\n                          {metric.change}\n                        </span>\n                        <span className=\"hidden text-[11px] sm:inline\">\n                          vs. last month\n                        </span>\n                      </span>\n                    }\n                  />\n                ))}\n              </MetricGroup>\n              <div className=\"grid gap-5 @min-[64rem]/dashboard:grid-cols-[minmax(0,1.8fr)_minmax(0,1fr)]\">\n                <MetricChart\n                  data={data}\n                  height={compact ? 215 : 260}\n                  description=\"Monthly revenue · USD\"\n                  valueFormatter={(value) =>\n                    `$${value.toLocaleString(\"en-US\")}`\n                  }\n                  axisFormatter={(value) =>\n                    value === 0 ? \"$0\" : `$${value / 1000}k`\n                  }\n                />\n                <ActivityFeed\n                  items={dashboardActivity}\n                  className=\"shadow-none\"\n                />\n              </div>\n              {!compact && (\n                <DataTable\n                  title=\"Team members\"\n                  rows={dashboardMembers}\n                  columns={columns}\n                  getRowId={(row) => row.id}\n                />\n              )}\n            </>\n          )}\n          {view === \"Members\" && (\n            <DataTable\n              title=\"Team members\"\n              rows={dashboardMembers}\n              columns={columns}\n              getRowId={(row) => row.id}\n            />\n          )}\n          {view === \"Activity\" && (\n            <ActivityFeed items={dashboardActivity} className=\"shadow-none\" />\n          )}\n          {view === \"Settings\" && (\n            <SettingsPanel\n              initialName={workspaceName}\n              initialEmail=\"team@example.com\"\n            />\n          )}\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/metric-group.tsx",
      "type": "registry:component",
      "target": "components/overtrue/metric-group.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\n/** A shared surface; use StatCard when each metric needs its own card. */\nexport function MetricGroup({ className, ...props }: ComponentProps<\"div\">) {\n  return (\n    <div\n      data-slot=\"metric-group\"\n      className={cn(\n        \"grid grid-cols-[repeat(auto-fit,minmax(min(100%,10rem),1fr))] gap-px overflow-hidden rounded-2xl border border-border bg-border text-card-foreground shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-12px_rgb(0_0_0/0.10)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.5)] [&>*]:bg-card\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\nexport function MetricGroupItem({\n  label,\n  value,\n  context,\n  className,\n  ...props\n}: Omit<ComponentProps<\"div\">, \"children\"> & {\n  label: string;\n  value: ReactNode;\n  context?: ReactNode;\n}) {\n  return (\n    <div\n      data-slot=\"metric-group-item\"\n      className={cn(\n        \"@container min-w-0 px-5 py-5 wrap-anywhere sm:px-6\",\n        className,\n      )}\n      {...props}\n    >\n      <p className=\"m-0 text-[13px] leading-5 font-medium text-muted-foreground\">\n        {label}\n      </p>\n      <p className=\"mt-2 mb-2.5 text-[clamp(1.125rem,14cqi,1.875rem)] leading-[1.15] font-semibold tracking-[-0.035em] tabular-nums\">\n        {value}\n      </p>\n      {context && (\n        <div className=\"text-xs leading-5 text-muted-foreground\">{context}</div>\n      )}\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/metric-chart.tsx",
      "type": "registry:component",
      "target": "components/overtrue/metric-chart.tsx",
      "content": "\"use client\";\nimport { useId, useSyncExternalStore, type ReactNode } from \"react\";\nimport { ChartLegend } from \"./chart-legend\";\nimport {\n  Area,\n  AreaChart,\n  CartesianGrid,\n  ResponsiveContainer,\n  Tooltip,\n  XAxis,\n  YAxis,\n} from \"recharts\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nexport interface MetricPoint {\n  label: string;\n  value: number;\n  previous?: number;\n}\n\nconst reducedMotionQuery = \"(prefers-reduced-motion: reduce)\";\nfunction subscribeToReducedMotion(onChange: () => void) {\n  const query = window.matchMedia(reducedMotionQuery);\n  query.addEventListener(\"change\", onChange);\n  return () => query.removeEventListener(\"change\", onChange);\n}\nfunction getReducedMotionSnapshot() {\n  return window.matchMedia(reducedMotionQuery).matches;\n}\n/** The server snapshot disables motion so hydration starts from identical markup. */\nfunction getReducedMotionServerSnapshot() {\n  return true;\n}\n\nconst PRIMARY = \"var(--color-primary)\";\nconst COMPARISON = \"var(--color-muted-foreground)\";\nconst GRID = \"color-mix(in oklab, var(--color-foreground) 7%, transparent)\";\nconst CROSSHAIR =\n  \"color-mix(in oklab, var(--color-foreground) 25%, transparent)\";\nconst TICK = { fontSize: 11, fill: \"var(--color-muted-foreground)\" };\n/** react-smooth accepts any cubic-bezier() string; the Recharts type lists only keywords. */\nconst EASE = \"cubic-bezier(0.22,1,0.36,1)\" as \"ease-out\";\n\nfunction HaloDot({\n  cx,\n  cy,\n  color,\n}: {\n  cx?: number;\n  cy?: number;\n  color: string;\n}) {\n  if (cx == null || cy == null) return <g />;\n  return (\n    <g pointerEvents=\"none\">\n      <circle cx={cx} cy={cy} r={8} fill={color} fillOpacity={0.18} />\n      <circle\n        cx={cx}\n        cy={cy}\n        r={3.5}\n        fill={color}\n        stroke=\"var(--color-card)\"\n        strokeWidth={1.5}\n      />\n    </g>\n  );\n}\n\nexport function MetricChart({\n  title = \"Revenue overview\",\n  data,\n  height = 240,\n  seriesLabel = \"Revenue\",\n  comparisonLabel = \"Previous period\",\n  valueFormatter = (value: number) => value.toLocaleString(\"en-US\"),\n  axisFormatter = (value: number) =>\n    value.toLocaleString(\"en-US\", {\n      notation: \"compact\",\n      maximumFractionDigits: 1,\n    }),\n  description,\n  actions,\n}: {\n  title?: string;\n  data: MetricPoint[];\n  height?: number;\n  seriesLabel?: string;\n  comparisonLabel?: string;\n  valueFormatter?: (value: number) => string;\n  axisFormatter?: (value: number) => string;\n  description?: string;\n  actions?: ReactNode;\n}) {\n  const gradient = useId().replace(/:/g, \"\");\n  const reducedMotion = useSyncExternalStore(\n    subscribeToReducedMotion,\n    getReducedMotionSnapshot,\n    getReducedMotionServerSnapshot,\n  );\n  const points = data\n    .filter((point) => Number.isFinite(point.value))\n    .map((point) => ({\n      ...point,\n      previous: Number.isFinite(point.previous) ? point.previous : undefined,\n    }));\n  const hasComparison = points.some((point) => point.previous !== undefined);\n  const chartHeight = Number.isFinite(height) ? Math.max(120, height) : 240;\n  const last = points.length - 1;\n  return (\n    <Card\n      data-slot=\"metric-chart\"\n      className=\"min-w-0 gap-0 rounded-2xl border border-border/70 bg-card py-0 text-card-foreground shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-12px_rgb(0_0_0/0.10)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.5)]\"\n    >\n      <CardHeader className=\"flex flex-row flex-wrap items-center justify-between gap-3 border-b border-border/60 px-5 py-4 [.border-b]:pb-4\">\n        <div className=\"min-w-0\">\n          <CardTitle className=\"text-sm font-semibold tracking-tight\">\n            {title}\n          </CardTitle>\n          {description && (\n            <p className=\"mt-1 text-xs leading-5 text-muted-foreground\">\n              {description}\n            </p>\n          )}\n        </div>\n        {actions}\n        <ChartLegend\n          layout=\"horizontal\"\n          items={[\n            { label: seriesLabel, color: PRIMARY },\n            ...(hasComparison\n              ? [\n                  {\n                    label: comparisonLabel,\n                    color: COMPARISON,\n                    dashed: true,\n                  },\n                ]\n              : []),\n          ]}\n        />\n      </CardHeader>\n      <CardContent className=\"p-5 pb-3\">\n        {!points.length ? (\n          <div\n            className=\"flex items-center justify-center text-sm text-muted-foreground\"\n            style={{ height: chartHeight }}\n          >\n            No data for this period.\n          </div>\n        ) : (\n          <div\n            role=\"img\"\n            aria-label={`${title}: ${points.map((point) => `${point.label}: ${seriesLabel} ${valueFormatter(point.value)}${point.previous !== undefined ? `, ${comparisonLabel} ${valueFormatter(point.previous)}` : \"\"}`).join(\"; \")}`}\n            data-slot=\"metric-chart-plot\"\n            className=\"tabular-nums dark:[&_.recharts-area-curve]:[filter:drop-shadow(0_0_6px_color-mix(in_oklab,currentColor_50%,transparent))]\"\n            style={{ height: chartHeight }}\n          >\n            <ResponsiveContainer width=\"100%\" height=\"100%\">\n              <AreaChart\n                data={points}\n                margin={{ top: 10, right: 10, left: 0, bottom: 0 }}\n              >\n                <defs>\n                  <linearGradient id={gradient} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n                    <stop offset=\"0%\" stopColor={PRIMARY} stopOpacity={0.32} />\n                    <stop\n                      offset=\"55%\"\n                      stopColor={PRIMARY}\n                      stopOpacity={0.11}\n                    />\n                    <stop offset=\"100%\" stopColor={PRIMARY} stopOpacity={0} />\n                  </linearGradient>\n                </defs>\n                <CartesianGrid vertical={false} stroke={GRID} />\n                <XAxis\n                  dataKey=\"label\"\n                  tickLine={false}\n                  axisLine={false}\n                  tick={TICK}\n                  minTickGap={24}\n                  dy={8}\n                />\n                <YAxis\n                  width={48}\n                  tickFormatter={axisFormatter}\n                  tickLine={false}\n                  axisLine={false}\n                  tick={TICK}\n                />\n                <Tooltip\n                  isAnimationActive={false}\n                  cursor={{ stroke: CROSSHAIR, strokeWidth: 1 }}\n                  content={({ active, payload, label }) => {\n                    const row = payload?.[0]?.payload as\n                      | (MetricPoint & { previous?: number })\n                      | undefined;\n                    if (!active || !row) return null;\n                    const change =\n                      row.previous !== undefined && row.previous !== 0\n                        ? (row.value - row.previous) / Math.abs(row.previous)\n                        : null;\n                    return (\n                      <div\n                        data-slot=\"metric-chart-tooltip\"\n                        className=\"min-w-44 rounded-xl border border-border/70 bg-popover/90 px-3 py-2.5 text-xs text-popover-foreground shadow-xl backdrop-blur-md\"\n                      >\n                        <p className=\"mb-1.5 font-medium text-foreground\">\n                          {label}\n                        </p>\n                        <div className=\"grid gap-1\">\n                          <div className=\"flex items-center gap-2\">\n                            <span\n                              aria-hidden=\"true\"\n                              className=\"size-2 shrink-0 rounded-full\"\n                              style={{ backgroundColor: PRIMARY }}\n                            />\n                            <span className=\"text-muted-foreground\">\n                              {seriesLabel}\n                            </span>\n                            <span className=\"ml-auto pl-4 font-medium text-foreground tabular-nums\">\n                              {valueFormatter(row.value)}\n                            </span>\n                          </div>\n                          {row.previous !== undefined && (\n                            <div className=\"flex items-center gap-2\">\n                              <span\n                                aria-hidden=\"true\"\n                                className=\"w-2 shrink-0 border-t-2 border-dashed\"\n                                style={{ borderColor: COMPARISON }}\n                              />\n                              <span className=\"text-muted-foreground\">\n                                {comparisonLabel}\n                              </span>\n                              <span className=\"ml-auto pl-4 font-medium text-foreground tabular-nums\">\n                                {valueFormatter(row.previous)}\n                              </span>\n                            </div>\n                          )}\n                        </div>\n                        {change !== null && Number.isFinite(change) && (\n                          <p className=\"mt-1.5 border-t border-border/60 pt-1.5 text-muted-foreground tabular-nums\">\n                            <span className=\"font-medium text-foreground\">\n                              {change > 0 ? \"+\" : change < 0 ? \"−\" : \"\"}\n                              {Math.abs(change * 100).toFixed(1)}%\n                            </span>{\" \"}\n                            vs. {comparisonLabel.toLowerCase()}\n                          </p>\n                        )}\n                      </div>\n                    );\n                  }}\n                />\n                {hasComparison && (\n                  <Area\n                    type=\"monotone\"\n                    dataKey=\"previous\"\n                    name={comparisonLabel}\n                    stroke={COMPARISON}\n                    strokeOpacity={0.7}\n                    strokeWidth={1.5}\n                    strokeDasharray=\"4 4\"\n                    fill=\"none\"\n                    activeDot={(props: { cx?: number; cy?: number }) => (\n                      <circle\n                        cx={props.cx}\n                        cy={props.cy}\n                        r={3}\n                        fill=\"var(--color-card)\"\n                        stroke={COMPARISON}\n                        strokeWidth={1.5}\n                      />\n                    )}\n                    isAnimationActive={!reducedMotion}\n                    animationDuration={700}\n                    animationEasing={EASE}\n                  />\n                )}\n                <Area\n                  type=\"monotone\"\n                  dataKey=\"value\"\n                  name={seriesLabel}\n                  stroke={PRIMARY}\n                  color={PRIMARY}\n                  strokeWidth={2}\n                  strokeLinecap=\"round\"\n                  strokeLinejoin=\"round\"\n                  fill={`url(#${gradient})`}\n                  dot={(props: { cx?: number; cy?: number; index?: number }) =>\n                    props.index === last ? (\n                      <HaloDot\n                        key=\"metric-chart-latest\"\n                        cx={props.cx}\n                        cy={props.cy}\n                        color={PRIMARY}\n                      />\n                    ) : (\n                      <g key={`metric-chart-dot-${props.index}`} />\n                    )\n                  }\n                  activeDot={(props: { cx?: number; cy?: number }) => (\n                    <HaloDot cx={props.cx} cy={props.cy} color={PRIMARY} />\n                  )}\n                  isAnimationActive={!reducedMotion}\n                  animationDuration={700}\n                  animationEasing={EASE}\n                />\n              </AreaChart>\n            </ResponsiveContainer>\n          </div>\n        )}\n      </CardContent>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/chart-legend.tsx",
      "type": "registry:component",
      "target": "components/overtrue/chart-legend.tsx",
      "content": "import type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface ChartLegendItem {\n  label: string;\n  color: string;\n  value?: ReactNode;\n  dashed?: boolean;\n}\nexport function ChartLegend({\n  items,\n  label = \"Chart legend\",\n  layout = \"vertical\",\n  className,\n}: {\n  items: readonly ChartLegendItem[];\n  label?: string;\n  layout?: \"horizontal\" | \"vertical\";\n  className?: string;\n}) {\n  return (\n    <ul\n      data-slot=\"chart-legend\"\n      data-layout={layout}\n      aria-label={label}\n      className={cn(\n        \"m-0 list-none p-0 text-xs\",\n        layout === \"horizontal\"\n          ? \"flex flex-wrap items-center gap-x-4 gap-y-2\"\n          : \"grid gap-3\",\n        className,\n      )}\n    >\n      {items.map((item) => (\n        <li\n          key={item.label}\n          data-slot=\"chart-legend-item\"\n          className=\"flex min-w-0 items-center gap-2\"\n        >\n          {item.dashed ? (\n            <svg\n              aria-hidden=\"true\"\n              data-slot=\"chart-legend-swatch\"\n              viewBox=\"0 0 14 2\"\n              className=\"h-0.5 w-3.5 shrink-0 overflow-visible\"\n            >\n              <line\n                x1=\"1\"\n                y1=\"1\"\n                x2=\"13\"\n                y2=\"1\"\n                stroke={item.color}\n                strokeWidth=\"2\"\n                strokeLinecap=\"round\"\n                strokeDasharray=\"2 4\"\n              />\n            </svg>\n          ) : (\n            <span\n              aria-hidden=\"true\"\n              data-slot=\"chart-legend-swatch\"\n              className=\"size-2 shrink-0 rounded-full\"\n              style={{\n                backgroundColor: item.color,\n                boxShadow: `0 0 0 2px color-mix(in oklab, ${item.color} 16%, transparent)`,\n              }}\n            />\n          )}\n          <span className=\"min-w-0 break-words text-muted-foreground\">\n            {item.label}\n          </span>\n          {item.value != null && (\n            <span className=\"ms-auto ps-3 font-medium text-foreground tabular-nums\">\n              {item.value}\n            </span>\n          )}\n        </li>\n      ))}\n    </ul>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/activity-feed.tsx",
      "type": "registry:component",
      "target": "components/overtrue/activity-feed.tsx",
      "content": "import type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nexport interface ActivityItem {\n  id: string;\n  initials: string;\n  content: ReactNode;\n  time: string;\n}\nexport function ActivityFeed({\n  items,\n  title = \"Recent activity\",\n  className,\n}: {\n  items: ActivityItem[];\n  title?: string;\n  className?: string;\n}) {\n  return (\n    <Card\n      data-slot=\"activity-feed\"\n      className={cn(\n        \"gap-0 rounded-lg border bg-card py-0 shadow-none\",\n        className,\n      )}\n    >\n      <CardHeader className=\"border-b px-5 py-4 [.border-b]:pb-4\">\n        <CardTitle className=\"text-sm font-semibold\">{title}</CardTitle>\n      </CardHeader>\n      <CardContent className=\"px-5 py-1\">\n        <ol className=\"divide-y divide-border\">\n          {items.map((item) => (\n            <li key={item.id} className=\"flex gap-3 py-4\">\n              <span className=\"flex size-8 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-medium text-primary\">\n                {item.initials}\n              </span>\n              <div className=\"min-w-0 text-sm\">\n                <div className=\"text-card-foreground\">{item.content}</div>\n                <p className=\"mt-1 text-xs text-muted-foreground\">\n                  {item.time}\n                </p>\n              </div>\n            </li>\n          ))}\n        </ol>\n        {!items.length && (\n          <p className=\"py-6 text-center text-sm text-muted-foreground\">\n            No activity yet.\n          </p>\n        )}\n      </CardContent>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/data-table.tsx",
      "type": "registry:component",
      "target": "components/overtrue/data-table.tsx",
      "content": "\"use client\";\nimport { useMemo, useRef, useState, type ReactNode } from \"react\";\nimport {\n  IconArrowDown as ArrowDown,\n  IconArrowUp as ArrowUp,\n  IconArrowsSort as ArrowsSort,\n  IconChevronLeft as ChevronLeft,\n  IconChevronRight as ChevronRight,\n} from \"@tabler/icons-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { SearchField } from \"./search-field\";\nimport {\n  Table,\n  TableBody,\n  TableCell,\n  TableHead,\n  TableHeader,\n  TableRow,\n} from \"@/components/ui/table\";\nexport interface DataColumn<T> {\n  key: string;\n  label: string;\n  value: (row: T) => string | number;\n  render?: (row: T) => ReactNode;\n  sortable?: boolean;\n}\nexport function DataTable<T>({\n  rows,\n  columns,\n  getRowId,\n  title = \"Records\",\n  pageSize = 5,\n}: {\n  rows: T[];\n  columns: DataColumn<T>[];\n  getRowId: (row: T) => string;\n  title?: string;\n  pageSize?: number;\n}) {\n  const searchRef = useRef<HTMLInputElement>(null);\n  const [query, setQuery] = useState(\"\");\n  const [sort, setSort] = useState<{ key: string; direction: 1 | -1 } | null>(\n    null,\n  );\n  const [page, setPage] = useState(0);\n  const size = Number.isFinite(pageSize)\n    ? Math.max(1, Math.floor(pageSize) || 5)\n    : 5;\n  const filtered = useMemo(() => {\n    const found = rows.filter((row) =>\n      columns.some((column) =>\n        String(column.value(row))\n          .toLowerCase()\n          .includes(query.trim().toLowerCase()),\n      ),\n    );\n    const column = columns.find((item) => item.key === sort?.key);\n    if (column && sort)\n      found.sort((a, b) => {\n        const x = column.value(a),\n          y = column.value(b);\n        return (\n          (typeof x === \"number\" && typeof y === \"number\"\n            ? x - y\n            : String(x).localeCompare(String(y))) * sort.direction\n        );\n      });\n    return found;\n  }, [rows, columns, query, sort]);\n  const lastPage = Math.max(0, Math.ceil(filtered.length / size) - 1);\n  const safePage = Math.min(page, lastPage);\n  return (\n    <section\n      data-slot=\"data-table\"\n      className=\"min-w-0 overflow-hidden rounded-lg border bg-card shadow-none\"\n      aria-label={title}\n    >\n      <div className=\"flex flex-wrap items-center justify-between gap-3 border-b p-4\">\n        <h2 className=\"text-sm font-semibold text-card-foreground\">{title}</h2>\n        <SearchField\n          ref={searchRef}\n          label={`Search ${title.toLowerCase()}`}\n          value={query}\n          onValueChange={(value) => {\n            setQuery(value);\n            setPage(0);\n          }}\n          placeholder=\"Search records…\"\n          containerClassName=\"w-full max-w-56\"\n        />\n      </div>\n      <div className=\"overflow-x-auto\">\n        <Table className=\"whitespace-nowrap\">\n          <TableHeader>\n            <TableRow>\n              {columns.map((column) => (\n                <TableHead\n                  key={column.key}\n                  aria-sort={\n                    sort?.key === column.key\n                      ? sort.direction === 1\n                        ? \"ascending\"\n                        : \"descending\"\n                      : undefined\n                  }\n                  className=\"h-10 bg-muted/30 px-4 text-xs font-medium\"\n                >\n                  {column.sortable ? (\n                    <button\n                      type=\"button\"\n                      onClick={() => {\n                        setSort({\n                          key: column.key,\n                          direction:\n                            sort?.key === column.key && sort.direction === 1\n                              ? -1\n                              : 1,\n                        });\n                        setPage(0);\n                      }}\n                      className=\"-ms-2 flex items-center gap-1.5 rounded-md px-2 py-2 hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n                    >\n                      {column.label}\n                      {sort?.key === column.key ? (\n                        sort.direction === 1 ? (\n                          <ArrowUp aria-hidden=\"true\" className=\"size-3\" />\n                        ) : (\n                          <ArrowDown aria-hidden=\"true\" className=\"size-3\" />\n                        )\n                      ) : (\n                        <ArrowsSort\n                          aria-hidden=\"true\"\n                          className=\"size-3 text-muted-foreground\"\n                        />\n                      )}\n                    </button>\n                  ) : (\n                    column.label\n                  )}\n                </TableHead>\n              ))}\n            </TableRow>\n          </TableHeader>\n          <TableBody>\n            {filtered\n              .slice(safePage * size, (safePage + 1) * size)\n              .map((row) => (\n                <TableRow key={getRowId(row)}>\n                  {columns.map((column) => (\n                    <TableCell key={column.key} className=\"px-4 py-3.5 text-sm\">\n                      {column.render ? column.render(row) : column.value(row)}\n                    </TableCell>\n                  ))}\n                </TableRow>\n              ))}\n          </TableBody>\n        </Table>\n      </div>\n      {!filtered.length && (\n        <div role=\"status\" className=\"px-4 py-10 text-center\">\n          <p className=\"m-0 text-sm font-medium\">\n            {query.trim() ? \"No matching records.\" : \"No records yet.\"}\n          </p>\n          <p className=\"m-0 mt-1 text-xs leading-5 text-muted-foreground\">\n            {query.trim()\n              ? \"Try another search or clear it to see all records.\"\n              : \"Records will appear here when they are available.\"}\n          </p>\n          {query.trim() && (\n            <Button\n              type=\"button\"\n              variant=\"outline\"\n              size=\"sm\"\n              className=\"mt-4 shadow-none\"\n              onClick={() => {\n                setQuery(\"\");\n                setPage(0);\n                searchRef.current?.focus();\n              }}\n            >\n              Clear search\n            </Button>\n          )}\n        </div>\n      )}\n      <div className=\"flex flex-wrap items-center justify-between gap-3 border-t px-4 py-3\">\n        <p className=\"text-xs text-muted-foreground\" aria-live=\"polite\">\n          {filtered.length\n            ? `${safePage * size + 1}–${Math.min((safePage + 1) * size, filtered.length)}`\n            : \"0\"}{\" \"}\n          of {filtered.length} records\n        </p>\n        <div className=\"flex gap-1\">\n          <Button\n            type=\"button\"\n            variant=\"outline\"\n            size=\"icon\"\n            className=\"size-8 border-border bg-card text-foreground shadow-none hover:bg-muted\"\n            aria-label=\"Previous page\"\n            disabled={!safePage}\n            onClick={() => setPage(safePage - 1)}\n          >\n            <ChevronLeft className=\"size-3.5\" />\n          </Button>\n          <Button\n            type=\"button\"\n            variant=\"outline\"\n            size=\"icon\"\n            className=\"size-8 border-border bg-card text-foreground shadow-none hover:bg-muted\"\n            aria-label=\"Next page\"\n            disabled={safePage >= lastPage}\n            onClick={() => setPage(safePage + 1)}\n          >\n            <ChevronRight className=\"size-3.5\" />\n          </Button>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/search-field.tsx",
      "type": "registry:component",
      "target": "components/overtrue/search-field.tsx",
      "content": "\"use client\";\nimport { useId, useImperativeHandle, useRef, type ComponentProps } from \"react\";\nimport { IconSearch, IconX } from \"@tabler/icons-react\";\nimport { Input } from \"@/components/ui/input\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SearchFieldProps extends Omit<\n  ComponentProps<typeof Input>,\n  \"type\" | \"value\" | \"defaultValue\" | \"onChange\"\n> {\n  label: string;\n  value: string;\n  onValueChange: (value: string) => void;\n  containerClassName?: string;\n}\n/** Controlled search input. Filtering and debouncing belong to the caller. */\nexport function SearchField({\n  label,\n  value,\n  onValueChange,\n  id,\n  ref,\n  containerClassName,\n  className,\n  placeholder = \"Search…\",\n  ...props\n}: SearchFieldProps) {\n  const generatedId = useId();\n  const inputId = id ?? generatedId;\n  const inputRef = useRef<HTMLInputElement>(null);\n  useImperativeHandle(ref, () => inputRef.current!, []);\n  return (\n    <div\n      data-slot=\"search-field\"\n      className={cn(\"relative min-w-0\", containerClassName)}\n    >\n      <label htmlFor={inputId} className=\"sr-only\">\n        {label}\n      </label>\n      <IconSearch\n        aria-hidden=\"true\"\n        className=\"pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground\"\n      />\n      <Input\n        {...props}\n        ref={inputRef}\n        id={inputId}\n        type=\"search\"\n        value={value}\n        onChange={(event) => onValueChange(event.target.value)}\n        placeholder={placeholder}\n        className={cn(\n          \"h-10 w-full rounded-md border-input bg-card dark:bg-card ps-9 pe-9 text-base text-foreground shadow-xs placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/20 sm:text-sm [&::-webkit-search-cancel-button]:appearance-none\",\n          className,\n        )}\n      />\n      {value && !props.readOnly && (\n        <button\n          type=\"button\"\n          aria-label={`Clear ${label.toLowerCase()}`}\n          disabled={props.disabled}\n          className=\"absolute end-1 top-1/2 flex size-7 -translate-y-1/2 items-center justify-center rounded-sm text-muted-foreground hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50\"\n          onClick={() => {\n            onValueChange(\"\");\n            inputRef.current?.focus();\n          }}\n        >\n          <IconX aria-hidden=\"true\" className=\"size-3.5\" />\n        </button>\n      )}\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/status-badge.tsx",
      "type": "registry:component",
      "target": "components/overtrue/status-badge.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nconst variants = {\n  success:\n    \"bg-emerald-500/10 text-emerald-700 ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-300 dark:ring-emerald-400/25\",\n  warning:\n    \"bg-amber-500/10 text-amber-700 ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-300 dark:ring-amber-400/25\",\n  // Tinted text leans toward the foreground so it stays legible on its own tint.\n  error:\n    \"bg-destructive/10 text-[color-mix(in_oklab,var(--color-destructive)_85%,var(--color-foreground))] ring-destructive/20 dark:ring-destructive/30\",\n  info: \"bg-primary/10 text-[color-mix(in_oklab,var(--color-primary)_85%,var(--color-foreground))] ring-primary/20 dark:ring-primary/30\",\n  neutral:\n    \"bg-muted/70 text-[color-mix(in_oklab,var(--color-muted-foreground)_85%,var(--color-foreground))] ring-border dark:bg-muted/50\",\n};\nconst dots = {\n  success: \"bg-emerald-500 dark:bg-emerald-400\",\n  warning: \"bg-amber-500 dark:bg-amber-400\",\n  error: \"bg-destructive\",\n  info: \"bg-primary\",\n  neutral: \"bg-muted-foreground/70\",\n};\nconst styles = `@keyframes status-badge-pulse{0%{transform:scale(1);opacity:.6}70%,100%{transform:scale(2.75);opacity:0}}`;\n\nexport interface StatusBadgeProps\n  extends Omit<ComponentProps<\"span\">, \"children\"> {\n  children: ReactNode;\n  variant?: keyof typeof variants;\n  /** Pulse the dot softly for states that are happening right now. */\n  live?: boolean;\n}\n\nexport function StatusBadge({\n  children,\n  variant = \"neutral\",\n  live = false,\n  className,\n  ...props\n}: StatusBadgeProps) {\n  return (\n    <span\n      data-slot=\"status-badge\"\n      data-variant={variant}\n      data-live={live || undefined}\n      className={cn(\n        \"inline-flex items-center gap-1.5 whitespace-nowrap rounded-full py-0.5 pr-2.5 pl-2 text-xs leading-5 font-medium tabular-nums ring-1 ring-inset\",\n        variants[variant],\n        className,\n      )}\n      {...props}\n    >\n      {live ? (\n        <style href=\"overtrue-status-badge\" precedence=\"default\">\n          {styles}\n        </style>\n      ) : null}\n      <span\n        aria-hidden=\"true\"\n        data-slot=\"status-badge-dot\"\n        className=\"relative flex size-1.5 shrink-0\"\n      >\n        {live ? (\n          <span\n            className={cn(\n              \"absolute inset-0 rounded-full motion-safe:animate-[status-badge-pulse_2s_cubic-bezier(0.22,1,0.36,1)_infinite] motion-reduce:hidden\",\n              dots[variant],\n            )}\n          />\n        ) : null}\n        <span className={cn(\"relative size-1.5 rounded-full\", dots[variant])} />\n      </span>\n      {children}\n    </span>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/settings-panel.tsx",
      "type": "registry:component",
      "target": "components/overtrue/settings-panel.tsx",
      "content": "\"use client\";\nimport { useId, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Input } from \"@/components/ui/input\";\nimport { SectionCard } from \"./section-card\";\nimport { cn } from \"@/lib/utils\";\nexport function SettingsPanel({\n  initialName = \"Acme Studio\",\n  initialEmail = \"team@acme.example\",\n  onSave,\n}: {\n  initialName?: string;\n  initialEmail?: string;\n  onSave?: (values: { name: string; email: string }) => void | Promise<void>;\n}) {\n  const id = useId();\n  const [name, setName] = useState(initialName),\n    [email, setEmail] = useState(initialEmail);\n  const [status, setStatus] = useState(\"\"),\n    [saving, setSaving] = useState(false);\n  const [saved, setSaved] = useState({\n    name: initialName,\n    email: initialEmail,\n  });\n  const [failed, setFailed] = useState(false);\n  const dirty = name !== saved.name || email !== saved.email;\n  return (\n    <SectionCard\n      title=\"Workspace settings\"\n      description=\"Manage your workspace name and contact details.\"\n      contentClassName=\"p-0\"\n    >\n      <form\n        onSubmit={async (event) => {\n          event.preventDefault();\n          if (saving || !dirty) return;\n          const values = { name, email };\n          setSaving(true);\n          setStatus(\"\");\n          setFailed(false);\n          try {\n            await onSave?.(values);\n            setSaved(values);\n            setStatus(\n              onSave ? \"Changes saved.\" : \"Demo saved locally in this preview.\",\n            );\n          } catch {\n            setFailed(true);\n            setStatus(\"Could not save changes. Please try again.\");\n          } finally {\n            setSaving(false);\n          }\n        }}\n      >\n        <fieldset disabled={saving} className=\"min-w-0 space-y-6 p-6\">\n          <div className=\"grid gap-2\">\n            <label htmlFor={`${id}-name`} className=\"text-sm font-medium\">\n              Workspace name\n            </label>\n            <Input\n              id={`${id}-name`}\n              className=\"h-10 rounded-md border-input bg-card dark:bg-card text-base shadow-xs focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/20 [&:user-invalid]:border-destructive [&:user-invalid]:ring-2 [&:user-invalid]:ring-destructive/20 aria-invalid:border-destructive aria-invalid:ring-destructive/20 disabled:bg-muted dark:disabled:bg-muted sm:text-sm\"\n              required\n              name=\"workspace-name\"\n              autoComplete=\"organization\"\n              value={name}\n              onChange={(event) => {\n                setName(event.target.value);\n                setStatus(\"\");\n                setFailed(false);\n              }}\n            />\n          </div>\n          <div className=\"grid gap-2\">\n            <label htmlFor={`${id}-email`} className=\"text-sm font-medium\">\n              Contact email\n            </label>\n            <Input\n              id={`${id}-email`}\n              className=\"h-10 rounded-md border-input bg-card dark:bg-card text-base shadow-xs focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/20 [&:user-invalid]:border-destructive [&:user-invalid]:ring-2 [&:user-invalid]:ring-destructive/20 aria-invalid:border-destructive aria-invalid:ring-destructive/20 disabled:bg-muted dark:disabled:bg-muted sm:text-sm\"\n              required\n              type=\"email\"\n              name=\"contact-email\"\n              autoComplete=\"email\"\n              value={email}\n              onChange={(event) => {\n                setEmail(event.target.value);\n                setStatus(\"\");\n                setFailed(false);\n              }}\n            />\n          </div>\n        </fieldset>\n        <div className=\"flex flex-wrap items-center justify-between gap-3 border-t border-border bg-muted/30 px-6 py-4\">\n          <p\n            role={failed ? \"alert\" : \"status\"}\n            className={cn(\n              \"m-0 min-w-0 grow basis-48 text-xs leading-5 text-muted-foreground\",\n              failed && \"text-destructive\",\n            )}\n          >\n            {status ||\n              (dirty ? \"You have unsaved changes.\" : \"You’re all up to date.\")}\n          </p>\n          <Button\n            type=\"submit\"\n            className=\"ml-auto h-10 shrink-0 rounded-md border border-primary bg-primary px-4 text-sm text-primary-foreground shadow-xs hover:bg-primary/90\"\n            disabled={saving || !dirty}\n          >\n            {saving ? \"Saving…\" : \"Save changes\"}\n          </Button>\n        </div>\n      </form>\n    </SectionCard>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/section-card.tsx",
      "type": "registry:component",
      "target": "components/overtrue/section-card.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport {\n  Card,\n  CardContent,\n  CardHeader,\n  CardTitle,\n  CardDescription,\n} from \"@/components/ui/card\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SectionCardProps extends Omit<\n  ComponentProps<typeof Card>,\n  \"title\"\n> {\n  title?: ReactNode;\n  description?: ReactNode;\n  actions?: ReactNode;\n  contentClassName?: string;\n}\n\n/** A shared heading, actions and content surface for admin panels. */\nexport function SectionCard({\n  title,\n  description,\n  actions,\n  children,\n  className,\n  contentClassName,\n  ...props\n}: SectionCardProps) {\n  return (\n    <Card\n      data-slot=\"section-card\"\n      className={cn(\n        \"min-w-0 gap-0 rounded-2xl border border-border/70 bg-card py-0 text-card-foreground ring-0\",\n        \"shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-12px_rgb(0_0_0/0.10)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.5)]\",\n        className,\n      )}\n      {...props}\n    >\n      {(title || description || actions) && (\n        <CardHeader className=\"flex flex-row flex-wrap items-center justify-between gap-x-4 gap-y-3 border-b border-border/60 px-5 py-4 [.border-b]:pb-4\">\n          <div data-slot=\"section-card-heading\" className=\"min-w-0 flex-1\">\n            {title && (\n              <CardTitle className=\"m-0 text-sm leading-6 font-semibold tracking-tight text-card-foreground\">\n                {title}\n              </CardTitle>\n            )}\n            {description && (\n              <CardDescription className=\"m-0 mt-0.5 text-[13px] leading-5 text-muted-foreground\">\n                {description}\n              </CardDescription>\n            )}\n          </div>\n          {actions && (\n            <div\n              data-slot=\"section-card-actions\"\n              className=\"flex shrink-0 items-center gap-2\"\n            >\n              {actions}\n            </div>\n          )}\n        </CardHeader>\n      )}\n      <CardContent className={cn(\"p-5\", contentClassName)}>\n        {children}\n      </CardContent>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/avatar-stack.tsx",
      "type": "registry:component",
      "target": "components/overtrue/avatar-stack.tsx",
      "content": "\"use client\";\nimport { useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\nexport interface TeamMember {\n  id: string;\n  name: string;\n  image?: string;\n}\n\n// Initials take a stable tint from the theme's chart palette.\nconst tints = [\n  \"[--avatar-tint:var(--color-chart-1)]\",\n  \"[--avatar-tint:var(--color-chart-2)]\",\n  \"[--avatar-tint:var(--color-chart-3)]\",\n  \"[--avatar-tint:var(--color-chart-4)]\",\n  \"[--avatar-tint:var(--color-chart-5)]\",\n];\nfunction tintFor(key: string) {\n  let hash = 0;\n  for (const char of key) hash = (hash * 31 + char.charCodeAt(0)) >>> 0;\n  return tints[hash % tints.length];\n}\n\nexport function AvatarStack({\n  members,\n  max = 4,\n  className,\n}: {\n  members: TeamMember[];\n  max?: number;\n  className?: string;\n}) {\n  const visible = members.slice(0, Math.max(0, max));\n  return (\n    <div\n      data-slot=\"avatar-stack\"\n      className={cn(\"flex items-center -space-x-2\", className)}\n      aria-label={members.map((member) => member.name).join(\", \")}\n    >\n      {visible.map((member) => (\n        <MemberAvatar key={member.id} member={member} />\n      ))}\n      {members.length > visible.length && (\n        <span\n          data-slot=\"avatar-stack-more\"\n          className=\"relative flex size-9 shrink-0 items-center justify-center rounded-full border-2 border-background bg-muted text-xs font-medium tracking-tight text-muted-foreground tabular-nums shadow-[0_1px_2px_rgb(0_0_0/0.06)]\"\n        >\n          +{members.length - visible.length}\n        </span>\n      )}\n    </div>\n  );\n}\n\nfunction MemberAvatar({ member }: { member: TeamMember }) {\n  const [failedImage, setFailedImage] = useState<string>();\n  const initials = member.name\n    .trim()\n    .split(/\\s+/)\n    .map((word) => word[0])\n    .slice(0, 2)\n    .join(\"\")\n    .toUpperCase();\n  const showImage = member.image && member.image !== failedImage;\n  return (\n    <span\n      role=\"img\"\n      aria-label={member.name}\n      title={member.name}\n      data-slot=\"avatar-stack-item\"\n      className={cn(\n        \"relative flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full border-2 border-background text-xs font-semibold tracking-tight shadow-[0_1px_2px_rgb(0_0_0/0.06)] transition-transform duration-150 ease-[cubic-bezier(0.22,1,0.36,1)] hover:z-10 hover:-translate-y-0.5 motion-reduce:transition-none motion-reduce:hover:translate-y-0\",\n        \"after:pointer-events-none after:absolute after:inset-0 after:rounded-full after:ring-1 after:ring-foreground/10 after:ring-inset\",\n        showImage\n          ? \"bg-muted\"\n          : cn(\n              tintFor(member.id || member.name),\n              \"bg-[color-mix(in_oklab,var(--avatar-tint)_16%,var(--color-card))] text-[color-mix(in_oklab,var(--avatar-tint)_72%,var(--color-foreground))]\",\n            ),\n      )}\n    >\n      {showImage ? (\n        <img\n          src={member.image}\n          alt=\"\"\n          className=\"size-full object-cover\"\n          onError={() => setFailedImage(member.image)}\n        />\n      ) : (\n        initials || \"?\"\n      )}\n    </span>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/analytics-overview.tsx",
      "type": "registry:component",
      "target": "components/overtrue/analytics-overview.tsx",
      "content": "\"use client\";\nimport { useId, useState } from \"react\";\nimport {\n  IconArrowDownRight,\n  IconArrowUpRight,\n  IconDownload,\n  IconChevronDown,\n  IconEye,\n  IconTarget,\n  IconUserPlus,\n} from \"@tabler/icons-react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Card, CardContent, CardHeader, CardTitle } from \"@/components/ui/card\";\nimport { PageHeader } from \"./page-header\";\nimport { StatCard } from \"./stat-card\";\nimport { MetricChart, type MetricPoint } from \"./metric-chart\";\nimport { RankedList, type RankedListItem } from \"./ranked-list\";\nimport { ConversionFunnel, type FunnelStage } from \"./conversion-funnel\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface AnalyticsReport {\n  id: string;\n  label: string;\n  description: string;\n  traffic: MetricPoint[];\n  sources: RankedListItem[];\n  /** Ordered from sessions to conversions; the first stage should match traffic. */\n  stages: FunnelStage[];\n  previousConversions: number;\n}\n\nexport const analyticsReports: AnalyticsReport[] = [\n  {\n    id: \"30-days\",\n    label: \"Last 30 days\",\n    description: \"August 23 – September 21, 2026\",\n    traffic: [\n      { label: \"Aug 23\", value: 4280, previous: 3840 },\n      { label: \"Aug 28\", value: 5120, previous: 4480 },\n      { label: \"Sep 2\", value: 4680, previous: 4120 },\n      { label: \"Sep 7\", value: 5640, previous: 4920 },\n      { label: \"Sep 12\", value: 6240, previous: 5280 },\n      { label: \"Sep 17\", value: 6840, previous: 5860 },\n    ],\n    sources: [\n      { id: \"search\", label: \"Organic search\", value: 14432 },\n      { id: \"direct\", label: \"Direct\", value: 8200 },\n      { id: \"referral\", label: \"Referrals\", value: 5576 },\n      { id: \"social\", label: \"Social\", value: 3280 },\n      { id: \"email\", label: \"Email\", value: 1312 },\n    ],\n    stages: [\n      { id: \"sessions\", label: \"Sessions\", value: 32800 },\n      { id: \"pricing\", label: \"Viewed pricing\", value: 8200 },\n      { id: \"trial\", label: \"Started a trial\", value: 1640 },\n      { id: \"subscribed\", label: \"Subscribed\", value: 492 },\n    ],\n    previousConversions: 342,\n  },\n  {\n    id: \"7-days\",\n    label: \"Last 7 days\",\n    description: \"September 15 – 21, 2026\",\n    traffic: [\n      { label: \"Tue\", value: 980, previous: 860 },\n      { label: \"Wed\", value: 1120, previous: 940 },\n      { label: \"Thu\", value: 1050, previous: 1080 },\n      { label: \"Fri\", value: 1360, previous: 1120 },\n      { label: \"Sat\", value: 1240, previous: 1060 },\n      { label: \"Sun\", value: 1480, previous: 1260 },\n      { label: \"Mon\", value: 1570, previous: 1380 },\n    ],\n    sources: [\n      { id: \"search\", label: \"Organic search\", value: 3784 },\n      { id: \"direct\", label: \"Direct\", value: 2200 },\n      { id: \"referral\", label: \"Referrals\", value: 1584 },\n      { id: \"social\", label: \"Social\", value: 880 },\n      { id: \"email\", label: \"Email\", value: 352 },\n    ],\n    stages: [\n      { id: \"sessions\", label: \"Sessions\", value: 8800 },\n      { id: \"pricing\", label: \"Viewed pricing\", value: 2376 },\n      { id: \"trial\", label: \"Started a trial\", value: 528 },\n      { id: \"subscribed\", label: \"Subscribed\", value: 176 },\n    ],\n    previousConversions: 139,\n  },\n];\n\nconst sum = (values: number[]) =>\n  values.reduce(\n    (total, value) => total + (Number.isFinite(value) ? Math.max(0, value) : 0),\n    0,\n  );\nfunction comparison(current: number, previous: number) {\n  const delta =\n    previous > 0 ? ((current - previous) / previous) * 100 : undefined;\n  return {\n    change: delta === undefined ? undefined : `${Math.abs(delta).toFixed(1)}%`,\n    trend:\n      delta === undefined || delta === 0\n        ? (\"neutral\" as const)\n        : delta > 0\n          ? (\"up\" as const)\n          : (\"down\" as const),\n  };\n}\n\n/** A complete demo by default; pass reports from your own analytics endpoint. */\nexport function AnalyticsOverview({\n  reports = analyticsReports,\n  className,\n}: {\n  reports?: AnalyticsReport[];\n  className?: string;\n}) {\n  const periodId = useId();\n  const [selected, setSelected] = useState(reports[0]?.id);\n  const report = reports.find((item) => item.id === selected) ?? reports[0];\n  const sessions = sum(report?.traffic.map((point) => point.value) ?? []);\n  const previousSessions = sum(\n    report?.traffic.map((point) => point.previous ?? 0) ?? [],\n  );\n  const conversions = sum([report?.stages.at(-1)?.value ?? 0]);\n  const previousConversions = sum([report?.previousConversions ?? 0]);\n  const conversion = sessions ? (conversions / sessions) * 100 : 0;\n  const previousConversion = previousSessions\n    ? (previousConversions / previousSessions) * 100\n    : 0;\n  const hasComparison = Boolean(\n    report?.traffic.length &&\n    report.traffic.every((point) => Number.isFinite(point.previous)),\n  );\n  const improved = conversion >= previousConversion;\n  const TrendIcon = improved ? IconArrowUpRight : IconArrowDownRight;\n\n  function exportReport() {\n    if (!report) return;\n    const rows = [\n      [\"Section\", \"Label\", \"Current\", \"Previous\"],\n      ...report.traffic.map((point) => [\n        \"Traffic\",\n        point.label,\n        point.value,\n        point.previous ?? \"\",\n      ]),\n      ...report.sources.map((source) => [\n        \"Source\",\n        source.label,\n        source.value,\n        \"\",\n      ]),\n      ...report.stages.map((stage) => [\"Funnel\", stage.label, stage.value, \"\"]),\n    ];\n    const csv = rows\n      .map((row) =>\n        row\n          .map((value) => {\n            const text = String(value);\n            return `\"${(/^[=+\\-@\\t\\r]/.test(text) ? \"'\" + text : text).replaceAll('\"', '\"\"')}\"`;\n          })\n          .join(\",\"),\n      )\n      .join(\"\\r\\n\");\n    const url = URL.createObjectURL(\n      new Blob([csv], { type: \"text/csv;charset=utf-8\" }),\n    );\n    const link = document.createElement(\"a\");\n    link.href = url;\n    link.download = \"analytics-report.csv\";\n    link.click();\n    setTimeout(() => URL.revokeObjectURL(url), 1000);\n  }\n\n  return (\n    <section\n      data-slot=\"analytics-overview\"\n      aria-label=\"Acquisition analytics\"\n      className={cn(\n        \"@container min-w-0 space-y-5 text-foreground\",\n        className,\n      )}\n    >\n      <PageHeader\n        eyebrow=\"Analytics\"\n        title=\"Acquisition overview\"\n        description={\n          report?.description ?? \"Connect your analytics to get started.\"\n        }\n        actions={\n          <>\n            <label className=\"sr-only\" htmlFor={periodId}>\n              Analytics period\n            </label>\n            <div className=\"relative\">\n              <select\n                id={periodId}\n                value={report?.id ?? \"\"}\n                disabled={!reports.length}\n                onChange={(event) => setSelected(event.target.value)}\n                className=\"h-8 max-w-full appearance-none rounded-md border bg-card py-0 pl-3 pr-8 text-xs font-medium leading-8 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\"\n              >\n                {!reports.length && <option value=\"\">No reports</option>}\n                {reports.map((item) => (\n                  <option key={item.id} value={item.id}>\n                    {item.label}\n                  </option>\n                ))}\n              </select>\n              <IconChevronDown\n                aria-hidden=\"true\"\n                className=\"pointer-events-none absolute top-1/2 right-2.5 size-3.5 -translate-y-1/2 text-muted-foreground\"\n                stroke={1.7}\n              />\n            </div>\n            <Button\n              size=\"sm\"\n              variant=\"outline\"\n              className=\"h-8 px-3 text-xs font-medium shadow-none\"\n              disabled={!report}\n              onClick={exportReport}\n            >\n              <IconDownload aria-hidden=\"true\" className=\"size-3.5\" />\n              Export\n            </Button>\n          </>\n        }\n      />\n      <div className=\"grid gap-4 @min-[36rem]:grid-cols-3\">\n        <StatCard\n          title=\"Sessions\"\n          value={sessions}\n          icon={<IconEye />}\n          {...comparison(sessions, hasComparison ? previousSessions : 0)}\n          description={\n            hasComparison && previousSessions\n              ? \"vs. previous period\"\n              : \"No previous comparison\"\n          }\n        />\n        <StatCard\n          title=\"New subscriptions\"\n          value={conversions}\n          icon={<IconUserPlus />}\n          {...comparison(conversions, hasComparison ? previousConversions : 0)}\n          description={\n            hasComparison && previousConversions\n              ? \"vs. previous period\"\n              : \"No previous comparison\"\n          }\n        />\n        <StatCard\n          title=\"Conversion rate\"\n          value={sessions ? `${conversion.toFixed(2)}%` : \"—\"}\n          icon={<IconTarget />}\n          {...comparison(conversion, hasComparison ? previousConversion : 0)}\n          description={\n            hasComparison && previousConversion\n              ? \"vs. previous period\"\n              : \"Subscriptions / sessions\"\n          }\n        />\n      </div>\n      <MetricChart\n        title=\"Traffic over time\"\n        seriesLabel=\"Sessions\"\n        comparisonLabel=\"Previous period\"\n        description={\n          report?.label === \"Last 30 days\"\n            ? \"Sessions grouped into five-day intervals\"\n            : report?.label\n        }\n        data={report?.traffic ?? []}\n        height={250}\n      />\n      <div className=\"grid gap-4 @min-[42rem]:grid-cols-2\">\n        <Card className=\"min-w-0 gap-0 rounded-lg bg-card py-0 shadow-none\">\n          <CardHeader className=\"flex flex-col items-start gap-1 border-b px-5 py-4 [.border-b]:pb-4\">\n            <CardTitle className=\"text-sm font-semibold\">\n              Acquisition sources\n            </CardTitle>\n            <p className=\"mt-1 text-xs text-muted-foreground\">\n              Sessions and share of tracked traffic\n            </p>\n          </CardHeader>\n          <CardContent className=\"p-5\">\n            <RankedList\n              label=\"Acquisition sources\"\n              items={report?.sources ?? []}\n            />\n            <p className=\"mt-4 text-xs leading-5 text-muted-foreground\">\n              {report?.sources.length\n                ? `Tracked across ${report.sources.length} acquisition channels.`\n                : \"Sources will appear when traffic is recorded.\"}\n            </p>\n          </CardContent>\n        </Card>\n        <Card className=\"min-w-0 gap-0 rounded-lg bg-card py-0 shadow-none\">\n          <CardHeader className=\"flex flex-col items-start gap-1 border-b px-5 py-4 [.border-b]:pb-4\">\n            <CardTitle className=\"text-sm font-semibold\">\n              From visit to subscription\n            </CardTitle>\n            <p className=\"mt-1 text-xs text-muted-foreground\">\n              Follow the journey through each step\n            </p>\n          </CardHeader>\n          <CardContent className=\"p-5\">\n            <ConversionFunnel\n              label=\"Subscription conversion\"\n              stages={report?.stages ?? []}\n            />\n          </CardContent>\n        </Card>\n      </div>\n      {sessions > 0 && hasComparison && previousSessions > 0 && (\n        <div className=\"flex items-start gap-3 rounded-lg border bg-card px-4 py-3 text-sm\">\n          <TrendIcon\n            aria-hidden=\"true\"\n            className={cn(\n              \"mt-0.5 size-4 shrink-0\",\n              improved\n                ? \"text-emerald-700 dark:text-emerald-400\"\n                : \"text-destructive\",\n            )}\n          />\n          <p className=\"m-0 leading-6 text-muted-foreground\">\n            <span className=\"font-medium text-foreground\">\n              {conversion === previousConversion\n                ? \"Conversion is steady.\"\n                : improved\n                  ? \"Conversion is improving.\"\n                  : \"Conversion needs attention.\"}\n            </span>{\" \"}\n            {conversions.toLocaleString(\"en-US\")} sessions became subscriptions,\n            a {conversion.toFixed(2)}% conversion rate\n            {conversion === previousConversion\n              ? \".\"\n              : ` — ${Math.abs(conversion - previousConversion).toFixed(2)} percentage points ${improved ? \"above\" : \"below\"} the previous period.`}\n          </p>\n        </div>\n      )}\n    </section>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/page-header.tsx",
      "type": "registry:component",
      "target": "components/overtrue/page-header.tsx",
      "content": "import type { ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport function PageHeader({\n  eyebrow,\n  title,\n  description,\n  actions,\n  className,\n}: {\n  eyebrow?: string;\n  title: string;\n  description?: string;\n  actions?: ReactNode;\n  className?: string;\n}) {\n  return (\n    <header\n      data-slot=\"page-header\"\n      className={cn(\n        \"flex flex-wrap items-end justify-between gap-x-6 gap-y-4\",\n        className,\n      )}\n    >\n      <div\n        data-slot=\"page-header-heading\"\n        className=\"min-w-0 transition-[opacity,translate] duration-700 ease-[cubic-bezier(0.22,1,0.36,1)] motion-safe:starting:translate-y-1 motion-safe:starting:opacity-0 motion-reduce:transition-none\"\n      >\n        {eyebrow && (\n          <p\n            data-slot=\"page-header-eyebrow\"\n            className=\"m-0 mb-2 flex items-center gap-2 text-[13px] leading-5 font-medium text-muted-foreground\"\n          >\n            <span\n              aria-hidden=\"true\"\n              className=\"size-1.5 shrink-0 rounded-full bg-primary shadow-[0_0_0_3px_color-mix(in_oklab,var(--color-primary)_16%,transparent)] dark:shadow-[0_0_0_3px_color-mix(in_oklab,var(--color-primary)_22%,transparent),0_0_10px_color-mix(in_oklab,var(--color-primary)_60%,transparent)]\"\n            />\n            {eyebrow}\n          </p>\n        )}\n        <h1 className=\"m-0 text-2xl leading-8 font-semibold tracking-[-0.025em] text-balance text-foreground\">\n          {title}\n        </h1>\n        {description && (\n          <p className=\"m-0 mt-1.5 max-w-3xl text-sm leading-6 text-pretty text-muted-foreground\">\n            {description}\n          </p>\n        )}\n      </div>\n      {actions && (\n        <div\n          data-slot=\"page-header-actions\"\n          className=\"flex flex-wrap items-center gap-2\"\n        >\n          {actions}\n        </div>\n      )}\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/stat-card.tsx",
      "type": "registry:component",
      "target": "components/overtrue/stat-card.tsx",
      "content": "\"use client\";\nimport type { ReactNode } from \"react\";\nimport {\n  IconArrowDownRight as ArrowDownRight,\n  IconArrowUpRight as ArrowUpRight,\n  IconMinus as Minus,\n} from \"@tabler/icons-react\";\nimport { Card, CardContent } from \"@/components/ui/card\";\nimport { cn } from \"@/lib/utils\";\nimport { Sparkline } from \"./sparkline\";\n\nexport interface StatCardProps {\n  title: string;\n  value: string | number;\n  change?: string;\n  trend?: \"up\" | \"down\" | \"neutral\";\n  /** A decrease is positive for metrics such as latency or churn. */\n  positiveTrend?: \"up\" | \"down\";\n  sparkline?: number[];\n  icon?: ReactNode;\n  description?: string;\n  className?: string;\n}\n\n// Currency symbols and units sit quieter than the digits; \"Q3 2026\" stays untouched.\nconst quiet = \"font-medium tracking-normal text-current/50\";\nconst unitSize = \"text-[0.6em]\";\nconst symbolSize = \"mr-[0.04em] text-[0.62em] align-[0.4em]\";\nfunction typeset(text: string) {\n  const match =\n    /^([+\\-−]?)([^\\d\\s+\\-−]{0,3})(\\d(?:[\\d.,  ]*\\d)?[KkMBT]?)(%|\\s+\\S.*)?$/.exec(\n      text,\n    );\n  if (!match || /[a-z]/i.test(match[2].replace(/[A-Z]{1,2}(?=\\$)/, \"\")))\n    return text;\n  const [, sign, symbol, digits, unit] = match;\n  return (\n    <>\n      {sign}\n      {symbol ? <span className={cn(quiet, symbolSize)}>{symbol}</span> : null}\n      {digits}\n      {unit ? <span className={cn(quiet, unitSize)}>{unit}</span> : null}\n    </>\n  );\n}\n\n// Same tones as DeltaBadge, so a change reads the same everywhere.\nconst toneText = {\n  positive: \"text-emerald-700 dark:text-emerald-400\",\n  negative: \"text-rose-700 dark:text-rose-400\",\n  neutral: \"text-muted-foreground\",\n};\nconst tonePill = {\n  positive: \"bg-emerald-500/10 dark:bg-emerald-400/10\",\n  negative: \"bg-rose-500/10 dark:bg-rose-400/10\",\n  neutral: \"bg-muted\",\n};\nconst toneLine = {\n  positive: \"text-emerald-600 dark:text-emerald-400\",\n  negative: \"text-rose-600 dark:text-rose-400\",\n  neutral: \"text-muted-foreground\",\n};\n\nexport function StatCard({\n  title,\n  value,\n  change,\n  trend = \"neutral\",\n  positiveTrend = \"up\",\n  sparkline,\n  icon,\n  description,\n  className,\n}: StatCardProps) {\n  const Icon =\n    trend === \"up\" ? ArrowUpRight : trend === \"down\" ? ArrowDownRight : Minus;\n  const tone =\n    trend === \"neutral\"\n      ? \"neutral\"\n      : trend === positiveTrend\n        ? \"positive\"\n        : \"negative\";\n  return (\n    <Card\n      data-slot=\"stat-card\"\n      data-trend={trend}\n      data-tone={tone}\n      className={cn(\n        \"min-w-0 gap-0 rounded-2xl border border-border/70 bg-card py-0 text-card-foreground ring-0 shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-12px_rgb(0_0_0/0.10)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.5)]\",\n        className,\n      )}\n    >\n      <CardContent className=\"p-5\">\n        <p\n          data-slot=\"stat-card-title\"\n          className=\"flex min-h-7 items-center justify-between gap-3 text-sm leading-5 font-medium text-muted-foreground\"\n        >\n          {title}\n          {icon && (\n            <span\n              aria-hidden=\"true\"\n              className=\"grid size-7 shrink-0 place-items-center rounded-lg bg-muted/60 text-muted-foreground ring-1 ring-border/60 ring-inset [&>svg]:size-4\"\n            >\n              {icon}\n            </span>\n          )}\n        </p>\n        <p\n          data-slot=\"stat-card-value\"\n          className=\"mt-2 text-3xl leading-9 font-semibold tracking-[-0.035em] wrap-anywhere text-card-foreground tabular-nums\"\n        >\n          {typeset(\n            typeof value === \"number\" ? value.toLocaleString(\"en-US\") : value,\n          )}\n        </p>\n        {sparkline && (\n          <Sparkline\n            data={sparkline}\n            label={`${title} trend`}\n            className={cn(\"mt-4\", toneLine[tone])}\n          />\n        )}\n        {(change || description) && (\n          <div className=\"mt-3 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs\">\n            {change && (\n              <span\n                data-slot=\"stat-card-change\"\n                className={cn(\n                  \"inline-flex h-5 items-center gap-0.5 rounded-full pr-1.5 pl-1 leading-none font-medium tracking-[-0.01em] tabular-nums\",\n                  toneText[tone],\n                  tonePill[tone],\n                )}\n              >\n                <Icon\n                  className=\"size-3 shrink-0\"\n                  aria-hidden=\"true\"\n                  stroke={2.5}\n                />\n                <span className=\"sr-only\">\n                  {trend === \"up\"\n                    ? \"Increase\"\n                    : trend === \"down\"\n                      ? \"Decrease\"\n                      : \"No change\"}\n                  {tone !== \"neutral\" ? ` (${tone})` : \"\"}:{\" \"}\n                </span>\n                {change}\n              </span>\n            )}\n            <span className=\"text-muted-foreground\">\n              {description ?? \"vs. last month\"}\n            </span>\n          </div>\n        )}\n      </CardContent>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/sparkline.tsx",
      "type": "registry:component",
      "target": "components/overtrue/sparkline.tsx",
      "content": "\"use client\";\nimport { useId, type CSSProperties } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SparklineProps {\n  data: number[];\n  label: string;\n  className?: string;\n  filled?: boolean;\n  /** Mark the most recent value. */\n  endpoint?: boolean;\n  /** Any CSS color. Defaults to the current text color, which is primary. */\n  color?: string;\n  /** Draw the line in and raise the area when the sparkline mounts. Skipped under reduced motion. */\n  animate?: boolean;\n}\n\nconst WIDTH = 240;\nconst HEIGHT = 48;\nconst PAD_X = 3;\nconst PAD_Y = 5;\nconst EASE = \"ease-[cubic-bezier(0.22,1,0.36,1)]\";\n\n/** Monotone cubic path: smooth, but never overshoots the data. */\nfunction monotonePath(points: [number, number][]) {\n  const n = points.length;\n  if (n < 2) return \"\";\n  const dx: number[] = [];\n  const slope: number[] = [];\n  for (let i = 0; i < n - 1; i++) {\n    dx.push(points[i + 1][0] - points[i][0]);\n    slope.push((points[i + 1][1] - points[i][1]) / dx[i]);\n  }\n  const tangent = [slope[0]];\n  for (let i = 1; i < n - 1; i++) {\n    tangent.push(\n      slope[i - 1] * slope[i] <= 0 ? 0 : (slope[i - 1] + slope[i]) / 2,\n    );\n  }\n  tangent.push(slope[n - 2]);\n  for (let i = 0; i < n - 1; i++) {\n    if (slope[i] === 0) {\n      tangent[i] = tangent[i + 1] = 0;\n      continue;\n    }\n    const a = tangent[i] / slope[i];\n    const b = tangent[i + 1] / slope[i];\n    const h = a * a + b * b;\n    if (h > 9) {\n      const t = 3 / Math.sqrt(h);\n      tangent[i] = t * a * slope[i];\n      tangent[i + 1] = t * b * slope[i];\n    }\n  }\n  const r = (value: number) => Math.round(value * 100) / 100;\n  let d = `M${r(points[0][0])},${r(points[0][1])}`;\n  for (let i = 0; i < n - 1; i++) {\n    const [x0, y0] = points[i];\n    const [x1, y1] = points[i + 1];\n    const h = dx[i] / 3;\n    d += `C${r(x0 + h)},${r(y0 + tangent[i] * h)} ${r(x1 - h)},${r(y1 - tangent[i + 1] * h)} ${r(x1)},${r(y1)}`;\n  }\n  return d;\n}\n\n/** A compact overview. Use a full chart when individual values need inspection. */\nexport function Sparkline({\n  data,\n  label,\n  className,\n  filled = true,\n  endpoint = true,\n  color,\n  animate = true,\n}: SparklineProps) {\n  const gradient = `sparkline-${useId().replace(/:/g, \"\")}`;\n  const values = data.filter(Number.isFinite);\n  let low = Infinity,\n    high = -Infinity;\n  for (const value of values) {\n    low = Math.min(low, value);\n    high = Math.max(high, value);\n  }\n  const points = values.map((value, i): [number, number] => [\n    values.length > 1\n      ? PAD_X + (i / (values.length - 1)) * (WIDTH - PAD_X * 2)\n      : WIDTH / 2,\n    high === low\n      ? HEIGHT / 2\n      : HEIGHT - PAD_Y - ((value - low) / (high - low)) * (HEIGHT - PAD_Y * 2),\n  ]);\n  const line = monotonePath(points);\n  const last = points[points.length - 1];\n  const lastValue = values[values.length - 1];\n  const motion = animate ? \"motion-reduce:transition-none\" : \"transition-none\";\n  return (\n    <div\n      data-slot=\"sparkline\"\n      role=\"img\"\n      aria-label={`${label}: ${values.length ? values.join(\", \") : \"No data\"}`}\n      className={cn(\"relative h-12 w-full text-primary\", className)}\n      style={color ? { color } : undefined}\n    >\n      {values.length > 1 && filled && (\n        <svg\n          viewBox={`0 0 ${WIDTH} ${HEIGHT}`}\n          preserveAspectRatio=\"none\"\n          aria-hidden=\"true\"\n          data-slot=\"sparkline-area\"\n          className={cn(\n            \"absolute inset-0 size-full origin-bottom overflow-visible transition-[opacity,scale] delay-75 duration-700\",\n            EASE,\n            animate && \"starting:scale-y-0 starting:opacity-0\",\n            motion,\n          )}\n        >\n          <defs>\n            <linearGradient id={gradient} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n              <stop offset=\"0%\" stopColor=\"currentColor\" stopOpacity=\"0.28\" />\n              <stop offset=\"100%\" stopColor=\"currentColor\" stopOpacity=\"0\" />\n            </linearGradient>\n          </defs>\n          <path\n            d={`${line}L${last[0]},${HEIGHT}L${points[0][0]},${HEIGHT}Z`}\n            fill={`url(#${gradient})`}\n            className={cn(\"transition-[d] duration-500\", EASE, motion)}\n          />\n        </svg>\n      )}\n      <svg\n        viewBox={`0 0 ${WIDTH} ${HEIGHT}`}\n        preserveAspectRatio=\"none\"\n        aria-hidden=\"true\"\n        data-slot=\"sparkline-line\"\n        className={cn(\n          // The line wipes in from the left; the inset leaves room for its glow.\n          \"absolute inset-0 size-full overflow-visible [clip-path:inset(-60%_-8%_-60%_-8%)] transition-[clip-path] duration-700\",\n          EASE,\n          animate &&\n            values.length > 1 &&\n            \"starting:[clip-path:inset(-60%_100%_-60%_-8%)]\",\n          motion,\n        )}\n      >\n        {values.length > 1 ? (\n          <path\n            d={line}\n            fill=\"none\"\n            stroke=\"currentColor\"\n            strokeWidth=\"2\"\n            strokeLinejoin=\"round\"\n            strokeLinecap=\"round\"\n            vectorEffect=\"non-scaling-stroke\"\n            className={cn(\n              \"transition-[d] duration-500 dark:[filter:drop-shadow(0_0_6px_color-mix(in_oklab,currentColor_50%,transparent))]\",\n              EASE,\n              motion,\n            )}\n          />\n        ) : values.length === 0 ? (\n          <path\n            d={`M${PAD_X} ${HEIGHT / 2}H${WIDTH - PAD_X}`}\n            stroke=\"currentColor\"\n            strokeDasharray=\"2 5\"\n            strokeLinecap=\"round\"\n            opacity=\"0.3\"\n            vectorEffect=\"non-scaling-stroke\"\n          />\n        ) : null}\n      </svg>\n      {/* Drawn in HTML so the marker stays round when the line stretches. */}\n      {endpoint && last && (\n        <span\n          aria-hidden=\"true\"\n          data-slot=\"sparkline-endpoint\"\n          className={cn(\n            // Moves with the line, and on mount appears once the line has drawn in.\n            \"absolute -translate-x-1/2 -translate-y-1/2 [transition:left_500ms_cubic-bezier(0.22,1,0.36,1),top_500ms_cubic-bezier(0.22,1,0.36,1),opacity_300ms_ease-out_550ms,scale_500ms_cubic-bezier(0.22,1,0.36,1)_550ms]\",\n            animate && \"starting:scale-0 starting:opacity-0\",\n            motion,\n          )}\n          style={\n            {\n              left: `${(last[0] / WIDTH) * 100}%`,\n              top: `${(last[1] / HEIGHT) * 100}%`,\n            } as CSSProperties\n          }\n        >\n          {/* Pulses once whenever the latest value changes. */}\n          <span\n            key={lastValue}\n            className={cn(\n              \"absolute inset-0 scale-[3.2] rounded-full bg-current opacity-0 transition-[opacity,scale] duration-1000 ease-out starting:scale-100 starting:opacity-40 motion-reduce:hidden\",\n              !animate && \"hidden\",\n            )}\n          />\n          <span className=\"relative block size-2 rounded-full border-[1.5px] border-card bg-current shadow-[0_0_0_3px_color-mix(in_oklab,currentColor_18%,transparent)] dark:shadow-[0_0_0_3px_color-mix(in_oklab,currentColor_24%,transparent),0_0_12px_1px_color-mix(in_oklab,currentColor_70%,transparent)]\" />\n        </span>\n      )}\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/ranked-list.tsx",
      "type": "registry:component",
      "target": "components/overtrue/ranked-list.tsx",
      "content": "import type { CSSProperties, ReactNode } from \"react\";\nimport { IconArrowUpRight } from \"@tabler/icons-react\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface RankedListItem {\n  id: string;\n  label: string;\n  value: number;\n  icon?: ReactNode;\n  href?: string;\n}\nexport interface RankedListProps {\n  items: RankedListItem[];\n  label: string;\n  formatValue?: (value: number) => string;\n  emptyMessage?: string;\n  className?: string;\n  /** Any CSS color for the bars. Defaults to the primary color. */\n  color?: string;\n  /** Show each row's rank before its label. */\n  showRank?: boolean;\n}\n\n/**\n * A sorted list of labelled values with a proportional bar behind each row, the value,\n * and its share of the total. Hovering a row brings its bar forward and quiets the rest.\n */\nexport function RankedList({\n  items,\n  label,\n  formatValue = (value) => value.toLocaleString(\"en-US\"),\n  emptyMessage = \"No results for this period.\",\n  className,\n  color = \"var(--color-primary)\",\n  showRank = false,\n}: RankedListProps) {\n  const rows = items\n    .map((item) => ({\n      ...item,\n      value: Number.isFinite(item.value) ? Math.max(0, item.value) : 0,\n    }))\n    .sort((a, b) => b.value - a.value);\n  const max = rows[0]?.value ?? 0;\n  const total = rows.reduce((sum, item) => sum + item.value, 0);\n  return (\n    <ol\n      data-slot=\"ranked-list\"\n      aria-label={label}\n      className={cn(\n        \"@container/ranking m-0 list-none space-y-2 p-0\",\n        // While one row is hovered, the other bars step back.\n        \"[&:has(>li:hover)>li:not(:hover)_[data-slot=ranked-list-bar]]:opacity-45\",\n        className,\n      )}\n      style={{ \"--ranked-list-color\": color } as CSSProperties}\n    >\n      <style href=\"overtrue-ranked-list\" precedence=\"default\">\n        {`@keyframes ranked-list-grow{from{transform:scaleX(0)}}`}\n      </style>\n      {!rows.length && (\n        <li className=\"py-8 text-center text-sm text-muted-foreground\">\n          {emptyMessage}\n        </li>\n      )}\n      {rows.map((item, index) => {\n        const width = max ? (item.value / max) * 100 : 0;\n        const content = (\n          <>\n            <span\n              aria-hidden=\"true\"\n              data-slot=\"ranked-list-bar\"\n              className={cn(\n                \"pointer-events-none absolute inset-y-0 left-0 origin-left rounded-lg\",\n                // The fill deepens toward its end, so its length reads without a hard rule through the label.\n                \"bg-[linear-gradient(to_right,color-mix(in_oklab,var(--ranked-list-color)_8%,transparent),color-mix(in_oklab,var(--ranked-list-color)_22%,transparent))]\",\n                \"shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--ranked-list-color)_7%,transparent)]\",\n                \"dark:bg-[linear-gradient(to_right,color-mix(in_oklab,var(--ranked-list-color)_8%,transparent),color-mix(in_oklab,var(--ranked-list-color)_28%,transparent))]\",\n                \"dark:shadow-[inset_0_0_0_1px_color-mix(in_oklab,var(--ranked-list-color)_10%,transparent),inset_0_1px_0_rgb(255_255_255/0.05)]\",\n                \"transition-[width,opacity,filter] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover/row:brightness-[1.06] group-hover/row:saturate-150 motion-reduce:transition-none\",\n                \"motion-safe:animate-[ranked-list-grow_700ms_cubic-bezier(0.22,1,0.36,1)_backwards]\",\n              )}\n              style={{\n                width: `${width}%`,\n                animationDelay: `${index * 40}ms`,\n              }}\n            />\n            <span className=\"relative flex min-w-0 items-center gap-2\">\n              {showRank && (\n                <span\n                  aria-hidden=\"true\"\n                  className=\"w-5 shrink-0 text-xs text-muted-foreground tabular-nums\"\n                >\n                  {index + 1}\n                </span>\n              )}\n              {item.icon && (\n                <span\n                  aria-hidden=\"true\"\n                  className=\"shrink-0 text-muted-foreground transition-colors duration-150 group-hover/row:text-foreground motion-reduce:transition-none [&>svg]:size-4\"\n                >\n                  {item.icon}\n                </span>\n              )}\n              <span className=\"min-w-0 wrap-anywhere\">{item.label}</span>\n              {item.href && (\n                <IconArrowUpRight\n                  aria-hidden=\"true\"\n                  className=\"size-3.5 shrink-0 text-muted-foreground transition-[translate,color] duration-150 group-hover/row:translate-x-px group-hover/row:-translate-y-px group-hover/row:text-foreground motion-reduce:transition-none\"\n                />\n              )}\n            </span>\n            <span className=\"relative flex flex-wrap items-baseline justify-between gap-x-3 gap-y-0.5 text-right tabular-nums @min-[18rem]/ranking:justify-end\">\n              <span className=\"font-medium\">{formatValue(item.value)}</span>\n              <span className=\"w-12 text-right text-xs text-muted-foreground\">\n                {total ? `${((item.value / total) * 100).toFixed(1)}%` : \"—\"}\n                <span className=\"sr-only\"> of total</span>\n              </span>\n            </span>\n          </>\n        );\n        const rowClass =\n          \"group/row relative grid grid-cols-1 items-center gap-1.5 rounded-lg px-3 py-3 text-sm text-foreground transition-colors duration-150 hover:bg-muted/50 motion-reduce:transition-none @min-[18rem]/ranking:grid-cols-[minmax(0,1fr)_auto] @min-[18rem]/ranking:gap-3\";\n        return (\n          <li key={item.id}>\n            {item.href ? (\n              <a\n                href={item.href}\n                className={cn(\n                  rowClass,\n                  \"outline-none focus-visible:ring-2 focus-visible:ring-primary/30\",\n                )}\n              >\n                {content}\n              </a>\n            ) : (\n              <div className={rowClass}>{content}</div>\n            )}\n          </li>\n        );\n      })}\n    </ol>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/conversion-funnel.tsx",
      "type": "registry:component",
      "target": "components/overtrue/conversion-funnel.tsx",
      "content": "import { cn } from \"@/lib/utils\";\n\nexport interface FunnelStage {\n  id: string;\n  label: string;\n  value: number;\n}\nexport interface ConversionFunnelProps {\n  stages: FunnelStage[];\n  label: string;\n  formatValue?: (value: number) => string;\n  className?: string;\n}\n\nconst keyframes =\n  \"@keyframes conversion-funnel-grow{from{transform:scaleX(0)}to{transform:scaleX(1)}}\";\n\nexport function ConversionFunnel({\n  stages,\n  label,\n  formatValue = (value) => value.toLocaleString(\"en-US\"),\n  className,\n}: ConversionFunnelProps) {\n  const rows = stages.map((stage) => ({\n    ...stage,\n    value: Number.isFinite(stage.value) ? Math.max(0, stage.value) : 0,\n  }));\n  const first = rows[0]?.value ?? 0;\n  const maximum = rows.reduce((max, stage) => Math.max(max, stage.value), 0);\n  return (\n    <ol\n      data-slot=\"conversion-funnel\"\n      aria-label={label}\n      className={cn(\"m-0 list-none space-y-5 p-0\", className)}\n    >\n      <style href=\"overtrue-conversion-funnel\" precedence=\"default\">\n        {keyframes}\n      </style>\n      {!rows.length && (\n        <li className=\"py-8 text-center text-sm text-muted-foreground\">\n          No conversion data for this period.\n        </li>\n      )}\n      {rows.map((stage, index) => {\n        const previous = rows[index - 1]?.value;\n        const width = maximum ? (stage.value / maximum) * 100 : 0;\n        const previousWidth =\n          maximum && previous !== undefined ? (previous / maximum) * 100 : 0;\n        return (\n          <li key={stage.id} data-slot=\"conversion-funnel-stage\">\n            <div className=\"mb-2 flex flex-wrap items-baseline justify-between gap-x-4 gap-y-1 text-sm\">\n              <span className=\"min-w-0 wrap-anywhere text-foreground\">\n                <span className=\"mr-2 font-mono text-xs tabular-nums text-muted-foreground\">\n                  {String(index + 1).padStart(2, \"0\")}\n                </span>\n                {stage.label}\n              </span>\n              <span className=\"font-semibold tracking-[-0.01em] tabular-nums text-foreground\">\n                {formatValue(stage.value)}\n              </span>\n            </div>\n            <div\n              aria-hidden=\"true\"\n              data-slot=\"conversion-funnel-track\"\n              className=\"relative h-2 overflow-hidden rounded-full bg-muted\"\n            >\n              {previousWidth > width && (\n                <div\n                  data-slot=\"conversion-funnel-loss\"\n                  className=\"absolute inset-y-0 transition-[left,width] duration-500 motion-reduce:transition-none\"\n                  style={{\n                    left: `${width}%`,\n                    width: `${previousWidth - width}%`,\n                    backgroundImage:\n                      \"repeating-linear-gradient(-45deg, color-mix(in oklab, var(--color-primary) 24%, transparent) 0 1px, transparent 1px 4px)\",\n                  }}\n                />\n              )}\n              <div\n                data-slot=\"conversion-funnel-bar\"\n                className=\"relative h-full origin-left rounded-full transition-[width] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] motion-safe:animate-[conversion-funnel-grow_700ms_cubic-bezier(0.22,1,0.36,1)_both] motion-reduce:transition-none\"\n                style={{\n                  width: `${width}%`,\n                  opacity: 1 - Math.min(index, 4) * 0.1,\n                  backgroundImage:\n                    \"linear-gradient(90deg, color-mix(in oklab, var(--color-primary) 72%, transparent), var(--color-primary))\",\n                  animationDelay: `${Math.min(index, 8) * 60}ms`,\n                }}\n              />\n            </div>\n            <p className=\"mt-1.5 flex flex-wrap justify-between gap-x-3 text-xs tabular-nums text-muted-foreground\">\n              <span>\n                {first\n                  ? `${((stage.value / first) * 100).toFixed(1)}% of ${rows[0].label.toLowerCase()}`\n                  : \"Conversion unavailable\"}\n              </span>\n              {index > 0 && (\n                <span>\n                  {previous\n                    ? `${((stage.value / previous) * 100).toFixed(1)}% from previous`\n                    : \"No previous entries\"}\n                </span>\n              )}\n            </p>\n          </li>\n        );\n      })}\n    </ol>\n  );\n}\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/dashboard. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
