mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
28 lines
658 B
Vue
28 lines
658 B
Vue
<script setup lang="ts">
|
|
import { cn } from "@/lib/utils";
|
|
import { Primitive, type PrimitiveProps } from "radix-vue";
|
|
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)"
|
|
data-component="button"
|
|
>
|
|
<slot />
|
|
</Primitive>
|
|
</template>
|