feat(blocks): add context-driven global search
Add a command-style global search dialog with asynchronous cancellation, paginated grouped results, highlighting, loading and error states, recent query history, and a configurable Mod+K shortcut. Make search sources and result actions host-defined through SearchProvider and SearchAdapter, so the block has no route, database, or HTTP dependency. Export the block, register i18n discovery, and cover adapter pagination and selection behavior.
This commit is contained in:
@@ -14,11 +14,15 @@ function createDialogHandle<Payload>(): DialogHandle<Payload> {
|
||||
return DialogPrimitive.createHandle<Payload>()
|
||||
}
|
||||
|
||||
function Dialog({ ...props }: DialogPrimitive.Root.Props) {
|
||||
function Dialog<Payload = unknown>({
|
||||
...props
|
||||
}: DialogPrimitive.Root.Props<Payload>) {
|
||||
return <DialogPrimitive.Root data-slot="dialog" {...props} />
|
||||
}
|
||||
|
||||
function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
|
||||
function DialogTrigger<Payload = unknown>({
|
||||
...props
|
||||
}: DialogPrimitive.Trigger.Props<Payload>) {
|
||||
return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user