@nuxt/ui 4.7.0 → 4.8.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 (355) hide show
  1. package/.nuxt/{ui.css → ui.static.css} +0 -10
  2. package/LICENSE.md +1 -1
  3. package/cli/commands/make/component.mjs +6 -2
  4. package/cli/templates.mjs +46 -20
  5. package/cli/utils.mjs +19 -0
  6. package/dist/module.json +1 -1
  7. package/dist/module.mjs +4 -4
  8. package/dist/runtime/components/Accordion.vue +15 -14
  9. package/dist/runtime/components/Alert.vue +20 -20
  10. package/dist/runtime/components/AuthForm.vue +37 -37
  11. package/dist/runtime/components/Avatar.d.vue.ts +4 -0
  12. package/dist/runtime/components/Avatar.vue +14 -12
  13. package/dist/runtime/components/Avatar.vue.d.ts +4 -0
  14. package/dist/runtime/components/AvatarGroup.d.vue.ts +4 -0
  15. package/dist/runtime/components/AvatarGroup.vue +11 -8
  16. package/dist/runtime/components/AvatarGroup.vue.d.ts +4 -0
  17. package/dist/runtime/components/Badge.vue +11 -11
  18. package/dist/runtime/components/Banner.vue +25 -23
  19. package/dist/runtime/components/BlogPost.d.vue.ts +1 -1
  20. package/dist/runtime/components/BlogPost.vue +30 -28
  21. package/dist/runtime/components/BlogPost.vue.d.ts +1 -1
  22. package/dist/runtime/components/BlogPosts.vue +6 -6
  23. package/dist/runtime/components/Breadcrumb.d.vue.ts +4 -0
  24. package/dist/runtime/components/Breadcrumb.vue +21 -18
  25. package/dist/runtime/components/Breadcrumb.vue.d.ts +4 -0
  26. package/dist/runtime/components/Button.vue +17 -16
  27. package/dist/runtime/components/Calendar.vue +21 -20
  28. package/dist/runtime/components/Card.vue +11 -11
  29. package/dist/runtime/components/Carousel.vue +23 -22
  30. package/dist/runtime/components/ChangelogVersion.vue +31 -29
  31. package/dist/runtime/components/ChangelogVersions.vue +8 -8
  32. package/dist/runtime/components/ChatMessage.d.vue.ts +6 -0
  33. package/dist/runtime/components/ChatMessage.vue +46 -36
  34. package/dist/runtime/components/ChatMessage.vue.d.ts +6 -0
  35. package/dist/runtime/components/ChatMessages.vue +14 -14
  36. package/dist/runtime/components/ChatPalette.vue +6 -6
  37. package/dist/runtime/components/ChatPrompt.d.vue.ts +7 -0
  38. package/dist/runtime/components/ChatPrompt.vue +22 -12
  39. package/dist/runtime/components/ChatPrompt.vue.d.ts +7 -0
  40. package/dist/runtime/components/ChatPromptSubmit.d.vue.ts +3 -3
  41. package/dist/runtime/components/ChatPromptSubmit.vue +6 -6
  42. package/dist/runtime/components/ChatPromptSubmit.vue.d.ts +3 -3
  43. package/dist/runtime/components/ChatReasoning.vue +20 -20
  44. package/dist/runtime/components/ChatShimmer.vue +7 -7
  45. package/dist/runtime/components/ChatTool.d.vue.ts +1 -1
  46. package/dist/runtime/components/ChatTool.vue +19 -19
  47. package/dist/runtime/components/ChatTool.vue.d.ts +1 -1
  48. package/dist/runtime/components/Checkbox.d.vue.ts +2 -0
  49. package/dist/runtime/components/Checkbox.vue +25 -24
  50. package/dist/runtime/components/Checkbox.vue.d.ts +2 -0
  51. package/dist/runtime/components/CheckboxGroup.d.vue.ts +1 -1
  52. package/dist/runtime/components/CheckboxGroup.vue +17 -14
  53. package/dist/runtime/components/CheckboxGroup.vue.d.ts +1 -1
  54. package/dist/runtime/components/Chip.vue +8 -8
  55. package/dist/runtime/components/Collapsible.vue +8 -7
  56. package/dist/runtime/components/ColorPicker.d.vue.ts +2 -0
  57. package/dist/runtime/components/ColorPicker.vue +10 -10
  58. package/dist/runtime/components/ColorPicker.vue.d.ts +2 -0
  59. package/dist/runtime/components/CommandPalette.d.vue.ts +5 -5
  60. package/dist/runtime/components/CommandPalette.vue +92 -69
  61. package/dist/runtime/components/CommandPalette.vue.d.ts +5 -5
  62. package/dist/runtime/components/Container.vue +4 -4
  63. package/dist/runtime/components/ContextMenu.vue +16 -15
  64. package/dist/runtime/components/DashboardGroup.d.vue.ts +1 -1
  65. package/dist/runtime/components/DashboardGroup.vue +6 -4
  66. package/dist/runtime/components/DashboardGroup.vue.d.ts +1 -1
  67. package/dist/runtime/components/DashboardNavbar.vue +16 -16
  68. package/dist/runtime/components/DashboardPanel.vue +7 -7
  69. package/dist/runtime/components/DashboardResizeHandle.vue +5 -5
  70. package/dist/runtime/components/DashboardSearch.d.vue.ts +16 -1
  71. package/dist/runtime/components/DashboardSearch.vue +13 -11
  72. package/dist/runtime/components/DashboardSearch.vue.d.ts +16 -1
  73. package/dist/runtime/components/DashboardSearchButton.d.vue.ts +2 -2
  74. package/dist/runtime/components/DashboardSearchButton.vue +15 -15
  75. package/dist/runtime/components/DashboardSearchButton.vue.d.ts +2 -2
  76. package/dist/runtime/components/DashboardSidebar.d.vue.ts +1 -1
  77. package/dist/runtime/components/DashboardSidebar.vue +22 -22
  78. package/dist/runtime/components/DashboardSidebar.vue.d.ts +1 -1
  79. package/dist/runtime/components/DashboardSidebarCollapse.d.vue.ts +1 -1
  80. package/dist/runtime/components/DashboardSidebarCollapse.vue +5 -5
  81. package/dist/runtime/components/DashboardSidebarCollapse.vue.d.ts +1 -1
  82. package/dist/runtime/components/DashboardSidebarToggle.d.vue.ts +1 -1
  83. package/dist/runtime/components/DashboardSidebarToggle.vue +5 -5
  84. package/dist/runtime/components/DashboardSidebarToggle.vue.d.ts +1 -1
  85. package/dist/runtime/components/DashboardToolbar.vue +6 -6
  86. package/dist/runtime/components/Drawer.d.vue.ts +1 -1
  87. package/dist/runtime/components/Drawer.vue +23 -22
  88. package/dist/runtime/components/Drawer.vue.d.ts +1 -1
  89. package/dist/runtime/components/DropdownMenu.vue +21 -20
  90. package/dist/runtime/components/Editor.vue +8 -7
  91. package/dist/runtime/components/EditorDragHandle.d.vue.ts +2 -2
  92. package/dist/runtime/components/EditorDragHandle.vue +8 -8
  93. package/dist/runtime/components/EditorDragHandle.vue.d.ts +2 -2
  94. package/dist/runtime/components/EditorToolbar.vue +10 -9
  95. package/dist/runtime/components/Empty.vue +14 -14
  96. package/dist/runtime/components/Error.d.vue.ts +9 -1
  97. package/dist/runtime/components/Error.vue +17 -10
  98. package/dist/runtime/components/Error.vue.d.ts +9 -1
  99. package/dist/runtime/components/FieldGroup.vue +4 -4
  100. package/dist/runtime/components/FileUpload.vue +36 -37
  101. package/dist/runtime/components/Footer.vue +10 -10
  102. package/dist/runtime/components/FooterColumns.vue +15 -15
  103. package/dist/runtime/components/Form.d.vue.ts +1 -1
  104. package/dist/runtime/components/Form.vue +5 -5
  105. package/dist/runtime/components/Form.vue.d.ts +1 -1
  106. package/dist/runtime/components/FormField.d.vue.ts +2 -1
  107. package/dist/runtime/components/FormField.vue +21 -21
  108. package/dist/runtime/components/FormField.vue.d.ts +2 -1
  109. package/dist/runtime/components/Header.vue +19 -19
  110. package/dist/runtime/components/Input.vue +19 -19
  111. package/dist/runtime/components/InputDate.vue +21 -20
  112. package/dist/runtime/components/InputMenu.d.vue.ts +52 -51
  113. package/dist/runtime/components/InputMenu.vue +66 -63
  114. package/dist/runtime/components/InputMenu.vue.d.ts +52 -51
  115. package/dist/runtime/components/InputNumber.vue +25 -24
  116. package/dist/runtime/components/InputTags.vue +26 -25
  117. package/dist/runtime/components/InputTime.vue +21 -20
  118. package/dist/runtime/components/Kbd.vue +5 -5
  119. package/dist/runtime/components/Link.d.vue.ts +11 -2
  120. package/dist/runtime/components/Link.vue +13 -4
  121. package/dist/runtime/components/Link.vue.d.ts +11 -2
  122. package/dist/runtime/components/Listbox.d.vue.ts +13 -9
  123. package/dist/runtime/components/Listbox.vue +34 -32
  124. package/dist/runtime/components/Listbox.vue.d.ts +13 -9
  125. package/dist/runtime/components/Main.vue +4 -4
  126. package/dist/runtime/components/Marquee.vue +5 -5
  127. package/dist/runtime/components/Modal.d.vue.ts +2 -2
  128. package/dist/runtime/components/Modal.vue +25 -24
  129. package/dist/runtime/components/Modal.vue.d.ts +2 -2
  130. package/dist/runtime/components/NavigationMenu.vue +66 -65
  131. package/dist/runtime/components/Page.vue +7 -7
  132. package/dist/runtime/components/PageAnchors.vue +11 -11
  133. package/dist/runtime/components/PageAside.vue +9 -9
  134. package/dist/runtime/components/PageBody.vue +4 -4
  135. package/dist/runtime/components/PageCTA.vue +18 -16
  136. package/dist/runtime/components/PageCard.vue +25 -23
  137. package/dist/runtime/components/PageColumns.vue +4 -4
  138. package/dist/runtime/components/PageFeature.vue +17 -15
  139. package/dist/runtime/components/PageGrid.vue +4 -4
  140. package/dist/runtime/components/PageHeader.vue +14 -14
  141. package/dist/runtime/components/PageHero.vue +20 -18
  142. package/dist/runtime/components/PageLinks.vue +12 -12
  143. package/dist/runtime/components/PageList.vue +4 -4
  144. package/dist/runtime/components/PageLogos.vue +16 -16
  145. package/dist/runtime/components/PageSection.d.vue.ts +1 -1
  146. package/dist/runtime/components/PageSection.vue +24 -22
  147. package/dist/runtime/components/PageSection.vue.d.ts +1 -1
  148. package/dist/runtime/components/Pagination.d.vue.ts +2 -2
  149. package/dist/runtime/components/Pagination.vue +23 -22
  150. package/dist/runtime/components/Pagination.vue.d.ts +2 -2
  151. package/dist/runtime/components/PinInput.vue +15 -14
  152. package/dist/runtime/components/Popover.vue +9 -8
  153. package/dist/runtime/components/PricingPlan.vue +36 -36
  154. package/dist/runtime/components/PricingPlans.vue +6 -6
  155. package/dist/runtime/components/PricingTable.vue +44 -44
  156. package/dist/runtime/components/Progress.d.vue.ts +1 -1
  157. package/dist/runtime/components/Progress.vue +12 -11
  158. package/dist/runtime/components/Progress.vue.d.ts +1 -1
  159. package/dist/runtime/components/RadioGroup.d.vue.ts +2 -0
  160. package/dist/runtime/components/RadioGroup.vue +28 -27
  161. package/dist/runtime/components/RadioGroup.vue.d.ts +2 -0
  162. package/dist/runtime/components/ScrollArea.vue +13 -13
  163. package/dist/runtime/components/Select.vue +38 -40
  164. package/dist/runtime/components/SelectMenu.d.vue.ts +46 -46
  165. package/dist/runtime/components/SelectMenu.vue +49 -48
  166. package/dist/runtime/components/SelectMenu.vue.d.ts +46 -46
  167. package/dist/runtime/components/Separator.d.vue.ts +9 -3
  168. package/dist/runtime/components/Separator.vue +29 -16
  169. package/dist/runtime/components/Separator.vue.d.ts +9 -3
  170. package/dist/runtime/components/Sidebar.vue +28 -28
  171. package/dist/runtime/components/Skeleton.vue +5 -5
  172. package/dist/runtime/components/Slideover.d.vue.ts +3 -3
  173. package/dist/runtime/components/Slideover.vue +24 -23
  174. package/dist/runtime/components/Slideover.vue.d.ts +3 -3
  175. package/dist/runtime/components/Slider.vue +16 -15
  176. package/dist/runtime/components/Stepper.vue +19 -18
  177. package/dist/runtime/components/Switch.d.vue.ts +2 -0
  178. package/dist/runtime/components/Switch.vue +26 -23
  179. package/dist/runtime/components/Switch.vue.d.ts +2 -0
  180. package/dist/runtime/components/Table.vue +26 -25
  181. package/dist/runtime/components/Tabs.vue +22 -21
  182. package/dist/runtime/components/Textarea.vue +19 -18
  183. package/dist/runtime/components/Theme.d.vue.ts +13 -5
  184. package/dist/runtime/components/Theme.vue +32 -4
  185. package/dist/runtime/components/Theme.vue.d.ts +13 -5
  186. package/dist/runtime/components/Timeline.vue +15 -15
  187. package/dist/runtime/components/Toast.vue +35 -34
  188. package/dist/runtime/components/Toaster.d.vue.ts +1 -1
  189. package/dist/runtime/components/Toaster.vue +10 -9
  190. package/dist/runtime/components/Toaster.vue.d.ts +1 -1
  191. package/dist/runtime/components/Tooltip.vue +13 -12
  192. package/dist/runtime/components/Tree.vue +24 -23
  193. package/dist/runtime/components/User.vue +23 -21
  194. package/dist/runtime/components/color-mode/ColorModeAvatar.vue +5 -2
  195. package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +1 -1
  196. package/dist/runtime/components/color-mode/ColorModeButton.vue +8 -6
  197. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +1 -1
  198. package/dist/runtime/components/color-mode/ColorModeImage.vue +4 -2
  199. package/dist/runtime/components/color-mode/ColorModeSwitch.vue +1 -0
  200. package/dist/runtime/components/content/ContentNavigation.vue +31 -30
  201. package/dist/runtime/components/content/ContentSearch.d.vue.ts +30 -3
  202. package/dist/runtime/components/content/ContentSearch.vue +66 -32
  203. package/dist/runtime/components/content/ContentSearch.vue.d.ts +30 -3
  204. package/dist/runtime/components/content/ContentSearchButton.d.vue.ts +2 -2
  205. package/dist/runtime/components/content/ContentSearchButton.vue +15 -15
  206. package/dist/runtime/components/content/ContentSearchButton.vue.d.ts +2 -2
  207. package/dist/runtime/components/content/ContentSurround.vue +14 -12
  208. package/dist/runtime/components/content/ContentToc.vue +34 -33
  209. package/dist/runtime/components/prose/A.vue +4 -4
  210. package/dist/runtime/components/prose/Accordion.vue +4 -4
  211. package/dist/runtime/components/prose/AccordionItem.vue +5 -5
  212. package/dist/runtime/components/prose/Badge.vue +4 -4
  213. package/dist/runtime/components/prose/Blockquote.vue +4 -4
  214. package/dist/runtime/components/prose/Callout.vue +8 -8
  215. package/dist/runtime/components/prose/Card.vue +12 -12
  216. package/dist/runtime/components/prose/CardGroup.vue +4 -4
  217. package/dist/runtime/components/prose/Code.vue +4 -4
  218. package/dist/runtime/components/prose/CodeCollapse.vue +8 -8
  219. package/dist/runtime/components/prose/CodeGroup.vue +9 -9
  220. package/dist/runtime/components/prose/CodePreview.vue +6 -6
  221. package/dist/runtime/components/prose/CodeTree.vue +14 -14
  222. package/dist/runtime/components/prose/Collapsible.vue +7 -7
  223. package/dist/runtime/components/prose/Em.vue +4 -4
  224. package/dist/runtime/components/prose/Field.vue +13 -13
  225. package/dist/runtime/components/prose/FieldGroup.vue +4 -4
  226. package/dist/runtime/components/prose/H1.vue +5 -5
  227. package/dist/runtime/components/prose/H2.vue +7 -7
  228. package/dist/runtime/components/prose/H3.vue +7 -7
  229. package/dist/runtime/components/prose/H4.vue +5 -5
  230. package/dist/runtime/components/prose/Hr.vue +4 -4
  231. package/dist/runtime/components/prose/Icon.vue +4 -4
  232. package/dist/runtime/components/prose/Img.vue +17 -12
  233. package/dist/runtime/components/prose/Kbd.d.vue.ts +10 -2
  234. package/dist/runtime/components/prose/Kbd.vue +8 -5
  235. package/dist/runtime/components/prose/Kbd.vue.d.ts +10 -2
  236. package/dist/runtime/components/prose/Li.vue +4 -4
  237. package/dist/runtime/components/prose/Ol.vue +4 -4
  238. package/dist/runtime/components/prose/P.vue +4 -4
  239. package/dist/runtime/components/prose/Pre.vue +9 -9
  240. package/dist/runtime/components/prose/Prompt.vue +12 -12
  241. package/dist/runtime/components/prose/Steps.vue +4 -4
  242. package/dist/runtime/components/prose/Strong.vue +4 -4
  243. package/dist/runtime/components/prose/Table.vue +5 -5
  244. package/dist/runtime/components/prose/Tabs.vue +4 -4
  245. package/dist/runtime/components/prose/TabsItem.vue +5 -5
  246. package/dist/runtime/components/prose/Tbody.vue +4 -4
  247. package/dist/runtime/components/prose/Td.vue +4 -4
  248. package/dist/runtime/components/prose/Th.vue +4 -4
  249. package/dist/runtime/components/prose/Thead.vue +4 -4
  250. package/dist/runtime/components/prose/Tr.vue +4 -4
  251. package/dist/runtime/components/prose/Ul.vue +4 -4
  252. package/dist/runtime/composables/defineShortcuts.js +7 -2
  253. package/dist/runtime/composables/index.d.ts +1 -2
  254. package/dist/runtime/composables/index.js +1 -2
  255. package/dist/runtime/composables/useAvatarGroup.d.ts +12 -1
  256. package/dist/runtime/composables/useAvatarGroup.js +4 -2
  257. package/dist/runtime/composables/useComponentIcons.js +1 -1
  258. package/dist/runtime/composables/useComponentProps.d.ts +180 -0
  259. package/dist/runtime/composables/useComponentProps.js +59 -0
  260. package/dist/runtime/composables/useContentSearch.d.ts +4 -2
  261. package/dist/runtime/composables/useContentSearch.js +64 -7
  262. package/dist/runtime/composables/useFieldGroup.d.ts +9 -1
  263. package/dist/runtime/composables/useFormField.d.ts +21 -1
  264. package/dist/runtime/composables/useForwardProps.d.ts +13 -0
  265. package/dist/runtime/composables/useForwardProps.js +14 -0
  266. package/dist/runtime/composables/usePrefix.d.ts +6 -0
  267. package/dist/runtime/composables/usePrefix.js +11 -0
  268. package/dist/runtime/composables/useResizable.d.ts +4 -0
  269. package/dist/runtime/composables/useResizable.js +1 -1
  270. package/dist/runtime/locale/ar.js +1 -0
  271. package/dist/runtime/locale/az.js +1 -0
  272. package/dist/runtime/locale/be.js +1 -0
  273. package/dist/runtime/locale/bg.js +1 -0
  274. package/dist/runtime/locale/bn.js +1 -0
  275. package/dist/runtime/locale/ca.js +1 -0
  276. package/dist/runtime/locale/ckb.js +1 -0
  277. package/dist/runtime/locale/cs.js +1 -0
  278. package/dist/runtime/locale/da.js +1 -0
  279. package/dist/runtime/locale/de.js +1 -0
  280. package/dist/runtime/locale/de_ch.js +1 -0
  281. package/dist/runtime/locale/el.js +1 -0
  282. package/dist/runtime/locale/en.js +1 -0
  283. package/dist/runtime/locale/es.js +1 -0
  284. package/dist/runtime/locale/et.js +1 -0
  285. package/dist/runtime/locale/eu.js +1 -0
  286. package/dist/runtime/locale/fa_ir.js +1 -0
  287. package/dist/runtime/locale/fi.js +1 -0
  288. package/dist/runtime/locale/fr.js +1 -0
  289. package/dist/runtime/locale/gl.js +1 -0
  290. package/dist/runtime/locale/he.js +1 -0
  291. package/dist/runtime/locale/hi.js +1 -0
  292. package/dist/runtime/locale/hr.js +1 -0
  293. package/dist/runtime/locale/hu.js +1 -0
  294. package/dist/runtime/locale/hy.js +1 -0
  295. package/dist/runtime/locale/id.js +1 -0
  296. package/dist/runtime/locale/is.js +1 -0
  297. package/dist/runtime/locale/it.js +1 -0
  298. package/dist/runtime/locale/ja.js +1 -0
  299. package/dist/runtime/locale/ka.js +1 -0
  300. package/dist/runtime/locale/kk.js +1 -0
  301. package/dist/runtime/locale/km.js +1 -0
  302. package/dist/runtime/locale/ko.js +1 -0
  303. package/dist/runtime/locale/ky.js +1 -0
  304. package/dist/runtime/locale/lb.js +1 -0
  305. package/dist/runtime/locale/lo.js +1 -0
  306. package/dist/runtime/locale/lt.js +1 -0
  307. package/dist/runtime/locale/mn.js +1 -0
  308. package/dist/runtime/locale/ms.js +1 -0
  309. package/dist/runtime/locale/nb_no.js +1 -0
  310. package/dist/runtime/locale/nl.js +1 -0
  311. package/dist/runtime/locale/pl.js +1 -0
  312. package/dist/runtime/locale/pt.js +1 -0
  313. package/dist/runtime/locale/pt_br.js +1 -0
  314. package/dist/runtime/locale/ro.js +1 -0
  315. package/dist/runtime/locale/ru.js +1 -0
  316. package/dist/runtime/locale/sk.js +1 -0
  317. package/dist/runtime/locale/sl.js +1 -0
  318. package/dist/runtime/locale/sq.js +1 -0
  319. package/dist/runtime/locale/sv.js +1 -0
  320. package/dist/runtime/locale/th.js +1 -0
  321. package/dist/runtime/locale/tj.js +1 -0
  322. package/dist/runtime/locale/tr.js +1 -0
  323. package/dist/runtime/locale/ug_cn.js +1 -0
  324. package/dist/runtime/locale/uk.js +1 -0
  325. package/dist/runtime/locale/ur.js +1 -0
  326. package/dist/runtime/locale/uz.js +1 -0
  327. package/dist/runtime/locale/vi.js +1 -0
  328. package/dist/runtime/locale/zh_cn.js +1 -0
  329. package/dist/runtime/locale/zh_tw.js +1 -0
  330. package/dist/runtime/plugins/colors.js +1 -1
  331. package/dist/runtime/types/content.d.ts +1 -0
  332. package/dist/runtime/types/content.js +1 -0
  333. package/dist/runtime/types/form.d.ts +2 -2
  334. package/dist/runtime/types/locale.d.ts +1 -0
  335. package/dist/runtime/utils/dashboard.d.ts +1 -1
  336. package/dist/runtime/utils/link.d.ts +1 -1
  337. package/dist/runtime/utils/link.js +1 -0
  338. package/dist/runtime/utils/{fuse.d.ts → search.d.ts} +2 -1
  339. package/dist/runtime/utils/{fuse.js → search.js} +11 -2
  340. package/dist/runtime/vue/components/color-mode/ColorModeSwitch.vue +1 -0
  341. package/dist/runtime/vue/overrides/inertia/Link.d.vue.ts +1 -1
  342. package/dist/runtime/vue/overrides/inertia/Link.vue +5 -0
  343. package/dist/runtime/vue/overrides/inertia/Link.vue.d.ts +1 -1
  344. package/dist/runtime/vue/overrides/none/Link.d.vue.ts +1 -1
  345. package/dist/runtime/vue/overrides/none/Link.vue.d.ts +1 -1
  346. package/dist/runtime/vue/overrides/vue-router/Link.d.vue.ts +1 -1
  347. package/dist/runtime/vue/overrides/vue-router/Link.vue.d.ts +1 -1
  348. package/dist/shared/{ui.BIQuJqNV.mjs → ui.CoJ8bnb0.mjs} +244 -83
  349. package/dist/unplugin.mjs +1 -1
  350. package/dist/vite.mjs +1 -1
  351. package/package.json +27 -34
  352. package/dist/runtime/composables/useComponentUI.d.ts +0 -33
  353. package/dist/runtime/composables/useComponentUI.js +0 -13
  354. package/dist/runtime/composables/useResolvedVariants.d.ts +0 -21
  355. package/dist/runtime/composables/useResolvedVariants.js +0 -14
