@maz-ui/mcp 4.6.1 → 4.7.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.
- package/dist/mcp.mjs +1 -1
- package/docs/generated-docs/maz-accordion.doc.md +5 -5
- package/docs/generated-docs/maz-ui-provider.doc.md +12 -0
- package/docs/src/blog/v4.md +1 -1
- package/docs/src/guide/getting-started.md +5 -1
- package/docs/src/guide/icon-set.md +43 -21
- package/docs/src/guide/icons.md +74 -15
- package/docs/src/guide/maz-ui-provider.md +199 -0
- package/docs/src/guide/migration-v4.md +1 -1
- package/docs/src/guide/nuxt.md +4 -0
- package/docs/src/guide/themes.md +4 -0
- package/docs/src/guide/translations.md +4 -0
- package/docs/src/guide/vue.md +7 -2
- package/docs/src/index.md +1 -1
- package/package.json +5 -5
package/dist/mcp.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
|
7
7
|
import { resolve, dirname, join } from 'node:path';
|
|
8
8
|
import { fileURLToPath } from 'node:url';
|
|
9
9
|
|
|
10
|
-
const version = "4.
|
|
10
|
+
const version = "4.6.1";
|
|
11
11
|
|
|
12
12
|
const _dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
13
|
class DocumentationService {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
## Props
|
|
2
2
|
|
|
3
|
-
| Name | Description | Type | Required |
|
|
4
|
-
| ----------------- | ----------- | --------- | -------- |
|
|
5
|
-
| **id** | | `string` | No |
|
|
6
|
-
| **model-value** | | `number` | No |
|
|
7
|
-
| **content-class** | | `unknown` | No |
|
|
3
|
+
| Name | Description | Type | Required |
|
|
4
|
+
| ----------------- | ----------- | --------- | -------- |
|
|
5
|
+
| **id** | | `string` | No |
|
|
6
|
+
| **model-value** | | `number` | No |
|
|
7
|
+
| **content-class** | | `unknown` | No |
|
|
8
8
|
|
|
9
9
|
## Events
|
|
10
10
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
## Props
|
|
2
|
+
|
|
3
|
+
| Name | Description | Type | Required |
|
|
4
|
+
| ---------------- | ----------- | -------------------------- | -------- |
|
|
5
|
+
| **theme** | | `intersection` | Yes |
|
|
6
|
+
| **translations** | | `MazUiTranslationsOptions` | No |
|
|
7
|
+
|
|
8
|
+
## Slots
|
|
9
|
+
|
|
10
|
+
| Name | Description | Bindings |
|
|
11
|
+
| ------- | ----------- | -------- |
|
|
12
|
+
| default | | |
|
package/docs/src/blog/v4.md
CHANGED
|
@@ -91,7 +91,7 @@ app.use(MazUi, {
|
|
|
91
91
|
|
|
92
92
|
### Specialized Ecosystem Packages
|
|
93
93
|
|
|
94
|
-
- **@maz-ui/icons** -
|
|
94
|
+
- **@maz-ui/icons** - 860+ Icons
|
|
95
95
|
SVG icon library with Vue components, direct SVG files, and auto-import support.
|
|
96
96
|
|
|
97
97
|
- **@maz-ui/nuxt** - Nuxt Integration
|
|
@@ -130,7 +130,7 @@ npm install @maz-ui/icons
|
|
|
130
130
|
|
|
131
131
|
**Features:**
|
|
132
132
|
|
|
133
|
-
-
|
|
133
|
+
- 860+ icons
|
|
134
134
|
- Usable as Vue components (e.g. `<MazStar />`)
|
|
135
135
|
- Tree-shakable imports
|
|
136
136
|
- Multiple sizes and variants
|
|
@@ -231,6 +231,10 @@ Learn about [theming and customization](./themes.md) to match your brand.
|
|
|
231
231
|
|
|
232
232
|
Learn about [internationalization](./translations.md) to support multiple languages.
|
|
233
233
|
|
|
234
|
+
### Lazy Loading with MazUiProvider
|
|
235
|
+
|
|
236
|
+
Use [`MazUiProvider`](./maz-ui-provider.md) to defer Maz-UI initialization to lazy-loaded pages for zero entry-bundle overhead.
|
|
237
|
+
|
|
234
238
|
### Get Help
|
|
235
239
|
|
|
236
240
|
Browse [GitHub discussions](https://github.com/LouisMazel/maz-ui/discussions) or open an issue on [GitHub](https://github.com/LouisMazel/maz-ui/issues).
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
# Icon Set (
|
|
1
|
+
# Icon Set (860+ icons)
|
|
2
2
|
|
|
3
|
-
The library includes **
|
|
3
|
+
The library includes **860+ icons**
|
|
4
4
|
|
|
5
5
|
## Icon Naming Convention
|
|
6
6
|
|
|
7
7
|
All icons follow a consistent naming pattern:
|
|
8
8
|
|
|
9
|
-
- Vue components: `Maz` + PascalCase (e.g., `MazUserCircle`)
|
|
9
|
+
- Static Vue components: `Maz` + PascalCase (e.g., `MazUserCircle`)
|
|
10
|
+
- Lazy Vue components: `LazyMaz` + PascalCase (e.g., `LazyMazUserCircle`)
|
|
10
11
|
- SVG files: kebab-case (e.g., `user-circle.svg`)
|
|
11
12
|
|
|
12
13
|
## Find your icon
|
|
@@ -14,18 +15,19 @@ All icons follow a consistent naming pattern:
|
|
|
14
15
|
<ComponentDemo>
|
|
15
16
|
<div class="maz-flex maz-flex-col maz-gap-4">
|
|
16
17
|
<div class="maz-flex maz-gap-2 maz-items-start">
|
|
17
|
-
<MazInput v-model="search" label="Search icon" @update:model-value="search = $event.trim()" :left-icon="
|
|
18
|
+
<MazInput v-model="search" label="Search icon" @update:model-value="search = $event.trim()" :left-icon="SearchIcon" class="flex-1" :assistive-text="`${filteredIcons.length} icons found`" />
|
|
18
19
|
</div>
|
|
19
20
|
<MazTabs v-model="currentTab">
|
|
20
21
|
<MazTabsBar :items="tabs" />
|
|
21
22
|
</MazTabs>
|
|
22
23
|
<div class="maz-grid maz-grid-cols-3 maz-gap-2">
|
|
23
|
-
<div v-for="icon in filteredIcons" :key="icon.name" class="maz-flex maz-flex-col maz-items-center maz-gap-3 maz-text-center maz-border maz-border-solid maz-border-divider maz-rounded maz-p-4 maz-truncate
|
|
24
|
+
<div v-for="icon in filteredIcons" :key="icon.name" class="maz-flex maz-flex-col maz-items-center maz-gap-3 maz-text-center maz-border maz-border-solid maz-border-divider maz-rounded maz-p-4 maz-truncate">
|
|
24
25
|
<component :is="icon.component" class="maz-size-8" />
|
|
25
26
|
<span class="maz-text-xs maz-text-muted maz-truncate">{{ icon.name }}</span>
|
|
26
27
|
<div class="maz-flex maz-flex-row maz-gap-2 maz-w-full">
|
|
27
|
-
<MazBtn v-tooltip="{ text: 'Copy Name', panelClass: 'maz-text-xs' }" class="maz-flex-1" size="xs" color="background" outlined @click="copyIcon(icon.name)" :icon="
|
|
28
|
-
<MazBtn v-tooltip="{ text: 'Copy Import', panelClass: 'maz-text-xs' }" class="maz-flex-1" size="xs" color="background" outlined @click="
|
|
28
|
+
<MazBtn v-tooltip="{ text: 'Copy Name', panelClass: 'maz-text-xs' }" class="maz-flex-1" size="xs" color="background" outlined @click="copyIcon(icon.name)" :icon="ClipboardDocumentIcon" />
|
|
29
|
+
<MazBtn v-tooltip="{ text: 'Copy Static Import', panelClass: 'maz-text-xs' }" class="maz-flex-1" size="xs" color="background" outlined @click="copyStaticImport(icon.name)" :icon="ClipboardDocumentListIcon" />
|
|
30
|
+
<MazBtn v-tooltip="{ text: 'Copy Lazy Import', panelClass: 'maz-text-xs' }" class="maz-flex-1" size="xs" color="background" outlined @click="copyLazyImport(icon.name)" :icon="ClipboardDocumentListIcon" />
|
|
29
31
|
</div>
|
|
30
32
|
</div>
|
|
31
33
|
</div>
|
|
@@ -33,25 +35,39 @@ All icons follow a consistent naming pattern:
|
|
|
33
35
|
</ComponentDemo>
|
|
34
36
|
|
|
35
37
|
<script setup>
|
|
36
|
-
import { ref,
|
|
38
|
+
import { computed, ref, shallowRef } from 'vue'
|
|
37
39
|
import { useToast } from 'maz-ui/composables/useToast'
|
|
38
40
|
import { vTooltip } from 'maz-ui/directives/vTooltip'
|
|
39
|
-
import { MazClipboardDocument, MazClipboardDocumentList } from '@maz-ui/icons'
|
|
40
41
|
|
|
41
|
-
const
|
|
42
|
+
const LazyIcons = shallowRef()
|
|
43
|
+
const SearchIcon = shallowRef()
|
|
44
|
+
const ClipboardDocumentIcon = shallowRef()
|
|
45
|
+
const ClipboardDocumentListIcon = shallowRef()
|
|
42
46
|
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
const lazyIconModule = await import('@maz-ui/icons/lazy')
|
|
48
|
+
LazyIcons.value = lazyIconModule
|
|
49
|
+
SearchIcon.value = lazyIconModule.MazMagnifyingGlass
|
|
50
|
+
ClipboardDocumentIcon.value = lazyIconModule.MazClipboardDocument
|
|
51
|
+
ClipboardDocumentListIcon.value = lazyIconModule.MazClipboardDocumentList
|
|
52
|
+
|
|
53
|
+
const icons = Object.entries(LazyIcons.value)
|
|
54
|
+
.filter(([name]) => name.startsWith('Maz'))
|
|
55
|
+
.sort(([nameA], [nameB]) => nameA.localeCompare(nameB))
|
|
56
|
+
.map(([name, component]) => ({ name, component }))
|
|
47
57
|
|
|
48
58
|
const { commonIcons, flags, flagsSquare, logos, all } = icons.reduce((acc, iconComponent) => {
|
|
49
59
|
if (iconComponent.name.startsWith('MazFlagSquare')) {
|
|
50
60
|
acc.flagsSquare.push(iconComponent)
|
|
51
61
|
}
|
|
52
|
-
else if (iconComponent.name.startsWith('MazFlag') && iconComponent.name.length >= 8)
|
|
53
|
-
|
|
54
|
-
|
|
62
|
+
else if (iconComponent.name.startsWith('MazFlag') && iconComponent.name.length >= 8) {
|
|
63
|
+
acc.flags.push(iconComponent)
|
|
64
|
+
}
|
|
65
|
+
else if (iconComponent.name.startsWith('MazLogo') && iconComponent.name.length >= 8) {
|
|
66
|
+
acc.logos.push(iconComponent)
|
|
67
|
+
}
|
|
68
|
+
else if (iconComponent.name.startsWith('Maz')) {
|
|
69
|
+
acc.commonIcons.push(iconComponent)
|
|
70
|
+
}
|
|
55
71
|
|
|
56
72
|
acc.all.push(iconComponent)
|
|
57
73
|
|
|
@@ -81,7 +97,8 @@ const search = ref()
|
|
|
81
97
|
const filteredIcons = computed(() => {
|
|
82
98
|
const _currentTab = currentTab.value
|
|
83
99
|
|
|
84
|
-
const
|
|
100
|
+
const tabMap = { 1: all, 2: commonIcons, 3: logos, 4: flags, 5: flagsSquare }
|
|
101
|
+
const baseIcons = tabMap[_currentTab] || all
|
|
85
102
|
|
|
86
103
|
const _search = search.value?.toLowerCase().replace(/\s/g, '')
|
|
87
104
|
if (!_search) return baseIcons
|
|
@@ -91,11 +108,16 @@ const filteredIcons = computed(() => {
|
|
|
91
108
|
|
|
92
109
|
const copyIcon = (icon) => {
|
|
93
110
|
navigator.clipboard.writeText(icon)
|
|
94
|
-
success('Icon copied to clipboard')
|
|
111
|
+
success('Icon name copied to clipboard')
|
|
95
112
|
}
|
|
96
113
|
|
|
97
|
-
const
|
|
114
|
+
const copyStaticImport = (icon) => {
|
|
98
115
|
navigator.clipboard.writeText(`import { ${icon} } from '@maz-ui/icons'`)
|
|
99
|
-
success('
|
|
116
|
+
success('Static import copied to clipboard')
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const copyLazyImport = (icon) => {
|
|
120
|
+
navigator.clipboard.writeText(`import { Lazy${icon} } from '@maz-ui/icons'`)
|
|
121
|
+
success('Lazy import copied to clipboard')
|
|
100
122
|
}
|
|
101
123
|
</script>
|
package/docs/src/guide/icons.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# @maz-ui/icons
|
|
2
2
|
|
|
3
|
-
A comprehensive collection of **
|
|
3
|
+
A comprehensive collection of **860 beautiful SVG icons** ready for use in your Vue.js applications. Built with performance and flexibility in mind, these icons are optimized for modern web development.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
7
|
+
- **860+ icons** - All icons are available [in the icon set page](./icon-set.md)
|
|
8
|
+
- **Static & Lazy components** - Static (eagerly loaded) by default, lazy (async) when you need to optimize bundle size
|
|
8
9
|
- **Multiple usage patterns** - Direct SVG files, Vue components, or auto-import
|
|
9
10
|
- **TypeScript support** - Full type definitions included
|
|
10
11
|
- **Tree-shakeable** - Import only the icons you need
|
|
@@ -53,11 +54,18 @@ npm install @maz-ui/icons vite-svg-loader
|
|
|
53
54
|
|
|
54
55
|
### Method 1: Vue Components (Recommended)
|
|
55
56
|
|
|
56
|
-
Import and use icons as Vue components:
|
|
57
|
+
Import and use icons as Vue components. Icons are available in two variants:
|
|
58
|
+
|
|
59
|
+
- **Static** (default) — eagerly loaded, rendered immediately with no async overhead
|
|
60
|
+
- **Lazy** — loaded on demand via `defineAsyncComponent`, ideal for optimizing bundle size
|
|
61
|
+
|
|
62
|
+
#### Static Icons (default)
|
|
57
63
|
|
|
58
64
|
```vue
|
|
59
65
|
<script setup lang="ts">
|
|
60
66
|
import { MazCheck, MazHeart, MazUser } from '@maz-ui/icons'
|
|
67
|
+
// Or import from the static sub-path:
|
|
68
|
+
// import { MazCheck } from '@maz-ui/icons/static'
|
|
61
69
|
</script>
|
|
62
70
|
|
|
63
71
|
<template>
|
|
@@ -69,11 +77,44 @@ import { MazCheck, MazHeart, MazUser } from '@maz-ui/icons'
|
|
|
69
77
|
</template>
|
|
70
78
|
```
|
|
71
79
|
|
|
80
|
+
#### Lazy Icons
|
|
81
|
+
|
|
82
|
+
Lazy icons are prefixed with `Lazy` and use `defineAsyncComponent` under the hood. Use them when you want to reduce your initial bundle size:
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<script setup lang="ts">
|
|
86
|
+
import { LazyMazCheck, LazyMazHeart, LazyMazUser } from '@maz-ui/icons'
|
|
87
|
+
// Or import from the lazy sub-path (without Lazy prefix):
|
|
88
|
+
// import { MazCheck } from '@maz-ui/icons/lazy'
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<template>
|
|
92
|
+
<div>
|
|
93
|
+
<LazyMazCheck class="text-green-500" />
|
|
94
|
+
<LazyMazUser class="w-6 h-6" />
|
|
95
|
+
<LazyMazHeart class="text-red-500 hover:scale-110 transition-transform" />
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
::: tip Sub-path imports for better tree-shaking
|
|
101
|
+
You can also import individual icons directly for optimal tree-shaking:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
// Static icon (individual file)
|
|
105
|
+
import { MazCheck } from '@maz-ui/icons/MazCheck'
|
|
106
|
+
|
|
107
|
+
// Lazy icon (individual file)
|
|
108
|
+
import { MazCheck } from '@maz-ui/icons/lazy/MazCheck'
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
:::
|
|
112
|
+
|
|
72
113
|
**Benefits:**
|
|
73
114
|
|
|
74
115
|
- ✅ Tree-shaking - Only bundled icons are included
|
|
75
116
|
- ✅ TypeScript support with full IntelliSense
|
|
76
|
-
- ✅
|
|
117
|
+
- ✅ Static icons render immediately, lazy icons optimize bundle size
|
|
77
118
|
- ✅ Easy to style with CSS classes
|
|
78
119
|
|
|
79
120
|
### Method 2: Auto-import with Resolver
|
|
@@ -115,11 +156,13 @@ export default defineConfig({
|
|
|
115
156
|
|
|
116
157
|
<template>
|
|
117
158
|
<div class="navigation">
|
|
118
|
-
<!--
|
|
159
|
+
<!-- Static icons (eagerly loaded) -->
|
|
119
160
|
<MazHome class="nav-icon" />
|
|
120
161
|
<MazUser class="nav-icon" />
|
|
121
162
|
<MazSettings class="nav-icon" />
|
|
122
|
-
|
|
163
|
+
|
|
164
|
+
<!-- Lazy icons (async loaded) — prefix with "Lazy" -->
|
|
165
|
+
<LazyMazLogout class="nav-icon" />
|
|
123
166
|
</div>
|
|
124
167
|
</template>
|
|
125
168
|
|
|
@@ -130,11 +173,16 @@ export default defineConfig({
|
|
|
130
173
|
</style>
|
|
131
174
|
```
|
|
132
175
|
|
|
176
|
+
The resolver automatically resolves:
|
|
177
|
+
- `MazXxx` → static icon from `@maz-ui/icons/MazXxx`
|
|
178
|
+
- `LazyMazXxx` → lazy icon from `@maz-ui/icons/lazy/MazXxx`
|
|
179
|
+
|
|
133
180
|
**Benefits:**
|
|
134
181
|
|
|
135
182
|
- ✅ Zero import boilerplate
|
|
136
183
|
- ✅ Full TypeScript support
|
|
137
184
|
- ✅ Tree-shaking still works
|
|
185
|
+
- ✅ Both static and lazy variants supported
|
|
138
186
|
- ✅ IntelliSense for all available icons
|
|
139
187
|
|
|
140
188
|
### Method 3: With vite-svg-loader
|
|
@@ -270,23 +318,33 @@ All icons support CSS custom properties for advanced styling:
|
|
|
270
318
|
|
|
271
319
|
## Available Icons
|
|
272
320
|
|
|
273
|
-
The library includes **
|
|
321
|
+
The library includes **860+ carefully** covering all common use cases:
|
|
274
322
|
|
|
275
323
|
### Icon Naming Convention
|
|
276
324
|
|
|
277
325
|
All icons follow a consistent naming pattern:
|
|
278
326
|
|
|
279
|
-
- Vue components: `Maz` + PascalCase (e.g., `MazUserCircle`)
|
|
327
|
+
- Static Vue components: `Maz` + PascalCase (e.g., `MazUserCircle`)
|
|
328
|
+
- Lazy Vue components: `LazyMaz` + PascalCase (e.g., `LazyMazUserCircle`)
|
|
280
329
|
- SVG files: kebab-case (e.g., `user-circle.svg`)
|
|
281
330
|
|
|
282
331
|
```typescript
|
|
283
|
-
//
|
|
332
|
+
// Static component imports (eagerly loaded)
|
|
284
333
|
import {
|
|
285
334
|
MazArrowRight, // arrow-right.svg
|
|
286
335
|
MazChatBubbleLeft, // chat-bubble-left.svg
|
|
287
336
|
MazShoppingCart, // shopping-cart.svg
|
|
288
337
|
MazUserCircle // user-circle.svg
|
|
289
338
|
} from '@maz-ui/icons'
|
|
339
|
+
|
|
340
|
+
// Lazy component imports (async loaded)
|
|
341
|
+
import {
|
|
342
|
+
LazyMazArrowRight,
|
|
343
|
+
LazyMazUserCircle
|
|
344
|
+
} from '@maz-ui/icons'
|
|
345
|
+
|
|
346
|
+
// Or import lazy icons without the Lazy prefix from the sub-path
|
|
347
|
+
import { MazArrowRight } from '@maz-ui/icons/lazy'
|
|
290
348
|
```
|
|
291
349
|
|
|
292
350
|
You can search icons on [Heroicons](https://heroicons.com/) and copy the name of the icon to use it in your project.
|
|
@@ -474,12 +532,13 @@ export const useIconStore = defineStore('icons', () => {
|
|
|
474
532
|
|
|
475
533
|
## Bundle Size
|
|
476
534
|
|
|
477
|
-
| Usage Method
|
|
478
|
-
|
|
|
479
|
-
|
|
|
480
|
-
|
|
|
481
|
-
|
|
|
482
|
-
|
|
|
535
|
+
| Usage Method | Bundle Impact | Best For |
|
|
536
|
+
| -------------------- | ------------- | ------------------------------------- |
|
|
537
|
+
| Static components | Tree-shaken | Immediate rendering, critical UI |
|
|
538
|
+
| Lazy components | Code-split | Non-critical icons, large icon sets |
|
|
539
|
+
| Direct SVG | Minimal | Static usage, minimal bundles |
|
|
540
|
+
| Auto-import | Tree-shaken | Development experience |
|
|
541
|
+
| vite-svg-loader | Optimized | Build-time optimization |
|
|
483
542
|
|
|
484
543
|
## Related Packages
|
|
485
544
|
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MazUiProvider
|
|
3
|
+
description: A component-based alternative to the MazUi plugin for initializing theme and translations, ideal for lazy-loaded pages and micro-frontends.
|
|
4
|
+
head:
|
|
5
|
+
- - meta
|
|
6
|
+
- name: keywords
|
|
7
|
+
content: maz-ui provider, vue provider component, lazy loading, theme provider, translations provider, tree-shaking, code splitting, maz-ui
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# {{ $frontmatter.title }}
|
|
11
|
+
|
|
12
|
+
{{ $frontmatter.description }}
|
|
13
|
+
|
|
14
|
+
## Why MazUiProvider?
|
|
15
|
+
|
|
16
|
+
The standard approach to initialize Maz-UI is the [`MazUi` plugin](./vue.md#install-plugin) in your `main.ts`. This works well, but it means theme and translation setup code is loaded in your **entry bundle** -- even on pages that don't use Maz-UI components.
|
|
17
|
+
|
|
18
|
+
`MazUiProvider` solves this by moving the initialization into a **component** that you place in a lazy-loaded route or subtree. The result: **zero Maz-UI footprint in your entry bundle**.
|
|
19
|
+
|
|
20
|
+
## Before & After
|
|
21
|
+
|
|
22
|
+
### Before: Plugin in main.ts (entry bundle)
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
// main.ts -- loaded on EVERY page
|
|
26
|
+
import { MazUi } from 'maz-ui/plugins/maz-ui'
|
|
27
|
+
import { mazUi } from '@maz-ui/themes/presets/mazUi'
|
|
28
|
+
import { fr } from '@maz-ui/translations'
|
|
29
|
+
import 'maz-ui/styles'
|
|
30
|
+
|
|
31
|
+
app.use(MazUi, {
|
|
32
|
+
theme: {
|
|
33
|
+
preset: mazUi,
|
|
34
|
+
strategy: 'hybrid',
|
|
35
|
+
},
|
|
36
|
+
translations: {
|
|
37
|
+
locale: 'fr',
|
|
38
|
+
messages: { fr },
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
All of `@maz-ui/themes`, `@maz-ui/translations`, and the preset data end up in the initial bundle.
|
|
44
|
+
|
|
45
|
+
### After: Provider in a lazy-loaded page
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
// main.ts -- clean, no Maz-UI code
|
|
49
|
+
import { createApp } from 'vue'
|
|
50
|
+
import { createRouter, createWebHistory } from 'vue-router'
|
|
51
|
+
import App from './App.vue'
|
|
52
|
+
|
|
53
|
+
const router = createRouter({
|
|
54
|
+
history: createWebHistory(),
|
|
55
|
+
routes: [
|
|
56
|
+
{
|
|
57
|
+
path: '/dashboard',
|
|
58
|
+
// Lazy-loaded -- Maz-UI code only loads when user navigates here
|
|
59
|
+
component: () => import('./pages/Dashboard.vue'),
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
createApp(App).use(router).mount('#app')
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
```vue
|
|
68
|
+
<!-- pages/Dashboard.vue -- lazy-loaded -->
|
|
69
|
+
<script setup lang="ts">
|
|
70
|
+
import { MazUiProvider } from 'maz-ui/components'
|
|
71
|
+
import { mazUi } from '@maz-ui/themes/presets/mazUi'
|
|
72
|
+
import { fr } from '@maz-ui/translations'
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<template>
|
|
76
|
+
<MazUiProvider
|
|
77
|
+
:theme="{ preset: mazUi, strategy: 'hybrid' }"
|
|
78
|
+
:translations="{ locale: 'fr', messages: { fr } }"
|
|
79
|
+
>
|
|
80
|
+
<!-- All Maz-UI components inside this subtree work as expected -->
|
|
81
|
+
<MazBtn color="primary">Dashboard Action</MazBtn>
|
|
82
|
+
<MazInput placeholder="Search..." />
|
|
83
|
+
</MazUiProvider>
|
|
84
|
+
</template>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The entire Maz-UI setup is now code-split into the Dashboard chunk.
|
|
88
|
+
|
|
89
|
+
## Props
|
|
90
|
+
|
|
91
|
+
| Prop | Type | Required | Default | Description |
|
|
92
|
+
|------|------|----------|---------|-------------|
|
|
93
|
+
| `theme` | `MazUiThemeOptions` | Yes | -- | Theme configuration (preset, strategy, dark mode, etc.). Same options as the `theme` key in the [MazUi plugin](./vue.md#install-plugin). See [Theming](./themes.md) for details. |
|
|
94
|
+
| `translations` | `MazUiTranslationsOptions` | No | `undefined` | Translations configuration (locale, messages, fallback). Same options as the `translations` key in the [MazUi plugin](./vue.md#install-plugin). See [Translations](./translations.md) for details. |
|
|
95
|
+
|
|
96
|
+
### MazUiThemeOptions
|
|
97
|
+
|
|
98
|
+
```typescript
|
|
99
|
+
interface MazUiThemeOptions {
|
|
100
|
+
preset?: ThemePreset // Theme preset (mazUi, ocean, pristine, obsidian, or custom)
|
|
101
|
+
overrides?: ThemePresetOverrides // Partial overrides for colors, foundation, etc.
|
|
102
|
+
strategy?: 'runtime' | 'buildtime' | 'hybrid' // CSS generation strategy (default: 'hybrid')
|
|
103
|
+
darkModeStrategy?: 'class' | 'media' // Dark mode handling (default: 'class')
|
|
104
|
+
colorMode?: 'light' | 'dark' | 'auto' // Initial color mode (default: 'auto')
|
|
105
|
+
mode?: 'light' | 'dark' | 'both' // Supported color modes (default: 'both')
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### MazUiTranslationsOptions
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
interface MazUiTranslationsOptions {
|
|
113
|
+
locale?: string // Active locale (default: 'en')
|
|
114
|
+
fallbackLocale?: string // Fallback locale (default: 'en')
|
|
115
|
+
preloadFallback?: boolean // Preload fallback locale (default: true)
|
|
116
|
+
messages?: MazUiTranslationsMessages // Locale messages (static objects or lazy loaders)
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Plugin vs Provider
|
|
121
|
+
|
|
122
|
+
| | Plugin (`MazUi`) | Component (`MazUiProvider`) |
|
|
123
|
+
|---|---|---|
|
|
124
|
+
| **Setup location** | `main.ts` via `app.use()` | Any `.vue` template |
|
|
125
|
+
| **Bundle impact** | Loaded in the entry bundle | Can be lazy-loaded with the page |
|
|
126
|
+
| **Scope** | Global (entire app) | Subtree (children of the provider) |
|
|
127
|
+
| **Reconfigurable** | Configured once at install | Reactive to prop changes |
|
|
128
|
+
| **Best for** | Apps that use Maz-UI on every page | Apps with Maz-UI on specific pages, micro-frontends, testing |
|
|
129
|
+
|
|
130
|
+
### When to use the plugin
|
|
131
|
+
|
|
132
|
+
- Your app uses Maz-UI components on most or all pages
|
|
133
|
+
- You want a simple, one-time setup
|
|
134
|
+
- You're using Nuxt (the [Nuxt module](./nuxt.md) handles everything automatically)
|
|
135
|
+
|
|
136
|
+
### When to use the provider
|
|
137
|
+
|
|
138
|
+
- Maz-UI is only used on certain lazy-loaded routes
|
|
139
|
+
- You want zero Maz-UI overhead in the initial bundle
|
|
140
|
+
- You're building a micro-frontend or embedding Maz-UI in a larger app
|
|
141
|
+
- You need different theme/translation configurations in different parts of your app
|
|
142
|
+
- You want theme configuration to be reactive to prop changes
|
|
143
|
+
|
|
144
|
+
## Using Both Together
|
|
145
|
+
|
|
146
|
+
If you use both the plugin and the provider, **the provider takes precedence in its subtree**. Children of `MazUiProvider` will use the provider's theme and translations, while the rest of the app uses the plugin's configuration.
|
|
147
|
+
|
|
148
|
+
```vue
|
|
149
|
+
<!-- App.vue -->
|
|
150
|
+
<!-- Plugin provides global defaults -->
|
|
151
|
+
<template>
|
|
152
|
+
<div>
|
|
153
|
+
<!-- Uses plugin theme (mazUi preset) -->
|
|
154
|
+
<MazBtn color="primary">Global Theme</MazBtn>
|
|
155
|
+
|
|
156
|
+
<!-- Provider overrides in this subtree -->
|
|
157
|
+
<MazUiProvider :theme="{ preset: ocean }">
|
|
158
|
+
<!-- Uses ocean preset -->
|
|
159
|
+
<MazBtn color="primary">Ocean Theme</MazBtn>
|
|
160
|
+
</MazUiProvider>
|
|
161
|
+
</div>
|
|
162
|
+
</template>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
This is possible because both the plugin and the provider use the same Vue `provide` injection keys (`mazThemeState` and `mazTranslations`). Vue's `provide`/`inject` mechanism ensures the nearest ancestor provider wins.
|
|
166
|
+
|
|
167
|
+
## Full Example
|
|
168
|
+
|
|
169
|
+
```vue
|
|
170
|
+
<script setup lang="ts">
|
|
171
|
+
import { MazUiProvider } from 'maz-ui/components'
|
|
172
|
+
import { mazUi } from '@maz-ui/themes/presets/mazUi'
|
|
173
|
+
import { fr } from '@maz-ui/translations'
|
|
174
|
+
import { ref } from 'vue'
|
|
175
|
+
|
|
176
|
+
const locale = ref('fr')
|
|
177
|
+
</script>
|
|
178
|
+
|
|
179
|
+
<template>
|
|
180
|
+
<MazUiProvider
|
|
181
|
+
:theme="{
|
|
182
|
+
preset: mazUi,
|
|
183
|
+
strategy: 'hybrid',
|
|
184
|
+
colorMode: 'auto',
|
|
185
|
+
}"
|
|
186
|
+
:translations="{
|
|
187
|
+
locale,
|
|
188
|
+
fallbackLocale: 'en',
|
|
189
|
+
messages: { fr },
|
|
190
|
+
}"
|
|
191
|
+
>
|
|
192
|
+
<div class="maz-bg-background maz-text-foreground maz-p-4">
|
|
193
|
+
<h1>My Dashboard</h1>
|
|
194
|
+
<MazBtn color="primary">Action</MazBtn>
|
|
195
|
+
<MazInput placeholder="Search..." />
|
|
196
|
+
</div>
|
|
197
|
+
</MazUiProvider>
|
|
198
|
+
</template>
|
|
199
|
+
```
|
|
@@ -68,7 +68,7 @@ v4.0.0 separates functionality into specialized packages for better modularity:
|
|
|
68
68
|
| **@maz-ui/themes** | Theme system and presets | New |
|
|
69
69
|
| **@maz-ui/translations** | i18n translations | New |
|
|
70
70
|
| **@maz-ui/utils** | JavaScript/TypeScript utilities | New |
|
|
71
|
-
| **@maz-ui/icons** | SVG icons and flags (
|
|
71
|
+
| **@maz-ui/icons** | SVG icons and flags (860+ icons) | New |
|
|
72
72
|
| **@maz-ui/cli** | CLI for theme generation | Renamed |
|
|
73
73
|
| **@maz-ui/nuxt** | Nuxt module | New |
|
|
74
74
|
| **@maz-ui/mcp** | MCP server for IA agent | New |
|
package/docs/src/guide/nuxt.md
CHANGED
|
@@ -445,6 +445,10 @@ export default defineNuxtConfig({
|
|
|
445
445
|
})
|
|
446
446
|
```
|
|
447
447
|
|
|
448
|
+
::: tip Subtree Overrides with MazUiProvider
|
|
449
|
+
You can use [`MazUiProvider`](./maz-ui-provider.md) within a Nuxt app to override theme or translations in a specific subtree, while the module handles global defaults.
|
|
450
|
+
:::
|
|
451
|
+
|
|
448
452
|
## Troubleshooting
|
|
449
453
|
|
|
450
454
|
### Theme System Issues
|
package/docs/src/guide/themes.md
CHANGED
|
@@ -48,6 +48,10 @@ app.use(MazUi, {
|
|
|
48
48
|
})
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
+
::: tip Alternative: MazUiProvider
|
|
52
|
+
You can also initialize the theme via the [`MazUiProvider`](./maz-ui-provider.md) component for lazy-loaded pages or subtree-scoped themes.
|
|
53
|
+
:::
|
|
54
|
+
|
|
51
55
|
### 2. Setup your CSS to support theme foundation and dark mode
|
|
52
56
|
|
|
53
57
|
```css
|
|
@@ -72,6 +72,10 @@ app.use(MazUi, {
|
|
|
72
72
|
})
|
|
73
73
|
```
|
|
74
74
|
|
|
75
|
+
::: tip Alternative: MazUiProvider
|
|
76
|
+
You can also provide translations via the [`MazUiProvider`](./maz-ui-provider.md) component for lazy-loaded pages or subtree-scoped configurations.
|
|
77
|
+
:::
|
|
78
|
+
|
|
75
79
|
## How it works
|
|
76
80
|
|
|
77
81
|
1. 🌍 **You install the MazUi plugin** - This tells your app to use translations
|
package/docs/src/guide/vue.md
CHANGED
|
@@ -41,7 +41,7 @@ yarn add maz-ui @maz-ui/themes
|
|
|
41
41
|
import { MazUi } from 'maz-ui/plugins/maz-ui'
|
|
42
42
|
|
|
43
43
|
import { mazUi } from '@maz-ui/themes'
|
|
44
|
-
import { en } from '@maz-ui/translations'
|
|
44
|
+
import { en } from '@maz-ui/translations/locales'
|
|
45
45
|
|
|
46
46
|
import 'maz-ui/styles'
|
|
47
47
|
|
|
@@ -65,7 +65,8 @@ You must the MazUi plugin to initialize the theme and translations.
|
|
|
65
65
|
```typescript
|
|
66
66
|
import { MazUi } from 'maz-ui/plugins/maz-ui'
|
|
67
67
|
import { mazUi } from '@maz-ui/themes/presets'
|
|
68
|
-
import { fr } from '@maz-ui/translations'
|
|
68
|
+
import { fr } from '@maz-ui/translations/locales'
|
|
69
|
+
// or import fr from '@maz-ui/translations/locales/fr'
|
|
69
70
|
|
|
70
71
|
// Import Maz-UI styles before your own CSS
|
|
71
72
|
import 'maz-ui/styles'
|
|
@@ -108,6 +109,10 @@ app.use(MazUi, {
|
|
|
108
109
|
app.mount('#app')
|
|
109
110
|
```
|
|
110
111
|
|
|
112
|
+
::: tip Alternative: MazUiProvider
|
|
113
|
+
If Maz-UI is only used on specific pages, you can use the [`MazUiProvider`](./maz-ui-provider.md) component instead of the plugin to keep Maz-UI out of your entry bundle.
|
|
114
|
+
:::
|
|
115
|
+
|
|
111
116
|
## Using your first component
|
|
112
117
|
|
|
113
118
|
Let's start with a simple button to see Maz-UI in action:
|
package/docs/src/index.md
CHANGED
|
@@ -239,7 +239,7 @@ description: Build amazing interfaces with Maz-UI - standalone components & tool
|
|
|
239
239
|
</div>
|
|
240
240
|
<h3 class="maz-text-base maz-font-semibold">@maz-ui/icons</h3>
|
|
241
241
|
<p class="dark:maz-text-gray-300 maz-text-muted maz-text-sm">
|
|
242
|
-
|
|
242
|
+
860+ beautiful SVG icons ready for Vue. Multiple usage patterns: components, direct SVG files, or auto-import.
|
|
243
243
|
</p>
|
|
244
244
|
<div class="maz-flex-1"></div>
|
|
245
245
|
<MazBtn color="background" outlined size="sm" block href="/guide/icons">Discover</MazBtn>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maz-ui/mcp",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.7.0-beta.0",
|
|
5
5
|
"description": "Maz-UI ModelContextProtocol Client",
|
|
6
6
|
"author": "Louis Mazel <me@loicmazuel.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
"docs"
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
44
|
+
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
45
45
|
"@maz-ui/node": "4.6.1",
|
|
46
|
-
"@maz-ui/utils": "4.
|
|
46
|
+
"@maz-ui/utils": "4.7.0-beta.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@modelcontextprotocol/inspector": "^0.
|
|
49
|
+
"@modelcontextprotocol/inspector": "^0.20.0",
|
|
50
50
|
"@swc/core": "1.15.11",
|
|
51
51
|
"eslint": "^9.39.2",
|
|
52
52
|
"lint-staged": "^16.2.7",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"ts-node-maintained": "^10.9.5",
|
|
55
55
|
"tsx": "^4.21.0",
|
|
56
56
|
"unbuild": "^3.6.1",
|
|
57
|
-
"@maz-ui/eslint-config": "4.
|
|
57
|
+
"@maz-ui/eslint-config": "4.7.0-beta.0"
|
|
58
58
|
},
|
|
59
59
|
"lint-staged": {
|
|
60
60
|
"*.{js,ts,mjs,mts,cjs,md,yml,json}": "cross-env NODE_ENV=production eslint --fix"
|