~james/core

core/web/src/lib/components/search/SearchBar.svelte -rw-r--r-- 593 bytes
452f17b7 — james chore(import): snapshot james.dad.town/core at f70c71c7696a 16 hours ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<script lang="ts">
	import Search from "$icon/search";
	import Input from "#lib/components/ui/Input.svelte";

	interface Props {
		type?: string;
		query: string;
		placeholder: string;
		mono?: boolean;
	}

	let { type, query = $bindable(), placeholder, mono = false }: Props = $props();
</script>

<form method="GET" class="flex items-center gap-xs">
	{#if type}
		<input type="hidden" name="type" value={type} />
	{/if}
	<Input
		name="q"
		type="search"
		bind:value={query}
		{placeholder}
		iconLeft={Search}
		class={mono ? "w-full typography-monospace-regular" : "w-full"}
	/>
</form>