TempMonitor/src/lib/components/ui/command/command-input.svelte

27 lines
786 B
Svelte
Raw Normal View History

2025-05-19 16:25:20 +02:00
<script lang="ts">
2025-05-18 13:18:46 +02:00
import { Command as CommandPrimitive } from "bits-ui";
2025-05-19 16:25:20 +02:00
import SearchIcon from "@lucide/svelte/icons/search";
2025-05-18 13:18:46 +02:00
import { cn } from "$lib/utils.js";
2025-05-19 16:25:20 +02:00
let {
ref = $bindable(null),
class: className,
value = $bindable(""),
...restProps
}: CommandPrimitive.InputProps = $props();
2025-05-18 13:18:46 +02:00
</script>
2025-05-19 16:25:20 +02:00
<div class="flex h-9 items-center gap-2 border-b px-3" data-slot="command-input-wrapper">
<SearchIcon class="size-4 shrink-0 opacity-50" />
2025-05-18 13:18:46 +02:00
<CommandPrimitive.Input
2025-05-19 16:25:20 +02:00
data-slot="command-input"
2025-05-18 13:18:46 +02:00
class={cn(
2025-05-19 16:25:20 +02:00
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
2025-05-18 13:18:46 +02:00
className,
)}
bind:ref
{...restProps}
bind:value
/>
</div>