@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,481 @@
|
|
|
1
|
+
# @maz-ui/icons
|
|
2
|
+
|
|
3
|
+
A comprehensive collection of **328 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
|
+
|
|
5
|
+
## ✨ Features
|
|
6
|
+
|
|
7
|
+
- 🎯 **300+ icons** - Comprehensive set covering all common use cases
|
|
8
|
+
- 📦 **Multiple usage patterns** - Direct SVG files, Vue components, or auto-import
|
|
9
|
+
- 🔧 **TypeScript support** - Full type definitions included
|
|
10
|
+
- ⚡️ **Tree-shakeable** - Import only the icons you need
|
|
11
|
+
- 🎨 **Customizable** - Easy to style with CSS
|
|
12
|
+
- 📱 **Optimized SVGs** - Clean, minimal markup for best performance
|
|
13
|
+
- 🔌 **Auto-import resolver** - Seamless integration with unplugin-vue-components
|
|
14
|
+
- 🛠️ **Build tool integration** - Works perfectly with Vite and vite-svg-loader
|
|
15
|
+
|
|
16
|
+
## 🚀 Installation
|
|
17
|
+
|
|
18
|
+
### Basic Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @maz-ui/icons
|
|
22
|
+
# or
|
|
23
|
+
yarn add @maz-ui/icons
|
|
24
|
+
# or
|
|
25
|
+
pnpm add @maz-ui/icons
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### With Auto-import Support (Recommended)
|
|
29
|
+
|
|
30
|
+
For the best developer experience with auto-imports:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @maz-ui/icons unplugin-vue-components
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### With vite-svg-loader Integration
|
|
37
|
+
|
|
38
|
+
To use SVG files as Vue components:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npm install @maz-ui/icons vite-svg-loader
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## 📖 Usage Methods
|
|
45
|
+
|
|
46
|
+
### Method 1: Vue Components (Recommended)
|
|
47
|
+
|
|
48
|
+
Import and use icons as Vue components:
|
|
49
|
+
|
|
50
|
+
```vue
|
|
51
|
+
<script setup lang="ts">
|
|
52
|
+
import { MazCheck, MazHeart, MazUser } from '@maz-ui/icons'
|
|
53
|
+
</script>
|
|
54
|
+
|
|
55
|
+
<template>
|
|
56
|
+
<div>
|
|
57
|
+
<MazCheck class="text-green-500" />
|
|
58
|
+
<MazUser class="w-6 h-6" />
|
|
59
|
+
<MazHeart class="text-red-500 hover:scale-110 transition-transform" />
|
|
60
|
+
</div>
|
|
61
|
+
</template>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
**Benefits:**
|
|
65
|
+
|
|
66
|
+
- ✅ Tree-shaking - Only bundled icons are included
|
|
67
|
+
- ✅ TypeScript support with full IntelliSense
|
|
68
|
+
- ✅ Vue 3 optimized with `defineAsyncComponent`
|
|
69
|
+
- ✅ Easy to style with CSS classes
|
|
70
|
+
|
|
71
|
+
### Method 2: Direct SVG Files
|
|
72
|
+
|
|
73
|
+
Access SVG files directly for maximum flexibility:
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import { onMounted, ref } from 'vue'
|
|
78
|
+
|
|
79
|
+
const checkSvg = ref('')
|
|
80
|
+
|
|
81
|
+
onMounted(async () => {
|
|
82
|
+
const response = await fetch('/node_modules/@maz-ui/icons/svg/check.svg')
|
|
83
|
+
checkSvg.value = await response.text()
|
|
84
|
+
})
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<div>
|
|
89
|
+
<!-- Using img tag -->
|
|
90
|
+
<img src="@maz-ui/icons/svg/check.svg" alt="Check" class="w-6 h-6">
|
|
91
|
+
|
|
92
|
+
<!-- Inline SVG with fetch -->
|
|
93
|
+
<div class="text-blue-500" v-html="checkSvg" />
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
**Benefits:**
|
|
99
|
+
|
|
100
|
+
- ✅ Direct file access
|
|
101
|
+
- ✅ Smallest possible bundle size
|
|
102
|
+
- ✅ Can be used in any context (not just Vue)
|
|
103
|
+
- ✅ Easy to embed in CSS or other assets
|
|
104
|
+
|
|
105
|
+
### Method 3: With vite-svg-loader
|
|
106
|
+
|
|
107
|
+
Transform SVG files into Vue components at build time:
|
|
108
|
+
|
|
109
|
+
#### Vite Configuration
|
|
110
|
+
|
|
111
|
+
```ts
|
|
112
|
+
import vue from '@vitejs/plugin-vue'
|
|
113
|
+
// vite.config.ts
|
|
114
|
+
import { defineConfig } from 'vite'
|
|
115
|
+
import svgLoader from 'vite-svg-loader'
|
|
116
|
+
|
|
117
|
+
export default defineConfig({
|
|
118
|
+
plugins: [
|
|
119
|
+
vue(),
|
|
120
|
+
svgLoader({
|
|
121
|
+
defaultImport: 'component' // Import as Vue component by default
|
|
122
|
+
})
|
|
123
|
+
]
|
|
124
|
+
})
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
#### Usage in Components
|
|
128
|
+
|
|
129
|
+
```vue
|
|
130
|
+
<script setup lang="ts">
|
|
131
|
+
// Import SVGs as Vue components
|
|
132
|
+
import CheckIcon from '@maz-ui/icons/svg/check.svg?component'
|
|
133
|
+
import HeartIcon from '@maz-ui/icons/svg/heart.svg?component'
|
|
134
|
+
import UserIcon from '@maz-ui/icons/svg/user.svg?component'
|
|
135
|
+
</script>
|
|
136
|
+
|
|
137
|
+
<template>
|
|
138
|
+
<div class="flex items-center gap-2">
|
|
139
|
+
<CheckIcon class="w-5 h-5 text-green-600" />
|
|
140
|
+
<UserIcon class="w-6 h-6 text-blue-500" />
|
|
141
|
+
<HeartIcon class="w-4 h-4 text-red-500 animate-pulse" />
|
|
142
|
+
</div>
|
|
143
|
+
</template>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Benefits:**
|
|
147
|
+
|
|
148
|
+
- ✅ Build-time optimization
|
|
149
|
+
- ✅ Full Vue component features (props, slots, etc.)
|
|
150
|
+
- ✅ Better performance than runtime imports
|
|
151
|
+
- ✅ Automatic TypeScript declarations
|
|
152
|
+
|
|
153
|
+
### Method 4: Auto-import with Resolver
|
|
154
|
+
|
|
155
|
+
Never worry about imports again with automatic component resolution:
|
|
156
|
+
|
|
157
|
+
#### Setup unplugin-vue-components
|
|
158
|
+
|
|
159
|
+
```ts
|
|
160
|
+
import { MazIconsResolver } from '@maz-ui/icons/resolvers'
|
|
161
|
+
import vue from '@vitejs/plugin-vue'
|
|
162
|
+
import Components from 'unplugin-vue-components/vite'
|
|
163
|
+
// vite.config.ts
|
|
164
|
+
import { defineConfig } from 'vite'
|
|
165
|
+
|
|
166
|
+
export default defineConfig({
|
|
167
|
+
plugins: [
|
|
168
|
+
vue(),
|
|
169
|
+
Components({
|
|
170
|
+
resolvers: [
|
|
171
|
+
MazIconsResolver() // Auto-import Maz UI icons
|
|
172
|
+
]
|
|
173
|
+
})
|
|
174
|
+
]
|
|
175
|
+
})
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### Usage (No Imports Required!)
|
|
179
|
+
|
|
180
|
+
```vue
|
|
181
|
+
<script setup lang="ts">
|
|
182
|
+
// No imports needed! Icons are auto-imported
|
|
183
|
+
</script>
|
|
184
|
+
|
|
185
|
+
<template>
|
|
186
|
+
<div class="navigation">
|
|
187
|
+
<!-- Icons are automatically imported when used -->
|
|
188
|
+
<MazHome class="nav-icon" />
|
|
189
|
+
<MazUser class="nav-icon" />
|
|
190
|
+
<MazSettings class="nav-icon" />
|
|
191
|
+
<MazLogout class="nav-icon" />
|
|
192
|
+
</div>
|
|
193
|
+
</template>
|
|
194
|
+
|
|
195
|
+
<style scoped>
|
|
196
|
+
.nav-icon {
|
|
197
|
+
@apply w-6 h-6 text-gray-600 hover:text-blue-500 transition-colors cursor-pointer;
|
|
198
|
+
}
|
|
199
|
+
</style>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Benefits:**
|
|
203
|
+
|
|
204
|
+
- ✅ Zero import boilerplate
|
|
205
|
+
- ✅ Full TypeScript support
|
|
206
|
+
- ✅ Tree-shaking still works
|
|
207
|
+
- ✅ IntelliSense for all available icons
|
|
208
|
+
|
|
209
|
+
## 🎨 Styling Icons
|
|
210
|
+
|
|
211
|
+
Icons inherit the current text color and can be styled like any other element:
|
|
212
|
+
|
|
213
|
+
```vue
|
|
214
|
+
<template>
|
|
215
|
+
<div class="icon-examples">
|
|
216
|
+
<!-- Size control -->
|
|
217
|
+
<MazStar class="w-4 h-4" />
|
|
218
|
+
<MazStar class="w-8 h-8" />
|
|
219
|
+
<MazStar class="text-2xl" />
|
|
220
|
+
|
|
221
|
+
<!-- Colors -->
|
|
222
|
+
<MazHeart class="text-red-500" />
|
|
223
|
+
<MazLeaf class="text-green-600" />
|
|
224
|
+
<MazSky class="text-blue-400" />
|
|
225
|
+
|
|
226
|
+
<!-- Interactive states -->
|
|
227
|
+
<MazButton class="hover:text-blue-500 transition-colors cursor-pointer" />
|
|
228
|
+
|
|
229
|
+
<!-- Animations -->
|
|
230
|
+
<MazSpinner class="animate-spin" />
|
|
231
|
+
<MazHeart class="hover:scale-110 transition-transform" />
|
|
232
|
+
|
|
233
|
+
<!-- With background -->
|
|
234
|
+
<MazCheck class="p-2 bg-green-100 text-green-600 rounded-full" />
|
|
235
|
+
</div>
|
|
236
|
+
</template>
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### CSS Custom Properties
|
|
240
|
+
|
|
241
|
+
All icons support CSS custom properties for advanced styling:
|
|
242
|
+
|
|
243
|
+
```css
|
|
244
|
+
.custom-icon {
|
|
245
|
+
--icon-size: 1.5rem;
|
|
246
|
+
--icon-color: theme('colors.blue.500');
|
|
247
|
+
--icon-hover-color: theme('colors.blue.600');
|
|
248
|
+
|
|
249
|
+
width: var(--icon-size);
|
|
250
|
+
height: var(--icon-size);
|
|
251
|
+
color: var(--icon-color);
|
|
252
|
+
transition: color 0.2s ease;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.custom-icon:hover {
|
|
256
|
+
color: var(--icon-hover-color);
|
|
257
|
+
}
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
## 📋 Available Icons
|
|
261
|
+
|
|
262
|
+
The library includes **300+ carefully** covering all common use cases:
|
|
263
|
+
|
|
264
|
+
### Icon Naming Convention
|
|
265
|
+
|
|
266
|
+
All icons follow a consistent naming pattern:
|
|
267
|
+
|
|
268
|
+
- Vue components: `Maz` + PascalCase (e.g., `MazUserCircle`)
|
|
269
|
+
- SVG files: kebab-case (e.g., `user-circle.svg`)
|
|
270
|
+
|
|
271
|
+
```typescript
|
|
272
|
+
// Component imports
|
|
273
|
+
import {
|
|
274
|
+
MazArrowRight, // arrow-right.svg
|
|
275
|
+
MazChatBubbleLeft, // chat-bubble-left.svg
|
|
276
|
+
MazShoppingCart, // shopping-cart.svg
|
|
277
|
+
MazUserCircle // user-circle.svg
|
|
278
|
+
} from '@maz-ui/icons'
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
You can search icons on [Heroicons](https://heroicons.com/) and copy the name of the icon to use it in your project.
|
|
282
|
+
|
|
283
|
+
## 🔧 Advanced Configuration
|
|
284
|
+
|
|
285
|
+
### Custom Icon Loading
|
|
286
|
+
|
|
287
|
+
Create your own icon loading utility:
|
|
288
|
+
|
|
289
|
+
```typescript
|
|
290
|
+
// utils/iconLoader.ts
|
|
291
|
+
import type { Component } from 'vue'
|
|
292
|
+
import { defineAsyncComponent } from 'vue'
|
|
293
|
+
|
|
294
|
+
interface IconComponents {
|
|
295
|
+
[key: string]: Component
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function createIconLoader(iconNames: string[]): IconComponents {
|
|
299
|
+
const icons: IconComponents = {}
|
|
300
|
+
|
|
301
|
+
iconNames.forEach((name) => {
|
|
302
|
+
const componentName = `Maz${name.split('-').map(
|
|
303
|
+
word => word.charAt(0).toUpperCase() + word.slice(1)
|
|
304
|
+
).join('')}`
|
|
305
|
+
|
|
306
|
+
icons[componentName] = defineAsyncComponent(
|
|
307
|
+
() => import(`@maz-ui/icons/svg/${name}.svg?component`)
|
|
308
|
+
)
|
|
309
|
+
})
|
|
310
|
+
|
|
311
|
+
return icons
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// Usage
|
|
315
|
+
const icons = createIconLoader(['check', 'user', 'heart'])
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### Dynamic Icon Loading
|
|
319
|
+
|
|
320
|
+
Load icons dynamically based on runtime conditions:
|
|
321
|
+
|
|
322
|
+
```vue
|
|
323
|
+
<script setup lang="ts">
|
|
324
|
+
import { computed, defineAsyncComponent } from 'vue'
|
|
325
|
+
|
|
326
|
+
interface Props {
|
|
327
|
+
name: string
|
|
328
|
+
size?: 'sm' | 'md' | 'lg'
|
|
329
|
+
color?: string
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
333
|
+
size: 'md',
|
|
334
|
+
color: 'currentColor'
|
|
335
|
+
})
|
|
336
|
+
|
|
337
|
+
const iconComponent = computed(() => {
|
|
338
|
+
return defineAsyncComponent(
|
|
339
|
+
() => import(`@maz-ui/icons/svg/${props.name}.svg?component`)
|
|
340
|
+
)
|
|
341
|
+
})
|
|
342
|
+
|
|
343
|
+
const iconClass = computed(() => {
|
|
344
|
+
const sizes = {
|
|
345
|
+
sm: 'w-4 h-4',
|
|
346
|
+
md: 'w-6 h-6',
|
|
347
|
+
lg: 'w-8 h-8'
|
|
348
|
+
}
|
|
349
|
+
return `${sizes[props.size]} text-${props.color}`
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
function handleClick() {
|
|
353
|
+
console.log(`Clicked ${props.name} icon`)
|
|
354
|
+
}
|
|
355
|
+
</script>
|
|
356
|
+
|
|
357
|
+
<template>
|
|
358
|
+
<component
|
|
359
|
+
:is="iconComponent"
|
|
360
|
+
:class="iconClass"
|
|
361
|
+
@click="handleClick"
|
|
362
|
+
/>
|
|
363
|
+
</template>
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
### Build-time Icon Optimization
|
|
367
|
+
|
|
368
|
+
Optimize icons at build time with custom Vite plugin:
|
|
369
|
+
|
|
370
|
+
```typescript
|
|
371
|
+
// vite-plugin-icon-optimizer.ts
|
|
372
|
+
import type { Plugin } from 'vite'
|
|
373
|
+
import { readFileSync } from 'node:fs'
|
|
374
|
+
import { optimize } from 'svgo'
|
|
375
|
+
|
|
376
|
+
export function iconOptimizer(): Plugin {
|
|
377
|
+
return {
|
|
378
|
+
name: 'icon-optimizer',
|
|
379
|
+
transform(code, id) {
|
|
380
|
+
if (id.includes('@maz-ui/icons/svg') && id.endsWith('.svg')) {
|
|
381
|
+
const svgContent = readFileSync(id.replace('?component', ''), 'utf-8')
|
|
382
|
+
const optimized = optimize(svgContent, {
|
|
383
|
+
plugins: [
|
|
384
|
+
'removeDoctype',
|
|
385
|
+
'removeComments',
|
|
386
|
+
'removeEmptyElements',
|
|
387
|
+
'mergePaths'
|
|
388
|
+
]
|
|
389
|
+
})
|
|
390
|
+
|
|
391
|
+
return `export default ${JSON.stringify(optimized.data)}`
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## 🏗️ Integration Examples
|
|
399
|
+
|
|
400
|
+
### With Tailwind CSS
|
|
401
|
+
|
|
402
|
+
```vue
|
|
403
|
+
<template>
|
|
404
|
+
<div class="flex items-center space-x-4">
|
|
405
|
+
<MazHome class="w-5 h-5 text-gray-500 hover:text-blue-500 transition-colors" />
|
|
406
|
+
<MazUser class="w-6 h-6 text-indigo-600" />
|
|
407
|
+
<MazSettings class="w-4 h-4 text-gray-400 hover:text-gray-600" />
|
|
408
|
+
</div>
|
|
409
|
+
</template>
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### With Pinia Store
|
|
413
|
+
|
|
414
|
+
```typescript
|
|
415
|
+
import type { Component } from 'vue'
|
|
416
|
+
// stores/icons.ts
|
|
417
|
+
import { defineStore } from 'pinia'
|
|
418
|
+
|
|
419
|
+
export const useIconStore = defineStore('icons', () => {
|
|
420
|
+
const loadedIcons = ref<Map<string, Component>>(new Map())
|
|
421
|
+
|
|
422
|
+
async function loadIcon(name: string): Promise<Component> {
|
|
423
|
+
if (loadedIcons.value.has(name)) {
|
|
424
|
+
return loadedIcons.value.get(name)!
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
const icon = await import(`@maz-ui/icons/svg/${name}.svg?component`)
|
|
428
|
+
loadedIcons.value.set(name, icon.default)
|
|
429
|
+
return icon.default
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return { loadIcon }
|
|
433
|
+
})
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
## 🐛 Troubleshooting
|
|
437
|
+
|
|
438
|
+
### Common Issues
|
|
439
|
+
|
|
440
|
+
**Icons not displaying:**
|
|
441
|
+
|
|
442
|
+
- Ensure SVG files are properly served by your build tool
|
|
443
|
+
- Check if CSS `currentColor` is being inherited correctly
|
|
444
|
+
- Verify vite-svg-loader configuration if using component imports
|
|
445
|
+
|
|
446
|
+
**TypeScript errors:**
|
|
447
|
+
|
|
448
|
+
- Add `vite-svg-loader` types to your `tsconfig.json`:
|
|
449
|
+
|
|
450
|
+
```json
|
|
451
|
+
{
|
|
452
|
+
"compilerOptions": {
|
|
453
|
+
"types": ["vite-svg-loader"]
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
**Auto-import not working:**
|
|
459
|
+
|
|
460
|
+
- Verify `unplugin-vue-components` is properly configured
|
|
461
|
+
- Check that `MazIconsResolver` is included in resolvers array
|
|
462
|
+
- Ensure icon names match the exact component names
|
|
463
|
+
|
|
464
|
+
## 📦 Bundle Size
|
|
465
|
+
|
|
466
|
+
| Usage Method | Bundle Impact | Best For |
|
|
467
|
+
| --------------- | ------------- | ----------------------------- |
|
|
468
|
+
| Direct SVG | Minimal | Static usage, minimal bundles |
|
|
469
|
+
| Vue Components | Tree-shaken | Dynamic usage, Vue apps |
|
|
470
|
+
| Auto-import | Tree-shaken | Development experience |
|
|
471
|
+
| vite-svg-loader | Optimized | Build-time optimization |
|
|
472
|
+
|
|
473
|
+
## 🔗 Related Packages
|
|
474
|
+
|
|
475
|
+
- [Heroicons](https://heroicons.com/) - Tailwind CSS icons
|
|
476
|
+
- [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components) - Auto-import components
|
|
477
|
+
- [`vite-svg-loader`](https://github.com/jpkleemans/vite-svg-loader) - Load SVG as Vue components
|
|
478
|
+
|
|
479
|
+
---
|
|
480
|
+
|
|
481
|
+
**Need help?** Check out our [GitHub discussions](https://github.com/LouisMazel/maz-ui/discussions) or open an [issue](https://github.com/LouisMazel/maz-ui/issues).
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Model Context Protocol (MCP)
|
|
3
|
+
description: Connect Maz-UI with AI assistants using Model Context Protocol - Get intelligent help with components, guides, composables, directives, plugins, and helpers
|
|
4
|
+
head:
|
|
5
|
+
- - meta
|
|
6
|
+
- name: keywords
|
|
7
|
+
content: mcp, model context protocol, ai assistant, claude, cline, maz-ui integration, ai development
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# {{ $frontmatter.title }}
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
<NpmBadge package="@maz-ui/mcp" />
|
|
15
|
+
|
|
16
|
+
Connect your AI assistant directly to Maz-UI's documentation and get intelligent help with components, composables, directives, plugins, helpers, and best practices.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
- [{{ $frontmatter.title }}](#-frontmattertitle-)
|
|
21
|
+
- [What is MCP?](#what-is-mcp)
|
|
22
|
+
- [AI Assistant Configuration](#ai-assistant-configuration)
|
|
23
|
+
- [Claude Code](#claude-code)
|
|
24
|
+
- [Claude Desktop](#claude-desktop)
|
|
25
|
+
- [Cursor IDE](#cursor-ide)
|
|
26
|
+
- [Windsurf](#windsurf)
|
|
27
|
+
- [Visual Studio Code (Copilot)](#visual-studio-code-copilot)
|
|
28
|
+
- [Cline](#cline)
|
|
29
|
+
- [Available Resources](#available-resources)
|
|
30
|
+
|
|
31
|
+
## What is MCP?
|
|
32
|
+
|
|
33
|
+
Think of MCP (Model Context Protocol) as a **smart bridge** between your AI assistant and Maz-UI. It's like giving your AI assistant a direct phone line to all of Maz-UI's documentation!
|
|
34
|
+
|
|
35
|
+
Instead of asking *"How do I use MazBtn?"* and getting generic answers or answers based on old documentation, your AI can now:
|
|
36
|
+
- 🔍 **Search** through all 50+ Maz-UI components and others
|
|
37
|
+
- 📖 **Read** the exact documentation for any component, composables, directives, plugins, helpers, and best practices
|
|
38
|
+
- 💡 **Suggest** the best way to implement your needs
|
|
39
|
+
- 🛠️ **Help** with implementation examples
|
|
40
|
+
|
|
41
|
+
::: tip Maz-UI provides a free MCP server with access to:
|
|
42
|
+
|
|
43
|
+
- 50+ Vue components documentation
|
|
44
|
+
- 14+ composables and utilities
|
|
45
|
+
- 11 comprehensive guides
|
|
46
|
+
- 5 directives and 4 plugins
|
|
47
|
+
- 20+ helper functions
|
|
48
|
+
|
|
49
|
+
:::
|
|
50
|
+
|
|
51
|
+
## AI Assistant Configuration
|
|
52
|
+
|
|
53
|
+
### Claude Code
|
|
54
|
+
|
|
55
|
+
1. Run the following command:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
claude mcp add maz-ui npx @maz-ui/mcp --scope (project | local | user)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
2. Will add the following to your `~/.mcp.json` (for project scope):
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"mcpServers": {
|
|
66
|
+
"maz-ui": {
|
|
67
|
+
"type": "stdio",
|
|
68
|
+
"command": "npx",
|
|
69
|
+
"args": ["@maz-ui/mcp"]
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
3. Restart Claude code to apply the new configuration.
|
|
76
|
+
|
|
77
|
+
### Claude Desktop
|
|
78
|
+
|
|
79
|
+
1. Open Claude desktop and navigate to Settings.
|
|
80
|
+
|
|
81
|
+
2. Under the Developer tab, tap Edit Config to open the configuration file.
|
|
82
|
+
|
|
83
|
+
3. Add the following configuration:
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"mcpServers": {
|
|
88
|
+
"maz-ui": {
|
|
89
|
+
"type": "stdio",
|
|
90
|
+
"command": "npx",
|
|
91
|
+
"args": ["@maz-ui/mcp"]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
4. Save the configuration file and restart Claude desktop.
|
|
98
|
+
|
|
99
|
+
5. From the new chat screen, you should see a hammer (MCP) icon appear with the new MCP server available.
|
|
100
|
+
|
|
101
|
+
### Cursor IDE
|
|
102
|
+
|
|
103
|
+
1. Open Cursor and create a .cursor directory in your project root if it doesn't exist.
|
|
104
|
+
|
|
105
|
+
2. Create a .cursor/mcp.json file if it doesn't exist and open it.
|
|
106
|
+
|
|
107
|
+
3. Add the following configuration:
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"mcpServers": {
|
|
112
|
+
"maz-ui": {
|
|
113
|
+
"command": "npx",
|
|
114
|
+
"args": ["@maz-ui/mcp"]
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
4. Save the configuration file.
|
|
121
|
+
|
|
122
|
+
5. Open Cursor and navigate to Settings/MCP. You should see a green active status after the server is successfully connected.
|
|
123
|
+
|
|
124
|
+
### Windsurf
|
|
125
|
+
|
|
126
|
+
1. Open Windsurf and navigate to the Cascade assistant.
|
|
127
|
+
|
|
128
|
+
2. Tap on the hammer (MCP) icon, then Configure to open the configuration file.
|
|
129
|
+
|
|
130
|
+
3. Add the following configuration:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"mcpServers": {
|
|
135
|
+
"maz-ui": {
|
|
136
|
+
"command": "npx",
|
|
137
|
+
"args": ["@maz-ui/mcp"]
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
4. Save the configuration file and reload by tapping Refresh in the Cascade assistant.
|
|
144
|
+
|
|
145
|
+
5. You should see a green active status after the server is successfully connected.
|
|
146
|
+
|
|
147
|
+
### Visual Studio Code (Copilot)
|
|
148
|
+
|
|
149
|
+
1. Open VS Code and create a .vscode directory in your project root if it doesn't exist.
|
|
150
|
+
|
|
151
|
+
2. Create a .vscode/mcp.json file if it doesn't exist and open it.
|
|
152
|
+
|
|
153
|
+
3. Add the following configuration:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"servers": {
|
|
158
|
+
"maz-ui": {
|
|
159
|
+
"command": "npx",
|
|
160
|
+
"args": ["@maz-ui/mcp"]
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
4. Save the configuration file.
|
|
167
|
+
|
|
168
|
+
5. Open Copilot chat and switch to "Agent" mode. You should see a tool icon that you can tap to confirm the MCP tools are available. Once you begin using the server, you will be prompted to enter your personal access token. Enter the token that you created earlier.
|
|
169
|
+
|
|
170
|
+
### Cline
|
|
171
|
+
|
|
172
|
+
1. Open the Cline extension in VS Code and tap the MCP Servers icon.
|
|
173
|
+
|
|
174
|
+
2. Tap Configure MCP Servers to open the configuration file.
|
|
175
|
+
|
|
176
|
+
3. Add the following configuration:
|
|
177
|
+
|
|
178
|
+
```json
|
|
179
|
+
{
|
|
180
|
+
"mcpServers": {
|
|
181
|
+
"maz-ui": {
|
|
182
|
+
"command": "npx",
|
|
183
|
+
"args": ["@maz-ui/mcp"]
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
4. Save the configuration file. Cline should automatically reload the configuration.
|
|
190
|
+
|
|
191
|
+
5. You should see a green active status after the server is successfully connected.
|
|
192
|
+
|
|
193
|
+
## Available Resources
|
|
194
|
+
|
|
195
|
+
Your AI assistant now has access to:
|
|
196
|
+
|
|
197
|
+
| Resource Type | Count | Description |
|
|
198
|
+
|---------------|-------|-------------|
|
|
199
|
+
| **Components** | 50+ | All Vue components with props, events, and examples |
|
|
200
|
+
| **Guides** | 11 | Installation, theming, migration, and best practices |
|
|
201
|
+
| **Composables** | 14+ | Reusable Vue composition functions |
|
|
202
|
+
| **Directives** | 5 | Vue directives for enhanced functionality |
|
|
203
|
+
| **Plugins** | 4 | Toast, dialog, AOS, and wait overlay systems |
|
|
204
|
+
| **Helpers** | 20+ | Utility functions for common tasks |
|
|
205
|
+
|
|
206
|
+
::: warning 🔒 Security Note
|
|
207
|
+
The MCP server provides read-only access to documentation. No sensitive data is transmitted or stored.
|
|
208
|
+
:::
|
|
209
|
+
|
|
210
|
+
Happy coding with AI-powered Maz-UI assistance! 🚀✨
|