{
  "title": "Model Selector",
  "description": "AI-focused model selector with preview, tooltips, and capability indicators built-in",
  "name": "gsap-ai-model-selector",
  "dependencies": [
    "gsap",
    "@gsap/react"
  ],
  "registryDependencies": [
    "gsap-swap",
    "button",
    "dropdown-menu",
    "tooltip",
    "scroll-area"
  ],
  "type": "registry:ui",
  "files": [
    {
      "path": "components/paceui/gsap/ai-model-selector.tsx",
      "type": "registry:ui",
      "content": "import { type ComponentProps, type ReactNode, useMemo, useState } from \"react\";\n\nimport {\n    BrainIcon,\n    CodeIcon,\n    EyeIcon,\n    FileSearch2Icon,\n    LanguagesIcon,\n    LayersIcon,\n    SpeechIcon,\n    VariableIcon,\n    VideoIcon,\n    Wand2Icon,\n    WrenchIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nimport { Button } from \"@/components/ui/button\";\nimport {\n    DropdownMenu,\n    DropdownMenuContent,\n    DropdownMenuItem,\n    DropdownMenuTrigger,\n} from \"@/components/ui/dropdown-menu\";\nimport { Swap } from \"@/components/paceui/gsap/swap\";\nimport { ScrollArea } from \"@/components/ui/scroll-area\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"@/components/ui/tooltip\";\n\ntype ModelCapability =\n    | \"vision\"\n    | \"thinking\"\n    | \"code\"\n    | \"speech\"\n    | \"search\"\n    | \"tools\"\n    | \"multimodal\"\n    | \"video\"\n    | \"math\"\n    | \"multilingual\"\n    | \"creativity\";\n\nexport type ModelOption = {\n    value: string;\n    image: string;\n    name: string;\n    darkInvertImage?: boolean;\n    description: string;\n    capabilities: ModelCapability[];\n};\n\ntype ModelSelectorProps = ComponentProps<typeof Button> & {\n    showCapabilities?: boolean;\n    showDescription?: boolean;\n};\n\nconst models: ModelOption[] = [\n    {\n        value: \"anthropic-claude-opus-5-5\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/claude-color.svg\",\n        name: \"Claude Opus 5.5\",\n        description: \"Industry-leading intelligence with a focus on coding, complex reasoning, and nuance.\",\n        capabilities: [\"thinking\", \"code\", \"vision\", \"tools\"],\n    },\n    {\n        value: \"openai-gpt-6-1-sol\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/openai.svg\",\n        name: \"GPT-6.1 Sol\",\n        darkInvertImage: true,\n        description: \"Omni model supporting seamless text, audio, and vision integration.\",\n        capabilities: [\"vision\", \"code\", \"speech\", \"tools\", \"multimodal\"],\n    },\n    {\n        value: \"google-gemini-4-argon\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/gemini-color.svg\",\n        name: \"Gemini 4 Argon\",\n        description: \"Next-generation performance with ultra-long context windows.\",\n        capabilities: [\"vision\", \"thinking\", \"speech\", \"tools\", \"video\"],\n    },\n    {\n        value: \"xai-grok-4-7\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/grok.svg\",\n        name: \"Grok 4.7\",\n        darkInvertImage: true,\n        description: \"Real-time information processing with enhanced logical reasoning.\",\n        capabilities: [\"thinking\", \"search\", \"code\"],\n    },\n    {\n        value: \"mistral-large-4\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/mistral-color.svg\",\n        name: \"Mistral Large 4\",\n        description: \"European powerhouse optimized for multilingual reasoning.\",\n        capabilities: [\"thinking\", \"code\", \"multilingual\"],\n    },\n    {\n        value: \"deepseek-v3\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/deepseek-color.svg\",\n        name: \"DeepSeek-V3\",\n        description: \"High-performance Mixture-of-Experts model for advanced logic.\",\n        capabilities: [\"thinking\", \"code\", \"math\"],\n    },\n    {\n        value: \"meta-llama-3-1-405b\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/meta-color.svg\",\n        name: \"Llama 3.1 (405B)\",\n        description: \"The premier open-source model for complex reasoning and scale.\",\n        capabilities: [\"thinking\", \"code\", \"tools\"],\n    },\n    {\n        value: \"stability-sd3-ultra\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/stability-color.svg\",\n        name: \"Stable Diffusion 3 Ultra\",\n        description: \"State-of-the-art text-to-image with superior prompt adherence.\",\n        capabilities: [\"vision\", \"creativity\"],\n    },\n    {\n        value: \"midjourney-v6-1\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/midjourney.svg\",\n        name: \"Midjourney v6.1\",\n        darkInvertImage: true,\n        description: \"Highly aesthetic and photorealistic image generation.\",\n        capabilities: [\"vision\", \"creativity\"],\n    },\n    {\n        value: \"perplexity-sonar-pro\",\n        image: \"https://unpkg.com/@lobehub/icons-static-svg@latest/icons/perplexity-color.svg\",\n        name: \"Sonar Pro\",\n        description: \"Search-centric model designed for cited, real-time factual answers.\",\n        capabilities: [\"search\", \"thinking\"],\n    },\n];\n\nconst CapabilityBadge = ({ capability }: { capability: ModelCapability }) => {\n    const styles: Record<ModelCapability, { color: string; text: string; icon: ReactNode }> = {\n        thinking: {\n            color: \"bg-purple-500/10 hover:bg-purple-500/20 text-purple-500\",\n            text: \"Thinking\",\n            icon: <BrainIcon className=\"size-3.5\" />,\n        },\n        code: {\n            color: \"bg-cyan-500/10 hover:bg-cyan-500/20 text-cyan-500\",\n            text: \"Code\",\n            icon: <CodeIcon className=\"size-3.5\" />,\n        },\n        vision: {\n            color: \"bg-green-500/10 hover:bg-green-500/20 text-green-500\",\n            text: \"Vision\",\n            icon: <EyeIcon className=\"size-3.5\" />,\n        },\n        creativity: {\n            color: \"bg-orange-500/10 hover:bg-orange-500/20 text-orange-500\",\n            text: \"Creativity\",\n            icon: <Wand2Icon className=\"size-3.5\" />,\n        },\n        search: {\n            color: \"bg-teal-500/10 hover:bg-teal-500/20 text-teal-500\",\n            text: \"Search\",\n            icon: <FileSearch2Icon className=\"size-3.5\" />,\n        },\n        speech: {\n            color: \"bg-pink-500/10 hover:bg-pink-500/20 text-pink-500\",\n            text: \"Speech\",\n            icon: <SpeechIcon className=\"size-3.5\" />,\n        },\n        tools: {\n            color: \"bg-blue-500/10 hover:bg-blue-500/20 text-blue-500\",\n            text: \"Tools\",\n            icon: <WrenchIcon className=\"size-3.5\" />,\n        },\n        video: {\n            color: \"bg-rose-500/10 hover:bg-rose-500/20 text-rose-500\",\n            text: \"Video\",\n            icon: <VideoIcon className=\"size-3.5\" />,\n        },\n        multilingual: {\n            color: \"bg-amber-500/10 hover:bg-amber-500/20 text-amber-500\",\n            text: \"Global\",\n            icon: <LanguagesIcon className=\"size-3.5\" />,\n        },\n        multimodal: {\n            color: \"bg-indigo-500/10 hover:bg-indigo-500/20 text-indigo-500\",\n            text: \"Multimodal\",\n            icon: <LayersIcon className=\"size-3.5\" />,\n        },\n        math: {\n            color: \"bg-slate-500/10 hover:bg-slate-500/20 text-slate-500\",\n            text: \"Math\",\n            icon: <VariableIcon className=\"size-3.5\" />,\n        },\n    };\n\n    const defaultStyle = {\n        color: \"bg-purple-500/10 hover:bg-purple-500/20 text-purple-500\",\n        text: \"Thinking\",\n        icon: <BrainIcon className=\"size-3.5\" />,\n    };\n\n    const { color, text, icon } = styles[capability] ?? defaultStyle;\n\n    return (\n        <Tooltip>\n            <TooltipTrigger render={<div className={cn(\"rounded p-1\", color)}>{icon}</div>}></TooltipTrigger>\n            <TooltipContent>\n                <p>{text}</p>\n            </TooltipContent>\n        </Tooltip>\n    );\n};\n\nexport const AiModelSelector = ({\n    showDescription = true,\n    showCapabilities = true,\n    variant = \"outline\",\n    className,\n    ...props\n}: ModelSelectorProps) => {\n    const [selectedModel, setSelectedModel] = useState(models[0].value);\n\n    const selectedModelItem = useMemo(() => {\n        return models.find((item) => item.value === selectedModel) ?? models[0];\n    }, [selectedModel]);\n\n    return (\n        <TooltipProvider>\n            <DropdownMenu>\n                <DropdownMenuTrigger\n                    render={\n                        <Button\n                            {...props}\n                            variant={variant}\n                            className={cn(\n                                \"h-8 max-w-full cursor-pointer overflow-hidden px-2.5 shadow-none select-none\",\n                                className,\n                            )}>\n                            <Swap state={selectedModelItem} effects={[\"blur\", \"slideDown\", \"opacity\"]}>\n                                {(state) => (\n                                    <div className=\"flex max-w-full items-center gap-2\">\n                                        <img\n                                            src={state.image}\n                                            className={cn(\"size-4 shrink-0\", { \"dark:invert\": state.darkInvertImage })}\n                                            alt={`${state.name} logo`}\n                                        />\n                                        <p className=\"truncate text-xs font-medium sm:text-sm\">{state.name}</p>\n                                        {showCapabilities && (\n                                            <div className=\"hidden items-center gap-1 sm:flex\">\n                                                {state.capabilities.slice(0, 3).map((capability) => (\n                                                    <CapabilityBadge capability={capability} key={capability} />\n                                                ))}\n                                            </div>\n                                        )}\n                                    </div>\n                                )}\n                            </Swap>\n                        </Button>\n                    }></DropdownMenuTrigger>\n                <DropdownMenuContent className=\"w-80 max-w-[calc(100vw-2rem)] shadow-none\" align=\"start\">\n                    <ScrollArea className=\"h-80\">\n                        <div className=\"space-y-0.5\">\n                            {models.map((item) => (\n                                <DropdownMenuItem\n                                    key={item.value}\n                                    onClick={() => setSelectedModel(item.value)}\n                                    className={cn(\"group relative cursor-pointer gap-3\", {\n                                        \"bg-accent\": selectedModel === item.value,\n                                    })}>\n                                    <img\n                                        src={item.image}\n                                        alt={`${item.name} logo`}\n                                        className={cn(\"size-5 shrink-0 sm:size-6\", {\n                                            \"dark:invert\": item.darkInvertImage,\n                                        })}\n                                    />\n                                    <div className=\"min-w-0 grow\">\n                                        <div className=\"flex items-center gap-2\">\n                                            <p className=\"grow truncate text-sm font-medium\">{item.name}</p>\n                                        </div>\n                                        {showDescription && (\n                                            <p className=\"text-muted-foreground mt-0.5 line-clamp-1 text-xs\">\n                                                {item.description}\n                                            </p>\n                                        )}\n                                    </div>\n                                    {showCapabilities && (\n                                        <div className=\"absolute end-0 hidden translate-x-5 scale-90 items-center gap-1 rounded bg-inherit px-2 py-1 opacity-0 transition-all duration-300 group-hover:translate-x-0 group-hover:scale-100 group-hover:opacity-100 sm:flex\">\n                                            {item.capabilities.map((capability) => (\n                                                <CapabilityBadge capability={capability} key={capability} />\n                                            ))}\n                                        </div>\n                                    )}\n                                </DropdownMenuItem>\n                            ))}\n                        </div>\n                    </ScrollArea>\n                </DropdownMenuContent>\n            </DropdownMenu>\n        </TooltipProvider>\n    );\n};\n"
    },
    {
      "path": "components/paceui/gsap/swap.tsx",
      "type": "registry:ui",
      "content": "import { type ComponentProps, type ReactNode, useMemo, useRef, useState } from \"react\";\n\nimport { useGSAP } from \"@gsap/react\";\nimport gsap from \"gsap\";\n\nconst effectPresets = {\n    slideUp: [\n        {\n            y: \"-100%\",\n        },\n        {\n            y: \"100%\",\n        },\n        {\n            y: 0,\n        },\n    ],\n    slideDown: [\n        {\n            y: \"100%\",\n        },\n        {\n            y: \"-100%\",\n        },\n        {\n            y: 0,\n        },\n    ],\n    opacity: [\n        {\n            opacity: 0,\n        },\n        {\n            opacity: 0,\n        },\n        {\n            opacity: 1,\n        },\n    ],\n    blur: [\n        {\n            filter: \"blur(12px)\",\n        },\n        {\n            filter: \"blur(12px)\",\n        },\n        {\n            filter: \"blur(0px)\",\n        },\n    ],\n    grayscale: [\n        {\n            filter: \"grayscale(100%)\",\n        },\n        {\n            filter: \"grayscale(100%)\",\n        },\n        {\n            filter: \"grayscale(0%)\",\n        },\n    ],\n} as const;\n\nexport type SwapProps<T = object> = Omit<ComponentProps<\"div\">, \"children\"> & {\n    state: T;\n    children: (state: T) => ReactNode;\n    effects?: (keyof typeof effectPresets)[];\n    duration?: number;\n};\n\nconst mergeVars = (varsArray: Record<string, string | number>[]) => {\n    const merged: Record<string, string | number> = {};\n\n    for (const vars of varsArray) {\n        for (const [key, value] of Object.entries(vars)) {\n            if (key === \"filter\" && merged.filter) {\n                merged.filter += ` ${value}`; // combine filters\n            } else {\n                merged[key] = value; // last one wins for other props\n            }\n        }\n    }\n\n    return merged;\n};\n\nexport const Swap = <T,>({ state, children, duration = 0.4, effects = [], ...props }: SwapProps<T>) => {\n    const [currentState, setCurrentState] = useState(state);\n\n    const containerRef = useRef<HTMLDivElement>(null);\n    const contentRef = useRef<HTMLDivElement>(null);\n\n    const [enterVars, exitVars, finalVars] = useMemo(\n        () => Array.from({ length: 3 }, (_, i) => mergeVars(effects.map((e) => effectPresets[e][i]))),\n        [effects],\n    );\n\n    useGSAP(\n        () => {\n            if (currentState === state) return;\n            const content = contentRef.current;\n            if (!content) return;\n\n            gsap.to(content, {\n                ...enterVars,\n                duration,\n                ease: \"power2.in\",\n                onComplete: () => {\n                    setCurrentState(state);\n                    gsap.fromTo(content, exitVars, {\n                        ...finalVars,\n                        duration,\n                        ease: \"power2.out\",\n                    });\n                },\n            });\n        },\n        { dependencies: [state] },\n    );\n\n    useGSAP(\n        () => {\n            if (!containerRef.current || !contentRef.current) return;\n\n            const box = contentRef.current.getBoundingClientRect();\n\n            gsap.to(containerRef.current, {\n                width: box.width,\n                height: box.height,\n                duration: 0.4,\n                ease: \"power2.out\",\n            });\n        },\n        { dependencies: [currentState] },\n    );\n\n    return (\n        <div {...props} ref={containerRef}>\n            <div ref={contentRef} className=\"inline-block\">\n                {children(currentState)}\n            </div>\n        </div>\n    );\n};\n"
    }
  ],
  "mcp": {
    "description": "Provides refined UI interactions and accessible controls. AI-focused model selector with preview, tooltips, and capability indicators built-in Configurable props include: ComponentProps<typeof Button> & {; showCapabilities?: boolean;; showDescription?: boolean;. Relies on gsap, @gsap/react, gsap-swap, button, dropdown-menu, tooltip. Optimal for building reusable interface elements and user input flows.",
    "tags": [
      "component",
      "gsap",
      "animation"
    ]
  }
}