{
  "component": {
    "id": "model-selector",
    "name": "Model selector",
    "tier": "pro",
    "exampleId": "model-selector",
    "access": "pro",
    "requiresAuthorization": true
  },
  "source": {
    "demoModule": "src/model-selector-demo.tsx",
    "exportName": "ModelSelectorDemo",
    "sha256": "0e520a6f0fac1068eb826ef0f394dbfb3d94f06326a03d878634310e9f966c01",
    "helperImports": [],
    "directComponentImports": [
      "model-selector"
    ],
    "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/model-selector",
    "registryUrl": "https://tidalui.com/r/pro/model-selector.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/model-selector",
      "purpose": "component",
      "command": "npx shadcn@latest add @tidal-pro/model-selector",
      "registryUrl": "https://tidalui.com/r/pro/model-selector.json",
      "access": "pro",
      "sourceDelivery": "server-gated",
      "requiresAuthorization": true
    }
  ],
  "imports": {
    "componentPath": "components/ui/model-selector.tsx",
    "exports": [
      "TidalModelGroup",
      "TidalModelSelector"
    ],
    "stylesheets": [
      "components/ui/tidal.css",
      "components/ui/model-selector.css"
    ],
    "scopeClass": "tidal-scope"
  },
  "dependencies": {
    "npm": [
      "lucide-react"
    ],
    "registry": [],
    "additionalRegistry": [],
    "installClosure": [
      "model-selector"
    ],
    "css": [
      "components/ui/tidal.css",
      "components/ui/model-selector.css"
    ],
    "demoCss": [],
    "consumerOwned": [
      "react",
      "react-dom"
    ]
  },
  "files": {
    "sourceFile": "/examples/model-selector.tsx",
    "demoStyles": [],
    "inlinedDemoStyles": [
      "src/model-selector-demo.css"
    ],
    "assets": []
  },
  "example": {
    "language": "tsx",
    "source": "\"use client\";\n\nimport \"./components/ui/tidal.css\";\n\nimport { useId, useRef, useState, type FormEvent } from \"react\";\n\nimport { TidalModelSelector, type TidalModelGroup } from \"./components/ui/model-selector\";\n\nimport \"./components/ui/model-selector.css\";\n\n\n\nconst tidalExampleStyles = \".model-selector-demo {\\n  container: model-selector-demo / inline-size;\\n  display: grid;\\n  gap: 14px;\\n  width: min(100%, 940px);\\n  min-width: 0;\\n}\\n\\n.model-selector-demo-actions {\\n  display: flex;\\n  flex-wrap: wrap;\\n  justify-content: end;\\n  gap: 8px;\\n}\\n\\n.model-selector-demo-actions button {\\n  min-width: 112px;\\n  min-height: 44px;\\n  padding: 10px 16px;\\n  color: var(--t-surface);\\n  background: var(--t-ink);\\n  border: 1px solid var(--t-ink);\\n  border-radius: 10px;\\n  font: inherit;\\n  font-size: 12px;\\n  font-weight: 600;\\n  cursor: pointer;\\n  transition:\\n    transform 140ms var(--t-ease-out),\\n    background 180ms var(--t-ease-out),\\n    color 180ms var(--t-ease-out);\\n}\\n\\n.model-selector-demo-actions button:last-child {\\n  color: var(--t-ink);\\n  background: var(--t-surface);\\n  border-color: var(--t-border);\\n}\\n\\n.model-selector-demo-actions button:hover {\\n  transform: translateY(-1px);\\n}\\n\\n.model-selector-demo-actions button:active {\\n  transform: scale(0.98);\\n}\\n\\n.model-selector-demo-status {\\n  margin: 0;\\n  color: var(--t-muted);\\n  font-size: 11px;\\n  line-height: 1.5;\\n  text-align: end;\\n  overflow-wrap: anywhere;\\n}\\n\\n@container model-selector-demo (max-width: 420px) {\\n  .model-selector-demo-actions {\\n    display: grid;\\n    grid-template-columns: repeat(2, minmax(0, 1fr));\\n  }\\n\\n  .model-selector-demo-actions button {\\n    min-width: 0;\\n    font-size: 16px;\\n  }\\n\\n  .model-selector-demo-status {\\n    text-align: start;\\n  }\\n}\\n\\n@media (prefers-reduced-motion: reduce) {\\n  .model-selector-demo-actions button {\\n    transition: none;\\n  }\\n\\n  .model-selector-demo-actions button:hover,\\n  .model-selector-demo-actions button:active {\\n    transform: none;\\n  }\\n}\";\n\nconst groups: readonly TidalModelGroup[] = [\n  {\n    id: \"everyday\",\n    label: \"Everyday work\",\n    searchText: \"writing summaries planning fast\",\n    description: \"Responsive sample models for routine workspace tasks.\",\n    models: [\n      {\n        id: \"tide-swift\",\n        label: \"Tide Swift\",\n        accessibleLabel: \"Tide Swift, available\",\n        searchText: \"fast writing summary extraction\",\n        description: \"Quick drafts and structured extraction.\",\n        context: \"64K sample tokens\",\n        cost: \"1 sample credit\",\n        capabilities: [\"Text\", \"Structured output\", \"Fast response\"],\n        modes: [\n          {\n            id: \"quick\",\n            label: \"Quick\",\n            accessibleLabel: \"Quick mode\",\n            description: \"Lowest delay\",\n          },\n          {\n            id: \"balanced\",\n            label: \"Balanced\",\n            accessibleLabel: \"Balanced mode\",\n            description: \"More review\",\n          },\n        ],\n      },\n      {\n        id: \"tide-reason\",\n        label: \"Tide Reason\",\n        accessibleLabel: \"Tide Reason, available\",\n        searchText: \"analysis planning code reasoning\",\n        description: \"Longer analysis for plans and technical work.\",\n        context: \"128K sample tokens\",\n        cost: \"3 sample credits\",\n        capabilities: [\"Text\", \"Code\", \"Tool plans\"],\n        modes: [\n          {\n            id: \"balanced\",\n            label: \"Balanced\",\n            accessibleLabel: \"Balanced mode\",\n            description: \"Everyday depth\",\n          },\n          {\n            id: \"careful\",\n            label: \"Careful\",\n            accessibleLabel: \"Careful mode\",\n            description: \"Extra review\",\n          },\n          {\n            id: \"deep\",\n            label: \"Deep\",\n            accessibleLabel: \"Deep mode\",\n            description: \"Longest analysis\",\n          },\n        ],\n      },\n    ],\n  },\n  {\n    id: \"specialist\",\n    label: \"Specialist\",\n    searchText: \"image vision archive preview\",\n    description: \"Focused sample models with narrower capabilities.\",\n    models: [\n      {\n        id: \"tide-vision\",\n        label: \"Tide Vision\",\n        accessibleLabel: \"Tide Vision, preview\",\n        searchText: \"image screenshot diagram visual\",\n        description: \"Reads screenshots, diagrams and product imagery.\",\n        availability: \"preview\",\n        context: \"96K sample tokens\",\n        cost: \"2 sample credits\",\n        capabilities: [\"Images\", \"Text\", \"Layout review\"],\n        modes: [\n          {\n            id: \"balanced\",\n            label: \"Balanced\",\n            accessibleLabel: \"Balanced mode\",\n            description: \"Mixed media\",\n          },\n          {\n            id: \"detail\",\n            label: \"Detail\",\n            accessibleLabel: \"Detail mode\",\n            description: \"Fine inspection\",\n          },\n        ],\n      },\n      {\n        id: \"tide-archive\",\n        label: \"Tide Archive\",\n        accessibleLabel: \"Tide Archive, unavailable\",\n        searchText: \"large archive documents\",\n        description: \"Large archive review is unavailable in this sample.\",\n        availability: \"unavailable\",\n        context: \"256K sample tokens\",\n        cost: \"Unavailable\",\n        capabilities: [\"Documents\", \"Long context\"],\n      },\n    ],\n  },\n];\n\nconst findModel = (id: string) =>\n  groups.flatMap((group) => group.models).find((model) => model.id === id);\n\nexport function ModelSelectorDemo() {\n  const formId = `model-selector-demo-${useId().replace(/:/g, \"\")}`;\n  const searchRef = useRef<HTMLInputElement>(null);\n  const [query, setQuery] = useState(\"\");\n  const [modelId, setModelId] = useState(\"tide-reason\");\n  const [modeId, setModeId] = useState(\"balanced\");\n  const [status, setStatus] = useState(\n    \"Tide Reason with Balanced mode is selected locally.\",\n  );\n\n  const chooseModel = (nextModelId: string) => {\n    const model = findModel(nextModelId);\n    const nextMode = model?.modes?.find((mode) => !mode.disabled)?.id ?? null;\n    setModelId(nextModelId);\n    setModeId(nextMode ?? \"\");\n    setStatus(`${model?.accessibleLabel ?? nextModelId} selected locally.`);\n  };\n\n  const submit = (event: FormEvent<HTMLFormElement>) => {\n    event.preventDefault();\n    const data = new FormData(event.currentTarget);\n    const model = findModel(String(data.get(\"sample-model\") ?? \"\"));\n    const mode = model?.modes?.find(\n      (item) => item.id === data.get(\"sample-mode\"),\n    );\n    setStatus(\n      `Prepared ${model?.accessibleLabel ?? \"the model\"}${mode ? ` in ${mode.accessibleLabel}` : \"\"} for this local preview.`,\n    );\n  };\n\n  const reset = () => {\n    setQuery(\"\");\n    setModelId(\"tide-reason\");\n    setModeId(\"balanced\");\n    setStatus(\"The sample selection was reset.\");\n    searchRef.current?.focus({ preventScroll: true });\n  };\n\n  return (\n    <form id={formId} className=\"model-selector-demo\" onSubmit={submit}>\n      <TidalModelSelector\n        title=\"Choose a workspace model\"\n        description=\"Compare available sample capabilities, context and cost.\"\n        groups={groups}\n        query={query}\n        onQueryChange={setQuery}\n        selectedModelId={modelId || null}\n        selectedModeId={modeId || null}\n        onModelChange={chooseModel}\n        onModeChange={(nextModeId) => {\n          setModeId(nextModeId);\n          setStatus(`${nextModeId} mode selected locally.`);\n        }}\n        modelName=\"sample-model\"\n        modeName=\"sample-mode\"\n        searchInputRef={searchRef}\n        footer=\"Fictional catalog and sample credits. No provider request is made.\"\n      />\n      <div className=\"model-selector-demo-actions\">\n        <button type=\"submit\">Use selection</button>\n        <button type=\"button\" onClick={reset}>\n          Reset\n        </button>\n      </div>\n      <p className=\"model-selector-demo-status\" role=\"status\">\n        {status}\n      </p>\n    </form>\n  );\n}\n\nexport default function AgentExample() {\n  return (\n    <div className=\"tidal-scope\" data-theme=\"light\" dir=\"ltr\">\n      <style>{tidalExampleStyles}</style>\n      <ModelSelectorDemo />\n    </div>\n  );\n}\n",
    "sourceFile": "/examples/model-selector.tsx",
    "fixtureData": "Existing demo fixture data only; replace with consumer-owned data before production use."
  },
  "controlledState": [
    {
      "prop": "query",
      "type": "inferred-from-existing-demo",
      "initial": "\"\"",
      "setter": "setQuery",
      "proposalCanBeRejected": false
    }
  ],
  "events": [
    {
      "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": "onModeChange",
      "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": "onModelChange",
      "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": "onQueryChange",
      "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": []
}
