-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckboxGroup.vue
More file actions
148 lines (139 loc) · 4.75 KB
/
Copy pathCheckboxGroup.vue
File metadata and controls
148 lines (139 loc) · 4.75 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
145
146
147
148
<script setup lang="ts">
const colors = ['primary', 'secondary', 'success', 'info', 'warning', 'error', 'neutral'] as const
const sizes = ['xs', 'sm', 'md', 'lg', 'xl'] as const
const eventTypes = [
{ label: 'Job accepted', value: 'job.accepted', description: 'Emitted when a runtime accepts a queued job.' },
{ label: 'Job completed', value: 'job.completed', description: 'Emitted when a job finishes successfully.' },
{ label: 'Session created', value: 'session.created', description: 'Emitted when a new agent session opens.' },
{ label: 'Lease renewed', value: 'lease.renewed', description: 'Emitted when a job lease is extended.' },
]
const capabilityItems = [
{ label: 'Streaming', value: 'streaming' },
{ label: 'Tool calls', value: 'tool_calls' },
{ label: 'Multi-agent', value: 'multi_agent' },
{ label: 'Traces', value: 'traces' },
]
const selectedEvents = ref(['job.accepted', 'session.created'])
const selectedCapabilities = ref(['streaming'])
const selectedColors = ref(['primary'])
const selectedSizes = ref(['md'])
const selectedDisabled = ref(['job.accepted', 'session.created'])
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Variants">
<div class="flex flex-wrap gap-8">
<div v-for="variant in ['list', 'card', 'table']" :key="variant" class="flex flex-col gap-2">
<div class="text-sm text-muted capitalize mb-1">{{ variant }}</div>
<UCheckboxGroup
:variant="variant as any"
:items="capabilityItems"
:default-value="['streaming']"
legend="Runtime capabilities"
color="primary"
/>
</div>
</div>
</GallerySection>
<GallerySection title="Colors">
<div class="flex flex-wrap gap-8">
<UCheckboxGroup
v-for="c in colors"
:key="c"
:color="c"
v-model="selectedColors"
:items="[{ label: c, value: c }]"
class="capitalize"
/>
</div>
</GallerySection>
<GallerySection title="Sizes">
<div class="flex flex-wrap gap-8">
<UCheckboxGroup
v-for="s in sizes"
:key="s"
:size="s"
v-model="selectedSizes"
:items="[{ label: s, value: s }]"
color="primary"
class="capitalize"
/>
</div>
</GallerySection>
<GallerySection title="Orientation">
<div class="flex flex-col gap-4">
<div>
<div class="text-sm text-muted mb-2">Vertical (default)</div>
<UCheckboxGroup
orientation="vertical"
:items="capabilityItems"
:default-value="['streaming', 'traces']"
legend="Agent features"
color="primary"
/>
</div>
<div>
<div class="text-sm text-muted mb-2">Horizontal</div>
<UCheckboxGroup
orientation="horizontal"
:items="capabilityItems"
:default-value="['tool_calls']"
legend="Agent features"
color="primary"
/>
</div>
</div>
</GallerySection>
<GallerySection title="States">
<div class="flex flex-wrap gap-8">
<div>
<div class="text-sm text-muted mb-2">Disabled group</div>
<UCheckboxGroup
disabled
v-model="selectedDisabled"
:items="capabilityItems"
legend="Runtime capabilities"
color="primary"
/>
</div>
<div>
<div class="text-sm text-muted mb-2">Required</div>
<UCheckboxGroup
required
:items="capabilityItems"
:default-value="['streaming']"
legend="Runtime capabilities"
color="primary"
/>
</div>
<div>
<div class="text-sm text-muted mb-2">Item disabled</div>
<UCheckboxGroup
:items="[
{ label: 'Streaming', value: 'streaming' },
{ label: 'Tool calls', value: 'tool_calls', disabled: true },
{ label: 'Multi-agent', value: 'multi_agent' },
]"
:default-value="['streaming']"
legend="Runtime capabilities"
color="primary"
/>
</div>
</div>
</GallerySection>
<GallerySection title="Realistic usage — Event subscriptions">
<UCheckboxGroup
v-model="selectedEvents"
:items="eventTypes"
legend="Subscribe to runtime events"
color="primary"
variant="card"
icon="i-material-symbols-notifications-outline"
class="w-full max-w-sm"
/>
<div v-if="selectedEvents.length" class="mt-3 text-sm text-muted">
Subscribed: {{ selectedEvents.join(', ') }}
</div>
</GallerySection>
</div>
</template>