{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hover-card",
  "title": "Hover Card",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/hover-card/HoverCard.tsx",
      "content": "import * as React from 'react'\nimport { Platform, Pressable, ScrollView, StyleSheet, useWindowDimensions } from 'react-native'\nimport * as Primitive from '@rn-primitives/hover-card'\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.Trigger, { className: 'style' })\ncssInterop(Primitive.Content, { className: 'style' })\ncssInterop(Primitive.Overlay, { className: 'style' })\n\nexport type HoverCardProps = Primitive.RootProps & { className?: string }\n\nexport const HoverCard = React.forwardRef<Primitive.RootRef, HoverCardProps>(({ className, ...props }, ref) => (\n  <Primitive.Root ref={ref} className={cn('self-start', className)} {...props} />\n))\nHoverCard.displayName = 'HoverCard'\nexport type HoverCardTriggerProps = Omit<Primitive.TriggerProps, 'children'> & {\n  children?: React.ReactNode\n  className?: string\n}\nexport const HoverCardTrigger = React.forwardRef<Primitive.TriggerRef, HoverCardTriggerProps>(\n  ({ className, children, asChild, disabled, onPress, ...props }, ref) => {\n    const { open, onOpenChange } = Primitive.useRootContext()\n    return (\n      <Primitive.Trigger\n        accessibilityRole=\"button\"\n        {...props}\n        ref={ref}\n        asChild={asChild}\n        disabled={disabled}\n        pointerEvents={disabled ? 'none' : props.pointerEvents}\n        onPress={(event) => {\n          if (disabled) return\n          onPress?.(event)\n          if (Platform.OS === 'web' && !event.isDefaultPrevented()) onOpenChange(!open)\n        }}\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  },\n)\nHoverCardTrigger.displayName = 'HoverCardTrigger'\nexport type HoverCardContentProps = Omit<Primitive.ContentProps, 'children'> & {\n  children?: React.ReactNode\n  className?: string\n}\nexport const HoverCardContent = React.forwardRef<Primitive.ContentRef, HoverCardContentProps>(\n  (\n    { className, children, asChild, insets, style, align = 'start', side = 'bottom', sideOffset = 8, ...props },\n    ref,\n  ) => {\n    const root = Primitive.useRootContext()\n    const visible = root.open\n    const popup = usePopupDismiss(visible, () => root.onOpenChange(false))\n    const safe = useSafeAreaInsets()\n    const { width, height } = useWindowDimensions()\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' ? <Primitive.Overlay accessible={false} style={StyleSheet.absoluteFill} /> : null}\n          <Primitive.Content\n            {...props}\n            ref={ref}\n            asChild={asChild}\n            align={align}\n            side={side}\n            sideOffset={sideOffset}\n            insets={bounds}\n            className={cn('rounded-lg border border-border bg-popover p-[12px]', className)}\n            style={StyleSheet.flatten([{ maxWidth, maxHeight }, style]) ?? undefined}\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)\nHoverCardContent.displayName = 'HoverCardContent'\nexport type HoverCardCloseProps = Omit<React.ComponentProps<typeof Pressable>, 'children'> & {\n  children?: React.ReactNode\n  className?: string\n}\nexport const HoverCardClose = React.forwardRef<React.ComponentRef<typeof Pressable>, HoverCardCloseProps>(\n  ({ className, children, disabled, onPress, ...props }, ref) => {\n    const { onOpenChange } = Primitive.useRootContext()\n    return (\n      <Pressable\n        {...props}\n        ref={ref}\n        accessibilityRole=\"button\"\n        disabled={disabled}\n        accessibilityState={{ ...props.accessibilityState, disabled: !!disabled }}\n        onPress={(event) => {\n          if (disabled) return\n          onPress?.(event)\n          if (!event.isDefaultPrevented()) onOpenChange(false)\n        }}\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        {renderTextChildren(children)}\n      </Pressable>\n    )\n  },\n)\nHoverCardClose.displayName = 'HoverCardClose'\n",
      "type": "registry:ui",
      "target": "~/components/ui/hover-card/HoverCard.tsx"
    },
    {
      "path": "packages/registry-native/components/hover-card/index.ts",
      "content": "export * from './HoverCard'\n",
      "type": "registry:ui",
      "target": "~/components/ui/hover-card/index.ts"
    }
  ],
  "dependencies": [
    "@rn-primitives/hover-card",
    "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": "Themed hover-card with press access, portal rendering, viewport bounds, and safe-area collision insets.",
  "categories": [
    "overlay",
    "navigation"
  ]
}