{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command",
  "title": "Command",
  "description": "A searchable command palette with keyboard navigation, groups, empty state and dialog composition.",
  "dependencies": [
    "cmdk@^1.1.1"
  ],
  "registryDependencies": [
    "@neumorphism-ui/utils",
    "@neumorphism-ui/dialog"
  ],
  "files": [
    {
      "path": "src/components/ui/command.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\nimport { Command as CommandPrimitive, useCommandState } from \"cmdk\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogHeader,\n  DialogTitle,\n} from \"@/components/ui/dialog\";\n\nfunction Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {\n  return (\n    <CommandPrimitive\n      data-slot=\"command\"\n      className={cn(\n        \"flex h-full w-full flex-col overflow-hidden rounded-[var(--neu-radius-overlay)] border border-[color:var(--neu-edge)] bg-[var(--popover)] text-[var(--popover-foreground)] [box-shadow:var(--neu-shadow-raised-sm)]\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction CommandDialog({\n  title = \"Command palette\",\n  description = \"Search for a command to run.\",\n  children,\n  className,\n  showCloseButton = false,\n  ...props\n}: Omit<React.ComponentProps<typeof Dialog>, \"children\"> & {\n  title?: string;\n  description?: string;\n  className?: string;\n  showCloseButton?: boolean;\n  children?: React.ReactNode;\n}) {\n  return (\n    <Dialog {...props}>\n      <DialogContent\n        className={cn(\"gap-0 overflow-hidden p-0\", className)}\n        showCloseButton={showCloseButton}\n      >\n        <DialogHeader className=\"sr-only\">\n          <DialogTitle>{title}</DialogTitle>\n          <DialogDescription>{description}</DialogDescription>\n        </DialogHeader>\n        <Command className=\"rounded-none border-0 [box-shadow:none]\">{children}</Command>\n      </DialogContent>\n    </Dialog>\n  );\n}\n\nfunction CommandInput({\n  className,\n  \"aria-label\": ariaLabel,\n  placeholder,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n  return (\n    <div\n      data-slot=\"command-input-wrapper\"\n      className=\"m-2 mb-0 flex h-10 shrink-0 items-center gap-2 rounded-[var(--neu-radius-control)] border border-transparent bg-[var(--neu-surface)] px-3 [box-shadow:var(--neu-shadow-inset)] focus-within:outline-2 focus-within:outline-solid focus-within:outline-offset-1 focus-within:outline-[color:var(--ring)]\"\n    >\n      <svg aria-hidden=\"true\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" className=\"size-4 shrink-0 text-[var(--muted-foreground)]\"><circle cx=\"10.5\" cy=\"10.5\" r=\"6.5\" /><path d=\"m16 16 4 4\" /></svg>\n      <CommandPrimitive.Input\n        data-slot=\"command-input\"\n        aria-label={ariaLabel ?? placeholder ?? \"Command search\"}\n        placeholder={placeholder}\n        className={cn(\n          \"h-9 w-full min-w-0 bg-transparent text-sm text-[var(--foreground)] outline-none placeholder:text-[var(--muted-foreground)] disabled:pointer-events-none disabled:opacity-50\",\n          className,\n        )}\n        {...props}\n      />\n    </div>\n  );\n}\n\nfunction CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {\n  return (\n    <CommandPrimitive.List\n      data-slot=\"command-list\"\n      className={cn(\n        \"max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto p-1.5 outline-none\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n  const search = useCommandState((state) => state.search);\n  if (!search) return null;\n  return (\n    <CommandPrimitive.Empty\n      data-slot=\"command-empty\"\n      className={cn(\"px-3 py-8 text-center text-sm text-[var(--muted-foreground)]\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {\n  return (\n    <CommandPrimitive.Group\n      data-slot=\"command-group\"\n      className={cn(\n        \"overflow-hidden py-1 text-[var(--foreground)] [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-2 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-semibold [&_[cmdk-group-heading]]:text-[var(--muted-foreground)]\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction CommandSeparator({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n  return (\n    <CommandPrimitive.Separator\n      data-slot=\"command-separator\"\n      className={cn(\"-mx-1 my-1 h-px bg-[var(--border)]\", className)}\n      {...props}\n    />\n  );\n}\n\nfunction CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {\n  return (\n    <CommandPrimitive.Item\n      data-slot=\"command-item\"\n      className={cn(\n        \"relative flex min-h-10 cursor-default items-center gap-2 rounded-[var(--neu-radius-control)] px-2.5 py-2 text-sm outline-none select-none transition-[background-color,box-shadow,color] duration-[var(--neu-duration)] motion-reduce:transition-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-[var(--neu-surface)] data-[selected=true]:text-[var(--neu-accent-ink)] data-[selected=true]:[box-shadow:var(--neu-shadow-inset-sm)]\",\n        className,\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<\"span\">) {\n  return (\n    <span\n      data-slot=\"command-shortcut\"\n      className={cn(\"ml-auto text-xs tracking-widest text-[var(--muted-foreground)]\", className)}\n      {...props}\n    />\n  );\n}\n\nexport {\n  Command,\n  CommandDialog,\n  CommandEmpty,\n  CommandGroup,\n  CommandInput,\n  CommandItem,\n  CommandList,\n  CommandSeparator,\n  CommandShortcut,\n};\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "navigation-disclosure"
  ],
  "type": "registry:ui"
}