{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "pay-invoice-card",
  "type": "registry:component",
  "title": "Pay Invoice Card",
  "description": "An invoice summary with a Paid, Due or Overdue status pill, line items, download and pay buttons, and a perforated bottom edge.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "payments",
    "invoice",
    "billing",
    "receipt",
    "status",
    "payment",
    "card"
  ],
  "docs": "https://hyperblur.dev/effects/pay-invoice-card",
  "files": [
    {
      "path": "registry/hyperblur/pay-invoice-card.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/pay-invoice-card.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport type PayInvoiceStatus = \"paid\" | \"due\" | \"overdue\";\n\nexport interface PayInvoiceLine {\n  name: string;\n  quantity?: number;\n  price: number;\n}\n\nexport interface PayInvoiceCardProps extends React.HTMLAttributes<HTMLDivElement> {\n  number?: string;\n  status?: PayInvoiceStatus;\n  billedTo?: string;\n  dueDate?: string;\n  paidDate?: string;\n  items?: PayInvoiceLine[];\n  currency?: string;\n  onDownload?: () => void;\n  onPay?: () => void;\n  downloadLabel?: string;\n  payLabel?: string;\n  accent?: string;\n}\n\nconst defaultItems: PayInvoiceLine[] = [\n  { name: \"Brand identity sprint\", quantity: 1, price: 240000 },\n  { name: \"Illustration set\", quantity: 6, price: 18000 },\n  { name: \"Hosting, 12 months\", quantity: 1, price: 14400 },\n];\n\nconst css = `\n.hb-qfb {\n  box-sizing: border-box;\n  width: 100%;\n  color: #ededed;\n  font-family: inherit;\n  font-size: 13px;\n  line-height: 1.4;\n}\n.hb-qfb *, .hb-qfb *::before, .hb-qfb *::after { box-sizing: border-box; }\n.hb-qfb-sheet {\n  position: relative;\n  padding: 12px 14px 18px;\n  background: linear-gradient(180deg, #151515, #111111);\n  border-radius: 14px;\n  box-shadow: 0 0 0 1px #262626 inset;\n  -webkit-mask: radial-gradient(circle at 50% 100%, transparent 5px, #000 5.5px) 0 0 / 16px 100% repeat-x;\n  mask: radial-gradient(circle at 50% 100%, transparent 5px, #000 5.5px) 0 0 / 16px 100% repeat-x;\n}\n.hb-qfb-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }\n.hb-qfb-hd > div { display: flex; align-items: baseline; gap: 8px; }\n.hb-qfb-lab { display: inline; color: #8f8f8f; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }\n.hb-qfb-no { display: inline; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }\n.hb-qfb-pill {\n  display: inline-flex;\n  flex: none;\n  align-items: center;\n  gap: 6px;\n  padding: 3px 10px 3px 8px;\n  color: var(--hb-qfb-s);\n  font-size: 12px;\n  font-weight: 600;\n  background: color-mix(in srgb, var(--hb-qfb-s) 14%, transparent);\n  border: 1px solid color-mix(in srgb, var(--hb-qfb-s) 32%, transparent);\n  border-radius: 999px;\n}\n.hb-qfb-pill i { width: 6px; height: 6px; background: var(--hb-qfb-s); border-radius: 50%; }\n.hb-qfb[data-status=\"overdue\"] .hb-qfb-pill i { animation: hb-qfb-beat 1.6s ease-in-out infinite; }\n.hb-qfb[data-status=\"paid\"] { --hb-qfb-s: #3ddc97; }\n.hb-qfb[data-status=\"due\"] { --hb-qfb-s: #ffb340; }\n.hb-qfb[data-status=\"overdue\"] { --hb-qfb-s: #ff5d6c; }\n.hb-qfb-sub { margin: 4px 0 0; color: #8f8f8f; font-size: 12px; }\n.hb-qfb-sub b { color: #cfcfcf; font-weight: 500; }\n.hb-qfb-items { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; padding: 0; list-style: none; }\n.hb-qfb-it { display: flex; align-items: baseline; gap: 8px; min-height: 20px; animation: hb-qfb-in 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i) * 70ms); }\n.hb-qfb-nm { overflow: hidden; min-width: 0; flex: 1; text-overflow: ellipsis; white-space: nowrap; }\n.hb-qfb-q { flex: none; color: #6f6f6f; font-size: 12px; font-variant-numeric: tabular-nums; }\n.hb-qfb-am { flex: none; min-width: 64px; font-variant-numeric: tabular-nums; text-align: right; }\n.hb-qfb-tear { height: 0; margin: 8px 0 6px; border-top: 1.5px dashed #333333; }\n.hb-qfb-tot { display: flex; align-items: baseline; justify-content: space-between; margin: 0; }\n.hb-qfb-tot span { color: #a1a1a1; }\n.hb-qfb-tot b { font-size: 20px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }\n.hb-qfb-acts { display: flex; gap: 8px; margin-top: 10px; }\n.hb-qfb-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 7px;\n  height: 32px;\n  margin: 0;\n  padding: 0 14px;\n  font: inherit;\n  font-size: 13px;\n  font-weight: 600;\n  border-radius: 9px;\n  cursor: pointer;\n  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s ease, border-color 0.2s ease;\n  -webkit-tap-highlight-color: transparent;\n}\n.hb-qfb-btn:hover { transform: translateY(-1px); }\n.hb-qfb-btn:active { transform: scale(0.97); }\n.hb-qfb-btn:focus-visible { outline: 2px solid var(--hb-qfb-x); outline-offset: 2px; }\n.hb-qfb-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }\n.hb-qfb-dl { flex: 1; color: #ededed; background: transparent; border: 1px solid #333333; }\n.hb-qfb-dl:hover { background: #1c1c1c; border-color: #4a4a4a; }\n.hb-qfb-pay { flex: 1.3; color: #fff; background: var(--hb-qfb-x); background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0)); border: 0; }\n.hb-qfb[data-status=\"overdue\"] .hb-qfb-pay { background-color: #e5384a; }\n@keyframes hb-qfb-beat { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(1.5); } }\n@keyframes hb-qfb-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-qfb-it, .hb-qfb[data-status=\"overdue\"] .hb-qfb-pill i { animation: none; }\n  .hb-qfb-btn { transition: none; }\n}\n`;\n\nconst statusLabel: Record<PayInvoiceStatus, string> = { paid: \"Paid\", due: \"Due\", overdue: \"Overdue\" };\n\nfunction money(cents: number, currency: string) {\n  const whole = Math.floor(cents / 100)\n    .toString()\n    .replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n  return `${currency}${whole}.${(cents % 100).toString().padStart(2, \"0\")}`;\n}\n\nexport function PayInvoiceCard({\n  number = \"INV-2041\",\n  status = \"due\",\n  billedTo = \"Orchard Studio\",\n  dueDate = \"Nov 11, 2026\",\n  paidDate = \"Nov 2, 2026\",\n  items = defaultItems,\n  currency = \"$\",\n  onDownload,\n  onPay,\n  downloadLabel = \"Download PDF\",\n  payLabel = \"Pay now\",\n  accent = \"#2f7bff\",\n  className = \"\",\n  style,\n  ...rest\n}: PayInvoiceCardProps) {\n  const total = items.reduce((sum, item) => sum + item.price * (item.quantity ?? 1), 0);\n  const vars = { \"--hb-qfb-x\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <div className={`hb-qfb ${className}`} style={vars} data-status={status} {...rest}>\n      <style href=\"hb-pay-invoice-card\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qfb-sheet\">\n        <div className=\"hb-qfb-hd\">\n          <div>\n            <span className=\"hb-qfb-lab\">Invoice</span>\n            <span className=\"hb-qfb-no\">{number}</span>\n          </div>\n          <span className=\"hb-qfb-pill\">\n            <i aria-hidden=\"true\" />\n            {statusLabel[status]}\n          </span>\n        </div>\n        <p className=\"hb-qfb-sub\">\n          Billed to <b>{billedTo}</b> &middot; {status === \"paid\" ? `Paid ${paidDate}` : `${status === \"overdue\" ? \"Was due\" : \"Due\"} ${dueDate}`}\n        </p>\n        <ul className=\"hb-qfb-items\">\n          {items.map((item, i) => (\n            <li key={item.name} className=\"hb-qfb-it\" style={{ \"--i\": i } as React.CSSProperties}>\n              <span className=\"hb-qfb-nm\">{item.name}</span>\n              {(item.quantity ?? 1) > 1 && <span className=\"hb-qfb-q\">x{item.quantity}</span>}\n              <span className=\"hb-qfb-am\">{money(item.price * (item.quantity ?? 1), currency)}</span>\n            </li>\n          ))}\n        </ul>\n        <div className=\"hb-qfb-tear\" aria-hidden=\"true\" />\n        <p className=\"hb-qfb-tot\">\n          <span>{status === \"paid\" ? \"Total paid\" : \"Amount due\"}</span>\n          <b>{money(total, currency)}</b>\n        </p>\n        <div className=\"hb-qfb-acts\">\n          <button type=\"button\" className=\"hb-qfb-btn hb-qfb-dl\" onClick={onDownload}>\n            <svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n              <path d=\"M12 4v11M7.5 11l4.5 4.5 4.5-4.5M5 19.5h14\" />\n            </svg>\n            {downloadLabel}\n          </button>\n          {status !== \"paid\" && (\n            <button type=\"button\" className=\"hb-qfb-btn hb-qfb-pay\" onClick={onPay}>\n              {payLabel} {money(total, currency)}\n            </button>\n          )}\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}