{
  "component": {
    "id": "status-badge",
    "name": "Status badge",
    "tier": "free",
    "exampleId": "status-badge",
    "access": "free",
    "requiresAuthorization": false
  },
  "source": {
    "demoModule": "src/status-badge-demo.tsx",
    "exportName": "StatusBadgeDemo",
    "sha256": "cf739edfee27f46cfe0df6f604c62f83733b4002ae482c7f67898797fb0e232a",
    "helperImports": [],
    "directComponentImports": [
      "status-badge",
      "tidal-button"
    ],
    "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 https://tidalui.com/r/status-badge.json",
    "registryUrl": "https://tidalui.com/r/status-badge.json",
    "access": "free",
    "sourceDelivery": "public-registry",
    "requiresAuthorization": false,
    "tokenSource": "none",
    "cli": {
      "package": "shadcn",
      "requested": "latest"
    }
  },
  "installPlan": [
    {
      "order": 1,
      "kind": "primary",
      "dependency": "https://tidalui.com/r/status-badge.json",
      "purpose": "component",
      "command": "npx shadcn@latest add https://tidalui.com/r/status-badge.json",
      "registryUrl": "https://tidalui.com/r/status-badge.json",
      "access": "free",
      "sourceDelivery": "public-registry",
      "requiresAuthorization": false
    },
    {
      "order": 2,
      "kind": "demo-only-additional",
      "dependency": "https://tidalui.com/r/tidal-button.json",
      "purpose": "complete-example-demo-dependency",
      "command": "npx shadcn@latest add https://tidalui.com/r/tidal-button.json",
      "registryUrl": "https://tidalui.com/r/tidal-button.json",
      "access": "free",
      "sourceDelivery": "public-registry",
      "requiresAuthorization": false
    }
  ],
  "imports": {
    "componentPath": "components/ui/status-badge.tsx",
    "exports": [
      "TidalButton",
      "TidalStatus",
      "TidalStatusBadge"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/status-badge.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [
      "https://tidalui.com/r/tidal-button.json"
    ],
    "installClosure": [
      "status-badge",
      "tidal-button"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/status-badge.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/status-badge.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/status-badge-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useEffect, useLayoutEffect, useRef, useState } from \"react\";\n\nimport { Folder, Check, X } from \"lucide-react\";\n\nimport { TidalStatusBadge, type TidalStatus } from \"./components/ui/status-badge\";\n\nimport { TidalButton } from \"./components/ui/tidal-button\";\n\nimport \"./components/ui/status-badge.css\";\n\n\n\nconst tidalExampleStyles = \".status-badge-specimen{width:100%;max-width:600px;padding:28px;border:1px solid var(--t-border);border-radius:var(--t-radius-card);background:var(--t-surface);box-shadow:0 24px 40px -28px #00000035,0 2px 4px #00000008}.status-badge-specimen>h3{font-size:29px;line-height:1.08;letter-spacing:-1px;font-weight:500;margin:13px 0 26px}.status-badge-specimen>h3>em{font-family:\\\"Instrument Serif\\\",serif;font-size:1.2em;font-weight:400}.status-demo-top{display:flex;align-items:center;justify-content:space-between;gap:16px}.status-demo-top>span:first-child{display:flex;align-items:center;gap:11px;min-width:0}.status-demo-top strong{font-size:12px;font-weight:550;display:block}.status-demo-top small{display:block;color:var(--t-muted);font-size:11px;margin-top:6px}.status-demo-top>.tidal-status-badge{flex:none}.status-demo-progress{height:4px;border-radius:3px;background:var(--t-wash);margin:22px 0 11px;overflow:hidden}.status-demo-progress>span{display:block;height:100%;background:var(--t-ink);border-radius:3px;transition:width 600ms var(--t-ease-out)}.status-demo-checks>div{display:flex;align-items:center;gap:11px;min-height:62px;border-bottom:1px solid var(--t-border);color:var(--t-muted);font-size:11px;transition:color 240ms}.status-demo-checks>div[data-complete=true],.status-demo-checks>div[data-failed=true]{color:var(--t-ink)}.status-demo-checks>div>.tidal-status-badge{margin-left:auto;flex:none}.status-demo-step{width:24px;height:24px;border:1px solid var(--t-border);border-radius:6px;display:grid;place-items:center;font-size:11px;flex:none;transition:background 240ms,color 240ms,transform 320ms var(--t-ease-spring)}.status-demo-checks>div[data-complete=true]>.status-demo-step{background:var(--t-ink);border-color:var(--t-ink);color:var(--t-surface);transform:scale(1.04)}.status-demo-checks>div[data-failed=true]>.status-demo-step{border-color:var(--t-ink);color:var(--t-ink)}.status-demo-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}.status-demo-actions>.tidal-button{font-size:11px;padding-inline:13px}.status-demo-note{font-size:11px;line-height:1.8;color:var(--t-muted);margin:18px 0 0;min-height:36px}.status-demo-legend{display:flex;align-items:center;gap:10px;border-top:1px solid var(--t-border);padding-top:18px;margin-top:14px}.status-demo-legend>span:last-child{font-size:11px;color:var(--t-muted)}@media(max-width:420px){.status-badge-specimen{padding:22px}.status-demo-top{align-items:flex-start;flex-direction:column;gap:14px}.status-demo-checks>div{font-size:11px;gap:8px}.status-demo-legend{flex-wrap:wrap}}\";\n\nexport function StatusBadgeDemo() {\n  const [phase, setPhase] = useState<\n    \"queued\" | \"checking\" | \"ready\" | \"failed\"\n  >(\"queued\");\n  const [step, setStep] = useState(0);\n  const timers = useRef<ReturnType<typeof setTimeout>[]>([]);\n  const focusOwner = useRef<HTMLButtonElement | null>(null);\n  const clear = () => {\n    timers.current.forEach(clearTimeout);\n    timers.current = [];\n  };\n  useEffect(() => () => timers.current.forEach(clearTimeout), []);\n  const status: TidalStatus =\n    phase === \"checking\"\n      ? \"pending\"\n      : phase === \"ready\"\n        ? \"success\"\n        : phase === \"failed\"\n          ? \"error\"\n          : \"neutral\";\n  const label =\n    phase === \"checking\"\n      ? \"Running checks\"\n      : phase === \"ready\"\n        ? \"Ready to preview\"\n        : phase === \"failed\"\n          ? \"Needs attention\"\n          : \"Queued\";\n  const progress = Math.round((step / 3) * 100);\n  useLayoutEffect(() => {\n    if ((phase !== \"ready\" && phase !== \"failed\") || !focusOwner.current)\n      return;\n    const active = document.activeElement;\n    if (active === document.body || active === focusOwner.current)\n      focusOwner.current.focus({ preventScroll: true });\n    focusOwner.current = null;\n  }, [phase]);\n  function run(fail: boolean, source: HTMLButtonElement) {\n    clear();\n    focusOwner.current = source;\n    setStep(0);\n    setPhase(\"checking\");\n    timers.current = [\n      setTimeout(() => setStep(1), 400),\n      setTimeout(() => setStep(2), 850),\n      setTimeout(() => {\n        setStep(fail ? 2 : 3);\n        setPhase(fail ? \"failed\" : \"ready\");\n      }, 1400),\n    ];\n  }\n  return (\n    <div className=\"status-badge-specimen\" data-phase={phase}>\n      <div className=\"status-demo-top\">\n        <span>\n          <Folder size={16} aria-hidden=\"true\" />\n          <span>\n            <strong>Northstar interface</strong>\n            <small>Simulated check, in this browser only</small>\n          </span>\n        </span>\n        <TidalStatusBadge status={status} label={label} announce />\n      </div>\n      <div\n        className=\"status-demo-progress\"\n        role=\"progressbar\"\n        aria-label=\"Simulated check progress\"\n        aria-valuenow={progress}\n        aria-valuemin={0}\n        aria-valuemax={100}\n      >\n        <span style={{ width: `${progress}%` }} />\n      </div>\n      <div className=\"status-demo-checks\">\n        {[\"Component contract\", \"Styles and tokens\", \"Preview layout\"].map(\n          (name, i) => {\n            const complete = i < step;\n            const failed = phase === \"failed\" && i === 2;\n            const pending = phase === \"checking\" && i === step;\n            return (\n              <div key={name} data-complete={complete} data-failed={failed}>\n                <span className=\"status-demo-step\" aria-hidden=\"true\">\n                  {complete ? (\n                    <Check size={12} />\n                  ) : failed ? (\n                    <X size={12} />\n                  ) : (\n                    <span>0{i + 1}</span>\n                  )}\n                </span>\n                <span>{name}</span>\n                <TidalStatusBadge\n                  label={\n                    complete\n                      ? \"Sample passed\"\n                      : failed\n                        ? \"Sample failed\"\n                        : pending\n                          ? \"Checking\"\n                          : \"Waiting\"\n                  }\n                  status={\n                    complete\n                      ? \"success\"\n                      : failed\n                        ? \"error\"\n                        : pending\n                          ? \"pending\"\n                          : \"neutral\"\n                  }\n                  size=\"sm\"\n                />\n              </div>\n            );\n          },\n        )}\n      </div>\n      <div className=\"status-demo-actions\">\n        <TidalButton\n          onClick={(event) => run(false, event.currentTarget)}\n          disabled={phase === \"checking\"}\n        >\n          Run sample check\n        </TidalButton>\n        <TidalButton\n          variant=\"secondary\"\n          onClick={(event) => run(true, event.currentTarget)}\n          disabled={phase === \"checking\"}\n        >\n          Try failure\n        </TidalButton>\n        <TidalButton\n          variant=\"ghost\"\n          onClick={() => {\n            clear();\n            focusOwner.current = null;\n            setStep(0);\n            setPhase(\"queued\");\n          }}\n        >\n          Reset\n        </TidalButton>\n      </div>\n      <p className=\"status-demo-note\">\n        {phase === \"ready\"\n          ? \"All three sample steps finished. Your real operation supplies the status.\"\n          : phase === \"failed\"\n            ? \"The last sample step failed. Clear words make the next step obvious.\"\n            : \"Run a sample to see the label, icon and interface change together.\"}\n      </p>\n      <div className=\"status-demo-legend\">\n        <TidalStatusBadge label=\"Review requested\" status=\"warning\" size=\"sm\" />\n        <span>One palette. Every state understood.</span>\n      </div>\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      <StatusBadgeDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/status-badge.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "phase",
      "type": "inferred-from-existing-demo",
      "initial": "\"queued\"",
      "setter": "setPhase",
      "proposalCanBeRejected": false
    }
  ],
  "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": "present-local"
  },
  "exceptions": []
}
