{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "conversation-search",
  "title": "Conversation Search",
  "description": "A find bar over a conversation's messages that counts matches, moves between them and marks them on the scrollbar.",
  "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-search.tsx",
      "content": "\"use client\";\n\nimport { type ConversationSearchInputState, conversationSearchPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { Input, InputGroup } from \"@ui-sdk/react/input\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps } from \"react\";\n\nconst parts = createParts(conversationSearchPrimitive, {\n  root: \"div\",\n  input: \"div\",\n  count: \"span\",\n  previous: \"button\",\n  next: \"button\",\n  close: \"button\",\n});\n\nexport type ConversationSearchProps = ComponentProps<typeof parts.Root>;\n\n/**\n * A find bar over a Conversation's messages: the field with its count, Previous, Next and Close, unless you pass\n * children. Pass `conversation` the Conversation's controller and wire `onMarksChange` to its `marks`.\n */\nexport function ConversationSearch({ children, ...props }: ConversationSearchProps) {\n  return <parts.Root {...props}>{children !== undefined ? children : DEFAULT_PARTS}</parts.Root>;\n}\n\nconst searchField = ({ controller, defaultValue, label, describedBy }: ConversationSearchInputState) => (\n  <InputGroup>\n    <Input\n      type=\"search\"\n      controller={controller}\n      defaultValue={defaultValue}\n      aria-label={label}\n      aria-describedby={describedBy}\n      placeholder=\"Find…\"\n      data-agent-hidden=\"\"\n    />\n    <ConversationSearchCount />\n  </InputGroup>\n);\n\nexport type ConversationSearchInputProps = ComponentProps<typeof parts.Input>;\n\n/** The search field with its count, unless you pass children. Pass the state to UI SDK Input. */\nexport function ConversationSearchInput({ children = searchField, ...props }: ConversationSearchInputProps) {\n  return <parts.Input {...props}>{children}</parts.Input>;\n}\n\nexport type ConversationSearchCountProps = ComponentProps<typeof parts.Count>;\n\n/** \"3 of 12\", or \"0 of 0\" without a match, while there's a search, unless you pass children. */\nexport function ConversationSearchCount({\n  children = ({ text }) => text,\n  ...props\n}: ConversationSearchCountProps) {\n  return <parts.Count {...props}>{children}</parts.Count>;\n}\n\n/** Moves to the previous match. Its icon is drawn in CSS; render it empty. */\nexport const ConversationSearchPrevious = parts.Previous;\n/** Moves to the next match. Its icon is drawn in CSS; render it empty. */\nexport const ConversationSearchNext = parts.Next;\n/** Closes the bar and moves focus back where it was. Its icon is drawn in CSS; render it empty. */\nexport const ConversationSearchClose = parts.Close;\n\nconst DEFAULT_PARTS = (\n  <>\n    <ConversationSearchInput />\n    <ConversationSearchPrevious />\n    <ConversationSearchNext />\n    <ConversationSearchClose />\n  </>\n);\n",
      "type": "registry:ui",
      "target": "@ui/conversation-search.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
