feat: dark mode

This commit is contained in:
Abhinav Raut
2025-05-28 01:50:35 +05:30
parent 1f8fdf2ef6
commit 210e0de1ae
96 changed files with 937 additions and 880 deletions

View File

@@ -1,9 +1,7 @@
<script setup>
import { Primitive } from 'radix-vue'
import { buttonVariants } from '.'
import { cn } from '@/lib/utils'
import { ref, computed } from 'vue'
import { DotLoader } from '@/components/ui/loader'
import { Primitive } from 'reka-ui';
import { cn } from '@/lib/utils';
import { buttonVariants } from '.';
const props = defineProps({
variant: { type: null, required: false },
@@ -11,26 +9,15 @@ const props = defineProps({
class: { type: null, required: false },
asChild: { type: Boolean, required: false },
as: { type: null, required: false, default: 'button' },
isLoading: { type: Boolean, required: false, default: false }
})
const isDisabled = ref(false)
const computedClass = computed(() => {
return cn(buttonVariants({ variant: props.variant, size: props.size }), props.class, {
'cursor-not-allowed opacity-50': props.isLoading || isDisabled.value
})
})
});
</script>
<template>
<Primitive
:as="as"
:as-child="asChild"
:class="computedClass"
:disabled="isLoading || isDisabled"
:class="cn(buttonVariants({ variant, size }), props.class)"
>
<DotLoader v-if="isLoading" />
<slot v-else />
<slot />
</Primitive>
</template>