migrate: convert most components to svelte 5

This commit is contained in:
Xylight committed 2024-10-25 19:33:27 -07:00
1 parent d670f39f0a
commit 10ef4123da
225 files changed
+5441 -3341

No files matched your search

+12 -5
View File
@@ -1,13 +1,20 @@
<script lang="ts">
import { createBubbler } from 'svelte/legacy';
const bubble = createBubbler();
import { hexToRgb } from '$lib/ui/colors'
import { createEventDispatcher } from 'svelte'
export let value: string
const dispatch = createEventDispatcher<{ change: string }>()
let clazz: string = ''
export { clazz as class }
interface Props {
value: string;
class?: string;
}
let { value = $bindable(), class: clazz = '' }: Props = $props();
</script>
<div
@@ -19,7 +26,7 @@
class="rounded-md border cursor-pointer absolute top-0 left-0 w-full h-full opacity-0"
type="color"
bind:value
on:change={() => dispatch('change', hexToRgb(value))}
on:contextmenu
onchange={() => dispatch('change', hexToRgb(value))}
oncontextmenu={bubble('contextmenu')}
/>
</div>