@nuxt/ui 3.0.0-alpha.10 → 3.0.0-alpha.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nuxt/ui/alert.ts +75 -58
- package/.nuxt/ui/avatar-group.ts +13 -1
- package/.nuxt/ui/avatar.ts +13 -1
- package/.nuxt/ui/badge.ts +102 -65
- package/.nuxt/ui/button-group.ts +13 -0
- package/.nuxt/ui/button.ts +124 -92
- package/.nuxt/ui/calendar.ts +20 -2
- package/.nuxt/ui/carousel.ts +5 -3
- package/.nuxt/ui/checkbox.ts +27 -9
- package/.nuxt/ui/chip.ts +36 -7
- package/.nuxt/ui/color-picker.ts +9 -1
- package/.nuxt/ui/context-menu.ts +32 -14
- package/.nuxt/ui/drawer.ts +11 -4
- package/.nuxt/ui/dropdown-menu.ts +32 -14
- package/.nuxt/ui/form-field.ts +9 -1
- package/.nuxt/ui/input-menu.ts +110 -75
- package/.nuxt/ui/input-number.ts +82 -51
- package/.nuxt/ui/input.ts +88 -53
- package/.nuxt/ui/kbd.ts +14 -2
- package/.nuxt/ui/navigation-menu.ts +114 -68
- package/.nuxt/ui/pin-input.ts +57 -31
- package/.nuxt/ui/popover.ts +1 -1
- package/.nuxt/ui/progress.ts +93 -54
- package/.nuxt/ui/radio-group.ts +25 -2
- package/.nuxt/ui/select-menu.ts +89 -54
- package/.nuxt/ui/select.ts +89 -54
- package/.nuxt/ui/separator.ts +52 -23
- package/.nuxt/ui/slideover.ts +11 -4
- package/.nuxt/ui/slider.ts +45 -22
- package/.nuxt/ui/stepper.ts +45 -23
- package/.nuxt/ui/switch.ts +20 -2
- package/.nuxt/ui/table.ts +30 -13
- package/.nuxt/ui/tabs.ts +67 -39
- package/.nuxt/ui/textarea.ts +88 -53
- package/.nuxt/ui/toast.ts +11 -1
- package/.nuxt/ui/toaster.ts +27 -11
- package/.nuxt/ui/tooltip.ts +1 -1
- package/README.md +8 -1
- package/cli/commands/make/component.mjs +12 -0
- package/cli/package.json +2 -2
- package/cli/templates.mjs +17 -12
- package/dist/client/devtools/200.html +1 -1
- package/dist/client/devtools/404.html +1 -1
- package/dist/client/devtools/_nuxt/CQ-XZFu7.js +54 -0
- package/dist/client/devtools/_nuxt/DNZFyo26.js +1 -0
- package/dist/client/devtools/_nuxt/Dtz-o9GB.js +1 -0
- package/dist/client/devtools/_nuxt/builds/latest.json +1 -1
- package/dist/client/devtools/_nuxt/builds/meta/1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b.json +1 -0
- package/dist/client/devtools/_nuxt/entry.qOdop8tq.css +1 -0
- package/dist/client/devtools/_nuxt/error-404.D-rS9BDk.css +1 -0
- package/dist/client/devtools/_nuxt/error-500.CfcCHs91.css +1 -0
- package/dist/client/devtools/index.html +1 -1
- package/dist/module.cjs +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/components/Accordion.vue +2 -1
- package/dist/runtime/components/Alert.vue +3 -2
- package/dist/runtime/components/Avatar.vue +5 -4
- package/dist/runtime/components/AvatarGroup.vue +2 -1
- package/dist/runtime/components/Badge.vue +2 -1
- package/dist/runtime/components/Breadcrumb.vue +1 -1
- package/dist/runtime/components/Button.vue +2 -1
- package/dist/runtime/components/ButtonGroup.vue +2 -1
- package/dist/runtime/components/Calendar.vue +2 -1
- package/dist/runtime/components/Card.vue +1 -1
- package/dist/runtime/components/Carousel.vue +2 -1
- package/dist/runtime/components/Checkbox.vue +2 -1
- package/dist/runtime/components/Chip.vue +3 -2
- package/dist/runtime/components/Collapsible.vue +4 -2
- package/dist/runtime/components/ColorPicker.vue +2 -1
- package/dist/runtime/components/CommandPalette.vue +12 -5
- package/dist/runtime/components/Container.vue +1 -1
- package/dist/runtime/components/ContextMenu.vue +2 -1
- package/dist/runtime/components/ContextMenuContent.vue +3 -3
- package/dist/runtime/components/Drawer.vue +7 -2
- package/dist/runtime/components/DropdownMenu.vue +2 -1
- package/dist/runtime/components/DropdownMenuContent.vue +3 -3
- package/dist/runtime/components/Form.vue +15 -14
- package/dist/runtime/components/FormField.vue +2 -1
- package/dist/runtime/components/Input.vue +3 -2
- package/dist/runtime/components/InputMenu.vue +13 -2
- package/dist/runtime/components/InputNumber.vue +2 -1
- package/dist/runtime/components/Kbd.vue +2 -1
- package/dist/runtime/components/Link.vue +1 -1
- package/dist/runtime/components/Modal.vue +8 -13
- package/dist/runtime/components/NavigationMenu.vue +14 -9
- package/dist/runtime/components/Pagination.vue +1 -1
- package/dist/runtime/components/PinInput.vue +4 -3
- package/dist/runtime/components/Popover.vue +7 -6
- package/dist/runtime/components/Progress.vue +4 -3
- package/dist/runtime/components/RadioGroup.vue +2 -1
- package/dist/runtime/components/Select.vue +3 -2
- package/dist/runtime/components/SelectMenu.vue +20 -4
- package/dist/runtime/components/Separator.vue +2 -1
- package/dist/runtime/components/Skeleton.vue +1 -1
- package/dist/runtime/components/Slideover.vue +8 -12
- package/dist/runtime/components/Slider.vue +2 -1
- package/dist/runtime/components/Stepper.vue +6 -4
- package/dist/runtime/components/Switch.vue +2 -1
- package/dist/runtime/components/Table.vue +2 -1
- package/dist/runtime/components/Tabs.vue +3 -1
- package/dist/runtime/components/Textarea.vue +3 -2
- package/dist/runtime/components/Toast.vue +2 -1
- package/dist/runtime/components/Toaster.vue +2 -1
- package/dist/runtime/components/Tooltip.vue +1 -1
- package/dist/runtime/composables/defineShortcuts.js +1 -1
- package/dist/runtime/composables/useFormField.d.ts +1 -1
- package/dist/runtime/composables/useFormField.js +6 -3
- package/dist/runtime/locale/ar.js +3 -1
- package/dist/runtime/locale/cs.js +3 -1
- package/dist/runtime/locale/da.d.ts +2 -0
- package/dist/runtime/locale/da.js +54 -0
- package/dist/runtime/locale/de.js +3 -1
- package/dist/runtime/locale/el.d.ts +2 -0
- package/dist/runtime/locale/el.js +54 -0
- package/dist/runtime/locale/en.js +3 -1
- package/dist/runtime/locale/es.js +3 -1
- package/dist/runtime/locale/et.d.ts +2 -0
- package/dist/runtime/locale/et.js +54 -0
- package/dist/runtime/locale/fa_ir.js +3 -1
- package/dist/runtime/locale/fi.d.ts +2 -0
- package/dist/runtime/locale/fi.js +54 -0
- package/dist/runtime/locale/fr.js +3 -1
- package/dist/runtime/locale/id.d.ts +2 -0
- package/dist/runtime/locale/id.js +54 -0
- package/dist/runtime/locale/index.d.ts +9 -0
- package/dist/runtime/locale/index.js +9 -0
- package/dist/runtime/locale/it.js +3 -1
- package/dist/runtime/locale/ja.js +3 -1
- package/dist/runtime/locale/ko.js +3 -1
- package/dist/runtime/locale/nl.js +3 -1
- package/dist/runtime/locale/pl.js +3 -1
- package/dist/runtime/locale/pt.js +3 -1
- package/dist/runtime/locale/pt_br.js +3 -1
- package/dist/runtime/locale/ru.js +3 -1
- package/dist/runtime/locale/sk.js +3 -1
- package/dist/runtime/locale/sv.d.ts +2 -0
- package/dist/runtime/locale/sv.js +54 -0
- package/dist/runtime/locale/th.d.ts +2 -0
- package/dist/runtime/locale/th.js +54 -0
- package/dist/runtime/locale/tr.js +3 -1
- package/dist/runtime/locale/uk.d.ts +2 -0
- package/dist/runtime/locale/uk.js +54 -0
- package/dist/runtime/locale/vi.d.ts +2 -0
- package/dist/runtime/locale/vi.js +54 -0
- package/dist/runtime/locale/zh_hans.js +3 -1
- package/dist/runtime/locale/zh_hant.js +11 -9
- package/dist/runtime/types/form.d.ts +2 -2
- package/dist/runtime/types/form.js +2 -2
- package/dist/runtime/types/locale.d.ts +2 -0
- package/dist/runtime/utils/form.d.ts +2 -2
- package/dist/runtime/utils/form.js +3 -3
- package/dist/runtime/utils/tv.d.ts +1 -0
- package/dist/runtime/utils/tv.js +4 -0
- package/dist/runtime/vue/components/Icon.vue +2 -2
- package/dist/runtime/vue/plugins/head.d.ts +1 -1
- package/dist/runtime/vue/plugins/head.js +3 -3
- package/dist/shared/{ui.D_93iuwH.mjs → ui.BKsd22-Q.mjs} +63 -36
- package/dist/shared/{ui.CwmIkD_Y.cjs → ui.DCjJwb6l.cjs} +63 -36
- package/dist/unplugin.cjs +5 -5
- package/dist/unplugin.mjs +5 -5
- package/dist/vite.cjs +1 -1
- package/dist/vite.mjs +1 -1
- package/package.json +49 -44
- package/dist/client/devtools/_nuxt/B1fTd_Rf.js +0 -1
- package/dist/client/devtools/_nuxt/CSUxkedg.js +0 -1
- package/dist/client/devtools/_nuxt/CbRTGpb7.js +0 -1
- package/dist/client/devtools/_nuxt/YQTlxbcT.js +0 -53
- package/dist/client/devtools/_nuxt/builds/meta/b3465abc-0a92-4ee7-ba6b-e5174891fcc0.json +0 -1
- package/dist/client/devtools/_nuxt/entry.DXXceQev.css +0 -1
- package/dist/client/devtools/_nuxt/error-404.BJpkZFyY.css +0 -1
- package/dist/client/devtools/_nuxt/error-500.D3i9VDlt.css +0 -1
package/.nuxt/ui/textarea.ts
CHANGED
|
@@ -1,3 +1,38 @@
|
|
|
1
|
+
const buttonGroup = [
|
|
2
|
+
"horizontal",
|
|
3
|
+
"vertical"
|
|
4
|
+
] as const
|
|
5
|
+
|
|
6
|
+
const size = [
|
|
7
|
+
"xs",
|
|
8
|
+
"sm",
|
|
9
|
+
"md",
|
|
10
|
+
"lg",
|
|
11
|
+
"xl"
|
|
12
|
+
] as const
|
|
13
|
+
|
|
14
|
+
const variant = [
|
|
15
|
+
"outline",
|
|
16
|
+
"soft",
|
|
17
|
+
"subtle",
|
|
18
|
+
"ghost",
|
|
19
|
+
"none"
|
|
20
|
+
] as const
|
|
21
|
+
|
|
22
|
+
const color = [
|
|
23
|
+
"primary",
|
|
24
|
+
"secondary",
|
|
25
|
+
"success",
|
|
26
|
+
"info",
|
|
27
|
+
"warning",
|
|
28
|
+
"error",
|
|
29
|
+
"neutral"
|
|
30
|
+
] as const
|
|
31
|
+
|
|
32
|
+
const type = [
|
|
33
|
+
"file"
|
|
34
|
+
] as const
|
|
35
|
+
|
|
1
36
|
export default {
|
|
2
37
|
"slots": {
|
|
3
38
|
"root": "relative inline-flex items-center",
|
|
@@ -5,11 +40,11 @@ export default {
|
|
|
5
40
|
"w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75",
|
|
6
41
|
"transition-colors"
|
|
7
42
|
],
|
|
8
|
-
"leading": "absolute inset-y-0 start-0 flex items-center"
|
|
43
|
+
"leading": "absolute inset-y-0 start-0 flex items-center",
|
|
9
44
|
"leadingIcon": "shrink-0 text-[var(--ui-text-dimmed)]",
|
|
10
45
|
"leadingAvatar": "shrink-0",
|
|
11
46
|
"leadingAvatarSize": "",
|
|
12
|
-
"trailing": "absolute inset-y-0 end-0 flex items-center"
|
|
47
|
+
"trailing": "absolute inset-y-0 end-0 flex items-center",
|
|
13
48
|
"trailingIcon": "shrink-0 text-[var(--ui-text-dimmed)]"
|
|
14
49
|
},
|
|
15
50
|
"variants": {
|
|
@@ -26,40 +61,40 @@ export default {
|
|
|
26
61
|
"size": {
|
|
27
62
|
"xs": {
|
|
28
63
|
"base": "px-2 py-1 text-xs gap-1",
|
|
29
|
-
"leading": "ps-2"
|
|
30
|
-
"trailing": "pe-2"
|
|
64
|
+
"leading": "ps-2",
|
|
65
|
+
"trailing": "pe-2",
|
|
31
66
|
"leadingIcon": "size-4",
|
|
32
67
|
"leadingAvatarSize": "3xs",
|
|
33
68
|
"trailingIcon": "size-4"
|
|
34
69
|
},
|
|
35
70
|
"sm": {
|
|
36
71
|
"base": "px-2.5 py-1.5 text-xs gap-1.5",
|
|
37
|
-
"leading": "ps-2.5"
|
|
38
|
-
"trailing": "pe-2.5"
|
|
72
|
+
"leading": "ps-2.5",
|
|
73
|
+
"trailing": "pe-2.5",
|
|
39
74
|
"leadingIcon": "size-4",
|
|
40
75
|
"leadingAvatarSize": "3xs",
|
|
41
76
|
"trailingIcon": "size-4"
|
|
42
77
|
},
|
|
43
78
|
"md": {
|
|
44
79
|
"base": "px-2.5 py-1.5 text-sm gap-1.5",
|
|
45
|
-
"leading": "ps-2.5"
|
|
46
|
-
"trailing": "pe-2.5"
|
|
80
|
+
"leading": "ps-2.5",
|
|
81
|
+
"trailing": "pe-2.5",
|
|
47
82
|
"leadingIcon": "size-5",
|
|
48
83
|
"leadingAvatarSize": "2xs",
|
|
49
84
|
"trailingIcon": "size-5"
|
|
50
85
|
},
|
|
51
86
|
"lg": {
|
|
52
87
|
"base": "px-3 py-2 text-sm gap-2",
|
|
53
|
-
"leading": "ps-3"
|
|
54
|
-
"trailing": "pe-3"
|
|
88
|
+
"leading": "ps-3",
|
|
89
|
+
"trailing": "pe-3",
|
|
55
90
|
"leadingIcon": "size-5",
|
|
56
91
|
"leadingAvatarSize": "2xs",
|
|
57
92
|
"trailingIcon": "size-5"
|
|
58
93
|
},
|
|
59
94
|
"xl": {
|
|
60
95
|
"base": "px-3 py-2 text-base gap-2",
|
|
61
|
-
"leading": "ps-3"
|
|
62
|
-
"trailing": "pe-3"
|
|
96
|
+
"leading": "ps-3",
|
|
97
|
+
"trailing": "pe-3",
|
|
63
98
|
"leadingIcon": "size-6",
|
|
64
99
|
"leadingAvatarSize": "xs",
|
|
65
100
|
"trailingIcon": "size-6"
|
|
@@ -99,144 +134,144 @@ export default {
|
|
|
99
134
|
},
|
|
100
135
|
"compoundVariants": [
|
|
101
136
|
{
|
|
102
|
-
"color": "primary" as
|
|
137
|
+
"color": "primary" as typeof color[number],
|
|
103
138
|
"variant": [
|
|
104
|
-
"outline" as
|
|
105
|
-
"subtle" as
|
|
139
|
+
"outline" as typeof variant[number],
|
|
140
|
+
"subtle" as typeof variant[number]
|
|
106
141
|
],
|
|
107
142
|
"class": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-primary)]"
|
|
108
143
|
},
|
|
109
144
|
{
|
|
110
|
-
"color": "secondary" as
|
|
145
|
+
"color": "secondary" as typeof color[number],
|
|
111
146
|
"variant": [
|
|
112
|
-
"outline" as
|
|
113
|
-
"subtle" as
|
|
147
|
+
"outline" as typeof variant[number],
|
|
148
|
+
"subtle" as typeof variant[number]
|
|
114
149
|
],
|
|
115
150
|
"class": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-secondary)]"
|
|
116
151
|
},
|
|
117
152
|
{
|
|
118
|
-
"color": "success" as
|
|
153
|
+
"color": "success" as typeof color[number],
|
|
119
154
|
"variant": [
|
|
120
|
-
"outline" as
|
|
121
|
-
"subtle" as
|
|
155
|
+
"outline" as typeof variant[number],
|
|
156
|
+
"subtle" as typeof variant[number]
|
|
122
157
|
],
|
|
123
158
|
"class": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-success)]"
|
|
124
159
|
},
|
|
125
160
|
{
|
|
126
|
-
"color": "info" as
|
|
161
|
+
"color": "info" as typeof color[number],
|
|
127
162
|
"variant": [
|
|
128
|
-
"outline" as
|
|
129
|
-
"subtle" as
|
|
163
|
+
"outline" as typeof variant[number],
|
|
164
|
+
"subtle" as typeof variant[number]
|
|
130
165
|
],
|
|
131
166
|
"class": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-info)]"
|
|
132
167
|
},
|
|
133
168
|
{
|
|
134
|
-
"color": "warning" as
|
|
169
|
+
"color": "warning" as typeof color[number],
|
|
135
170
|
"variant": [
|
|
136
|
-
"outline" as
|
|
137
|
-
"subtle" as
|
|
171
|
+
"outline" as typeof variant[number],
|
|
172
|
+
"subtle" as typeof variant[number]
|
|
138
173
|
],
|
|
139
174
|
"class": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-warning)]"
|
|
140
175
|
},
|
|
141
176
|
{
|
|
142
|
-
"color": "error" as
|
|
177
|
+
"color": "error" as typeof color[number],
|
|
143
178
|
"variant": [
|
|
144
|
-
"outline" as
|
|
145
|
-
"subtle" as
|
|
179
|
+
"outline" as typeof variant[number],
|
|
180
|
+
"subtle" as typeof variant[number]
|
|
146
181
|
],
|
|
147
182
|
"class": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-error)]"
|
|
148
183
|
},
|
|
149
184
|
{
|
|
150
|
-
"color": "primary" as
|
|
185
|
+
"color": "primary" as typeof color[number],
|
|
151
186
|
"highlight": true,
|
|
152
187
|
"class": "ring ring-inset ring-[var(--ui-primary)]"
|
|
153
188
|
},
|
|
154
189
|
{
|
|
155
|
-
"color": "secondary" as
|
|
190
|
+
"color": "secondary" as typeof color[number],
|
|
156
191
|
"highlight": true,
|
|
157
192
|
"class": "ring ring-inset ring-[var(--ui-secondary)]"
|
|
158
193
|
},
|
|
159
194
|
{
|
|
160
|
-
"color": "success" as
|
|
195
|
+
"color": "success" as typeof color[number],
|
|
161
196
|
"highlight": true,
|
|
162
197
|
"class": "ring ring-inset ring-[var(--ui-success)]"
|
|
163
198
|
},
|
|
164
199
|
{
|
|
165
|
-
"color": "info" as
|
|
200
|
+
"color": "info" as typeof color[number],
|
|
166
201
|
"highlight": true,
|
|
167
202
|
"class": "ring ring-inset ring-[var(--ui-info)]"
|
|
168
203
|
},
|
|
169
204
|
{
|
|
170
|
-
"color": "warning" as
|
|
205
|
+
"color": "warning" as typeof color[number],
|
|
171
206
|
"highlight": true,
|
|
172
207
|
"class": "ring ring-inset ring-[var(--ui-warning)]"
|
|
173
208
|
},
|
|
174
209
|
{
|
|
175
|
-
"color": "error" as
|
|
210
|
+
"color": "error" as typeof color[number],
|
|
176
211
|
"highlight": true,
|
|
177
212
|
"class": "ring ring-inset ring-[var(--ui-error)]"
|
|
178
213
|
},
|
|
179
214
|
{
|
|
180
|
-
"color": "neutral" as
|
|
215
|
+
"color": "neutral" as typeof color[number],
|
|
181
216
|
"variant": [
|
|
182
|
-
"outline" as
|
|
183
|
-
"subtle" as
|
|
217
|
+
"outline" as typeof variant[number],
|
|
218
|
+
"subtle" as typeof variant[number]
|
|
184
219
|
],
|
|
185
220
|
"class": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]"
|
|
186
221
|
},
|
|
187
222
|
{
|
|
188
|
-
"color": "neutral" as
|
|
223
|
+
"color": "neutral" as typeof color[number],
|
|
189
224
|
"highlight": true,
|
|
190
225
|
"class": "ring ring-inset ring-[var(--ui-border-inverted)]"
|
|
191
226
|
},
|
|
192
227
|
{
|
|
193
228
|
"leading": true,
|
|
194
|
-
"size": "xs" as
|
|
229
|
+
"size": "xs" as typeof size[number],
|
|
195
230
|
"class": "ps-7"
|
|
196
231
|
},
|
|
197
232
|
{
|
|
198
233
|
"leading": true,
|
|
199
|
-
"size": "sm" as
|
|
234
|
+
"size": "sm" as typeof size[number],
|
|
200
235
|
"class": "ps-8"
|
|
201
236
|
},
|
|
202
237
|
{
|
|
203
238
|
"leading": true,
|
|
204
|
-
"size": "md" as
|
|
239
|
+
"size": "md" as typeof size[number],
|
|
205
240
|
"class": "ps-9"
|
|
206
241
|
},
|
|
207
242
|
{
|
|
208
243
|
"leading": true,
|
|
209
|
-
"size": "lg" as
|
|
244
|
+
"size": "lg" as typeof size[number],
|
|
210
245
|
"class": "ps-10"
|
|
211
246
|
},
|
|
212
247
|
{
|
|
213
248
|
"leading": true,
|
|
214
|
-
"size": "xl" as
|
|
249
|
+
"size": "xl" as typeof size[number],
|
|
215
250
|
"class": "ps-11"
|
|
216
251
|
},
|
|
217
252
|
{
|
|
218
253
|
"trailing": true,
|
|
219
|
-
"size": "xs" as
|
|
254
|
+
"size": "xs" as typeof size[number],
|
|
220
255
|
"class": "pe-7"
|
|
221
256
|
},
|
|
222
257
|
{
|
|
223
258
|
"trailing": true,
|
|
224
|
-
"size": "sm" as
|
|
259
|
+
"size": "sm" as typeof size[number],
|
|
225
260
|
"class": "pe-8"
|
|
226
261
|
},
|
|
227
262
|
{
|
|
228
263
|
"trailing": true,
|
|
229
|
-
"size": "md" as
|
|
264
|
+
"size": "md" as typeof size[number],
|
|
230
265
|
"class": "pe-9"
|
|
231
266
|
},
|
|
232
267
|
{
|
|
233
268
|
"trailing": true,
|
|
234
|
-
"size": "lg" as
|
|
269
|
+
"size": "lg" as typeof size[number],
|
|
235
270
|
"class": "pe-10"
|
|
236
271
|
},
|
|
237
272
|
{
|
|
238
273
|
"trailing": true,
|
|
239
|
-
"size": "xl" as
|
|
274
|
+
"size": "xl" as typeof size[number],
|
|
240
275
|
"class": "pe-11"
|
|
241
276
|
},
|
|
242
277
|
{
|
|
@@ -256,8 +291,8 @@ export default {
|
|
|
256
291
|
}
|
|
257
292
|
],
|
|
258
293
|
"defaultVariants": {
|
|
259
|
-
"size": "md" as
|
|
260
|
-
"color": "primary" as
|
|
261
|
-
"variant": "outline" as
|
|
294
|
+
"size": "md" as typeof size[number],
|
|
295
|
+
"color": "primary" as typeof color[number],
|
|
296
|
+
"variant": "outline" as typeof variant[number]
|
|
262
297
|
}
|
|
263
298
|
}
|
package/.nuxt/ui/toast.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
const color = [
|
|
2
|
+
"primary",
|
|
3
|
+
"secondary",
|
|
4
|
+
"success",
|
|
5
|
+
"info",
|
|
6
|
+
"warning",
|
|
7
|
+
"error",
|
|
8
|
+
"neutral"
|
|
9
|
+
] as const
|
|
10
|
+
|
|
1
11
|
export default {
|
|
2
12
|
"slots": {
|
|
3
13
|
"root": "relative group overflow-hidden bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*2)] ring ring-[var(--ui-border)] p-4 flex gap-2.5 focus:outline-none",
|
|
@@ -61,6 +71,6 @@ export default {
|
|
|
61
71
|
}
|
|
62
72
|
},
|
|
63
73
|
"defaultVariants": {
|
|
64
|
-
"color": "primary" as
|
|
74
|
+
"color": "primary" as typeof color[number]
|
|
65
75
|
}
|
|
66
76
|
}
|
package/.nuxt/ui/toaster.ts
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
const position = [
|
|
2
|
+
"top-left",
|
|
3
|
+
"top-center",
|
|
4
|
+
"top-right",
|
|
5
|
+
"bottom-left",
|
|
6
|
+
"bottom-center",
|
|
7
|
+
"bottom-right"
|
|
8
|
+
] as const
|
|
9
|
+
|
|
10
|
+
const swipeDirection = [
|
|
11
|
+
"up",
|
|
12
|
+
"right",
|
|
13
|
+
"down",
|
|
14
|
+
"left"
|
|
15
|
+
] as const
|
|
16
|
+
|
|
1
17
|
export default {
|
|
2
18
|
"slots": {
|
|
3
19
|
"viewport": "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-[var(--height)] focus:outline-none",
|
|
@@ -34,9 +50,9 @@ export default {
|
|
|
34
50
|
"compoundVariants": [
|
|
35
51
|
{
|
|
36
52
|
"position": [
|
|
37
|
-
"top-left" as
|
|
38
|
-
"top-center" as
|
|
39
|
-
"top-right" as
|
|
53
|
+
"top-left" as typeof position[number],
|
|
54
|
+
"top-center" as typeof position[number],
|
|
55
|
+
"top-right" as typeof position[number]
|
|
40
56
|
],
|
|
41
57
|
"class": {
|
|
42
58
|
"viewport": "top-4",
|
|
@@ -45,9 +61,9 @@ export default {
|
|
|
45
61
|
},
|
|
46
62
|
{
|
|
47
63
|
"position": [
|
|
48
|
-
"bottom-left" as
|
|
49
|
-
"bottom-center" as
|
|
50
|
-
"bottom-right" as
|
|
64
|
+
"bottom-left" as typeof position[number],
|
|
65
|
+
"bottom-center" as typeof position[number],
|
|
66
|
+
"bottom-right" as typeof position[number]
|
|
51
67
|
],
|
|
52
68
|
"class": {
|
|
53
69
|
"viewport": "bottom-4",
|
|
@@ -56,20 +72,20 @@ export default {
|
|
|
56
72
|
},
|
|
57
73
|
{
|
|
58
74
|
"swipeDirection": [
|
|
59
|
-
"left" as
|
|
60
|
-
"right" as
|
|
75
|
+
"left" as typeof swipeDirection[number],
|
|
76
|
+
"right" as typeof swipeDirection[number]
|
|
61
77
|
],
|
|
62
78
|
"class": "data-[swipe=move]:translate-x-[var(--reka-toast-swipe-move-x)] data-[swipe=end]:translate-x-[var(--reka-toast-swipe-end-x)] data-[swipe=cancel]:translate-x-0"
|
|
63
79
|
},
|
|
64
80
|
{
|
|
65
81
|
"swipeDirection": [
|
|
66
|
-
"up" as
|
|
67
|
-
"down" as
|
|
82
|
+
"up" as typeof swipeDirection[number],
|
|
83
|
+
"down" as typeof swipeDirection[number]
|
|
68
84
|
],
|
|
69
85
|
"class": "data-[swipe=move]:translate-y-[var(--reka-toast-swipe-move-y)] data-[swipe=end]:translate-y-[var(--reka-toast-swipe-end-y)] data-[swipe=cancel]:translate-y-0"
|
|
70
86
|
}
|
|
71
87
|
],
|
|
72
88
|
"defaultVariants": {
|
|
73
|
-
"position": "bottom-right" as
|
|
89
|
+
"position": "bottom-right" as typeof position[number]
|
|
74
90
|
}
|
|
75
91
|
}
|
package/.nuxt/ui/tooltip.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"slots": {
|
|
3
|
-
"content": "flex items-center gap-1 bg-[var(--ui-bg)] text-[var(--ui-text-highlighted)] shadow-sm rounded-[var(--ui-radius)] ring ring-[var(--ui-border)] h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
|
|
3
|
+
"content": "flex items-center gap-1 bg-[var(--ui-bg)] text-[var(--ui-text-highlighted)] shadow-sm rounded-[var(--ui-radius)] ring ring-[var(--ui-border)] h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] pointer-events-auto",
|
|
4
4
|
"arrow": "fill-[var(--ui-border)]",
|
|
5
5
|
"text": "truncate",
|
|
6
6
|
"kbds": "hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['·'] before:me-0.5",
|
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
We're thrilled to introduce Nuxt UI v3, a significant upgrade to our UI library that delivers extensive improvements and robust new capabilities. This major update harnesses the combined strengths of [Reka UI](https://reka-ui.com/), [Tailwind CSS v4](https://tailwindcss.com/docs/v4-beta), and [Tailwind Variants](https://www.tailwind-variants.org/) to offer developers an unparalleled set of tools for creating sophisticated, accessible, and highly performant user interfaces.
|
|
11
11
|
|
|
12
12
|
> [!NOTE]
|
|
13
|
-
> You are on the `v3` development branch, check out the [dev branch](https://github.com/nuxt/ui) for Nuxt UI v2.
|
|
13
|
+
> You are on the `v3` development branch, check out the [dev branch](https://github.com/nuxt/ui/tree/dev) for Nuxt UI v2.
|
|
14
14
|
|
|
15
15
|
## Documentation
|
|
16
16
|
|
|
@@ -74,11 +74,18 @@ export default defineConfig({
|
|
|
74
74
|
|
|
75
75
|
```ts [main.ts]
|
|
76
76
|
import { createApp } from 'vue'
|
|
77
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
77
78
|
import ui from '@nuxt/ui/vue-plugin'
|
|
78
79
|
import App from './App.vue'
|
|
79
80
|
|
|
80
81
|
const app = createApp(App)
|
|
81
82
|
|
|
83
|
+
const router = createRouter({
|
|
84
|
+
routes: [],
|
|
85
|
+
history: createWebHistory()
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
app.use(router)
|
|
82
89
|
app.use(ui)
|
|
83
90
|
|
|
84
91
|
app.mount('#app')
|
|
@@ -32,6 +32,10 @@ export default defineCommand({
|
|
|
32
32
|
content: {
|
|
33
33
|
type: 'boolean',
|
|
34
34
|
description: 'Create a content component (with --pro).'
|
|
35
|
+
},
|
|
36
|
+
template: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'Only generate template.'
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
41
|
async setup({ args }) {
|
|
@@ -53,6 +57,10 @@ export default defineCommand({
|
|
|
53
57
|
const path = resolve('.')
|
|
54
58
|
|
|
55
59
|
for (const template of Object.keys(templates)) {
|
|
60
|
+
if (args.template && template !== args.template) {
|
|
61
|
+
continue
|
|
62
|
+
}
|
|
63
|
+
|
|
56
64
|
const { filename, contents } = templates[template](args)
|
|
57
65
|
if (!contents) {
|
|
58
66
|
continue
|
|
@@ -70,6 +78,10 @@ export default defineCommand({
|
|
|
70
78
|
consola.success(`🪄 Generated ${filePath}!`)
|
|
71
79
|
}
|
|
72
80
|
|
|
81
|
+
if (args.template) {
|
|
82
|
+
return
|
|
83
|
+
}
|
|
84
|
+
|
|
73
85
|
const themePath = resolve(path, `src/theme/${args.prose ? 'prose/' : ''}${args.content ? 'content/' : ''}index.ts`)
|
|
74
86
|
await appendFile(themePath, `export { default as ${camelCase(name)} } from './${kebabCase(name)}'`)
|
|
75
87
|
await sortFile(themePath)
|
package/cli/package.json
CHANGED
package/cli/templates.mjs
CHANGED
|
@@ -30,10 +30,10 @@ const component = ({ name, primitive, pro, prose, content }) => {
|
|
|
30
30
|
contents: primitive
|
|
31
31
|
? `
|
|
32
32
|
<script lang="ts">
|
|
33
|
-
import { tv } from 'tailwind-variants'
|
|
34
33
|
import type { AppConfig } from '@nuxt/schema'
|
|
35
34
|
import _appConfig from '#build/app.config'
|
|
36
35
|
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
|
|
36
|
+
import { tv } from ${pro ? '#ui/utils/tv' : '../utils/tv'}
|
|
37
37
|
|
|
38
38
|
const appConfig = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}
|
|
39
39
|
|
|
@@ -57,7 +57,7 @@ export interface ${upperName}Slots {
|
|
|
57
57
|
<script setup lang="ts">
|
|
58
58
|
import { Primitive } from 'reka-ui'
|
|
59
59
|
|
|
60
|
-
const props =
|
|
60
|
+
const props = defineProps<${upperName}Props>()
|
|
61
61
|
defineSlots<${upperName}Slots>()
|
|
62
62
|
|
|
63
63
|
const ui = ${camelName}()
|
|
@@ -71,11 +71,12 @@ const ui = ${camelName}()
|
|
|
71
71
|
`
|
|
72
72
|
: `
|
|
73
73
|
<script lang="ts">
|
|
74
|
-
import {
|
|
74
|
+
import type { VariantProps } from 'tailwind-variants'
|
|
75
75
|
import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
|
|
76
76
|
import type { AppConfig } from '@nuxt/schema'
|
|
77
77
|
import _appConfig from '#build/app.config'
|
|
78
78
|
import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
|
|
79
|
+
import { tv } from ${pro ? '#ui/utils/tv' : '../utils/tv'}
|
|
79
80
|
|
|
80
81
|
const appConfig = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}
|
|
81
82
|
|
|
@@ -163,15 +164,19 @@ describe('${upperName}', () => {
|
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
|
|
166
|
-
const
|
|
167
|
+
const docs = ({ name, pro, primitive }) => {
|
|
167
168
|
const kebabName = kebabCase(name)
|
|
168
169
|
const upperName = splitByCase(name).map(p => upperFirst(p)).join('')
|
|
169
170
|
|
|
170
171
|
return {
|
|
171
|
-
filename: `docs/content
|
|
172
|
+
filename: `docs/content/3.components/${kebabName}.md`,
|
|
172
173
|
contents: `---
|
|
173
|
-
|
|
174
|
-
|
|
174
|
+
title: ${upperName}
|
|
175
|
+
description: ''${pro
|
|
176
|
+
? `
|
|
177
|
+
module: ui-pro`
|
|
178
|
+
: ''}
|
|
179
|
+
links:${primitive
|
|
175
180
|
? ''
|
|
176
181
|
: `
|
|
177
182
|
- label: ${upperName}
|
|
@@ -190,19 +195,19 @@ links: ${pro
|
|
|
190
195
|
|
|
191
196
|
### Props
|
|
192
197
|
|
|
193
|
-
:component-props
|
|
198
|
+
:component-props${pro ? '{pro}' : ''}
|
|
194
199
|
|
|
195
200
|
### Slots
|
|
196
201
|
|
|
197
|
-
:component-slots
|
|
202
|
+
:component-slots${pro ? '{pro}' : ''}
|
|
198
203
|
|
|
199
204
|
### Emits
|
|
200
205
|
|
|
201
|
-
:component-emits
|
|
206
|
+
:component-emits${pro ? '{pro}' : ''}
|
|
202
207
|
|
|
203
208
|
## Theme
|
|
204
209
|
|
|
205
|
-
:component-theme
|
|
210
|
+
:component-theme${pro ? '{pro}' : ''}
|
|
206
211
|
`
|
|
207
212
|
}
|
|
208
213
|
}
|
|
@@ -212,5 +217,5 @@ export default {
|
|
|
212
217
|
component,
|
|
213
218
|
theme,
|
|
214
219
|
test,
|
|
215
|
-
|
|
220
|
+
docs
|
|
216
221
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt_ui__/devtools/_nuxt/entry.
|
|
1
|
+
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt_ui__/devtools/_nuxt/entry.qOdop8tq.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt_ui__/devtools/_nuxt/CQ-XZFu7.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt_ui__/devtools/_nuxt/error-404.D-rS9BDk.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_ui__/devtools/_nuxt/Dtz-o9GB.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt_ui__/devtools/_nuxt/error-500.CfcCHs91.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_ui__/devtools/_nuxt/DNZFyo26.js"><script type="module" src="/__nuxt_ui__/devtools/_nuxt/CQ-XZFu7.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1736765680267,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt_ui__/devtools",buildId:"1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt_ui__/devtools/_nuxt/entry.
|
|
1
|
+
<!DOCTYPE html><html data-capo=""><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__nuxt_ui__/devtools/_nuxt/entry.qOdop8tq.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__nuxt_ui__/devtools/_nuxt/CQ-XZFu7.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt_ui__/devtools/_nuxt/error-404.D-rS9BDk.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_ui__/devtools/_nuxt/Dtz-o9GB.js"><link rel="prefetch" as="style" crossorigin href="/__nuxt_ui__/devtools/_nuxt/error-500.CfcCHs91.css"><link rel="prefetch" as="script" crossorigin href="/__nuxt_ui__/devtools/_nuxt/DNZFyo26.js"><script type="module" src="/__nuxt_ui__/devtools/_nuxt/CQ-XZFu7.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1736765680267,false]</script><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt_ui__/devtools",buildId:"1f5fbd7b-9d97-480e-9ae4-e02b4ff7018b",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
|