{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "command-palette-shadcnui", "type": "registry:component", "title": "Command Palette", "description": "Command palette with search and keyboard navigation", "registryDependencies": [ "button" ], "dependencies": [ "framer-motion", "react" ], "files": [ { "path": "@uitripled/react-shadcn/src/components/search/command-palette.tsx", "content": "\"use client\";\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n type Transition,\n type Variants,\n} from \"framer-motion\";\nimport { File, Search, Settings, User, X } from \"lucide-react\";\nimport { useMemo, useState } from \"react\";\n\ntype Command = {\n icon: typeof File;\n label: string;\n shortcut: string;\n description: string;\n};\n\nconst commands: Command[] = [\n {\n icon: File,\n label: \"New File\",\n shortcut: \"⌘N\",\n description: \"Spin up a glassmorphic canvas\",\n },\n {\n icon: Settings,\n label: \"Workspace Settings\",\n shortcut: \"⌘,\",\n description: \"Fine-tune tokens, motion, and themes\",\n },\n {\n icon: User,\n label: \"Team Directory\",\n shortcut: \"⌘P\",\n description: \"Invite collaborators to your motion library\",\n },\n {\n icon: Search,\n label: \"Global Command\",\n shortcut: \"⌘K\",\n description: \"Jump anywhere with palette search\",\n },\n];\n\nconst overlayTransition: Transition = { duration: 0.24, ease: \"easeOut\" };\n\nexport function CommandPalette() {\n const [isOpen, setIsOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const shouldReduceMotion = useReducedMotion();\n\n const filteredCommands = useMemo(\n () =>\n commands.filter((cmd) =>\n cmd.label.toLowerCase().includes(query.toLowerCase())\n ),\n [query]\n );\n\n const panelVariants: Variants = shouldReduceMotion\n ? {\n initial: { opacity: 0, y: 0, scale: 1 },\n animate: { opacity: 1, y: 0, scale: 1 },\n exit: { opacity: 0, y: 0, scale: 1 },\n }\n : {\n initial: { opacity: 0, scale: 0.96, y: 20, filter: \"blur(6px)\" },\n animate: {\n opacity: 1,\n scale: 1,\n y: 0,\n filter: \"blur(0px)\",\n transition: { duration: 0.28, ease: [0.18, 0.89, 0.32, 1.12] },\n },\n exit: {\n opacity: 0,\n scale: 0.97,\n y: 12,\n filter: \"blur(8px)\",\n transition: { duration: 0.2, ease: [0.4, 0, 0.2, 1] },\n },\n };\n\n return (\n