{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "command", "title": "Command", "description": "A command menu / palette (cmdk) for keyboard-driven navigation and actions, reusable across apps", "dependencies": [ "cmdk", "@ark-ui/react", "lucide-react", "clsx", "tailwind-merge" ], "registryDependencies": ["dialog"], "files": [ { "path": "src/registry/thornberry/components/command.tsx", "content": "import { Portal } from \"@ark-ui/react/portal\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport { Search } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\nimport {\n DialogBackdrop,\n DialogContent,\n DialogDescription,\n DialogPositioner,\n DialogRoot,\n DialogTitle,\n} from \"@/registry/thornberry/components/dialog\";\n\nimport type { ComponentProps } from \"react\";\n\n/**\n * Command menu primitives (cmdk) styled for Sigil/Tailwind. Compose a command\n * palette with {@link CommandDialog} (a ⌘K-style modal) or embed {@link Command}\n * inline. Apps feed their own command items, so the palette is reusable across\n * products.\n */\nconst Command = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\ninterface CommandDialogProps extends ComponentProps {\n /** Accessible title (visually hidden). */\n title?: string;\n /** Accessible description (visually hidden). */\n description?: string;\n}\n\nconst CommandDialog = ({\n children,\n title = \"Command Palette\",\n description = \"Search for a command to run\",\n ...rest\n}: CommandDialogProps) => (\n \n \n \n \n \n {title}\n \n {description}\n \n \n {children}\n \n \n \n \n \n);\n\nconst CommandInput = ({\n className,\n ...rest\n}: ComponentProps) => (\n
\n \n \n
\n);\n\nconst CommandList = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst CommandEmpty = (\n rest: ComponentProps,\n) => (\n \n);\n\nconst CommandGroup = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst CommandSeparator = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst CommandItem = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\n/** A trailing shortcut hint inside a command item. */\nconst CommandShortcut = ({ className, ...rest }: ComponentProps<\"span\">) => (\n \n);\n\nexport {\n Command,\n CommandDialog,\n CommandInput,\n CommandList,\n CommandEmpty,\n CommandGroup,\n CommandItem,\n CommandShortcut,\n CommandSeparator,\n};\n", "type": "registry:ui" }, { "path": "src/lib/utils.ts", "content": "import { clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nimport type { ClassValue } from \"clsx\";\n\nexport const cn = (...inputs: ClassValue[]) => {\n return twMerge(clsx(inputs));\n};\n", "type": "registry:lib", "target": "" }, { "path": "src/registry/thornberry/components/dialog.tsx", "content": "import { Dialog as ArkDialog } from \"@ark-ui/react/dialog\";\nimport { X } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nimport type { ComponentProps } from \"react\";\n\nconst DialogProvider = ArkDialog.RootProvider;\nconst DialogContext = ArkDialog.Context;\nconst DialogRoot = ArkDialog.Root;\n\nconst DialogTrigger = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst DialogBackdrop = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst DialogPositioner = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst DialogContent = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst DialogTitle = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst DialogDescription = ({\n className,\n ...rest\n}: ComponentProps) => (\n \n);\n\nconst DialogCloseTrigger = ({\n className,\n children,\n asChild,\n ...rest\n}: ComponentProps) => {\n // If there are no children, render the default X icon\n if (!children) {\n return (\n \n \n Close\n \n );\n }\n\n // If children are provided, use them inside the CloseTrigger\n // This is useful for creating buttons that close the dialog\n return (\n \n {children}\n \n );\n};\n\nexport {\n DialogRoot,\n DialogTrigger,\n DialogBackdrop,\n DialogPositioner,\n DialogContent,\n DialogTitle,\n DialogDescription,\n DialogCloseTrigger,\n DialogProvider,\n DialogContext,\n};\n", "type": "registry:component", "target": "" } ], "type": "registry:ui" }