* chore: add dev:nuxt script * chore(module): add `.npmrc` to playground * chore: bump 'nuxtjs/tailwindcss' and add it to modules * chore: add schema to components.json * chore: bump playground deps * fix: add missing tailwind.css by the cli * chore: bump tailwind config * chore(playground): bump Button component * chore: add comments * refactor: simplify components registration * chore(module): bump deps * chore(module): remove `oxc-parser` * chore: dedupe * feat(module): auto generate `lib/utils` * feat(module): refresh playground style and dark mode * chore: revert components registration and link the comment * chore: readd oxc-parser * chore: bump vitest
27 lines
614 B
Vue
27 lines
614 B
Vue
<script setup lang="ts">
|
|
import type { HTMLAttributes } from 'vue'
|
|
import { Primitive, type PrimitiveProps } from 'radix-vue'
|
|
import { type ButtonVariants, buttonVariants } from '.'
|
|
import { cn } from '@/lib/utils'
|
|
|
|
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>
|