Line data Source code
1 : <script setup lang="ts">
2 : import DialogClose from '@comfyorg/design-system/dialog/DialogClose'
3 : import DialogContent from '@comfyorg/design-system/dialog/DialogContent'
4 : import DialogOverlay from '@comfyorg/design-system/dialog/DialogOverlay'
5 : import DialogPortal from '@comfyorg/design-system/dialog/DialogPortal'
6 : import {
7 : DialogDescription,
8 : DialogRoot,
9 : DialogTitle,
10 : VisuallyHidden
11 : } from 'reka-ui'
12 :
13 : import Button from '@comfyorg/design-system/button/Button'
14 :
15 2355 : const open = defineModel<boolean>({ default: false })
16 4 :
17 : const {
18 : src,
19 : alt = '',
20 : fallbackTitle,
21 : closeLabel
22 : } = defineProps<{
23 : src: string
24 : alt?: string
25 : fallbackTitle: string
26 : closeLabel: string
27 : }>()
28 : </script>
29 : <template>
30 7 : <DialogRoot v-model:open="open">
31 : <DialogPortal>
32 : <DialogOverlay />
33 : <DialogContent surface="none" size="fit">
34 : <VisuallyHidden>
35 : <DialogTitle>{{ alt || fallbackTitle }}</DialogTitle>
36 : <DialogDescription v-if="alt">{{ alt }}</DialogDescription>
37 : </VisuallyHidden>
38 : <DialogClose>
39 : <Button
40 : :aria-label="closeLabel"
41 : size="icon"
42 : variant="muted-textonly"
43 : class="absolute -top-2 -right-2 z-10 translate-x-full text-white hover:text-white/80"
44 : >
45 : <i class="icon-[lucide--x] size-5" />
46 : </Button>
47 : </DialogClose>
48 : <img
49 : :src
50 : :alt
51 : class="max-h-[90vh] max-w-[90vw] rounded-sm object-contain"
52 : />
53 : </DialogContent>
54 : </DialogPortal>
55 : </DialogRoot>
56 : </template>
|