@maz-ui/mcp 5.0.0-beta.0 → 5.0.0-beta.11
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-circular-progress-bar.doc.md +1 -1
- package/docs/generated-docs/maz-code-highlight.doc.md +11 -0
- package/docs/generated-docs/maz-drawer.doc.md +1 -1
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +5 -5
- package/docs/generated-docs/maz-gallery.doc.md +15 -15
- package/docs/generated-docs/maz-input-phone-number.doc.md +42 -38
- package/docs/generated-docs/maz-sidebar-content.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-footer.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-group.doc.md +11 -0
- package/docs/generated-docs/maz-sidebar-header.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +26 -0
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +16 -0
- package/docs/generated-docs/maz-sidebar-menu.doc.md +5 -0
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +11 -0
- package/docs/generated-docs/maz-sidebar.doc.md +33 -0
- package/docs/generated-docs/maz-slider.doc.md +1 -1
- package/docs/generated-docs/maz-spinner.doc.md +4 -4
- package/docs/generated-docs/maz-textarea.doc.md +25 -24
- package/docs/generated-docs/maz-ticker.doc.md +1 -1
- package/docs/generated-docs/maz-window-mockup.doc.md +23 -0
- package/docs/src/blog/v5.md +1 -3
- package/docs/src/components/maz-badge.md +4 -4
- package/docs/src/components/maz-btn.md +2 -2
- package/docs/src/components/maz-code-highlight.md +233 -0
- package/docs/src/components/maz-container.md +2 -2
- package/docs/src/components/maz-icon.md +1 -1
- package/docs/src/components/maz-input-phone-number.md +106 -103
- package/docs/src/components/maz-popover.md +1 -1
- package/docs/src/components/maz-sidebar.md +621 -0
- package/docs/src/components/maz-textarea.md +27 -1
- package/docs/src/components/maz-timeline.md +60 -0
- package/docs/src/components/maz-window-mockup.md +249 -0
- package/docs/src/directives/click-outside.md +7 -14
- package/docs/src/directives/lazy-img.md +4 -4
- package/docs/src/ecosystem/eslint-config.md +189 -8
- package/docs/src/ecosystem/stylelint-config.md +122 -10
- package/docs/src/guide/getting-started.md +13 -11
- package/docs/src/guide/maz-ui-provider.md +6 -3
- package/docs/src/guide/migration-v4.md +7 -3
- package/docs/src/guide/migration-v5.md +67 -12
- package/docs/src/guide/nuxt.md +53 -46
- package/docs/src/guide/tailwind.md +4 -0
- package/docs/src/guide/themes.md +127 -69
- package/docs/src/helpers/capitalize.md +2 -3
- package/docs/src/helpers/currency.md +2 -2
- package/docs/src/helpers/date.md +2 -2
- package/docs/src/helpers/number.md +2 -2
- package/docs/src/plugins/wait.md +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
## Props
|
|
2
|
+
|
|
3
|
+
| Name | Description | Type | Required | Default | Possible values |
|
|
4
|
+
| ----------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------- | -------- | ----------- | ----------------------------------- |
|
|
5
|
+
| **id** | Stable id used to scope the empty-state SVG pattern. Auto-generated if not provided. | `string` | No | `undefined` | - |
|
|
6
|
+
| **variant** | Window style variant | `MazWindowMockupVariant` | No | `browser` | `browser' \| 'terminal' \| 'editor` |
|
|
7
|
+
| **url** | URL to display in the browser address bar (browser variant only) | `string` | No | `localhost` | - |
|
|
8
|
+
| **filename** | Filename to display in the editor tab (editor variant only) | `string` | No | `index.vue` | - |
|
|
9
|
+
| **title** | Title to display in the terminal title bar (terminal variant only) | `string` | No | `zsh` | - |
|
|
10
|
+
| **min-height** | Minimum height of the content area as a CSS value (e.g. '200px') | `string` | No | `undefined` | - |
|
|
11
|
+
| **code** | Source code to display using MazCodeHighlight. Takes priority over the default slot. | `string` | No | `undefined` | - |
|
|
12
|
+
| **language** | Language identifier for syntax highlighting (e.g. 'vue', 'ts', 'bash') | `string` | No | `undefined` | - |
|
|
13
|
+
| **label** | Label displayed inside the empty-state placeholder when no code and no slot content are provided. | `string` | No | `undefined` | - |
|
|
14
|
+
| **hide-prompt** | Whether to hide the terminal prompt prefix (no-op on non-terminal variants) | `boolean` | No | `false` | - |
|
|
15
|
+
| **prompt** | Prefix to display before the code in the terminal (terminal variant only) | `string` | No | `$` | - |
|
|
16
|
+
| **hide-url-copy** | Hide the copy-to-clipboard button next to the URL bar (browser variant only). | `boolean` | No | `false` | - |
|
|
17
|
+
| **translations** | Custom translations for the component. Override either key independently. | `Partial<MazUiTranslationsNestedSchema['windowMockup']>` | No | `undefined` | - |
|
|
18
|
+
|
|
19
|
+
## Slots
|
|
20
|
+
|
|
21
|
+
| Name | Description | Bindings |
|
|
22
|
+
| ------- | ---------------------------------------------------------------------- | -------- |
|
|
23
|
+
| default | Free content (image, interface, etc.) shown when code prop is not set. | |
|
package/docs/src/blog/v5.md
CHANGED
|
@@ -90,9 +90,7 @@ npx @maz-ui/upgrade ./ --dry-run
|
|
|
90
90
|
npx @maz-ui/upgrade ./
|
|
91
91
|
```
|
|
92
92
|
|
|
93
|
-
It
|
|
94
|
-
|
|
95
|
-
It respects your `.gitignore`, walks `.vue`/`.css`/`.ts`/`.tsx`/`.cts`/`.mts`/`.js`/`.jsx`/`.cjs`/`.mjs` and `package.json`, and skips the usual build dirs.
|
|
93
|
+
It handles the mechanical part of the migration (CSS subpath imports, prop renames, CSS var renames, Nuxt config keys, custom preset color keys, and `package.json` version bumps)
|
|
96
94
|
|
|
97
95
|
### `@maz-ui/mcp` — for everything else
|
|
98
96
|
|
|
@@ -54,7 +54,7 @@ description: MazBadge is a standalone component to show short text in colored co
|
|
|
54
54
|
'destructive',
|
|
55
55
|
'contrast',
|
|
56
56
|
'accent',
|
|
57
|
-
'
|
|
57
|
+
'surface',
|
|
58
58
|
'transparent',
|
|
59
59
|
]
|
|
60
60
|
</script>
|
|
@@ -89,7 +89,7 @@ const colors = [
|
|
|
89
89
|
'destructive',
|
|
90
90
|
'contrast',
|
|
91
91
|
'accent',
|
|
92
|
-
'
|
|
92
|
+
'surface',
|
|
93
93
|
'transparent',
|
|
94
94
|
]
|
|
95
95
|
</script>
|
|
@@ -124,7 +124,7 @@ const colors = [
|
|
|
124
124
|
'destructive',
|
|
125
125
|
'contrast',
|
|
126
126
|
'accent',
|
|
127
|
-
'
|
|
127
|
+
'surface',
|
|
128
128
|
'transparent',
|
|
129
129
|
]
|
|
130
130
|
</script>
|
|
@@ -196,7 +196,7 @@ const roundedSize = ['none', 'sm', 'md', 'lg', 'xl', 'full']
|
|
|
196
196
|
'destructive',
|
|
197
197
|
'contrast',
|
|
198
198
|
'accent',
|
|
199
|
-
'
|
|
199
|
+
'surface',
|
|
200
200
|
'transparent',
|
|
201
201
|
]
|
|
202
202
|
|
|
@@ -141,7 +141,7 @@ const colors = [
|
|
|
141
141
|
'contrast',
|
|
142
142
|
'accent',
|
|
143
143
|
'transparent',
|
|
144
|
-
'
|
|
144
|
+
'surface',
|
|
145
145
|
]
|
|
146
146
|
</script>
|
|
147
147
|
|
|
@@ -597,7 +597,7 @@ When `to` attribute is provided, the component automatically becomes a `<RouterL
|
|
|
597
597
|
'warning',
|
|
598
598
|
'destructive',
|
|
599
599
|
'contrast',
|
|
600
|
-
'
|
|
600
|
+
'surface',
|
|
601
601
|
'transparent',
|
|
602
602
|
]
|
|
603
603
|
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: MazCodeHighlight
|
|
3
|
+
description: MazCodeHighlight displays source code with syntax highlighting powered by shiki. It auto-detects dark/light mode, ships with a copy-to-clipboard button, a language badge, and supports lazy loading.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# {{ $frontmatter.title }}
|
|
7
|
+
|
|
8
|
+
{{ $frontmatter.description }}
|
|
9
|
+
|
|
10
|
+
<!--@include: ./../../.vitepress/mixins/getting-started.md-->
|
|
11
|
+
|
|
12
|
+
## Installation requirement
|
|
13
|
+
|
|
14
|
+
Install [`shiki`](https://shiki.style) in your project to enable highlighting:
|
|
15
|
+
|
|
16
|
+
::: code-group
|
|
17
|
+
|
|
18
|
+
```bash [pnpm]
|
|
19
|
+
pnpm add shiki
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
```bash [npm]
|
|
23
|
+
npm install shiki
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
```bash [yarn]
|
|
27
|
+
yarn add shiki
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
If `shiki` is not installed, the component falls back to a plain `<pre><code>` block.
|
|
33
|
+
|
|
34
|
+
## Basic usage
|
|
35
|
+
|
|
36
|
+
<ComponentDemo>
|
|
37
|
+
<MazCodeHighlight code="const greeting = 'Hello, maz-ui!'" language="ts" />
|
|
38
|
+
|
|
39
|
+
<template #code>
|
|
40
|
+
|
|
41
|
+
```vue
|
|
42
|
+
<template>
|
|
43
|
+
<MazCodeHighlight code="const greeting = 'Hello, maz-ui!'" language="ts" />
|
|
44
|
+
</template>
|
|
45
|
+
|
|
46
|
+
<script lang="ts" setup>
|
|
47
|
+
import MazCodeHighlight from 'maz-ui/components/MazCodeHighlight'
|
|
48
|
+
</script>
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
</template>
|
|
52
|
+
</ComponentDemo>
|
|
53
|
+
|
|
54
|
+
## With slot
|
|
55
|
+
|
|
56
|
+
The default slot text is used as source code when the `code` prop is not provided. This is useful for plain text blocks.
|
|
57
|
+
|
|
58
|
+
<ComponentDemo>
|
|
59
|
+
<MazCodeHighlight language="bash">npm install maz-ui</MazCodeHighlight>
|
|
60
|
+
|
|
61
|
+
<template #code>
|
|
62
|
+
|
|
63
|
+
```vue
|
|
64
|
+
<template>
|
|
65
|
+
<MazCodeHighlight language="bash">npm install maz-ui</MazCodeHighlight>
|
|
66
|
+
</template>
|
|
67
|
+
|
|
68
|
+
<script lang="ts" setup>
|
|
69
|
+
import MazCodeHighlight from 'maz-ui/components/MazCodeHighlight'
|
|
70
|
+
</script>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
</template>
|
|
74
|
+
</ComponentDemo>
|
|
75
|
+
|
|
76
|
+
## Languages
|
|
77
|
+
|
|
78
|
+
Pass any valid [shiki language identifier](https://shiki.style/languages) to the `language` prop. The chosen language is also displayed as a small badge in the top-right corner (the badge fades out on hover when the copy button appears).
|
|
79
|
+
|
|
80
|
+
<ComponentDemo>
|
|
81
|
+
<MazCodeHighlight language="vue" :code="vueExample" />
|
|
82
|
+
|
|
83
|
+
<template #code>
|
|
84
|
+
|
|
85
|
+
```vue
|
|
86
|
+
<template>
|
|
87
|
+
<MazCodeHighlight language="vue" :code="vueExample" />
|
|
88
|
+
</template>
|
|
89
|
+
|
|
90
|
+
<script lang="ts" setup>
|
|
91
|
+
import MazCodeHighlight from 'maz-ui/components/MazCodeHighlight'
|
|
92
|
+
|
|
93
|
+
const vueExample = `<script lang="ts" setup>
|
|
94
|
+
import { ref } from 'vue'
|
|
95
|
+
const count = ref(0)
|
|
96
|
+
<\/script>
|
|
97
|
+
|
|
98
|
+
<template>
|
|
99
|
+
<button @click="count++">Count: {{ count }}</button>
|
|
100
|
+
</template>`
|
|
101
|
+
</script>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
</template>
|
|
105
|
+
</ComponentDemo>
|
|
106
|
+
|
|
107
|
+
## Custom theme
|
|
108
|
+
|
|
109
|
+
Override the auto-detected theme with any [shiki built-in theme](https://shiki.style/themes).
|
|
110
|
+
|
|
111
|
+
<ComponentDemo>
|
|
112
|
+
<MazCodeHighlight code="console.log('dracula theme')" language="js" theme="dracula" />
|
|
113
|
+
|
|
114
|
+
<template #code>
|
|
115
|
+
|
|
116
|
+
```vue
|
|
117
|
+
<template>
|
|
118
|
+
<MazCodeHighlight code="console.log('dracula theme')" language="js" theme="dracula" />
|
|
119
|
+
</template>
|
|
120
|
+
|
|
121
|
+
<script lang="ts" setup>
|
|
122
|
+
import MazCodeHighlight from 'maz-ui/components/MazCodeHighlight'
|
|
123
|
+
</script>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
</template>
|
|
127
|
+
</ComponentDemo>
|
|
128
|
+
|
|
129
|
+
## Copy to clipboard
|
|
130
|
+
|
|
131
|
+
A copy button is displayed in the top-right corner on hover (or when focused via keyboard). Clicking it writes the resolved code to the clipboard and shows a check icon for ~1.5s.
|
|
132
|
+
|
|
133
|
+
### Disable the copy button
|
|
134
|
+
|
|
135
|
+
Set `:copyable="false"` to hide the button entirely.
|
|
136
|
+
|
|
137
|
+
<ComponentDemo>
|
|
138
|
+
<MazCodeHighlight code="const noCopyButton = true" language="ts" :copyable="false" />
|
|
139
|
+
|
|
140
|
+
<template #code>
|
|
141
|
+
|
|
142
|
+
```vue
|
|
143
|
+
<template>
|
|
144
|
+
<MazCodeHighlight code="const noCopyButton = true" language="ts" :copyable="false" />
|
|
145
|
+
</template>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
</template>
|
|
149
|
+
</ComponentDemo>
|
|
150
|
+
|
|
151
|
+
### Copy a different value than the displayed code
|
|
152
|
+
|
|
153
|
+
Use `copyValue` when the displayed source differs from what should be copied — for example to strip a leading `$` prompt when rendering a shell command. This is the mechanism `MazWindowMockup` uses internally to keep the terminal prompt out of the clipboard.
|
|
154
|
+
|
|
155
|
+
<ComponentDemo>
|
|
156
|
+
<MazCodeHighlight code="$ pnpm add maz-ui" copy-value="pnpm add maz-ui" language="bash" />
|
|
157
|
+
|
|
158
|
+
<template #code>
|
|
159
|
+
|
|
160
|
+
```vue
|
|
161
|
+
<template>
|
|
162
|
+
<MazCodeHighlight
|
|
163
|
+
code="$ pnpm add maz-ui"
|
|
164
|
+
copy-value="pnpm add maz-ui"
|
|
165
|
+
language="bash"
|
|
166
|
+
/>
|
|
167
|
+
</template>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
</template>
|
|
171
|
+
</ComponentDemo>
|
|
172
|
+
|
|
173
|
+
## Disable rounded corners
|
|
174
|
+
|
|
175
|
+
Set `:rounded="false"` to render the highlighted block with squared corners — useful when embedding inside another container that already has its own border-radius (e.g. inside `MazWindowMockup`).
|
|
176
|
+
|
|
177
|
+
<ComponentDemo>
|
|
178
|
+
<MazCodeHighlight code="// squared corners" language="ts" :rounded="false" />
|
|
179
|
+
|
|
180
|
+
<template #code>
|
|
181
|
+
|
|
182
|
+
```vue
|
|
183
|
+
<template>
|
|
184
|
+
<MazCodeHighlight code="// squared corners" language="ts" :rounded="false" />
|
|
185
|
+
</template>
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
</template>
|
|
189
|
+
</ComponentDemo>
|
|
190
|
+
|
|
191
|
+
## Custom translations
|
|
192
|
+
|
|
193
|
+
The copy button's aria-label and tooltip come from the `@maz-ui/translations` package (`codeHighlight.copyToClipboard` / `codeHighlight.copiedToClipboard`). You can override either key per-instance with the `translations` prop without touching the global locale:
|
|
194
|
+
|
|
195
|
+
<ComponentDemo>
|
|
196
|
+
<MazCodeHighlight
|
|
197
|
+
code="const hello = 'world'"
|
|
198
|
+
language="ts"
|
|
199
|
+
:translations="{ copyToClipboard: 'Copier le code', copiedToClipboard: 'Copié !' }"
|
|
200
|
+
/>
|
|
201
|
+
|
|
202
|
+
<template #code>
|
|
203
|
+
|
|
204
|
+
```vue
|
|
205
|
+
<template>
|
|
206
|
+
<MazCodeHighlight
|
|
207
|
+
code="const hello = 'world'"
|
|
208
|
+
language="ts"
|
|
209
|
+
:translations="{
|
|
210
|
+
copyToClipboard: 'Copier le code',
|
|
211
|
+
copiedToClipboard: 'Copié !',
|
|
212
|
+
}"
|
|
213
|
+
/>
|
|
214
|
+
</template>
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
</template>
|
|
218
|
+
</ComponentDemo>
|
|
219
|
+
|
|
220
|
+
For app-wide translations, set up the [maz-ui translations plugin](/translations) and the component will pick up your locale automatically.
|
|
221
|
+
|
|
222
|
+
<script lang="ts" setup>
|
|
223
|
+
const vueExample = `<script lang="ts" setup>
|
|
224
|
+
import { ref } from 'vue'
|
|
225
|
+
const count = ref(0)
|
|
226
|
+
<\/script>
|
|
227
|
+
|
|
228
|
+
<template>
|
|
229
|
+
<button @click="count++">Count: {{ count }}</button>
|
|
230
|
+
</template>`
|
|
231
|
+
</script>
|
|
232
|
+
|
|
233
|
+
<!--@include: ./../../.vitepress/generated-docs/maz-code-highlight.doc.md-->
|
|
@@ -301,7 +301,7 @@ Use the `header` slot to fully customize the header, or use `title`, `icon-start
|
|
|
301
301
|
<ComponentDemo>
|
|
302
302
|
<MazContainer
|
|
303
303
|
title="Dashboard Overview"
|
|
304
|
-
start-icon="chart-bar"
|
|
304
|
+
start-icon="/chart-bar.svg"
|
|
305
305
|
elevation
|
|
306
306
|
:bordered="false"
|
|
307
307
|
rounded-size="xl"
|
|
@@ -329,7 +329,7 @@ Use the `header` slot to fully customize the header, or use `title`, `icon-start
|
|
|
329
329
|
<template>
|
|
330
330
|
<MazContainer
|
|
331
331
|
title="Dashboard Overview"
|
|
332
|
-
start-icon="chart-bar"
|
|
332
|
+
start-icon="/chart-bar.svg"
|
|
333
333
|
elevation
|
|
334
334
|
:bordered="false"
|
|
335
335
|
rounded-size="xl"
|
|
@@ -8,7 +8,7 @@ description: A flexible icon component that accepts Vue components, raw SVG stri
|
|
|
8
8
|
{{ $frontmatter.description }}
|
|
9
9
|
|
|
10
10
|
::: tip
|
|
11
|
-
Download the bundled icons pack
|
|
11
|
+
Download the bundled [icons pack](#all-bundled-icons) or use [`@maz-ui/icons`](../guide/icons.md) for the full set.
|
|
12
12
|
:::
|
|
13
13
|
|
|
14
14
|
## How it works
|
|
@@ -68,34 +68,28 @@ const results = ref<MazInputPhoneNumberData>()
|
|
|
68
68
|
Control which countries appear in the dropdown and their order.
|
|
69
69
|
|
|
70
70
|
<ComponentDemo>
|
|
71
|
-
<div class="maz:
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
<MazInputPhoneNumber
|
|
94
|
-
v-model="phone3"
|
|
95
|
-
:ignored-countries="['AF', 'AL', 'DZ']"
|
|
96
|
-
placeholder="Some countries are hidden"
|
|
97
|
-
/>
|
|
98
|
-
</div>
|
|
71
|
+
<div class="maz:flex maz:flex-col maz:gap-4">
|
|
72
|
+
<MazInputPhoneNumber
|
|
73
|
+
top-label="Preferred Countries"
|
|
74
|
+
assistive-text="Show your most common countries first"
|
|
75
|
+
v-model="phone1"
|
|
76
|
+
:preferred-countries="['US', 'FR', 'GB', 'DE', 'CA']"
|
|
77
|
+
placeholder="Common countries appear first"
|
|
78
|
+
/>
|
|
79
|
+
<MazInputPhoneNumber
|
|
80
|
+
top-label="Only Specific Countries"
|
|
81
|
+
assistive-text="Limit to certain countries only"
|
|
82
|
+
v-model="phone2"
|
|
83
|
+
:only-countries="['US', 'FR', 'GB', 'DE', 'IT', 'ES']"
|
|
84
|
+
placeholder="Only European + North American countries"
|
|
85
|
+
/>
|
|
86
|
+
<MazInputPhoneNumber
|
|
87
|
+
top-label="Ignore Countries"
|
|
88
|
+
assistive-text="Remove unwanted countries"
|
|
89
|
+
v-model="phone3"
|
|
90
|
+
:ignored-countries="['AF', 'AL', 'DZ']"
|
|
91
|
+
placeholder="Some countries are hidden"
|
|
92
|
+
/>
|
|
99
93
|
</div>
|
|
100
94
|
|
|
101
95
|
<template #code>
|
|
@@ -133,22 +127,22 @@ Control which countries appear in the dropdown and their order.
|
|
|
133
127
|
Choose how the country selector and phone input are arranged.
|
|
134
128
|
|
|
135
129
|
<ComponentDemo>
|
|
136
|
-
<div class="maz:
|
|
137
|
-
<
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
<
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
130
|
+
<div class="maz:flex maz:flex-col maz:gap-6">
|
|
131
|
+
<MazInputPhoneNumber
|
|
132
|
+
top-label="Responsive"
|
|
133
|
+
assistive-text="Stacks on mobile, side-by-side on desktop"
|
|
134
|
+
orientation="responsive"
|
|
135
|
+
/>
|
|
136
|
+
<MazInputPhoneNumber
|
|
137
|
+
top-label="Always Row"
|
|
138
|
+
assistive-text="Side-by-side on all screen sizes"
|
|
139
|
+
orientation="row"
|
|
140
|
+
/>
|
|
141
|
+
<MazInputPhoneNumber
|
|
142
|
+
top-label="Always Column"
|
|
143
|
+
assistive-text="Stacked on all screen sizes"
|
|
144
|
+
orientation="col"
|
|
145
|
+
/>
|
|
152
146
|
</div>
|
|
153
147
|
|
|
154
148
|
<template #code>
|
|
@@ -156,13 +150,25 @@ Choose how the country selector and phone input are arranged.
|
|
|
156
150
|
```vue
|
|
157
151
|
<template>
|
|
158
152
|
<!-- Responsive layout (default) -->
|
|
159
|
-
<MazInputPhoneNumber
|
|
153
|
+
<MazInputPhoneNumber
|
|
154
|
+
top-label="Responsive"
|
|
155
|
+
assistive-text="Stacks on mobile, side-by-side on desktop"
|
|
156
|
+
orientation="responsive"
|
|
157
|
+
/>
|
|
160
158
|
|
|
161
159
|
<!-- Always side-by-side -->
|
|
162
|
-
<MazInputPhoneNumber
|
|
160
|
+
<MazInputPhoneNumber
|
|
161
|
+
top-label="Always Row"
|
|
162
|
+
assistive-text="Side-by-side on all screen sizes"
|
|
163
|
+
orientation="row"
|
|
164
|
+
/>
|
|
163
165
|
|
|
164
166
|
<!-- Always stacked -->
|
|
165
|
-
<MazInputPhoneNumber
|
|
167
|
+
<MazInputPhoneNumber
|
|
168
|
+
top-label="Always Column"
|
|
169
|
+
assistive-text="Stacked on all screen sizes"
|
|
170
|
+
orientation="col"
|
|
171
|
+
/>
|
|
166
172
|
</template>
|
|
167
173
|
```
|
|
168
174
|
|
|
@@ -174,34 +180,30 @@ Choose how the country selector and phone input are arranged.
|
|
|
174
180
|
Customize what information is shown to users.
|
|
175
181
|
|
|
176
182
|
<ComponentDemo>
|
|
177
|
-
<div class="maz:
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
:
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
<h4 class="maz:font-semibold maz:mb-2">Hide Country Flags</h4>
|
|
202
|
-
<p class="maz:text-sm maz:text-muted maz:mb-2">Text-only country selection</p>
|
|
203
|
-
<MazInputPhoneNumber hide-flags />
|
|
204
|
-
</div>
|
|
183
|
+
<div class="maz:flex maz:flex-col maz:gap-4">
|
|
184
|
+
<MazInputPhoneNumber
|
|
185
|
+
top-label="Show Country Names"
|
|
186
|
+
assistive-text="Display country names instead of calling codes"
|
|
187
|
+
display-country-name
|
|
188
|
+
:translations="{
|
|
189
|
+
countrySelect: { placeholder: 'Choose country' }
|
|
190
|
+
}"
|
|
191
|
+
/>
|
|
192
|
+
<MazInputPhoneNumber
|
|
193
|
+
top-label="Show Calling Codes in List"
|
|
194
|
+
assistive-text="Help users see the dialing codes"
|
|
195
|
+
show-code-in-list
|
|
196
|
+
/>
|
|
197
|
+
<MazInputPhoneNumber
|
|
198
|
+
top-label="Hide Phone Examples"
|
|
199
|
+
assistive-text="Remove the example phone number hints (visible when the phone input is focused)"
|
|
200
|
+
:example="false"
|
|
201
|
+
/>
|
|
202
|
+
<MazInputPhoneNumber
|
|
203
|
+
top-label="Hide Country Flags"
|
|
204
|
+
assistive-text="Text-only country selection"
|
|
205
|
+
hide-flags
|
|
206
|
+
/>
|
|
205
207
|
</div>
|
|
206
208
|
|
|
207
209
|
<template #code>
|
|
@@ -762,34 +764,35 @@ const mobilePhone = ref()
|
|
|
762
764
|
Understanding what data the component provides.
|
|
763
765
|
|
|
764
766
|
<ComponentDemo>
|
|
765
|
-
<
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
<
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
<
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
<
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
<
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
<
|
|
791
|
-
|
|
792
|
-
|
|
767
|
+
<MazInputPhoneNumber
|
|
768
|
+
v-model="dataPhone"
|
|
769
|
+
v-model:country-code="dataCountry"
|
|
770
|
+
top-label="Your phone number"
|
|
771
|
+
placeholder="Enter a phone number to see data"
|
|
772
|
+
assistive-text="Enter your phone number in international format (e.g. +33612345678)"
|
|
773
|
+
@data="phoneData = $event"
|
|
774
|
+
/>
|
|
775
|
+
|
|
776
|
+
<div v-if="phoneData" class="maz:bg-surface-400 maz:pt-8 maz:rounded-md">
|
|
777
|
+
<h4 class="maz:font-semibold maz:mb-3">📊 Phone Number Data</h4>
|
|
778
|
+
<div class="maz:grid maz:grid-cols-1 maz:md:grid-cols-2 maz:gap-4 maz:text-sm">
|
|
779
|
+
<div>
|
|
780
|
+
<strong>Valid:</strong> {{ phoneData?.isValid ? '✅' : '❌' }}
|
|
781
|
+
</div>
|
|
782
|
+
<div>
|
|
783
|
+
<strong>Country:</strong> {{ phoneData?.countryCode || 'None' }}
|
|
784
|
+
</div>
|
|
785
|
+
<div>
|
|
786
|
+
<strong>National Format:</strong> {{ phoneData?.formatNational || 'None' }}
|
|
787
|
+
</div>
|
|
788
|
+
<div>
|
|
789
|
+
<strong>International:</strong> {{ phoneData?.formatInternational || 'None' }}
|
|
790
|
+
</div>
|
|
791
|
+
<div>
|
|
792
|
+
<strong>E164 Format:</strong> {{ phoneData?.e164 || 'None' }}
|
|
793
|
+
</div>
|
|
794
|
+
<div>
|
|
795
|
+
<strong>Phone Type:</strong> {{ phoneData?.type || 'Unknown' }}
|
|
793
796
|
</div>
|
|
794
797
|
</div>
|
|
795
798
|
</div>
|
|
@@ -1356,7 +1356,7 @@ MazPopover follows WAI-ARIA guidelines:
|
|
|
1356
1356
|
<script setup>
|
|
1357
1357
|
import { ref, reactive } from 'vue'
|
|
1358
1358
|
import MazPopover from 'maz-ui/components/MazPopover'
|
|
1359
|
-
import { MazInformationCircle } from '@maz-ui/icons/
|
|
1359
|
+
import { MazInformationCircle } from '@maz-ui/icons/static/MazInformationCircle'
|
|
1360
1360
|
import { MazEllipsisVertical } from '@maz-ui/icons/raw/MazEllipsisVertical'
|
|
1361
1361
|
|
|
1362
1362
|
const isOpen = ref(false)
|