@maz-ui/mcp 5.0.0-beta.4 → 5.0.0-beta.40

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.
Files changed (157) hide show
  1. package/README.md +1 -1
  2. package/dist/mcp.d.mts +22 -9
  3. package/dist/mcp.d.ts +22 -9
  4. package/dist/mcp.mjs +160 -83
  5. package/docs/generated-docs/maz-avatar.doc.md +30 -30
  6. package/docs/generated-docs/maz-bottom-sheet.doc.md +16 -13
  7. package/docs/generated-docs/maz-btn.doc.md +21 -19
  8. package/docs/generated-docs/maz-checkbox.doc.md +16 -17
  9. package/docs/generated-docs/maz-circular-progress-bar.doc.md +1 -1
  10. package/docs/generated-docs/maz-code-highlight.doc.md +11 -0
  11. package/docs/generated-docs/maz-container.doc.md +1 -0
  12. package/docs/generated-docs/maz-date-picker.doc.md +41 -41
  13. package/docs/generated-docs/maz-drawer.doc.md +7 -8
  14. package/docs/generated-docs/maz-dropdown.doc.md +3 -0
  15. package/docs/generated-docs/maz-expand-animation.doc.md +4 -4
  16. package/docs/generated-docs/maz-fullscreen-loader.doc.md +5 -5
  17. package/docs/generated-docs/maz-gallery.doc.md +15 -15
  18. package/docs/generated-docs/maz-input-code.doc.md +16 -16
  19. package/docs/generated-docs/maz-input-price.doc.md +14 -14
  20. package/docs/generated-docs/maz-input-tags.doc.md +16 -16
  21. package/docs/generated-docs/maz-input.doc.md +33 -33
  22. package/docs/generated-docs/maz-lazy-img.doc.md +14 -14
  23. package/docs/generated-docs/maz-loading-bar.doc.md +4 -4
  24. package/docs/generated-docs/maz-markdown-editor.doc.md +65 -0
  25. package/docs/generated-docs/maz-popover.doc.md +1 -1
  26. package/docs/generated-docs/maz-pull-to-refresh.doc.md +10 -10
  27. package/docs/generated-docs/maz-radio-buttons.doc.md +17 -17
  28. package/docs/generated-docs/maz-radio.doc.md +16 -16
  29. package/docs/generated-docs/maz-reading-progress-bar.doc.md +4 -4
  30. package/docs/generated-docs/maz-sidebar-content.doc.md +5 -0
  31. package/docs/generated-docs/maz-sidebar-footer.doc.md +5 -0
  32. package/docs/generated-docs/maz-sidebar-group.doc.md +11 -0
  33. package/docs/generated-docs/maz-sidebar-header.doc.md +5 -0
  34. package/docs/generated-docs/maz-sidebar-menu-button.doc.md +27 -0
  35. package/docs/generated-docs/maz-sidebar-menu-item.doc.md +5 -0
  36. package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +16 -0
  37. package/docs/generated-docs/maz-sidebar-menu.doc.md +5 -0
  38. package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
  39. package/docs/generated-docs/maz-sidebar-trigger.doc.md +5 -0
  40. package/docs/generated-docs/maz-sidebar.doc.md +36 -0
  41. package/docs/generated-docs/maz-slider.doc.md +1 -1
  42. package/docs/generated-docs/maz-spinner.doc.md +4 -4
  43. package/docs/generated-docs/maz-switch.doc.md +14 -14
  44. package/docs/generated-docs/maz-table.doc.md +39 -37
  45. package/docs/generated-docs/maz-tabs-bar.doc.md +20 -9
  46. package/docs/generated-docs/maz-tabs.doc.md +6 -3
  47. package/docs/generated-docs/maz-textarea.doc.md +27 -25
  48. package/docs/generated-docs/maz-ticker.doc.md +1 -1
  49. package/docs/generated-docs/maz-timeline.doc.md +4 -4
  50. package/docs/generated-docs/maz-window-mockup.doc.md +23 -0
  51. package/docs/src/blog/v4.md +1 -1
  52. package/docs/src/blog/v5.md +5 -7
  53. package/docs/src/components/maz-avatar.md +52 -4
  54. package/docs/src/components/maz-bottom-sheet.md +300 -169
  55. package/docs/src/components/maz-btn.md +1 -1
  56. package/docs/src/components/maz-code-highlight.md +233 -0
  57. package/docs/src/components/maz-date-picker.md +1 -1
  58. package/docs/src/components/maz-dialog.md +46 -0
  59. package/docs/src/components/maz-dropdown.md +32 -16
  60. package/docs/src/components/maz-icon.md +2 -2
  61. package/docs/src/components/maz-lazy-img.md +64 -0
  62. package/docs/src/components/maz-markdown-editor.md +369 -0
  63. package/docs/src/components/maz-pull-to-refresh.md +1 -1
  64. package/docs/src/components/maz-sidebar.md +719 -0
  65. package/docs/src/components/maz-table.md +74 -0
  66. package/docs/src/components/maz-tabs.md +110 -3
  67. package/docs/src/components/maz-textarea.md +58 -0
  68. package/docs/src/components/maz-timeline.md +60 -0
  69. package/docs/src/components/maz-window-mockup.md +249 -0
  70. package/docs/src/composables/use-drag.md +239 -0
  71. package/docs/src/composables/use-form-validator.md +50 -11
  72. package/docs/src/composables/use-swipe.md +26 -11
  73. package/docs/src/directives/click-outside.md +8 -15
  74. package/docs/src/directives/fullscreen-img.md +1 -1
  75. package/docs/src/directives/lazy-img.md +44 -11
  76. package/docs/src/directives/tooltip.md +24 -1
  77. package/docs/src/directives/zoom-img.md +1 -1
  78. package/docs/src/ecosystem/eslint-config.md +95 -1
  79. package/docs/src/{guide/icons.md → ecosystem/icons/index.md} +1 -1
  80. package/docs/src/ecosystem/node/exec-promise.md +87 -0
  81. package/docs/src/ecosystem/node/index.md +53 -0
  82. package/docs/src/ecosystem/node/logger.md +146 -0
  83. package/docs/src/ecosystem/node/print-banner.md +93 -0
  84. package/docs/src/{guide → ecosystem}/nuxt.md +81 -47
  85. package/docs/src/{guide → ecosystem}/themes.md +152 -71
  86. package/docs/src/{guide → ecosystem}/translations.md +1 -1
  87. package/docs/src/ecosystem/utils/camel-case.md +31 -0
  88. package/docs/src/{helpers → ecosystem/utils}/capitalize.md +2 -3
  89. package/docs/src/ecosystem/utils/check-availability.md +79 -0
  90. package/docs/src/ecosystem/utils/cookie.md +80 -0
  91. package/docs/src/ecosystem/utils/debounce-callback.md +38 -0
  92. package/docs/src/ecosystem/utils/debounce-id.md +69 -0
  93. package/docs/src/ecosystem/utils/debounce.md +65 -0
  94. package/docs/src/ecosystem/utils/fetch-locale-ip.md +33 -0
  95. package/docs/src/ecosystem/utils/format-json.md +33 -0
  96. package/docs/src/ecosystem/utils/format-phone-number.md +37 -0
  97. package/docs/src/ecosystem/utils/get-browser-locale.md +29 -0
  98. package/docs/src/ecosystem/utils/get-error-message.md +39 -0
  99. package/docs/src/ecosystem/utils/idle-timeout.md +90 -0
  100. package/docs/src/ecosystem/utils/index.md +60 -0
  101. package/docs/src/ecosystem/utils/is-client.md +32 -0
  102. package/docs/src/ecosystem/utils/is-equal.md +38 -0
  103. package/docs/src/ecosystem/utils/is-server.md +31 -0
  104. package/docs/src/ecosystem/utils/is-standalone-mode.md +43 -0
  105. package/docs/src/ecosystem/utils/kebab-case.md +36 -0
  106. package/docs/src/ecosystem/utils/normalize-string.md +77 -0
  107. package/docs/src/ecosystem/utils/pascal-case.md +35 -0
  108. package/docs/src/ecosystem/utils/script-loader.md +77 -0
  109. package/docs/src/ecosystem/utils/sleep.md +59 -0
  110. package/docs/src/ecosystem/utils/snake-case.md +36 -0
  111. package/docs/src/ecosystem/utils/swipe-handler.md +91 -0
  112. package/docs/src/ecosystem/utils/textarea-autogrow.md +41 -0
  113. package/docs/src/ecosystem/utils/throttle-id.md +48 -0
  114. package/docs/src/ecosystem/utils/throttle.md +57 -0
  115. package/docs/src/ecosystem/utils/truthy-filter.md +31 -0
  116. package/docs/src/ecosystem/utils/types/deep-key-of.md +48 -0
  117. package/docs/src/ecosystem/utils/types/deep-partial.md +42 -0
  118. package/docs/src/ecosystem/utils/types/deep-required.md +39 -0
  119. package/docs/src/ecosystem/utils/types/flatten-object-keys.md +44 -0
  120. package/docs/src/ecosystem/utils/types/generic-instance-type.md +42 -0
  121. package/docs/src/ecosystem/utils/types/infer-maybe-ref.md +35 -0
  122. package/docs/src/ecosystem/utils/upper-first.md +32 -0
  123. package/docs/src/ecosystem/utils/user-visibility.md +69 -0
  124. package/docs/src/guide/getting-started.md +15 -13
  125. package/docs/src/guide/global-defaults.md +101 -0
  126. package/docs/src/guide/maz-ui-provider.md +6 -3
  127. package/docs/src/guide/migration-v4.md +13 -9
  128. package/docs/src/guide/migration-v5.md +112 -13
  129. package/docs/src/guide/resolvers.md +7 -7
  130. package/docs/src/guide/tailwind.md +4 -0
  131. package/docs/src/guide/vue.md +4 -4
  132. package/docs/src/index.md +12 -12
  133. package/docs/src/plugins/aos.md +1 -1
  134. package/package.json +8 -7
  135. package/docs/src/helpers/camel-case.md +0 -14
  136. package/docs/src/helpers/check-availability.md +0 -14
  137. package/docs/src/helpers/debounce-callback.md +0 -14
  138. package/docs/src/helpers/debounce-id.md +0 -14
  139. package/docs/src/helpers/debounce.md +0 -14
  140. package/docs/src/helpers/is-client.md +0 -14
  141. package/docs/src/helpers/is-equal.md +0 -14
  142. package/docs/src/helpers/is-standalone-mode.md +0 -14
  143. package/docs/src/helpers/kebab-case.md +0 -14
  144. package/docs/src/helpers/normalize-string.md +0 -14
  145. package/docs/src/helpers/pascal-case.md +0 -14
  146. package/docs/src/helpers/script-loader.md +0 -14
  147. package/docs/src/helpers/sleep.md +0 -14
  148. package/docs/src/helpers/snake-case.md +0 -14
  149. package/docs/src/helpers/throttle-id.md +0 -14
  150. package/docs/src/helpers/throttle.md +0 -14
  151. /package/docs/src/{guide → ecosystem/icons}/icon-set.md +0 -0
  152. /package/docs/src/{guide → ecosystem}/mcp.md +0 -0
  153. /package/docs/src/{helpers → ecosystem/utils}/country-code-to-unicode-flag.md +0 -0
  154. /package/docs/src/{helpers → ecosystem/utils}/currency.md +0 -0
  155. /package/docs/src/{helpers → ecosystem/utils}/date.md +0 -0
  156. /package/docs/src/{helpers → ecosystem/utils}/get-country-flag-url.md +0 -0
  157. /package/docs/src/{helpers → ecosystem/utils}/number.md +0 -0
