Files
accounted/components/ui/toolbar-search.tsx
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

36 lines
1.2 KiB
TypeScript

'use client'
import * as React from 'react'
import { Search } from 'lucide-react'
import { Input } from '@/components/ui/input'
import { cn } from '@/lib/utils'
interface ToolbarSearchProps extends React.InputHTMLAttributes<HTMLInputElement> {
/** Overrides the wrapper (width/flex) classes, not the input itself. */
containerClassName?: string
}
/**
* Page-toolbar search field. A pill, like every other control that lives in a
* toolbar row (buttons, context pickers, segmented controls), at the shared
* h-8 toolbar height. Form fields inside dialogs and forms keep the regular
* rounded-lg Input; this variant exists only for toolbars.
*/
export const ToolbarSearch = React.forwardRef<HTMLInputElement, ToolbarSearchProps>(
({ containerClassName, className, ...props }, ref) => (
<div className={cn('relative min-w-[220px] max-w-xs flex-1', containerClassName)}>
<Search
className="absolute left-3.5 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"
aria-hidden="true"
/>
<Input
ref={ref}
type="search"
{...props}
className={cn('h-8 rounded-full pl-10 pr-4 text-[13px]', className)}
/>
</div>
),
)
ToolbarSearch.displayName = 'ToolbarSearch'