@@ -1,13 +1,3 @@
1
- @source "/home/runner/work/ui/ui/**/*";
2
- @source inline("isolate");
3
- @source "./ui";
4
-
5
- @layer base {
6
- body {
7
- @apply antialiased text-default bg-default scheme-light dark:scheme-dark;
8
- }
9
- }
10
-
11
1
  @theme static {
12
2
  --color-old-neutral-50: oklch(98.5% 0 0);
13
3
  --color-old-neutral-100: oklch(97% 0 0);
package/LICENSE.md CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2023 NuxtLabs
3
+ Copyright (c) 2023 Nuxt
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
6
 
@@ -3,7 +3,7 @@ import { resolve } from 'pathe'
3
3
  import { defineCommand } from 'citty'
4
4
  import { consola } from 'consola'
5
5
  import { splitByCase, upperFirst, camelCase, kebabCase } from 'scule'
6
- import { appendFile, sortFile } from '../../utils.mjs'
6
+ import { appendFile, appendThemeDefault, sortFile } from '../../utils.mjs'
7
7
  import templates from '../../templates.mjs'
8
8
 
9
9
  export default defineCommand({
@@ -75,8 +75,12 @@ export default defineCommand({
75
75
 
76
76
  if (!args.prose) {
77
77
  const typesPath = resolve(path, 'src/runtime/types/index.ts')
78
- await appendFile(typesPath, `export * from '../components/${args.content ? 'content/' : ''}${splitByCase(name).map(p => upperFirst(p)).join('')}.vue'`)
78
+ const pascal = splitByCase(name).map(p => upperFirst(p)).join('')
79
+ await appendFile(typesPath, `export * from '../components/${args.content ? 'content/' : ''}${pascal}.vue'`)
79
80
  await sortFile(typesPath)
81
+
82
+ const useComponentPropsPath = resolve(path, 'src/runtime/composables/useComponentProps.ts')
83
+ await appendThemeDefault(useComponentPropsPath, camelCase(name), `${pascal}Props`)
80
84
  }
81
85
  }
82
86
  })
package/cli/templates.mjs CHANGED
@@ -20,18 +20,28 @@ const component = ({ name, primitive, prose, content }) => {
20
20
  const upperName = splitByCase(name).map(p => upperFirst(p)).join('')
21
21
  const camelName = camelCase(name)
22
22
  const kebabName = kebabCase(name)
23
+ const nested = prose || content
24
+ const dirPrefix = prose ? 'prose/' : (content ? 'content/' : '')
25
+ const importPrefix = nested ? '../..' : '..'
26
+ const componentKey = prose ? `prose.${camelName}` : camelName
27
+ const componentConfigArgs = prose
28
+ ? `typeof theme, AppConfig, '${camelName}', 'ui.prose'`
29
+ : `typeof theme, AppConfig, '${camelName}'`
30
+ const appConfigLookup = prose
31
+ ? `appConfig.ui?.prose?.${camelName}`
32
+ : `appConfig.ui?.${camelName}`
23
33
 
24
34
  return {
25
- filename: `src/runtime/components/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${upperName}.vue`,
35
+ filename: `src/runtime/components/${dirPrefix}${upperName}.vue`,
26
36
  contents: primitive
27
37
  ? `
28
38
  <script lang="ts">
29
39
  import type { VNode } from 'vue'
30
40
  import type { AppConfig } from '@nuxt/schema'
31
- import theme from '#build/ui/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
32
- import type { ComponentConfig } from '../types/tv'
41
+ import theme from '#build/ui/${dirPrefix}${kebabName}'
42
+ import type { ComponentConfig } from '${importPrefix}/types/tv'
33
43
 
34
- type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'>
44
+ type ${upperName} = ComponentConfig<${componentConfigArgs}>
35
45
 
36
46
  export interface ${upperName}Props {
37
47
  /**
@@ -52,18 +62,22 @@ export interface ${upperName}Slots {
52
62
  import { computed } from 'vue'
53
63
  import { Primitive } from 'reka-ui'
54
64
  import { useAppConfig } from '#imports'
55
- import { tv } from '../utils/tv'
65
+ import { useComponentProps } from '${importPrefix}/composables/useComponentProps'
66
+ import { tv } from '${importPrefix}/utils/tv'
56
67
 
57
- const props = defineProps<${upperName}Props>()
68
+ const _props = defineProps<${upperName}Props>()
58
69
  defineSlots<${upperName}Slots>()
59
70
 
71
+ const props = useComponentProps('${componentKey}', _props)
72
+
60
73
  const appConfig = useAppConfig() as ${upperName}['AppConfig']
61
74
 
62
- const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
75
+ // eslint-disable-next-line vue/no-dupe-keys
76
+ const ui = computed(() => tv({ extend: tv(theme), ...(${appConfigLookup} || {}) })())
63
77
  </script>
64
78
 
65
79
  <template>
66
- <Primitive :as="as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
80
+ <Primitive :as="props.as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
67
81
  <slot />
68
82
  </Primitive>
69
83
  </template>
@@ -71,42 +85,54 @@ const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName}
71
85
  : `
72
86
  <script lang="ts">
73
87
  import type { ${upperName}RootProps, ${upperName}RootEmits } from 'reka-ui'
88
+ import type { VNode } from 'vue'
74
89
  import type { AppConfig } from '@nuxt/schema'
75
- import theme from '#build/ui/${prose ? 'prose/' : ''}${content ? 'content/' : ''}${kebabName}'
76
- import type { ComponentConfig } from '../types/tv'
90
+ import theme from '#build/ui/${dirPrefix}${kebabName}'
91
+ import type { ComponentConfig } from '${importPrefix}/types/tv'
77
92
 
78
- type ${upperName} = ComponentConfig<typeof theme, AppConfig, '${camelName}'>
93
+ type ${upperName} = ComponentConfig<${componentConfigArgs}>
79
94
 
80
- export interface ${upperName}Props extends Pick<${upperName}RootProps> {
95
+ // TODO: narrow with \`Pick<${upperName}RootProps, '...' | '...'>\` to expose only the props you need.
96
+ export interface ${upperName}Props extends ${upperName}RootProps {
81
97
  class?: any
82
98
  ui?: ${upperName}['slots']
83
99
  }
84
100
 
85
101
  export interface ${upperName}Emits extends ${upperName}RootEmits {}
86
102
 
87
- export interface ${upperName}Slots {}
103
+ export interface ${upperName}Slots {
104
+ default?(props?: {}): VNode[]
105
+ }
88
106
  </script>
89
107
 
90
108
  <script setup lang="ts">
91
109
  import { computed } from 'vue'
92
- import { ${upperName}Root, useForwardPropsEmits } from 'reka-ui'
110
+ import { ${upperName}Root } from 'reka-ui'
93
111
  import { reactivePick } from '@vueuse/core'
94
112
  import { useAppConfig } from '#imports'
95
- import { tv } from '../utils/tv'
113
+ import { useComponentProps } from '${importPrefix}/composables/useComponentProps'
114
+ import { useForwardProps } from '${importPrefix}/composables/useForwardProps'
115
+ import { tv } from '${importPrefix}/utils/tv'
96
116
 
97
- const props = defineProps<${upperName}Props>()
117
+ const _props = defineProps<${upperName}Props>()
98
118
  const emits = defineEmits<${upperName}Emits>()
99
- const slots = defineSlots<${upperName}Slots>()
119
+ defineSlots<${upperName}Slots>()
120
+
121
+ const props = useComponentProps('${componentKey}', _props)
100
122
 
101
123
  const appConfig = useAppConfig() as ${upperName}['AppConfig']
102
124
 
103
- const rootProps = useForwardPropsEmits(reactivePick(props), emits)
125
+ // TODO: list the same keys as in \`${upperName}Props\` Pick.
126
+ const rootProps = useForwardProps(reactivePick(props, 'as'), emits)
104
127
 
105
- const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.${camelName} || {}) })())
128
+ // eslint-disable-next-line vue/no-dupe-keys
129
+ const ui = computed(() => tv({ extend: tv(theme), ...(${appConfigLookup} || {}) })())
106
130
  </script>
107
131
 
108
132
  <template>
109
- <${upperName}Root v-bind="rootProps" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })" />
133
+ <${upperName}Root v-bind="rootProps" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
134
+ <slot />
135
+ </${upperName}Root>
110
136
  </template>
