{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "thread-search-solid",
  "title": "Thread Search (Solid)",
  "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/solid@0.1.0-beta.17"
  ],
  "registryDependencies": [
    "@kind-ui/agent-ui-setup",
    "@kind-ui/picker-solid",
    "@kind-ui/internal-command-solid"
  ],
  "files": [
    {
      "path": "packages/agent-ui/src/solid/thread-search.tsx",
      "content": "import { type PickerTriggerState, threadSearchPrimitive } from \"@kind-ui/agent-ui/core\";\nimport type { ComponentProps, JSX } from \"@solidjs/web\";\nimport { createParts } from \"@ui-sdk/solid/primitive\";\nimport { omit } from \"solid-js\";\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, {\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?: JSX.Element;\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(props: ThreadSearchShortcutProps) {\n  return (\n    <parts.Shortcut {...omit(props, \"children\")}>\n      {props.children ?? ((state: { text: string }) => state.text)}\n    </parts.Shortcut>\n  );\n}\n\n/** Opens the dialog. Shows a search icon, the `label` and the `shortcut`'s keys, unless you pass children. */\nexport function ThreadSearchTrigger(props: ThreadSearchTriggerProps) {\n  return (\n    <picker.Trigger {...omit(props, \"children\")}>\n      {props.children ??\n        ((state: PickerTriggerState) => (\n          <>\n            <span data-picker-text=\"\">{state.text}</span>\n            <ThreadSearchShortcut />\n          </>\n        ))}\n    </picker.Trigger>\n  );\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(props: ThreadSearchHintsProps) {\n  return (\n    <parts.Hints {...omit(props, \"children\")}>\n      {props.children ?? (\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    </parts.Hints>\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(props: ThreadSearchProps) {\n  return (\n    <parts.Root {...omit(props, \"children\")}>\n      {props.children ?? (\n        <>\n          <ThreadSearchTrigger />\n          <ThreadSearchBackdrop />\n          <picker.Content>\n            <picker.List />\n            <ThreadSearchHints />\n          </picker.Content>\n        </>\n      )}\n    </parts.Root>\n  );\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/solid/thread-search.tsx"
    }
  ],
  "meta": {
    "layer": "solid"
  },
  "type": "registry:ui"
}
