### User stories
As a Wikidata user, I want to be able to easily find other entity types (aside from items) using the platform's main search.
### Background
- **Description:** The scoped search allows users to select an entity type from a dropdown attached to a search input. The users' selection will restrict the scope of their search.
- **Previous implementations:** No previous implementations of a similar solution have been found in our ecosystem. Nevertheless, this element is composed by two existing components that are available in the Codex library: [[ https://doc.wikimedia.org/codex/main/components/demos/select.html | Select ]] and [[ https://doc.wikimedia.org/codex/main/components/demos/typeahead-search.html | TypeaheadSearch ]]. The latter being the component currently in use by Vector 2022 to provide a main search in all projects.
### Design specifications
{F37098256}
| [[ https://www.figma.com/file/1RiCkqbWsz2Ul8z2dUK3GW/Wikidata-Search?type=design&node-id=611-49403&t=sAUMCku9aOKUyBL2-0 | Component spec sheet ]] | [[ https://www.figma.com/proto/1RiCkqbWsz2Ul8z2dUK3GW/Wikidata-Search?type=design&node-id=109-7770&scaling=min-zoom&page-id=77%3A7609&starting-point-node-id=109%3A7770 | Prototype ]] |
### Acceptance criteria
The new scoped TypeaheadSearch component is implemented following the design specifications:
[] The component's visual properties match the design guidelines (see design specs)
[] The component's interactive properties match the design guidelines (see prototype)
[] The component adjusts to different reading directions (LTR, RTL)
[] The component is fully usable via keyboard
### Open questions and considerations
- Ownership/maintenance: The scoped TypeaheadSearch pattern will be built using the combination of the Codex components Select and TypeaheadSearch, but it won't be introduced into the Codex library. We need to decide if this element would belong into a potential library of "LOD components" (see T338631). Alignment with the Web team at WMF and our Platform team would be crucial to define responsibilities.
- Select menu width: We might need to customize the Menu component (used by Select). The current width of the Codex's menu is 100% (of its parent). We’d need to adjust that to make it wrap (fit) its content by default and take a max-width (see linked specs for more details).
- Select menu header: The current implementation of the Codex Menu doesn't include a menu heading slot. We'll need to decide which team will implement that missing element. It's also unclear if menu headers should take descriptions (to be discussed with the Design Systems team).
- Should this be implemented as two separate components instead of a composite component? Possibly we would then need to only inject the select/menu into vector and could reuse the existing typeahead search component
### Notes
- Skins: The new search solution will be implemented in Vector 2022 only. We’ll investigate and evaluate making the new solution available in other skins (Vector legacy, Minerva) if we get specific requests.