-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectMenu.vue
More file actions
139 lines (127 loc) · 4.36 KB
/
Copy pathSelectMenu.vue
File metadata and controls
139 lines (127 loc) · 4.36 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
<script setup lang="ts">
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const
const variants = ['outline', 'soft', 'subtle', 'ghost', 'none'] as const
const colors = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'neutral'] as const
const runtimeItems = [
{ label: 'prod-runtime-01', description: 'us-east-1 · healthy', icon: 'i-material-symbols-cloud-outline' },
{ label: 'prod-runtime-02', description: 'us-west-2 · healthy', icon: 'i-material-symbols-cloud-outline' },
{ label: 'staging-runtime', description: 'eu-central-1 · degraded', icon: 'i-material-symbols-cloud-alert-outline' },
{ label: 'dev-runtime', description: 'local · idle', icon: 'i-material-symbols-computer-outline' },
]
const agentItems = [
{ label: 'orchestrator-agent', icon: 'i-material-symbols-hub-outline' },
{ label: 'worker-agent-01', icon: 'i-material-symbols-smart-toy-outline' },
{ label: 'worker-agent-02', icon: 'i-material-symbols-smart-toy-outline' },
{ label: 'monitor-agent', icon: 'i-material-symbols-monitor-heart-outline' },
{ label: 'trace-collector', icon: 'i-material-symbols-timeline-outline' },
]
const statusItems = [
{ label: 'Pending', icon: 'i-material-symbols-schedule-outline', color: 'neutral' },
{ label: 'Running', icon: 'i-material-symbols-play-circle-outline', color: 'info' },
{ label: 'Succeeded', icon: 'i-material-symbols-check-circle-outline', color: 'success' },
{ label: 'Failed', icon: 'i-material-symbols-cancel-outline', color: 'error' },
{ label: 'Cancelled', icon: 'i-material-symbols-do-not-disturb-on-outline', color: 'warning' },
]
const singleValue = ref(runtimeItems[0])
const multiValue = ref([agentItems[0], agentItems[2]])
const statusValue = ref(null)
const sizeValues = ref<Record<string, any>>({})
const colorValues = ref<Record<string, any>>({})
const variantValues = ref<Record<string, any>>({})
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Single selection">
<USelectMenu
v-model="singleValue"
:items="runtimeItems"
placeholder="Select a runtime…"
class="w-72"
/>
</GallerySection>
<GallerySection title="Multiple selection">
<USelectMenu
v-model="multiValue"
:items="agentItems"
multiple
placeholder="Select agents…"
class="w-72"
/>
</GallerySection>
<GallerySection title="Colors">
<div class="flex flex-wrap gap-3">
<USelectMenu
v-for="c in colors"
:key="c"
v-model="colorValues[c]"
:items="statusItems"
:color="c"
:placeholder="c"
class="w-40"
/>
</div>
</GallerySection>
<GallerySection title="Variants">
<div class="flex flex-wrap gap-3">
<USelectMenu
v-for="v in variants"
:key="v"
v-model="variantValues[v]"
:items="statusItems"
:variant="v"
:placeholder="v"
class="w-40"
/>
</div>
</GallerySection>
<GallerySection title="Sizes">
<div class="flex flex-wrap items-center gap-3">
<USelectMenu
v-for="s in sizes"
:key="s"
v-model="sizeValues[s]"
:items="agentItems"
:size="s"
:placeholder="s"
class="w-40"
/>
</div>
</GallerySection>
<GallerySection title="States">
<USelectMenu
:items="runtimeItems"
placeholder="Select a runtime…"
class="w-60"
disabled
/>
<USelectMenu
:items="runtimeItems"
placeholder="Required"
class="w-60"
required
highlight
/>
</GallerySection>
<GallerySection title="With icons & search">
<USelectMenu
v-model="statusValue"
:items="statusItems"
placeholder="Filter by job status…"
icon="i-material-symbols-filter-list"
class="w-72"
:clear="true"
/>
</GallerySection>
<GallerySection title="With descriptions (realistic)">
<USelectMenu
v-model="singleValue"
:items="runtimeItems"
placeholder="Choose runtime target…"
trailing-icon="i-material-symbols-expand-more"
selected-icon="i-material-symbols-check"
class="w-80"
:search-input="{ placeholder: 'Search runtimes…' }"
/>
</GallerySection>
</div>
</template>