@nuxt/ui 3.0.0-alpha.7 → 3.0.0-alpha.9

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 (296) 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/card.ts +8 -0
  10. package/.nuxt/ui/carousel.ts +41 -0
  11. package/.nuxt/ui/checkbox.ts +105 -0
  12. package/.nuxt/ui/chip.ts +67 -0
  13. package/.nuxt/ui/collapsible.ts +6 -0
  14. package/.nuxt/ui/command-palette.ts +40 -0
  15. package/.nuxt/ui/container.ts +3 -0
  16. package/.nuxt/ui/context-menu.ts +198 -0
  17. package/.nuxt/ui/drawer.ts +55 -0
  18. package/.nuxt/ui/dropdown-menu.ts +199 -0
  19. package/.nuxt/ui/form-field.ts +40 -0
  20. package/.nuxt/ui/form.ts +3 -0
  21. package/.nuxt/ui/index.ts +45 -0
  22. package/.nuxt/ui/input-menu.ts +411 -0
  23. package/.nuxt/ui/input-number.ts +204 -0
  24. package/.nuxt/ui/input.ts +263 -0
  25. package/.nuxt/ui/kbd.ts +19 -0
  26. package/.nuxt/ui/link.ts +15 -0
  27. package/.nuxt/ui/modal.ts +28 -0
  28. package/.nuxt/ui/navigation-menu.ts +390 -0
  29. package/.nuxt/ui/pagination.ts +8 -0
  30. package/.nuxt/ui/pin-input.ts +145 -0
  31. package/.nuxt/ui/popover.ts +6 -0
  32. package/.nuxt/ui/progress.ts +258 -0
  33. package/.nuxt/ui/radio-group.ts +112 -0
  34. package/.nuxt/ui/select-menu.ts +316 -0
  35. package/.nuxt/ui/select.ts +314 -0
  36. package/.nuxt/ui/separator.ts +143 -0
  37. package/.nuxt/ui/skeleton.ts +3 -0
  38. package/.nuxt/ui/slideover.ts +63 -0
  39. package/.nuxt/ui/slider.ts +148 -0
  40. package/.nuxt/ui/switch.ts +113 -0
  41. package/.nuxt/ui/table.ts +129 -0
  42. package/.nuxt/ui/tabs.ts +227 -0
  43. package/.nuxt/ui/textarea.ts +263 -0
  44. package/.nuxt/ui/toast.ts +66 -0
  45. package/.nuxt/ui/toaster.ts +75 -0
  46. package/.nuxt/ui/tooltip.ts +9 -0
  47. package/README.md +52 -12
  48. package/cli/commands/{init.mjs → make/component.mjs} +4 -4
  49. package/cli/commands/make/index.mjs +14 -0
  50. package/cli/commands/make/locale.mjs +64 -0
  51. package/cli/index.mjs +2 -2
  52. package/cli/templates.mjs +47 -2
  53. package/cli/utils.mjs +14 -0
  54. package/dist/chunks/component-meta.cjs +77249 -0
  55. package/dist/chunks/component-meta.mjs +77247 -0
  56. package/dist/client/devtools/200.html +1 -0
  57. package/dist/client/devtools/404.html +1 -0
  58. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKK58UfivUw4aw-SK92LTmKP0.woff2 +0 -0
  59. package/dist/client/devtools/_fonts/rP2Wp2ywxg089UriCZaSExd86J3t9jz86MvyyKy58UfivUw-9uYm8d48E4.woff2 +0 -0
  60. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu0-K6z9mXg-VNw7NHvqnp.woff2 +0 -0
  61. package/dist/client/devtools/_fonts/rP2Yp2ywxg089UriI5-g4vlH9VoD8Cmcqbu6-K6z9mXgjU0-EkYdMs3MAX.woff2 +0 -0
  62. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-7DW3w-R7n06NbhGy.woff +0 -0
  63. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDG3w-leGNfkTmsj.woff +0 -0
  64. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat-JDW3w-ciElMF03ku.woff +0 -0
  65. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JCm3w-sB722Uoa0f.woff +0 -0
  66. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8JDW3w-PBDI1JDjwV.woff +0 -0
  67. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat8gCm3w-0q1hqVn09O.woff +0 -0
  68. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9XCm3w-ByvzuLy2fa.woff +0 -0
  69. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat9uCm3w-5TKCIs6EEw.woff +0 -0
  70. package/dist/client/devtools/_fonts/rP2rp2ywxg089UriCZaSExd86J3t9jz86Mvy4qCRAL19DksVat_XDW3w-r2swRDGfn2.woff +0 -0
  71. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAC5thTQ-ldB60l5U8r.woff +0 -0
  72. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpthTQ-wbFKGFDrgo.woff +0 -0
  73. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAIpxhTQ-LLUBv5jskj.woff +0 -0
  74. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwARZthTQ-F71RdTRbNg.woff +0 -0
  75. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwA_JxhTQ-6nh65gZkc0.woff +0 -0
  76. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJthTQ-aMoWEJLmTt.woff +0 -0
  77. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAkJxhTQ-WMBvmLOgKm.woff +0 -0
  78. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAop1hTQ-utGC2hnWq2.woff +0 -0
  79. package/dist/client/devtools/_fonts/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAopxhTQ-YpyTieVa5B.woff +0 -0
  80. package/dist/client/devtools/_nuxt/BDC8ywlR.js +1 -0
  81. package/dist/client/devtools/_nuxt/BT004Uxp.js +53 -0
  82. package/dist/client/devtools/_nuxt/C1H2Soz3.js +1 -0
  83. package/dist/client/devtools/_nuxt/builds/latest.json +1 -0
  84. package/dist/client/devtools/_nuxt/builds/meta/f98c13ea-d751-4b37-8ce3-94e99708745f.json +1 -0
  85. package/dist/client/devtools/_nuxt/entry.Bx6WJjrx.css +1 -0
  86. package/dist/client/devtools/_nuxt/error-404.Cq4qshcf.css +1 -0
  87. package/dist/client/devtools/_nuxt/error-500.ax1aM34m.css +1 -0
  88. package/dist/client/devtools/favicon.svg +1 -0
  89. package/dist/client/devtools/index.html +1 -0
  90. package/dist/devtools/runtime/DevtoolsRenderer.vue +53 -0
  91. package/dist/devtools/runtime/examples/AvatarGroupExample.vue +7 -0
  92. package/dist/devtools/runtime/examples/ButtonGroupExample.vue +8 -0
  93. package/dist/devtools/runtime/examples/CardExample.vue +13 -0
  94. package/dist/devtools/runtime/examples/CarouselExample.vue +13 -0
  95. package/dist/devtools/runtime/examples/ChipExample.vue +5 -0
  96. package/dist/devtools/runtime/examples/CollapsibleExample.vue +8 -0
  97. package/dist/devtools/runtime/examples/CommandPaletteExample.vue +29 -0
  98. package/dist/devtools/runtime/examples/ContainerExample.vue +5 -0
  99. package/dist/devtools/runtime/examples/ContextMenuExample.vue +5 -0
  100. package/dist/devtools/runtime/examples/DrawerExample.vue +8 -0
  101. package/dist/devtools/runtime/examples/DropdownMenuExample.vue +5 -0
  102. package/dist/devtools/runtime/examples/FormExample.vue +30 -0
  103. package/dist/devtools/runtime/examples/FormFieldExample.vue +5 -0
  104. package/dist/devtools/runtime/examples/LinkExample.vue +5 -0
  105. package/dist/devtools/runtime/examples/ModalExample.vue +8 -0
  106. package/dist/devtools/runtime/examples/PopoverExample.vue +8 -0
  107. package/dist/devtools/runtime/examples/SkeletonExample.vue +3 -0
  108. package/dist/devtools/runtime/examples/SlideoverExample.vue +8 -0
  109. package/dist/devtools/runtime/examples/ToasterExample.vue +11 -0
  110. package/dist/devtools/runtime/examples/TooltipExample.vue +5 -0
  111. package/dist/module.cjs +223 -4
  112. package/dist/module.d.cts +54 -0
  113. package/dist/module.d.mts +10 -0
  114. package/dist/module.d.ts +10 -0
  115. package/dist/module.json +1 -1
  116. package/dist/module.mjs +158 -2763
  117. package/dist/runtime/components/Accordion.vue +32 -1
  118. package/dist/runtime/components/Alert.vue +8 -1
  119. package/dist/runtime/components/App.vue +19 -5
  120. package/dist/runtime/components/Avatar.vue +23 -5
  121. package/dist/runtime/components/AvatarGroup.vue +3 -0
  122. package/dist/runtime/components/Badge.vue +33 -3
  123. package/dist/runtime/components/Breadcrumb.vue +33 -4
  124. package/dist/runtime/components/Button.vue +6 -1
  125. package/dist/runtime/components/ButtonGroup.vue +4 -1
  126. package/dist/runtime/components/Card.vue +3 -0
  127. package/dist/runtime/components/Carousel.vue +17 -8
  128. package/dist/runtime/components/Checkbox.vue +4 -0
  129. package/dist/runtime/components/Chip.vue +9 -2
  130. package/dist/runtime/components/Collapsible.vue +3 -0
  131. package/dist/runtime/components/CommandPalette.vue +8 -4
  132. package/dist/runtime/components/Container.vue +3 -0
  133. package/dist/runtime/components/ContextMenu.vue +64 -3
  134. package/dist/runtime/components/ContextMenuContent.vue +10 -8
  135. package/dist/runtime/components/Drawer.vue +3 -0
  136. package/dist/runtime/components/DropdownMenu.vue +52 -3
  137. package/dist/runtime/components/DropdownMenuContent.vue +10 -8
  138. package/dist/runtime/components/Form.vue +21 -20
  139. package/dist/runtime/components/FormField.vue +10 -3
  140. package/dist/runtime/components/Input.vue +1 -0
  141. package/dist/runtime/components/InputMenu.vue +118 -31
  142. package/dist/runtime/components/InputNumber.vue +192 -0
  143. package/dist/runtime/components/Kbd.vue +2 -0
  144. package/dist/runtime/components/Link.vue +69 -6
  145. package/dist/runtime/components/Modal.vue +15 -3
  146. package/dist/runtime/components/NavigationMenu.vue +95 -46
  147. package/dist/runtime/components/Pagination.vue +17 -6
  148. package/dist/runtime/components/PinInput.vue +96 -0
  149. package/dist/runtime/components/Popover.vue +20 -1
  150. package/dist/runtime/components/Progress.vue +1 -1
  151. package/dist/runtime/components/RadioGroup.vue +4 -1
  152. package/dist/runtime/components/Select.vue +24 -13
  153. package/dist/runtime/components/SelectMenu.vue +130 -42
  154. package/dist/runtime/components/Separator.vue +1 -1
  155. package/dist/runtime/components/Skeleton.vue +3 -0
  156. package/dist/runtime/components/Slideover.vue +15 -3
  157. package/dist/runtime/components/Slider.vue +1 -1
  158. package/dist/runtime/components/Switch.vue +5 -1
  159. package/dist/runtime/components/Table.vue +27 -8
  160. package/dist/runtime/components/Tabs.vue +20 -1
  161. package/dist/runtime/components/Textarea.vue +1 -1
  162. package/dist/runtime/components/Toast.vue +8 -1
  163. package/dist/runtime/components/Toaster.vue +29 -14
  164. package/dist/runtime/components/Tooltip.vue +3 -0
  165. package/dist/runtime/composables/defineLocale.d.ts +9 -0
  166. package/dist/runtime/composables/defineLocale.js +4 -0
  167. package/dist/runtime/composables/defineShortcuts.js +0 -6
  168. package/dist/runtime/composables/extendDevtoolsMeta.d.ts +7 -0
  169. package/dist/runtime/composables/extendDevtoolsMeta.js +2 -0
  170. package/dist/runtime/composables/useFormField.d.ts +4 -1
  171. package/dist/runtime/composables/useFormField.js +1 -1
  172. package/dist/runtime/composables/useKbd.d.ts +10 -3
  173. package/dist/runtime/composables/useKbd.js +14 -8
  174. package/dist/runtime/composables/useLocale.d.ts +4 -0
  175. package/dist/runtime/composables/useLocale.js +10 -0
  176. package/dist/runtime/index.css +1 -1
  177. package/dist/runtime/locale/ar.d.ts +2 -0
  178. package/dist/runtime/locale/ar.js +47 -0
  179. package/dist/runtime/locale/cs.d.ts +2 -0
  180. package/dist/runtime/locale/cs.js +46 -0
  181. package/dist/runtime/locale/de.d.ts +2 -0
  182. package/dist/runtime/locale/de.js +46 -0
  183. package/dist/runtime/locale/en.d.ts +2 -0
  184. package/dist/runtime/locale/en.js +46 -0
  185. package/dist/runtime/locale/es.d.ts +2 -0
  186. package/dist/runtime/locale/es.js +46 -0
  187. package/dist/runtime/locale/fa_ir.d.ts +2 -0
  188. package/dist/runtime/locale/fa_ir.js +47 -0
  189. package/dist/runtime/locale/fr.d.ts +2 -0
  190. package/dist/runtime/locale/fr.js +46 -0
  191. package/dist/runtime/locale/index.d.ts +12 -0
  192. package/dist/runtime/locale/index.js +12 -0
  193. package/dist/runtime/locale/it.d.ts +2 -0
  194. package/dist/runtime/locale/it.js +46 -0
  195. package/dist/runtime/locale/pl.d.ts +2 -0
  196. package/dist/runtime/locale/pl.js +46 -0
  197. package/dist/runtime/locale/ru.d.ts +2 -0
  198. package/dist/runtime/locale/ru.js +46 -0
  199. package/dist/runtime/locale/zh_hans.d.ts +2 -0
  200. package/dist/runtime/locale/zh_hans.js +46 -0
  201. package/dist/runtime/locale/zh_hant.d.ts +2 -0
  202. package/dist/runtime/locale/zh_hant.js +46 -0
  203. package/dist/runtime/types/form.d.ts +7 -2
  204. package/dist/runtime/types/index.d.ts +3 -0
  205. package/dist/runtime/types/index.js +3 -0
  206. package/dist/runtime/types/locale.d.ts +48 -0
  207. package/dist/runtime/types/locale.js +0 -0
  208. package/dist/runtime/types/utils.d.ts +7 -0
  209. package/dist/runtime/utils/form.d.ts +5 -9
  210. package/dist/runtime/utils/form.js +115 -50
  211. package/dist/runtime/utils/index.js +1 -1
  212. package/dist/runtime/utils/link.d.ts +2 -2
  213. package/dist/runtime/utils/locale.d.ts +15 -0
  214. package/dist/runtime/utils/locale.js +25 -0
  215. package/dist/runtime/vue/components/Icon.vue +15 -0
  216. package/dist/runtime/vue/components/Link.vue +195 -0
  217. package/dist/runtime/vue/plugins/color-mode.d.ts +4 -0
  218. package/dist/runtime/vue/plugins/color-mode.js +6 -0
  219. package/dist/runtime/vue/plugins/head.d.ts +4 -0
  220. package/dist/runtime/vue/plugins/head.js +6 -0
  221. package/dist/runtime/vue/stubs.d.ts +15 -0
  222. package/dist/runtime/vue/stubs.js +27 -0
  223. package/dist/shared/ui.BPnAe4QS.cjs +3030 -0
  224. package/dist/shared/ui.d52SSCwA.mjs +3023 -0
  225. package/dist/unplugin.cjs +192 -0
  226. package/dist/unplugin.d.cts +49 -0
  227. package/dist/unplugin.d.mts +49 -0
  228. package/dist/unplugin.d.ts +49 -0
  229. package/dist/unplugin.mjs +181 -0
  230. package/dist/vite.cjs +22 -0
  231. package/dist/vite.d.cts +13 -0
  232. package/dist/vite.d.mts +13 -0
  233. package/dist/vite.d.ts +13 -0
  234. package/dist/vite.mjs +20 -0
  235. package/package.json +78 -33
  236. package/vue-plugin.d.ts +5 -0
  237. package/cli/node_modules/.ignored/citty/LICENSE +0 -36
  238. package/cli/node_modules/.ignored/citty/README.md +0 -134
  239. package/cli/node_modules/.ignored/citty/dist/index.cjs +0 -475
  240. package/cli/node_modules/.ignored/citty/dist/index.d.cts +0 -80
  241. package/cli/node_modules/.ignored/citty/dist/index.d.mts +0 -80
  242. package/cli/node_modules/.ignored/citty/dist/index.d.ts +0 -80
  243. package/cli/node_modules/.ignored/citty/dist/index.mjs +0 -463
  244. package/cli/node_modules/.ignored/citty/package.json +0 -49
  245. package/cli/node_modules/.ignored/consola/LICENSE +0 -47
  246. package/cli/node_modules/.ignored/consola/README.md +0 -318
  247. package/cli/node_modules/.ignored/consola/core.d.ts +0 -1
  248. package/cli/node_modules/.ignored/consola/dist/basic.cjs +0 -32
  249. package/cli/node_modules/.ignored/consola/dist/basic.d.ts +0 -9
  250. package/cli/node_modules/.ignored/consola/dist/basic.mjs +0 -24
  251. package/cli/node_modules/.ignored/consola/dist/browser.cjs +0 -80
  252. package/cli/node_modules/.ignored/consola/dist/browser.d.ts +0 -7
  253. package/cli/node_modules/.ignored/consola/dist/browser.mjs +0 -72
  254. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.cjs +0 -436
  255. package/cli/node_modules/.ignored/consola/dist/chunks/prompt.mjs +0 -429
  256. package/cli/node_modules/.ignored/consola/dist/core.cjs +0 -415
  257. package/cli/node_modules/.ignored/consola/dist/core.d.ts +0 -124
  258. package/cli/node_modules/.ignored/consola/dist/core.mjs +0 -410
  259. package/cli/node_modules/.ignored/consola/dist/index.cjs +0 -21
  260. package/cli/node_modules/.ignored/consola/dist/index.d.ts +0 -9
  261. package/cli/node_modules/.ignored/consola/dist/index.mjs +0 -8
  262. package/cli/node_modules/.ignored/consola/dist/shared/consola.06ad8a64.mjs +0 -62
  263. package/cli/node_modules/.ignored/consola/dist/shared/consola.36c0034f.mjs +0 -636
  264. package/cli/node_modules/.ignored/consola/dist/shared/consola.4bbae468.cjs +0 -645
  265. package/cli/node_modules/.ignored/consola/dist/shared/consola.deac7d5a.cjs +0 -65
  266. package/cli/node_modules/.ignored/consola/dist/utils.cjs +0 -308
  267. package/cli/node_modules/.ignored/consola/dist/utils.d.ts +0 -169
  268. package/cli/node_modules/.ignored/consola/dist/utils.mjs +0 -284
  269. package/cli/node_modules/.ignored/consola/lib/index.cjs +0 -9
  270. package/cli/node_modules/.ignored/consola/package.json +0 -101
  271. package/cli/node_modules/.ignored/consola/utils.d.ts +0 -1
  272. package/cli/node_modules/.ignored/pathe/LICENSE +0 -44
  273. package/cli/node_modules/.ignored/pathe/README.md +0 -69
  274. package/cli/node_modules/.ignored/pathe/dist/index.cjs +0 -23
  275. package/cli/node_modules/.ignored/pathe/dist/index.d.cts +0 -36
  276. package/cli/node_modules/.ignored/pathe/dist/index.d.mts +0 -36
  277. package/cli/node_modules/.ignored/pathe/dist/index.d.ts +0 -36
  278. package/cli/node_modules/.ignored/pathe/dist/index.mjs +0 -1
  279. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.1f0a373c.cjs +0 -238
  280. package/cli/node_modules/.ignored/pathe/dist/shared/pathe.ff20891b.mjs +0 -221
  281. package/cli/node_modules/.ignored/pathe/dist/utils.cjs +0 -58
  282. package/cli/node_modules/.ignored/pathe/dist/utils.d.cts +0 -5
  283. package/cli/node_modules/.ignored/pathe/dist/utils.d.mts +0 -5
  284. package/cli/node_modules/.ignored/pathe/dist/utils.d.ts +0 -5
  285. package/cli/node_modules/.ignored/pathe/dist/utils.mjs +0 -54
  286. package/cli/node_modules/.ignored/pathe/package.json +0 -48
  287. package/cli/node_modules/.ignored/pathe/utils.d.ts +0 -1
  288. package/cli/node_modules/.ignored/scule/LICENSE +0 -21
  289. package/cli/node_modules/.ignored/scule/README.md +0 -149
  290. package/cli/node_modules/.ignored/scule/dist/index.cjs +0 -92
  291. package/cli/node_modules/.ignored/scule/dist/index.d.cts +0 -57
  292. package/cli/node_modules/.ignored/scule/dist/index.d.mts +0 -57
  293. package/cli/node_modules/.ignored/scule/dist/index.d.ts +0 -57
  294. package/cli/node_modules/.ignored/scule/dist/index.mjs +0 -80
  295. package/cli/node_modules/.ignored/scule/package.json +0 -43
  296. package/cli/node_modules/.package-lock.json +0 -33
