/
index.vue
264 lines (249 loc) · 7.44 KB
/
index.vue
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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
<script setup lang="ts">
import { version } from '../../package.json'
const showDialog = ref(false)
const showDropdown = ref(false)
const radio = ref('a')
</script>
<template>
<div class="relative p-10 n-bg-base">
<div class="mx-auto w-full flex flex-col gap-4 container">
<NTip n="hover:yellow-600 dark:hover:yellow-500">
This library is heavily working in progress. Breaking changes may not follow semver. Pin the version if used.
</NTip>
<div class="flex items-center gap-2">
<div class="text-4xl">
@nuxt/devtools-ui-kit
</div>
<sup class="text-xl">
<code>v{{ version }}</code>
</sup>
</div>
<div class="mb-5 flex gap-1">
<NButton
n="sm"
to="https://github.com/nuxt/devtools/tree/main/packages/devtools-ui-kit"
target="_blank"
icon="i-carbon-logo-github"
>
GitHub
</NButton>
<NDarkToggle>
<template #default="{ isDark }">
<NSwitch v-model="isDark.value" n="indigo">
{{ isDark.value ? "Dark" : "Light" }}
</NSwitch>
</template>
</NDarkToggle>
</div>
<NCard class="p4">
<div class="n-header-upper">
Buttons
</div>
<div id="buttons" class="flex flex-wrap items-center gap-3">
<NButton n="yellow6 dark:yellow5 xs">
XS Yellow
</NButton>
<NButton n="orange6 dark:orange5 sm dashed">
S Orange Dashed
</NButton>
<NButton n="red6 dark:red5 solid" icon="carbon:at">
Red Solid
</NButton>
<NButton disabled>
Disabled
</NButton>
<NButton n="purple6 dark:purple5 xl">
XL Purple
</NButton>
</div>
<ShowSource src="/playground/pages/index.vue#L44-L58" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Checkboxes
</div>
<div class="flex items-center gap-3">
<NCheckbox n="sky6 dark:sky5 sm" :model-value="true">
Small
</NCheckbox>
<NCheckbox n="red6 dark:red5" :model-value="false">
Normal
</NCheckbox>
<NCheckbox n="purple6 dark:purple5 xl" :model-value="true" disabled>
XL Disabled
</NCheckbox>
</div>
<ShowSource src="/playground/pages/index.vue#L68-L76" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Links
</div>
<form class="flex items-center gap-3">
<NLink to="/" n="green">
NuxtLink
</NLink>
<NLink href="https://nuxt.com">
nuxt.com
</NLink>
</form>
<ShowSource src="/playground/pages/index.vue#L86-L91" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Radios
</div>
<form class="flex items-center gap-3">
<NRadio v-model="radio" n="red6 dark:red5" name="name" value="a">
Apple
</NRadio>
<NRadio
v-model="radio"
n="yellow6 dark:yellow5"
name="name"
value="b"
>
Banana
</NRadio>
<NRadio
v-model="radio"
n="orange6 dark:orange5"
name="name"
value="c"
>
Orange
</NRadio>
</form>
<ShowSource src="/playground/pages/index.vue#L101-L119" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Switches
</div>
<div class="flex items-center gap-3">
<NSwitch n="lime6 dark:lime5 sm" :model-value="true">
SM
</NSwitch>
<NSwitch n="red6 dark:red5" :model-value="false">
Normal
</NSwitch>
<NSwitch :model-value="true" disabled>
Disabled
</NSwitch>
<NSwitch n="purple6 dark:purple5 xl" :model-value="false">
XL
</NSwitch>
</div>
<ShowSource src="/playground/pages/index.vue#L129-L140" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Tips
</div>
<div class="flex flex-col gap-2">
<NTip n="lime6 dark:lime5" icon="carbon:checkmark-outline">
Success!
</NTip>
<NTip n="yellow6 dark:yellow5" icon="carbon:warning">
Warning!
</NTip>
<NTip n="red6 dark:red5" icon="carbon:warning-alt">
Error!
</NTip>
</div>
<ShowSource src="/playground/pages/index.vue#L150-L158" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Dropdown
</div>
<div class="flex flex-col gap-2">
<NDropdown v-model="showDropdown" n="lime6 dark:lime5">
<template #trigger>
<NButton @click="showDropdown = !showDropdown">
Dropdown ({{ showDropdown }})
</NButton>
</template>
<div class="flex flex-col gap-2 p-3">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
</div>
</NDropdown>
</div>
<ShowSource src="/playground/pages/index.vue#L168-L180" />
</NCard>
<NCard class="p4">
<form>
<div class="n-header-upper">
TextInput
</div>
<div class="flex flex-col gap-2">
<NTextInput
n="lime6 dark:lime5"
icon="carbon:checkmark-outline"
placeholder="Hi!"
/>
<NTextInput
n="pink6 dark:pink5"
icon="carbon:user"
placeholder="Your name..."
/>
<NTextInput
n="pink6 dark:pink5"
icon="carbon-character-whole-number"
placeholder="Your age..."
type="number"
/>
<NTextInput
n="lime6 dark:lime5"
icon="carbon:password"
type="password"
placeholder="Your password..."
required
/>
<NButton class="self-start">
Submit
</NButton>
</div>
</form>
<ShowSource src="/playground/pages/index.vue#L190-L205" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Dialog
</div>
<div class="flex flex-col gap-2">
<NButton n="lime6 dark:lime5" @click="showDialog = !showDialog">
Show Dialog
</NButton>
<NDialog
v-model="showDialog"
class="min-w-100 flex flex-col gap-4 p4"
>
<h1 text-4xl>
Hi
</h1>
<NTextInput n="lime6 dark:lime5" placeholder="Say something..." />
<div>
<NButton @click="showDialog = false">
Close
</NButton>
</div>
</NDialog>
</div>
<ShowSource src="/playground/pages/index.vue#L215-L231" />
</NCard>
<NCard class="p4">
<div class="n-header-upper">
Loading
</div>
<div class="flex flex-col gap-2">
<NLoading />
</div>
<ShowSource src="/playground/pages/index.vue#L246" />
</NCard>
</div>
</div>
</template>