{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "transactions-table",
  "title": "Transactions table",
  "description": "Transactions table is a production-ready tables component from BJORK UI, packaged for shadcn registries.",
  "dependencies": [
    "clsx",
    "framer-motion",
    "lucide-react",
    "next-themes",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/bjork-ui/tables/transactions-table.tsx",
      "content": "\"use client\";\n\nimport {\n  Fragment,\n  useEffect,\n  useId,\n  useMemo,\n  useRef,\n  useState,\n  useSyncExternalStore,\n  type KeyboardEvent as ReactKeyboardEvent,\n} from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport { useTheme } from \"next-themes\";\nimport {\n  AlertTriangle,\n  Check,\n  ChevronRight,\n  Clock3,\n  CreditCard,\n  Landmark,\n  Receipt,\n  Undo2,\n  Wallet,\n  X,\n  type LucideIcon,\n} from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { useElementSize } from \"../_core/canvas\";\nimport {\n  type BjorkTableThemeMode,\n  getBjorkSignalPalette,\n  getBjorkTablePalette,\n  useBjorkTableIsDark,\n} from \"./table-theme\";\n\nexport type TransactionStatus = \"paid\" | \"pending\" | \"refunded\" | \"failed\" | \"disputed\";\nexport type TransactionFilter = TransactionStatus | \"all\";\n\nexport interface TransactionLineItem {\n  name: string;\n  quantity: number;\n  /** Price of one unit in minor units (cents). */\n  unitAmount: number;\n}\n\nexport interface TransactionPaymentMethod {\n  kind: \"credit\" | \"debit\" | \"bank\" | \"wallet\";\n  last4: string;\n  /** Overrides the generated label, e.g. \"Corporate card\". */\n  label?: string;\n}\n\nexport interface Transaction {\n  id: string;\n  orderId: string;\n  /** ISO timestamp. */\n  createdAt: string;\n  customer: { name: string; email: string };\n  /** Amount in minor units (cents). Negative for refunds. */\n  amount: number;\n  /** ISO 4217 code. */\n  currency: string;\n  status: TransactionStatus;\n  method: TransactionPaymentMethod;\n  items: TransactionLineItem[];\n  /** Shipping in minor units, shown in the detail row. */\n  shipping?: number;\n  /** Context line in the detail row, e.g. a decline reason or dispute deadline. */\n  note?: string;\n}\n\nexport interface TransactionsTableProps {\n  transactions?: Transaction[];\n  title?: string;\n  caption?: string;\n  loading?: boolean;\n  /** Reference time for Today / Yesterday grouping. Defaults to the current time. */\n  now?: Date | string;\n  /** Time zone used for day grouping and times. Defaults to UTC so server and client agree. */\n  timeZone?: string;\n  locale?: string;\n  defaultFilter?: TransactionFilter;\n  defaultExpandedIds?: string[];\n  selectedId?: string | null;\n  onTransactionSelect?: (transaction: Transaction) => void;\n  onFilterChange?: (filter: TransactionFilter) => void;\n  /** Body scrolls under a sticky header past this height (px). */\n  maxBodyHeight?: number;\n  className?: string;\n  theme?: BjorkTableThemeMode;\n  enableAnimations?: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* Sample data                                                         */\n/* ------------------------------------------------------------------ */\n\nexport const TRANSACTIONS_SAMPLE_NOW = \"2026-10-08T18:30:00Z\";\n\nconst item = (name: string, quantity: number, unitAmount: number): TransactionLineItem => ({\n  name,\n  quantity,\n  unitAmount,\n});\n\nexport const TRANSACTIONS_SAMPLE: Transaction[] = [\n  {\n    id: \"txn_9f2c41\",\n    orderId: \"#KS-2418\",\n    createdAt: \"2026-10-08T17:52:00Z\",\n    customer: { name: \"Mara Lindqvist\", email: \"mara.l@fernpost.io\" },\n    amount: 12_850,\n    currency: \"USD\",\n    status: \"paid\",\n    method: { kind: \"credit\", last4: \"4419\" },\n    items: [item(\"Ash glaze mug, 12 oz\", 2, 3_400), item(\"Pour-over kettle, matte\", 1, 5_200)],\n    shipping: 850,\n  },\n  {\n    id: \"txn_9f2b77\",\n    orderId: \"#KS-2417\",\n    createdAt: \"2026-10-08T16:31:00Z\",\n    customer: { name: \"Tobi Achterberg\", email: \"tobi@orchardline.co\" },\n    amount: 6_400,\n    currency: \"USD\",\n    status: \"pending\",\n    method: { kind: \"bank\", last4: \"0917\" },\n    items: [item(\"Linen apron, rust\", 1, 5_600)],\n    shipping: 800,\n    note: \"Bank transfer clears in 1–2 business days.\",\n  },\n  {\n    id: \"txn_9f2a03\",\n    orderId: \"#KS-2416\",\n    createdAt: \"2026-10-08T14:08:00Z\",\n    customer: { name: \"Priya Ramaswell\", email: \"priya.r@kelpmail.com\" },\n    amount: 24_200,\n    currency: \"USD\",\n    status: \"paid\",\n    method: { kind: \"debit\", last4: \"2087\" },\n    items: [\n      item(\"Stoneware dinner set, 4 pc\", 1, 18_800),\n      item(\"Walnut serving board\", 1, 4_600),\n    ],\n    shipping: 800,\n  },\n  {\n    id: \"txn_9f1e58\",\n    orderId: \"#KS-2409\",\n    createdAt: \"2026-10-08T11:46:00Z\",\n    customer: { name: \"Jonah Feldmore\", email: \"jonah@quietfield.studio\" },\n    amount: -4_800,\n    currency: \"USD\",\n    status: \"refunded\",\n    method: { kind: \"credit\", last4: \"7731\" },\n    items: [item(\"Speckled bowl, large\", 2, 2_400)],\n    note: \"Refunded to Credit •• 7731. Arrived chipped, customer kept the set.\",\n  },\n  {\n    id: \"txn_9f1c22\",\n    orderId: \"#KS-2415\",\n    createdAt: \"2026-10-08T09:15:00Z\",\n    customer: { name: \"Elise Okonkwo-Hart\", email: \"elise@bramblemade.com\" },\n    amount: 3_900,\n    currency: \"USD\",\n    status: \"failed\",\n    method: { kind: \"credit\", last4: \"0042\" },\n    items: [item(\"Beeswax candle, tall\", 3, 1_300)],\n    note: \"Declined by issuer: insufficient funds. Customer was emailed a retry link.\",\n  },\n  {\n    id: \"txn_9e8d90\",\n    orderId: \"#KS-2414\",\n    createdAt: \"2026-10-07T21:03:00Z\",\n    customer: { name: \"Wren Castellano\", email: \"wren.c@tidewater.app\" },\n    amount: 15_600,\n    currency: \"USD\",\n    status: \"disputed\",\n    method: { kind: \"credit\", last4: \"5508\" },\n    items: [item(\"Hand-thrown vase, celadon\", 1, 14_800)],\n    shipping: 800,\n    note: \"Reason: item not received. Evidence due Oct 15.\",\n  },\n  {\n    id: \"txn_9e8a41\",\n    orderId: \"#KS-2413\",\n    createdAt: \"2026-10-07T18:27:00Z\",\n    customer: { name: \"Dario Mbeki-Lund\", email: \"dario@northloam.net\" },\n    amount: 8_850,\n    currency: \"USD\",\n    status: \"paid\",\n    method: { kind: \"wallet\", last4: \"6612\" },\n    items: [item(\"Ash glaze mug, 12 oz\", 1, 3_400), item(\"Linen tea towel set\", 1, 4_650)],\n    shipping: 800,\n  },\n  {\n    id: \"txn_9e7f12\",\n    orderId: \"#KS-2412\",\n    createdAt: \"2026-10-07T13:40:00Z\",\n    customer: { name: \"Hana Sorvari\", email: \"hana@pinecone.works\" },\n    amount: 4_200,\n    currency: \"USD\",\n    status: \"paid\",\n    method: { kind: \"debit\", last4: \"3390\" },\n    items: [item(\"Ceramic pour-over cone\", 1, 3_400)],\n    shipping: 800,\n  },\n  {\n    id: \"txn_9d3301\",\n    orderId: \"#KS-2405\",\n    createdAt: \"2026-10-05T16:12:00Z\",\n    customer: { name: \"Mara Lindqvist\", email: \"mara.l@fernpost.io\" },\n    amount: 31_500,\n    currency: \"USD\",\n    status: \"paid\",\n    method: { kind: \"credit\", last4: \"4419\" },\n    items: [item(\"Stoneware dinner set, 4 pc\", 1, 18_800), item(\"Speckled bowl, large\", 5, 2_400), item(\"Walnut serving board\", 1, 0)],\n    shipping: 700,\n    note: \"Walnut board added as a free gift.\",\n  },\n  {\n    id: \"txn_9d2e76\",\n    orderId: \"#KS-2403\",\n    createdAt: \"2026-10-05T10:58:00Z\",\n    customer: { name: \"Teo Valdivia\", email: \"teo@saltbox.supply\" },\n    amount: -2_600,\n    currency: \"USD\",\n    status: \"refunded\",\n    method: { kind: \"wallet\", last4: \"1874\" },\n    items: [item(\"Beeswax candle, tall\", 2, 1_300)],\n    note: \"Partial refund: wrong scent shipped.\",\n  },\n  {\n    id: \"txn_9c1a09\",\n    orderId: \"#KS-2398\",\n    createdAt: \"2026-10-03T19:44:00Z\",\n    customer: { name: \"Ines Halloran\", email: \"ines@copperleaf.org\" },\n    amount: 9_300,\n    currency: \"USD\",\n    status: \"paid\",\n    method: { kind: \"credit\", last4: \"9925\" },\n    items: [item(\"Linen apron, rust\", 1, 5_600), item(\"Ash glaze mug, 12 oz\", 1, 3_400)],\n    shipping: 300,\n  },\n  {\n    id: \"txn_9c0f44\",\n    orderId: \"#KS-2396\",\n    createdAt: \"2026-10-03T08:20:00Z\",\n    customer: { name: \"Rafe Oyelaran\", email: \"rafe@gristmill.dev\" },\n    amount: 5_600,\n    currency: \"USD\",\n    status: \"pending\",\n    method: { kind: \"bank\", last4: \"4410\" },\n    items: [item(\"Linen apron, rust\", 1, 5_600)],\n    note: \"Awaiting bank confirmation.\",\n  },\n];\n\n/* ------------------------------------------------------------------ */\n/* Helpers                                                             */\n/* ------------------------------------------------------------------ */\n\nconst STATUS_META: Record<\n  TransactionStatus,\n  { label: string; tone: \"green\" | \"orange\" | \"red\" | \"neutral\"; icon: LucideIcon }\n> = {\n  paid: { label: \"Paid\", tone: \"green\", icon: Check },\n  pending: { label: \"Pending\", tone: \"neutral\", icon: Clock3 },\n  refunded: { label: \"Refunded\", tone: \"neutral\", icon: Undo2 },\n  failed: { label: \"Failed\", tone: \"red\", icon: X },\n  disputed: { label: \"Disputed\", tone: \"orange\", icon: AlertTriangle },\n};\n\nconst FILTERS: TransactionFilter[] = [\"all\", \"paid\", \"pending\", \"refunded\", \"failed\", \"disputed\"];\n\nconst EMPTY_COPY: Record<TransactionFilter, [string, string]> = {\n  all: [\"No transactions yet\", \"Orders show up here as soon as they come in.\"],\n  paid: [\"No paid transactions\", \"Completed charges will land here.\"],\n  pending: [\"Nothing pending\", \"Every payment in this period has settled.\"],\n  refunded: [\"No refunds\", \"Nothing has been returned in this period.\"],\n  failed: [\"No failed payments\", \"Every charge in this period went through.\"],\n  disputed: [\"No open disputes\", \"Nothing needs a response right now.\"],\n};\n\nconst METHOD_META: Record<TransactionPaymentMethod[\"kind\"], { label: string; icon: LucideIcon }> = {\n  credit: { label: \"Credit\", icon: CreditCard },\n  debit: { label: \"Debit\", icon: CreditCard },\n  bank: { label: \"Bank\", icon: Landmark },\n  wallet: { label: \"Wallet\", icon: Wallet },\n};\n\nconst moneyCache = new Map<string, Intl.NumberFormat>();\nfunction formatMoney(minor: number, currency: string, locale: string) {\n  const key = `${locale}|${currency}`;\n  let formatter = moneyCache.get(key);\n  if (!formatter) {\n    formatter = new Intl.NumberFormat(locale, { style: \"currency\", currency });\n    moneyCache.set(key, formatter);\n  }\n  const digits = formatter.resolvedOptions().maximumFractionDigits ?? 2;\n  return formatter.format(minor / 10 ** digits);\n}\n\nconst noopSubscribe = () => () => {};\nconst focusRing = \"outline-none focus-visible:ring-2 focus-visible:ring-[#ec5c13]/45\";\n\n/* ------------------------------------------------------------------ */\n/* Component                                                           */\n/* ------------------------------------------------------------------ */\n\nexport function TransactionsTable({\n  transactions = TRANSACTIONS_SAMPLE,\n  title = \"Transactions\",\n  caption = \"Transaction history\",\n  loading = false,\n  now,\n  timeZone = \"UTC\",\n  locale = \"en-US\",\n  defaultFilter = \"all\",\n  defaultExpandedIds = [],\n  selectedId: selectedIdProp,\n  onTransactionSelect,\n  onFilterChange,\n  maxBodyHeight = 560,\n  className,\n  theme = \"auto\",\n  enableAnimations = true,\n}: TransactionsTableProps) {\n  const mounted = useSyncExternalStore(noopSubscribe, () => true, () => false);\n  const { resolvedTheme } = useTheme();\n  const forcedTheme = theme === \"auto\" ? undefined : theme;\n  const detectedIsDark = useBjorkTableIsDark(resolvedTheme, forcedTheme);\n  const isDark = !mounted && theme === \"auto\" ? true : detectedIsDark;\n  const palette = getBjorkTablePalette(isDark);\n  const reduceMotion = useReducedMotion();\n  const shouldAnimate = enableAnimations && !reduceMotion;\n\n  const [filter, setFilter] = useState<TransactionFilter>(defaultFilter);\n  const [expanded, setExpanded] = useState<Set<string>>(() => new Set(defaultExpandedIds));\n  const [internalSelected, setInternalSelected] = useState<string | null>(null);\n  const selectedId = selectedIdProp !== undefined ? selectedIdProp : internalSelected;\n  const [entered, setEntered] = useState(false);\n  const [instantExpand, setInstantExpand] = useState(false);\n\n  const rootRef = useRef<HTMLDivElement>(null);\n  const { width } = useElementSize(rootRef);\n  const compact = width > 0 && width < 760;\n\n  const uid = useId();\n  const tabRefs = useRef(new Map<TransactionFilter, HTMLButtonElement>());\n\n  // Without an explicit `now`, the sample data stays anchored to its own day so the demo reads Today / Yesterday.\n  const [clientNow] = useState(() => new Date());\n  const reference = useMemo(\n    () =>\n      now !== undefined\n        ? new Date(now)\n        : transactions === TRANSACTIONS_SAMPLE\n          ? new Date(TRANSACTIONS_SAMPLE_NOW)\n          : clientNow,\n    [now, transactions, clientNow]\n  );\n\n  useEffect(() => {\n    const id = window.setTimeout(() => setEntered(true), 50);\n    return () => window.clearTimeout(id);\n  }, []);\n\n  const counts = useMemo(() => {\n    const result: Record<TransactionFilter, number> = {\n      all: transactions.length,\n      paid: 0,\n      pending: 0,\n      refunded: 0,\n      failed: 0,\n      disputed: 0,\n    };\n    transactions.forEach((t) => {\n      result[t.status] += 1;\n    });\n    return result;\n  }, [transactions]);\n\n  const groups = useMemo(() => {\n    const dayKey = new Intl.DateTimeFormat(\"en-CA\", { timeZone, year: \"numeric\", month: \"2-digit\", day: \"2-digit\" });\n    const dayLabel = new Intl.DateTimeFormat(locale, { timeZone, month: \"short\", day: \"numeric\" });\n    const weekday = new Intl.DateTimeFormat(locale, { timeZone, weekday: \"long\" });\n    const todayKey = dayKey.format(reference);\n    const yesterdayKey = dayKey.format(new Date(reference.getTime() - 86_400_000));\n    const visible = transactions\n      .filter((t) => filter === \"all\" || t.status === filter)\n      .slice()\n      .sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());\n    const map = new Map<string, { key: string; label: string; sub: string; rows: Transaction[] }>();\n    visible.forEach((t) => {\n      const date = new Date(t.createdAt);\n      const key = dayKey.format(date);\n      let group = map.get(key);\n      if (!group) {\n        const label = key === todayKey ? \"Today\" : key === yesterdayKey ? \"Yesterday\" : dayLabel.format(date);\n        const sub = key === todayKey || key === yesterdayKey ? dayLabel.format(date) : weekday.format(date);\n        group = { key, label, sub, rows: [] };\n        map.set(key, group);\n      }\n      group.rows.push(t);\n    });\n    return [...map.values()];\n  }, [transactions, filter, reference, timeZone, locale]);\n\n  const timeFormat = useMemo(\n    () => new Intl.DateTimeFormat(locale, { timeZone, hour: \"numeric\", minute: \"2-digit\" }),\n    [locale, timeZone]\n  );\n\n  const chooseFilter = (next: TransactionFilter) => {\n    setFilter(next);\n    onFilterChange?.(next);\n  };\n\n  const onTabKeyDown = (event: ReactKeyboardEvent<HTMLButtonElement>) => {\n    const index = FILTERS.indexOf(filter);\n    let nextIndex = -1;\n    if (event.key === \"ArrowRight\") nextIndex = (index + 1) % FILTERS.length;\n    else if (event.key === \"ArrowLeft\") nextIndex = (index - 1 + FILTERS.length) % FILTERS.length;\n    else if (event.key === \"Home\") nextIndex = 0;\n    else if (event.key === \"End\") nextIndex = FILTERS.length - 1;\n    if (nextIndex < 0) return;\n    event.preventDefault();\n    const next = FILTERS[nextIndex];\n    chooseFilter(next);\n    tabRefs.current.get(next)?.focus();\n  };\n\n  const toggleExpanded = (id: string) => {\n    setExpanded((prev) => {\n      const next = new Set(prev);\n      if (next.has(id)) next.delete(id);\n      else next.add(id);\n      return next;\n    });\n  };\n\n  const select = (transaction: Transaction) => {\n    if (selectedIdProp === undefined) setInternalSelected(transaction.id);\n    onTransactionSelect?.(transaction);\n  };\n\n  const columnCount = compact ? 3 : 7;\n  const skeletonTone = isDark ? \"bg-[#ededed]/[0.06]\" : \"bg-[#171717]/[0.06]\";\n  const animateIn = shouldAnimate && !entered;\n  const tabId = (f: TransactionFilter) => `${uid}-tab-${f}`;\n  const panelId = `${uid}-panel`;\n  let rowIndex = 0;\n\n  return (\n    <div ref={rootRef} className={cn(\"mx-auto w-full max-w-[980px] text-[13px]\", className)}>\n      <div className={cn(\"overflow-hidden rounded-[18px] border\", palette.container)}>\n        {/* Header + filter tabs */}\n        <div className=\"px-4 pt-3.5\">\n          <div className=\"flex items-baseline justify-between gap-3\">\n            <h3 className={cn(\"text-[14px] font-medium\", palette.primaryText)}>{title}</h3>\n            <span className={cn(\"text-[12px] tabular-nums\", palette.secondaryText)}>\n              {loading ? \"Loading…\" : `${counts.all} ${counts.all === 1 ? \"transaction\" : \"transactions\"}`}\n            </span>\n          </div>\n          <div\n            role=\"tablist\"\n            aria-label=\"Filter by status\"\n            className=\"-mx-4 mt-3 flex gap-1 overflow-x-auto px-4 pb-3 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden\"\n          >\n            {FILTERS.map((f) => {\n              const active = f === filter;\n              const label = f === \"all\" ? \"All\" : STATUS_META[f].label;\n              return (\n                <button\n                  key={f}\n                  ref={(node) => {\n                    if (node) tabRefs.current.set(f, node);\n                    else tabRefs.current.delete(f);\n                  }}\n                  id={tabId(f)}\n                  type=\"button\"\n                  role=\"tab\"\n                  aria-selected={active}\n                  aria-controls={panelId}\n                  tabIndex={active ? 0 : -1}\n                  onClick={() => chooseFilter(f)}\n                  onKeyDown={onTabKeyDown}\n                  className={cn(\n                    \"relative flex h-8 shrink-0 items-center gap-1.5 rounded-[9px] px-2.5 text-[13px] transition-colors\",\n                    active ? palette.primaryText : cn(palette.secondaryText, palette.menuItem),\n                    focusRing\n                  )}\n                >\n                  {active ? (\n                    <motion.span\n                      layoutId={shouldAnimate ? `${uid}-tab-pill` : undefined}\n                      aria-hidden\n                      transition={{ type: \"spring\", stiffness: 520, damping: 38 }}\n                      className={cn(\"absolute inset-0 rounded-[9px] border\", palette.mutedSurface, palette.divider)}\n                    />\n                  ) : null}\n                  <span className=\"relative\">{label}</span>\n                  <span\n                    className={cn(\n                      \"relative min-w-[18px] rounded-[6px] px-1 text-center text-[11px] tabular-nums\",\n                      active ? cn(palette.accentBg, palette.accent) : isDark ? \"bg-[#ededed]/[0.05]\" : \"bg-[#171717]/[0.05]\"\n                    )}\n                  >\n                    {counts[f]}\n                  </span>\n                </button>\n              );\n            })}\n          </div>\n        </div>\n\n        {/* Table */}\n        <div\n          id={panelId}\n          role=\"tabpanel\"\n          aria-labelledby={tabId(filter)}\n          tabIndex={0}\n          className={cn(\"overflow-auto border-t\", palette.divider, focusRing, \"focus-visible:ring-inset\")}\n          style={{ maxHeight: maxBodyHeight }}\n        >\n          <table\n            className=\"w-full table-fixed border-separate border-spacing-0\"\n            style={{ minWidth: compact ? undefined : 740 }}\n            aria-busy={loading || undefined}\n          >\n            <caption className=\"sr-only\">\n              {caption}, {filter === \"all\" ? \"all statuses\" : STATUS_META[filter].label}, grouped by day\n            </caption>\n            <colgroup>\n              <col style={{ width: compact ? 36 : 44 }} />\n              {compact ? (\n                <>\n                  <col />\n                  <col style={{ width: 128 }} />\n                </>\n              ) : (\n                <>\n                  <col style={{ width: 112 }} />\n                  <col />\n                  <col style={{ width: 150 }} />\n                  <col style={{ width: 124 }} />\n                  <col style={{ width: 92 }} />\n                  <col style={{ width: 124 }} />\n                </>\n              )}\n            </colgroup>\n            <thead>\n              <tr className=\"text-[11px] font-medium uppercase tracking-[0.08em]\">\n                <th scope=\"col\" className={cn(\"sticky top-0 z-[1] h-9 border-b\", palette.header)}>\n                  <span className=\"sr-only\">Details</span>\n                </th>\n                {compact ? (\n                  <>\n                    <th scope=\"col\" className={cn(\"sticky top-0 z-[1] border-b px-2 text-left font-medium\", palette.header)}>\n                      Order\n                    </th>\n                    <th scope=\"col\" className={cn(\"sticky top-0 z-[1] border-b px-4 text-right font-medium\", palette.header)}>\n                      Amount\n                    </th>\n                  </>\n                ) : (\n                  <>\n                    {[\"Order\", \"Customer\", \"Method\", \"Status\"].map((label) => (\n                      <th\n                        key={label}\n                        scope=\"col\"\n                        className={cn(\"sticky top-0 z-[1] border-b px-3 text-left font-medium\", palette.header)}\n                      >\n                        {label}\n                      </th>\n                    ))}\n                    <th scope=\"col\" className={cn(\"sticky top-0 z-[1] border-b px-3 text-right font-medium\", palette.header)}>\n                      Time\n                    </th>\n                    <th scope=\"col\" className={cn(\"sticky top-0 z-[1] border-b px-4 text-right font-medium\", palette.header)}>\n                      Amount\n                    </th>\n                  </>\n                )}\n              </tr>\n            </thead>\n\n            {loading ? (\n              <tbody aria-hidden>\n                {Array.from({ length: 6 }, (_, i) => (\n                  <tr key={i}>\n                    {Array.from({ length: columnCount }, (_, c) => (\n                      <td key={c} className={cn(\"h-[52px] border-b px-3\", palette.divider)}>\n                        {c === 0 ? null : (\n                          <span\n                            className={cn(\n                              \"block h-2.5 rounded-full\",\n                              skeletonTone,\n                              shouldAnimate && \"animate-pulse\",\n                              c === columnCount - 1 && \"ml-auto\"\n                            )}\n                            style={{ width: `${40 + ((i * 11 + c * 17) % 45)}%` }}\n                          />\n                        )}\n                      </td>\n                    ))}\n                  </tr>\n                ))}\n              </tbody>\n            ) : groups.length === 0 ? (\n              <tbody>\n                <tr>\n                  <td colSpan={columnCount} className=\"px-6 py-14 text-center\">\n                    <div className=\"mx-auto flex max-w-[300px] flex-col items-center gap-2.5\">\n                      <span\n                        aria-hidden\n                        className={cn(\"flex h-10 w-10 items-center justify-center rounded-full border\", palette.divider, palette.mutedSurface)}\n                      >\n                        <Receipt className={cn(\"h-4 w-4\", palette.secondaryText)} />\n                      </span>\n                      <p className={cn(\"text-[14px] font-medium\", palette.primaryText)}>{EMPTY_COPY[filter][0]}</p>\n                      <p className={cn(\"text-[12px]\", palette.secondaryText)}>{EMPTY_COPY[filter][1]}</p>\n                      {filter !== \"all\" ? (\n                        <button\n                          type=\"button\"\n                          onClick={() => {\n                            chooseFilter(\"all\");\n                            tabRefs.current.get(\"all\")?.focus();\n                          }}\n                          className={cn(\"mt-1 h-8 rounded-[9px] border px-3 text-[13px] transition-colors\", palette.control, focusRing)}\n                        >\n                          Show all transactions\n                        </button>\n                      ) : null}\n                    </div>\n                  </td>\n                </tr>\n              </tbody>\n            ) : (\n              groups.map((group) => {\n                const currency = group.rows[0]?.currency ?? \"USD\";\n                const net = group.rows\n                  .filter((t) => t.status !== \"failed\" && t.currency === currency)\n                  .reduce((sum, t) => sum + t.amount, 0);\n                return (\n                  <tbody key={group.key}>\n                    <tr>\n                      <th\n                        scope=\"rowgroup\"\n                        colSpan={columnCount - 1}\n                        className={cn(\n                          \"h-9 border-b px-4 text-left text-[12px] font-medium\",\n                          palette.divider,\n                          isDark ? \"bg-[#141414]\" : \"bg-[#fdf9f2]\"\n                        )}\n                      >\n                        <span className={palette.primaryText}>{group.label}</span>\n                        <span className={cn(\"ml-2 font-normal\", palette.secondaryText)}>{group.sub}</span>\n                      </th>\n                      <td\n                        className={cn(\n                          \"border-b px-4 text-right text-[12px] tabular-nums\",\n                          palette.divider,\n                          palette.secondaryText,\n                          isDark ? \"bg-[#141414]\" : \"bg-[#fdf9f2]\"\n                        )}\n                      >\n                        <span className=\"sr-only\">Net for {group.label}: </span>\n                        <span aria-hidden className=\"mr-1.5 opacity-70\">Net</span>\n                        {formatMoney(net, currency, locale)}\n                      </td>\n                    </tr>\n                    {group.rows.map((t) => {\n                      const isOpen = expanded.has(t.id);\n                      const isSelected = selectedId === t.id;\n                      const status = STATUS_META[t.status];\n                      const tone = getBjorkSignalPalette(status.tone, isDark);\n                      const StatusIcon = status.icon;\n                      const method = METHOD_META[t.method.kind];\n                      const MethodIcon = method.icon;\n                      const methodLabel = `${t.method.label ?? method.label} •• ${t.method.last4}`;\n                      const detailId = `${uid}-detail-${t.id}`;\n                      const delay = animateIn ? Math.min(rowIndex++, 12) * 0.035 : 0;\n                      const amountText = formatMoney(t.amount, t.currency, locale);\n                      const amountClass = cn(\n                        \"tabular-nums\",\n                        t.status === \"failed\"\n                          ? cn(\"line-through decoration-1\", palette.secondaryText)\n                          : t.amount < 0\n                            ? palette.secondaryText\n                            : cn(\"font-medium\", palette.primaryText)\n                      );\n                      const pill = (\n                        <span\n                          className={cn(\n                            \"inline-flex items-center gap-1 rounded-md border px-1.5 py-0.5 text-[12px] font-medium\",\n                            tone.bgColor,\n                            tone.borderColor,\n                            tone.textColor\n                          )}\n                        >\n                          <StatusIcon aria-hidden className=\"h-3 w-3\" strokeWidth={2.25} />\n                          {status.label}\n                        </span>\n                      );\n                      const expandButton = (\n                        <button\n                          type=\"button\"\n                          aria-expanded={isOpen}\n                          aria-controls={detailId}\n                          aria-label={`${isOpen ? \"Hide\" : \"Show\"} details for order ${t.orderId}`}\n                          onClick={(event) => {\n                            event.stopPropagation();\n                            setInstantExpand(event.detail === 0);\n                            toggleExpanded(t.id);\n                          }}\n                          className={cn(\n                            \"mx-auto flex h-6 w-6 items-center justify-center rounded-md transition-colors\",\n                            palette.secondaryText,\n                            palette.menuItem,\n                            focusRing\n                          )}\n                        >\n                          <ChevronRight\n                            aria-hidden\n                            className={cn(\n                              \"h-3.5 w-3.5\",\n                              shouldAnimate && \"transition-transform duration-200\",\n                              isOpen && \"rotate-90\"\n                            )}\n                          />\n                        </button>\n                      );\n                      const orderButton = (\n                        <button\n                          type=\"button\"\n                          onClick={(event) => {\n                            event.stopPropagation();\n                            select(t);\n                          }}\n                          aria-label={`Open order ${t.orderId}, ${t.customer.name}, ${amountText}, ${status.label}`}\n                          className={cn(\n                            \"rounded font-mono text-[12px] tracking-tight transition-colors\",\n                            isSelected ? palette.accent : palette.primaryText,\n                            focusRing\n                          )}\n                        >\n                          {t.orderId}\n                        </button>\n                      );\n                      return (\n                        <Fragment key={t.id}>\n                          <motion.tr\n                            initial={animateIn ? { opacity: 0, y: 6 } : false}\n                            animate={{ opacity: 1, y: 0 }}\n                            transition={{ type: \"spring\", stiffness: 420, damping: 34, delay }}\n                            onClick={() => select(t)}\n                            aria-selected={isSelected}\n                            className={cn(\n                              \"cursor-pointer transition-colors duration-150\",\n                              isSelected ? palette.selectedRow : palette.row\n                            )}\n                          >\n                            <td className={cn(\"relative h-[52px] border-b\", palette.divider, isOpen && \"border-b-transparent\")}>\n                              {isSelected ? (\n                                <span aria-hidden className=\"absolute inset-y-0 left-0 w-[2px] bg-[#ec5c13]\" />\n                              ) : null}\n                              {expandButton}\n                            </td>\n                            {compact ? (\n                              <>\n                                <td className={cn(\"border-b px-2 py-2.5\", palette.divider, isOpen && \"border-b-transparent\")}>\n                                  <div className=\"flex min-w-0 flex-col items-start gap-0.5\">\n                                    {orderButton}\n                                    <span className={cn(\"max-w-full truncate text-[12px]\", palette.secondaryText)}>\n                                      {t.customer.name} · {timeFormat.format(new Date(t.createdAt))}\n                                    </span>\n                                  </div>\n                                </td>\n                                <td className={cn(\"border-b px-4 py-2.5 text-right\", palette.divider, isOpen && \"border-b-transparent\")}>\n                                  <div className=\"flex flex-col items-end gap-1\">\n                                    <span className={amountClass}>{amountText}</span>\n                                    {pill}\n                                  </div>\n                                </td>\n                              </>\n                            ) : (\n                              <>\n                                <td className={cn(\"border-b px-3\", palette.divider, isOpen && \"border-b-transparent\")}>\n                                  {orderButton}\n                                </td>\n                                <td className={cn(\"border-b px-3\", palette.divider, isOpen && \"border-b-transparent\")}>\n                                  <div className=\"flex min-w-0 flex-col\">\n                                    <span className={cn(\"truncate\", palette.primaryText)}>{t.customer.name}</span>\n                                    <span className={cn(\"truncate text-[12px]\", palette.secondaryText)}>{t.customer.email}</span>\n                                  </div>\n                                </td>\n                                <td className={cn(\"border-b px-3\", palette.divider, palette.secondaryText, isOpen && \"border-b-transparent\")}>\n                                  <span className=\"inline-flex items-center gap-1.5 whitespace-nowrap\">\n                                    <MethodIcon aria-hidden className=\"h-3.5 w-3.5 opacity-70\" />\n                                    <span className=\"tabular-nums\">{methodLabel}</span>\n                                  </span>\n                                </td>\n                                <td className={cn(\"border-b px-3\", palette.divider, isOpen && \"border-b-transparent\")}>{pill}</td>\n                                <td\n                                  className={cn(\n                                    \"border-b px-3 text-right tabular-nums\",\n                                    palette.divider,\n                                    palette.secondaryText,\n                                    isOpen && \"border-b-transparent\"\n                                  )}\n                                >\n                                  <time dateTime={t.createdAt}>{timeFormat.format(new Date(t.createdAt))}</time>\n                                </td>\n                                <td className={cn(\"border-b px-4 text-right\", palette.divider, isOpen && \"border-b-transparent\")}>\n                                  <span className={amountClass}>{amountText}</span>\n                                </td>\n                              </>\n                            )}\n                          </motion.tr>\n                          {isOpen ? (\n                            <tr id={detailId} className={isSelected ? palette.selectedRow : undefined}>\n                              <td className={cn(\"border-b\", palette.divider)} />\n                              <td colSpan={columnCount - 1} className={cn(\"border-b px-3 pb-4 pt-0\", palette.divider, compact && \"px-2 pr-4\")}>\n                                <TransactionDetail\n                                  transaction={t}\n                                  methodLabel={methodLabel}\n                                  locale={locale}\n                                  palette={palette}\n                                  isDark={isDark}\n                                  animate={shouldAnimate && !instantExpand}\n                                />\n                              </td>\n                            </tr>\n                          ) : null}\n                        </Fragment>\n                      );\n                    })}\n                  </tbody>\n                );\n              })\n            )}\n          </table>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nfunction TransactionDetail({\n  transaction: t,\n  methodLabel,\n  locale,\n  palette,\n  isDark,\n  animate,\n}: {\n  transaction: Transaction;\n  methodLabel: string;\n  locale: string;\n  palette: ReturnType<typeof getBjorkTablePalette>;\n  isDark: boolean;\n  animate: boolean;\n}) {\n  const subtotal = t.items.reduce((sum, line) => sum + line.quantity * line.unitAmount, 0);\n  const shipping = t.shipping ?? 0;\n  const surface = isDark ? \"bg-[#151515] border-[#232323]\" : \"bg-[#fbf6ec] border-[#efe4d3]\";\n  return (\n    <motion.div\n      initial={animate ? { opacity: 0, y: -4 } : false}\n      animate={{ opacity: 1, y: 0 }}\n      transition={{ type: \"spring\", stiffness: 480, damping: 36 }}\n      className={cn(\"grid gap-4 rounded-[12px] border p-3.5 sm:grid-cols-[minmax(0,1fr)_200px]\", surface)}\n    >\n      <div className=\"min-w-0\">\n        <p className={cn(\"mb-2 text-[11px] font-medium uppercase tracking-[0.08em]\", palette.secondaryText)}>\n          {t.items.length} {t.items.length === 1 ? \"item\" : \"items\"}\n        </p>\n        <ul className=\"space-y-1.5\">\n          {t.items.map((line, i) => (\n            <li key={i} className=\"flex items-baseline gap-2\">\n              <span className={cn(\"w-6 shrink-0 tabular-nums\", palette.secondaryText)}>{line.quantity}×</span>\n              <span className={cn(\"min-w-0 flex-1 truncate\", palette.primaryText)}>{line.name}</span>\n              <span className={cn(\"shrink-0 tabular-nums\", palette.primaryText)}>\n                {line.unitAmount === 0 ? \"Free\" : formatMoney(line.quantity * line.unitAmount, t.currency, locale)}\n              </span>\n            </li>\n          ))}\n        </ul>\n        {t.note ? <p className={cn(\"mt-3 text-[12px] leading-relaxed\", palette.secondaryText)}>{t.note}</p> : null}\n      </div>\n      <dl className={cn(\"space-y-1.5 border-t pt-3 text-[12px] sm:border-l sm:border-t-0 sm:pl-4 sm:pt-0\", palette.divider)}>\n        <div className=\"flex justify-between gap-3\">\n          <dt className={palette.secondaryText}>Subtotal</dt>\n          <dd className={cn(\"tabular-nums\", palette.primaryText)}>{formatMoney(subtotal, t.currency, locale)}</dd>\n        </div>\n        <div className=\"flex justify-between gap-3\">\n          <dt className={palette.secondaryText}>Shipping</dt>\n          <dd className={cn(\"tabular-nums\", palette.primaryText)}>\n            {shipping ? formatMoney(shipping, t.currency, locale) : \"—\"}\n          </dd>\n        </div>\n        <div className=\"flex justify-between gap-3\">\n          <dt className={palette.secondaryText}>{t.amount < 0 ? \"Refunded\" : \"Charged\"}</dt>\n          <dd className={cn(\"font-medium tabular-nums\", palette.primaryText)}>{formatMoney(t.amount, t.currency, locale)}</dd>\n        </div>\n        <div className={cn(\"flex justify-between gap-3 border-t pt-1.5\", palette.divider)}>\n          <dt className={palette.secondaryText}>Method</dt>\n          <dd className={cn(\"tabular-nums\", palette.primaryText)}>{methodLabel}</dd>\n        </div>\n        <div className=\"flex justify-between gap-3\">\n          <dt className={palette.secondaryText}>Ref</dt>\n          <dd className={cn(\"font-mono text-[11px]\", palette.secondaryText)}>{t.id}</dd>\n        </div>\n      </dl>\n    </motion.div>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/tables/transactions-table.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs))\n}\n",
      "type": "registry:lib",
      "target": "@lib/utils.ts"
    },
    {
      "path": "components/bjork-ui/_core/canvas.ts",
      "content": "\"use client\";\n\nimport { useEffect, useState, type RefObject } from \"react\";\nimport { isCoarsePointer } from \"./loop\";\n\n// Caps DPR at 1.5 on coarse pointers and 2 otherwise.\nexport function defaultMaxDpr(): number {\n  return isCoarsePointer() ? 1.5 : 2;\n}\n\n// Sets the backing size for a CSS box and returns the DPR used.\nexport function sizeCanvas(\n  canvas: HTMLCanvasElement,\n  cssW: number,\n  cssH: number,\n  maxDpr: number = defaultMaxDpr(),\n): number {\n  const dpr = Math.min(typeof window !== \"undefined\" ? window.devicePixelRatio || 1 : 1, maxDpr);\n  canvas.width = Math.max(1, Math.round(cssW * dpr));\n  canvas.height = Math.max(1, Math.round(cssH * dpr));\n  canvas.style.width = `${cssW}px`;\n  canvas.style.height = `${cssH}px`;\n  return dpr;\n}\n\n// Rounded size of an element, kept current with a ResizeObserver.\nexport function useElementSize(ref: RefObject<HTMLElement | null>): { width: number; height: number } {\n  const [size, setSize] = useState({ width: 0, height: 0 });\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el || typeof ResizeObserver === \"undefined\") return;\n    const observer = new ResizeObserver((entries) => {\n      const box = entries[0]?.contentRect;\n      if (!box) return;\n      const width = Math.round(box.width);\n      const height = Math.round(box.height);\n      setSize((prev) => (prev.width === width && prev.height === height ? prev : { width, height }));\n    });\n    observer.observe(el);\n    return () => observer.disconnect();\n  }, [ref]);\n\n  return size;\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/canvas.ts"
    },
    {
      "path": "components/bjork-ui/_core/loop.ts",
      "content": "\"use client\";\n\nimport { useCallback, useEffect, useMemo, useRef, type RefObject } from \"react\";\n\nexport interface VisibleLoopOptions {\n  enabled?: boolean;\n  fpsCap?: number;\n  rootMargin?: string;\n}\n\n/**\n * Runs `frame(dt, t)` on requestAnimationFrame while the element is near the viewport,\n * the tab is visible and `enabled` is not false. Return `false` from `frame` to go idle\n * until `wake()` is called. Writes `data-loop` on the element: running, idle or paused.\n */\nexport function useVisibleLoop(\n  ref: RefObject<HTMLElement | null>,\n  frame: (dt: number, t: number) => boolean | void,\n  opts?: VisibleLoopOptions,\n): { wake: () => void } {\n  const enabled = opts?.enabled !== false;\n  const fpsCap = opts?.fpsCap ?? 0;\n  const rootMargin = opts?.rootMargin ?? \"96px\";\n\n  const frameRef = useRef(frame);\n  useEffect(() => {\n    frameRef.current = frame;\n  }, [frame]);\n\n  const wakeRef = useRef<() => void>(() => {});\n  const wake = useCallback(() => wakeRef.current(), []);\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el || typeof window === \"undefined\") return;\n\n    let wants = true; // false once the frame callback returns false\n    let inView = false;\n    let raf = 0;\n    let last = 0;\n    let t = 0;\n    const minFrame = fpsCap > 0 ? 1000 / fpsCap : 0;\n\n    const canRun = () => enabled && inView && document.visibilityState === \"visible\";\n    const stop = () => {\n      if (raf) cancelAnimationFrame(raf);\n      raf = 0;\n    };\n\n    const update = () => {\n      if (!enabled) {\n        stop();\n        el.dataset.loop = \"paused\";\n        return;\n      }\n      if (!wants) {\n        stop();\n        el.dataset.loop = \"idle\";\n        return;\n      }\n      if (!canRun()) {\n        stop();\n        el.dataset.loop = \"paused\";\n        return;\n      }\n      el.dataset.loop = \"running\";\n      if (!raf) {\n        last = performance.now();\n        raf = requestAnimationFrame(tick);\n      }\n    };\n\n    const tick = (now: number) => {\n      raf = 0;\n      if (!canRun() || !wants) {\n        update();\n        return;\n      }\n      const elapsed = now - last;\n      if (minFrame && elapsed < minFrame - 0.5) {\n        raf = requestAnimationFrame(tick);\n        return;\n      }\n      last = now;\n      const dt = Math.min(0.05, Math.max(0, elapsed / 1000));\n      t += dt;\n      const keep = frameRef.current(dt, t);\n      if (keep === false) {\n        wants = false;\n        update();\n        return;\n      }\n      raf = requestAnimationFrame(tick);\n    };\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        inView = entry.isIntersecting;\n        update();\n      },\n      { rootMargin },\n    );\n    observer.observe(el);\n\n    const onVisibility = () => update();\n    document.addEventListener(\"visibilitychange\", onVisibility);\n\n    wakeRef.current = () => {\n      wants = true;\n      update();\n    };\n\n    update();\n\n    return () => {\n      stop();\n      observer.disconnect();\n      document.removeEventListener(\"visibilitychange\", onVisibility);\n      wakeRef.current = () => {};\n    };\n  }, [ref, enabled, fpsCap, rootMargin]);\n\n  return useMemo(() => ({ wake }), [wake]);\n}\n\n// matchMedia based check. False on the server.\nexport function isCoarsePointer(): boolean {\n  if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return false;\n  return window.matchMedia(\"(pointer: coarse)\").matches;\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/loop.ts"
    },
    {
      "path": "components/bjork-ui/tables/table-theme.ts",
      "content": "import { useEffect, useState } from \"react\";\n\nexport type BjorkTableThemeMode = \"light\" | \"dark\" | \"auto\";\n\nexport function useBjorkTableIsDark(\n  resolvedTheme?: string,\n  forcedTheme?: Exclude<BjorkTableThemeMode, \"auto\">\n) {\n  const [documentTheme, setDocumentTheme] = useState<\"light\" | \"dark\" | null>(null);\n  const [previewTheme, setPreviewTheme] = useState<\"light\" | \"dark\" | null>(null);\n  // Server and first client render must agree, otherwise React keeps the\n  // server-rendered (dark) classes when the real theme resolves to light.\n  const [mounted, setMounted] = useState(false);\n\n  useEffect(() => {\n    setMounted(true);\n    const syncDocumentTheme = () => {\n      const root = document.documentElement;\n      const searchParams = new URLSearchParams(window.location.search);\n      const theme = searchParams.get(\"theme\");\n\n      setPreviewTheme(theme === \"light\" || theme === \"dark\" ? theme : null);\n\n      setDocumentTheme(\n        root.classList.contains(\"light\")\n          ? \"light\"\n          : root.classList.contains(\"dark\")\n            ? \"dark\"\n            : null\n      );\n    };\n\n    syncDocumentTheme();\n\n    const observer = new MutationObserver(syncDocumentTheme);\n    observer.observe(document.documentElement, {\n      attributes: true,\n      attributeFilter: [\"class\"],\n    });\n\n    return () => observer.disconnect();\n  }, []);\n\n  const activeTheme =\n    forcedTheme ?? previewTheme ?? documentTheme ?? (mounted ? resolvedTheme : undefined);\n\n  return activeTheme !== \"light\";\n}\n\nexport function getBjorkTablePalette(isDark: boolean) {\n  return {\n    container: isDark\n      ? \"border-[#1c1c1c] bg-[#121212] shadow-[inset_0_7px_14px_rgba(255,255,255,0.03),inset_0_0.5px_0.5px_rgba(255,255,255,0.06),0_14px_20px_-6px_rgba(0,0,0,0.45)]\"\n      : \"border-[#f5ede2] bg-[#fffcf6] shadow-[inset_0_7px_14px_rgba(88,72,49,0.045),inset_0_0.5px_0.5px_rgba(255,255,255,0.92),inset_1px_0_0_rgba(88,72,49,0.026),inset_-1px_0_0_rgba(255,255,255,0.68),0_14px_22px_-9px_rgba(66,52,33,0.11)]\",\n    header: isDark\n      ? \"border-[#232323] bg-[#181818] text-[#ededed]/42\"\n      : \"border-[#f1e8dc] bg-[#fbf7ef] text-[#171717]/60\",\n    row: isDark\n      ? \"border-[#232323] hover:bg-[#181818]/70\"\n      : \"border-[#f1e8dc] hover:bg-[#f8f2e7]/72\",\n    selectedRow: isDark\n      ? \"border-[#2a2a2a] bg-[#181818]\"\n      : \"border-[#eadfce] bg-[#f8f2e7]\",\n    control: isDark\n      ? \"border-[#232323] bg-[#181818] text-[#ededed]/70 hover:bg-[#202020] shadow-[inset_0_1px_0_rgba(255,255,255,0.045)]\"\n      : \"border-[#eadfce] bg-[#fffcf6] text-[#171717]/68 shadow-[var(--bjork-shadow-soft)] hover:bg-[#f8f2e7]\",\n    menu: isDark\n      ? \"border-[#232323] bg-[#181818] text-[#ededed]/76 shadow-[inset_0_1px_0_rgba(255,255,255,0.055),inset_0_12px_24px_rgba(255,255,255,0.018),0_22px_42px_-22px_rgba(0,0,0,0.9)]\"\n      : \"border-[#eadfce] bg-[#fffcf6] text-[#171717]/76 shadow-[inset_0_1px_0_rgba(88,72,49,0.04),inset_0_12px_24px_rgba(88,72,49,0.022),0_22px_44px_-26px_rgba(66,52,33,0.22)]\",\n    menuItem: isDark ? \"hover:bg-[#232323]\" : \"hover:bg-[#f8f2e7]\",\n    menuActive: isDark ? \"bg-[#232323]\" : \"bg-[#f8f2e7]\",\n    divider: isDark ? \"border-[#232323]\" : \"border-[#f1e8dc]\",\n    primaryText: isDark ? \"text-[#ededed]/90\" : \"text-[#171717]/86\",\n    secondaryText: isDark ? \"text-[#ededed]/38\" : \"text-[#171717]/60\",\n    mutedSurface: isDark ? \"bg-[#181818]\" : \"bg-[#f8f2e7]\",\n    popover: isDark ? \"bg-[#111] text-[#ededed]\" : \"bg-[#fffcf6] text-[#171717]\",\n    accent: isDark ? \"text-[#d86a2c]\" : \"text-[#bd4514]\",\n    accentBg: isDark ? \"bg-[#ec5c13]/12\" : \"bg-[#ec5c13]/14\",\n    accentBorder: isDark ? \"border-[#ec5c13]/24\" : \"border-[#bd4514]/22\",\n    checkboxAccent: isDark ? \"#d86a2c\" : \"#bd4514\",\n  };\n}\n\nexport function getBjorkSignalPalette(\n  tone: \"green\" | \"red\" | \"orange\" | \"neutral\",\n  isDark: boolean\n) {\n  const palettes = {\n    green: {\n      bgColor: isDark ? \"bg-[#3e6f52]/18\" : \"bg-[#dce8dc]\",\n      borderColor: isDark ? \"border-[#5f9f78]/28\" : \"border-[#bad0bd]\",\n      textColor: isDark ? \"text-[#77b58b]\" : \"text-[#47785c]\",\n      dotColor: isDark ? \"bg-[#77b58b]\" : \"bg-[#47785c]\",\n      color: isDark ? \"#77b58b\" : \"#47785c\",\n    },\n    red: {\n      bgColor: isDark ? \"bg-[#87463f]/18\" : \"bg-[#eadad5]\",\n      borderColor: isDark ? \"border-[#c46a61]/28\" : \"border-[#d7bcb4]\",\n      textColor: isDark ? \"text-[#cf7c72]\" : \"text-[#9d5149]\",\n      dotColor: isDark ? \"bg-[#cf7c72]\" : \"bg-[#9d5149]\",\n      color: isDark ? \"#cf7c72\" : \"#9d5149\",\n    },\n    orange: {\n      bgColor: isDark ? \"bg-[#ec5c13]/14\" : \"bg-[#ead9cb]\",\n      borderColor: isDark ? \"border-[#ec5c13]/28\" : \"border-[#d5b59f]\",\n      textColor: isDark ? \"text-[#d86a2c]\" : \"text-[#9f4317]\",\n      dotColor: isDark ? \"bg-[#d86a2c]\" : \"bg-[#9f4317]\",\n      color: isDark ? \"#d86a2c\" : \"#9f4317\",\n    },\n    neutral: {\n      bgColor: isDark ? \"bg-[#ededed]/8\" : \"bg-[#ded7ca]\",\n      borderColor: isDark ? \"border-[#ededed]/14\" : \"border-[#cfc6b7]\",\n      textColor: isDark ? \"text-[#ededed]/58\" : \"text-[#171717]/60\",\n      dotColor: isDark ? \"bg-[#ededed]/45\" : \"bg-[#171717]/42\",\n      color: isDark ? \"#a3a3a3\" : \"#706b62\",\n    },\n  } as const;\n\n  return palettes[tone];\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/tables/table-theme.ts"
    }
  ],
  "cssVars": {
    "light": {
      "bjork-bg": "#f7f3ea",
      "bjork-surface": "#fffcf6",
      "bjork-surface-muted": "rgba(250, 246, 237, 0.94)",
      "bjork-surface-hover": "#f5efe3",
      "bjork-surface-active": "#efe7d8",
      "bjork-panel": "#f8f2e7",
      "bjork-menu": "rgba(255, 252, 246, 0.98)",
      "bjork-field": "rgba(255, 252, 246, 0.96)",
      "bjork-field-muted": "rgba(248, 242, 231, 0.82)",
      "bjork-field-inset": "rgba(239, 231, 216, 0.72)",
      "bjork-error-bg": "#fff0e8",
      "bjork-text": "#171717",
      "bjork-text-strong": "rgba(23, 23, 23, 0.9)",
      "bjork-text-medium": "rgba(23, 23, 23, 0.78)",
      "bjork-text-muted": "rgba(23, 23, 23, 0.68)",
      "bjork-text-soft": "rgba(23, 23, 23, 0.62)",
      "bjork-text-faint": "rgba(23, 23, 23, 0.22)",
      "bjork-inverted-text": "#fff8f0",
      "bjork-border": "#eee6db",
      "bjork-border-muted": "#f5ede2",
      "bjork-border-strong": "#e1d7c8",
      "bjork-thumb": "#a49b8e",
      "bjork-track": "#ded6ca",
      "bjork-accent": "#ec7d43",
      "bjork-accent-hover": "#f0935f",
      "bjork-accent-soft": "rgba(236, 125, 67, 0.1)",
      "bjork-accent-muted": "rgba(236, 125, 67, 0.2)",
      "bjork-accent-badge": "rgba(236, 125, 67, 0.16)",
      "bjork-accent-badge-foreground": "#8d421d",
      "bjork-accent-foreground": "#3f2112",
      "bjork-accent-fill": "#ec7d43",
      "bjork-accent-fill-hover": "#f0935f",
      "bjork-shadow-surface": "inset 0 7px 14px rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.92), inset 1px 0 0 rgba(88, 72, 49, 0.026), inset -1px 0 0 rgba(255, 255, 255, 0.68), 0 14px 22px -9px rgba(66, 52, 33, 0.11)",
      "bjork-shadow-soft": "inset 0 1px 0 rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.86)",
      "bjork-shadow-panel": "inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.64), 0 18px 38px -30px rgba(66, 52, 33, 0.2)",
      "bjork-shadow-menu": "inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 0 12px 24px rgba(88, 72, 49, 0.022), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.62), 0 22px 44px -26px rgba(66, 52, 33, 0.22)",
      "bjork-shadow-inset": "inset 0 1px 10px rgba(88, 72, 49, 0.12), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.72)",
      "bjork-ring-offset": "#f7f3ea"
    },
    "dark": {
      "bjork-bg": "#111111",
      "bjork-surface": "#121212",
      "bjork-surface-muted": "rgba(22, 22, 22, 0.92)",
      "bjork-surface-hover": "#161616",
      "bjork-surface-active": "#202020",
      "bjork-panel": "#0d0d0d",
      "bjork-menu": "rgba(18, 18, 18, 0.98)",
      "bjork-field": "rgba(18, 18, 18, 0.95)",
      "bjork-field-muted": "rgba(18, 18, 18, 0.55)",
      "bjork-field-inset": "rgba(9, 9, 9, 0.75)",
      "bjork-error-bg": "#130d0a",
      "bjork-text": "#ededed",
      "bjork-text-strong": "rgba(237, 237, 237, 0.9)",
      "bjork-text-medium": "rgba(237, 237, 237, 0.72)",
      "bjork-text-muted": "rgba(237, 237, 237, 0.6)",
      "bjork-text-soft": "rgba(237, 237, 237, 0.5)",
      "bjork-text-faint": "rgba(237, 237, 237, 0.22)",
      "bjork-inverted-text": "#080808",
      "bjork-border": "#232323",
      "bjork-border-muted": "#1c1c1c",
      "bjork-border-strong": "#343434",
      "bjork-thumb": "#626262",
      "bjork-track": "#090909",
      "bjork-accent": "#ec5c13",
      "bjork-accent-hover": "#f07832",
      "bjork-accent-soft": "rgba(236, 92, 19, 0.12)",
      "bjork-accent-muted": "rgba(236, 92, 19, 0.24)",
      "bjork-accent-badge": "#b84a12",
      "bjork-accent-badge-foreground": "#fff2ea",
      "bjork-accent-foreground": "#fff2ea",
      "bjork-accent-fill": "#b84a12",
      "bjork-accent-fill-hover": "#a84a14",
      "bjork-shadow-surface": "inset 0 7px 14px rgba(255, 255, 255, 0.03), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.06), 0 14px 20px -6px rgba(0, 0, 0, 0.45)",
      "bjork-shadow-soft": "inset 0 1px 0 rgba(255, 255, 255, 0.045)",
      "bjork-shadow-panel": "inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 36px -28px rgba(0, 0, 0, 0.9)",
      "bjork-shadow-menu": "inset 0 1px 0 rgba(255, 255, 255, 0.055), inset 0 12px 24px rgba(255, 255, 255, 0.018), inset 0 -18px 26px rgba(0, 0, 0, 0.24), 0 22px 42px -22px rgba(0, 0, 0, 0.9)",
      "bjork-shadow-inset": "inset 0 1px 10px rgba(0, 0, 0, 0.45)",
      "bjork-ring-offset": "#080808"
    }
  },
  "css": {
    ".bjork-range": {
      "box-shadow": "inset 0 1px 1px rgba(255, 255, 255, 0.04), 0 0 14px rgba(189, 69, 20, 0.06)"
    },
    ".bjork-range::-webkit-slider-thumb": {
      "appearance": "none",
      "width": "16px",
      "height": "8px",
      "border": "0",
      "border-radius": "999px",
      "background": "var(--bjork-thumb)",
      "box-shadow": "inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.42)"
    },
    ".bjork-range::-moz-range-thumb": {
      "width": "16px",
      "height": "8px",
      "border": "0",
      "border-radius": "999px",
      "background": "var(--bjork-thumb)",
      "box-shadow": "inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.42)"
    },
    ".bjork-layered-button-accent, .bjork-layered-button-raised": {
      "position": "relative",
      "isolation": "isolate",
      "appearance": "none",
      "overflow": "hidden",
      "border": "0",
      "border-radius": "13px",
      "box-shadow": "inset 0 1px 0 #ffffff38, 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",
      "transition": "filter 150ms ease-out, box-shadow 150ms ease-out"
    },
    ".bjork-layered-button-accent::after, .bjork-layered-button-raised::after": {
      "position": "absolute",
      "inset": "0",
      "pointer-events": "none",
      "content": "\"\"",
      "border": "1.5px solid transparent",
      "border-radius": "inherit",
      "background": "linear-gradient(#ffffffb8, #0000003d 41% 75%, #ffffff47) border-box",
      "mix-blend-mode": "overlay",
      "-webkit-mask-image": "linear-gradient(#000, #000), linear-gradient(#000, #000)",
      "mask-image": "linear-gradient(#000, #000), linear-gradient(#000, #000)",
      "-webkit-mask-clip": "padding-box, border-box",
      "mask-clip": "padding-box, border-box",
      "-webkit-mask-origin": "padding-box, border-box",
      "mask-origin": "padding-box, border-box",
      "-webkit-mask-composite": "xor",
      "mask-composite": "exclude"
    },
    ".bjork-layered-button-accent": {
      "color": "oklch(100% 0 0)",
      "text-shadow": "0 -1px #00000040",
      "background": "radial-gradient(ellipse at -20px top, rgba(255, 255, 255, 0.14), transparent), linear-gradient(180deg, #ec5c13 0%, #ec5c13 62%, color-mix(in oklab, #ec5c13 84%, black 16%) 100%)"
    },
    ".bjork-layered-button-raised": {
      "color": "oklch(100% 0 0)",
      "text-shadow": "0 -1px #00000026",
      "background": "radial-gradient(ellipse at -20px top, #ffffff38, #fff0), linear-gradient(180deg, oklch(0.1881 0.006 265), oklch(0.5493 0.0081 265))"
    },
    ".dark .bjork-layered-button-raised": {
      "color": "oklch(0.2574 0.0056 265)",
      "text-shadow": "0 -1px #00000026",
      "background": "radial-gradient(ellipse at -20px top, #ffffff38, #fff0), linear-gradient(180deg, color-mix(in oklab, oklch(0.9674 0.0013 265) 80%, oklch(0.2574 0.0056 265) 20%), color-mix(in oklab, oklch(0.669 0.0107 265) 80%, oklch(0.2574 0.0056 265) 20%))"
    },
    "@media (hover: hover)": {
      ".bjork-layered-button-accent:hover": {
        "filter": "brightness(1.08) saturate(1.04)"
      },
      ".bjork-layered-button-raised:hover": {
        "filter": "brightness(1.08) contrast(0.9)"
      }
    }
  },
  "meta": {
    "collection": "Tables",
    "registryUrl": "https://ui.isaiahbjork.com/transactions-table.json",
    "installCommand": "npx shadcn@latest add https://ui.isaiahbjork.com/transactions-table.json"
  },
  "type": "registry:component"
}