@nuxt/ui 3.0.1 → 3.1.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 (228) hide show
  1. package/.nuxt/ui/accordion.ts +25 -4
  2. package/.nuxt/ui/alert.ts +52 -31
  3. package/.nuxt/ui/avatar-group.ts +24 -3
  4. package/.nuxt/ui/avatar.ts +26 -5
  5. package/.nuxt/ui/badge.ts +56 -35
  6. package/.nuxt/ui/breadcrumb.ts +28 -7
  7. package/.nuxt/ui/button-group.ts +23 -2
  8. package/.nuxt/ui/button.ts +66 -45
  9. package/.nuxt/ui/calendar.ts +39 -18
  10. package/.nuxt/ui/card.ts +28 -7
  11. package/.nuxt/ui/carousel.ts +29 -8
  12. package/.nuxt/ui/checkbox-group.ts +82 -0
  13. package/.nuxt/ui/checkbox.ts +163 -29
  14. package/.nuxt/ui/chip.ts +31 -10
  15. package/.nuxt/ui/collapsible.ts +23 -2
  16. package/.nuxt/ui/color-picker.ts +26 -5
  17. package/.nuxt/ui/command-palette.ts +37 -16
  18. package/.nuxt/ui/container.ts +24 -3
  19. package/.nuxt/ui/context-menu.ts +56 -35
  20. package/.nuxt/ui/drawer.ts +33 -12
  21. package/.nuxt/ui/dropdown-menu.ts +57 -36
  22. package/.nuxt/ui/form-field.ts +29 -8
  23. package/.nuxt/ui/form.ts +23 -2
  24. package/.nuxt/ui/index.ts +1 -0
  25. package/.nuxt/ui/input-menu.ts +65 -44
  26. package/.nuxt/ui/input-number.ts +43 -22
  27. package/.nuxt/ui/input.ts +46 -25
  28. package/.nuxt/ui/kbd.ts +27 -6
  29. package/.nuxt/ui/link.ts +26 -5
  30. package/.nuxt/ui/modal.ts +28 -7
  31. package/.nuxt/ui/navigation-menu.ts +103 -84
  32. package/.nuxt/ui/pagination.ts +23 -2
  33. package/.nuxt/ui/pin-input.ts +43 -22
  34. package/.nuxt/ui/popover.ts +25 -4
  35. package/.nuxt/ui/progress.ts +40 -19
  36. package/.nuxt/ui/radio-group.ts +273 -37
  37. package/.nuxt/ui/select-menu.ts +59 -35
  38. package/.nuxt/ui/select.ts +55 -34
  39. package/.nuxt/ui/separator.ts +31 -10
  40. package/.nuxt/ui/skeleton.ts +24 -3
  41. package/.nuxt/ui/slideover.ts +27 -6
  42. package/.nuxt/ui/slider.ts +39 -18
  43. package/.nuxt/ui/stepper.ts +41 -20
  44. package/.nuxt/ui/switch.ts +44 -23
  45. package/.nuxt/ui/table.ts +38 -17
  46. package/.nuxt/ui/tabs.ts +55 -34
  47. package/.nuxt/ui/textarea.ts +63 -37
  48. package/.nuxt/ui/toast.ts +47 -26
  49. package/.nuxt/ui/toaster.ts +23 -2
  50. package/.nuxt/ui/tooltip.ts +25 -4
  51. package/.nuxt/ui/tree.ts +41 -20
  52. package/.nuxt/ui.css +56 -12
  53. package/README.md +11 -0
  54. package/cli/templates.mjs +18 -17
  55. package/dist/module.d.mts +2 -1
  56. package/dist/module.json +5 -5
  57. package/dist/module.mjs +11 -7
  58. package/dist/runtime/components/Accordion.vue +36 -92
  59. package/dist/runtime/components/Accordion.vue.d.ts +91 -0
  60. package/dist/runtime/components/Alert.vue +37 -100
  61. package/dist/runtime/components/Alert.vue.d.ts +96 -0
  62. package/dist/runtime/components/App.vue +28 -34
  63. package/dist/runtime/components/App.vue.d.ts +24 -0
  64. package/dist/runtime/components/Avatar.vue +47 -78
  65. package/dist/runtime/components/Avatar.vue.d.ts +60 -0
  66. package/dist/runtime/components/AvatarGroup.vue +40 -77
  67. package/dist/runtime/components/AvatarGroup.vue.d.ts +40 -0
  68. package/dist/runtime/components/Badge.vue +33 -62
  69. package/dist/runtime/components/Badge.vue.d.ts +62 -0
  70. package/dist/runtime/components/Breadcrumb.vue +36 -88
  71. package/dist/runtime/components/Breadcrumb.vue.d.ts +82 -0
  72. package/dist/runtime/components/Button.vue +96 -105
  73. package/dist/runtime/components/Button.vue.d.ts +73 -0
  74. package/dist/runtime/components/ButtonGroup.vue +20 -46
  75. package/dist/runtime/components/ButtonGroup.vue.d.ts +55 -0
  76. package/dist/runtime/components/Calendar.vue +73 -127
  77. package/dist/runtime/components/Calendar.vue.d.ts +107 -0
  78. package/dist/runtime/components/Card.vue +18 -40
  79. package/dist/runtime/components/Card.vue.d.ts +38 -0
  80. package/dist/runtime/components/Carousel.vue +112 -230
  81. package/dist/runtime/components/Carousel.vue.d.ts +120 -0
  82. package/dist/runtime/components/Checkbox.vue +52 -93
  83. package/dist/runtime/components/Checkbox.vue.d.ts +76 -0
  84. package/dist/runtime/components/CheckboxGroup.vue +121 -0
  85. package/dist/runtime/components/CheckboxGroup.vue.d.ts +75 -0
  86. package/dist/runtime/components/Chip.vue +26 -69
  87. package/dist/runtime/components/Chip.vue.d.ts +71 -0
  88. package/dist/runtime/components/Collapsible.vue +22 -41
  89. package/dist/runtime/components/Collapsible.vue.d.ts +50 -0
  90. package/dist/runtime/components/ColorPicker.vue +111 -197
  91. package/dist/runtime/components/ColorPicker.vue.d.ts +63 -0
  92. package/dist/runtime/components/CommandPalette.vue +94 -234
  93. package/dist/runtime/components/CommandPalette.vue.d.ts +173 -0
  94. package/dist/runtime/components/Container.vue +15 -28
  95. package/dist/runtime/components/Container.vue.d.ts +27 -0
  96. package/dist/runtime/components/ContextMenu.vue +32 -119
  97. package/dist/runtime/components/ContextMenu.vue.d.ts +127 -0
  98. package/dist/runtime/components/ContextMenuContent.vue +71 -72
  99. package/dist/runtime/components/ContextMenuContent.vue.d.ts +105 -0
  100. package/dist/runtime/components/Drawer.vue +49 -87
  101. package/dist/runtime/components/Drawer.vue.d.ts +88 -0
  102. package/dist/runtime/components/DropdownMenu.vue +37 -129
  103. package/dist/runtime/components/DropdownMenu.vue.d.ts +141 -0
  104. package/dist/runtime/components/DropdownMenuContent.vue +76 -79
  105. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +55 -0
  106. package/dist/runtime/components/Form.vue +135 -219
  107. package/dist/runtime/components/Form.vue.d.ts +66 -0
  108. package/dist/runtime/components/FormField.vue +36 -77
  109. package/dist/runtime/components/FormField.vue.d.ts +70 -0
  110. package/dist/runtime/components/Icon.vue +12 -19
  111. package/dist/runtime/components/Icon.vue.d.ts +17 -0
  112. package/dist/runtime/components/Input.vue +82 -140
  113. package/dist/runtime/components/Input.vue.d.ts +91 -0
  114. package/dist/runtime/components/InputMenu.vue +193 -302
  115. package/dist/runtime/components/InputMenu.vue.d.ts +312 -0
  116. package/dist/runtime/components/InputNumber.vue +71 -133
  117. package/dist/runtime/components/InputNumber.vue.d.ts +193 -0
  118. package/dist/runtime/components/Kbd.vue +20 -46
  119. package/dist/runtime/components/Kbd.vue.d.ts +55 -0
  120. package/dist/runtime/components/Link.vue +98 -173
  121. package/dist/runtime/components/Link.vue.d.ts +124 -0
  122. package/dist/runtime/components/LinkBase.vue +33 -41
  123. package/dist/runtime/components/LinkBase.vue.d.ts +48 -0
  124. package/dist/runtime/components/Modal.vue +53 -116
  125. package/dist/runtime/components/Modal.vue.d.ts +109 -0
  126. package/dist/runtime/components/NavigationMenu.vue +78 -186
  127. package/dist/runtime/components/NavigationMenu.vue.d.ts +159 -0
  128. package/dist/runtime/components/OverlayProvider.vue +14 -18
  129. package/dist/runtime/components/OverlayProvider.vue.d.ts +2 -0
  130. package/dist/runtime/components/Pagination.vue +46 -140
  131. package/dist/runtime/components/Pagination.vue.d.ts +143 -0
  132. package/dist/runtime/components/PinInput.vue +61 -78
  133. package/dist/runtime/components/PinInput.vue.d.ts +68 -0
  134. package/dist/runtime/components/Popover.vue +47 -84
  135. package/dist/runtime/components/Popover.vue.d.ts +80 -0
  136. package/dist/runtime/components/Progress.vue +70 -131
  137. package/dist/runtime/components/Progress.vue.d.ts +97 -0
  138. package/dist/runtime/components/RadioGroup.vue +75 -126
  139. package/dist/runtime/components/RadioGroup.vue.d.ts +88 -0
  140. package/dist/runtime/components/Select.vue +115 -202
  141. package/dist/runtime/components/Select.vue.d.ts +139 -0
  142. package/dist/runtime/components/SelectMenu.vue +167 -281
  143. package/dist/runtime/components/SelectMenu.vue.d.ts +184 -0
  144. package/dist/runtime/components/Separator.vue +29 -71
  145. package/dist/runtime/components/Separator.vue.d.ts +75 -0
  146. package/dist/runtime/components/Skeleton.vue +21 -23
  147. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  148. package/dist/runtime/components/Slideover.vue +53 -120
  149. package/dist/runtime/components/Slideover.vue.d.ts +111 -0
  150. package/dist/runtime/components/Slider.vue +46 -84
  151. package/dist/runtime/components/Slider.vue.d.ts +71 -0
  152. package/dist/runtime/components/Stepper.vue +44 -113
  153. package/dist/runtime/components/Stepper.vue.d.ts +89 -0
  154. package/dist/runtime/components/Switch.vue +45 -93
  155. package/dist/runtime/components/Switch.vue.d.ts +73 -0
  156. package/dist/runtime/components/Table.vue +165 -264
  157. package/dist/runtime/components/Table.vue.d.ts +183 -0
  158. package/dist/runtime/components/Tabs.vue +40 -105
  159. package/dist/runtime/components/Tabs.vue.d.ts +104 -0
  160. package/dist/runtime/components/Textarea.vue +113 -158
  161. package/dist/runtime/components/Textarea.vue.d.ts +95 -0
  162. package/dist/runtime/components/Toast.vue +49 -110
  163. package/dist/runtime/components/Toast.vue.d.ts +95 -0
  164. package/dist/runtime/components/Toaster.vue +70 -107
  165. package/dist/runtime/components/Toaster.vue.d.ts +63 -0
  166. package/dist/runtime/components/Tooltip.vue +38 -65
  167. package/dist/runtime/components/Tooltip.vue.d.ts +65 -0
  168. package/dist/runtime/components/Tree.vue +57 -150
  169. package/dist/runtime/components/Tree.vue.d.ts +128 -0
  170. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  171. package/dist/runtime/composables/defineShortcuts.js +0 -1
  172. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  173. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  174. package/dist/runtime/composables/useFormField.d.ts +2 -2
  175. package/dist/runtime/composables/useFormField.js +1 -1
  176. package/dist/runtime/composables/useOverlay.d.ts +16 -8
  177. package/dist/runtime/composables/useOverlay.js +14 -6
  178. package/dist/runtime/composables/usePortal.d.ts +6 -0
  179. package/dist/runtime/composables/usePortal.js +17 -0
  180. package/dist/runtime/index.css +1 -1
  181. package/dist/runtime/inertia/components/Link.vue +146 -0
  182. package/dist/runtime/inertia/components/Link.vue.d.ts +92 -0
  183. package/dist/runtime/inertia/stubs.d.ts +43 -0
  184. package/dist/runtime/inertia/stubs.js +82 -0
  185. package/dist/runtime/locale/bg.d.ts +3 -0
  186. package/dist/runtime/locale/bg.js +54 -0
  187. package/dist/runtime/locale/hy.d.ts +3 -0
  188. package/dist/runtime/locale/hy.js +54 -0
  189. package/dist/runtime/locale/index.d.ts +6 -1
  190. package/dist/runtime/locale/index.js +6 -1
  191. package/dist/runtime/locale/kk.d.ts +3 -0
  192. package/dist/runtime/locale/kk.js +54 -0
  193. package/dist/runtime/locale/tj.d.ts +3 -0
  194. package/dist/runtime/locale/tj.js +54 -0
  195. package/dist/runtime/locale/ug_cn.d.ts +3 -0
  196. package/dist/runtime/locale/ug_cn.js +55 -0
  197. package/dist/runtime/types/form.d.ts +5 -1
  198. package/dist/runtime/types/index.d.ts +2 -0
  199. package/dist/runtime/types/index.js +2 -0
  200. package/dist/runtime/types/utils.d.ts +70 -10
  201. package/dist/runtime/utils/index.d.ts +1 -0
  202. package/dist/runtime/utils/index.js +3 -0
  203. package/dist/runtime/utils/link.d.ts +4 -27
  204. package/dist/runtime/utils/link.js +32 -1
  205. package/dist/runtime/utils/tv.js +2 -2
  206. package/dist/runtime/vue/components/Icon.vue +7 -8
  207. package/dist/runtime/vue/components/Icon.vue.d.ts +14 -0
  208. package/dist/runtime/vue/components/Link.vue +118 -199
  209. package/dist/runtime/vue/components/Link.vue.d.ts +124 -0
  210. package/dist/runtime/vue/stubs.d.ts +5 -0
  211. package/dist/runtime/vue/stubs.js +11 -2
  212. package/dist/shared/{ui.BCaWD5Ek.mjs → ui.D7lOOabO.mjs} +623 -364
  213. package/dist/types.d.mts +5 -1
  214. package/dist/unplugin.d.mts +6 -1
  215. package/dist/unplugin.mjs +25 -4
  216. package/dist/vite.mjs +1 -1
  217. package/package.json +122 -64
  218. package/dist/module.cjs +0 -62
  219. package/dist/module.d.cts +0 -44
  220. package/dist/module.d.ts +0 -44
  221. package/dist/shared/ui.C6uTSFTI.cjs +0 -3555
  222. package/dist/types.d.ts +0 -1
  223. package/dist/unplugin.cjs +0 -232
  224. package/dist/unplugin.d.cts +0 -61
  225. package/dist/unplugin.d.ts +0 -61
  226. package/dist/vite.cjs +0 -23
  227. package/dist/vite.d.cts +0 -15
  228. package/dist/vite.d.ts +0 -15
