mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-10-23 04:52:14 +00:00
27 lines
632 B
Vue
27 lines
632 B
Vue
<script setup lang="ts">
|
|
import type { HTMLAttributes } from 'vue';
|
|
import { cn } from '@/src/modules/shared/style/cn';
|
|
import { Primitive, type PrimitiveProps } from 'radix-vue';
|
|
import { type ButtonVariants, buttonVariants } from '.';
|
|
|
|
type Props = {
|
|
variant?: ButtonVariants['variant'];
|
|
size?: ButtonVariants['size'];
|
|
class?: HTMLAttributes['class'];
|
|
} & PrimitiveProps;
|
|
|
|
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>
|