{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "dashboard-overview",
  "title": "Dashboard Overview",
  "description": "A product dashboard in three decisions: one number first, one large chart first, or the work list first with the numbers as one line.",
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils",
    "https://miseui.junsu4621.workers.dev/r/motion.json",
    "https://miseui.junsu4621.workers.dev/r/button.json",
    "https://miseui.junsu4621.workers.dev/r/chart.json",
    "https://miseui.junsu4621.workers.dev/r/data-table.json",
    "https://miseui.junsu4621.workers.dev/r/skeleton.json",
    "https://miseui.junsu4621.workers.dev/r/status.json",
    "https://miseui.junsu4621.workers.dev/r/tabs.json"
  ],
  "files": [
    {
      "path": "registry/miseui/blocks/dashboard-overview.tsx",
      "content": "import type * as React from \"react\"\nimport { ChartLine, LayoutDashboard, ReceiptText, Settings, Users } from \"lucide-react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Tabs, TabsContent } from \"@/registry/miseui/ui/tabs\"\nimport { AnalyticsBody, AnalyticsSkeleton } from \"./dashboard-overview-analytics\"\nimport { DashboardContent, OverviewBody } from \"./dashboard-overview-body\"\nimport {\n  DashboardRail,\n  type DashboardActivity,\n  type DashboardAttention,\n  type DashboardMetric,\n  type DashboardNavItem,\n  type DashboardRange,\n} from \"./dashboard-overview-parts\"\nimport { SAMPLE_ACTIVITY, SAMPLE_ATTENTION, SAMPLE_METRICS, SAMPLE_WORK } from \"./dashboard-overview-sample\"\nimport { RangeHeader, useRange } from \"./dashboard-overview-shell\"\nimport { DashboardSkeleton } from \"./dashboard-overview-states\"\nimport { WorkListBody, WorkListSkeleton, type DashboardWorkItem } from \"./dashboard-overview-table\"\n\ntype DashboardVariant = \"overview\" | \"analytics\" | \"table\"\n\nconst DEFAULT_NAV: readonly DashboardNavItem[] = [\n  { id: \"overview\", label: \"Overview\", icon: LayoutDashboard },\n  { id: \"customers\", label: \"Customers\", icon: Users },\n  { id: \"invoices\", label: \"Invoices\", icon: ReceiptText },\n  { id: \"reports\", label: \"Reports\", icon: ChartLine },\n  { id: \"settings\", label: \"Settings\", icon: Settings },\n]\n\ninterface DashboardOverviewProps extends Omit<React.ComponentProps<\"div\">, \"title\"> {\n  /** `overview` one number first, `analytics` one large chart first, `table` the work list first. Anything else is `overview`. */\n  variant?: DashboardVariant\n  /** The first is the number the page is about; up to three more sit in a quieter row. An empty list shows the empty state. */\n  metrics?: readonly DashboardMetric[]\n  activity?: readonly DashboardActivity[]\n  /** One thing that needs a person. Leave it out when nothing does. */\n  attention?: DashboardAttention\n  /** Shows the loading skeleton and locks the date range. */\n  pending?: boolean\n  /** Replaces the numbers with this message and a way to retry. */\n  error?: string\n  onRetry?: () => void\n  range?: DashboardRange\n  defaultRange?: DashboardRange\n  onRangeChange?: (range: DashboardRange) => void\n  product?: string\n  nav?: readonly DashboardNavItem[]\n  onNavigate?: (id: string) => void\n  emptyActionLabel?: string\n  onEmptyAction?: () => void\n  /** `table` only: the rows to work through. */\n  workItems?: readonly DashboardWorkItem[]\n  /** `table` only: heads the page and names the table. */\n  workTitle?: string\n  /** `table` only: fires with the row and whether it is now handled. */\n  onWorkAction?: (item: DashboardWorkItem, handled: boolean) => void\n}\n\nconst SKELETON: Readonly<Record<DashboardVariant, React.ReactNode>> = {\n  overview: <DashboardSkeleton />,\n  analytics: <AnalyticsSkeleton />,\n  table: <WorkListSkeleton />,\n}\n\ntype DashboardPanelProps = Pick<\n  DashboardOverviewProps,\n  \"metrics\" | \"activity\" | \"attention\" | \"error\" | \"onRetry\" | \"onEmptyAction\" | \"workItems\" | \"onWorkAction\"\n> & {\n  shape: DashboardVariant\n  range: DashboardRange\n  pending: boolean\n  emptyActionLabel: string\n  workTitle: string\n}\n\nfunction DashboardPanel({ shape, range, pending, error, onRetry, metrics, activity, attention, emptyActionLabel, onEmptyAction, workItems, workTitle, onWorkAction }: DashboardPanelProps) {\n  // Sample data only stands in when nothing real was passed, so it can never leak into a live dashboard.\n  const shownMetrics = metrics ?? SAMPLE_METRICS[range]\n  const content = {\n    metrics: shownMetrics,\n    activity: activity ?? (metrics ? [] : SAMPLE_ACTIVITY),\n    attention: attention ?? (metrics ? undefined : SAMPLE_ATTENTION),\n  }\n  return (\n    <DashboardContent\n      pending={pending}\n      error={error}\n      onRetry={onRetry}\n      empty={shownMetrics.length === 0}\n      emptyActionLabel={emptyActionLabel}\n      onEmptyAction={onEmptyAction}\n      skeleton={SKELETON[shape]}\n    >\n      {shape === \"analytics\" ? <AnalyticsBody {...content} /> : null}\n      {shape === \"overview\" ? <OverviewBody {...content} /> : null}\n      {/* The sample list is already the failed payments, so the sample attention item would only repeat it. */}\n      {shape === \"table\" ? <WorkListBody metrics={shownMetrics} items={workItems ?? (metrics ? [] : SAMPLE_WORK)} title={workTitle} attention={attention} onAction={onWorkAction} /> : null}\n    </DashboardContent>\n  )\n}\n\nfunction DashboardOverview({\n  variant,\n  metrics,\n  activity,\n  attention,\n  pending = false,\n  error,\n  onRetry,\n  range,\n  defaultRange = \"30d\",\n  onRangeChange,\n  product = \"Tallyroom\",\n  nav = DEFAULT_NAV,\n  onNavigate,\n  emptyActionLabel = \"Connect billing\",\n  onEmptyAction,\n  workItems,\n  workTitle = \"Payments to chase\",\n  onWorkAction,\n  className,\n  ...props\n}: DashboardOverviewProps) {\n  const [currentRange, selectRange] = useRange(range, defaultRange, onRangeChange)\n  const shape: DashboardVariant = variant === \"analytics\" || variant === \"table\" ? variant : \"overview\"\n  const panel = { shape, range: currentRange, pending, error, onRetry, metrics, activity, attention, emptyActionLabel, onEmptyAction, workItems, workTitle, onWorkAction }\n\n  return (\n    <div data-slot=\"dashboard-overview\" data-variant={shape} className={cn(\"@container w-full bg-muted dark:bg-background\", className)} {...props}>\n      <div className={cn(\"flex min-w-0 flex-col\", shape !== \"analytics\" && \"@3xl:flex-row\")}>\n        <DashboardRail product={product} nav={nav} onNavigate={onNavigate} layout={shape === \"analytics\" ? \"bar\" : \"rail\"} touch={shape !== \"overview\"} />\n        <Tabs value={currentRange} onValueChange={selectRange} className=\"min-w-0 flex-1 gap-6 p-4 @md:p-6 @3xl:p-8\">\n          <RangeHeader title={shape === \"table\" ? `${workTitle}.` : \"Overview.\"} range={currentRange} pending={pending} touch={shape !== \"overview\"} />\n          {/* Not a tab stop of its own: a focused panel has no visible ring, and its controls are reachable anyway. */}\n          <TabsContent value={currentRange} tabIndex={-1} className=\"min-w-0\">\n            <DashboardPanel {...panel} />\n          </TabsContent>\n        </Tabs>\n      </div>\n    </div>\n  )\n}\n\nexport {\n  DashboardOverview,\n  type DashboardOverviewProps,\n  type DashboardActivity,\n  type DashboardAttention,\n  type DashboardMetric,\n  type DashboardRange,\n  type DashboardVariant,\n  type DashboardWorkItem,\n}\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-shell.tsx",
      "content": "import { useState } from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { TabsList, TabsTrigger } from \"@/registry/miseui/ui/tabs\"\nimport type { DashboardRange } from \"./dashboard-overview-parts\"\n\nconst RANGE_LABELS: Readonly<Record<DashboardRange, string>> = { \"7d\": \"7 days\", \"30d\": \"30 days\", \"90d\": \"90 days\" }\nconst RANGES = Object.keys(RANGE_LABELS) as DashboardRange[]\n\ninterface RangeHeaderProps {\n  title: string\n  range: DashboardRange\n  pending: boolean\n  /** Grows the range tabs to 40 px under a finger. */\n  touch?: boolean\n}\n\nfunction RangeHeader({ title, range, pending, touch = false }: RangeHeaderProps) {\n  return (\n    <div className=\"flex flex-wrap items-center justify-between gap-3\">\n      <h2 className=\"text-title text-xl\">\n        {title} <span className=\"text-muted-foreground\">Last {RANGE_LABELS[range]}.</span>\n      </h2>\n      <TabsList aria-label=\"Date range\" className={cn(touch && \"pointer-coarse:h-12\")}>\n        {RANGES.map((value) => (\n          <TabsTrigger key={value} value={value} disabled={pending} className=\"px-3\">\n            {RANGE_LABELS[value]}\n          </TabsTrigger>\n        ))}\n      </TabsList>\n    </div>\n  )\n}\n\nfunction useRange(range: DashboardRange | undefined, defaultRange: DashboardRange, onChange?: (range: DashboardRange) => void) {\n  const [internal, setInternal] = useState(defaultRange)\n  const select = (next: string) => {\n    setInternal(next as DashboardRange)\n    onChange?.(next as DashboardRange)\n  }\n  return [range ?? internal, select] as const\n}\n\nexport { RangeHeader, useRange }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-body.tsx",
      "content": "import type * as React from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Button } from \"@/registry/miseui/ui/button\"\nimport { AreaChart } from \"./dashboard-overview-chart\"\nimport {\n  ActivityList,\n  AttentionItem,\n  ChangeLabel,\n  PANEL_CLASS,\n  SecondaryMetrics,\n  type DashboardActivity,\n  type DashboardAttention,\n  type DashboardMetric,\n} from \"./dashboard-overview-parts\"\nimport { DashboardMessage } from \"./dashboard-overview-states\"\n\n/** One number first means the row under it stays short. A fourth metric belongs on its own page. */\nconst MAX_SECONDARY = 3\n\ninterface OverviewBodyProps {\n  metrics: readonly DashboardMetric[]\n  activity: readonly DashboardActivity[]\n  attention?: DashboardAttention\n}\n\nfunction OverviewBody({ metrics, activity, attention }: OverviewBodyProps) {\n  const [primary, ...rest] = metrics\n  return (\n    <div className=\"grid gap-4 @5xl:grid-cols-[minmax(0,1fr)_320px]\">\n      <div className=\"flex min-w-0 flex-col gap-4\">\n        <section className={cn(PANEL_CLASS, \"flex flex-col gap-6 p-4 @md:p-6\")}>\n          <div className=\"flex flex-col gap-2\">\n            <p className=\"text-[13px] text-muted-foreground\">{primary.label}</p>\n            <p className=\"text-display text-5xl @2xl:text-6xl\">{primary.value}</p>\n            <ChangeLabel metric={primary} className=\"text-[15px]\" />\n          </div>\n          <AreaChart label={primary.label} points={primary.series ?? []} format={primary.formatPoint} />\n        </section>\n        <SecondaryMetrics metrics={rest.slice(0, MAX_SECONDARY)} />\n      </div>\n      <div className=\"flex min-w-0 flex-col gap-4\">\n        {attention ? <AttentionItem key={attention.title} attention={attention} /> : null}\n        <ActivityList activity={activity} />\n      </div>\n    </div>\n  )\n}\n\ninterface DashboardContentProps {\n  pending: boolean\n  error?: string\n  onRetry?: () => void\n  /** No metrics at all, which is the empty state in every design. */\n  empty: boolean\n  emptyActionLabel: string\n  onEmptyAction?: () => void\n  /** Same shape as the loaded design, so nothing jumps when the numbers land. */\n  skeleton: React.ReactNode\n  children: React.ReactNode\n}\n\nfunction DashboardContent({ pending, error, onRetry, empty, emptyActionLabel, onEmptyAction, skeleton, children }: DashboardContentProps) {\n  if (pending) return skeleton\n  if (error) {\n    return (\n      <DashboardMessage\n        role=\"alert\"\n        title=\"These numbers did not load\"\n        description={error}\n        action={<Button variant=\"outline\" onClick={onRetry}>Try again</Button>}\n      />\n    )\n  }\n  if (empty) {\n    return (\n      <DashboardMessage\n        title=\"No numbers to show yet\"\n        description=\"Connect a billing account and your revenue appears here within a few minutes.\"\n        action={<Button variant=\"mise\" onClick={onEmptyAction}>{emptyActionLabel}</Button>}\n      />\n    )\n  }\n  return children\n}\n\nexport { DashboardContent, OverviewBody }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-analytics.tsx",
      "content": "import { useRef, useState } from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Chart } from \"@/registry/miseui/ui/chart\"\nimport { useElementWidth } from \"@/registry/miseui/ui/chart-state\"\nimport { Skeleton } from \"@/registry/miseui/ui/skeleton\"\nimport { ActivityList, AttentionItem, ChangeLabel, PANEL_CLASS, type DashboardActivity, type DashboardAttention, type DashboardMetric } from \"./dashboard-overview-parts\"\n\nconst MAX_METRICS = 4\nconst FALLBACK_WIDTH_PX = 640\n/** Below this width a tall plot is mostly empty scrolling, and the strip above it already took the first screen. */\nconst TALL_FROM_PX = 560\nconst SHORT_HEIGHT_PX = 240\nconst TALL_HEIGHT_PX = 384\nconst STRIP_CLASS = \"grid grid-cols-2 gap-1 @3xl:grid-cols-4\"\nconst plainFormat = (value: number) => value.toLocaleString(\"en-US\")\n\ninterface MetricTileProps {\n  metric: DashboardMetric\n  active: boolean\n  onChoose?: () => void\n}\n\n/** A metric with nothing to draw stays a plain figure: a button that changes nothing is a lie. */\nfunction MetricTile({ metric, active, onChoose }: MetricTileProps) {\n  const content = (\n    <>\n      <span className=\"block text-[13px] text-pretty text-muted-foreground\">{metric.label}</span>\n      <span className=\"text-title mt-1 block text-xl @2xl:text-2xl\">{metric.value}</span>\n    </>\n  )\n  if (!onChoose) return <div className=\"min-w-0 rounded-xl p-3\">{content}</div>\n  return (\n    <button\n      type=\"button\"\n      aria-pressed={active}\n      onClick={onChoose}\n      className={cn(\n        \"min-w-0 rounded-xl p-3 text-start outline-none\",\n        \"transition-colors duration-(--duration-fast) ease-(--ease-mise)\",\n        \"focus-visible:ring-[3px] focus-visible:ring-ring/50\",\n        active ? \"bg-muted dark:bg-accent\" : \"hover:bg-muted/60 dark:hover:bg-accent/60\",\n      )}\n    >\n      {content}\n    </button>\n  )\n}\n\nfunction useChosenMetric(metrics: readonly DashboardMetric[]) {\n  const [chosenId, setChosenId] = useState<string | null>(null)\n  const drawable = (metric: DashboardMetric) => (metric.series?.length ?? 0) > 0\n  // A range or data change can take the chosen metric away, so this falls back instead of drawing nothing.\n  const current = metrics.find((metric) => metric.id === chosenId && drawable(metric)) ?? metrics.find(drawable) ?? metrics[0]\n  return { current, choose: setChosenId, drawable }\n}\n\nfunction LargeChart({ metric }: { metric: DashboardMetric }) {\n  const frame = useRef<HTMLDivElement>(null)\n  const width = useElementWidth(frame, FALLBACK_WIDTH_PX)\n  const data = (metric.series ?? []).map((point) => ({ day: point.label, value: point.value }))\n  return (\n    <div ref={frame} className=\"min-w-0\">\n      {/* A line, because the kit's area scale starts at zero, which flattens a slowly moving total into a shelf. */}\n      <Chart\n        key={metric.id}\n        variant=\"line\"\n        label={metric.label}\n        data={data}\n        index=\"day\"\n        series={[{ key: \"value\", label: metric.label }]}\n        height={width < TALL_FROM_PX ? SHORT_HEIGHT_PX : TALL_HEIGHT_PX}\n        formatValue={metric.formatPoint ?? plainFormat}\n      />\n    </div>\n  )\n}\n\ninterface AnalyticsBodyProps {\n  metrics: readonly DashboardMetric[]\n  activity: readonly DashboardActivity[]\n  attention?: DashboardAttention\n}\n\nfunction AnalyticsBody({ metrics, activity, attention }: AnalyticsBodyProps) {\n  const shown = metrics.slice(0, MAX_METRICS)\n  const { current, choose, drawable } = useChosenMetric(shown)\n  return (\n    <div className=\"flex min-w-0 flex-col gap-4 pointer-coarse:[&_[data-slot=button]]:h-10\">\n      <section aria-label=\"Trend\" className={cn(PANEL_CLASS, \"flex flex-col gap-4 p-2 @md:p-4\")}>\n        <div role=\"group\" aria-label=\"Metric on the chart\" className={STRIP_CLASS}>\n          {shown.map((metric) => (\n            <MetricTile key={metric.id} metric={metric} active={metric.id === current.id} onChoose={drawable(metric) ? () => choose(metric.id) : undefined} />\n          ))}\n        </div>\n        <div className=\"flex flex-col gap-3 px-2 pb-2 @md:px-2\">\n          <ChangeLabel metric={current} className=\"text-[13px]\" />\n          <LargeChart metric={current} />\n        </div>\n      </section>\n      <div className=\"flex min-w-0 flex-col gap-4 @3xl:flex-row @3xl:items-start\">\n        {/* empty: the item can be put off, and a column reserved for it would stay behind as a blank. */}\n        {attention ? (\n          <div className=\"min-w-0 empty:hidden @3xl:order-last @3xl:w-80 @3xl:shrink-0\">\n            <AttentionItem key={attention.title} attention={attention} />\n          </div>\n        ) : null}\n        <div className=\"min-w-0 flex-1\">\n          <ActivityList activity={activity} />\n        </div>\n      </div>\n    </div>\n  )\n}\n\nfunction AnalyticsSkeleton() {\n  return (\n    <div role=\"status\" aria-label=\"Loading dashboard\" className=\"flex flex-col gap-4\">\n      <div className={cn(PANEL_CLASS, \"flex flex-col gap-4 p-2 @md:p-4\")}>\n        <div className={STRIP_CLASS}>\n          {Array.from({ length: MAX_METRICS }, (_, index) => (\n            <div key={index} className=\"flex flex-col gap-2 p-3\">\n              <Skeleton effect=\"wave\" className=\"h-4 w-24\" />\n              <Skeleton effect=\"wave\" className=\"h-6 w-20\" />\n            </div>\n          ))}\n        </div>\n        <Skeleton effect=\"wave\" className=\"mx-2 mb-2 h-60 rounded-xl @2xl:h-96\" />\n      </div>\n      <div className={cn(PANEL_CLASS, \"p-4\")}>\n        <Skeleton effect=\"wave\" className=\"h-40 w-full\" />\n      </div>\n    </div>\n  )\n}\n\nexport { AnalyticsBody, AnalyticsSkeleton }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-table.tsx",
      "content": "import { useState } from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Button } from \"@/registry/miseui/ui/button\"\nimport { DataTable, type DataTableColumn } from \"@/registry/miseui/ui/data-table\"\nimport { Skeleton } from \"@/registry/miseui/ui/skeleton\"\nimport { Status, type StatusTone } from \"@/registry/miseui/ui/status\"\nimport { AttentionItem, PANEL_CLASS, type DashboardAttention, type DashboardMetric } from \"./dashboard-overview-parts\"\n\ninterface DashboardWorkItem {\n  id: string\n  customer: string\n  detail?: string\n  status: string\n  statusTone?: StatusTone\n  /** Already formatted: this block never guesses a currency or a locale. */\n  amount: string\n  /** What the amount column sorts by. */\n  amountValue?: number\n  due: string\n  /** What the due column sorts by, such as a timestamp. */\n  dueValue?: number\n  actionLabel: string\n}\n\nconst MAX_NUMBERS = 4\nconst SKELETON_ROWS = 5\n\n/** The list is the page, so the numbers give up their plate and sit on the ground as one sentence. */\nfunction NumberLine({ metrics }: { metrics: readonly DashboardMetric[] }) {\n  return (\n    <dl aria-label=\"Key numbers\" className=\"flex flex-wrap items-baseline gap-x-6 gap-y-2\">\n      {metrics.slice(0, MAX_NUMBERS).map((metric) => (\n        <div key={metric.id} className=\"flex items-baseline gap-2 whitespace-nowrap\">\n          <dt className=\"order-last text-[13px] text-muted-foreground\">{metric.label}</dt>\n          <dd className={cn(\"text-[15px] font-medium tabular-nums\", metric.changeTone === \"negative\" && \"text-destructive\")}>{metric.value}</dd>\n          {metric.change ? <dd className=\"sr-only\">{metric.change}</dd> : null}\n        </div>\n      ))}\n    </dl>\n  )\n}\n\nfunction workColumns(handled: readonly string[], toggle: (item: DashboardWorkItem) => void): DataTableColumn<DashboardWorkItem>[] {\n  const isHandled = (item: DashboardWorkItem) => handled.includes(item.id)\n  return [\n    {\n      key: \"customer\",\n      header: \"Customer\",\n      hideable: false,\n      cell: (item) => (\n        <span className=\"block min-w-0\">\n          <span className=\"block text-sm\">{item.customer}</span>\n          {item.detail ? <span className=\"block text-[13px] text-muted-foreground\">{item.detail}</span> : null}\n        </span>\n      ),\n    },\n    {\n      key: \"status\",\n      header: \"Status\",\n      value: (item) => (isHandled(item) ? \"Handled\" : item.status),\n      cell: (item) => (\n        <Status state=\"custom\" tone={isHandled(item) ? \"success\" : (item.statusTone ?? \"neutral\")} className=\"text-[13px]\">\n          {isHandled(item) ? \"Handled\" : item.status}\n        </Status>\n      ),\n    },\n    { key: \"amount\", header: \"Amount\", numeric: true, filterable: false, value: (item) => item.amountValue ?? item.amount, cell: (item) => item.amount },\n    { key: \"due\", header: \"Due\", filterable: false, value: (item) => item.dueValue ?? item.due, cell: (item) => <span className=\"whitespace-nowrap\">{item.due}</span> },\n    {\n      key: \"action\",\n      header: \"Action\",\n      sortable: false,\n      filterable: false,\n      hideable: false,\n      value: () => \"\",\n      // The same button changes job and is never removed, so keyboard focus stays on the row just handled.\n      cell: (item) => (\n        <Button variant=\"outline\" size=\"sm\" aria-label={`${isHandled(item) ? \"Undo\" : item.actionLabel}: ${item.customer}`} className=\"pointer-coarse:h-10\" onClick={() => toggle(item)}>\n          {isHandled(item) ? \"Undo\" : item.actionLabel}\n        </Button>\n      ),\n    },\n  ]\n}\n\ninterface WorkListBodyProps {\n  metrics: readonly DashboardMetric[]\n  items: readonly DashboardWorkItem[]\n  title: string\n  attention?: DashboardAttention\n  /** Fires with the row and whether it is now handled. Update your data here. */\n  onAction?: (item: DashboardWorkItem, handled: boolean) => void\n}\n\nfunction WorkListBody({ metrics, items, title, attention, onAction }: WorkListBodyProps) {\n  const [handled, setHandled] = useState<readonly string[]>([])\n  const toggle = (item: DashboardWorkItem) => {\n    const next = !handled.includes(item.id)\n    setHandled(next ? [...handled, item.id] : handled.filter((id) => id !== item.id))\n    onAction?.(item, next)\n  }\n  const columns = workColumns(handled, toggle)\n  return (\n    <div className=\"flex min-w-0 flex-col gap-4\">\n      <NumberLine metrics={metrics} />\n      {attention ? <AttentionItem key={attention.title} attention={attention} /> : null}\n      {/* From @xl the table has room, so it earns a plate. Narrower it turns into cards, and a plate around cards is a plate on a plate. */}\n      <div className=\"min-w-0 @xl:rounded-2xl @xl:border @xl:bg-background @xl:p-4 @xl:dark:bg-card\">\n        <DataTable label={title} variant=\"cards\" rows={items} columns={columns} emptyText=\"Nothing needs you right now.\" labels={{ filter: \"Filter this list\" }} />\n      </div>\n    </div>\n  )\n}\n\nfunction WorkListSkeleton() {\n  return (\n    <div role=\"status\" aria-label=\"Loading dashboard\" className=\"flex flex-col gap-4\">\n      <Skeleton effect=\"wave\" className=\"h-5 w-full max-w-xl\" />\n      <div className={cn(PANEL_CLASS, \"flex flex-col gap-4 p-4\")}>\n        <Skeleton effect=\"wave\" className=\"h-9 w-full\" />\n        {Array.from({ length: SKELETON_ROWS }, (_, index) => (\n          <Skeleton key={index} effect=\"wave\" className=\"h-10 w-full\" />\n        ))}\n      </div>\n    </div>\n  )\n}\n\nexport { WorkListBody, WorkListSkeleton, type DashboardWorkItem }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-parts.tsx",
      "content": "import type * as React from \"react\"\nimport { useState } from \"react\"\nimport { TriangleAlert } from \"lucide-react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Button } from \"@/registry/miseui/ui/button\"\nimport type { ChartPoint } from \"./dashboard-overview-chart\"\n\ntype DashboardRange = \"7d\" | \"30d\" | \"90d\"\ntype ChangeTone = \"positive\" | \"negative\" | \"neutral\"\n\ninterface DashboardMetric {\n  id: string\n  label: string\n  /** Already formatted: this block never guesses a currency or a locale. */\n  value: string\n  change?: string\n  /** Whether the change is good news, which its sign cannot tell: more churn is up and bad. */\n  changeTone?: ChangeTone\n  /** Drawn only for the first metric. */\n  series?: readonly ChartPoint[]\n  formatPoint?: (value: number) => string\n}\n\ninterface DashboardActivity {\n  id: string\n  title: string\n  detail?: string\n  time: string\n}\n\ninterface DashboardAttention {\n  title: string\n  description: string\n  actionLabel: string\n  onAction?: () => void\n}\n\ninterface DashboardNavItem {\n  id: string\n  label: string\n  icon: React.ComponentType<{ className?: string }>\n}\n\nconst CAPTION_CLASS = \"text-[13px] leading-relaxed text-muted-foreground\"\n/** A white panel on the pale canvas. Tinted from the ink, and off in dark mode, where it would read as a glow. */\nconst PANEL_CLASS =\n  \"rounded-2xl border bg-background dark:bg-card shadow-[0_1px_2px_color-mix(in_oklab,var(--foreground)_6%,transparent),0_16px_32px_-16px_color-mix(in_oklab,var(--foreground)_16%,transparent)] dark:shadow-none\"\nconst TONE_CLASS: Record<ChangeTone, string> = {\n  positive: \"text-foreground\",\n  negative: \"text-destructive\",\n  neutral: \"text-muted-foreground\",\n}\n\nfunction ChangeLabel({ metric, className }: { metric: DashboardMetric; className?: string }) {\n  if (!metric.change) return null\n  return <span className={cn(TONE_CLASS[metric.changeTone ?? \"neutral\"], className)}>{metric.change}</span>\n}\n\n/** Sized by position, not by a card: the first of these outranks the rest, and all of them sit under the chart. */\nfunction SecondaryMetrics({ metrics }: { metrics: readonly DashboardMetric[] }) {\n  if (metrics.length === 0) return null\n  return (\n    <dl className={cn(PANEL_CLASS, \"grid gap-6 p-4 @md:grid-cols-[3fr_2fr_2fr] @md:p-6\")}>\n      {metrics.map((metric, index) => (\n        <div key={metric.id} className={cn(\"flex flex-col gap-1\", index > 0 && \"@md:border-l @md:pl-6\")}>\n          <dt className={CAPTION_CLASS}>{metric.label}</dt>\n          <dd className={cn(\"text-title\", index === 0 ? \"text-2xl\" : \"text-lg\")}>{metric.value}</dd>\n          {metric.change ? (\n            <dd className=\"text-[13px]\">\n              <ChangeLabel metric={metric} />\n            </dd>\n          ) : null}\n        </div>\n      ))}\n    </dl>\n  )\n}\n\nfunction AttentionItem({ attention }: { attention: DashboardAttention }) {\n  const [dismissed, setDismissed] = useState(false)\n  if (dismissed) return null\n  return (\n    <section aria-label=\"Needs your attention\" className={cn(PANEL_CLASS, \"flex gap-3 p-4\")}>\n      <TriangleAlert aria-hidden=\"true\" className=\"mt-1 size-4 shrink-0 text-destructive\" />\n      <div className=\"flex min-w-0 flex-col gap-1\">\n        <h3 className=\"text-[15px] font-medium\">{attention.title}</h3>\n        <p className={cn(CAPTION_CLASS, \"text-pretty\")}>{attention.description}</p>\n        <div className=\"mt-2 flex flex-wrap gap-2\">\n          <Button variant=\"outline\" size=\"sm\" onClick={attention.onAction}>\n            {attention.actionLabel}\n          </Button>\n          <Button variant=\"ghost\" size=\"sm\" onClick={() => setDismissed(true)}>\n            Later\n          </Button>\n        </div>\n      </div>\n    </section>\n  )\n}\n\nfunction ActivityList({ activity }: { activity: readonly DashboardActivity[] }) {\n  return (\n    <section className={cn(PANEL_CLASS, \"flex flex-col gap-2 p-4\")}>\n      <h3 className=\"text-[15px] font-medium\">Recent activity</h3>\n      {activity.length === 0 ? (\n        <p className={cn(CAPTION_CLASS, \"py-3\")}>Nothing has happened in this period.</p>\n      ) : (\n        <ul className=\"flex flex-col divide-y\">\n          {activity.map((item) => (\n            <li key={item.id} className=\"flex items-start justify-between gap-3 py-3\">\n              <div className=\"min-w-0\">\n                <p className=\"text-[13px] leading-relaxed text-pretty\">{item.title}</p>\n                {item.detail ? <p className={CAPTION_CLASS}>{item.detail}</p> : null}\n              </div>\n              <span className={cn(CAPTION_CLASS, \"shrink-0 whitespace-nowrap\")}>{item.time}</span>\n            </li>\n          ))}\n        </ul>\n      )}\n    </section>\n  )\n}\n\ninterface DashboardRailProps {\n  product: string\n  nav: readonly DashboardNavItem[]\n  onNavigate?: (id: string) => void\n  /** `rail` stands at the side from @3xl. `bar` stays on top at every width, giving the content the full width. */\n  layout?: \"rail\" | \"bar\"\n  /** Grows the items to 40 px under a finger. */\n  touch?: boolean\n}\n\n/** A top bar under @3xl. The bar scrolls by itself, so five labels never push the page sideways on a phone. */\nfunction DashboardRail({ product, nav, onNavigate, layout = \"rail\", touch = false }: DashboardRailProps) {\n  const [active, setActive] = useState(nav[0]?.id ?? \"\")\n  const rail = layout === \"rail\"\n  const select = (id: string) => {\n    setActive(id)\n    onNavigate?.(id)\n  }\n  return (\n    <div className={cn(\"flex min-w-0 flex-col gap-3 border-b p-4\", rail ? \"@3xl:w-56 @3xl:shrink-0 @3xl:gap-6 @3xl:border-r @3xl:border-b-0\" : \"@3xl:flex-row @3xl:items-center @3xl:gap-6 @3xl:px-8 @3xl:py-3\")}>\n      <p className={cn(\"px-3 text-[15px] font-medium\", !rail && \"@3xl:px-0\")}>{product}</p>\n      <nav aria-label=\"Main\" className={cn(\"flex gap-1 overflow-x-auto\", rail && \"@3xl:flex-col @3xl:overflow-visible\")}>\n        {nav.map((item) => (\n          <button\n            key={item.id}\n            type=\"button\"\n            aria-current={item.id === active ? \"page\" : undefined}\n            onClick={() => select(item.id)}\n            className={cn(\n              \"inline-flex h-9 shrink-0 items-center gap-3 rounded-md px-3 text-[13px] whitespace-nowrap outline-none\",\n              \"transition-colors duration-(--duration-fast) ease-(--ease-mise)\",\n              \"focus-visible:ring-[3px] focus-visible:ring-inset focus-visible:ring-ring/50\",\n              touch && \"pointer-coarse:h-10\",\n              item.id === active ? \"bg-background dark:bg-card text-foreground shadow-xs\" : \"text-muted-foreground hover:bg-background/60\",\n            )}\n          >\n            <item.icon className=\"size-4\" />\n            {item.label}\n          </button>\n        ))}\n      </nav>\n    </div>\n  )\n}\n\nexport {\n  PANEL_CLASS,\n  ActivityList,\n  AttentionItem,\n  ChangeLabel,\n  DashboardRail,\n  SecondaryMetrics,\n  type DashboardActivity,\n  type DashboardAttention,\n  type DashboardMetric,\n  type DashboardNavItem,\n  type DashboardRange,\n}\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-states.tsx",
      "content": "import type * as React from \"react\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\nimport { Skeleton } from \"@/registry/miseui/ui/skeleton\"\nimport { PANEL_CLASS } from \"./dashboard-overview-parts\"\n\n/** Same panels as the loaded screen, so nothing jumps when the numbers land. */\nfunction DashboardSkeleton() {\n  return (\n    <div role=\"status\" aria-label=\"Loading dashboard\" className=\"grid gap-4 @5xl:grid-cols-[minmax(0,1fr)_320px]\">\n      <div className=\"flex flex-col gap-4\">\n        <div className={cn(PANEL_CLASS, \"flex flex-col gap-6 p-4 @md:p-6\")}>\n          <div className=\"flex flex-col gap-2\">\n            <Skeleton effect=\"wave\" className=\"h-4 w-48\" />\n            <Skeleton effect=\"wave\" className=\"h-12 w-56 rounded-xl @2xl:h-16 @2xl:w-72\" />\n            <Skeleton effect=\"wave\" className=\"h-4 w-56\" />\n          </div>\n          <Skeleton effect=\"wave\" className=\"h-40 w-full rounded-xl @2xl:h-56\" />\n        </div>\n        <div className={cn(PANEL_CLASS, \"grid gap-6 p-4 @md:grid-cols-[3fr_2fr_2fr] @md:p-6\")}>\n          <Skeleton effect=\"wave\" className=\"h-16 w-full\" />\n          <Skeleton effect=\"wave\" className=\"h-16 w-full\" />\n          <Skeleton effect=\"wave\" className=\"h-16 w-full\" />\n        </div>\n      </div>\n      <div className=\"flex flex-col gap-4\">\n        <div className={cn(PANEL_CLASS, \"p-4\")}>\n          <Skeleton effect=\"wave\" className=\"h-24 w-full\" />\n        </div>\n        <div className={cn(PANEL_CLASS, \"p-4\")}>\n          <Skeleton effect=\"wave\" className=\"h-48 w-full\" />\n        </div>\n      </div>\n    </div>\n  )\n}\n\ninterface DashboardMessageProps {\n  title: string\n  description: string\n  action?: React.ReactNode\n  role?: \"alert\"\n}\n\nfunction DashboardMessage({ title, description, action, role }: DashboardMessageProps) {\n  return (\n    <div role={role} className={cn(PANEL_CLASS, \"flex flex-col items-start gap-3 p-6 py-16 @md:p-12\")}>\n      <h3 className=\"text-title text-2xl text-balance\">{title}</h3>\n      <p className=\"max-w-md text-[15px] leading-relaxed text-pretty text-muted-foreground\">{description}</p>\n      {action ? <div className=\"mt-2\">{action}</div> : null}\n    </div>\n  )\n}\n\nexport { DashboardMessage, DashboardSkeleton }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-chart.tsx",
      "content": "import type * as React from \"react\"\nimport { useId, useState } from \"react\"\nimport { motion, useReducedMotion } from \"motion/react\"\nimport { SPRING_DEFAULT } from \"@/registry/miseui/lib/motion\"\nimport { cn } from \"@/registry/miseui/lib/utils\"\n\ninterface ChartPoint {\n  label: string\n  value: number\n}\n\nconst VIEW_WIDTH = 640\nconst VIEW_HEIGHT = 200\n/** Keeps a 2 px line off the top and bottom edge, where the SVG would clip half of it. */\nconst INSET_Y = 12\nconst PERCENT = 100\nconst FILL_TOP_OPACITY = 0.22\nconst CAPTION_CLASS = \"text-[13px] text-muted-foreground\"\n\n/** A single reading still draws as a flat line, and a flat series must not divide by zero. */\nfunction buildPaths(values: readonly number[]) {\n  const drawn = values.length === 1 ? [values[0], values[0]] : values\n  const min = Math.min(...drawn)\n  const span = Math.max(...drawn) - min\n  const ys = drawn.map((value) =>\n    span === 0 ? VIEW_HEIGHT / 2 : INSET_Y + (1 - (value - min) / span) * (VIEW_HEIGHT - 2 * INSET_Y),\n  )\n  const line = ys\n    .map((y, index) => `${index === 0 ? \"M\" : \"L\"}${((index / (ys.length - 1)) * VIEW_WIDTH).toFixed(1)} ${y.toFixed(1)}`)\n    .join(\" \")\n  return { line, area: `${line} L${VIEW_WIDTH} ${VIEW_HEIGHT} L0 ${VIEW_HEIGHT} Z`, ys }\n}\n\nfunction shareOf(index: number, count: number) {\n  return count <= 1 ? PERCENT : (index / (count - 1)) * PERCENT\n}\n\ninterface ChartReadoutProps {\n  point: ChartPoint\n  left: number\n  top: number\n  format: (value: number) => string\n}\n\n/** Flips past the middle so the reading never leaves the chart. Instant on purpose: it follows a hand. */\nfunction ChartReadout({ point, left, top, format }: ChartReadoutProps) {\n  const flip = left > PERCENT / 2\n  return (\n    <>\n      <span aria-hidden=\"true\" className=\"pointer-events-none absolute inset-y-0 w-px bg-foreground/30\" style={{ left: `${left}%` }} />\n      <span\n        aria-hidden=\"true\"\n        className=\"pointer-events-none absolute size-2 -translate-1/2 rounded-full bg-mise ring-2 ring-background\"\n        style={{ left: `${left}%`, top: `${top}%` }}\n      />\n      <span\n        data-testid=\"chart-readout\"\n        className=\"pointer-events-none absolute top-0 z-10 rounded-md border bg-popover px-2 py-1 text-[13px] whitespace-nowrap shadow-xs\"\n        style={{ left: `${left}%`, transform: flip ? \"translateX(calc(-100% - 8px))\" : \"translateX(8px)\" }}\n      >\n        <span className=\"font-medium text-popover-foreground\">{format(point.value)}</span>\n        <span className=\"ml-2 text-muted-foreground\">{point.label}</span>\n      </span>\n    </>\n  )\n}\n\ninterface ChartMarksProps {\n  line: string\n  area: string\n}\n\nfunction ChartMarks({ line, area }: ChartMarksProps) {\n  const reduceMotion = useReducedMotion()\n  const fillId = `area-${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`\n  return (\n    <svg\n      aria-hidden=\"true\"\n      viewBox={`0 0 ${VIEW_WIDTH} ${VIEW_HEIGHT}`}\n      preserveAspectRatio=\"none\"\n      className=\"absolute inset-0 size-full overflow-visible\"\n    >\n      <defs>\n        <linearGradient id={fillId} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n          <stop offset=\"0\" style={{ stopColor: \"var(--mise)\", stopOpacity: FILL_TOP_OPACITY }} />\n          <stop offset=\"1\" style={{ stopColor: \"var(--mise)\", stopOpacity: 0 }} />\n        </linearGradient>\n      </defs>\n      {/* Keyed on the data, so a new range arrives as one soft change instead of a jump. */}\n      <motion.g\n        key={line}\n        data-testid=\"chart-marks\"\n        data-reduced={reduceMotion ? \"true\" : \"false\"}\n        initial={reduceMotion ? false : { opacity: 0 }}\n        animate={{ opacity: 1 }}\n        transition={SPRING_DEFAULT}\n      >\n        <path data-testid=\"chart-area\" d={area} fill={`url(#${fillId})`} />\n        <path\n          data-testid=\"chart-line\"\n          d={line}\n          fill=\"none\"\n          strokeWidth={2}\n          strokeLinejoin=\"round\"\n          strokeLinecap=\"round\"\n          vectorEffect=\"non-scaling-stroke\"\n          className=\"stroke-mise\"\n        />\n      </motion.g>\n    </svg>\n  )\n}\n\n/** The chart's numbers for anyone who cannot see or hover it. */\nfunction ChartTable({ label, points, format }: { label: string; points: readonly ChartPoint[]; format: (value: number) => string }) {\n  return (\n    <table className=\"sr-only\">\n      <caption>{label}</caption>\n      <tbody>\n        {points.map((point) => (\n          <tr key={point.label}>\n            <th scope=\"row\">{point.label}</th>\n            <td>{format(point.value)}</td>\n          </tr>\n        ))}\n      </tbody>\n    </table>\n  )\n}\n\ninterface AreaChartProps extends Omit<React.ComponentProps<\"figure\">, \"children\"> {\n  /** Names the chart for assistive tech. */\n  label: string\n  points: readonly ChartPoint[]\n  format?: (value: number) => string\n}\n\nconst defaultFormat = (value: number) => value.toLocaleString(\"en-US\")\n\nfunction AreaChart({ label, points, format = defaultFormat, className, ...props }: AreaChartProps) {\n  const [active, setActive] = useState<number | null>(null)\n  if (points.length === 0) return null\n\n  const values = points.map((point) => point.value)\n  const { line, area, ys } = buildPaths(values)\n  const first = points[0]\n  const last = points[points.length - 1]\n  const count = points.length\n  // After a switch to a shorter range the old index could point at nothing.\n  const current = active !== null && active < count ? active : null\n\n  const track = (event: React.PointerEvent<HTMLDivElement>) => {\n    const rect = event.currentTarget.getBoundingClientRect()\n    if (rect.width <= 0) return\n    const share = (event.clientX - rect.left) / rect.width\n    setActive(Math.min(count - 1, Math.max(0, Math.round(share * (count - 1)))))\n  }\n\n  return (\n    <figure\n      data-slot=\"area-chart\"\n      aria-label={`${label}, from ${format(first.value)} on ${first.label} to ${format(last.value)} on ${last.label}`}\n      className={cn(\"flex flex-col gap-2\", className)}\n      {...props}\n    >\n      <div data-testid=\"chart-plot\" className=\"relative h-40 touch-pan-y border-b @2xl:h-56\" onPointerMove={track} onPointerLeave={() => setActive(null)}>\n        <ChartMarks line={line} area={area} />\n        {/* The scale does not start at zero, so the two ends of it are written down. */}\n        <span className={cn(CAPTION_CLASS, \"pointer-events-none absolute top-0 left-0\")}>{format(Math.max(...values))}</span>\n        <span className={cn(CAPTION_CLASS, \"pointer-events-none absolute right-0 bottom-1\")}>{format(Math.min(...values))}</span>\n        {current !== null ? (\n          <ChartReadout point={points[current]} left={shareOf(current, count)} top={(ys[current] / VIEW_HEIGHT) * PERCENT} format={format} />\n        ) : null}\n      </div>\n      <div aria-hidden=\"true\" className={cn(CAPTION_CLASS, \"flex justify-between\")}>\n        <span>{first.label}</span>\n        <span>{last.label}</span>\n      </div>\n      <ChartTable label={label} points={points} format={format} />\n    </figure>\n  )\n}\n\nexport { AreaChart, type AreaChartProps, type ChartPoint }\n",
      "type": "registry:component"
    },
    {
      "path": "registry/miseui/blocks/dashboard-overview-sample.ts",
      "content": "import type { ChartPoint } from \"./dashboard-overview-chart\"\nimport type { DashboardActivity, DashboardAttention, DashboardMetric, DashboardRange } from \"./dashboard-overview-parts\"\nimport type { DashboardWorkItem } from \"./dashboard-overview-table\"\n\n/** Everything in this file is invented sample data. Pass `metrics` and none of it is shown. */\n\nconst SAMPLE_LAST_DAY = Date.UTC(2026, 10, 2)\nconst DAY_MS = 86_400_000\nconst dayLabel = new Intl.DateTimeFormat(\"en-US\", { month: \"short\", day: \"numeric\", timeZone: \"UTC\" })\n\n/** Dates counted back from a fixed day, so the sample renders the same on the server and in a test. */\nfunction dated(values: readonly number[], stepDays: number): ChartPoint[] {\n  return values.map((value, index) => ({\n    label: dayLabel.format(SAMPLE_LAST_DAY - (values.length - 1 - index) * stepDays * DAY_MS),\n    value,\n  }))\n}\n\nconst formatDollars = (value: number) => `$${value.toLocaleString(\"en-US\")}`\nconst formatCount = (value: number) => value.toLocaleString(\"en-US\")\nconst formatPercent = (value: number) => `${value}%`\n\nconst WEEK = [47702, 47702, 47886, 47886, 48066, 48132, 48216]\nconst MONTH = [\n  46076, 46076, 46160, 46244, 46244, 46118, 46298, 46382, 46382, 46466, 46550, 46734, 46734, 46650, 46818, 46902, 46986,\n  47170, 47170, 47086, 47254, 47338, 47422, 47618, 47618, 47702, 47702, 47886, 48066, 48216,\n]\nconst QUARTER = [43318, 43612, 43780, 44102, 44018, 44496, 44910, 45238, 45154, 45702, 46076, 47170, 48216]\n\n/** Only the analytics design draws these. Each ends on the figure its metric shows, so the chart and the number agree. */\nconst SUBSCRIPTIONS = {\n  week: [1273, 1275, 1276, 1279, 1280, 1282, 1284],\n  month: [1247, 1248, 1250, 1251, 1251, 1253, 1255, 1256, 1258, 1258, 1260, 1262, 1263, 1263, 1265, 1267, 1268, 1270, 1270, 1272, 1273, 1274, 1276, 1277, 1277, 1279, 1280, 1281, 1283, 1284],\n  quarter: [1172, 1181, 1188, 1196, 1201, 1213, 1222, 1231, 1238, 1249, 1258, 1272, 1284],\n}\nconst CONVERSION = {\n  week: [23.4, 23.5, 23.5, 23.7, 23.8, 24, 24.1],\n  month: [22.2, 22.2, 22.3, 22.3, 22.4, 22.4, 22.5, 22.5, 22.5, 22.6, 22.6, 22.7, 22.7, 22.8, 22.8, 22.8, 22.9, 22.9, 23, 23, 23, 23.1, 23.1, 23.2, 23.2, 23.2, 23.3, 23.3, 23.4, 23.4],\n  quarter: [19.2, 19.4, 19.6, 19.7, 20, 20.2, 20.4, 20.6, 20.8, 21, 21.2, 21.5, 21.8],\n}\nconst CHURN = {\n  week: [0, 1, 0, 0, 0, 1, 0],\n  month: [0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0],\n  quarter: [2, 3, 2, 3, 2, 2, 3, 2, 2, 3, 2, 3, 2],\n}\n\ninterface RangeFigures {\n  points: ChartPoint[]\n  change: string\n  subscriptions: string\n  conversion: [string, string]\n  churn: [string, string, DashboardMetric[\"changeTone\"]]\n  series: { subscriptions: ChartPoint[]; conversion: ChartPoint[]; churn: ChartPoint[] }\n}\n\nfunction metricsFor({ points, change, subscriptions, conversion, churn, series }: RangeFigures): DashboardMetric[] {\n  return [\n    {\n      id: \"mrr\",\n      label: \"Monthly recurring revenue\",\n      value: \"$48,216\",\n      change,\n      changeTone: \"positive\",\n      series: points,\n      formatPoint: formatDollars,\n    },\n    { id: \"subscriptions\", label: \"Active subscriptions\", value: \"1,284\", change: subscriptions, changeTone: \"positive\", series: series.subscriptions, formatPoint: formatCount },\n    { id: \"conversion\", label: \"Trial to paid\", value: conversion[0], change: conversion[1], changeTone: \"positive\", series: series.conversion, formatPoint: formatPercent },\n    { id: \"churn\", label: \"Accounts churned\", value: churn[0], change: churn[1], changeTone: churn[2], series: series.churn, formatPoint: formatCount },\n  ]\n}\n\nconst SAMPLE_METRICS: Readonly<Record<DashboardRange, DashboardMetric[]>> = {\n  \"7d\": metricsFor({\n    points: dated(WEEK, 1),\n    change: \"+$514 (+1.1%) from last week\",\n    subscriptions: \"+11 this week\",\n    conversion: [\"24.1%\", \"+0.7 pts\"],\n    churn: [\"2\", \"Same as last week\", \"neutral\"],\n    series: { subscriptions: dated(SUBSCRIPTIONS.week, 1), conversion: dated(CONVERSION.week, 1), churn: dated(CHURN.week, 1) },\n  }),\n  \"30d\": metricsFor({\n    points: dated(MONTH, 1),\n    change: \"+$2,140 (+4.6%) from 30 days ago\",\n    subscriptions: \"+37 in 30 days\",\n    conversion: [\"23.4%\", \"+1.2 pts\"],\n    churn: [\"9\", \"3 more than last period\", \"negative\"],\n    series: { subscriptions: dated(SUBSCRIPTIONS.month, 1), conversion: dated(CONVERSION.month, 1), churn: dated(CHURN.month, 1) },\n  }),\n  \"90d\": metricsFor({\n    points: dated(QUARTER, 7),\n    change: \"+$4,898 (+11.3%) from 90 days ago\",\n    subscriptions: \"+112 in 90 days\",\n    conversion: [\"21.8%\", \"+2.6 pts\"],\n    churn: [\"31\", \"4 fewer than last period\", \"positive\"],\n    series: { subscriptions: dated(SUBSCRIPTIONS.quarter, 7), conversion: dated(CONVERSION.quarter, 7), churn: dated(CHURN.quarter, 7) },\n  }),\n}\n\nconst SAMPLE_ACTIVITY: readonly DashboardActivity[] = [\n  { id: \"a1\", title: \"Pell Street Studio moved to Team\", detail: \"+$180 per month\", time: \"12 min ago\" },\n  { id: \"a2\", title: \"Dunmore Dental started a trial\", detail: \"Invited 3 people\", time: \"1 hr ago\" },\n  { id: \"a3\", title: \"Tern Harbor Books cancelled\", detail: \"-$84 per month, left a note\", time: \"4 hr ago\" },\n  { id: \"a4\", title: \"Quill & Ash paid invoice 2291\", detail: \"$1,260, 11 days late\", time: \"Yesterday\" },\n  { id: \"a5\", title: \"Orchard Row added 6 seats\", detail: \"+$126 per month\", time: \"Oct 31\" },\n]\n\nconst SAMPLE_ATTENTION: DashboardAttention = {\n  title: \"14 payments failed this week\",\n  description: \"$1,092 is at risk. Automatic retries stop on Friday.\",\n  actionLabel: \"Review payments\",\n}\n\nconst SAMPLE_WORK: readonly DashboardWorkItem[] = [\n  { id: \"w1\", customer: \"Pell Street Studio\", detail: \"Team plan\", status: \"Card declined\", statusTone: \"danger\", amount: \"$264\", amountValue: 264, due: \"Nov 1\", dueValue: 1, actionLabel: \"Retry\" },\n  { id: \"w2\", customer: \"Dunmore Dental\", detail: \"Starter plan\", status: \"Card expired\", statusTone: \"danger\", amount: \"$84\", amountValue: 84, due: \"Oct 30\", dueValue: -1, actionLabel: \"Ask for a card\" },\n  { id: \"w3\", customer: \"Quill & Ash\", detail: \"Invoice 2304\", status: \"11 days late\", statusTone: \"warning\", amount: \"$1,260\", amountValue: 1260, due: \"Oct 22\", dueValue: -9, actionLabel: \"Remind\" },\n  { id: \"w4\", customer: \"Orchard Row\", detail: \"Team plan\", status: \"Retry on Friday\", statusTone: \"neutral\", amount: \"$126\", amountValue: 126, due: \"Nov 2\", dueValue: 2, actionLabel: \"Retry\" },\n  { id: \"w5\", customer: \"Tern Harbor Books\", detail: \"Final invoice\", status: \"4 days late\", statusTone: \"warning\", amount: \"$84\", amountValue: 84, due: \"Oct 29\", dueValue: -2, actionLabel: \"Remind\" },\n]\n\nexport { SAMPLE_ACTIVITY, SAMPLE_ATTENTION, SAMPLE_METRICS, SAMPLE_WORK }\n",
      "type": "registry:component"
    }
  ],
  "categories": [
    "blocks"
  ],
  "type": "registry:block"
}