2024-12-02 17:20:27 +01:00
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { cn } from "@/lib/utils";
|
2025-03-28 01:16:24 +01:00
|
|
|
import { useId } from "reka-ui";
|
2024-12-02 17:20:27 +01:00
|
|
|
import { type HTMLAttributes, provide } from "vue";
|
|
|
|
|
import { FORM_ITEM_INJECTION_KEY } from "./injectionKeys";
|
|
|
|
|
|
2025-03-28 01:16:24 +01:00
|
|
|
const props = defineProps<{
|
|
|
|
|
class?: HTMLAttributes["class"];
|
|
|
|
|
}>();
|
2024-12-02 17:20:27 +01:00
|
|
|
|
|
|
|
|
const id = useId();
|
|
|
|
|
provide(FORM_ITEM_INJECTION_KEY, id);
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
2025-04-10 13:55:56 +02:00
|
|
|
<div
|
|
|
|
|
data-slot="form-item"
|
|
|
|
|
:class="cn('grid gap-2', props.class)"
|
|
|
|
|
>
|
2025-03-28 01:16:24 +01:00
|
|
|
<slot />
|
|
|
|
|
</div>
|
2024-12-02 17:20:27 +01:00
|
|
|
</template>
|