-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPopover.vue
More file actions
137 lines (128 loc) · 4.89 KB
/
Copy pathPopover.vue
File metadata and controls
137 lines (128 loc) · 4.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<script setup lang="ts">
const open1 = ref(false)
const open2 = ref(false)
const open3 = ref(false)
const open4 = ref(false)
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Basic (click)">
<UPopover v-model:open="open1">
<UButton icon="i-material-symbols-info-outline" variant="outline" color="primary">
Agent info
</UButton>
<template #content>
<div class="p-4 text-sm max-w-xs">
<p class="font-semibold text-highlighted mb-1">arcp-agent-001</p>
<p class="text-muted">Runtime: v2.4.1 · Region: us-east-1 · Status: active</p>
</div>
</template>
</UPopover>
</GallerySection>
<GallerySection title="Hover mode">
<UPopover mode="hover" :open-delay="200" :close-delay="150">
<UButton icon="i-material-symbols-bolt-outline" variant="soft" color="info">
Hover for trace
</UButton>
<template #content>
<div class="p-4 text-sm max-w-xs">
<p class="font-semibold text-highlighted mb-1">Trace: trc_8a3f9d</p>
<p class="text-muted">Span count: 42 · Duration: 1.2 s · Errors: 0</p>
</div>
</template>
</UPopover>
</GallerySection>
<GallerySection title="With arrow">
<UPopover v-model:open="open2" :arrow="true" :content="{ side: 'top' }">
<UButton icon="i-material-symbols-schedule-outline" variant="soft" color="warning">
Lease details
</UButton>
<template #content>
<div class="p-4 text-sm max-w-xs">
<p class="font-semibold text-highlighted mb-1">Lease: lse_c72b01</p>
<p class="text-muted">Expires in <span class="text-warning font-medium">28 s</span> · Auto-renew: off</p>
</div>
</template>
</UPopover>
</GallerySection>
<GallerySection title="Placement">
<UPopover :content="{ side: 'top' }">
<UButton size="sm" variant="outline" color="neutral">Top</UButton>
<template #content>
<div class="p-3 text-sm text-muted">Placed above the trigger</div>
</template>
</UPopover>
<UPopover :content="{ side: 'right' }">
<UButton size="sm" variant="outline" color="neutral">Right</UButton>
<template #content>
<div class="p-3 text-sm text-muted">Placed to the right</div>
</template>
</UPopover>
<UPopover :content="{ side: 'bottom' }">
<UButton size="sm" variant="outline" color="neutral">Bottom</UButton>
<template #content>
<div class="p-3 text-sm text-muted">Placed below the trigger</div>
</template>
</UPopover>
<UPopover :content="{ side: 'left' }">
<UButton size="sm" variant="outline" color="neutral">Left</UButton>
<template #content>
<div class="p-3 text-sm text-muted">Placed to the left</div>
</template>
</UPopover>
</GallerySection>
<GallerySection title="Realistic: Session actions">
<UPopover v-model:open="open3">
<UButton icon="i-material-symbols-more-vert" variant="ghost" color="neutral" />
<template #content="{ close }">
<div class="flex flex-col min-w-40 p-1">
<UButton
variant="ghost"
color="neutral"
icon="i-material-symbols-refresh"
class="justify-start"
@click="close"
>
Restart session
</UButton>
<UButton
variant="ghost"
color="neutral"
icon="i-material-symbols-terminal-outline"
class="justify-start"
@click="close"
>
Open console
</UButton>
<UButton
variant="ghost"
color="error"
icon="i-material-symbols-stop-circle-outline"
class="justify-start"
@click="close"
>
Terminate
</UButton>
</div>
</template>
</UPopover>
</GallerySection>
<GallerySection title="Non-dismissible">
<UPopover v-model:open="open4" :dismissible="false">
<UButton icon="i-material-symbols-lock-outline" variant="soft" color="error">
Locked popover
</UButton>
<template #content="{ close }">
<div class="p-4 text-sm max-w-xs flex flex-col gap-3">
<p class="font-semibold text-highlighted">Confirm termination</p>
<p class="text-muted">This will stop all active jobs in session ses_7f2d88. This cannot be undone.</p>
<div class="flex gap-2 justify-end">
<UButton size="sm" variant="ghost" color="neutral" @click="close">Cancel</UButton>
<UButton size="sm" color="error" @click="close">Terminate</UButton>
</div>
</div>
</template>
</UPopover>
</GallerySection>
</div>
</template>