{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"command-palette","type":"registry:component","title":"Command Palette","description":"Instant-filter command menu with keyboard shortcut badges and action feedback for power-user hackathon apps.","dependencies":["lucide-react"],"files":[{"path":"components/incepture/command-palette.tsx","type":"registry:component","target":"components/incepture/command-palette.tsx","content":"\"use client\";\n\nimport { useMemo, useState } from \"react\";\nimport { CornerDownLeft, FileCode2, FolderGit2, Search, Settings, Terminal } from \"lucide-react\";\n\ninterface CommandItem {\n  id: string;\n  label: string;\n  group: string;\n  shortcut?: string;\n  icon: \"code\" | \"repo\" | \"terminal\" | \"settings\";\n}\n\nconst COMMANDS: CommandItem[] = [\n  { id: \"new-project\", label: \"Create new hackathon project\", group: \"Quick Actions\", shortcut: \"N\", icon: \"repo\" },\n  { id: \"copy-cli\", label: \"Copy registry install command\", group: \"Quick Actions\", shortcut: \"C\", icon: \"terminal\" },\n  { id: \"open-docs\", label: \"Browse server-rendered blocks\", group: \"Navigation\", shortcut: \"G D\", icon: \"code\" },\n  { id: \"toggle-theme\", label: \"Switch color theme\", group: \"Preferences\", shortcut: \"T\", icon: \"settings\" },\n  { id: \"deploy-vercel\", label: \"Deploy preview to Vercel\", group: \"Quick Actions\", shortcut: \"D\", icon: \"terminal\" },\n];\n\nconst ICONS = {\n  code: FileCode2,\n  repo: FolderGit2,\n  terminal: Terminal,\n  settings: Settings,\n};\n\nexport function CommandPalette() {\n  const [query, setQuery] = useState(\"\");\n  const [selected, setSelected] = useState<string | null>(null);\n\n  const filtered = useMemo(() => {\n    const q = query.trim().toLowerCase();\n    if (!q) return COMMANDS;\n    return COMMANDS.filter(\n      (item) =>\n        item.label.toLowerCase().includes(q) ||\n        item.group.toLowerCase().includes(q)\n    );\n  }, [query]);\n\n  return (\n    <div className=\"mx-auto w-full max-w-lg overflow-hidden rounded-xl border border-stone-200 bg-white text-stone-900 shadow-lg dark:border-stone-800 dark:bg-stone-900 dark:text-stone-100\">\n      <div className=\"flex items-center gap-3 border-b border-stone-200 px-4 py-3 dark:border-stone-800\">\n        <Search className=\"h-4 w-4 text-stone-400\" />\n        <input\n          type=\"text\"\n          value={query}\n          onChange={(e) => setQuery(e.target.value)}\n          placeholder=\"Type a command or search...\"\n          aria-label=\"Search commands\"\n          className=\"w-full bg-transparent text-sm outline-none placeholder:text-stone-400\"\n        />\n        <kbd className=\"rounded border border-stone-200 px-1.5 py-0.5 font-mono text-[10px] text-stone-500 dark:border-stone-700\">\n          ESC\n        </kbd>\n      </div>\n\n      <ul className=\"max-h-64 overflow-y-auto p-2\" role=\"listbox\" aria-label=\"Commands\">\n        {filtered.length === 0 ? (\n          <li className=\"px-3 py-6 text-center text-xs text-stone-500\">\n            No commands match &ldquo;{query}&rdquo;.\n          </li>\n        ) : (\n          filtered.map((item) => {\n            const Icon = ICONS[item.icon];\n            const isSelected = selected === item.id;\n            return (\n              <li key={item.id}>\n                <button\n                  type=\"button\"\n                  onClick={() => setSelected(item.id)}\n                  className={`flex w-full items-center justify-between rounded-lg px-3 py-2.5 text-left text-sm transition ${\n                    isSelected\n                      ? \"bg-stone-900 text-stone-50 dark:bg-stone-100 dark:text-stone-950\"\n                      : \"hover:bg-stone-100 dark:hover:bg-stone-800\"\n                  }`}\n                >\n                  <span className=\"flex items-center gap-2.5\">\n                    <Icon className=\"h-4 w-4 opacity-70\" />\n                    <span>{item.label}</span>\n                  </span>\n                  <span className=\"flex items-center gap-2\">\n                    {item.shortcut && (\n                      <kbd\n                        className={`rounded px-1.5 py-0.5 font-mono text-[10px] ${\n                          isSelected\n                            ? \"bg-white/15 text-inherit dark:bg-black/15\"\n                            : \"border border-stone-200 text-stone-500 dark:border-stone-700\"\n                        }`}\n                      >\n                        {item.shortcut}\n                      </kbd>\n                    )}\n                    <CornerDownLeft className=\"h-3.5 w-3.5 opacity-50\" />\n                  </span>\n                </button>\n              </li>\n            );\n          })\n        )}\n      </ul>\n\n      <div className=\"flex items-center justify-between border-t border-stone-200 bg-stone-50 px-4 py-2 font-mono text-[11px] text-stone-500 dark:border-stone-800 dark:bg-stone-950\">\n        <span>{filtered.length} commands</span>\n        <span>{selected ? `Ran: ${selected}` : \"Click any item to run\"}</span>\n      </div>\n    </div>\n  );\n}\n"}]}