{
  "$schema": "https://uipkge.dev/schema/registry-item.json",
  "name": "billing-account",
  "title": "Billing Account",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-angular/blocks/billing-account/billing-account.component.ts",
      "content": "// Stripe-style account billing page: current-plan card with Pro badge, price and renewal\n// date plus Upgrade / Cancel actions, usage meters for seats and projects, a payment-method\n// row with update and delete actions, and a compact billing-history list with paid badges\n// and per-invoice downloads. Port of the React block 1:1.\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core'\nimport { CreditCard, Download, LucideAngularModule, Trash2 } from 'lucide-angular'\nimport { cn } from '@/lib/utils'\nimport { UiBadgeComponent } from '@/ui/badge/badge.component'\nimport { UiButtonComponent } from '@/ui/button/button.component'\nimport {\n  UiCardComponent,\n  UiCardContentComponent,\n  UiCardDescriptionComponent,\n  UiCardHeaderComponent,\n  UiCardTitleComponent,\n} from '@/ui/card/card.component'\nimport { UiProgressComponent } from '@/ui/progress/progress.component'\nimport { UiSeparatorComponent } from '@/ui/separator/separator.component'\n\ninterface UsageMetric {\n  label: string\n  used: number\n  total: number\n}\n\ninterface Invoice {\n  id: string\n  date: string\n  amount: string\n  status: 'Paid' | 'Open' | 'Past due'\n}\n\nconst plan = {\n  name: 'Pro',\n  price: '$49',\n  cadence: 'month',\n  renewalDate: 'September 12, 2026',\n}\n\nconst usage: UsageMetric[] = [\n  { label: 'Seats', used: 18, total: 20 },\n  { label: 'Projects', used: 7, total: 10 },\n]\n\nconst paymentMethod = {\n  brand: 'Visa',\n  last4: '4242',\n  expiry: '04/28',\n}\n\nconst invoices: Invoice[] = [\n  { id: 'inv-2026-08', date: 'Aug 12, 2026', amount: '$49.00', status: 'Paid' },\n  { id: 'inv-2026-07', date: 'Jul 12, 2026', amount: '$49.00', status: 'Paid' },\n  { id: 'inv-2026-06', date: 'Jun 12, 2026', amount: '$49.00', status: 'Paid' },\n  { id: 'inv-2026-05', date: 'May 12, 2026', amount: '$49.00', status: 'Paid' },\n]\n\n@Component({\n  changeDetection: ChangeDetectionStrategy.Eager,\n  selector: 'ui-billing-account, [ui-billing-account]',\n  standalone: true,\n  // React renders the root <div> itself: the host stays out of layout and `class` goes to the root.\n  host: { '[attr.class]': '\"contents\"' },\n  imports: [\n    LucideAngularModule,\n    UiBadgeComponent,\n    UiButtonComponent,\n    UiCardComponent,\n    UiCardContentComponent,\n    UiCardDescriptionComponent,\n    UiCardHeaderComponent,\n    UiCardTitleComponent,\n    UiProgressComponent,\n    UiSeparatorComponent,\n  ],\n  template: `\n    <div data-slot=\"billing-account\" [class]=\"rootClass\">\n      <div ui-card>\n        <div ui-card-header>\n          <div class=\"flex items-center gap-2\">\n            <h3 ui-card-title>Current plan</h3>\n            <span ui-badge>{{ plan.name }}</span>\n          </div>\n          <p ui-card-description>Your subscription renews automatically each month.</p>\n        </div>\n        <div ui-card-content class=\"space-y-4\">\n          <div class=\"flex flex-wrap items-end justify-between gap-4\">\n            <div>\n              <p class=\"text-2xl font-bold tracking-tight\">\n                {{ plan.price }}\n                <span class=\"text-muted-foreground text-sm font-normal\">/ {{ plan.cadence }}</span>\n              </p>\n              <p class=\"text-muted-foreground mt-1 text-xs\">Renews on {{ plan.renewalDate }}</p>\n            </div>\n            <div class=\"flex items-center gap-2\">\n              <button ui-button size=\"sm\">Upgrade</button>\n              <button ui-button variant=\"ghost\" size=\"sm\" class=\"text-destructive hover:text-destructive\">\n                Cancel subscription\n              </button>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div ui-card>\n        <div ui-card-header>\n          <h3 ui-card-title>Usage</h3>\n          <p ui-card-description>Consumption against your plan limits this cycle.</p>\n        </div>\n        <div ui-card-content class=\"space-y-5\">\n          @for (metric of usageMetrics; track metric.label) {\n            <div class=\"space-y-2\">\n              <div class=\"flex items-center justify-between text-sm\">\n                <span class=\"font-medium\">{{ metric.label }}</span>\n                <span class=\"text-muted-foreground text-xs tabular-nums\">\n                  {{ metric.used }} of {{ metric.total }} used\n                </span>\n              </div>\n              <ui-progress [value]=\"(metric.used / metric.total) * 100\" />\n            </div>\n          }\n        </div>\n      </div>\n\n      <div ui-card>\n        <div ui-card-header>\n          <h3 ui-card-title>Payment method</h3>\n          <p ui-card-description>Charged when your subscription renews.</p>\n        </div>\n        <div ui-card-content>\n          <div class=\"flex items-center justify-between gap-4\">\n            <div class=\"flex items-center gap-3\">\n              <div\n                class=\"bg-muted text-muted-foreground border-border flex size-9 shrink-0 items-center justify-center rounded-md border shadow-xs\"\n                aria-hidden=\"true\"\n              >\n                <lucide-icon [img]=\"CreditCard\" class=\"size-4\" />\n              </div>\n              <div>\n                <p class=\"text-sm font-medium tabular-nums\">•••• •••• •••• {{ paymentMethod.last4 }}</p>\n                <p class=\"text-muted-foreground text-xs\">\n                  {{ paymentMethod.brand }} · Expires {{ paymentMethod.expiry }}\n                </p>\n              </div>\n            </div>\n            <div class=\"flex items-center gap-1\">\n              <button ui-button variant=\"ghost\" size=\"sm\">Update</button>\n              <button ui-button variant=\"ghost\" size=\"icon-sm\" aria-label=\"Delete payment method\">\n                <lucide-icon [img]=\"Trash2\" class=\"text-muted-foreground size-4\" />\n              </button>\n            </div>\n          </div>\n        </div>\n      </div>\n\n      <div ui-card>\n        <div ui-card-header>\n          <h3 ui-card-title>Billing history</h3>\n          <p ui-card-description>Invoices from the last 12 months.</p>\n        </div>\n        <div ui-card-content>\n          <ul class=\"-my-2 divide-y\">\n            @for (invoice of invoiceList; track invoice.id) {\n              <li class=\"flex items-center justify-between gap-4 py-3\">\n                <div class=\"min-w-0\">\n                  <p class=\"text-sm font-medium\">{{ invoice.date }}</p>\n                  <p class=\"text-muted-foreground text-xs tabular-nums\">{{ invoice.amount }}</p>\n                </div>\n                <div class=\"flex items-center gap-2\">\n                  <span ui-badge variant=\"success\">{{ invoice.status }}</span>\n                  <ui-separator orientation=\"vertical\" class=\"!h-4\" />\n                  <button ui-button variant=\"ghost\" size=\"icon-sm\" aria-label=\"Download invoice\">\n                    <lucide-icon [img]=\"Download\" class=\"text-muted-foreground size-4\" />\n                  </button>\n                </div>\n              </li>\n            }\n          </ul>\n        </div>\n      </div>\n    </div>\n  `,\n})\nexport class UiBillingAccountComponent {\n  protected readonly CreditCard = CreditCard\n  protected readonly Download = Download\n  protected readonly Trash2 = Trash2\n\n  protected readonly plan = plan\n  protected readonly usageMetrics = usage\n  protected readonly paymentMethod = paymentMethod\n  protected readonly invoiceList = invoices\n\n  @Input('class') className?: string\n\n  get rootClass(): string {\n    return cn('mx-auto w-full max-w-2xl space-y-6', this.className)\n  }\n}\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/billing-account/billing-account.component.ts"
    },
    {
      "path": "packages/registry-angular/blocks/billing-account/index.ts",
      "content": "export { UiBillingAccountComponent } from './billing-account.component'\n",
      "type": "registry:block",
      "target": "~/src/app/components/blocks/billing-account/index.ts"
    }
  ],
  "dependencies": [
    "lucide-angular"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://uipkge.dev/r/angular/badge.json",
    "https://uipkge.dev/r/angular/button.json",
    "https://uipkge.dev/r/angular/card.json",
    "https://uipkge.dev/r/angular/progress.json",
    "https://uipkge.dev/r/angular/separator.json"
  ],
  "description": "Stripe-style account billing page: current-plan card with Pro badge, price and renewal date plus Upgrade / Cancel actions, usage meters for seats and projects, a payment-method row with update and delete actions, and a compact billing-history list with paid badges and per-invoice downloads.",
  "categories": [
    "finance",
    "app",
    "billing"
  ]
}