2024-11-30 00:58:04 +01:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { cn } from "@/lib/utils";
|
2025-03-28 01:16:24 +01:00
|
|
|
import { Primitive, type PrimitiveProps } from "reka-ui";
|
2024-11-30 00:58:04 +01:00
|
|
|
import type { HTMLAttributes } from "vue";
|
|
|
|
|
import { type ButtonVariants, buttonVariants } from ".";
|
|
|
|
|
|
|
|
|
|
interface Props extends PrimitiveProps {
|
|
|
|
|
variant?: ButtonVariants["variant"];
|
|
|
|
|
size?: ButtonVariants["size"];
|
|
|
|
|
class?: HTMLAttributes["class"];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
|
|
as: "button",
|
|
|
|
|
});
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<Primitive
|
|
|
|
|
:as="as"
|
|
|
|
|
:as-child="asChild"
|
|
|
|
|
:class="cn(buttonVariants({ variant, size }), props.class)"
|
|
|
|
|
>
|
|
|
|
|
<slot />
|
|
|
|
|
</Primitive>
|
|
|
|
|
</template>
|