import {type StyleProp, type ViewStyle} from 'react-native' import {atoms as a, useTheme} from '#/alf' import * as Menu from '#/components/Menu' import {type TriggerProps as MenuTriggerProps} from '#/components/Menu/types' import {Text} from '#/components/Typography' import {type AuxiliaryViewProps, type TriggerProps} from './types' export { ContainerItem, type MenuControlProps as ContextMenuControlProps, Divider, Group, Item, ItemIcon, ItemRadio, ItemText, LabelText, Root, useMenuContext as useContextMenuContext, useMenuControl as useContextMenuControl, } from '#/components/Menu' export function Provider({children}: {children: React.ReactNode}) { return children } // native only export function AuxiliaryView({}: AuxiliaryViewProps) { return null } /* * On web the context menu is just a Menu; contentLabel, onTap, style, and * swipeGesture only apply to the native press-and-hold presentation. */ export function Trigger({children, label, hint, role}: TriggerProps) { return ( {/* * Menu supplies the same web-arm child props shape as ContextMenu's * TriggerChildProps; only the native arms of the two unions differ, * and those never occur here. */} {children as unknown as MenuTriggerProps['children']} ) } export function Outer({ children, label, align: _align, style, onCloseAutoFocus, }: { children: React.ReactNode label?: string /** * Native positions the menu against the message bubble explicitly; the web * dropdown is anchored by radix, so this is accepted only for parity. */ align?: 'left' | 'right' style?: StyleProp onCloseAutoFocus?: (event: Event) => void }) { const t = useTheme() return ( {label ? ( {label} ) : null} {children} ) }