mirror of
https://github.com/abhinavxd/libredesk.git
synced 2025-11-07 07:23:29 +00:00
feat: dark mode
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user