-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCommandPalette.vue
More file actions
144 lines (136 loc) · 5.13 KB
/
Copy pathCommandPalette.vue
File metadata and controls
144 lines (136 loc) · 5.13 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
138
139
140
141
142
143
144
<script setup lang="ts">
const agentGroups = [
{
id: 'actions',
label: 'Actions',
items: [
{ label: 'Spawn agent', icon: 'i-material-symbols-add-circle-outline', description: 'Start a new agent session', kbds: ['meta', 'N'] },
{ label: 'Terminate session', icon: 'i-material-symbols-stop-circle-outline', description: 'Gracefully stop the current session', kbds: ['meta', 'T'] },
{ label: 'Renew lease', icon: 'i-material-symbols-autorenew', description: 'Extend the active job lease', kbds: ['meta', 'R'] },
],
},
{
id: 'jobs',
label: 'Recent Jobs',
items: [
{ label: 'job-7f3a2c', icon: 'i-material-symbols-work-outline', description: 'Inference pipeline · running' },
{ label: 'job-4b1e9d', icon: 'i-material-symbols-work-history-outline', description: 'Batch trace export · completed' },
{ label: 'job-9c0f55', icon: 'i-material-symbols-work-outline', description: 'Event stream replay · queued' },
],
},
{
id: 'runtimes',
label: 'Runtimes',
items: [
{ label: 'runtime-alpha', icon: 'i-material-symbols-memory-outline', description: 'GPU cluster · 4 agents active' },
{ label: 'runtime-beta', icon: 'i-material-symbols-memory-outline', description: 'CPU pool · idle' },
],
},
]
const agentGroupsWithIcons = [
{
id: 'events',
label: 'Events',
highlightedIcon: 'i-material-symbols-arrow-forward',
items: [
{ label: 'session.started', icon: 'i-material-symbols-play-circle-outline', description: 'Session lifecycle event' },
{ label: 'job.completed', icon: 'i-material-symbols-check-circle-outline', description: 'Job terminal event' },
{ label: 'lease.expiring', icon: 'i-material-symbols-timer-outline', description: 'Lease lifecycle warning' },
{ label: 'trace.emitted', icon: 'i-material-symbols-route-outline', description: 'Observability trace event' },
],
},
]
const multiGroups = [
{
id: 'commands',
label: 'Commands',
items: [
{ label: 'View traces', icon: 'i-material-symbols-route-outline' },
{ label: 'Open logs', icon: 'i-material-symbols-terminal-outline' },
{ label: 'Inspect agent', icon: 'i-material-symbols-manage-search-outline' },
],
},
{
id: 'sessions',
label: 'Sessions',
items: [
{ label: 'sess-001', icon: 'i-material-symbols-account-circle-outline', description: 'inference-worker · active' },
{ label: 'sess-002', icon: 'i-material-symbols-account-circle-outline', description: 'batch-processor · idle' },
],
},
]
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Basic palette with groups">
<div class="w-full max-w-lg rounded-lg border border-(--ui-border) shadow-sm overflow-hidden">
<UCommandPalette
:autofocus="false"
placeholder="Search agents, jobs, runtimes…"
:groups="agentGroups"
/>
</div>
</GallerySection>
<GallerySection title="With highlighted icon per group">
<div class="w-full max-w-lg rounded-lg border border-(--ui-border) shadow-sm overflow-hidden">
<UCommandPalette
:autofocus="false"
placeholder="Search events…"
:groups="agentGroupsWithIcons"
/>
</div>
</GallerySection>
<GallerySection title="Multiple groups">
<div class="w-full max-w-lg rounded-lg border border-(--ui-border) shadow-sm overflow-hidden">
<UCommandPalette
:autofocus="false"
placeholder="Search commands and sessions…"
:groups="multiGroups"
/>
</div>
</GallerySection>
<GallerySection title="Sizes">
<div class="flex flex-col gap-6 w-full max-w-lg">
<div v-for="s in ['sm', 'md', 'lg'] as const" :key="s" class="rounded-lg border border-(--ui-border) shadow-sm overflow-hidden">
<UCommandPalette
:autofocus="false"
:size="s"
:placeholder="`Size ${s} — search jobs…`"
:groups="[{
id: 'jobs',
label: 'Jobs',
items: [
{ label: 'job-alpha', icon: 'i-material-symbols-work-outline', description: 'Running' },
{ label: 'job-beta', icon: 'i-material-symbols-work-history-outline', description: 'Completed' },
]
}]"
/>
</div>
</div>
</GallerySection>
<GallerySection title="Inside a Modal (realistic usage)">
<UModal>
<UButton icon="i-material-symbols-search" variant="outline" color="neutral">
Open command palette
</UButton>
<template #content>
<UCommandPalette
placeholder="Search ARCP resources…"
:groups="agentGroups"
:close="true"
/>
</template>
</UModal>
</GallerySection>
<GallerySection title="Loading state">
<div class="w-full max-w-lg rounded-lg border border-(--ui-border) shadow-sm overflow-hidden">
<UCommandPalette
:autofocus="false"
loading
placeholder="Fetching runtime index…"
:groups="[]"
/>
</div>
</GallerySection>
</div>
</template>