{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "author": "Lopifi (https://lopifi.com)",
  "categories": [
    "ledger-tables",
    "finance",
    "accounting"
  ],
  "dependencies": [
    "@base-ui-components/react"
  ],
  "description": "CSV/XLSX/PDF with a stated scope.",
  "files": [
    {
      "content": "\"use client\";\n\nimport { Menu } from \"@base-ui-components/react/menu\";\nimport { cn } from \"@/lib/ledger/cn\";\nimport { ArrowDownTrayIcon } from \"@/components/ledger/icons\";\n\nexport interface ExportMenuProps {\n  className?: string;\n  onExport: (format: \"csv\" | \"xlsx\" | \"pdf\") => void;\n  /** Stated explicitly — exporting the page when the user expected the full\n      filtered set is a silent data error. */\n  scopeCount: number;\n  scopeDescription: string;\n}\n\nexport function ExportMenu({ scopeCount, scopeDescription, onExport, className }: ExportMenuProps) {\n  return (\n    <Menu.Root>\n      <Menu.Trigger\n        className={cn(\n          \"inline-flex h-8 items-center gap-2 rounded-sm border border-border bg-surface px-3 text-label font-medium\",\n          \"transition-colors duration-1 ease-standard hover:bg-surface-hover\",\n          className,\n        )}\n      >\n        <ArrowDownTrayIcon aria-hidden=\"true\" className=\"size-3.5\" />\n        Export\n      </Menu.Trigger>\n      <Menu.Portal>\n        <Menu.Positioner align=\"end\" className=\"z-dropdown\" sideOffset={8}>\n          <Menu.Popup\n            className=\"w-[280px] rounded-md border border-border bg-surface-raised p-1 shadow-elevation-3\"\n            style={{ transformOrigin: \"var(--transform-origin)\" }}\n          >\n            <p className=\"px-3 py-2 text-caption text-text-secondary\">\n              Exports <span className=\"numeric font-medium\">{scopeCount.toLocaleString()}</span>{\" \"}\n              {scopeDescription}. The resolved period and filters are written into the file header.\n            </p>\n            {([\"csv\", \"xlsx\", \"pdf\"] as const).map((f) => (\n              <Menu.Item\n                className=\"cursor-pointer rounded-xs px-3 py-2 text-body outline-none data-[highlighted]:bg-surface-hover\"\n                key={f}\n                onClick={() => onExport(f)}\n              >\n                Export as {f.toUpperCase()}\n              </Menu.Item>\n            ))}\n          </Menu.Popup>\n        </Menu.Positioner>\n      </Menu.Portal>\n    </Menu.Root>\n  );\n}\n",
      "path": "components/ledger/export-menu.tsx",
      "target": "components/ledger/export-menu.tsx",
      "type": "registry:component"
    }
  ],
  "name": "export-menu",
  "registryDependencies": [
    "@lopifi/theme",
    "@lopifi/cn",
    "@lopifi/icons"
  ],
  "title": "ExportMenu",
  "type": "registry:component"
}
