import { Icon } from '@/components/ui/icon'; import { NativeOnlyAnimatedView } from '@/components/ui/native-only-animated-view'; import { TextClassContext } from '@/components/ui/text'; import { cn } from '@/lib/utils'; import * as MenubarPrimitive from '@rn-primitives/menubar'; import { Portal } from '@rn-primitives/portal'; import { Check, ChevronDown, ChevronRight, ChevronUp } from 'lucide-react-native'; import * as React from 'react'; import { Platform, Pressable, type StyleProp, StyleSheet, Text, type TextProps, View, type ViewStyle, } from 'react-native'; import { FadeIn } from 'react-native-reanimated'; import { FullWindowOverlay as RNFullWindowOverlay } from 'react-native-screens'; const MenubarMenu = MenubarPrimitive.Menu; const MenubarGroup = MenubarPrimitive.Group; const MenubarPortal = MenubarPrimitive.Portal; const MenubarSub = MenubarPrimitive.Sub; const MenubarRadioGroup = MenubarPrimitive.RadioGroup; const FullWindowOverlay = Platform.OS === 'ios' ? RNFullWindowOverlay : React.Fragment; function Menubar({ className, value: valueProp, onValueChange: onValueChangeProp, ...props }: MenubarPrimitive.RootProps & React.RefAttributes) { const id = React.useId(); const [value, setValue] = React.useState(undefined); function closeMenu() { if (onValueChangeProp) { onValueChangeProp(undefined); return; } setValue(undefined); } return ( <> {Platform.OS !== 'web' && (value || valueProp) ? ( ) : null} ); } function MenubarTrigger({ className, ...props }: MenubarPrimitive.TriggerProps & React.RefAttributes) { const { value } = MenubarPrimitive.useRootContext(); const { value: itemValue } = MenubarPrimitive.useMenuContext(); return ( ); } function MenubarSubTrigger({ className, inset, children, iconClassName, ...props }: MenubarPrimitive.SubTriggerProps & React.RefAttributes & { children?: React.ReactNode; iconClassName?: string; inset?: boolean; }) { const { open } = MenubarPrimitive.useSubContext(); const icon = Platform.OS === 'web' ? ChevronRight : open ? ChevronUp : ChevronDown; return ( <>{children} ); } function MenubarSubContent({ className, ...props }: MenubarPrimitive.SubContentProps & React.RefAttributes) { return ( ); } function MenubarContent({ className, overlayClassName, overlayStyle, portalHost, align = 'start', alignOffset = -4, sideOffset = 8, ...props }: MenubarPrimitive.ContentProps & React.RefAttributes & { overlayStyle?: StyleProp; overlayClassName?: string; portalHost?: string; }) { return ( ); } function MenubarItem({ className, inset, variant, ...props }: MenubarPrimitive.ItemProps & React.RefAttributes & { className?: string; inset?: boolean; variant?: 'default' | 'destructive'; }) { return ( ); } function MenubarCheckboxItem({ className, children, ...props }: MenubarPrimitive.CheckboxItemProps & React.RefAttributes & { children?: React.ReactNode; }) { return ( <>{children} ); } function MenubarRadioItem({ className, children, ...props }: MenubarPrimitive.RadioItemProps & React.RefAttributes & { children?: React.ReactNode; }) { return ( <>{children} ); } function MenubarLabel({ className, inset, ...props }: MenubarPrimitive.LabelProps & React.RefAttributes & { className?: string; inset?: boolean; }) { return ( ); } function MenubarSeparator({ className, ...props }: MenubarPrimitive.SeparatorProps & React.RefAttributes) { return ( ); } function MenubarShortcut({ className, ...props }: TextProps & React.RefAttributes) { return ( ); } export { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, };