{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "thinking-model-select",
  "title": "ThinkingModelSelect",
  "description": "Model picker with an embedded reasoning-effort slider in the popup footer.",
  "registryDependencies": [
    "utils",
    "https://ui.neon.com/r/model-select.json",
    "https://ui.neon.com/r/thinking-select.json",
    "https://ui.neon.com/r/neon-tokens.json"
  ],
  "files": [
    {
      "path": "src/components/thinking-model-select/thinking-model-select.tsx",
      "content": "\"use client\";\n\nimport type { KeyboardEvent } from \"react\";\n\nimport { ModelSelect } from \"@/components/model-select/model-select\";\nimport type {\n  ModelSelectProps,\n  ModelSelectSize,\n} from \"@/components/model-select/model-select\";\nimport { ThinkingSelect } from \"@/components/thinking-select/thinking-select\";\nimport type { ThinkingEffort } from \"@/components/thinking-select/thinking-select\";\nimport { cn } from \"@/lib/utils\";\n\nexport type ThinkingModelSelectProps = Omit<\n  ModelSelectProps,\n  \"footer\" | \"onPopupKeyDown\" | \"valueSuffix\"\n> & {\n  /** Controlled reasoning effort. */\n  effort: ThinkingEffort;\n  /** Called with the newly selected reasoning effort. */\n  onEffortChange: (effort: ThinkingEffort) => void;\n};\n\n/* ─────────────────────────────────────────────────────────\n * COMPOSITION STORYBOARD\n *\n * ModelSelect provides the trigger, search, and list; this\n * component pins a ThinkingSelect footer under the list and\n * echoes the current effort in the trigger. Tab cycles the\n * effort while the popup is open. The footer disappears for\n * models that cannot reason.\n * ───────────────────────────────────────────────────────── */\nconst EFFORT_CYCLE: ThinkingEffort[] = [\n  \"off\",\n  \"low\",\n  \"medium\",\n  \"high\",\n  \"xhigh\",\n  \"max\",\n];\n\nconst EFFORT_SHORT: Record<ThinkingEffort, string> = {\n  high: \"high\",\n  low: \"low\",\n  max: \"max\",\n  medium: \"med\",\n  off: \"off\",\n  xhigh: \"xhigh\",\n};\n\n/** Tiny effort readout for the trigger: off, low, med, high, xhigh, max. */\nconst EffortReadout = ({ effort }: { effort: ThinkingEffort }) => (\n  <span\n    aria-hidden=\"true\"\n    className={cn(\n      \"ml-0.5 w-[5ch] shrink-0 font-mono text-[10px] leading-none\",\n      effort === \"off\" ? \"text-muted-foreground/70\" : \"text-primary\"\n    )}\n  >\n    {EFFORT_SHORT[effort]}\n  </span>\n);\n\nconst FOOTER_SLIDER_SIZE: Record<ModelSelectSize, \"sm\" | \"md\" | \"lg\"> = {\n  lg: \"md\",\n  md: \"sm\",\n  sm: \"sm\",\n};\n\nexport const ThinkingModelSelect = ({\n  defaultValue,\n  effort,\n  models,\n  onEffortChange,\n  size = \"md\",\n  value,\n  ...props\n}: ThinkingModelSelectProps) => {\n  const selected = models.find((model) => model.id === (value ?? defaultValue));\n  const showThinking = selected?.reasoning !== false;\n\n  const cycleEffort = () => {\n    const index = EFFORT_CYCLE.indexOf(effort);\n    const next = EFFORT_CYCLE[(index + 1) % EFFORT_CYCLE.length];\n\n    if (next) {\n      onEffortChange(next);\n    }\n  };\n\n  const handlePopupKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n    if (event.key === \"Tab\" && showThinking) {\n      event.preventDefault();\n      event.stopPropagation();\n      cycleEffort();\n    }\n  };\n\n  return (\n    <ModelSelect\n      defaultValue={defaultValue}\n      footer={\n        showThinking ? (\n          <div\n            className=\"flex items-center gap-2 bg-muted/15 p-1\"\n            onKeyDown={(event) => {\n              if (event.key === \"Tab\") {\n                return;\n              }\n              event.stopPropagation();\n            }}\n            onPointerDown={(event) => event.stopPropagation()}\n            role=\"presentation\"\n          >\n            <ThinkingSelect\n              className=\"min-w-0 flex-1\"\n              onValueChange={onEffortChange}\n              size={FOOTER_SLIDER_SIZE[size]}\n              value={effort}\n            />\n            <kbd className=\"mr-1 shrink-0 border border-border/40 px-1 py-px font-mono text-[9px] text-muted-foreground/60 lowercase\">\n              tab\n            </kbd>\n          </div>\n        ) : undefined\n      }\n      models={models}\n      onPopupKeyDown={handlePopupKeyDown}\n      size={size}\n      value={value}\n      valueSuffix={showThinking ? <EffortReadout effort={effort} /> : undefined}\n      {...props}\n    />\n  );\n};\n",
      "type": "registry:component"
    }
  ],
  "type": "registry:component"
}