{
  "component": {
    "id": "analytics-card",
    "name": "Analytics card",
    "tier": "pro",
    "exampleId": "analytics-card",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/core-demos.tsx",
    "exportName": "AnalyticsDemo",
    "sha256": "08481b8ac15c80247991fef2f86d8f569603e8992ea8bbff871fc8a825d351e7",
    "helperImports": [],
    "directComponentImports": [
      "analytics-card"
    ],
    "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/analytics-card",
    "registryUrl": "https://tidalui.com/r/pro/analytics-card.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/analytics-card",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/analytics-card",
      "registryUrl": "https://tidalui.com/r/pro/analytics-card.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/analytics-card.tsx",
    "exports": [
      "TidalAnalyticsCard"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/analytics-card.css",
      "components/ui/segmented-control.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [
      "https://tidalui.com/r/segmented-control.json"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "analytics-card",
      "segmented-control"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/analytics-card.css",
      "components/ui/segmented-control.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/analytics-card.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useState } from \"react\";\n\nimport { TidalAnalyticsCard } from \"./components/ui/analytics-card\";\n\nimport \"./components/ui/analytics-card.css\";\n\nimport \"./components/ui/segmented-control.css\";\n\n\n\nfunction sampleDailyValues(count: number, total: number, start: string) {\n  const weights = Array.from(\n    { length: count },\n    (_, i) =>\n      0.7 +\n      (i / count) * 0.6 +\n      Math.sin(i * 1.9) * 0.16 +\n      Math.cos(i * 0.45) * 0.1,\n  );\n  const sum = weights.reduce((a, b) => a + b, 0);\n  const values = weights.map((weight) => Math.round((weight / sum) * total));\n  values[values.length - 1] += total - values.reduce((a, b) => a + b, 0);\n  return values.map((value, i) => {\n    const date = new Date(start + \"T12:00:00Z\");\n    date.setUTCDate(date.getUTCDate() + i);\n    return {\n      value,\n      label: date.toLocaleDateString(\"en-US\", {\n        month: \"short\",\n        day: \"numeric\",\n        timeZone: \"UTC\",\n      }),\n    };\n  });\n}\n\nconst analyticsPeriods = [\n  {\n    id: \"week\",\n    label: \"7 days\",\n    total: 8240,\n    change: 8.2,\n    data: [900, 1060, 880, 1200, 1120, 1460, 1620].map((value, i) => ({\n      value,\n      label: \"Oct \" + (7 + i),\n    })),\n    comparison: sampleDailyValues(7, 7616, \"2026-09-30\"),\n    breakdown: [\n      { label: \"Subscriptions\", value: 5820 },\n      { label: \"One-time\", value: 1820 },\n      { label: \"Usage\", value: 600 },\n    ],\n  },\n  {\n    id: \"month\",\n    label: \"30 days\",\n    total: 32480,\n    change: 14.8,\n    data: sampleDailyValues(30, 32480, \"2026-09-14\"),\n    comparison: sampleDailyValues(30, 28293, \"2026-08-15\"),\n    breakdown: [\n      { label: \"Subscriptions\", value: 23720 },\n      { label: \"One-time\", value: 5910 },\n      { label: \"Usage\", value: 2850 },\n    ],\n  },\n  {\n    id: \"quarter\",\n    label: \"90 days\",\n    total: 98640,\n    change: 21.6,\n    data: sampleDailyValues(90, 98640, \"2026-07-16\"),\n    comparison: sampleDailyValues(90, 81118, \"2026-04-17\"),\n    breakdown: [\n      { label: \"Subscriptions\", value: 68060 },\n      { label: \"One-time\", value: 21700 },\n      { label: \"Usage\", value: 8880 },\n    ],\n  },\n];\n\nexport function AnalyticsDemo() {\n  const [period, setPeriod] = useState(\"month\");\n  return (\n    <TidalAnalyticsCard\n      title=\"Revenue overview\"\n      periods={analyticsPeriods}\n      period={period}\n      onPeriodChange={setPeriod}\n      formatValue={(n) => \"$\" + n.toLocaleString(\"en-US\")}\n    />\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <AnalyticsDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/analytics-card.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "period",
      "type": "inferred-from-existing-demo",
      "initial": "\"month\"",
      "setter": "setPeriod",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onPeriodChange",
      "nativeType": "component 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": "Consumer-provided label remains required where the component API requires one.",
    "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": []
}
