@nuxt/ui 2.18.4 → 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 -223
  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 -219
  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 -163
  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 -45
  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 -307
  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
@@ -0,0 +1,31 @@
1
+ import { type InjectionKey, type Ref, type ComputedRef } from 'vue';
2
+ import { type UseEventBusReturn } from '@vueuse/core';
3
+ import type { FormFieldProps } from '../types.js';
4
+ import type { FormEvent, FormFieldInjectedOptions, FormInjectedOptions } from '../types/form.js';
5
+ import type { GetObjectField } from '../types/utils.js';
6
+ type Props<T> = {
7
+ id?: string;
8
+ name?: string;
9
+ size?: GetObjectField<T, 'size'>;
10
+ color?: GetObjectField<T, 'color'>;
11
+ eagerValidation?: boolean;
12
+ legend?: string;
13
+ highlight?: boolean;
14
+ disabled?: boolean;
15
+ };
16
+ export declare const formOptionsInjectionKey: InjectionKey<ComputedRef<FormInjectedOptions>>;
17
+ export declare const formBusInjectionKey: InjectionKey<UseEventBusReturn<FormEvent, string>>;
18
+ export declare const formFieldInjectionKey: InjectionKey<ComputedRef<FormFieldInjectedOptions<FormFieldProps>>>;
19
+ export declare const formInputsInjectionKey: InjectionKey<Ref<Record<string, string>>>;
20
+ export declare function useFormField<T>(props?: Props<T>): {
21
+ id: ComputedRef<string | undefined>;
22
+ name: ComputedRef<string | undefined>;
23
+ size: ComputedRef<"md" | "xs" | "sm" | "lg" | "xl" | NonNullable<GetObjectField<T, "size">> | undefined>;
24
+ color: ComputedRef<"error" | GetObjectField<T, "color"> | undefined>;
25
+ highlight: ComputedRef<boolean | undefined>;
26
+ disabled: ComputedRef<boolean | undefined>;
27
+ emitFormBlur: () => void;
28
+ emitFormInput: import("@vueuse/core").PromisifyFn<() => void>;
29
+ emitFormChange: () => void;
30
+ };
31
+ export {};
@@ -0,0 +1,50 @@
1
+ import { inject, ref, computed } from "vue";
2
+ import { useDebounceFn } from "@vueuse/core";
3
+ export const formOptionsInjectionKey = Symbol("nuxt-ui.form-options");
4
+ export const formBusInjectionKey = Symbol("nuxt-ui.form-events");
5
+ export const formFieldInjectionKey = Symbol("nuxt-ui.form-field");
6
+ export const formInputsInjectionKey = Symbol("nuxt-ui.form-inputs");
7
+ export function useFormField(props) {
8
+ const formOptions = inject(formOptionsInjectionKey, void 0);
9
+ const formBus = inject(formBusInjectionKey, void 0);
10
+ const formField = inject(formFieldInjectionKey, void 0);
11
+ const formInputs = inject(formInputsInjectionKey, void 0);
12
+ if (formField) {
13
+ if (props?.id) {
14
+ formField.value.id = props?.id;
15
+ }
16
+ if (formInputs && formField.value.name) {
17
+ formInputs.value[formField.value.name] = formField.value.id;
18
+ }
19
+ }
20
+ const blurred = ref(false);
21
+ function emitFormEvent(type, name) {
22
+ if (formBus && formField && name) {
23
+ formBus.emit({ type, name });
24
+ }
25
+ }
26
+ function emitFormBlur() {
27
+ emitFormEvent("blur", formField?.value.name);
28
+ blurred.value = true;
29
+ }
30
+ function emitFormChange() {
31
+ emitFormEvent("change", formField?.value.name);
32
+ }
33
+ const emitFormInput = useDebounceFn(
34
+ () => {
35
+ emitFormEvent("input", formField?.value.name);
36
+ },
37
+ formField?.value.validateOnInputDelay ?? formOptions?.value.validateOnInputDelay ?? 0
38
+ );
39
+ return {
40
+ id: computed(() => props?.id ?? formField?.value.id),
41
+ name: computed(() => props?.name ?? formField?.value.name),
42
+ size: computed(() => props?.size ?? formField?.value.size),
43
+ color: computed(() => formField?.value.error ? "error" : props?.color),
44
+ highlight: computed(() => formField?.value.error ? true : props?.highlight),
45
+ disabled: computed(() => formOptions?.value.disabled || props?.disabled),
46
+ emitFormBlur,
47
+ emitFormInput,
48
+ emitFormChange
49
+ };
50
+ }
@@ -0,0 +1,28 @@
1
+ export declare const kbdKeysMap: {
2
+ meta: string;
3
+ command: string;
4
+ shift: string;
5
+ ctrl: string;
6
+ option: string;
7
+ alt: string;
8
+ enter: string;
9
+ delete: string;
10
+ backspace: string;
11
+ escape: string;
12
+ tab: string;
13
+ capslock: string;
14
+ arrowup: string;
15
+ arrowright: string;
16
+ arrowdown: string;
17
+ arrowleft: string;
18
+ pageup: string;
19
+ pagedown: string;
20
+ home: string;
21
+ end: string;
22
+ };
23
+ export type KbdKey = keyof typeof kbdKeysMap;
24
+ export declare const useKbd: () => {
25
+ macOS: import("vue").ComputedRef<false | "" | RegExpMatchArray | null | undefined>;
26
+ metaSymbol: import("vue").Ref<string, string>;
27
+ getKbdKey: (value?: KbdKey | string) => string | undefined;
28
+ };
@@ -0,0 +1,46 @@
1
+ import { createSharedComposable } from "@vueuse/core";
2
+ import { ref, computed, onMounted } from "vue";
3
+ export const kbdKeysMap = {
4
+ meta: "",
5
+ command: "\u2318",
6
+ shift: "\u21E7",
7
+ ctrl: "\u2303",
8
+ option: "\u2325",
9
+ alt: "\u2387",
10
+ enter: "\u21B5",
11
+ delete: "\u2326",
12
+ backspace: "\u232B",
13
+ escape: "\u238B",
14
+ tab: "\u21E5",
15
+ capslock: "\u21EA",
16
+ arrowup: "\u2191",
17
+ arrowright: "\u2192",
18
+ arrowdown: "\u2193",
19
+ arrowleft: "\u2190",
20
+ pageup: "\u21DE",
21
+ pagedown: "\u21DF",
22
+ home: "\u2196",
23
+ end: "\u2198"
24
+ };
25
+ const _useKbd = () => {
26
+ const macOS = computed(() => import.meta.client && navigator && navigator.userAgent && navigator.userAgent.match(/Macintosh;/));
27
+ const metaSymbol = ref(" ");
28
+ onMounted(() => {
29
+ metaSymbol.value = macOS.value ? kbdKeysMap.command : kbdKeysMap.ctrl;
30
+ });
31
+ function getKbdKey(value) {
32
+ if (!value) {
33
+ return;
34
+ }
35
+ if (value === "meta") {
36
+ return metaSymbol.value;
37
+ }
38
+ return kbdKeysMap[value] || value.toUpperCase();
39
+ }
40
+ return {
41
+ macOS,
42
+ metaSymbol,
43
+ getKbdKey
44
+ };
45
+ };
46
+ export const useKbd = createSharedComposable(_useKbd);
@@ -1,13 +1,17 @@
1
1
  import type { ShallowRef, Component, InjectionKey } from 'vue';
