{
  "component": {
    "id": "response-feedback",
    "name": "Response feedback",
    "tier": "pro",
    "exampleId": "response-feedback",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/response-feedback-demo.tsx",
    "exportName": "ResponseFeedbackDemo",
    "sha256": "98057749f4a07fe3ea077a69247ce7d3ced1e7df12bdfdfa10294c4b85e915fe",
    "helperImports": [],
    "directComponentImports": [
      "response-feedback"
    ],
    "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/response-feedback",
    "registryUrl": "https://tidalui.com/r/pro/response-feedback.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/response-feedback",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/response-feedback",
      "registryUrl": "https://tidalui.com/r/pro/response-feedback.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/response-feedback.tsx",
    "exports": [
      "TidalFeedbackChoice",
      "TidalResponseFeedback"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/response-feedback.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "response-feedback"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/response-feedback.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/response-feedback.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "import \"./components/ui/tidal.css\";\n\nimport { useState, useRef, useLayoutEffect } from \"react\";\n\nimport { TidalResponseFeedback, type TidalFeedbackChoice } from \"./components/ui/response-feedback\";\n\nimport \"./components/ui/response-feedback.css\";\n\n\n\nexport function ResponseFeedbackDemo() {\n  const form = useRef<HTMLFormElement>(null),\n    editSource = useRef<HTMLButtonElement | null>(null);\n  const [choice, setChoice] = useState<TidalFeedbackChoice | null>(null),\n    [reasons, setReasons] = useState<readonly string[]>([]),\n    [comment, setComment] = useState(\"\"),\n    [success, setSuccess] = useState(\"\");\n  useLayoutEffect(() => {\n    const source = editSource.current;\n    if (success || !source) return;\n    editSource.current = null;\n    const active = source.ownerDocument.activeElement;\n    if (active === source || active === source.ownerDocument.body)\n      form.current?.focus({ preventScroll: true });\n  }, [success]);\n  return (\n    <div style={{ width: \"100%\", maxWidth: 480, marginInline: \"auto\" }}>\n      <TidalResponseFeedback\n        ref={form}\n        choice={choice}\n        onChoiceChange={setChoice}\n        reasons={[\n          { id: \"incorrect\", label: \"Incorrect information\" },\n          { id: \"incomplete\", label: \"Missing details\" },\n          { id: \"unclear\", label: \"Hard to follow\" },\n        ]}\n        selectedReasons={reasons}\n        onReasonsChange={setReasons}\n        comment={comment}\n        onCommentChange={setComment}\n        success={success}\n        onSubmit={(e) => {\n          e.preventDefault();\n          const data = new FormData(e.currentTarget);\n          setSuccess(`Feedback kept in this preview: ${data.get(\"feedback\")}.`);\n        }}\n        textareaProps={{\n          placeholder: \"What would make this response more useful?\",\n          maxLength: 1000,\n        }}\n      />\n      {success && (\n        <button\n          type=\"button\"\n          style={{\n            display: \"block\",\n            margin: \"12px auto\",\n            minHeight: 44,\n            color: \"var(--t-muted)\",\n            background: \"none\",\n            border: 0,\n            cursor: \"pointer\",\n          }}\n          onClick={(event) => {\n            editSource.current = event.currentTarget;\n            setSuccess(\"\");\n          }}\n        >\n          Edit feedback\n        </button>\n      )}\n    </div>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <ResponseFeedbackDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/response-feedback.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "choice",
      "type": "inferred-from-existing-demo",
      "initial": "null",
      "setter": "setChoice",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "name": "onChoiceChange",
      "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": "onCommentChange",
      "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": "onReasonsChange",
      "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": "onSubmit",
      "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."
    }
  ],
  "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": []
}
