mirror of
https://github.com/pocket-id/pocket-id.git
synced 2025-12-24 01:11:52 +03:00
30 lines
605 B
Svelte
30 lines
605 B
Svelte
<script lang="ts">
|
|
import { cn, type WithElementRef } from "$lib/utils/style.js";
|
|
import type { HTMLAttributes } from "svelte/elements";
|
|
|
|
let {
|
|
ref = $bindable(null),
|
|
class: className,
|
|
variant = "legend",
|
|
children,
|
|
...restProps
|
|
}: WithElementRef<HTMLAttributes<HTMLLegendElement>> & {
|
|
variant?: "legend" | "label";
|
|
} = $props();
|
|
</script>
|
|
|
|
<legend
|
|
bind:this={ref}
|
|
data-slot="field-legend"
|
|
data-variant={variant}
|
|
class={cn(
|
|
"mb-3 font-medium",
|
|
"data-[variant=legend]:text-base",
|
|
"data-[variant=label]:text-sm",
|
|
className
|
|
)}
|
|
{...restProps}
|
|
>
|
|
{@render children?.()}
|
|
</legend>
|