@maz-ui/mcp 4.9.3 → 5.0.0-beta.1
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-alert.doc.md +1 -1
- package/docs/generated-docs/maz-avatar.doc.md +1 -1
- package/docs/generated-docs/maz-badge.doc.md +8 -8
- package/docs/generated-docs/maz-btn.doc.md +26 -26
- package/docs/generated-docs/maz-card.doc.md +19 -19
- package/docs/generated-docs/maz-chart.doc.md +8 -8
- package/docs/generated-docs/maz-container.doc.md +20 -20
- package/docs/generated-docs/maz-drawer.doc.md +8 -8
- package/docs/generated-docs/maz-dropdown.doc.md +1 -1
- package/docs/generated-docs/maz-dropzone.doc.md +2 -2
- package/docs/generated-docs/maz-gallery.doc.md +15 -15
- package/docs/generated-docs/maz-icon.doc.md +11 -14
- package/docs/generated-docs/maz-input.doc.md +38 -38
- package/docs/generated-docs/maz-lazy-img.doc.md +18 -0
- package/docs/generated-docs/maz-link.doc.md +9 -9
- package/docs/generated-docs/maz-pagination.doc.md +9 -9
- package/docs/generated-docs/maz-popover.doc.md +5 -1
- package/docs/generated-docs/maz-radio-buttons.doc.md +17 -17
- package/docs/generated-docs/maz-select.doc.md +2 -2
- package/docs/generated-docs/maz-skeleton.doc.md +10 -10
- package/docs/generated-docs/maz-table.doc.md +37 -37
- package/docs/generated-docs/maz-textarea.doc.md +1 -1
- package/docs/generated-docs/maz-timeline.doc.md +1 -1
- package/docs/src/blog/v4.md +7 -7
- package/docs/src/blog/v5.md +186 -0
- package/docs/src/components/maz-accordion.md +1 -1
- package/docs/src/components/maz-alert.md +15 -15
- package/docs/src/components/maz-animated-counter.md +4 -4
- package/docs/src/components/maz-avatar.md +2 -2
- package/docs/src/components/maz-backdrop.md +7 -7
- package/docs/src/components/maz-badge.md +16 -34
- package/docs/src/components/maz-bottom-sheet.md +74 -74
- package/docs/src/components/maz-btn-group.md +17 -17
- package/docs/src/components/maz-btn.md +129 -96
- package/docs/src/components/maz-card-spotlight.md +5 -5
- package/docs/src/components/maz-card.md +20 -20
- package/docs/src/components/maz-carousel.md +14 -14
- package/docs/src/components/maz-chart.md +23 -4
- package/docs/src/components/maz-checkbox.md +3 -3
- package/docs/src/components/maz-checklist.md +19 -19
- package/docs/src/components/maz-circular-progress-bar.md +4 -4
- package/docs/src/components/maz-container.md +52 -37
- package/docs/src/components/maz-date-picker.md +7 -7
- package/docs/src/components/maz-dialog-confirm.md +2 -2
- package/docs/src/components/maz-drawer.md +14 -14
- package/docs/src/components/maz-dropdown.md +27 -12
- package/docs/src/components/maz-dropzone.md +6 -6
- package/docs/src/components/maz-expand-animation.md +2 -2
- package/docs/src/components/maz-fullscreen-loader.md +2 -2
- package/docs/src/components/maz-gallery.md +1 -1
- package/docs/src/components/maz-icon.md +113 -60
- package/docs/src/components/maz-input-code.md +1 -1
- package/docs/src/components/maz-input-phone-number.md +89 -88
- package/docs/src/components/maz-input-tags.md +2 -2
- package/docs/src/components/maz-input.md +42 -12
- package/docs/src/components/maz-link.md +28 -12
- package/docs/src/components/maz-pagination.md +2 -2
- package/docs/src/components/maz-popover.md +236 -236
- package/docs/src/components/maz-pull-to-refresh.md +2 -2
- package/docs/src/components/maz-radio-buttons.md +11 -11
- package/docs/src/components/maz-radio.md +3 -3
- package/docs/src/components/maz-read-more.md +7 -7
- package/docs/src/components/maz-select-country.md +26 -26
- package/docs/src/components/maz-select.md +1 -1
- package/docs/src/components/maz-skeleton.md +25 -25
- package/docs/src/components/maz-spinner.md +2 -2
- package/docs/src/components/maz-stepper.md +5 -5
- package/docs/src/components/maz-switch.md +1 -1
- package/docs/src/components/maz-table.md +10 -10
- package/docs/src/components/maz-tabs.md +17 -17
- package/docs/src/components/maz-textarea.md +8 -8
- package/docs/src/components/maz-ticker.md +37 -37
- package/docs/src/components/maz-timeline.md +9 -9
- package/docs/src/composables/use-dialog.md +1 -1
- package/docs/src/composables/use-display-names.md +2 -2
- package/docs/src/composables/use-form-validator.md +35 -35
- package/docs/src/composables/use-idle-timeout.md +3 -3
- package/docs/src/composables/use-reading-time.md +5 -5
- package/docs/src/composables/use-string-matching.md +4 -4
- package/docs/src/composables/use-swipe.md +3 -3
- package/docs/src/composables/use-timer.md +3 -3
- package/docs/src/composables/use-toast.md +1 -1
- package/docs/src/composables/use-user-visibility.md +1 -1
- package/docs/src/composables/use-wait.md +2 -2
- package/docs/src/directives/click-outside.md +17 -17
- package/docs/src/directives/lazy-img.md +5 -5
- package/docs/src/directives/tooltip.md +15 -15
- package/docs/src/directives/zoom-img.md +1 -1
- package/docs/src/ecosystem/eslint-config.md +187 -0
- package/docs/src/ecosystem/stylelint-config.md +302 -0
- package/docs/src/guide/browser-support.md +81 -0
- package/docs/src/guide/getting-started.md +23 -16
- package/docs/src/guide/icon-set.md +11 -11
- package/docs/src/guide/icons.md +32 -5
- package/docs/src/guide/maz-ui-provider.md +6 -6
- package/docs/src/guide/migration-v4.md +3 -3
- package/docs/src/guide/migration-v5.md +662 -0
- package/docs/src/guide/nuxt.md +27 -44
- package/docs/src/guide/resolvers.md +2 -2
- package/docs/src/guide/tailwind.md +154 -0
- package/docs/src/guide/themes.md +258 -485
- package/docs/src/guide/vue.md +8 -5
- package/docs/src/helpers/capitalize.md +4 -4
- package/docs/src/helpers/country-code-to-unicode-flag.md +37 -37
- package/docs/src/helpers/currency.md +4 -4
- package/docs/src/helpers/date.md +4 -4
- package/docs/src/helpers/get-country-flag-url.md +9 -9
- package/docs/src/helpers/number.md +5 -5
- package/docs/src/index.md +296 -266
- package/docs/src/made-with-maz-ui.md +5 -5
- package/docs/src/plugins/aos.md +6 -6
- package/docs/src/plugins/dialog.md +4 -4
- package/docs/src/plugins/toast.md +3 -3
- package/docs/src/plugins/wait.md +1 -1
- package/package.json +5 -5
|
@@ -32,7 +32,7 @@ The simplest way to use MazInputPhoneNumber - just add it and it works!
|
|
|
32
32
|
@data="results = $event"
|
|
33
33
|
/>
|
|
34
34
|
|
|
35
|
-
<div class="maz
|
|
35
|
+
<div class="maz:mt-4 maz:text-sm">
|
|
36
36
|
<p><strong>Phone Number:</strong> {{ phoneNumber || 'Not entered yet' }}</p>
|
|
37
37
|
<p><strong>Country:</strong> {{ countryCode || 'Not selected' }}</p>
|
|
38
38
|
<p><strong>Is Valid:</strong> {{ results?.isValid ? '✅ Yes' : '❌ No' }}</p>
|
|
@@ -68,10 +68,10 @@ const results = ref<MazInputPhoneNumberData>()
|
|
|
68
68
|
Control which countries appear in the dropdown and their order.
|
|
69
69
|
|
|
70
70
|
<ComponentDemo>
|
|
71
|
-
<div class="maz
|
|
71
|
+
<div class="maz:space-y-4">
|
|
72
72
|
<div>
|
|
73
|
-
<h4 class="maz
|
|
74
|
-
<p class="maz
|
|
73
|
+
<h4 class="maz:font-semibold maz:mb-2">Preferred Countries</h4>
|
|
74
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Show your most common countries first</p>
|
|
75
75
|
<MazInputPhoneNumber
|
|
76
76
|
v-model="phone1"
|
|
77
77
|
:preferred-countries="['US', 'FR', 'GB', 'DE', 'CA']"
|
|
@@ -79,8 +79,8 @@ Control which countries appear in the dropdown and their order.
|
|
|
79
79
|
/>
|
|
80
80
|
</div>
|
|
81
81
|
<div>
|
|
82
|
-
<h4 class="maz
|
|
83
|
-
<p class="maz
|
|
82
|
+
<h4 class="maz:font-semibold maz:mb-2">Only Specific Countries</h4>
|
|
83
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Limit to certain countries only</p>
|
|
84
84
|
<MazInputPhoneNumber
|
|
85
85
|
v-model="phone2"
|
|
86
86
|
:only-countries="['US', 'FR', 'GB', 'DE', 'IT', 'ES']"
|
|
@@ -88,8 +88,8 @@ Control which countries appear in the dropdown and their order.
|
|
|
88
88
|
/>
|
|
89
89
|
</div>
|
|
90
90
|
<div>
|
|
91
|
-
<h4 class="maz
|
|
92
|
-
<p class="maz
|
|
91
|
+
<h4 class="maz:font-semibold maz:mb-2">Ignore Countries</h4>
|
|
92
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Remove unwanted countries</p>
|
|
93
93
|
<MazInputPhoneNumber
|
|
94
94
|
v-model="phone3"
|
|
95
95
|
:ignored-countries="['AF', 'AL', 'DZ']"
|
|
@@ -133,20 +133,20 @@ Control which countries appear in the dropdown and their order.
|
|
|
133
133
|
Choose how the country selector and phone input are arranged.
|
|
134
134
|
|
|
135
135
|
<ComponentDemo>
|
|
136
|
-
<div class="maz
|
|
136
|
+
<div class="maz:space-y-6">
|
|
137
137
|
<div>
|
|
138
|
-
<h4 class="maz
|
|
139
|
-
<p class="maz
|
|
138
|
+
<h4 class="maz:font-semibold maz:mb-2">Responsive (Default)</h4>
|
|
139
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Stacks on mobile, side-by-side on desktop</p>
|
|
140
140
|
<MazInputPhoneNumber orientation="responsive" />
|
|
141
141
|
</div>
|
|
142
142
|
<div>
|
|
143
|
-
<h4 class="maz
|
|
144
|
-
<p class="maz
|
|
143
|
+
<h4 class="maz:font-semibold maz:mb-2">Always Row</h4>
|
|
144
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Side-by-side on all screen sizes</p>
|
|
145
145
|
<MazInputPhoneNumber orientation="row" />
|
|
146
146
|
</div>
|
|
147
147
|
<div>
|
|
148
|
-
<h4 class="maz
|
|
149
|
-
<p class="maz
|
|
148
|
+
<h4 class="maz:font-semibold maz:mb-2">Always Column</h4>
|
|
149
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Stacked on all screen sizes</p>
|
|
150
150
|
<MazInputPhoneNumber orientation="col" />
|
|
151
151
|
</div>
|
|
152
152
|
</div>
|
|
@@ -174,10 +174,10 @@ Choose how the country selector and phone input are arranged.
|
|
|
174
174
|
Customize what information is shown to users.
|
|
175
175
|
|
|
176
176
|
<ComponentDemo>
|
|
177
|
-
<div class="maz
|
|
177
|
+
<div class="maz:space-y-6">
|
|
178
178
|
<div>
|
|
179
|
-
<h4 class="maz
|
|
180
|
-
<p class="maz
|
|
179
|
+
<h4 class="maz:font-semibold maz:mb-2">Show Country Names</h4>
|
|
180
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Display country names instead of calling codes</p>
|
|
181
181
|
<MazInputPhoneNumber
|
|
182
182
|
display-country-name
|
|
183
183
|
:translations="{
|
|
@@ -186,20 +186,20 @@ Customize what information is shown to users.
|
|
|
186
186
|
/>
|
|
187
187
|
</div>
|
|
188
188
|
<div>
|
|
189
|
-
<h4 class="maz
|
|
190
|
-
<p class="maz
|
|
189
|
+
<h4 class="maz:font-semibold maz:mb-2">Show Calling Codes in List</h4>
|
|
190
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Help users see the dialing codes</p>
|
|
191
191
|
<MazInputPhoneNumber show-code-in-list />
|
|
192
192
|
</div>
|
|
193
193
|
<div>
|
|
194
|
-
<h4 class="maz
|
|
195
|
-
<p class="maz
|
|
194
|
+
<h4 class="maz:font-semibold maz:mb-2">Hide Phone Examples</h4>
|
|
195
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">
|
|
196
196
|
Remove the example phone number hints (visible when the phone input is focused)
|
|
197
197
|
</p>
|
|
198
198
|
<MazInputPhoneNumber :example="false" />
|
|
199
199
|
</div>
|
|
200
200
|
<div>
|
|
201
|
-
<h4 class="maz
|
|
202
|
-
<p class="maz
|
|
201
|
+
<h4 class="maz:font-semibold maz:mb-2">Hide Country Flags</h4>
|
|
202
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Text-only country selection</p>
|
|
203
203
|
<MazInputPhoneNumber hide-flags />
|
|
204
204
|
</div>
|
|
205
205
|
</div>
|
|
@@ -233,20 +233,20 @@ Customize what information is shown to users.
|
|
|
233
233
|
Let the component automatically detect the user's country.
|
|
234
234
|
|
|
235
235
|
<ComponentDemo>
|
|
236
|
-
<div class="maz
|
|
236
|
+
<div class="maz:space-y-6">
|
|
237
237
|
<div>
|
|
238
|
-
<h4 class="maz
|
|
239
|
-
<p class="maz
|
|
238
|
+
<h4 class="maz:font-semibold maz:mb-2">Browser Locale Detection</h4>
|
|
239
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Uses browser language settings (enabled by default)</p>
|
|
240
240
|
<MazInputPhoneNumber :use-browser-locale="true" />
|
|
241
241
|
</div>
|
|
242
242
|
<div>
|
|
243
|
-
<h4 class="maz
|
|
244
|
-
<p class="maz
|
|
243
|
+
<h4 class="maz:font-semibold maz:mb-2">IP-based Detection</h4>
|
|
244
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Fetches country from user's IP address</p>
|
|
245
245
|
<MazInputPhoneNumber fetch-country />
|
|
246
246
|
</div>
|
|
247
247
|
<div>
|
|
248
|
-
<h4 class="maz
|
|
249
|
-
<p class="maz
|
|
248
|
+
<h4 class="maz:font-semibold maz:mb-2">Manual Default Country</h4>
|
|
249
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Set a specific default country</p>
|
|
250
250
|
<MazInputPhoneNumber
|
|
251
251
|
:use-browser-locale="false"
|
|
252
252
|
country-code="JP"
|
|
@@ -280,10 +280,10 @@ Let the component automatically detect the user's country.
|
|
|
280
280
|
Control how phone numbers are automatically formatted as users type.
|
|
281
281
|
|
|
282
282
|
<ComponentDemo>
|
|
283
|
-
<div class="maz
|
|
283
|
+
<div class="maz:space-y-6">
|
|
284
284
|
<div>
|
|
285
|
-
<h4 class="maz
|
|
286
|
-
<p class="maz
|
|
285
|
+
<h4 class="maz:font-semibold maz:mb-2">Format on Blur (Default)</h4>
|
|
286
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Shows raw input while typing, formats when field loses focus</p>
|
|
287
287
|
<MazInputPhoneNumber
|
|
288
288
|
auto-format="blur"
|
|
289
289
|
country-code="US"
|
|
@@ -295,8 +295,8 @@ Control how phone numbers are automatically formatted as users type.
|
|
|
295
295
|
/>
|
|
296
296
|
</div>
|
|
297
297
|
<div>
|
|
298
|
-
<h4 class="maz
|
|
299
|
-
<p class="maz
|
|
298
|
+
<h4 class="maz:font-semibold maz:mb-2">Format While Typing</h4>
|
|
299
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Real-time formatting as you type</p>
|
|
300
300
|
<MazInputPhoneNumber
|
|
301
301
|
auto-format="typing"
|
|
302
302
|
country-code="FR"
|
|
@@ -308,8 +308,8 @@ Control how phone numbers are automatically formatted as users type.
|
|
|
308
308
|
/>
|
|
309
309
|
</div>
|
|
310
310
|
<div>
|
|
311
|
-
<h4 class="maz
|
|
312
|
-
<p class="maz
|
|
311
|
+
<h4 class="maz:font-semibold maz:mb-2">Disable Formatting</h4>
|
|
312
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">For countries with multiple valid lengths or custom formatting</p>
|
|
313
313
|
<MazInputPhoneNumber
|
|
314
314
|
auto-format="disabled"
|
|
315
315
|
country-code="AI"
|
|
@@ -348,23 +348,23 @@ Control how phone numbers are automatically formatted as users type.
|
|
|
348
348
|
Control the visual validation feedback and success/error indicators.
|
|
349
349
|
|
|
350
350
|
<ComponentDemo>
|
|
351
|
-
<div class="maz
|
|
351
|
+
<div class="maz:space-y-6">
|
|
352
352
|
<div>
|
|
353
|
-
<h4 class="maz
|
|
354
|
-
<p class="maz
|
|
353
|
+
<h4 class="maz:font-semibold maz:mb-2">Hide Validation UI</h4>
|
|
354
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">No visual success/error indicators</p>
|
|
355
355
|
<MazInputPhoneNumber
|
|
356
356
|
:validation-success="false"
|
|
357
357
|
:validation-error="false"
|
|
358
358
|
/>
|
|
359
359
|
</div>
|
|
360
360
|
<div>
|
|
361
|
-
<h4 class="maz
|
|
362
|
-
<p class="maz
|
|
361
|
+
<h4 class="maz:font-semibold maz:mb-2">Force Success State</h4>
|
|
362
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Always show success styling</p>
|
|
363
363
|
<MazInputPhoneNumber success />
|
|
364
364
|
</div>
|
|
365
365
|
<div>
|
|
366
|
-
<h4 class="maz
|
|
367
|
-
<p class="maz
|
|
366
|
+
<h4 class="maz:font-semibold maz:mb-2">Force Error State</h4>
|
|
367
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Always show error styling</p>
|
|
368
368
|
<MazInputPhoneNumber error />
|
|
369
369
|
</div>
|
|
370
370
|
</div>
|
|
@@ -395,10 +395,10 @@ Control the visual validation feedback and success/error indicators.
|
|
|
395
395
|
Make the component speak your users' language.
|
|
396
396
|
|
|
397
397
|
<ComponentDemo>
|
|
398
|
-
<div class="maz
|
|
398
|
+
<div class="maz:space-y-6">
|
|
399
399
|
<div>
|
|
400
|
-
<h4 class="maz
|
|
401
|
-
<p class="maz
|
|
400
|
+
<h4 class="maz:font-semibold maz:mb-2">Custom Labels</h4>
|
|
401
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Translate all text in the interface</p>
|
|
402
402
|
<MazInputPhoneNumber
|
|
403
403
|
:translations="{
|
|
404
404
|
countrySelect: {
|
|
@@ -414,13 +414,13 @@ Make the component speak your users' language.
|
|
|
414
414
|
/>
|
|
415
415
|
</div>
|
|
416
416
|
<div>
|
|
417
|
-
<h4 class="maz
|
|
418
|
-
<p class="maz
|
|
417
|
+
<h4 class="maz:font-semibold maz:mb-2">Country Names in French</h4>
|
|
418
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Change the language of country names</p>
|
|
419
419
|
<MazInputPhoneNumber country-locale="fr-FR" />
|
|
420
420
|
</div>
|
|
421
421
|
<div>
|
|
422
|
-
<h4 class="maz
|
|
423
|
-
<p class="maz
|
|
422
|
+
<h4 class="maz:font-semibold maz:mb-2">Custom Country Names</h4>
|
|
423
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Override specific country names</p>
|
|
424
424
|
<MazInputPhoneNumber
|
|
425
425
|
:custom-countries-list="{
|
|
426
426
|
US: 'United States of America',
|
|
@@ -472,40 +472,40 @@ Make the component speak your users' language.
|
|
|
472
472
|
Replace the default flag emojis with your own design.
|
|
473
473
|
|
|
474
474
|
<ComponentDemo>
|
|
475
|
-
<div class="maz
|
|
475
|
+
<div class="maz:space-y-6">
|
|
476
476
|
<div>
|
|
477
|
-
<h4 class="maz
|
|
478
|
-
<p class="maz
|
|
477
|
+
<h4 class="maz:font-semibold maz:mb-2">Country Code Badges</h4>
|
|
478
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Show country codes instead of flags</p>
|
|
479
479
|
<MazInputPhoneNumber>
|
|
480
480
|
<template #selector-flag="{ countryCode }">
|
|
481
481
|
<span
|
|
482
482
|
id="custom-flag-element"
|
|
483
|
-
class="maz
|
|
483
|
+
class="maz:bg-primary maz:text-primary-foreground maz:px-2 maz:py-1 maz:rounded-md maz:text-xs maz:font-semibold"
|
|
484
484
|
>
|
|
485
485
|
{{ countryCode }}
|
|
486
486
|
</span>
|
|
487
487
|
</template>
|
|
488
488
|
<template #country-list-flag="{ countryCode }">
|
|
489
|
-
<MazBadge size="sm" class="maz
|
|
489
|
+
<MazBadge size="sm" class="maz:me-2 maz:min-w-10">
|
|
490
490
|
{{ countryCode }}
|
|
491
491
|
</MazBadge>
|
|
492
492
|
</template>
|
|
493
493
|
</MazInputPhoneNumber>
|
|
494
494
|
</div>
|
|
495
495
|
<div>
|
|
496
|
-
<h4 class="maz
|
|
497
|
-
<p class="maz
|
|
496
|
+
<h4 class="maz:font-semibold maz:mb-2">Custom Icons</h4>
|
|
497
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Use your own flag icons or designs</p>
|
|
498
498
|
<MazInputPhoneNumber>
|
|
499
499
|
<template #selector-flag="{ countryCode }">
|
|
500
500
|
<div
|
|
501
501
|
id="icon-flag-element"
|
|
502
|
-
class="maz
|
|
502
|
+
class="maz:w-6 maz:h-6 maz:bg-linear-to-r maz:from-blue-500 maz:to-green-500 maz:rounded-full maz:flex maz:items-center maz:justify-center maz:text-white maz:text-xs maz:font-bold"
|
|
503
503
|
>
|
|
504
504
|
{{ countryCode?.charAt(0) }}
|
|
505
505
|
</div>
|
|
506
506
|
</template>
|
|
507
507
|
<template #country-list-flag="{ countryCode }">
|
|
508
|
-
<div class="maz
|
|
508
|
+
<div class="maz:w-6 maz:h-6 maz:bg-linear-to-r maz:from-purple-500 maz:to-pink-500 maz:rounded-md maz:flex maz:items-center maz:justify-center maz:text-white maz:text-xs maz:font-bold maz:me-2">
|
|
509
509
|
{{ countryCode?.charAt(0) }}
|
|
510
510
|
</div>
|
|
511
511
|
</template>
|
|
@@ -525,7 +525,7 @@ Replace the default flag emojis with your own design.
|
|
|
525
525
|
</span>
|
|
526
526
|
</template>
|
|
527
527
|
<template #country-list-flag="{ countryCode }">
|
|
528
|
-
<MazBadge size="sm" class="maz
|
|
528
|
+
<MazBadge size="sm" class="maz:me-2">
|
|
529
529
|
{{ countryCode }}
|
|
530
530
|
</MazBadge>
|
|
531
531
|
</template>
|
|
@@ -547,17 +547,18 @@ Replace the default flag emojis with your own design.
|
|
|
547
547
|
</template>
|
|
548
548
|
|
|
549
549
|
<style scoped>
|
|
550
|
+
@reference "../../.vitepress/theme/main.css";
|
|
550
551
|
.country-badge {
|
|
551
|
-
@apply maz
|
|
552
|
+
@apply maz:bg-primary maz:text-primary-foreground maz:px-2 maz:py-1 maz:rounded-md maz:text-xs maz:font-semibold;
|
|
552
553
|
}
|
|
553
554
|
|
|
554
555
|
.custom-flag-icon,
|
|
555
556
|
.custom-list-icon {
|
|
556
|
-
@apply maz
|
|
557
|
+
@apply maz:w-6 maz:h-6 maz:bg-linear-to-r maz:from-blue-500 maz:to-green-500 maz:rounded-full maz:flex maz:items-center maz:justify-center maz:text-white maz:text-xs maz:font-bold;
|
|
557
558
|
}
|
|
558
559
|
|
|
559
560
|
.custom-list-icon {
|
|
560
|
-
@apply maz
|
|
561
|
+
@apply maz:me-2;
|
|
561
562
|
}
|
|
562
563
|
</style>
|
|
563
564
|
```
|
|
@@ -574,10 +575,10 @@ Replace the default flag emojis with your own design.
|
|
|
574
575
|
Fine-tune the component for specific use cases.
|
|
575
576
|
|
|
576
577
|
<ComponentDemo>
|
|
577
|
-
<div class="maz
|
|
578
|
+
<div class="maz:space-y-6">
|
|
578
579
|
<div>
|
|
579
|
-
<h4 class="maz
|
|
580
|
-
<p class="maz
|
|
580
|
+
<h4 class="maz:font-semibold maz:mb-2">Phone-only Mode</h4>
|
|
581
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Hide country selector, pre-select country</p>
|
|
581
582
|
<MazInputPhoneNumber
|
|
582
583
|
hide-country-select
|
|
583
584
|
country-code="US"
|
|
@@ -589,21 +590,21 @@ Fine-tune the component for specific use cases.
|
|
|
589
590
|
/>
|
|
590
591
|
</div>
|
|
591
592
|
<div>
|
|
592
|
-
<h4 class="maz
|
|
593
|
-
<p class="maz
|
|
593
|
+
<h4 class="maz:font-semibold maz:mb-2">Custom Search Sensitivity</h4>
|
|
594
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Adjust how strict country search is (0 = fuzzy, 1 = exact)</p>
|
|
594
595
|
<MazInputPhoneNumber
|
|
595
596
|
:search-threshold="0.3"
|
|
596
597
|
placeholder="Try searching 'unite' for United States"
|
|
597
598
|
/>
|
|
598
599
|
</div>
|
|
599
600
|
<div>
|
|
600
|
-
<h4 class="maz
|
|
601
|
-
<p class="maz
|
|
601
|
+
<h4 class="maz:font-semibold maz:mb-2">Disable Search</h4>
|
|
602
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Remove search functionality from country list</p>
|
|
602
603
|
<MazInputPhoneNumber :search="false" />
|
|
603
604
|
</div>
|
|
604
605
|
<div>
|
|
605
|
-
<h4 class="maz
|
|
606
|
-
<p class="maz
|
|
606
|
+
<h4 class="maz:font-semibold maz:mb-2">Different Dropdown Position</h4>
|
|
607
|
+
<p class="maz:text-sm maz:text-muted maz:mb-2">Control where the country list appears</p>
|
|
607
608
|
<MazInputPhoneNumber list-position="top-start" />
|
|
608
609
|
</div>
|
|
609
610
|
</div>
|
|
@@ -642,11 +643,11 @@ Fine-tune the component for specific use cases.
|
|
|
642
643
|
See how to use the component in common scenarios.
|
|
643
644
|
|
|
644
645
|
<ComponentDemo>
|
|
645
|
-
<div class="maz
|
|
646
|
+
<div class="maz:space-y-8">
|
|
646
647
|
<div>
|
|
647
|
-
<h4 class="maz
|
|
648
|
-
<p class="maz
|
|
649
|
-
<div class="maz
|
|
648
|
+
<h4 class="maz:font-semibold maz:mb-2">🏢 Business Form</h4>
|
|
649
|
+
<p class="maz:text-sm maz:text-muted maz:mb-4">Perfect for customer registration</p>
|
|
650
|
+
<div class="maz:max-w-md maz:grid maz:grid-cols-1 maz:gap-4">
|
|
650
651
|
<MazInput label="Full Name" placeholder="John Doe" />
|
|
651
652
|
<MazInput label="Email" type="email" placeholder="john@example.com" />
|
|
652
653
|
<MazInputPhoneNumber
|
|
@@ -663,9 +664,9 @@ See how to use the component in common scenarios.
|
|
|
663
664
|
</div>
|
|
664
665
|
</div>
|
|
665
666
|
<div>
|
|
666
|
-
<h4 class="maz
|
|
667
|
-
<p class="maz
|
|
668
|
-
<div class="maz
|
|
667
|
+
<h4 class="maz:font-semibold maz:mb-2">🌍 Global Support</h4>
|
|
668
|
+
<p class="maz:text-sm maz:text-muted maz:mb-4">Multi-language international form</p>
|
|
669
|
+
<div class="maz:max-w-md">
|
|
669
670
|
<MazInputPhoneNumber
|
|
670
671
|
v-model="globalPhone"
|
|
671
672
|
country-locale="es-ES"
|
|
@@ -683,9 +684,9 @@ See how to use the component in common scenarios.
|
|
|
683
684
|
</div>
|
|
684
685
|
</div>
|
|
685
686
|
<div>
|
|
686
|
-
<h4 class="maz
|
|
687
|
-
<p class="maz
|
|
688
|
-
<div class="maz
|
|
687
|
+
<h4 class="maz:font-semibold maz:mb-2">📱 Mobile-first Design</h4>
|
|
688
|
+
<p class="maz:text-sm maz:text-muted maz:mb-4">Optimized for mobile apps</p>
|
|
689
|
+
<div class="maz:max-w-xs">
|
|
689
690
|
<MazInputPhoneNumber
|
|
690
691
|
v-model="mobilePhone"
|
|
691
692
|
orientation="col"
|
|
@@ -761,16 +762,16 @@ const mobilePhone = ref()
|
|
|
761
762
|
Understanding what data the component provides.
|
|
762
763
|
|
|
763
764
|
<ComponentDemo>
|
|
764
|
-
<div class="maz
|
|
765
|
+
<div class="maz:space-y-4">
|
|
765
766
|
<MazInputPhoneNumber
|
|
766
767
|
v-model="dataPhone"
|
|
767
768
|
v-model:country-code="dataCountry"
|
|
768
769
|
label="Enter a phone number to see data"
|
|
769
770
|
@data="phoneData = $event"
|
|
770
771
|
/>
|
|
771
|
-
<div v-if="phoneData" class="maz
|
|
772
|
-
<h4 class="maz
|
|
773
|
-
<div class="maz
|
|
772
|
+
<div v-if="phoneData" class="maz:bg-surface-400 maz:p-4 maz:rounded-md">
|
|
773
|
+
<h4 class="maz:font-semibold maz:mb-3">📊 Phone Number Data</h4>
|
|
774
|
+
<div class="maz:grid maz:grid-cols-1 maz:md:grid-cols-2 maz:gap-4 maz:text-sm">
|
|
774
775
|
<div>
|
|
775
776
|
<strong>Valid:</strong> {{ phoneData?.isValid ? '✅' : '❌' }}
|
|
776
777
|
</div>
|
|
@@ -43,7 +43,7 @@ const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
|
|
|
43
43
|
|
|
44
44
|
## Sizing
|
|
45
45
|
|
|
46
|
-
<div class="maz
|
|
46
|
+
<div class="maz:flex maz:flex-col maz:gap-2">
|
|
47
47
|
<MazInputTags
|
|
48
48
|
v-for="size in sizes"
|
|
49
49
|
:key="size"
|
|
@@ -65,7 +65,7 @@ const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
|
|
|
65
65
|
</script>
|
|
66
66
|
|
|
67
67
|
<template>
|
|
68
|
-
<div class="maz
|
|
68
|
+
<div class="maz:flex maz:flex-col maz:gap-2">
|
|
69
69
|
<MazInputTags
|
|
70
70
|
v-for="size in sizes"
|
|
71
71
|
:key="size"
|
|
@@ -146,8 +146,8 @@ const inputValue = ref()
|
|
|
146
146
|
<MazInput
|
|
147
147
|
v-model="inputValue"
|
|
148
148
|
label="label icons"
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
start-icon="/banknotes.svg"
|
|
150
|
+
end-icon="/user.svg"
|
|
151
151
|
autocomplete="off"
|
|
152
152
|
/>
|
|
153
153
|
|
|
@@ -155,12 +155,12 @@ const inputValue = ref()
|
|
|
155
155
|
|
|
156
156
|
::: details View code
|
|
157
157
|
|
|
158
|
-
When you use the properties `
|
|
158
|
+
When you use the properties `end-icon`, `start-icon` or `icon` with the icon name (string), the component uses `<MazIcon icon="..." />` component.
|
|
159
159
|
|
|
160
160
|
Check out how [MazIcon](./maz-icon.md) works, see all available icons and download them to put them in your public folder.
|
|
161
161
|
|
|
162
162
|
```html
|
|
163
|
-
<MazInput v-model="inputValue" label="label icons"
|
|
163
|
+
<MazInput v-model="inputValue" label="label icons" start-icon="/banknotes.svg" end-icon="/user.svg" />
|
|
164
164
|
```
|
|
165
165
|
|
|
166
166
|
:::
|
|
@@ -171,7 +171,7 @@ Check out how [MazIcon](./maz-icon.md) works, see all available icons and downlo
|
|
|
171
171
|
|
|
172
172
|
```html
|
|
173
173
|
<MazInput v-model="inputValue" label="label icons">
|
|
174
|
-
<template #
|
|
174
|
+
<template #start-icon>
|
|
175
175
|
<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
176
176
|
<path
|
|
177
177
|
d="M2.25 18.75C7.71719 18.75 13.0136 19.4812 18.0468 20.8512C18.7738 21.0491 19.5 20.5086 19.5 19.7551V18.75M3.75 4.5V5.25C3.75 5.66421 3.41421 6 3 6H2.25M2.25 6V5.625C2.25 5.00368 2.75368 4.5 3.375 4.5H20.25M2.25 6V15M20.25 4.5V5.25C20.25 5.66421 20.5858 6 21 6H21.75M20.25 4.5H20.625C21.2463 4.5 21.75 5.00368 21.75 5.625V15.375C21.75 15.9963 21.2463 16.5 20.625 16.5H20.25M21.75 15H21C20.5858 15 20.25 15.3358 20.25 15.75V16.5M20.25 16.5H3.75M3.75 16.5H3.375C2.75368 16.5 2.25 15.9963 2.25 15.375V15M3.75 16.5V15.75C3.75 15.3358 3.41421 15 3 15H2.25M15 10.5C15 12.1569 13.6569 13.5 12 13.5C10.3431 13.5 9 12.1569 9 10.5C9 8.84315 10.3431 7.5 12 7.5C13.6569 7.5 15 8.84315 15 10.5ZM18 10.5H18.0075V10.5075H18V10.5ZM6 10.5H6.0075V10.5075H6V10.5Z"
|
|
@@ -182,7 +182,7 @@ Check out how [MazIcon](./maz-icon.md) works, see all available icons and downlo
|
|
|
182
182
|
/>
|
|
183
183
|
</svg>
|
|
184
184
|
</template>
|
|
185
|
-
<template #
|
|
185
|
+
<template #end-icon>
|
|
186
186
|
<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
187
187
|
<path
|
|
188
188
|
d="M15.75 6C15.75 8.07107 14.071 9.75 12 9.75C9.9289 9.75 8.24996 8.07107 8.24996 6C8.24996 3.92893 9.9289 2.25 12 2.25C14.071 2.25 15.75 3.92893 15.75 6Z"
|
|
@@ -223,8 +223,38 @@ const inputValue = ref('value')
|
|
|
223
223
|
<MazInput
|
|
224
224
|
v-model="inputValue"
|
|
225
225
|
label="label icons"
|
|
226
|
-
:
|
|
227
|
-
:
|
|
226
|
+
:start-icon="MazBanknotes"
|
|
227
|
+
:end-icon="MazUser"
|
|
228
|
+
/>
|
|
229
|
+
</template>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
:::
|
|
233
|
+
|
|
234
|
+
### Pass a full `MazIconProps` object
|
|
235
|
+
|
|
236
|
+
`startIcon` and `endIcon` also accept a full `MazIconProps` object — pass the same shape `<MazIcon>` accepts to override the size, set a `<title>` for screen readers, attach `svgAttributes`, etc.
|
|
237
|
+
|
|
238
|
+
::: details View code
|
|
239
|
+
|
|
240
|
+
```vue
|
|
241
|
+
<script lang="ts" setup>
|
|
242
|
+
import MazInput from 'maz-ui/components/MazInput'
|
|
243
|
+
import { MazBanknotes } from '@maz-ui/icons/raw/MazBanknotes'
|
|
244
|
+
import { ref } from 'vue'
|
|
245
|
+
|
|
246
|
+
const inputValue = ref('value')
|
|
247
|
+
</script>
|
|
248
|
+
|
|
249
|
+
<template>
|
|
250
|
+
<MazInput
|
|
251
|
+
v-model="inputValue"
|
|
252
|
+
label="amount"
|
|
253
|
+
:start-icon="{
|
|
254
|
+
icon: MazBanknotes,
|
|
255
|
+
size: 'lg',
|
|
256
|
+
title: 'Amount in USD',
|
|
257
|
+
}"
|
|
228
258
|
/>
|
|
229
259
|
</template>
|
|
230
260
|
```
|
|
@@ -262,7 +292,7 @@ const inputValue = ref('value')
|
|
|
262
292
|
<ComponentDemo>
|
|
263
293
|
<MazInput v-model="inputValue" label="label debounce" :debounce="1000" autocomplete="off" />
|
|
264
294
|
|
|
265
|
-
<p class="maz
|
|
295
|
+
<p class="maz:mt-2">
|
|
266
296
|
modelValue: {{ inputValue ?? 'null' }}
|
|
267
297
|
</p>
|
|
268
298
|
|
|
@@ -280,7 +310,7 @@ const inputValue = ref('value')
|
|
|
280
310
|
> Use the attribute `size` with a value in {{ sizes.join(', ') }}
|
|
281
311
|
|
|
282
312
|
<ComponentDemo>
|
|
283
|
-
<div class="maz
|
|
313
|
+
<div class="maz:flex maz:flex-col maz:gap-2 maz:items-start">
|
|
284
314
|
<MazInput
|
|
285
315
|
v-for="size in sizes"
|
|
286
316
|
:key="size"
|
|
@@ -320,7 +350,7 @@ Click on each input to show colors
|
|
|
320
350
|
:::
|
|
321
351
|
|
|
322
352
|
<ComponentDemo>
|
|
323
|
-
<div class="maz
|
|
353
|
+
<div class="maz:flex maz:flex-col maz:gap-2 maz:items-start">
|
|
324
354
|
<MazInput
|
|
325
355
|
v-for="name in colors"
|
|
326
356
|
:key="name"
|
|
@@ -357,7 +387,7 @@ const colors = ['primary', 'secondary', 'info', 'success', 'warning', 'destructi
|
|
|
357
387
|
Use the attribute `rounded-size` with a value in `'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full'`
|
|
358
388
|
|
|
359
389
|
<ComponentDemo>
|
|
360
|
-
<div class="maz
|
|
390
|
+
<div class="maz:flex maz:flex-col maz:gap-2 maz:items-start">
|
|
361
391
|
<MazInput rounded-size="none" placeholder="Rounded input" autocomplete="off" />
|
|
362
392
|
<MazInput rounded-size="sm" placeholder="Rounded input" autocomplete="off" />
|
|
363
393
|
<MazInput rounded-size="md" placeholder="Rounded input" autocomplete="off" />
|