@@ -8,6 +8,7 @@ import {Command as CommandPrimitive} from "cmdk";
88import { cn } from "@/lib/utils" ;
99import { useRouter } from "next/navigation" ;
1010import { PageItem } from "@/lib/getPagesFromPageMap" ;
11+ import { Kbd } from "@/components/ui/kbd" ;
1112
1213type Props = {
1314 placeholder ?: string ;
@@ -143,7 +144,7 @@ export function NextraSearchDialog({placeholder = "Search...", pages = []}: Prop
143144 showCloseButton = { false }
144145 className = "search-dialog !max-w-[800px] overflow-hidden !bg-transparent px-2 border-none [&_.bg-popover]:bg-transparent" >
145146
146- < div className = "border-4 border-slate-200 rounded-2xl bg-white " >
147+ < div className = "border-4 rounded-2xl bg-background " >
147148 < SearchInput
148149 placeholder = { placeholder }
149150 query = { query }
@@ -216,16 +217,16 @@ function SearchTrigger({placeholder, onClick}: { placeholder: string; onClick: (
216217 return (
217218 < button
218219 onClick = { onClick }
219- className = "inline-flex items-center gap-2 px-3 py-2 text-sm
220- bg-input text-foreground cursor-pointer
221- border border-gray-200 rounded-md hover:border-gray-300 hover:bg-gray-50 transition-colors"
220+ className = { cn (
221+ "inline-flex items-center gap-2 px-3 py-2 text-sm cursor-pointer hover:border-gray-300 dark:hover:border-white/40" ,
222+ "file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-all outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm" ,
223+ "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]" ,
224+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
225+ ) }
222226 >
223227 < SearchIcon className = "size-4" />
224228 < span > { placeholder } </ span >
225- < kbd
226- className = "hidden sm:inline-flex h-5 select-none items-center gap-1 rounded border border-gray-200 bg-gray-100 px-1.5 font-mono text-xs text-gray-600" >
227- < span className = "text-xs" > ⌘</ span > K
228- </ kbd >
229+ < Kbd > < span className = "text-xs" > ⌘</ span > K</ Kbd >
229230 </ button >
230231 ) ;
231232}
@@ -278,7 +279,7 @@ function SearchItem({url, title, description, onSelect, value, parent}: {
278279 value ?: string ;
279280} ) {
280281 return (
281- < CommandItem onSelect = { ( ) => onSelect ( url ) } value = { value } >
282+ < CommandItem onSelect = { ( ) => onSelect ( url ) } value = { value } className = "cursor-pointer" >
282283 < div className = "flex flex-col gap-1 w-full" >
283284 < div className = "flex items-center gap-1" >
284285 { parent && (
@@ -289,7 +290,7 @@ function SearchItem({url, title, description, onSelect, value, parent}: {
289290 ) }
290291 < div className = "font-semibold" > { title } </ div >
291292 </ div >
292- < div className = "text-xs text-gray-600 " >
293+ < div className = "text-xs text-muted-foreground " >
293294 { description }
294295 </ div >
295296 </ div >
@@ -336,7 +337,7 @@ function highlightQuery(text: string, query: string) {
336337 const parts = text . split ( regex ) ;
337338
338339 return parts . map ( ( part , index ) =>
339- regex . test ( part ) ? < mark key = { index } className = "bg-brand text-brand -foreground font-medium" > { part } </ mark > : part
340+ regex . test ( part ) ? < mark key = { index } className = "bg-primary text-primary -foreground rounded-[3px] font-medium" > { part } </ mark > : part
340341 ) ;
341342}
342343
0 commit comments