{
  "component": {
    "id": "donut-chart",
    "name": "Donut chart",
    "tier": "pro",
    "exampleId": "donut-chart",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/donut-chart-demo.tsx",
    "exportName": "DonutChartDemo",
    "sha256": "ff0cb4ae249fa349817c9802feafdc7c4c608d03d673dfaad89ae0e031ed0619",
    "helperImports": [],
    "directComponentImports": [
      "donut-chart"
    ],
    "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/donut-chart",
    "registryUrl": "https://tidalui.com/r/pro/donut-chart.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/donut-chart",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/donut-chart",
      "registryUrl": "https://tidalui.com/r/pro/donut-chart.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/donut-chart.tsx",
    "exports": [
      "TidalDonutChart",
      "TidalDonutSegment"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/donut-chart.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "donut-chart"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/donut-chart.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/donut-chart.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/donut-chart-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useMemo, useState } from \"react\";\n\nimport { TidalDonutChart, type TidalDonutSegment } from \"./components/ui/donut-chart\";\n\nimport \"./components/ui/donut-chart.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .donut-chart-demo {\\n  container: donut-chart-demo / inline-size;\\n  display: grid;\\n  gap: 14px;\\n  width: 100%;\\n  max-width: 720px;\\n  min-width: 0;\\n  margin-inline: auto;\\n}\\n\\n.tidal-scope .donut-chart-demo-footer {\\n  display: flex;\\n  min-width: 0;\\n  align-items: center;\\n  justify-content: space-between;\\n  gap: 12px;\\n}\\n\\n.tidal-scope .donut-chart-demo-footer p {\\n  min-width: 0;\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.45;\\n  overflow-wrap: anywhere;\\n}\\n\\n.tidal-scope .donut-chart-demo-footer button {\\n  flex: none;\\n  min-width: 96px;\\n  min-height: 44px;\\n  padding: 0 15px;\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  border: 1px solid var(--t-border);\\n  border-radius: var(--t-radius-control);\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 650;\\n  cursor: pointer;\\n  transition:\\n    color 140ms,\\n    background-color 140ms,\\n    transform 140ms var(--t-ease-out);\\n}\\n\\n.tidal-scope .donut-chart-demo-footer button:hover:not(:disabled) {\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  border-color: var(--t-ink);\\n}\\n\\n.tidal-scope .donut-chart-demo-footer button:active:not(:disabled) {\\n  transform: scale(0.98);\\n}\\n\\n.tidal-scope .donut-chart-demo-footer button:disabled {\\n  opacity: 0.42;\\n  cursor: not-allowed;\\n}\\n\\n@container donut-chart-demo (max-width: 360px) {\\n  .tidal-scope .donut-chart-demo-footer {\\n    align-items: stretch;\\n    flex-direction: column;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .tidal-scope .donut-chart-demo-footer button {\\n    transition: none;\\n  }\\n}\\n\\n.tidal-scope .donut-chart-demo-note {\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.45;\\n}\";\n\nconst SEGMENTS: readonly TidalDonutSegment[] = [\n  {\n    id: \"research\",\n    label: \"Research\",\n    value: 12,\n    displayValue: \"12 h\",\n    description: \"Project notes and background research.\",\n  },\n  {\n    id: \"design\",\n    label: \"Design\",\n    value: 9,\n    displayValue: \"9 h\",\n    description: \"Interface design and prototyping.\",\n  },\n  {\n    id: \"writing\",\n    label: \"Writing\",\n    value: 6,\n    displayValue: \"6 h\",\n    description: \"Documentation and release notes.\",\n  },\n  {\n    id: \"review\",\n    label: \"Review\",\n    value: 4,\n    displayValue: \"4 h\",\n    description: \"Quality checks and feedback.\",\n  },\n  {\n    id: \"handoff\",\n    label: \"Handoff\",\n    value: 0.75,\n    displayValue: \"45 min\",\n    description: \"Delivery notes and handoff.\",\n  },\n];\n\nexport function DonutChartDemo() {\n  const [activeId, setActiveId] = useState(\"research\");\n  const [hiddenIds, setHiddenIds] = useState<readonly string[]>([]);\n  const [status, setStatus] = useState(\"Research selected: 12 h.\");\n  const visibleTotal = useMemo(\n    () =>\n      SEGMENTS.filter((segment) => !hiddenIds.includes(segment.id)).reduce(\n        (sum, segment) => sum + segment.value,\n        0,\n      ),\n    [hiddenIds],\n  );\n\n  return (\n    <section className=\"donut-chart-demo\" aria-label=\"Donut chart preview\">\n      <TidalDonutChart\n        title=\"Time by activity\"\n        description=\"Project time · This week\"\n        segments={SEGMENTS}\n        totalText={`${visibleTotal.toLocaleString(\"en-US\", { maximumFractionDigits: 2 })} h`}\n        activeId={activeId}\n        onActiveChange={(segment) => {\n          setActiveId(segment.id);\n          setStatus(`${segment.label} selected: ${segment.displayValue}.`);\n        }}\n        hiddenIds={hiddenIds}\n        onHiddenChange={(nextHiddenIds, changedSegment) => {\n          setHiddenIds(nextHiddenIds);\n          const nextVisible = SEGMENTS.find(\n            (segment) =>\n              segment.value > 0 && !nextHiddenIds.includes(segment.id),\n          );\n          if (nextHiddenIds.includes(activeId) && nextVisible) {\n            setActiveId(nextVisible.id);\n          } else if (!nextVisible) {\n            setActiveId(\"\");\n          } else if (!nextHiddenIds.includes(changedSegment.id)) {\n            setActiveId(changedSegment.id);\n          }\n          setStatus(\n            `${changedSegment.label} ${nextHiddenIds.includes(changedSegment.id) ? \"hidden\" : \"shown\"}.`,\n          );\n        }}\n      />\n      <footer className=\"donut-chart-demo-footer\">\n        <p role=\"status\" aria-live=\"polite\">\n          {status}\n        </p>\n        <button\n          type=\"button\"\n          disabled={!hiddenIds.length}\n          onClick={() => {\n            setHiddenIds([]);\n            setActiveId(\"research\");\n            setStatus(\"All sample segments shown.\");\n          }}\n        >\n          Show all\n        </button>\n      </footer>\n      <p className=\"donut-chart-demo-note\">\n        Sample data. Changes stay in this preview.\n      </p>\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      <DonutChartDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/donut-chart.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "activeId",
      "type": "inferred-from-existing-demo",
      "initial": "\"research\"",
      "setter": "setActiveId",
      "proposalCanBeRejected": false
    },
    {
      "prop": "hiddenIds",
      "type": "inferred-from-existing-demo",
      "initial": "[]",
      "setter": "setHiddenIds",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onActiveChange",
      "nativeType": "component callback",
      "callerFirst": true,
      "preventable": true,
      "observedResult": "The existing demo callback remains the source of truth; this example does not call a live service."
    },
    {
      "name": "onClick",
      "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."
    },
    {
      "name": "onHiddenChange",
      "nativeType": "component 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": []
}
