'use client'; import * as React from 'react'; import { CheckIcon, ChevronRightIcon, CircleIcon } from '@/icons'; import * as DropdownMenuPrimitive from 'radix-ui/dropdown-menu'; import { cn } from '@/lib/utils'; import { iconSizing } from '@/lib/cva-presets'; /** Shared by every row in the menu, whatever its selection behaviour. */ const menuItemBase = cn( 'relative flex cursor-default items-center gap-2 rounded-sm py-1.5 text-sm outline-hidden select-none', 'focus:bg-accent focus:text-accent-foreground', 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50', iconSizing, "[&_svg:not([class*='text-'])]:text-muted-foreground" ); /** Shared by the floating surfaces (root content and submenus). */ const menuSurface = cn( 'min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground', 'duration-(--ui-duration-base) ease-(--ui-ease-standard)', 'data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95', 'data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95', 'data-[side=top]:slide-in-from-bottom-2 data-[side=bottom]:slide-in-from-top-2', 'data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2' ); export type DropdownMenuProps = React.ComponentProps; export interface DropdownMenuItemProps extends React.ComponentProps { /** Indent the label to line up with rows that have a check or radio marker. */ inset?: boolean; variant?: 'default' | 'destructive'; } /** * Menu of commands triggered by a button. * * For choosing a *value* in a form, use Select — it submits with the form and * is announced as a combobox. This is for actions. */ function DropdownMenu(props: DropdownMenuProps) { return ; } function DropdownMenuPortal(props: React.ComponentProps) { return ; } function DropdownMenuTrigger( props: React.ComponentProps ) { return ; } function DropdownMenuContent({ className, sideOffset = 4, ...props }: React.ComponentProps) { return ( ); } function DropdownMenuGroup(props: React.ComponentProps) { return ; } function DropdownMenuItem({ className, inset, variant = 'default', ...props }: DropdownMenuItemProps) { return ( ); } function DropdownMenuCheckboxItem({ className, children, checked, ...props }: React.ComponentProps) { return ( {children} ); } function DropdownMenuRadioGroup( props: React.ComponentProps ) { return ; } function DropdownMenuRadioItem({ className, children, ...props }: React.ComponentProps) { return ( {children} ); } function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps & { inset?: boolean }) { return ( ); } function DropdownMenuSeparator({ className, ...props }: React.ComponentProps) { return ( ); } /** Right-aligned keyboard hint. Purely visual — bind the shortcut yourself. */ function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) { return ( ); } function DropdownMenuSub(props: React.ComponentProps) { return ; } function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps & { inset?: boolean }) { return ( {children} ); } function DropdownMenuSubContent({ className, ...props }: React.ComponentProps) { return ( ); } export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };