@nuxt/ui 3.0.0-alpha.1 → 3.0.0-alpha.10

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 (332) hide show
  1. package/.nuxt/ui/accordion.ts +20 -0
  2. package/.nuxt/ui/alert.ts +242 -0
  3. package/.nuxt/ui/avatar-group.ts +40 -0
  4. package/.nuxt/ui/avatar.ts +42 -0
  5. package/.nuxt/ui/badge.ts +194 -0
  6. package/.nuxt/ui/breadcrumb.ts +45 -0
  7. package/.nuxt/ui/button-group.ts +16 -0
  8. package/.nuxt/ui/button.ts +344 -0
  9. package/.nuxt/ui/calendar.ts +85 -0
  10. package/.nuxt/ui/card.ts +8 -0
  11. package/.nuxt/ui/carousel.ts +41 -0
  12. package/.nuxt/ui/checkbox.ts +105 -0
  13. package/.nuxt/ui/chip.ts +67 -0
  14. package/.nuxt/ui/collapsible.ts +6 -0
  15. package/.nuxt/ui/color-picker.ts +39 -0
  16. package/.nuxt/ui/command-palette.ts +50 -0
  17. package/.nuxt/ui/container.ts +3 -0
  18. package/.nuxt/ui/context-menu.ts +198 -0
  19. package/.nuxt/ui/drawer.ts +55 -0
  20. package/.nuxt/ui/dropdown-menu.ts +199 -0
  21. package/.nuxt/ui/form-field.ts +40 -0
  22. package/.nuxt/ui/form.ts +3 -0
  23. package/.nuxt/ui/index.ts +48 -0
  24. package/.nuxt/ui/input-menu.ts +410 -0
  25. package/.nuxt/ui/input-number.ts +204 -0
  26. package/.nuxt/ui/input.ts +263 -0
  27. package/.nuxt/ui/kbd.ts +19 -0
  28. package/.nuxt/ui/link.ts +15 -0
  29. package/.nuxt/ui/modal.ts +28 -0
  30. package/.nuxt/ui/navigation-menu.ts +390 -0
  31. package/.nuxt/ui/pagination.ts +8 -0
  32. package/.nuxt/ui/pin-input.ts +145 -0
  33. package/.nuxt/ui/popover.ts +6 -0
  34. package/.nuxt/ui/progress.ts +258 -0
  35. package/.nuxt/ui/radio-group.ts +112 -0
  36. package/.nuxt/ui/select-menu.ts +316 -0
  37. package/.nuxt/ui/select.ts +315 -0
  38. package/.nuxt/ui/separator.ts +143 -0
  39. package/.nuxt/ui/skeleton.ts +3 -0
  40. package/.nuxt/ui/slideover.ts +63 -0
  41. package/.nuxt/ui/slider.ts +148 -0
  42. package/.nuxt/ui/stepper.ts +180 -0
  43. package/.nuxt/ui/switch.ts +113 -0
  44. package/.nuxt/ui/table.ts +129 -0
  45. package/.nuxt/ui/tabs.ts +227 -0
  46. package/.nuxt/ui/textarea.ts +263 -0
  47. package/.nuxt/ui/toast.ts +66 -0
  48. package/.nuxt/ui/toaster.ts +75 -0
  49. package/.nuxt/ui/tooltip.ts +9 -0
  50. package/README.md +75 -54
  51. package/cli/commands/{init.mjs → make/component.mjs} +5 -5
  52. package/cli/commands/make/index.mjs +14 -0
  53. package/cli/commands/make/locale.mjs +64 -0
  54. package/cli/index.mjs +2 -2
  55. package/cli/templates.mjs +52 -7
  56. package/cli/utils.mjs +14 -0
  57. package/dist/chunks/component-meta.cjs +82802 -0
  58. package/dist/chunks/component-meta.mjs +82800 -0
  59. package/dist/client/devtools/200.html +1 -0
  60. package/dist/client/devtools/404.html +1 -0
  61. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
  62. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
  63. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
  64. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
  65. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
  66. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
  67. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
  68. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
  69. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
  70. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
  71. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
  72. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
  73. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
  74. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
  75. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
  76. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
  77. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
  78. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
  79. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
  80. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
  81. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
  82. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
  83. package/dist/client/devtools/_nuxt/B1fTd_Rf.js +1 -0
  84. package/dist/client/devtools/_nuxt/CSUxkedg.js +1 -0
  85. package/dist/client/devtools/_nuxt/CbRTGpb7.js +1 -0
  86. package/dist/client/devtools/_nuxt/YQTlxbcT.js +53 -0
  87. package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
  88. package/dist/client/devtools/_nuxt/builds/meta/b3465abc-0a92-4ee7-ba6b-e5174891fcc0.json +1 -0
  89. package/dist/client/devtools/_nuxt/entry.DXXceQev.css +1 -0
  90. package/dist/client/devtools/_nuxt/error-404.BJpkZFyY.css +1 -0
  91. package/dist/client/devtools/_nuxt/error-500.D3i9VDlt.css +1 -0
  92. package/dist/client/devtools/favicon.svg +1 -0
  93. package/dist/client/devtools/index.html +1 -0
  94. package/dist/devtools/runtime/DevtoolsRenderer.vue +54 -0
  95. package/dist/devtools/runtime/examples/AvatarGroupExample.vue +7 -0
  96. package/dist/devtools/runtime/examples/ButtonGroupExample.vue +8 -0
  97. package/dist/devtools/runtime/examples/CardExample.vue +13 -0
  98. package/dist/devtools/runtime/examples/CarouselExample.vue +13 -0
  99. package/dist/devtools/runtime/examples/ChipExample.vue +5 -0
  100. package/dist/devtools/runtime/examples/CollapsibleExample.vue +8 -0
  101. package/dist/devtools/runtime/examples/CommandPaletteExample.vue +29 -0
  102. package/dist/devtools/runtime/examples/ContainerExample.vue +5 -0
  103. package/dist/devtools/runtime/examples/ContextMenuExample.vue +5 -0
  104. package/dist/devtools/runtime/examples/DrawerExample.vue +8 -0
  105. package/dist/devtools/runtime/examples/DropdownMenuExample.vue +5 -0
  106. package/dist/devtools/runtime/examples/FormExample.vue +30 -0
  107. package/dist/devtools/runtime/examples/FormFieldExample.vue +5 -0
  108. package/dist/devtools/runtime/examples/LinkExample.vue +5 -0
  109. package/dist/devtools/runtime/examples/ModalExample.vue +8 -0
  110. package/dist/devtools/runtime/examples/PopoverExample.vue +8 -0
  111. package/dist/devtools/runtime/examples/SkeletonExample.vue +3 -0
  112. package/dist/devtools/runtime/examples/SlideoverExample.vue +8 -0
  113. package/dist/devtools/runtime/examples/StepperExample.vue +44 -0
  114. package/dist/devtools/runtime/examples/ToasterExample.vue +11 -0
  115. package/dist/devtools/runtime/examples/TooltipExample.vue +5 -0
  116. package/dist/module.cjs +223 -4
  117. package/dist/module.d.cts +54 -0
  118. package/dist/module.d.mts +38 -7
  119. package/dist/module.d.ts +38 -7
  120. package/dist/module.json +2 -1
  121. package/dist/module.mjs +179 -2568
  122. package/dist/runtime/components/Accordion.vue +49 -8
  123. package/dist/runtime/components/Alert.vue +13 -6
  124. package/dist/runtime/components/App.vue +20 -7
  125. package/dist/runtime/components/Avatar.vue +33 -9
  126. package/dist/runtime/components/AvatarGroup.vue +4 -1
  127. package/dist/runtime/components/Badge.vue +34 -4
  128. package/dist/runtime/components/Breadcrumb.vue +52 -13
  129. package/dist/runtime/components/Button.vue +45 -6
  130. package/dist/runtime/components/ButtonGroup.vue +5 -2
  131. package/dist/runtime/components/Calendar.vue +190 -0
  132. package/dist/runtime/components/Card.vue +4 -1
  133. package/dist/runtime/components/Carousel.vue +322 -0
  134. package/dist/runtime/components/Checkbox.vue +28 -33
  135. package/dist/runtime/components/Chip.vue +9 -2
  136. package/dist/runtime/components/Collapsible.vue +7 -4
  137. package/dist/runtime/components/ColorPicker.vue +265 -0
  138. package/dist/runtime/components/CommandPalette.vue +122 -96
  139. package/dist/runtime/components/Container.vue +4 -1
  140. package/dist/runtime/components/ContextMenu.vue +101 -14
  141. package/dist/runtime/components/ContextMenuContent.vue +48 -18
  142. package/dist/runtime/components/Drawer.vue +22 -11
  143. package/dist/runtime/components/DropdownMenu.vue +91 -16
  144. package/dist/runtime/components/DropdownMenuContent.vue +50 -18
  145. package/dist/runtime/components/Form.vue +49 -32
  146. package/dist/runtime/components/FormField.vue +18 -6
  147. package/dist/runtime/components/Icon.vue +1 -1
  148. package/dist/runtime/components/Input.vue +15 -6
  149. package/dist/runtime/components/InputMenu.vue +152 -65
  150. package/dist/runtime/components/InputNumber.vue +192 -0
  151. package/dist/runtime/components/Kbd.vue +3 -1
  152. package/dist/runtime/components/Link.vue +71 -8
  153. package/dist/runtime/components/LinkBase.vue +10 -7
  154. package/dist/runtime/components/Modal.vue +23 -11
  155. package/dist/runtime/components/NavigationMenu.vue +170 -75
  156. package/dist/runtime/components/Pagination.vue +31 -15
  157. package/dist/runtime/components/PinInput.vue +96 -0
  158. package/dist/runtime/components/Popover.vue +26 -7
  159. package/dist/runtime/components/Progress.vue +25 -8
  160. package/dist/runtime/components/RadioGroup.vue +28 -7
  161. package/dist/runtime/components/Select.vue +79 -32
  162. package/dist/runtime/components/SelectMenu.vue +164 -80
  163. package/dist/runtime/components/Separator.vue +3 -3
  164. package/dist/runtime/components/Skeleton.vue +4 -1
  165. package/dist/runtime/components/Slideover.vue +23 -11
  166. package/dist/runtime/components/Slider.vue +3 -3
  167. package/dist/runtime/components/Stepper.vue +171 -0
  168. package/dist/runtime/components/Switch.vue +16 -16
  169. package/dist/runtime/components/Table.vue +262 -0
  170. package/dist/runtime/components/Tabs.vue +42 -15
  171. package/dist/runtime/components/Textarea.vue +9 -3
  172. package/dist/runtime/components/Toast.vue +13 -5
  173. package/dist/runtime/components/Toaster.vue +31 -16
  174. package/dist/runtime/components/Tooltip.vue +9 -6
  175. package/dist/runtime/composables/defineLocale.d.ts +9 -0
  176. package/dist/runtime/composables/defineLocale.js +4 -0
  177. package/dist/runtime/composables/defineShortcuts.d.ts +1 -1
  178. package/dist/runtime/composables/defineShortcuts.js +2 -8
  179. package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
  180. package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
  181. package/dist/runtime/composables/useAvatarGroup.d.ts +1 -1
  182. package/dist/runtime/composables/useButtonGroup.d.ts +2 -2
  183. package/dist/runtime/composables/useComponentIcons.d.ts +3 -0
  184. package/dist/runtime/composables/useFormField.d.ts +8 -4
  185. package/dist/runtime/composables/useFormField.js +2 -1
  186. package/dist/runtime/composables/useKbd.d.ts +10 -3
  187. package/dist/runtime/composables/useKbd.js +14 -8
  188. package/dist/runtime/composables/useLocale.d.ts +4 -0
  189. package/dist/runtime/composables/useLocale.js +10 -0
  190. package/dist/runtime/composables/useModal.d.ts +2 -2
  191. package/dist/runtime/composables/useSlideover.d.ts +2 -2
  192. package/dist/runtime/composables/useToast.d.ts +2 -2
  193. package/dist/runtime/index.css +1 -1
  194. package/dist/runtime/keyframes.css +1 -0
  195. package/dist/runtime/locale/ar.d.ts +2 -0
  196. package/dist/runtime/locale/ar.js +53 -0
  197. package/dist/runtime/locale/cs.d.ts +2 -0
  198. package/dist/runtime/locale/cs.js +52 -0
  199. package/dist/runtime/locale/de.d.ts +2 -0
  200. package/dist/runtime/locale/de.js +52 -0
  201. package/dist/runtime/locale/en.d.ts +2 -0
  202. package/dist/runtime/locale/en.js +52 -0
  203. package/dist/runtime/locale/es.d.ts +2 -0
  204. package/dist/runtime/locale/es.js +52 -0
  205. package/dist/runtime/locale/fa_ir.d.ts +2 -0
  206. package/dist/runtime/locale/fa_ir.js +53 -0
  207. package/dist/runtime/locale/fr.d.ts +2 -0
  208. package/dist/runtime/locale/fr.js +52 -0
  209. package/dist/runtime/locale/index.d.ts +19 -0
  210. package/dist/runtime/locale/index.js +19 -0
  211. package/dist/runtime/locale/it.d.ts +2 -0
  212. package/dist/runtime/locale/it.js +52 -0
  213. package/dist/runtime/locale/ja.d.ts +2 -0
  214. package/dist/runtime/locale/ja.js +52 -0
  215. package/dist/runtime/locale/ko.d.ts +2 -0
  216. package/dist/runtime/locale/ko.js +52 -0
  217. package/dist/runtime/locale/nl.d.ts +2 -0
  218. package/dist/runtime/locale/nl.js +52 -0
  219. package/dist/runtime/locale/pl.d.ts +2 -0
  220. package/dist/runtime/locale/pl.js +52 -0
  221. package/dist/runtime/locale/pt.d.ts +2 -0
  222. package/dist/runtime/locale/pt.js +52 -0
  223. package/dist/runtime/locale/pt_br.d.ts +2 -0
  224. package/dist/runtime/locale/pt_br.js +52 -0
  225. package/dist/runtime/locale/ru.d.ts +2 -0
  226. package/dist/runtime/locale/ru.js +52 -0
  227. package/dist/runtime/locale/sk.d.ts +2 -0
  228. package/dist/runtime/locale/sk.js +52 -0
  229. package/dist/runtime/locale/tr.d.ts +2 -0
  230. package/dist/runtime/locale/tr.js +52 -0
  231. package/dist/runtime/locale/zh_hans.d.ts +2 -0
  232. package/dist/runtime/locale/zh_hans.js +52 -0
  233. package/dist/runtime/locale/zh_hant.d.ts +2 -0
  234. package/dist/runtime/locale/zh_hant.js +52 -0
  235. package/dist/runtime/plugins/colors.js +12 -8
  236. package/dist/runtime/types/form.d.ts +9 -2
  237. package/dist/runtime/types/index.d.ts +50 -42
  238. package/dist/runtime/types/index.js +8 -0
  239. package/dist/runtime/types/locale.d.ts +54 -0
  240. package/dist/runtime/types/utils.d.ts +8 -3
  241. package/dist/runtime/utils/form.d.ts +7 -5
  242. package/dist/runtime/utils/form.js +117 -28
  243. package/dist/runtime/utils/index.d.ts +2 -1
  244. package/dist/runtime/utils/index.js +16 -0
  245. package/dist/runtime/utils/link.d.ts +5 -3
  246. package/dist/runtime/utils/link.js +1 -1
  247. package/dist/runtime/utils/locale.d.ts +15 -0
  248. package/dist/runtime/utils/locale.js +25 -0
  249. package/dist/runtime/vue/components/Icon.vue +15 -0
  250. package/dist/runtime/vue/components/Link.vue +208 -0
  251. package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
  252. package/dist/runtime/vue/plugins/color-mode.js +6 -0
  253. package/dist/runtime/vue/plugins/head.d.ts +4 -0
  254. package/dist/runtime/vue/plugins/head.js +6 -0
  255. package/dist/runtime/vue/stubs.d.ts +15 -0
  256. package/dist/runtime/vue/stubs.js +27 -0
  257. package/dist/shared/ui.CwmIkD_Y.cjs +3269 -0
  258. package/dist/shared/ui.D_93iuwH.mjs +3262 -0
  259. package/dist/unplugin.cjs +192 -0
  260. package/dist/unplugin.d.cts +49 -0
  261. package/dist/unplugin.d.mts +49 -0
  262. package/dist/unplugin.d.ts +49 -0
  263. package/dist/unplugin.mjs +181 -0
  264. package/dist/vite.cjs +22 -0
  265. package/dist/vite.d.cts +13 -0
  266. package/dist/vite.d.mts +13 -0
  267. package/dist/vite.d.ts +13 -0
  268. package/dist/vite.mjs +20 -0
  269. package/package.json +98 -31
  270. package/vue-plugin.d.ts +5 -0
  271. package/cli/node_modules/.ignored/citty/LICENSE +0 -36
  272. package/cli/node_modules/.ignored/citty/README.md +0 -134
  273. package/cli/node_modules/.ignored/citty/dist/index.cjs +0 -475
  274. package/cli/node_modules/.ignored/citty/dist/index.d.cts +0 -80
  275. package/cli/node_modules/.ignored/citty/dist/index.d.mts +0 -80
  276. package/cli/node_modules/.ignored/citty/dist/index.d.ts +0 -80
  277. package/cli/node_modules/.ignored/citty/dist/index.mjs +0 -463
  278. package/cli/node_modules/.ignored/citty/package.json +0 -49
  279. package/cli/node_modules/.ignored/consola/LICENSE +0 -47
  280. package/cli/node_modules/.ignored/consola/README.md +0 -318
  281. package/cli/node_modules/.ignored/consola/core.d.ts +0 -1
  282. package/cli/node_modules/.ignored/consola/dist/basic.cjs +0 -32
  283. package/cli/node_modules/.ignored/consola/dist/basic.d.ts +0 -9
  284. package/cli/node_modules/.ignored/consola/dist/basic.mjs +0 -24
  285. package/cli/node_modules/.ignored/consola/dist/browser.cjs +0 -80
  286. package/cli/node_modules/.ignored/consola/dist/browser.d.ts +0 -7
  287. package/cli/node_modules/.ignored/consola/dist/browser.mjs +0 -72
  288. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +0 -436
  289. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +0 -429
  290. package/cli/node_modules/.ignored/consola/dist/core.cjs +0 -415
  291. package/cli/node_modules/.ignored/consola/dist/core.d.ts +0 -124
  292. package/cli/node_modules/.ignored/consola/dist/core.mjs +0 -410
  293. package/cli/node_modules/.ignored/consola/dist/index.cjs +0 -21
  294. package/cli/node_modules/.ignored/consola/dist/index.d.ts +0 -9
  295. package/cli/node_modules/.ignored/consola/dist/index.mjs +0 -8
  296. package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +0 -62
  297. package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +0 -636
  298. package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +0 -645
  299. package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +0 -65
  300. package/cli/node_modules/.ignored/consola/dist/utils.cjs +0 -308
  301. package/cli/node_modules/.ignored/consola/dist/utils.d.ts +0 -169
  302. package/cli/node_modules/.ignored/consola/dist/utils.mjs +0 -284
  303. package/cli/node_modules/.ignored/consola/lib/index.cjs +0 -9
  304. package/cli/node_modules/.ignored/consola/package.json +0 -101
  305. package/cli/node_modules/.ignored/consola/utils.d.ts +0 -1
  306. package/cli/node_modules/.ignored/pathe/LICENSE +0 -44
  307. package/cli/node_modules/.ignored/pathe/README.md +0 -69
  308. package/cli/node_modules/.ignored/pathe/dist/index.cjs +0 -23
  309. package/cli/node_modules/.ignored/pathe/dist/index.d.cts +0 -36
  310. package/cli/node_modules/.ignored/pathe/dist/index.d.mts +0 -36
  311. package/cli/node_modules/.ignored/pathe/dist/index.d.ts +0 -36
  312. package/cli/node_modules/.ignored/pathe/dist/index.mjs +0 -1
  313. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +0 -238
  314. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +0 -221
  315. package/cli/node_modules/.ignored/pathe/dist/utils.cjs +0 -58
  316. package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +0 -5
  317. package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +0 -5
  318. package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +0 -5
  319. package/cli/node_modules/.ignored/pathe/dist/utils.mjs +0 -54
  320. package/cli/node_modules/.ignored/pathe/package.json +0 -48
  321. package/cli/node_modules/.ignored/pathe/utils.d.ts +0 -1
  322. package/cli/node_modules/.ignored/scule/LICENSE +0 -21
  323. package/cli/node_modules/.ignored/scule/README.md +0 -149
  324. package/cli/node_modules/.ignored/scule/dist/index.cjs +0 -92
  325. package/cli/node_modules/.ignored/scule/dist/index.d.cts +0 -57
  326. package/cli/node_modules/.ignored/scule/dist/index.d.mts +0 -57
  327. package/cli/node_modules/.ignored/scule/dist/index.d.ts +0 -57
  328. package/cli/node_modules/.ignored/scule/dist/index.mjs +0 -80
  329. package/cli/node_modules/.ignored/scule/package.json +0 -43
  330. package/cli/node_modules/.package-lock.json +0 -33
  331. package/dist/runtime/types/component.d.ts +0 -17
  332. /package/dist/runtime/types/{component.js → locale.js} +0 -0
@@ -0,0 +1,171 @@
1
+ <script lang="ts">
2
+ import { tv, type VariantProps } from 'tailwind-variants'
3
+ import type { StepperRootProps, StepperRootEmits } from 'reka-ui'
4
+ import type { AppConfig } from '@nuxt/schema'
5
+ import _appConfig from '#build/app.config'
6
+ import theme from '#build/ui/stepper'
7
+ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
8
+ import type { DynamicSlots } from '../types/utils'
9
+
10
+ const appConfig = _appConfig as AppConfig & { ui: { stepper: Partial<typeof theme> } }
11
+
12
+ const stepper = tv({ extend: tv(theme), ...(appConfig.ui?.stepper || {}) })
13
+
14
+ type StepperVariants = VariantProps<typeof stepper>
15
+
16
+ export interface StepperItem {
17
+ slot?: string
18
+ value?: string
19
+ title?: string
20
+ description?: string
21
+ icon?: string
22
+ content?: string
23
+ disabled?: boolean
24
+ }
25
+
26
+ export interface StepperProps<T extends StepperItem> extends Pick<StepperRootProps, 'linear'> {
27
+ /**
28
+ * The element or component this component should render as.
29
+ * @defaultValue 'div'
30
+ */
31
+ as?: any
32
+ items: T[]
33
+ size?: StepperVariants['size']
34
+ color?: StepperVariants['color']
35
+ orientation?: StepperVariants['orientation']
36
+ /**
37
+ * The value of the step that should be active when initially rendered. Use when you do not need to control the state of the steps.
38
+ */
39
+ defaultValue?: string | number
40
+ disabled?: boolean
41
+ ui?: Partial<typeof stepper.slots>
42
+ class?: any
43
+ }
44
+
45
+ export type StepperEmits<T> = Omit<StepperRootEmits, 'update:modelValue'> & {
46
+ next: [payload: T]
47
+ prev: [payload: T]
48
+ }
49
+
50
+ type SlotProps<T extends StepperItem> = (props: { item: T }) => any
51
+
52
+ export type StepperSlots<T extends StepperItem> = {
53
+ indicator: SlotProps<T>
54
+ title: SlotProps<T>
55
+ description: SlotProps<T>
56
+ content: SlotProps<T>
57
+ } & DynamicSlots<T, SlotProps<T>>
58
+
59
+ extendDevtoolsMeta({ example: 'StepperExample' })
60
+ </script>
61
+
62
+ <script setup lang="ts" generic="T extends StepperItem">
63
+ import { computed } from 'vue'
64
+ import { StepperRoot, StepperItem, StepperTrigger, StepperIndicator, StepperSeparator, StepperTitle, StepperDescription, useForwardProps } from 'reka-ui'
65
+ import { reactivePick } from '@vueuse/core'
66
+ import UIcon from './Icon.vue'
67
+
68
+ const props = withDefaults(defineProps<StepperProps<T>>(), {
69
+ linear: true
70
+ })
71
+ const emits = defineEmits<StepperEmits<T>>()
72
+ const slots = defineSlots<StepperSlots<T>>()
73
+
74
+ const modelValue = defineModel<string | number>()
75
+
76
+ const rootProps = useForwardProps(reactivePick(props, 'as', 'orientation', 'linear'))
77
+
78
+ const ui = computed(() => stepper({
79
+ orientation: props.orientation,
80
+ size: props.size,
81
+ color: props.color
82
+ }))
83
+
84
+ const currentStepIndex = computed({
85
+ get() {
86
+ const value = modelValue.value ?? props.defaultValue
87
+
88
+ return ((typeof value === 'string')
89
+ ? props.items.findIndex(item => item.value === value)
90
+ : value) ?? 0
91
+ },
92
+ set(value: number) {
93
+ modelValue.value = props.items?.[value]?.value ?? value
94
+ }
95
+ })
96
+
97
+ const currentStep = computed(() => props.items?.[currentStepIndex.value] as T)
98
+ const hasNext = computed(() => currentStepIndex.value < props.items?.length - 1)
99
+ const hasPrev = computed(() => currentStepIndex.value > 0)
100
+
101
+ defineExpose({
102
+ next() {
103
+ if (hasNext.value) {
104
+ currentStepIndex.value += 1
105
+ emits('next', currentStep.value)
106
+ }
107
+ },
108
+ prev() {
109
+ if (hasPrev.value) {
110
+ currentStepIndex.value -= 1
111
+ emits('prev', currentStep.value)
112
+ }
113
+ },
114
+ hasNext,
115
+ hasPrev
116
+ })
117
+ </script>
118
+
119
+ <template>
120
+ <StepperRoot v-bind="rootProps" v-model="currentStepIndex" :class="ui.root({ class: [props.class, props.ui?.root] })">
121
+ <div :class="ui.header({ class: props.ui?.header })">
122
+ <StepperItem
123
+ v-for="(item, count) in items"
124
+ :key="item.value ?? count"
125
+ :step="count"
126
+ :disabled="item.disabled || props.disabled"
127
+ :class="ui.item({ class: props.ui?.item })"
128
+ >
129
+ <div :class="ui.container({ class: props.ui?.container })">
130
+ <StepperTrigger :class="ui.trigger({ class: props.ui?.trigger })">
131
+ <StepperIndicator :class="ui.indicator({ class: props.ui?.indicator })">
132
+ <slot name="indicator" :item="item">
133
+ <UIcon v-if="item.icon" :name="item.icon" :class="ui.icon({ class: props.ui?.indicator })" />
134
+ <template v-else>
135
+ {{ count + 1 }}
136
+ </template>
137
+ </slot>
138
+ </StepperIndicator>
139
+ </StepperTrigger>
140
+
141
+ <StepperSeparator
142
+ v-if="count < items.length - 1"
143
+ :class="ui.separator({ class: props.ui?.separator })"
144
+ />
145
+ </div>
146
+
147
+ <div :class="ui.wrapper({ class: props.ui?.wrapper })">
148
+ <StepperTitle :class="ui.title({ class: props.ui?.title })">
149
+ <slot name="title" :item="currentStep">
150
+ {{ item.title }}
151
+ </slot>
152
+ </StepperTitle>
153
+ <StepperDescription :class="ui.description({ class: props.ui?.description })">
154
+ <slot name="description" :item="currentStep">
155
+ {{ item.description }}
156
+ </slot>
157
+ </StepperDescription>
158
+ </div>
159
+ </StepperItem>
160
+ </div>
161
+
162
+ <div v-if="currentStep?.content || !!slots.content || (currentStep?.slot && !!slots[currentStep.slot]) || (currentStep?.value && !!slots[currentStep.value])" :class="ui.content({ class: props.ui?.description })">
163
+ <slot
164
+ :name="!!slots[currentStep?.slot ?? currentStep.value] ? currentStep.slot ?? currentStep.value : 'content'"
165
+ :item="currentStep"
166
+ >
167
+ {{ currentStep?.content }}
168
+ </slot>
169
+ </div>
170
+ </StepperRoot>
171
+ </template>
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { tv, type VariantProps } from 'tailwind-variants'
3
- import type { SwitchRootProps } from 'radix-vue'
3
+ import type { SwitchRootProps } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/switch'
7
+ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
7
8
  import type { PartialString } from '../types/utils'
8
9
 
9
10
  const appConfig = _appConfig as AppConfig & { ui: { switch: Partial<typeof theme> } }
@@ -12,10 +13,10 @@ const switchTv = tv({ extend: tv(theme), ...(appConfig.ui?.switch || {}) })
12
13
 
13
14
  type SwitchVariants = VariantProps<typeof switchTv>
14
15
 
15
- export interface SwitchProps extends Pick<SwitchRootProps, 'disabled' | 'id' | 'name' | 'required' | 'value'> {
16
+ export interface SwitchProps extends Pick<SwitchRootProps, 'disabled' | 'id' | 'name' | 'required' | 'value' | 'defaultValue'> {
16
17
  /**
17
18
  * The element or component this component should render as.
18
- * @defaultValue `div`
19
+ * @defaultValue 'div'
19
20
  */
20
21
  as?: any
21
22
  color?: SwitchVariants['color']
@@ -33,38 +34,38 @@ export interface SwitchProps extends Pick<SwitchRootProps, 'disabled' | 'id' | '
33
34
  uncheckedIcon?: string
34
35
  label?: string
35
36
  description?: string
36
- /** The state of the switch when it is initially rendered. Use when you do not need to control its state. */
37
- defaultValue?: boolean
38
37
  class?: any
39
38
  ui?: PartialString<typeof switchTv.slots>
40
39
  }
41
40
 
42
- export interface SwitchEmits {
43
- (e: 'update:modelValue', payload: boolean): void
44
- (e: 'change', payload: Event): void
41
+ export type SwitchEmits = {
42
+ change: [payload: Event]
45
43
  }
46
44
 
47
45
  export interface SwitchSlots {
48
46
  label(props: { label?: string }): any
49
47
  description(props: { description?: string }): any
50
48
  }
49
+
50
+ extendDevtoolsMeta({ defaultProps: { label: 'Switch me!' } })
51
51
  </script>
52
52
 
53
53
  <script setup lang="ts">
54
54
  import { computed, useId } from 'vue'
55
- import { SwitchRoot, SwitchThumb, useForwardProps, Label } from 'radix-vue'
55
+ import { Primitive, SwitchRoot, SwitchThumb, useForwardProps, Label } from 'reka-ui'
56
56
  import { reactivePick } from '@vueuse/core'
57
57
  import { useAppConfig } from '#imports'
58
58
  import { useFormField } from '../composables/useFormField'
59
+ import UIcon from './Icon.vue'
59
60
 
60
61
  const props = defineProps<SwitchProps>()
61
62
  const slots = defineSlots<SwitchSlots>()
62
63
  const emits = defineEmits<SwitchEmits>()
63
64
 
64
- const modelValue = defineModel<boolean | undefined>({ default: undefined })
65
+ const modelValue = defineModel<boolean>({ default: undefined })
65
66
 
66
67
  const appConfig = useAppConfig()
67
- const rootProps = useForwardProps(reactivePick(props, 'as', 'required', 'value'))
68
+ const rootProps = useForwardProps(reactivePick(props, 'required', 'value', 'defaultValue'))
68
69
 
69
70
  const { id: _id, emitFormChange, emitFormInput, size, color, name, disabled } = useFormField<SwitchProps>(props)
70
71
  const id = _id.value ?? useId()
@@ -87,17 +88,16 @@ function onUpdate(value: any) {
87
88
  </script>
88
89
 
89
90
  <template>
90
- <div :class="ui.root({ class: [props.class, props.ui?.root] })">
91
+ <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
91
92
  <div :class="ui.container({ class: props.ui?.container })">
92
93
  <SwitchRoot
93
94
  :id="id"
94
- v-model:checked="modelValue"
95
- :default-checked="defaultValue"
96
95
  v-bind="rootProps"
96
+ v-model="modelValue"
97
97
  :name="name"
98
98
  :disabled="disabled || loading"
99
99
  :class="ui.base({ class: props.ui?.base })"
100
- @update:checked="onUpdate"
100
+ @update:model-value="onUpdate"
101
101
  >
102
102
  <SwitchThumb :class="ui.thumb({ class: props.ui?.thumb })">
103
103
  <UIcon v-if="loading" :name="loadingIcon || appConfig.ui.icons.loading" :class="ui.icon({ class: props.ui?.icon, checked: true, unchecked: true })" />
@@ -120,5 +120,5 @@ function onUpdate(value: any) {
120
120
  </slot>
121
121
  </p>
122
122
  </div>
123
- </div>
123
+ </Primitive>
124
124
  </template>
@@ -0,0 +1,262 @@
1
+ <!-- eslint-disable vue/block-tag-newline -->
2
+ <script lang="ts">
3
+ import type { Ref } from 'vue'
4
+ import { tv, type VariantProps } from 'tailwind-variants'
5
+ import type { AppConfig } from '@nuxt/schema'
6
+ import type { RowData } from '@tanstack/table-core'
7
+ import type {
8
+ Row,
9
+ ColumnDef,
10
+ ColumnFiltersState,
11
+ ColumnPinningState,
12
+ RowSelectionState,
13
+ SortingState,
14
+ ExpandedState,
15
+ VisibilityState,
16
+ GlobalFilterOptions,
17
+ ColumnFiltersOptions,
18
+ ColumnPinningOptions,
19
+ VisibilityOptions,
20
+ ExpandedOptions,
21
+ SortingOptions,
22
+ RowSelectionOptions,
23
+ Updater,
24
+ CellContext,
25
+ HeaderContext
26
+ } from '@tanstack/vue-table'
27
+ import _appConfig from '#build/app.config'
28
+ import theme from '#build/ui/table'
29
+
30
+ declare module '@tanstack/table-core' {
31
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
+ interface ColumnMeta<TData extends RowData, TValue> {
33
+ class?: {
34
+ th?: string
35
+ td?: string
36
+ }
37
+ }
38
+ }
39
+
40
+ const appConfig = _appConfig as AppConfig & { ui: { table: Partial<typeof theme> } }
41
+
42
+ const table = tv({ extend: tv(theme), ...(appConfig.ui?.table || {}) })
43
+
44
+ type TableVariants = VariantProps<typeof table>
45
+
46
+ export type TableColumn<T> = ColumnDef<T>
47
+
48
+ export interface TableData {
49
+ [key: string]: any
50
+ }
51
+
52
+ export interface TableProps<T> {
53
+ /**
54
+ * The element or component this component should render as.
55
+ * @defaultValue 'div'
56
+ */
57
+ as?: any
58
+ data?: T[]
59
+ columns?: TableColumn<T>[]
60
+ caption?: string
61
+ /**
62
+ * Whether the table should have a sticky header.
63
+ * @defaultValue false
64
+ */
65
+ sticky?: boolean
66
+ /** Whether the table should be in loading state. */
67
+ loading?: boolean
68
+ loadingColor?: TableVariants['loadingColor']
69
+ loadingAnimation?: TableVariants['loadingAnimation']
70
+ /**
71
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/global-filtering#table-options)
72
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/global-filtering)
73
+ */
74
+ globalFilterOptions?: Omit<GlobalFilterOptions<T>, 'onGlobalFilterChange'>
75
+ /**
76
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-filtering#table-options)
77
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-filtering)
78
+ */
79
+ columnFiltersOptions?: Omit<ColumnFiltersOptions<T>, 'getFilteredRowModel' | 'onColumnFiltersChange'>
80
+ /**
81
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-pinning#table-options)
82
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-pinning)
83
+ */
84
+ columnPinningOptions?: Omit<ColumnPinningOptions, 'onColumnPinningChange'>
85
+ /**
86
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#table-options)
87
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility)
88
+ */
89
+ visibilityOptions?: Omit<VisibilityOptions, 'onColumnVisibilityChange'>
90
+ /**
91
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#table-options)
92
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting)
93
+ */
94
+ sortingOptions?: Omit<SortingOptions<T>, 'getSortedRowModel' | 'onSortingChange'>
95
+ /**
96
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#table-options)
97
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding)
98
+ */
99
+ expandedOptions?: Omit<ExpandedOptions<T>, 'getExpandedRowModel' | 'onExpandedChange'>
100
+ /**
101
+ * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#table-options)
102
+ * @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection)
103
+ */
104
+ rowSelectionOptions?: Omit<RowSelectionOptions<T>, 'onRowSelectionChange'>
105
+ class?: any
106
+ ui?: Partial<typeof table.slots>
107
+ }
108
+
109
+ type DynamicHeaderSlots<T, K = keyof T> = Record<string, (props: HeaderContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-header`, (props: HeaderContext<T, unknown>) => any>
110
+ type DynamicCellSlots<T, K = keyof T> = Record<string, (props: CellContext<T, unknown>) => any> & Record<`${K extends string ? K : never}-cell`, (props: CellContext<T, unknown>) => any>
111
+
112
+ export type TableSlots<T> = {
113
+ expanded: (props: { row: Row<T> }) => any
114
+ empty: (props?: {}) => any
115
+ caption: (props?: {}) => any
116
+ } & DynamicHeaderSlots<T> & DynamicCellSlots<T>
117
+
118
+ </script>
119
+
120
+ <script setup lang="ts" generic="T extends TableData">
121
+ import { computed } from 'vue'
122
+ import { Primitive } from 'reka-ui'
123
+ import { FlexRender, getCoreRowModel, getFilteredRowModel, getSortedRowModel, getExpandedRowModel, useVueTable } from '@tanstack/vue-table'
124
+ import { upperFirst } from 'scule'
125
+ import { useLocale } from '../composables/useLocale'
126
+
127
+ const props = defineProps<TableProps<T>>()
128
+ defineSlots<TableSlots<T>>()
129
+
130
+ const { t } = useLocale()
131
+
132
+ const data = computed(() => props.data ?? [])
133
+ const columns = computed<TableColumn<T>[]>(() => props.columns ?? Object.keys(data.value[0] ?? {}).map((accessorKey: string) => ({ accessorKey, header: upperFirst(accessorKey) })))
134
+
135
+ const ui = computed(() => table({
136
+ sticky: props.sticky,
137
+ loading: props.loading,
138
+ loadingColor: props.loadingColor,
139
+ loadingAnimation: props.loadingAnimation
140
+ }))
141
+
142
+ const globalFilterState = defineModel<string>('globalFilter', { default: undefined })
143
+ const columnFiltersState = defineModel<ColumnFiltersState>('columnFilters', { default: [] })
144
+ const columnVisibilityState = defineModel<VisibilityState>('columnVisibility', { default: {} })
145
+ const columnPinningState = defineModel<ColumnPinningState>('columnPinning', { default: {} })
146
+ const rowSelectionState = defineModel<RowSelectionState>('rowSelection', { default: {} })
147
+ const sortingState = defineModel<SortingState>('sorting', { default: [] })
148
+ const expandedState = defineModel<ExpandedState>('expanded', { default: {} })
149
+
150
+ const tableApi = useVueTable({
151
+ data,
152
+ columns: columns.value,
153
+ getCoreRowModel: getCoreRowModel(),
154
+ ...(props.globalFilterOptions || {}),
155
+ onGlobalFilterChange: updaterOrValue => valueUpdater(updaterOrValue, globalFilterState),
156
+ ...(props.columnFiltersOptions || {}),
157
+ getFilteredRowModel: getFilteredRowModel(),
158
+ onColumnFiltersChange: updaterOrValue => valueUpdater(updaterOrValue, columnFiltersState),
159
+ ...(props.visibilityOptions || {}),
160
+ onColumnVisibilityChange: updaterOrValue => valueUpdater(updaterOrValue, columnVisibilityState),
161
+ ...(props.columnPinningOptions || {}),
162
+ onColumnPinningChange: updaterOrValue => valueUpdater(updaterOrValue, columnPinningState),
163
+ ...(props.rowSelectionOptions || {}),
164
+ onRowSelectionChange: updaterOrValue => valueUpdater(updaterOrValue, rowSelectionState),
165
+ ...(props.sortingOptions || {}),
166
+ getSortedRowModel: getSortedRowModel(),
167
+ onSortingChange: updaterOrValue => valueUpdater(updaterOrValue, sortingState),
168
+ ...(props.expandedOptions || {}),
169
+ getExpandedRowModel: getExpandedRowModel(),
170
+ onExpandedChange: updaterOrValue => valueUpdater(updaterOrValue, expandedState),
171
+ state: {
172
+ get globalFilter() {
173
+ return globalFilterState.value
174
+ },
175
+ get columnFilters() {
176
+ return columnFiltersState.value
177
+ },
178
+ get columnVisibility() {
179
+ return columnVisibilityState.value
180
+ },
181
+ get columnPinning() {
182
+ return columnPinningState.value
183
+ },
184
+ get expanded() {
185
+ return expandedState.value
186
+ },
187
+ get rowSelection() {
188
+ return rowSelectionState.value
189
+ },
190
+ get sorting() {
191
+ return sortingState.value
192
+ }
193
+ }
194
+ })
195
+
196
+ function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref) {
197
+ ref.value = typeof updaterOrValue === 'function' ? updaterOrValue(ref.value) : updaterOrValue
198
+ }
199
+
200
+ defineExpose({
201
+ tableApi
202
+ })
203
+ </script>
204
+
205
+ <template>
206
+ <Primitive :as="as" :class="ui.root({ class: [props.class, props.ui?.root] })">
207
+ <table :class="ui.base({ class: [props.ui?.base] })">
208
+ <caption v-if="caption" :class="ui.caption({ class: [props.ui?.caption] })">
209
+ <slot name="caption">
210
+ {{ caption }}
211
+ </slot>
212
+ </caption>
213
+
214
+ <thead :class="ui.thead({ class: [props.ui?.thead] })">
215
+ <tr v-for="headerGroup in tableApi.getHeaderGroups()" :key="headerGroup.id" :class="ui.tr({ class: [props.ui?.tr] })">
216
+ <th
217
+ v-for="header in headerGroup.headers"
218
+ :key="header.id"
219
+ :data-pinned="header.column.getIsPinned()"
220
+ :class="ui.th({ class: [props.ui?.th, header.column.columnDef.meta?.class?.th], pinned: !!header.column.getIsPinned() })"
221
+ >
222
+ <slot :name="`${header.id}-header`" v-bind="header.getContext()">
223
+ <FlexRender v-if="!header.isPlaceholder" :render="header.column.columnDef.header" :props="header.getContext()" />
224
+ </slot>
225
+ </th>
226
+ </tr>
227
+ </thead>
228
+
229
+ <tbody :class="ui.tbody({ class: [props.ui?.tbody] })">
230
+ <template v-if="tableApi.getRowModel().rows?.length">
231
+ <template v-for="row in tableApi.getRowModel().rows" :key="row.id">
232
+ <tr :data-selected="row.getIsSelected()" :data-expanded="row.getIsExpanded()" :class="ui.tr({ class: [props.ui?.tr] })">
233
+ <td
234
+ v-for="cell in row.getVisibleCells()"
235
+ :key="cell.id"
236
+ :data-pinned="cell.column.getIsPinned()"
237
+ :class="ui.td({ class: [props.ui?.td, cell.column.columnDef.meta?.class?.td], pinned: !!cell.column.getIsPinned() })"
238
+ >
239
+ <slot :name="`${cell.column.id}-cell`" v-bind="cell.getContext()">
240
+ <FlexRender :render="cell.column.columnDef.cell" :props="cell.getContext()" />
241
+ </slot>
242
+ </td>
243
+ </tr>
244
+ <tr v-if="row.getIsExpanded()" :class="ui.tr({ class: [props.ui?.tr] })">
245
+ <td :colspan="row.getAllCells().length" :class="ui.td({ class: [props.ui?.td] })">
246
+ <slot name="expanded" :row="row" />
247
+ </td>
248
+ </tr>
249
+ </template>
250
+ </template>
251
+
252
+ <tr v-else :class="ui.tr({ class: [props.ui?.tr] })">
253
+ <td :colspan="columns?.length" :class="ui.empty({ class: props.ui?.empty })">
254
+ <slot name="empty">
255
+ {{ t('table.noData') }}
256
+ </slot>
257
+ </td>
258
+ </tr>
259
+ </tbody>
260
+ </table>
261
+ </Primitive>
262
+ </template>
@@ -1,9 +1,10 @@
1
1
  <script lang="ts">
2
2
  import { tv, type VariantProps } from 'tailwind-variants'
3
- import type { TabsRootProps, TabsRootEmits, TabsContentProps, TabsTriggerProps } from 'radix-vue'
3
+ import type { TabsRootProps, TabsRootEmits } from 'reka-ui'
4
4
  import type { AppConfig } from '@nuxt/schema'
5
5
  import _appConfig from '#build/app.config'
6
6
  import theme from '#build/ui/tabs'
7
+ import { extendDevtoolsMeta } from '../composables/extendDevtoolsMeta'
7
8
  import type { AvatarProps } from '../types'
8
9
  import type { DynamicSlots, PartialString } from '../types/utils'
9
10
 
@@ -11,7 +12,7 @@ const appConfig = _appConfig as AppConfig & { ui: { tabs: Partial<typeof theme>
11
12
 
12
13
  const tabs = tv({ extend: tv(theme), ...(appConfig.ui?.tabs || {}) })
13
14
 
14
- export interface TabsItem extends Pick<TabsTriggerProps, 'disabled'> {
15
+ export interface TabsItem {
15
16
  label?: string
16
17
  icon?: string
17
18
  avatar?: AvatarProps
@@ -19,11 +20,12 @@ export interface TabsItem extends Pick<TabsTriggerProps, 'disabled'> {
19
20
  content?: string
20
21
  /** A unique value for the tab item. Defaults to the index. */
21
22
  value?: string | number
23
+ disabled?: boolean
22
24
  }
23
25
 
24
26
  type TabsVariants = VariantProps<typeof tabs>
25
27
 
26
- export interface TabsProps<T> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode'> {
28
+ export interface TabsProps<T> extends Pick<TabsRootProps<string | number>, 'defaultValue' | 'modelValue' | 'activationMode' | 'unmountOnHide'> {
27
29
  /**
28
30
  * The element or component this component should render as.
29
31
  * @defaultValue 'div'
@@ -42,7 +44,12 @@ export interface TabsProps<T> extends Pick<TabsRootProps<string | number>, 'defa
42
44
  * The content of the tabs, can be disabled to prevent rendering the content.
43
45
  * @defaultValue true
44
46
  */
45
- content?: boolean | Omit<TabsContentProps, 'as' | 'asChild' | 'value'>
47
+ content?: boolean
48
+ /**
49
+ * The key used to get the label from the item.
50
+ * @defaultValue 'label'
51
+ */
52
+ labelKey?: string
46
53
  class?: any
47
54
  ui?: PartialString<typeof tabs.slots>
48
55
  }
@@ -57,24 +64,44 @@ export type TabsSlots<T extends { slot?: string }> = {
57
64
  trailing: SlotProps<T>
58
65
  content: SlotProps<T>
59
66
  } & DynamicSlots<T, SlotProps<T>>
67
+
68
+ extendDevtoolsMeta({
69
+ defaultProps: {
70
+ items: [{
71
+ label: 'Tab1',
72
+ avatar: { src: 'https://avatars.githubusercontent.com/u/739984?v=4' },
73
+ content: 'This is the content shown for Tab1'
74
+ }, {
75
+ label: 'Tab2',
76
+ icon: 'i-lucide-user',
77
+ content: 'And, this is the content for Tab2'
78
+ }, {
79
+ label: 'Tab3',
80
+ icon: 'i-lucide-bell',
81
+ content: 'Finally, this is the content for Tab3'
82
+ }]
83
+ }
84
+ })
60
85
  </script>
61
86
 
62
87
  <script setup lang="ts" generic="T extends TabsItem">
63
- import { computed, toRef } from 'vue'
64
- import { defu } from 'defu'
65
- import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from 'radix-vue'
88
+ import { computed } from 'vue'
89
+ import { TabsRoot, TabsList, TabsIndicator, TabsTrigger, TabsContent, useForwardPropsEmits } from 'reka-ui'
66
90
  import { reactivePick } from '@vueuse/core'
91
+ import { get } from '../utils'
92
+ import UIcon from './Icon.vue'
93
+ import UAvatar from './Avatar.vue'
67
94
 
68
95
  const props = withDefaults(defineProps<TabsProps<T>>(), {
69
96
  content: true,
70
97
  defaultValue: '0',
71
- orientation: 'horizontal'
98
+ orientation: 'horizontal',
99
+ labelKey: 'label'
72
100
  })
73
101
  const emits = defineEmits<TabsEmits>()
74
102
  const slots = defineSlots<TabsSlots<T>>()
75
103
 
76
- const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'defaultValue', 'orientation', 'activationMode', 'modelValue'), emits)
77
- const contentProps = toRef(() => defu(props.content || {}, { forceMount: true }) as TabsContentProps)
104
+ const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'orientation', 'activationMode', 'unmountOnHide'), emits)
78
105
 
79
106
  const ui = computed(() => tabs({
80
107
  color: props.color,
@@ -91,12 +118,12 @@ const ui = computed(() => tabs({
91
118
 
92
119
  <TabsTrigger v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :disabled="item.disabled" :class="ui.trigger({ class: props.ui?.trigger })">
93
120
  <slot name="leading" :item="item" :index="index">
94
- <UAvatar v-if="item.avatar" :size="((props.ui?.leadingAvatarSize || ui.leadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
95
- <UIcon v-else-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
121
+ <UIcon v-if="item.icon" :name="item.icon" :class="ui.leadingIcon({ class: props.ui?.leadingIcon })" />
122
+ <UAvatar v-else-if="item.avatar" :size="((props.ui?.leadingAvatarSize || ui.leadingAvatarSize()) as AvatarProps['size'])" v-bind="item.avatar" :class="ui.leadingAvatar({ class: props.ui?.leadingAvatar })" />
96
123
  </slot>
97
124
 
98
- <span v-if="item.label || !!slots.default" :class="ui.label({ class: props.ui?.label })">
99
- <slot :item="item" :index="index">{{ item.label }}</slot>
125
+ <span v-if="get(item, props.labelKey as string) || !!slots.default" :class="ui.label({ class: props.ui?.label })">
126
+ <slot :item="item" :index="index">{{ get(item, props.labelKey as string) }}</slot>
100
127
  </span>
101
128
 
102
129
  <slot name="trailing" :item="item" :index="index" />
@@ -104,7 +131,7 @@ const ui = computed(() => tabs({
104
131
  </TabsList>
105
132
 
106
133
  <template v-if="!!content">
107
- <TabsContent v-for="(item, index) of items" :key="index" v-bind="contentProps" :value="item.value || String(index)" :class="ui.content({ class: props.ui?.content })">
134
+ <TabsContent v-for="(item, index) of items" :key="index" :value="item.value || String(index)" :class="ui.content({ class: props.ui?.content })">
108
135
  <slot :name="item.slot || 'content'" :item="item" :index="index">
109
136
  {{ item.content }}
110
137
  </slot>