@nuxt/ui 3.2.0 → 3.3.0

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.
Files changed (175) hide show
  1. package/.nuxt/ui/button.ts +42 -42
  2. package/.nuxt/ui/command-palette.ts +2 -1
  3. package/.nuxt/ui/file-upload.ts +290 -0
  4. package/.nuxt/ui/index.ts +1 -0
  5. package/.nuxt/ui/kbd.ts +167 -3
  6. package/.nuxt/ui/table.ts +8 -0
  7. package/.nuxt/ui/tabs.ts +4 -2
  8. package/.nuxt/ui/toast.ts +8 -15
  9. package/.nuxt/ui/tooltip.ts +1 -1
  10. package/cli/templates.mjs +4 -3
  11. package/dist/module.d.mts +15 -1
  12. package/dist/module.json +1 -1
  13. package/dist/module.mjs +3 -3
  14. package/dist/runtime/components/Accordion.vue.d.ts +1 -1
  15. package/dist/runtime/components/Alert.vue.d.ts +2 -2
  16. package/dist/runtime/components/App.vue.d.ts +1 -1
  17. package/dist/runtime/components/Avatar.vue.d.ts +1 -1
  18. package/dist/runtime/components/AvatarGroup.vue.d.ts +1 -1
  19. package/dist/runtime/components/Badge.vue.d.ts +1 -1
  20. package/dist/runtime/components/Breadcrumb.vue.d.ts +1 -1
  21. package/dist/runtime/components/Button.vue +6 -6
  22. package/dist/runtime/components/Button.vue.d.ts +1 -5
  23. package/dist/runtime/components/ButtonGroup.vue.d.ts +1 -1
  24. package/dist/runtime/components/Calendar.vue.d.ts +1 -1
  25. package/dist/runtime/components/Card.vue.d.ts +1 -1
  26. package/dist/runtime/components/Carousel.vue +18 -14
  27. package/dist/runtime/components/Carousel.vue.d.ts +1 -1
  28. package/dist/runtime/components/Checkbox.vue.d.ts +1 -1
  29. package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
  30. package/dist/runtime/components/Chip.vue.d.ts +2 -2
  31. package/dist/runtime/components/Collapsible.vue.d.ts +1 -1
  32. package/dist/runtime/components/ColorPicker.vue +1 -2
  33. package/dist/runtime/components/ColorPicker.vue.d.ts +1 -1
  34. package/dist/runtime/components/CommandPalette.vue +4 -0
  35. package/dist/runtime/components/CommandPalette.vue.d.ts +6 -1
  36. package/dist/runtime/components/Container.vue.d.ts +1 -1
  37. package/dist/runtime/components/ContextMenu.vue.d.ts +1 -1
  38. package/dist/runtime/components/ContextMenuContent.vue.d.ts +1 -1
  39. package/dist/runtime/components/Drawer.vue +4 -4
  40. package/dist/runtime/components/Drawer.vue.d.ts +6 -1
  41. package/dist/runtime/components/DropdownMenu.vue.d.ts +1 -1
  42. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +8 -5
  43. package/dist/runtime/components/FileUpload.vue +242 -0
  44. package/dist/runtime/components/FileUpload.vue.d.ts +167 -0
  45. package/dist/runtime/components/Form.vue.d.ts +6 -5
  46. package/dist/runtime/components/FormField.vue +2 -2
  47. package/dist/runtime/components/FormField.vue.d.ts +4 -4
  48. package/dist/runtime/components/Icon.vue.d.ts +1 -1
  49. package/dist/runtime/components/Input.vue +10 -7
  50. package/dist/runtime/components/Input.vue.d.ts +9 -9
  51. package/dist/runtime/components/InputMenu.vue +17 -10
  52. package/dist/runtime/components/InputMenu.vue.d.ts +15 -12
  53. package/dist/runtime/components/InputNumber.vue.d.ts +4 -4
  54. package/dist/runtime/components/InputTags.vue +2 -0
  55. package/dist/runtime/components/InputTags.vue.d.ts +5 -3
  56. package/dist/runtime/components/Kbd.vue +2 -1
  57. package/dist/runtime/components/Kbd.vue.d.ts +5 -1
  58. package/dist/runtime/components/Link.vue +6 -5
  59. package/dist/runtime/components/Link.vue.d.ts +1 -3
  60. package/dist/runtime/components/LinkBase.vue.d.ts +1 -1
  61. package/dist/runtime/components/Modal.vue.d.ts +2 -2
  62. package/dist/runtime/components/NavigationMenu.vue +3 -2
  63. package/dist/runtime/components/NavigationMenu.vue.d.ts +1 -1
  64. package/dist/runtime/components/OverlayProvider.vue.d.ts +1 -1
  65. package/dist/runtime/components/Pagination.vue.d.ts +1 -1
  66. package/dist/runtime/components/PinInput.vue.d.ts +1 -1
  67. package/dist/runtime/components/Popover.vue +2 -1
  68. package/dist/runtime/components/Popover.vue.d.ts +8 -2
  69. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  70. package/dist/runtime/components/RadioGroup.vue +1 -1
  71. package/dist/runtime/components/RadioGroup.vue.d.ts +5 -4
  72. package/dist/runtime/components/Select.vue.d.ts +1 -1
  73. package/dist/runtime/components/SelectMenu.vue +9 -6
  74. package/dist/runtime/components/SelectMenu.vue.d.ts +1 -1
  75. package/dist/runtime/components/Separator.vue.d.ts +1 -1
  76. package/dist/runtime/components/Skeleton.vue.d.ts +1 -1
  77. package/dist/runtime/components/Slideover.vue.d.ts +2 -2
  78. package/dist/runtime/components/Slider.vue.d.ts +5 -5
  79. package/dist/runtime/components/Stepper.vue.d.ts +1 -1
  80. package/dist/runtime/components/Switch.vue.d.ts +1 -1
  81. package/dist/runtime/components/Table.vue +83 -8
  82. package/dist/runtime/components/Table.vue.d.ts +20 -4
  83. package/dist/runtime/components/Tabs.vue +11 -2
  84. package/dist/runtime/components/Tabs.vue.d.ts +8 -3
  85. package/dist/runtime/components/Textarea.vue +10 -7
  86. package/dist/runtime/components/Textarea.vue.d.ts +10 -9
  87. package/dist/runtime/components/Timeline.vue.d.ts +1 -1
  88. package/dist/runtime/components/Toast.vue +12 -4
  89. package/dist/runtime/components/Toast.vue.d.ts +14 -13
  90. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  91. package/dist/runtime/components/Tooltip.vue +2 -1
  92. package/dist/runtime/components/Tooltip.vue.d.ts +8 -2
  93. package/dist/runtime/components/Tree.vue +3 -2
  94. package/dist/runtime/components/Tree.vue.d.ts +1 -1
  95. package/dist/runtime/composables/defineShortcuts.js +5 -3
  96. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  97. package/dist/runtime/composables/useComponentIcons.d.ts +1 -1
  98. package/dist/runtime/composables/useFileUpload.d.ts +19 -0
  99. package/dist/runtime/composables/useFileUpload.js +63 -0
  100. package/dist/runtime/composables/useFormField.d.ts +3 -6
  101. package/dist/runtime/composables/useFormField.js +5 -2
  102. package/dist/runtime/composables/useKbd.d.ts +1 -1
  103. package/dist/runtime/composables/useLocale.js +2 -2
  104. package/dist/runtime/composables/useOverlay.d.ts +28 -1
  105. package/dist/runtime/composables/useOverlay.js +4 -4
  106. package/dist/runtime/composables/usePortal.d.ts +1 -1
  107. package/dist/runtime/inertia/components/Link.vue.d.ts +1 -1
  108. package/dist/runtime/inertia/components/LinkBase.vue.d.ts +1 -1
  109. package/dist/runtime/inertia/stubs.d.ts +1 -0
  110. package/dist/runtime/inertia/stubs.js +4 -2
  111. package/dist/runtime/locale/ar.js +2 -1
  112. package/dist/runtime/locale/az.js +1 -0
  113. package/dist/runtime/locale/bg.js +1 -0
  114. package/dist/runtime/locale/bn.js +1 -0
  115. package/dist/runtime/locale/ca.js +1 -0
  116. package/dist/runtime/locale/ckb.js +2 -1
  117. package/dist/runtime/locale/cs.js +1 -0
  118. package/dist/runtime/locale/da.js +1 -0
  119. package/dist/runtime/locale/de.js +1 -0
  120. package/dist/runtime/locale/el.js +1 -0
  121. package/dist/runtime/locale/en.js +1 -0
  122. package/dist/runtime/locale/es.js +1 -0
  123. package/dist/runtime/locale/et.js +1 -0
  124. package/dist/runtime/locale/fa_ir.js +1 -0
  125. package/dist/runtime/locale/fi.js +1 -0
  126. package/dist/runtime/locale/fr.js +1 -0
  127. package/dist/runtime/locale/he.js +1 -0
  128. package/dist/runtime/locale/hi.js +2 -1
  129. package/dist/runtime/locale/hu.js +1 -0
  130. package/dist/runtime/locale/hy.js +1 -0
  131. package/dist/runtime/locale/id.js +1 -0
  132. package/dist/runtime/locale/it.js +1 -0
  133. package/dist/runtime/locale/ja.js +1 -0
  134. package/dist/runtime/locale/kk.js +1 -0
  135. package/dist/runtime/locale/km.js +2 -1
  136. package/dist/runtime/locale/ko.js +1 -0
  137. package/dist/runtime/locale/ky.js +1 -0
  138. package/dist/runtime/locale/lb.js +1 -0
  139. package/dist/runtime/locale/lt.js +1 -0
  140. package/dist/runtime/locale/mn.js +1 -0
  141. package/dist/runtime/locale/ms.js +1 -0
  142. package/dist/runtime/locale/nb_no.js +1 -0
  143. package/dist/runtime/locale/nl.js +1 -0
  144. package/dist/runtime/locale/pl.js +1 -0
  145. package/dist/runtime/locale/pt.js +1 -0
  146. package/dist/runtime/locale/pt_br.js +1 -0
  147. package/dist/runtime/locale/ro.js +1 -0
  148. package/dist/runtime/locale/ru.js +1 -0
  149. package/dist/runtime/locale/sk.js +1 -0
  150. package/dist/runtime/locale/sl.js +1 -0
  151. package/dist/runtime/locale/sv.js +1 -0
  152. package/dist/runtime/locale/th.js +1 -0
  153. package/dist/runtime/locale/tj.js +1 -0
  154. package/dist/runtime/locale/tr.js +1 -0
  155. package/dist/runtime/locale/ug_cn.js +1 -0
  156. package/dist/runtime/locale/uk.js +1 -0
  157. package/dist/runtime/locale/ur.js +1 -0
  158. package/dist/runtime/locale/uz.js +1 -0
  159. package/dist/runtime/locale/vi.js +1 -0
  160. package/dist/runtime/locale/zh_cn.js +1 -0
  161. package/dist/runtime/locale/zh_tw.js +1 -0
  162. package/dist/runtime/types/index.d.ts +1 -0
  163. package/dist/runtime/types/index.js +1 -0
  164. package/dist/runtime/types/locale.d.ts +1 -0
  165. package/dist/runtime/utils/index.d.ts +1 -0
  166. package/dist/runtime/utils/index.js +9 -0
  167. package/dist/runtime/vue/components/Icon.vue.d.ts +1 -1
  168. package/dist/runtime/vue/components/Link.vue.d.ts +1 -1
  169. package/dist/runtime/vue/stubs.d.ts +1 -0
  170. package/dist/runtime/vue/stubs.js +3 -1
  171. package/dist/shared/{ui.BPVxSPGY.mjs → ui.BkSj2DmF.mjs} +278 -29
  172. package/dist/unplugin.d.mts +2 -0
  173. package/dist/unplugin.mjs +6 -3
  174. package/dist/vite.mjs +1 -1
  175. package/package.json +24 -24
