'use client'; import * as React from 'react'; import type { DialogProps } from '@radix-ui/react-dialog'; import { cn, createPrimitiveElement, withCn, withRef, withVariants, } from '@udecode/cn'; import { Command as CommandPrimitive } from 'cmdk'; import { Search } from 'lucide-react'; import { Dialog, DialogContent, DialogTitle } from './dialog'; import { inputVariants } from './input'; export const Command = withCn( CommandPrimitive, 'flex size-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground' ); export function CommandDialog({ children, ...props }: DialogProps) { return ( Command Dialog {children} ); } export const CommandInput = withRef( ({ className, ...props }, ref) => (
) ); export const InputCommand = withVariants( CommandPrimitive.Input, inputVariants, ['variant'] ); export const CommandList = withCn( CommandPrimitive.List, 'max-h-[500px] overflow-y-auto overflow-x-hidden' ); export const CommandEmpty = withCn( CommandPrimitive.Empty, 'py-6 text-center text-sm' ); export const CommandGroup = withCn( CommandPrimitive.Group, 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground' ); export const CommandSeparator = withCn( CommandPrimitive.Separator, '-mx-1 h-px bg-border' ); export const CommandItem = withCn( CommandPrimitive.Item, 'relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0' ); export const CommandShortcut = withCn( createPrimitiveElement('span'), 'ml-auto text-xs tracking-widest text-muted-foreground' );