2024-04-22 19:36:31 +02:00
|
|
|
<script lang="ts">
|
|
|
|
|
import type { HTMLAttributes } from "svelte/elements";
|
2025-06-08 16:32:41 +02:00
|
|
|
import type { WithElementRef } from "bits-ui";
|
2024-04-22 19:36:31 +02:00
|
|
|
import { cn } from "$lib/utils.js";
|
|
|
|
|
|
2025-06-08 16:32:41 +02:00
|
|
|
let {
|
|
|
|
|
ref = $bindable(null),
|
|
|
|
|
class: className,
|
|
|
|
|
level = 5,
|
|
|
|
|
children,
|
|
|
|
|
...restProps
|
|
|
|
|
}: WithElementRef<HTMLAttributes<HTMLDivElement>> & {
|
|
|
|
|
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
|
|
|
} = $props();
|
2024-04-22 19:36:31 +02:00
|
|
|
</script>
|
|
|
|
|
|
2025-06-08 16:32:41 +02:00
|
|
|
<div
|
|
|
|
|
role="heading"
|
|
|
|
|
aria-level={level}
|
|
|
|
|
bind:this={ref}
|
2024-04-22 19:36:31 +02:00
|
|
|
class={cn("mb-1 font-medium leading-none tracking-tight", className)}
|
2025-06-08 16:32:41 +02:00
|
|
|
{...restProps}
|
2024-04-22 19:36:31 +02:00
|
|
|
>
|
2025-06-08 16:32:41 +02:00
|
|
|
{@render children?.()}
|
|
|
|
|
</div>
|