{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "thread-search",
  "title": "Thread Search",
  "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/react@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/picker",
    "@kind-ui/internal-command"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/react/thread-search.tsx",
      "content": "\"use client\";\n\nimport { threadSearchPrimitive } from \"@kind-ui/agent-ui/core\";\nimport { createParts } from \"@ui-sdk/react/primitive\";\nimport type { ComponentProps, ReactNode } from \"react\";\nimport {\n  type PickerContentProps,\n  type PickerItemProps,\n  type PickerListProps,\n  type PickerParts,\n  type PickerRowItemProps,\n  type PickerSectionRowsProps,\n  type PickerTriggerProps,\n  pickerParts,\n} from \"./picker\";\n\nconst parts = createParts(threadSearchPrimitive, {\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// 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 : <ThreadSearchStatus value={row.option.value} />),\n});\n\nexport type ThreadSearchStatusProps = ComponentProps<typeof parts.Status>;\n\n/** A row's status mark, named in words (\"Running\"), by its row's `value`. */\nexport function ThreadSearchStatus(props: ThreadSearchStatusProps) {\n  return <parts.Status {...props} />;\n}\n\nexport type ThreadSearchProps = Omit<ComponentProps<typeof parts.Root>, \"children\"> & {\n  children?: ReactNode;\n};\nexport type ThreadSearchTriggerProps = PickerTriggerProps;\nexport type ThreadSearchBackdropProps = ComponentProps<typeof parts.Backdrop>;\nexport type ThreadSearchShortcutProps = ComponentProps<typeof parts.Shortcut>;\nexport type ThreadSearchContentProps = PickerContentProps;\nexport type ThreadSearchListProps = PickerListProps;\nexport type ThreadSearchSectionRowsProps = PickerSectionRowsProps;\nexport type ThreadSearchRowItemProps = PickerRowItemProps;\nexport type ThreadSearchItemProps = PickerItemProps;\n\n/** The `shortcut`'s keys as this platform shows them, like `⌘K`, unless you pass children. Present only with one. */\nexport function ThreadSearchShortcut({ children = ({ text }) => text, ...props }: ThreadSearchShortcutProps) {\n  return <parts.Shortcut {...props}>{children}</parts.Shortcut>;\n}\n\n/** Opens the dialog. Shows a search icon, the `label` and the `shortcut`'s keys, unless you pass children. */\nexport function ThreadSearchTrigger({\n  children = ({ text }) => (\n    <>\n      <span data-picker-text=\"\">{text}</span>\n      <ThreadSearchShortcut />\n    </>\n  ),\n  ...props\n}: ThreadSearchTriggerProps) {\n  return <picker.Trigger {...props}>{children}</picker.Trigger>;\n}\n\n/** Dims the page beneath the dialog. A press on it closes the dialog. */\nexport function ThreadSearchBackdrop(props: ThreadSearchBackdropProps) {\n  return <parts.Backdrop {...props} />;\n}\n\nexport type ThreadSearchHintsProps = ComponentProps<typeof parts.Hints>;\n\n/** \"↑↓ Navigate\", \"↵ Open\" and \"Esc Close\" under the list, unless you pass children. Hidden on touch screens. */\nexport function ThreadSearchHints({ children = HINTS, ...props }: ThreadSearchHintsProps) {\n  return <parts.Hints {...props}>{children}</parts.Hints>;\n}\n\nconst HINTS = (\n  <>\n    <span>\n      <kbd>↑↓</kbd> Navigate\n    </span>\n    <span>\n      <kbd>↵</kbd> Open\n    </span>\n    <span>\n      <kbd>Esc</kbd> Close\n    </span>\n  </>\n);\n\nconst DEFAULT = (\n  <>\n    <ThreadSearchTrigger />\n    <ThreadSearchBackdrop />\n    <picker.Content>\n      <picker.List />\n      <ThreadSearchHints />\n    </picker.Content>\n  </>\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 calls `onSelect` and closes it. Any `children` replace the trigger and the dialog.\n */\nexport function ThreadSearch({ children = DEFAULT, ...props }: ThreadSearchProps) {\n  return <parts.Root {...props}>{children}</parts.Root>;\n}\n\n/** The dialog: the search field, the list and the key hints, unless you pass children. 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 pass children. */\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 pass children. */\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/thread-search.tsx"
    }
  ],
  "meta": {
    "layer": "react"
  },
  "type": "registry:ui"
}
