Line data Source code
1 : <template>
2 7 : <div
3 : role="status"
4 : :data-position="position"
5 : :class="
6 : cn(
7 : 'pointer-events-auto absolute flex max-h-96 w-96 flex-col rounded-lg border bg-background shadow-md',
8 : position === 'bottom-left' && 'bottom-4 left-4',
9 : position === 'bottom-right' && 'right-4 bottom-4'
10 : )
11 : "
12 : >
13 : <div class="flex min-h-0 flex-1 flex-col gap-4 p-4">
14 : <div class="flex items-center gap-4">
15 : <div
16 : v-if="icon"
17 : class="flex shrink-0 items-center justify-center rounded-lg bg-primary/90 p-3"
18 : >
19 : <i :class="cn('text-white', icon)" />
20 : </div>
21 : <div class="flex flex-1 flex-col gap-1 font-normal">
22 : <div class="text-sm leading-[1.429]">
23 : {{ title }}
24 : </div>
25 : <div
26 : v-if="subtitle"
27 : class="text-sm leading-[1.21] text-muted-foreground"
28 : >
29 : {{ subtitle }}
30 : </div>
31 : </div>
32 : <Button
33 : v-if="closeLabel"
34 : class="size-6 shrink-0 self-start"
35 : size="icon-sm"
36 : variant="muted-textonly"
37 : :aria-label="closeLabel"
38 : @click="emit('close')"
39 : >
40 : <i class="icon-[lucide--x] size-3.5" />
41 : </Button>
42 : </div>
43 :
44 : <div
45 : v-if="$slots.default"
46 : class="min-h-0 flex-1 overflow-y-auto text-sm text-muted-foreground"
47 : >
48 : <slot />
49 : </div>
50 : </div>
51 :
52 : <div
53 : v-if="$slots['footer-start'] || $slots['footer-end']"
54 : class="flex items-center justify-between px-4 pb-4"
55 : >
56 : <div>
57 : <slot name="footer-start" />
58 : </div>
59 : <div class="flex items-center gap-4">
60 : <slot name="footer-end" />
61 : </div>
62 : </div>
63 : </div>
64 : </template>
65 :
66 : <script setup lang="ts">
67 : import Button from '@comfyorg/design-system/button/Button'
68 : import { cn } from '@comfyorg/tailwind-utils'
69 :
70 : const {
71 : icon,
72 : title,
73 : subtitle,
74 : closeLabel,
75 : position = 'bottom-left'
76 : } = defineProps<{
77 : icon?: string
78 : title: string
79 : subtitle?: string
80 : closeLabel?: string
81 : position?: 'bottom-left' | 'bottom-right'
82 : }>()
83 :
84 6 : const emit = defineEmits<{
85 : close: []
86 : }>()
87 : </script>
|