import type { ComponentPropsWithoutRef, HTMLAttributes, ReactNode } from 'react';
import type { OpenStateProps, PopperContentProps, TriggerProps } from '../../utils/primitiveProps.cjs';
import type { SxProp } from '../Layout/sx.cjs';
export type ContextMenuProps = OpenStateProps;
export type ContextMenuTriggerProps = TriggerProps & {
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
};
export interface ContextMenuContentProps extends ComponentPropsWithoutRef<'div'> {
className?: string;
/** Nudge, in px, along the alignment axis from where the pointer opened the menu. Default: `-4`. */
alignOffset?: number;
/** Density of the menu: `sm` tightens padding and type, `md` is the default. */
size?: 'sm' | 'md';
/** One-off CSS for the menu content panel. */
sx?: SxProp;
}
export interface ContextMenuItemProps extends Omit, 'onSelect'> {
disabled?: boolean;
onSelect?: (event: Event) => void;
textValue?: string;
icon?: ReactNode;
shortcut?: ReactNode;
destructive?: boolean;
/**
* Render the single child (e.g. Next ``) as the item, so the entry is a real link
* (client-side routing, middle-click). The child's own children become the label.
*/
asChild?: boolean;
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
}
export interface ContextMenuCheckboxItemProps extends Omit, 'onSelect'> {
checked?: boolean;
onCheckedChange?: (checked: boolean) => void;
disabled?: boolean;
onSelect?: (event: Event) => void;
textValue?: string;
shortcut?: ReactNode;
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
}
export interface ContextMenuRadioGroupProps extends Omit, 'onChange'> {
value?: string;
onValueChange?: (value: string) => void;
}
export interface ContextMenuRadioItemProps extends Omit, 'onSelect'> {
value: string;
disabled?: boolean;
onSelect?: (event: Event) => void;
textValue?: string;
shortcut?: ReactNode;
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
}
export interface ContextMenuLabelProps extends ComponentPropsWithoutRef<'div'> {
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
}
export interface ContextMenuSeparatorProps extends HTMLAttributes {
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
}
export interface ContextMenuSubProps {
open?: boolean;
defaultOpen?: boolean;
onOpenChange?: (open: boolean) => void;
children?: ReactNode;
}
export interface ContextMenuSubTriggerProps extends ComponentPropsWithoutRef<'div'> {
disabled?: boolean;
textValue?: string;
icon?: ReactNode;
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
}
export type ContextMenuSubContentProps = Omit & {
/** Submenus open flush with the start or end of their trigger row; `center` is not supported. */
align?: 'start' | 'end';
/** One-off CSS, same as `Box`'s `sx` (scalar or responsive `{ base, sm, md, lg, xl }` map). */
sx?: SxProp;
};