{
  "component": {
    "id": "invoice-preview",
    "name": "Invoice preview",
    "tier": "pro",
    "exampleId": "invoice-preview",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/invoice-preview-demo.tsx",
    "exportName": "InvoicePreviewDemo",
    "sha256": "a965afab18812a9c5d49030471b995b30894fe03acdf643f0358fd81dc63666a",
    "helperImports": [],
    "directComponentImports": [
      "invoice-preview"
    ],
    "sampleBoundary": "Existing local demo fixture with fictional data and callbacks. No live service, customer data, access key, or Pro source is included."
  },
  "install": {
    "command": "npx shadcn@latest add @tidal-pro/invoice-preview",
    "registryUrl": "https://tidalui.com/r/pro/invoice-preview.json",
    "namespace": "@tidal-pro",
    "access": "pro",
    "sourceDelivery": "server-gated",
    "requiresAuthorization": true,
    "tokenSource": "local-env",
    "tokenEnvName": "TIDALUI_TOKEN",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "@tidal-pro/invoice-preview",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/invoice-preview",
      "registryUrl": "https://tidalui.com/r/pro/invoice-preview.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/invoice-preview.tsx",
    "exports": [
      "TidalInvoiceLineItem",
      "TidalInvoicePreview"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/invoice-preview.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "invoice-preview"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/invoice-preview.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/invoice-preview.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/invoice-preview-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useMemo, useState } from \"react\";\n\nimport { TidalInvoicePreview, type TidalInvoiceLineItem } from \"./components/ui/invoice-preview\";\n\nimport \"./components/ui/invoice-preview.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .invoice-preview-demo,\\n.tidal-scope .invoice-preview-demo * {\\n  box-sizing: border-box;\\n}\\n\\n.tidal-scope .invoice-preview-demo {\\n  width: 100%;\\n  max-width: 1120px;\\n  min-width: 0;\\n  container: invoice-preview-demo / inline-size;\\n}\\n\\n.tidal-scope .invoice-preview-demo-layout {\\n  display: grid;\\n  min-width: 0;\\n  gap: 12px;\\n  padding: 20px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 22px;\\n  background:\\n    linear-gradient(var(--t-border) 1px, transparent 1px),\\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\\n    var(--t-subtle);\\n  background-size: 28px 28px;\\n}\\n\\n.tidal-scope .invoice-preview-demo-picker {\\n  display: grid;\\n  width: min(100%, 300px);\\n  gap: 5px;\\n  padding: 10px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 10px;\\n  background: var(--t-surface);\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  font-weight: 670;\\n  letter-spacing: 0.05em;\\n  line-height: 1.35;\\n}\\n\\n.tidal-scope .invoice-preview-demo-picker > span {\\n  min-width: 0;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .invoice-preview-demo-picker select {\\n  width: 100%;\\n  min-width: 0;\\n  min-height: 44px;\\n  padding: 8px 10px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 8px;\\n  background: var(--t-surface);\\n  color: var(--t-ink);\\n  font: inherit;\\n  font-size: 16px;\\n  line-height: 1.4;\\n}\\n\\n.tidal-scope .invoice-preview-demo-picker select:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .invoice-preview-demo-boundary {\\n  min-width: 0;\\n  padding: 20px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 18px;\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  scroll-margin-block: 18px;\\n}\\n\\n.tidal-scope .invoice-preview-demo-boundary:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n\\n.tidal-scope .invoice-preview-demo-boundary > span {\\n  color: color-mix(in srgb, var(--t-surface) 62%, var(--t-ink));\\n  font-size: 11px;\\n  font-weight: 690;\\n  letter-spacing: 0.09em;\\n  line-height: 1.35;\\n  text-transform: uppercase;\\n}\\n\\n.tidal-scope .invoice-preview-demo-boundary h3 {\\n  margin: 8px 0 0;\\n  font-size: 18px;\\n  font-weight: 650;\\n  letter-spacing: -0.035em;\\n  line-height: 1.25;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .invoice-preview-demo-boundary p {\\n  max-width: 72ch;\\n  margin: 7px 0 0;\\n  color: color-mix(in srgb, var(--t-surface) 72%, var(--t-ink));\\n  font-size: 11px;\\n  line-height: 1.6;\\n  overflow-wrap: anywhere;\\n}\\n\\n@container invoice-preview-demo (max-width: 520px) {\\n  .tidal-scope .invoice-preview-demo-layout {\\n    gap: 9px;\\n    padding: 8px;\\n  }\\n\\n  .tidal-scope .invoice-preview-demo-picker {\\n    width: 100%;\\n  }\\n\\n  .tidal-scope .invoice-preview-demo-boundary {\\n    padding: 17px;\\n  }\\n}\";\n\ntype SampleInvoiceId = \"sample-1048\" | \"sample-1036\";\n\ninterface SampleInvoice {\n  id: SampleInvoiceId;\n  issue: { dateTime: string; label: string };\n  due: { dateTime: string; label: string };\n  reference: string;\n  rows: readonly (TidalInvoiceLineItem & { note: string })[];\n  subtotal: string;\n  adjustment: string;\n  total: string;\n}\n\nconst SAMPLE_INVOICES: readonly SampleInvoice[] = [\n  {\n    id: \"sample-1048\",\n    issue: { dateTime: \"2026-10-01\", label: \"October 1, 2026\" },\n    due: { dateTime: \"2026-10-15\", label: \"October 15, 2026\" },\n    reference: \"PO-1048\",\n    rows: [\n      {\n        id: \"brief-layout\",\n        description: \"Product design\",\n        detail: \"Website interface and responsive layouts.\",\n        note: \"Includes the homepage, component library, and responsive layouts.\",\n        quantity: \"1\",\n        rate: \"$16.00\",\n        total: \"$16.00\",\n      },\n      {\n        id: \"checklist-layout\",\n        description: \"Design review\",\n        detail: \"Interface review and handoff.\",\n        note: \"Review notes and developer handoff.\",\n        quantity: \"1\",\n        rate: \"$8.00\",\n        total: \"$8.00\",\n      },\n    ],\n    subtotal: \"$24.00\",\n    adjustment: \"$0.00\",\n    total: \"$24.00\",\n  },\n  {\n    id: \"sample-1036\",\n    issue: { dateTime: \"2026-09-01\", label: \"September 1, 2026\" },\n    due: { dateTime: \"2026-09-15\", label: \"September 15, 2026\" },\n    reference: \"PO-1036\",\n    rows: [\n      {\n        id: \"review-layout\",\n        description: \"Design review\",\n        detail: \"Interface review and revisions.\",\n        note: \"Two rounds of interface review and revisions.\",\n        quantity: \"2\",\n        rate: \"$10.00\",\n        total: \"$20.00\",\n      },\n    ],\n    subtotal: \"$20.00\",\n    adjustment: \"−$2.00\",\n    total: \"$18.00\",\n  },\n];\n\nexport function InvoicePreviewDemo() {\n  const generatedId = useId().replace(/:/g, \"\");\n  const disclosureId = `invoice-preview-${generatedId}-boundary`;\n  const [invoiceId, setInvoiceId] = useState<SampleInvoiceId>(\"sample-1048\");\n  const [showNotes, setShowNotes] = useState(false);\n  const [message, setMessage] = useState(\"Invoice 1048 selected.\");\n  const invoice = SAMPLE_INVOICES.find((entry) => entry.id === invoiceId)!;\n  const rows = useMemo(\n    () =>\n      invoice.rows.map((row) => ({\n        ...row,\n        detail: showNotes ? row.note : row.detail,\n      })),\n    [invoice, showNotes],\n  );\n\n  return (\n    <section\n      className=\"invoice-preview-demo\"\n      aria-label=\"Invoice sample preview\"\n    >\n      <div className=\"invoice-preview-demo-layout\">\n        <label className=\"invoice-preview-demo-picker\">\n          <span>Invoice</span>\n          <select\n            value={invoiceId}\n            onChange={(event) => {\n              const next =\n                event.currentTarget.value === \"sample-1036\"\n                  ? \"sample-1036\"\n                  : \"sample-1048\";\n              setInvoiceId(next);\n              setShowNotes(false);\n              setMessage(\n                `${next === \"sample-1048\" ? \"Invoice 1048\" : \"Invoice 1036\"} selected.`,\n              );\n            }}\n          >\n            <option value=\"sample-1048\">Invoice 1048</option>\n            <option value=\"sample-1036\">Invoice 1036</option>\n          </select>\n        </label>\n\n        <TidalInvoicePreview\n          key={invoice.id}\n          accessibleName={`${invoice.id.replace(\"sample-\", \"Invoice \")} preview`}\n          invoiceNumber={invoice.id.replace(\"sample-\", \"INV-\")}\n          status=\"Preview only\"\n          issueDate={invoice.issue}\n          dueDate={invoice.due}\n          purchaseOrder={invoice.reference}\n          from={{\n            label: \"From\",\n            name: \"Northstar Studio\",\n            lines: [\"12 Paper Street\", \"Example City\"],\n            detail: \"Design studio\",\n          }}\n          billTo={{\n            label: \"Bill to\",\n            name: \"Tidal Workspace\",\n            lines: [\"24 Grove Avenue\", \"Example City\"],\n            detail: \"Product team\",\n          }}\n          lineItems={rows}\n          lineItemsCaption={`Line items for ${invoice.id}`}\n          totals={[\n            { id: \"subtotal\", label: \"Subtotal\", value: invoice.subtotal },\n            {\n              id: \"adjustment\",\n              label: \"Adjustment\",\n              value: invoice.adjustment,\n            },\n            {\n              id: \"total\",\n              label: \"Total\",\n              value: invoice.total,\n              emphasis: true,\n            },\n          ]}\n          currencyNote=\"All amounts in USD.\"\n          notes=\"Thank you for working with Northstar Studio.\"\n          actions={[\n            {\n              kind: \"button\",\n              id: \"toggle-row-notes\",\n              label: showNotes ? \"Show short descriptions\" : \"Show item notes\",\n              buttonProps: { \"aria-pressed\": showNotes },\n              onAction: () => {\n                setShowNotes((current) => !current);\n                setMessage(\n                  showNotes ? \"Short descriptions shown.\" : \"Item notes shown.\",\n                );\n              },\n            },\n            {\n              kind: \"link\",\n              id: \"review-boundary\",\n              label: \"About this sample\",\n              href: `#${disclosureId}`,\n              onAction: () => setMessage(\"Sample details opened.\"),\n            },\n          ]}\n          footer={\n            <span role=\"status\" aria-live=\"polite\">\n              {message} Sample data. Changes stay in this preview.\n            </span>\n          }\n        />\n\n        <aside\n          id={disclosureId}\n          className=\"invoice-preview-demo-boundary\"\n          tabIndex={-1}\n        >\n          <h3>About this sample</h3>\n          <p>Sample data. Changes stay in this preview.</p>\n        </aside>\n      </div>\n    </section>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <InvoicePreviewDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/invoice-preview.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "value",
      "type": "inferred-from-existing-demo",
      "initial": "\"sample-1048\"",
      "setter": "setInvoiceId",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onChange",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    }
  ],
  "nativeForm": {
    "participates": true,
    "names": [],
    "expectedFormData": {},
    "submitBehavior": "The existing demo's native form callback receives the submit event.",
    "resetBehavior": "Native reset behavior remains available where the demo renders a resettable control.",
    "disabledBehavior": "Disabled controls remain excluded from successful native form submission.",
    "readOnlyBehavior": "Read-only controls retain their value and remain inspectable by the consumer."
  },
  "accessibility": {
    "labelSource": "Existing demo label or ARIA prop",
    "semantics": "Preserve the component's native element and the semantics demonstrated by the source fixture.",
    "keyboard": [
      "Tab and Shift+Tab",
      "Enter or Space for native activation",
      "Arrow keys where the component exposes a composite control"
    ],
    "focusReturn": "Preserve browser focus order and visible focus.",
    "errorAnnouncement": "No error announcement path is present in this demo; the consumer owns validation messaging.",
    "reducedMotion": "Verify prefers-reduced-motion with the existing component transition path.",
    "forcedColors": "Verify visible borders, text, and focus in forced-colors mode."
  },
  "responsive": {
    "widths": [
      320,
      390,
      768,
      1260
    ],
    "shortViewport": "Check the example at a 300px viewport height with keyboard or portal content visible.",
    "overflow": "The page should not gain horizontal overflow; component-local scrolling must remain intentional.",
    "touchTargetMinPx": 44,
    "coarseInputFontPx": 16
  },
  "errors": [
    {
      "fixture": "Exercise the existing demo's error, empty, loading, or invalid fixture.",
      "visibleResult": "The consumer-visible result must remain explicit and must not be replaced by a silent console error.",
      "focusResult": "Focus must remain on the triggering control or move to the announced error according to the native pattern.",
      "ownership": "Consumer-owned sample state only; no network request or customer data is used."
    }
  ],
  "verification": {
    "commands": [
      "npx tsc --noEmit",
      "npx vite build"
    ],
    "lockfile": "Use the consumer project's committed lockfile.",
    "browser": [
      "Chromium 1260x800",
      "Chromium 390x844",
      "Keyboard and reduced-motion pass"
    ]
  },
  "validation": {
    "consumerFixture": {
      "tsc": "pass",
      "viteBuild": "pass",
      "resourceModel": "Generated usage plus only the component files and CSS delivered by the primary item and listed registry dependencies."
    },
    "registryArtifact": "server-gated"
  },
  "exceptions": []
}
