{
  "component": {
    "id": "context-meter",
    "name": "Context meter",
    "tier": "pro",
    "exampleId": "context-meter",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/context-meter-demo.tsx",
    "exportName": "ContextMeterDemo",
    "sha256": "d511c175b5b5183816426fa0510c622f69eeb20b5c83ac526c57f8ed5506ee27",
    "helperImports": [],
    "directComponentImports": [
      "context-meter"
    ],
    "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/context-meter",
    "registryUrl": "https://tidalui.com/r/pro/context-meter.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/context-meter",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/context-meter",
      "registryUrl": "https://tidalui.com/r/pro/context-meter.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/context-meter.tsx",
    "exports": [
      "TidalContextMeter"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/context-meter.css",
      "components/ui/meter.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "@tidal-pro/meter"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "context-meter",
      "meter"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/context-meter.css",
      "components/ui/meter.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/context-meter.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/context-meter-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useState } from \"react\";\n\nimport { TidalContextMeter } from \"./components/ui/context-meter\";\n\nimport \"./components/ui/context-meter.css\";\n\nimport \"./components/ui/meter.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .context-meter-demo {\\n  width: 100%;\\n  max-width: 540px;\\n  min-width: 0;\\n}\\n.tidal-scope .context-meter-demo-options {\\n  display: flex;\\n  gap: 6px;\\n  flex-wrap: wrap;\\n  justify-content: center;\\n  margin-top: 16px;\\n}\\n.tidal-scope .context-meter-demo-options button {\\n  min-width: 44px;\\n  min-height: 44px;\\n  padding: 8px 12px;\\n  border: 1px solid var(--t-border);\\n  border-radius: 9px;\\n  font-size: 11px;\\n  font-family: inherit;\\n  line-height: 1.5;\\n  color: var(--t-muted);\\n  background: var(--t-surface);\\n  cursor: pointer;\\n  max-width: 100%;\\n  overflow-wrap: anywhere;\\n}\\n.tidal-scope .context-meter-demo-options button[aria-pressed=\\\"true\\\"] {\\n  background: var(--t-ink);\\n  color: var(--t-surface);\\n  border-color: var(--t-ink);\\n}\\n.tidal-scope .context-meter-demo-options button:focus-visible {\\n  outline: 2px solid var(--t-accent);\\n  outline-offset: 3px;\\n}\\n.tidal-scope .context-meter-demo > p {\\n  font-size: 11px;\\n  line-height: 1.6;\\n  color: var(--t-muted);\\n  text-align: center;\\n  margin: 12px 8px 0;\\n}\";\n\nconst snapshots = [\n  { name: \"Typical request\", used: 12480, reserved: 4096 },\n  { name: \"Near capacity\", used: 27400, reserved: 4096 },\n  { name: \"Over capacity\", used: 30720, reserved: 4096 },\n];\n\nexport function ContextMeterDemo() {\n  const [selected, setSelected] = useState(0);\n  const current = snapshots[selected];\n  return (\n    <div className=\"context-meter-demo\">\n      <TidalContextMeter\n        title=\"Research conversation\"\n        description=\"Track supplied input counts and the space reserved for a response.\"\n        used={current.used}\n        capacity={32768}\n        reserved={current.reserved}\n        breakdown={[\n          { id: \"instructions\", label: \"Instructions\", tokens: 1840 },\n          { id: \"conversation\", label: \"Conversation\", tokens: 5440 },\n          { id: \"sources\", label: \"Attached sources\", tokens: 5200 },\n        ]}\n      />\n      <div\n        role=\"group\"\n        aria-label=\"Sample context counts\"\n        className=\"context-meter-demo-options\"\n      >\n        {snapshots.map((s, i) => (\n          <button\n            type=\"button\"\n            key={s.name}\n            aria-pressed={selected === i}\n            onClick={() => setSelected(i)}\n          >\n            {s.name}\n          </button>\n        ))}\n      </div>\n      <p>\n        Fixed sample counts. No text is tokenized and no model is contacted.\n      </p>\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <ContextMeterDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/context-meter.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [
    {
      "name": "onClick",
      "nativeType": "React synthetic event or native callback",
      "callerFirst": true,
      "preventable": false,
      "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": "The existing error or alert path remains consumer-owned and should be announced by the rendered semantics.",
    "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": []
}