package/dist/module.mjs CHANGED
@@ -1,2751 +1,129 @@
1
- import { defuFn, defu } from 'defu';
2
- import { addTemplate, addTypeTemplate, defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, hasNuxtModule, installModule } from '@nuxt/kit';
1
+ import defu, { defu as defu$1 } from 'defu';
2
+ import { defineNuxtModule, createResolver, addVitePlugin, addPlugin, addComponentsDir, addImportsDir, extendPages, hasNuxtModule, installModule } from '@nuxt/kit';
3
+ import { d as defaultOptions, r as resolveColors, a as getDefaultUiConfig, b as addTemplates, c as buildTemplates } from './shared/ui.d52SSCwA.mjs';
4
+ import { addCustomTab } from '@nuxt/devtools-kit';
5
+ import sirv from 'sirv';
6
+ import 'get-port-please';
7
+ import { kebabCase, camelCase } from 'scule';
8
+ import fs from 'node:fs';
9
+ import '../dist/runtime/utils/index.js';
3
10
  import 'node:url';
4
- import { kebabCase } from 'scule';
5
- import { pick } from '../dist/runtime/utils/index.js';
6
11
 
7
- const accordion = {
8
- slots: {
9
- root: "w-full",
10
- item: "border-b border-[var(--ui-border)] last:border-b-0",
11
- header: "flex",
12
- trigger: "group flex-1 flex items-center gap-1.5 font-medium text-sm py-3.5 focus-visible:outline-[var(--ui-primary)] min-w-0",
13
- content: "data-[state=open]:animate-[accordion-down_200ms_ease-out] data-[state=closed]:animate-[accordion-up_200ms_ease-out] overflow-hidden focus:outline-none",
14
- body: "text-sm pb-3.5",
15
- leadingIcon: "shrink-0 size-5",
16
- trailingIcon: "shrink-0 size-5 ms-auto group-data-[state=open]:rotate-180 transition-transform duration-200",
17
- label: "text-left break-words"
18
- },
19
- variants: {
20
- disabled: {
21
- true: {
22
- trigger: "cursor-not-allowed opacity-75"
23
- }
24
- }
25
- }
26
- };
27
-
28
- const alert = (options) => ({
29
- slots: {
30
- root: "relative overflow-hidden w-full rounded-[calc(var(--ui-radius)*2)] p-4 flex gap-2.5",
31
- wrapper: "min-w-0 flex-1 flex flex-col gap-1",
32
- title: "text-sm font-medium",
33
- description: "text-sm opacity-90",
34
- icon: "shrink-0 size-5",
35
- avatar: "shrink-0",
36
- avatarSize: "2xl",
37
- actions: "flex gap-1.5 shrink-0",
38
- close: "p-0.5"
39
- },
40
- variants: {
41
- color: {
42
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
43
- neutral: ""
44
- },
45
- variant: {
46
- solid: "",
47
- outline: "",
48
- soft: "",
49
- subtle: ""
50
- },
51
- multiline: {
52
- true: {
53
- root: "items-start",
54
- actions: "items-start mt-1"
55
- },
56
- false: {
57
- root: "items-center",
58
- actions: "items-center"
59
- }
60
- }
61
- },
62
- compoundVariants: [...(options.theme.colors || []).map((color) => ({
63
- color,
64
- variant: "solid",
65
- class: {
66
- root: `bg-[var(--ui-${color})] text-[var(--ui-bg)]`
67
- }
68
- })), ...(options.theme.colors || []).map((color) => ({
69
- color,
70
- variant: "outline",
71
- class: {
72
- root: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
73
- }
74
- })), ...(options.theme.colors || []).map((color) => ({
75
- color,
76
- variant: "soft",
77
- class: {
78
- root: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})]`
79
- }
80
- })), ...(options.theme.colors || []).map((color) => ({
81
- color,
82
- variant: "subtle",
83
- class: {
84
- root: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
85
- }
86
- })), {
87
- color: "neutral",
88
- variant: "solid",
89
- class: {
90
- root: "text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)]"
91
- }
92
- }, {
93
- color: "neutral",
94
- variant: "outline",
95
- class: {
96
- root: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border)]"
97
- }
98
- }, {
99
- color: "neutral",
100
- variant: "soft",
101
- class: {
102
- root: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50"
103
- }
104
- }, {
105
- color: "neutral",
106
- variant: "subtle",
107
- class: {
108
- root: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50 ring ring-inset ring-[var(--ui-border-accented)]"
109
- }
110
- }],
111
- defaultVariants: {
112
- color: "primary",
113
- variant: "solid"
114
- }
115
- });
116
-
117
- const avatar = {
118
- slots: {
119
- root: "inline-flex items-center justify-center shrink-0 select-none overflow-hidden rounded-full align-middle bg-[var(--ui-bg-elevated)]",
120
- image: "h-full w-full rounded-[inherit] object-cover",
121
- fallback: "font-medium leading-none text-[var(--ui-text-muted)] truncate",
122
- icon: "text-[var(--ui-text-muted)] shrink-0"
123
- },
124
- variants: {
125
- size: {
126
- "3xs": {
127
- root: "size-4 text-[8px]"
128
- },
129
- "2xs": {
130
- root: "size-5 text-[10px]"
131
- },
132
- "xs": {
133
- root: "size-6 text-xs"
134
- },
135
- "sm": {
136
- root: "size-7 text-sm"
137
- },
138
- "md": {
139
- root: "size-8 text-base"
140
- },
141
- "lg": {
142
- root: "size-9 text-lg"
143
- },
144
- "xl": {
145
- root: "size-10 text-xl"
146
- },
147
- "2xl": {
148
- root: "size-11 text-[22px]"
149
- },
150
- "3xl": {
151
- root: "size-12 text-2xl"
152
- }
153
- }
154
- },
155
- defaultVariants: {
156
- size: "md"
157
- }
158
- };
159
-
160
- const avatarGroup = {
161
- slots: {
162
- root: "inline-flex flex-row-reverse justify-end",
163
- base: "relative rounded-full ring-[var(--ui-bg)] first:me-0"
164
- },
165
- variants: {
166
- size: {
167
- "3xs": {
168
- base: "ring -me-0.5"
169
- },
170
- "2xs": {
171
- base: "ring -me-0.5"
172
- },
173
- "xs": {
174
- base: "ring -me-0.5"
175
- },
176
- "sm": {
177
- base: "ring-2 -me-1.5"
178
- },
179
- "md": {
180
- base: "ring-2 -me-1.5"
181
- },
182
- "lg": {
183
- base: "ring-2 -me-1.5"
184
- },
185
- "xl": {
186
- base: "ring-3 -me-2"
187
- },
188
- "2xl": {
189
- base: "ring-3 -me-2"
190
- },
191
- "3xl": {
192
- base: "ring-3 -me-2"
193
- }
194
- }
195
- },
196
- defaultVariants: {
197
- size: "md"
198
- }
199
- };
200
-
201
- const badge = (options) => ({
202
- base: "rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center",
203
- variants: {
204
- color: {
205
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
206
- neutral: ""
207
- },
208
- variant: {
209
- solid: "",
210
- outline: "",
211
- soft: "",
212
- subtle: ""
213
- },
214
- size: {
215
- sm: "text-xs px-1.5 py-0.5",
216
- md: "text-xs px-2 py-1",
217
- lg: "text-sm px-2 py-1"
218
- }
219
- },
220
- compoundVariants: [...(options.theme.colors || []).map((color) => ({
221
- color,
222
- variant: "solid",
223
- class: `bg-[var(--ui-${color})] text-[var(--ui-bg)]`
224
- })), ...(options.theme.colors || []).map((color) => ({
225
- color,
226
- variant: "outline",
227
- class: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/50`
228
- })), ...(options.theme.colors || []).map((color) => ({
229
- color,
230
- variant: "soft",
231
- class: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})]`
232
- })), ...(options.theme.colors || []).map((color) => ({
233
- color,
234
- variant: "subtle",
235
- class: `bg-[var(--ui-${color})]/10 text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25`
236
- })), {
237
- color: "neutral",
238
- variant: "solid",
239
- class: "text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)]"
240
- }, {
241
- color: "neutral",
242
- variant: "outline",
243
- class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg)]"
244
- }, {
245
- color: "neutral",
246
- variant: "soft",
247
- class: "text-[var(--ui-text)] bg-[var(--ui-bg-elevated)]"
248
- }, {
249
- color: "neutral",
250
- variant: "subtle",
251
- class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg-elevated)]"
252
- }],
253
- defaultVariants: {
254
- color: "primary",
255
- variant: "solid",
256
- size: "md"
257
- }
258
- });
259
-
260
- const breadcrumb = (options) => ({
261
- slots: {
262
- root: "relative min-w-0",
263
- list: "flex items-center gap-1.5",
264
- item: "flex min-w-0",
265
- link: "group relative flex items-center gap-1.5 text-sm min-w-0 focus-visible:outline-[var(--ui-primary)]",
266
- linkLeadingIcon: "shrink-0 size-5",
267
- linkLeadingAvatar: "shrink-0",
268
- linkLeadingAvatarSize: "2xs",
269
- linkLabel: "truncate",
270
- separator: "flex",
271
- separatorIcon: "shrink-0 size-5 text-[var(--ui-text-muted)]"
272
- },
273
- variants: {
274
- active: {
275
- true: {
276
- link: "text-[var(--ui-primary)] font-semibold"
277
- },
278
- false: {
279
- link: "text-[var(--ui-text-muted)] font-medium"
280
- }
281
- },
282
- disabled: {
283
- true: {
284
- link: "cursor-not-allowed opacity-75"
285
- }
286
- },
287
- to: {
288
- true: ""
289
- }
290
- },
291
- compoundVariants: [{
292
- disabled: false,
293
- active: false,
294
- to: true,
295
- class: {
296
- link: ["hover:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
297
- }
298
- }]
299
- });
300
-
301
- const buttonGroupVariant = {
302
- buttonGroup: {
303
- horizontal: "not-only:first:rounded-e-none not-only:last:rounded-s-none not-last:not-first:rounded-none",
304
- vertical: "not-only:first:rounded-b-none not-only:last:rounded-t-none not-last:not-first:rounded-none"
305
- }
306
- };
307
- const buttonGroupVariantWithRoot = {
308
- buttonGroup: {
309
- horizontal: {
310
- root: "group",
311
- base: "group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"
312
- },
313
- vertical: {
314
- root: "group",
315
- base: "group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"
316
- }
317
- }
318
- };
319
- const buttonGroup = {
320
- base: "relative",
321
- variants: {
322
- size: {
323
- xs: "",
324
- sm: "",
325
- md: "",
326
- lg: "",
327
- xl: ""
328
- },
329
- orientation: {
330
- horizontal: "inline-flex -space-x-px",
331
- vertical: "flex flex-col -space-y-px"
332
- }
333
- }
334
- };
335
-
336
- const button = (options) => ({
337
- slots: {
338
- base: ["rounded-[calc(var(--ui-radius)*1.5)] font-medium inline-flex items-center focus:outline-none disabled:cursor-not-allowed aria-disabled:cursor-not-allowed disabled:opacity-75 aria-disabled:opacity-75", options.theme.transitions && "transition-colors"],
339
- label: "truncate",
340
- leadingIcon: "shrink-0",
341
- leadingAvatar: "shrink-0",
342
- leadingAvatarSize: "",
343
- trailingIcon: "shrink-0"
344
- },
345
- variants: {
346
- ...buttonGroupVariant,
347
- color: {
348
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
349
- neutral: ""
350
- },
351
- variant: {
352
- solid: "",
353
- outline: "",
354
- soft: "",
355
- subtle: "",
356
- ghost: "",
357
- link: ""
358
- },
359
- size: {
360
- xs: {
361
- base: "px-2 py-1 text-xs gap-1",
362
- leadingIcon: "size-4",
363
- leadingAvatarSize: "3xs",
364
- trailingIcon: "size-4"
365
- },
366
- sm: {
367
- base: "px-2.5 py-1.5 text-xs gap-1.5",
368
- leadingIcon: "size-4",
369
- leadingAvatarSize: "3xs",
370
- trailingIcon: "size-4"
371
- },
372
- md: {
373
- base: "px-2.5 py-1.5 text-sm gap-1.5",
374
- leadingIcon: "size-5",
375
- leadingAvatarSize: "2xs",
376
- trailingIcon: "size-5"
377
- },
378
- lg: {
379
- base: "px-3 py-2 text-sm gap-2",
380
- leadingIcon: "size-5",
381
- leadingAvatarSize: "2xs",
382
- trailingIcon: "size-5"
383
- },
384
- xl: {
385
- base: "px-3 py-2 text-base gap-2",
386
- leadingIcon: "size-6",
387
- leadingAvatarSize: "xs",
388
- trailingIcon: "size-6"
389
- }
390
- },
391
- block: {
392
- true: {
393
- base: "w-full justify-center",
394
- leadingAvatarSize: "xs",
395
- trailingIcon: "ms-auto"
396
- }
397
- },
398
- square: {
399
- true: ""
400
- },
401
- leading: {
402
- true: ""
403
- },
404
- trailing: {
405
- true: ""
406
- },
407
- loading: {
408
- true: ""
409
- }
410
- },
411
- compoundVariants: [...(options.theme.colors || []).map((color) => ({
412
- color,
413
- variant: "solid",
414
- class: `text-[var(--ui-bg)] bg-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/75 disabled:bg-[var(--ui-${color})] aria-disabled:bg-[var(--ui-${color})] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-${color})]`
415
- })), ...(options.theme.colors || []).map((color) => ({
416
- color,
417
- variant: "outline",
418
- class: `ring ring-inset ring-[var(--ui-${color})]/50 text-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent focus-visible:ring-2 focus-visible:ring-[var(--ui-${color})]`
419
- })), ...(options.theme.colors || []).map((color) => ({
420
- color,
421
- variant: "soft",
422
- class: `text-[var(--ui-${color})] bg-[var(--ui-${color})]/10 hover:bg-[var(--ui-${color})]/15 focus-visible:bg-[var(--ui-${color})]/15 disabled:bg-[var(--ui-${color})]/10 aria-disabled:bg-[var(--ui-${color})]/10`
423
- })), ...(options.theme.colors || []).map((color) => ({
424
- color,
425
- variant: "subtle",
426
- class: `text-[var(--ui-${color})] ring ring-inset ring-[var(--ui-${color})]/25 bg-[var(--ui-${color})]/10 hover:bg-[var(--ui-${color})]/15 disabled:bg-[var(--ui-${color})]/10 aria-disabled:bg-[var(--ui-${color})]/10 focus-visible:ring-2 focus-visible:ring-[var(--ui-${color})]`
427
- })), ...(options.theme.colors || []).map((color) => ({
428
- color,
429
- variant: "ghost",
430
- class: `text-[var(--ui-${color})] hover:bg-[var(--ui-${color})]/10 focus-visible:bg-[var(--ui-${color})]/10 disabled:bg-transparent aria-disabled:bg-transparent dark:disabled:bg-transparent dark:aria-disabled:bg-transparent`
431
- })), ...(options.theme.colors || []).map((color) => ({
432
- color,
433
- variant: "link",
434
- class: `text-[var(--ui-${color})] hover:text-[var(--ui-${color})]/75 disabled:text-[var(--ui-${color})] aria-disabled:text-[var(--ui-${color})] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
435
- })), {
436
- color: "neutral",
437
- variant: "solid",
438
- class: "text-[var(--ui-bg)] bg-[var(--ui-bg-inverted)] hover:bg-[var(--ui-bg-inverted)]/80 disabled:bg-[var(--ui-bg-inverted)] aria-disabled:bg-[var(--ui-bg-inverted)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-border-inverted)]"
439
- }, {
440
- color: "neutral",
441
- variant: "outline",
442
- class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg)] hover:bg-[var(--ui-bg-elevated)] disabled:bg-[var(--ui-bg)] aria-disabled:bg-[var(--ui-bg)] focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]"
443
- }, {
444
- color: "neutral",
445
- variant: "soft",
446
- class: "text-[var(--ui-text)] bg-[var(--ui-bg-elevated)] hover:bg-[var(--ui-bg-accented)]/75 focus-visible:bg-[var(--ui-bg-accented)]/75 disabled:bg-[var(--ui-bg-elevated)] aria-disabled:bg-[var(--ui-bg-elevated)]"
447
- }, {
448
- color: "neutral",
449
- variant: "subtle",
450
- class: "ring ring-inset ring-[var(--ui-border-accented)] text-[var(--ui-text)] bg-[var(--ui-bg-elevated)] hover:bg-[var(--ui-bg-accented)]/75 disabled:bg-[var(--ui-bg-elevated)] aria-disabled:bg-[var(--ui-bg-elevated)] focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]"
451
- }, {
452
- color: "neutral",
453
- variant: "ghost",
454
- class: "text-[var(--ui-text)] hover:bg-[var(--ui-bg-elevated)] focus-visible:bg-[var(--ui-bg-elevated)] hover:disabled:bg-transparent dark:hover:disabled:bg-transparent hover:aria-disabled:bg-transparent dark:hover:aria-disabled:bg-transparent"
455
- }, {
456
- color: "neutral",
457
- variant: "link",
458
- class: "text-[var(--ui-text-muted)] hover:text-[var(--ui-text)] disabled:text-[var(--ui-text-muted)] aria-disabled:text-[var(--ui-text-muted)] focus-visible:ring-inset focus-visible:ring-2 focus-visible:ring-[var(--ui-border-inverted)]"
459
- }, {
460
- size: "xs",
461
- square: true,
462
- class: "p-1"
463
- }, {
464
- size: "sm",
465
- square: true,
466
- class: "p-1.5"
467
- }, {
468
- size: "md",
469
- square: true,
470
- class: "p-1.5"
471
- }, {
472
- size: "lg",
473
- square: true,
474
- class: "p-2"
475
- }, {
476
- size: "xl",
477
- square: true,
478
- class: "p-2"
479
- }, {
480
- loading: true,
481
- leading: true,
482
- class: {
483
- leadingIcon: "animate-spin"
484
- }
485
- }, {
486
- loading: true,
487
- leading: false,
488
- trailing: true,
489
- class: {
490
- trailingIcon: "animate-spin"
491
- }
492
- }],
493
- defaultVariants: {
494
- color: "primary",
495
- variant: "solid",
496
- size: "md"
497
- }
498
- });
499
-
500
- const card = {
501
- slots: {
502
- root: "bg-[var(--ui-bg)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] rounded-[calc(var(--ui-radius)*2)] shadow",
503
- header: "p-4 sm:px-6",
504
- body: "p-4 sm:p-6",
505
- footer: "p-4 sm:px-6"
506
- }
507
- };
508
-
509
- const carousel = (options) => ({
510
- slots: {
511
- root: "relative focus:outline-none",
512
- viewport: "overflow-hidden",
513
- container: "flex items-start",
514
- item: "min-w-0 shrink-0 basis-full",
515
- controls: "",
516
- arrows: "",
517
- prev: "absolute rounded-full",
518
- next: "absolute rounded-full",
519
- dots: "absolute inset-x-0 -bottom-7 flex flex-wrap items-center justify-center gap-3",
520
- dot: ["cursor-pointer size-3 bg-[var(--ui-border-accented)] rounded-full", options.theme.transitions && "transition"]
521
- },
522
- variants: {
523
- orientation: {
524
- vertical: {
525
- container: "flex-col -mt-4",
526
- item: "pt-4",
527
- prev: "-top-12 left-1/2 -translate-x-1/2 rotate-90",
528
- next: "-bottom-12 left-1/2 -translate-x-1/2 rotate-90"
529
- },
530
- horizontal: {
531
- container: "flex-row -ml-4",
532
- item: "pl-4",
533
- prev: "-left-12 top-1/2 -translate-y-1/2",
534
- next: "-right-12 top-1/2 -translate-y-1/2"
535
- }
536
- },
537
- active: {
538
- true: {
539
- dot: "bg-[var(--ui-border-inverted)]"
540
- }
541
- }
542
- },
543
- defaultVariants: {
544
- orientation: "horizontal"
545
- }
546
- });
547
-
548
- const checkbox = (options) => ({
549
- slots: {
550
- root: "relative flex items-start",
551
- base: "shrink-0 flex items-center justify-center rounded-[var(--ui-radius)] text-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border-accented)] focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2",
552
- container: "flex items-center",
553
- wrapper: "ms-2",
554
- icon: "shrink-0 size-full",
555
- label: "block font-medium text-[var(--ui-text)]",
556
- description: "text-[var(--ui-text-muted)]"
557
- },
558
- variants: {
559
- color: {
560
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, `focus-visible:outline-[var(--ui-${color})]`])),
561
- neutral: "focus-visible:outline-[var(--ui-border-inverted)]"
562
- },
563
- size: {
564
- xs: {
565
- base: "size-3",
566
- container: "h-4",
567
- wrapper: "text-xs"
568
- },
569
- sm: {
570
- base: "size-3.5",
571
- container: "h-4",
572
- wrapper: "text-xs"
573
- },
574
- md: {
575
- base: "size-4",
576
- container: "h-5",
577
- wrapper: "text-sm"
578
- },
579
- lg: {
580
- base: "size-4.5",
581
- container: "h-5",
582
- wrapper: "text-sm"
583
- },
584
- xl: {
585
- base: "size-5",
586
- container: "h-6",
587
- wrapper: "text-base"
588
- }
589
- },
590
- required: {
591
- true: {
592
- label: "after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]"
593
- }
594
- },
595
- disabled: {
596
- true: {
597
- base: "cursor-not-allowed opacity-75",
598
- label: "cursor-not-allowed opacity-75",
599
- description: "cursor-not-allowed opacity-75"
600
- }
601
- },
602
- checked: {
603
- true: ""
604
- }
605
- },
606
- compoundVariants: [...(options.theme.colors || []).map((color) => ({
607
- color,
608
- checked: true,
609
- class: `ring-2 ring-[var(--ui-${color})] bg-[var(--ui-${color})]`
610
- })), {
611
- color: "neutral",
612
- checked: true,
613
- class: "ring-2 ring-[var(--ui-border-inverted)] bg-[var(--ui-bg-inverted)]"
614
- }],
615
- defaultVariants: {
616
- size: "md",
617
- color: "primary"
618
- }
619
- });
620
-
621
- const chip = (options) => ({
622
- slots: {
623
- root: "relative inline-flex items-center justify-center shrink-0",
624
- base: "rounded-full ring ring-[var(--ui-bg)] flex items-center justify-center text-[var(--ui-bg)] font-medium whitespace-nowrap"
625
- },
626
- variants: {
627
- color: {
628
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, `bg-[var(--ui-${color})]`])),
629
- neutral: "bg-[var(--ui-text-muted)]"
630
- },
631
- size: {
632
- "3xs": "h-[4px] min-w-[4px] text-[4px]",
633
- "2xs": "h-[5px] min-w-[5px] text-[5px]",
634
- "xs": "h-[6px] min-w-[6px] text-[6px]",
635
- "sm": "h-[7px] min-w-[7px] text-[7px]",
636
- "md": "h-[8px] min-w-[8px] text-[8px]",
637
- "lg": "h-[9px] min-w-[9px] text-[9px]",
638
- "xl": "h-[10px] min-w-[10px] text-[10px]",
639
- "2xl": "h-[11px] min-w-[11px] text-[11px]",
640
- "3xl": "h-[12px] min-w-[12px] text-[12px]"
641
- },
642
- position: {
643
- "top-right": "top-0 right-0",
644
- "bottom-right": "bottom-0 right-0",
645
- "top-left": "top-0 left-0",
646
- "bottom-left": "bottom-0 left-0"
647
- },
648
- inset: {
649
- false: ""
650
- },
651
- standalone: {
652
- false: "absolute"
653
- }
654
- },
655
- compoundVariants: [{
656
- position: "top-right",
657
- inset: false,
658
- class: "-translate-y-1/2 translate-x-1/2 transform"
659
- }, {
660
- position: "bottom-right",
661
- inset: false,
662
- class: "translate-y-1/2 translate-x-1/2 transform"
663
- }, {
664
- position: "top-left",
665
- inset: false,
666
- class: "-translate-y-1/2 -translate-x-1/2 transform"
667
- }, {
668
- position: "bottom-left",
669
- inset: false,
670
- class: "translate-y-1/2 -translate-x-1/2 transform"
671
- }],
672
- defaultVariants: {
673
- size: "md",
674
- color: "primary",
675
- position: "top-right"
676
- }
677
- });
678
-
679
- const collapsible = {
680
- slots: {
681
- root: "",
682
- content: "data-[state=open]:animate-[collapsible-down_200ms_ease-out] data-[state=closed]:animate-[collapsible-up_200ms_ease-out] overflow-hidden"
683
- }
684
- };
685
-
686
- const commandPalette = (options) => ({
687
- slots: {
688
- root: "flex flex-col min-h-0 min-w-0 divide-y divide-[var(--ui-border)]",
689
- input: "[&>input]:h-12",
690
- close: "",
691
- content: "relative overflow-hidden",
692
- viewport: "divide-y divide-[var(--ui-border)] scroll-py-1",
693
- group: "p-1 isolate",
694
- empty: "py-6 text-center text-sm text-[var(--ui-text-muted)]",
695
- label: "px-2 py-1.5 text-xs font-semibold text-[var(--ui-text-highlighted)]",
696
- item: ["group relative w-full flex items-center gap-2 px-2 py-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
697
- itemLeadingIcon: ["shrink-0 size-5 text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"],
698
- itemLeadingAvatar: "shrink-0",
699
- itemLeadingAvatarSize: "2xs",
700
- itemLeadingChip: "shrink-0 size-5",
701
- itemLeadingChipSize: "md",
702
- itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
703
- itemTrailingIcon: "shrink-0 size-5",
704
- itemTrailingHighlightedIcon: "shrink-0 size-5 text-[var(--ui-text-dimmed)] hidden group-data-highlighted:inline-flex",
705
- itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0 gap-0.5",
706
- itemTrailingKbdsSize: "md",
707
- itemLabel: "truncate space-x-1",
708
- itemLabelBase: "text-[var(--ui-text-highlighted)] [&>mark]:text-[var(--ui-bg)] [&>mark]:bg-[var(--ui-primary)]",
709
- itemLabelPrefix: "text-[var(--ui-text)]",
710
- itemLabelSuffix: "text-[var(--ui-text-dimmed)] [&>mark]:text-[var(--ui-bg)] [&>mark]:bg-[var(--ui-primary)]"
711
- },
712
- variants: {
713
- loading: {
714
- true: {
715
- itemLeadingIcon: "animate-spin"
716
- }
717
- }
718
- }
719
- });
720
-
721
- const container = {
722
- base: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"
723
- };
724
-
725
- const contextMenu = (options) => ({
726
- slots: {
727
- content: "min-w-32 bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
728
- group: "p-1 isolate",
729
- label: "w-full flex items-center font-semibold text-[var(--ui-text-highlighted)]",
730
- separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
731
- item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
732
- itemLeadingIcon: "shrink-0",
733
- itemLeadingAvatar: "shrink-0",
734
- itemLeadingAvatarSize: "",
735
- itemTrailing: "ms-auto inline-flex",
736
- itemTrailingIcon: "shrink-0",
737
- itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
738
- itemTrailingKbdsSize: "",
739
- itemLabel: "truncate",
740
- itemLabelExternalIcon: "size-3 align-top text-[var(--ui-text-dimmed)]"
741
- },
742
- variants: {
743
- active: {
744
- true: {
745
- item: "text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]",
746
- itemLeadingIcon: "text-[var(--ui-text)]"
747
- },
748
- false: {
749
- item: ["text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
750
- itemLeadingIcon: ["text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
751
- }
752
- },
753
- loading: {
754
- true: {
755
- itemLeadingIcon: "animate-spin"
756
- }
757
- },
758
- size: {
759
- xs: {
760
- label: "p-1 text-xs gap-1",
761
- item: "p-1 text-xs gap-1",
762
- itemLeadingIcon: "size-4",
763
- itemLeadingAvatarSize: "3xs",
764
- itemTrailingIcon: "size-4",
765
- itemTrailingKbds: "gap-0.5",
766
- itemTrailingKbdsSize: "sm"
767
- },
768
- sm: {
769
- label: "p-1.5 text-xs gap-1.5",
770
- item: "p-1.5 text-xs gap-1.5",
771
- itemLeadingIcon: "size-4",
772
- itemLeadingAvatarSize: "3xs",
773
- itemTrailingIcon: "size-4",
774
- itemTrailingKbds: "gap-0.5",
775
- itemTrailingKbdsSize: "sm"
776
- },
777
- md: {
778
- label: "p-1.5 text-sm gap-1.5",
779
- item: "p-1.5 text-sm gap-1.5",
780
- itemLeadingIcon: "size-5",
781
- itemLeadingAvatarSize: "2xs",
782
- itemTrailingIcon: "size-5",
783
- itemTrailingKbds: "gap-0.5",
784
- itemTrailingKbdsSize: "md"
785
- },
786
- lg: {
787
- label: "p-2 text-sm gap-2",
788
- item: "p-2 text-sm gap-2",
789
- itemLeadingIcon: "size-5",
790
- itemLeadingAvatarSize: "2xs",
791
- itemTrailingIcon: "size-5",
792
- itemTrailingKbds: "gap-1",
793
- itemTrailingKbdsSize: "md"
794
- },
795
- xl: {
796
- label: "p-2 text-base gap-2",
797
- item: "p-2 text-base gap-2",
798
- itemLeadingIcon: "size-6",
799
- itemLeadingAvatarSize: "xs",
800
- itemTrailingIcon: "size-6",
801
- itemTrailingKbds: "gap-1",
802
- itemTrailingKbdsSize: "lg"
803
- }
804
- }
805
- },
806
- defaultVariants: {
807
- size: "md"
808
- }
809
- });
810
-
811
- const drawer = {
812
- slots: {
813
- overlay: "fixed inset-0 bg-[var(--ui-bg-elevated)]/75",
814
- content: "fixed bg-[var(--ui-bg)] ring ring-[var(--ui-border)] flex focus:outline-none",
815
- handle: "shrink-0 rounded-full bg-[var(--ui-bg-accented)]",
816
- container: "w-full flex flex-col gap-4 p-4 overflow-y-auto",
817
- header: "",
818
- title: "text-[var(--ui-text-highlighted)] font-semibold",
819
- description: "mt-1 text-[var(--ui-text-muted)] text-sm",
820
- body: "flex-1",
821
- footer: "flex flex-col gap-1.5"
822
- },
823
- variants: {
824
- direction: {
825
- top: {
826
- content: "top-0 mb-24 flex-col-reverse rounded-b-[calc(var(--ui-radius)*2)]",
827
- handle: "mb-4"
828
- },
829
- right: {
830
- content: "right-4 flex-row",
831
- handle: "ml-4"
832
- },
833
- bottom: {
834
- content: "bottom-0 mt-24 flex-col rounded-t-[calc(var(--ui-radius)*2)]",
835
- handle: "mt-4"
836
- },
837
- left: {
838
- content: "left-4 flex-row-reverse",
839
- handle: "mr-4"
840
- }
841
- }
842
- },
843
- compoundVariants: [{
844
- direction: ["top", "bottom"],
845
- class: {
846
- content: "inset-x-0 h-auto max-h-[96%]",
847
- handle: "w-12 h-1.5 mx-auto"
848
- }
849
- }, {
850
- direction: ["right", "left"],
851
- class: {
852
- content: "inset-y-4 w-auto max-w-[calc(100%-2rem)] rounded-[calc(var(--ui-radius)*2)] after:hidden",
853
- handle: "h-12 w-1.5 mt-auto mb-auto"
854
- }
855
- }]
856
- };
857
-
858
- const dropdownMenu = (options) => ({
859
- slots: {
860
- content: "min-w-32 bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] divide-y divide-[var(--ui-border)] overflow-y-auto scroll-py-1 data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
861
- arrow: "fill-[var(--ui-border)]",
862
- group: "p-1 isolate",
863
- label: "w-full flex items-center font-semibold text-[var(--ui-text-highlighted)]",
864
- separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
865
- item: "group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
866
- itemLeadingIcon: "shrink-0",
867
- itemLeadingAvatar: "shrink-0",
868
- itemLeadingAvatarSize: "",
869
- itemTrailing: "ms-auto inline-flex",
870
- itemTrailingIcon: "shrink-0",
871
- itemTrailingKbds: "hidden lg:inline-flex items-center shrink-0",
872
- itemTrailingKbdsSize: "",
873
- itemLabel: "truncate",
874
- itemLabelExternalIcon: "size-3 align-top text-[var(--ui-text-dimmed)]"
875
- },
876
- variants: {
877
- active: {
878
- true: {
879
- item: "text-[var(--ui-text-highlighted)] before:bg-[var(--ui-bg-elevated)]",
880
- itemLeadingIcon: "text-[var(--ui-text)]"
881
- },
882
- false: {
883
- item: ["text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
884
- itemLeadingIcon: ["text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
885
- }
886
- },
887
- loading: {
888
- true: {
889
- itemLeadingIcon: "animate-spin"
890
- }
891
- },
892
- size: {
893
- xs: {
894
- label: "p-1 text-xs gap-1",
895
- item: "p-1 text-xs gap-1",
896
- itemLeadingIcon: "size-4",
897
- itemLeadingAvatarSize: "3xs",
898
- itemTrailingIcon: "size-4",
899
- itemTrailingKbds: "gap-0.5",
900
- itemTrailingKbdsSize: "sm"
901
- },
902
- sm: {
903
- label: "p-1.5 text-xs gap-1.5",
904
- item: "p-1.5 text-xs gap-1.5",
905
- itemLeadingIcon: "size-4",
906
- itemLeadingAvatarSize: "3xs",
907
- itemTrailingIcon: "size-4",
908
- itemTrailingKbds: "gap-0.5",
909
- itemTrailingKbdsSize: "sm"
910
- },
911
- md: {
912
- label: "p-1.5 text-sm gap-1.5",
913
- item: "p-1.5 text-sm gap-1.5",
914
- itemLeadingIcon: "size-5",
915
- itemLeadingAvatarSize: "2xs",
916
- itemTrailingIcon: "size-5",
917
- itemTrailingKbds: "gap-0.5",
918
- itemTrailingKbdsSize: "md"
919
- },
920
- lg: {
921
- label: "p-2 text-sm gap-2",
922
- item: "p-2 text-sm gap-2",
923
- itemLeadingIcon: "size-5",
924
- itemLeadingAvatarSize: "2xs",
925
- itemTrailingIcon: "size-5",
926
- itemTrailingKbds: "gap-1",
927
- itemTrailingKbdsSize: "md"
928
- },
929
- xl: {
930
- label: "p-2 text-base gap-2",
931
- item: "p-2 text-base gap-2",
932
- itemLeadingIcon: "size-6",
933
- itemLeadingAvatarSize: "xs",
934
- itemTrailingIcon: "size-6",
935
- itemTrailingKbds: "gap-1",
936
- itemTrailingKbdsSize: "lg"
937
- }
938
- }
939
- },
940
- defaultVariants: {
941
- size: "md"
942
- }
943
- });
944
-
945
- const form = {
946
- base: ""
947
- };
948
-
949
- const formField = {
950
- slots: {
951
- root: "",
952
- wrapper: "",
953
- labelWrapper: "flex content-center items-center justify-between",
954
- label: "block font-medium text-[var(--ui-text)]",
955
- container: "mt-1 relative",
956
- description: "text-[var(--ui-text-muted)]",
957
- error: "mt-2 text-[var(--ui-error)]",
958
- hint: "text-[var(--ui-text-muted)]",
959
- help: "mt-2 text-[var(--ui-text-muted)]"
960
- },
961
- variants: {
962
- size: {
963
- xs: { root: "text-xs" },
964
- sm: { root: "text-xs" },
965
- md: { root: "text-sm" },
966
- lg: { root: "text-sm" },
967
- xl: { root: "text-base" }
968
- },
969
- required: {
970
- true: {
971
- label: `after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]`
972
- }
973
- }
974
- },
975
- defaultVariants: {
976
- size: "md"
977
- }
978
- };
979
-
980
- const input = (options) => ({
981
- slots: {
982
- root: "relative inline-flex items-center",
983
- base: ["w-full rounded-[calc(var(--ui-radius)*1.5)] border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
984
- leading: "absolute inset-y-0 start-0 flex items-center",
985
- leadingIcon: "shrink-0 text-[var(--ui-text-dimmed)]",
986
- leadingAvatar: "shrink-0",
987
- leadingAvatarSize: "",
988
- trailing: "absolute inset-y-0 end-0 flex items-center",
989
- trailingIcon: "shrink-0 text-[var(--ui-text-dimmed)]"
990
- },
991
- variants: {
992
- ...buttonGroupVariantWithRoot,
993
- size: {
994
- xs: {
995
- base: "px-2 py-1 text-xs gap-1",
996
- leading: "pl-2",
997
- trailing: "pr-2",
998
- leadingIcon: "size-4",
999
- leadingAvatarSize: "3xs",
1000
- trailingIcon: "size-4"
1001
- },
1002
- sm: {
1003
- base: "px-2.5 py-1.5 text-xs gap-1.5",
1004
- leading: "pl-2.5",
1005
- trailing: "pr-2.5",
1006
- leadingIcon: "size-4",
1007
- leadingAvatarSize: "3xs",
1008
- trailingIcon: "size-4"
1009
- },
1010
- md: {
1011
- base: "px-2.5 py-1.5 text-sm gap-1.5",
1012
- leading: "pl-2.5",
1013
- trailing: "pr-2.5",
1014
- leadingIcon: "size-5",
1015
- leadingAvatarSize: "2xs",
1016
- trailingIcon: "size-5"
1017
- },
1018
- lg: {
1019
- base: "px-3 py-2 text-sm gap-2",
1020
- leading: "pl-3",
1021
- trailing: "pr-3",
1022
- leadingIcon: "size-5",
1023
- leadingAvatarSize: "2xs",
1024
- trailingIcon: "size-5"
1025
- },
1026
- xl: {
1027
- base: "px-3 py-2 text-base gap-2",
1028
- leading: "pl-3",
1029
- trailing: "pr-3",
1030
- leadingIcon: "size-6",
1031
- leadingAvatarSize: "xs",
1032
- trailingIcon: "size-6"
1033
- }
1034
- },
1035
- variant: {
1036
- outline: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg)] ring ring-inset ring-[var(--ui-border-accented)]",
1037
- soft: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)]/50 hover:bg-[var(--ui-bg-elevated)] focus:bg-[var(--ui-bg-elevated)] disabled:bg-[var(--ui-bg-elevated)]/50",
1038
- subtle: "text-[var(--ui-text-highlighted)] bg-[var(--ui-bg-elevated)] ring ring-inset ring-[var(--ui-border-accented)]",
1039
- ghost: "text-[var(--ui-text-highlighted)] hover:bg-[var(--ui-bg-elevated)] focus:bg-[var(--ui-bg-elevated)] disabled:bg-transparent dark:disabled:bg-transparent",
1040
- none: "text-[var(--ui-text-highlighted)]"
1041
- },
1042
- color: {
1043
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1044
- neutral: ""
1045
- },
1046
- leading: {
1047
- true: ""
1048
- },
1049
- trailing: {
1050
- true: ""
1051
- },
1052
- loading: {
1053
- true: ""
1054
- },
1055
- highlight: {
1056
- true: ""
1057
- },
1058
- type: {
1059
- file: "file:mr-1.5 file:font-medium file:text-[var(--ui-text-muted)] file:outline-none"
1060
- }
1061
- },
1062
- compoundVariants: [...(options.theme.colors || []).map((color) => ({
1063
- color,
1064
- variant: ["outline", "subtle"],
1065
- class: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
1066
- })), ...(options.theme.colors || []).map((color) => ({
1067
- color,
1068
- highlight: true,
1069
- class: `ring ring-inset ring-[var(--ui-${color})]`
1070
- })), {
1071
- color: "neutral",
1072
- variant: ["outline", "subtle"],
1073
- class: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]"
1074
- }, {
1075
- color: "neutral",
1076
- highlight: true,
1077
- class: "ring ring-inset ring-[var(--ui-border-inverted)]"
1078
- }, {
1079
- leading: true,
1080
- size: "xs",
1081
- class: "pl-7"
1082
- }, {
1083
- leading: true,
1084
- size: "sm",
1085
- class: "pl-8"
1086
- }, {
1087
- leading: true,
1088
- size: "md",
1089
- class: "pl-9"
1090
- }, {
1091
- leading: true,
1092
- size: "lg",
1093
- class: "pl-10"
1094
- }, {
1095
- leading: true,
1096
- size: "xl",
1097
- class: "pl-11"
1098
- }, {
1099
- trailing: true,
1100
- size: "xs",
1101
- class: "pr-7"
1102
- }, {
1103
- trailing: true,
1104
- size: "sm",
1105
- class: "pr-8"
1106
- }, {
1107
- trailing: true,
1108
- size: "md",
1109
- class: "pr-9"
1110
- }, {
1111
- trailing: true,
1112
- size: "lg",
1113
- class: "pr-10"
1114
- }, {
1115
- trailing: true,
1116
- size: "xl",
1117
- class: "pr-11"
1118
- }, {
1119
- loading: true,
1120
- leading: true,
1121
- class: {
1122
- leadingIcon: "animate-spin"
1123
- }
1124
- }, {
1125
- loading: true,
1126
- leading: false,
1127
- trailing: true,
1128
- class: {
1129
- trailingIcon: "animate-spin"
1130
- }
1131
- }],
1132
- defaultVariants: {
1133
- size: "md",
1134
- color: "primary",
1135
- variant: "outline"
1136
- }
1137
- });
1138
-
1139
- const inputMenu = (options) => {
1140
- return defuFn({
1141
- slots: {
1142
- base: () => ["rounded-[calc(var(--ui-radius)*1.5)]", options.theme.transitions && "transition-colors"],
1143
- trailing: "group absolute inset-y-0 end-0 flex items-center disabled:cursor-not-allowed disabled:opacity-75",
1144
- arrow: "fill-[var(--ui-border)]",
1145
- content: "max-h-60 w-[var(--radix-popper-anchor-width)] bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1146
- viewport: "divide-y divide-[var(--ui-border)] scroll-py-1",
1147
- group: "p-1 isolate",
1148
- empty: "py-2 text-center text-sm text-[var(--ui-text-muted)]",
1149
- label: "font-semibold text-[var(--ui-text-highlighted)]",
1150
- separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
1151
- item: ["group relative w-full flex items-center gap-1.5 p-1.5 text-sm select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
1152
- itemLeadingIcon: ["shrink-0 text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"],
1153
- itemLeadingAvatar: "shrink-0",
1154
- itemLeadingAvatarSize: "",
1155
- itemLeadingChip: "shrink-0",
1156
- itemLeadingChipSize: "",
1157
- itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
1158
- itemTrailingIcon: "shrink-0",
1159
- itemLabel: "truncate",
1160
- tagsItem: "px-1.5 py-0.5 rounded-[var(--ui-radius)] font-medium inline-flex items-center gap-0.5 ring ring-inset ring-[var(--ui-border-accented)] bg-[var(--ui-bg-elevated)] text-[var(--ui-text)] data-disabled:cursor-not-allowed data-disabled:opacity-75",
1161
- tagsItemText: "truncate",
1162
- tagsItemDelete: ["inline-flex items-center rounded-[calc(var(--ui-radius)/2)] text-[var(--ui-text-dimmed)] hover:text-[var(--ui-text)] hover:bg-[var(--ui-bg-accented)]/75 disabled:pointer-events-none", options.theme.transitions && "transition-colors"],
1163
- tagsItemDeleteIcon: "",
1164
- tagsInput: ""
1165
- },
1166
- variants: {
1167
- multiple: {
1168
- true: {
1169
- root: "flex-wrap",
1170
- base: "",
1171
- tagsInput: "border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
1172
- },
1173
- false: {
1174
- base: "w-full border-0 placeholder:text-[var(--ui-text-dimmed)] focus:outline-none disabled:cursor-not-allowed disabled:opacity-75"
1175
- }
1176
- },
1177
- size: {
1178
- xs: {
1179
- label: "p-1 text-[10px]/3 gap-1",
1180
- item: "p-1 text-xs gap-1",
1181
- itemLeadingIcon: "size-4",
1182
- itemLeadingAvatarSize: "3xs",
1183
- itemLeadingChip: "size-4",
1184
- itemLeadingChipSize: "sm",
1185
- itemTrailingIcon: "size-4",
1186
- tagsItem: "text-[10px]/3",
1187
- tagsItemDeleteIcon: "size-3"
1188
- },
1189
- sm: {
1190
- label: "p-1.5 text-[10px]/3 gap-1.5",
1191
- item: "p-1.5 text-xs gap-1.5",
1192
- itemLeadingIcon: "size-4",
1193
- itemLeadingAvatarSize: "3xs",
1194
- itemLeadingChip: "size-4",
1195
- itemLeadingChipSize: "sm",
1196
- itemTrailingIcon: "size-4",
1197
- tagsItem: "text-[10px]/3",
1198
- tagsItemDeleteIcon: "size-3"
1199
- },
1200
- md: {
1201
- label: "p-1.5 text-xs gap-1.5",
1202
- item: "p-1.5 text-sm gap-1.5",
1203
- itemLeadingIcon: "size-5",
1204
- itemLeadingAvatarSize: "2xs",
1205
- itemLeadingChip: "size-5",
1206
- itemLeadingChipSize: "md",
1207
- itemTrailingIcon: "size-5",
1208
- tagsItem: "text-xs",
1209
- tagsItemDeleteIcon: "size-3.5"
1210
- },
1211
- lg: {
1212
- label: "p-2 text-xs gap-2",
1213
- item: "p-2 text-sm gap-2",
1214
- itemLeadingIcon: "size-5",
1215
- itemLeadingAvatarSize: "2xs",
1216
- itemLeadingChip: "size-5",
1217
- itemLeadingChipSize: "md",
1218
- itemTrailingIcon: "size-5",
1219
- tagsItem: "text-xs",
1220
- tagsItemDeleteIcon: "size-3.5"
1221
- },
1222
- xl: {
1223
- label: "p-2 text-sm gap-2",
1224
- item: "p-2 text-base gap-2",
1225
- itemLeadingIcon: "size-6",
1226
- itemLeadingAvatarSize: "xs",
1227
- itemLeadingChip: "size-6",
1228
- itemLeadingChipSize: "lg",
1229
- itemTrailingIcon: "size-6",
1230
- tagsItem: "text-sm",
1231
- tagsItemDeleteIcon: "size-4"
12
+ const devtoolsComponentMeta = {};
13
+ function extractDevtoolsMeta(code) {
14
+ const match = code.match(/extendDevtoolsMeta(?:<.*?>)?\(/);
15
+ if (!match)
16
+ return null;
17
+ const startIndex = code.indexOf(match[0]) + match[0].length;
18
+ let openBraceCount = 0;
19
+ let closeBraceCount = 0;
20
+ let endIndex = startIndex;
21
+ for (let i = startIndex; i < code.length; i++) {
22
+ if (code[i] === "{")
23
+ openBraceCount++;
24
+ if (code[i] === "}")
25
+ closeBraceCount++;
26
+ if (openBraceCount > 0 && openBraceCount === closeBraceCount) {
27
+ endIndex = i + 1;
28
+ break;
29
+ }
30
+ }
31
+ return code.slice(startIndex, endIndex).trim();
32
+ }
33
+ function devtoolsMetaPlugin({ resolve, options, templates }) {
34
+ return {
35
+ name: "ui-devtools-component-meta",
36
+ enforce: "pre",
37
+ async transform(code, id) {
38
+ if (!id.match(/\/runtime\/components\/\w+.vue/))
39
+ return;
40
+ const fileName = id.split("/")[id.split("/").length - 1];
41
+ if (code && fileName) {
42
+ const slug = kebabCase(fileName.replace(/\..*/, ""));
43
+ const match = extractDevtoolsMeta(code);
44
+ if (match) {
45
+ const metaObject = new Function(`return ${match}`)();
46
+ devtoolsComponentMeta[slug] = { meta: { devtools: { ...metaObject } } };
1232
47
  }
1233
48
  }
1234
- },
1235
- compoundVariants: [...(options.theme.colors || []).map((color) => ({
1236
- color,
1237
- multiple: true,
1238
- variant: ["outline", "subtle"],
1239
- class: `has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[var(--${color})]`
1240
- })), {
1241
- color: "neutral",
1242
- multiple: true,
1243
- variant: ["outline", "subtle"],
1244
- class: "has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-[var(--ui-border-inverted)]"
1245
- }]
1246
- }, input(options));
1247
- };
1248
-
1249
- const kbd = {
1250
- base: "inline-flex items-center justify-center px-1 rounded-[var(--ui-radius)] font-medium font-sans",
1251
- variants: {
1252
- variant: {
1253
- solid: "bg-[var(--ui-bg-inverted)] text-[var(--ui-bg)]",
1254
- outline: "bg-[var(--ui-bg)] text-[var(--ui-text-highlighted)] ring ring-inset ring-[var(--ui-border-accented)]",
1255
- subtle: "bg-[var(--ui-bg-elevated)] text-[var(--ui-text)] ring ring-inset ring-[var(--ui-border-accented)]"
1256
- },
1257
- size: {
1258
- sm: "h-4 min-w-[16px] text-[10px]",
1259
- md: "h-5 min-w-[20px] text-[11px]",
1260
- lg: "h-6 min-w-[24px] text-[12px]"
1261
- }
1262
- },
1263
- defaultVariants: {
1264
- variant: "outline",
1265
- size: "md"
1266
- }
1267
- };
1268
-
1269
- const link = (options) => ({
1270
- base: "focus-visible:outline-[var(--ui-primary)]",
1271
- variants: {
1272
- active: {
1273
- true: "text-[var(--ui-primary)]",
1274
- false: ["text-[var(--ui-text-muted)] hover:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1275
- },
1276
- disabled: {
1277
- true: "cursor-not-allowed opacity-75"
1278
- }
1279
- }
1280
- });
1281
-
1282
- const modal = {
1283
- slots: {
1284
- overlay: "fixed inset-0 bg-[var(--ui-bg-elevated)]/75",
1285
- content: "fixed w-full h-dvh bg-[var(--ui-bg)] divide-y divide-[var(--ui-border)] flex flex-col focus:outline-none",
1286
- header: "px-4 py-5 sm:px-6",
1287
- body: "flex-1 p-4 sm:p-6",
1288
- footer: "flex items-center gap-1.5 p-4 sm:px-6",
1289
- title: "text-[var(--ui-text-highlighted)] font-semibold",
1290
- description: "mt-1 text-[var(--ui-text-muted)] text-sm",
1291
- close: "absolute top-4 right-4"
1292
- },
1293
- variants: {
1294
- transition: {
1295
- true: {
1296
- overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]",
1297
- content: "data-[state=open]:animate-[scale-in_200ms_ease-out] data-[state=closed]:animate-[scale-out_200ms_ease-in]"
1298
- }
1299
- },
1300
- fullscreen: {
1301
- true: {
1302
- content: "inset-0"
1303
- },
1304
- false: {
1305
- content: "top-[50%] left-[50%] translate-x-[-50%] translate-y-[-50%] sm:max-w-lg sm:h-auto sm:my-8 sm:rounded-[calc(var(--ui-radius)*2)] sm:shadow-lg sm:ring ring-[var(--ui-border)]"
1306
- }
1307
- }
1308
- }
1309
- };
1310
-
1311
- const navigationMenu = (options) => ({
1312
- slots: {
1313
- root: "relative flex gap-1.5",
1314
- list: "isolate min-w-0",
1315
- item: "min-w-0",
1316
- link: "group relative w-full flex items-center gap-1.5 font-medium text-sm before:absolute before:z-[-1] before:rounded-[calc(var(--ui-radius)*1.5)] focus:outline-none focus-visible:outline-none dark:focus-visible:outline-none focus-visible:before:ring-inset focus-visible:before:ring-2",
1317
- linkLeadingIcon: "shrink-0 size-5",
1318
- linkLeadingAvatar: "shrink-0",
1319
- linkLeadingAvatarSize: "2xs",
1320
- linkTrailing: "ms-auto inline-flex",
1321
- linkTrailingBadge: "shrink-0 rounded",
1322
- linkTrailingBadgeSize: "sm",
1323
- linkTrailingIcon: "size-5 transform shrink-0 group-data-[state=open]:rotate-180 transition-transform duration-200",
1324
- linkLabel: "truncate",
1325
- linkLabelExternalIcon: "size-3 align-top text-[var(--ui-text-dimmed)]",
1326
- childList: "",
1327
- childItem: "",
1328
- childLink: "group size-full px-3 py-2 rounded-[calc(var(--ui-radius)*1.5)] flex items-start gap-2 text-left",
1329
- childLinkWrapper: "flex flex-col items-start",
1330
- childLinkIcon: "size-5 shrink-0",
1331
- childLinkLabel: "font-semibold text-sm relative inline-flex",
1332
- childLinkLabelExternalIcon: "size-3 align-top text-[var(--ui-text-dimmed)]",
1333
- childLinkDescription: "text-sm text-[var(--ui-text-muted)]",
1334
- separator: "px-2 h-px bg-[var(--ui-border)]",
1335
- viewportWrapper: "absolute top-full inset-x-0 flex w-full",
1336
- // FIXME: add `sm:w-[var(--radix-navigation-menu-viewport-width)]` / `transition-[width,height]` / `origin-[top_center]` once position is based on trigger
1337
- viewport: "relative overflow-hidden bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] h-[var(--radix-navigation-menu-viewport-height)] w-full data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1338
- content: "absolute top-0 left-0 w-full data-[motion=from-start]:animate-[enter-from-left_200ms_ease] data-[motion=from-end]:animate-[enter-from-right_200ms_ease] data-[motion=to-start]:animate-[exit-to-left_200ms_ease] data-[motion=to-end]:animate-[exit-to-right_200ms_ease]",
1339
- indicator: "data-[state=visible]:animate-[fade-in_100ms_ease-out] data-[state=hidden]:animate-[fade-out_100ms_ease-in] bottom-0 z-[1] flex h-2.5 items-end justify-center overflow-hidden transition-transform duration-200 ease-out",
1340
- arrow: "relative top-[50%] size-2.5 rotate-45 border border-[var(--ui-border)] bg-[var(--ui-bg)] z-[1] rounded-[calc(var(--ui-radius)/2)]"
1341
- },
1342
- variants: {
1343
- color: {
1344
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1345
- link: `focus-visible:before:ring-[var(--ui-${color})]`,
1346
- childLink: `focus-visible:outline-[var(--ui-${color})]`
1347
- }])),
1348
- neutral: {
1349
- link: "focus-visible:before:ring-[var(--ui-border-inverted)]",
1350
- childLink: "focus-visible:outline-[var(--ui-border-inverted)]"
1351
- }
1352
- },
1353
- highlightColor: {
1354
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
1355
- neutral: ""
1356
- },
1357
- variant: {
1358
- pill: "",
1359
- link: ""
1360
- },
1361
- orientation: {
1362
- horizontal: {
1363
- root: "w-full items-center justify-between",
1364
- list: "flex items-center",
1365
- item: "py-2",
1366
- link: "px-2.5 py-1.5 before:inset-x-px before:inset-y-0",
1367
- childList: "grid grid-cols-2 gap-2 p-2"
1368
- },
1369
- vertical: {
1370
- root: "flex-col",
1371
- link: "flex-row px-2.5 py-1.5 before:inset-y-px before:inset-x-0",
1372
- childList: "ml-5 border-l border-[var(--ui-border)]",
1373
- childItem: "pl-1.5 -ml-px"
1374
- }
1375
- },
1376
- active: {
1377
- true: {
1378
- childLink: "bg-[var(--ui-bg-elevated)] text-[var(--ui-text-highlighted)]",
1379
- childLinkIcon: "text-[var(--ui-text)]"
1380
- },
1381
- false: {
1382
- link: "text-[var(--ui-text-muted)]",
1383
- linkLeadingIcon: "text-[var(--ui-text-dimmed)]",
1384
- childLink: ["hover:bg-[var(--ui-bg-elevated)]/50 text-[var(--ui-text)] hover:text-[var(--ui-text-highlighted)]", options.theme.transitions && "transition-colors"],
1385
- childLinkIcon: ["text-[var(--ui-text-dimmed)] group-hover:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1386
- }
1387
- },
1388
- disabled: {
1389
- true: {
1390
- link: "cursor-not-allowed opacity-75"
1391
- }
1392
- },
1393
- highlight: {
1394
- true: ""
1395
- }
1396
- },
1397
- compoundVariants: [{
1398
- highlight: true,
1399
- orientation: "horizontal",
1400
- class: {
1401
- item: "-mb-px",
1402
- link: "after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full"
1403
- }
1404
- }, {
1405
- highlight: true,
1406
- orientation: "vertical",
1407
- class: {
1408
- item: "px-1.5 -ml-px",
1409
- link: "after:absolute after:-left-1.5 after:inset-y-0.5 after:block after:w-px after:rounded-full"
1410
- }
1411
- }, {
1412
- disabled: false,
1413
- active: false,
1414
- variant: "pill",
1415
- class: {
1416
- link: ["hover:text-[var(--ui-text-highlighted)] hover:before:bg-[var(--ui-bg-elevated)]/50 data-[state=open]:text-[var(--ui-text-highlighted)]", options.theme.transitions && "transition-colors before:transition-colors"],
1417
- linkLeadingIcon: ["group-hover:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1418
- }
1419
- }, {
1420
- disabled: false,
1421
- variant: "pill",
1422
- highlight: true,
1423
- orientation: "horizontal",
1424
- class: {
1425
- link: "data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50"
1426
- }
1427
- }, {
1428
- disabled: false,
1429
- variant: "pill",
1430
- highlight: false,
1431
- active: false,
1432
- orientation: "horizontal",
1433
- class: {
1434
- link: "data-[state=open]:before:bg-[var(--ui-bg-elevated)]/50"
1435
- }
1436
- }, ...(options.theme.colors || []).map((color) => ({
1437
- color,
1438
- variant: "pill",
1439
- active: true,
1440
- class: {
1441
- link: `text-[var(--ui-${color})]`,
1442
- linkLeadingIcon: `text-[var(--ui-${color})]`
1443
- }
1444
- })), {
1445
- color: "neutral",
1446
- variant: "pill",
1447
- active: true,
1448
- class: {
1449
- link: "text-[var(--ui-text-highlighted)]",
1450
- linkLeadingIcon: "text-[var(--ui-text-highlighted)]"
1451
- }
1452
- }, {
1453
- variant: "pill",
1454
- active: true,
1455
- highlight: false,
1456
- class: {
1457
- link: "before:bg-[var(--ui-bg-elevated)]"
1458
- }
1459
- }, {
1460
- variant: "pill",
1461
- active: true,
1462
- highlight: true,
1463
- class: {
1464
- link: ["hover:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "before:transition-colors"]
1465
- }
1466
- }, {
1467
- disabled: false,
1468
- active: false,
1469
- variant: "link",
1470
- class: {
1471
- link: ["hover:text-[var(--ui-text-highlighted)] data-[state=open]:text-[var(--ui-text-highlighted)]", options.theme.transitions && "transition-colors"],
1472
- linkLeadingIcon: ["group-hover:text-[var(--ui-text)] group-data-[state=open]:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"]
1473
- }
1474
- }, ...(options.theme.colors || []).map((color) => ({
1475
- color,
1476
- variant: "link",
1477
- active: true,
1478
- class: {
1479
- link: `text-[var(--ui-${color})]`,
1480
- linkLeadingIcon: `text-[var(--ui-${color})]`
1481
- }
1482
- })), {
1483
- color: "neutral",
1484
- variant: "link",
1485
- active: true,
1486
- class: {
1487
- link: "text-[var(--ui-text-highlighted)]",
1488
- linkLeadingIcon: "text-[var(--ui-text-highlighted)]"
1489
- }
1490
- }, ...(options.theme.colors || []).map((highlightColor) => ({
1491
- highlightColor,
1492
- highlight: true,
1493
- active: true,
1494
- class: {
1495
- link: `after:bg-[var(--ui-${highlightColor})]`
1496
- }
1497
- })), {
1498
- highlightColor: "neutral",
1499
- highlight: true,
1500
- active: true,
1501
- class: {
1502
- link: "after:bg-[var(--ui-bg-inverted)]"
1503
- }
1504
- }],
1505
- defaultVariants: {
1506
- color: "primary",
1507
- highlightColor: "primary",
1508
- variant: "pill"
1509
- }
1510
- });
1511
-
1512
- const pagination = {
1513
- slots: {
1514
- root: "",
1515
- list: "flex items-center gap-1",
1516
- ellipsis: "pointer-events-none",
1517
- label: "min-w-5 text-center"
1518
- }
1519
- };
1520
-
1521
- const popover = {
1522
- slots: {
1523
- content: "bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] focus:outline-none",
1524
- arrow: "fill-[var(--ui-border)]"
1525
- }
1526
- };
1527
-
1528
- const progress = (options) => ({
1529
- slots: {
1530
- root: "gap-2",
1531
- base: "relative overflow-hidden rounded-full bg-[var(--ui-bg-accented)]",
1532
- indicator: "rounded-full size-full transition-transform duration-200 ease-out",
1533
- status: "flex justify-end text-[var(--ui-text-dimmed)] transition-[width] duration-200",
1534
- steps: "grid items-end",
1535
- step: "truncate text-end row-start-1 col-start-1 transition-opacity"
1536
- },
1537
- variants: {
1538
- animation: {
1539
- "carousel": "",
1540
- "carousel-inverse": "",
1541
- "swing": "",
1542
- "elastic": ""
1543
- },
1544
- color: {
1545
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1546
- indicator: `bg-[var(--ui-${color})]`,
1547
- steps: `text-[var(--ui-${color})]`
1548
- }])),
1549
- neutral: {
1550
- indicator: "bg-[var(--ui-bg-inverted)]",
1551
- steps: "text-[var(--ui-bg)]"
1552
- }
1553
- },
1554
- size: {
1555
- "2xs": {
1556
- status: "text-xs",
1557
- steps: "text-xs"
1558
- },
1559
- "xs": {
1560
- status: "text-xs",
1561
- steps: "text-xs"
1562
- },
1563
- "sm": {
1564
- status: "text-sm",
1565
- steps: "text-sm"
1566
- },
1567
- "md": {
1568
- status: "text-sm",
1569
- steps: "text-sm"
1570
- },
1571
- "lg": {
1572
- status: "text-sm",
1573
- steps: "text-sm"
1574
- },
1575
- "xl": {
1576
- status: "text-base",
1577
- steps: "text-base"
1578
- },
1579
- "2xl": {
1580
- status: "text-base",
1581
- steps: "text-base"
1582
- }
1583
- },
1584
- step: {
1585
- active: {
1586
- step: "opacity-100"
1587
- },
1588
- first: {
1589
- step: "opacity-100 text-[var(--ui-text-muted)]"
1590
- },
1591
- other: {
1592
- step: "opacity-0"
1593
- },
1594
- last: {
1595
- step: ""
1596
- }
1597
- },
1598
- orientation: {
1599
- horizontal: {
1600
- root: "w-full flex flex-col",
1601
- base: "w-full",
1602
- status: "flex-row"
1603
- },
1604
- vertical: {
1605
- root: "h-full flex flex-row-reverse",
1606
- base: "h-full",
1607
- status: "flex-col"
1608
- }
1609
- },
1610
- inverted: {
1611
- true: {
1612
- status: "self-end"
1613
- }
1614
- }
1615
- },
1616
- compoundVariants: [{
1617
- inverted: true,
1618
- orientation: "horizontal",
1619
- class: {
1620
- step: "text-start",
1621
- status: "flex-row-reverse"
1622
- }
1623
- }, {
1624
- inverted: true,
1625
- orientation: "vertical",
1626
- class: {
1627
- steps: "items-start",
1628
- status: "flex-col-reverse"
1629
- }
1630
- }, {
1631
- orientation: "horizontal",
1632
- size: "2xs",
1633
- class: "h-px"
1634
- }, {
1635
- orientation: "horizontal",
1636
- size: "xs",
1637
- class: "h-0.5"
1638
- }, {
1639
- orientation: "horizontal",
1640
- size: "sm",
1641
- class: "h-1"
1642
- }, {
1643
- orientation: "horizontal",
1644
- size: "md",
1645
- class: "h-2"
1646
- }, {
1647
- orientation: "horizontal",
1648
- size: "lg",
1649
- class: "h-3"
1650
- }, {
1651
- orientation: "horizontal",
1652
- size: "xl",
1653
- class: "h-4"
1654
- }, {
1655
- orientation: "horizontal",
1656
- size: "2xl",
1657
- class: "h-5"
1658
- }, {
1659
- orientation: "vertical",
1660
- size: "2xs",
1661
- class: "w-px"
1662
- }, {
1663
- orientation: "vertical",
1664
- size: "xs",
1665
- class: "w-0.5"
1666
- }, {
1667
- orientation: "vertical",
1668
- size: "sm",
1669
- class: "w-1"
1670
- }, {
1671
- orientation: "vertical",
1672
- size: "md",
1673
- class: "w-2"
1674
- }, {
1675
- orientation: "vertical",
1676
- size: "lg",
1677
- class: "w-3"
1678
- }, {
1679
- orientation: "vertical",
1680
- size: "xl",
1681
- class: "w-4"
1682
- }, {
1683
- orientation: "vertical",
1684
- size: "2xl",
1685
- class: "w-5"
1686
- }, {
1687
- orientation: "horizontal",
1688
- animation: "carousel",
1689
- class: {
1690
- indicator: "data-[state=indeterminate]:animate-[carousel_2s_ease-in-out_infinite]"
1691
- }
1692
- }, {
1693
- orientation: "vertical",
1694
- animation: "carousel",
1695
- class: {
1696
- indicator: "data-[state=indeterminate]:animate-[carousel-vertical_2s_ease-in-out_infinite]"
1697
- }
1698
- }, {
1699
- orientation: "horizontal",
1700
- animation: "carousel-inverse",
1701
- class: {
1702
- indicator: "data-[state=indeterminate]:animate-[carousel-inverse_2s_ease-in-out_infinite]"
1703
- }
1704
- }, {
1705
- orientation: "vertical",
1706
- animation: "carousel-inverse",
1707
- class: {
1708
- indicator: "data-[state=indeterminate]:animate-[carousel-inverse-vertical_2s_ease-in-out_infinite]"
1709
- }
1710
- }, {
1711
- orientation: "horizontal",
1712
- animation: "swing",
1713
- class: {
1714
- indicator: "data-[state=indeterminate]:animate-[swing_2s_ease-in-out_infinite]"
1715
- }
1716
- }, {
1717
- orientation: "vertical",
1718
- animation: "swing",
1719
- class: {
1720
- indicator: "data-[state=indeterminate]:animate-[swing-vertical_2s_ease-in-out_infinite]"
1721
- }
1722
- }, {
1723
- orientation: "horizontal",
1724
- animation: "elastic",
1725
- class: {
1726
- indicator: "data-[state=indeterminate]:animate-[elastic_2s_ease-in-out_infinite]"
1727
- }
1728
- }, {
1729
- orientation: "vertical",
1730
- animation: "elastic",
1731
- class: {
1732
- indicator: "data-[state=indeterminate]:animate-[elastic-vertical_2s_ease-in-out_infinite]"
1733
- }
1734
- }],
1735
- defaultVariants: {
1736
- animation: "carousel",
1737
- color: "primary",
1738
- size: "md"
1739
- }
1740
- });
1741
-
1742
- const radioGroup = (options) => ({
1743
- slots: {
1744
- root: "relative",
1745
- fieldset: "flex",
1746
- legend: "mb-1 block font-medium text-[var(--ui-text)]",
1747
- item: "flex items-start",
1748
- base: "rounded-full ring ring-inset ring-[var(--ui-border-accented)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-offset-[var(--ui-bg)]",
1749
- indicator: "flex items-center justify-center size-full rounded-full after:bg-[var(--ui-bg)] after:rounded-full",
1750
- container: "flex items-center",
1751
- wrapper: "ms-2",
1752
- label: "block font-medium text-[var(--ui-text)]",
1753
- description: "text-[var(--ui-text-muted)]"
1754
- },
1755
- variants: {
1756
- color: {
1757
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
1758
- base: `focus-visible:outline-[var(--ui-${color})]`,
1759
- indicator: `bg-[var(--ui-${color})]`
1760
- }])),
1761
- neutral: {
1762
- base: "focus-visible:outline-[var(--ui-border-inverted)]",
1763
- indicator: "bg-[var(--ui-bg-inverted)]"
1764
- }
1765
- },
1766
- orientation: {
1767
- horizontal: {
1768
- fieldset: "flex-row",
1769
- wrapper: "me-2"
1770
- },
1771
- vertical: {
1772
- fieldset: "flex-col"
1773
- }
1774
- },
1775
- size: {
1776
- xs: {
1777
- fieldset: "gap-0.5",
1778
- legend: "text-xs",
1779
- base: "size-3",
1780
- item: "text-xs",
1781
- container: "h-4",
1782
- indicator: "after:size-1"
1783
- },
1784
- sm: {
1785
- fieldset: "gap-0.5",
1786
- legend: "text-xs",
1787
- base: "size-3.5",
1788
- item: "text-xs",
1789
- container: "h-4",
1790
- indicator: "after:size-1"
1791
- },
1792
- md: {
1793
- fieldset: "gap-1",
1794
- legend: "text-sm",
1795
- base: "size-4",
1796
- item: "text-sm",
1797
- container: "h-5",
1798
- indicator: "after:size-1.5"
1799
- },
1800
- lg: {
1801
- fieldset: "gap-1",
1802
- legend: "text-sm",
1803
- base: "size-4.5",
1804
- item: "text-sm",
1805
- container: "h-5",
1806
- indicator: "after:size-1.5"
1807
- },
1808
- xl: {
1809
- fieldset: "gap-1.5",
1810
- legend: "text-base",
1811
- base: "size-5",
1812
- item: "text-base",
1813
- container: "h-6",
1814
- indicator: "after:size-2"
1815
- }
1816
- },
1817
- disabled: {
1818
- true: {
1819
- base: "cursor-not-allowed opacity-75",
1820
- label: "cursor-not-allowed opacity-75"
1821
- }
1822
- },
1823
- required: {
1824
- true: {
1825
- legend: "after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]"
1826
- }
1827
- }
1828
- },
1829
- defaultVariants: {
1830
- size: "md",
1831
- color: "primary"
1832
- }
1833
- });
1834
-
1835
- const select = (options) => {
1836
- return defuFn({
1837
- slots: {
1838
- root: () => void 0,
1839
- base: () => ["relative group rounded-[calc(var(--ui-radius)*1.5)] inline-flex items-center focus:outline-none disabled:cursor-not-allowed disabled:opacity-75", options.theme.transitions && "transition-colors"],
1840
- value: "truncate group-data-placeholder:text-[var(--ui-text-dimmed)]",
1841
- arrow: "fill-[var(--ui-border)]",
1842
- content: "max-h-60 w-[var(--radix-popper-anchor-width)] bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*1.5)] ring ring-[var(--ui-border)] overflow-hidden data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
1843
- viewport: "divide-y divide-[var(--ui-border)] scroll-py-1",
1844
- group: "p-1 isolate",
1845
- empty: "py-2 text-center text-sm text-[var(--ui-text-muted)]",
1846
- label: "font-semibold text-[var(--ui-text-highlighted)]",
1847
- separator: "-mx-1 my-1 h-px bg-[var(--ui-border)]",
1848
- item: ["group relative w-full flex items-center select-none outline-none before:absolute before:z-[-1] before:inset-px before:rounded-[calc(var(--ui-radius)*1.5)] data-disabled:cursor-not-allowed data-disabled:opacity-75 text-[var(--ui-text)] data-highlighted:text-[var(--ui-text-highlighted)] data-highlighted:before:bg-[var(--ui-bg-elevated)]/50", options.theme.transitions && "transition-colors before:transition-colors"],
1849
- itemLeadingIcon: ["shrink-0 text-[var(--ui-text-dimmed)] group-data-highlighted:text-[var(--ui-text)]", options.theme.transitions && "transition-colors"],
1850
- itemLeadingAvatar: "shrink-0",
1851
- itemLeadingAvatarSize: "",
1852
- itemLeadingChip: "shrink-0",
1853
- itemLeadingChipSize: "",
1854
- itemTrailing: "ms-auto inline-flex gap-1.5 items-center",
1855
- itemTrailingIcon: "shrink-0",
1856
- itemLabel: "truncate"
1857
- },
1858
- variants: {
1859
- ...buttonGroupVariant,
1860
- size: {
1861
- xs: {
1862
- label: "p-1 text-[10px]/3 gap-1",
1863
- item: "p-1 text-xs gap-1",
1864
- itemLeadingIcon: "size-4",
1865
- itemLeadingAvatarSize: "3xs",
1866
- itemLeadingChip: "size-4",
1867
- itemLeadingChipSize: "sm",
1868
- itemTrailingIcon: "size-4"
1869
- },
1870
- sm: {
1871
- label: "p-1.5 text-[10px]/3 gap-1.5",
1872
- item: "p-1.5 text-xs gap-1.5",
1873
- itemLeadingIcon: "size-4",
1874
- itemLeadingAvatarSize: "3xs",
1875
- itemLeadingChip: "size-4",
1876
- itemLeadingChipSize: "sm",
1877
- itemTrailingIcon: "size-4"
1878
- },
1879
- md: {
1880
- label: "p-1.5 text-xs gap-1.5",
1881
- item: "p-1.5 text-sm gap-1.5",
1882
- itemLeadingIcon: "size-5",
1883
- itemLeadingAvatarSize: "2xs",
1884
- itemLeadingChip: "size-5",
1885
- itemLeadingChipSize: "md",
1886
- itemTrailingIcon: "size-5"
1887
- },
1888
- lg: {
1889
- label: "p-2 text-xs gap-2",
1890
- item: "p-2 text-sm gap-2",
1891
- itemLeadingIcon: "size-5",
1892
- itemLeadingAvatarSize: "2xs",
1893
- itemLeadingChip: "size-5",
1894
- itemLeadingChipSize: "md",
1895
- itemTrailingIcon: "size-5"
1896
- },
1897
- xl: {
1898
- label: "p-2 text-sm gap-2",
1899
- item: "p-2 text-base gap-2",
1900
- itemLeadingIcon: "size-6",
1901
- itemLeadingAvatarSize: "xs",
1902
- itemLeadingChip: "size-6",
1903
- itemLeadingChipSize: "lg",
1904
- itemTrailingIcon: "size-6"
49
+ return {
50
+ code
51
+ };
52
+ },
53
+ configureServer(server) {
54
+ server.middlewares.use("/__nuxt_ui__/devtools/api/component-meta", async (_req, res) => {
55
+ res.setHeader("Content-Type", "application/json");
56
+ try {
57
+ const componentMeta = await import('./chunks/component-meta.mjs');
58
+ const meta = defu(
59
+ Object.entries(componentMeta.default).reduce((acc, [key, value]) => {
60
+ if (!key.startsWith("U"))
61
+ return acc;
62
+ const name = key.substring(1);
63
+ const slug = kebabCase(name);
64
+ const template = templates?.[camelCase(name)];
65
+ if (devtoolsComponentMeta[slug] === void 0) {
66
+ const path = resolve(`./runtime/components/${name}.vue`);
67
+ const code = fs.readFileSync(path, "utf-8");
68
+ const match = extractDevtoolsMeta(code);
69
+ if (match) {
70
+ const metaObject = new Function(`return ${match}`)();
71
+ devtoolsComponentMeta[slug] = { meta: { devtools: { ...metaObject } } };
72
+ } else {
73
+ devtoolsComponentMeta[slug] = null;
74
+ }
75
+ }
76
+ value.meta.props = value.meta.props.map((prop) => {
77
+ let defaultValue = prop.default ? prop.default : prop?.tags?.find((tag) => tag.name === "defaultValue" && !tag.text?.includes("appConfig"))?.text ?? template?.defaultVariants?.[prop.name];
78
+ if (typeof defaultValue === "string")
79
+ defaultValue = defaultValue?.replaceAll(/["'`]/g, "");
80
+ if (defaultValue === "true")
81
+ defaultValue = true;
82
+ if (defaultValue === "false")
83
+ defaultValue = false;
84
+ if (!Number.isNaN(Number.parseInt(defaultValue)))
85
+ defaultValue = Number.parseInt(defaultValue);
86
+ return {
87
+ ...prop,
88
+ default: defaultValue
89
+ };
90
+ });
91
+ const label = key.replace(/^U/, options.prefix ?? "U");
92
+ acc[kebabCase(key.replace(/^U/, ""))] = { ...value, label, slug };
93
+ return acc;
94
+ }, {}),
95
+ devtoolsComponentMeta
96
+ );
97
+ res.end(JSON.stringify(meta));
98
+ } catch (error) {
99
+ console.error(`Failed to fetch component meta`, error);
100
+ res.statusCode = 500;
101
+ res.end(JSON.stringify({ error: "Failed to fetch component meta" }));
1905
102
  }
1906
- }
1907
- }
1908
- }, input(options));
1909
- };
1910
-
1911
- const selectMenu = (options) => {
1912
- return defu({
1913
- slots: {
1914
- value: "truncate",
1915
- placeholder: "truncate text-[var(--ui-text-dimmed)]",
1916
- input: "placeholder:text-[var(--ui-text-dimmed)] border-0 border-b border-[var(--ui-border)] focus:outline-none"
1917
- },
1918
- variants: {
1919
- size: {
1920
- xs: {
1921
- input: "text-xs px-2 py-1"
1922
- },
1923
- sm: {
1924
- input: "text-xs px-2.5 py-1.5"
1925
- },
1926
- md: {
1927
- input: "text-sm px-2.5 py-1.5"
1928
- },
1929
- lg: {
1930
- input: "text-sm px-3 py-2"
1931
- },
1932
- xl: {
1933
- input: "text-base px-3 py-2"
103
+ });
104
+ server.middlewares.use("/__nuxt_ui__/devtools/api/component-example", async (req, res) => {
105
+ const query = new URL(req.url, "http://localhost").searchParams;
106
+ const name = query.get("component");
107
+ if (!name) {
108
+ res.statusCode = 400;
109
+ res.end(JSON.stringify({ error: "Component name is required" }));
110
+ return;
1934
111
  }
1935
- }
1936
- }
1937
- }, select(options));
1938
- };
1939
-
1940
- const separator = (options) => ({
1941
- slots: {
1942
- root: "flex items-center align-center text-center",
1943
- border: "",
1944
- container: "font-medium text-[var(--ui-text)] flex",
1945
- icon: "shrink-0 size-5",
1946
- avatar: "shrink-0",
1947
- avatarSize: "2xs",
1948
- label: "text-sm"
1949
- },
1950
- variants: {
1951
- color: {
1952
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, { border: `border-[var(--ui-${color})]` }])),
1953
- neutral: { border: "border-[var(--ui-border)]" }
1954
- },
1955
- orientation: {
1956
- horizontal: {
1957
- root: "w-full flex-row",
1958
- border: "w-full",
1959
- container: "mx-3 whitespace-nowrap"
1960
- },
1961
- vertical: {
1962
- root: "h-full flex-col",
1963
- border: "h-full",
1964
- container: "my-2"
1965
- }
1966
- },
1967
- size: {
1968
- xs: "",
1969
- sm: "",
1970
- md: "",
1971
- lg: "",
1972
- xl: ""
1973
- },
1974
- type: {
1975
- solid: {
1976
- border: "border-solid"
1977
- },
1978
- dashed: {
1979
- border: "border-dashed"
1980
- },
1981
- dotted: {
1982
- border: "border-dotted"
1983
- }
1984
- }
1985
- },
1986
- compoundVariants: [{
1987
- orientation: "horizontal",
1988
- size: "xs",
1989
- class: { border: "border-t" }
1990
- }, {
1991
- orientation: "horizontal",
1992
- size: "sm",
1993
- class: { border: "border-t-[2px]" }
1994
- }, {
1995
- orientation: "horizontal",
1996
- size: "md",
1997
- class: { border: "border-t-[3px]" }
1998
- }, {
1999
- orientation: "horizontal",
2000
- size: "lg",
2001
- class: { border: "border-t-[4px]" }
2002
- }, {
2003
- orientation: "horizontal",
2004
- size: "xl",
2005
- class: { border: "border-t-[5px]" }
2006
- }, {
2007
- orientation: "vertical",
2008
- size: "xs",
2009
- class: { border: "border-s" }
2010
- }, {
2011
- orientation: "vertical",
2012
- size: "sm",
2013
- class: { border: "border-s-[2px]" }
2014
- }, {
2015
- orientation: "vertical",
2016
- size: "md",
2017
- class: { border: "border-s-[3px]" }
2018
- }, {
2019
- orientation: "vertical",
2020
- size: "lg",
2021
- class: { border: "border-s-[4px]" }
2022
- }, {
2023
- orientation: "vertical",
2024
- size: "xl",
2025
- class: { border: "border-s-[5px]" }
2026
- }],
2027
- defaultVariants: {
2028
- color: "neutral",
2029
- size: "xs",
2030
- type: "solid"
2031
- }
2032
- });
2033
-
2034
- const skeleton = {
2035
- base: "animate-pulse rounded-[calc(var(--ui-radius)*1.5)] bg-[var(--ui-bg-elevated)]"
2036
- };
2037
-
2038
- const slideover = {
2039
- slots: {
2040
- overlay: "fixed inset-0 bg-[var(--ui-bg-elevated)]/75",
2041
- content: "fixed bg-[var(--ui-bg)] divide-y divide-[var(--ui-border)] sm:ring ring-[var(--ui-border)] sm:shadow-lg flex flex-col focus:outline-none",
2042
- header: "px-4 py-5 sm:px-6",
2043
- body: "flex-1 overflow-y-auto p-4 sm:p-6",
2044
- footer: "flex items-center gap-1.5 p-4 sm:px-6",
2045
- title: "text-[var(--ui-text-highlighted)] font-semibold",
2046
- description: "mt-1 text-[var(--ui-text-muted)] text-sm",
2047
- close: "absolute top-4 right-4"
2048
- },
2049
- variants: {
2050
- side: {
2051
- top: {
2052
- content: "inset-x-0 top-0 max-h-full"
2053
- },
2054
- right: {
2055
- content: "right-0 inset-y-0 w-full max-w-md"
2056
- },
2057
- bottom: {
2058
- content: "inset-x-0 bottom-0 max-h-full"
2059
- },
2060
- left: {
2061
- content: "left-0 inset-y-0 w-full max-w-md"
2062
- }
2063
- },
2064
- transition: {
2065
- true: {
2066
- overlay: "data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"
2067
- }
2068
- }
2069
- },
2070
- compoundVariants: [{
2071
- transition: true,
2072
- side: "top",
2073
- class: {
2074
- content: "data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"
2075
- }
2076
- }, {
2077
- transition: true,
2078
- side: "right",
2079
- class: {
2080
- content: "data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"
2081
- }
2082
- }, {
2083
- transition: true,
2084
- side: "bottom",
2085
- class: {
2086
- content: "data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"
2087
- }
2088
- }, {
2089
- transition: true,
2090
- side: "left",
2091
- class: {
2092
- content: "data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"
2093
- }
2094
- }]
2095
- };
2096
-
2097
- const slider = (options) => ({
2098
- slots: {
2099
- root: "relative flex items-center select-none touch-none",
2100
- track: "relative bg-[var(--ui-bg-accented)] overflow-hidden rounded-full grow",
2101
- range: "absolute rounded-full",
2102
- thumb: "rounded-full bg-[var(--ui-bg)] ring-2 focus:outline-none focus-visible:outline-2 focus-visible:outline-offset-2"
2103
- },
2104
- variants: {
2105
- color: {
2106
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2107
- range: `bg-[var(--ui-${color})]`,
2108
- thumb: `ring-[var(--ui-${color})] focus-visible:outline-[var(--ui-${color})]`
2109
- }])),
2110
- neutral: {
2111
- range: "bg-[var(--ui-bg-inverted)]",
2112
- thumb: "ring-[var(--ui-border-inverted)] focus-visible:outline-[var(--ui-border-inverted)]/50"
2113
- }
2114
- },
2115
- size: {
2116
- xs: {
2117
- thumb: "size-3"
2118
- },
2119
- sm: {
2120
- thumb: "size-3.5"
2121
- },
2122
- md: {
2123
- thumb: "size-4"
2124
- },
2125
- lg: {
2126
- thumb: "size-4.5"
2127
- },
2128
- xl: {
2129
- thumb: "size-5"
2130
- }
2131
- },
2132
- orientation: {
2133
- horizontal: {
2134
- root: "w-full",
2135
- range: "h-full"
2136
- },
2137
- vertical: {
2138
- root: "flex-col h-full",
2139
- range: "w-full"
2140
- }
2141
- },
2142
- disabled: {
2143
- true: {
2144
- root: "opacity-75 cursor-not-allowed"
2145
- }
2146
- }
2147
- },
2148
- compoundVariants: [{
2149
- orientation: "horizontal",
2150
- size: "xs",
2151
- class: {
2152
- track: "h-[6px]"
2153
- }
2154
- }, {
2155
- orientation: "horizontal",
2156
- size: "sm",
2157
- class: {
2158
- track: "h-[7px]"
2159
- }
2160
- }, {
2161
- orientation: "horizontal",
2162
- size: "md",
2163
- class: {
2164
- track: "h-[8px]"
2165
- }
2166
- }, {
2167
- orientation: "horizontal",
2168
- size: "lg",
2169
- class: {
2170
- track: "h-[9px]"
2171
- }
2172
- }, {
2173
- orientation: "horizontal",
2174
- size: "xl",
2175
- class: {
2176
- track: "h-[10px]"
2177
- }
2178
- }, {
2179
- orientation: "vertical",
2180
- size: "xs",
2181
- class: {
2182
- track: "w-[6px]"
2183
- }
2184
- }, {
2185
- orientation: "vertical",
2186
- size: "sm",
2187
- class: {
2188
- track: "w-[7px]"
2189
- }
2190
- }, {
2191
- orientation: "vertical",
2192
- size: "md",
2193
- class: {
2194
- track: "w-[8px]"
2195
- }
2196
- }, {
2197
- orientation: "vertical",
2198
- size: "lg",
2199
- class: {
2200
- track: "w-[9px]"
2201
- }
2202
- }, {
2203
- orientation: "vertical",
2204
- size: "xl",
2205
- class: {
2206
- track: "w-[10px]"
2207
- }
2208
- }],
2209
- defaultVariants: {
2210
- size: "md",
2211
- color: "primary"
2212
- }
2213
- });
2214
-
2215
- const _switch = (options) => ({
2216
- slots: {
2217
- root: "relative flex items-start",
2218
- base: ["inline-flex items-center shrink-0 rounded-full border-2 border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-[var(--ui-bg)] data-[state=unchecked]:bg-[var(--ui-bg-accented)]", options.theme.transitions && "transition-colors duration-200"],
2219
- container: "flex items-center",
2220
- thumb: "group pointer-events-none block rounded-full bg-[var(--ui-bg)] shadow-lg ring-0 transition-transform duration-200 data-[state=unchecked]:translate-x-0 flex items-center justify-center",
2221
- icon: ["absolute shrink-0 group-data-[state=unchecked]:text-[var(--ui-text-dimmed)] opacity-0 size-10/12", options.theme.transitions && "transition-[color,opacity] duration-200"],
2222
- wrapper: "ms-2",
2223
- label: "block font-medium text-[var(--ui-text)]",
2224
- description: "text-[var(--ui-text-muted)]"
2225
- },
2226
- variants: {
2227
- color: {
2228
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2229
- base: `data-[state=checked]:bg-[var(--ui-${color})] focus-visible:ring-[var(--ui-${color})]`,
2230
- icon: `group-data-[state=checked]:text-[var(--ui-${color})]`
2231
- }])),
2232
- neutral: {
2233
- base: "data-[state=checked]:bg-[var(--ui-bg-inverted)] focus-visible:ring-[var(--ui-border-inverted)]",
2234
- icon: "group-data-[state=checked]:text-[var(--ui-text-highlighted)]"
2235
- }
2236
- },
2237
- size: {
2238
- xs: {
2239
- base: "w-7",
2240
- container: "h-4",
2241
- thumb: "size-3 data-[state=checked]:translate-x-3",
2242
- wrapper: "text-xs"
2243
- },
2244
- sm: {
2245
- base: "w-8",
2246
- container: "h-4",
2247
- thumb: "size-3.5 data-[state=checked]:translate-x-3.5",
2248
- wrapper: "text-xs"
2249
- },
2250
- md: {
2251
- base: "w-9",
2252
- container: "h-5",
2253
- thumb: "size-4 data-[state=checked]:translate-x-4",
2254
- wrapper: "text-sm"
2255
- },
2256
- lg: {
2257
- base: "w-10",
2258
- container: "h-5",
2259
- thumb: "size-4.5 data-[state=checked]:translate-x-4.5",
2260
- wrapper: "text-sm"
2261
- },
2262
- xl: {
2263
- base: "w-11",
2264
- container: "h-6",
2265
- thumb: "size-5 data-[state=checked]:translate-x-5",
2266
- wrapper: "text-base"
2267
- }
2268
- },
2269
- checked: {
2270
- true: {
2271
- icon: "group-data-[state=checked]:opacity-100"
2272
- }
2273
- },
2274
- unchecked: {
2275
- true: {
2276
- icon: "group-data-[state=unchecked]:opacity-100"
2277
- }
2278
- },
2279
- loading: {
2280
- true: {
2281
- icon: "animate-spin"
2282
- }
2283
- },
2284
- required: {
2285
- true: {
2286
- label: "after:content-['*'] after:ms-0.5 after:text-[var(--ui-error)]"
2287
- }
2288
- },
2289
- disabled: {
2290
- true: {
2291
- base: "cursor-not-allowed opacity-75",
2292
- label: "cursor-not-allowed opacity-75",
2293
- description: "cursor-not-allowed opacity-75"
2294
- }
2295
- }
2296
- },
2297
- defaultVariants: {
2298
- color: "primary",
2299
- size: "md"
2300
- }
2301
- });
2302
-
2303
- const table = (options) => ({
2304
- slots: {
2305
- root: "relative overflow-auto",
2306
- base: "min-w-full overflow-clip",
2307
- thead: "relative [&>tr]:after:absolute [&>tr]:after:inset-x-0 [&>tr]:after:bottom-0 [&>tr]:after:h-px [&>tr]:after:bg-[var(--ui-border-accented)]",
2308
- tbody: "divide-y divide-[var(--ui-border)]",
2309
- tr: "data-[selected=true]:bg-[var(--ui-bg-elevated)]/50",
2310
- th: "px-4 py-3.5 text-sm text-[var(--ui-text-highlighted)] text-left rtl:text-right font-semibold [&:has([role=checkbox])]:pr-0",
2311
- td: "p-4 text-sm text-[var(--ui-text-muted)] whitespace-nowrap [&:has([role=checkbox])]:pr-0",
2312
- empty: "py-6 text-center text-sm text-[var(--ui-text-muted)]"
2313
- },
2314
- variants: {
2315
- pinned: {
2316
- true: {
2317
- th: "sticky bg-[var(--ui-bg)]/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0",
2318
- td: "sticky bg-[var(--ui-bg)]/75 data-[pinned=left]:left-0 data-[pinned=right]:right-0"
2319
- }
2320
- },
2321
- sticky: {
2322
- true: {
2323
- thead: "sticky top-0 inset-x-0 bg-[var(--ui-bg)]/75 z-[1] backdrop-blur"
2324
- }
2325
- },
2326
- loading: {
2327
- true: {
2328
- thead: "after:absolute after:bottom-0 after:inset-x-0 after:h-px"
2329
- }
2330
- },
2331
- loadingAnimation: {
2332
- "carousel": "",
2333
- "carousel-inverse": "",
2334
- "swing": "",
2335
- "elastic": ""
2336
- },
2337
- loadingColor: {
2338
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2339
- neutral: ""
2340
- }
2341
- },
2342
- compoundVariants: [...(options.theme.colors || []).map((loadingColor) => ({
2343
- loading: true,
2344
- loadingColor,
2345
- class: {
2346
- thead: `after:bg-[var(--ui-${loadingColor})]`
2347
- }
2348
- })), {
2349
- loading: true,
2350
- loadingColor: "neutral",
2351
- class: {
2352
- thead: "after:bg-[var(--ui-bg-inverted)]"
2353
- }
2354
- }, {
2355
- loading: true,
2356
- loadingAnimation: "carousel",
2357
- class: {
2358
- thead: "after:animate-[carousel_2s_ease-in-out_infinite]"
2359
- }
2360
- }, {
2361
- loading: true,
2362
- loadingAnimation: "carousel-inverse",
2363
- class: {
2364
- thead: "after:animate-[carousel-inverse_2s_ease-in-out_infinite]"
2365
- }
2366
- }, {
2367
- loading: true,
2368
- loadingAnimation: "swing",
2369
- class: {
2370
- thead: "after:animate-[swing_2s_ease-in-out_infinite]"
2371
- }
2372
- }, {
2373
- loading: true,
2374
- loadingAnimation: "elastic",
2375
- class: {
2376
- thead: "after:animate-[elastic_2s_ease-in-out_infinite]"
2377
- }
2378
- }],
2379
- defaultVariants: {
2380
- loadingColor: "primary",
2381
- loadingAnimation: "carousel"
2382
- }
2383
- });
2384
-
2385
- const tabs = (options) => ({
2386
- slots: {
2387
- root: "flex items-center gap-2",
2388
- list: "relative flex p-1 group",
2389
- indicator: "absolute transition-[translate,width] duration-200",
2390
- trigger: ["relative inline-flex items-center shrink-0 data-[state=inactive]:text-[var(--ui-text-muted)] hover:data-[state=inactive]:text-[var(--ui-text)] font-medium rounded-[calc(var(--ui-radius)*1.5)] disabled:cursor-not-allowed disabled:opacity-75 focus:outline-none", options.theme.transitions && "transition-colors"],
2391
- content: "focus:outline-none w-full",
2392
- leadingIcon: "shrink-0",
2393
- leadingAvatar: "shrink-0",
2394
- leadingAvatarSize: "",
2395
- label: "truncate"
2396
- },
2397
- variants: {
2398
- color: {
2399
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, ""])),
2400
- neutral: ""
2401
- },
2402
- variant: {
2403
- pill: {
2404
- list: "bg-[var(--ui-bg-elevated)] rounded-[calc(var(--ui-radius)*2)]",
2405
- trigger: "flex-1",
2406
- indicator: "rounded-[calc(var(--ui-radius)*1.5)] shadow-sm"
2407
- },
2408
- link: {
2409
- list: "border-[var(--ui-border)]",
2410
- indicator: "rounded-full"
2411
- }
2412
- },
2413
- orientation: {
2414
- horizontal: {
2415
- root: "flex-col",
2416
- list: "w-full",
2417
- indicator: "left-0 w-[var(--radix-tabs-indicator-size)] translate-x-[var(--radix-tabs-indicator-position)]",
2418
- trigger: "justify-center"
2419
- },
2420
- vertical: {
2421
- list: "flex-col",
2422
- indicator: "top-0 h-[var(--radix-tabs-indicator-size)] translate-y-[var(--radix-tabs-indicator-position)]"
2423
- }
2424
- },
2425
- size: {
2426
- xs: {
2427
- trigger: "px-2 py-1 text-xs gap-1",
2428
- leadingIcon: "size-4",
2429
- leadingAvatarSize: "3xs"
2430
- },
2431
- sm: {
2432
- trigger: "px-2.5 py-1.5 text-xs gap-1.5",
2433
- leadingIcon: "size-4",
2434
- leadingAvatarSize: "3xs"
2435
- },
2436
- md: {
2437
- trigger: "px-3 py-1.5 text-sm gap-1.5",
2438
- leadingIcon: "size-5",
2439
- leadingAvatarSize: "2xs"
2440
- },
2441
- lg: {
2442
- trigger: "px-3 py-2 text-sm gap-2",
2443
- leadingIcon: "size-5",
2444
- leadingAvatarSize: "2xs"
2445
- },
2446
- xl: {
2447
- trigger: "px-3 py-2 text-base gap-2",
2448
- leadingIcon: "size-6",
2449
- leadingAvatarSize: "xs"
2450
- }
2451
- }
2452
- },
2453
- compoundVariants: [{
2454
- orientation: "horizontal",
2455
- variant: "pill",
2456
- class: {
2457
- indicator: "inset-y-1"
2458
- }
2459
- }, {
2460
- orientation: "horizontal",
2461
- variant: "link",
2462
- class: {
2463
- list: "border-b",
2464
- indicator: "-bottom-px h-px"
2465
- }
2466
- }, {
2467
- orientation: "vertical",
2468
- variant: "pill",
2469
- class: {
2470
- indicator: "inset-x-1",
2471
- list: "items-center"
2472
- }
2473
- }, {
2474
- orientation: "vertical",
2475
- variant: "link",
2476
- class: {
2477
- list: "border-l",
2478
- indicator: "-left-px w-px"
2479
- }
2480
- }, ...(options.theme.colors || []).map((color) => ({
2481
- color,
2482
- variant: "pill",
2483
- class: {
2484
- indicator: `bg-[var(--ui-${color})]`,
2485
- trigger: `data-[state=active]:text-[var(--ui-bg)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-${color})]`
2486
- }
2487
- })), {
2488
- color: "neutral",
2489
- variant: "pill",
2490
- class: {
2491
- indicator: "bg-[var(--ui-bg-inverted)]",
2492
- trigger: "data-[state=active]:text-[var(--ui-bg)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--ui-border-inverted)]"
2493
- }
2494
- }, ...(options.theme.colors || []).map((color) => ({
2495
- color,
2496
- variant: "link",
2497
- class: {
2498
- indicator: `bg-[var(--ui-${color})]`,
2499
- trigger: `data-[state=active]:text-[var(--ui-${color})] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`
2500
- }
2501
- })), {
2502
- color: "neutral",
2503
- variant: "link",
2504
- class: {
2505
- indicator: "bg-[var(--ui-bg-inverted)]",
2506
- trigger: "data-[state=active]:text-[var(--ui-text-highlighted)] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]"
2507
- }
2508
- }],
2509
- defaultVariants: {
2510
- color: "primary",
2511
- variant: "pill",
2512
- size: "md"
2513
- }
2514
- });
2515
-
2516
- const textarea = (options) => {
2517
- return input(options);
2518
- };
2519
-
2520
- const toast = (options) => ({
2521
- slots: {
2522
- root: "relative group overflow-hidden bg-[var(--ui-bg)] shadow-lg rounded-[calc(var(--ui-radius)*2)] ring ring-[var(--ui-border)] p-4 flex gap-2.5 focus:outline-none",
2523
- wrapper: "w-0 flex-1 flex flex-col gap-1",
2524
- title: "text-sm font-medium text-[var(--ui-text-highlighted)]",
2525
- description: "text-sm text-[var(--ui-text-muted)]",
2526
- icon: "shrink-0 size-5",
2527
- avatar: "shrink-0",
2528
- avatarSize: "2xl",
2529
- actions: "flex gap-1.5 shrink-0",
2530
- progress: "absolute inset-x-0 bottom-0 h-1 z-[-1]",
2531
- close: "p-0.5"
2532
- },
2533
- variants: {
2534
- color: {
2535
- ...Object.fromEntries((options.theme.colors || []).map((color) => [color, {
2536
- root: `focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-${color})]`,
2537
- icon: `text-[var(--ui-${color})]`,
2538
- progress: `bg-[var(--ui-${color})]`
2539
- }])),
2540
- neutral: {
2541
- root: "focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-[var(--ui-border-inverted)]",
2542
- icon: "text-[var(--ui-text-highlighted)]",
2543
- progress: "bg-[var(--ui-bg-inverted)]"
2544
- }
2545
- },
2546
- multiline: {
2547
- true: {
2548
- root: "items-start",
2549
- actions: "items-start mt-1"
2550
- },
2551
- false: {
2552
- root: "items-center",
2553
- actions: "items-center"
2554
- }
2555
- }
2556
- },
2557
- defaultVariants: {
2558
- color: "primary"
2559
- }
2560
- });
2561
-
2562
- const toaster = {
2563
- slots: {
2564
- viewport: "fixed flex flex-col w-[calc(100%-2rem)] sm:w-96 z-[100] data-[expanded=true]:h-[var(--height)] focus:outline-none",
2565
- base: "absolute inset-x-0 z-[var(--index)] transform-[var(--transform)] data-[expanded=false]:data-[front=false]:h-[var(--front-height)] data-[expanded=false]:data-[front=false]:*:invisible data-[state=closed]:animate-[toast-closed_200ms_ease-in-out] data-[state=closed]:data-[expanded=false]:data-[front=false]:animate-[toast-collapsed-closed_200ms_ease-in-out] data-[swipe=move]:transition-none transition-[transform,translate,height] duration-200 ease-out"
2566
- },
2567
- variants: {
2568
- position: {
2569
- "top-left": {
2570
- viewport: "left-4"
2571
- },
2572
- "top-center": {
2573
- viewport: "left-1/2 transform -translate-x-1/2"
2574
- },
2575
- "top-right": {
2576
- viewport: "right-4"
2577
- },
2578
- "bottom-left": {
2579
- viewport: "left-4"
2580
- },
2581
- "bottom-center": {
2582
- viewport: "left-1/2 transform -translate-x-1/2"
2583
- },
2584
- "bottom-right": {
2585
- viewport: "right-4"
2586
- }
2587
- },
2588
- swipeDirection: {
2589
- up: "data-[swipe=end]:animate-[toast-slide-up_200ms_ease-out]",
2590
- right: "data-[swipe=end]:animate-[toast-slide-right_200ms_ease-out]",
2591
- down: "data-[swipe=end]:animate-[toast-slide-down_200ms_ease-out]",
2592
- left: "data-[swipe=end]:animate-[toast-slide-left_200ms_ease-out]"
2593
- }
2594
- },
2595
- compoundVariants: [{
2596
- position: ["top-left", "top-center", "top-right"],
2597
- class: {
2598
- viewport: "top-4",
2599
- base: "top-0 data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out]"
2600
- }
2601
- }, {
2602
- position: ["bottom-left", "bottom-center", "bottom-right"],
2603
- class: {
2604
- viewport: "bottom-4",
2605
- base: "bottom-0 data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out]"
2606
- }
2607
- }, {
2608
- swipeDirection: ["left", "right"],
2609
- class: "data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=cancel]:translate-x-0"
2610
- }, {
2611
- swipeDirection: ["up", "down"],
2612
- class: "data-[swipe=move]:translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=end]:translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=cancel]:translate-y-0"
2613
- }],
2614
- defaultVariants: {
2615
- position: "bottom-right"
2616
- }
2617
- };
2618
-
2619
- const tooltip = {
2620
- slots: {
2621
- content: "flex items-center gap-1 bg-[var(--ui-bg)] text-[var(--ui-text-highlighted)] shadow rounded-[var(--ui-radius)] ring ring-[var(--ui-border)] h-6 px-2 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in]",
2622
- arrow: "fill-[var(--ui-border)]",
2623
- text: "truncate",
2624
- kbds: `hidden lg:inline-flex items-center shrink-0 gap-0.5 before:content-['\xB7'] before:mr-0.5`,
2625
- kbdsSize: "sm"
2626
- }
2627
- };
2628
-
2629
- const theme = {
2630
- __proto__: null,
2631
- accordion: accordion,
2632
- alert: alert,
2633
- avatar: avatar,
2634
- avatarGroup: avatarGroup,
2635
- badge: badge,
2636
- breadcrumb: breadcrumb,
2637
- button: button,
2638
- buttonGroup: buttonGroup,
2639
- card: card,
2640
- carousel: carousel,
2641
- checkbox: checkbox,
2642
- chip: chip,
2643
- collapsible: collapsible,
2644
- commandPalette: commandPalette,
2645
- container: container,
2646
- contextMenu: contextMenu,
2647
- drawer: drawer,
2648
- dropdownMenu: dropdownMenu,
2649
- form: form,
2650
- formField: formField,
2651
- input: input,
2652
- inputMenu: inputMenu,
2653
- kbd: kbd,
2654
- link: link,
2655
- modal: modal,
2656
- navigationMenu: navigationMenu,
2657
- pagination: pagination,
2658
- popover: popover,
2659
- progress: progress,
2660
- radioGroup: radioGroup,
2661
- select: select,
2662
- selectMenu: selectMenu,
2663
- separator: separator,
2664
- skeleton: skeleton,
2665
- slideover: slideover,
2666
- slider: slider,
2667
- switch: _switch,
2668
- table: table,
2669
- tabs: tabs,
2670
- textarea: textarea,
2671
- toast: toast,
2672
- toaster: toaster,
2673
- tooltip: tooltip
2674
- };
2675
-
2676
- function addTemplates(options, nuxt) {
2677
- for (const component in theme) {
2678
- addTemplate({
2679
- filename: `ui/${kebabCase(component)}.ts`,
2680
- write: true,
2681
- getContents: async () => {
2682
- const template = theme[component];
2683
- const result = typeof template === "function" ? template(options) : template;
2684
- const variants = Object.keys(result.variants || {});
2685
- let json = JSON.stringify(result, null, 2);
2686
- for (const variant of variants) {
2687
- json = json.replace(new RegExp(`("${variant}": "[^"]+")`, "g"), "$1 as const");
2688
- json = json.replace(new RegExp(`("${variant}": \\[\\s*)((?:"[^"]+",?\\s*)+)(\\])`, "g"), (_, before, match, after) => {
2689
- const replaced = match.replace(/("[^"]+")/g, "$1 as const");
2690
- return `${before}${replaced}${after}`;
2691
- });
112
+ try {
113
+ const path = resolve(`./devtools/runtime/examples/${name}.vue`);
114
+ const source = fs.readFileSync(path, "utf-8");
115
+ res.setHeader("Content-Type", "application/json");
116
+ res.end(JSON.stringify({ component: name, source }));
117
+ } catch (error) {
118
+ console.error(`Failed to read component source for ${name}:`, error);
119
+ res.statusCode = 500;
120
+ res.end(JSON.stringify({ error: "Failed to read component source" }));
2692
121
  }
2693
- return `export default ${json}`;
2694
- }
2695
- });
2696
- }
2697
- addTemplate({
2698
- filename: "ui/index.ts",
2699
- write: true,
2700
- getContents: () => Object.keys(theme).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
2701
- });
2702
- addTypeTemplate({
2703
- filename: "types/ui.d.ts",
2704
- getContents: () => `import * as ui from '#build/ui'
2705
- import type { DeepPartial } from '#ui/types/utils'
2706
- import colors from 'tailwindcss/colors'
2707
-
2708
- const icons = ${JSON.stringify(nuxt.options.appConfig.ui.icons)};
2709
-
2710
- type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone'
2711
- type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor>
2712
-
2713
- type AppConfigUI = {
2714
- colors?: {
2715
- ${options.theme?.colors?.map((color) => `${color}?: Color`).join("\n ")}
2716
- neutral?: NeutralColor
2717
- }
2718
- icons?: Partial<typeof icons>
2719
- } & DeepPartial<typeof ui, string>
2720
-
2721
- declare module '@nuxt/schema' {
2722
- interface AppConfigInput {
2723
- ui?: AppConfigUI
2724
- }
2725
- }
2726
-
2727
- export {}
2728
- `
2729
- });
122
+ });
123
+ }
124
+ };
2730
125
  }
