{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "thread-search-vue",
  "title": "Thread Search (Vue)",
  "description": "A Search chats dialog over the threads, grouped by date, with New chat and a shortcut.",
  "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",
    "@kind-ui/picker-vue",
    "@kind-ui/internal-command-vue"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/vue/thread-search.ts",
      "content": "import { threadSearchPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/vue/primitive\";\nimport { defineComponent, h } from \"vue\";\nimport { type PickerParts, pickerParts } from \"./picker\";\n\n// `@ui-sdk/vue`'s `createParts` hands the primitive an emitter for every callback, whether or not anything listens, so\n// `onSelect` and `onNew`, whose presence offers `select` and \"New chat\", are declared function props instead, which\n// `@select` and `@new` bind.\nconst primitive = Object.defineProperty(\n  Object.assign((options: never) => threadSearchPrimitive(options), threadSearchPrimitive, {\n    options: { ...threadSearchPrimitive.options, onSelect: \"action\", onNew: \"action\" },\n  }),\n  \"name\",\n  { value: threadSearchPrimitive.name },\n) as typeof threadSearchPrimitive;\n\nconst parts = createParts(primitive, {\n  root: \"div\",\n  trigger: \"button\",\n  backdrop: \"div\",\n  content: \"div\",\n  viewport: \"div\",\n  command: \"div\",\n  item: \"span\",\n  note: \"p\",\n  shortcut: \"kbd\",\n  hints: \"div\",\n  status: \"span\",\n});\n\n/** A row's status mark, named in words (\"Running\"), by its row's `value`. */\nexport const ThreadSearchStatus = parts.Status;\n\n// Its parts are Picker's, with state the picker parts never read.\n// The status mark ends the row, after the date, since Command hides an item's icon from assistive technology and a\n// status needs its words.\nconst picker = pickerParts(parts as unknown as PickerParts, \"ThreadSearch\", {\n  icon: () => null,\n  trailing: (row) => (row.icon === undefined ? null : h(ThreadSearchStatus, { value: row.option.value })),\n});\n\n/** The `shortcut`'s keys as this platform shows them, like `⌘K`, unless you fill the default slot. Present only with one. */\nexport const ThreadSearchShortcut = defineComponent({\n  name: \"ThreadSearchShortcut\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () =>\n      h(parts.Shortcut, attrs, {\n        ...slots,\n        default: slots.default ?? (({ state }: { state: { text: string } }) => state.text),\n      });\n  },\n}) as unknown as typeof parts.Shortcut;\n\n/** Opens the dialog. Shows a search icon, the `label` and the `shortcut`'s keys, unless you fill the default slot. */\nexport const ThreadSearchTrigger = defineComponent({\n  name: \"ThreadSearchTrigger\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () =>\n      h(picker.Trigger, attrs, {\n        ...slots,\n        default:\n          slots.default ??\n          (({ state }: { state: { text: string } }) => [\n            h(\"span\", { \"data-picker-text\": \"\" }, state.text),\n            h(ThreadSearchShortcut),\n          ]),\n      });\n  },\n}) as unknown as typeof parts.Trigger;\n\n/** Dims the page beneath the dialog. A press on it closes the dialog. */\nexport const ThreadSearchBackdrop = parts.Backdrop;\n\nconst hints = () => [\n  h(\"span\", [h(\"kbd\", \"↑↓\"), \" Navigate\"]),\n  h(\"span\", [h(\"kbd\", \"↵\"), \" Open\"]),\n  h(\"span\", [h(\"kbd\", \"Esc\"), \" Close\"]),\n];\n\n/** \"↑↓ Navigate\", \"↵ Open\" and \"Esc Close\" under the list, unless you fill the default slot. Hidden on touch screens. */\nexport const ThreadSearchHints = defineComponent({\n  name: \"ThreadSearchHints\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () => h(parts.Hints, attrs, { ...slots, default: slots.default ?? hints });\n  },\n}) as unknown as typeof parts.Hints;\n\nconst defaultParts = () => [\n  h(ThreadSearchTrigger),\n  h(ThreadSearchBackdrop),\n  h(picker.Content, null, () => [h(picker.List), h(ThreadSearchHints)]),\n];\n\n/**\n * The \"Search chats\" dialog: a button that opens a search over the threads, grouped by date, with \"New chat\" after\n * them. Choosing a thread emits `select` and closes it. A default slot replaces the trigger and the dialog.\n */\nexport const ThreadSearch = defineComponent({\n  name: \"ThreadSearch\",\n  inheritAttrs: false,\n  setup(_, { attrs, slots }) {\n    return () => h(parts.Root, attrs, { ...slots, default: slots.default ?? defaultParts });\n  },\n}) as unknown as typeof parts.Root;\n\n/** The dialog: the search field, the list and the key hints, unless you fill the default slot. Focus moves to the search field. */\nexport const ThreadSearchContent = picker.Content;\n/** UI SDK Command: the search field, its status line, the empty text, and the rows unless you fill the default slot. */\nexport const ThreadSearchList = picker.List;\n/** A group of rows under its label, or the footer. */\nexport const ThreadSearchSectionRows = picker.SectionRows;\n/** A row: UI SDK's `CommandItem` with the row's props, holding its `ThreadSearchItem` unless you fill the default slot. */\nexport const ThreadSearchRowItem = picker.RowItem;\n/** A row's content: its status mark, marked title, snippet and date. */\nexport const ThreadSearchItem = picker.Item;\n",
      "type": "registry:ui",
      "target": "@ui/vue/thread-search.ts"
    }
  ],
  "meta": {
    "layer": "vue"
  },
  "type": "registry:ui"
}
