@maz-ui/mcp 5.0.1-beta.0 → 5.1.0-beta.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 (343) hide show
  1. package/README.md +61 -228
  2. package/bin/maz-ui-mcp.mjs +2 -5
  3. package/dist/cli.d.mts +7 -0
  4. package/dist/cli.d.ts +7 -0
  5. package/dist/cli.mjs +14 -0
  6. package/dist/index.d.mts +340 -0
  7. package/dist/index.d.ts +340 -0
  8. package/dist/index.mjs +14 -0
  9. package/dist/shared/mcp.DzqVbCaL.mjs +2346 -0
  10. package/docs/README.md +207 -0
  11. package/docs/agents/agents-md.md +52 -0
  12. package/docs/agents/claude-rule.md +52 -0
  13. package/docs/components/maz-accordion.md +76 -0
  14. package/docs/{src/components → components}/maz-alert.md +31 -164
  15. package/docs/components/maz-animated-counter.md +87 -0
  16. package/docs/components/maz-animated-element.md +46 -0
  17. package/docs/components/maz-animated-text.md +53 -0
  18. package/docs/components/maz-avatar.md +193 -0
  19. package/docs/components/maz-backdrop.md +178 -0
  20. package/docs/{src/components → components}/maz-badge.md +26 -67
  21. package/docs/components/maz-bottom-sheet.md +257 -0
  22. package/docs/{src/components → components}/maz-btn-group.md +26 -189
  23. package/docs/{src/components → components}/maz-btn.md +60 -245
  24. package/docs/components/maz-card-spotlight.md +84 -0
  25. package/docs/{src/components → components}/maz-card.md +67 -192
  26. package/docs/components/maz-carousel.md +153 -0
  27. package/docs/{src/components → components}/maz-chart.md +17 -161
  28. package/docs/components/maz-checkbox.md +138 -0
  29. package/docs/components/maz-checklist.md +251 -0
  30. package/docs/components/maz-circular-progress-bar.md +109 -0
  31. package/docs/{src/components → components}/maz-code-highlight.md +15 -93
  32. package/docs/components/maz-container.md +241 -0
  33. package/docs/{src/components → components}/maz-date-picker.md +85 -454
  34. package/docs/components/maz-dialog-confirm.md +215 -0
  35. package/docs/components/maz-dialog.md +143 -0
  36. package/docs/components/maz-drawer.md +106 -0
  37. package/docs/components/maz-dropdown.md +419 -0
  38. package/docs/{src/components → components}/maz-dropzone.md +80 -221
  39. package/docs/components/maz-expand-animation.md +82 -0
  40. package/docs/components/maz-fullscreen-loader.md +58 -0
  41. package/docs/components/maz-gallery.md +79 -0
  42. package/docs/{src/components → components}/maz-icon.md +32 -83
  43. package/docs/components/maz-input-code.md +73 -0
  44. package/docs/components/maz-input-number.md +79 -0
  45. package/docs/components/maz-input-phone-number.md +536 -0
  46. package/docs/components/maz-input-price.md +68 -0
  47. package/docs/components/maz-input-tags.md +112 -0
  48. package/docs/{src/components → components}/maz-input.md +74 -221
  49. package/docs/components/maz-lazy-img.md +113 -0
  50. package/docs/components/maz-link.md +146 -0
  51. package/docs/components/maz-loading-bar.md +38 -0
  52. package/docs/{src/components → components}/maz-markdown-editor.md +72 -125
  53. package/docs/components/maz-pagination.md +82 -0
  54. package/docs/components/maz-popover.md +794 -0
  55. package/docs/{src/components → components}/maz-pull-to-refresh.md +59 -45
  56. package/docs/components/maz-radio-buttons.md +313 -0
  57. package/docs/components/maz-radio.md +119 -0
  58. package/docs/{src/components → components}/maz-read-more.md +31 -122
  59. package/docs/components/maz-reading-progress-bar.md +96 -0
  60. package/docs/{src/components → components}/maz-select-country.md +80 -340
  61. package/docs/{src/components → components}/maz-select.md +76 -206
  62. package/docs/components/maz-sidebar-content.md +25 -0
  63. package/docs/components/maz-sidebar-footer.md +25 -0
  64. package/docs/components/maz-sidebar-group.md +27 -0
  65. package/docs/components/maz-sidebar-header.md +25 -0
  66. package/docs/components/maz-sidebar-menu-button.md +41 -0
  67. package/docs/components/maz-sidebar-menu-item.md +25 -0
  68. package/docs/components/maz-sidebar-menu-sub.md +32 -0
  69. package/docs/components/maz-sidebar-menu.md +25 -0
  70. package/docs/components/maz-sidebar-separator.md +21 -0
  71. package/docs/components/maz-sidebar-trigger.md +25 -0
  72. package/docs/{src/components → components}/maz-sidebar.md +117 -329
  73. package/docs/{src/components → components}/maz-skeleton.md +27 -156
  74. package/docs/{src/components → components}/maz-slider.md +33 -66
  75. package/docs/components/maz-spinner.md +84 -0
  76. package/docs/{src/components → components}/maz-stepper.md +43 -185
  77. package/docs/components/maz-switch.md +86 -0
  78. package/docs/components/maz-table-cell.md +27 -0
  79. package/docs/components/maz-table-row.md +28 -0
  80. package/docs/components/maz-table-title.md +27 -0
  81. package/docs/components/maz-table-virtualizer.md +31 -0
  82. package/docs/components/maz-table.md +426 -0
  83. package/docs/components/maz-tabs-bar.md +43 -0
  84. package/docs/components/maz-tabs-content-item.md +27 -0
  85. package/docs/components/maz-tabs-content.md +27 -0
  86. package/docs/{src/components → components}/maz-tabs.md +89 -126
  87. package/docs/components/maz-textarea.md +255 -0
  88. package/docs/components/maz-ticker.md +427 -0
  89. package/docs/components/maz-timeline.md +304 -0
  90. package/docs/components/maz-ui-provider.md +26 -0
  91. package/docs/{src/components → components}/maz-window-mockup.md +38 -105
  92. package/docs/composables/use-aos.md +41 -0
  93. package/docs/composables/use-breakpoints.md +42 -0
  94. package/docs/composables/use-dialog.md +58 -0
  95. package/docs/{src/composables → composables}/use-display-names.md +12 -59
  96. package/docs/{src/composables → composables}/use-drag.md +14 -68
  97. package/docs/{src/composables → composables}/use-form-validator.md +22 -696
  98. package/docs/{src/composables → composables}/use-idle-timeout.md +13 -97
  99. package/docs/{src/composables → composables}/use-pull-to-refresh.md +14 -7
  100. package/docs/{src/composables → composables}/use-reading-time.md +20 -56
  101. package/docs/composables/use-string-matching.md +41 -0
  102. package/docs/{src/composables → composables}/use-swipe.md +14 -81
  103. package/docs/{src/composables → composables}/use-timer.md +12 -38
  104. package/docs/composables/use-toast.md +50 -0
  105. package/docs/{src/composables → composables}/use-user-visibility.md +14 -56
  106. package/docs/composables/use-wait.md +50 -0
  107. package/docs/composables/use-window-size.md +25 -0
  108. package/docs/{src/directives → directives}/click-outside.md +13 -99
  109. package/docs/{src/directives → directives}/fullscreen-img.md +10 -28
  110. package/docs/{src/directives → directives}/lazy-img.md +14 -49
  111. package/docs/{src/directives → directives}/tooltip.md +12 -217
  112. package/docs/{src/directives → directives}/zoom-img.md +11 -38
  113. package/docs/{src/ecosystem → ecosystem}/eslint-config.md +37 -29
  114. package/docs/ecosystem/icons/icon-set.md +25 -0
  115. package/docs/{src/ecosystem → ecosystem}/icons/index.md +22 -16
  116. package/docs/ecosystem/mcp.md +165 -0
  117. package/docs/{src/ecosystem → ecosystem}/node/exec-promise.md +12 -6
  118. package/docs/ecosystem/node/index.md +53 -0
  119. package/docs/{src/ecosystem → ecosystem}/node/logger.md +12 -6
  120. package/docs/{src/ecosystem → ecosystem}/node/print-banner.md +12 -4
  121. package/docs/ecosystem/node/setup-agents.md +102 -0
  122. package/docs/{src/ecosystem → ecosystem}/nuxt.md +46 -19
  123. package/docs/{src/ecosystem → ecosystem}/stylelint-config.md +33 -25
  124. package/docs/{src/ecosystem → ecosystem}/themes.md +72 -235
  125. package/docs/{src/ecosystem → ecosystem}/translations.md +25 -23
  126. package/docs/ecosystem/utils/camel-case.md +37 -0
  127. package/docs/ecosystem/utils/capitalize.md +37 -0
  128. package/docs/{src/ecosystem → ecosystem}/utils/check-availability.md +14 -8
  129. package/docs/{src/ecosystem → ecosystem}/utils/cookie.md +18 -12
  130. package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
  131. package/docs/{src/ecosystem → ecosystem}/utils/currency.md +12 -26
  132. package/docs/{src/ecosystem → ecosystem}/utils/date.md +10 -24
  133. package/docs/ecosystem/utils/debounce-callback.md +44 -0
  134. package/docs/{src/ecosystem → ecosystem}/utils/debounce-id.md +14 -8
  135. package/docs/{src/ecosystem → ecosystem}/utils/debounce.md +14 -8
  136. package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
  137. package/docs/{src/ecosystem → ecosystem}/utils/format-json.md +11 -5
  138. package/docs/{src/ecosystem → ecosystem}/utils/format-phone-number.md +12 -6
  139. package/docs/ecosystem/utils/get-browser-locale.md +35 -0
  140. package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
  141. package/docs/{src/ecosystem → ecosystem}/utils/get-error-message.md +10 -4
  142. package/docs/{src/ecosystem → ecosystem}/utils/idle-timeout.md +15 -9
  143. package/docs/{src/ecosystem → ecosystem}/utils/index.md +10 -13
  144. package/docs/{src/ecosystem → ecosystem}/utils/is-client.md +11 -5
  145. package/docs/{src/ecosystem → ecosystem}/utils/is-equal.md +14 -8
  146. package/docs/{src/ecosystem → ecosystem}/utils/is-ios.md +12 -6
  147. package/docs/ecosystem/utils/is-server.md +37 -0
  148. package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
  149. package/docs/{src/ecosystem → ecosystem}/utils/kebab-case.md +10 -4
  150. package/docs/{src/ecosystem → ecosystem}/utils/normalize-string.md +10 -4
  151. package/docs/{src/ecosystem → ecosystem}/utils/number.md +10 -24
  152. package/docs/{src/ecosystem → ecosystem}/utils/pascal-case.md +11 -5
  153. package/docs/{src/ecosystem → ecosystem}/utils/prevent-ios-input-zoom.md +14 -8
  154. package/docs/{src/ecosystem → ecosystem}/utils/script-loader.md +16 -8
  155. package/docs/{src/ecosystem → ecosystem}/utils/sleep.md +10 -4
  156. package/docs/{src/ecosystem → ecosystem}/utils/snake-case.md +10 -4
  157. package/docs/{src/ecosystem → ecosystem}/utils/swipe-handler.md +14 -8
  158. package/docs/{src/ecosystem → ecosystem}/utils/textarea-autogrow.md +12 -6
  159. package/docs/{src/ecosystem → ecosystem}/utils/throttle-id.md +13 -7
  160. package/docs/{src/ecosystem → ecosystem}/utils/throttle.md +14 -8
  161. package/docs/ecosystem/utils/truthy-filter.md +37 -0
  162. package/docs/{src/ecosystem → ecosystem}/utils/types/deep-key-of.md +11 -5
  163. package/docs/{src/ecosystem → ecosystem}/utils/types/deep-partial.md +10 -4
  164. package/docs/ecosystem/utils/types/deep-required.md +45 -0
  165. package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
  166. package/docs/{src/ecosystem → ecosystem}/utils/types/generic-instance-type.md +10 -4
  167. package/docs/{src/ecosystem → ecosystem}/utils/types/infer-maybe-ref.md +10 -4
  168. package/docs/ecosystem/utils/upper-first.md +38 -0
  169. package/docs/{src/ecosystem → ecosystem}/utils/user-visibility.md +12 -6
  170. package/docs/guide/ai-agents.md +237 -0
  171. package/docs/{src/guide → guide}/browser-support.md +22 -15
  172. package/docs/{src/guide → guide}/getting-started.md +34 -139
  173. package/docs/{src/guide → guide}/global-defaults.md +12 -11
  174. package/docs/{src/guide → guide}/maz-ui-provider.md +17 -16
  175. package/docs/{src/guide → guide}/migration-v5.md +95 -88
  176. package/docs/{src/guide → guide}/resolvers.md +33 -100
  177. package/docs/guide/tailwind.md +483 -0
  178. package/docs/{src/guide → guide}/vue.md +33 -39
  179. package/docs/manifest.json +1 -0
  180. package/docs/{src/plugins → plugins}/aos.md +20 -55
  181. package/docs/{src/plugins → plugins}/dialog.md +14 -161
  182. package/docs/plugins/toast.md +221 -0
  183. package/docs/plugins/wait.md +78 -0
  184. package/docs/reference/icons.md +46 -0
  185. package/docs/reference/tailwind-tokens.md +191 -0
  186. package/docs/rules.md +57 -0
  187. package/package.json +84 -22
  188. package/dist/mcp.d.mts +0 -153
  189. package/dist/mcp.d.ts +0 -153
  190. package/dist/mcp.mjs +0 -1511
  191. package/docs/generated-docs/maz-accordion.doc.md +0 -21
  192. package/docs/generated-docs/maz-alert.doc.md +0 -20
  193. package/docs/generated-docs/maz-animated-counter.doc.md +0 -17
  194. package/docs/generated-docs/maz-animated-element.doc.md +0 -14
  195. package/docs/generated-docs/maz-animated-text.doc.md +0 -17
  196. package/docs/generated-docs/maz-avatar.doc.md +0 -45
  197. package/docs/generated-docs/maz-backdrop.doc.md +0 -55
  198. package/docs/generated-docs/maz-badge.doc.md +0 -16
  199. package/docs/generated-docs/maz-bottom-sheet.doc.md +0 -24
  200. package/docs/generated-docs/maz-btn-group.doc.md +0 -20
  201. package/docs/generated-docs/maz-btn.doc.md +0 -33
  202. package/docs/generated-docs/maz-card-spotlight.doc.md +0 -16
  203. package/docs/generated-docs/maz-card.doc.md +0 -39
  204. package/docs/generated-docs/maz-carousel.doc.md +0 -17
  205. package/docs/generated-docs/maz-chart.doc.md +0 -10
  206. package/docs/generated-docs/maz-checkbox.doc.md +0 -33
  207. package/docs/generated-docs/maz-checklist.doc.md +0 -30
  208. package/docs/generated-docs/maz-circular-progress-bar.doc.md +0 -27
  209. package/docs/generated-docs/maz-code-highlight.doc.md +0 -11
  210. package/docs/generated-docs/maz-container.doc.md +0 -26
  211. package/docs/generated-docs/maz-date-picker.doc.md +0 -56
  212. package/docs/generated-docs/maz-dialog-confirm.doc.md +0 -24
  213. package/docs/generated-docs/maz-dialog.doc.md +0 -22
  214. package/docs/generated-docs/maz-drawer.doc.md +0 -25
  215. package/docs/generated-docs/maz-dropdown.doc.md +0 -45
  216. package/docs/generated-docs/maz-dropzone.doc.md +0 -82
  217. package/docs/generated-docs/maz-expand-animation.doc.md +0 -12
  218. package/docs/generated-docs/maz-fullscreen-loader.doc.md +0 -13
  219. package/docs/generated-docs/maz-gallery.doc.md +0 -17
  220. package/docs/generated-docs/maz-icon.doc.md +0 -16
  221. package/docs/generated-docs/maz-input-code.doc.md +0 -25
  222. package/docs/generated-docs/maz-input-number.doc.md +0 -33
  223. package/docs/generated-docs/maz-input-phone-number.doc.md +0 -62
  224. package/docs/generated-docs/maz-input-price.doc.md +0 -26
  225. package/docs/generated-docs/maz-input-tags.doc.md +0 -24
  226. package/docs/generated-docs/maz-input.doc.md +0 -54
  227. package/docs/generated-docs/maz-lazy-img.doc.md +0 -49
  228. package/docs/generated-docs/maz-link.doc.md +0 -31
  229. package/docs/generated-docs/maz-loading-bar.doc.md +0 -6
  230. package/docs/generated-docs/maz-markdown-editor.doc.md +0 -65
  231. package/docs/generated-docs/maz-pagination.doc.md +0 -21
  232. package/docs/generated-docs/maz-popover.doc.md +0 -79
  233. package/docs/generated-docs/maz-pull-to-refresh.doc.md +0 -50
  234. package/docs/generated-docs/maz-radio-buttons.doc.md +0 -34
  235. package/docs/generated-docs/maz-radio.doc.md +0 -33
  236. package/docs/generated-docs/maz-read-more.doc.md +0 -18
  237. package/docs/generated-docs/maz-reading-progress-bar.doc.md +0 -18
  238. package/docs/generated-docs/maz-select-country.doc.md +0 -45
  239. package/docs/generated-docs/maz-select.doc.md +0 -32
  240. package/docs/generated-docs/maz-sidebar-content.doc.md +0 -5
  241. package/docs/generated-docs/maz-sidebar-footer.doc.md +0 -5
  242. package/docs/generated-docs/maz-sidebar-group.doc.md +0 -11
  243. package/docs/generated-docs/maz-sidebar-header.doc.md +0 -5
  244. package/docs/generated-docs/maz-sidebar-menu-button.doc.md +0 -27
  245. package/docs/generated-docs/maz-sidebar-menu-item.doc.md +0 -5
  246. package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +0 -16
  247. package/docs/generated-docs/maz-sidebar-menu.doc.md +0 -5
  248. package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
  249. package/docs/generated-docs/maz-sidebar-trigger.doc.md +0 -5
  250. package/docs/generated-docs/maz-sidebar.doc.md +0 -36
  251. package/docs/generated-docs/maz-skeleton.doc.md +0 -12
  252. package/docs/generated-docs/maz-slider.doc.md +0 -20
  253. package/docs/generated-docs/maz-spinner.doc.md +0 -6
  254. package/docs/generated-docs/maz-stepper.doc.md +0 -30
  255. package/docs/generated-docs/maz-switch.doc.md +0 -31
  256. package/docs/generated-docs/maz-table-cell.doc.md +0 -5
  257. package/docs/generated-docs/maz-table-row.doc.md +0 -12
  258. package/docs/generated-docs/maz-table-title.doc.md +0 -5
  259. package/docs/generated-docs/maz-table-virtualizer.doc.md +0 -20
  260. package/docs/generated-docs/maz-table.doc.md +0 -72
  261. package/docs/generated-docs/maz-tabs-bar.doc.md +0 -29
  262. package/docs/generated-docs/maz-tabs-content-item.doc.md +0 -11
  263. package/docs/generated-docs/maz-tabs-content.doc.md +0 -5
  264. package/docs/generated-docs/maz-tabs.doc.md +0 -20
  265. package/docs/generated-docs/maz-textarea.doc.md +0 -46
  266. package/docs/generated-docs/maz-ticker.doc.md +0 -25
  267. package/docs/generated-docs/maz-timeline.doc.md +0 -32
  268. package/docs/generated-docs/maz-ui-provider.doc.md +0 -12
  269. package/docs/generated-docs/maz-window-mockup.doc.md +0 -23
  270. package/docs/src/blog/v4.md +0 -276
  271. package/docs/src/blog/v5.md +0 -184
  272. package/docs/src/changelog.md +0 -7
  273. package/docs/src/components/index.md +0 -8
  274. package/docs/src/components/maz-accordion.md +0 -80
  275. package/docs/src/components/maz-animated-counter.md +0 -124
  276. package/docs/src/components/maz-animated-element.md +0 -36
  277. package/docs/src/components/maz-animated-text.md +0 -36
  278. package/docs/src/components/maz-avatar.md +0 -227
  279. package/docs/src/components/maz-backdrop.md +0 -250
  280. package/docs/src/components/maz-bottom-sheet.md +0 -533
  281. package/docs/src/components/maz-card-spotlight.md +0 -163
  282. package/docs/src/components/maz-carousel.md +0 -231
  283. package/docs/src/components/maz-checkbox.md +0 -168
  284. package/docs/src/components/maz-checklist.md +0 -414
  285. package/docs/src/components/maz-circular-progress-bar.md +0 -145
  286. package/docs/src/components/maz-container.md +0 -363
  287. package/docs/src/components/maz-dialog-confirm.md +0 -240
  288. package/docs/src/components/maz-dialog.md +0 -164
  289. package/docs/src/components/maz-drawer.md +0 -181
  290. package/docs/src/components/maz-dropdown.md +0 -691
  291. package/docs/src/components/maz-expand-animation.md +0 -99
  292. package/docs/src/components/maz-fullscreen-loader.md +0 -58
  293. package/docs/src/components/maz-gallery.md +0 -85
  294. package/docs/src/components/maz-input-code.md +0 -61
  295. package/docs/src/components/maz-input-number.md +0 -81
  296. package/docs/src/components/maz-input-phone-number.md +0 -942
  297. package/docs/src/components/maz-input-price.md +0 -67
  298. package/docs/src/components/maz-input-tags.md +0 -114
  299. package/docs/src/components/maz-lazy-img.md +0 -88
  300. package/docs/src/components/maz-link.md +0 -178
  301. package/docs/src/components/maz-loading-bar.md +0 -26
  302. package/docs/src/components/maz-pagination.md +0 -79
  303. package/docs/src/components/maz-popover.md +0 -1416
  304. package/docs/src/components/maz-radio-buttons.md +0 -462
  305. package/docs/src/components/maz-radio.md +0 -142
  306. package/docs/src/components/maz-reading-progress-bar.md +0 -74
  307. package/docs/src/components/maz-spinner.md +0 -93
  308. package/docs/src/components/maz-switch.md +0 -92
  309. package/docs/src/components/maz-table.md +0 -732
  310. package/docs/src/components/maz-textarea.md +0 -400
  311. package/docs/src/components/maz-ticker.md +0 -692
  312. package/docs/src/components/maz-timeline.md +0 -478
  313. package/docs/src/composables/use-aos.md +0 -34
  314. package/docs/src/composables/use-breakpoints.md +0 -35
  315. package/docs/src/composables/use-dialog.md +0 -88
  316. package/docs/src/composables/use-string-matching.md +0 -63
  317. package/docs/src/composables/use-toast.md +0 -71
  318. package/docs/src/composables/use-wait.md +0 -62
  319. package/docs/src/composables/use-window-size.md +0 -18
  320. package/docs/src/ecosystem/icons/icon-set.md +0 -123
  321. package/docs/src/ecosystem/mcp.md +0 -210
  322. package/docs/src/ecosystem/node/index.md +0 -53
  323. package/docs/src/ecosystem/utils/camel-case.md +0 -31
  324. package/docs/src/ecosystem/utils/capitalize.md +0 -50
  325. package/docs/src/ecosystem/utils/country-code-to-unicode-flag.md +0 -213
  326. package/docs/src/ecosystem/utils/debounce-callback.md +0 -38
  327. package/docs/src/ecosystem/utils/fetch-locale-ip.md +0 -33
  328. package/docs/src/ecosystem/utils/get-browser-locale.md +0 -29
  329. package/docs/src/ecosystem/utils/get-country-flag-url.md +0 -156
  330. package/docs/src/ecosystem/utils/is-server.md +0 -31
  331. package/docs/src/ecosystem/utils/is-standalone-mode.md +0 -43
  332. package/docs/src/ecosystem/utils/truthy-filter.md +0 -31
  333. package/docs/src/ecosystem/utils/types/deep-required.md +0 -39
  334. package/docs/src/ecosystem/utils/types/flatten-object-keys.md +0 -44
  335. package/docs/src/ecosystem/utils/upper-first.md +0 -32
  336. package/docs/src/guide/cli.md +0 -144
  337. package/docs/src/guide/migration-v4.md +0 -925
  338. package/docs/src/guide/tailwind.md +0 -158
  339. package/docs/src/index.md +0 -603
  340. package/docs/src/made-with-maz-ui.md +0 -58
  341. package/docs/src/plugins/toast.md +0 -349
  342. package/docs/src/plugins/wait.md +0 -109
  343. package/docs/src/theme-editor.md +0 -21
