"use client" import * as React from "react" import { Search } from "lucide-react" import { Command as CommandPrimitive } from "cmdk" import { cva, type VariantProps } from "class-variance-authority" import { cn } from "../../lib/utils" import { Dialog, DialogContent, DialogTitle } from "./dialog" /** * Command (Komut Paleti) Bileşeni * * Gerçek command palette işlevselliği ile klavye navigasyonu, arama ve filtreleme. * cmdk kütüphanesi üzerine inşa edilmiş, tam özellikli command interface. */ const commandVariants = cva( "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", { variants: { variant: { default: "bg-popover text-popover-foreground", glass: "bg-background/80 text-foreground backdrop-blur-sm", bordered: "bg-popover text-popover-foreground border border-border", }, size: { sm: "min-h-[200px]", default: "min-h-[300px]", lg: "min-h-[400px]", }, }, defaultVariants: { variant: "default", size: "default", }, } ) // Command bileşeni - cmdk primitive wrapper interface CommandProps extends React.ComponentProps, VariantProps {} const Command = React.forwardRef< React.ElementRef, CommandProps >(({ className, variant, size, ...props }, ref) => ( )) Command.displayName = CommandPrimitive.displayName // CommandDialog bileşeni interface CommandDialogProps extends React.ComponentProps { commandClassName?: string children?: React.ReactNode } const CommandDialog = ({ children, commandClassName, ...props }: CommandDialogProps) => { return ( Command Menu {children} ) } // CommandInput bileşeni interface CommandInputProps extends React.ComponentProps {} const CommandInput = React.forwardRef< React.ElementRef, CommandInputProps >(({ className, ...props }, ref) => (
)) CommandInput.displayName = CommandPrimitive.Input.displayName // CommandList bileşeni interface CommandListProps extends React.ComponentProps {} const CommandList = React.forwardRef< React.ElementRef, CommandListProps >(({ className, ...props }, ref) => ( )) CommandList.displayName = CommandPrimitive.List.displayName // CommandEmpty bileşeni interface CommandEmptyProps extends React.ComponentProps {} const CommandEmpty = React.forwardRef< React.ElementRef, CommandEmptyProps >(({ className, ...props }, ref) => ( )) CommandEmpty.displayName = CommandPrimitive.Empty.displayName // CommandGroup bileşeni interface CommandGroupProps extends React.ComponentProps {} const CommandGroup = React.forwardRef< React.ElementRef, CommandGroupProps >(({ className, ...props }, ref) => ( )) CommandGroup.displayName = CommandPrimitive.Group.displayName // CommandSeparator bileşeni interface CommandSeparatorProps extends React.ComponentProps {} const CommandSeparator = React.forwardRef< React.ElementRef, CommandSeparatorProps >(({ className, ...props }, ref) => ( )) CommandSeparator.displayName = CommandPrimitive.Separator.displayName // CommandItem bileşeni interface CommandItemProps extends React.ComponentProps {} const CommandItem = React.forwardRef< React.ElementRef, CommandItemProps >(({ className, ...props }, ref) => ( )) CommandItem.displayName = CommandPrimitive.Item.displayName // CommandShortcut bileşeni - utility component const CommandShortcut = ({ className, ...props }: React.HTMLAttributes) => { return ( ) } CommandShortcut.displayName = "CommandShortcut" export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, }