import * as React from "react"; import { DismissableLayer } from "@radix-ui/react-dismissable-layer"; import { FocusScope } from "@radix-ui/react-focus-scope"; import * as PopperPrimitive from "@radix-ui/react-popper"; import { Portal as _Portal1 } from "@radix-ui/react-portal"; import * as Radix from "@radix-ui/react-primitive"; import { Primitive } from "@radix-ui/react-primitive"; import * as RovingFocusGroup from "@radix-ui/react-roving-focus"; type Direction = 'ltr' | 'rtl'; export const createMenuScope: import("@radix-ui/react-context").CreateScope; export interface MenuProps { children?: React.ReactNode; open?: boolean; onOpenChange?(open: boolean): void; dir?: Direction; modal?: boolean; } export const Menu: React.FC; type PopperAnchorProps = Radix.ComponentPropsWithoutRef; export interface MenuAnchorProps extends PopperAnchorProps { } export const MenuAnchor: React.ForwardRefExoticComponent>; type PortalProps = React.ComponentPropsWithoutRef; export interface MenuPortalProps extends Omit { children?: React.ReactNode; /** * Used to force mounting when more control is needed. Useful when * controlling animation with React animation libraries. */ forceMount?: true; } export const MenuPortal: React.FC; /** * We purposefully don't union MenuRootContent and MenuSubContent props here because * they have conflicting prop types. We agreed that we would allow MenuSubContent to * accept props that it would just ignore. */ export interface MenuContentProps extends MenuRootContentTypeProps { /** * Used to force mounting when more control is needed. Useful when * controlling animation with React animation libraries. */ forceMount?: true; } export const MenuContent: React.ForwardRefExoticComponent>; interface MenuRootContentTypeProps extends Omit { } type FocusScopeProps = Radix.ComponentPropsWithoutRef; type DismissableLayerProps = Radix.ComponentPropsWithoutRef; type RovingFocusGroupProps = Radix.ComponentPropsWithoutRef; type PopperContentProps = Radix.ComponentPropsWithoutRef; type MenuContentImplPrivateProps = { onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus']; onDismiss?: DismissableLayerProps['onDismiss']; disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents']; /** * Whether scrolling outside the `MenuContent` should be prevented * (default: `false`) */ disableOutsideScroll?: boolean; /** * Whether focus should be trapped within the `MenuContent` * (default: false) */ trapFocus?: FocusScopeProps['trapped']; }; interface MenuContentImplProps extends MenuContentImplPrivateProps, Omit { /** * Event handler called when auto-focusing on close. * Can be prevented. */ onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus']; /** * Whether keyboard navigation should loop around * @defaultValue false */ loop?: RovingFocusGroupProps['loop']; onEntryFocus?: RovingFocusGroupProps['onEntryFocus']; onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside']; onFocusOutside?: DismissableLayerProps['onFocusOutside']; onInteractOutside?: DismissableLayerProps['onInteractOutside']; } type PrimitiveDivProps = Radix.ComponentPropsWithoutRef; export interface MenuGroupProps extends PrimitiveDivProps { } export const MenuGroup: React.ForwardRefExoticComponent>; export interface MenuLabelProps extends PrimitiveDivProps { } export const MenuLabel: React.ForwardRefExoticCo