-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckbox.vue
More file actions
180 lines (169 loc) · 5.07 KB
/
Copy pathCheckbox.vue
File metadata and controls
180 lines (169 loc) · 5.07 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<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 checkedColors = ref(
Object.fromEntries(colors.map(c => [c, true]))
) as Ref<Record<string, boolean>>
const checkedSizes = ref(
Object.fromEntries(sizes.map(s => [s, true]))
) as Ref<Record<string, boolean>>
const listChecked = ref(false)
const cardChecked = ref(true)
const indeterminate = ref<boolean | 'indeterminate'>('indeterminate')
const highlighted = ref(true)
const disabled = ref(false)
const required = ref(false)
const jobOptions = ref([
{ id: 'traces', label: 'Emit traces', description: 'Stream span events to the collector.', checked: true },
{ id: 'metrics', label: 'Publish metrics', description: 'Report runtime telemetry every 30 s.', checked: true },
{ id: 'heartbeat', label: 'Send heartbeat', description: 'Renew lease on each agent tick.', checked: false },
{ id: 'debug', label: 'Verbose debug logs', description: 'Include internal runtime frames.', checked: false },
])
</script>
<template>
<div class="flex flex-col gap-8">
<GallerySection title="Colors">
<div class="flex flex-wrap gap-4">
<UCheckbox
v-for="c in colors"
:key="c"
v-model="checkedColors[c]"
:color="c"
:label="c"
class="capitalize"
/>
</div>
</GallerySection>
<GallerySection title="Sizes">
<div class="flex flex-wrap items-center gap-4">
<UCheckbox
v-for="s in sizes"
:key="s"
v-model="checkedSizes[s]"
:size="s"
:label="s"
class="capitalize"
/>
</div>
</GallerySection>
<GallerySection title="Variants">
<div class="flex flex-wrap gap-6">
<UCheckbox
v-model="listChecked"
variant="list"
label="List variant"
description="Default inline style."
color="primary"
/>
<UCheckbox
v-model="cardChecked"
variant="card"
label="Card variant"
description="Bordered card when checked."
color="primary"
/>
</div>
</GallerySection>
<GallerySection title="States">
<div class="flex flex-wrap gap-6">
<UCheckbox
v-model="indeterminate"
label="Indeterminate"
description="Partial job selection."
color="warning"
icon="i-material-symbols-indeterminate-check-box-outline"
/>
<UCheckbox
v-model="highlighted"
:highlight="true"
label="Highlighted"
description="Focus ring always visible."
color="info"
/>
<UCheckbox
:model-value="false"
disabled
label="Disabled"
description="Agent is locked."
color="neutral"
/>
<UCheckbox
:model-value="true"
disabled
label="Disabled (checked)"
description="Session already committed."
color="neutral"
/>
<UCheckbox
:model-value="false"
required
label="Required"
description="Must accept runtime terms."
color="error"
/>
</div>
</GallerySection>
<GallerySection title="Indicator position">
<div class="flex flex-wrap gap-6">
<UCheckbox
:model-value="true"
indicator="start"
label="Start"
description="Checkbox leads the label."
color="primary"
/>
<UCheckbox
:model-value="true"
indicator="end"
label="End"
description="Checkbox trails the label."
color="secondary"
/>
<UCheckbox
:model-value="true"
indicator="hidden"
label="Hidden (card-only)"
description="Indicator hidden; use with card variant."
variant="card"
color="success"
/>
</div>
</GallerySection>
<GallerySection title="Custom icon">
<div class="flex flex-wrap gap-6">
<UCheckbox
:model-value="true"
icon="i-material-symbols-check-circle-outline"
label="Job completed"
color="success"
/>
<UCheckbox
:model-value="true"
icon="i-material-symbols-bolt"
label="Fast-path enabled"
color="warning"
/>
<UCheckbox
:model-value="true"
icon="i-material-symbols-lock-outline"
label="Lease locked"
color="error"
/>
</div>
</GallerySection>
<GallerySection title="Realistic — Job runtime options">
<div class="flex w-full max-w-sm flex-col gap-3">
<UCheckbox
v-for="opt in jobOptions"
:key="opt.id"
v-model="opt.checked"
variant="card"
color="primary"
:label="opt.label"
:description="opt.description"
icon="i-material-symbols-settings-outline"
/>
</div>
</GallerySection>
</div>
</template>