@@ -19,6 +19,7 @@ description: MazTable is designed to be a reusable data table with advanced feat
19
19
  4. Row Selection (prop `select-value="key"`): There is a dedicated column for selection with a checkbox for each row. Users can individually or collectively select/deselect rows.
20
20
  5. Customizable Page Size: Users can choose the number of items to display per page using a dropdown list.
21
21
  6. Loading Indicator (prop `loading`): A loading indicator (MazLoadingBar) is displayed when data is being loaded.
22
+ 7. Animated rows (props `animated-rows` + `row-key`): rows slide to their new position when the order changes (FLIP animation). Respects `prefers-reduced-motion`.
22
23
 
23
24
  ## Available models
24
25
 
@@ -369,6 +370,67 @@ v-model:page-size="{{pageSize ?? 'undefined'}}"
369
370
 
370
371
  </ComponentDemo>
371
372
 
373
+ ## Animated rows
374
+
375
+ Enable `animated-rows` to make rows slide to their new position when the order changes (FLIP animation) - perfect for live leaderboards or sortable lists. Provide a stable `row-key` (a field uniquely identifying each row) so every row keeps its identity across reorders. The animation is automatically disabled when the user prefers reduced motion.
376
+
377
+ <ComponentDemo>
378
+ <MazBtn class="vp-raw" size="sm" @click="shuffleRows">Shuffle</MazBtn>
379
+ <br />
380
+ <br />
381
+ <MazTable
382
+ class="vp-raw"
383
+ size="sm"
384
+ animated-rows
385
+ row-key="id"
386
+ :headers="[
387
+ { label: '#', key: 'id', align: 'center', width: '3rem' },
388
+ { label: 'Name', key: 'name' },
389
+ { label: 'Score', key: 'score', align: 'center' },
390
+ ]"
391
+ :rows="players"
392
+ />
393
+
394
+ <template #code>
395
+
396
+ ```vue
397
+ <template>
398
+ <MazBtn @click="shuffleRows">
399
+ Shuffle
400
+ </MazBtn>
401
+ <MazTable
402
+ animated-rows
403
+ row-key="id"
404
+ :headers="[
405
+ { label: '#', key: 'id', align: 'center', width: '3rem' },
406
+ { label: 'Name', key: 'name' },
407
+ { label: 'Score', key: 'score', align: 'center' },
408
+ ]"
409
+ :rows="players"
410
+ />
411
+ </template>
412
+
413
+ <script lang="ts" setup>
414
+ import { MazTable } from 'maz-ui/components'
415
+ import { ref } from 'vue'
416
+
417
+ const players = ref([
418
+ { id: 1, name: 'John', score: 12 },
419
+ { id: 2, name: 'Jane', score: 24 },
420
+ { id: 3, name: 'Alice', score: 8 },
421
+ { id: 4, name: 'Bob', score: 31 },
422
+ ])
423
+
424
+ function shuffleRows() {
425
+ players.value = [...players.value].sort(() => Math.random() - 0.5)
426
+ }
427
+ </script>
428
+ ```
429
+
430
+ </template>
431
+
432
+ </ComponentDemo>
433
+
372
434
  ## Loading
