mirror of
https://github.com/versia-pub/frontend.git
synced 2025-12-06 16:38:20 +01:00
34 lines
896 B
Vue
34 lines
896 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 SidebarMenuButtonVariants, sidebarMenuButtonVariants } from ".";
|
||
|
|
|
||
|
|
export interface SidebarMenuButtonProps extends PrimitiveProps {
|
||
|
|
variant?: SidebarMenuButtonVariants["variant"];
|
||
|
|
size?: SidebarMenuButtonVariants["size"];
|
||
|
|
isActive?: boolean;
|
||
|
|
class?: HTMLAttributes["class"];
|
||
|
|
}
|
||
|
|
|
||
|
|
const props = withDefaults(defineProps<SidebarMenuButtonProps>(), {
|
||
|
|
as: "button",
|
||
|
|
variant: "default",
|
||
|
|
size: "default",
|
||
|
|
});
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<Primitive
|
||
|
|
data-sidebar="menu-button"
|
||
|
|
:data-size="size"
|
||
|
|
:data-active="isActive"
|
||
|
|
:class="cn(sidebarMenuButtonVariants({ variant, size }), props.class)"
|
||
|
|
:as="as"
|
||
|
|
:as-child="asChild"
|
||
|
|
v-bind="$attrs"
|
||
|
|
>
|
||
|
|
<slot />
|
||
|
|
</Primitive>
|
||
|
|
</template>
|