2023-09-08 23:30:32 +00:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type { Label as LabelPrimitive } from "bits-ui";
|
2024-02-26 06:59:29 +00:00
|
|
|
import { getFormControl } from "formsnap";
|
2023-11-07 00:36:51 +00:00
|
|
|
import { cn } from "$lib/utils";
|
2023-09-08 23:30:32 +00:00
|
|
|
import { Label } from "$lib/components/ui/label";
|
|
|
|
|
|
|
|
|
|
type $$Props = LabelPrimitive.Props;
|
|
|
|
|
|
|
|
|
|
let className: $$Props["class"] = undefined;
|
|
|
|
|
export { className as class };
|
|
|
|
|
|
2024-02-26 06:59:29 +00:00
|
|
|
const { labelAttrs } = getFormControl();
|
2023-09-08 23:30:32 +00:00
|
|
|
</script>
|
|
|
|
|
|
2024-02-26 06:59:29 +00:00
|
|
|
<Label {...$labelAttrs} class={cn("data-[fs-error]:text-destructive", className)} {...$$restProps}>
|
|
|
|
|
<slot {labelAttrs} />
|
2023-09-08 23:30:32 +00:00
|
|
|
</Label>
|