mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-10-07 10:19:04 +02:00
Co-authored-by: Elias Schneider <login@eliasschneider.com>
25 lines
592 B
Svelte
25 lines
592 B
Svelte
<script lang="ts">
|
|
import * as FormPrimitive from 'formsnap';
|
|
import { Label } from '$lib/components/ui/label/index.js';
|
|
import { cn, type WithoutChild } from '$lib/utils/style.js';
|
|
|
|
let {
|
|
ref = $bindable(null),
|
|
children,
|
|
class: className,
|
|
...restProps
|
|
}: WithoutChild<FormPrimitive.LabelProps> = $props();
|
|
</script>
|
|
|
|
<FormPrimitive.Label {...restProps} bind:ref>
|
|
{#snippet child({ props })}
|
|
<Label
|
|
{...props}
|
|
data-slot="form-label"
|
|
class={cn('data-[fs-error]:text-destructive', className)}
|
|
>
|
|
{@render children?.()}
|
|
</Label>
|
|
{/snippet}
|
|
</FormPrimitive.Label>
|