maz-ui 5.0.0 → 5.1.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{MazDropzone.DJ8au25t.css → MazDropzone.BW2grpTi.css} +1 -1
- package/dist/chunks/{MazDrawer.DANxKYxJ.js → MazDrawer.CC8zomfx.js} +2 -2
- package/dist/chunks/{MazDropzone.POH3pmfi.js → MazDropzone.Dez5j0WP.js} +2 -2
- package/dist/components/MazDrawer.js +1 -1
- package/dist/components/MazDropzone.js +1 -1
- package/dist/components/MazDropzone.vue.d.ts +2 -2
- package/dist/components/MazInputPrice.vue.d.ts +1 -1
- package/dist/components/index.js +2 -2
- package/docs/README.md +207 -0
- package/docs/agents/agents-md.md +52 -0
- package/docs/agents/claude-rule.md +52 -0
- package/docs/components/maz-accordion.md +76 -0
- package/docs/components/maz-alert.md +241 -0
- package/docs/components/maz-animated-counter.md +87 -0
- package/docs/components/maz-animated-element.md +46 -0
- package/docs/components/maz-animated-text.md +53 -0
- package/docs/components/maz-avatar.md +193 -0
- package/docs/components/maz-backdrop.md +178 -0
- package/docs/components/maz-badge.md +167 -0
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/components/maz-btn-group.md +316 -0
- package/docs/components/maz-btn.md +423 -0
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/components/maz-card.md +321 -0
- package/docs/components/maz-carousel.md +153 -0
- package/docs/components/maz-chart.md +206 -0
- package/docs/components/maz-checkbox.md +138 -0
- package/docs/components/maz-checklist.md +251 -0
- package/docs/components/maz-circular-progress-bar.md +109 -0
- package/docs/components/maz-code-highlight.md +155 -0
- package/docs/components/maz-container.md +241 -0
- package/docs/components/maz-date-picker.md +791 -0
- package/docs/components/maz-dialog-confirm.md +215 -0
- package/docs/components/maz-dialog.md +143 -0
- package/docs/components/maz-drawer.md +106 -0
- package/docs/components/maz-dropdown.md +419 -0
- package/docs/components/maz-dropzone.md +387 -0
- package/docs/components/maz-expand-animation.md +82 -0
- package/docs/components/maz-fullscreen-loader.md +58 -0
- package/docs/components/maz-gallery.md +79 -0
- package/docs/components/maz-icon.md +203 -0
- package/docs/components/maz-input-code.md +73 -0
- package/docs/components/maz-input-number.md +79 -0
- package/docs/components/maz-input-phone-number.md +536 -0
- package/docs/components/maz-input-price.md +68 -0
- package/docs/components/maz-input-tags.md +112 -0
- package/docs/components/maz-input.md +334 -0
- package/docs/components/maz-lazy-img.md +113 -0
- package/docs/components/maz-link.md +146 -0
- package/docs/components/maz-loading-bar.md +38 -0
- package/docs/components/maz-markdown-editor.md +320 -0
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/components/maz-pull-to-refresh.md +222 -0
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/components/maz-read-more.md +209 -0
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/components/maz-select-country.md +513 -0
- package/docs/components/maz-select.md +318 -0
- package/docs/components/maz-sidebar-content.md +25 -0
- package/docs/components/maz-sidebar-footer.md +25 -0
- package/docs/components/maz-sidebar-group.md +27 -0
- package/docs/components/maz-sidebar-header.md +25 -0
- package/docs/components/maz-sidebar-menu-button.md +41 -0
- package/docs/components/maz-sidebar-menu-item.md +25 -0
- package/docs/components/maz-sidebar-menu-sub.md +32 -0
- package/docs/components/maz-sidebar-menu.md +25 -0
- package/docs/components/maz-sidebar-separator.md +21 -0
- package/docs/components/maz-sidebar-trigger.md +25 -0
- package/docs/components/maz-sidebar.md +507 -0
- package/docs/components/maz-skeleton.md +226 -0
- package/docs/components/maz-slider.md +165 -0
- package/docs/components/maz-spinner.md +84 -0
- package/docs/components/maz-stepper.md +301 -0
- package/docs/components/maz-switch.md +86 -0
- package/docs/components/maz-table-cell.md +27 -0
- package/docs/components/maz-table-row.md +28 -0
- package/docs/components/maz-table-title.md +27 -0
- package/docs/components/maz-table-virtualizer.md +31 -0
- package/docs/components/maz-table.md +426 -0
- package/docs/components/maz-tabs-bar.md +43 -0
- package/docs/components/maz-tabs-content-item.md +27 -0
- package/docs/components/maz-tabs-content.md +27 -0
- package/docs/components/maz-tabs.md +308 -0
- package/docs/components/maz-textarea.md +255 -0
- package/docs/components/maz-ticker.md +427 -0
- package/docs/components/maz-timeline.md +304 -0
- package/docs/components/maz-ui-provider.md +26 -0
- package/docs/components/maz-window-mockup.md +182 -0
- package/docs/composables/use-aos.md +41 -0
- package/docs/composables/use-breakpoints.md +42 -0
- package/docs/composables/use-dialog.md +58 -0
- package/docs/composables/use-display-names.md +130 -0
- package/docs/composables/use-drag.md +185 -0
- package/docs/composables/use-form-validator.md +1123 -0
- package/docs/composables/use-idle-timeout.md +172 -0
- package/docs/composables/use-pull-to-refresh.md +86 -0
- package/docs/composables/use-reading-time.md +132 -0
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/composables/use-swipe.md +171 -0
- package/docs/composables/use-timer.md +104 -0
- package/docs/composables/use-toast.md +50 -0
- package/docs/composables/use-user-visibility.md +127 -0
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/directives/click-outside.md +182 -0
- package/docs/directives/fullscreen-img.md +83 -0
- package/docs/directives/lazy-img.md +182 -0
- package/docs/directives/tooltip.md +298 -0
- package/docs/directives/zoom-img.md +100 -0
- package/docs/ecosystem/eslint-config.md +289 -0
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/ecosystem/icons/index.md +584 -0
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/ecosystem/node/exec-promise.md +93 -0
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/ecosystem/node/logger.md +152 -0
- package/docs/ecosystem/node/print-banner.md +101 -0
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/ecosystem/nuxt.md +551 -0
- package/docs/ecosystem/stylelint-config.md +310 -0
- package/docs/ecosystem/themes.md +966 -0
- package/docs/ecosystem/translations.md +1173 -0
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/ecosystem/utils/check-availability.md +85 -0
- package/docs/ecosystem/utils/cookie.md +86 -0
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/ecosystem/utils/currency.md +53 -0
- package/docs/ecosystem/utils/date.md +53 -0
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/ecosystem/utils/debounce-id.md +75 -0
- package/docs/ecosystem/utils/debounce.md +71 -0
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/ecosystem/utils/format-json.md +39 -0
- package/docs/ecosystem/utils/format-phone-number.md +43 -0
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/ecosystem/utils/get-error-message.md +45 -0
- package/docs/ecosystem/utils/idle-timeout.md +96 -0
- package/docs/ecosystem/utils/index.md +57 -0
- package/docs/ecosystem/utils/is-client.md +38 -0
- package/docs/ecosystem/utils/is-equal.md +44 -0
- package/docs/ecosystem/utils/is-ios.md +43 -0
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/ecosystem/utils/kebab-case.md +42 -0
- package/docs/ecosystem/utils/normalize-string.md +83 -0
- package/docs/ecosystem/utils/number.md +51 -0
- package/docs/ecosystem/utils/pascal-case.md +41 -0
- package/docs/ecosystem/utils/prevent-ios-input-zoom.md +72 -0
- package/docs/ecosystem/utils/script-loader.md +85 -0
- package/docs/ecosystem/utils/sleep.md +65 -0
- package/docs/ecosystem/utils/snake-case.md +42 -0
- package/docs/ecosystem/utils/swipe-handler.md +97 -0
- package/docs/ecosystem/utils/textarea-autogrow.md +47 -0
- package/docs/ecosystem/utils/throttle-id.md +54 -0
- package/docs/ecosystem/utils/throttle.md +63 -0
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/ecosystem/utils/types/deep-key-of.md +54 -0
- package/docs/ecosystem/utils/types/deep-partial.md +48 -0
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/ecosystem/utils/types/generic-instance-type.md +48 -0
- package/docs/ecosystem/utils/types/infer-maybe-ref.md +41 -0
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/ecosystem/utils/user-visibility.md +75 -0
- package/docs/guide/ai-agents.md +237 -0
- package/docs/guide/browser-support.md +88 -0
- package/docs/guide/getting-started.md +191 -0
- package/docs/guide/global-defaults.md +103 -0
- package/docs/guide/maz-ui-provider.md +231 -0
- package/docs/guide/migration-v5.md +871 -0
- package/docs/guide/resolvers.md +650 -0
- package/docs/guide/tailwind.md +483 -0
- package/docs/guide/vue.md +286 -0
- package/docs/manifest.json +1 -0
- package/docs/plugins/aos.md +312 -0
- package/docs/plugins/dialog.md +269 -0
- package/docs/plugins/toast.md +221 -0
- package/docs/plugins/wait.md +78 -0
- package/docs/reference/icons.md +46 -0
- package/docs/reference/tailwind-tokens.md +191 -0
- package/docs/rules.md +57 -0
- package/package.json +31 -4
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazAlert"
|
|
3
|
+
description: "MazAlert is an accessible component for displaying contextual feedback messages like success, warning, error, or informational notifications with customizable colors, icons, and styling options"
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-alert"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazAlert
|
|
9
|
+
|
|
10
|
+
> MazAlert is an accessible component for displaying contextual feedback messages like success, warning, error, or informational notifications with customizable colors, icons, and styling options
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazAlert from 'maz-ui/components/MazAlert'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-alert
|
|
16
|
+
|
|
17
|
+
> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)
|
|
18
|
+
|
|
19
|
+
## Basic usage
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<template>
|
|
23
|
+
<MazAlert title="Information" content="This is an informational alert message." />
|
|
24
|
+
</template>
|
|
25
|
+
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import MazAlert from 'maz-ui/components/MazAlert'
|
|
28
|
+
</script>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Variants
|
|
32
|
+
|
|
33
|
+
MazAlert supports two visual variants: `soft` (default) with transparent background, and `solid` with full color background.
|
|
34
|
+
|
|
35
|
+
### Soft variant (default)
|
|
36
|
+
|
|
37
|
+
The soft variant uses a transparent background with colored text.
|
|
38
|
+
|
|
39
|
+
```vue
|
|
40
|
+
<template>
|
|
41
|
+
<MazAlert color="info" variant="soft" title="Soft Info" content="..." />
|
|
42
|
+
<MazAlert color="success" variant="soft" title="Soft Success" content="..." />
|
|
43
|
+
<MazAlert color="destructive" variant="soft" title="Soft Error" content="..." />
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Solid variant
|
|
48
|
+
|
|
49
|
+
The solid variant uses the full color as background with contrasting text.
|
|
50
|
+
|
|
51
|
+
```vue
|
|
52
|
+
<template>
|
|
53
|
+
<MazAlert color="info" variant="solid" title="Solid Info" content="..." />
|
|
54
|
+
<MazAlert color="success" variant="solid" title="Solid Success" content="..." />
|
|
55
|
+
<MazAlert color="destructive" variant="solid" title="Solid Error" content="..." />
|
|
56
|
+
</template>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### All colors with solid variant
|
|
60
|
+
|
|
61
|
+
```vue
|
|
62
|
+
<template>
|
|
63
|
+
<MazAlert color="info" variant="solid" title="Info" content="..." />
|
|
64
|
+
<MazAlert color="success" variant="solid" title="Success" content="..." />
|
|
65
|
+
<MazAlert color="warning" variant="solid" title="Warning" content="..." />
|
|
66
|
+
<MazAlert color="destructive" variant="solid" title="Error" content="..." />
|
|
67
|
+
<!-- ... other colors -->
|
|
68
|
+
</template>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Colors
|
|
72
|
+
|
|
73
|
+
MazAlert supports all theme colors to convey different types of messages.
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<template>
|
|
77
|
+
<MazAlert color="info" title="Info" content="This is an info alert." />
|
|
78
|
+
<MazAlert color="success" title="Success" content="Operation completed successfully!" />
|
|
79
|
+
<MazAlert color="warning" title="Warning" content="Please review before proceeding." />
|
|
80
|
+
<MazAlert color="destructive" title="Error" content="An error occurred." />
|
|
81
|
+
<MazAlert color="primary" title="Primary" content="This is a primary alert." />
|
|
82
|
+
<MazAlert color="secondary" title="Secondary" content="This is a secondary alert." />
|
|
83
|
+
<MazAlert color="accent" title="Accent" content="This is an accent alert." />
|
|
84
|
+
<MazAlert color="contrast" title="Contrast" content="This is a contrast alert." />
|
|
85
|
+
</template>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## With slots
|
|
89
|
+
|
|
90
|
+
Use slots for more complex content with custom HTML.
|
|
91
|
+
|
|
92
|
+
```vue
|
|
93
|
+
<template>
|
|
94
|
+
<MazAlert color="destructive">
|
|
95
|
+
<template #title>
|
|
96
|
+
3 errors found
|
|
97
|
+
</template>
|
|
98
|
+
<ul class="m-0 list-inside list-disc pl-0">
|
|
99
|
+
<li>firstname - Invalid length: Expected >=5 but received 0</li>
|
|
100
|
+
<li>lastname - Invalid length: Expected >=2 but received 0</li>
|
|
101
|
+
<li>age - Invalid type: Expected number but received ""</li>
|
|
102
|
+
</ul>
|
|
103
|
+
</MazAlert>
|
|
104
|
+
</template>
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Without border
|
|
108
|
+
|
|
109
|
+
Remove the border with `:bordered="false"`.
|
|
110
|
+
|
|
111
|
+
```vue
|
|
112
|
+
<template>
|
|
113
|
+
<MazAlert
|
|
114
|
+
color="success"
|
|
115
|
+
title="Without border"
|
|
116
|
+
content="This alert has no border."
|
|
117
|
+
:bordered="false"
|
|
118
|
+
/>
|
|
119
|
+
|
|
120
|
+
<MazAlert
|
|
121
|
+
color="success"
|
|
122
|
+
title="With border (default)"
|
|
123
|
+
content="This alert has a border."
|
|
124
|
+
/>
|
|
125
|
+
</template>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Rounded sizes
|
|
129
|
+
|
|
130
|
+
Customize the border radius with the `rounded-size` prop.
|
|
131
|
+
|
|
132
|
+
```vue
|
|
133
|
+
<template>
|
|
134
|
+
<MazAlert rounded-size="none" title="Rounded: none" content="..." />
|
|
135
|
+
<MazAlert rounded-size="sm" title="Rounded: sm" content="..." />
|
|
136
|
+
<MazAlert rounded-size="md" title="Rounded: md" content="..." />
|
|
137
|
+
<MazAlert rounded-size="base" title="Rounded: base (default)" content="..." />
|
|
138
|
+
<MazAlert rounded-size="lg" title="Rounded: lg" content="..." />
|
|
139
|
+
<MazAlert rounded-size="xl" title="Rounded: xl" content="..." />
|
|
140
|
+
<MazAlert rounded-size="2xl" title="Rounded: 2xl" content="..." />
|
|
141
|
+
<MazAlert rounded-size="3xl" title="Rounded: 3xl" content="..." />
|
|
142
|
+
</template>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Hide icon
|
|
146
|
+
|
|
147
|
+
Hide the default icon with `hide-icon`.
|
|
148
|
+
|
|
149
|
+
```vue
|
|
150
|
+
<template>
|
|
151
|
+
<MazAlert color="warning" title="With icon (default)" content="The icon is visible." />
|
|
152
|
+
<MazAlert color="warning" title="Without icon" content="The icon is hidden." hide-icon />
|
|
153
|
+
</template>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Custom icon
|
|
157
|
+
|
|
158
|
+
Provide a custom icon using the `icon` prop.
|
|
159
|
+
|
|
160
|
+
```vue
|
|
161
|
+
<template>
|
|
162
|
+
<MazAlert
|
|
163
|
+
color="primary"
|
|
164
|
+
title="Custom icon"
|
|
165
|
+
content="This alert uses a custom icon."
|
|
166
|
+
icon="/bell.svg"
|
|
167
|
+
/>
|
|
168
|
+
</template>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Title only or content only
|
|
172
|
+
|
|
173
|
+
You can use either title, content, or both.
|
|
174
|
+
|
|
175
|
+
```vue
|
|
176
|
+
<template>
|
|
177
|
+
<MazAlert color="info" title="Title only alert" />
|
|
178
|
+
<MazAlert color="success" content="Content only alert without a title." />
|
|
179
|
+
<MazAlert color="warning" title="Both title and content" content="This alert has both." />
|
|
180
|
+
</template>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Use cases
|
|
184
|
+
|
|
185
|
+
### Form validation errors
|
|
186
|
+
|
|
187
|
+
```vue
|
|
188
|
+
<template>
|
|
189
|
+
<MazAlert color="destructive" title="Please fix the following errors:">
|
|
190
|
+
<ul class="m-0 list-inside list-disc pl-0">
|
|
191
|
+
<li>Email address is required</li>
|
|
192
|
+
<li>Password must be at least 8 characters</li>
|
|
193
|
+
</ul>
|
|
194
|
+
</MazAlert>
|
|
195
|
+
</template>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Success notification
|
|
199
|
+
|
|
200
|
+
```vue
|
|
201
|
+
<template>
|
|
202
|
+
<MazAlert
|
|
203
|
+
color="success"
|
|
204
|
+
title="Payment successful!"
|
|
205
|
+
content="Your order #12345 has been confirmed. You will receive an email confirmation shortly."
|
|
206
|
+
/>
|
|
207
|
+
</template>
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Warning message
|
|
211
|
+
|
|
212
|
+
```vue
|
|
213
|
+
<template>
|
|
214
|
+
<MazAlert
|
|
215
|
+
color="warning"
|
|
216
|
+
title="Session expiring soon"
|
|
217
|
+
content="Your session will expire in 5 minutes. Please save your work to avoid losing any changes."
|
|
218
|
+
/>
|
|
219
|
+
</template>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## MazAlert API
|
|
223
|
+
|
|
224
|
+
`import MazAlert from 'maz-ui/components/MazAlert'`
|
|
225
|
+
|
|
226
|
+
### Props
|
|
227
|
+
|
|
228
|
+
- `title` (`string`): Title of the alert.
|
|
229
|
+
- `content` (`string`): Content of the alert.
|
|
230
|
+
- `icon` (`string | IconComponent`): Icon of the alert - can be a component or icon name string.
|
|
231
|
+
- `hide-icon` (`boolean`, default: `false`): Hide the icon.
|
|
232
|
+
- `color` (`MazAlertColor`, default: `"info"`): Color of the alert. Values: `'success'`, `'warning'`, `'destructive'`, `'info'`, `'primary'`, `'secondary'`, `'accent'`, `'contrast'` (non exhaustive).
|
|
233
|
+
- `icon-size` (`MazIconSize`, default: `"md"`): Size of the icon.
|
|
234
|
+
- `rounded-size` (`MazAlertRoundedSize`, default: `'md'`): Size of the rounded corners. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'2xl'`, `'3xl'` (non exhaustive).
|
|
235
|
+
- `bordered` (`boolean`, default: `true`): Add border to the component.
|
|
236
|
+
- `variant` (`MazAlertVariant`, default: `"soft"`): Visual variant of the alert. Values: `'soft'`, `'solid'` (non exhaustive).
|
|
237
|
+
|
|
238
|
+
### Slots
|
|
239
|
+
|
|
240
|
+
- `#title`: Title slot - overrides title prop
|
|
241
|
+
- `#default`: Default slot for alert content - overrides content prop
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazAnimatedCounter"
|
|
3
|
+
description: "MazAnimatedCounter is a standalone component that allows you to animate a number from 0 to a specific value. Fully animated with CSS."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-animated-counter"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazAnimatedCounter
|
|
9
|
+
|
|
10
|
+
> MazAnimatedCounter is a standalone component that allows you to animate a number from 0 to a specific value. Fully animated with CSS.
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazAnimatedCounter from 'maz-ui/components/MazAnimatedCounter'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-animated-counter
|
|
16
|
+
|
|
17
|
+
> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)
|
|
18
|
+
|
|
19
|
+
## Basic usage
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
import MazAnimatedCounter from 'maz-ui/components/MazAnimatedCounter'
|
|
24
|
+
|
|
25
|
+
const count = ref(Math.floor(Math.random() * 99999))
|
|
26
|
+
|
|
27
|
+
onMounted(() => {
|
|
28
|
+
setInterval(() => {
|
|
29
|
+
count.value = Math.floor(Math.random() * 99999)
|
|
30
|
+
}, 3000)
|
|
31
|
+
})
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<MazAnimatedCounter :count="4000" />
|
|
36
|
+
</template>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## duration
|
|
40
|
+
|
|
41
|
+
You can set the duration of the animation with the `duration` prop. The default value is `1000` ms.
|
|
42
|
+
|
|
43
|
+
```vue
|
|
44
|
+
<MazAnimatedCounter :count="4000" :duration="5000" />
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## prefix and suffix
|
|
48
|
+
|
|
49
|
+
You can add a prefix and a suffix to the number with props or slots.
|
|
50
|
+
|
|
51
|
+
Be careful, you can't use both at the same time.
|
|
52
|
+
|
|
53
|
+
```html
|
|
54
|
+
<p class="font-semibold">Prefixed</p>
|
|
55
|
+
|
|
56
|
+
<MazAnimatedCounter :count="20" prefix="$" />
|
|
57
|
+
|
|
58
|
+
<MazAnimatedCounter :count="20">
|
|
59
|
+
<template #prefix>$</template>
|
|
60
|
+
</MazAnimatedCounter>
|
|
61
|
+
|
|
62
|
+
<p class="font-semibold">Suffixed</p>
|
|
63
|
+
|
|
64
|
+
<MazAnimatedCounter :count="100" suffix="%" />
|
|
65
|
+
|
|
66
|
+
<MazAnimatedCounter :count="100">
|
|
67
|
+
<template #suffix>%</template>
|
|
68
|
+
</MazAnimatedCounter>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## MazAnimatedCounter API
|
|
72
|
+
|
|
73
|
+
`import MazAnimatedCounter from 'maz-ui/components/MazAnimatedCounter'`
|
|
74
|
+
|
|
75
|
+
### Props
|
|
76
|
+
|
|
77
|
+
- `count` (`number`, required): The number to animate.
|
|
78
|
+
- `duration` (`number`, default: `1000`): Duration of the animation in milliseconds.
|
|
79
|
+
- `prefix` (`string`): Suffix to display next to the number.
|
|
80
|
+
- `suffix` (`string`): Suffix to display next to the number.
|
|
81
|
+
- `delay` (`number`, default: `100`): Delay before the animation starts in milliseconds.
|
|
82
|
+
- `once` (`boolean`, default: `true`): Play the animation only once.
|
|
83
|
+
|
|
84
|
+
### Slots
|
|
85
|
+
|
|
86
|
+
- `#prefix`
|
|
87
|
+
- `#suffix`
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazAnimatedElement"
|
|
3
|
+
description: "MazAnimatedElement is a standalone component that animates its content with a sliding blur effect when it enters the viewport. It supports different animation directions (up, down, left, right) and allows customizing the animation delay and duration."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-animated-element"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazAnimatedElement
|
|
9
|
+
|
|
10
|
+
> MazAnimatedElement is a standalone component that animates its content with a sliding blur effect when it enters the viewport. It supports different animation directions (up, down, left, right) and allows customizing the animation delay and duration.
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazAnimatedElement from 'maz-ui/components/MazAnimatedElement'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-animated-element
|
|
16
|
+
|
|
17
|
+
> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)
|
|
18
|
+
|
|
19
|
+
## Basic usage
|
|
20
|
+
|
|
21
|
+
```vue
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
import MazAnimatedElement from 'maz-ui/components/MazAnimatedElement'
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<MazAnimatedElement direction="up" :delay="1000" :duration="2000">
|
|
28
|
+
<MazAvatar src="https://github.com/LouisMazel.png" size="lg" />
|
|
29
|
+
</MazAnimatedElement>
|
|
30
|
+
</template>
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## MazAnimatedElement API
|
|
34
|
+
|
|
35
|
+
`import MazAnimatedElement from 'maz-ui/components/MazAnimatedElement'`
|
|
36
|
+
|
|
37
|
+
### Props
|
|
38
|
+
|
|
39
|
+
- `direction` (`"up" | "down" | "left" | "right"`, default: `"up"`): The direction of the animation.
|
|
40
|
+
- `delay` (`number`, default: `0`): The delay of the animation.
|
|
41
|
+
- `duration` (`number`, default: `2000`): The duration of the animation.
|
|
42
|
+
- `once` (`boolean`, default: `true`): Play the animation only once.
|
|
43
|
+
|
|
44
|
+
### Slots
|
|
45
|
+
|
|
46
|
+
- `#default`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazAnimatedText"
|
|
3
|
+
description: "MazAnimatedText is a standalone component that animates text with a sliding blur effect. It can highlight the last word with a gradient background and supports different animation directions (up, down, left, right)."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-animated-text"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazAnimatedText
|
|
9
|
+
|
|
10
|
+
> MazAnimatedText is a standalone component that animates text with a sliding blur effect. It can highlight the last word with a gradient background and supports different animation directions (up, down, left, right).
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazAnimatedText from 'maz-ui/components/MazAnimatedText'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-animated-text
|
|
16
|
+
|
|
17
|
+
> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)
|
|
18
|
+
|
|
19
|
+
## Basic usage
|
|
20
|
+
|
|
21
|
+
**Tip:**
|
|
22
|
+
|
|
23
|
+
This component is SSR friendly. It will display the brut text on the server side with the chosen tag, and the animated text on the client side.
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import MazAnimatedText from 'maz-ui/components/MazAnimatedText'
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<MazAnimatedText tag="h1" text="Hello" last-word="world" :delay="1000" :duration="2000" direction="up" :column-gap="0.5" :row-gap="0.5" />
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## MazAnimatedText API
|
|
36
|
+
|
|
37
|
+
`import MazAnimatedText from 'maz-ui/components/MazAnimatedText'`
|
|
38
|
+
|
|
39
|
+
### Props
|
|
40
|
+
|
|
41
|
+
- `text` (`string`, required): The text to animate.
|
|
42
|
+
- `last-word` (`string`): The last word(s) to be highlighted.
|
|
43
|
+
- `delay` (`number`, default: `0`): The delay of the animation.
|
|
44
|
+
- `direction` (`"up" | "down" | "left" | "right"`, default: `"up"`): The direction of the animation.
|
|
45
|
+
- `tag` (`string`, default: `"span"`): The tag to use for the text.
|
|
46
|
+
- `word-delay` (`number`, default: `75`): The delay between each word.
|
|
47
|
+
- `column-gap` (`number`, default: `0.5`): The column gap between each word.
|
|
48
|
+
- `row-gap` (`number`, default: `0`): The row gap between each word.
|
|
49
|
+
- `duration` (`number`, default: `2000`): The duration of the animation.
|
|
50
|
+
- `once` (`boolean`, default: `true`): Play the animation only once.
|
|
51
|
+
- `gradient-from` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"primary"`): The gradient from color.
|
|
52
|
+
- `gradient-via` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"info"`): The gradient via color.
|
|
53
|
+
- `gradient-to` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"secondary"`): The gradient to color.
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazAvatar"
|
|
3
|
+
description: "MazAvatar is a standalone component that displays an image or an icon with a caption. It can be used to display a user's profile picture, a placeholder image, or an icon."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-avatar"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazAvatar
|
|
9
|
+
|
|
10
|
+
> MazAvatar is a standalone component that displays an image or an icon with a caption. It can be used to display a user's profile picture, a placeholder image, or an icon.
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazAvatar from 'maz-ui/components/MazAvatar'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-avatar
|
|
16
|
+
|
|
17
|
+
> Before use it, you should install the MazUi plugin in your project, follow instructions in [Getting Started](../guide/getting-started.md)
|
|
18
|
+
|
|
19
|
+
**Tip:**
|
|
20
|
+
|
|
21
|
+
This component uses [vLazyImg](../directives/lazy-img.md) directive
|
|
22
|
+
|
|
23
|
+
## Basic usage
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import MazAvatar from 'maz-ui/components/MazAvatar'
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<MazAvatar src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80" />
|
|
32
|
+
</template>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Options
|
|
36
|
+
|
|
37
|
+
**Tip:**
|
|
38
|
+
|
|
39
|
+
See all the options props here
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<script lang="ts" setup>
|
|
43
|
+
import MazAvatar from 'maz-ui/components/MazAvatar'
|
|
44
|
+
function clicked() { console.log('clicked') }
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<template>
|
|
48
|
+
<MazAvatar
|
|
49
|
+
caption="Louis Mazel"
|
|
50
|
+
size="1.5rem"
|
|
51
|
+
/>
|
|
52
|
+
<MazAvatar
|
|
53
|
+
src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=maz-ui"
|
|
54
|
+
size="2rem"
|
|
55
|
+
href="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=maz-ui"
|
|
56
|
+
target="_blank"
|
|
57
|
+
rounded-size="none"
|
|
58
|
+
clickable
|
|
59
|
+
>
|
|
60
|
+
<template #icon>
|
|
61
|
+
<MazIcon icon="/eye.svg" />
|
|
62
|
+
</template>
|
|
63
|
+
</MazAvatar>
|
|
64
|
+
<MazAvatar
|
|
65
|
+
src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=200"
|
|
66
|
+
size="2.5rem"
|
|
67
|
+
clickable
|
|
68
|
+
rounded-size="xl"
|
|
69
|
+
@click="clicked"
|
|
70
|
+
/>
|
|
71
|
+
<MazAvatar
|
|
72
|
+
src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=600"
|
|
73
|
+
size="3rem"
|
|
74
|
+
bordered
|
|
75
|
+
/>
|
|
76
|
+
</template>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Initials from caption
|
|
80
|
+
|
|
81
|
+
When no `src` is provided, `MazAvatar` displays initials generated from the `caption`. The `letter-count` prop (default `2`) controls how many letters are displayed:
|
|
82
|
+
|
|
83
|
+
- **Single word**: the first `letter-count` characters of the word are used.
|
|
84
|
+
- **Multiple words**: the first letter of each of the first `letter-count` words is used.
|
|
85
|
+
|
|
86
|
+
Initials are always uppercased.
|
|
87
|
+
|
|
88
|
+
```vue
|
|
89
|
+
<template>
|
|
90
|
+
<!-- "AD" -->
|
|
91
|
+
<MazAvatar caption="admin" />
|
|
92
|
+
<!-- "ADM" -->
|
|
93
|
+
<MazAvatar caption="admin" :letter-count="3" />
|
|
94
|
+
<!-- "LM" -->
|
|
95
|
+
<MazAvatar caption="Louis Mazel" />
|
|
96
|
+
<!-- "JCD" -->
|
|
97
|
+
<MazAvatar caption="Jean Claude Dus" :letter-count="3" />
|
|
98
|
+
</template>
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## On Error
|
|
102
|
+
|
|
103
|
+
When no `src` (and no `caption`) is provided, or when the image fails to load, `MazAvatar` displays the default `no-image` placeholder.
|
|
104
|
+
|
|
105
|
+
```html
|
|
106
|
+
<MazAvatar @error="error" src="https://broken-link-image-src.example" />
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Fallback image loaded on error
|
|
110
|
+
|
|
111
|
+
```html
|
|
112
|
+
<MazAvatar
|
|
113
|
+
src="https://broken-link-image-src.com"
|
|
114
|
+
fallback-src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=100"
|
|
115
|
+
/>
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Loading
|
|
119
|
+
|
|
120
|
+
The props `loading` has 3 possible values: `intersecting`, `lazy`, or `eager`.
|
|
121
|
+
|
|
122
|
+
By default, the value is `intersecting` which means the image will be loaded when it's intersecting with the `IntersectionObserver` browser API. This mode uses the [`MazLazyImg`](./maz-lazy-img.md) component with [`vLazyImg`](../directives/lazy-img.md) directive to handle the lazy loading.
|
|
123
|
+
|
|
124
|
+
Native modes:
|
|
125
|
+
|
|
126
|
+
- `lazy`: The image will be loaded only when it's in the viewport
|
|
127
|
+
- `eager`: The image will be loaded immediately
|
|
128
|
+
|
|
129
|
+
These modes are native use an `HTMLImageElement` with the `loading` attribute. (see [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img#attr-loading)). **Useful for SSR (Server Side Rendering) or when you want to load the image immediately.**
|
|
130
|
+
|
|
131
|
+
```html
|
|
132
|
+
<MazAvatar
|
|
133
|
+
loading="intersecting"
|
|
134
|
+
src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=123"
|
|
135
|
+
/>
|
|
136
|
+
<MazAvatar loading="lazy" src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=123" />
|
|
137
|
+
<MazAvatar loading="eager" src="https://api.dicebear.com/7.x/big-smile/svg?backgroundColor=1d90ff&scale=80&seed=123" />
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## Image height full
|
|
141
|
+
|
|
142
|
+
By default the image fills the avatar **width** (`width: 100%`). Enable `image-height-full` to make the image fill the **height** instead: it keeps its aspect ratio, fills 100% of the height and overflows/crops horizontally. This is ideal for wide images or SVGs (like flags) that must cover the whole avatar.
|
|
143
|
+
|
|
144
|
+
```vue
|
|
145
|
+
<template>
|
|
146
|
+
<!-- default: width 100% -->
|
|
147
|
+
<MazAvatar src="https://placedog.net/300/200" />
|
|
148
|
+
<!-- height 100%, cropped on the sides -->
|
|
149
|
+
<MazAvatar image-height-full src="https://placedog.net/300/200" />
|
|
150
|
+
</template>
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## MazAvatar API
|
|
154
|
+
|
|
155
|
+
`import MazAvatar from 'maz-ui/components/MazAvatar'`
|
|
156
|
+
|
|
157
|
+
### Props
|
|
158
|
+
|
|
159
|
+
- `src` (`string | null`): The source of the image.
|
|
160
|
+
- `caption` (`string | null`): The caption of the avatar.
|
|
161
|
+
- `href` (`string`): The link of the avatar.
|
|
162
|
+
- `to` (`string | Record<string, unknown>`): The link (router-link or nuxt-link) of the avatar.
|
|
163
|
+
- `alt` (`string`, default: `"avatar image"`): The alt of the image.
|
|
164
|
+
- `target` (`string`, default: `"_self"`): The target of the link.
|
|
165
|
+
- `size` (`` `${number}rem` | `${number}px` | `${number}em` | `${number}vw` | `${number}vh` | `${number}vmin` | `${number}vmax` | `${number}%` | `${number}ch` | `${number}cm` | `${number}mm` | `${number}in` | `${number}ex` | `${number}pc` | `${number... ``): The size of the avatar - a keyword from `MazSize` or any CSS size unit. Values: `'mini'`, `'xs'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'2rem'`, `'48px'` (non exhaustive).
|
|
166
|
+
- `bordered` (`boolean`): Add a border to the avatar.
|
|
167
|
+
- `clickable` (`boolean`): Make the avatar clickable.
|
|
168
|
+
- `square` (`boolean`): Make the avatar square.
|
|
169
|
+
- `no-elevation` (`boolean`): Remove the shadow.
|
|
170
|
+
- `show-caption` (`boolean`): Show the caption.
|
|
171
|
+
- `image-height-full` (`boolean`): Make the image height full.
|
|
172
|
+
- `hide-loader` (`boolean`): Remove the loader.
|
|
173
|
+
- `button-color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"info"`): The color of the clickable button.
|
|
174
|
+
- `hide-clickable-icon` (`boolean`): Remove the icon on hover when component is clickable.
|
|
175
|
+
- `letter-count` (`number`, default: `2`): Number of letters to display in the round text initials. - For a single-word caption, the first `letterCount` characters are used (`'admin'` + `3` -> `'ADM'`). - For a multi-word caption, the first letter of the first `letterCount` words is used (`'Louis Mazel'` -> `'LM'`).
|
|
176
|
+
- `rounded-size` (`MazRoundedSize`): Size of the rounded. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
177
|
+
- `fallback-src` (`string`): The fallback src to replace the src on loading error.
|
|
178
|
+
- `loading` (`"intersecting" | "lazy" | "eager"`, default: `"intersecting"`): The loading strategy of the image - lazy, eager or intersecting.
|
|
179
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"primary"`): The color of the avatar.
|
|
180
|
+
|
|
181
|
+
### Events
|
|
182
|
+
|
|
183
|
+
- `@click` (payload: `event: MouseEvent`): Emitted when the avatar is clicked
|
|
184
|
+
- `@intersecting` (payload: `el: Element`): Emitted when the image is intersecting
|
|
185
|
+
- `@loading` (payload: `el: Element`): Emitted when the image is loading
|
|
186
|
+
- `@loaded` (payload: `el: Element`): Emitted when the image is loaded
|
|
187
|
+
- `@error` (payload: `el: Element`): Emitted when the image is in error
|
|
188
|
+
|
|
189
|
+
### Slots
|
|
190
|
+
|
|
191
|
+
- `#round-text`: Replace the initials displayed when a caption is set and no image source is provided
|
|
192
|
+
- `#icon`: The icon displayed on the clickable button overlay (shown on hover/focus)
|
|
193
|
+
- `#caption`: Replace the caption displayed below the avatar (requires `showCaption`)
|