{
  "component": {
    "id": "roi-calculator",
    "name": "ROI calculator",
    "tier": "pro",
    "exampleId": "roi-calculator",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/roi-calculator-demo.tsx",
    "exportName": "RoiCalculatorDemo",
    "sha256": "0faf0c9da692d80eea3e51d8099f79411bb07e8fb66ac5b96eaeda62938f9b61",
    "helperImports": [],
    "directComponentImports": [
      "roi-calculator"
    ],
    "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/roi-calculator",
    "registryUrl": "https://tidalui.com/r/pro/roi-calculator.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/roi-calculator",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/roi-calculator",
      "registryUrl": "https://tidalui.com/r/pro/roi-calculator.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/roi-calculator.tsx",
    "exports": [
      "TidalRoiCalculator",
      "TidalRoiInput"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/roi-calculator.css",
      "components/ui/number-stepper.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [
      "@tidal-pro/number-stepper"
    ],
    "additionalRegistry": [],
    "installClosure": [
      "number-stepper",
      "roi-calculator"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/roi-calculator.css",
      "components/ui/number-stepper.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/roi-calculator.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/roi-calculator-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useState } from \"react\";\n\nimport { TidalRoiCalculator, type TidalRoiInput } from \"./components/ui/roi-calculator\";\n\nimport \"./components/ui/roi-calculator.css\";\n\nimport \"./components/ui/number-stepper.css\";\n\n\n\nconst tidalExampleStyles = \".tidal-scope .roi-calculator-demo {\\n  width: 100%;\\n  max-width: 940px;\\n  min-width: 0;\\n}\\n.roi-calculator-demo .tidal-roi-formula p {\\n  margin: 6px 0 0;\\n}\\n@media (max-width: 400px) {\\n  .roi-calculator-demo .tidal-roi {\\n    padding: 18px;\\n  }\\n}\";\n\nconst initial = { people: 8, hours: 3, rate: 45, subscription: 240 };\n\nexport const roiInputs: readonly TidalRoiInput[] = [\n  {\n    id: \"people\",\n    label: \"People using the product\",\n    min: 1,\n    max: 500,\n    step: 1,\n    unit: \"people\",\n  },\n  {\n    id: \"hours\",\n    label: \"Time saved each week\",\n    description: \"Per person, based on your own estimate.\",\n    min: 0,\n    max: 40,\n    step: 0.5,\n    unit: \"hours\",\n  },\n  {\n    id: \"rate\",\n    label: \"Value of one hour\",\n    min: 1,\n    max: 500,\n    step: 1,\n    unit: \"USD\",\n  },\n  {\n    id: \"subscription\",\n    label: \"Monthly product cost\",\n    min: 1,\n    max: 50000,\n    step: 1,\n    unit: \"USD\",\n  },\n];\n\nexport function RoiCalculatorDemo() {\n  const [values, setValues] = useState<Record<string, number | null>>(initial);\n  const complete = Object.values(values).every((v) => v !== null);\n  const monthly = complete\n    ? (values.people! * values.hours! * values.rate! * 52) / 12\n    : null;\n  const net = monthly === null ? null : monthly - values.subscription!;\n  const roi =\n    net === null || !values.subscription || values.subscription <= 0\n      ? null\n      : (net / values.subscription) * 100;\n  const money = (v: number) =>\n    new Intl.NumberFormat(\"en-US\", {\n      style: \"currency\",\n      currency: \"USD\",\n      maximumFractionDigits: 0,\n    }).format(v);\n  return (\n    <div className=\"roi-calculator-demo\">\n      <TidalRoiCalculator\n        title=\"Estimate the value of time saved\"\n        description=\"Adjust four assumptions to compare time value with a monthly product cost.\"\n        inputs={roiInputs}\n        values={values}\n        onValueChange={(id, value) => setValues((v) => ({ ...v, [id]: value }))}\n        inputProps={(i) => ({ name: i.id })}\n        results={[\n          {\n            id: \"net\",\n            label: \"Estimated monthly net value\",\n            value: net,\n            formatValue: money,\n            description: \"Time value less the product cost.\",\n          },\n          {\n            id: \"roi\",\n            label: \"Estimated return on cost\",\n            value: roi,\n            formatValue: (v) => `${Math.round(v).toLocaleString(\"en-US\")}%`,\n          },\n        ]}\n        formula={\n          <>\n            <p>\n              Monthly time value = people × weekly hours saved × hourly value ×\n              52 ÷ 12.\n            </p>\n            <p>\n              Net value = monthly time value − monthly cost. Return = net value\n              ÷ monthly cost × 100.\n            </p>\n          </>\n        }\n        disclaimer=\"Illustrative estimates only. Time saved is not cash earned, and actual results depend on your assumptions.\"\n        onReset={() => setValues(initial)}\n      />\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      <RoiCalculatorDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/roi-calculator.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [],
  "events": [
    {
      "name": "onReset",
      "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": "onValueChange",
      "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": "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": "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": []
}
