Skyler Grey | 7177bbd | 2023-06-01 03:26:31 +0200 | [diff] [blame] | 1 | <script lang="ts"> |
| 2 | import type { HTMLInputAttributes } from "svelte/elements"; |
| 3 | import { cn } from "$lib/utils"; |
| 4 | |
| 5 | let className: string | undefined | null = undefined; |
| 6 | |
| 7 | export let value: HTMLInputAttributes["value"] = undefined; |
Skyler Grey | 51e9e63 | 2023-06-03 10:20:11 +0200 | [diff] [blame] | 8 | export let element: HTMLInputElement; |
Skyler Grey | 7177bbd | 2023-06-01 03:26:31 +0200 | [diff] [blame] | 9 | export { className as class }; |
| 10 | </script> |
| 11 | |
| 12 | <input |
| 13 | class={cn( |
| 14 | "flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", |
| 15 | className |
| 16 | )} |
Skyler Grey | 51e9e63 | 2023-06-03 10:20:11 +0200 | [diff] [blame] | 17 | bind:this={element} |
Skyler Grey | 7177bbd | 2023-06-01 03:26:31 +0200 | [diff] [blame] | 18 | bind:value |
| 19 | on:blur |
| 20 | on:change |
| 21 | on:click |
| 22 | on:focus |
| 23 | on:keydown |
| 24 | on:keypress |
| 25 | on:keyup |
| 26 | on:mouseover |
| 27 | on:mouseenter |
| 28 | on:mouseleave |
| 29 | on:paste |
| 30 | on:input |
| 31 | {...$$restProps} |
| 32 | /> |