{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkout-success-receipt",
  "type": "registry:component",
  "title": "Checkout Success Receipt",
  "description": "An order confirmation with a self-drawing success mark, a paper receipt that prints out of a slot with perforated edges and a barcode, and a delivery timeline. Download receipt saves a text file locally unless you handle it.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "checkout",
    "checkout",
    "confirmation",
    "receipt",
    "success",
    "delivery timeline",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/checkout-success-receipt",
  "files": [
    {
      "path": "registry/hyperblur/checkout-success-receipt.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/checkout-success-receipt.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ReceiptItem {\n  name: string;\n  detail: string;\n  quantity: number;\n  price: number;\n}\n\nexport interface ReceiptStage {\n  label: string;\n  date: string;\n}\n\nexport interface ReceiptOrder {\n  number: string;\n  date: string;\n  customer: string;\n  email: string;\n  payment: string;\n  items: ReceiptItem[];\n  shipping: number;\n  tax: number;\n}\n\nexport interface CheckoutSuccessReceiptProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  merchant?: string;\n  order?: ReceiptOrder;\n  stages?: ReceiptStage[];\n  currentStage?: number;\n  currency?: string;\n  continueCta?: { label: string; href: string };\n  onDownload?: (orderNumber: string) => void;\n  accent?: string;\n}\n\nconst defaultOrder: ReceiptOrder = {\n  number: \"NW-20931\",\n  date: \"Nov 4, 2026\",\n  customer: \"Maya Lindqvist\",\n  email: \"maya@studio.co\",\n  payment: \"Visa ending 4242\",\n  items: [\n    { name: \"Field Jacket\", detail: \"Olive, M\", quantity: 1, price: 168 },\n    { name: \"Merino Crew Socks\", detail: \"Charcoal, 3-pack\", quantity: 2, price: 32 },\n    { name: \"Canvas Weekender\", detail: \"Sand\", quantity: 1, price: 124 },\n  ],\n  shipping: 12,\n  tax: 29.04,\n};\n\nconst defaultStages: ReceiptStage[] = [\n  { label: \"Order placed\", date: \"Today, 10:42\" },\n  { label: \"Packed\", date: \"Nov 5\" },\n  { label: \"Shipped\", date: \"Nov 5\" },\n  { label: \"Delivered\", date: \"Est. Nov 7\" },\n];\n\nfunction hash(n: number) {\n  let x = (n + 1) * 2654435761;\n  x = (x ^ (x >>> 15)) >>> 0;\n  return x % 1000;\n}\n\nconst css = `\n.hb-qg6 {\n  --hb-qg6-accent: #10b981;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  isolation: isolate;\n  overflow: hidden;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-qg6 *, .hb-qg6 *::before, .hb-qg6 *::after { box-sizing: border-box; }\n.hb-qg6::before { content: \"\"; position: absolute; left: -10%; top: -30%; width: 60%; height: 90%; z-index: -1; background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-qg6-accent) 18%, transparent), transparent); }\n.hb-qg6-inner { max-width: 1120px; margin: 0 auto; padding: clamp(44px, 7cqw, 104px) clamp(16px, 4cqw, 32px); display: grid; gap: 40px; align-items: center; }\n@container (min-width: 820px) { .hb-qg6-inner { grid-template-columns: 1fr 420px; gap: 64px; } }\n.hb-qg6-mark { position: relative; width: 76px; height: 76px; }\n.hb-qg6-mark svg { position: relative; width: 76px; height: 76px; }\n.hb-qg6-circ { stroke-dasharray: 214; stroke-dashoffset: 214; animation: hb-qg6-draw .7s cubic-bezier(.6,0,.3,1) forwards; }\n.hb-qg6-tick { stroke-dasharray: 40; stroke-dashoffset: 40; animation: hb-qg6-draw .4s .6s ease-out forwards; }\n@keyframes hb-qg6-draw { to { stroke-dashoffset: 0; } }\n.hb-qg6-fillc { transform-origin: center; transform: scale(0); animation: hb-qg6-grow .45s .55s cubic-bezier(.3,1.4,.5,1) forwards; }\n@keyframes hb-qg6-grow { to { transform: scale(1); } }\n.hb-qg6-wave { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--hb-qg6-accent); opacity: 0; animation: hb-qg6-wave 1.6s .8s ease-out 2; }\n@keyframes hb-qg6-wave { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2); opacity: 0; } }\n.hb-qg6-dot { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: var(--hb-qg6-accent); opacity: 0; animation: hb-qg6-burst .9s .7s cubic-bezier(.2,.8,.2,1) forwards; }\n@keyframes hb-qg6-burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(var(--d)); } }\n.hb-qg6-title { margin: 26px 0 0; font-size: clamp(32px, 5cqw, 52px); letter-spacing: -0.04em; line-height: 1.02; font-weight: 600; }\n.hb-qg6-lead { margin: 14px 0 0; font-size: 16px; line-height: 1.6; color: #8f8f8f; max-width: 480px; }\n.hb-qg6-lead b { color: #ededed; font-weight: 500; }\n.hb-qg6-tl { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 520px; }\n.hb-qg6-st { position: relative; display: grid; gap: 4px; padding-top: 22px; font-size: 12px; color: #6b6b6b; }\n.hb-qg6-st::before { content: \"\"; position: absolute; top: 6px; left: 14px; right: -2px; height: 2px; background: rgba(255,255,255,.1); }\n.hb-qg6-st:last-child::before { display: none; }\n.hb-qg6-st::after { content: \"\"; position: absolute; top: 6px; left: 14px; right: -2px; height: 2px; background: var(--hb-qg6-accent); transform: scaleX(0); transform-origin: left; animation: hb-qg6-line .5s cubic-bezier(.2,.8,.2,1) forwards; animation-delay: var(--dl); }\n.hb-qg6-st[data-state=\"todo\"]::after, .hb-qg6-st[data-state=\"current\"]::after, .hb-qg6-st:last-child::after { display: none; }\n@keyframes hb-qg6-line { to { transform: scaleX(1); } }\n.hb-qg6-node { position: absolute; top: 0; left: 0; width: 14px; height: 14px; border-radius: 50%; background: #0a0a0a; border: 2px solid rgba(255,255,255,.18); }\n.hb-qg6-st[data-state=\"done\"] .hb-qg6-node { background: var(--hb-qg6-accent); border-color: var(--hb-qg6-accent); }\n.hb-qg6-st[data-state=\"current\"] .hb-qg6-node { border-color: var(--hb-qg6-accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--hb-qg6-accent) 60%, transparent); animation: hb-qg6-ping 1.8s ease-out infinite; }\n@keyframes hb-qg6-ping { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }\n.hb-qg6-st b { font-weight: 500; color: #a1a1a1; font-size: 13px; }\n.hb-qg6-st[data-state=\"done\"] b, .hb-qg6-st[data-state=\"current\"] b { color: #ededed; }\n.hb-qg6-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }\n.hb-qg6-btn { height: 46px; padding: 0 20px; border-radius: 999px; font: inherit; font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none; transition: filter .2s, background .2s, transform .15s; }\n.hb-qg6-btn svg { width: 15px; height: 15px; }\n.hb-qg6-primary { border: 0; background: #ededed; color: #0a0a0a; }\n.hb-qg6-primary:hover { filter: brightness(.92); }\n.hb-qg6-ghost { border: 1px solid rgba(255,255,255,.14); background: transparent; color: #ededed; }\n.hb-qg6-ghost:hover { background: rgba(255,255,255,.05); }\n.hb-qg6-btn:active { transform: translateY(1px); }\n.hb-qg6-btn:focus-visible { outline: 2px solid var(--hb-qg6-accent); outline-offset: 3px; }\n.hb-qg6-paperwrap { position: relative; justify-self: center; width: 100%; max-width: 420px; }\n.hb-qg6-slot { height: 10px; border-radius: 6px; background: #1a1a1a; box-shadow: inset 0 2px 4px rgba(0,0,0,.8), 0 1px 0 rgba(255,255,255,.06); margin: 0 -8px; position: relative; z-index: 2; }\n.hb-qg6-clip { overflow: hidden; margin-top: -5px; padding: 0 0 20px; filter: drop-shadow(0 24px 30px rgba(0,0,0,.5)); }\n.hb-qg6-paper { position: relative; background: #f4f2ec; color: #1a1a1a; padding: 26px 24px 30px; transform: translateY(-100%); animation: hb-qg6-print 1.4s .3s cubic-bezier(.3,.7,.2,1) forwards; -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 5.5px, #000 6px) 0 100% / 16px 12px repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 11px) no-repeat; mask: radial-gradient(circle 6px at 50% 100%, transparent 5.5px, #000 6px) 0 100% / 16px 12px repeat-x, linear-gradient(#000, #000) 0 0 / 100% calc(100% - 11px) no-repeat; }\n@keyframes hb-qg6-print { to { transform: none; } }\n.hb-qg6-rh { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }\n.hb-qg6-rh b { font-size: 15px; letter-spacing: -0.01em; }\n.hb-qg6-rh small { display: block; font-size: 11px; color: #6f6c64; margin-top: 2px; }\n.hb-qg6-paid { font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--hb-qg6-accent); border: 1.5px solid currentColor; border-radius: 6px; padding: 3px 7px; transform: rotate(-6deg); }\n.hb-qg6-tear { position: relative; height: 1px; margin: 18px -24px; background-image: linear-gradient(90deg, rgba(0,0,0,.25) 50%, transparent 50%); background-size: 8px 1px; }\n.hb-qg6-tear::before, .hb-qg6-tear::after { content: \"\"; position: absolute; top: -8px; width: 16px; height: 16px; border-radius: 50%; background: #0a0a0a; }\n.hb-qg6-tear::before { left: -8px; }\n.hb-qg6-tear::after { right: -8px; }\n.hb-qg6-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13px; }\n.hb-qg6-items li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: baseline; }\n.hb-qg6-items em { font-style: normal; font-size: 11px; color: #6f6c64; font-variant-numeric: tabular-nums; }\n.hb-qg6-items small { display: block; font-size: 11px; color: #6f6c64; }\n.hb-qg6-items span:last-child { font-variant-numeric: tabular-nums; }\n.hb-qg6-tot { display: grid; gap: 6px; font-size: 12px; color: #4b4943; font-variant-numeric: tabular-nums; }\n.hb-qg6-tot div { display: flex; justify-content: space-between; }\n.hb-qg6-tot div[data-big=\"true\"] { font-size: 16px; font-weight: 700; color: #1a1a1a; margin-top: 6px; }\n.hb-qg6-meta { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 11px; color: #6f6c64; }\n.hb-qg6-meta b { display: block; color: #1a1a1a; font-size: 12px; font-weight: 600; margin-top: 2px; }\n.hb-qg6-code { margin-top: 18px; display: flex; align-items: flex-end; gap: 1.5px; height: 36px; }\n.hb-qg6-code i { display: block; background: #1a1a1a; height: 100%; }\n.hb-qg6-num { font-size: 10px; letter-spacing: .3em; color: #6f6c64; text-align: center; margin-top: 6px; font-variant-numeric: tabular-nums; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-qg6 *, .hb-qg6 *::before, .hb-qg6 *::after { animation: none !important; transition: none !important; }\n  .hb-qg6-circ, .hb-qg6-tick { stroke-dashoffset: 0; }\n  .hb-qg6-fillc, .hb-qg6-paper, .hb-qg6-st::after { transform: none; }\n  .hb-qg6-dot, .hb-qg6-wave { display: none; }\n}\n`;\n\nexport function CheckoutSuccessReceipt({\n  title = \"Order confirmed\",\n  merchant = \"Northwind Supply\",\n  order = defaultOrder,\n  stages = defaultStages,\n  currentStage = 1,\n  currency = \"USD\",\n  continueCta = { label: \"Continue shopping\", href: \"#\" },\n  onDownload,\n  accent = \"#10b981\",\n  className = \"\",\n  style,\n  ...rest\n}: CheckoutSuccessReceiptProps) {\n  const money = React.useMemo(() => new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency }), [currency]);\n  const subtotal = order.items.reduce((s, i) => s + i.price * i.quantity, 0);\n  const total = subtotal + order.shipping + order.tax;\n  const first = order.customer.split(\" \")[0];\n\n  const download = () => {\n    if (onDownload) {\n      onDownload(order.number);\n      return;\n    }\n    const lines = [\n      `${merchant} receipt`,\n      `Order ${order.number}, ${order.date}`,\n      `Billed to ${order.customer} <${order.email}>`,\n      \"\",\n      ...order.items.map((i) => `${i.quantity} x ${i.name} (${i.detail})  ${money.format(i.price * i.quantity)}`),\n      \"\",\n      `Subtotal  ${money.format(subtotal)}`,\n      `Shipping  ${money.format(order.shipping)}`,\n      `Tax  ${money.format(order.tax)}`,\n      `Total  ${money.format(total)}`,\n      `Paid with ${order.payment}`,\n    ];\n    const url = URL.createObjectURL(new Blob([lines.join(\"\\n\")], { type: \"text/plain\" }));\n    const a = document.createElement(\"a\");\n    a.href = url;\n    a.download = `receipt-${order.number}.txt`;\n    a.click();\n    setTimeout(() => URL.revokeObjectURL(url), 1000);\n  };\n\n  const bars = Array.from({ length: 46 }, (_, i) => 1 + (hash(i) % 3));\n  const dots = Array.from({ length: 10 }, (_, i) => ({ a: i * 36 + (hash(i) % 14), d: 44 + (hash(i + 20) % 22) }));\n  const vars = { \"--hb-qg6-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-qg6 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-checkout-success-receipt\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qg6-inner\">\n        <div>\n          <div className=\"hb-qg6-mark\" aria-hidden=\"true\">\n            <span className=\"hb-qg6-wave\" />\n            {dots.map((d, i) => (\n              <span key={i} className=\"hb-qg6-dot\" style={{ \"--a\": `${d.a}deg`, \"--d\": `-${d.d}px` } as React.CSSProperties} />\n            ))}\n            <svg viewBox=\"0 0 76 76\" fill=\"none\">\n              <circle className=\"hb-qg6-fillc\" cx=\"38\" cy=\"38\" r=\"34\" fill=\"color-mix(in srgb, var(--hb-qg6-accent) 16%, transparent)\" />\n              <circle className=\"hb-qg6-circ\" cx=\"38\" cy=\"38\" r=\"34\" stroke=\"var(--hb-qg6-accent)\" strokeWidth=\"3\" strokeLinecap=\"round\" transform=\"rotate(-90 38 38)\" />\n              <path className=\"hb-qg6-tick\" d=\"M25 39.5l9 9L52 30\" stroke=\"var(--hb-qg6-accent)\" strokeWidth=\"4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n            </svg>\n          </div>\n          <h2 className=\"hb-qg6-title\">{title}</h2>\n          <p className=\"hb-qg6-lead\">\n            Thanks, {first}. Order <b>{order.number}</b> is being packed. We sent the receipt to <b>{order.email}</b> and will text you when it ships.\n          </p>\n          <ol className=\"hb-qg6-tl\" aria-label=\"Delivery progress\">\n            {stages.map((s, i) => {\n              const state = i < currentStage ? \"done\" : i === currentStage ? \"current\" : \"todo\";\n              return (\n                <li key={s.label} className=\"hb-qg6-st\" data-state={state} style={{ \"--dl\": `${(1.1 + i * 0.25).toFixed(2)}s` } as React.CSSProperties} aria-current={state === \"current\" ? \"step\" : undefined}>\n                  <span className=\"hb-qg6-node\" aria-hidden=\"true\" />\n                  <b>{s.label}</b>\n                  <span>{s.date}</span>\n                </li>\n              );\n            })}\n          </ol>\n          <div className=\"hb-qg6-actions\">\n            <button type=\"button\" className=\"hb-qg6-btn hb-qg6-primary\" onClick={download}>\n              <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M8 2.5v8M4.5 7L8 10.5 11.5 7M3 13.5h10\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n              Download receipt\n            </button>\n            <a className=\"hb-qg6-btn hb-qg6-ghost\" href={continueCta.href}>\n              {continueCta.label}\n              <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M3.5 8h9M8.5 4l4 4-4 4\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>\n            </a>\n          </div>\n        </div>\n        <div className=\"hb-qg6-paperwrap\">\n          <div className=\"hb-qg6-slot\" aria-hidden=\"true\" />\n          <div className=\"hb-qg6-clip\">\n            <article className=\"hb-qg6-paper\" aria-label={`Receipt for order ${order.number}`}>\n              <div className=\"hb-qg6-rh\">\n                <div>\n                  <b>{merchant}</b>\n                  <small>Receipt {order.number}</small>\n                  <small>{order.date}</small>\n                </div>\n                <span className=\"hb-qg6-paid\">PAID</span>\n              </div>\n              <div className=\"hb-qg6-tear\" aria-hidden=\"true\" />\n              <ul className=\"hb-qg6-items\">\n                {order.items.map((it) => (\n                  <li key={it.name}>\n                    <em>{it.quantity}x</em>\n                    <span>{it.name}<small>{it.detail}</small></span>\n                    <span>{money.format(it.price * it.quantity)}</span>\n                  </li>\n                ))}\n              </ul>\n              <div className=\"hb-qg6-tear\" aria-hidden=\"true\" />\n              <div className=\"hb-qg6-tot\">\n                <div><span>Subtotal</span><span>{money.format(subtotal)}</span></div>\n                <div><span>Shipping</span><span>{money.format(order.shipping)}</span></div>\n                <div><span>Tax</span><span>{money.format(order.tax)}</span></div>\n                <div data-big=\"true\"><span>Total</span><span>{money.format(total)}</span></div>\n              </div>\n              <div className=\"hb-qg6-meta\">\n                <div>Billed to<b>{order.customer}</b></div>\n                <div>Payment<b>{order.payment}</b></div>\n              </div>\n              <div className=\"hb-qg6-code\" aria-hidden=\"true\">\n                {bars.map((w, i) => <i key={i} style={{ width: `${w}px`, opacity: i % 7 === 3 ? 0 : 1 }} />)}\n              </div>\n              <div className=\"hb-qg6-num\" aria-hidden=\"true\">{order.number.replace(/\\D/g, \"\").padEnd(12, \"0\")}</div>\n            </article>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}