{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "conversation-search-vue",
  "title": "Conversation Search (Vue)",
  "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/vue@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/conversation-search.ts",
      "content": "import { type ConversationSearchInputState, conversationSearchPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { Input, InputGroup } from \"@ui-sdk/vue/input\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { defineComponent, h, type Slots, type VNodeChild } from \"vue\";\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\n// A part with default children, unless the host passes its own default slot.\nconst withDefault = <Part extends object>(\n  name: string,\n  part: Part,\n  children: (scope: { state: never }) => VNodeChild,\n): Part =>\n  defineComponent({\n    name,\n    inheritAttrs: false,\n    setup(_, { attrs, slots }) {\n      return () => h(part, attrs, { ...slots, default: slots.default ?? children } as Slots);\n    },\n  }) as unknown as Part;\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\n/** \"3 of 12\", or \"0 of 0\" without a match, while there's a search, unless you fill the default slot. */\nexport const ConversationSearchCount = withDefault(\n  \"ConversationSearchCount\",\n  parts.Count,\n  ({ state }: { state: { text: string } }) => state.text,\n);\n\n/** The search field with its count, unless you fill the default slot, which gets the state to pass UI SDK Input. */\nexport const ConversationSearchInput = withDefault(\n  \"ConversationSearchInput\",\n  parts.Input,\n  ({ state }: { state: ConversationSearchInputState }) =>\n    h(InputGroup, null, () => [\n      h(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      h(ConversationSearchCount),\n    ]),\n);\n\n/**\n * A find bar over a Conversation's messages: the field with its count, Previous, Next and Close, unless you fill the\n * default slot. Pass `conversation` the Conversation's controller and wire `@marks-change` to its `marks`.\n */\nexport const ConversationSearch = withDefault(\"ConversationSearch\", parts.Root, () => [\n  h(ConversationSearchInput),\n  h(ConversationSearchPrevious),\n  h(ConversationSearchNext),\n  h(ConversationSearchClose),\n]);\n",
      "type": "registry:ui",
      "target": "@ui/vue/conversation-search.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
