/**
 * @file ContextMenu.tsx
 * @input Uses React, StyleX, useLayer (context mode), useListFocus
 * @output Exports ContextMenu component
 * @position Core implementation; consumed by index.ts
 *
 * Right-click context menu positioned at the cursor. The cursor point is
 * captured as an offset *inside the trigger* and materialized as a zero-size
 * anchor element, so the menu is positioned relative to the trigger's context
 * (via CSS anchor positioning) rather than the viewport. It therefore follows
 * the content on scroll and auto-flips at viewport edges, while still appearing
 * under the cursor.
 * Reuses DropdownMenu item rendering and keyboard navigation.
 *
 * Supports two content modes with a single keyboard/focus path:
 * - **Data-driven**: pass `items` array (converted to components internally)
 * - **Compound-component**: pass `menuContent` JSX directly
 *
 * Both modes use useListFocus for DOM-based keyboard navigation.
 * Open state is managed internally — right-click opens, click-outside/Escape closes.
 *
 * SYNC: When modified, update these files to stay in sync:
 * - /packages/core/src/ContextMenu/ContextMenu.doc.mjs
 * - /packages/core/src/ContextMenu/ContextMenu.test.tsx
 * - /packages/core/src/ContextMenu/index.ts
 * - /apps/storybook/stories/ContextMenu.stories.tsx
 * - /packages/cli/assets/templates/blocks/components/ContextMenu/ (showcase blocks)
 */
import React from 'react';
import type { ReactNode } from 'react';
import type { BaseProps } from '../BaseProps';
import type { StyleXStyles } from '../theme/types';
import type { DropdownMenuOption, DropdownMenuItemData, DropdownMenuDivider, DropdownMenuSection } from '../DropdownMenu/DropdownMenu';
export type ContextMenuItemData = DropdownMenuItemData;
export type ContextMenuDivider = DropdownMenuDivider;
export type ContextMenuSection = DropdownMenuSection;
export type ContextMenuOption = DropdownMenuOption;
interface ContextMenuBaseProps extends BaseProps {
    /** Ref forwarded to the trigger wrapper element. */
    ref?: React.Ref<HTMLDivElement>;
    /**
     * Styles applied to the trigger wrapper element (the right-click target).
     * By default the trigger is a plain block that hugs its content — pass a
     * fill style (e.g. `width/height: 100%`) when the whole parent area should
     * be right-clickable (as the Table does for full-cell context menus).
     */
    triggerXstyle?: StyleXStyles | StyleXStyles[];
    /** The trigger area — right-click on this to open the menu. */
    children: ReactNode;
    /** Custom menu width. @default '160px' */
    menuWidth?: number | string;
    /** Size of menu items. @default 'md' */
    size?: 'sm' | 'md' | 'lg';
    /**
     * Accessible name for the menu surface, announced when it opens.
     * @default 'Context menu'
     */
    label?: string;
    /** When true, right-click shows the native browser context menu instead. */
    isDisabled?: boolean;
    /** Called when the menu opens or closes. */
    onOpenChange?: (isOpen: boolean) => void;
    'data-testid'?: string;
}
interface ContextMenuDataProps extends ContextMenuBaseProps {
    /** Array of menu entries (data-driven mode). */
    items: ContextMenuOption[];
    menuContent?: undefined;
}
interface ContextMenuCompoundProps extends ContextMenuBaseProps {
    items?: undefined;
    /** Custom JSX menu content (compound mode). */
    menuContent: ReactNode;
}
export type ContextMenuProps = ContextMenuDataProps | ContextMenuCompoundProps;
/**
 * A context menu component that appears on right-click at cursor position.
 *
 * Supports two modes:
 * - **Data-driven**: pass `items` for static menus
 * - **Compound-component**: pass `menuContent` JSX for dynamic menus
 *
 * Both modes share the same DOM-based keyboard navigation via useListFocus.
 *
 * @example
 * ```
 * <ContextMenu
 *   items={[
 *     { label: 'Cut', onClick: () => handleCut() },
 *     { label: 'Copy', onClick: () => handleCopy() },
 *     { type: 'divider' },
 *     { label: 'Paste', onClick: () => handlePaste() },
 *   ]}
 * >
 *   <div>Right-click this area</div>
 * </ContextMenu>
 * ```
 */
export declare function ContextMenu({ children, menuWidth, size, label: labelFromProps, isDisabled, onOpenChange, ref, className, style, xstyle, triggerXstyle, 'data-testid': testId, ...rest }: ContextMenuProps): React.JSX.Element;
export declare namespace ContextMenu {
    var displayName: string;
}
export {};
//# sourceMappingURL=ContextMenu.d.ts.map