{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navigation-menu",
  "title": "Navigation Menu",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/navigation-menu/NavigationMenu.tsx",
      "content": "import * as React from 'react'\nimport { Platform, Pressable, ScrollView, StyleSheet, View, useWindowDimensions } from 'react-native'\nimport * as Primitive from '@rn-primitives/navigation-menu'\nimport { cssInterop } from 'react-native-css-interop'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { PortalWindow, usePopupDismiss } from '@/lib/portal'\nimport { renderTextChildren } from '@/lib/label-children'\nimport { cn } from '@/lib/utils'\n\ncssInterop(Primitive.Root, { className: 'style' })\ncssInterop(Primitive.List, { className: 'style' })\ncssInterop(Primitive.Item, { className: 'style' })\ncssInterop(Primitive.Trigger, { className: 'style' })\ncssInterop(Primitive.Content, { className: 'style' })\ncssInterop(Primitive.Link, { className: 'style' })\ncssInterop(Primitive.Indicator, { className: 'style' })\ncssInterop(Primitive.Viewport, { className: 'style' })\n\nexport type NavigationMenuProps = Primitive.RootProps & { className?: string }\n\nexport const NavigationMenu = React.forwardRef<Primitive.RootRef, NavigationMenuProps>(\n  ({ className, value, ...props }, ref) => (\n    <Primitive.Root\n      ref={ref}\n      value={Platform.OS === 'web' ? (value ?? '') : value}\n      className={cn('relative w-full', className)}\n      {...props}\n    />\n  ),\n)\nNavigationMenu.displayName = 'NavigationMenu'\nexport type NavigationMenuListProps = Primitive.ListProps & { className?: string }\nexport const NavigationMenuList = React.forwardRef<Primitive.ListRef, NavigationMenuListProps>(\n  ({ className, ...props }, ref) => (\n    <Primitive.List ref={ref} className={cn('flex-row flex-wrap items-start gap-[8px]', className)} {...props} />\n  ),\n)\nNavigationMenuList.displayName = 'NavigationMenuList'\nexport type NavigationMenuItemProps = Primitive.ItemProps & { className?: string }\nexport const NavigationMenuItem = React.forwardRef<Primitive.ItemRef, NavigationMenuItemProps>(\n  ({ className, ...props }, ref) => (\n    <Primitive.Item ref={ref} className={cn('min-w-0 max-w-full', className)} {...props} />\n  ),\n)\nNavigationMenuItem.displayName = 'NavigationMenuItem'\nexport type NavigationMenuTriggerProps = Omit<Primitive.TriggerProps, 'children'> & {\n  children?: React.ReactNode\n  className?: string\n}\nexport const NavigationMenuTrigger = React.forwardRef<Primitive.TriggerRef, NavigationMenuTriggerProps>(\n  ({ className, children, asChild, disabled, ...props }, ref) => (\n    <Primitive.Trigger\n      accessibilityRole=\"button\"\n      {...props}\n      ref={ref}\n      asChild={asChild}\n      disabled={disabled}\n      className={cn(\n        'min-h-[48px] min-w-[48px] flex-row items-center justify-center gap-[8px] rounded-md border border-border bg-background px-[16px] py-[10px] active:bg-accent',\n        disabled && 'opacity-50',\n        className,\n      )}\n    >\n      {asChild ? children : renderTextChildren(children)}\n    </Primitive.Trigger>\n  ),\n)\nNavigationMenuTrigger.displayName = 'NavigationMenuTrigger'\nexport type NavigationMenuContentProps = Omit<Primitive.ContentProps, 'children'> & {\n  children?: React.ReactNode\n  className?: string\n}\nexport const NavigationMenuContent = React.forwardRef<Primitive.ContentRef, NavigationMenuContentProps>(\n  ({ className, children, asChild, insets, style, sideOffset = 8, ...props }, ref) => {\n    const safe = useSafeAreaInsets()\n    const { width, height } = useWindowDimensions()\n    const { value, onValueChange } = Primitive.useRootContext()\n    const item = Primitive.useItemContext()\n    const visible = value !== undefined && value === item.value\n    const popup = usePopupDismiss(visible, () => onValueChange(undefined))\n    const bounds = { top: safe.top + 8, bottom: safe.bottom + 8, left: safe.left + 8, right: safe.right + 8, ...insets }\n    const maxWidth = Math.max(0, Math.min(320, width - bounds.left - bounds.right))\n    const maxHeight = Math.max(0, height - bounds.top - bounds.bottom)\n    // Native headless content must unmount to release its platform Back subscription.\n    if (Platform.OS !== 'web' && !visible) return null\n    return (\n      <Primitive.Portal\n        forceMount={props.forceMount}\n        hostName={popup.hostName}\n        {...(Platform.OS === 'web'\n          ? { container: (popup.container ?? undefined) as unknown as Primitive.PortalProps['container'] }\n          : {})}\n      >\n        <PortalWindow layer={popup}>\n          {Platform.OS !== 'web' ? (\n            <Pressable accessible={false} style={StyleSheet.absoluteFill} onPress={() => onValueChange(undefined)} />\n          ) : null}\n          <Primitive.Content\n            {...props}\n            ref={ref}\n            asChild={asChild}\n            sideOffset={sideOffset}\n            insets={bounds}\n            className={cn(\n              'z-50 gap-[4px] rounded-lg border border-border bg-popover p-[8px]',\n              Platform.OS === 'web' && 'relative mt-[8px]',\n              className,\n            )}\n            style={\n              StyleSheet.flatten([\n                { width: maxWidth, maxWidth: Platform.OS === 'web' ? '100%' : maxWidth, maxHeight },\n                style,\n              ]) ?? undefined\n            }\n          >\n            {asChild ? (\n              children\n            ) : (\n              <ScrollView bounces={false} keyboardShouldPersistTaps=\"handled\" style={{ maxHeight, flexGrow: 0 }}>\n                {renderTextChildren(children)}\n              </ScrollView>\n            )}\n          </Primitive.Content>\n        </PortalWindow>\n      </Primitive.Portal>\n    )\n  },\n)\nNavigationMenuContent.displayName = 'NavigationMenuContent'\n\nexport type NavigationMenuLinkProps = Omit<Primitive.LinkProps, 'children'> & {\n  children?: React.ReactNode\n  className?: string\n}\nexport const NavigationMenuLink = React.forwardRef<Primitive.LinkRef, NavigationMenuLinkProps>(\n  ({ className, children, asChild, disabled, onPress, active, ...props }, ref) => {\n    const { onValueChange } = Primitive.useRootContext()\n    return (\n      <Primitive.Link\n        {...props}\n        ref={ref}\n        asChild={asChild}\n        active={active}\n        disabled={disabled}\n        accessibilityState={{ ...props.accessibilityState, disabled: !!disabled, selected: !!active }}\n        onPress={(event) => {\n          if (disabled) return\n          onPress?.(event)\n          if (Platform.OS !== 'web' && !event.isDefaultPrevented()) onValueChange(undefined)\n        }}\n        className={cn(\n          'min-h-[48px] min-w-[48px] flex-row items-center gap-[8px] rounded-md px-[12px] py-[10px] active:bg-accent',\n          active && 'bg-secondary',\n          disabled && 'opacity-50',\n          className,\n        )}\n      >\n        {asChild ? children : <View className=\"min-w-0 flex-1\">{renderTextChildren(children)}</View>}\n      </Primitive.Link>\n    )\n  },\n)\nNavigationMenuLink.displayName = 'NavigationMenuLink'\nexport type NavigationMenuIndicatorProps = Primitive.IndicatorProps & { className?: string }\nexport const NavigationMenuIndicator = React.forwardRef<Primitive.IndicatorRef, NavigationMenuIndicatorProps>(\n  ({ className, ...props }, ref) => (\n    <Primitive.Indicator ref={ref} className={cn('h-[2px] rounded-full bg-primary', className)} {...props} />\n  ),\n)\nNavigationMenuIndicator.displayName = 'NavigationMenuIndicator'\nexport type NavigationMenuViewportProps = Primitive.ViewportProps & { className?: string }\nexport const NavigationMenuViewport = React.forwardRef<Primitive.ViewportRef, NavigationMenuViewportProps>(\n  ({ className, ...props }, ref) => <Primitive.Viewport ref={ref} className={cn('relative', className)} {...props} />,\n)\nNavigationMenuViewport.displayName = 'NavigationMenuViewport'\n",
      "type": "registry:ui",
      "target": "~/components/ui/navigation-menu/NavigationMenu.tsx"
    },
    {
      "path": "packages/registry-native/components/navigation-menu/index.ts",
      "content": "export * from './NavigationMenu'\n",
      "type": "registry:ui",
      "target": "~/components/ui/navigation-menu/index.ts"
    }
  ],
  "dependencies": [
    "@rn-primitives/navigation-menu",
    "react-native-safe-area-context",
    "react-native-css-interop"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/portal.json",
    "https://native.uipkge.dev/r/native/label-children.json"
  ],
  "description": "Composable touch navigation menu with native Back dismissal, selected links, and themed portal content.",
  "categories": [
    "overlay",
    "navigation"
  ]
}