{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "activity-log",
  "title": "Activity Log",
  "type": "registry:block",
  "files": [
    {
      "path": "packages/registry-native/blocks/activity-log/ActivityLog.tsx",
      "content": "import * as React from 'react'\nimport { FlatList, View, useWindowDimensions, type ViewProps } from 'react-native'\nimport { ListItem, ListItemContent, ListItemDescription, ListItemTitle, ListSeparator } from '@/components/ui/list'\nimport { SegmentedControl, SegmentedControlItem } from '@/components/ui/segmented-control'\nimport { Text } from '@/components/ui/text'\nimport { useAnnouncement } from '@/lib/accessibility'\nimport { cn } from '@/lib/utils'\n\nexport interface ActivityLogEntry {\n  id: string\n  actor: string\n  action: string\n  target?: string\n  /** A caller-localized time or relative date. */\n  time: string\n  category?: string\n}\n\nexport interface ActivityLogCategory {\n  /** A unique nonempty ID. */\n  id: string\n  label: string\n}\n\nconst defaultLabels = {\n  filter: 'Filter by action category',\n  all: 'All actions',\n  empty: 'No activity yet.',\n  noMatches: 'No activity in this category.',\n  matches: (count: number) => `${count} ${count === 1 ? 'event' : 'events'}`,\n}\n\nexport interface ActivityLogProps extends Omit<ViewProps, 'children'> {\n  className?: string\n  /** Display order and event IDs are caller-owned. */\n  entries?: readonly ActivityLogEntry[]\n  categories?: readonly ActivityLogCategory[]\n  /** Pass null for no category filter. Omit for local filter state. */\n  category?: string | null\n  onCategoryChange?: (id: string | null) => void\n  onOpen?: (id: string) => void\n  header?: React.ReactNode\n  labels?: Partial<typeof defaultLabels>\n}\n\nexport function ActivityLog({\n  className,\n  entries = [],\n  categories = [],\n  category,\n  onCategoryChange,\n  onOpen,\n  header,\n  labels,\n  ...props\n}: ActivityLogProps) {\n  const copy = { ...defaultLabels, ...labels }\n  const [internalCategory, setInternalCategory] = React.useState<string | null>(null)\n  const requestedCategory = category === undefined ? internalCategory : category\n  const validCategories = categories.filter(({ id }) => Boolean(id))\n  const activeCategory = validCategories.find(({ id }) => id === requestedCategory)\n  const visible = activeCategory ? entries.filter((entry) => entry.category === activeCategory.id) : entries\n  const { width, fontScale } = useWindowDimensions()\n  const stackMeta = width < 360 || fontScale >= 1.4\n  const summary = activeCategory ? (visible.length ? copy.matches(visible.length) : copy.noMatches) : undefined\n  useAnnouncement(summary)\n\n  return (\n    <View {...props} className={cn('min-h-0 flex-1', className)}>\n      <FlatList\n        data={visible}\n        keyExtractor={(entry) => entry.id}\n        ItemSeparatorComponent={ListSeparator}\n        contentContainerStyle={{ paddingBottom: 16 }}\n        ListHeaderComponent={\n          <View className=\"gap-3 pb-3\">\n            {header}\n            {validCategories.length ? (\n              <SegmentedControl\n                accessibilityLabel={copy.filter}\n                value={activeCategory?.id ?? ''}\n                onValueChange={(value) => {\n                  const next = validCategories.find(({ id }) => id === value)?.id\n                  if (value !== '' && !next) return\n                  if (category === undefined) setInternalCategory(next ?? null)\n                  onCategoryChange?.(next ?? null)\n                }}\n              >\n                <SegmentedControlItem value=\"\">{copy.all}</SegmentedControlItem>\n                {validCategories.map(({ id, label }) => (\n                  <SegmentedControlItem key={id} value={id}>\n                    {label}\n                  </SegmentedControlItem>\n                ))}\n              </SegmentedControl>\n            ) : null}\n            {activeCategory && visible.length ? (\n              <Text size=\"sm\" variant=\"muted\">\n                {summary}\n              </Text>\n            ) : null}\n          </View>\n        }\n        ListEmptyComponent={\n          <Text className=\"rounded-xl border border-border px-4 py-6 text-center\">\n            {activeCategory ? copy.noMatches : copy.empty}\n          </Text>\n        }\n        renderItem={({ item }) => (\n          <ListItem\n            accessible\n            accessibilityLabel={[item.actor, item.action, item.target, item.time].filter(Boolean).join(', ')}\n            onPress={onOpen ? () => onOpen(item.id) : undefined}\n            className=\"items-start px-0\"\n          >\n            <ListItemContent className=\"gap-1\">\n              <View className={cn('gap-1', !stackMeta && 'flex-row items-baseline justify-between gap-3')}>\n                <ListItemTitle className={cn(!stackMeta && 'min-w-0 flex-1')}>{item.actor}</ListItemTitle>\n                <Text size=\"sm\" variant=\"muted\" className={cn(!stackMeta && 'max-w-[45%]')}>\n                  {item.time}\n                </Text>\n              </View>\n              <Text>{item.action}</Text>\n              {item.target ? <ListItemDescription>{item.target}</ListItemDescription> : null}\n            </ListItemContent>\n          </ListItem>\n        )}\n      />\n    </View>\n  )\n}\n",
      "type": "registry:block",
      "target": "~/components/blocks/activity-log/ActivityLog.tsx"
    },
    {
      "path": "packages/registry-native/blocks/activity-log/index.ts",
      "content": "export { ActivityLog, type ActivityLogCategory, type ActivityLogEntry, type ActivityLogProps } from './ActivityLog'\n",
      "type": "registry:block",
      "target": "~/components/blocks/activity-log/index.ts"
    }
  ],
  "dependencies": [],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/accessibility.json",
    "https://native.uipkge.dev/r/native/list.json",
    "https://native.uipkge.dev/r/native/segmented-control.json",
    "https://native.uipkge.dev/r/native/text.json"
  ],
  "description": "A native audit feed for actor, action, time, and optional filtered event details.",
  "categories": [
    "activity",
    "workflow"
  ]
}