@nuxt/ui 2.18.3 → 3.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (383) hide show
  1. package/README.md +18 -1
  2. package/cli/commands/init.mjs +83 -0
  3. package/cli/index.mjs +15 -0
  4. package/cli/package.json +13 -0
  5. package/cli/templates.mjs +171 -0
  6. package/cli/utils.mjs +17 -0
  7. package/dist/module.d.mts +10 -26
  8. package/dist/module.d.ts +10 -26
  9. package/dist/module.json +3 -3
  10. package/dist/module.mjs +2620 -152
  11. package/dist/runtime/assets/css/animations.css +1 -0
  12. package/dist/runtime/components/Accordion.vue +67 -0
  13. package/dist/runtime/components/Accordion.vue.d.ts +492 -0
  14. package/dist/runtime/components/Alert.vue +78 -0
  15. package/dist/runtime/components/Alert.vue.d.ts +548 -0
  16. package/dist/runtime/components/App.vue +32 -0
  17. package/dist/runtime/components/App.vue.d.ts +25 -0
  18. package/dist/runtime/components/Avatar.vue +48 -0
  19. package/dist/runtime/components/Avatar.vue.d.ts +384 -0
  20. package/dist/runtime/components/AvatarGroup.vue +74 -0
  21. package/dist/runtime/components/AvatarGroup.vue.d.ts +381 -0
  22. package/dist/runtime/components/Badge.vue +24 -0
  23. package/dist/runtime/components/Badge.vue.d.ts +422 -0
  24. package/dist/runtime/components/Breadcrumb.vue +60 -0
  25. package/dist/runtime/components/Breadcrumb.vue.d.ts +307 -0
  26. package/dist/runtime/components/Button.vue +55 -0
  27. package/dist/runtime/components/Button.vue.d.ts +949 -0
  28. package/dist/runtime/components/ButtonGroup.vue +29 -0
  29. package/dist/runtime/components/ButtonGroup.vue.d.ts +182 -0
  30. package/dist/runtime/components/Card.vue +33 -0
  31. package/dist/runtime/components/Card.vue.d.ts +191 -0
  32. package/dist/runtime/components/Checkbox.vue +89 -0
  33. package/dist/runtime/components/Checkbox.vue.d.ts +819 -0
  34. package/dist/runtime/components/Chip.vue +43 -0
  35. package/dist/runtime/components/Chip.vue.d.ts +590 -0
  36. package/dist/runtime/components/Collapsible.vue +33 -0
  37. package/dist/runtime/components/Collapsible.vue.d.ts +159 -0
  38. package/dist/runtime/components/CommandPalette.vue +210 -0
  39. package/dist/runtime/components/CommandPalette.vue.d.ts +684 -0
  40. package/dist/runtime/components/Container.vue +20 -0
  41. package/dist/runtime/components/Container.vue.d.ts +27 -0
  42. package/dist/runtime/components/ContextMenu.vue +51 -0
  43. package/dist/runtime/components/ContextMenu.vue.d.ts +796 -0
  44. package/dist/runtime/components/ContextMenuContent.vue +108 -0
  45. package/dist/runtime/components/ContextMenuContent.vue.d.ts +0 -0
  46. package/dist/runtime/components/Drawer.vue +73 -0
  47. package/dist/runtime/components/Drawer.vue.d.ts +343 -0
  48. package/dist/runtime/components/DropdownMenu.vue +55 -0
  49. package/dist/runtime/components/DropdownMenu.vue.d.ts +815 -0
  50. package/dist/runtime/components/DropdownMenuContent.vue +111 -0
  51. package/dist/runtime/components/DropdownMenuContent.vue.d.ts +0 -0
  52. package/dist/runtime/components/Form.vue +206 -0
  53. package/dist/runtime/components/Form.vue.d.ts +39 -0
  54. package/dist/runtime/components/FormField.vue +82 -0
  55. package/dist/runtime/components/FormField.vue.d.ts +356 -0
  56. package/dist/runtime/components/Icon.vue +16 -0
  57. package/dist/runtime/components/Icon.vue.d.ts +17 -0
  58. package/dist/runtime/components/Input.vue +140 -0
  59. package/dist/runtime/components/Input.vue.d.ts +1137 -0
  60. package/dist/runtime/components/InputMenu.vue +264 -0
  61. package/dist/runtime/components/InputMenu.vue.d.ts +2121 -0
  62. package/dist/runtime/components/Kbd.vue +27 -0
  63. package/dist/runtime/components/Kbd.vue.d.ts +169 -0
  64. package/dist/runtime/components/Link.vue +83 -0
  65. package/dist/runtime/components/Link.vue.d.ts +76 -0
  66. package/dist/runtime/components/LinkBase.vue +50 -0
  67. package/dist/runtime/components/LinkBase.vue.d.ts +49 -0
  68. package/dist/runtime/components/Modal.vue +100 -0
  69. package/dist/runtime/components/Modal.vue.d.ts +319 -0
  70. package/dist/runtime/components/ModalProvider.vue +12 -0
  71. package/dist/runtime/components/NavigationMenu.vue +125 -0
  72. package/dist/runtime/components/NavigationMenu.vue.d.ts +1789 -0
  73. package/dist/runtime/components/Pagination.vue +80 -0
  74. package/dist/runtime/components/Pagination.vue.d.ts +295 -0
  75. package/dist/runtime/components/Popover.vue +52 -0
  76. package/dist/runtime/components/Popover.vue.d.ts +197 -0
  77. package/dist/runtime/components/Progress.vue +126 -0
  78. package/dist/runtime/components/Progress.vue.d.ts +1781 -0
  79. package/dist/runtime/components/RadioGroup.vue +111 -0
  80. package/dist/runtime/components/RadioGroup.vue.d.ts +1715 -0
  81. package/dist/runtime/components/Select.vue +148 -0
  82. package/dist/runtime/components/Select.vue.d.ts +1569 -0
  83. package/dist/runtime/components/SelectMenu.vue +208 -0
  84. package/dist/runtime/components/SelectMenu.vue.d.ts +1661 -0
  85. package/dist/runtime/components/Separator.vue +47 -0
  86. package/dist/runtime/components/Separator.vue.d.ts +0 -0
  87. package/dist/runtime/components/Skeleton.vue +19 -0
  88. package/dist/runtime/components/Skeleton.vue.d.ts +26 -0
  89. package/dist/runtime/components/Slideover.vue +101 -0
  90. package/dist/runtime/components/Slideover.vue.d.ts +375 -0
  91. package/dist/runtime/components/SlideoverProvider.vue +12 -0
  92. package/dist/runtime/components/Slider.vue +83 -0
  93. package/dist/runtime/components/Slider.vue.d.ts +0 -0
  94. package/dist/runtime/components/Switch.vue +80 -0
  95. package/dist/runtime/components/Switch.vue.d.ts +1676 -0
  96. package/dist/runtime/components/Tabs.vue +61 -0
  97. package/dist/runtime/components/Tabs.vue.d.ts +934 -0
  98. package/dist/runtime/components/Textarea.vue +149 -0
  99. package/dist/runtime/components/Textarea.vue.d.ts +1133 -0
  100. package/dist/runtime/components/Toast.vue +112 -0
  101. package/dist/runtime/components/Toast.vue.d.ts +0 -0
  102. package/dist/runtime/components/Toaster.vue +109 -0
  103. package/dist/runtime/components/Toaster.vue.d.ts +362 -0
  104. package/dist/runtime/components/Tooltip.vue +52 -0
  105. package/dist/runtime/components/Tooltip.vue.d.ts +248 -0
  106. package/dist/runtime/composables/defineShortcuts.d.ts +7 -5
  107. package/dist/runtime/composables/defineShortcuts.js +94 -65
  108. package/dist/runtime/composables/useAvatarGroup.d.ts +10 -0
  109. package/dist/runtime/composables/useAvatarGroup.js +10 -0
  110. package/dist/runtime/composables/useButtonGroup.d.ts +12 -17
  111. package/dist/runtime/composables/useButtonGroup.js +6 -56
  112. package/dist/runtime/composables/useComponentIcons.d.ts +26 -0
  113. package/dist/runtime/composables/useComponentIcons.js +26 -0
  114. package/dist/runtime/composables/useFormField.d.ts +31 -0
  115. package/dist/runtime/composables/useFormField.js +50 -0
  116. package/dist/runtime/composables/useKbd.d.ts +28 -0
  117. package/dist/runtime/composables/useKbd.js +46 -0
  118. package/dist/runtime/composables/useModal.d.ts +8 -4
  119. package/dist/runtime/composables/useModal.js +1 -0
  120. package/dist/runtime/composables/useSlideover.d.ts +9 -5
  121. package/dist/runtime/composables/useSlideover.js +3 -2
  122. package/dist/runtime/composables/useToast.d.ts +9 -17
  123. package/dist/runtime/composables/useToast.js +27 -13
  124. package/dist/runtime/plugins/colors.d.ts +0 -2
  125. package/dist/runtime/plugins/colors.js +9 -17
  126. package/dist/runtime/plugins/modal.d.ts +0 -0
  127. package/dist/runtime/plugins/slideover.d.ts +0 -0
  128. package/dist/runtime/plugins/{slideovers.js → slideover.js} +3 -3
  129. package/dist/runtime/types/app.config.d.ts +6 -0
  130. package/dist/runtime/types/component.d.ts +17 -14
  131. package/dist/runtime/types/component.js +0 -0
  132. package/dist/runtime/types/form.d.ts +63 -32
  133. package/dist/runtime/types/form.js +12 -0
  134. package/dist/runtime/types/index.d.ts +41 -30
  135. package/dist/runtime/types/index.js +42 -31
  136. package/dist/runtime/types/utils.d.ts +13 -32
  137. package/dist/runtime/types/utils.js +0 -0
  138. package/dist/runtime/utils/form.d.ts +15 -0
  139. package/dist/runtime/utils/form.js +66 -0
  140. package/dist/runtime/utils/fuse.d.ts +4 -0
  141. package/dist/runtime/utils/fuse.js +63 -0
  142. package/dist/runtime/utils/index.d.ts +4 -10
  143. package/dist/runtime/utils/index.js +40 -60
  144. package/dist/runtime/utils/link.d.ts +58 -71
  145. package/dist/runtime/utils/link.js +4 -124
  146. package/package.json +47 -45
  147. package/dist/runtime/components/data/Table.vue +0 -355
  148. package/dist/runtime/components/data/Table.vue.d.ts +0 -439
  149. package/dist/runtime/components/elements/Accordion.vue +0 -185
  150. package/dist/runtime/components/elements/Accordion.vue.d.ts +0 -224
  151. package/dist/runtime/components/elements/Alert.vue +0 -139
  152. package/dist/runtime/components/elements/Alert.vue.d.ts +0 -194
  153. package/dist/runtime/components/elements/Avatar.vue +0 -160
  154. package/dist/runtime/components/elements/Avatar.vue.d.ts +0 -255
  155. package/dist/runtime/components/elements/AvatarGroup.d.ts +0 -56
  156. package/dist/runtime/components/elements/AvatarGroup.js +0 -58
  157. package/dist/runtime/components/elements/Badge.vue +0 -75
  158. package/dist/runtime/components/elements/Badge.vue.d.ts +0 -109
  159. package/dist/runtime/components/elements/Button.vue +0 -193
  160. package/dist/runtime/components/elements/Button.vue.d.ts +0 -504
  161. package/dist/runtime/components/elements/ButtonGroup.d.ts +0 -153
  162. package/dist/runtime/components/elements/ButtonGroup.js +0 -51
  163. package/dist/runtime/components/elements/Carousel.vue +0 -165
  164. package/dist/runtime/components/elements/Carousel.vue.d.ts +0 -159
  165. package/dist/runtime/components/elements/Chip.vue +0 -85
  166. package/dist/runtime/components/elements/Chip.vue.d.ts +0 -162
  167. package/dist/runtime/components/elements/Dropdown.vue +0 -254
  168. package/dist/runtime/components/elements/Dropdown.vue.d.ts +0 -254
  169. package/dist/runtime/components/elements/Icon.vue +0 -30
  170. package/dist/runtime/components/elements/Icon.vue.d.ts +0 -47
  171. package/dist/runtime/components/elements/Kbd.vue +0 -59
  172. package/dist/runtime/components/elements/Kbd.vue.d.ts +0 -86
  173. package/dist/runtime/components/elements/Link.vue +0 -95
  174. package/dist/runtime/components/elements/Link.vue.d.ts +0 -225
  175. package/dist/runtime/components/elements/Meter.vue +0 -170
  176. package/dist/runtime/components/elements/Meter.vue.d.ts +0 -279
  177. package/dist/runtime/components/elements/MeterGroup.d.ts +0 -135
  178. package/dist/runtime/components/elements/MeterGroup.js +0 -159
  179. package/dist/runtime/components/elements/Progress.vue +0 -203
  180. package/dist/runtime/components/elements/Progress.vue.d.ts +0 -280
  181. package/dist/runtime/components/forms/Checkbox.vue +0 -143
  182. package/dist/runtime/components/forms/Checkbox.vue.d.ts +0 -179
  183. package/dist/runtime/components/forms/Form.vue +0 -222
  184. package/dist/runtime/components/forms/Form.vue.d.ts +0 -53
  185. package/dist/runtime/components/forms/FormGroup.vue +0 -128
  186. package/dist/runtime/components/forms/FormGroup.vue.d.ts +0 -169
  187. package/dist/runtime/components/forms/Input.vue +0 -300
  188. package/dist/runtime/components/forms/Input.vue.d.ts +0 -482
  189. package/dist/runtime/components/forms/InputMenu.vue +0 -439
  190. package/dist/runtime/components/forms/InputMenu.vue.d.ts +0 -700
  191. package/dist/runtime/components/forms/Radio.vue +0 -140
  192. package/dist/runtime/components/forms/Radio.vue.d.ts +0 -168
  193. package/dist/runtime/components/forms/RadioGroup.vue +0 -145
  194. package/dist/runtime/components/forms/RadioGroup.vue.d.ts +0 -176
  195. package/dist/runtime/components/forms/Range.vue +0 -173
  196. package/dist/runtime/components/forms/Range.vue.d.ts +0 -268
  197. package/dist/runtime/components/forms/Select.vue +0 -322
  198. package/dist/runtime/components/forms/Select.vue.d.ts +0 -471
  199. package/dist/runtime/components/forms/SelectMenu.vue +0 -546
  200. package/dist/runtime/components/forms/SelectMenu.vue.d.ts +0 -754
  201. package/dist/runtime/components/forms/Textarea.vue +0 -231
  202. package/dist/runtime/components/forms/Textarea.vue.d.ts +0 -436
  203. package/dist/runtime/components/forms/Toggle.vue +0 -171
  204. package/dist/runtime/components/forms/Toggle.vue.d.ts +0 -262
  205. package/dist/runtime/components/layout/Card.vue +0 -63
  206. package/dist/runtime/components/layout/Card.vue.d.ts +0 -89
  207. package/dist/runtime/components/layout/Container.vue +0 -48
  208. package/dist/runtime/components/layout/Container.vue.d.ts +0 -53
  209. package/dist/runtime/components/layout/Divider.vue +0 -108
  210. package/dist/runtime/components/layout/Divider.vue.d.ts +0 -198
  211. package/dist/runtime/components/layout/Skeleton.vue +0 -46
  212. package/dist/runtime/components/layout/Skeleton.vue.d.ts +0 -53
  213. package/dist/runtime/components/navigation/Breadcrumb.vue +0 -82
  214. package/dist/runtime/components/navigation/Breadcrumb.vue.d.ts +0 -95
  215. package/dist/runtime/components/navigation/CommandPalette.vue +0 -345
  216. package/dist/runtime/components/navigation/CommandPalette.vue.d.ts +0 -390
  217. package/dist/runtime/components/navigation/CommandPaletteGroup.vue +0 -152
  218. package/dist/runtime/components/navigation/CommandPaletteGroup.vue.d.ts +0 -60
  219. package/dist/runtime/components/navigation/HorizontalNavigation.vue +0 -102
  220. package/dist/runtime/components/navigation/HorizontalNavigation.vue.d.ts +0 -99
  221. package/dist/runtime/components/navigation/Pagination.vue +0 -270
  222. package/dist/runtime/components/navigation/Pagination.vue.d.ts +0 -260
  223. package/dist/runtime/components/navigation/Tabs.vue +0 -160
  224. package/dist/runtime/components/navigation/Tabs.vue.d.ts +0 -165
  225. package/dist/runtime/components/navigation/VerticalNavigation.vue +0 -105
  226. package/dist/runtime/components/navigation/VerticalNavigation.vue.d.ts +0 -113
  227. package/dist/runtime/components/overlays/ContextMenu.vue +0 -85
  228. package/dist/runtime/components/overlays/ContextMenu.vue.d.ts +0 -126
  229. package/dist/runtime/components/overlays/Modal.vue +0 -122
  230. package/dist/runtime/components/overlays/Modal.vue.d.ts +0 -166
  231. package/dist/runtime/components/overlays/Modals.client.vue +0 -18
  232. package/dist/runtime/components/overlays/Notification.vue +0 -212
  233. package/dist/runtime/components/overlays/Notification.vue.d.ts +0 -235
  234. package/dist/runtime/components/overlays/Notifications.vue +0 -69
  235. package/dist/runtime/components/overlays/Notifications.vue.d.ts +0 -66
  236. package/dist/runtime/components/overlays/Popover.vue +0 -213
  237. package/dist/runtime/components/overlays/Popover.vue.d.ts +0 -220
  238. package/dist/runtime/components/overlays/Slideover.vue +0 -152
  239. package/dist/runtime/components/overlays/Slideover.vue.d.ts +0 -167
  240. package/dist/runtime/components/overlays/Slideovers.client.vue +0 -18
  241. package/dist/runtime/components/overlays/Tooltip.vue +0 -127
  242. package/dist/runtime/components/overlays/Tooltip.vue.d.ts +0 -165
  243. package/dist/runtime/composables/useCarouselScroll.d.ts +0 -2
  244. package/dist/runtime/composables/useCarouselScroll.js +0 -37
  245. package/dist/runtime/composables/useCopyToClipboard.d.ts +0 -10
  246. package/dist/runtime/composables/useCopyToClipboard.js +0 -26
  247. package/dist/runtime/composables/useFormGroup.d.ts +0 -18
  248. package/dist/runtime/composables/useFormGroup.js +0 -49
  249. package/dist/runtime/composables/usePopper.d.ts +0 -268
  250. package/dist/runtime/composables/usePopper.js +0 -94
  251. package/dist/runtime/composables/useShortcuts.d.ts +0 -12
  252. package/dist/runtime/composables/useShortcuts.js +0 -26
  253. package/dist/runtime/composables/useTimer.d.ts +0 -8
  254. package/dist/runtime/composables/useTimer.js +0 -51
  255. package/dist/runtime/composables/useUI.d.ts +0 -10
  256. package/dist/runtime/composables/useUI.js +0 -24
  257. package/dist/runtime/plugins/modals.d.ts +0 -2
  258. package/dist/runtime/plugins/slideovers.d.ts +0 -2
  259. package/dist/runtime/types/accordion.d.ts +0 -9
  260. package/dist/runtime/types/alert.d.ts +0 -12
  261. package/dist/runtime/types/avatar.d.ts +0 -17
  262. package/dist/runtime/types/badge.d.ts +0 -15
  263. package/dist/runtime/types/breadcrumb.d.ts +0 -10
  264. package/dist/runtime/types/button.d.ts +0 -31
  265. package/dist/runtime/types/chip.d.ts +0 -15
  266. package/dist/runtime/types/clipboard.d.ts +0 -3
  267. package/dist/runtime/types/command-palette.d.ts +0 -29
  268. package/dist/runtime/types/divider.d.ts +0 -3
  269. package/dist/runtime/types/dropdown.d.ts +0 -15
  270. package/dist/runtime/types/form-group.d.ts +0 -5
  271. package/dist/runtime/types/horizontal-navigation.d.ts +0 -13
  272. package/dist/runtime/types/input.d.ts +0 -8
  273. package/dist/runtime/types/kbd.d.ts +0 -5
  274. package/dist/runtime/types/link.d.ts +0 -12
  275. package/dist/runtime/types/meter.d.ts +0 -5
  276. package/dist/runtime/types/modal.d.ts +0 -18
  277. package/dist/runtime/types/notification.d.ts +0 -24
  278. package/dist/runtime/types/popper.d.ts +0 -17
  279. package/dist/runtime/types/progress.d.ts +0 -6
  280. package/dist/runtime/types/range.d.ts +0 -7
  281. package/dist/runtime/types/select.d.ts +0 -8
  282. package/dist/runtime/types/slideover.d.ts +0 -16
  283. package/dist/runtime/types/tabs.d.ts +0 -8
  284. package/dist/runtime/types/textarea.d.ts +0 -8
  285. package/dist/runtime/types/toggle.d.ts +0 -7
  286. package/dist/runtime/types/tooltip.d.ts +0 -7
  287. package/dist/runtime/types/vertical-navigation.d.ts +0 -13
  288. package/dist/runtime/ui.config/data/table.d.ts +0 -81
  289. package/dist/runtime/ui.config/data/table.js +0 -80
  290. package/dist/runtime/ui.config/elements/accordion.d.ts +0 -23
  291. package/dist/runtime/ui.config/elements/accordion.js +0 -22
  292. package/dist/runtime/ui.config/elements/alert.d.ts +0 -41
  293. package/dist/runtime/ui.config/elements/alert.js +0 -40
  294. package/dist/runtime/ui.config/elements/avatar.d.ts +0 -60
  295. package/dist/runtime/ui.config/elements/avatar.js +0 -59
  296. package/dist/runtime/ui.config/elements/avatarGroup.d.ts +0 -6
  297. package/dist/runtime/ui.config/elements/avatarGroup.js +0 -5
  298. package/dist/runtime/ui.config/elements/badge.d.ts +0 -34
  299. package/dist/runtime/ui.config/elements/badge.js +0 -33
  300. package/dist/runtime/ui.config/elements/button.d.ts +0 -81
  301. package/dist/runtime/ui.config/elements/button.js +0 -80
  302. package/dist/runtime/ui.config/elements/buttonGroup.d.ts +0 -101
  303. package/dist/runtime/ui.config/elements/buttonGroup.js +0 -19
  304. package/dist/runtime/ui.config/elements/carousel.d.ts +0 -27
  305. package/dist/runtime/ui.config/elements/carousel.js +0 -26
  306. package/dist/runtime/ui.config/elements/chip.d.ts +0 -35
  307. package/dist/runtime/ui.config/elements/chip.js +0 -34
  308. package/dist/runtime/ui.config/elements/dropdown.d.ts +0 -59
  309. package/dist/runtime/ui.config/elements/dropdown.js +0 -57
  310. package/dist/runtime/ui.config/elements/kbd.d.ts +0 -17
  311. package/dist/runtime/ui.config/elements/kbd.js +0 -16
  312. package/dist/runtime/ui.config/elements/meter.d.ts +0 -77
  313. package/dist/runtime/ui.config/elements/meter.js +0 -76
  314. package/dist/runtime/ui.config/elements/meterGroup.d.ts +0 -52
  315. package/dist/runtime/ui.config/elements/meterGroup.js +0 -24
  316. package/dist/runtime/ui.config/elements/progress.d.ts +0 -75
  317. package/dist/runtime/ui.config/elements/progress.js +0 -74
  318. package/dist/runtime/ui.config/forms/checkbox.d.ts +0 -19
  319. package/dist/runtime/ui.config/forms/checkbox.js +0 -18
  320. package/dist/runtime/ui.config/forms/formGroup.d.ts +0 -26
  321. package/dist/runtime/ui.config/forms/formGroup.js +0 -26
  322. package/dist/runtime/ui.config/forms/input.d.ts +0 -110
  323. package/dist/runtime/ui.config/forms/input.js +0 -109
  324. package/dist/runtime/ui.config/forms/inputMenu.d.ts +0 -64
  325. package/dist/runtime/ui.config/forms/inputMenu.js +0 -62
  326. package/dist/runtime/ui.config/forms/radio.d.ts +0 -18
  327. package/dist/runtime/ui.config/forms/radio.js +0 -17
  328. package/dist/runtime/ui.config/forms/radioGroup.d.ts +0 -9
  329. package/dist/runtime/ui.config/forms/radioGroup.js +0 -8
  330. package/dist/runtime/ui.config/forms/range.d.ts +0 -64
  331. package/dist/runtime/ui.config/forms/range.js +0 -63
  332. package/dist/runtime/ui.config/forms/select.d.ts +0 -111
  333. package/dist/runtime/ui.config/forms/select.js +0 -13
  334. package/dist/runtime/ui.config/forms/selectMenu.d.ts +0 -70
  335. package/dist/runtime/ui.config/forms/selectMenu.js +0 -32
  336. package/dist/runtime/ui.config/forms/textarea.d.ts +0 -109
  337. package/dist/runtime/ui.config/forms/textarea.js +0 -10
  338. package/dist/runtime/ui.config/forms/toggle.d.ts +0 -63
  339. package/dist/runtime/ui.config/forms/toggle.js +0 -62
  340. package/dist/runtime/ui.config/index.d.ts +0 -43
  341. package/dist/runtime/ui.config/index.js +0 -43
  342. package/dist/runtime/ui.config/layout/card.d.ts +0 -24
  343. package/dist/runtime/ui.config/layout/card.js +0 -23
  344. package/dist/runtime/ui.config/layout/container.d.ts +0 -6
  345. package/dist/runtime/ui.config/layout/container.js +0 -5
  346. package/dist/runtime/ui.config/layout/divider.d.ts +0 -52
  347. package/dist/runtime/ui.config/layout/divider.js +0 -51
  348. package/dist/runtime/ui.config/layout/skeleton.d.ts +0 -6
  349. package/dist/runtime/ui.config/layout/skeleton.js +0 -5
  350. package/dist/runtime/ui.config/navigation/breadcrumb.d.ts +0 -21
  351. package/dist/runtime/ui.config/navigation/breadcrumb.js +0 -20
  352. package/dist/runtime/ui.config/navigation/commandPalette.d.ts +0 -72
  353. package/dist/runtime/ui.config/navigation/commandPalette.js +0 -71
  354. package/dist/runtime/ui.config/navigation/horizontalNavigation.d.ts +0 -27
  355. package/dist/runtime/ui.config/navigation/horizontalNavigation.js +0 -26
  356. package/dist/runtime/ui.config/navigation/pagination.d.ts +0 -35
  357. package/dist/runtime/ui.config/navigation/pagination.js +0 -34
  358. package/dist/runtime/ui.config/navigation/tabs.d.ts +0 -35
  359. package/dist/runtime/ui.config/navigation/tabs.js +0 -34
  360. package/dist/runtime/ui.config/navigation/verticalNavigation.d.ts +0 -34
  361. package/dist/runtime/ui.config/navigation/verticalNavigation.js +0 -33
  362. package/dist/runtime/ui.config/overlays/contextMenu.d.ts +0 -31
  363. package/dist/runtime/ui.config/overlays/contextMenu.js +0 -25
  364. package/dist/runtime/ui.config/overlays/modal.d.ts +0 -36
  365. package/dist/runtime/ui.config/overlays/modal.js +0 -37
  366. package/dist/runtime/ui.config/overlays/notification.d.ts +0 -50
  367. package/dist/runtime/ui.config/overlays/notification.js +0 -50
  368. package/dist/runtime/ui.config/overlays/notifications.d.ts +0 -7
  369. package/dist/runtime/ui.config/overlays/notifications.js +0 -6
  370. package/dist/runtime/ui.config/overlays/popover.d.ts +0 -47
  371. package/dist/runtime/ui.config/overlays/popover.js +0 -41
  372. package/dist/runtime/ui.config/overlays/slideover.d.ts +0 -35
  373. package/dist/runtime/ui.config/overlays/slideover.js +0 -36
  374. package/dist/runtime/ui.config/overlays/tooltip.d.ts +0 -37
  375. package/dist/runtime/ui.config/overlays/tooltip.js +0 -34
  376. package/dist/runtime/ui.config/popper.d.ts +0 -8
  377. package/dist/runtime/ui.config/popper.js +0 -9
  378. package/dist/runtime/ui.css +0 -1
  379. package/dist/runtime/utils/colors.d.ts +0 -11
  380. package/dist/runtime/utils/colors.js +0 -299
  381. package/dist/runtime/utils/lodash.d.ts +0 -2
  382. package/dist/runtime/utils/lodash.js +0 -23
  383. package/dist/runtime/plugins/{modals.js → modal.js} +1 -1
