@groupteknology/vuno 1.0.0 → 2.0.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 (437) hide show
  1. package/README.md +53 -27
  2. package/dist/module.d.mts +14 -2
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +80 -13
  5. package/dist/runtime/app/assets/css/dialog.css +1 -0
  6. package/dist/runtime/app/assets/css/main.css +1 -0
  7. package/dist/runtime/app/assets/css/stylesheet.css +1 -0
  8. package/dist/runtime/app/assets/css/theme.css +1 -0
  9. package/dist/runtime/app/assets/css/tokens.css +1 -0
  10. package/dist/runtime/app/components/Alert/Alert.d.vue.ts +20 -0
  11. package/dist/runtime/app/components/Alert/Alert.theme.d.ts +13 -0
  12. package/dist/runtime/app/components/Alert/Alert.theme.js +13 -0
  13. package/dist/runtime/app/components/Alert/Alert.vue +59 -0
  14. package/dist/runtime/app/components/Alert/Alert.vue.d.ts +20 -0
  15. package/dist/runtime/app/components/App/App.d.vue.ts +52 -0
  16. package/dist/runtime/app/components/App/App.vue +150 -0
  17. package/dist/runtime/app/components/App/App.vue.d.ts +52 -0
  18. package/dist/runtime/app/components/App/internal/Overlay/Overlay.d.vue.ts +7 -0
  19. package/dist/runtime/app/components/App/internal/Overlay/Overlay.vue +39 -0
  20. package/dist/runtime/app/components/App/internal/Overlay/Overlay.vue.d.ts +7 -0
  21. package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.d.vue.ts +8 -0
  22. package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue +19 -0
  23. package/dist/runtime/app/components/App/internal/OverlayItem/OverlayItem.vue.d.ts +8 -0
  24. package/dist/runtime/app/components/App/internal/Toast/Toast.d.vue.ts +11 -0
  25. package/dist/runtime/app/components/App/internal/Toast/Toast.theme.d.ts +13 -0
  26. package/dist/runtime/app/components/App/internal/Toast/Toast.theme.js +18 -0
  27. package/dist/runtime/app/components/App/internal/Toast/Toast.vue +64 -0
  28. package/dist/runtime/app/components/App/internal/Toast/Toast.vue.d.ts +11 -0
  29. package/dist/runtime/app/components/App/internal/Toaster/Toaster.d.vue.ts +11 -0
  30. package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.d.ts +15 -0
  31. package/dist/runtime/app/components/App/internal/Toaster/Toaster.theme.js +16 -0
  32. package/dist/runtime/app/components/App/internal/Toaster/Toaster.vue +100 -0
  33. package/dist/runtime/app/components/App/internal/Toaster/Toaster.vue.d.ts +11 -0
  34. package/dist/runtime/app/components/Avatar/Avatar.d.vue.ts +27 -0
  35. package/dist/runtime/app/components/Avatar/Avatar.theme.d.ts +30 -0
  36. package/dist/runtime/app/components/Avatar/Avatar.theme.js +22 -0
  37. package/dist/runtime/app/components/Avatar/Avatar.vue +51 -0
  38. package/dist/runtime/app/components/Avatar/Avatar.vue.d.ts +27 -0
  39. package/dist/runtime/app/components/Badge/Badge.d.vue.ts +40 -0
  40. package/dist/runtime/app/components/Badge/Badge.theme.d.ts +40 -0
  41. package/dist/runtime/app/components/Badge/Badge.theme.js +22 -0
  42. package/dist/runtime/app/components/Badge/Badge.vue +28 -0
  43. package/dist/runtime/app/components/Badge/Badge.vue.d.ts +40 -0
  44. package/dist/runtime/app/components/Button/Button.d.vue.ts +49 -0
  45. package/dist/runtime/app/components/Button/Button.theme.d.ts +88 -0
  46. package/dist/runtime/app/components/Button/Button.theme.js +59 -0
  47. package/dist/runtime/app/components/Button/Button.vue +78 -0
  48. package/dist/runtime/app/components/Button/Button.vue.d.ts +49 -0
  49. package/dist/runtime/app/components/Card/Card.d.vue.ts +94 -0
  50. package/dist/runtime/app/components/Card/Card.theme.d.ts +57 -0
  51. package/dist/runtime/app/components/Card/Card.theme.js +62 -0
  52. package/dist/runtime/app/components/Card/Card.vue +45 -0
  53. package/dist/runtime/app/components/Card/Card.vue.d.ts +94 -0
  54. package/dist/runtime/app/components/Code/Code.d.vue.ts +19 -0
  55. package/dist/runtime/app/components/Code/Code.theme.d.ts +11 -0
  56. package/dist/runtime/app/components/Code/Code.theme.js +12 -0
  57. package/dist/runtime/app/components/Code/Code.vue +109 -0
  58. package/dist/runtime/app/components/Code/Code.vue.d.ts +19 -0
  59. package/dist/runtime/app/components/Confirm/Confirm.d.vue.ts +35 -0
  60. package/dist/runtime/app/components/Confirm/Confirm.theme.d.ts +12 -0
  61. package/dist/runtime/app/components/Confirm/Confirm.theme.js +13 -0
  62. package/dist/runtime/app/components/Confirm/Confirm.vue +83 -0
  63. package/dist/runtime/app/components/Confirm/Confirm.vue.d.ts +35 -0
  64. package/dist/runtime/app/components/Container/Container.d.vue.ts +42 -0
  65. package/dist/runtime/app/components/Container/Container.theme.d.ts +53 -0
  66. package/dist/runtime/app/components/Container/Container.theme.js +31 -0
  67. package/dist/runtime/app/components/Container/Container.vue +20 -0
  68. package/dist/runtime/app/components/Container/Container.vue.d.ts +42 -0
  69. package/dist/runtime/app/components/ControlGroup/ControlGroup.d.vue.ts +26 -0
  70. package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.d.ts +16 -0
  71. package/dist/runtime/app/components/ControlGroup/ControlGroup.theme.js +13 -0
  72. package/dist/runtime/app/components/ControlGroup/ControlGroup.vue +26 -0
  73. package/dist/runtime/app/components/ControlGroup/ControlGroup.vue.d.ts +26 -0
  74. package/dist/runtime/app/components/FieldArray/FieldArray.d.vue.ts +13 -0
  75. package/dist/runtime/app/components/FieldArray/FieldArray.theme.d.ts +12 -0
  76. package/dist/runtime/app/components/FieldArray/FieldArray.theme.js +13 -0
  77. package/dist/runtime/app/components/FieldArray/FieldArray.vue +173 -0
  78. package/dist/runtime/app/components/FieldArray/FieldArray.vue.d.ts +13 -0
  79. package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.d.vue.ts +13 -0
  80. package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.d.ts +5 -0
  81. package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.theme.js +2 -0
  82. package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue +39 -0
  83. package/dist/runtime/app/components/FieldCheckbox/FieldCheckbox.vue.d.ts +13 -0
  84. package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.d.vue.ts +40 -0
  85. package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.d.ts +30 -0
  86. package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.theme.js +10 -0
  87. package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue +40 -0
  88. package/dist/runtime/app/components/FieldCheckbox/internal/Checkbox/Checkbox.vue.d.ts +40 -0
  89. package/dist/runtime/app/components/FieldColor/FieldColor.d.vue.ts +13 -0
  90. package/dist/runtime/app/components/FieldColor/FieldColor.theme.d.ts +27 -0
  91. package/dist/runtime/app/components/FieldColor/FieldColor.theme.js +18 -0
  92. package/dist/runtime/app/components/FieldColor/FieldColor.vue +88 -0
  93. package/dist/runtime/app/components/FieldColor/FieldColor.vue.d.ts +13 -0
  94. package/dist/runtime/app/components/FieldCurrency/FieldCurrency.d.vue.ts +13 -0
  95. package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.d.ts +5 -0
  96. package/dist/runtime/app/components/FieldCurrency/FieldCurrency.theme.js +2 -0
  97. package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue +51 -0
  98. package/dist/runtime/app/components/FieldCurrency/FieldCurrency.vue.d.ts +13 -0
  99. package/dist/runtime/app/components/FieldFile/FieldFile.d.vue.ts +26 -0
  100. package/dist/runtime/app/components/FieldFile/FieldFile.theme.d.ts +5 -0
  101. package/dist/runtime/app/components/FieldFile/FieldFile.theme.js +2 -0
  102. package/dist/runtime/app/components/FieldFile/FieldFile.vue +99 -0
  103. package/dist/runtime/app/components/FieldFile/FieldFile.vue.d.ts +26 -0
  104. package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.d.vue.ts +66 -0
  105. package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.d.ts +88 -0
  106. package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.theme.js +55 -0
  107. package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue +187 -0
  108. package/dist/runtime/app/components/FieldFile/internal/FileUpload/FileUpload.vue.d.ts +66 -0
  109. package/dist/runtime/app/components/FieldInput/FieldInput.d.vue.ts +24 -0
  110. package/dist/runtime/app/components/FieldInput/FieldInput.theme.d.ts +5 -0
  111. package/dist/runtime/app/components/FieldInput/FieldInput.theme.js +2 -0
  112. package/dist/runtime/app/components/FieldInput/FieldInput.vue +61 -0
  113. package/dist/runtime/app/components/FieldInput/FieldInput.vue.d.ts +24 -0
  114. package/dist/runtime/app/components/FieldNumber/FieldNumber.d.vue.ts +13 -0
  115. package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.d.ts +5 -0
  116. package/dist/runtime/app/components/FieldNumber/FieldNumber.theme.js +2 -0
  117. package/dist/runtime/app/components/FieldNumber/FieldNumber.vue +47 -0
  118. package/dist/runtime/app/components/FieldNumber/FieldNumber.vue.d.ts +13 -0
  119. package/dist/runtime/app/components/FieldPassword/FieldPassword.d.vue.ts +13 -0
  120. package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.d.ts +5 -0
  121. package/dist/runtime/app/components/FieldPassword/FieldPassword.theme.js +2 -0
  122. package/dist/runtime/app/components/FieldPassword/FieldPassword.vue +62 -0
  123. package/dist/runtime/app/components/FieldPassword/FieldPassword.vue.d.ts +13 -0
  124. package/dist/runtime/app/components/FieldRadio/FieldRadio.d.vue.ts +13 -0
  125. package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.d.ts +5 -0
  126. package/dist/runtime/app/components/FieldRadio/FieldRadio.theme.js +2 -0
  127. package/dist/runtime/app/components/FieldRadio/FieldRadio.vue +41 -0
  128. package/dist/runtime/app/components/FieldRadio/FieldRadio.vue.d.ts +13 -0
  129. package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.d.vue.ts +32 -0
  130. package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.d.ts +54 -0
  131. package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.theme.js +31 -0
  132. package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue +80 -0
  133. package/dist/runtime/app/components/FieldRadio/internal/RadioGroup/RadioGroup.vue.d.ts +32 -0
  134. package/dist/runtime/app/components/FieldSearch/FieldSearch.d.vue.ts +17 -0
  135. package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.d.ts +6 -0
  136. package/dist/runtime/app/components/FieldSearch/FieldSearch.theme.js +7 -0
  137. package/dist/runtime/app/components/FieldSearch/FieldSearch.vue +74 -0
  138. package/dist/runtime/app/components/FieldSearch/FieldSearch.vue.d.ts +17 -0
  139. package/dist/runtime/app/components/FieldSelect/FieldSelect.d.vue.ts +13 -0
  140. package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.d.ts +5 -0
  141. package/dist/runtime/app/components/FieldSelect/FieldSelect.theme.js +2 -0
  142. package/dist/runtime/app/components/FieldSelect/FieldSelect.vue +45 -0
  143. package/dist/runtime/app/components/FieldSelect/FieldSelect.vue.d.ts +13 -0
  144. package/dist/runtime/app/components/FieldSelect/internal/Select/Select.d.vue.ts +97 -0
  145. package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.d.ts +36 -0
  146. package/dist/runtime/app/components/FieldSelect/internal/Select/Select.theme.js +49 -0
  147. package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue +196 -0
  148. package/dist/runtime/app/components/FieldSelect/internal/Select/Select.vue.d.ts +97 -0
  149. package/dist/runtime/app/components/FieldSelect/internal/Select/option.d.ts +25 -0
  150. package/dist/runtime/app/components/FieldSelect/internal/Select/option.js +6 -0
  151. package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.d.ts +30 -0
  152. package/dist/runtime/app/components/FieldSelect/internal/Select/useVunoSelectState.js +142 -0
  153. package/dist/runtime/app/components/FieldSlug/FieldSlug.d.vue.ts +13 -0
  154. package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.d.ts +5 -0
  155. package/dist/runtime/app/components/FieldSlug/FieldSlug.theme.js +2 -0
  156. package/dist/runtime/app/components/FieldSlug/FieldSlug.vue +113 -0
  157. package/dist/runtime/app/components/FieldSlug/FieldSlug.vue.d.ts +13 -0
  158. package/dist/runtime/app/components/FieldSwitch/FieldSwitch.d.vue.ts +13 -0
  159. package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.d.ts +5 -0
  160. package/dist/runtime/app/components/FieldSwitch/FieldSwitch.theme.js +2 -0
  161. package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue +37 -0
  162. package/dist/runtime/app/components/FieldSwitch/FieldSwitch.vue.d.ts +13 -0
  163. package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.d.vue.ts +26 -0
  164. package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.d.ts +39 -0
  165. package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.theme.js +20 -0
  166. package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue +46 -0
  167. package/dist/runtime/app/components/FieldSwitch/internal/Switch/Switch.vue.d.ts +26 -0
  168. package/dist/runtime/app/components/FieldTags/FieldTags.d.vue.ts +13 -0
  169. package/dist/runtime/app/components/FieldTags/FieldTags.theme.d.ts +5 -0
  170. package/dist/runtime/app/components/FieldTags/FieldTags.theme.js +2 -0
  171. package/dist/runtime/app/components/FieldTags/FieldTags.vue +41 -0
  172. package/dist/runtime/app/components/FieldTags/FieldTags.vue.d.ts +13 -0
  173. package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.d.vue.ts +26 -0
  174. package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.d.ts +34 -0
  175. package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.theme.js +20 -0
  176. package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue +97 -0
  177. package/dist/runtime/app/components/FieldTags/internal/TagsInput/TagsInput.vue.d.ts +26 -0
  178. package/dist/runtime/app/components/FieldTextarea/FieldTextarea.d.vue.ts +26 -0
  179. package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.d.ts +5 -0
  180. package/dist/runtime/app/components/FieldTextarea/FieldTextarea.theme.js +2 -0
  181. package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue +45 -0
  182. package/dist/runtime/app/components/FieldTextarea/FieldTextarea.vue.d.ts +26 -0
  183. package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.d.vue.ts +34 -0
  184. package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.d.ts +36 -0
  185. package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.theme.js +37 -0
  186. package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue +43 -0
  187. package/dist/runtime/app/components/FieldTextarea/internal/Textarea/Textarea.vue.d.ts +34 -0
  188. package/dist/runtime/app/components/Form/Form.d.vue.ts +52 -0
  189. package/dist/runtime/app/components/Form/Form.theme.d.ts +9 -0
  190. package/dist/runtime/app/components/Form/Form.theme.js +10 -0
  191. package/dist/runtime/app/components/Form/Form.vue +129 -0
  192. package/dist/runtime/app/components/Form/Form.vue.d.ts +52 -0
  193. package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.d.vue.ts +7 -0
  194. package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue +67 -0
  195. package/dist/runtime/app/components/Form/internal/FormFieldRenderer/FormFieldRenderer.vue.d.ts +7 -0
  196. package/dist/runtime/app/components/Form/internal/grid.d.ts +9 -0
  197. package/dist/runtime/app/components/Form/internal/grid.js +91 -0
  198. package/dist/runtime/app/components/Form/internal/standard-schema.d.ts +29 -0
  199. package/dist/runtime/app/components/Form/internal/standard-schema.js +15 -0
  200. package/dist/runtime/app/components/Form/internal/useVunoFormState.d.ts +43 -0
  201. package/dist/runtime/app/components/Form/internal/useVunoFormState.js +81 -0
  202. package/dist/runtime/app/components/FormField/FormField.d.vue.ts +35 -0
  203. package/dist/runtime/app/components/FormField/FormField.theme.d.ts +62 -0
  204. package/dist/runtime/app/components/FormField/FormField.theme.js +28 -0
  205. package/dist/runtime/app/components/FormField/FormField.vue +124 -0
  206. package/dist/runtime/app/components/FormField/FormField.vue.d.ts +35 -0
  207. package/dist/runtime/app/components/FormModal/FormModal.d.vue.ts +63 -0
  208. package/dist/runtime/app/components/FormModal/FormModal.theme.d.ts +8 -0
  209. package/dist/runtime/app/components/FormModal/FormModal.theme.js +9 -0
  210. package/dist/runtime/app/components/FormModal/FormModal.vue +95 -0
  211. package/dist/runtime/app/components/FormModal/FormModal.vue.d.ts +63 -0
  212. package/dist/runtime/app/components/FormSection/FormSection.d.vue.ts +15 -0
  213. package/dist/runtime/app/components/FormSection/FormSection.theme.d.ts +12 -0
  214. package/dist/runtime/app/components/FormSection/FormSection.theme.js +14 -0
  215. package/dist/runtime/app/components/FormSection/FormSection.vue +45 -0
  216. package/dist/runtime/app/components/FormSection/FormSection.vue.d.ts +15 -0
  217. package/dist/runtime/app/components/Icon/Icon.d.vue.ts +6 -0
  218. package/dist/runtime/app/components/Icon/Icon.vue +32 -0
  219. package/dist/runtime/app/components/Icon/Icon.vue.d.ts +6 -0
  220. package/dist/runtime/app/components/Menu/Menu.d.vue.ts +36 -0
  221. package/dist/runtime/app/components/Menu/Menu.theme.d.ts +17 -0
  222. package/dist/runtime/app/components/Menu/Menu.theme.js +20 -0
  223. package/dist/runtime/app/components/Menu/Menu.vue +182 -0
  224. package/dist/runtime/app/components/Menu/Menu.vue.d.ts +36 -0
  225. package/dist/runtime/app/components/Modal/Modal.d.vue.ts +43 -0
  226. package/dist/runtime/app/components/Modal/Modal.theme.d.ts +59 -0
  227. package/dist/runtime/app/components/Modal/Modal.theme.js +47 -0
  228. package/dist/runtime/app/components/Modal/Modal.vue +215 -0
  229. package/dist/runtime/app/components/Modal/Modal.vue.d.ts +43 -0
  230. package/dist/runtime/app/components/Navbar/Navbar.d.vue.ts +45 -0
  231. package/dist/runtime/app/components/Navbar/Navbar.theme.d.ts +31 -0
  232. package/dist/runtime/app/components/Navbar/Navbar.theme.js +32 -0
  233. package/dist/runtime/app/components/Navbar/Navbar.vue +47 -0
  234. package/dist/runtime/app/components/Navbar/Navbar.vue.d.ts +45 -0
  235. package/dist/runtime/app/components/NavigationList/NavigationList.d.vue.ts +38 -0
  236. package/dist/runtime/app/components/NavigationList/NavigationList.theme.d.ts +32 -0
  237. package/dist/runtime/app/components/NavigationList/NavigationList.theme.js +35 -0
  238. package/dist/runtime/app/components/NavigationList/NavigationList.vue +187 -0
  239. package/dist/runtime/app/components/NavigationList/NavigationList.vue.d.ts +38 -0
  240. package/dist/runtime/app/components/NavigationMenu/NavigationMenu.d.vue.ts +31 -0
  241. package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.d.ts +26 -0
  242. package/dist/runtime/app/components/NavigationMenu/NavigationMenu.theme.js +27 -0
  243. package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue +236 -0
  244. package/dist/runtime/app/components/NavigationMenu/NavigationMenu.vue.d.ts +31 -0
  245. package/dist/runtime/app/components/NavigationToc/NavigationToc.d.vue.ts +14 -0
  246. package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.d.ts +9 -0
  247. package/dist/runtime/app/components/NavigationToc/NavigationToc.theme.js +10 -0
  248. package/dist/runtime/app/components/NavigationToc/NavigationToc.vue +81 -0
  249. package/dist/runtime/app/components/NavigationToc/NavigationToc.vue.d.ts +14 -0
  250. package/dist/runtime/app/components/Page/Page.d.vue.ts +40 -0
  251. package/dist/runtime/app/components/Page/Page.theme.d.ts +32 -0
  252. package/dist/runtime/app/components/Page/Page.theme.js +31 -0
  253. package/dist/runtime/app/components/Page/Page.vue +132 -0
  254. package/dist/runtime/app/components/Page/Page.vue.d.ts +40 -0
  255. package/dist/runtime/app/components/Pagination/Pagination.d.vue.ts +33 -0
  256. package/dist/runtime/app/components/Pagination/Pagination.theme.d.ts +13 -0
  257. package/dist/runtime/app/components/Pagination/Pagination.theme.js +14 -0
  258. package/dist/runtime/app/components/Pagination/Pagination.vue +129 -0
  259. package/dist/runtime/app/components/Pagination/Pagination.vue.d.ts +33 -0
  260. package/dist/runtime/app/components/Slideover/Slideover.d.vue.ts +43 -0
  261. package/dist/runtime/app/components/Slideover/Slideover.theme.d.ts +35 -0
  262. package/dist/runtime/app/components/Slideover/Slideover.theme.js +24 -0
  263. package/dist/runtime/app/components/Slideover/Slideover.vue +58 -0
  264. package/dist/runtime/app/components/Slideover/Slideover.vue.d.ts +43 -0
  265. package/dist/runtime/app/components/State/State.d.vue.ts +14 -0
  266. package/dist/runtime/app/components/State/State.theme.d.ts +19 -0
  267. package/dist/runtime/app/components/State/State.theme.js +26 -0
  268. package/dist/runtime/app/components/State/State.vue +66 -0
  269. package/dist/runtime/app/components/State/State.vue.d.ts +14 -0
  270. package/dist/runtime/app/components/Table/Table.d.vue.ts +80 -0
  271. package/dist/runtime/app/components/Table/Table.theme.d.ts +50 -0
  272. package/dist/runtime/app/components/Table/Table.theme.js +64 -0
  273. package/dist/runtime/app/components/Table/Table.vue +483 -0
  274. package/dist/runtime/app/components/Table/Table.vue.d.ts +80 -0
  275. package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.d.vue.ts +5 -0
  276. package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.vue +26 -0
  277. package/dist/runtime/app/components/Table/internal/CellBadge/CellBadge.vue.d.ts +5 -0
  278. package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.d.vue.ts +5 -0
  279. package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.d.ts +21 -0
  280. package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.theme.js +11 -0
  281. package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue +32 -0
  282. package/dist/runtime/app/components/Table/internal/CellBoolean/CellBoolean.vue.d.ts +5 -0
  283. package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.d.vue.ts +5 -0
  284. package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.d.ts +5 -0
  285. package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.theme.js +4 -0
  286. package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue +16 -0
  287. package/dist/runtime/app/components/Table/internal/CellCurrency/CellCurrency.vue.d.ts +5 -0
  288. package/dist/runtime/app/components/Table/internal/CellDate/CellDate.d.vue.ts +5 -0
  289. package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.d.ts +5 -0
  290. package/dist/runtime/app/components/Table/internal/CellDate/CellDate.theme.js +4 -0
  291. package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue +21 -0
  292. package/dist/runtime/app/components/Table/internal/CellDate/CellDate.vue.d.ts +5 -0
  293. package/dist/runtime/app/components/Table/internal/CellImage/CellImage.d.vue.ts +5 -0
  294. package/dist/runtime/app/components/Table/internal/CellImage/CellImage.vue +24 -0
  295. package/dist/runtime/app/components/Table/internal/CellImage/CellImage.vue.d.ts +5 -0
  296. package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.d.vue.ts +5 -0
  297. package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.d.ts +5 -0
  298. package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.theme.js +4 -0
  299. package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue +17 -0
  300. package/dist/runtime/app/components/Table/internal/CellNumber/CellNumber.vue.d.ts +5 -0
  301. package/dist/runtime/app/components/Table/internal/CellText/CellText.d.vue.ts +5 -0
  302. package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.d.ts +13 -0
  303. package/dist/runtime/app/components/Table/internal/CellText/CellText.theme.js +11 -0
  304. package/dist/runtime/app/components/Table/internal/CellText/CellText.vue +16 -0
  305. package/dist/runtime/app/components/Table/internal/CellText/CellText.vue.d.ts +5 -0
  306. package/dist/runtime/app/components/Table/internal/TableCell/TableCell.d.vue.ts +22 -0
  307. package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue +48 -0
  308. package/dist/runtime/app/components/Table/internal/TableCell/TableCell.vue.d.ts +22 -0
  309. package/dist/runtime/app/components/Table/internal/column.d.ts +9 -0
  310. package/dist/runtime/app/components/Table/internal/column.js +5 -0
  311. package/dist/runtime/app/components/Table/internal/query.d.ts +18 -0
  312. package/dist/runtime/app/components/Table/internal/query.js +8 -0
  313. package/dist/runtime/app/components/Table/internal/selection.d.ts +29 -0
  314. package/dist/runtime/app/components/Table/internal/selection.js +10 -0
  315. package/dist/runtime/app/components/Table/internal/useVunoTable.d.ts +93 -0
  316. package/dist/runtime/app/components/Table/internal/useVunoTable.js +153 -0
  317. package/dist/runtime/app/components/Table/internal/useVunoTableSelection.d.ts +21 -0
  318. package/dist/runtime/app/components/Table/internal/useVunoTableSelection.js +29 -0
  319. package/dist/runtime/app/components/Tabs/Tabs.d.vue.ts +49 -0
  320. package/dist/runtime/app/components/Tabs/Tabs.theme.d.ts +32 -0
  321. package/dist/runtime/app/components/Tabs/Tabs.theme.js +23 -0
  322. package/dist/runtime/app/components/Tabs/Tabs.vue +119 -0
  323. package/dist/runtime/app/components/Tabs/Tabs.vue.d.ts +49 -0
  324. package/dist/runtime/app/components/Tooltip/Tooltip.d.vue.ts +40 -0
  325. package/dist/runtime/app/components/Tooltip/Tooltip.theme.d.ts +12 -0
  326. package/dist/runtime/app/components/Tooltip/Tooltip.theme.js +13 -0
  327. package/dist/runtime/app/components/Tooltip/Tooltip.vue +139 -0
  328. package/dist/runtime/app/components/Tooltip/Tooltip.vue.d.ts +40 -0
  329. package/dist/runtime/app/components/internal/ControlShell/ControlShell.d.vue.ts +41 -0
  330. package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.d.ts +50 -0
  331. package/dist/runtime/app/components/internal/ControlShell/ControlShell.theme.js +38 -0
  332. package/dist/runtime/app/components/internal/ControlShell/ControlShell.vue +33 -0
  333. package/dist/runtime/app/components/internal/ControlShell/ControlShell.vue.d.ts +41 -0
  334. package/dist/runtime/app/components/internal/FieldShell/FieldShell.d.vue.ts +23 -0
  335. package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue +63 -0
  336. package/dist/runtime/app/components/internal/FieldShell/FieldShell.vue.d.ts +23 -0
  337. package/dist/runtime/app/components/internal/Input/Input.d.vue.ts +52 -0
  338. package/dist/runtime/app/components/internal/Input/Input.theme.d.ts +30 -0
  339. package/dist/runtime/app/components/internal/Input/Input.theme.js +21 -0
  340. package/dist/runtime/app/components/internal/Input/Input.vue +66 -0
  341. package/dist/runtime/app/components/internal/Input/Input.vue.d.ts +52 -0
  342. package/dist/runtime/app/components/internal/NumberInput/NumberInput.d.vue.ts +36 -0
  343. package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.d.ts +31 -0
  344. package/dist/runtime/app/components/internal/NumberInput/NumberInput.theme.js +26 -0
  345. package/dist/runtime/app/components/internal/NumberInput/NumberInput.vue +221 -0
  346. package/dist/runtime/app/components/internal/NumberInput/NumberInput.vue.d.ts +36 -0
  347. package/dist/runtime/app/components/internal/NumberInput/number.d.ts +42 -0
  348. package/dist/runtime/app/components/internal/NumberInput/number.js +64 -0
  349. package/dist/runtime/app/composables/defineShortcuts.d.ts +19 -0
  350. package/dist/runtime/app/composables/defineShortcuts.js +68 -0
  351. package/dist/runtime/app/composables/internal/useVunoAnchor.d.ts +45 -0
  352. package/dist/runtime/app/composables/internal/useVunoAnchor.js +35 -0
  353. package/dist/runtime/app/composables/internal/useVunoControlGroup.d.ts +17 -0
  354. package/dist/runtime/app/composables/internal/useVunoControlGroup.js +18 -0
  355. package/dist/runtime/app/composables/internal/useVunoPortal.d.ts +18 -0
  356. package/dist/runtime/app/composables/internal/useVunoPortal.js +12 -0
  357. package/dist/runtime/app/composables/useConfirm.d.ts +15 -0
  358. package/dist/runtime/app/composables/useConfirm.js +5 -0
  359. package/dist/runtime/app/composables/useContext.d.ts +11 -0
  360. package/dist/runtime/app/composables/useContext.js +9 -0
  361. package/dist/runtime/app/composables/useCrud.d.ts +23 -0
  362. package/dist/runtime/app/composables/useCrud.js +153 -0
  363. package/dist/runtime/app/composables/useField.d.ts +10 -0
  364. package/dist/runtime/app/composables/useField.js +42 -0
  365. package/dist/runtime/app/composables/useForm.d.ts +5 -0
  366. package/dist/runtime/app/composables/useForm.js +9 -0
  367. package/dist/runtime/app/composables/useModal.d.ts +21 -0
  368. package/dist/runtime/app/composables/useModal.js +24 -0
  369. package/dist/runtime/app/composables/useOverlay.d.ts +22 -0
  370. package/dist/runtime/app/composables/useOverlay.js +10 -0
  371. package/dist/runtime/app/composables/useTableQuery.d.ts +10 -0
  372. package/dist/runtime/app/composables/useTableQuery.js +126 -0
  373. package/dist/runtime/app/composables/useTheme.d.ts +31 -0
  374. package/dist/runtime/app/composables/useTheme.js +29 -0
  375. package/dist/runtime/app/composables/useToast.d.ts +28 -0
  376. package/dist/runtime/app/composables/useToast.js +13 -0
  377. package/dist/runtime/app/internal/keys.d.ts +43 -0
  378. package/dist/runtime/app/internal/keys.js +8 -0
  379. package/dist/runtime/app/internal/slots.d.ts +22 -0
  380. package/dist/runtime/app/internal/slots.js +24 -0
  381. package/dist/runtime/app/plugins/vue-query.d.ts +8 -0
  382. package/dist/runtime/app/plugins/vue-query.js +13 -0
  383. package/dist/runtime/app/theme/icons.d.ts +2 -0
  384. package/dist/runtime/app/theme/icons.js +43 -0
  385. package/dist/runtime/app/theme/index.d.ts +1168 -0
  386. package/dist/runtime/app/theme/index.js +120 -0
  387. package/dist/runtime/app/theme/messages.d.ts +2 -0
  388. package/dist/runtime/app/theme/messages.js +70 -0
  389. package/dist/runtime/app/theme/shared.d.ts +42 -0
  390. package/dist/runtime/app/theme/shared.js +24 -0
  391. package/dist/runtime/app/types/alert.d.ts +13 -0
  392. package/dist/runtime/app/types/alert.js +0 -0
  393. package/dist/runtime/app/types/app-config.d.ts +8 -0
  394. package/dist/runtime/app/types/app-config.js +1 -0
  395. package/dist/runtime/app/types/app.d.ts +83 -0
  396. package/dist/runtime/app/types/app.js +0 -0
  397. package/dist/runtime/app/types/base.d.ts +78 -0
  398. package/dist/runtime/app/types/base.js +0 -0
  399. package/dist/runtime/app/types/confirm.d.ts +19 -0
  400. package/dist/runtime/app/types/confirm.js +0 -0
  401. package/dist/runtime/app/types/crud.d.ts +108 -0
  402. package/dist/runtime/app/types/crud.js +0 -0
  403. package/dist/runtime/app/types/field-type.d.ts +4 -0
  404. package/dist/runtime/app/types/field-type.js +0 -0
  405. package/dist/runtime/app/types/field.d.ts +233 -0
  406. package/dist/runtime/app/types/field.js +0 -0
  407. package/dist/runtime/app/types/form.d.ts +67 -0
  408. package/dist/runtime/app/types/form.js +0 -0
  409. package/dist/runtime/app/types/index.d.ts +16 -0
  410. package/dist/runtime/app/types/index.js +1 -0
  411. package/dist/runtime/app/types/page.d.ts +61 -0
  412. package/dist/runtime/app/types/page.js +0 -0
  413. package/dist/runtime/app/types/responsive.d.ts +8 -0
  414. package/dist/runtime/app/types/responsive.js +0 -0
  415. package/dist/runtime/app/types/shortcuts.d.ts +44 -0
  416. package/dist/runtime/app/types/shortcuts.js +0 -0
  417. package/dist/runtime/app/types/slots.d.ts +30 -0
  418. package/dist/runtime/app/types/slots.js +0 -0
  419. package/dist/runtime/app/types/state.d.ts +35 -0
  420. package/dist/runtime/app/types/state.js +0 -0
  421. package/dist/runtime/app/types/table.d.ts +287 -0
  422. package/dist/runtime/app/types/table.js +0 -0
  423. package/dist/runtime/app/types/theme.d.ts +251 -0
  424. package/dist/runtime/app/types/theme.js +0 -0
  425. package/dist/runtime/app/utils/format.d.ts +18 -0
  426. package/dist/runtime/app/utils/format.js +36 -0
  427. package/dist/runtime/app/utils/pagination.d.ts +41 -0
  428. package/dist/runtime/app/utils/pagination.js +32 -0
  429. package/dist/runtime/app/utils/path.d.ts +16 -0
  430. package/dist/runtime/app/utils/path.js +76 -0
  431. package/dist/runtime/app/utils/query-key.d.ts +20 -0
  432. package/dist/runtime/app/utils/query-key.js +7 -0
  433. package/dist/runtime/app/utils/theme.d.ts +44 -0
  434. package/dist/runtime/app/utils/theme.js +43 -0
  435. package/dist/types.d.mts +3 -11
  436. package/package.json +18 -3
  437. package/dist/module.d.cts +0 -2
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Formularios, tablas y diálogos declarativos para Nuxt 4, con componentes propios y sin librería de interfaz por debajo.
4
4
 