373
435
 
374
436
  Enable the loading state with the prop `loading`
@@ -516,6 +578,17 @@ Available sizes: `'mini' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'`
516
578
  const searchQuery = ref<string>()
517
579
  const pageSize = ref<number>(10)
518
580
  const page = ref<number>(1)
581
+
582
+ const players = ref([
583
+ { id: 1, name: 'John', score: 12 },
584
+ { id: 2, name: 'Jane', score: 24 },
585
+ { id: 3, name: 'Alice', score: 8 },
586
+ { id: 4, name: 'Bob', score: 31 },
587
+ ])
588
+
589
+ function shuffleRows() {
590
+ players.value = [...players.value].sort(() => Math.random() - 0.5)
591
+ }
519
592
  </script>
520
593
 
521
594
  ## Types
@@ -545,6 +618,7 @@ export interface MazTableHeadersEnriched {
545
618
  srOnly?: boolean
546
619
  width?: string
547
620
  maxWidth?: string
621
+ minWidth?: string
548
622
  classes?: ThHTMLAttributes['class']
549
623
  scope?: ThHTMLAttributes['scope']
550
624
  align?: ThHTMLAttributes['align']
@@ -182,17 +182,124 @@ You can choose the name of this query parameter with the props `query-param` `@d
182
182
  ]
183
183
 
184
184
  const tabs2: MazTabsBarItem[] = ['First Tab', 'Second Tab', 'Third Tab', 'Fourth Tab', 'Fifth Tab', 'Sixth Tab', 'Seventh Tab', 'Eighth Tab', 'Ninth Tab', 'Tenth Tab']
185
+
186
+ const standaloneModel = ref('weekly')
187
+
188
+ const standaloneItems = [
189
+ { label: 'Daily', value: 'daily' },
190
+ { label: 'Weekly', value: 'weekly' },
191
+ { label: 'Monthly', value: 'monthly' },
192
+ ]
185
193
  </script>
186
194
 
195
+ ## Size and rounded size
196
+
197
+ Each tab is rendered with a [`MazBtn`](./maz-btn.md), so you can control its `size` (`MazSize`) and `rounded-size` (`MazRoundedSize`, applied to the bar, the indicator and each tab).
198
+
199
+ These props can be set on `MazTabsBar` directly, or on `MazTabs` which forwards them to its `MazTabsBar`. They are also globalizable through the [global defaults](./../guide/global-defaults.md) (`MazTabsBar` or `global` entry).
200
+
201
+ <MazTabs size="sm" rounded-size="lg">
202
+ <MazTabsBar :items="tabs2" />
203
+ </MazTabs>
204
+
205
+ ```vue
206
+ <template>
207
+ <!-- size & rounded-size forwarded from MazTabs to MazTabsBar -->
208
+ <MazTabs size="sm" rounded-size="lg">
209
+ <MazTabsBar :items="tabs" />
210
+ <!-- ... -->
211
+ </MazTabs>
212
+
213
+ <!-- or directly on MazTabsBar -->
214
+ <MazTabsBar :items="tabs" size="lg" rounded-size="full" />
215
+ </template>
216
+ ```
217
+
218
+ Each item can also override the `size` and `rounded-size` (and accepts every other [`MazBtn`](./maz-btn.md) prop, except `active`, `block`, `type`, `loading` and `fab`).
219
+
220
+ ## Active color
221
+
222
+ The active tab is highlighted by the indicator. Use the `color` prop (`MazColor`) on `MazTabsBar` (or on `MazTabs`, which forwards it) to color it. When omitted, the default neutral indicator is used.
223
+
224
+ <MazTabs>
225
+ <MazTabsBar :items="tabs2" color="primary" />
226
+ </MazTabs>
227
+
228
+ ```vue
229
+ <template>
230
+ <MazTabsBar :items="tabs" color="primary" />
231
+ </template>
232
+ ```
233
+
234
+ ## Standalone usage
235
+
236
+ `MazTabsBar` can be used on its own, without `MazTabs`, as an independent switcher with its own `v-model`.
237
+
238
+ ::: tip Nested inside a `MazTabs`
239
+ If your page is already wrapped by a `MazTabs`, a nested `MazTabsBar` would otherwise be linked to that parent (clicking a tab would change the page). Add the `standalone` prop to make it fully independent (it then ignores the parent's selection, size, rounded-size and color):
240
+
241
+ ```vue
242
+ <MazTabsBar v-model="selected" :items="items" standalone />
243
+ ```
244
+ :::
245
+
246
+ The model returns the `1`-based index of the selected tab, unless the items provide a `value` (`string | number`), in which case that value is returned. The model type is inferred from the items passed: declare the items `as const` (or with literal `value`s) to get a strict union type for the model and the `@update:model-value` event.
247
+
248
+ <MazTabsBar v-model="standaloneModel" :items="standaloneItems" color="secondary" rounded-size="full" />
249
+
250
+ <br />
251
+
252
+ <p>Selected value: <strong>{{ standaloneModel }}</strong></p>
253
+
254
+ ```vue
255
+ <script lang="ts" setup>
256
+ import { MazTabsBar, type MazTabsBarItem } from 'maz-ui/components'
257
+ import { ref } from 'vue'
258
+
259
+ const selected = ref('weekly')
260
+
261
+ const items = [
262
+ { label: 'Daily', value: 'daily' },
263
+ { label: 'Weekly', value: 'weekly' },
264
+ { label: 'Monthly', value: 'monthly' },
265
+ ] as const satisfies readonly MazTabsBarItem[]
266
+ </script>
267
+
268
+ <template>
269
+ <MazTabsBar v-model="selected" :items="items" color="secondary" rounded-size="full" />
270
+ <!-- selected & @update:model-value === 'daily' | 'weekly' | 'monthly' -->
271
+ </template>
272
+ ```
273
+
274
+ When no `value` is set on the items, the model is a number (the `1`-based index):
275
+
276
+ ```vue
277
+ <script lang="ts" setup>
278
+ const selected = ref(1)
279
+ const items = ['First', 'Second', 'Third']
280
+ </script>
281
+
282
+ <template>
283
+ <MazTabsBar v-model="selected" :items="items" />
284
+ <!-- selected === 1 | 2 | 3 -->
285
+ </template>
286
+ ```
287
+
187
288
  ## Types
188
289
 
189
290
  ```ts
190
- type MazTabsBarItem
191
- = | {
291
+ type MazTabsBarItem<Value extends string | number = string | number>
292
+ // Inherits all MazBtn props except 'active' | 'block' | 'type' | 'loading' | 'fab'
293
+ = | (Omit<MazBtnProps, 'active' | 'block' | 'type' | 'loading' | 'fab'> & {
192
294
  /**
193
295
  * Label of the tab
194
296
  */
195
297
  label: string
298
+ /**
299
+ * Value returned by the model when the tab is selected (standalone usage).
300
+ * When omitted, the model returns the 1-based index of the tab.
301
+ */
302
+ value?: Value
196
303
  /**
197
304
  * Will disable the tab
198
305
  * @default false
@@ -208,7 +315,7 @@ type MazTabsBarItem
208
315
  */
209
316
  content: string | number | boolean
210
317
  }
211
- }
318
+ })
212
319
  | string
