Files
nexus/frontend/src/components/ui/Dialog.vue
T
developer b7b44494f0
CI - Build & Test / Backend (.NET) (push) Successful in 26s
CI - Build & Test / Frontend (Vue/TS) (push) Successful in 16s
CI - Build & Test / Security Check (push) Successful in 2s
fix(shadcn): isolate Nexus CSS vars with --nx- prefix + admin password reset endpoint
2026-06-11 10:06:58 +02:00

62 lines
1.1 KiB
Vue

<script setup lang="ts">
import { ref, watch } from 'vue'
import { cn } from '@/lib/utils'
interface Props {
open?: boolean
class?: string
}
const props = withDefaults(defineProps<Props>(), {
open: false,
})
const emit = defineEmits<{
'update:open': [value: boolean]
}>()
const visible = ref(props.open)
watch(
() => props.open,
(val) => {
visible.value = val
},
)
function close() {
emit('update:open', false)
}
function onOverlayClick() {
close()
}
defineExpose({ close })
</script>
<template>
<Teleport to="body">
<div
v-if="visible"
class="fixed inset-0 z-50 flex items-center justify-center"
@click.self="onOverlayClick"
>
<!-- Overlay -->
<div class="fixed inset-0 bg-black/60 backdrop-blur-sm" />
<!-- Content -->
<div
:class="
cn(
'relative z-50 w-full max-w-lg gap-4 border bg-background p-6 shadow-lg duration-200 sm:rounded-lg',
props.class,
)
"
>
<slot :close="close" />
</div>
</div>
</Teleport>
</template>