{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "block-invoice",
  "type": "registry:block",
  "title": "Invoice",
  "description": "One invoice as a document on a raised page: who bills whom, the lines and totals, how it was paid, and downloading or sending it.",
  "dependencies": [
    "@remixicon/react@^4.9.0"
  ],
  "registryDependencies": [
    "https://wideset.co/r/app-shell.json",
    "https://wideset.co/r/avatar.json",
    "https://wideset.co/r/block-styles.json",
    "https://wideset.co/r/breadcrumbs.json",
    "https://wideset.co/r/button.json",
    "https://wideset.co/r/card.json",
    "https://wideset.co/r/divider.json",
    "https://wideset.co/r/dropdown-menu.json",
    "https://wideset.co/r/icon-button.json",
    "https://wideset.co/r/list-item.json",
    "https://wideset.co/r/sidebar.json",
    "https://wideset.co/r/status-badge.json",
    "https://wideset.co/r/table.json",
    "https://wideset.co/r/text-input.json",
    "https://wideset.co/r/utils.json"
  ],
  "files": [
    {
      "path": "src/blocks/invoice/activity-timeline.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/activity-timeline.tsx",
      "content": "'use client';\n\n// TODO(custom): activity timeline; no Timeline in Wideset.\nimport {\n  type RemixiconComponentType,\n  RiBankCardLine,\n  RiEyeLine,\n  RiFileTextLine,\n  RiMailSendLine,\n} from '@remixicon/react';\n\nimport type { InvoiceEvent, InvoiceEventKind } from './data';\nimport { formatDateTime } from './format';\n\nconst ICON: Record<InvoiceEventKind, RemixiconComponentType> = {\n  created: RiFileTextLine,\n  paid: RiBankCardLine,\n  sent: RiMailSendLine,\n  viewed: RiEyeLine,\n};\n\n/** What happened to the invoice, newest first, on one line of marks: the event, then when. */\nexport function ActivityTimeline({ items }: { items: InvoiceEvent[] }) {\n  return (\n    <ol className=\"flex flex-col\">\n      {items.map((item, index) => {\n        const Icon = ICON[item.kind];\n        const last = index === items.length - 1;\n        return (\n          <li key={item.id} className=\"gap-ws-7 relative flex\">\n            {last ? null : (\n              <span\n                aria-hidden=\"true\"\n                className=\"border-ws-static-base top-ws-15 bottom-ws-3 left-ws-9 absolute border-l\"\n              />\n            )}\n            <span\n              aria-hidden=\"true\"\n              className=\"size-ws-14 rounded-ws-control-full border-ws-static-base bg-ws-static-foreground text-ws-static-subtle flex shrink-0 items-center justify-center border\"\n            >\n              <Icon className=\"size-ws-8\" />\n            </span>\n            <div className={last ? 'pt-ws-2 min-w-0 flex-1' : 'pt-ws-2 pb-ws-11 min-w-0 flex-1'}>\n              <p className=\"typography-body-md text-ws-static-base\">{item.label}</p>\n              <time\n                dateTime={item.at}\n                className=\"typography-caption-md text-ws-static-subtle tabular-nums\"\n              >\n                {formatDateTime(item.at)}\n              </time>\n            </div>\n          </li>\n        );\n      })}\n    </ol>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/brand-mark.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/brand-mark.tsx",
      "content": "'use client';\n\nimport { cn } from '@/lib/wideset/utils';\n\nconst TILE =\n  'M0 16C0 8.45753 0 4.68629 2.34315 2.34315C4.68629 0 8.45753 0 16 0C23.5425 0 27.3137 0 29.6569 2.34315C32 4.68629 32 8.45753 32 16C32 23.5425 32 27.3137 29.6569 29.6569C27.3137 32 23.5425 32 16 32C8.45753 32 4.68629 32 2.34315 29.6569C0 27.3137 0 23.5425 0 16Z';\n\n/**\n * Orbit's mark: a planet and its ring on the inverse tile, so it inverts in dark mode. It takes\n * the size of its place (32px in a sidebar, 36px in a larger switcher). Decorative beside the\n * product's name; give it a `label` when it stands alone.\n */\nexport function BrandMark({ className, label }: { className?: string; label?: string }) {\n  return (\n    <svg\n      viewBox=\"0 0 32 32\"\n      role={label ? 'img' : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn('size-ws-14 shrink-0', className)}\n    >\n      <path d={TILE} className=\"fill-(--ws-static-fill-inverse-background)\" />\n      <ellipse\n        cx=\"16\"\n        cy=\"16\"\n        rx=\"10.5\"\n        ry=\"4\"\n        transform=\"rotate(-28 16 16)\"\n        strokeWidth=\"1.75\"\n        className=\"fill-none stroke-(--ws-static-text-inverse-strong)\"\n      />\n      <circle cx=\"16\" cy=\"16\" r=\"4.75\" className=\"fill-(--ws-static-text-inverse-strong)\" />\n    </svg>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/data.ts",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/data.ts",
      "content": "import {\n  type RemixiconComponentType,\n  RiBankCardFill,\n  RiBankCardLine,\n  RiContactsBook3Line,\n  RiHandCoinLine,\n  RiHome5Line,\n  RiInbox2Line,\n  RiKey2Line,\n  RiLineChartLine,\n  RiPieChart2Line,\n  RiPlugLine,\n  RiQuestionLine,\n  RiSettings3Line,\n  RiTeamLine,\n} from '@remixicon/react';\n\n/*\n  One invoice from Billing's list: ORB-2026-0097, October's Growth seats for Lumen Studio, 36 at\n  $39 = $1,404.00, charged to the card on the day it was issued. Orbit Inc. is a US company and\n  Lumen Studio Ltd a UK business with a VAT number, so the VAT is reverse-charged: 0% on the\n  invoice, and Lumen Studio accounts for it to HMRC. Every total is worked out from the lines.\n*/\n\n/** The product is Orbit; the workspace paying for it is Lumen Studio. */\nexport const product = { name: 'Orbit' };\nexport const workspace = { name: 'Lumen Studio', initials: 'LS' };\nexport const account = { name: 'Maya Okafor', email: 'maya@lumenstudio.co', initials: 'MO' };\n\nexport type NavLink = {\n  id: string;\n  label: string;\n  icon: RemixiconComponentType;\n  /** The icon while the page is open (a line icon swaps for its fill). */\n  activeIcon?: RemixiconComponentType;\n};\n\nexport const mainLinks: NavLink[] = [\n  { id: 'home', label: 'Home', icon: RiHome5Line },\n  { id: 'inbox', label: 'Inbox', icon: RiInbox2Line },\n  { id: 'customers', label: 'Customers', icon: RiContactsBook3Line },\n  { id: 'deals', label: 'Deals', icon: RiHandCoinLine },\n  { id: 'revenue', label: 'Revenue', icon: RiLineChartLine },\n  { id: 'reports', label: 'Reports', icon: RiPieChart2Line },\n];\n\nexport const settingsLinks: NavLink[] = [\n  { id: 'general', label: 'General', icon: RiSettings3Line },\n  { id: 'members', label: 'Members', icon: RiTeamLine },\n  { id: 'billing', label: 'Billing', icon: RiBankCardLine, activeIcon: RiBankCardFill },\n  { id: 'integrations', label: 'Integrations', icon: RiPlugLine },\n  { id: 'api-keys', label: 'API keys', icon: RiKey2Line },\n];\n\nexport const helpLink: NavLink = { id: 'help', label: 'Help and support', icon: RiQuestionLine };\n\n/** A company on the invoice: who bills, or who is billed. */\nexport type Party = { name: string; address: string[]; taxId: string; email: string };\n\nexport const issuer: Party = {\n  name: 'Orbit Inc.',\n  address: ['548 Market Street, Suite 41210', 'San Francisco, CA 94104', 'United States'],\n  taxId: 'EIN 88-4127305',\n  email: 'billing@orbit.so',\n};\n\nexport const billedTo: Party = {\n  name: 'Lumen Studio Ltd',\n  address: ['21 Hoxton Square', 'London N1 6NN', 'United Kingdom'],\n  taxId: 'VAT GB 318 4471 26',\n  email: 'finance@lumenstudio.co',\n};\n\nexport type InvoiceLine = {\n  id: string;\n  description: string;\n  /** What the line covers, under its description. */\n  detail: string;\n  quantity: number;\n  /** The quantity's unit, after the number (\"36 seats\"). */\n  unit: string;\n  unitPrice: number;\n};\n\nexport const invoice = {\n  number: 'ORB-2026-0097',\n  /** As Billing's list words it. */\n  description: 'Growth, 36 seats',\n  status: 'Paid',\n  currency: 'USD',\n  issued: '2026-10-01',\n  /** Charged automatically, so it falls due the day it is issued. */\n  due: '2026-10-01',\n  paid: '2026-10-01',\n  period: { from: '2026-10-01', to: '2026-10-31' },\n  lines: [\n    {\n      id: 'growth-seats',\n      description: 'Growth plan',\n      detail: 'Seats, billed monthly',\n      quantity: 36,\n      unit: 'seats',\n      unitPrice: 39,\n    },\n  ] satisfies InvoiceLine[],\n  vat: { rate: 0, label: 'reverse charge' },\n  card: { brand: 'Mastercard', last4: '8812' },\n};\n\n/** Rounds to whole cents, the way the totals are charged. */\nconst cents = (value: number) => Math.round(value * 100) / 100;\n\nexport const lineAmount = (line: InvoiceLine) => cents(line.quantity * line.unitPrice);\nexport const subtotal = cents(invoice.lines.reduce((sum, line) => sum + lineAmount(line), 0));\nexport const vatAmount = cents(subtotal * invoice.vat.rate);\nexport const total = cents(subtotal + vatAmount);\nexport const amountPaid = total;\nexport const amountDue = cents(total - amountPaid);\n\nexport type InvoiceEventKind = 'created' | 'paid' | 'sent' | 'viewed';\n\nexport type InvoiceEvent = {\n  id: string;\n  kind: InvoiceEventKind;\n  /** What happened, as one line. */\n  label: string;\n  /** ISO date and time, UTC. */\n  at: string;\n};\n\n/** What happened to the invoice, newest first. */\nexport const activity: InvoiceEvent[] = [\n  {\n    id: 'viewed',\n    kind: 'viewed',\n    label: `Viewed by ${account.name}`,\n    at: '2026-10-02T08:24:00Z',\n  },\n  {\n    id: 'sent',\n    kind: 'sent',\n    label: `Sent to ${billedTo.email}`,\n    at: '2026-10-01T09:02:00Z',\n  },\n  {\n    id: 'paid',\n    kind: 'paid',\n    label: `Paid with ${invoice.card.brand} ending ${invoice.card.last4}`,\n    at: '2026-10-01T09:01:00Z',\n  },\n  {\n    id: 'created',\n    kind: 'created',\n    label: `Issued by ${issuer.name}`,\n    at: '2026-10-01T09:00:00Z',\n  },\n];\n"
    },
    {
      "path": "src/blocks/invoice/format.ts",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/format.ts",
      "content": "// One locale for the whole screen; swap it for the user's.\nconst LOCALE = 'en-US';\n\nconst usd = new Intl.NumberFormat(LOCALE, { style: 'currency', currency: 'USD' });\nconst percent = new Intl.NumberFormat(LOCALE, { style: 'percent', maximumFractionDigits: 2 });\n// Dates are calendar days (`2026-10-01`), parsed as UTC midnight: format them in UTC too.\nconst date = new Intl.DateTimeFormat(LOCALE, {\n  day: 'numeric',\n  month: 'short',\n  year: 'numeric',\n  timeZone: 'UTC',\n});\nconst dateTime = new Intl.DateTimeFormat(LOCALE, {\n  dateStyle: 'medium',\n  timeStyle: 'short',\n  timeZone: 'UTC',\n});\n\nexport const formatUsd = (value: number) => usd.format(value);\nexport const formatPercent = (rate: number) => percent.format(rate);\nexport const formatDate = (iso: string) => date.format(new Date(iso));\n/** Oct 1, 2026, 9:01 AM. */\nexport const formatDateTime = (iso: string) => dateTime.format(new Date(iso));\n/** Oct 1 – 31, 2026. */\nexport const formatPeriod = (from: string, to: string) =>\n  date.formatRange(new Date(from), new Date(to));\n"
    },
    {
      "path": "src/blocks/invoice/index.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/index.tsx",
      "content": "'use client';\n\nimport '@/styles/wideset-blocks.css';\n\nimport { RiSideBarLine } from '@remixicon/react';\nimport { AppShell } from '@/components/ui/wideset/app-shell/AppShell';\nimport { Breadcrumbs } from '@/components/ui/wideset/breadcrumbs/Breadcrumbs';\nimport { cn } from '@/lib/wideset/utils';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { useId, useState } from 'react';\n\nimport { ActivityTimeline } from './activity-timeline';\nimport { activity, invoice } from './data';\nimport { InvoiceDocument } from './invoice-document';\nimport { InvoiceHeader } from './invoice-header';\nimport { InvoiceSidebar } from './sidebar';\n\n/** One column of the page: the header and the body share its edges. */\nconst COLUMN = 'px-ws-14 mx-auto w-full max-w-[80rem]';\n\n/**\n * Invoice (Inset direction): one invoice as a document on the raised page beside the workspace\n * sidebar. The header names it and holds what to do with it; the document is the page's one\n * object, its activity a narrow column beside it.\n */\nexport default function Invoice() {\n  const activityId = useId();\n  const sidebarId = useId();\n  const [collapsed, setCollapsed] = useState(false);\n\n  return (\n    <AppShell className=\"ws-block-utility\" direction=\"inset\">\n      <InvoiceSidebar id={sidebarId} collapsed={collapsed} onCollapsedChange={setCollapsed} />\n      <AppShell.Main>\n        <div className=\"h-ws-18 border-ws-static-base flex shrink-0 items-center border-b\">\n          {/* The bar belongs to the surround: it runs edge to edge. The sidebar's toggle is pulled\n              left so its glyph, not its box, sits 20px from the edge; the crumbs follow it. */}\n          <div className=\"gap-ws-5 px-ws-11 flex w-full items-center\">\n            <IconButton\n              icon={RiSideBarLine}\n              variant=\"secondary\"\n              preset=\"ghost\"\n              size=\"sm\"\n              iconClassName=\"text-ws-static-subtle size-ws-9\"\n              aria-label={collapsed ? 'Expand sidebar' : 'Collapse sidebar'}\n              aria-expanded={!collapsed}\n              aria-controls={sidebarId}\n              onClick={() => setCollapsed(!collapsed)}\n              className=\"-ml-ws-5\"\n            />\n            <Breadcrumbs separator=\"arrow\">\n              <Breadcrumbs.Item asChild>\n                <a href=\"#settings\">Settings</a>\n              </Breadcrumbs.Item>\n              <Breadcrumbs.Item asChild>\n                <a href=\"#billing\">Billing</a>\n              </Breadcrumbs.Item>\n              <Breadcrumbs.Item>{invoice.number}</Breadcrumbs.Item>\n            </Breadcrumbs>\n          </div>\n        </div>\n\n        {/* The page scrolls inside the card, so the card's corners stay put. */}\n        <div className=\"ws-scrollbar min-h-0 flex-1 overflow-y-auto\">\n          <div className={cn(COLUMN, 'gap-ws-12 pt-ws-14 pb-ws-16 flex flex-col')}>\n            <InvoiceHeader />\n\n            <div className=\"gap-ws-16 grid grid-cols-1 items-start lg:grid-cols-[minmax(0,1fr)_18rem]\">\n              <InvoiceDocument />\n\n              <aside aria-labelledby={activityId} className=\"gap-ws-9 flex flex-col\">\n                <h2 id={activityId} className=\"typography-label-strong-md text-ws-static-strong\">\n                  Activity\n                </h2>\n                <ActivityTimeline items={activity} />\n              </aside>\n            </div>\n          </div>\n        </div>\n      </AppShell.Main>\n    </AppShell>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/invoice-document.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/invoice-document.tsx",
      "content": "'use client';\n\nimport { Card } from '@/components/ui/wideset/card/Card';\n\nimport { BrandMark } from './brand-mark';\nimport { billedTo, invoice, issuer, type Party, product, total } from './data';\nimport { formatDate, formatPeriod, formatUsd } from './format';\nimport { InvoiceTotals } from './invoice-totals';\nimport { KeyValue } from './key-value';\nimport { LineItemsTable } from './line-items-table';\n\n/** A company's block on the invoice: its legal name, address and tax number, one per line. */\nfunction PartyLines({ party }: { party: Party }) {\n  return (\n    <>\n      {[party.name, ...party.address, party.taxId].map((line) => (\n        <span key={line} className=\"block\">\n          {line}\n        </span>\n      ))}\n    </>\n  );\n}\n\n/**\n * The invoice as a document, the page's one object: who bills whom, the dates, the lines and what\n * they come to, how it was paid. The total stands at the top, where the eye lands first.\n */\nexport function InvoiceDocument() {\n  return (\n    <Card aria-label={`Invoice ${invoice.number}`} role=\"article\">\n      <Card.Header>\n        <div className=\"gap-ws-9 flex items-start justify-between\">\n          <div className=\"gap-ws-5 flex items-center\">\n            <BrandMark />\n            <span className=\"typography-label-strong-md text-ws-static-strong\">{product.name}</span>\n          </div>\n          <div className=\"gap-ws-2 flex flex-col items-end\">\n            <span className=\"typography-title-md text-ws-static-strong tabular-nums\">\n              {formatUsd(total)}\n            </span>\n            <span className=\"typography-body-md text-ws-static-subtle tabular-nums\">\n              Paid on {formatDate(invoice.paid)}\n            </span>\n          </div>\n        </div>\n      </Card.Header>\n      <Card.Content>\n        <div className=\"gap-ws-14 flex flex-col\">\n          <dl className=\"gap-ws-12 grid grid-cols-2\">\n            <KeyValue label=\"From\">\n              <PartyLines party={issuer} />\n            </KeyValue>\n            <KeyValue label=\"Billed to\">\n              <PartyLines party={billedTo} />\n            </KeyValue>\n          </dl>\n\n          <dl className=\"gap-ws-12 grid grid-cols-4\">\n            <KeyValue label=\"Invoice number\">{invoice.number}</KeyValue>\n            <KeyValue label=\"Issued\">{formatDate(invoice.issued)}</KeyValue>\n            <KeyValue label=\"Due\">{formatDate(invoice.due)}</KeyValue>\n            <KeyValue label=\"Billing period\">\n              {formatPeriod(invoice.period.from, invoice.period.to)}\n            </KeyValue>\n          </dl>\n\n          <div className=\"gap-ws-12 flex flex-col\">\n            <LineItemsTable />\n            <div className=\"gap-ws-12 grid grid-cols-[minmax(0,1fr)_18rem] items-start\">\n              <dl className=\"gap-ws-11 flex flex-col\">\n                <KeyValue label=\"Paid with\">\n                  {invoice.card.brand} ending {invoice.card.last4}\n                </KeyValue>\n                <KeyValue label=\"Note\">\n                  Reverse charge: {billedTo.name} accounts for the VAT to HMRC. Questions about this\n                  invoice go to {issuer.email}.\n                </KeyValue>\n              </dl>\n              <InvoiceTotals />\n            </div>\n          </div>\n        </div>\n      </Card.Content>\n    </Card>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/invoice-header.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/invoice-header.tsx",
      "content": "'use client';\n\nimport {\n  type RemixiconComponentType,\n  RiDownload2Line,\n  RiLinkM,\n  RiMoreFill,\n  RiPrinterLine,\n  RiReceiptLine,\n  RiSendPlaneLine,\n} from '@remixicon/react';\nimport { Button } from '@/components/ui/wideset/button/Button';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { StatusBadge } from '@/components/ui/wideset/status-badge/StatusBadge';\n\nimport { invoice } from './data';\nimport { formatPeriod } from './format';\n\nconst MENU: { label: string; icon: RemixiconComponentType }[] = [\n  { label: 'Copy link', icon: RiLinkM },\n  { label: 'Print', icon: RiPrinterLine },\n  { label: 'Download receipt', icon: RiReceiptLine },\n];\n\n/**\n * The invoice's header: its number and status, what it bills for, then what to do with it,\n * primary last. Paid is a lifecycle state, so the badge stays neutral.\n */\nexport function InvoiceHeader() {\n  return (\n    <header className=\"gap-ws-12 flex flex-wrap items-center justify-between\">\n      <div className=\"gap-ws-2 flex min-w-0 flex-col\">\n        <div className=\"gap-ws-7 flex items-center\">\n          <h1 className=\"typography-title-sm text-ws-static-strong tabular-nums\">\n            {invoice.number}\n          </h1>\n          <StatusBadge size=\"lg\">{invoice.status}</StatusBadge>\n        </div>\n        <p className=\"typography-body-md text-ws-static-subtle tabular-nums\">\n          {invoice.description}, {formatPeriod(invoice.period.from, invoice.period.to)}\n        </p>\n      </div>\n\n      <div className=\"gap-ws-5 flex items-center\">\n        <DropdownMenu>\n          <DropdownMenu.Trigger asChild>\n            <IconButton\n              icon={RiMoreFill}\n              variant=\"secondary\"\n              preset=\"border\"\n              size=\"sm\"\n              aria-label=\"More actions\"\n            />\n          </DropdownMenu.Trigger>\n          <DropdownMenu.Content align=\"end\" className=\"ws-block-utility w-[14rem]\">\n            {MENU.map(({ label, icon: Icon }) => (\n              <DropdownMenu.Item key={label}>\n                <ListItem.Prefix>\n                  <Icon className=\"size-ws-9\" />\n                </ListItem.Prefix>\n                <ListItem.Content>\n                  <ListItem.Label>{label}</ListItem.Label>\n                </ListItem.Content>\n              </DropdownMenu.Item>\n            ))}\n          </DropdownMenu.Content>\n        </DropdownMenu>\n        <Button variant=\"secondary\" preset=\"border\" size=\"sm\">\n          <Button.Icon icon={RiSendPlaneLine} />\n          Send\n        </Button>\n        <Button size=\"sm\">\n          <Button.Icon icon={RiDownload2Line} />\n          Download PDF\n        </Button>\n      </div>\n    </header>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/invoice-totals.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/invoice-totals.tsx",
      "content": "'use client';\n\n// TODO(custom): invoice totals (label and amount rows, ruled into groups); no DescriptionList in Wideset.\nimport { cn } from '@/lib/wideset/utils';\n\nimport { amountDue, amountPaid, invoice, subtotal, total, vatAmount } from './data';\nimport { formatPercent, formatUsd } from './format';\n\ntype RowProps = { label: string; value: number; strong?: boolean };\n\n/**\n * A label and its amount on one row; `strong` for the figures the reader is after, which also\n * open a group under a line. The line is the row's own border: a `dl` holds only its rows.\n */\nfunction Row({ label, value, strong }: RowProps) {\n  const type = strong\n    ? 'typography-label-strong-md text-ws-static-strong'\n    : 'typography-body-md text-ws-static-base';\n  return (\n    <div\n      className={cn(\n        'gap-ws-9 flex items-baseline justify-between',\n        strong && 'border-ws-static-base pt-ws-7 border-t',\n      )}\n    >\n      <dt className={strong ? type : 'typography-body-md text-ws-static-subtle'}>{label}</dt>\n      <dd className={`${type} tabular-nums`}>{formatUsd(value)}</dd>\n    </div>\n  );\n}\n\n/**\n * The sums under the lines: what they come to, the VAT on top, the total, what was paid and what\n * is left to pay. Every figure is worked out from the lines in `data.ts`.\n */\nexport function InvoiceTotals() {\n  return (\n    <dl className=\"gap-ws-7 flex flex-col\">\n      <Row label=\"Subtotal\" value={subtotal} />\n      <Row\n        label={`VAT ${formatPercent(invoice.vat.rate)}, ${invoice.vat.label}`}\n        value={vatAmount}\n      />\n      <Row label=\"Total\" value={total} strong />\n      <Row label=\"Amount paid\" value={amountPaid} />\n      <Row label=\"Amount due\" value={amountDue} strong />\n    </dl>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/key-value.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/key-value.tsx",
      "content": "'use client';\n\n// TODO(custom): key-value pair (label above value); no DescriptionList in Wideset.\nimport type { ReactNode } from 'react';\n\n/** A fact: its label above its value. Render inside a `dl`. */\nexport function KeyValue({ label, children }: { label: string; children: ReactNode }) {\n  return (\n    <div className=\"gap-ws-3 flex min-w-0 flex-col\">\n      <dt className=\"typography-label-sm text-ws-static-subtle\">{label}</dt>\n      <dd className=\"typography-body-md text-ws-static-base tabular-nums\">{children}</dd>\n    </div>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/line-items-table.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/line-items-table.tsx",
      "content": "'use client';\n\nimport { Table } from '@/components/ui/wideset/table/Table';\n\nimport { invoice, lineAmount } from './data';\nimport { formatUsd } from './format';\n\n/**\n * What the invoice charges for: one row per line, quantity times unit price. The outer columns\n * are flush, so the descriptions start on the document's edge and the amounts end on it.\n */\nexport function LineItemsTable() {\n  return (\n    <Table size=\"md\" aria-label=\"Invoice lines\" className=\"w-full\">\n      <Table.Head>\n        <Table.Row>\n          <Table.Header flushMargin className=\"w-full\">\n            Description\n          </Table.Header>\n          <Table.Header align=\"right\">Qty</Table.Header>\n          <Table.Header align=\"right\" className=\"whitespace-nowrap\">\n            Unit price\n          </Table.Header>\n          <Table.Header align=\"right\" flushMargin>\n            Amount\n          </Table.Header>\n        </Table.Row>\n      </Table.Head>\n      <Table.Body>\n        {invoice.lines.map((line) => (\n          <Table.Row key={line.id}>\n            <Table.Cell flushMargin>\n              <span className=\"text-ws-static-strong\">{line.description}</span>\n              <Table.CellDescription>{line.detail}</Table.CellDescription>\n            </Table.Cell>\n            <Table.Cell align=\"right\" className=\"whitespace-nowrap tabular-nums\">\n              {line.quantity} {line.unit}\n            </Table.Cell>\n            <Table.Cell align=\"right\" className=\"tabular-nums\">\n              {formatUsd(line.unitPrice)}\n            </Table.Cell>\n            <Table.Cell align=\"right\" flushMargin className=\"tabular-nums\">\n              {formatUsd(lineAmount(line))}\n            </Table.Cell>\n          </Table.Row>\n        ))}\n      </Table.Body>\n    </Table>\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/people.assets.ts",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/people.assets.ts",
      "content": "// Portraits of the sample people as small JPEG data URLs (a block ships only .ts and .tsx).\n// Exported from the Wideset Core Figma file by people.cjs: do not edit by hand.\n\n/** A person’s photo by name. People who are not here show their initials. */\nexport const PHOTOS: Record<string, string | undefined> = {\n  'Maya Okafor':\n    'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/4gHYSUNDX1BST0ZJTEUAAQEAAAHIAAAAAAQwAABtbnRyUkdCIFhZWiAH4AABAAEAAAAAAABhY3NwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAA9tYAAQAAAADTLQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAlkZXNjAAAA8AAAACRyWFlaAAABFAAAABRnWFlaAAABKAAAABRiWFlaAAABPAAAABR3dHB0AAABUAAAABRyVFJDAAABZAAAAChnVFJDAAABZAAAAChiVFJDAAABZAAAAChjcHJ0AAABjAAAADxtbHVjAAAAAAAAAAEAAAAMZW5VUwAAAAgAAAAcAHMAUgBHAEJYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAA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Ss+akeP3GDVbS+id8TJQf8FKbTxuS4U59iKvTOPPNe7RYP7iKRr6fQrHiYYPpH7fU7igOFWyPWUOr4fZ90dQqZNjQmU+DSS4r27h75qxNJ9NrBoZClwGC7NcG1cp47nFDyz4D0GKmaipYwSTRak/UPSrULGjQOUG/nK3GoV7gYdtvIbRKIyFHcoZJNKEMJSg4AAr2PqA8AK6+5sVHb/5F01E4ln2pp9gpWgHcOePCqlvlt/Spqmx/lq5TVzSXgqYIoOCEb1HyA/9NVxrVjfHafA+rG/2JoVZAVmto141vcKM+FtjP//Z',\n};\n"
    },
    {
      "path": "src/blocks/invoice/person-avatar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/person-avatar.tsx",
      "content": "'use client';\n\nimport { Avatar } from '@/components/ui/wideset/avatar/Avatar';\nimport { type AvatarProps } from '@/components/ui/wideset/avatar/Avatar.types';\n\nimport { PHOTOS } from './people.assets';\n\ntype PersonAvatarProps = Pick<\n  AvatarProps,\n  'size' | 'shape' | 'status' | 'color' | 'className' | 'style' | 'title' | 'aria-hidden'\n> & {\n  name: string;\n  initials: string;\n  /** The photo's text: empty beside the person's name, their name where the avatar stands alone. */\n  alt?: string;\n};\n\n/**\n * A person's avatar: their photo when `people.assets.ts` has one, with the initials as its\n * fallback, otherwise the initials on their colour. Every place that draws a person uses it, so\n * someone has the same face across the screen and photos mix with initials as in a real product.\n */\nexport function PersonAvatar({ name, initials, color, alt = '', ...props }: PersonAvatarProps) {\n  const photo = PHOTOS[name];\n  return photo ? (\n    <Avatar src={photo} alt={alt} initials={initials} {...props} />\n  ) : (\n    <Avatar initials={initials} color={color} {...props} />\n  );\n}\n"
    },
    {
      "path": "src/blocks/invoice/sidebar.tsx",
      "type": "registry:file",
      "target": "blocks/wideset/invoice/sidebar.tsx",
      "content": "'use client';\n\n// TODO(custom): workspace switcher and account menu are composed by hand.\nimport {\n  RiAddLine,\n  RiArrowDownSLine,\n  RiLogoutBoxRLine,\n  RiSearchLine,\n  RiSettingsLine,\n} from '@remixicon/react';\nimport { Divider } from '@/components/ui/wideset/divider/Divider';\nimport { DropdownMenu } from '@/components/ui/wideset/dropdown/DropdownMenu';\nimport { IconButton } from '@/components/ui/wideset/button/IconButton';\nimport { ListItem } from '@/components/ui/wideset/list-item/ListItem';\nimport { Sidebar } from '@/components/ui/wideset/sidebar/Sidebar';\nimport { type SidebarProps } from '@/components/ui/wideset/sidebar/Sidebar.types';\nimport { TextInput } from '@/components/ui/wideset/text-input/TextInput';\nimport { useState } from 'react';\n\nimport { BrandMark } from './brand-mark';\nimport {\n  account,\n  helpLink,\n  mainLinks,\n  type NavLink,\n  product,\n  settingsLinks,\n  workspace,\n} from './data';\nimport { PersonAvatar } from './person-avatar';\n\n/**\n * The workspace sidebar: switcher, search, the app's pages, settings and the signed-in account.\n * Its toggle sits in the page bar, so the screen holds `collapsed` and passes it down; collapsed,\n * it keeps the mark, the page icons and the avatar.\n */\nexport function InvoiceSidebar(\n  props: Pick<SidebarProps, 'id' | 'collapsed' | 'onCollapsedChange'>,\n) {\n  const [active, setActive] = useState('billing');\n\n  const link = ({ id, label, icon, activeIcon }: NavLink) => (\n    <Sidebar.Item\n      key={id}\n      href={`#${id}`}\n      icon={active === id ? (activeIcon ?? icon) : icon}\n      label={label}\n      active={active === id}\n      onClick={() => setActive(id)}\n    />\n  );\n\n  const nav = (\n    <nav aria-label=\"Workspace\" className=\"gap-ws-9 flex flex-col\">\n      <div className=\"flex flex-col\">{mainLinks.map(link)}</div>\n      <Divider weight=\"thin\" />\n      <div role=\"group\" aria-labelledby=\"sidebar-settings\" className=\"gap-ws-2 flex flex-col\">\n        <Sidebar.SectionHeader id=\"sidebar-settings\">Settings</Sidebar.SectionHeader>\n        {settingsLinks.map(link)}\n      </div>\n    </nav>\n  );\n\n  return (\n    <Sidebar {...props}>\n      <Sidebar.Header>\n        <Sidebar.Expanded>\n          <div className=\"gap-ws-9 flex flex-col\">\n            <div className=\"gap-ws-7 pt-ws-3 pb-ws-7 flex items-center\">\n              <BrandMark className=\"size-ws-15\" />\n              <div className=\"flex min-w-0 flex-1 flex-col\">\n                <span className=\"typography-label-strong-sm text-ws-static-strong truncate\">\n                  {workspace.name}\n                </span>\n                <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                  {product.name}\n                </span>\n              </div>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <IconButton\n                    icon={RiArrowDownSLine}\n                    variant=\"secondary\"\n                    preset=\"ghost\"\n                    size=\"xs\"\n                    aria-label=\"Switch workspace\"\n                    className=\"mr-ws-3\"\n                  />\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content className=\"ws-block-utility\" align=\"end\">\n                  <DropdownMenu.Item data-state=\"checked\">\n                    <ListItem.Content>\n                      <ListItem.Label>{workspace.name}</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiAddLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>New workspace</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </div>\n            <TextInput size=\"sm\">\n              <TextInput.Prefix inner>\n                <TextInput.Icon icon={RiSearchLine} />\n              </TextInput.Prefix>\n              <TextInput.Input type=\"search\" placeholder=\"Search\" aria-label=\"Search\" />\n            </TextInput>\n          </div>\n        </Sidebar.Expanded>\n        <Sidebar.Collapsed>\n          <div className=\"pt-ws-3 pb-ws-7 flex justify-center\">\n            <BrandMark className=\"size-ws-15\" />\n          </div>\n        </Sidebar.Collapsed>\n      </Sidebar.Header>\n\n      {/* A section draws only the slot for the state it is in, so the pages go in both. */}\n      <Sidebar.Section scrollable>{nav}</Sidebar.Section>\n\n      <Sidebar.Footer>\n        <div className=\"gap-ws-9 flex flex-col\">\n          <div className=\"flex flex-col\">{link(helpLink)}</div>\n          {/* On the grey ground the line keeps the nav's inset: run edge to edge, it would stop\n              short of the page and read as broken. */}\n          <div className=\"border-ws-static-base pt-ws-5 border-t\">\n            <Sidebar.Expanded>\n              <DropdownMenu>\n                <DropdownMenu.Trigger asChild>\n                  <button\n                    type=\"button\"\n                    className=\"gap-ws-5 px-ws-5 py-ws-3 rounded-ws-control-lg hover:bg-ws-dynamic-tertiary-alpha-strong-default focus-visible:wds-focus-visible outline-ws-dynamic-primary-strong-default flex w-full items-center text-left\"\n                  >\n                    <PersonAvatar name={account.name} initials={account.initials} color=\"orange\" />\n                    <span className=\"flex min-w-0 flex-1 flex-col\">\n                      <span className=\"typography-label-strong-sm text-ws-static-base truncate\">\n                        {account.name}\n                      </span>\n                      <span className=\"typography-caption-md text-ws-static-subtle truncate\">\n                        {account.email}\n                      </span>\n                    </span>\n                    <RiArrowDownSLine\n                      aria-hidden=\"true\"\n                      className=\"size-ws-9 text-ws-static-strong\"\n                    />\n                  </button>\n                </DropdownMenu.Trigger>\n                <DropdownMenu.Content side=\"top\" align=\"start\" className=\"ws-block-utility w-[14rem]\">\n                  <DropdownMenu.Item>\n                    <ListItem.Prefix>\n                      <RiSettingsLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Account settings</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                  <DropdownMenu.Separator />\n                  <DropdownMenu.Item variant=\"danger\">\n                    <ListItem.Prefix>\n                      <RiLogoutBoxRLine className=\"size-ws-9\" />\n                    </ListItem.Prefix>\n                    <ListItem.Content>\n                      <ListItem.Label>Log out</ListItem.Label>\n                    </ListItem.Content>\n                  </DropdownMenu.Item>\n                </DropdownMenu.Content>\n              </DropdownMenu>\n            </Sidebar.Expanded>\n            <Sidebar.Collapsed>\n              <div className=\"flex justify-center\">\n                <PersonAvatar\n                  name={account.name}\n                  initials={account.initials}\n                  color=\"orange\"\n                  alt={account.name}\n                  title={account.name}\n                />\n              </div>\n            </Sidebar.Collapsed>\n          </div>\n        </div>\n      </Sidebar.Footer>\n    </Sidebar>\n  );\n}\n"
    }
  ],
  "meta": {
    "version": "1.1.0",
    "commit": "a734f9f0"
  }
}
