{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "conversation-search-solid",
  "title": "Conversation Search (Solid)",
  "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/solid@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/solid/conversation-search.tsx",
      "content": "import { type ConversationSearchInputState, conversationSearchPrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps } from \"@solidjs/web\";\nimport { Input, InputGroup } from \"@ui-sdk/solid/input\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { omit } from \"solid-js\";\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(props: ConversationSearchProps) {\n  return (\n    <parts.Root {...omit(props, \"children\")}>\n      {props.children ?? (\n        <>\n          <ConversationSearchInput />\n          <ConversationSearchPrevious />\n          <ConversationSearchNext />\n          <ConversationSearchClose />\n        </>\n      )}\n    </parts.Root>\n  );\n}\n\nconst searchField = (state: ConversationSearchInputState) => (\n  <InputGroup>\n    <Input\n      type=\"search\"\n      controller={state.controller}\n      defaultValue={state.defaultValue}\n      aria-label={state.label}\n      aria-describedby={state.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(props: ConversationSearchInputProps) {\n  return <parts.Input {...omit(props, \"children\")}>{props.children ?? searchField}</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(props: ConversationSearchCountProps) {\n  return (\n    <parts.Count {...omit(props, \"children\")}>\n      {props.children ?? ((state: { text: string }) => state.text)}\n    </parts.Count>\n  );\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",
      "type": "registry:ui",
      "target": "@ui/solid/conversation-search.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
