@nuxt/ui 2.18.4 → 3.0.0-alpha.1

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