2026-02-02 12:16:51 +03:00
|
|
|
<!-- Component: SearchBar -->
|
2026-01-09 16:19:22 +03:00
|
|
|
<script lang="ts">
|
2026-02-07 18:02:32 +03:00
|
|
|
import { Input } from '$shared/ui';
|
2026-02-02 12:16:51 +03:00
|
|
|
import AsteriskIcon from '@lucide/svelte/icons/asterisk';
|
2026-01-09 16:19:22 +03:00
|
|
|
|
|
|
|
|
interface Props {
|
2026-01-29 14:33:12 +03:00
|
|
|
/**
|
|
|
|
|
* Unique identifier for the input element
|
|
|
|
|
*/
|
2026-01-18 20:07:37 +03:00
|
|
|
id?: string;
|
2026-01-29 14:33:12 +03:00
|
|
|
/**
|
|
|
|
|
* Current search value (bindable)
|
|
|
|
|
*/
|
2026-01-09 16:19:22 +03:00
|
|
|
value: string;
|
2026-01-29 14:33:12 +03:00
|
|
|
/**
|
|
|
|
|
* Additional CSS classes for the container
|
|
|
|
|
*/
|
2026-01-09 16:19:22 +03:00
|
|
|
class?: string;
|
2026-01-29 14:33:12 +03:00
|
|
|
/**
|
|
|
|
|
* Placeholder text for the input
|
|
|
|
|
*/
|
2026-01-09 16:19:22 +03:00
|
|
|
placeholder?: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
id = 'search-bar',
|
2026-01-29 14:33:12 +03:00
|
|
|
value = $bindable(''),
|
2026-01-09 16:19:22 +03:00
|
|
|
class: className,
|
|
|
|
|
placeholder,
|
|
|
|
|
}: Props = $props();
|
|
|
|
|
</script>
|
|
|
|
|
|
2026-02-01 11:56:39 +03:00
|
|
|
<div class="relative w-full">
|
2026-02-06 14:48:44 +03:00
|
|
|
<div class="absolute left-4 sm:left-5 top-1/2 -translate-y-1/2 pointer-events-none z-10">
|
|
|
|
|
<AsteriskIcon class="size-3 sm:size-4 stroke-gray-400 stroke-[1.5]" />
|
2026-02-01 11:56:39 +03:00
|
|
|
</div>
|
2026-02-07 18:02:32 +03:00
|
|
|
<Input {id} class={className} bind:value={value} placeholder={placeholder} />
|
2026-02-01 11:56:39 +03:00
|
|
|
</div>
|