{"name":"command","dependencies":["cmdk","lucide-react"],"registryDependencies":["@herocn/dialog","@herocn/input-group"],"files":[{"path":"command.tsx","content":"\"use client\";\n\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { cn } from \"cn\";\nimport { CheckIcon, SearchIcon } from \"lucide-react\";\nimport type * as React from \"react\";\nimport {\n\tDialog,\n\tDialogContent,\n\tDialogDescription,\n\tDialogHeader,\n\tDialogTitle,\n} from \"@/components/ui/dialog\";\nimport {\n\tInputGroup,\n\tInputGroupAddon,\n} from \"@/components/ui/input-group\";\n\nfunction Command({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive>) {\n\treturn (\n\t\t<CommandPrimitive\n\t\t\tdata-slot=\"command\"\n\t\t\tclassName={cn(\n\t\t\t\t\"flex size-full flex-col overflow-hidden rounded-xl bg-popover text-popover-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandDialog({\n\ttitle = \"Command Palette\",\n\tdescription = \"Search for a command to run...\",\n\tchildren,\n\toverlayVariant = \"opaque\",\n\tclassName,\n\tshowCloseButton = false,\n\t...props\n}: Omit<React.ComponentProps<typeof Dialog>, \"children\"> &\n\tPick<React.ComponentProps<typeof DialogContent>, \"overlayVariant\"> & {\n\t\ttitle?: string;\n\t\tdescription?: string;\n\t\tclassName?: string;\n\t\tshowCloseButton?: boolean;\n\t\tchildren: React.ReactNode;\n\t}) {\n\treturn (\n\t\t<Dialog {...props}>\n\t\t\t<DialogHeader className=\"sr-only\">\n\t\t\t\t<DialogTitle>{title}</DialogTitle>\n\t\t\t\t<DialogDescription>{description}</DialogDescription>\n\t\t\t</DialogHeader>\n\t\t\t<DialogContent\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"top-4 translate-y-0 overflow-hidden rounded-2xl p-0 transition-none sm:max-w-xl md:top-1/3 md:-translate-y-1/3\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\toverlayVariant={overlayVariant}\n\t\t\t\tshowCloseButton={showCloseButton}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</DialogContent>\n\t\t</Dialog>\n\t);\n}\n\nfunction CommandInput({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Input>) {\n\treturn (\n\t\t<div\n\t\t\tdata-slot=\"command-input-wrapper\"\n\t\t\tclassName=\"rounded-t-xl border-border border-b p-1 pb-1.5\"\n\t\t>\n\t\t\t<InputGroup className=\"rounded-xl hover:not-focus-within:brightness-100 dark:hover:not-focus-within:brightness-100\">\n\t\t\t\t<InputGroupAddon align=\"inline-start\">\n\t\t\t\t\t<SearchIcon className=\"size-4\" />\n\t\t\t\t</InputGroupAddon>\n\t\t\t\t<CommandPrimitive.Input\n\t\t\t\t\tdata-slot=\"command-input\"\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"w-full text-sm outline-hidden placeholder:text-accent-foreground/80 disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t)}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t</InputGroup>\n\t\t</div>\n\t);\n}\n\nfunction CommandList({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.List>) {\n\treturn (\n\t\t<CommandPrimitive.List\n\t\t\tdata-slot=\"command-list\"\n\t\t\tclassName={cn(\n\t\t\t\t\"no-scrollbar max-h-72 scroll-py-1 overflow-y-auto overflow-x-hidden outline-none\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandEmpty({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Empty>) {\n\treturn (\n\t\t<CommandPrimitive.Empty\n\t\t\tdata-slot=\"command-empty\"\n\t\t\tclassName={cn(\"py-6 text-center text-sm\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandGroup({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Group>) {\n\treturn (\n\t\t<CommandPrimitive.Group\n\t\t\tdata-slot=\"command-group\"\n\t\t\tclassName={cn(\n\t\t\t\t\"overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground **:[[cmdk-group-heading]]:text-xs\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandSeparator({\n\tclassName,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Separator>) {\n\treturn (\n\t\t<CommandPrimitive.Separator\n\t\t\tdata-slot=\"command-separator\"\n\t\t\tclassName={cn(\"my-1 h-px bg-border/50\", className)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nfunction CommandItem({\n\tclassName,\n\tchildren,\n\t...props\n}: React.ComponentProps<typeof CommandPrimitive.Item>) {\n\treturn (\n\t\t<CommandPrimitive.Item\n\t\t\tdata-slot=\"command-item\"\n\t\t\tclassName={cn(\n\t\t\t\t\"group/command-item relative flex cursor-pointer select-none items-center gap-2 rounded-xl px-3 py-2.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0 data-[selected=true]:*:[svg]:text-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<CheckIcon className=\"ms-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100\" />\n\t\t</CommandPrimitive.Item>\n\t);\n}\n\nfunction CommandShortcut({\n\tclassName,\n\t...props\n}: React.ComponentProps<\"span\">) {\n\treturn (\n\t\t<span\n\t\t\tdata-slot=\"command-shortcut\"\n\t\t\tclassName={cn(\n\t\t\t\t\"ms-auto text-muted-foreground text-xs tracking-widest group-data-[selected=true]/command-item:text-foreground\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t/>\n\t);\n}\n\nexport {\n\tCommand,\n\tCommandDialog,\n\tCommandEmpty,\n\tCommandGroup,\n\tCommandInput,\n\tCommandItem,\n\tCommandList,\n\tCommandSeparator,\n\tCommandShortcut,\n};\n","type":"registry:ui"}],"type":"registry:ui"}