2731
126
 
2732
- const icons = {
2733
- chevronDoubleLeft: "i-heroicons-chevron-double-left-20-solid",
2734
- chevronDoubleRight: "i-heroicons-chevron-double-right-20-solid",
2735
- chevronDown: "i-heroicons-chevron-down-20-solid",
2736
- chevronLeft: "i-heroicons-chevron-left-20-solid",
2737
- chevronRight: "i-heroicons-chevron-right-20-solid",
2738
- arrowLeft: "i-heroicons-arrow-left-20-solid",
2739
- arrowRight: "i-heroicons-arrow-right-20-solid",
2740
- check: "i-heroicons-check-20-solid",
2741
- close: "i-heroicons-x-mark-20-solid",
2742
- ellipsis: "i-heroicons-ellipsis-horizontal-20-solid",
2743
- external: "i-heroicons-arrow-up-right-20-solid",
2744
- loading: "i-heroicons-arrow-path-20-solid",
2745
- minus: "i-heroicons-minus-20-solid",
2746
- search: "i-heroicons-magnifying-glass-20-solid"
2747
- };
2748
-
2749
127
  const module = defineNuxtModule({
2750
128
  meta: {
2751
129
  name: "ui",
@@ -2755,33 +133,14 @@ const module = defineNuxtModule({
2755
133
  },
2756
134
  docs: "https://ui3.nuxt.dev/getting-started/installation"
2757
135
  },
2758
- defaults: {
2759
- prefix: "U",
2760
- fonts: true,
2761
- colorMode: true,
2762
- theme: {
2763
- colors: void 0,
2764
- transitions: true
2765
- }
2766
- },
136
+ defaults: defaultOptions,
2767
137
  async setup(options, nuxt) {
2768
138
  const { resolve } = createResolver(import.meta.url);
2769
139
  options.theme = options.theme || {};
2770
- options.theme.colors = options.theme.colors?.length ? [.../* @__PURE__ */ new Set(["primary", ...options.theme.colors])] : ["primary", "secondary", "success", "info", "warning", "error"];
140
+ options.theme.colors = resolveColors(options.theme.colors);
2771
141
  nuxt.options.ui = options;
2772
142
  nuxt.options.alias["#ui"] = resolve("./runtime");
2773
- nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, {
2774
- colors: pick({
2775
- primary: "green",
2776
- secondary: "blue",
2777
- success: "green",
2778
- info: "blue",
2779
- warning: "yellow",
2780
- error: "red",
2781
- neutral: "slate"
2782
- }, [...options.theme?.colors || [], "neutral"]),
2783
- icons
2784
- });
143
+ nuxt.options.appConfig.ui = defu$1(nuxt.options.appConfig.ui || {}, getDefaultUiConfig(options.theme.colors));
2785
144
  nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {};
2786
145
  nuxt.options.app.rootAttrs.class = [nuxt.options.app.rootAttrs.class, "isolate"].filter(Boolean).join(" ");
2787
146
  if (nuxt.options.builder === "@nuxt/vite-builder") {
@@ -2794,7 +153,7 @@ const module = defineNuxtModule({
2794
153
  if (!hasNuxtModule(name)) {
2795
154
  await installModule(name, options2);
2796
155
  } else {
2797
- nuxt.options[name] = defu(nuxt.options[name], options2);
156
+ nuxt.options[name] = defu$1(nuxt.options[name], options2);
2798
157
  }
2799
158
  }
2800
159
  await registerModule("@nuxt/icon", { cssLayer: "components" });
@@ -2813,7 +172,43 @@ const module = defineNuxtModule({
2813
172
  pathPrefix: false
2814
173
  });
2815
174
  addImportsDir(resolve("./runtime/composables"));
2816
- addTemplates(options, nuxt);
175
+ addTemplates(options, nuxt, resolve);
176
+ if (nuxt.options.dev && nuxt.options.devtools.enabled && options.devtools?.enabled) {
177
+ const templates = buildTemplates(options);
178
+ nuxt.options.vite = defu$1(nuxt.options?.vite, { plugins: [devtoolsMetaPlugin({ resolve, templates, options })] });
179
+ {
180
+ nuxt.hook("vite:serverCreated", async (server) => {
181
+ server.middlewares.use("/__nuxt_ui__/devtools", sirv(resolve("../dist/client/devtools"), {
182
+ single: true,
183
+ dev: true
184
+ }));
185
+ });
186
+ }
187
+ nuxt.options.routeRules = defu$1(nuxt.options.routeRules, { "/__nuxt_ui__/**": { ssr: false } });
188
+ extendPages((pages) => {
189
+ if (pages.length) {
190
+ pages.unshift({
191
+ name: "ui-devtools",
192
+ path: "/__nuxt_ui__/components/:slug",
193
+ file: resolve("./devtools/runtime/DevtoolsRenderer.vue"),
194
+ meta: {
195
+ // https://github.com/nuxt/nuxt/pull/29366
196
+ // isolate: true
197
+ layout: false
198
+ }
199
+ });
200
+ }
201
+ });
202
+ addCustomTab({
203
+ name: "nuxt-ui",
204
+ title: "Nuxt UI",
205
+ icon: "/__nuxt_ui__/devtools/favicon.svg",
206
+ view: {
207
+ type: "iframe",
208
+ src: "/__nuxt_ui__/devtools"
209
+ }
210
+ });
211
+ }
2817
212
  }
2818
213
  });
2819
214