import * as React from 'react'; import { tv, type VariantProps } from 'tailwind-variants'; import { cn } from '../../utils/cn'; import type { DialogProps } from '../dialog'; import { Dialog, DialogContent } from '../dialog'; import { SearchIcon } from '../icons'; import { Command as CommandPrimitive } from './cmdk'; export interface CommandProps extends React.ComponentPropsWithoutRef {} const Command = React.forwardRef, CommandProps>( ({ className, ...props }, ref) => ( ) ); Command.displayName = CommandPrimitive.displayName; interface CommandDialogProps extends DialogProps {} const CommandDialog = ({ children, ...props }: CommandDialogProps) => { return ( {children} ); }; const commandInputVariant = tv({ base: 'placeholder:text-muted disabled:text-disabled flex h-full bg-transparent outline-none disabled:cursor-not-allowed', variants: { fullWidth: { true: 'w-full', false: 'w-auto', }, }, }); export interface CommandInputProps extends Omit, 'prefix'>, VariantProps { prefix?: React.ReactNode; wrapperClassName?: string; } const CommandInput = React.forwardRef, CommandInputProps>( ({ className, wrapperClassName, fullWidth = true, prefix, ...props }, ref) => (
{prefix ?? }
) ); CommandInput.displayName = CommandPrimitive.Input.displayName; const CommandList = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); CommandList.displayName = CommandPrimitive.List.displayName; const CommandEmpty = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >((props, ref) => ); CommandEmpty.displayName = CommandPrimitive.Empty.displayName; const CommandGroup = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); CommandGroup.displayName = CommandPrimitive.Group.displayName; const CommandSeparator = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); CommandSeparator.displayName = CommandPrimitive.Separator.displayName; const CommandItem = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( )); CommandItem.displayName = CommandPrimitive.Item.displayName; const CommandShortcut = ({ className, ...props }: React.HTMLAttributes) => { return ; }; CommandShortcut.displayName = 'CommandShortcut'; const CommandLoading = CommandPrimitive.Loading; CommandLoading.displayName = 'CommandLoading'; export { Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, };