package/.nuxt/ui.css CHANGED
@@ -1,18 +1,19 @@
1
1
  @source "./ui";
2
2
 
3
3
  @theme default {
4
- --color-old-neutral-50: oklch(0.985 0 0);
5
- --color-old-neutral-100: oklch(0.97 0 0);
6
- --color-old-neutral-200: oklch(0.922 0 0);
7
- --color-old-neutral-300: oklch(0.87 0 0);
8
- --color-old-neutral-400: oklch(0.708 0 0);
9
- --color-old-neutral-500: oklch(0.556 0 0);
10
- --color-old-neutral-600: oklch(0.439 0 0);
11
- --color-old-neutral-700: oklch(0.371 0 0);
12
- --color-old-neutral-800: oklch(0.269 0 0);
13
- --color-old-neutral-900: oklch(0.205 0 0);
14
- --color-old-neutral-950: oklch(0.145 0 0);
15
- --color-primary-50: var(--ui-color-primary-50);
4
+ --color-old-neutral-50: oklch(98.5% 0 0);
5
+ --color-old-neutral-100: oklch(97% 0 0);
6
+ --color-old-neutral-200: oklch(92.2% 0 0);
7
+ --color-old-neutral-300: oklch(87% 0 0);
8
+ --color-old-neutral-400: oklch(70.8% 0 0);
9
+ --color-old-neutral-500: oklch(55.6% 0 0);
10
+ --color-old-neutral-600: oklch(43.9% 0 0);
11
+ --color-old-neutral-700: oklch(37.1% 0 0);
12
+ --color-old-neutral-800: oklch(26.9% 0 0);
13
+ --color-old-neutral-900: oklch(20.5% 0 0);
14
+ --color-old-neutral-950: oklch(14.5% 0 0);
15
+ --color-primary: var(--ui-primary);
16
+ --color-primary-50: var(--ui-color-primary-50);
16
17
  --color-primary-100: var(--ui-color-primary-100);
17
18
  --color-primary-200: var(--ui-color-primary-200);
18
19
  --color-primary-300: var(--ui-color-primary-300);
@@ -23,6 +24,7 @@
23
24
  --color-primary-800: var(--ui-color-primary-800);
24
25
  --color-primary-900: var(--ui-color-primary-900);
25
26
  --color-primary-950: var(--ui-color-primary-950);
27
+ --color-secondary: var(--ui-secondary);
26
28
  --color-secondary-50: var(--ui-color-secondary-50);
27
29
  --color-secondary-100: var(--ui-color-secondary-100);
28
30
  --color-secondary-200: var(--ui-color-secondary-200);
@@ -34,6 +36,7 @@
34
36
  --color-secondary-800: var(--ui-color-secondary-800);
35
37
  --color-secondary-900: var(--ui-color-secondary-900);
36
38
  --color-secondary-950: var(--ui-color-secondary-950);
39
+ --color-success: var(--ui-success);
37
40
  --color-success-50: var(--ui-color-success-50);
38
41
  --color-success-100: var(--ui-color-success-100);
39
42
  --color-success-200: var(--ui-color-success-200);
@@ -45,6 +48,7 @@
45
48
  --color-success-800: var(--ui-color-success-800);
46
49
  --color-success-900: var(--ui-color-success-900);
47
50
  --color-success-950: var(--ui-color-success-950);
51
+ --color-info: var(--ui-info);
48
52
  --color-info-50: var(--ui-color-info-50);
49
53
  --color-info-100: var(--ui-color-info-100);
50
54
  --color-info-200: var(--ui-color-info-200);
@@ -56,6 +60,7 @@
56
60
  --color-info-800: var(--ui-color-info-800);
57
61
  --color-info-900: var(--ui-color-info-900);
58
62
  --color-info-950: var(--ui-color-info-950);
63
+ --color-warning: var(--ui-warning);
59
64
  --color-warning-50: var(--ui-color-warning-50);
60
65
  --color-warning-100: var(--ui-color-warning-100);
61
66
  --color-warning-200: var(--ui-color-warning-200);
@@ -67,6 +72,7 @@
67
72
  --color-warning-800: var(--ui-color-warning-800);
68
73
  --color-warning-900: var(--ui-color-warning-900);
69
74
  --color-warning-950: var(--ui-color-warning-950);
75
+ --color-error: var(--ui-error);
70
76
  --color-error-50: var(--ui-color-error-50);
71
77
  --color-error-100: var(--ui-color-error-100);
72
78
  --color-error-200: var(--ui-color-error-200);
@@ -89,4 +95,42 @@
89
95
  --color-neutral-800: var(--ui-color-neutral-800);
90
96
  --color-neutral-900: var(--ui-color-neutral-900);
91
97
  --color-neutral-950: var(--ui-color-neutral-950);
98
+ --radius-xs: calc(var(--ui-radius) * 0.5);
99
+ --radius-sm: var(--ui-radius);
100
+ --radius-md: calc(var(--ui-radius) * 1.5);
101
+ --radius-lg: calc(var(--ui-radius) * 2);
102
+ --radius-xl: calc(var(--ui-radius) * 3);
103
+ --radius-2xl: calc(var(--ui-radius) * 4);
104
+ --radius-3xl: calc(var(--ui-radius) * 6);
105
+ --text-color-dimmed: var(--ui-text-dimmed);
106
+ --text-color-muted: var(--ui-text-muted);
107
+ --text-color-toned: var(--ui-text-toned);
108
+ --text-color-default: var(--ui-text);
109
+ --text-color-highlighted: var(--ui-text-highlighted);
110
+ --text-color-inverted: var(--ui-text-inverted);
111
+ --background-color-default: var(--ui-bg);
112
+ --background-color-muted: var(--ui-bg-muted);
113
+ --background-color-elevated: var(--ui-bg-elevated);
114
+ --background-color-accented: var(--ui-bg-accented);
115
+ --background-color-inverted: var(--ui-bg-inverted);
116
+ --background-color-border: var(--ui-border);
117
+ --border-color-default: var(--ui-border);
118
+ --border-color-muted: var(--ui-border-muted);
119
+ --border-color-accented: var(--ui-border-accented);
120
+ --border-color-inverted: var(--ui-border-inverted);
121
+ --ring-color-default: var(--ui-border);
122
+ --ring-color-muted: var(--ui-border-muted);
123
+ --ring-color-accented: var(--ui-border-accented);
124
+ --ring-color-inverted: var(--ui-border-inverted);
125
+ --ring-color-bg: var(--ui-bg);
126
+ --divide-color-default: var(--ui-border);
127
+ --divide-color-muted: var(--ui-border-muted);
128
+ --divide-color-accented: var(--ui-border-accented);
129
+ --divide-color-inverted: var(--ui-border-inverted);
130
+ --outline-color-default: var(--ui-border);
131
+ --outline-color-inverted: var(--ui-border-inverted);
132
+ --stroke-default: var(--ui-border);
133
+ --stroke-inverted: var(--ui-border-inverted);
134
+ --fill-default: var(--ui-border);
135
+ --fill-inverted: var(--ui-border-inverted);
92
136
  }