@@ -1,925 +0,0 @@
1
- ---
2
- title: Maz-UI v4.0.0 Migration Guide
3
- description: Complete guide to migrate from Maz-UI v3.x to v4.0.0 - Modular architecture, optimized tree-shaking, and new components
4
- ---
5
-
6
- # {{ $frontmatter.title }}
7
-
8
- Maz-UI v4.0.0 isn’t just an update — it’s a complete rebuild designed to give developers more flexibility and simplicity.
9
-
10
- The library is now split into independent packages, allowing you to install and use only what you need.\
11
- The theme system has been redesigned to make customizing and managing multiple themes easier, while the internationalization system offers full control over translations.\
12
- Performance has also been significantly improved thanks to optimal tree-shaking, more efficient minification, and a modernized architecture.
13
-
14
- ::: tip Connected to Maz-UI MCP
15
-
16
- Follow the [MCP](/ecosystem/mcp) guide to connect your AI assistant to Maz-UI's documentation for a smooth migration process.
17
-
18
- :::
19
-
20
- ## Why Migrate to v4.0.0?
21
-
22
- ### Architectural Revolution
23
-
24
- v4.0.0 isn't just an update, it's a **complete rebuild** that transforms Maz-UI into a modern and performant library:
25
-
26
- #### Optimized Tree-Shaking
27
-
28
- - **Dramatic bundle reduction**: 60-90% size reduction
29
- - **Granular imports**: Every component, composables, plugins, directive, and utility is individually importable
30
- - **Modern bundlers**: Perfect compatibility with Vite, Webpack 5, Rollup
31
-
32
- #### Modular Architecture
33
-
34
- - **Restructured monorepo**: Separation into specialized packages
35
- - **New export structure**: Modular exports for better DX
36
- - **Maximum flexibility**: Choose exactly what you need
37
-
38
- #### Advanced Theme System
39
-
40
- - **Predefined presets**: `mazUi`, `obsidian`, `ocean`, `pristine`
41
- - **Dynamic CSS Variables**: Automatic CSS variable generation
42
- - **Intelligent dark mode**: Configurable strategies for dark mode based on system preferences and user choice stored in cookies
43
-
44
- ::: tip Theming further evolved in v5
45
- The theme system has been rewritten on top of native `light-dark()` + `color-scheme` + `color-mix(in oklch)` in v5. If you are upgrading past v4, see the dedicated [v5 migration guide](./migration-v5.md#theming-native-css-rewrite-new-non-breaking-by-default) for the full theming changes (new `lightClass`, `Promise<void>` returns, removed JS helpers).
46
- :::
47
-
48
- #### Complete Internationalization
49
-
50
- - **9 supported languages by default**: EN, FR, DE, ES, IT, PT, JA, ZH-CN
51
- - **Add your own languages**: Easy integration of custom translations
52
- - **Translation system**: Vue plugin and dedicated composables
53
- - **Automatic fallback**: Smart handling of missing translations
54
-
55
- #### New Components or refactored
56
-
57
- - **MazLink**: Modern link component replacing `MazBtn variant="link"`
58
- - **MazExpandAnimation**: CSS Grid expansion animation (replaces `MazTransitionExpand`)
59
- - **MazDropzone**: Complete rewrite without external dependency
60
- - **MazPopover**: Versatile overlay component with smart positioning
61
- - **MazSelectCountry**: Country/language selector with i18n support
62
-
63
- ## New Packages
64
-
65
- v4.0.0 separates functionality into specialized packages for better modularity:
66
-
67
- ### Main Packages
68
-
69
- | Package | Description | Status |
70
- |---------|-------------|--------|
71
- | **maz-ui** | Vue components, composables, plugins | Refactored |
72
- | **@maz-ui/themes** | Theme system and presets | New |
73
- | **@maz-ui/translations** | i18n translations | New |
74
- | **@maz-ui/utils** | JavaScript/TypeScript utilities | New |
75
- | **@maz-ui/icons** | SVG icons and flags (860+ icons) | New |
76
- | **@maz-ui/cli** | CLI for theme generation | Renamed |
77
- | **@maz-ui/nuxt** | Nuxt module | New |
78
- | **@maz-ui/mcp** | MCP server for IA agent | New |
79
-
80
- ## Migration Checklist
81
-
82
- ### Step 1: Update Dependencies
83
-
84
- ```bash
85
- # Uninstall old version
86
- npm uninstall maz-ui
87
-
88
- # Install new version
89
- npm install maz-ui@4.0.0
90
-
91
- # Optional: Install specialized packages
92
- npm install @maz-ui/themes @maz-ui/translations @maz-ui/utils @maz-ui/icons
93
-
94
- # Remove external dependency no longer needed
95
- npm uninstall dropzone
96
- ```
97
-
98
- **Updated peer dependencies:**
99
- - **Vue**: `^3.5.0` (was `^3.0.0`)
100
- - **unplugin-vue-components**: `>=28.0.0`
101
- - **unplugin-auto-import**: `>=19.0.0`
102
-
103
- ### Vue users - Plugin configuration
104
-
105
- **NEW**: v4.0.0 introduces a mandatory Vue plugin for configuration.
106
-
107
- #### Before (v3.x)
108
-
109
- ```typescript
110
- // main.ts
111
- import { createApp } from 'vue'
112
- import 'maz-ui/style.css'
113
- import App from './App.vue'
114
-
115
- createApp(App).mount('#app')
116
- ```
117
-
118
- #### After (v4.0.0)
119
-
120
- ```typescript
121
- // main.ts
122
- import { createApp } from 'vue'
123
- import { MazUi } from 'maz-ui/plugins/maz-ui'
124
- import { mazUi } from '@maz-ui/themes/presets'
125
- import { fr } from '@maz-ui/translations'
126
-
127
- // Import styles before your CSS
128
- import 'maz-ui/style.css'
129
- import './style.css'
130
-
131
- import App from './App.vue'
132
-
133
- const app = createApp(App)
134
-
135
- // NEW: MazUi plugin required
136
- app.use(MazUi, {
137
- // Theme configuration (optional)
138
- theme: {
139
- preset: mazUi, // or 'ocean' | 'pristine' | 'obsidian'
140
- },
141
- // Translation configuration (optional)
142
- translations: {
143
- locale: 'fr',
144
- fallbackLocale: 'en',
145
- messages: {
146
- fr,
147
- },
148
- },
149
- })
150
-
151
- app.mount('#app')
152
- ```
153
-
154
- ### Nuxt users - Module Configuration
155
-
156
- **NEW**: Dedicated Nuxt module with simplified API.
157
-
158
- #### Before (v3.x)
159
-
160
- ```typescript
161
- // nuxt.config.ts
162
- export default defineNuxtConfig({
163
- modules: ['maz-ui/nuxt'],
164
- mazUi: {
165
- // v3 configuration
166
- }
167
- })
168
- ```
169
-
170
- #### After (v4.0.0)
171
-
172
- ```typescript
173
- // nuxt.config.ts
174
- export default defineNuxtConfig({
175
- modules: ['@maz-ui/nuxt'], // New package
176
- mazUi: {
177
- // New configuration API
178
- theme: {
179
- preset: 'maz-ui',
180
- strategy: 'runtime',
181
- darkModeStrategy: 'class',
182
- },
183
- translations: {
184
- locale: 'fr',
185
- fallbackLocale: 'en',
186
- },
187
- plugins: {
188
- aos: true,
189
- dialog: true,
190
- toast: true,
191
- wait: true,
192
- },
193
- directives: {
194
- vTooltip: true,
195
- vLazyImg: true,
196
- vClickOutside: true,
197
- },
198
- }
199
- })
200
- ```
201
-
202
- ### Import Migration
203
-
204
- **MAJOR CHANGE**: New modular import structure.
205
-
206
- #### Components
207
-
208
- **NOTE**: Component imports haven't changed - they work the same way as in v3.x.
209
-
210
- ```typescript
211
- // ✅ SAME AS v3.x - Still works
212
- import MazBtn from 'maz-ui/components/MazBtn'
213
- import MazInput from 'maz-ui/components/MazInput'
214
-
215
- // ✅ NEW - Batch imports for convenience
216
- import { MazBtn, MazInput } from 'maz-ui/components'
217
- ```
218
-
219
- #### Plugins
220
-
221
- ```typescript
222
- // ❌ BEFORE (v3.x)
223
- import { installToaster, ToastHandler } from 'maz-ui'
224
-
225
- // ✅ AFTER (v4.0.0)
226
- import { ToastPlugin, ToastHandler } from 'maz-ui/plugins'
227
- // or for maximum tree-shaking
228
- import { ToastPlugin, ToastHandler } from 'maz-ui/plugins/toast'
229
- ```
230
-
231
- #### Directives
232
-
233
- ```typescript
234
- // ❌ BEFORE (v3.x)
235
- import { vClickOutside, vTooltip } from 'maz-ui'
236
-
237
- // ✅ AFTER (v4.0.0)
238
- import { vClickOutside, vTooltip } from 'maz-ui/directives'
239
- // or for maximum tree-shaking
240
- import { vClickOutside } from 'maz-ui/directives/vClickOutside'
241
- import { vTooltip } from 'maz-ui/directives/vTooltip'
242
- ```
243
-
244
- #### Composables
245
-
246
- ```typescript
247
- // ❌ BEFORE (v3.x)
248
- import { useTimer, useToast } from 'maz-ui'
249
-
250
- // ✅ AFTER (v4.0.0)
251
- import { useTimer, useToast } from 'maz-ui/composables'
252
- // or for maximum tree-shaking
253
- import { useTimer } from 'maz-ui/composables/useTimer'
254
- import { useToast } from 'maz-ui/composables/useToast'
255
- ```
256
-
257
- #### Utilities
258
-
259
- ```typescript
260
- // ❌ BEFORE (v3.x)
261
- import { currency, date } from 'maz-ui'
262
-
263
- // ✅ AFTER (v4.0.0)
264
- import { formatCurrency, formatDate } from 'maz-ui'
265
- // or for better performance
266
- import { formatCurrency, formatDate } from '@maz-ui/utils'
267
- ```
268
-
269
- ## Component Changes
270
-
271
- ### MazBtn - Major Changes
272
-
273
- #### Removed `variant="link"`
274
-
275
- ```html
276
- <!-- ❌ BEFORE (v3.x) -->
277
- <MazBtn variant="link" href="/path">
278
- Link
279
- </MazBtn>
280
-
281
- <!-- ✅ AFTER (v4.0.0) - Use MazLink -->
282
- <MazLink href="/path">
283
- Link
284
- </MazLink>
285
-
286
- <!-- Action with click -->
287
- <MazLink @click="handleClick">
288
- Action
289
- </MazLink>
290
- ```
291
-
292
- #### Prop Changes
293
-
294
- ```html
295
- <!-- CHANGED PROPS -->
296
- <MazBtn
297
- outlined <!-- ✅ NEW: was 'outline' -->
298
- justify="space-between" <!-- 🆕 NEW: Content alignment -->
299
- :padding="false" <!-- 🆕 NEW: Padding control -->
300
- rounded-size="full" <!-- 🆕 NEW: Border radius size -->
301
- >
302
- Button
303
- </MazBtn>
304
- ```
305
-
306
- ### MazLink - New Component
307
-
308
- Replaces `MazBtn variant="link"` with a richer API:
309
-
310
- ```html
311
- <!-- ✅ NEW COMPONENT -->
312
- <MazLink
313
- href="/path"
314
- :auto-external="true" <!-- 🆕 NEW: Automatic external icon -->
315
- :underline-hover="true" <!-- 🆕 NEW: Underline on hover -->
316
- left-icon="home" <!-- 🆕 NEW: Left icon -->
317
- right-icon="arrow-right" <!-- 🆕 NEW: Right icon -->
318
- color="primary" <!-- 🆕 NEW: Custom color -->
319
- as="router-link" <!-- 🆕 NEW: Custom component -->
320
- >
321
- Link with icons
322
- </MazLink>
323
- ```
324
-
325
- ### MazPicker --> MazDatePicker
326
-
327
- MazPicker has been renamed to MazDatePicker.
328
-
329
- Props have been changed:
330
- - `no-header` --> `hide-header`
331
- - `input-date-style` --> `input-date-format`
332
-
333
- New Props:
334
- - `min-max-auto`: Control behavior when the date is in the range of min and max.
335
-
336
- ```html
337
- <MazDatePicker />
338
- ```
339
-
340
- ### MazPopover - New Component
341
-
342
- Versatile overlay component with smart positioning:
343
-
344
- ```html
345
- <!-- NEW COMPONENT -->
346
- <MazPopover
347
- trigger="click" <!-- 🆕 NEW: Trigger mode -->
348
- position="bottom-start" <!-- 🆕 NEW: Smart positioning -->
349
- :persistent="true" <!-- 🆕 NEW: Keep open for interactions -->
350
- role="dialog" <!-- 🆕 NEW: Accessibility role -->
351
- >
352
- <template #trigger>
353
- <MazBtn>Open Popover</MazBtn>
354
- </template>
355
-
356
- <template #default>
357
- <div class="p-4">
358
- Popover content
359
- </div>
360
- </template>
361
- </MazPopover>
362
- ```
363
-
364
- ### MazSelectCountry - New Component
365
-
366
- Country/language selector with i18n support:
367
-
368
- ```html
369
- <!-- ✅ NEW COMPONENT -->
370
- <MazSelectCountry
371
- v-model="selectedCountry"
372
- :preferred-codes="['US', 'FR']" <!-- 🆕 NEW: Preferred countries -->
373
- :locale="'fr'" <!-- 🆕 NEW: Localization -->
374
- :hide-flags="false" <!-- 🆕 NEW: Flag display -->
375
- :display-code="false" <!-- 🆕 NEW: Show codes -->
376
- />
377
- ```
378
-
379
- ### MazInputPhoneNumber - Renamed
380
-
381
- ```html
382
- <!-- ❌ BEFORE (v3.x) -->
383
- <MazPhoneNumberInput
384
- v-model="phone"
385
- v-model:country-code="country"
386
- :preferred-countries="['FR', 'US']"
387
- @update="handleUpdate"
388
- />
389
-
390
- <!-- ✅ AFTER (v4.0.0) -->
391
- <MazInputPhoneNumber
392
- v-model="phone"
393
- v-model:country-code="country"
394
- :preferred-countries="['FR', 'US']"
395
- @data="handleData" <!-- 🔄 CHANGED: @update → @data -->
396
- />
397
- ```
398
-
399
- ### MazExpandAnimation - Replaces MazTransitionExpand
400
-
401
- ```html
402
- <!-- ❌ BEFORE (v3.x) -->
403
- <MazTransitionExpand animation-duration="500ms">
404
- <div v-show="isOpen">Content</div>
405
- </MazTransitionExpand>
406
-
407
- <!-- ✅ AFTER (v4.0.0) -->
408
- <MazExpandAnimation
409
- v-model="isOpen" <!-- 🆕 NEW: v-model for state control -->
410
- duration="500ms" <!-- 🔄 CHANGED: duration instead of animation-duration -->
411
- timing-function="ease-in-out" <!-- 🆕 NEW: Timing function -->
412
- >
413
- <div>Content</div>
414
- </MazExpandAnimation>
415
- ```
416
-
417
- ### MazDropzone - Complete Rewrite
418
-
419
- **External dependency removed:**
420
-
421
- ```bash
422
- # ❌ BEFORE (v3.x) - External dependency required
423
- npm install dropzone
424
-
425
- # ✅ AFTER (v4.0.0) - No external dependency
426
- npm uninstall dropzone
427
- ```
428
-
429
- **New Features:**
430
-
431
- ```html
432
- <!-- ✅ NEW FEATURES -->
433
- <MazDropzone
434
- v-model="files"
435
- :auto-upload="'single'" <!-- 🆕 NEW: Automatic upload -->
436
- url="/api/upload" <!-- 🆕 NEW: Upload URL -->
437
- :request-options="{ ... }" <!-- 🆕 NEW: Request options -->
438
- :transform-body="transformFn" <!-- 🆕 NEW: Body transformation -->
439
- :min-file-size="0.1" <!-- 🆕 NEW: Min size in MB -->
440
- @upload-success="onSuccess" <!-- 🆕 NEW: Success event -->
441
- @upload-error="onError" <!-- 🆕 NEW: Error event -->
442
- />
443
- ```
444
-
445
- ### MazDropdown & MazSelect - Position API
446
-
447
- ```html
448
- <!-- ❌ BEFORE (v3.x) -->
449
- <MazDropdown position="bottom right" />
450
- <MazSelect position="bottom right" />
451
-
452
- <!-- ✅ AFTER (v4.0.0) -->
453
- <MazDropdown position="bottom-end" />
454
- <MazSelect position="bottom-end" />
455
- ```
456
-
457
- **New position type:**
458
-
459
- ```typescript
460
- type MazPopoverPosition = 'auto' | 'top' | 'bottom' | 'left' | 'right' |
461
- 'top-start' | 'top-end' | 'bottom-start' | 'bottom-end' |
462
- 'left-start' | 'left-end' | 'right-start' | 'right-end'
463
- ```
464
-
465
- ### MazDialogConfirm - Renamed
466
-
467
- ```typescript
468
- // ❌ BEFORE (v3.x)
469
- import { MazDialogPromise } from 'maz-ui'
470
-
471
- // ✅ AFTER (v4.0.0)
472
- import { MazDialogConfirm } from 'maz-ui'
473
- ```
474
-
475
- ## Composable Changes
476
-
477
- ### useDialog - API Changes
478
-
479
- **No longer Promise-based to avoid JS console errors:**
480
-
481
- ```typescript
482
- // ❌ BEFORE (v3.x)
483
- const dialog = useDialog()
484
-
485
- try {
486
- const result = await dialog.confirm({
487
- title: 'Confirm',
488
- message: 'Are you sure?',
489
- confirmText: 'Yes',
490
- cancelText: 'No'
491
- })
492
- // Handle confirm
493
- } catch (error) {
494
- // Handle cancel
495
- }
496
- ```
497
-
498
- ```typescript
499
- // ✅ AFTER (v4.0.0)
500
- const dialog = useDialog()
501
-
502
- dialog.confirm({
503
- title: 'Confirm',
504
- message: 'Are you sure?',
505
- buttons: { // 🔄 CHANGED: buttons instead of confirmText/cancelText
506
- confirm: 'Yes',
507
- cancel: 'No'
508
- },
509
- onAccept: () => { // 🆕 NEW: Accept callback
510
- // Handle confirm
511
- },
512
- onReject: () => { // 🆕 NEW: Reject callback
513
- // Handle cancel
514
- },
515
- onClose: () => { // 🆕 NEW: Close callback (finally)
516
- // Handle close
517
- }
518
- })
519
- ```
520
-
521
- ### useDisplayNames - Renamed
522
-
523
- ```typescript
524
- // ❌ BEFORE (v3.x)
525
- import { useLanguageDisplayNames } from 'maz-ui'
526
-
527
- const { getDisplayName } = useLanguageDisplayNames()
528
-
529
- // ✅ AFTER (v4.0.0)
530
- import { useDisplayNames } from 'maz-ui/composables'
531
-
532
- const { getDisplayName } = useDisplayNames()
533
- ```
534
-
535
- **📖 Complete documentation:** [useDisplayNames Guide](/composables/use-display-names)
536
-
537
- ### Helpers to Composables
538
-
539
- **🔄 MAJOR CHANGE**: Several helpers are now Vue composables and must be used within Vue context.
540
-
541
- #### useIdleTimeout
542
-
543
- ```typescript
544
- // ❌ BEFORE (v3.x)
545
- import { idleTimeout } from 'maz-ui'
546
-
547
- const controller = idleTimeout({
548
- timeout: 5000,
549
- onTimeout: () => console.log('timeout'),
550
- onActivity: () => console.log('activity')
551
- })
552
-
553
- // ✅ AFTER (v4.0.0)
554
- import { useIdleTimeout } from 'maz-ui/composables'
555
-
556
- // In a Vue component
557
- const { isIdle } = useIdleTimeout({
558
- timeout: 5000,
559
- onTimeout: () => console.log('timeout'),
560
- onActivity: () => console.log('activity')
561
- })
562
- ```
563
-
564
- ## Color System Changes
565
-
566
- ### Color Removals and Replacements
567
-
568
- ```typescript
569
- // ❌ REMOVED COLORS
570
- color="theme" // ✅ REPLACED BY: color="contrast"
571
- color="white" // ❌ REMOVED
572
- color="black" // ❌ REMOVED
573
- color="danger" // ✅ REPLACED BY: color="destructive"
574
- ```
575
-
576
- ### 🆕 New Color System
577
-
578
- **Available colors in v4.0.0:**
579
-
580
- ```typescript
581
- type MazColor = 'primary' | 'secondary' | 'accent' | 'info' | 'success' |
582
- 'warning' | 'destructive' | 'contrast' | 'transparent'
583
- ```
584
-
585
- **Migration examples:**
586
-
587
- ```html
588
- <!-- ❌ BEFORE (v3.x) -->
589
- <MazBtn color="theme">Theme Button</MazBtn>
590
- <MazBtn color="danger">Danger Button</MazBtn>
591
-
592
- <!-- ✅ AFTER (v4.0.0) -->
593
- <MazBtn color="contrast">Contrast Button</MazBtn>
594
- <MazBtn color="destructive">Destructive Button</MazBtn>
595
- ```
596
-
597
- ## Removed Features
598
-
599
- ### Removed Directive
600
-
601
- ```html
602
- <!-- ❌ REMOVED - v-closable directive -->
603
- <div v-closable="handler">Content</div>
604
-
605
- <!-- ✅ ALTERNATIVE - Use v-click-outside -->
606
- <div v-click-outside="handler">Content</div>
607
- ```
608
-
609
- ### Removed Utility Names
610
-
611
- ```typescript
612
- // ❌ BEFORE (v3.x)
613
- import { currency, date } from 'maz-ui'
614
-
615
- // ✅ AFTER (v4.0.0)
616
- import { formatCurrency, formatDate } from 'maz-ui'
617
- ```
618
-
619
- ## TypeScript Changes
620
-
621
- ### Type Prefixing
622
-
623
- **All component types are now prefixed with `Maz`:**
624
-
625
- ```typescript
626
- // ❌ BEFORE (v3.x)
627
- import type { Props } from 'maz-ui/components/MazBtn'
628
- import type { ButtonsRadioOption, Row, Color, Size } from 'maz-ui'
629
-
630
- // ✅ AFTER (v4.0.0)
631
- import type { MazBtnProps } from 'maz-ui/components/MazBtn'
632
- import type { MazRadioButtonsOption, MazTableRow, MazColor, MazSize } from 'maz-ui'
633
- ```
634
-
635
- ### Type Import Changes
636
-
637
- ```typescript
638
- // ❌ BEFORE (v3.x)
639
- import type { Color, Size } from 'maz-ui'
640
-
641
- // ✅ AFTER (v4.0.0)
642
- import type { MazColor, MazSize } from 'maz-ui'
643
- ```
644
-
645
- ## Theme System
646
-
647
- ### Basic Configuration
648
-
649
- ```typescript
650
- // main.ts
651
- import { MazUi } from 'maz-ui/plugins/maz-ui'
652
- import { mazUi } from '@maz-ui/themes/presets'
653
-
654
- app.use(MazUi, {
655
- theme: {
656
- preset: mazUi, // or 'ocean' | 'pristine' | 'obsidian'
657
- },
658
- })
659
- ```
660
-
661
- ### Custom Theme
662
-
663
- ```typescript
664
- import { definePreset } from '@maz-ui/themes'
665
- import { mazUi } from '@maz-ui/themes/presets'
666
-
667
- const customTheme = definePreset({
668
- base: mazUi,
669
- name: 'custom-theme',
670
- colors: {
671
- light: {
672
- primary: '220 100% 50%',
673
- secondary: '220 14% 96%',
674
- },
675
- dark: {
676
- primary: '220 100% 70%',
677
- secondary: '220 14% 4%',
678
- }
679
- }
680
- })
681
-
682
- app.use(MazUi, {
683
- theme: {
684
- preset: customTheme,
685
- },
686
- })
687
- ```
688
-
689
- ### useTheme Composable
690
-
691
- ```vue
692
- <script setup>
693
- import { useTheme } from 'maz-ui/composables'
694
-
695
- const { isDark, toggleDarkMode, updateTheme } = useTheme()
696
-
697
- // Change theme
698
- updateTheme('ocean')
699
-
700
- // Toggle dark mode (v5: returns Promise<void>, optional { animate } param)
701
- toggleDarkMode()
702
- </script>
703
-
704
- <template>
705
- <button @click="toggleDarkMode">
706
- {{ isDark ? '☀️' : '🌙' }}
707
- </button>
708
- </template>
709
- ```
710
-
711
- **📖 Complete documentation:** [Theme Guide](/ecosystem/themes)
712
-
713
- ## Translation System
714
-
715
- ### Configuration
716
-
717
- ```typescript
718
- // main.ts
719
- import { MazUi } from 'maz-ui/plugins/maz-ui'
720
- import { fr, en } from '@maz-ui/translations'
721
-
722
- app.use(MazUi, {
723
- translations: {
724
- locale: 'fr',
725
- fallbackLocale: 'en',
726
- messages: {
727
- fr,
728
- en,
729
- },
730
- },
731
- })
732
- ```
733
-
734
- ### useTranslations Composable
735
-
736
- ```vue
737
- <script setup>
738
- import { useTranslations } from 'maz-ui/composables'
739
-
740
- const { t, locale, setLocale } = useTranslations()
741
-
742
- // Change language
743
- setLocale('fr')
744
- </script>
745
-
746
- <template>
747
- <p>{{ t('button.cancel') }}</p>
748
- </template>
749
- ```
750
-
751
- **📖 Complete documentation:** [Translation Guide](/ecosystem/translations)
752
-
753
- ## Common Errors and Solutions
754
-
755
- ### "idleTimeout is not a function"
756
-
757
- ```typescript
758
- // ❌ Old way
759
- import { idleTimeout } from 'maz-ui'
760
-
761
- // ✅ New way
762
- import { useIdleTimeout } from 'maz-ui/composables'
763
-
764
- // In a Vue component
765
- const { isIdle } = useIdleTimeout({ timeout: 5000 })
766
- ```
767
-
768
- ### ❌ "MazTransitionExpand is not exported"
769
-
770
- ```vue
771
- <!-- ❌ Removed component -->
772
- <MazTransitionExpand>
773
- <div v-show="isOpen">Content</div>
774
- </MazTransitionExpand>
775
-
776
- <!-- ✅ New component -->
777
- <MazExpandAnimation v-model="isOpen">
778
- <div>Content</div>
779
- </MazExpandAnimation>
780
- ```
781
-
782
- ### ❌ "Module not found: Can't resolve 'dropzone'"
783
-
784
- ```bash
785
- # ❌ Remove old dependency
786
- npm uninstall dropzone
787
-
788
- # ✅ MazDropzone has no external dependency
789
- ```
790
-
791
- ### ❌ "useTheme must be used within MazUi plugin"
792
-
793
- ```typescript
794
- // ❌ Missing plugin
795
- import { createApp } from 'vue'
796
-
797
- // ✅ Add MazUi plugin
798
- import { MazUi } from 'maz-ui/plugins/maz-ui'
799
-
800
- app.use(MazUi)
801
- ```
802
-
803
- ### ❌ "Property 'outline' does not exist"
804
-
805
- ```html
806
- <!-- ❌ Old prop name -->
807
- <MazBtn outline>Button</MazBtn>
808
-
809
- <!-- ✅ New prop name -->
810
- <MazBtn outlined>Button</MazBtn>
811
- ```
812
-
813
- ## Migration Benefits
814
-
815
- ### Performance
816
-
817
- | Metric | v3.x | v4.0.0 | Improvement |
818
- |--------|------|--------|-------------|
819
- | **Bundle Size** | ~500KB | ~50-200KB | 60-90% |
820
- | **Tree-shaking** | ❌ Limited | ✅ Optimal | Perfect |
821
- | **Lazy Loading** | ❌ Basic | ✅ Advanced | Intelligent |
822
- | **TypeScript** | ✅ Good | ✅ Excellent | Strict |
823
-
824
- ### Developer Experience
825
-
826
- - **Auto-imports**: Resolvers for unplugin-vue-components
827
- - **TypeScript**: Strict types and perfect auto-completion
828
- - **DevTools**: Nuxt DevTools integration
829
- - **Documentation**: Interactive guides and examples
830
-
831
- ### Maintenance
832
-
833
- - **Modularity**: Separate packages for better maintenance
834
- - **Versioning**: Semantic versioning for each package
835
- - **Stability**: Mature and tested architecture
836
-
837
- ## Complete Migration Checklist
838
-
839
- ### Dependencies
840
-
841
- - <MazCheckbox> Update maz-ui to v4.0.0+ </MazCheckbox>
842
- - <MazCheckbox> Remove `dropzone` dependency </MazCheckbox>
843
- - <MazCheckbox> Update Vue to v3.5+ </MazCheckbox>
844
- - <MazCheckbox> Update unplugin-auto-import to v19+ </MazCheckbox>
845
- - <MazCheckbox> Update unplugin-vue-components to v28+ </MazCheckbox>
846
-
847
- ### Configuration
848
-
849
- - <MazCheckbox> Add MazUi plugin in main.ts </MazCheckbox>
850
- - <MazCheckbox> Configure theme with new system </MazCheckbox>
851
- - <MazCheckbox> Configure translations with new system </MazCheckbox>
852
- - <MazCheckbox> Migrate Nuxt configuration to @maz-ui/nuxt (if using Nuxt) </MazCheckbox>
853
-
854
- ### Imports
855
-
856
- - <MazCheckbox> Migrate plugin imports to `maz-ui/plugins/*` </MazCheckbox>
857
- - <MazCheckbox> Migrate directive imports to `maz-ui/directives/*` </MazCheckbox>
858
- - <MazCheckbox> Migrate composable imports to `maz-ui/composables/*` </MazCheckbox>
859
- - <MazCheckbox> Update utility imports (e.g. currency → formatCurrency, etc.) </MazCheckbox>
860
-
861
- ### Components
862
-
863
- - <MazCheckbox> Replace `MazBtn variant="link"` with `MazLink` </MazCheckbox>
864
- - <MazCheckbox> Update `MazBtn outline` to `outlined` </MazCheckbox>
865
- - <MazCheckbox> Rename `MazPhoneNumberInput` to `MazInputPhoneNumber` </MazCheckbox>
866
- - <MazCheckbox> Rename `MazPicker` to `MazDatePicker` </MazCheckbox>
867
- - <MazCheckbox> Replace `MazTransitionExpand` with `MazExpandAnimation` </MazCheckbox>
868
- - <MazCheckbox> Update `MazDropdown`/`MazSelect` position props </MazCheckbox>
869
- - <MazCheckbox> Rename `MazDialogPromise` to `MazDialogConfirm` </MazCheckbox>
870
- - <MazCheckbox> Check new `MazDropzone` props </MazCheckbox>
871
- - <MazCheckbox> Rename `MazPicker` to `MazDatePicker` </MazCheckbox>
872
-
873
- ### API Changes
874
-
875
- - <MazCheckbox> Migrate `useDialog` from Promise to callback API </MazCheckbox>
876
- - <MazCheckbox> Rename `useLanguageDisplayNames` to `useDisplayNames` </MazCheckbox>
877
- - <MazCheckbox> Update `@update` to `@data` in `MazInputPhoneNumber` </MazCheckbox>
878
- - <MazCheckbox> Replace removed colors (theme → contrast, danger → destructive) </MazCheckbox>
879
- - <MazCheckbox> Remove `v-closable` directive usage </MazCheckbox>
880
-
881
- ### Helpers to Composables
882
-
883
- - <MazCheckbox> Migrate `idleTimeout` to `useIdleTimeout` </MazCheckbox>
884
- - <MazCheckbox> Migrate `userVisibility` to `useUserVisibility` </MazCheckbox>
885
- - <MazCheckbox> Migrate `mountComponent` to `useMountComponent` </MazCheckbox>
886
- - <MazCheckbox> Migrate `injectStrict` to `useInjectStrict` </MazCheckbox>
887
- - <MazCheckbox> Migrate `freezeValue` to `useFreezeValue` </MazCheckbox>
888
-
889
- ### TypeScript
890
-
891
- - <MazCheckbox> Update all type imports to use `Maz` prefix </MazCheckbox>
892
- - <MazCheckbox> Update prop type imports (e.g. Props → MazBtnProps) </MazCheckbox>
893
- - <MazCheckbox> Update generic types (e.g. Color → MazColor, Size → MazSize) </MazCheckbox>
894
-
895
- ### Testing and Validation
896
-
897
- - <MazCheckbox> Test TypeScript compilation </MazCheckbox>
898
- - <MazCheckbox> Test production build </MazCheckbox>
899
- - <MazCheckbox> Check bundle size </MazCheckbox>
900
- - <MazCheckbox> Run unit tests </MazCheckbox>
901
- - <MazCheckbox> Test in development and production </MazCheckbox>
902
- - <MazCheckbox> Test SSR/Nuxt if applicable </MazCheckbox>
903
- - <MazCheckbox> Validate critical functionality </MazCheckbox>
904
-
905
- ## Additional Resources
906
-
907
- - **[Official v4 Documentation](https://maz-ui.com)** - Complete documentation
908
- - **[Theme Guide](/ecosystem/themes)** - Advanced theme system
909
- - **[Translation Guide](/ecosystem/translations)** - Internationalization
910
- - **[Vue Installation Guide](/guide/vue)** - Vue setup
911
- - **[Nuxt Installation Guide](/ecosystem/nuxt)** - Nuxt setup
912
- - **[Resolvers Guide](/guide/resolvers)** - Smart auto-imports
913
- - **[Complete Changelog](https://github.com/LouisMazel/maz-ui/blob/master/CHANGELOG.md)** - All changes
914
-
915
- ## Need Help?
916
-
917
- Migration seems complex? We're here to help:
918
-
919
- - **[Create Issue](https://github.com/LouisMazel/maz-ui/issues)** - Report bugs
920
- - **[Discussions](https://github.com/LouisMazel/maz-ui/discussions)**
921
- - **[MCP](./mcp.md)**
922
-
923
- ---
924
-
925
- **🎉 Congratulations!** You now have all the tools to migrate to Maz-UI v4.0.0 and enjoy an exceptional developer experience with optimized performance!