5
- El módulo **trae su propia estética, y se sobreescribe entera desde el proyecto**. Todo lo que pinta se deriva de un puñado de variables CSS —los tokens `--vuno-*`—, así que redefinir una cambia vuno entero sin tocar un solo componente. Lo que necesita comportamiento difícil —combobox, menú, pestañas, tooltip, campo numérico— lleva su patrón ARIA y su teclado escritos aquí, con [Floating UI](https://floating-ui.com) para colocar lo que flota y nada más; el resto son elementos nativos.
5
+ El módulo **trae su propia estética, y se sobreescribe desde el proyecto**. Los colores, superficies y tipografía se derivan de variables CSS —los tokens `--vuno-*`—; la curvatura usa directamente la escala predeterminada de Tailwind. Lo que necesita comportamiento difícil —combobox, menú, pestañas, tooltip, campo numérico— lleva su patrón ARIA y su teclado escritos aquí, con [Floating UI](https://floating-ui.com) para colocar lo que flota y nada más; el resto son elementos nativos.
6
6
 
7
- Un color o un radio escrito a mano dentro de un componente es un error: si algo no se puede cambiar desde los tokens, falta un token.
7
+ Un color literal dentro de un componente es un error: si algo no se puede cambiar desde los tokens, falta un token. Para radios se usan las utilidades estándar de Tailwind.
8
8
 
9
9
  ## Documentación
10
10
 
@@ -87,7 +87,28 @@ const definition = {
87
87
 
88
88
  ### Tipos de campo
89
89
 
90
- `text` · `email` · `password` · `textarea` · `number` · `select` · `radio` · `checkbox` · `switch` · `color` · `slug` · `file` · `array`
90
+ `text` · `search` · `email` · `password` · `textarea` · `number` · `select` · `radio` · `checkbox` · `switch` · `color` · `slug` · `file` · `array`
91
+
92
+ Los mismos campos son componentes públicos y ya incluyen etiqueta, descripción, ayuda y error. Dentro de `VForm` leen y escriben por `name`; fuera usan su propio `v-model`:
93
+
94
+ ```vue
95
+ <VFieldInput name="name" label="Nombre" />
96
+
97
+ <VFieldInput v-model="name" label="Nombre" />
98
+ ```
99
+
100
+ La etiqueta va arriba por defecto. `orientation="horizontal"` la coloca al costado del control:
101
+
102
+ ```vue
103
+ <VFieldSelect
104
+ v-model="role"
105
+ label="Rol"
106
+ orientation="horizontal"
107
+ :items="roles"
108
+ />
109
+ ```
110
+
111
+ Los controles básicos son implementación interna. Para campos propios, `VFormField` sigue disponible y puede envolver cualquier control; un `VField*` colocado dentro reconoce ese envoltorio y no crea uno duplicado.
91
112
 
92
113
  `source` del campo `slug` es el **nombre** del campo del que deriva, no su valor.
93
114
 
@@ -296,18 +317,14 @@ key: () => productKeys.list(filtros) // solo refresca esa combinación de filtro
296
317
 
297
318
  `useCrud` resuelve el listado durante el render en servidor, así que el HTML sale con las filas puestas y no aparecen al hidratar. Nuxt renderiza en servidor por defecto, de modo que esto no hay que activarlo.
298
319
 
299
- Para que además viaje en el payload y el cliente no vuelva a pedirlo, el plugin de vue-query del proyecto tiene que deshidratar. Es responsabilidad del consumidor, no del módulo:
300
-
301
- ```ts
302
- // app/plugins/vue-query.ts
303
- export default defineNuxtPlugin((nuxtApp) => {
304
- const state = useState<DehydratedState | null>('vue-query', () => null)
305
- const queryClient = new QueryClient()
320
+ Vuno registra TanStack Query y deshidrata su caché en el payload de Nuxt, de modo que el cliente hidrata lo resuelto en servidor sin repetir la primera consulta. No hace falta instalar ni configurar `@tanstack/vue-query` en el proyecto consumidor.
306
321
 
307
- nuxtApp.vueApp.use(VueQueryPlugin, { queryClient })
322
+ Si el proyecto ya aporta su propio `QueryClient`, desactiva el registro de Vuno y conserva esa configuración:
308
323
 
309
- if (import.meta.server) nuxtApp.hooks.hook('app:rendered', () => { state.value = dehydrate(queryClient) })
310
- if (import.meta.client) hydrate(queryClient, state.value)
324
+ ```ts [nuxt.config.ts]
325
+ export default defineNuxtConfig({
326
+ modules: ['@groupteknology/vuno'],
327
+ vuno: { vueQuery: false },
311
328
  })
312
329
  ```
313
330
 
@@ -319,14 +336,6 @@ Con la clave incompleta no se espera nada: la consulta está suspendida y espera
319
336
 
320
337
  Si compruebas esto con un test, **mira el HTML renderizado, no el payload**. El payload lleva la consulta resuelta aunque el prefetch esté apagado, porque la consulta se asienta después del render y el plugin deshidrata lo que encuentra: un assert sobre el payload pasa en las dos direcciones y no mide nada.
321
338
 
322
- **`@tanstack/vue-query` lo instala el proyecto**, y solo hace falta si usas este composable:
323
-
324
- ```bash
325
- pnpm add @tanstack/vue-query
326
- ```
327
-
328
- No se declara como dependencia opcional del módulo a propósito. npm instala igualmente los `peerDependencies` marcados como opcionales, y como los de vue-query admiten Vue 2, acababa colocando `vue@2.6.14` en la raíz y chocando con el `vue@^3.5.0` que pide vuno: `npm install @groupteknology/vuno` fallaba con `ERESOLVE` en un proyecto Nuxt que no declarara `vue` por su cuenta. Con pnpm no ocurría, que es por lo que tardó en verse.
329
-
330
339
  ## Páginas
331
340
 
332
341
  `VPage` pone la estructura que repite cualquier pantalla de mantenimiento:
@@ -461,6 +470,18 @@ Los dos estados existen además sueltos, para las pantallas que no son una tabla
461
470
  <VState tone="failure" :failure="failure" />
462
471
  ```
463
472
 
473
+ Un aviso que acompaña contenido existente usa `VAlert`. Es persistente, toma los mismos colores semánticos del tema y usa `role="status"` por defecto; `role="alert"` queda para lo urgente:
474
+
475
+ ```vue
476
+ <VAlert
477
+ color="warning"
478
+ title="Faltan datos de facturación"
479
+ description="Completa la dirección fiscal antes de emitir una factura."
480
+ >
481
+ <template #actions><VButton label="Completar datos" variant="outline" /></template>
482
+ </VAlert>
483
+ ```
484
+
464
485
  Tipos de columna: `text` · `number` · `currency` · `date` · `boolean` · `badge` · `image` · `custom` · `actions`. Trae búsqueda con antirrebote, paginación, selección múltiple, panel lateral de filtros y menú de acciones por fila.
465
486
 
466
487
  ## Diálogos de confirmación
@@ -519,15 +540,22 @@ Se pinta en `<VApp>` y no en la pantalla que lo abrió, así que navegar no lo d
519
540
  | `useField` | Lee y escribe un campo por su ruta; para construir campos propios. |
520
541
  | `useTheme` | Resuelve los slots de un componente cruzando tema, `app.config` y prop `ui`. |
521
542
  | `useIcons` | Los iconos configurados en `vuno.icons`. |
543
+ | `useLocale` | El idioma configurado para fechas, números y monedas. |
522
544
  | `useMessages` | Los textos configurados en `vuno.messages`. |
545
+ | `useToast` | Notificaciones globales que no interrumpen. |
546
+ | `useConfirm` | Confirmación global que devuelve la respuesta como promesa. |
547
+ | `useOverlay` | Abre componentes como capas globales desde código. |
548
+ | `useModal` | Resuelve y abre los modales del proyecto por nombre. |
549
+ | `useContext` | Acceso de bajo nivel al contexto provisto por `VApp`. |
550
+ | `defineShortcuts` | Declara atajos de teclado reactivos y ligados al ciclo de vida. |
523
551
 
524
- Los tres últimos existen para que un componente tuyo pueda usar los mismos iconos, textos y reglas de tema que los de vuno sin duplicar la configuración.
552
+ `useTheme`, `useIcons`, `useLocale` y `useMessages` existen para que un componente tuyo pueda usar la misma configuración visual y regional que los de vuno sin duplicarla.
525
553
 
526
554
  ## Personalización
527
555
 
528
556
  ### Los tokens
529
557
 
530
- **Es el primer sitio al que hay que ir, y casi siempre el único.** Todo el color, el radio y la jerarquía de texto de vuno salen de variables CSS que se redefinen desde el proyecto. El caso mínimo, en cualquier hoja que cargue tu aplicación:
558
+ **Es el primer sitio al que hay que ir, y casi siempre el único.** El color y la jerarquía de texto de vuno salen de variables CSS que se redefinen desde el proyecto. El caso mínimo, en cualquier hoja que cargue tu aplicación:
531
559
 
532
560
  ```css
533
561
  :root {
@@ -548,11 +576,11 @@ Los que hay:
548
576
  | `--vuno-surface` · `--vuno-surface-1` · `--vuno-surface-2` · `--vuno-surface-inverse` | La escala de elevación: **cada cosa sube un escalón sobre lo que la sostiene**. La página es la base —blanco en claro, negro en oscuro—, lo que se levanta de ella es el 1 y lo que se levanta dentro de algo ya levantado es el 2. |
549
577
  | `--vuno-text-strong` · `-body` · `-muted` · `-subtle` · `-inverse` | El texto por jerarquía, no por color. |
550
578
  | `--vuno-border` · `--vuno-border-strong` | El borde que decora y el que delimita un control. |
551
- | `--vuno-radius` | La curvatura de todo. |
552
579
  | `--vuno-backdrop` | El velo que oscurece detrás de un diálogo. |
553
580
 
554
581
  Dos cosas que ahorran un rato:
555
582
 
583
+ - **La curvatura usa Tailwind directamente.** El tema predeterminado usa `rounded-sm` y la prop `radius` admite `xs`, `sm`, `md`, `lg`, `xl`, `2xl`, `3xl`, `4xl` y `full`.
556
584
  - **El tema oscuro se redefine aparte**, bajo `.dark`. Si solo cambias `:root`, el modo oscuro se queda con el valor de serie.
557
585
  - **Cada acento sólido necesita su contraste.** Un `--vuno-warning` claro con texto blanco no se lee; por eso el ámbar de serie trae texto oscuro.
558
586
 
@@ -593,14 +621,12 @@ En desarrollo.
593
621
 
594
622
  ### Nota sobre pruebas automatizadas
595
623
 
596
- Tres trampas, las tres medidas aquí, que hacen que una comprobación afirme lo contrario de lo que pasa.
624
+ Dos trampas, las dos medidas aquí, que hacen que una comprobación afirme lo contrario de lo que pasa.
597
625
 
598
626
  **Una pestaña oculta no pinta.** Con la ventana de fondo, `document.visibilityState` es `hidden`, `requestAnimationFrame` **no dispara nunca** y con él se paran las transiciones: un diálogo puede no llegar a abrirse y una captura caducar. El DOM y las medidas de disposición sí funcionan, así que se puede comprobar casi todo; lo que no se puede es dar por cerrado un componente porque su nodo siga ahí. Mira el estado (`opacity`, `data-state`) y no la existencia del nodo, o haz la prueba con la pestaña delante.
599
627
 
600
628
  **`getComputedStyle` se queda con el valor viejo tras cambiar un token.** Si redefines `--vuno-primary` y vuelves a leer un elemento que ya existía, puede devolverte el color anterior aunque la variable ya valga otra cosa. Se nota porque el valor sale en `oklab` en vez de en `oklch`. Lee sobre un elemento **creado después** del cambio —o sobre un clon del que te interesa— y el valor es el nuevo.
601
629
 
602
- **Un control de Reka no responde a un clic sintético.** Sus botones actúan en `pointerdown`, no en `click`, y las flechas necesitan foco de verdad: un `.click()` o un `.focus()` desde el script no disparan nada y parece que el componente está roto. Los controles nativos —casilla, interruptor, radio— sí responden a `click()`, así que ahí el clic sintético vale.
603
-
604
630
  ## Licencia
605
631
 
606
632
  [MIT](./LICENSE) © Diego Otayza
package/dist/module.d.mts CHANGED
@@ -1,2 +1,14 @@
1
- export * from "/woodpecker/src/github.com/groupteknology/vuno/packages/core/src/module.js";
2
- export { default } from "/woodpecker/src/github.com/groupteknology/vuno/packages/core/src/module.js";
1
+ import { NuxtModule } from '@nuxt/schema';
2
+ export * from '../dist/runtime/app/types/index.js';
3
+
4
+ interface ModuleOptions {
5
+ prefix?: string;
6
+ /** Registrar el compilador de Tailwind. Ponlo en `false` si ya lo monta el proyecto. */
7
+ tailwind?: boolean;
8
+ /** Registrar TanStack Query con hidratación SSR. Ponlo en `false` si el proyecto ya aporta su propio cliente. */
9
+ vueQuery?: boolean;
10
+ }
11
+ declare const module$1: NuxtModule<ModuleOptions>;
12
+
13
+ export { module$1 as default };
14
+ export type { ModuleOptions };
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vuno",
3
3
  "configKey": "vuno",
4
- "version": "1.0.0",
4
+ "version": "2.0.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "unknown"
package/dist/module.mjs CHANGED
@@ -1,18 +1,85 @@
1
- import { createJiti } from "file:///woodpecker/src/github.com/groupteknology/vuno/node_modules/.pnpm/jiti@2.7.0/node_modules/jiti/lib/jiti.mjs";
1
+ import { defineNuxtModule, createResolver, addComponent, resolveModule, addTypeTemplate, addComponentsDir, addImportsDir, addPlugin, addTemplate, addVitePlugin } from '@nuxt/kit';
2
+ import tailwindcss from '@tailwindcss/vite';
3
+ import { sep } from 'node:path';
2
4
 
3
- const jiti = createJiti(import.meta.url, {
4
- "interopDefault": true,
5
- "alias": {
6
- "@groupteknology/vuno": "/woodpecker/src/github.com/groupteknology/vuno/packages/core"
5
+ const module$1 = defineNuxtModule({
6
+ defaults: {
7
+ prefix: "V",
8
+ tailwind: true,
9
+ vueQuery: true
7
10
  },
8
- "transformOptions": {
9
- "babel": {
10
- "plugins": []
11
+ meta: {
12
+ name: "vuno",
13
+ configKey: "vuno"
14
+ },
15
+ moduleDependencies: {
16
+ "@nuxt/icon": {
17
+ defaults: {
18
+ clientBundle: {
19
+ scan: true
20
+ }
21
+ }
11
22
  }
12
- }
13
- })
23
+ },
24
+ setup(options, nuxt) {
25
+ const resolver = createResolver(import.meta.url);
26
+ const runtimeDir = resolver.resolve("./runtime/app");
27
+ addComponent({
28
+ name: "VunoIconRenderer",
29
+ filePath: resolveModule("@nuxt/icon/runtime/components/index", { url: new URL(import.meta.url) }),
30
+ global: true
31
+ });
32
+ nuxt.options.alias["#vuno"] = runtimeDir;
33
+ nuxt.hook("prepare:types", ({ nodeTsConfig }) => {
34
+ nodeTsConfig.compilerOptions ??= {};
35
+ nodeTsConfig.compilerOptions.paths ??= {};
36
+ nodeTsConfig.compilerOptions.paths["#vuno"] = [runtimeDir];
37
+ nodeTsConfig.compilerOptions.paths["#vuno/*"] = [`${runtimeDir}/*`];
38
+ });
39
+ addTypeTemplate({
40
+ filename: "types/vuno-page-meta.d.ts",
41
+ getContents: () => `declare module '#app' {
42
+ interface PageMeta {
43
+ /** T\xEDtulo de la p\xE1gina disponible tambi\xE9n mediante \`route.meta.title\`. */
44
+ title?: string
45
+ /** \xCDndice declarativo disponible durante el render del servidor. */
46
+ toc?: import('@groupteknology/vuno').VunoNavigationTocItem[]
47
+ }
48
+ }
14
49
 
15
- /** @type {import("/woodpecker/src/github.com/groupteknology/vuno/packages/core/src/module.js")} */
16
- const _module = await jiti.import("/woodpecker/src/github.com/groupteknology/vuno/packages/core/src/module.ts");
50
+ export {}
51
+ `
52
+ });
53
+ addComponentsDir({
54
+ global: true,
55
+ ignore: ["**/internal/**"],
56
+ path: resolver.resolve("./runtime/app/components"),
57
+ pathPrefix: false,
58
+ prefix: options.prefix
59
+ });
60
+ nuxt.hook("components:extend", (components) => {
61
+ for (const component of components) {
62
+ const path = component.filePath.split("\\").join("/");
63
+ if (path.includes("/components/modal/")) component.global = true;
64
+ }
65
+ });
66
+ addImportsDir(resolver.resolve("./runtime/app/composables"));
67
+ if (options.vueQuery) addPlugin(resolver.resolve("./runtime/app/plugins/vue-query"));
68
+ addTemplate({
69
+ filename: "vuno.css",
70
+ write: true,
71
+ // `sep` en vez de un literal: en Windows `srcDir` llega con barras
72
+ // invertidas y Tailwind no las interpreta como separador; fuera de
73
+ // Windows la sustitución no hace nada.
74
+ getContents: () => `@source '${nuxt.options.srcDir.replaceAll(sep, "/")}/**/*';`
75
+ });
76
+ if (options.tailwind && !hasTailwindPlugin(nuxt.options.vite.plugins)) addVitePlugin(tailwindcss());
77
+ nuxt.options.css.push(resolver.resolve("./runtime/app/assets/css/main.css"));
78
+ }
79
+ });
80
+ function hasTailwindPlugin(plugins) {
81
+ const flat = Array.isArray(plugins) ? plugins.flat(Infinity) : [];
82
+ return flat.some((plugin) => typeof plugin?.name === "string" && plugin.name.startsWith("@tailwindcss/vite"));
83
+ }
17
84
 
18
- export default _module?.default ?? _module;
85
+ export { module$1 as default };
@@ -0,0 +1 @@
1
+ :root{--vuno-modal-duration:180ms;--vuno-modal-ease:cubic-bezier(0.32,0.72,0,1);--vuno-backdrop:rgba(0,0,0,.5)}dialog[data-vuno-modal]{opacity:0;transform:scale(.97) translateY(.5rem);transition:opacity var(--vuno-modal-duration) var(--vuno-modal-ease),transform var(--vuno-modal-duration) var(--vuno-modal-ease),display var(--vuno-modal-duration) allow-discrete,overlay var(--vuno-modal-duration) allow-discrete}dialog[data-vuno-modal][open]{opacity:1;transform:scale(1) translateY(0)}@starting-style{dialog[data-vuno-modal][open]{opacity:0;transform:scale(.97) translateY(.5rem)}}dialog[data-vuno-modal]::backdrop{background-color:transparent;transition:background-color var(--vuno-modal-duration) var(--vuno-modal-ease),display var(--vuno-modal-duration) allow-discrete,overlay var(--vuno-modal-duration) allow-discrete}dialog[data-vuno-modal][open]::backdrop{background-color:var(--vuno-backdrop)}@starting-style{dialog[data-vuno-modal][open]::backdrop{background-color:transparent}}dialog[data-vuno-modal][data-position=end],dialog[data-vuno-modal][data-position=start]{transform:translateX(var(--vuno-panel-from))}dialog[data-vuno-modal][data-position=end]{--vuno-panel-from:100%}[dir=rtl] dialog[data-vuno-modal][data-position=end],dialog[data-vuno-modal][data-position=start]{--vuno-panel-from:-100%}[dir=rtl] dialog[data-vuno-modal][data-position=start]{--vuno-panel-from:100%}dialog[data-vuno-modal][data-position=end][open],dialog[data-vuno-modal][data-position=start][open]{transform:translateX(0)}@starting-style{dialog[data-vuno-modal][data-position=end][open],dialog[data-vuno-modal][data-position=start][open]{transform:translateX(var(--vuno-panel-from))}}dialog[data-vuno-modal].vuno-overlay-behind::backdrop,dialog[data-vuno-modal].vuno-overlay-behind[open]::backdrop{background-color:transparent}@media (prefers-reduced-motion:reduce){dialog[data-vuno-modal],dialog[data-vuno-modal]::backdrop{transition-duration:1ms}dialog[data-vuno-modal],dialog[data-vuno-modal][data-position=end],dialog[data-vuno-modal][data-position=end][open],dialog[data-vuno-modal][data-position=start],dialog[data-vuno-modal][data-position=start][open]{transform:none}}
@@ -0,0 +1 @@
1
+ @import "tailwindcss";@import "#build/vuno.css";@import "./tokens.css";@import "./theme.css";@import "./dialog.css";@source "../../**/*";
@@ -0,0 +1 @@
1
+ @import "tailwindcss";@import "./tokens.css";@import "./theme.css";
@@ -0,0 +1 @@
1
+ @theme inline{--color-vuno-primary:var(--vuno-primary);--color-vuno-primary-contrast:var(--vuno-primary-contrast);--color-vuno-secondary:var(--vuno-secondary);--color-vuno-secondary-contrast:var(--vuno-secondary-contrast);--color-vuno-neutral:var(--vuno-neutral);--color-vuno-neutral-contrast:var(--vuno-neutral-contrast);--color-vuno-surface:var(--vuno-surface);--color-vuno-surface-1:var(--vuno-surface-1);--color-vuno-surface-2:var(--vuno-surface-2);--color-vuno-surface-inverse:var(--vuno-surface-inverse);--color-vuno-strong:var(--vuno-text-strong);--color-vuno-body:var(--vuno-text-body);--color-vuno-muted:var(--vuno-text-muted);--color-vuno-subtle:var(--vuno-text-subtle);--color-vuno-inverse:var(--vuno-text-inverse);--font-sans:var(--vuno-font-sans);--font-mono:var(--vuno-font-mono);--color-vuno-border:var(--vuno-border);--color-vuno-border-strong:var(--vuno-border-strong);--color-vuno-success:var(--vuno-success);--color-vuno-success-contrast:var(--vuno-success-contrast);--color-vuno-info:var(--vuno-info);--color-vuno-info-contrast:var(--vuno-info-contrast);--color-vuno-warning:var(--vuno-warning);--color-vuno-warning-contrast:var(--vuno-warning-contrast);--color-vuno-error:var(--vuno-error);--color-vuno-error-contrast:var(--vuno-error-contrast);--container-8xl:96rem}
@@ -0,0 +1 @@
1
+ @layer base{:root{color-scheme:light;--vuno-color-white:oklch(100% 0 0);--vuno-color-slate-50:oklch(98.4% 0.003 247.858);--vuno-color-slate-100:oklch(96.8% 0.007 247.896);--vuno-color-slate-200:oklch(92.9% 0.013 255.508);--vuno-color-slate-300:oklch(86.9% 0.022 252.894);--vuno-color-slate-400:oklch(70.4% 0.04 256.788);--vuno-color-slate-500:oklch(55.4% 0.046 257.417);--vuno-color-slate-600:oklch(44.6% 0.043 257.281);--vuno-color-slate-700:oklch(37.2% 0.044 257.287);--vuno-color-slate-800:oklch(27.9% 0.041 260.031);--vuno-color-slate-900:oklch(20.8% 0.042 265.755);--vuno-color-slate-950:oklch(12.9% 0.042 264.695);--vuno-color-black:oklch(0% 0 0);--vuno-color-blue-400:oklch(70.7% 0.165 254.624);--vuno-color-blue-600:oklch(54.6% 0.245 262.881);--vuno-color-violet-400:oklch(70.2% 0.183 293.541);--vuno-color-violet-600:oklch(54.1% 0.281 293.009);--vuno-color-emerald-400:oklch(76.5% 0.177 163.223);--vuno-color-emerald-700:oklch(50.8% 0.118 165.612);--vuno-color-cyan-400:oklch(78.9% 0.154 211.53);--vuno-color-cyan-700:oklch(52% 0.105 223.128);--vuno-color-red-400:oklch(70.4% 0.191 22.216);--vuno-color-red-700:oklch(50.5% 0.213 27.518);--vuno-color-amber-300:oklch(87.9% 0.169 91.605);--vuno-color-amber-400:oklch(82.8% 0.189 84.429);--dashboard-navbar-height:64px;--dashboard-aside-width:384px;--vuno-font-sans:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;--vuno-font-mono:"JetBrains Mono",ui-monospace,"Cascadia Code","Source Code Pro",Menlo,monospace;--vuno-primary:var(--vuno-color-blue-600);--vuno-primary-contrast:var(--vuno-color-white);--vuno-secondary:var(--vuno-color-violet-600);--vuno-secondary-contrast:var(--vuno-color-white);--vuno-neutral:var(--vuno-color-slate-600);--vuno-neutral-contrast:var(--vuno-color-white);--vuno-surface:var(--vuno-color-white);--vuno-surface-1:var(--vuno-color-slate-100);--vuno-surface-2:var(--vuno-color-slate-200);--vuno-surface-inverse:var(--vuno-color-slate-900);--vuno-text-strong:var(--vuno-color-slate-900);--vuno-text-body:var(--vuno-color-slate-700);--vuno-text-muted:var(--vuno-color-slate-600);--vuno-text-subtle:var(--vuno-color-slate-400);--vuno-text-inverse:var(--vuno-color-slate-50);--vuno-border:var(--vuno-color-slate-300);--vuno-border-strong:var(--vuno-color-slate-500);--vuno-success:var(--vuno-color-emerald-700);--vuno-success-contrast:var(--vuno-color-white);--vuno-info:var(--vuno-color-cyan-700);--vuno-info-contrast:var(--vuno-color-white);--vuno-warning:var(--vuno-color-amber-400);--vuno-warning-contrast:var(--vuno-color-slate-900);--vuno-error:var(--vuno-color-red-700);--vuno-error-contrast:var(--vuno-color-white)}.dark{color-scheme:dark;--vuno-primary:var(--vuno-color-blue-400);--vuno-primary-contrast:var(--vuno-color-slate-950);--vuno-secondary:var(--vuno-color-violet-400);--vuno-secondary-contrast:var(--vuno-color-slate-950);--vuno-neutral:var(--vuno-color-slate-400);--vuno-neutral-contrast:var(--vuno-color-slate-950);--vuno-surface:var(--vuno-color-black);--vuno-surface-1:var(--vuno-color-slate-900);--vuno-surface-2:var(--vuno-color-slate-800);--vuno-surface-inverse:var(--vuno-color-slate-50);--vuno-text-strong:var(--vuno-color-white);--vuno-text-body:var(--vuno-color-slate-200);--vuno-text-muted:var(--vuno-color-slate-400);--vuno-text-subtle:var(--vuno-color-slate-500);--vuno-text-inverse:var(--vuno-color-slate-900);--vuno-border:var(--vuno-color-slate-700);--vuno-border-strong:var(--vuno-color-slate-500);--vuno-success:var(--vuno-color-emerald-400);--vuno-success-contrast:var(--vuno-color-slate-950);--vuno-info:var(--vuno-color-cyan-400);--vuno-info-contrast:var(--vuno-color-slate-950);--vuno-warning:var(--vuno-color-amber-300);--vuno-warning-contrast:var(--vuno-color-slate-950);--vuno-error:var(--vuno-color-red-400);--vuno-error-contrast:var(--vuno-color-slate-950)}html{scrollbar-gutter:stable}body{background-color:var(--vuno-surface);color:var(--vuno-text-body);font-family:var(--vuno-font-sans);font-optical-sizing:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}}
@@ -0,0 +1,20 @@
1
+ import type { VunoAlertProps } from '#vuno/types/alert';
2
+ import type { VunoColor } from '#vuno/types/base';
3
+ type __VLS_Slots = {
4
+ /** Acciones relacionadas con el aviso. */
5
+ actions?: () => unknown;
6
+ /** Contenido que sustituye a `description`. */
7
+ default?: () => unknown;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<VunoAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoAlertProps> & Readonly<{}>, {
10
+ color: VunoColor;
11
+ role: "alert" | "status";
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,13 @@
1
+ export declare const alertTheme: Record<"alert", {
2
+ readonly slots: {
3
+ readonly actions: "mt-3 flex flex-wrap items-center gap-2 empty:hidden";
4
+ readonly body: "min-w-0 flex-1";
5
+ readonly description: "mt-1 text-sm text-vuno-body";
6
+ readonly icon: "size-5 shrink-0 self-center text-(--vuno-accent)";
7
+ readonly root: "flex w-full items-start gap-3 rounded-sm bg-(--vuno-accent)/10 p-4 ring-1 ring-(--vuno-accent)/25 ring-inset";
8
+ readonly title: "font-medium text-vuno-strong";
9
+ };
10
+ readonly variants: {
11
+ readonly color: Record<import("../../types/base.js").VunoColor, Record<"root", string>>;
12
+ };
13
+ }>;
@@ -0,0 +1,13 @@
1
+ import { accentByColor } from "#vuno/theme/shared";
2
+ import { defineTheme } from "#vuno/utils/theme";
3
+ export const alertTheme = defineTheme("alert", {
4
+ slots: {
5
+ actions: "mt-3 flex flex-wrap items-center gap-2 empty:hidden",
6
+ body: "min-w-0 flex-1",
7
+ description: "mt-1 text-sm text-vuno-body",
8
+ icon: "size-5 shrink-0 self-center text-(--vuno-accent)",
9
+ root: "flex w-full items-start gap-3 rounded-sm bg-(--vuno-accent)/10 p-4 ring-1 ring-(--vuno-accent)/25 ring-inset",
10
+ title: "font-medium text-vuno-strong"
11
+ },
12
+ variants: { color: accentByColor("root") }
13
+ });
@@ -0,0 +1,59 @@
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { useIcons, useTheme } from "#vuno/composables/useTheme";
4
+ import Icon from "#vuno/components/Icon/Icon.vue";
5
+ defineOptions({ name: "VunoAlert" });
6
+ const props = defineProps({
7
+ color: { type: String, required: false, default: "info" },
8
+ description: { type: String, required: false },
9
+ icon: { type: [null, String], required: false },
10
+ role: { type: String, required: false, default: "status" },
11
+ title: { type: String, required: true },
12
+ ui: { type: Object, required: false }
13
+ });
14
+ defineSlots();
15
+ const icons = useIcons();
16
+ const defaultIcons = {
17
+ error: icons.value.notifyError,
18
+ info: icons.value.notifyInfo,
19
+ neutral: icons.value.notifyInfo,
20
+ primary: icons.value.notifyInfo,
21
+ secondary: icons.value.notifyInfo,
22
+ success: icons.value.notifySuccess,
23
+ warning: icons.value.notifyWarning
24
+ };
25
+ const iconName = computed(() => props.icon === null ? void 0 : props.icon ?? defaultIcons[props.color]);
26
+ const ui = useTheme(
27
+ "alert",
28
+ () => props.ui,
29
+ () => ({ color: props.color })
30
+ );
31
+ </script>
32
+
33
+ <template>
34
+ <div
35
+ :class="ui.root"
36
+ :role="props.role"
37
+ >
38
+ <Icon
39
+ v-if="iconName"
40
+ :class="ui.icon"
41
+ :name="iconName"
42
+ />
43
+
44
+ <div :class="ui.body">
45
+ <p :class="ui.title">{{ props.title }}</p>
46
+
47
+ <div
48
+ v-if="props.description || $slots.default"
49
+ :class="ui.description"
50
+ >
51
+ <slot>{{ props.description }}</slot>
52
+ </div>
53
+
54
+ <div :class="ui.actions">
55
+ <slot name="actions" />
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </template>
@@ -0,0 +1,20 @@
1
+ import type { VunoAlertProps } from '#vuno/types/alert';
2
+ import type { VunoColor } from '#vuno/types/base';
3
+ type __VLS_Slots = {
4
+ /** Acciones relacionadas con el aviso. */
5
+ actions?: () => unknown;
6
+ /** Contenido que sustituye a `description`. */
7
+ default?: () => unknown;
8
+ };
9
+ declare const __VLS_base: import("vue").DefineComponent<VunoAlertProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<VunoAlertProps> & Readonly<{}>, {
10
+ color: VunoColor;
11
+ role: "alert" | "status";
12
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
16
+ type __VLS_WithSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
@@ -0,0 +1,52 @@
1
+ import { type Component } from 'vue';
2
+ import type { VunoAlertRequest, VunoConfirmRequest, VunoNotifyRequest } from '#vuno/types/app';
3
+ /**
4
+ * Raíz del módulo: provee el contexto global, aloja los overlays y la pila
5
+ * de notificaciones.
6
+ *
7
+ * Monta directamente todo lo que necesitan las piezas del módulo.
8
+ */
9
+ type Props = {
10
+ /**
11
+ * Dirección de lectura.
12
+ *
13
+ * Se provee a los componentes que la necesitan —hoy solo las
14
+ * pestañas, para invertir sus flechas— y se pone además en el
15
+ * elemento, que es de donde la lee el navegador para el texto y
16
+ * para las propiedades lógicas del CSS.
17
+ */
18
+ dir?: 'ltr' | 'rtl';
19
+ };
20
+ /**
21
+ * Monta un componente y espera a que emita `close`.
22
+ *
23
+ * Cerrar con Escape o pulsando fuera cuenta como cerrar sin resultado: un
24
+ * `update:open` en falso resuelve igual, porque si no la promesa se quedaría
25
+ * esperando para siempre a un diálogo que ya no está en pantalla.
26
+ */
27
+ declare function open<TResult = unknown>(component: Component, props?: Record<string, unknown>): Promise<TResult | undefined>;
28
+ declare function closeAll(): void;
29
+ declare function dismiss(id: number): void;
30
+ declare function notify(request: VunoNotifyRequest): number;
31
+ declare var __VLS_1: {};
32
+ type __VLS_Slots = {} & {
33
+ default?: (props: typeof __VLS_1) => any;
34
+ };
35
+ declare const __VLS_base: import("vue").DefineComponent<Props, {
36
+ alert: (request: VunoAlertRequest) => Promise<void>;
37
+ closeAll: typeof closeAll;
38
+ confirm: (request: VunoConfirmRequest) => Promise<boolean>;
39
+ dismiss: typeof dismiss;
40
+ notify: typeof notify;
41
+ open: typeof open;
42
+ }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
43
+ dir: "ltr" | "rtl";
44
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
45
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
46
+ declare const _default: typeof __VLS_export;
47
+ export default _default;
48
+ type __VLS_WithSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -0,0 +1,150 @@
1
+ <script setup>
2
+ import { markRaw, onBeforeUnmount, provide, reactive, shallowReactive } from "vue";
3
+ import { vunoContextInjectionKey, vunoDirectionInjectionKey } from "#vuno/internal/keys";
4
+ import Overlay from "#vuno/components/App/internal/Overlay/Overlay.vue";
5
+ import Toaster from "#vuno/components/App/internal/Toaster/Toaster.vue";
6
+ import Confirm from "#vuno/components/Confirm/Confirm.vue";
7
+ defineOptions({ name: "VunoApp" });
8
+ const props = defineProps({
9
+ dir: { type: String, required: false, default: "ltr" }
10
+ });
11
+ const notifications = shallowReactive([]);
12
+ const overlays = reactive([]);
13
+ let nextId = 0;
14
+ const EXIT_MS = 220;
15
+ function removeOverlay(id) {
16
+ const index = overlays.findIndex((entry) => entry.id === id);
17
+ if (index !== -1) overlays.splice(index, 1);
18
+ }
19
+ function dismissOverlay(id) {
20
+ const entry = overlays.find((item) => item.id === id);
21
+ if (entry) entry.open = false;
22
+ setTimeout(() => removeOverlay(id), EXIT_MS);
23
+ }
24
+ function open(component, props2 = {}) {
25
+ return new Promise((resolve) => {
26
+ const id = nextId++;
27
+ let settled = false;
28
+ const settle = (value) => {
29
+ if (settled) return;
30
+ settled = true;
31
+ resolve(value);
32
+ dismissOverlay(id);
33
+ };
34
+ overlays.push({
35
+ id,
36
+ // El registro es reactivo en profundidad para poder animar la
37
+ // salida, y eso alcanzaría también al componente: envolverlo en
38
+ // un proxy no sirve de nada y Vue avisa de ello.
39
+ component: markRaw(component),
40
+ listeners: {
41
+ close: (value) => settle(value),
42
+ /**
43
+ * Se aplaza una microtarea porque lo normal dentro del modal
44
+ * es cerrar y luego emitir el resultado:
45
+ *
46
+ * ```ts
47
+ * open.value = false
48
+ * emit('close', true)
49
+ * ```
50
+ *
51
+ * Resolver aquí en el acto se quedaría con el primero de los
52
+ * dos y devolvería `undefined` habiendo un resultado. Con el
53
+ * aplazamiento, un `close` síncrono llega antes y gana; si no
54
+ * llega ninguno —Escape, pulsar fuera—, resuelve sin valor.
55
+ */
56
+ "update:open": (value) => {
57
+ if (!value) queueMicrotask(() => settle(void 0));
58
+ }
59
+ },
60
+ open: true,
61
+ props: { ...props2 }
62
+ });
63
+ });
64
+ }
65
+ function askConfirm(request, dismissed) {
66
+ return new Promise((resolve) => {
67
+ const id = nextId++;
68
+ let settled = false;
69
+ const settle = (value) => {
70
+ if (settled) return;
71
+ settled = true;
72
+ resolve(value);
73
+ dismissOverlay(id);
74
+ };
75
+ overlays.push({
76
+ id,
77
+ component: markRaw(Confirm),
78
+ listeners: {
79
+ cancel: () => settle(false),
80
+ confirm: () => settle(true),
81
+ // Escape o pulsar fuera: en una confirmación es que no, y en
82
+ // una alerta es que ya se enteró.
83
+ "update:open": (value) => {
84
+ if (!value) settle(dismissed);
85
+ }
86
+ },
87
+ open: true,
88
+ props: { ...request }
89
+ });
90
+ });
91
+ }
92
+ const confirm = (request) => askConfirm(request, false);
93
+ const alert = async (request) => {
94
+ await askConfirm({ ...request, alert: true }, true);
95
+ };
96
+ function closeAll() {
97
+ for (const entry of [...overlays]) (entry.listeners.cancel ?? entry.listeners.close)?.();
98
+ }
99
+ const timers = /* @__PURE__ */ new Map();
100
+ function dismiss(id) {
101
+ const timer = timers.get(id);
102
+ if (timer) {
103
+ clearTimeout(timer);
104
+ timers.delete(id);
105
+ }
106
+ const index = notifications.findIndex((entry) => entry.id === id);
107
+ if (index !== -1) notifications.splice(index, 1);
108
+ }
109
+ function notify(request) {
110
+ const id = nextId++;
111
+ const duration = request.duration ?? 5e3;
112
+ notifications.push({ ...request, id, color: request.color ?? "neutral", duration });
113
+ if (duration > 0)
114
+ timers.set(
115
+ id,
116
+ setTimeout(() => dismiss(id), duration)
117
+ );
118
+ return id;
119
+ }
120
+ onBeforeUnmount(() => {
121
+ for (const timer of timers.values()) clearTimeout(timer);
122
+ timers.clear();
123
+ });
124
+ const context = { alert, closeAll, confirm, dismiss, notifications, notify, open, overlays };
125
+ provide(vunoDirectionInjectionKey, () => props.dir);
126
+ provide(vunoContextInjectionKey, context);
127
+ defineExpose({ alert, closeAll, confirm, dismiss, notify, open });
128
+ </script>
129
+
130
+ <template>
131
+ <!--
132
+ La dirección de lectura se pone en el elemento —de donde la lee el
133
+ navegador— y se provee además a los componentes que la necesitan.
134
+ Vue aporta un `useId` estable que Nuxt conserva entre servidor y cliente.
135
+
136
+ El `div` es la única forma de llevar el `dir` sin pedirle nada al
137
+ proyecto. No pinta: no tiene clase ni estilo, así que el hijo se
138
+ comporta igual que si colgara del padre.
139
+ -->
140
+ <div :dir="props.dir">
141
+ <slot />
142
+
143
+ <Overlay :overlays="overlays" />
144
+
145
+ <Toaster
146
+ :notifications="notifications"
147
+ @dismiss="dismiss"
148
+ />
149
+ </div>
150
+ </template>