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