{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "invoice-list",
  "type": "registry:block",
  "title": "Invoice list",
  "description": "Billing records with status filters, readable amounts, optional document links, and empty states.",
  "categories": [
    "blocks"
  ],
  "dependencies": [
    "@tabler/icons-react"
  ],
  "registryDependencies": [
    "card"
  ],
  "files": [
    {
      "path": "src/registry/overtrue/invoice-list.tsx",
      "type": "registry:component",
      "target": "components/overtrue/invoice-list.tsx",
      "content": "\"use client\";\nimport { useState } from \"react\";\nimport { IconArrowDown, IconFileInvoice } from \"@tabler/icons-react\";\nimport { SectionCard } from \"./section-card\";\nimport { StatusBadge } from \"./status-badge\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface Invoice {\n  id: string;\n  description: string;\n  date: string;\n  amount: string;\n  status: \"Paid\" | \"Open\" | \"Overdue\";\n  href?: string;\n}\nconst filters = [\"All\", \"Paid\", \"Open\", \"Overdue\"] as const;\nexport function InvoiceList({\n  invoices,\n  className,\n}: {\n  invoices: readonly Invoice[];\n  className?: string;\n}) {\n  const [filter, setFilter] = useState<(typeof filters)[number]>(\"All\");\n  const visible = invoices.filter(\n    (invoice) => filter === \"All\" || invoice.status === filter,\n  );\n  return (\n    <SectionCard\n      title=\"Billing history\"\n      description=\"Invoices and receipts for your workspace.\"\n      className={cn(\"shadow-none\", className)}\n      contentClassName=\"p-0\"\n    >\n      <div\n        aria-label=\"Filter invoices\"\n        className=\"flex flex-wrap gap-1 border-b border-border px-5 py-3\"\n      >\n        {filters.map((value) => (\n          <button\n            key={value}\n            type=\"button\"\n            aria-pressed={filter === value}\n            onClick={() => setFilter(value)}\n            className={cn(\n              \"rounded-md px-3 py-1.5 text-xs font-medium transition-colors focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\",\n              filter === value\n                ? \"bg-muted text-foreground\"\n                : \"text-muted-foreground hover:bg-muted/60 hover:text-foreground\",\n            )}\n          >\n            {value}\n          </button>\n        ))}\n      </div>\n      <ul\n        aria-label=\"Invoices\"\n        className=\"m-0 list-none divide-y divide-border p-0\"\n      >\n        {visible.map((invoice) => (\n          <li\n            key={invoice.id}\n            className=\"flex flex-wrap items-center gap-x-4 gap-y-3 px-5 py-4\"\n          >\n            <span className=\"hidden size-9 shrink-0 items-center justify-center rounded-lg border border-border text-muted-foreground sm:flex\">\n              <IconFileInvoice aria-hidden=\"true\" className=\"size-4\" />\n            </span>\n            <div className=\"min-w-0 flex-1 basis-36\">\n              <p className=\"m-0 text-sm font-medium [overflow-wrap:anywhere]\">\n                {invoice.id}\n              </p>\n              <p className=\"m-0 mt-1 text-xs leading-5 text-muted-foreground [overflow-wrap:anywhere]\">\n                {invoice.description} · {invoice.date}\n              </p>\n            </div>\n            <div className=\"flex items-center gap-3\">\n              <span className=\"text-sm font-medium tabular-nums\">\n                {invoice.amount}\n              </span>\n              <StatusBadge\n                variant={\n                  invoice.status === \"Paid\"\n                    ? \"success\"\n                    : invoice.status === \"Overdue\"\n                      ? \"error\"\n                      : \"neutral\"\n                }\n              >\n                {invoice.status}\n              </StatusBadge>\n              {invoice.href && (\n                <a\n                  href={invoice.href}\n                  aria-label={`Download invoice ${invoice.id}`}\n                  className=\"inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring\"\n                >\n                  <IconArrowDown aria-hidden=\"true\" className=\"size-4\" />\n                </a>\n              )}\n            </div>\n          </li>\n        ))}\n      </ul>\n      {!visible.length && (\n        <p\n          role=\"status\"\n          className=\"m-0 px-5 py-10 text-center text-sm text-muted-foreground\"\n        >\n          {invoices.length\n            ? \"No invoices with this status.\"\n            : \"Your invoices will appear here.\"}\n        </p>\n      )}\n      <p\n        aria-live=\"polite\"\n        className=\"m-0 border-t border-border px-5 py-3 text-xs tabular-nums text-muted-foreground\"\n      >\n        {visible.length} {visible.length === 1 ? \"invoice\" : \"invoices\"}\n        {filter !== \"All\" && ` · ${filter.toLowerCase()}`}\n      </p>\n    </SectionCard>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/section-card.tsx",
      "type": "registry:component",
      "target": "components/overtrue/section-card.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport {\n  Card,\n  CardContent,\n  CardHeader,\n  CardTitle,\n  CardDescription,\n} from \"@/components/ui/card\";\nimport { cn } from \"@/lib/utils\";\n\nexport interface SectionCardProps extends Omit<\n  ComponentProps<typeof Card>,\n  \"title\"\n> {\n  title?: ReactNode;\n  description?: ReactNode;\n  actions?: ReactNode;\n  contentClassName?: string;\n}\n\n/** A shared heading, actions and content surface for admin panels. */\nexport function SectionCard({\n  title,\n  description,\n  actions,\n  children,\n  className,\n  contentClassName,\n  ...props\n}: SectionCardProps) {\n  return (\n    <Card\n      data-slot=\"section-card\"\n      className={cn(\n        \"min-w-0 gap-0 rounded-2xl border border-border/70 bg-card py-0 text-card-foreground ring-0\",\n        \"shadow-[0_1px_2px_rgb(0_0_0/0.04),0_8px_24px_-12px_rgb(0_0_0/0.10)] dark:shadow-[inset_0_1px_0_rgb(255_255_255/0.05),0_1px_2px_rgb(0_0_0/0.5)]\",\n        className,\n      )}\n      {...props}\n    >\n      {(title || description || actions) && (\n        <CardHeader className=\"flex flex-row flex-wrap items-center justify-between gap-x-4 gap-y-3 border-b border-border/60 px-5 py-4 [.border-b]:pb-4\">\n          <div data-slot=\"section-card-heading\" className=\"min-w-0 flex-1\">\n            {title && (\n              <CardTitle className=\"m-0 text-sm leading-6 font-semibold tracking-tight text-card-foreground\">\n                {title}\n              </CardTitle>\n            )}\n            {description && (\n              <CardDescription className=\"m-0 mt-0.5 text-[13px] leading-5 text-muted-foreground\">\n                {description}\n              </CardDescription>\n            )}\n          </div>\n          {actions && (\n            <div\n              data-slot=\"section-card-actions\"\n              className=\"flex shrink-0 items-center gap-2\"\n            >\n              {actions}\n            </div>\n          )}\n        </CardHeader>\n      )}\n      <CardContent className={cn(\"p-5\", contentClassName)}>\n        {children}\n      </CardContent>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/registry/overtrue/status-badge.tsx",
      "type": "registry:component",
      "target": "components/overtrue/status-badge.tsx",
      "content": "import type { ComponentProps, ReactNode } from \"react\";\nimport { cn } from \"@/lib/utils\";\n\nconst variants = {\n  success:\n    \"bg-emerald-500/10 text-emerald-700 ring-emerald-600/20 dark:bg-emerald-400/10 dark:text-emerald-300 dark:ring-emerald-400/25\",\n  warning:\n    \"bg-amber-500/10 text-amber-700 ring-amber-600/20 dark:bg-amber-400/10 dark:text-amber-300 dark:ring-amber-400/25\",\n  // Tinted text leans toward the foreground so it stays legible on its own tint.\n  error:\n    \"bg-destructive/10 text-[color-mix(in_oklab,var(--color-destructive)_85%,var(--color-foreground))] ring-destructive/20 dark:ring-destructive/30\",\n  info: \"bg-primary/10 text-[color-mix(in_oklab,var(--color-primary)_85%,var(--color-foreground))] ring-primary/20 dark:ring-primary/30\",\n  neutral:\n    \"bg-muted/70 text-[color-mix(in_oklab,var(--color-muted-foreground)_85%,var(--color-foreground))] ring-border dark:bg-muted/50\",\n};\nconst dots = {\n  success: \"bg-emerald-500 dark:bg-emerald-400\",\n  warning: \"bg-amber-500 dark:bg-amber-400\",\n  error: \"bg-destructive\",\n  info: \"bg-primary\",\n  neutral: \"bg-muted-foreground/70\",\n};\nconst styles = `@keyframes status-badge-pulse{0%{transform:scale(1);opacity:.6}70%,100%{transform:scale(2.75);opacity:0}}`;\n\nexport interface StatusBadgeProps\n  extends Omit<ComponentProps<\"span\">, \"children\"> {\n  children: ReactNode;\n  variant?: keyof typeof variants;\n  /** Pulse the dot softly for states that are happening right now. */\n  live?: boolean;\n}\n\nexport function StatusBadge({\n  children,\n  variant = \"neutral\",\n  live = false,\n  className,\n  ...props\n}: StatusBadgeProps) {\n  return (\n    <span\n      data-slot=\"status-badge\"\n      data-variant={variant}\n      data-live={live || undefined}\n      className={cn(\n        \"inline-flex items-center gap-1.5 whitespace-nowrap rounded-full py-0.5 pr-2.5 pl-2 text-xs leading-5 font-medium tabular-nums ring-1 ring-inset\",\n        variants[variant],\n        className,\n      )}\n      {...props}\n    >\n      {live ? (\n        <style href=\"overtrue-status-badge\" precedence=\"default\">\n          {styles}\n        </style>\n      ) : null}\n      <span\n        aria-hidden=\"true\"\n        data-slot=\"status-badge-dot\"\n        className=\"relative flex size-1.5 shrink-0\"\n      >\n        {live ? (\n          <span\n            className={cn(\n              \"absolute inset-0 rounded-full motion-safe:animate-[status-badge-pulse_2s_cubic-bezier(0.22,1,0.36,1)_infinite] motion-reduce:hidden\",\n              dots[variant],\n            )}\n          />\n        ) : null}\n        <span className={cn(\"relative size-1.5 rounded-full\", dots[variant])} />\n      </span>\n      {children}\n    </span>\n  );\n}\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/invoice-list. Requires an initialized shadcn/ui project with Tailwind CSS v4."
}