2
+ import type { ModalProps } from '../types.js';
2
3
  import type { ComponentProps } from '../types/component.js';
3
- import type { Modal, ModalState } from '../types/modal.js';
4
+ export interface ModalState {
5
+ component: Component | string;
6
+ props: ModalProps;
7
+ }
4
8
  export declare const modalInjectionKey: InjectionKey<ShallowRef<ModalState>>;
5
9
  declare function _useModal(): {
6
- open: <T extends Component>(component: T, props?: Modal & ComponentProps<T>) => void;
10
+ open: <T extends Component>(component: T, props?: ModalProps & ComponentProps<T>) => void;
7
11
  close: () => Promise<void>;
8
12
  reset: () => void;
9
- patch: <T extends Component = {}>(props: Partial<Modal & ComponentProps<T>>) => void;
10
- isOpen: import("vue").Ref<boolean>;
13
+ patch: <T extends Component = Record<string, never>>(props: Partial<ModalProps & ComponentProps<T>>) => void;
14
+ isOpen: import("vue").Ref<boolean, boolean>;
11
15
  };
12
16
  export declare const useModal: typeof _useModal;
13
17
  export {};
@@ -19,6 +19,7 @@ function _useModal() {
19
19
  isOpen.value = false;
20
20
  }
21
21
  function reset() {
22
+ if (!modalState) return;
22
23
  modalState.value = {
23
24
  component: "div",
24
25
  props: {}
@@ -1,13 +1,17 @@
1
1
  import type { ShallowRef, Component, InjectionKey } from 'vue';
2
+ import type { SlideoverProps } from '../types.js';
2
3
  import type { ComponentProps } from '../types/component.js';
3
- import type { Slideover, SlideoverState } from '../types/slideover.js';
4
- export declare const slidOverInjectionKey: InjectionKey<ShallowRef<SlideoverState>>;
4
+ export interface SlideoverState {
5
+ component: Component | string;
6
+ props: SlideoverProps;
7
+ }
8
+ export declare const slideoverInjectionKey: InjectionKey<ShallowRef<SlideoverState>>;
5
9
  declare function _useSlideover(): {
6
- open: <T extends Component>(component: T, props?: Slideover & ComponentProps<T>) => void;
10
+ open: <T extends Component>(component: T, props?: SlideoverProps & ComponentProps<T>) => void;
7
11
  close: () => Promise<void>;
8
12
  reset: () => void;
9
- patch: <T extends Component = {}>(props: Partial<Slideover & ComponentProps<T>>) => void;
10
- isOpen: import("vue").Ref<boolean>;
13
+ patch: <T extends Component = Record<string, never>>(props: Partial<SlideoverState & ComponentProps<T>>) => void;
14
+ isOpen: import("vue").Ref<boolean, boolean>;
11
15
  };
12
16
  export declare const useSlideover: typeof _useSlideover;
13
17
  export {};
@@ -1,8 +1,8 @@
1
1
  import { ref, inject } from "vue";
2
2
  import { createSharedComposable } from "@vueuse/core";
3
- export const slidOverInjectionKey = Symbol("nuxt-ui.slideover");
3
+ export const slideoverInjectionKey = Symbol("nuxt-ui.slideover");
4
4
  function _useSlideover() {
5
- const slideoverState = inject(slidOverInjectionKey);
5
+ const slideoverState = inject(slideoverInjectionKey);
6
6
  const isOpen = ref(false);
7
7
  function open(component, props) {
8
8
  if (!slideoverState) {
@@ -19,6 +19,7 @@ function _useSlideover() {
19
19
  isOpen.value = false;
20
20
  }
21
21
  function reset() {
22
+ if (!slideoverState) return;
22
23
  slideoverState.value = {
23
24
  component: "div",
24
25
  props: {}
@@ -1,20 +1,12 @@
1
- import type { Notification } from '../types/notification.js';
1
+ import type { ToastProps } from '../types.js';
2
+ export interface Toast extends Omit<ToastProps, 'defaultOpen'> {
3
+ id: string | number;
4
+ click?: (toast: Toast) => void;
5
+ }
2
6
  export declare function useToast(): {
3
- add: (notification: Partial<Notification>) => {
4
- id: string;
5
- title?: string;
6
- description?: string;
7
- icon?: string;
8
- avatar?: import("../types").Avatar;
9
- closeButton?: import("../types").Button;
10
- timeout?: number;
11
- actions?: import("../types").NotificationAction[];
12
- click?: (...args: any[]) => void;
13
- callback?: (...args: any[]) => void;
14
- color?: import("../types").NotificationColor;
15
- ui?: any;
16
- };
17
- remove: (id: string) => void;
18
- update: (id: string, notification: Partial<Notification>) => void;
7
+ toasts: import("vue").Ref<Toast[], Toast[]>;
8
+ add: (toast: Partial<Toast>) => Toast;
9
+ update: (id: string | number, toast: Partial<Toast>) => void;
10
+ remove: (id: string | number) => void;
19
11
  clear: () => void;
20
12
  };
@@ -1,34 +1,48 @@
1
1
  import { useState } from "#imports";
2
2
  export function useToast() {
3
- const notifications = useState("notifications", () => []);
4
- function add(notification) {
3
+ const toasts = useState("toasts", () => []);
4
+ function add(toast) {
5
5
  const body = {
6
6
  id: (/* @__PURE__ */ new Date()).getTime().toString(),
7
- ...notification
7
+ open: true,
8
+ ...toast
8
9
  };
9
- const index = notifications.value.findIndex((n) => n.id === body.id);
10
+ const index = toasts.value.findIndex((t) => t.id === body.id);
10
11
  if (index === -1) {
11
- notifications.value.push(body);
12
+ toasts.value.push(body);
12
13
  }
14
+ toasts.value = toasts.value.slice(-5);
13
15
  return body;
14
16
  }
15
- function remove(id) {
16
- notifications.value = notifications.value.filter((n) => n.id !== id);
17
+ function update(id, toast) {
18
+ const index = toasts.value.findIndex((t) => t.id === id);
19
+ if (index !== -1) {
20
+ toasts.value[index] = {
21
+ ...toasts.value[index],
22
+ ...toast
23
+ };
24
+ }
17
25
  }
18
- function update(id, notification) {
19
- const index = notifications.value.findIndex((n) => n.id === id);
26
+ function remove(id) {
27
+ const index = toasts.value.findIndex((t) => t.id === id);
20
28
  if (index !== -1) {
21
- const previous = notifications.value[index];
22
- notifications.value.splice(index, 1, { ...previous, ...notification });
29
+ toasts.value[index] = {
30
+ ...toasts.value[index],
31
+ open: false
32
+ };
23
33
  }
34
+ setTimeout(() => {
35
+ toasts.value = toasts.value.filter((t) => t.id !== id);
36
+ }, 200);
24
37
  }
25
38
  function clear() {
26
- notifications.value = [];
39
+ toasts.value = [];
27
40
  }
28
41
  return {
42
+ toasts,
29
43
  add,
30
- remove,
31
44
  update,
45
+ remove,
32
46
  clear
33
47
  };
34
48
  }
@@ -1,2 +0,0 @@
1
- declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
2
- export default _default;
@@ -1,27 +1,18 @@
1
1
  import { computed } from "vue";
2
- import { get, hexToRgb } from "../utils/index.js";
3
2
  import { defineNuxtPlugin, useAppConfig, useNuxtApp, useHead } from "#imports";
4
- import colors from "#tailwind-config/theme/colors";
5
3
  export default defineNuxtPlugin(() => {
6
4
  const appConfig = useAppConfig();
7
5
  const nuxtApp = useNuxtApp();
6
+ const shades = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
7
+ function generateColor(key, value) {
8
+ return `${shades.map((shade) => `--color-${key}-${shade}: var(--color-${value}-${shade});`).join("\n ")}`;
9
+ }
8
10
  const root = computed(() => {
9
- const primary = get(colors, appConfig.ui.primary);
10
- const gray = get(colors, appConfig.ui.gray);
11
- if (!primary) {
12
- console.warn(`[@nuxt/ui] Primary color '${appConfig.ui.primary}' not found in Tailwind config`);
13
- }
14
- if (!gray) {
15
- console.warn(`[@nuxt/ui] Gray color '${appConfig.ui.gray}' not found in Tailwind config`);
16
- }
17
11
  return `:root {
18
- ${Object.entries(primary || colors.green).map(([key, value]) => `--color-primary-${key}: ${hexToRgb(value)};`).join("\n")}
19
- --color-primary-DEFAULT: var(--color-primary-500);
20
-
21
- ${Object.entries(gray || colors.cool).map(([key, value]) => `--color-gray-${key}: ${hexToRgb(value)};`).join("\n")}
12
+ ${Object.entries(appConfig.ui.colors).map(([key, value]) => generateColor(key, value)).join("\n ")}
13
+ --color-primary-DEFAULT: var(--color-primary-500);
22
14
  }
23
-
24
- .dark {
15
+ @media (prefers-color-scheme: dark) {
25
16
  --color-primary-DEFAULT: var(--color-primary-400);
26
17
  }
27
18
  `;
@@ -30,7 +21,8 @@ ${Object.entries(gray || colors.cool).map(([key, value]) => `--color-gray-${key}
30
21
  style: [{
31
22
  innerHTML: () => root.value,
32
23
  tagPriority: -2,
33
- id: "nuxt-ui-colors"
24
+ id: "nuxt-ui-colors",
25
+ type: "text/css"
34
26
  }]
35
27
  };
36
28
  if (import.meta.client && nuxtApp.isHydrating && !nuxtApp.payload.serverRendered) {
File without changes
File without changes
@@ -1,10 +1,10 @@
1
- import { defineNuxtPlugin } from "#imports";
2
1
  import { shallowRef } from "vue";
3
- import { slidOverInjectionKey } from "../composables/useSlideover.js";
2
+ import { defineNuxtPlugin } from "#imports";
3
+ import { slideoverInjectionKey } from "../composables/useSlideover.js";
4
4
  export default defineNuxtPlugin((nuxtApp) => {
5
5
  const slideoverState = shallowRef({
6
6
  component: "div",
7
7
  props: {}
8
8
  });
9
- nuxtApp.vueApp.provide(slidOverInjectionKey, slideoverState);
9
+ nuxtApp.vueApp.provide(slideoverInjectionKey, slideoverState);
10
10
  });
@@ -0,0 +1,6 @@
1
+ declare module '#build/app.config' {
2
+ import type { AppConfig } from '@nuxt/schema'
3
+
4
+ const _default: AppConfig
5
+ export default _default
6
+ }
@@ -1,14 +1,17 @@
1
- export type ComponentProps<T> =
2
- T extends new () => { $props: infer P } ? NonNullable<P> :
3
- T extends (props: infer P, ...args: any) => any ? P :
4
- {}
5
-
6
- export type ComponentSlots<T> =
7
- T extends new () => { $slots: infer S } ? NonNullable<S> :
8
- T extends (props: any, ctx: { slots: infer S; attrs: any; emit: any }, ...args: any) => any ? NonNullable<S> :
9
- {}
10
-
11
- export type ComponentEmit<T> =
12
- T extends new () => { $emit: infer E } ? NonNullable<E> :
13
- T extends (props: any, ctx: { slots: any; attrs: any; emit: infer E }, ...args: any) => any ? NonNullable<E> :
14
- {}
1
+ export type ComponentProps<T> = T extends new () => {
2
+ $props: infer P;
3
+ } ? NonNullable<P> : T extends (props: infer P, ...args: any) => any ? P : Record<string, never>;
4
+ export type ComponentSlots<T> = T extends new () => {
5
+ $slots: infer S;
6
+ } ? NonNullable<S> : T extends (props: any, ctx: {
7
+ slots: infer S;
8
+ attrs: any;
9
+ emit: any;
10
+ }, ...args: any) => any ? NonNullable<S> : Record<string, never>;
11
+ export type ComponentEmit<T> = T extends new () => {
12
+ $emit: infer E;
13
+ } ? NonNullable<E> : T extends (props: any, ctx: {
14
+ slots: any;
15
+ attrs: any;
16
+ emit: infer E;
17
+ }, ...args: any) => any ? NonNullable<E> : Record<string, never>;
File without changes
@@ -1,38 +1,69 @@
1
- import type { Ref } from 'vue'
2
-
3
- export interface FormError<T extends string = string> {
4
- path: T
5
- message: string
1
+ import type { ComputedRef, Ref } from 'vue';
2
+ import type { ZodSchema } from 'zod';
3
+ import type { Schema as JoiSchema } from 'joi';
4
+ import type { ObjectSchema as YupObjectSchema } from 'yup';
5
+ import type { GenericSchema as ValibotSchema, GenericSchemaAsync as ValibotSchemaAsync, SafeParser as ValibotSafeParser, SafeParserAsync as ValibotSafeParserAsync } from 'valibot';
6
+ import type { GetObjectField } from './utils.js';
7
+ export interface Form<T> {
8
+ validate(opts?: {
9
+ name: string | string[];
10
+ silent?: false;
11
+ nested?: boolean;
12
+ }): Promise<T | false>;
13
+ clear(path?: string): void;
14
+ errors: Ref<FormError[]>;
15
+ setErrors(errs: FormError[], path?: string): void;
16
+ getErrors(path?: string): FormError[];
17
+ submit(): Promise<void>;
18
+ disabled: ComputedRef<boolean>;
19
+ }
20
+ export type FormSchema<T extends Record<string, any>> = ZodSchema | YupObjectSchema<T> | ValibotSchema | ValibotSchemaAsync | ValibotSafeParser<any, any> | ValibotSafeParserAsync<any, any> | JoiSchema<T>;
21
+ export type FormInputEvents = 'input' | 'blur' | 'change';
22
+ export interface FormError<P extends string = string> {
23
+ name: P;
24
+ message: string;
6
25
  }
7
-
8
26
  export interface FormErrorWithId extends FormError {
9
- id: string
27
+ id: string;
10
28
  }
11
-
12
- export interface Form<T> {
13
- validate(path?: string | string[], opts?: { silent?: true }): Promise<T | false>;
14
- validate(path?: string | string[], opts?: { silent?: false }): Promise<T>;
15
- clear(path?: string): void
16
- errors: Ref<FormError[]>
17
- setErrors(errs: FormError[], path?: string): void
18
- getErrors(path?: string): FormError[]
19
- submit(): Promise<void>
29
+ export type FormSubmitEvent<T> = SubmitEvent & {
30
+ data: T;
31
+ };
32
+ export type FormValidationError = {
33
+ errors: FormErrorWithId[];
34
+ childrens: FormValidationError[];
35
+ };
36
+ export type FormErrorEvent = SubmitEvent & FormValidationError;
37
+ export type FormEventType = FormInputEvents;
38
+ export type FormChildAttachEvent = {
39
+ type: 'attach';
40
+ formId: string | number;
41
+ validate: Form<any>['validate'];
42
+ };
43
+ export type FormChildDetachEvent = {
44
+ type: 'detach';
45
+ formId: string | number;
46
+ };
47
+ export type FormInputEvent = {
48
+ type: FormEventType;
49
+ name?: string;
50
+ };
51
+ export type FormEvent = FormInputEvent | FormChildAttachEvent | FormChildDetachEvent;
52
+ export interface FormInjectedOptions {
53
+ disabled?: boolean;
54
+ validateOnInputDelay?: number;
20
55
  }
21
-
22
- export type FormSubmitEvent<T> = SubmitEvent & { data: T }
23
- export type FormErrorEvent = SubmitEvent & { errors: FormErrorWithId[] }
24
-
25
- export type FormEventType = 'blur' | 'input' | 'change' | 'submit'
26
-
27
- export interface FormEvent {
28
- type: FormEventType
29
- path?: string
56
+ export interface FormFieldInjectedOptions<T> {
57
+ id: string;
58
+ name?: string;
59
+ size?: GetObjectField<T, 'size'>;
60
+ error?: string | boolean;
61
+ eagerValidation?: boolean;
62
+ validateOnInputDelay?: number;
30
63
  }
31
-
32
- export interface InjectedFormGroupValue {
33
- inputId: Ref<string | undefined>
34
- name: Ref<string>
35
- size: Ref<string | number | symbol>
36
- error: Ref<string | boolean | undefined>
37
- eagerValidation: Ref<boolean>
64
+ export declare class FormValidationException extends Error {
65
+ formId: string | number;
66
+ errors: FormErrorWithId[];
67
+ childrens: FormValidationException[];
68
+ constructor(formId: string | number, errors: FormErrorWithId[], childErrors: FormValidationException[]);
38
69
  }
@@ -0,0 +1,12 @@
1
+ export class FormValidationException extends Error {
2
+ formId;
3
+ errors;
4
+ childrens;
5
+ constructor(formId, errors, childErrors) {
6
+ super("Form validation exception");
7
+ this.formId = formId;
8
+ this.errors = errors;
9
+ this.childrens = childErrors;
10
+ Object.setPrototypeOf(this, FormValidationException.prototype);
11
+ }
12
+ }
@@ -1,31 +1,42 @@
1
- export * from './accordion.js';
2
- export * from './alert.js';
3
- export * from './avatar.js';
4
- export * from './badge.js';
5
- export * from './breadcrumb.js';
6
- export * from './button.js';
7
- export * from './chip.js';
8
- export * from './clipboard.js';
9
- export * from './command-palette.js';
10
- export * from './divider.js';
11
- export * from './dropdown.js';
12
- export * from './form-group.js';
1
+ export * from '../components/Accordion.vue.js';
2
+ export * from '../components/Alert.vue.js';
3
+ export * from '../components/App.vue.js';
4
+ export * from '../components/Avatar.vue.js';
5
+ export * from '../components/AvatarGroup.vue.js';
6
+ export * from '../components/Badge.vue.js';
7
+ export * from '../components/Breadcrumb.vue.js';
8
+ export * from '../components/Button.vue.js';
9
+ export * from '../components/Card.vue.js';
10
+ export * from '../components/Checkbox.vue.js';
11
+ export * from '../components/Chip.vue.js';
12
+ export * from '../components/Collapsible.vue.js';
13
+ export * from '../components/CommandPalette.vue.js';
14
+ export * from '../components/Container.vue.js';
15
+ export * from '../components/ContextMenu.vue.js';
16
+ export * from '../components/Drawer.vue.js';
17
+ export * from '../components/DropdownMenu.vue.js';
18
+ export * from '../components/Form.vue.js';
19
+ export * from '../components/FormField.vue.js';
20
+ export * from '../components/Input.vue.js';
21
+ export * from '../components/InputMenu.vue.js';
22
+ export * from '../components/Kbd.vue.js';
23
+ export * from '../components/Link.vue.js';
24
+ export * from '../components/Modal.vue.js';
25
+ export * from '../components/NavigationMenu.vue.js';
26
+ export * from '../components/Pagination.vue.js';
27
+ export * from '../components/Popover.vue.js';
28
+ export * from '../components/Progress.vue.js';
29
+ export * from '../components/RadioGroup.vue.js';
30
+ export * from '../components/Select.vue.js';
31
+ export * from '../components/SelectMenu.vue.js';
32
+ export * from '../components/Separator.vue.js';
33
+ export * from '../components/Skeleton.vue.js';
34
+ export * from '../components/Slideover.vue.js';
35
+ export * from '../components/Slider.vue.js';
36
+ export * from '../components/Switch.vue.js';
37
+ export * from '../components/Tabs.vue.js';
38
+ export * from '../components/Textarea.vue.js';
39
+ export * from '../components/Toast.vue.js';
40
+ export * from '../components/Toaster.vue.js';
41
+ export * from '../components/Tooltip.vue.js';
13
42
  export * from './form.js';
14
- export * from './horizontal-navigation.js';
15
- export * from './input.js';
16
- export * from './kbd.js';
17
- export * from './link.js';
18
- export * from './meter.js';
19
- export * from './modal.js';
20
- export * from './slideover.js';
21
- export * from './notification.js';
22
- export * from './popper.js';
23
- export * from './progress.js';
24
- export * from './range.js';
25
- export * from './select.js';
26
- export * from './tabs.js';
27
- export * from './textarea.js';
28
- export * from './toggle.js';
29
- export * from './tooltip.js';
30
- export * from './vertical-navigation.js';
31
- export * from './utils.js';