partially refactor components to ui package
This commit is contained in:
23
components/Label.svelte
Normal file
23
components/Label.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from 'svelte';
|
||||
|
||||
let {
|
||||
for: target,
|
||||
error,
|
||||
bigError,
|
||||
children
|
||||
}: { for: string; error?: boolean; bigError?: boolean; children: Snippet } = $props();
|
||||
</script>
|
||||
|
||||
<label
|
||||
for={target}
|
||||
class={[
|
||||
'transition-fontColor block',
|
||||
error && !bigError
|
||||
? 'mt-1 text-sm font-normal text-red-500'
|
||||
: 'text-text dark:text-background mb-3 text-base font-medium',
|
||||
bigError && 'text-red-500!'
|
||||
]}
|
||||
>
|
||||
{@render children()}
|
||||
</label>
|
||||
Reference in New Issue
Block a user