SearchInput: bordered like Input, matching Select in FilterBar

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ilya Mukhortov 2026-10-28 10:31:53 +10:00
parent cc0448bfde
commit b7c038c9d7
1 changed files with 4 additions and 3 deletions

View File

@ -3,7 +3,7 @@ import { SearchIcon, XIcon } from "lucide-react"
import { cn } from "../lib/utils" import { cn } from "../lib/utils"
/** Поле поиска на мягкой подложке: иконка, крестик очистки. */ /** Поле поиска: иконка, крестик очистки. */
export const SearchInput = React.forwardRef< export const SearchInput = React.forwardRef<
HTMLInputElement, HTMLInputElement,
Omit<React.ComponentProps<"input">, "value" | "onChange" | "size"> & { Omit<React.ComponentProps<"input">, "value" | "onChange" | "size"> & {
@ -38,8 +38,9 @@ export const SearchInput = React.forwardRef<
onKeyDown?.(e) onKeyDown?.(e)
}} }}
className={cn( className={cn(
"w-full rounded-lg border border-transparent bg-muted/70 transition outline-none placeholder:text-muted-foreground/80 [&::-webkit-search-cancel-button]:hidden", // как Input: рамка на белом, та же подсветка фокуса — в строке фильтров стоит рядом с Select
"focus:border-primary/40 focus:bg-card focus:ring-4 focus:ring-primary/10", "w-full min-w-0 rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground dark:bg-input/30 [&::-webkit-search-cancel-button]:hidden",
"focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
size === "sm" && "h-8 pr-8 pl-9 text-sm", size === "sm" && "h-8 pr-8 pl-9 text-sm",
size === "md" && "h-9 pr-8 pl-9 text-sm", size === "md" && "h-9 pr-8 pl-9 text-sm",
size === "lg" && "h-12 rounded-xl pr-12 pl-12 text-base", size === "lg" && "h-12 rounded-xl pr-12 pl-12 text-base",