{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "command",
  "title": "Command",
  "description": "A searchable list of actions, inline or in a palette dialog.",
  "dependencies": [
    "cmdk"
  ],
  "registryDependencies": [
    "https://ui.ndekocode.dev/r/theme.json",
    "https://ui.ndekocode.dev/r/utils.json",
    "https://ui.ndekocode.dev/r/icons.json",
    "https://ui.ndekocode.dev/r/recipes.json",
    "https://ui.ndekocode.dev/r/dialog.json"
  ],
  "files": [
    {
      "path": "registry/ndeko/ui/command.tsx",
      "content": "'use client';\n\nimport { Command as CommandPrimitive } from 'cmdk';\n\nimport { SearchIcon } from '@/registry/ndeko/lib/icons';\nimport { MENU_SEPARATOR } from '@/registry/ndeko/lib/recipes';\nimport { cn } from '@/registry/ndeko/lib/utils';\nimport {\n  Dialog,\n  DialogContent,\n  DialogDescription,\n  DialogTitle,\n} from '@/registry/ndeko/ui/dialog';\n\nfunction Command({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n  return (\n    <CommandPrimitive\n      data-slot='command'\n      className={cn(\n        'bg-popover text-popover-foreground flex size-full flex-col overflow-hidden rounded-xl',\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\ntype CommandDialogProps = Omit<\n  React.ComponentProps<typeof Dialog>,\n  'children'\n> & {\n  title?: string;\n  description?: string;\n  className?: string;\n  children?: React.ReactNode;\n};\n\nfunction CommandDialog({\n  title = 'Command palette',\n  description = 'Search for a command to run.',\n  className,\n  children,\n  ...props\n}: CommandDialogProps) {\n  return (\n    <Dialog {...props}>\n      <DialogContent\n        showCloseButton={false}\n        instant\n        animateSize={false}\n        contentClassName='gap-0'\n        className={cn('max-w-lg overflow-hidden p-0', className)}\n      >\n        <DialogTitle className='sr-only'>{title}</DialogTitle>\n        <DialogDescription className='sr-only'>{description}</DialogDescription>\n        <Command className='rounded-none bg-transparent **:data-[slot=command-input-wrapper]:h-12'>\n          {children}\n        </Command>\n      </DialogContent>\n    </Dialog>\n  );\n}\n\nfunction CommandInput({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n  return (\n    <div\n      data-slot='command-input-wrapper'\n      className='hairline-b border-border flex h-10 items-center gap-2 px-3'\n    >\n      <SearchIcon className='text-muted-foreground size-4 shrink-0' />\n      <CommandPrimitive.Input\n        data-slot='command-input'\n        className={cn(\n          'placeholder:text-muted-foreground/75 flex h-full w-full bg-transparent text-[13px] outline-none disabled:cursor-not-allowed disabled:opacity-50',\n          className\n        )}\n        {...props}\n      />\n    </div>\n  );\n}\n\nfunction CommandList({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n  return (\n    <CommandPrimitive.List\n      data-slot='command-list'\n      className={cn(\n        'max-h-80 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto p-1',\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction CommandEmpty({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n  return (\n    <CommandPrimitive.Empty\n      data-slot='command-empty'\n      className={cn(\n        'text-muted-foreground py-6 text-center text-[13px]',\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction CommandGroup({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n  return (\n    <CommandPrimitive.Group\n      data-slot='command-group'\n      className={cn(\n        'text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium',\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(MENU_SEPARATOR, className)}\n      {...props}\n    />\n  );\n}\n\nfunction CommandItem({\n  className,\n  ...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n  return (\n    <CommandPrimitive.Item\n      data-slot='command-item'\n      className={cn(\n        \"data-[selected=true]:bg-foreground/5 [&_svg:not([class*='text-'])]:text-muted-foreground relative flex h-8 cursor-default items-center gap-2.5 rounded-md px-2 text-[13px] outline-none select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4\",\n        className\n      )}\n      {...props}\n    />\n  );\n}\n\nfunction CommandShortcut({ className, ...props }: React.ComponentProps<'kbd'>) {\n  return (\n    <kbd\n      data-slot='command-shortcut'\n      className={cn(\n        'keycap-3d text-muted-foreground ms-auto inline-flex h-5 min-w-5 items-center justify-center rounded-[5px] px-1 font-sans text-[11px] font-medium',\n        className\n      )}\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": [
    "primitives"
  ],
  "type": "registry:ui"
}