package/dist/module.mjs CHANGED
@@ -1,114 +1,2602 @@
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.3";
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
- });
1
+ import { defuFn, defu } from 'defu';
2
+ import { addTemplate, hasNuxtModule, addTypeTemplate, defineNuxtModule, createResolver, addVitePlugin, installModule, addPlugin, addComponentsDir, addImportsDir } from '@nuxt/kit';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { kebabCase } from 'scule';
5
+
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", options.transitions && "transition-colors before:transition-colors"],
1313
+ linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover: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", options.transitions && "transition-colors"],
1351
+ linkLeadingIcon: ["group-hover:text-gray-700 dark:group-hover: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"
1808
+ },
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"
2385
+ }
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
+ const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
2475
+ if (!nuxt.options.css.find((path) => path.endsWith("tailwind.css"))) {
2476
+ const template = addTemplate({
2477
+ filename: "tailwind.css",
2478
+ write: true,
2479
+ getContents: () => `@import "tailwindcss";
2480
+ @import "./ui.css";
2481
+ ${hasNuxtModule("@nuxt/content") ? '@source "../content/**/*.md";' : ""}
2482
+ `
2483
+ });
2484
+ nuxt.options.css.unshift(template.dst);
2485
+ }
2486
+ addTemplate({
2487
+ filename: "ui.css",
2488
+ write: true,
2489
+ getContents: () => `@layer base {
2490
+ :root {
2491
+ color-scheme: light dark;
2492
+ }
34
2493
  }
35
2494
 
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
- };
2495
+ @theme {
2496
+ --color-gray-*: initial;
2497
+ --color-cool-50: #f9fafb;
2498
+ --color-cool-100: #f3f4f6;
2499
+ --color-cool-200: #e5e7eb;
2500
+ --color-cool-300: #d1d5db;
2501
+ --color-cool-400: #9ca3af;
2502
+ --color-cool-500: #6b7280;
2503
+ --color-cool-600: #4b5563;
2504
+ --color-cool-700: #374151;
2505
+ --color-cool-800: #1f2937;
2506
+ --color-cool-900: #111827;
2507
+ --color-cool-950: #030712;
2508
+
2509
+ --spacing-4_5: 1.125rem;
2510
+
2511
+ ${shades.map((shade) => `--color-primary-${shade}: var(--color-primary-${shade});`).join("\n ")}
2512
+ ${shades.map((shade) => `--color-error-${shade}: var(--color-error-${shade});`).join("\n ")}
2513
+ ${shades.map((shade) => `--color-gray-${shade}: var(--color-gray-${shade});`).join("\n ")}
2514
+ }
2515
+ `
49
2516
  });
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
- }
85
- },
86
- safelist: generateSafelist(${JSON.stringify(moduleOptions.safelistColors || [])}, ${JSON.stringify(nuxt2.options.appConfig.ui.colors)}),
2517
+ for (const component in theme) {
2518
+ addTemplate({
2519
+ filename: `ui/${kebabCase(component)}.ts`,
2520
+ write: true,
2521
+ getContents: async () => {
2522
+ const template = theme[component];
2523
+ const result = typeof template === "function" ? template(options) : template;
2524
+ const variants = Object.keys(result.variants || {});
2525
+ let json = JSON.stringify(result, null, 2);
2526
+ for (const variant of variants) {
2527
+ json = json.replace(new RegExp(`("${variant}": "[^"]+")`, "g"), "$1 as const");
2528
+ json = json.replace(new RegExp(`("${variant}": \\[\\s*)((?:"[^"]+",?\\s*)+)(\\])`, "g"), (_, before, match, after) => {
2529
+ const replaced = match.replace(/("[^"]+")/g, "$1 as const");
2530
+ return `${before}${replaced}${after}`;
2531
+ });
2532
+ }
2533
+ if (process.env.DEV) {
2534
+ return [
2535
+ `import template from ${JSON.stringify(fileURLToPath(new URL(`./theme/${kebabCase(component)}`, import.meta.url)))}`,
2536
+ `const result = typeof template === 'function' ? template(${JSON.stringify(options)}) : template`,
2537
+ `const json = ${json}`,
2538
+ `export default result as typeof json`
2539
+ ].join("\n");
2540
+ }
2541
+ return `export default ${json}`;
87
2542
  }
88
- `
2543
+ });
2544
+ }
2545
+ addTemplate({
2546
+ filename: "ui/index.ts",
2547
+ write: true,
2548
+ getContents: () => Object.keys(theme).map((component) => `export { default as ${component} } from './${kebabCase(component)}'`).join("\n")
2549
+ });
2550
+ addTypeTemplate({
2551
+ filename: "types/ui.d.ts",
2552
+ getContents: () => `import * as ui from '#build/ui'
2553
+ import type { DeepPartial } from '#ui/types/utils'
2554
+
2555
+ const colors = ${JSON.stringify(options.colors)} as const;
2556
+ const icons = ${JSON.stringify(nuxt.options.appConfig.ui.icons)};
2557
+
2558
+ type AppConfigUI = {
2559
+ colors?: {
2560
+ primary?: Exclude<typeof colors[number], 'error'>
2561
+ error?: Exclude<typeof colors[number], 'primary'>
2562
+ gray?: 'slate' | 'cool' | 'zinc' | 'neutral' | 'stone'
2563
+ }
2564
+ icons?: Partial<typeof icons>
2565
+ } & DeepPartial<typeof ui, string>
2566
+
2567
+ declare module 'nuxt/schema' {
2568
+ interface AppConfigInput {
2569
+ ui?: AppConfigUI
2570
+ }
2571
+ }
2572
+ declare module '@nuxt/schema' {
2573
+ interface AppConfigInput {
2574
+ ui?: AppConfigUI
2575
+ }
2576
+ }
2577
+ export {}
2578
+ `
89
2579
  });
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
2580
  }
100
2581
 
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;
2582
+ const icons = {
2583
+ chevronDoubleLeft: "i-heroicons-chevron-double-left-20-solid",
2584
+ chevronDoubleRight: "i-heroicons-chevron-double-right-20-solid",
2585
+ chevronDown: "i-heroicons-chevron-down-20-solid",
2586
+ chevronLeft: "i-heroicons-chevron-left-20-solid",
2587
+ chevronRight: "i-heroicons-chevron-right-20-solid",
2588
+ check: "i-heroicons-check-20-solid",
2589
+ close: "i-heroicons-x-mark-20-solid",
2590
+ ellipsis: "i-heroicons-ellipsis-horizontal-20-solid",
2591
+ external: "i-heroicons-arrow-up-right-20-solid",
2592
+ loading: "i-heroicons-arrow-path-20-solid",
2593
+ minus: "i-heroicons-minus-20-solid",
2594
+ search: "i-heroicons-magnifying-glass-20-solid"
2595
+ };
2596
+
108
2597
  const module = defineNuxtModule({
109
2598
  meta: {
110
- name,
111
- version,
2599
+ name: "ui",
112
2600
  configKey: "ui",
113
2601
  compatibility: {
114
2602
  nuxt: ">=3.10.0"
@@ -116,68 +2604,48 @@ const module = defineNuxtModule({
116
2604
  },
117
2605
  defaults: {
118
2606
  prefix: "U",
119
- safelistColors: ["primary"],
120
- disableGlobalStyles: false
2607
+ colors: void 0,
2608
+ transitions: true
121
2609
  },
122
2610
  async setup(options, nuxt) {
123
2611
  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")
2612
+ 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"];
2613
+ nuxt.options.ui = options;
2614
+ nuxt.options.alias["#ui"] = resolve("./runtime");
2615
+ nuxt.options.appConfig.ui = defu(nuxt.options.appConfig.ui || {}, {
2616
+ colors: {
2617
+ primary: "green",
2618
+ error: "red",
2619
+ gray: "cool"
2620
+ },
2621
+ icons
137
2622
  });
2623
+ nuxt.options.app.rootAttrs = nuxt.options.app.rootAttrs || {};
2624
+ nuxt.options.app.rootAttrs.class = [nuxt.options.app.rootAttrs.class, "isolate"].filter(Boolean).join(" ");
2625
+ nuxt.options.css.push(resolve("./runtime/assets/css/animations.css"));
2626
+ if (nuxt.options.builder === "@nuxt/vite-builder") {
2627
+ const plugin = await import('@tailwindcss/vite').then((r) => r.default);
2628
+ addVitePlugin(plugin());
2629
+ } else {
2630
+ nuxt.options.postcss.plugins["@tailwindcss/postcss"] = {};
2631
+ }
2632
+ await installModule("@nuxt/icon", { cssLayer: "components" });
138
2633
  addPlugin({
139
- src: resolve(runtimeDir, "plugins", "modals")
2634
+ src: resolve("./runtime/plugins/colors")
140
2635
  });
141
2636
  addPlugin({
142
- src: resolve(runtimeDir, "plugins", "slideovers")
2637
+ src: resolve("./runtime/plugins/modal")
143
2638
  });
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
2639
+ addPlugin({
2640
+ src: resolve("./runtime/plugins/slideover")
173
2641
  });
174
2642
  addComponentsDir({
175
- path: resolve(runtimeDir, "components", "overlays"),
2643
+ path: resolve("./runtime/components"),
176
2644
  prefix: options.prefix,
177
- global: options.global,
178
- watch: false
2645
+ pathPrefix: false
179
2646
  });
180
- addImportsDir(resolve(runtimeDir, "composables"));
2647
+ addImportsDir(resolve("./runtime/composables"));
2648
+ addTemplates(options, nuxt);
181
2649
  }
182
2650
  });
183
2651