213
320
  ```
214
321
 
@@ -303,6 +303,64 @@ By default, the textarea automatically expands as the user types. You can disabl
303
303
  </template>
304
304
  </ComponentDemo>
305
305
 
306
+ ## Minimum rows (compact / input-like)
307
+
308
+ Use the `min-rows` prop to control the initial (minimum) height of the textarea. It defaults to `3` lines. Set it to `1` to make the textarea start at the height of a regular input while keeping the autogrow behavior: it grows line by line as the user types.
309
+
310
+ <ComponentDemo>
311
+ <MazTextarea
312
+ v-model="value"
313
+ name="comment"
314
+ :min-rows="1"
315
+ rounded-size="xl"
316
+ placeholder="Send your message"
317
+ />
318
+
319
+ <template #code>
320
+
321
+ ```vue
322
+ <template>
323
+ <MazTextarea
324
+ v-model="value"
325
+ name="comment"
326
+ :min-rows="1"
327
+ rounded-size="xl"
328
+ placeholder="Send your message"
329
+ />
330
+ </template>
331
+ ```
332
+
333
+ </template>
334
+ </ComponentDemo>
335
+
336
+ ## Sizes
337
+
338
+ The `size` prop controls the padding (height) and text size of the textarea, mirroring the `MazInput` sizes (`mini`, `xs`, `sm`, `md`, `lg`, `xl`). Combined with `:min-rows="1"`, a given size matches the height of a `MazInput` of the same size, while keeping the autogrow behavior.
339
+
340
+ <ComponentDemo>
341
+ <div class="maz:flex maz:flex-col maz:gap-4">
342
+ <MazTextarea v-model="value" name="comment" size="xs" :min-rows="1" placeholder="Size xs" />
343
+ <MazTextarea v-model="value" name="comment" size="sm" :min-rows="1" placeholder="Size sm" />
344
+ <MazTextarea v-model="value" name="comment" size="md" :min-rows="1" placeholder="Size md" />
345
+ <MazTextarea v-model="value" name="comment" size="lg" :min-rows="1" placeholder="Size lg" />
346
+ <MazTextarea v-model="value" name="comment" size="xl" :min-rows="1" placeholder="Size xl" />
347
+ </div>
348
+
349
+ <template #code>
350
+
351
+ ```vue
352
+ <template>
353
+ <MazTextarea v-model="value" name="comment" size="xs" :min-rows="1" placeholder="Size xs" />
354
+ <MazTextarea v-model="value" name="comment" size="sm" :min-rows="1" placeholder="Size sm" />
355
+ <MazTextarea v-model="value" name="comment" size="md" :min-rows="1" placeholder="Size md" />
356
+ <MazTextarea v-model="value" name="comment" size="lg" :min-rows="1" placeholder="Size lg" />
357
+ <MazTextarea v-model="value" name="comment" size="xl" :min-rows="1" placeholder="Size xl" />
358
+ </template>
359
+ ```
360
+
361
+ </template>
362
+ </ComponentDemo>
363
+
306
364
  ## Disabled
307
365
 
308
366
  <ComponentDemo>
@@ -9,6 +9,21 @@ description: MazTimeline is a step/progress timeline component for Vue 3 with su
9
9
 
10
10
  <!--@include: ./../../.vitepress/mixins/getting-started.md-->
11
11
 
12
+ ---
13
+
14
+ Control the current step:
15
+
16
+ <MazRadioButtons
17
+ :model-value="currentStep"
18
+ size="sm"
19
+ :options="[
20
+ { label: 'None', value: -1 },
21
+ ...steps.map((step, index) => ({ label: index, value: index })),
22
+ { label: 'All Completed', value: 99 },
23
+ ]"
24
+ @update:model-value="currentStep = $event"
25
+ />
26
+
12
27
  ## Basic usage
13
28
 
14
29
  <ComponentDemo>
@@ -292,6 +307,40 @@ Customize the indicator border radius with the `rounded-size` prop.
292
307
  </template>
293
308
  </ComponentDemo>
294
309
 
310
+ ## Custom Icons
311
+
312
+ <ComponentDemo>
313
+ <MazTimeline :model-value="0" :steps="iconsSteps" direction="horizontal" size="lg" />
314
+
315
+ <template #code>
316
+
317
+ ```vue
318
+ <template>
319
+ <MazTimeline
320
+ v-model="currentStep"
321
+ :steps="steps"
322
+ size="lg"
323
+ />
324
+ </template>
325
+
326
+ <script lang="ts" setup>
327
+ import { MazCommandLine } from '@maz-ui/icons/MazCommandLine'
328
+ import { MazClipboardDocumentList } from '@maz-ui/icons/MazClipboardDocumentList'
329
+ import { MazClipboardDocumentCheck } from '@maz-ui/icons/MazClipboardDocumentCheck'
330
+ import { MazComputerDesktop } from '@maz-ui/icons/MazComputerDesktop'
331
+
332
+ const iconsSteps = [
333
+ { title: 'PO', subtitle: 'Writing PRD', icon: MazClipboardDocumentList },
334
+ { title: 'Dev', subtitle: 'Building Code', icon: MazCommandLine },
335
+ { title: 'Tech Lead', subtitle: 'Review Code', icon: MazComputerDesktop },
336
+ { title: 'QA', subtitle: 'Testing', icon: MazClipboardDocumentCheck },
337
+ ]
338
+ </script>
339
+ ```
340
+
341
+ </template>
342
+ </ComponentDemo>
343
+
295
344
  ## Custom slots
296
345
 
297
346
  MazTimeline provides scoped slots for full customization.
@@ -378,6 +427,10 @@ MazTimeline provides scoped slots for full customization.
378
427
 
379
428
  <script lang="ts" setup>
380
429
  import { ref } from 'vue'
430
+ import { MazComputerDesktop } from '@maz-ui/icons/MazComputerDesktop'
431
+ import { MazCommandLine } from '@maz-ui/icons/MazCommandLine'
432
+ import { MazClipboardDocumentList } from '@maz-ui/icons/MazClipboardDocumentList'
433
+ import { MazClipboardDocumentCheck } from '@maz-ui/icons/MazClipboardDocumentCheck'
381
434
 
382
435
  const currentStep = ref(1)
383
436
  const clickableStep = ref(0)
@@ -410,6 +463,13 @@ MazTimeline provides scoped slots for full customization.
410
463
  { title: 'Complete', subtitle: 'All done!' },
411
464
  ]
412
465
 
466
+ const iconsSteps = [
467
+ { title: 'PO', subtitle: 'Writing PRD', icon: MazClipboardDocumentList },
468
+ { title: 'Dev', subtitle: 'Building Code', icon: MazCommandLine },
469
+ { title: 'Tech Lead', subtitle: 'Review Code', icon: MazComputerDesktop },
470
+ { title: 'QA', subtitle: 'Testing', icon: MazClipboardDocumentCheck },
471
+ ]
472
+
413
473
  const colors = ['primary', 'secondary', 'info', 'success', 'warning', 'destructive']
414
474
  const sizes = ['mini', 'xs', 'sm', 'md', 'lg', 'xl']
415
475
  const roundedSizes = ['full', 'lg', 'md', 'sm', 'none']
@@ -0,0 +1,249 @@
1
+ ---
2
+ title: MazWindowMockup
3
+ description: MazWindowMockup renders a macOS-style window frame in three variants — browser, terminal, and editor — to showcase content, demos, or code examples in your documentation or UI.
4
+ ---
5
+
6
+ # {{ $frontmatter.title }}
7
+
8
+ {{ $frontmatter.description }}
9
+
10
+ <!--@include: ./../../.vitepress/mixins/getting-started.md-->
11
+
12
+ ::: info Optional: shiki for code variants
13
+ When you pass the `code` prop, `MazWindowMockup` mounts `MazCodeHighlight` internally for syntax highlighting. This requires the [`shiki`](https://shiki.style) optional peer dependency to be installed. See the [MazCodeHighlight installation note](/components/maz-code-highlight#installation-requirement).
14
+ :::
15
+
16
+ ## Browser variant
17
+
18
+ The default variant. Displays an address bar with the `url` prop and a copy-URL button on the right side of the bar.
19
+
20
+ <ComponentDemo>
21
+ <MazWindowMockup url="https://maz-ui.com" min-height="100px">
22
+ <div style="padding: 1rem; text-align: center;">Browser content goes here</div>
23
+ </MazWindowMockup>
24
+
25
+ <template #code>
26
+
27
+ ```vue
28
+ <template>
29
+ <MazWindowMockup url="https://maz-ui.com" min-height="100px">
30
+ <div>Browser content goes here</div>
31
+ </MazWindowMockup>
32
+ </template>
33
+
34
+ <script lang="ts" setup>
35
+ import MazWindowMockup from 'maz-ui/components/MazWindowMockup'
36
+ </script>
37
+ ```
38
+
39
+ </template>
40
+ </ComponentDemo>
41
+
42
+ ### Hide the URL copy button
43
+
44
+ Set `:hide-url-copy="true"` to remove the copy-URL button from the title bar.
45
+
46
+ <ComponentDemo>
47
+ <MazWindowMockup url="https://maz-ui.com" min-height="80px" :hide-url-copy="true" />
48
+
49
+ <template #code>
50
+
51
+ ```vue
52
+ <template>
53
+ <MazWindowMockup url="https://maz-ui.com" min-height="80px" :hide-url-copy="true" />
54
+ </template>
55
+ ```
56
+
57
+ </template>
58
+ </ComponentDemo>
59
+
60
+ ### With screenshot
61
+
62
+ Use this variant to display a screenshot of a website.
63
+
64
+ <ComponentDemo>
65
+ <MazWindowMockup url="https://maz-ui.com" min-height="100px">
66
+ <img :src="screenshot" alt="Maz UI Demo Dashboard" width="100%">
67
+ </MazWindowMockup>
68
+
69
+ <template #code>
70
+
71
+ ```vue
72
+ <template>
73
+ <MazWindowMockup url="https://maz-ui.com" min-height="100px">
74
+ <img src="/img/screenshots/maz-ui-home-desktop.webp" alt="Maz UI Demo Dashboard" width="100%">
75
+ </MazWindowMockup>
76
+ </template>
77
+
78
+ <script lang="ts" setup>
79
+ import MazWindowMockup from 'maz-ui/components/MazWindowMockup'
80
+ </script>
81
+ ```
82
+
83
+ </template>
84
+ </ComponentDemo>
85
+
86
+ ## Terminal variant
87
+
88
+ Displays a centered title and a `$` prompt prefix in front of the code (when `code` is provided). The prompt prefix is **not** copied to the clipboard — the copy button only writes the raw `code` value.
89
+
90
+ <ComponentDemo>
91
+ <MazWindowMockup variant="terminal" title="zsh" code="pnpm add maz-ui" language="bash" />
92
+
93
+ <template #code>
94
+
95
+ ```vue
96
+ <template>
97
+ <MazWindowMockup variant="terminal" title="zsh" code="pnpm add maz-ui" language="bash" />
98
+ </template>
99
+
100
+ <script lang="ts" setup>
101
+ import MazWindowMockup from 'maz-ui/components/MazWindowMockup'
102
+ </script>
103
+ ```
104
+
105
+ </template>
106
+ </ComponentDemo>
107
+
108
+ ### Custom prompt
109
+
110
+ Replace the default `$` with any character via the `prompt` prop.
111
+
112
+ <ComponentDemo>
113
+ <MazWindowMockup variant="terminal" code="git status" language="bash" prompt="❯" />
114
+
115
+ <template #code>
116
+
117
+ ```vue
118
+ <template>
119
+ <MazWindowMockup variant="terminal" code="git status" language="bash" prompt="❯" />
120
+ </template>
121
+ ```
122
+
123
+ </template>
124
+ </ComponentDemo>
125
+
126
+ ### Without prompt
127
+
128
+ Hide the default prompt by setting `hide-prompt` to `true`.
129
+
130
+ <ComponentDemo>
131
+ <MazWindowMockup variant="terminal" code="git status" language="bash" :hide-prompt="true" />
132
+
133
+ <template #code>
134
+
135
+ ```vue
136
+ <template>
137
+ <MazWindowMockup variant="terminal" code="git status" language="bash" :hide-prompt="true" />
138
+ </template>
139
+ ```
140
+
141
+ </template>
142
+ </ComponentDemo>
143
+
144
+ ## Editor variant
145
+
146
+ Shows a filename tab anchored to the bottom of the title bar — matching the look of real editors like VSCode.
147
+
148
+ <ComponentDemo>
149
+ <MazWindowMockup variant="editor" filename="App.vue" :code="vueCode" language="vue" />
150
+
151
+ <template #code>
152
+
153
+ ```vue
154
+ <template>
155
+ <MazWindowMockup variant="editor" filename="App.vue" :code="vueCode" language="vue" />
156
+ </template>
157
+
158
+ <script lang="ts" setup>
159
+ import MazWindowMockup from 'maz-ui/components/MazWindowMockup'
160
+
161
+ const vueCode = `<template>
162
+ <MazBtn>Click me</MazBtn>
163
+ </template>`
164
+ </script>
165
+ ```
166
+
167
+ </template>
168
+ </ComponentDemo>
169
+
170
+ ## With code and language props
171
+
172
+ Pass `code` and `language` to display highlighted source code via `MazCodeHighlight`. The inner highlighter automatically renders with squared corners so it sits flush against the window's border.
173
+
174
+ <ComponentDemo>
175
+ <MazWindowMockup code="import MazBtn from 'maz-ui/components/MazBtn'" language="ts" />
176
+
177
+ <template #code>
178
+
179
+ ```vue
180
+ <template>
181
+ <MazWindowMockup code="import MazBtn from 'maz-ui/components/MazBtn'" language="ts" />
182
+ </template>
183
+
184
+ <script lang="ts" setup>
185
+ import MazWindowMockup from 'maz-ui/components/MazWindowMockup'
186
+ </script>
187
+ ```
188
+
189
+ </template>
190
+ </ComponentDemo>
191
+
192
+ ## Empty-state placeholder
193
+
194
+ When neither `code` nor a slot content is provided, the content area renders an empty placeholder. Pass the optional `label` prop to display a centered text inside it.
195
+
196
+ <ComponentDemo>
197
+ <MazWindowMockup url="https://maz-ui.com" min-height="160px" label="Preview" />
198
+
199
+ <template #code>
200
+
201
+ ```vue
202
+ <template>
203
+ <MazWindowMockup url="https://maz-ui.com" min-height="160px" label="Preview" />
204
+ </template>
205
+ ```
206
+
207
+ </template>
208
+ </ComponentDemo>
209
+
210
+ ## Custom translations
211
+
212
+ The URL copy button's aria-label and tooltip come from the `@maz-ui/translations` package (`windowMockup.copyUrlToClipboard` / `windowMockup.urlCopiedToClipboard`). Override per-instance with the `translations` prop:
213
+
214
+ <ComponentDemo>
215
+ <MazWindowMockup
216
+ url="https://maz-ui.com"
217
+ min-height="80px"
218
+ :translations="{ copyUrlToClipboard: 'Copier l\'URL', urlCopiedToClipboard: 'URL copiée !' }"
219
+ />
220
+
221
+ <template #code>
222
+
223
+ ```vue
224
+ <template>
225
+ <MazWindowMockup
226
+ url="https://maz-ui.com"
227
+ min-height="80px"
228
+ :translations="{
229
+ copyUrlToClipboard: 'Copier l\'URL',
230
+ urlCopiedToClipboard: 'URL copiée !',
231
+ }"
232
+ />
233
+ </template>
234
+ ```
235
+
236
+ </template>
237
+ </ComponentDemo>
238
+
239
+ For app-wide translations, set up the [maz-ui translations plugin](/translations) and the component will pick up your locale automatically.
240
+
241
+ <script lang="ts" setup>
242
+ import screenshot from './../assets/interface-screenshot.png'
243
+
244
+ const vueCode = `<template>
245
+ <MazBtn>Click me</MazBtn>
246
+ </template>`
247
+ </script>
248
+
249
+ <!--@include: ./../../.vitepress/generated-docs/maz-window-mockup.doc.md-->