{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "transactions-table",
  "title": "Transactions Table Block",
  "description": "A transactions table for finance screens: money in, money out and net for 7, 30 or 90 days with a drawn trend line, type filters with counts, search, rows grouped by day with daily totals, status dots, a detail drawer and CSV export.",
  "dependencies": [
    "motion",
    "clsx",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "registry/new-york/transactions-table/transactions-table.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { AnimatePresence, motion, useReducedMotion } from \"motion/react\";\nimport { clsx, type ClassValue } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nfunction cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs));\n}\n\nexport type TransactionKind = \"income\" | \"expense\" | \"refund\" | \"transfer\";\nexport type TransactionStatus = \"completed\" | \"pending\" | \"failed\";\n\nexport interface Transaction {\n  id: string;\n  /** YYYY-MM-DD */\n  date: string;\n  /** HH:MM */\n  time?: string;\n  description: string;\n  counterparty: string;\n  category: string;\n  kind: TransactionKind;\n  /** Positive number; the sign comes from kind. */\n  amount: number;\n  status: TransactionStatus;\n  method?: string;\n  reference?: string;\n}\n\nexport interface TransactionsTableProps {\n  title?: string;\n  transactions?: Transaction[];\n  currency?: string;\n  /** Today as YYYY-MM-DD; ranges are counted back from it. Defaults to the newest transaction date. */\n  today?: string;\n  /** Called with the rows currently shown when Export is pressed. Without it a CSV file is downloaded. */\n  onExport?: (rows: Transaction[]) => void;\n  theme?: \"dark\" | \"light\";\n  className?: string;\n}\n\nconst PALETTES = {\n  dark: { bg: \"#0A0A0A\", text: \"#F5F4F1\", muted: \"rgba(245,244,241,0.6)\", faint: \"rgba(245,244,241,0.38)\", card: \"#111111\", panel: \"#141414\", border: \"rgba(255,255,255,0.09)\", row: \"rgba(255,255,255,0.03)\", chip: \"rgba(255,255,255,0.05)\", on: \"#F5F4F1\", onText: \"#0A0A0A\", pos: \"#4ADE80\", neg: \"#F5F4F1\", warn: \"#FBBF24\", bad: \"#F87171\", ring: \"rgba(245,244,241,0.6)\", scrim: \"rgba(0,0,0,0.6)\" },\n  light: { bg: \"#FAFAF8\", text: \"#0A0A0A\", muted: \"rgba(10,10,10,0.6)\", faint: \"rgba(10,10,10,0.4)\", card: \"#FFFFFF\", panel: \"#FFFFFF\", border: \"rgba(10,10,10,0.09)\", row: \"rgba(10,10,10,0.025)\", chip: \"rgba(10,10,10,0.04)\", on: \"#0A0A0A\", onText: \"#FAFAF8\", pos: \"#15803D\", neg: \"#0A0A0A\", warn: \"#B45309\", bad: \"#DC2626\", ring: \"rgba(10,10,10,0.5)\", scrim: \"rgba(10,10,10,0.35)\" },\n};\n\nconst SEED: [number, string, string, string, string, TransactionKind, number, TransactionStatus, string][] = [\n  [0, \"09:42\", \"Pro plan, 24 seats\", \"Halcyon\", \"Subscriptions\", \"income\", 696, \"completed\", \"Card\"],\n  [0, \"08:15\", \"Cloud hosting\", \"Stratus Cloud\", \"Infrastructure\", \"expense\", 1284.5, \"pending\", \"Card\"],\n  [1, \"16:20\", \"Team plan, 40 seats\", \"Northwind\", \"Subscriptions\", \"income\", 3160, \"completed\", \"Bank transfer\"],\n  [1, \"11:03\", \"Refund, duplicate charge\", \"Kestrel\", \"Refunds\", \"refund\", 79, \"completed\", \"Card\"],\n  [2, \"14:48\", \"Design contractor\", \"Parallel Studio\", \"Services\", \"expense\", 4200, \"completed\", \"Bank transfer\"],\n  [2, \"10:30\", \"Starter plan, 6 seats\", \"Fieldnote\", \"Subscriptions\", \"income\", 72, \"failed\", \"Card\"],\n  [3, \"17:12\", \"Email delivery\", \"Relay Mail\", \"Infrastructure\", \"expense\", 189, \"completed\", \"Card\"],\n  [3, \"09:05\", \"Enterprise, annual\", \"Brightline\", \"Subscriptions\", \"income\", 18240, \"completed\", \"Bank transfer\"],\n  [5, \"13:37\", \"Move to savings\", \"Treasury\", \"Transfers\", \"transfer\", 10000, \"completed\", \"Internal\"],\n  [6, \"15:55\", \"Office rent, Berlin\", \"Linien Spaces\", \"Office\", \"expense\", 3800, \"completed\", \"Bank transfer\"],\n  [8, \"12:10\", \"Pro plan, 12 seats\", \"Copperleaf\", \"Subscriptions\", \"income\", 348, \"completed\", \"Card\"],\n  [10, \"10:44\", \"Error monitoring\", \"Sentra\", \"Infrastructure\", \"expense\", 96, \"completed\", \"Card\"],\n  [12, \"16:01\", \"Team plan, 18 seats\", \"Tessellate\", \"Subscriptions\", \"income\", 1422, \"completed\", \"Card\"],\n  [15, \"11:26\", \"Payroll, October\", \"Payroll\", \"Payroll\", \"expense\", 48600, \"completed\", \"Bank transfer\"],\n  [19, \"09:58\", \"Pro plan, 60 seats\", \"Oakline\", \"Subscriptions\", \"income\", 1740, \"completed\", \"Card\"],\n  [24, \"14:19\", \"Refund, downgrade\", \"Morrow Labs\", \"Refunds\", \"refund\", 210, \"completed\", \"Card\"],\n  [33, \"10:02\", \"Enterprise, annual\", \"Harbor Health\", \"Subscriptions\", \"income\", 24600, \"completed\", \"Bank transfer\"],\n  [47, \"13:40\", \"Conference booth\", \"ProductConf\", \"Marketing\", \"expense\", 5200, \"completed\", \"Card\"],\n  [61, \"15:22\", \"Team plan, 32 seats\", \"Lumen\", \"Subscriptions\", \"income\", 2528, \"completed\", \"Card\"],\n  [80, \"09:30\", \"Laptops x4\", \"Hardware Co.\", \"Equipment\", \"expense\", 7960, \"completed\", \"Card\"],\n];\n\nfunction seedTransactions(today: string): Transaction[] {\n  const t = new Date(`${today}T12:00:00Z`);\n  return SEED.map(([back, time, description, counterparty, category, kind, amount, status, method], i) => {\n    const d = new Date(t);\n    d.setUTCDate(d.getUTCDate() - back);\n    return { id: `tx-${i + 1}`, date: d.toISOString().slice(0, 10), time, description, counterparty, category, kind, amount, status, method, reference: `TX-${(482910 + i * 7731).toString(36).toUpperCase()}` };\n  });\n}\n\nconst RANGES = [\n  { id: 7, label: \"7 days\" },\n  { id: 30, label: \"30 days\" },\n  { id: 90, label: \"90 days\" },\n] as const;\nconst KINDS: (\"all\" | TransactionKind)[] = [\"all\", \"income\", \"expense\", \"refund\", \"transfer\"];\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\nconst WD = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\nconst signed = (t: Transaction) => (t.kind === \"income\" ? t.amount : t.kind === \"transfer\" ? 0 : -t.amount);\nconst daysBetween = (a: string, b: string) => Math.round((Date.parse(b) - Date.parse(a)) / 864e5);\n\nexport function TransactionsTable({ title = \"Transactions\", transactions, currency = \"$\", today, onExport, theme = \"dark\", className }: TransactionsTableProps) {\n  const p = PALETTES[theme];\n  const reduce = !!useReducedMotion();\n  const uid = React.useId();\n  const ref = today ?? (transactions ? transactions.reduce((m, t) => (t.date > m ? t.date : m), \"0000-00-00\") : \"2026-11-01\");\n  const all = React.useMemo(() => transactions ?? seedTransactions(ref), [transactions, ref]);\n  const [range, setRange] = React.useState<7 | 30 | 90>(30);\n  const [kind, setKind] = React.useState<\"all\" | TransactionKind>(\"all\");\n  const [q, setQ] = React.useState(\"\");\n  const [sel, setSel] = React.useState<Transaction | null>(null);\n  const opener = React.useRef<HTMLElement | null>(null);\n\n  const money = (n: number, sign = false) => `${sign ? (n > 0 ? \"+\" : n < 0 ? \"−\" : \"\") : \"\"}${currency}${Math.abs(n).toLocaleString(\"en-US\", { minimumFractionDigits: Math.abs(n) % 1 ? 2 : 0, maximumFractionDigits: 2 })}`;\n  const dayLabel = (d: string) => {\n    const back = daysBetween(d, ref);\n    if (back === 0) return \"Today\";\n    if (back === 1) return \"Yesterday\";\n    const x = new Date(`${d}T12:00:00Z`);\n    return `${WD[x.getUTCDay()]} ${x.getUTCDate()} ${MONTHS[x.getUTCMonth()]}`;\n  };\n\n  const inRange = all.filter((t) => daysBetween(t.date, ref) < range && daysBetween(t.date, ref) >= 0);\n  const query = q.trim().toLowerCase();\n  const rows = inRange.filter((t) => (kind === \"all\" || t.kind === kind) && (!query || `${t.description} ${t.counterparty} ${t.category} ${t.reference}`.toLowerCase().includes(query))).sort((a, b) => (b.date + (b.time ?? \"\")).localeCompare(a.date + (a.time ?? \"\")));\n  const done = inRange.filter((t) => t.status === \"completed\");\n  const income = done.filter((t) => t.kind === \"income\").reduce((s, t) => s + t.amount, 0);\n  const out = done.filter((t) => t.kind === \"expense\" || t.kind === \"refund\").reduce((s, t) => s + t.amount, 0);\n  const net = income - out;\n  const groups = Array.from(new Set(rows.map((r) => r.date))).map((d) => ({ d, items: rows.filter((r) => r.date === d) }));\n\n  // Daily net for the sparkline over the selected range.\n  const spark = (() => {\n    const buckets = Math.min(range, 30);\n    const per = range / buckets;\n    const vals = Array.from({ length: buckets }, () => 0);\n    for (const t of done) {\n      const back = daysBetween(t.date, ref);\n      const b = buckets - 1 - Math.floor(back / per);\n      if (b >= 0) vals[b] += signed(t);\n    }\n    let acc = 0;\n    return vals.map((v) => (acc += v));\n  })();\n  const min = Math.min(...spark, 0);\n  const max = Math.max(...spark, 1);\n  const pts = spark.map((v, i) => `${(i / Math.max(1, spark.length - 1)) * 100},${36 - ((v - min) / (max - min || 1)) * 32}`).join(\" \");\n\n  const exportCsv = () => {\n    if (onExport) return onExport(rows);\n    const esc = (v: string | number) => `\"${String(v).replace(/\"/g, '\"\"')}\"`;\n    const csv = [[\"Date\", \"Time\", \"Description\", \"Counterparty\", \"Category\", \"Type\", \"Amount\", \"Status\", \"Reference\"], ...rows.map((t) => [t.date, t.time ?? \"\", t.description, t.counterparty, t.category, t.kind, signed(t) || t.amount, t.status, t.reference ?? \"\"])].map((r) => r.map(esc).join(\",\")).join(\"\\n\");\n    const url = URL.createObjectURL(new Blob([csv], { type: \"text/csv\" }));\n    const a = document.createElement(\"a\");\n    a.href = url;\n    a.download = `transactions-${range}d.csv`;\n    a.click();\n    setTimeout(() => URL.revokeObjectURL(url), 1000);\n  };\n\n  const focusOnMount = React.useCallback((el: HTMLDivElement | null) => el?.focus(), []);\n  const close = React.useCallback(() => {\n    setSel(null);\n    setTimeout(() => opener.current?.focus(), 0);\n  }, []);\n  React.useEffect(() => {\n    if (!sel) return;\n    const k = (e: KeyboardEvent) => e.key === \"Escape\" && close();\n    window.addEventListener(\"keydown\", k);\n    return () => window.removeEventListener(\"keydown\", k);\n  }, [sel, close]);\n\n  const ring = { [\"--tw-ring-color\" as string]: p.ring, [\"--tw-ring-offset-color\" as string]: p.card } as React.CSSProperties;\n  const focus = \"outline-none focus-visible:ring-2 focus-visible:ring-offset-2\";\n  const statusColor = (s: TransactionStatus) => (s === \"completed\" ? p.pos : s === \"pending\" ? p.warn : p.bad);\n\n  return (\n    <section className={cn(\"@container w-full\", className)} style={{ background: p.bg, color: p.text }}>\n      <div className=\"relative mx-auto max-w-6xl overflow-hidden px-4 py-10 @[640px]:px-6 @[640px]:py-14\">\n        <div className=\"overflow-hidden rounded-2xl border\" style={{ background: p.card, borderColor: p.border }}>\n          {/* Header + summary */}\n          <div className=\"flex flex-col gap-4 border-b p-5 @[760px]:flex-row @[760px]:items-center @[760px]:justify-between\" style={{ borderColor: p.border }}>\n            <h2 className=\"m-0 text-[20px] font-semibold tracking-[-0.02em]\">{title}</h2>\n            <div className=\"flex flex-wrap items-center gap-2\">\n              <div role=\"radiogroup\" aria-label=\"Date range\" className=\"inline-flex rounded-lg p-0.5\" style={{ background: p.chip }}>\n                {RANGES.map((r) => (\n                  <button key={r.id} type=\"button\" role=\"radio\" aria-checked={range === r.id} onClick={() => setRange(r.id)} className={cn(\"relative h-8 cursor-pointer rounded-md border-0 bg-transparent px-3 text-[13px] font-medium\", focus)} style={{ color: range === r.id ? p.onText : p.muted, ...ring }}>\n                    {range === r.id && <motion.span layoutId={`${uid}-range`} className=\"absolute inset-0 rounded-md\" style={{ background: p.on }} transition={reduce ? { duration: 0 } : { type: \"spring\", stiffness: 420, damping: 34 }} />}\n                    <span className=\"relative\">{r.label}</span>\n                  </button>\n                ))}\n              </div>\n              <button type=\"button\" onClick={exportCsv} className={cn(\"flex h-9 cursor-pointer items-center gap-1.5 rounded-lg border px-3 text-[13px] font-medium\", focus)} style={{ borderColor: p.border, background: \"transparent\", color: p.text, ...ring }}>\n                <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                  <path d=\"M12 4v11m0 0-4-4m4 4 4-4M5 20h14\" />\n                </svg>\n                Export CSV\n              </button>\n            </div>\n          </div>\n          <div className=\"grid grid-cols-1 border-b @[640px]:grid-cols-[1fr_1fr_1.4fr]\" style={{ borderColor: p.border }} aria-live=\"polite\">\n            {[\n              [\"Money in\", income, p.pos],\n              [\"Money out\", -out, p.text],\n            ].map(([l, v, c]) => (\n              <div key={l as string} className=\"border-b p-5 @[640px]:border-r @[640px]:border-b-0\" style={{ borderColor: p.border }}>\n                <p className=\"m-0 text-[12.5px]\" style={{ color: p.faint }}>\n                  {l as string} · {range} days\n                </p>\n                <p className=\"m-0 mt-1.5 text-[24px] font-semibold tracking-[-0.02em] tabular-nums\" style={{ color: c as string }}>\n                  {money(v as number, true)}\n                </p>\n              </div>\n            ))}\n            <div className=\"flex items-center justify-between gap-4 p-5\">\n              <div>\n                <p className=\"m-0 text-[12.5px]\" style={{ color: p.faint }}>\n                  Net\n                </p>\n                <p className=\"m-0 mt-1.5 text-[24px] font-semibold tracking-[-0.02em] tabular-nums\">{money(net, true)}</p>\n              </div>\n              <svg viewBox=\"0 0 100 40\" preserveAspectRatio=\"none\" className=\"h-10 w-full max-w-[180px]\" aria-hidden=\"true\">\n                <defs>\n                  <linearGradient id={`${uid}-g`} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n                    <stop offset=\"0\" stopColor={p.pos} stopOpacity=\"0.35\" />\n                    <stop offset=\"1\" stopColor={p.pos} stopOpacity=\"0\" />\n                  </linearGradient>\n                </defs>\n                <motion.polygon key={`a-${range}`} points={`0,40 ${pts} 100,40`} fill={`url(#${uid}-g)`} initial={reduce ? false : { opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.6 }} />\n                <motion.polyline key={`l-${range}`} points={pts} fill=\"none\" stroke={p.pos} strokeWidth=\"1.6\" vectorEffect=\"non-scaling-stroke\" initial={reduce ? false : { pathLength: 0 }} animate={{ pathLength: 1 }} transition={{ duration: 0.8, ease: \"easeOut\" }} />\n              </svg>\n            </div>\n          </div>\n\n          {/* Filters */}\n          <div className=\"flex flex-col gap-3 border-b px-5 py-3 @[760px]:flex-row @[760px]:items-center @[760px]:justify-between\" style={{ borderColor: p.border }}>\n            <div role=\"group\" aria-label=\"Type\" className=\"-mx-5 flex gap-1 overflow-x-auto px-5 [scrollbar-width:none] @[760px]:mx-0 @[760px]:px-0 [&::-webkit-scrollbar]:hidden\">\n              {KINDS.map((k) => {\n                const n = inRange.filter((t) => k === \"all\" || t.kind === k).length;\n                const on = kind === k;\n                return (\n                  <button key={k} type=\"button\" aria-pressed={on} onClick={() => setKind(k)} className={cn(\"h-8 shrink-0 cursor-pointer rounded-md border px-2.5 text-[13px] capitalize\", focus)} style={{ borderColor: on ? p.on : \"transparent\", background: on ? p.chip : \"transparent\", color: on ? p.text : p.muted, ...ring }}>\n                    {k} <span className=\"tabular-nums\" style={{ color: p.faint }}>{n}</span>\n                  </button>\n                );\n              })}\n            </div>\n            <div className=\"relative\">\n              <label htmlFor={`${uid}-q`} className=\"sr-only\">\n                Search transactions\n              </label>\n              <svg className=\"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2\" width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke={p.faint} strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n                <circle cx=\"11\" cy=\"11\" r=\"6.5\" />\n                <path d=\"m20 20-4.2-4.2\" />\n              </svg>\n              <input id={`${uid}-q`} type=\"search\" value={q} onChange={(e) => setQ(e.target.value)} placeholder=\"Search name, category or reference\" className=\"h-9 w-full rounded-lg border pr-3 pl-8 text-[16px] outline-none focus-visible:ring-2 @[760px]:w-[280px] @[760px]:text-[13px]\" style={{ background: \"transparent\", borderColor: p.border, color: p.text, ...ring }} />\n            </div>\n          </div>\n\n          {/* Rows grouped by day */}\n          {groups.length === 0 ? (\n            <p className=\"m-0 px-5 py-14 text-center text-[14px]\" style={{ color: p.muted }}>\n              No transactions match. Try another type or a longer range.\n            </p>\n          ) : (\n            <div className=\"text-[14px]\">\n              <div aria-hidden=\"true\" className=\"hidden @[760px]:block\">\n                <div className=\"grid grid-cols-[1.6fr_1fr_0.9fr_0.8fr_1fr] gap-4 px-5 py-2.5 text-[12px]\" style={{ color: p.faint, background: p.row }}>\n                  {[\"Description\", \"Category\", \"Method\", \"Status\", \"Amount\"].map((h, i) => (\n                    <span key={h} className={i === 4 ? \"text-right\" : \"\"}>\n                      {h}\n                    </span>\n                  ))}\n                </div>\n              </div>\n              <AnimatePresence initial={false} mode=\"popLayout\">\n                {groups.map((g) => {\n                  const total = g.items.filter((t) => t.status === \"completed\").reduce((s, t) => s + signed(t), 0);\n                  return (\n                    <motion.section key={g.d} aria-label={dayLabel(g.d)} layout={!reduce} initial={reduce ? false : { opacity: 0 }} animate={{ opacity: 1 }} exit={reduce ? undefined : { opacity: 0 }}>\n                      <div className=\"flex items-center justify-between border-t px-5 pt-4 pb-1.5 text-[12px] font-medium\" style={{ borderColor: p.border, color: p.faint }}>\n                        <h3 className=\"m-0 text-[12px] font-medium\">{dayLabel(g.d)}</h3>\n                        <span className=\"tabular-nums\">{money(total, true)}</span>\n                      </div>\n                      {g.items.map((t) => (\n                        <button\n                          key={t.id}\n                          type=\"button\"\n                          aria-label={`${t.counterparty}, ${t.description}, ${t.kind === \"transfer\" ? money(t.amount) : money(signed(t), true)}, ${t.status}`}\n                          onClick={(e) => {\n                            opener.current = e.currentTarget;\n                            setSel(t);\n                          }}\n                          aria-haspopup=\"dialog\"\n                          className={cn(\"grid w-full cursor-pointer grid-cols-[1fr_auto] items-center gap-x-4 gap-y-0.5 border-0 bg-transparent px-5 py-2.5 text-left transition-colors @[760px]:grid-cols-[1.6fr_1fr_0.9fr_0.8fr_1fr]\", focus, \"focus-visible:ring-inset\")}\n                          style={{ color: p.text, ...ring }}\n                          onMouseEnter={(e) => (e.currentTarget.style.background = p.row)}\n                          onMouseLeave={(e) => (e.currentTarget.style.background = \"transparent\")}\n                        >\n                          <span className=\"flex min-w-0 items-center gap-3\">\n                            <span className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-full text-[12px] font-semibold\" style={{ background: p.chip, color: t.kind === \"income\" ? p.pos : p.muted }} aria-hidden=\"true\">\n                              {t.kind === \"income\" ? \"↓\" : t.kind === \"transfer\" ? \"⇄\" : t.kind === \"refund\" ? \"↺\" : \"↑\"}\n                            </span>\n                            <span className=\"min-w-0\">\n                              <span className=\"block truncate font-medium\">{t.counterparty}</span>\n                              <span className=\"block truncate text-[12.5px]\" style={{ color: p.faint }}>\n                                {t.description}\n                                <span className=\"@[760px]:hidden\"> · {t.category}</span>\n                              </span>\n                            </span>\n                          </span>\n                          <span className=\"hidden truncate @[760px]:block\" style={{ color: p.muted }}>\n                            {t.category}\n                          </span>\n                          <span className=\"hidden truncate @[760px]:block\" style={{ color: p.muted }}>\n                            {t.method}\n                          </span>\n                          <span className=\"hidden items-center gap-1.5 text-[12.5px] capitalize @[760px]:flex\" style={{ color: p.muted }}>\n                            <span className=\"h-1.5 w-1.5 rounded-full\" style={{ background: statusColor(t.status) }} aria-hidden=\"true\" />\n                            {t.status}\n                          </span>\n                          <span className=\"text-right font-medium tabular-nums\" style={{ color: t.status === \"failed\" ? p.faint : t.kind === \"income\" ? p.pos : p.text, textDecoration: t.status === \"failed\" ? \"line-through\" : undefined }}>\n                            {t.kind === \"transfer\" ? money(t.amount) : money(signed(t), true)}\n                            <span className=\"block text-[11.5px] font-normal capitalize no-underline @[760px]:hidden\" style={{ color: statusColor(t.status) }}>\n                              {t.status === \"completed\" ? \"\" : t.status}\n                            </span>\n                          </span>\n                        </button>\n                      ))}\n                    </motion.section>\n                  );\n                })}\n              </AnimatePresence>\n            </div>\n          )}\n          <p className=\"m-0 border-t px-5 py-3 text-[12.5px] tabular-nums\" style={{ borderColor: p.border, color: p.faint }}>\n            {rows.length} of {inRange.length} transactions · totals count completed only\n          </p>\n        </div>\n\n        {/* Detail drawer */}\n        <AnimatePresence>\n          {sel && (\n            <motion.div className=\"absolute inset-0 z-20 flex justify-end\" initial={reduce ? false : { opacity: 0 }} animate={{ opacity: 1 }} exit={reduce ? undefined : { opacity: 0 }} style={{ background: p.scrim }} onClick={close}>\n              <motion.div\n                role=\"dialog\"\n                aria-modal=\"true\"\n                aria-labelledby={`${uid}-dt`}\n                tabIndex={-1}\n                ref={focusOnMount}\n                onClick={(e) => e.stopPropagation()}\n                initial={reduce ? false : { x: \"100%\" }}\n                animate={{ x: 0 }}\n                exit={reduce ? undefined : { x: \"100%\" }}\n                transition={{ type: \"spring\", stiffness: 340, damping: 36 }}\n                className=\"flex h-full w-full max-w-[380px] flex-col overflow-y-auto border-l p-6 outline-none\"\n                style={{ background: p.panel, borderColor: p.border }}\n              >\n                <div className=\"flex items-center justify-between\">\n                  <span className=\"text-[12.5px] font-mono\" style={{ color: p.faint }}>\n                    {sel.reference}\n                  </span>\n                  <button type=\"button\" onClick={close} className={cn(\"h-8 cursor-pointer rounded-lg border px-3 text-[13px]\", focus)} style={{ borderColor: p.border, background: \"transparent\", color: p.text, ...ring }}>\n                    Close\n                  </button>\n                </div>\n                <p className=\"m-0 mt-8 text-[13px]\" style={{ color: p.muted }}>\n                  {sel.counterparty}\n                </p>\n                <h4 id={`${uid}-dt`} className=\"m-0 mt-1 text-[34px] font-semibold tracking-[-0.03em] tabular-nums\" style={{ color: sel.kind === \"income\" ? p.pos : p.text }}>\n                  {sel.kind === \"transfer\" ? money(sel.amount) : money(signed(sel), true)}\n                </h4>\n                <p className=\"m-0 mt-1 text-[14px]\" style={{ color: p.muted }}>\n                  {sel.description}\n                </p>\n                <dl className=\"m-0 mt-8 flex flex-col text-[14px]\">\n                  {[\n                    [\"Status\", <span key=\"s\" className=\"flex items-center gap-1.5 capitalize\"><span className=\"h-1.5 w-1.5 rounded-full\" style={{ background: statusColor(sel.status) }} />{sel.status}</span>],\n                    [\"Date\", `${dayLabel(sel.date)}${sel.time ? `, ${sel.time}` : \"\"}`],\n                    [\"Type\", <span key=\"k\" className=\"capitalize\">{sel.kind}</span>],\n                    [\"Category\", sel.category],\n                    [\"Method\", sel.method ?? \"–\"],\n                  ].map(([k, v]) => (\n                    <div key={k as string} className=\"flex justify-between gap-4 border-t py-3\" style={{ borderColor: p.border }}>\n                      <dt style={{ color: p.faint }}>{k}</dt>\n                      <dd className=\"m-0 text-right\">{v}</dd>\n                    </div>\n                  ))}\n                </dl>\n                {sel.status === \"failed\" && (\n                  <p className=\"m-0 mt-4 rounded-lg p-3 text-[13px]\" style={{ background: p.chip, color: p.bad }}>\n                    The card was declined. The customer was emailed to update it.\n                  </p>\n                )}\n              </motion.div>\n            </motion.div>\n          )}\n        </AnimatePresence>\n      </div>\n    </section>\n  );\n}\n\nexport default TransactionsTable;\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}