{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "attachment-tray",
  "title": "Attachment Tray",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/attachment-tray/AttachmentTray.tsx",
      "content": "import * as React from 'react'\nimport { View, type ViewProps } from 'react-native'\nimport { File } from 'lucide-react-native'\nimport { Button } from '@/components/ui/button'\nimport { Icon } from '@/components/ui/icon'\nimport { Progress } from '@/components/ui/progress'\nimport { Text } from '@/components/ui/text'\nimport { useAnnouncement } from '@/lib/accessibility'\nimport { cn } from '@/lib/utils'\n\nexport type AttachmentTrayStatus =\n  { status: 'ready' } | { status: 'uploading'; progress?: number } | { status: 'failed'; reason: string }\n\nconst defaultLabels = {\n  ready: 'Ready',\n  uploading: 'Uploading…',\n  failed: 'Upload failed',\n  remove: 'Remove',\n  removeAction: (name: string) => `Remove ${name}`,\n  retry: 'Retry',\n  retryAction: (name: string) => `Retry uploading ${name}`,\n  progress: (name: string) => `Upload progress for ${name}`,\n  statusChange: (name: string, status: string) => `${name}. ${status}`,\n}\n\nexport interface AttachmentTrayProps extends ViewProps {\n  className?: string\n  children?: React.ReactNode\n}\n\nexport function AttachmentTray({ className, children, ...props }: AttachmentTrayProps) {\n  return (\n    <View {...props} className={cn('gap-2', className)}>\n      {children}\n    </View>\n  )\n}\n\nexport interface AttachmentTrayItemProps extends Omit<ViewProps, 'children'> {\n  className?: string\n  name: string\n  detail?: string\n  state: AttachmentTrayStatus\n  /** Decorative artwork. The row name supplies the file identity. */\n  preview?: React.ReactNode\n  /** Invoked as a removal request for any state, including uploads the caller can cancel. */\n  onRemove?: () => void\n  onRetry?: () => void\n  disabled?: boolean\n  labels?: Partial<typeof defaultLabels>\n}\n\nexport function AttachmentTrayItem({\n  className,\n  name,\n  detail,\n  state,\n  preview,\n  onRemove,\n  onRetry,\n  disabled = false,\n  labels,\n  ...props\n}: AttachmentTrayItemProps) {\n  const copy = { ...defaultLabels, ...labels }\n  const status = state.status\n  const statusText = copy[status]\n  const announcingCopy = copy.statusChange\n  const previous = React.useRef(status)\n  const [announcement, setAnnouncement] = React.useState<string>()\n  React.useEffect(() => {\n    if (previous.current === status) return\n    previous.current = status\n    setAnnouncement(announcingCopy(name, statusText))\n  }, [announcingCopy, name, status, statusText])\n  useAnnouncement(announcement)\n\n  return (\n    <View {...props} className={cn('gap-3 rounded-xl border border-border bg-card px-4 py-3', className)}>\n      <View className=\"flex-row items-start gap-3\">\n        <View\n          aria-hidden\n          accessibilityElementsHidden\n          importantForAccessibility=\"no-hide-descendants\"\n          pointerEvents=\"none\"\n          className=\"size-10 shrink-0 items-center justify-center overflow-hidden rounded-lg bg-muted\"\n        >\n          {preview ?? <Icon icon={File} size={20} className=\"text-muted-foreground\" />}\n        </View>\n        <View className=\"min-w-0 flex-1 gap-1\">\n          <Text className=\"font-semibold\">{name}</Text>\n          {detail ? (\n            <Text size=\"sm\" variant=\"muted\">\n              {detail}\n            </Text>\n          ) : null}\n          <Text size=\"sm\" className={status === 'failed' ? 'text-destructive' : undefined}>\n            {statusText}\n          </Text>\n        </View>\n      </View>\n      {state.status === 'uploading' ? (\n        <Progress\n          accessible\n          accessibilityLabel={copy.progress(name)}\n          accessibilityState={{ busy: true }}\n          value={Number.isFinite(state.progress) ? state.progress : undefined}\n        />\n      ) : null}\n      {state.status === 'failed' ? (\n        <Text size=\"sm\" variant=\"muted\">\n          {state.reason}\n        </Text>\n      ) : null}\n      {onRemove || (state.status === 'failed' && onRetry) ? (\n        <View className=\"flex-row flex-wrap items-center gap-2\">\n          {state.status === 'failed' && onRetry ? (\n            <Button\n              variant=\"outline\"\n              accessibilityLabel={copy.retryAction(name)}\n              disabled={disabled}\n              onPress={() => {\n                if (!disabled) onRetry()\n              }}\n            >\n              {copy.retry}\n            </Button>\n          ) : null}\n          {onRemove ? (\n            <Button\n              variant=\"ghost\"\n              accessibilityLabel={copy.removeAction(name)}\n              disabled={disabled}\n              onPress={() => {\n                if (!disabled) onRemove()\n              }}\n            >\n              {copy.remove}\n            </Button>\n          ) : null}\n        </View>\n      ) : null}\n    </View>\n  )\n}\n",
      "type": "registry:ui",
      "target": "~/components/ui/attachment-tray/AttachmentTray.tsx"
    },
    {
      "path": "packages/registry-native/components/attachment-tray/index.ts",
      "content": "export {\n  AttachmentTray,\n  AttachmentTrayItem,\n  type AttachmentTrayItemProps,\n  type AttachmentTrayProps,\n  type AttachmentTrayStatus,\n} from './AttachmentTray'\n",
      "type": "registry:ui",
      "target": "~/components/ui/attachment-tray/index.ts"
    }
  ],
  "dependencies": [
    "lucide-react-native"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/accessibility.json",
    "https://native.uipkge.dev/r/native/button.json",
    "https://native.uipkge.dev/r/native/icon.json",
    "https://native.uipkge.dev/r/native/progress.json",
    "https://native.uipkge.dev/r/native/text.json"
  ],
  "description": "Composable attachment controls with upload progress, accessible status, and per-file retry and removal.",
  "categories": [
    "input",
    "messaging"
  ]
}