111
137
  `
112
138
  }
package/cli/utils.mjs CHANGED
@@ -16,6 +16,25 @@ export async function appendFile(path, contents) {
16
16
  }
17
17
  }
18
18
 
19
+ /**
20
+ * Insert a `key?: Partial<ComponentTypes.XProps>` entry into the `ThemeDefaults`
21
+ * interface in `src/runtime/composables/useComponentProps.ts`, keeping entries
22
+ * sorted alphabetically and avoiding duplicates.
23
+ */
24
+ export async function appendThemeDefault(path, key, propsType) {
25
+ const file = await fsp.readFile(path, 'utf-8')
26
+ const entry = ` ${key}?: Partial<ComponentTypes.${propsType}>`
27
+
28
+ const match = file.match(/(export interface ThemeDefaults \{\n)([\s\S]*?)(\n\})/)
29
+ if (!match) return
30
+
31
+ const [, header, body, footer] = match
32
+ if (body.split('\n').includes(entry)) return
33
+
34
+ const sorted = [...body.split('\n'), entry].sort().join('\n')
35
+ await fsp.writeFile(path, file.replace(match[0], header + sorted + footer))
36
+ }
37
+
19
38
  export function normalizeLocale(locale) {
20
39
  if (!locale) {
21
40
  return ''
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuxt/ui",
3
- "version": "4.7.0",
3
+ "version": "4.8.0",
4
4
  "docs": "https://ui.nuxt.com/docs/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, addPlugin, hasNuxtModule, addComponentsDir, addImportsDir, addImports } from '@nuxt/kit';
3
- import { d as defaultOptions, r as resolveColors, a as getDefaultConfig, p as publicComposables, b as addTemplates } from './shared/ui.BIQuJqNV.mjs';
3
+ import { d as defaultOptions, r as resolveColors, g as getDefaultConfig, p as publicComposables, a as addTemplates } from './shared/ui.CoJ8bnb0.mjs';
4
4
  import '../dist/runtime/utils/index.js';
5
5
  import 'node:url';
6
6
  import 'scule';
@@ -11,7 +11,7 @@ import 'pathe';
11
11
  import 'tinyglobby';
12
12
 
13
13
  const name = "@nuxt/ui";
14
- const version = "4.7.0";
14
+ const version = "4.8.0";
15
15
 
16
16
  const module$1 = defineNuxtModule({
17
17
  meta: {
@@ -50,7 +50,7 @@ const module$1 = defineNuxtModule({
50
50
  }
51
51
  },
52
52
  "@nuxtjs/mdc": {
53
- optional: !userUiOptions.mdc && !userUiOptions.content,
53
+ optional: !userUiOptions.mdc,
54
54
  defaults: {
55
55
  highlight: {
56
56
  theme: {
@@ -142,7 +142,7 @@ const module$1 = defineNuxtModule({
142
142
  });
143
143
  addImports(
144
144
  Object.entries(publicComposables).flatMap(
145
- ([file, exports$1]) => exports$1.map((name2) => ({ name: name2, from: resolve(`./runtime/composables/${file}`) }))
145
+ ([file, exports]) => exports.map((name2) => ({ name: name2, from: resolve(`./runtime/composables/${file}`) }))
146
146
  )
147
147
  );
148
148
  addTemplates(options, nuxt, resolve);
@@ -4,14 +4,15 @@ import theme from "#build/ui/accordion";
4
4
 
5
5
  <script setup>
6
6
  import { computed } from "vue";
7
- import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent, useForwardPropsEmits } from "reka-ui";
7
+ import { AccordionRoot, AccordionItem, AccordionHeader, AccordionTrigger, AccordionContent } from "reka-ui";
8
+ import { useForwardProps } from "../composables/useForwardProps";
8
9
  import { reactivePick } from "@vueuse/core";
9
10
  import { useAppConfig } from "#imports";
10
- import { useComponentUI } from "../composables/useComponentUI";
11
+ import { useComponentProps } from "../composables/useComponentProps";
11
12
  import { get } from "../utils";
12
13
  import { tv } from "../utils/tv";
13
14
  import UIcon from "./Icon.vue";
14
- const props = defineProps({
15
+ const _props = defineProps({
15
16
  as: { type: null, required: false },
16
17
  items: { type: Array, required: false },
17
18
  trailingIcon: { type: null, required: false },
@@ -28,16 +29,16 @@ const props = defineProps({
28
29
  });
29
30
  const emits = defineEmits(["update:modelValue"]);
30
31
  const slots = defineSlots();
32
+ const props = useComponentProps("accordion", _props);
31
33
  const appConfig = useAppConfig();
32
- const uiProp = useComponentUI("accordion", props);
33
- const rootProps = useForwardPropsEmits(reactivePick(props, "as", "collapsible", "defaultValue", "disabled", "modelValue", "unmountOnHide"), emits);
34
+ const rootProps = useForwardProps(reactivePick(props, "as", "collapsible", "defaultValue", "disabled", "modelValue", "unmountOnHide"), emits);
34
35
  const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.accordion || {} })({
35
36
  disabled: props.disabled
36
37
  }));
37
38
  </script>
38
39
 
39
40
  <template>
40
- <AccordionRoot v-bind="rootProps" :type="type" data-slot="root" :class="ui.root({ class: [uiProp?.root, props.class] })">
41
+ <AccordionRoot v-bind="rootProps" :type="props.type" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
41
42
  <AccordionItem
42
43
  v-for="(item, index) in props.items"
43
44
  v-slot="{ open }"
@@ -45,27 +46,27 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.accordion ||
45
46
  :value="get(item, props.valueKey) ?? String(index)"
46
47
  :disabled="item.disabled"
47
48
  data-slot="item"
48
- :class="ui.item({ class: [uiProp?.item, item.ui?.item, item.class] })"
49
+ :class="ui.item({ class: [props.ui?.item, item.ui?.item, item.class] })"
49
50
  >
50
- <AccordionHeader as="div" data-slot="header" :class="ui.header({ class: [uiProp?.header, item.ui?.header] })">
51
- <AccordionTrigger data-slot="trigger" :class="ui.trigger({ class: [uiProp?.trigger, item.ui?.trigger], disabled: item.disabled })">
51
+ <AccordionHeader as="div" data-slot="header" :class="ui.header({ class: [props.ui?.header, item.ui?.header] })">
52
+ <AccordionTrigger data-slot="trigger" :class="ui.trigger({ class: [props.ui?.trigger, item.ui?.trigger], disabled: item.disabled })">
52
53
  <slot name="leading" :item="item" :index="index" :open="open" :ui="ui">
53
- <UIcon v-if="item.icon" :name="item.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: [uiProp?.leadingIcon, item?.ui?.leadingIcon] })" />
54
+ <UIcon v-if="item.icon" :name="item.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: [props.ui?.leadingIcon, item?.ui?.leadingIcon] })" />
54
55
  </slot>
55
56
 
56
- <span v-if="get(item, props.labelKey) || !!slots.default" data-slot="label" :class="ui.label({ class: [uiProp?.label, item.ui?.label] })">
57
+ <span v-if="get(item, props.labelKey) || !!slots.default" data-slot="label" :class="ui.label({ class: [props.ui?.label, item.ui?.label] })">
57
58
  <slot :item="item" :index="index" :open="open">{{ get(item, props.labelKey) }}</slot>
58
59
  </span>
59
60
 
60
61
  <slot name="trailing" :item="item" :index="index" :open="open" :ui="ui">
61
- <UIcon :name="item.trailingIcon || trailingIcon || appConfig.ui.icons.chevronDown" data-slot="trailingIcon" :class="ui.trailingIcon({ class: [uiProp?.trailingIcon, item.ui?.trailingIcon] })" />
62
+ <UIcon :name="item.trailingIcon || props.trailingIcon || appConfig.ui.icons.chevronDown" data-slot="trailingIcon" :class="ui.trailingIcon({ class: [props.ui?.trailingIcon, item.ui?.trailingIcon] })" />
62
63
  </slot>
63
64
  </AccordionTrigger>
64
65
  </AccordionHeader>
65
66
 
66
- <AccordionContent v-if="item.content || !!slots.content || item.slot && !!slots[item.slot] || !!slots.body || item.slot && !!slots[`${item.slot}-body`]" data-slot="content" :class="ui.content({ class: [uiProp?.content, item.ui?.content] })">
67
+ <AccordionContent v-if="item.content || !!slots.content || item.slot && !!slots[item.slot] || !!slots.body || item.slot && !!slots[`${item.slot}-body`]" data-slot="content" :class="ui.content({ class: [props.ui?.content, item.ui?.content] })">
67
68
  <slot :name="item.slot || 'content'" :item="item" :index="index" :open="open" :ui="ui">
68
- <div data-slot="body" :class="ui.body({ class: [uiProp?.body, item.ui?.body] })">
69
+ <div data-slot="body" :class="ui.body({ class: [props.ui?.body, item.ui?.body] })">
69
70
  <slot :name="item.slot ? `${item.slot}-body` : 'body'" :item="item" :index="index" :open="open" :ui="ui">
70
71
  {{ item.content }}
71
72
  </slot>
@@ -6,13 +6,13 @@ import theme from "#build/ui/alert";
6
6
  import { computed } from "vue";
7
7
  import { Primitive } from "reka-ui";
8
8
  import { useAppConfig } from "#imports";
9
- import { useComponentUI } from "../composables/useComponentUI";
9
+ import { useComponentProps } from "../composables/useComponentProps";
10
10
  import { useLocale } from "../composables/useLocale";
11
11
  import { tv } from "../utils/tv";
12
12
  import UIcon from "./Icon.vue";
13
13
  import UAvatar from "./Avatar.vue";
14
14
  import UButton from "./Button.vue";
15
- const props = defineProps({
15
+ const _props = defineProps({
16
16
  as: { type: null, required: false },
17
17
  title: { type: String, required: false },
18
18
  description: { type: String, required: false },
@@ -29,9 +29,9 @@ const props = defineProps({
29
29
  });
30
30
  const emits = defineEmits(["update:open"]);
31
31
  const slots = defineSlots();
32
+ const props = useComponentProps("alert", _props);
32
33
  const { t } = useLocale();
33
34
  const appConfig = useAppConfig();
34
- const uiProp = useComponentUI("alert", props);
35
35
  const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.alert || {} })({
36
36
  color: props.color,
37
37
  variant: props.variant,
@@ -41,48 +41,48 @@ const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.alert || {} }
41
41
  </script>
42
42
 
43
43
  <template>
44
- <Primitive :as="as" :data-orientation="orientation" data-slot="root" :class="ui.root({ class: [uiProp?.root, props.class] })">
44
+ <Primitive :as="props.as" :data-orientation="props.orientation" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
45
45
  <slot name="leading" :ui="ui">
46
- <UAvatar v-if="avatar" :size="uiProp?.avatarSize || ui.avatarSize()" v-bind="avatar" data-slot="avatar" :class="ui.avatar({ class: uiProp?.avatar })" />
47
- <UIcon v-else-if="icon" :name="icon" data-slot="icon" :class="ui.icon({ class: uiProp?.icon })" />
46
+ <UAvatar v-if="props.avatar" :size="props.ui?.avatarSize || ui.avatarSize()" v-bind="props.avatar" data-slot="avatar" :class="ui.avatar({ class: props.ui?.avatar })" />
47
+ <UIcon v-else-if="props.icon" :name="props.icon" data-slot="icon" :class="ui.icon({ class: props.ui?.icon })" />
48
48
  </slot>
49
49
 
50
- <div data-slot="wrapper" :class="ui.wrapper({ class: uiProp?.wrapper })">
51
- <div v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class: uiProp?.title })">
50
+ <div data-slot="wrapper" :class="ui.wrapper({ class: props.ui?.wrapper })">
51
+ <div v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
52
52
  <slot name="title">
53
- {{ title }}
53
+ {{ props.title }}
54
54
  </slot>
55
55
  </div>
56
- <div v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class: uiProp?.description })">
56
+ <div v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
57
57
  <slot name="description">
58
- {{ description }}
58
+ {{ props.description }}
59
59
  </slot>
60
60
  </div>
61
61
 
62
- <div v-if="orientation === 'vertical' && (actions?.length || !!slots.actions)" data-slot="actions" :class="ui.actions({ class: uiProp?.actions })">
62
+ <div v-if="props.orientation === 'vertical' && (props.actions?.length || !!slots.actions)" data-slot="actions" :class="ui.actions({ class: props.ui?.actions })">
63
63
  <slot name="actions">
64
- <UButton v-for="(action, index) in actions" :key="index" size="xs" v-bind="action" />
64
+ <UButton v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
65
65
  </slot>
66
66
  </div>
67
67
  </div>
68
68
 
69
- <div v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions) || close" data-slot="actions" :class="ui.actions({ class: uiProp?.actions, orientation: 'horizontal' })">
70
- <template v-if="orientation === 'horizontal' && (actions?.length || !!slots.actions)">
69
+ <div v-if="props.orientation === 'horizontal' && (props.actions?.length || !!slots.actions) || props.close" data-slot="actions" :class="ui.actions({ class: props.ui?.actions, orientation: 'horizontal' })">
70
+ <template v-if="props.orientation === 'horizontal' && (props.actions?.length || !!slots.actions)">
71
71
  <slot name="actions">
72
- <UButton v-for="(action, index) in actions" :key="index" size="xs" v-bind="action" />
72
+ <UButton v-for="(action, index) in props.actions" :key="index" size="xs" v-bind="action" />
73
73
  </slot>
74
74
  </template>
75
75
 
76
76
  <slot name="close" :ui="ui">
77
77
  <UButton
78
- v-if="close"
79
- :icon="closeIcon || appConfig.ui.icons.close"
78
+ v-if="props.close"
79
+ :icon="props.closeIcon || appConfig.ui.icons.close"
80
80
  color="neutral"
81
81
  variant="link"
82
82
  :aria-label="t('alert.close')"
83
- v-bind="typeof close === 'object' ? close : {}"
83
+ v-bind="typeof props.close === 'object' ? props.close : {}"
84
84
  data-slot="close"
85
- :class="ui.close({ class: uiProp?.close })"
85
+ :class="ui.close({ class: props.ui?.close })"
86
86
  @click="emits('update:open', false)"
87
87
  />
88
88
  </slot>
@@ -6,7 +6,7 @@ import theme from "#build/ui/auth-form";
6
6
  import { reactive, ref, computed, useTemplateRef } from "vue";
7
7
  import { Primitive } from "reka-ui";
8
8
  import { useAppConfig } from "#imports";
9
- import { useComponentUI } from "../composables/useComponentUI";
9
+ import { useComponentProps } from "../composables/useComponentProps";
10
10
  import { useLocale } from "../composables/useLocale";
11
11
  import { omit, pick } from "../utils";
12
12
  import { tv } from "../utils/tv";
@@ -20,7 +20,7 @@ import USelectMenu from "./SelectMenu.vue";
20
20
  import UInput from "./Input.vue";
21
21
  import UPinInput from "./PinInput.vue";
22
22
  defineOptions({ inheritAttrs: false });
23
- const props = defineProps({
23
+ const _props = defineProps({
24
24
  as: { type: null, required: false },
25
25
  icon: { type: null, required: false },
26
26
  title: { type: String, required: false },
@@ -40,7 +40,7 @@ const props = defineProps({
40
40
  onSubmit: { type: Function, required: false },
41
41
  ui: { type: Object, required: false }
42
42
  });
43
- const state = reactive((props.fields || []).reduce((acc, field) => {
43
+ const state = reactive((_props.fields || []).reduce((acc, field) => {
44
44
  if (field.name) {
45
45
  acc[field.name] = field.defaultValue;
46
46
  }
@@ -48,9 +48,9 @@ const state = reactive((props.fields || []).reduce((acc, field) => {
48
48
  }, {}));
49
49
  defineEmits(["submit"]);
50
50
  const slots = defineSlots();
51
+ const props = useComponentProps("authForm", _props);
51
52
  const { t } = useLocale();
52
53
  const appConfig = useAppConfig();
53
- const uiProp = useComponentUI("authForm", props);
54
54
  const ui = computed(() => tv({ extend: tv(theme), ...appConfig.ui?.authForm || {} })());
55
55
  const formRef = useTemplateRef("formRef");
56
56
  const passwordVisibility = ref(false);
@@ -79,34 +79,34 @@ defineExpose({
79
79
  </script>
80
80
 
81
81
  <template>
82
- <Primitive :as="as" data-slot="root" :class="ui.root({ class: [uiProp?.root, props.class] })">
83
- <div v-if="icon || !!slots.leading || (title || !!slots.title) || (description || !!slots.description) || !!slots.header" data-slot="header" :class="ui.header({ class: uiProp?.header })">
82
+ <Primitive :as="props.as" data-slot="root" :class="ui.root({ class: [props.ui?.root, props.class] })">
83
+ <div v-if="props.icon || !!slots.leading || (props.title || !!slots.title) || (props.description || !!slots.description) || !!slots.header" data-slot="header" :class="ui.header({ class: props.ui?.header })">
84
84
  <slot name="header">
85
- <div v-if="icon || !!slots.leading" data-slot="leading" :class="ui.leading({ class: uiProp?.leading })">
85
+ <div v-if="props.icon || !!slots.leading" data-slot="leading" :class="ui.leading({ class: props.ui?.leading })">
86
86
  <slot name="leading" :ui="ui">
87
- <UIcon v-if="icon" :name="icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: uiProp?.leadingIcon })" />
87
+ <UIcon v-if="props.icon" :name="props.icon" data-slot="leadingIcon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
88
88
  </slot>
89
89
  </div>
90
90
 
91
- <div v-if="title || !!slots.title" data-slot="title" :class="ui.title({ class: uiProp?.title })">
91
+ <div v-if="props.title || !!slots.title" data-slot="title" :class="ui.title({ class: props.ui?.title })">
92
92
  <slot name="title">
93
- {{ title }}
93
+ {{ props.title }}
94
94
  </slot>
95
95
  </div>
96
96
 
97
- <div v-if="description || !!slots.description" data-slot="description" :class="ui.description({ class: uiProp?.description })">
97
+ <div v-if="props.description || !!slots.description" data-slot="description" :class="ui.description({ class: props.ui?.description })">
98
98
  <slot name="description">
99
- {{ description }}
99
+ {{ props.description }}
100
100
  </slot>
101
101
  </div>
102
102
  </slot>
103
103
  </div>
104
104
 
105
- <div data-slot="body" :class="ui.body({ class: uiProp?.body })">
106
- <div v-if="providers?.length || !!slots.providers" data-slot="providers" :class="ui.providers({ class: uiProp?.providers })">
105
+ <div data-slot="body" :class="ui.body({ class: props.ui?.body })">
106
+ <div v-if="props.providers?.length || !!slots.providers" data-slot="providers" :class="ui.providers({ class: props.ui?.providers })">
107
107
  <slot name="providers">
108
108
  <UButton
109
- v-for="(provider, index) in providers"
109
+ v-for="(provider, index) in props.providers"
110
110
  :key="index"
111
111
  block
112
112
  color="neutral"
@@ -118,29 +118,29 @@ defineExpose({
118
118
 
119
119
  <slot name="separator">
120
120
  <USeparator
121
- v-if="providers?.length && fields?.length"
122
- v-bind="typeof separator === 'object' ? separator : { label: separator }"
121
+ v-if="props.providers?.length && props.fields?.length"
122
+ v-bind="typeof props.separator === 'object' ? props.separator : { label: props.separator }"
123
123
  data-slot="separator"
124
- :class="ui.separator({ class: uiProp?.separator })"
124
+ :class="ui.separator({ class: props.ui?.separator })"
125
125
  />
126
126
  </slot>
127
127
 
128
128
  <UForm
129
- v-if="fields?.length"
129
+ v-if="props.fields?.length"
130
130
  ref="formRef"
131
131
  :state="state"
132
- :schema="schema"
133
- :validate="validate"
134
- :validate-on="validateOn"
135
- :disabled="disabled"
136
- :loading-auto="loadingAuto"
132
+ :schema="props.schema"
133
+ :validate="props.validate"
134
+ :validate-on="props.validateOn"
135
+ :disabled="props.disabled"
136
+ :loading-auto="props.loadingAuto"
137
137
  data-slot="form"
138
- :class="ui.form({ class: uiProp?.form })"
138
+ :class="ui.form({ class: props.ui?.form })"
139
139
  v-bind="$attrs"
140
- @submit="onSubmit"
140
+ @submit="props.onSubmit"
141
141
  >
142
142
  <UFormField
143
- v-for="field in fields"
143
+ v-for="field in props.fields"
144
144
  :key="field.name"
145
145
  v-bind="pickFieldProps(field)"
146
146
  >
@@ -149,14 +149,14 @@ defineExpose({
149
149
  v-if="field.type === 'checkbox'"
150
150
  v-model="state[field.name]"
151
151
  data-slot="checkbox"
152
- :class="ui.checkbox({ class: uiProp?.checkbox })"
152
+ :class="ui.checkbox({ class: props.ui?.checkbox })"
153
153
  v-bind="omitFieldProps(field)"
154
154
  />
155
155
  <USelectMenu
156
156
  v-else-if="field.type === 'select'"
157
157
  v-model="state[field.name]"
158
158
  data-slot="select"
159
- :class="ui.select({ class: uiProp?.select })"
159
+ :class="ui.select({ class: props.ui?.select })"
160
160
  v-bind="omitFieldProps(field)"
161
161
  />
162
162
  <UPinInput
@@ -164,7 +164,7 @@ defineExpose({
164
164
  :id="field.name"
165
165
  v-model="state[field.name]"
166
166
  data-slot="otp"
167
- :class="ui.otp({ class: uiProp?.otp })"
167
+ :class="ui.otp({ class: props.ui?.otp })"
168
168
  v-bind="Object.assign({}, omitFieldProps(field), typeof field.otp === 'object' ? field.otp : {})"
169
169
  otp
170
170
  />
@@ -173,7 +173,7 @@ defineExpose({
173
173
  ref="passwordRef"
174
174
  v-model="state[field.name]"
175
175
  data-slot="password"
176
- :class="ui.password({ class: uiProp?.password })"
176
+ :class="ui.password({ class: props.ui?.password })"
177
177
  v-bind="omitFieldProps(field)"
178
178
  :type="passwordVisibility ? 'text' : 'password'"
179
179
  >
@@ -194,7 +194,7 @@ defineExpose({
194
194
  v-else
195
195
  v-model="state[field.name]"
196
196
  data-slot="input"
197
- :class="ui.input({ class: uiProp?.input })"
197
+ :class="ui.input({ class: props.ui?.input })"
198
198
  v-bind="omitFieldProps(field)"
199
199
  />
200
200
  </slot>
@@ -218,20 +218,20 @@ defineExpose({
218
218
 
219
219
  <slot v-if="!!slots.validation" name="validation" />
220
220
 
221
- <slot name="submit" :loading="loading">
221
+ <slot name="submit" :loading="props.loading">
222
222
  <UButton
223
223
  type="submit"
224
224
  :label="t('authForm.submit')"
225
225
  block
226
- :loading="loading"
227
- :loading-auto="loadingAuto"
228
- v-bind="submit"
226
+ :loading="props.loading"
227
+ :loading-auto="props.loadingAuto"
228
+ v-bind="props.submit"
229
229
  />
230
230
  </slot>
231
231
  </UForm>
232
232
  </div>
233
233
 
234
- <div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: uiProp?.footer })">
234
+ <div v-if="!!slots.footer" data-slot="footer" :class="ui.footer({ class: props.ui?.footer })">
235
235
  <slot name="footer" />
236
236
  </div>
237
237
  </Primitive>
@@ -25,6 +25,10 @@ export interface AvatarProps extends /** @vue-ignore */ Omit<ImgHTMLAttributes,
25
25
  * @defaultValue 'md'
26
26
  */
27
27
  size?: Avatar['variants']['size'];
28
+ /**
29
+ * @defaultValue 'neutral'
30
+ */
31
+ color?: Avatar['variants']['color'];
28
32
  chip?: boolean | ChipProps;
29
33
  class?: any;
30
34
  style?: any;