<script lang="ts">
  import Root from 'bits-ui';
  import { cn, type WithoutChild } from '$lib/utils/cn.svelte.js';
  import type { Snippet } from 'svelte';

  type Props = WithoutChild<Root.Field.RootProps> & {
    class?: string;
    children?: Snippet;
  };

  let {
    ref = $bindable(null),
    class: className,
    children,
    ...restProps
  }: Props = $props();
</script>

<Root.Field.Root
  bind:ref
  data-slot="field-root"
  class={cn('flex flex-col gap-2', className)}
  {...restProps}
>
  {children}
</Root.Field.Root>