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

+18 -6
View File
@@ -1,15 +1,27 @@
<script lang="ts">
export let defaultValue: boolean = false
export let checked: boolean | undefined = defaultValue
export let inlineDescription: boolean = false
interface Props {
defaultValue?: boolean;
checked?: boolean | undefined;
inlineDescription?: boolean;
children?: import('svelte').Snippet;
description?: import('svelte').Snippet;
}
let {
defaultValue = false,
checked = $bindable(defaultValue),
inlineDescription = false,
children,
description
}: Props = $props();
</script>
<label class="font-normal cursor-pointer text-sm flex flex-row items-baseline gap-2">
<input type="checkbox" bind:checked class="cursor-pointer" />
<div class="inline-flex {inlineDescription ? 'flex-row' : 'flex-col'} font-medium gap-1">
<slot />
{#if $$slots.description}
<span class="font-normal text-slate-600 dark:text-zinc-400"><slot name="description" /></span>
{@render children?.()}
{#if description}
<span class="font-normal text-slate-600 dark:text-zinc-400">{@render description?.()}</span>
{/if}
</div>
</label>