feat(docs): add bilingual package documentation site

This commit is contained in:
Maofeng
2026-09-20 15:53:28 +08:00
parent 60f6f1fb1a
commit dc80bd8ae0
111 changed files with 6531 additions and 0 deletions
@@ -0,0 +1,47 @@
---
title: Installation and setup
description: Add Search, register its catalog, and mount the search surface.
order: 10
toc:
- id: add-the-package
title: Add the package
- id: import-styles
title: Import styles
- id: mount-search
title: Mount search
---
## Add the package {#add-the-package}
Add Search to the consuming application:
```json
{
"dependencies": {
"@workspace/search": "workspace:*"
}
}
```
## Import styles {#import-styles}
Import the Search stylesheet once from the application's global stylesheet so Tailwind scans the utilities used by the package:
```css
@import "@workspace/search/globals.css";
```
Also add `@workspace/search/locales/{locale}` to the application's internationalization catalog sources.
## Mount search {#mount-search}
```tsx
import { SearchDialog, SearchProvider, SearchTrigger } from "@workspace/search"
;<SearchProvider adapter={searchAdapter} onSelect={openResult}>
<SearchTrigger>Search</SearchTrigger>
<SearchDialog />
</SearchProvider>
```
`SearchDialog` registers `Mod+K` by default. Pass `hotkey={false}` when the application manages shortcuts centrally.