@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
|
@@ -26,7 +26,7 @@ description: Vue composables for form validation with Valibot - useFormValidator
|
|
|
26
26
|
Here's the simplest form you can create with `useFormValidator`:
|
|
27
27
|
|
|
28
28
|
<ComponentDemo>
|
|
29
|
-
<form class="maz
|
|
29
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitQuickStart">
|
|
30
30
|
<MazInput
|
|
31
31
|
v-model="quickStartModel.email"
|
|
32
32
|
label="Email"
|
|
@@ -138,8 +138,8 @@ Each field in `fieldsStates` contains:
|
|
|
138
138
|
| `validating` | `boolean` | Async validation is in progress |
|
|
139
139
|
|
|
140
140
|
<ComponentDemo>
|
|
141
|
-
<div class="maz
|
|
142
|
-
<form class="maz
|
|
141
|
+
<div class="maz:flex maz:flex-col maz:gap-4">
|
|
142
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitState">
|
|
143
143
|
<MazInput
|
|
144
144
|
v-model="stateModel.name"
|
|
145
145
|
label="Name (min 3 characters)"
|
|
@@ -157,11 +157,11 @@ Each field in `fieldsStates` contains:
|
|
|
157
157
|
/>
|
|
158
158
|
<MazBtn type="submit">Submit</MazBtn>
|
|
159
159
|
</form>
|
|
160
|
-
<div class="maz-
|
|
161
|
-
<p class="maz
|
|
162
|
-
<pre class="maz
|
|
163
|
-
<p class="maz
|
|
164
|
-
<pre class="maz
|
|
160
|
+
<div class="maz:rounded-md">
|
|
161
|
+
<p class="maz:font-semibold maz:mb-2">Form State:</p>
|
|
162
|
+
<pre class="maz:text-xs maz:bg-surface-600/70 maz:dark:bg-surface-600/60 maz:p-2 maz:rounded-md">{{ JSON.stringify({ isValid: stateValid, isDirty: stateDirty, isSubmitted: stateSubmitted, isSubmitting: stateSubmitting }, null, 2) }}</pre>
|
|
163
|
+
<p class="maz:font-semibold maz:mb-2 maz:mt-4">Fields States:</p>
|
|
164
|
+
<pre class="maz:text-xs maz:bg-surface-600/70 maz:dark:bg-surface-600/60 maz:p-2 maz:rounded-md">{{ JSON.stringify(stateFields, null, 2) }}</pre>
|
|
165
165
|
</div>
|
|
166
166
|
</div>
|
|
167
167
|
|
|
@@ -229,10 +229,10 @@ For `eager`, `blur`, and `progressive` modes, you must use `useFormField` with t
|
|
|
229
229
|
The default mode. Validates when field values change. Errors only appear if the field is not empty.
|
|
230
230
|
|
|
231
231
|
<ComponentDemo>
|
|
232
|
-
<div class="maz
|
|
233
|
-
<p class="maz
|
|
232
|
+
<div class="maz:mb-4">
|
|
233
|
+
<p class="maz:text-sm maz:text-muted">Type in the field and clear it - notice the error appears only when there's content.</p>
|
|
234
234
|
</div>
|
|
235
|
-
<form class="maz
|
|
235
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitLazy">
|
|
236
236
|
<MazInput
|
|
237
237
|
v-model="lazyModel.name"
|
|
238
238
|
label="Name (min 3 characters)"
|
|
@@ -287,10 +287,10 @@ const onSubmit = handleSubmit((data) => {
|
|
|
287
287
|
Validates all fields immediately when the form is created and on every change. Errors are always displayed.
|
|
288
288
|
|
|
289
289
|
<ComponentDemo>
|
|
290
|
-
<div class="maz
|
|
291
|
-
<p class="maz
|
|
290
|
+
<div class="maz:mb-4">
|
|
291
|
+
<p class="maz:text-sm maz:text-muted">Notice all fields show errors immediately, even before any interaction.</p>
|
|
292
292
|
</div>
|
|
293
|
-
<form class="maz
|
|
293
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitAggressive">
|
|
294
294
|
<MazInput
|
|
295
295
|
v-model="aggressiveModel.name"
|
|
296
296
|
label="Name (min 3 characters)"
|
|
@@ -342,10 +342,10 @@ Requires `useFormField` with `ref` option or `validationEvents`.
|
|
|
342
342
|
:::
|
|
343
343
|
|
|
344
344
|
<ComponentDemo>
|
|
345
|
-
<div class="maz
|
|
346
|
-
<p class="maz
|
|
345
|
+
<div class="maz:mb-4">
|
|
346
|
+
<p class="maz:text-sm maz:text-muted">Type something, then click outside the field (blur) to see validation. After that, errors update as you type.</p>
|
|
347
347
|
</div>
|
|
348
|
-
<form class="maz
|
|
348
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitEager">
|
|
349
349
|
<MazInput
|
|
350
350
|
ref="eagerNameRef"
|
|
351
351
|
v-model="eagerName"
|
|
@@ -446,10 +446,10 @@ Requires `useFormField` with `ref` option or `validationEvents`.
|
|
|
446
446
|
Validates only when the field loses focus. Errors are only shown after blur.
|
|
447
447
|
|
|
448
448
|
<ComponentDemo>
|
|
449
|
-
<div class="maz
|
|
450
|
-
<p class="maz
|
|
449
|
+
<div class="maz:mb-4">
|
|
450
|
+
<p class="maz:text-sm maz:text-muted">Type in the field, then click outside. Errors only appear after blur, and don't update while typing.</p>
|
|
451
451
|
</div>
|
|
452
|
-
<form class="maz
|
|
452
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitBlur">
|
|
453
453
|
<MazInput
|
|
454
454
|
ref="blurNameRef"
|
|
455
455
|
v-model="blurName"
|
|
@@ -517,10 +517,10 @@ Requires `useFormField` with `ref` option or `validationEvents`.
|
|
|
517
517
|
The most user-friendly mode. Validates silently in the background. Shows errors only on blur if the field is invalid. Once valid, it stays valid until it becomes invalid again.
|
|
518
518
|
|
|
519
519
|
<ComponentDemo>
|
|
520
|
-
<div class="maz
|
|
521
|
-
<p class="maz
|
|
520
|
+
<div class="maz:mb-4">
|
|
521
|
+
<p class="maz:text-sm maz:text-muted">Start typing - the field becomes valid (green) as soon as validation passes. Errors only show after blur.</p>
|
|
522
522
|
</div>
|
|
523
|
-
<form class="maz
|
|
523
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitProgressive">
|
|
524
524
|
<MazInput
|
|
525
525
|
ref="progressiveNameRef"
|
|
526
526
|
v-model="progressiveName"
|
|
@@ -709,10 +709,10 @@ const { value: email } = useFormField<string>('email', {
|
|
|
709
709
|
Use Valibot's `pipeAsync` and `checkAsync` for async validations like checking username availability:
|
|
710
710
|
|
|
711
711
|
<ComponentDemo>
|
|
712
|
-
<div class="maz
|
|
713
|
-
<p class="maz
|
|
712
|
+
<div class="maz:mb-4">
|
|
713
|
+
<p class="maz:text-sm maz:text-muted">Try typing "taken" - the async validator will reject it after a 2-second delay.</p>
|
|
714
714
|
</div>
|
|
715
|
-
<form class="maz
|
|
715
|
+
<form class="maz:flex maz:gap-4" @submit="onSubmitAsync">
|
|
716
716
|
<MazInput
|
|
717
717
|
ref="asyncUsernameRef"
|
|
718
718
|
v-model="asyncUsername"
|
|
@@ -721,7 +721,7 @@ Use Valibot's `pipeAsync` and `checkAsync` for async validations like checking u
|
|
|
721
721
|
:error="asyncUsernameHasError"
|
|
722
722
|
:success="asyncUsernameValid"
|
|
723
723
|
:loading="asyncUsernameValidating"
|
|
724
|
-
class="maz
|
|
724
|
+
class="maz:flex-1"
|
|
725
725
|
/>
|
|
726
726
|
<MazBtn type="submit" :loading="asyncSubmitting">Submit</MazBtn>
|
|
727
727
|
</form>
|
|
@@ -789,10 +789,10 @@ For expensive validations (like API calls), use throttling or debouncing to limi
|
|
|
789
789
|
| `throttledFields` | Runs at most once per interval | 1000ms | Rate-limited APIs |
|
|
790
790
|
|
|
791
791
|
<ComponentDemo>
|
|
792
|
-
<div class="maz
|
|
793
|
-
<p class="maz
|
|
792
|
+
<div class="maz:mb-4">
|
|
793
|
+
<p class="maz:text-sm maz:text-muted">Name has 500ms debounce, Age has 1000ms throttle. Watch the console to see validation timing.</p>
|
|
794
794
|
</div>
|
|
795
|
-
<form class="maz
|
|
795
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitDebounced">
|
|
796
796
|
<MazInput
|
|
797
797
|
v-model="debouncedModel.name"
|
|
798
798
|
label="Name (debounced 500ms)"
|
|
@@ -842,7 +842,7 @@ const { model, errorMessages, fieldsStates, isSubmitting, handleSubmit } = useFo
|
|
|
842
842
|
Use `resetForm()` to reset the form to its initial state, or set `resetOnSuccess` to automatically reset after successful submission.
|
|
843
843
|
|
|
844
844
|
<ComponentDemo>
|
|
845
|
-
<form class="maz
|
|
845
|
+
<form class="maz:flex maz:flex-col maz:gap-4" @submit="onSubmitReset">
|
|
846
846
|
<MazInput
|
|
847
847
|
v-model="resetModel.name"
|
|
848
848
|
label="Name"
|
|
@@ -858,7 +858,7 @@ Use `resetForm()` to reset the form to its initial state, or set `resetOnSuccess
|
|
|
858
858
|
:error="resetStates.age.error"
|
|
859
859
|
:success="resetStates.age.valid"
|
|
860
860
|
/>
|
|
861
|
-
<div class="maz
|
|
861
|
+
<div class="maz:flex maz:gap-2">
|
|
862
862
|
<MazBtn type="submit" :loading="resetSubmitting">Submit</MazBtn>
|
|
863
863
|
<MazBtn type="button" color="destructive" @click="resetFormFn">Reset</MazBtn>
|
|
864
864
|
</div>
|
|
@@ -1196,9 +1196,9 @@ const { value } = useFormField<string>('email', {
|
|
|
1196
1196
|
|
|
1197
1197
|
<script lang="ts" setup>
|
|
1198
1198
|
import { ref, useTemplateRef } from 'vue'
|
|
1199
|
-
import { useFormValidator } from 'maz-ui/
|
|
1200
|
-
import { useFormField } from 'maz-ui/
|
|
1201
|
-
import { useToast } from 'maz-ui/
|
|
1199
|
+
import { useFormValidator } from 'maz-ui/composables/useFormValidator'
|
|
1200
|
+
import { useFormField } from 'maz-ui/composables/useFormField'
|
|
1201
|
+
import { useToast } from 'maz-ui/composables/useToast'
|
|
1202
1202
|
import { sleep } from '@maz-ui/utils'
|
|
1203
1203
|
import {
|
|
1204
1204
|
string,
|
|
@@ -44,7 +44,7 @@ A plugin to know the amount of time a user has spent on your website
|
|
|
44
44
|
<br />
|
|
45
45
|
<br />
|
|
46
46
|
|
|
47
|
-
<p class="maz
|
|
47
|
+
<p class="maz:text-warning">Wait 5 seconds without any actions to see the dialog popup</p>
|
|
48
48
|
|
|
49
49
|
<template #code>
|
|
50
50
|
|
|
@@ -139,8 +139,8 @@ onBeforeUnmount(() => {
|
|
|
139
139
|
<script lang="ts" setup>
|
|
140
140
|
import { onMounted, ref, onBeforeUnmount } from 'vue'
|
|
141
141
|
|
|
142
|
-
import { useIdleTimeout } from 'maz-ui/
|
|
143
|
-
import { useDialog } from 'maz-ui/
|
|
142
|
+
import { useIdleTimeout } from 'maz-ui/composables/useIdleTimeout'
|
|
143
|
+
import { useDialog } from 'maz-ui/composables/useDialog'
|
|
144
144
|
|
|
145
145
|
const dialog = useDialog()
|
|
146
146
|
|
|
@@ -35,8 +35,8 @@ This method is not SSR friendly (only on client side, with Nuxt use this composa
|
|
|
35
35
|
|
|
36
36
|
Time to read this page: <strong>{{ durationSelector }} minutes</strong>
|
|
37
37
|
|
|
38
|
-
<MazCard collapsible class="maz
|
|
39
|
-
<div id="content-to-read" class="maz
|
|
38
|
+
<MazCard collapsible class="maz:w-full" title="Content to read">
|
|
39
|
+
<div id="content-to-read" class="maz:px-4">
|
|
40
40
|
<p>
|
|
41
41
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lectus quam id leo in. Placerat vestibulum lectus mauris ultrices eros in cursus turpis. Et tortor consequat id porta nibh venenatis cras sed. Praesent tristique magna sit amet. Iaculis at erat pellentesque adipiscing commodo elit at. Interdum velit euismod in pellentesque massa placerat duis. Eget nunc scelerisque viverra mauris in aliquam. Nulla facilisi morbi tempus iaculis urna id volutpat lacus. Pellentesque eu tincidunt tortor aliquam nulla facilisi cras fermentum odio. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Volutpat blandit aliquam etiam erat velit scelerisque. Eget nullam non nisi est sit amet. Turpis egestas sed tempus urna et pharetra. Nisl rhoncus mattis rhoncus urna neque viverra justo. Rutrum tellus pellentesque eu tincidunt tortor aliquam. Non odio euismod lacinia at. Magna eget est lorem ipsum.
|
|
42
42
|
</p>
|
|
@@ -75,8 +75,8 @@ onMounted(() => {
|
|
|
75
75
|
Time to read this page: <strong>{{ duration }} minutes</strong>
|
|
76
76
|
</div>
|
|
77
77
|
|
|
78
|
-
<MazCard collapsible class="maz
|
|
79
|
-
<div id="content-to-read" class="maz
|
|
78
|
+
<MazCard collapsible class="maz:w-full" title="Content to read">
|
|
79
|
+
<div id="content-to-read" class="maz:px-4">
|
|
80
80
|
<p>
|
|
81
81
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Lectus quam id leo in. Placerat vestibulum lectus mauris ultrices eros in cursus turpis. Et tortor consequat id porta nibh venenatis cras sed. Praesent tristique magna sit amet. Iaculis at erat pellentesque adipiscing commodo elit at. Interdum velit euismod in pellentesque massa placerat duis. Eget nunc scelerisque viverra mauris in aliquam. Nulla facilisi morbi tempus iaculis urna id volutpat lacus. Pellentesque eu tincidunt tortor aliquam nulla facilisi cras fermentum odio. Egestas integer eget aliquet nibh praesent tristique magna sit amet. Volutpat blandit aliquam etiam erat velit scelerisque. Eget nullam non nisi est sit amet. Turpis egestas sed tempus urna et pharetra. Nisl rhoncus mattis rhoncus urna neque viverra justo. Rutrum tellus pellentesque eu tincidunt tortor aliquam. Non odio euismod lacinia at. Magna eget est lorem ipsum.
|
|
82
82
|
</p>
|
|
@@ -105,7 +105,7 @@ Time to read this page: <strong>{{ durationSelector }} minutes</strong>
|
|
|
105
105
|
|
|
106
106
|
<script lang="ts" setup>
|
|
107
107
|
import { ref, onMounted } from 'vue'
|
|
108
|
-
import { useReadingTime } from 'maz-ui/
|
|
108
|
+
import { useReadingTime } from 'maz-ui/composables/useReadingTime'
|
|
109
109
|
|
|
110
110
|
const velocity = ref()
|
|
111
111
|
|
|
@@ -10,15 +10,15 @@ description: Efficient composable for string matching tasks, utilizing Levenshte
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
12
|
<ComponentDemo>
|
|
13
|
-
<div class="maz
|
|
13
|
+
<div class="maz:flex maz:gap-4 maz:items-start maz:flex-wrap maz:mb-4">
|
|
14
14
|
<MazInput v-model="string1" label="Enter first string" />
|
|
15
15
|
<MazInput v-model="string2" label="Enter second string" />
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
<p class="
|
|
18
|
+
<p class="maz:mb-1!">
|
|
19
19
|
<b>isMatching:</b> {{ isMatching }}
|
|
20
20
|
</p>
|
|
21
|
-
<p class="
|
|
21
|
+
<p class="maz:my-0!">
|
|
22
22
|
<b>score:</b> {{ score }}
|
|
23
23
|
</p>
|
|
24
24
|
|
|
@@ -54,7 +54,7 @@ const { score, isMatching } = useStringMatching(string1, string2)
|
|
|
54
54
|
|
|
55
55
|
<script lang="ts" setup>
|
|
56
56
|
import { ref } from 'vue'
|
|
57
|
-
import { useStringMatching } from 'maz-ui/
|
|
57
|
+
import { useStringMatching } from 'maz-ui/composables/useStringMatching'
|
|
58
58
|
|
|
59
59
|
const string1 = ref<string>('maz-ui')
|
|
60
60
|
const string2 = ref<string>('méz-ui')
|
|
@@ -26,7 +26,7 @@ You can use this information to implement specific interactions in your applicat
|
|
|
26
26
|
<div ref="swipeContainer" class="swipe-container">
|
|
27
27
|
<p>
|
|
28
28
|
Swipe in any direction<br>
|
|
29
|
-
<span class="maz
|
|
29
|
+
<span class="maz:text-xs maz:text-muted">
|
|
30
30
|
(You should use a real device or a mobile simulator to test the swipe functionality)
|
|
31
31
|
</span>
|
|
32
32
|
<br><br>
|
|
@@ -73,7 +73,7 @@ onUnmounted(() => {
|
|
|
73
73
|
<div ref="swipeContainer" class="swipe-container">
|
|
74
74
|
<p>
|
|
75
75
|
Swipe in any direction<br>
|
|
76
|
-
<span class="maz
|
|
76
|
+
<span class="maz:text-sm maz:text-muted">
|
|
77
77
|
(You should use a real device or a mobile simulator to test the swipe functionality)
|
|
78
78
|
</span>
|
|
79
79
|
<br><br>
|
|
@@ -97,7 +97,7 @@ onUnmounted(() => {
|
|
|
97
97
|
```
|
|
98
98
|
|
|
99
99
|
<script lang="ts" setup>
|
|
100
|
-
import { useSwipe } from 'maz-ui/
|
|
100
|
+
import { useSwipe } from 'maz-ui/composables/useSwipe'
|
|
101
101
|
import { onMounted, onUnmounted, ref } from 'vue'
|
|
102
102
|
|
|
103
103
|
const swipeContainer = ref<HTMLDivElement>()
|
|
@@ -25,7 +25,7 @@ This composable can be used in Vue components to handle timeouts in a flexible a
|
|
|
25
25
|
|
|
26
26
|
**Remaning time**: {{ remainingTime }}ms
|
|
27
27
|
|
|
28
|
-
<div class="maz
|
|
28
|
+
<div class="maz:flex maz:items-center maz:gap-2">
|
|
29
29
|
<MazBtn @click="start">
|
|
30
30
|
Start
|
|
31
31
|
</MazBtn>
|
|
@@ -41,8 +41,8 @@ This composable can be used in Vue components to handle timeouts in a flexible a
|
|
|
41
41
|
</div>
|
|
42
42
|
|
|
43
43
|
<script lang="ts" setup>
|
|
44
|
-
import { useTimer } from 'maz-ui/
|
|
45
|
-
import { useToast } from 'maz-ui/
|
|
44
|
+
import { useTimer } from 'maz-ui/composables/useTimer'
|
|
45
|
+
import { useToast } from 'maz-ui/composables/useToast'
|
|
46
46
|
|
|
47
47
|
const toast = useToast()
|
|
48
48
|
|
|
@@ -91,7 +91,7 @@ onBeforeUnmount(() => {
|
|
|
91
91
|
<script lang="ts" setup>
|
|
92
92
|
import { onMounted, ref, onBeforeUnmount } from 'vue'
|
|
93
93
|
|
|
94
|
-
import { useUserVisibility } from 'maz-ui/
|
|
94
|
+
import { useUserVisibility } from 'maz-ui/composables/useUserVisibility'
|
|
95
95
|
|
|
96
96
|
const events = ref([])
|
|
97
97
|
|
|
@@ -49,8 +49,8 @@ onMounted(async () => {
|
|
|
49
49
|
|
|
50
50
|
<script lang="ts" setup>
|
|
51
51
|
import { onMounted } from 'vue'
|
|
52
|
-
import { sleep } from 'maz-ui/
|
|
53
|
-
import { useWait } from 'maz-ui/
|
|
52
|
+
import { sleep } from '@maz-ui/utils'
|
|
53
|
+
import { useWait } from 'maz-ui/composables/useWait'
|
|
54
54
|
|
|
55
55
|
const wait = useWait()
|
|
56
56
|
|
|
@@ -11,8 +11,8 @@ description: vClickOutside is a Vue directive to trigger a function when the use
|
|
|
11
11
|
|
|
12
12
|
<ComponentDemo>
|
|
13
13
|
<div
|
|
14
|
-
style="padding: 50px; background-color:
|
|
15
|
-
class="maz
|
|
14
|
+
style="padding: 50px; background-color: var(--maz-surface-300);"
|
|
15
|
+
class="maz:flex maz:flex-center maz:rounded-md"
|
|
16
16
|
>
|
|
17
17
|
<MazCard v-click-outside="clikedOutside">
|
|
18
18
|
Click outside me
|
|
@@ -21,8 +21,8 @@ description: vClickOutside is a Vue directive to trigger a function when the use
|
|
|
21
21
|
|
|
22
22
|
<div
|
|
23
23
|
v-if="hasClikedOutside"
|
|
24
|
-
style="padding: 16px; margin-top: 16px; background-color:
|
|
25
|
-
class="maz
|
|
24
|
+
style="padding: 16px; margin-top: 16px; background-color: var(--maz-success); color: black;"
|
|
25
|
+
class="maz:flex maz:flex-center maz:rounded-md"
|
|
26
26
|
>
|
|
27
27
|
You clicked outside
|
|
28
28
|
</div>
|
|
@@ -44,7 +44,7 @@ function clikedOutside() {
|
|
|
44
44
|
|
|
45
45
|
<template>
|
|
46
46
|
<div
|
|
47
|
-
style="padding: 50px; background-color:
|
|
47
|
+
style="padding: 50px; background-color: var(--maz-surface-300);"
|
|
48
48
|
class="flex flex-center rounded"
|
|
49
49
|
>
|
|
50
50
|
<MazCard v-click-outside="clikedOutside">
|
|
@@ -54,7 +54,7 @@ function clikedOutside() {
|
|
|
54
54
|
|
|
55
55
|
<div
|
|
56
56
|
v-if="hasClikedOutside"
|
|
57
|
-
style="padding: 16px; margin-top: 16px; background-color:
|
|
57
|
+
style="padding: 16px; margin-top: 16px; background-color: var(--maz-success); color: black;"
|
|
58
58
|
class="flex flex-center rounded"
|
|
59
59
|
>
|
|
60
60
|
You clicked outside
|
|
@@ -71,13 +71,13 @@ The directive can accept an options object to customize its behavior:
|
|
|
71
71
|
|
|
72
72
|
<ComponentDemo>
|
|
73
73
|
<div
|
|
74
|
-
style="padding: 50px; background-color:
|
|
75
|
-
class="maz
|
|
74
|
+
style="padding: 50px; background-color: var(--maz-surface-300);"
|
|
75
|
+
class="maz:flex maz:flex-center maz:rounded-md"
|
|
76
76
|
>
|
|
77
77
|
<MazCard v-click-outside="{ callback: clickedOutsideWithIgnore, ignore: ['.ignore-me'] }">
|
|
78
|
-
<div class="maz
|
|
78
|
+
<div class="maz:p-4">
|
|
79
79
|
<p>Click outside me (but not on the button below)</p>
|
|
80
|
-
<MazBtn class="ignore-me maz
|
|
80
|
+
<MazBtn class="ignore-me maz:mt-2" color="secondary">
|
|
81
81
|
This button is ignored
|
|
82
82
|
</MazBtn>
|
|
83
83
|
</div>
|
|
@@ -86,8 +86,8 @@ The directive can accept an options object to customize its behavior:
|
|
|
86
86
|
|
|
87
87
|
<div
|
|
88
88
|
v-if="hasClickedOutsideWithIgnore"
|
|
89
|
-
style="padding: 16px; margin-top: 16px; background-color:
|
|
90
|
-
class="maz
|
|
89
|
+
style="padding: 16px; margin-top: 16px; background-color: var(--maz-warning); color: black;"
|
|
90
|
+
class="maz:flex maz:flex-center maz:rounded-md"
|
|
91
91
|
>
|
|
92
92
|
You clicked outside (button clicks are ignored)
|
|
93
93
|
</div>
|
|
@@ -128,8 +128,8 @@ The directive can be configured to trigger only once:
|
|
|
128
128
|
|
|
129
129
|
<ComponentDemo>
|
|
130
130
|
<div
|
|
131
|
-
style="padding: 50px; background-color:
|
|
132
|
-
class="maz
|
|
131
|
+
style="padding: 50px; background-color: var(--maz-surface-300);"
|
|
132
|
+
class="maz:flex maz:flex-center maz:rounded-md"
|
|
133
133
|
>
|
|
134
134
|
<MazCard v-click-outside="{ callback: clickedOnce, once: true }">
|
|
135
135
|
Click outside me (works only once)
|
|
@@ -138,8 +138,8 @@ The directive can be configured to trigger only once:
|
|
|
138
138
|
|
|
139
139
|
<div
|
|
140
140
|
v-if="hasClickedOnce"
|
|
141
|
-
style="padding: 16px; margin-top: 16px; background-color:
|
|
142
|
-
class="maz
|
|
141
|
+
style="padding: 16px; margin-top: 16px; background-color: var(--maz-info); color: white;"
|
|
142
|
+
class="maz:flex maz:flex-center maz:rounded-md"
|
|
143
143
|
>
|
|
144
144
|
This will only show once!
|
|
145
145
|
</div>
|
|
@@ -253,7 +253,7 @@ Please refer to the [Nuxt module documentation](./../guide/nuxt.md) for more inf
|
|
|
253
253
|
|
|
254
254
|
<script lang="ts" setup>
|
|
255
255
|
import { ref } from 'vue'
|
|
256
|
-
import { vClickOutside } from 'maz-ui/
|
|
256
|
+
import { vClickOutside } from 'maz-ui/directives/vClickOutside'
|
|
257
257
|
|
|
258
258
|
const hasClikedOutside = ref(false)
|
|
259
259
|
const hasClickedOutsideWithIgnore = ref(false)
|
|
@@ -10,7 +10,7 @@ description: vLazyImg is a Vue directive to lazy load images with many options.
|
|
|
10
10
|
## Basic usage
|
|
11
11
|
|
|
12
12
|
<img
|
|
13
|
-
style="background-color:
|
|
13
|
+
style="background-color: var(--maz-surface-300); width: 80%;"
|
|
14
14
|
class="flex flex-center rounded"
|
|
15
15
|
v-lazy-img="'https://placedog.net/1500/1000'"
|
|
16
16
|
/>
|
|
@@ -23,7 +23,7 @@ import { vLazyImg } from 'maz-ui/directives'
|
|
|
23
23
|
<template>
|
|
24
24
|
<img
|
|
25
25
|
v-lazy-img="'https://placedog.net/1500/1000'"
|
|
26
|
-
style="background-color:
|
|
26
|
+
style="background-color: var(--maz-surface-300); width: 80%;"
|
|
27
27
|
class="flex flex-center rounded"
|
|
28
28
|
>
|
|
29
29
|
</template>
|
|
@@ -54,7 +54,7 @@ import { vLazyImg } from 'maz-ui/directives'
|
|
|
54
54
|
> Open the developer console to show logs
|
|
55
55
|
|
|
56
56
|
<img
|
|
57
|
-
style="background-color:
|
|
57
|
+
style="background-color: var(--maz-surface-300); width: 80%;"
|
|
58
58
|
class="flex flex-center rounded"
|
|
59
59
|
v-lazy-img="lazyBinding"
|
|
60
60
|
/>
|
|
@@ -83,7 +83,7 @@ const lazyBinding: vLazyImgBindingValue = {
|
|
|
83
83
|
<template>
|
|
84
84
|
<img
|
|
85
85
|
v-lazy-img="lazyBinding"
|
|
86
|
-
style="background-color:
|
|
86
|
+
style="background-color: var(--maz-surface-300); width: 80%;"
|
|
87
87
|
class="flex flex-center rounded"
|
|
88
88
|
>
|
|
89
89
|
</template>
|
|
@@ -163,7 +163,7 @@ export type vLazyImgBindingValue = string | vLazyImgBindingOptions
|
|
|
163
163
|
```
|
|
164
164
|
|
|
165
165
|
<script lang="ts" setup>
|
|
166
|
-
import { vLazyImg, type vLazyImgBindingValue } from 'maz-ui/
|
|
166
|
+
import { vLazyImg, type vLazyImgBindingValue } from 'maz-ui/directives/vLazyImg'
|
|
167
167
|
import { ref } from 'vue'
|
|
168
168
|
|
|
169
169
|
const lazyBinding: vLazyImgBindingValue = {
|
|
@@ -11,11 +11,11 @@ description: vTooltip is a Vue directive to display a text when the user hovers
|
|
|
11
11
|
## Basic usage
|
|
12
12
|
|
|
13
13
|
<ComponentDemo>
|
|
14
|
-
<p class="maz
|
|
14
|
+
<p class="maz:mb-4">
|
|
15
15
|
Hover the buttons
|
|
16
16
|
</p>
|
|
17
17
|
<div
|
|
18
|
-
class="maz
|
|
18
|
+
class="maz:flex maz:gap-3 maz:flex-wrap"
|
|
19
19
|
>
|
|
20
20
|
<MazBtn v-tooltip="'This is a top tooltip'">
|
|
21
21
|
Top
|
|
@@ -60,11 +60,11 @@ import { vTooltip } from 'maz-ui/directives'
|
|
|
60
60
|
## Colors
|
|
61
61
|
|
|
62
62
|
<ComponentDemo>
|
|
63
|
-
<p class="maz
|
|
63
|
+
<p class="maz:mb-4">
|
|
64
64
|
Hover the buttons
|
|
65
65
|
</p>
|
|
66
66
|
<div
|
|
67
|
-
class="maz
|
|
67
|
+
class="maz:flex maz:gap-3 maz:flex-wrap"
|
|
68
68
|
>
|
|
69
69
|
<MazBtn v-tooltip="{ text: 'Tooltip text', color: 'primary' }">
|
|
70
70
|
Primary
|
|
@@ -90,7 +90,7 @@ import { vTooltip } from 'maz-ui/directives'
|
|
|
90
90
|
<MazBtn v-tooltip="{ text: 'Tooltip text', color: 'contrast' }" color="contrast">
|
|
91
91
|
Contrast
|
|
92
92
|
</MazBtn>
|
|
93
|
-
<MazBtn v-tooltip="{ text: 'Tooltip text', color: '
|
|
93
|
+
<MazBtn v-tooltip="{ text: 'Tooltip text', color: 'surface' }" color="surface">
|
|
94
94
|
Background
|
|
95
95
|
</MazBtn>
|
|
96
96
|
</div>
|
|
@@ -130,7 +130,7 @@ import { vTooltip } from 'maz-ui/directives'
|
|
|
130
130
|
Contrast
|
|
131
131
|
</MazBtn>
|
|
132
132
|
|
|
133
|
-
<MazBtn v-tooltip="{ text: 'Tooltip text', color: 'default' }" color="
|
|
133
|
+
<MazBtn v-tooltip="{ text: 'Tooltip text', color: 'default' }" color="surface">
|
|
134
134
|
Background
|
|
135
135
|
</MazBtn>
|
|
136
136
|
```
|
|
@@ -144,7 +144,7 @@ You can change the position of the tooltip by passing a `position` option or usi
|
|
|
144
144
|
|
|
145
145
|
<ComponentDemo>
|
|
146
146
|
<div
|
|
147
|
-
class="maz
|
|
147
|
+
class="maz:flex maz:gap-3 maz:flex-wrap"
|
|
148
148
|
>
|
|
149
149
|
<MazBtn v-tooltip.bottom="{ text: 'Tooltip text' }">
|
|
150
150
|
Bottom
|
|
@@ -230,7 +230,7 @@ You can also use HTML content in the tooltip by passing a string to the `html` o
|
|
|
230
230
|
|
|
231
231
|
<ComponentDemo>
|
|
232
232
|
<div
|
|
233
|
-
class="maz
|
|
233
|
+
class="maz:flex maz:gap-3 maz:flex-wrap"
|
|
234
234
|
>
|
|
235
235
|
<MazBtn v-tooltip="{ html: '<strong>Tooltip</strong> text <br> with <br> line breaks' }">
|
|
236
236
|
HTML
|
|
@@ -254,9 +254,9 @@ You can customize the tooltip by passing a `panelClass` or `panelStyle` option.
|
|
|
254
254
|
|
|
255
255
|
<ComponentDemo>
|
|
256
256
|
<div
|
|
257
|
-
class="maz
|
|
257
|
+
class="maz:flex maz:gap-3 maz:flex-wrap"
|
|
258
258
|
>
|
|
259
|
-
<MazBtn v-tooltip="{ text: 'Custom panel class', panelClass: '
|
|
259
|
+
<MazBtn v-tooltip="{ text: 'Custom panel class', panelClass: 'maz:text-red-500!' }">
|
|
260
260
|
panelClass
|
|
261
261
|
</MazBtn>
|
|
262
262
|
<MazBtn v-tooltip="{ text: 'Custom panel style', panelStyle: 'background-color: red; color: white;' }">
|
|
@@ -267,7 +267,7 @@ You can customize the tooltip by passing a `panelClass` or `panelStyle` option.
|
|
|
267
267
|
<template #code>
|
|
268
268
|
|
|
269
269
|
```html
|
|
270
|
-
<MazBtn v-tooltip="{ text: 'Custom panel class', panelClass: '
|
|
270
|
+
<MazBtn v-tooltip="{ text: 'Custom panel class', panelClass: 'maz:text-red-500!' }">
|
|
271
271
|
panelClass
|
|
272
272
|
</MazBtn>
|
|
273
273
|
<MazBtn v-tooltip="{ text: 'Custom panel style', panelStyle: 'background-color: red; color: white;' }">
|
|
@@ -288,7 +288,7 @@ The `adaptive` trigger will use the `click` trigger on touch devices (mobile and
|
|
|
288
288
|
|
|
289
289
|
<ComponentDemo>
|
|
290
290
|
<div
|
|
291
|
-
class="maz
|
|
291
|
+
class="maz:flex maz:gap-3 maz:flex-wrap"
|
|
292
292
|
>
|
|
293
293
|
<MazBtn v-tooltip="{ text: 'Tooltip text', trigger: 'click' }">
|
|
294
294
|
Click
|
|
@@ -326,7 +326,7 @@ The `offset` (in px) option allows you to adjust the position of the tooltip rel
|
|
|
326
326
|
|
|
327
327
|
<ComponentDemo>
|
|
328
328
|
<div
|
|
329
|
-
class="maz
|
|
329
|
+
class="maz:flex maz:gap-3 maz:flex-wrap"
|
|
330
330
|
>
|
|
331
331
|
<MazBtn v-tooltip="{ text: 'Tooltip text', offset: 0 }">
|
|
332
332
|
0
|
|
@@ -368,7 +368,7 @@ The `offset` (in px) option allows you to adjust the position of the tooltip rel
|
|
|
368
368
|
## Open programmatically
|
|
369
369
|
|
|
370
370
|
<ComponentDemo>
|
|
371
|
-
<div class="maz
|
|
371
|
+
<div class="maz:flex maz:gap-3 maz:flex-wrap">
|
|
372
372
|
<MazBtn v-tooltip.top="{ text: 'Tooltip text', open: open }">
|
|
373
373
|
Primary
|
|
374
374
|
</MazBtn>
|
|
@@ -475,6 +475,6 @@ type VTooltipBindingValue
|
|
|
475
475
|
|
|
476
476
|
<script lang="ts" setup>
|
|
477
477
|
import { ref } from 'vue'
|
|
478
|
-
import { vTooltip } from 'maz-ui/
|
|
478
|
+
import { vTooltip } from 'maz-ui/directives/vTooltip'
|
|
479
479
|
const open = ref(true)
|
|
480
480
|
</script>
|
|
@@ -56,7 +56,7 @@ import { vZoomImg } from 'maz-ui/directives'
|
|
|
56
56
|
</MazCard>
|
|
57
57
|
|
|
58
58
|
<script lang="ts" setup>
|
|
59
|
-
import { vZoomImg } from 'maz-ui/
|
|
59
|
+
import { vZoomImg } from 'maz-ui/directives/vZoomImg'
|
|
60
60
|
|
|
61
61
|
const zoomImgBinding: vZoomImgBinding = {
|
|
62
62
|
src: 'https://placedog.net/1200/800',
|