package/.nuxt/ui/kbd.ts CHANGED
@@ -1,6 +1,17 @@
1
+ const color = [
2
+ "primary",
3
+ "secondary",
4
+ "success",
5
+ "info",
6
+ "warning",
7
+ "error",
8
+ "neutral"
9
+ ] as const
10
+
1
11
  const variant = [
2
12
  "solid",
3
13
  "outline",
14
+ "soft",
4
15
  "subtle"
5
16
  ] as const
6
17
 
@@ -13,10 +24,20 @@ const size = [
13
24
  export default {
14
25
  "base": "inline-flex items-center justify-center px-1 rounded-sm font-medium font-sans",
15
26
  "variants": {
27
+ "color": {
28
+ "primary": "",
29
+ "secondary": "",
30
+ "success": "",
31
+ "info": "",
32
+ "warning": "",
33
+ "error": "",
34
+ "neutral": ""
35
+ },
16
36
  "variant": {
17
- "solid": "bg-inverted text-inverted",
18
- "outline": "bg-default text-highlighted ring ring-inset ring-accented",
19
- "subtle": "bg-elevated text-default ring ring-inset ring-accented"
37
+ "solid": "",
38
+ "outline": "",
39
+ "soft": "",
40
+ "subtle": ""
20
41
  },
21
42
  "size": {
22
43
  "sm": "h-4 min-w-[16px] text-[10px]",
@@ -24,8 +45,151 @@ export default {
24
45
  "lg": "h-6 min-w-[24px] text-[12px]"
25
46
  }
26
47
  },
48
+ "compoundVariants": [
49
+ {
50
+ "color": "primary" as typeof color[number],
51
+ "variant": "solid" as typeof variant[number],
52
+ "class": "text-inverted bg-primary"
53
+ },
54
+ {
55
+ "color": "secondary" as typeof color[number],
56
+ "variant": "solid" as typeof variant[number],
57
+ "class": "text-inverted bg-secondary"
58
+ },
59
+ {
60
+ "color": "success" as typeof color[number],
61
+ "variant": "solid" as typeof variant[number],
62
+ "class": "text-inverted bg-success"
63
+ },
64
+ {
65
+ "color": "info" as typeof color[number],
66
+ "variant": "solid" as typeof variant[number],
67
+ "class": "text-inverted bg-info"
68
+ },
69
+ {
70
+ "color": "warning" as typeof color[number],
71
+ "variant": "solid" as typeof variant[number],
72
+ "class": "text-inverted bg-warning"
73
+ },
74
+ {
75
+ "color": "error" as typeof color[number],
76
+ "variant": "solid" as typeof variant[number],
77
+ "class": "text-inverted bg-error"
78
+ },
79
+ {
80
+ "color": "primary" as typeof color[number],
81
+ "variant": "outline" as typeof variant[number],
82
+ "class": "ring ring-inset ring-primary/50 text-primary"
83
+ },
84
+ {
85
+ "color": "secondary" as typeof color[number],
86
+ "variant": "outline" as typeof variant[number],
87
+ "class": "ring ring-inset ring-secondary/50 text-secondary"
88
+ },
89
+ {
90
+ "color": "success" as typeof color[number],
91
+ "variant": "outline" as typeof variant[number],
92
+ "class": "ring ring-inset ring-success/50 text-success"
93
+ },
94
+ {
95
+ "color": "info" as typeof color[number],
96
+ "variant": "outline" as typeof variant[number],
97
+ "class": "ring ring-inset ring-info/50 text-info"
98
+ },
99
+ {
100
+ "color": "warning" as typeof color[number],
101
+ "variant": "outline" as typeof variant[number],
102
+ "class": "ring ring-inset ring-warning/50 text-warning"
103
+ },
104
+ {
105
+ "color": "error" as typeof color[number],
106
+ "variant": "outline" as typeof variant[number],
107
+ "class": "ring ring-inset ring-error/50 text-error"
108
+ },
109
+ {
110
+ "color": "primary" as typeof color[number],
111
+ "variant": "soft" as typeof variant[number],
112
+ "class": "text-primary bg-primary/10"
113
+ },
114
+ {
115
+ "color": "secondary" as typeof color[number],
116
+ "variant": "soft" as typeof variant[number],
117
+ "class": "text-secondary bg-secondary/10"
118
+ },
119
+ {
120
+ "color": "success" as typeof color[number],
121
+ "variant": "soft" as typeof variant[number],
122
+ "class": "text-success bg-success/10"
123
+ },
124
+ {
125
+ "color": "info" as typeof color[number],
126
+ "variant": "soft" as typeof variant[number],
127
+ "class": "text-info bg-info/10"
128
+ },
129
+ {
130
+ "color": "warning" as typeof color[number],
131
+ "variant": "soft" as typeof variant[number],
132
+ "class": "text-warning bg-warning/10"
133
+ },
134
+ {
135
+ "color": "error" as typeof color[number],
136
+ "variant": "soft" as typeof variant[number],
137
+ "class": "text-error bg-error/10"
138
+ },
139
+ {
140
+ "color": "primary" as typeof color[number],
141
+ "variant": "subtle" as typeof variant[number],
142
+ "class": "text-primary ring ring-inset ring-primary/25 bg-primary/10"
143
+ },
144
+ {
145
+ "color": "secondary" as typeof color[number],
146
+ "variant": "subtle" as typeof variant[number],
147
+ "class": "text-secondary ring ring-inset ring-secondary/25 bg-secondary/10"
148
+ },
149
+ {
150
+ "color": "success" as typeof color[number],
151
+ "variant": "subtle" as typeof variant[number],
152
+ "class": "text-success ring ring-inset ring-success/25 bg-success/10"
153
+ },
154
+ {
155
+ "color": "info" as typeof color[number],
156
+ "variant": "subtle" as typeof variant[number],
157
+ "class": "text-info ring ring-inset ring-info/25 bg-info/10"
158
+ },
159
+ {
160
+ "color": "warning" as typeof color[number],
161
+ "variant": "subtle" as typeof variant[number],
162
+ "class": "text-warning ring ring-inset ring-warning/25 bg-warning/10"
163
+ },
164
+ {
165
+ "color": "error" as typeof color[number],
166
+ "variant": "subtle" as typeof variant[number],
167
+ "class": "text-error ring ring-inset ring-error/25 bg-error/10"
168
+ },
169
+ {
170
+ "color": "neutral" as typeof color[number],
171
+ "variant": "solid" as typeof variant[number],
172
+ "class": "text-inverted bg-inverted"
173
+ },
174
+ {
175
+ "color": "neutral" as typeof color[number],
176
+ "variant": "outline" as typeof variant[number],
177
+ "class": "ring ring-inset ring-accented text-default bg-default"
178
+ },
179
+ {
180
+ "color": "neutral" as typeof color[number],
181
+ "variant": "soft" as typeof variant[number],
182
+ "class": "text-default bg-elevated"
183
+ },
184
+ {
185
+ "color": "neutral" as typeof color[number],
186
+ "variant": "subtle" as typeof variant[number],
187
+ "class": "ring ring-inset ring-accented text-default bg-elevated"
188
+ }
189
+ ],
27
190
  "defaultVariants": {
28
191
  "variant": "outline" as typeof variant[number],
192
+ "color": "neutral" as typeof color[number],
29
193
  "size": "md" as typeof size[number]
30
194
  }
31
195
  }
package/.nuxt/ui/table.ts CHANGED
@@ -22,6 +22,7 @@ export default {
22
22
  "caption": "sr-only",
23
23
  "thead": "relative",
24
24
  "tbody": "divide-y divide-default [&>tr]:data-[selectable=true]:hover:bg-elevated/50 [&>tr]:data-[selectable=true]:focus-visible:outline-primary",
25
+ "tfoot": "relative",
25
26
  "tr": "data-[selected=true]:bg-elevated/50",
26
27
  "th": "px-4 py-3.5 text-sm text-highlighted text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pe-0",
27
28
  "td": "p-4 text-sm text-muted whitespace-nowrap [&:has([role=checkbox])]:pe-0",
@@ -38,7 +39,14 @@ export default {
38
39
  },
39
40
  "sticky": {
40
41
  "true": {
42
+ "thead": "sticky top-0 inset-x-0 bg-default/75 z-[1] backdrop-blur",
43
+ "tfoot": "sticky bottom-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"
44
+ },
45
+ "header": {
41
46
  "thead": "sticky top-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"
47
+ },
48
+ "footer": {
49
+ "tfoot": "sticky bottom-0 inset-x-0 bg-default/75 z-[1] backdrop-blur"
42
50
  }
43
51
  },
44
52
  "loading": {
package/.nuxt/ui/tabs.ts CHANGED
@@ -35,11 +35,13 @@ export default {
35
35
  "group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75",
36
36
  "transition-colors"
37
37
  ],
38
- "content": "focus:outline-none w-full",
39
38
  "leadingIcon": "shrink-0",
40
39
  "leadingAvatar": "shrink-0",
41
40
  "leadingAvatarSize": "",
42
- "label": "truncate"
41
+ "label": "truncate",
42
+ "trailingBadge": "shrink-0",
43
+ "trailingBadgeSize": "sm",
44
+ "content": "focus:outline-none w-full"
43
45
  },
44
46
  "variants": {
45
47
  "color": {
package/.nuxt/ui/toast.ts CHANGED
@@ -18,45 +18,38 @@ export default {
18
18
  "avatar": "shrink-0",
19
19
  "avatarSize": "2xl",
20
20
  "actions": "flex gap-1.5 shrink-0",
21
- "progress": "absolute inset-x-0 bottom-0 h-1 z-[-1]",
21
+ "progress": "absolute inset-x-0 bottom-0",
22
22
  "close": "p-0"
23
23
  },
24
24
  "variants": {
25
25
  "color": {
26
26
  "primary": {
27
27
  "root": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-primary",
28
- "icon": "text-primary",
29
- "progress": "bg-primary"
28
+ "icon": "text-primary"
30
29
  },
31
30
  "secondary": {
32
31
  "root": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary",
33
- "icon": "text-secondary",
34
- "progress": "bg-secondary"
32
+ "icon": "text-secondary"
35
33
  },
36
34
  "success": {
37
35
  "root": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-success",
38
- "icon": "text-success",
39
- "progress": "bg-success"
36
+ "icon": "text-success"
40
37
  },
41
38
  "info": {
42
39
  "root": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-info",
43
- "icon": "text-info",
44
- "progress": "bg-info"
40
+ "icon": "text-info"
45
41
  },
46
42
  "warning": {
47
43
  "root": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-warning",
48
- "icon": "text-warning",
49
- "progress": "bg-warning"
44
+ "icon": "text-warning"
50
45
  },
51
46
  "error": {
52
47
  "root": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-error",
53
- "icon": "text-error",
54
- "progress": "bg-error"
48
+ "icon": "text-error"
55
49
  },
56
50
  "neutral": {
57
51
  "root": "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-inverted",
58
- "icon": "text-highlighted",
59
- "progress": "bg-inverted"
52
+ "icon": "text-highlighted"
60
53
  }
61
54
  },
62
55
  "orientation": {
@@ -3,7 +3,7 @@ export default {
3
3
  "content": "flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 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] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",
4
4
  "arrow": "fill-default",
5
5
  "text": "truncate",
6
- "kbds": "hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['·'] before:me-0.5",
6
+ "kbds": "hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5",
7
7
  "kbdsSize": "sm"
8
8
  }
9
9
  }
package/cli/templates.mjs CHANGED
@@ -35,7 +35,7 @@ ${pro ? `import type { ComponentConfig } from '@nuxt/ui'` : ''}
35
35
  import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
36
36
  ${!pro ? `import type { ComponentConfig } from '../types/utils'` : ''}
37
37
 
38
- type ${upperName} = ComponentConfig<typeof theme, AppConfig, ${upperName}${pro ? `, '${key}'` : ''}>
38
+ type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'${pro ? `, '${key}'` : ''}>
39
39
 
40
40
  export interface ${upperName}Props {
41
41
  /**
@@ -80,7 +80,7 @@ ${pro ? `import type { ComponentConfig } from '@nuxt/ui'` : ''}
80
80
  import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
81
81
  ${!pro ? `import type { ComponentConfig } from '../types/utils'` : ''}
82
82
 
83
- type ${upperName} = ComponentConfig<typeof theme, AppConfig, ${upperName}${pro ? `, '${key}'` : ''}>
83
+ type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'${pro ? `, '${key}'` : ''}>
84
84
 
85
85
  export interface ${upperName}Props extends Pick<${upperName}RootProps> {
86
86
  class?: any
@@ -147,7 +147,8 @@ const test = ({ name, prose, content }) => {
147
147
  ? undefined
148
148
  : `
149
149
  import { describe, it, expect } from 'vitest'
150
- import ${upperName}, { type ${upperName}Props, type ${upperName}Slots } from '../../${content ? '../' : ''}src/runtime/components/${content ? 'content/' : ''}${upperName}.vue'
150
+ import ${upperName} from '../../${content ? '../' : ''}src/runtime/components/${content ? 'content/' : ''}${upperName}.vue'
151
+ import type { ${upperName}Props, ${upperName}Slots } from '../../${content ? '../' : ''}src/runtime/components/${content ? 'content/' : ''}${upperName}.vue'
151
152
  import ComponentRender from '../${content ? '../' : ''}component-render'
152
153
 
153
154
  describe('${upperName}', () => {
package/dist/module.d.mts CHANGED
@@ -1,6 +1,8 @@
1
1
  import * as _nuxt_schema from '@nuxt/schema';
2
2
  export * from '../dist/runtime/types/index.js';
3
3
 
4
+ type Color = 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | (string & {});
5
+ type Size = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | (string & {});
4
6
  interface ModuleOptions {
5
7
  /**
6
8
  * Prefix for components
@@ -30,13 +32,25 @@ interface ModuleOptions {
30
32
  * @defaultValue `['primary', 'secondary', 'success', 'info', 'warning', 'error']`
31
33
  * @link https://ui.nuxt.com/getting-started/installation/nuxt#themecolors
32
34
  */
33
- colors?: string[];
35
+ colors?: Color[];
34
36
  /**
35
37
  * Enable or disable transitions on components
36
38
  * @defaultValue `true`
37
39
  * @link https://ui.nuxt.com/getting-started/installation/nuxt#themetransitions
38
40
  */
39
41
  transitions?: boolean;
42
+ defaultVariants?: {
43
+ /**
44
+ * The default color variant to use for components
45
+ * @defaultValue `'primary'`
46
+ */
47
+ color?: Color;
48
+ /**
49
+ * The default size variant to use for components
50
+ * @defaultValue `'md'`
51
+ */
52
+ size?: Size;
53
+ };
40
54
  };
41
55
  }
42
56
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "docs": "https://ui.nuxt.com/getting-started/installation/nuxt",
5
5
  "configKey": "ui",
6
6
  "compatibility": {
package/dist/module.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defu } from 'defu';
2
2
  import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
3
- import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.BPVxSPGY.mjs';
3
+ import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.BkSj2DmF.mjs';
4
4
  import '../dist/runtime/utils/index.js';
5
5
  import 'node:url';
6
6
  import 'scule';
@@ -8,7 +8,7 @@ import 'tailwindcss/colors';
8
8
  import 'knitwork';
9
9
 
10
10
  const name = "@nuxt/ui";
11
- const version = "3.2.0";
11
+ const version = "3.3.0";
12
12
 
13
13
  const module = defineNuxtModule({
14
14
  meta: {
@@ -38,7 +38,7 @@ const module = defineNuxtModule({
38
38
  }
39
39
  async function registerModule(name2, key, options2) {
40
40
  if (!hasNuxtModule(name2)) {
41
- await installModule(name2, options2);
41
+ await installModule(name2, defu(nuxt.options[key], options2));
42
42
  } else {
43
43
  nuxt.options[key] = defu(nuxt.options[key], options2);
44
44
  }
@@ -73,5 +73,5 @@ declare const _default: <T extends AccordionItem>(__VLS_props: NonNullable<Await
73
73
  };
74
74
  export default _default;
75
75
  type __VLS_PrettifyLocal<T> = {
76
- [K in keyof T]: T[K];
76
+ [K in keyof T as K]: T[K];
77
77
  } & {};
@@ -53,7 +53,7 @@ export interface AlertProps {
53
53
  ui?: Alert['slots'];
54
54
  }
55
55
  export interface AlertEmits {
56
- (e: 'update:open', value: boolean): void;
56
+ 'update:open': [value: boolean];
57
57
  }
58
58
  export interface AlertSlots {
59
59
  leading(props?: {}): any;
@@ -66,7 +66,7 @@ export interface AlertSlots {
66
66
  };
67
67
  }): any;
68
68
  }
69
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
69
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AlertProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
70
70
  "update:open": (value: boolean) => any;
71
71
  }, string, import("vue").PublicProps, Readonly<AlertProps> & Readonly<{
72
72
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
@@ -20,5 +20,5 @@ declare const _default: <T extends Messages>(__VLS_props: NonNullable<Awaited<ty
20
20
  };
21
21
  export default _default;
22
22
  type __VLS_PrettifyLocal<T> = {
23
- [K in keyof T]: T[K];
23
+ [K in keyof T as K]: T[K];
24
24
  } & {};
@@ -28,7 +28,7 @@ export interface AvatarProps {
28
28
  export interface AvatarSlots {
29
29
  default(props?: {}): any;
30
30
  }
31
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvatarProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{}>, {
31
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvatarProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarProps> & Readonly<{}>, {
32
32
  as: any;
33
33
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
34
34
  default?: (props: {}) => any;
@@ -22,7 +22,7 @@ export interface AvatarGroupProps {
22
22
  export interface AvatarGroupSlots {
23
23
  default(props?: {}): any;
24
24
  }
25
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvatarGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, AvatarGroupSlots>;
25
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvatarGroupProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<AvatarGroupProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, AvatarGroupSlots>;
26
26
  export default _default;
27
27
  type __VLS_WithSlots<T, S> = T & {
28
28
  new (): {
@@ -32,7 +32,7 @@ export interface BadgeSlots {
32
32
  default(props?: {}): any;
33
33
  trailing(props?: {}): any;
34
34
  }
35
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<BadgeProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & Readonly<{}>, {
35
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<BadgeProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<BadgeProps> & Readonly<{}>, {
36
36
  as: any;
37
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, BadgeSlots>;
38
38
  export default _default;
@@ -62,5 +62,5 @@ declare const _default: <T extends BreadcrumbItem>(__VLS_props: NonNullable<Awai
62
62
  };
63
63
  export default _default;
64
64
  type __VLS_PrettifyLocal<T> = {
65
- [K in keyof T]: T[K];
65
+ [K in keyof T as K]: T[K];
66
66
  } & {};
@@ -10,7 +10,7 @@ import { useAppConfig } from "#imports";
10
10
  import { useComponentIcons } from "../composables/useComponentIcons";
11
11
  import { useButtonGroup } from "../composables/useButtonGroup";
12
12
  import { formLoadingInjectionKey } from "../composables/useFormField";
13
- import { omit } from "../utils";
13
+ import { omit, mergeClasses } from "../utils";
14
14
  import { tv } from "../utils/tv";
15
15
  import { pickLinkProps } from "../utils/link";
16
16
  import UIcon from "./Icon.vue";
@@ -41,11 +41,11 @@ const props = defineProps({
41
41
  as: { type: null, required: false },
42
42
  type: { type: null, required: false },
43
43
  disabled: { type: Boolean, required: false },
44
- active: { type: Boolean, required: false, default: void 0 },
44
+ active: { type: Boolean, required: false },
45
45
  exact: { type: Boolean, required: false },
46
46
  exactQuery: { type: [Boolean, String], required: false },
47
47
  exactHash: { type: Boolean, required: false },
48
- inactiveClass: { type: String, required: false, default: "" },
48
+ inactiveClass: { type: String, required: false },
49
49
  to: { type: null, required: false },
50
50
  href: { type: null, required: false },
51
51
  external: { type: Boolean, required: false },
@@ -56,7 +56,7 @@ const props = defineProps({
56
56
  prefetch: { type: Boolean, required: false },
57
57
  prefetchOn: { type: [String, Object], required: false },
58
58
  noPrefetch: { type: Boolean, required: false },
59
- activeClass: { type: String, required: false, default: "" },
59
+ activeClass: { type: String, required: false },
60
60
  exactActiveClass: { type: String, required: false },
61
61
  ariaCurrentValue: { type: String, required: false },
62
62
  viewTransition: { type: Boolean, required: false },
@@ -89,10 +89,10 @@ const ui = computed(() => tv({
89
89
  variants: {
90
90
  active: {
91
91
  true: {
92
- base: props.activeClass
92
+ base: mergeClasses(appConfig.ui?.button?.variants?.active?.true?.base, props.activeClass)
93
93
  },
94
94
  false: {
95
- base: props.inactiveClass
95
+ base: mergeClasses(appConfig.ui?.button?.variants?.active?.false?.base, props.inactiveClass)
96
96
  }
97
97
  }
98
98
  }
@@ -35,11 +35,7 @@ export interface ButtonSlots {
35
35
  default(props?: {}): any;
36
36
  trailing(props?: {}): any;
37
37
  }
38
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {
39
- activeClass: string;
40
- active: boolean;
41
- inactiveClass: string;
42
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
38
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ButtonProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonSlots>;
43
39
  export default _default;
44
40
  type __VLS_WithSlots<T, S> = T & {
45
41
  new (): {
@@ -23,7 +23,7 @@ export interface ButtonGroupProps {
23
23
  export interface ButtonGroupSlots {
24
24
  default(props?: {}): any;
25
25
  }
26
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ButtonGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonGroupProps> & Readonly<{}>, {
26
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ButtonGroupProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ButtonGroupProps> & Readonly<{}>, {
27
27
  orientation: ButtonGroup["variants"]["orientation"];
28
28
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ButtonGroupSlots>;
29
29
  export default _default;
@@ -107,5 +107,5 @@ declare const _default: <R extends boolean, M extends boolean>(__VLS_props: NonN
107
107
  };
108
108
  export default _default;
109
109
  type __VLS_PrettifyLocal<T> = {
110
- [K in keyof T]: T[K];
110
+ [K in keyof T as K]: T[K];
111
111
  } & {};
@@ -20,7 +20,7 @@ export interface CardSlots {
20
20
  default(props?: {}): any;
21
21
  footer(props?: {}): any;
22
22
  }
23
- declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CardProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CardSlots>;
23
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<CardProps, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<CardProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, CardSlots>;
24
24
  export default _default;
25
25
  type __VLS_WithSlots<T, S> = T & {
26
26
  new (): {
@@ -6,7 +6,7 @@ import theme from "#build/ui/carousel";
6
6
  import { computed, ref, watch, onMounted } from "vue";
7
7
  import useEmblaCarousel from "embla-carousel-vue";
8
8
  import { Primitive, useForwardProps } from "reka-ui";
9
- import { reactivePick, computedAsync } from "@vueuse/core";
9
+ import { reactivePick } from "@vueuse/core";
10
10
  import { useAppConfig } from "#imports";
11
11
  import { useLocale } from "../composables/useLocale";
12
12
  import { tv } from "../utils/tv";
@@ -62,34 +62,36 @@ const options = computed(() => ({
62
62
  axis: props.orientation === "horizontal" ? "x" : "y",
63
63
  direction: dir.value === "rtl" ? "rtl" : "ltr"
64
64
  }));
65
- const plugins = computedAsync(async () => {
66
- const plugins2 = [];
65
+ const plugins = ref([]);
66
+ async function loadPlugins() {
67
+ const emblaPlugins = [];
67
68
  if (props.autoplay) {
68
69
  const AutoplayPlugin = await import("embla-carousel-autoplay").then((r) => r.default);
69
- plugins2.push(AutoplayPlugin(typeof props.autoplay === "boolean" ? {} : props.autoplay));
70
+ emblaPlugins.push(AutoplayPlugin(typeof props.autoplay === "boolean" ? {} : props.autoplay));
70
71
  }
71
72
  if (props.autoScroll) {
72
73
  const AutoScrollPlugin = await import("embla-carousel-auto-scroll").then((r) => r.default);
73
- plugins2.push(AutoScrollPlugin(typeof props.autoScroll === "boolean" ? {} : props.autoScroll));
74
+ emblaPlugins.push(AutoScrollPlugin(typeof props.autoScroll === "boolean" ? {} : props.autoScroll));
74
75
  }
75
76
  if (props.autoHeight) {
76
77
  const AutoHeightPlugin = await import("embla-carousel-auto-height").then((r) => r.default);
77
- plugins2.push(AutoHeightPlugin(typeof props.autoHeight === "boolean" ? {} : props.autoHeight));
78
+ emblaPlugins.push(AutoHeightPlugin(typeof props.autoHeight === "boolean" ? {} : props.autoHeight));
78
79
  }
79
80
  if (props.classNames) {
80
81
  const ClassNamesPlugin = await import("embla-carousel-class-names").then((r) => r.default);
81
- plugins2.push(ClassNamesPlugin(typeof props.classNames === "boolean" ? {} : props.classNames));
82
+ emblaPlugins.push(ClassNamesPlugin(typeof props.classNames === "boolean" ? {} : props.classNames));
82
83
  }
83
84
  if (props.fade) {
84
85
  const FadePlugin = await import("embla-carousel-fade").then((r) => r.default);
85
- plugins2.push(FadePlugin(typeof props.fade === "boolean" ? {} : props.fade));
86
+ emblaPlugins.push(FadePlugin(typeof props.fade === "boolean" ? {} : props.fade));
86
87
  }
87
88
  if (props.wheelGestures) {
88
89
  const { WheelGesturesPlugin } = await import("embla-carousel-wheel-gestures");
89
- plugins2.push(WheelGesturesPlugin(typeof props.wheelGestures === "boolean" ? {} : props.wheelGestures));
90
+ emblaPlugins.push(WheelGesturesPlugin(typeof props.wheelGestures === "boolean" ? {} : props.wheelGestures));
90
91
  }
91
- return plugins2;
92
- });
92
+ plugins.value = emblaPlugins;
93
+ }
94
+ watch(() => [props.autoplay, props.autoScroll, props.autoHeight, props.classNames, props.fade, props.wheelGestures], loadPlugins, { immediate: true });
93
95
  const [emblaRef, emblaApi] = useEmblaCarousel(options.value, plugins.value);
94
96
  watch([options, plugins], () => {
95
97
  emblaApi.value?.reInit(options.value, plugins.value);
@@ -162,8 +164,7 @@ defineExpose({
162
164
  <div
163
165
  v-for="(item, index) in items"
164
166
  :key="index"
165
- role="group"
166
- aria-roledescription="slide"
167
+ v-bind="dots ? { role: 'tabpanel' } : { 'role': 'group', 'aria-roledescription': 'slide' }"
167
168
  :class="ui.item({ class: [props.ui?.item, isCarouselItem(item) && item.ui?.item, isCarouselItem(item) && item.class] })"
168
169
  >
169
170
  <slot :item="item" :index="index" />
@@ -195,10 +196,13 @@ defineExpose({
195
196
  />
196
197
  </div>
197
198
 
198
- <div v-if="dots" :class="ui.dots({ class: props.ui?.dots })">
199
+ <div v-if="dots" role="tablist" :aria-label="t('carousel.dots')" :class="ui.dots({ class: props.ui?.dots })">
199
200
  <template v-for="(_, index) in scrollSnaps" :key="index">
200
201
  <button
202
+ type="button"
203
+ role="tab"
201
204
  :aria-label="t('carousel.goto', { slide: index + 1 })"
205
+ :aria-selected="selectedIndex === index"
202
206
  :class="ui.dot({ class: props.ui?.dot, active: selectedIndex === index })"
203
207
  :data-state="selectedIndex === index ? 'active' : void 0"
204
208
  @click="scrollTo(index)"