package/README.md CHANGED
@@ -104,6 +104,17 @@ app.mount('#app')
104
104
 
105
105
  Learn more in the [installation guide](https://ui.nuxt.com/getting-started/installation/vue).
106
106
 
107
+ ## Contribution
108
+
109
+ Thank you for considering contributing to Nuxt UI. Here are a few ways you can get involved:
110
+
111
+ - Reporting Bugs: If you come across any bugs or issues, please check out the reporting bugs guide to learn how to submit a bug report.
112
+ - Suggestions: Have any thoughts to enhance Nuxt UI? We'd love to hear them! Check out the [contribution guide](https://ui.nuxt.com/getting-started/contribution) to share your suggestions.
113
+
114
+ ## Local Development
115
+
116
+ Follow the docs to [set up your local development environment](https://ui.nuxt.com/getting-started/contribution#local-development) and contribute.
117
+
107
118
  ## Credits
108
119
 
109
120
  - [nuxt/nuxt](https://github.com/nuxt/nuxt)
package/cli/templates.mjs CHANGED
@@ -31,13 +31,10 @@ const component = ({ name, primitive, pro, prose, content }) => {
31
31
  ? `
32
32
  <script lang="ts">
33
33
  import type { AppConfig } from '@nuxt/schema'
34
- import _appConfig from '#build/app.config'
35
34
  import theme from '#build/${path}/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
36
- import { tv } from '${pro ? '#ui/utils/tv' : '../utils/tv'}'
35
+ import type { ComponentConfig } from '../types/utils'
37
36
 
38
- const appConfig${camelName} = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}
39
-
40
- const ${camelName} = tv({ extend: tv(theme), ...(appConfig${camelName}.${key}?.${prose ? 'prose?.' : ''}${camelName} || {}) })
37
+ type ${upperName} = ComponentConfig<typeof theme, AppConfig, ${upperName}${pro ? `, '${key}'` : ''}>
41
38
 
42
39
  export interface ${upperName}Props {
43
40
  /**
@@ -46,7 +43,7 @@ export interface ${upperName}Props {
46
43
  */
47
44
  as?: any
48
45
  class?: any
49
- ui?: Partial<typeof ${camelName}.slots>
46
+ ui?: ${upperName}['slots']
50
47
  }
51
48
 
52
49
  export interface ${upperName}Slots {
@@ -55,12 +52,17 @@ export interface ${upperName}Slots {
55
52
  </script>
56
53
 
57
54
  <script setup lang="ts">
55
+ import { computed } from 'vue'
58
56
  import { Primitive } from 'reka-ui'
57
+ import { useAppConfig } from '#imports'
58
+ import { tv } from '../utils/tv'
59
59
 
60
60
  const props = defineProps<${upperName}Props>()
61
61
  defineSlots<${upperName}Slots>()
62
62
 
63
- const ui = ${camelName}()
63
+ const appConfig = useAppConfig() as ${upperName}['AppConfig']
64
+
65
+ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
64
66
  </script>
65
67
 
66
68
  <template>
@@ -71,22 +73,16 @@ const ui = ${camelName}()
71
73
  `
72
74
  : `
73
75
  <script lang="ts">
74
- import type { VariantProps } from 'tailwind-variants'
75
76
  import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
76
77
  import type { AppConfig } from '@nuxt/schema'
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'}'
80
-
81
- const appConfig${camelName} = _appConfig as AppConfig & { ${key}: { ${prose ? 'prose: { ' : ''}${camelName}: Partial<typeof theme> } }${prose ? ' }' : ''}
79
+ import type { ComponentConfig } from '../types/utils'
82
80
 
83
- const ${camelName} = tv({ extend: tv(theme), ...(appConfig${camelName}.${key}?.${prose ? 'prose?.' : ''}${camelName} || {}) })
84
-
85
- type ${upperName}Variants = VariantProps<typeof ${camelName}>
81
+ type ${upperName} = ComponentConfig<typeof theme, AppConfig, ${upperName}${pro ? `, '${key}'` : ''}>
86
82
 
87
83
  export interface ${upperName}Props extends Pick<${upperName}RootProps> {
88
84
  class?: any
89
- ui?: Partial<typeof ${camelName}.slots>
85
+ ui?: ${upperName}['slots']
90
86
  }
91
87
 
92
88
  export interface ${upperName}Emits extends ${upperName}RootEmits {}
@@ -95,16 +91,21 @@ export interface ${upperName}Slots {}
95
91
  </script>
96
92
 
97
93
  <script setup lang="ts">
94
+ import { computed } from 'vue'
98
95
  import { ${upperName}Root, useForwardPropsEmits } from 'reka-ui'
99
96
  import { reactivePick } from '@vueuse/core'
97
+ import { useAppConfig } from '#imports'
98
+ import { tv } from '../utils/tv'
100
99
 
101
100
  const props = defineProps<${upperName}Props>()
102
101
  const emits = defineEmits<${upperName}Emits>()
103
102
  const slots = defineSlots<${upperName}Slots>()
104
103
 
104
+ const appConfig = useAppConfig() as ${upperName}['AppConfig']
105
+
105
106
  const rootProps = useForwardPropsEmits(reactivePick(props), emits)
106
107
 
107
- const ui = ${camelName}()
108
+ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
108
109
  </script>
109
110
 
110
111
  <template>
package/dist/module.d.mts CHANGED
@@ -41,4 +41,5 @@ interface ModuleOptions {
41
41
  }
42
42
  declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
43
43
 
44
- export { type ModuleOptions, _default as default };
44
+ export { _default as default };
45
+ export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
- "name": "ui",
2
+ "name": "@nuxt/ui",
3
+ "version": "3.1.0",
4
+ "docs": "https://ui.nuxt.com/getting-started/installation/nuxt",
3
5
  "configKey": "ui",
4
6
  "compatibility": {
5
7
  "nuxt": ">=3.16.0"
6
8
  },
7
- "docs": "https://ui.nuxt.com/getting-started/installation/nuxt",
8
- "version": "3.0.1",
9
9
  "builder": {
10
- "@nuxt/module-builder": "0.8.4",
11
- "unbuild": "2.0.0"
10
+ "@nuxt/module-builder": "1.0.1",
11
+ "unbuild": "3.5.0"
12
12
  }
13
13
  }
package/dist/module.mjs CHANGED
@@ -1,19 +1,23 @@
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.BCaWD5Ek.mjs';
3
+ import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates } from './shared/ui.D7lOOabO.mjs';
4
4
  import '../dist/runtime/utils/index.js';
5
5
  import 'node:url';
6
6
  import 'scule';
7
7
  import 'tailwindcss/colors';
8
8
 
9
+ const name = "@nuxt/ui";
10
+ const version = "3.1.0";
11
+
9
12
  const module = defineNuxtModule({
10
13
  meta: {
11
- name: "ui",
14
+ name,
15
+ version,
16
+ docs: "https://ui.nuxt.com/getting-started/installation/nuxt",
12
17
  configKey: "ui",
13
18
  compatibility: {
14
19
  nuxt: ">=3.16.0"
15
- },
16
- docs: "https://ui.nuxt.com/getting-started/installation/nuxt"
20
+ }
17
21
  },
18
22
  defaults: defaultOptions,
19
23
  async setup(options, nuxt) {
@@ -31,9 +35,9 @@ const module = defineNuxtModule({
31
35
  } else {
32
36
  nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
33
37
  }
34
- async function registerModule(name, key, options2) {
35
- if (!hasNuxtModule(name)) {
36
- await installModule(name, options2);
38
+ async function registerModule(name2, key, options2) {
39
+ if (!hasNuxtModule(name2)) {
40
+ await installModule(name2, options2);
37
41
  } else {
38
42
  nuxt.options[key] = defu(nuxt.options[key], options2);
39
43
  }
@@ -1,112 +1,56 @@
1
- <!-- eslint-disable vue/block-tag-newline -->
2
- <script lang="ts">
3
- import type { AccordionRootProps, AccordionRootEmits } from 'reka-ui'
4
- import type { AppConfig } from '@nuxt/schema'
5
- import _appConfig from '#build/app.config'
6
- import theme from '#build/ui/accordion'
7
- import { tv } from '../utils/tv'
8
- import type { DynamicSlots } from '../types/utils'
9
-
10
- const appConfigAccordion = _appConfig as AppConfig & { ui: { accordion: Partial<typeof theme> } }
11
-
12
- const accordion = tv({ extend: tv(theme), ...(appConfigAccordion.ui?.accordion || {}) })
13
-
14
- export interface AccordionItem {
15
- label?: string
16
- /**
17
- * @IconifyIcon
18
- */
19
- icon?: string
20
- /**
21
- * @IconifyIcon
22
- */
23
- trailingIcon?: string
24
- slot?: string
25
- content?: string
26
- /** A unique value for the accordion item. Defaults to the index. */
27
- value?: string
28
- disabled?: boolean
29
- }
30
-
31
- export interface AccordionProps<T> extends Pick<AccordionRootProps, 'collapsible' | 'defaultValue' | 'modelValue' | 'type' | 'disabled' | 'unmountOnHide'> {
32
- /**
33
- * The element or component this component should render as.
34
- * @defaultValue 'div'
35
- */
36
- as?: any
37
- items?: T[]
38
- /**
39
- * The icon displayed on the right side of the trigger.
40
- * @defaultValue appConfig.ui.icons.chevronDown
41
- * @IconifyIcon
42
- */
43
- trailingIcon?: string
44
- /**
45
- * The key used to get the label from the item.
46
- * @defaultValue 'label'
47
- */
48
- labelKey?: string
49
- class?: any
50
- ui?: Partial<typeof accordion.slots>
51
- }
52
-
53
- export interface AccordionEmits extends AccordionRootEmits {}
54
-
55
- type SlotProps<T> = (props: { item: T, index: number, open: boolean }) => any
56
-
57
- export type AccordionSlots<T extends { slot?: string }> = {
58
- leading: SlotProps<T>
59
- default: SlotProps<T>
60
- trailing: SlotProps<T>
61
- content: SlotProps<T>
62
- body: SlotProps<T>
63
- } & DynamicSlots<T, SlotProps<T>>
64
-
1
+ <script>
2
+ import theme from "#build/ui/accordion";
65
3
  </script>
66
4
 
67
- <script setup lang="ts" generic="T extends AccordionItem">
68
- import { computed } from 'vue'
69
- import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent, useForwardPropsEmits } from 'reka-ui'
70
- import { reactivePick } from '@vueuse/core'
71
- import { useAppConfig } from '#imports'
72
- import { get } from '../utils'
73
- import UIcon from './Icon.vue'
74
-
75
- const props = withDefaults(defineProps<AccordionProps<T>>(), {
76
- type: 'single',
77
- collapsible: true,
78
- unmountOnHide: true,
79
- labelKey: 'label'
80
- })
81
- const emits = defineEmits<AccordionEmits>()
82
- const slots = defineSlots<AccordionSlots<T>>()
83
-
84
- const appConfig = useAppConfig()
85
- const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'collapsible', 'defaultValue', 'disabled', 'modelValue', 'type', 'unmountOnHide'), emits)
86
-
87
- const ui = computed(() => accordion({
5
+ <script setup>
6
+ import { computed } from "vue";
7
+ import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent, useForwardPropsEmits } from "reka-ui";
8
+ import { reactivePick } from "@vueuse/core";
9
+ import { useAppConfig } from "#imports";
10
+ import { get } from "../utils";
11
+ import { tv } from "../utils/tv";
12
+ import UIcon from "./Icon.vue";
13
+ const props = defineProps({
14
+ as: { type: null, required: false },
15
+ items: { type: Array, required: false },
16
+ trailingIcon: { type: String, required: false },
17
+ labelKey: { type: String, required: false, default: "label" },
18
+ class: { type: null, required: false },
19
+ ui: { type: null, required: false },
20
+ collapsible: { type: Boolean, required: false, default: true },
21
+ defaultValue: { type: null, required: false },
22
+ modelValue: { type: null, required: false },
23
+ type: { type: String, required: false, default: "single" },
24
+ disabled: { type: Boolean, required: false },
25
+ unmountOnHide: { type: Boolean, required: false, default: true }
26
+ });
27
+ const emits = defineEmits(["update:modelValue"]);
28
+ const slots = defineSlots();
29
+ const appConfig = useAppConfig();
30
+ const rootProps = useForwardPropsEmits(reactivePick(props, "as", "collapsible", "defaultValue", "disabled", "modelValue", "type", "unmountOnHide"), emits);
31
+ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.accordion || {} })({
88
32
  disabled: props.disabled
89
- }))
33
+ }));
90
34
  </script>
91
35
 
92
36
  <template>
93
37
  <AccordionRoot v-bind="rootProps" :class="ui.root({ class: [props.class, props.ui?.root] })">
94
38
  <AccordionItem
95
- v-for="(item, index) in items"
39
+ v-for="(item, index) in props.items"
96
40
  v-slot="{ open }"
97
41
  :key="index"
98
42
  :value="item.value || String(index)"
99
43
  :disabled="item.disabled"
100
44
  :class="ui.item({ class: props.ui?.item })"
101
45
  >
102
- <AccordionHeader :class="ui.header({ class: props.ui?.header })">
46
+ <AccordionHeader as="div" :class="ui.header({ class: props.ui?.header })">
103
47
  <AccordionTrigger :class="ui.trigger({ class: props.ui?.trigger, disabled: item.disabled })">
104
48
  <slot name="leading" :item="item" :index="index" :open="open">
105
49
  <UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
106
50
  </slot>
107
51
 
108
- <span v-if="get(item, props.labelKey as string) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
109
- <slot :item="item" :index="index" :open="open">{{ get(item, props.labelKey as string) }}</slot>
52
+ <span v-if="get(item, props.labelKey) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
53
+ <slot :item="item" :index="index" :open="open">{{ get(item, props.labelKey) }}</slot>
110
54
  </span>
111
55
 
112
56
  <slot name="trailing" :item="item" :index="index" :open="open">
@@ -115,10 +59,10 @@ const ui = computed(() => accordion({
115
59
  </AccordionTrigger>
116
60
  </AccordionHeader>
117
61
 
118
- <AccordionContent v-if="item.content || !!slots.content || (item.slot && !!slots[item.slot]) || !!slots.body || (item.slot && !!slots[`${item.slot}-body`])" :class="ui.content({ class: props.ui?.content })">
62
+ <AccordionContent v-if="item.content || !!slots.content || item.slot && !!slots[item.slot] || !!slots.body || item.slot && !!slots[`${item.slot}-body`]" :class="ui.content({ class: props.ui?.content })">
119
63
  <slot :name="item.slot || 'content'" :item="item" :index="index" :open="open">
120
64
  <div :class="ui.body({ class: props.ui?.body })">
121
- <slot :name="item.slot ? `${item.slot}-body`: 'body'" :item="item" :index="index" :open="open">
65
+ <slot :name="item.slot ? `${item.slot}-body` : 'body'" :item="item" :index="index" :open="open">
122
66
  {{ item.content }}
123
67
  </slot>
124
68
  </div>
@@ -0,0 +1,91 @@
1
+ import type { AccordionRootProps, AccordionRootEmits } from 'reka-ui';
2
+ import type { AppConfig } from '@nuxt/schema';
3
+ import theme from '#build/ui/accordion';
4
+ import type { DynamicSlots, ComponentConfig } from '../types/utils';
5
+ type Accordion = ComponentConfig<typeof theme, AppConfig, 'accordion'>;
6
+ export interface AccordionItem {
7
+ label?: string;
8
+ /**
9
+ * @IconifyIcon
10
+ */
11
+ icon?: string;
12
+ /**
13
+ * @IconifyIcon
14
+ */
15
+ trailingIcon?: string;
16
+ slot?: string;
17
+ content?: string;
18
+ /** A unique value for the accordion item. Defaults to the index. */
19
+ value?: string;
20
+ disabled?: boolean;
21
+ [key: string]: any;
22
+ }
23
+ export interface AccordionProps<T extends AccordionItem = AccordionItem> extends Pick<AccordionRootProps, 'collapsible' | 'defaultValue' | 'modelValue' | 'type' | 'disabled' | 'unmountOnHide'> {
24
+ /**
25
+ * The element or component this component should render as.
26
+ * @defaultValue 'div'
27
+ */
28
+ as?: any;
29
+ items?: T[];
30
+ /**
31
+ * The icon displayed on the right side of the trigger.
32
+ * @defaultValue appConfig.ui.icons.chevronDown
33
+ * @IconifyIcon
34
+ */
35
+ trailingIcon?: string;
36
+ /**
37
+ * The key used to get the label from the item.
38
+ * @defaultValue 'label'
39
+ */
40
+ labelKey?: string;
41
+ class?: any;
42
+ ui?: Accordion['slots'];
43
+ }
44
+ export interface AccordionEmits extends AccordionRootEmits {
45
+ }
46
+ type SlotProps<T extends AccordionItem> = (props: {
47
+ item: T;
48
+ index: number;
49
+ open: boolean;
50
+ }) => any;
51
+ export type AccordionSlots<T extends AccordionItem = AccordionItem> = {
52
+ leading: SlotProps<T>;
53
+ default: SlotProps<T>;
54
+ trailing: SlotProps<T>;
55
+ content: SlotProps<T>;
56
+ body: SlotProps<T>;
57
+ } & DynamicSlots<T, 'body', {
58
+ index: number;
59
+ open: boolean;
60
+ }>;
61
+ declare const _default: <T extends AccordionItem>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
62
+ props: __VLS_PrettifyLocal<any & AccordionProps<T> & Partial<{}>> & (import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps);
63
+ expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
64
+ attrs: any;
65
+ slots: Readonly<{
66
+ leading: SlotProps<T>;
67
+ default: SlotProps<T>;
68
+ trailing: SlotProps<T>;
69
+ content: SlotProps<T>;
70
+ body: SlotProps<T>;
71
+ } & DynamicSlots<T, "body", {
72
+ index: number;
73
+ open: boolean;
74
+ }>> & {
75
+ leading: SlotProps<T>;
76
+ default: SlotProps<T>;
77
+ trailing: SlotProps<T>;
78
+ content: SlotProps<T>;
79
+ body: SlotProps<T>;
80
+ } & DynamicSlots<T, "body", {
81
+ index: number;
82
+ open: boolean;
83
+ }>;
84
+ emit: (evt: "update:modelValue", value: string | string[] | undefined) => void;
85
+ }>) => import("vue").VNode & {
86
+ __ctx?: Awaited<typeof __VLS_setup>;
87
+ };
88
+ export default _default;
89
+ type __VLS_PrettifyLocal<T> = {
90
+ [K in keyof T]: T[K];
91
+ } & {};