{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "conversation",
  "title": "Conversation",
  "description": "A message log that follows new content and offers a jump to the latest.",
  "dependencies": [
    "@kind-ui/agent-ui@0.9.0",
    "@ui-sdk/core@0.1.0-beta.17",
    "@ui-sdk/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/conversation.tsx",
      "content": "\"use client\";\n\nimport { conversationPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport { type ComponentProps, memo } from \"react\";\n\nconst conversation = createParts(conversationPrimitive, {\n  root: \"div\",\n  viewport: \"div\",\n  content: \"div\",\n  row: \"div\",\n  jump: \"button\",\n  empty: \"div\",\n  \"empty-title\": \"div\",\n  \"empty-description\": \"div\",\n  skeleton: \"div\",\n  loading: \"div\",\n  error: \"div\",\n  \"error-icon\": \"span\",\n  \"error-text\": \"div\",\n  retry: \"button\",\n  marks: \"div\",\n  mark: \"span\",\n});\n\n/** Pass `controller={createConversationController()}` (from `@kind-ui/agent-ui/core`) to scroll it from outside. */\nexport const Conversation = conversation.Root;\nexport const ConversationViewport = conversation.Viewport;\n/**\n * With `virtualize`, render rows from its state, keyed by index so each measurement stays with its row:\n * `{({ rows }) => rows.map((row) => <ConversationRow key={row.index} value={row.key} index={row.index} …/>)}`.\n */\nexport const ConversationContent = conversation.Content;\nexport const ConversationRow = conversation.Row;\n/** Its text is the new-message count, written by the primitive; render it without children. */\nexport const ConversationJump = conversation.Jump;\nexport const ConversationEmpty = conversation.Empty;\nexport const ConversationEmptyTitle = conversation.EmptyTitle;\nexport const ConversationEmptyDescription = conversation.EmptyDescription;\n\nexport type ConversationSkeletonProps = ComponentProps<typeof conversation.Skeleton>;\n\n/** Three placeholder rows while `status` is `\"loading\"`, unless you pass children. Hidden from assistive technology. */\nexport function ConversationSkeleton({ children = SKELETON_ROWS, ...props }: ConversationSkeletonProps) {\n  return <conversation.Skeleton {...props}>{children}</conversation.Skeleton>;\n}\n\nexport type ConversationLoadingProps = ComponentProps<typeof conversation.Loading>;\n\n/** The visually hidden status read while `status` is `\"loading\"`: \"Loading conversation\", unless you pass children. */\nexport function ConversationLoading({\n  children = \"Loading conversation\",\n  ...props\n}: ConversationLoadingProps) {\n  return <conversation.Loading {...props}>{children}</conversation.Loading>;\n}\n\nexport type ConversationErrorProps = ComponentProps<typeof conversation.Error>;\n\n/** Shown while `status` is `\"error\"`: its mark, its words and Retry, unless you pass children. */\nexport function ConversationError({ children = ERROR_PARTS, ...props }: ConversationErrorProps) {\n  return <conversation.Error {...props}>{children}</conversation.Error>;\n}\n\n/** The error's status mark. Hidden from assistive technology: the words say it. */\nexport const ConversationErrorIcon = conversation.ErrorIcon;\n\nexport type ConversationErrorTextProps = ComponentProps<typeof conversation.ErrorText>;\n\n/** The `error` option's words, unless you pass children. */\nexport function ConversationErrorText({\n  children = ({ error }) => error,\n  ...props\n}: ConversationErrorTextProps) {\n  return <conversation.ErrorText {...props}>{children}</conversation.ErrorText>;\n}\n\nexport type ConversationRetryProps = ComponentProps<typeof conversation.Retry>;\n\n/** Calls `onRetry`, shown only while it's set. \"Retry\", unless you pass children. */\nexport function ConversationRetry({ children = \"Retry\", ...props }: ConversationRetryProps) {\n  return <conversation.Retry {...props}>{children}</conversation.Retry>;\n}\n\nexport type ConversationMarksProps = ComponentProps<typeof conversation.Marks>;\n\n/**\n * The track beside the scrollbar that shows each message in `marks`, one `ConversationMark` per 4px step that holds\n * one, unless you pass children. Hidden from assistive technology.\n */\nexport function ConversationMarks({\n  children = ({ marks }) => marks.map((step) => <ConversationMark key={step} value={String(step)} />),\n  ...props\n}: ConversationMarksProps) {\n  return <conversation.Marks {...props}>{children}</conversation.Marks>;\n}\n\n/**\n * One mark on the track, at `--kind-conversation-mark` (0 to 1) down it. `value` is its step. Memoized, so a host\n * render that keeps the marks renders none of them.\n */\nexport const ConversationMark = memo(conversation.Mark);\n\nconst SKELETON_ROWS = (\n  <>\n    <span />\n    <span />\n    <span />\n  </>\n);\n\nconst ERROR_PARTS = (\n  <>\n    <ConversationErrorIcon />\n    <ConversationErrorText />\n    <ConversationRetry />\n  </>\n);\n",
      "type": "registry:ui",
      "target": "@ui/conversation.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
