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,423 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazBtn"
|
|
3
|
+
description: "MazBtn is a standalone component that replaces the standard html button with a beautiful design system. Many options like colors, sizes, disabled state, loading state, icons are included. Support of router-link and nuxt-link"
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-btn"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazBtn
|
|
9
|
+
|
|
10
|
+
> MazBtn is a standalone component that replaces the standard html button with a beautiful design system. Many options like colors, sizes, disabled state, loading state, icons are included. Support of router-link and nuxt-link
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazBtn from 'maz-ui/components/MazBtn'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-btn
|
|
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 setup lang="ts">
|
|
23
|
+
import MazBtn from 'maz-ui/components/MazBtn'
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template>
|
|
27
|
+
<MazBtn>Button</MazBtn>
|
|
28
|
+
</template>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Sizes
|
|
32
|
+
|
|
33
|
+
Use the attribute `size` with value ``
|
|
34
|
+
|
|
35
|
+
```vue
|
|
36
|
+
<script setup lang="ts">
|
|
37
|
+
const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<MazBtn v-for="size in sizes" :key="size" :size="size">
|
|
42
|
+
{{ size }}
|
|
43
|
+
</MazBtn>
|
|
44
|
+
</template>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Colors
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<MazBtn>primary</MazBtn>
|
|
51
|
+
<MazBtn color="secondary">secondary</MazBtn>
|
|
52
|
+
<MazBtn color="info">info</MazBtn>
|
|
53
|
+
<MazBtn color="success">success</MazBtn>
|
|
54
|
+
<MazBtn color="warning">warning</MazBtn>
|
|
55
|
+
<MazBtn color="destructive">destructive</MazBtn>
|
|
56
|
+
<MazBtn color="contrast">contrast</MazBtn>
|
|
57
|
+
<MazBtn color="accent">accent</MazBtn>
|
|
58
|
+
<MazBtn color="surface">surface</MazBtn>
|
|
59
|
+
<MazBtn color="transparent">transparent</MazBtn>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Outlined
|
|
63
|
+
|
|
64
|
+
Transform the button into an outlined button with the attribute `outlined`
|
|
65
|
+
|
|
66
|
+
```html
|
|
67
|
+
<MazBtn outlined>primary</MazBtn>
|
|
68
|
+
<MazBtn color="secondary" outlined>secondary</MazBtn>
|
|
69
|
+
<MazBtn color="info" outlined>info</MazBtn>
|
|
70
|
+
<MazBtn color="success" outlined>success</MazBtn>
|
|
71
|
+
<MazBtn color="warning" outlined>warning</MazBtn>
|
|
72
|
+
<MazBtn color="destructive" outlined>destructive</MazBtn>
|
|
73
|
+
<MazBtn color="contrast" outlined>contrast</MazBtn>
|
|
74
|
+
<MazBtn color="accent" outlined>accent</MazBtn>
|
|
75
|
+
<MazBtn color="surface" outlined>surface</MazBtn>
|
|
76
|
+
<MazBtn color="transparent" outlined>transparent</MazBtn>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Loading
|
|
80
|
+
|
|
81
|
+
The loading state is available with the attribute `loading`
|
|
82
|
+
|
|
83
|
+
```vue
|
|
84
|
+
<script lang="ts" setup>
|
|
85
|
+
const colors = [
|
|
86
|
+
'primary',
|
|
87
|
+
'secondary',
|
|
88
|
+
'info',
|
|
89
|
+
'success',
|
|
90
|
+
'warning',
|
|
91
|
+
'destructive',
|
|
92
|
+
'contrast',
|
|
93
|
+
'accent',
|
|
94
|
+
'transparent',
|
|
95
|
+
'surface',
|
|
96
|
+
]
|
|
97
|
+
</script>
|
|
98
|
+
|
|
99
|
+
<template>
|
|
100
|
+
<MazBtn
|
|
101
|
+
v-for="color of colors"
|
|
102
|
+
:key="color"
|
|
103
|
+
loading
|
|
104
|
+
:color="color"
|
|
105
|
+
>
|
|
106
|
+
{{ color }}
|
|
107
|
+
</MazBtn>
|
|
108
|
+
</template>
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Pastel
|
|
112
|
+
|
|
113
|
+
The pastel state is available with the attribute `pastel`
|
|
114
|
+
|
|
115
|
+
**Note:**
|
|
116
|
+
|
|
117
|
+
Better in light mode
|
|
118
|
+
|
|
119
|
+
```html
|
|
120
|
+
<MazBtn pastel>primary</MazBtn>
|
|
121
|
+
<MazBtn color="secondary" pastel>secondary</MazBtn>
|
|
122
|
+
<MazBtn color="info" pastel>info</MazBtn>
|
|
123
|
+
<MazBtn color="success" pastel>success</MazBtn>
|
|
124
|
+
<MazBtn color="warning" pastel>warning</MazBtn>
|
|
125
|
+
<MazBtn color="destructive" pastel>destructive</MazBtn>
|
|
126
|
+
<MazBtn color="contrast" pastel>contrast</MazBtn>
|
|
127
|
+
<MazBtn color="accent" pastel>accent</MazBtn>
|
|
128
|
+
<MazBtn color="surface" pastel>surface</MazBtn>
|
|
129
|
+
<MazBtn color="transparent" pastel>transparent</MazBtn>
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Rounded Size
|
|
133
|
+
|
|
134
|
+
Choose the size of the rounded with the attribute `rounded-size` and value `none`, `sm`, `md`, `lg`, `xl`, `full`
|
|
135
|
+
|
|
136
|
+
```html
|
|
137
|
+
<MazBtn rounded-size="none">none</MazBtn>
|
|
138
|
+
<MazBtn rounded-size="sm">sm</MazBtn>
|
|
139
|
+
<MazBtn rounded-size="md">md</MazBtn>
|
|
140
|
+
<MazBtn rounded-size="lg">lg</MazBtn>
|
|
141
|
+
<MazBtn rounded-size="xl">xl</MazBtn>
|
|
142
|
+
<MazBtn rounded-size="full">full</MazBtn>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Fab
|
|
146
|
+
|
|
147
|
+
The button can be a fab button with the attribute `fab`
|
|
148
|
+
|
|
149
|
+
```html
|
|
150
|
+
<MazBtn fab icon="/sun.svg" size="mini" />
|
|
151
|
+
<MazBtn fab icon="/sun.svg" size="xs" />
|
|
152
|
+
<MazBtn fab icon="/sun.svg" size="sm" />
|
|
153
|
+
<MazBtn fab> fab </MazBtn>
|
|
154
|
+
<MazBtn fab icon="/sun.svg" size="lg" />
|
|
155
|
+
<MazBtn fab icon="/sun.svg" size="xl" />
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Block
|
|
159
|
+
|
|
160
|
+
Will take `width: 100%;`
|
|
161
|
+
|
|
162
|
+
```html
|
|
163
|
+
<MazBtn block>block</MazBtn>
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Justify
|
|
167
|
+
|
|
168
|
+
This property is used to align the content of the button.
|
|
169
|
+
|
|
170
|
+
By default, the justify is `center`
|
|
171
|
+
|
|
172
|
+
```html
|
|
173
|
+
<MazBtn block justify="center" icon="/users.svg" end-icon="/sun.svg" size="md">center</MazBtn>
|
|
174
|
+
<MazBtn block justify="start" icon="/users.svg" end-icon="/sun.svg" size="md">start</MazBtn>
|
|
175
|
+
<MazBtn block justify="end" icon="/users.svg" end-icon="/sun.svg" size="md">end</MazBtn>
|
|
176
|
+
<MazBtn block justify="space-between" icon="/users.svg" end-icon="/sun.svg" size="md">between</MazBtn>
|
|
177
|
+
<MazBtn block justify="space-around" icon="/users.svg" end-icon="/sun.svg" size="md">around</MazBtn>
|
|
178
|
+
<MazBtn block justify="space-evenly" icon="/users.svg" end-icon="/sun.svg" size="md">evenly</MazBtn>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## Disabled
|
|
182
|
+
|
|
183
|
+
```html
|
|
184
|
+
<MazBtn disabled>disabled</MazBtn>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
## Icons
|
|
188
|
+
|
|
189
|
+
```html
|
|
190
|
+
<MazBtn :start-icon="MazCheck" size="mini">
|
|
191
|
+
start-icon
|
|
192
|
+
</MazBtn>
|
|
193
|
+
<MazBtn :start-icon="MazCheck" size="xs">
|
|
194
|
+
start-icon
|
|
195
|
+
</MazBtn>
|
|
196
|
+
<MazBtn :start-icon="MazCheck" size="sm">
|
|
197
|
+
start-icon
|
|
198
|
+
</MazBtn>
|
|
199
|
+
<MazBtn :start-icon="MazCheck" size="md">
|
|
200
|
+
start-icon
|
|
201
|
+
</MazBtn>
|
|
202
|
+
<MazBtn :start-icon="MazCheck" size="lg">
|
|
203
|
+
start-icon
|
|
204
|
+
</MazBtn>
|
|
205
|
+
<MazBtn :start-icon="MazCheck" size="xl">
|
|
206
|
+
start-icon
|
|
207
|
+
</MazBtn>
|
|
208
|
+
<MazBtn fab :icon="MazCommandLine" size="lg" />
|
|
209
|
+
<MazBtn :start-icon="MazSpinner" size="sm" color="warning">
|
|
210
|
+
icon component
|
|
211
|
+
</MazBtn>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Use icon path
|
|
215
|
+
|
|
216
|
+
**Details: View code**
|
|
217
|
+
|
|
218
|
+
When you use the properties `end-icon`, `start-icon` or `icon` with the icon path, the component uses `<MazIcon icon="..." />` component.
|
|
219
|
+
|
|
220
|
+
Check out how [MazIcon](./maz-icon.md) works, see all available icons and download them to put them in your public folder.
|
|
221
|
+
|
|
222
|
+
```html
|
|
223
|
+
<MazBtn start-icon="/check.svg" size="sm"> start-icon </MazBtn>
|
|
224
|
+
<MazBtn end-icon="/home.svg"> end-icon </MazBtn>
|
|
225
|
+
<MazBtn icon="/command-line.svg" fab size="lg" />
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Use your own SVG icons
|
|
229
|
+
|
|
230
|
+
**Details: View code**
|
|
231
|
+
|
|
232
|
+
```html
|
|
233
|
+
<MazBtn size="sm">
|
|
234
|
+
<template #start-icon>
|
|
235
|
+
<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
236
|
+
<path
|
|
237
|
+
d="M4.5 12.75L10.5 18.75L19.5 5.25"
|
|
238
|
+
stroke="currentColor"
|
|
239
|
+
stroke-width="1.5"
|
|
240
|
+
stroke-linecap="round"
|
|
241
|
+
stroke-linejoin="round"
|
|
242
|
+
/>
|
|
243
|
+
</svg>
|
|
244
|
+
</template>
|
|
245
|
+
start-icon
|
|
246
|
+
</MazBtn>
|
|
247
|
+
<MazBtn>
|
|
248
|
+
<template #end-icon>
|
|
249
|
+
<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
250
|
+
<path
|
|
251
|
+
d="M2.25 12L11.2045 3.04549C11.6438 2.60615 12.3562 2.60615 12.7955 3.04549L21.75 12M4.5 9.75V19.875C4.5 20.4963 5.00368 21 5.625 21H9.75V16.125C9.75 15.5037 10.2537 15 10.875 15H13.125C13.7463 15 14.25 15.5037 14.25 16.125V21H18.375C18.9963 21 19.5 20.4963 19.5 19.875V9.75M8.25 21H16.5"
|
|
252
|
+
stroke="currentColor"
|
|
253
|
+
stroke-width="1.5"
|
|
254
|
+
stroke-linecap="round"
|
|
255
|
+
stroke-linejoin="round"
|
|
256
|
+
/>
|
|
257
|
+
</svg>
|
|
258
|
+
</template>
|
|
259
|
+
end-icon
|
|
260
|
+
</MazBtn>
|
|
261
|
+
<MazBtn fab size="lg">
|
|
262
|
+
<template #icon>
|
|
263
|
+
<svg width="1em" height="1em" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
264
|
+
<path
|
|
265
|
+
d="M6.75 7.5L9.75 9.75L6.75 12M11.25 12H14.25M5.25 20.25H18.75C19.9926 20.25 21 19.2426 21 18V6C21 4.75736 19.9926 3.75 18.75 3.75H5.25C4.00736 3.75 3 4.75736 3 6V18C3 19.2426 4.00736 20.25 5.25 20.25Z"
|
|
266
|
+
stroke="currentColor"
|
|
267
|
+
stroke-width="1.5"
|
|
268
|
+
stroke-linecap="round"
|
|
269
|
+
stroke-linejoin="round"
|
|
270
|
+
/>
|
|
271
|
+
</svg>
|
|
272
|
+
</template>
|
|
273
|
+
</MazBtn>
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Use [@maz-ui/icons](../ecosystem/icons/index.md)
|
|
277
|
+
|
|
278
|
+
**Details: View code**
|
|
279
|
+
|
|
280
|
+
```vue
|
|
281
|
+
<script lang="ts" setup>
|
|
282
|
+
import MazBtn from 'maz-ui/components/MazBtn'
|
|
283
|
+
|
|
284
|
+
import { MazCheck } from '@maz-ui/icons/raw/MazCheck'
|
|
285
|
+
import { MazHome } from '@maz-ui/icons/raw/MazHome'
|
|
286
|
+
import { MazCommandLine } from '@maz-ui/icons/raw/MazCommandLine'
|
|
287
|
+
</script>
|
|
288
|
+
|
|
289
|
+
<template>
|
|
290
|
+
<MazBtn :start-icon="MazCheck" size="sm">
|
|
291
|
+
start-icon
|
|
292
|
+
</MazBtn>
|
|
293
|
+
<MazBtn :end-icon="MazHome">
|
|
294
|
+
end-icon
|
|
295
|
+
</MazBtn>
|
|
296
|
+
<MazBtn fab :icon="MazCommandLine" size="lg" />
|
|
297
|
+
</template>
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Use [vite-svg-loader](https://github.com/jpkleemans/vite-svg-loader)
|
|
301
|
+
|
|
302
|
+
**Details: View code**
|
|
303
|
+
|
|
304
|
+
```vue
|
|
305
|
+
<script lang="ts" setup>
|
|
306
|
+
import MazBtn from 'maz-ui/components/MazBtn'
|
|
307
|
+
|
|
308
|
+
import MazCheck from '@maz-ui/icons/svg/check.svg?component'
|
|
309
|
+
import MazHome from '@maz-ui/icons/svg/home.svg?component'
|
|
310
|
+
import MazCommandLine from '@maz-ui/icons/svg/command-line.svg?component'
|
|
311
|
+
</script>
|
|
312
|
+
|
|
313
|
+
<template>
|
|
314
|
+
<MazBtn :start-icon="MazCheck" size="sm">
|
|
315
|
+
start-icon
|
|
316
|
+
</MazBtn>
|
|
317
|
+
<MazBtn :end-icon="MazHome">
|
|
318
|
+
end-icon
|
|
319
|
+
</MazBtn>
|
|
320
|
+
<MazBtn fab :icon="MazCommandLine" size="lg" />
|
|
321
|
+
</template>
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
### Use your own components
|
|
325
|
+
|
|
326
|
+
**Details: View code**
|
|
327
|
+
|
|
328
|
+
```vue
|
|
329
|
+
<script lang="ts" setup>
|
|
330
|
+
import { MazBtn, MazSpinner } from 'maz-ui/components'
|
|
331
|
+
</script>
|
|
332
|
+
|
|
333
|
+
<template>
|
|
334
|
+
<MazBtn :start-icon="MazSpinner" size="sm" color="info">
|
|
335
|
+
start-icon
|
|
336
|
+
</MazBtn>
|
|
337
|
+
</template>
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Pass a full `MazIconProps` object
|
|
341
|
+
|
|
342
|
+
`startIcon`, `endIcon` and `icon` accept either a bare value (Vue component, URL, raw SVG string) **or** a full `MazIconProps` object. The latter is useful when you want to override the auto-derived size, set a `<title>` for screen readers, flip a directional icon for RTL, or attach extra SVG attributes.
|
|
343
|
+
|
|
344
|
+
**Details: View code**
|
|
345
|
+
|
|
346
|
+
```vue
|
|
347
|
+
<script lang="ts" setup>
|
|
348
|
+
import MazBtn from 'maz-ui/components/MazBtn'
|
|
349
|
+
import { MazStar } from '@maz-ui/icons/raw/MazStar'
|
|
350
|
+
</script>
|
|
351
|
+
|
|
352
|
+
<template>
|
|
353
|
+
<!-- The button picks an icon size from its own size - `sm` defaults to a small icon. -->
|
|
354
|
+
<MazBtn size="sm" :start-icon="MazStar">favorite</MazBtn>
|
|
355
|
+
|
|
356
|
+
<!-- Pass an object to override per-icon. -->
|
|
357
|
+
<MazBtn
|
|
358
|
+
size="sm"
|
|
359
|
+
:start-icon="{
|
|
360
|
+
icon: MazStar,
|
|
361
|
+
size: 'xl',
|
|
362
|
+
title: 'Favorite',
|
|
363
|
+
flipIconForRtl: true,
|
|
364
|
+
}"
|
|
365
|
+
>
|
|
366
|
+
favorite
|
|
367
|
+
</MazBtn>
|
|
368
|
+
</template>
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
## [HTMLLinkElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement)
|
|
372
|
+
|
|
373
|
+
**Note:**
|
|
374
|
+
|
|
375
|
+
When `href` attribute is provided, the component automatically becomes a `<a href="..." />`
|
|
376
|
+
|
|
377
|
+
```html
|
|
378
|
+
<MazBtn href="https://www.google.com" target="_blank"> Is Button Link </MazBtn>
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## [RouterLink](https://router.vuejs.org/api/#router-link)
|
|
382
|
+
|
|
383
|
+
**Note:**
|
|
384
|
+
|
|
385
|
+
When `to` attribute is provided, the component automatically becomes a `<RouterLink to="..." />`
|
|
386
|
+
|
|
387
|
+
```html
|
|
388
|
+
<MazBtn :to="{ path: '/made-with-maz-ui.html' }"> Is RouterLink </MazBtn>
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
## MazBtn API
|
|
392
|
+
|
|
393
|
+
`import MazBtn from 'maz-ui/components/MazBtn'`
|
|
394
|
+
|
|
395
|
+
### Props
|
|
396
|
+
|
|
397
|
+
- `text` (`string`): The text of the button, if not provided, the slot will be used.
|
|
398
|
+
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`): Predifined sizes of the button.
|
|
399
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent" | "surface"`, default: `"primary"`): The color of the button.
|
|
400
|
+
- `text-color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent" | "muted"`): The text color of the button.
|
|
401
|
+
- `type` (`"submit" | "reset" | "button"`, default: `"button"`): The type of the button.
|
|
402
|
+
- `rounded-size` (`MazRoundedSize`, default: `'md'`): Size of the rounded. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
403
|
+
- `outlined` (`boolean`, default: `false`): If true, the button have the "border" style.
|
|
404
|
+
- `pastel` (`boolean`, default: `false`): If true, the button will have a pastel color.
|
|
405
|
+
- `block` (`boolean`, default: `false`): If true, the button will have a full width.
|
|
406
|
+
- `loading` (`boolean`, default: `false`): Enable the button loader.
|
|
407
|
+
- `disabled` (`boolean`, default: `false`): Disable the button.
|
|
408
|
+
- `fab` (`boolean`, default: `false`): If true, the button will have a fab style.
|
|
409
|
+
- `icon` (`MazIconLike`): The icon to display in the fab variant. Accepts a bare value (Vue component, raw SVG string, URL or `data:` URI) for the common case, or a full `MazIconProps` object for fine-grained control (size, title, svgAttributes, fallback, flipIconForRtl, …).
|
|
410
|
+
- `start-icon` (`MazIconLike`): The icon to display on the inline-start edge (left in LTR, right in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
411
|
+
- `end-icon` (`MazIconLike`): The icon to display on the inline-end edge (right in LTR, left in RTL). Accepts a bare value or a full `MazIconProps` object.
|
|
412
|
+
- `padding` (`boolean`, default: `true`): If true, the button will have no padding.
|
|
413
|
+
- `justify` (`"center" | "end" | "start" | "space-between" | "space-around" | "space-evenly"`, default: `"center"`): Choose how the elements are aligned in the button.
|
|
414
|
+
- `active` (`boolean`, default: `false`): If true, the button will have an active state.
|
|
415
|
+
- `overflow-hidden` (`boolean`, default: `true`): If true, the button will have an overflow-hidden style.
|
|
416
|
+
|
|
417
|
+
### Slots
|
|
418
|
+
|
|
419
|
+
- `#start-icon`: The icon to display on the inline-start edge (left in LTR, right in RTL)
|
|
420
|
+
- `#icon`: The icon to display on the fab button
|
|
421
|
+
- `#default`: The content of the button
|
|
422
|
+
- `#end-icon`: The icon to display on the inline-end edge (right in LTR, left in RTL)
|
|
423
|
+
- `#loader`: The loader to display in the button
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazCardSpotlight"
|
|
3
|
+
description: "MazCardSpotlight is a standalone component"
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-card-spotlight"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazCardSpotlight
|
|
9
|
+
|
|
10
|
+
> MazCardSpotlight is a standalone component
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazCardSpotlight from 'maz-ui/components/MazCardSpotlight'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-card-spotlight
|
|
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
|
+
**This component is better in dark mode**
|
|
20
|
+
|
|
21
|
+
**Tip:**
|
|
22
|
+
|
|
23
|
+
If you want to increase the border width, you must just add padding @default: `var(--maz-border-width)` (1px)
|
|
24
|
+
|
|
25
|
+
## Basic usage
|
|
26
|
+
|
|
27
|
+
```vue
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import { useTheme } from '@maz-ui/themes/composables/useTheme'
|
|
30
|
+
import MazCardSpotlight from 'maz-ui/components/MazCardSpotlight'
|
|
31
|
+
|
|
32
|
+
const { setColorMode } = useTheme()
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<MazCardSpotlight style="width: 500px; max-width: 100%;">
|
|
37
|
+
<h3 style="margin-top: 0; Fmargin-bottom: 30px;">
|
|
38
|
+
Hover this component <br>
|
|
39
|
+
To see the magic appear
|
|
40
|
+
</h3>
|
|
41
|
+
<MazBtn color="contrast" @click="setColorMode('light')">
|
|
42
|
+
Switch to light theme
|
|
43
|
+
</MazBtn>
|
|
44
|
+
</MazCardSpotlight>
|
|
45
|
+
</template>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Effect with multiple cards and with secondary color
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<div class="grid gap-4 grid-cols-1 mob-l:grid-cols-2 tab-l:grid-cols-3">
|
|
52
|
+
<MazCardSpotlight v-for="competition of competitions" :key="competition.label" color="secondary">
|
|
53
|
+
<div class="flex p-4">
|
|
54
|
+
<MazAvatar
|
|
55
|
+
v-if="competition.areaEnsignUrl"
|
|
56
|
+
:src="competition.areaEnsignUrl"
|
|
57
|
+
style="margin-right: 16px"
|
|
58
|
+
size="0.8rem"
|
|
59
|
+
/>
|
|
60
|
+
<div class="truncate flex column">
|
|
61
|
+
<span class="truncate"> {{ competition.label }} </span>
|
|
62
|
+
<span class="truncate"> {{ competition.area }} </span>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</MazCardSpotlight>
|
|
66
|
+
</div>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## MazCardSpotlight API
|
|
70
|
+
|
|
71
|
+
`import MazCardSpotlight from 'maz-ui/components/MazCardSpotlight'`
|
|
72
|
+
|
|
73
|
+
### Props
|
|
74
|
+
|
|
75
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"primary"`): The color of the component.
|
|
76
|
+
- `elevation` (`boolean`, default: `false`): Add elevation to the component.
|
|
77
|
+
- `padding` (`boolean`, default: `true`): Add padding to the content.
|
|
78
|
+
- `content-class` (`ClassValue`): The classes to apply to the content div.
|
|
79
|
+
- `content-style` (`StyleValue`): Style apply to the content div.
|
|
80
|
+
- `inner-opacity` (`number`, default: `0.95`): The opacity of the inner div - should be between 0 and 1 When 0 the spotlight is completely visible When 1 the spotlight is only visible on borders.
|
|
81
|
+
|
|
82
|
+
### Slots
|
|
83
|
+
|
|
84
|
+
- `#default`
|