@maz-ui/mcp 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/README.md +61 -228
- package/bin/maz-ui-mcp.mjs +2 -5
- package/dist/cli.d.mts +7 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.mjs +14 -0
- package/dist/index.d.mts +340 -0
- package/dist/index.d.ts +340 -0
- package/dist/index.mjs +14 -0
- package/dist/shared/mcp.DzqVbCaL.mjs +2346 -0
- 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/{src/components → components}/maz-alert.md +31 -164
- 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/{src/components → components}/maz-badge.md +26 -67
- package/docs/components/maz-bottom-sheet.md +257 -0
- package/docs/{src/components → components}/maz-btn-group.md +26 -189
- package/docs/{src/components → components}/maz-btn.md +60 -245
- package/docs/components/maz-card-spotlight.md +84 -0
- package/docs/{src/components → components}/maz-card.md +67 -192
- package/docs/components/maz-carousel.md +153 -0
- package/docs/{src/components → components}/maz-chart.md +17 -161
- 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/{src/components → components}/maz-code-highlight.md +15 -93
- package/docs/components/maz-container.md +241 -0
- package/docs/{src/components → components}/maz-date-picker.md +85 -454
- 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/{src/components → components}/maz-dropzone.md +80 -221
- 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/{src/components → components}/maz-icon.md +32 -83
- 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/{src/components → components}/maz-input.md +74 -221
- 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/{src/components → components}/maz-markdown-editor.md +72 -125
- package/docs/components/maz-pagination.md +82 -0
- package/docs/components/maz-popover.md +794 -0
- package/docs/{src/components → components}/maz-pull-to-refresh.md +59 -45
- package/docs/components/maz-radio-buttons.md +313 -0
- package/docs/components/maz-radio.md +119 -0
- package/docs/{src/components → components}/maz-read-more.md +31 -122
- package/docs/components/maz-reading-progress-bar.md +96 -0
- package/docs/{src/components → components}/maz-select-country.md +80 -340
- package/docs/{src/components → components}/maz-select.md +76 -206
- 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/{src/components → components}/maz-sidebar.md +117 -329
- package/docs/{src/components → components}/maz-skeleton.md +27 -156
- package/docs/{src/components → components}/maz-slider.md +33 -66
- package/docs/components/maz-spinner.md +84 -0
- package/docs/{src/components → components}/maz-stepper.md +43 -185
- 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/{src/components → components}/maz-tabs.md +89 -126
- 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/{src/components → components}/maz-window-mockup.md +38 -105
- 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/{src/composables → composables}/use-display-names.md +12 -59
- package/docs/{src/composables → composables}/use-drag.md +14 -68
- package/docs/{src/composables → composables}/use-form-validator.md +22 -696
- package/docs/{src/composables → composables}/use-idle-timeout.md +13 -97
- package/docs/{src/composables → composables}/use-pull-to-refresh.md +14 -7
- package/docs/{src/composables → composables}/use-reading-time.md +20 -56
- package/docs/composables/use-string-matching.md +41 -0
- package/docs/{src/composables → composables}/use-swipe.md +14 -81
- package/docs/{src/composables → composables}/use-timer.md +12 -38
- package/docs/composables/use-toast.md +50 -0
- package/docs/{src/composables → composables}/use-user-visibility.md +14 -56
- package/docs/composables/use-wait.md +50 -0
- package/docs/composables/use-window-size.md +25 -0
- package/docs/{src/directives → directives}/click-outside.md +13 -99
- package/docs/{src/directives → directives}/fullscreen-img.md +10 -28
- package/docs/{src/directives → directives}/lazy-img.md +14 -49
- package/docs/{src/directives → directives}/tooltip.md +12 -217
- package/docs/{src/directives → directives}/zoom-img.md +11 -38
- package/docs/{src/ecosystem → ecosystem}/eslint-config.md +37 -29
- package/docs/ecosystem/icons/icon-set.md +25 -0
- package/docs/{src/ecosystem → ecosystem}/icons/index.md +22 -16
- package/docs/ecosystem/mcp.md +165 -0
- package/docs/{src/ecosystem → ecosystem}/node/exec-promise.md +12 -6
- package/docs/ecosystem/node/index.md +53 -0
- package/docs/{src/ecosystem → ecosystem}/node/logger.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/node/print-banner.md +12 -4
- package/docs/ecosystem/node/setup-agents.md +102 -0
- package/docs/{src/ecosystem → ecosystem}/nuxt.md +46 -19
- package/docs/{src/ecosystem → ecosystem}/stylelint-config.md +33 -25
- package/docs/{src/ecosystem → ecosystem}/themes.md +72 -235
- package/docs/{src/ecosystem → ecosystem}/translations.md +25 -23
- package/docs/ecosystem/utils/camel-case.md +37 -0
- package/docs/ecosystem/utils/capitalize.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/check-availability.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/cookie.md +18 -12
- package/docs/ecosystem/utils/country-code-to-unicode-flag.md +128 -0
- package/docs/{src/ecosystem → ecosystem}/utils/currency.md +12 -26
- package/docs/{src/ecosystem → ecosystem}/utils/date.md +10 -24
- package/docs/ecosystem/utils/debounce-callback.md +44 -0
- package/docs/{src/ecosystem → ecosystem}/utils/debounce-id.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/debounce.md +14 -8
- package/docs/ecosystem/utils/fetch-locale-ip.md +39 -0
- package/docs/{src/ecosystem → ecosystem}/utils/format-json.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/format-phone-number.md +12 -6
- package/docs/ecosystem/utils/get-browser-locale.md +35 -0
- package/docs/ecosystem/utils/get-country-flag-url.md +67 -0
- package/docs/{src/ecosystem → ecosystem}/utils/get-error-message.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/idle-timeout.md +15 -9
- package/docs/{src/ecosystem → ecosystem}/utils/index.md +10 -13
- package/docs/{src/ecosystem → ecosystem}/utils/is-client.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/is-equal.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/is-ios.md +12 -6
- package/docs/ecosystem/utils/is-server.md +37 -0
- package/docs/ecosystem/utils/is-standalone-mode.md +49 -0
- package/docs/{src/ecosystem → ecosystem}/utils/kebab-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/normalize-string.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/number.md +10 -24
- package/docs/{src/ecosystem → ecosystem}/utils/pascal-case.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/prevent-ios-input-zoom.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/script-loader.md +16 -8
- package/docs/{src/ecosystem → ecosystem}/utils/sleep.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/snake-case.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/swipe-handler.md +14 -8
- package/docs/{src/ecosystem → ecosystem}/utils/textarea-autogrow.md +12 -6
- package/docs/{src/ecosystem → ecosystem}/utils/throttle-id.md +13 -7
- package/docs/{src/ecosystem → ecosystem}/utils/throttle.md +14 -8
- package/docs/ecosystem/utils/truthy-filter.md +37 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-key-of.md +11 -5
- package/docs/{src/ecosystem → ecosystem}/utils/types/deep-partial.md +10 -4
- package/docs/ecosystem/utils/types/deep-required.md +45 -0
- package/docs/ecosystem/utils/types/flatten-object-keys.md +50 -0
- package/docs/{src/ecosystem → ecosystem}/utils/types/generic-instance-type.md +10 -4
- package/docs/{src/ecosystem → ecosystem}/utils/types/infer-maybe-ref.md +10 -4
- package/docs/ecosystem/utils/upper-first.md +38 -0
- package/docs/{src/ecosystem → ecosystem}/utils/user-visibility.md +12 -6
- package/docs/guide/ai-agents.md +237 -0
- package/docs/{src/guide → guide}/browser-support.md +22 -15
- package/docs/{src/guide → guide}/getting-started.md +34 -139
- package/docs/{src/guide → guide}/global-defaults.md +12 -11
- package/docs/{src/guide → guide}/maz-ui-provider.md +17 -16
- package/docs/{src/guide → guide}/migration-v5.md +95 -88
- package/docs/{src/guide → guide}/resolvers.md +33 -100
- package/docs/guide/tailwind.md +483 -0
- package/docs/{src/guide → guide}/vue.md +33 -39
- package/docs/manifest.json +1 -0
- package/docs/{src/plugins → plugins}/aos.md +20 -55
- package/docs/{src/plugins → plugins}/dialog.md +14 -161
- 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 +84 -22
- package/dist/mcp.d.mts +0 -153
- package/dist/mcp.d.ts +0 -153
- package/dist/mcp.mjs +0 -1511
- package/docs/generated-docs/maz-accordion.doc.md +0 -21
- package/docs/generated-docs/maz-alert.doc.md +0 -20
- package/docs/generated-docs/maz-animated-counter.doc.md +0 -17
- package/docs/generated-docs/maz-animated-element.doc.md +0 -14
- package/docs/generated-docs/maz-animated-text.doc.md +0 -17
- package/docs/generated-docs/maz-avatar.doc.md +0 -45
- package/docs/generated-docs/maz-backdrop.doc.md +0 -55
- package/docs/generated-docs/maz-badge.doc.md +0 -16
- package/docs/generated-docs/maz-bottom-sheet.doc.md +0 -24
- package/docs/generated-docs/maz-btn-group.doc.md +0 -20
- package/docs/generated-docs/maz-btn.doc.md +0 -33
- package/docs/generated-docs/maz-card-spotlight.doc.md +0 -16
- package/docs/generated-docs/maz-card.doc.md +0 -39
- package/docs/generated-docs/maz-carousel.doc.md +0 -17
- package/docs/generated-docs/maz-chart.doc.md +0 -10
- package/docs/generated-docs/maz-checkbox.doc.md +0 -33
- package/docs/generated-docs/maz-checklist.doc.md +0 -30
- package/docs/generated-docs/maz-circular-progress-bar.doc.md +0 -27
- package/docs/generated-docs/maz-code-highlight.doc.md +0 -11
- package/docs/generated-docs/maz-container.doc.md +0 -26
- package/docs/generated-docs/maz-date-picker.doc.md +0 -56
- package/docs/generated-docs/maz-dialog-confirm.doc.md +0 -24
- package/docs/generated-docs/maz-dialog.doc.md +0 -22
- package/docs/generated-docs/maz-drawer.doc.md +0 -25
- package/docs/generated-docs/maz-dropdown.doc.md +0 -45
- package/docs/generated-docs/maz-dropzone.doc.md +0 -82
- package/docs/generated-docs/maz-expand-animation.doc.md +0 -12
- package/docs/generated-docs/maz-fullscreen-loader.doc.md +0 -13
- package/docs/generated-docs/maz-gallery.doc.md +0 -17
- package/docs/generated-docs/maz-icon.doc.md +0 -16
- package/docs/generated-docs/maz-input-code.doc.md +0 -25
- package/docs/generated-docs/maz-input-number.doc.md +0 -33
- package/docs/generated-docs/maz-input-phone-number.doc.md +0 -62
- package/docs/generated-docs/maz-input-price.doc.md +0 -26
- package/docs/generated-docs/maz-input-tags.doc.md +0 -24
- package/docs/generated-docs/maz-input.doc.md +0 -54
- package/docs/generated-docs/maz-lazy-img.doc.md +0 -49
- package/docs/generated-docs/maz-link.doc.md +0 -31
- package/docs/generated-docs/maz-loading-bar.doc.md +0 -6
- package/docs/generated-docs/maz-markdown-editor.doc.md +0 -65
- package/docs/generated-docs/maz-pagination.doc.md +0 -21
- package/docs/generated-docs/maz-popover.doc.md +0 -79
- package/docs/generated-docs/maz-pull-to-refresh.doc.md +0 -50
- package/docs/generated-docs/maz-radio-buttons.doc.md +0 -34
- package/docs/generated-docs/maz-radio.doc.md +0 -33
- package/docs/generated-docs/maz-read-more.doc.md +0 -18
- package/docs/generated-docs/maz-reading-progress-bar.doc.md +0 -18
- package/docs/generated-docs/maz-select-country.doc.md +0 -45
- package/docs/generated-docs/maz-select.doc.md +0 -32
- package/docs/generated-docs/maz-sidebar-content.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-footer.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-group.doc.md +0 -11
- package/docs/generated-docs/maz-sidebar-header.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-button.doc.md +0 -27
- package/docs/generated-docs/maz-sidebar-menu-item.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-menu-sub.doc.md +0 -16
- package/docs/generated-docs/maz-sidebar-menu.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar-separator.doc.md +0 -0
- package/docs/generated-docs/maz-sidebar-trigger.doc.md +0 -5
- package/docs/generated-docs/maz-sidebar.doc.md +0 -36
- package/docs/generated-docs/maz-skeleton.doc.md +0 -12
- package/docs/generated-docs/maz-slider.doc.md +0 -20
- package/docs/generated-docs/maz-spinner.doc.md +0 -6
- package/docs/generated-docs/maz-stepper.doc.md +0 -30
- package/docs/generated-docs/maz-switch.doc.md +0 -31
- package/docs/generated-docs/maz-table-cell.doc.md +0 -5
- package/docs/generated-docs/maz-table-row.doc.md +0 -12
- package/docs/generated-docs/maz-table-title.doc.md +0 -5
- package/docs/generated-docs/maz-table-virtualizer.doc.md +0 -20
- package/docs/generated-docs/maz-table.doc.md +0 -72
- package/docs/generated-docs/maz-tabs-bar.doc.md +0 -29
- package/docs/generated-docs/maz-tabs-content-item.doc.md +0 -11
- package/docs/generated-docs/maz-tabs-content.doc.md +0 -5
- package/docs/generated-docs/maz-tabs.doc.md +0 -20
- package/docs/generated-docs/maz-textarea.doc.md +0 -46
- package/docs/generated-docs/maz-ticker.doc.md +0 -25
- package/docs/generated-docs/maz-timeline.doc.md +0 -32
- package/docs/generated-docs/maz-ui-provider.doc.md +0 -12
- package/docs/generated-docs/maz-window-mockup.doc.md +0 -23
- package/docs/src/blog/v4.md +0 -276
- package/docs/src/blog/v5.md +0 -184
- package/docs/src/changelog.md +0 -7
- package/docs/src/components/index.md +0 -8
- package/docs/src/components/maz-accordion.md +0 -80
- package/docs/src/components/maz-animated-counter.md +0 -124
- package/docs/src/components/maz-animated-element.md +0 -36
- package/docs/src/components/maz-animated-text.md +0 -36
- package/docs/src/components/maz-avatar.md +0 -227
- package/docs/src/components/maz-backdrop.md +0 -250
- package/docs/src/components/maz-bottom-sheet.md +0 -533
- package/docs/src/components/maz-card-spotlight.md +0 -163
- package/docs/src/components/maz-carousel.md +0 -231
- package/docs/src/components/maz-checkbox.md +0 -168
- package/docs/src/components/maz-checklist.md +0 -414
- package/docs/src/components/maz-circular-progress-bar.md +0 -145
- package/docs/src/components/maz-container.md +0 -363
- package/docs/src/components/maz-dialog-confirm.md +0 -240
- package/docs/src/components/maz-dialog.md +0 -164
- package/docs/src/components/maz-drawer.md +0 -181
- package/docs/src/components/maz-dropdown.md +0 -691
- package/docs/src/components/maz-expand-animation.md +0 -99
- package/docs/src/components/maz-fullscreen-loader.md +0 -58
- package/docs/src/components/maz-gallery.md +0 -85
- package/docs/src/components/maz-input-code.md +0 -61
- package/docs/src/components/maz-input-number.md +0 -81
- package/docs/src/components/maz-input-phone-number.md +0 -942
- package/docs/src/components/maz-input-price.md +0 -67
- package/docs/src/components/maz-input-tags.md +0 -114
- package/docs/src/components/maz-lazy-img.md +0 -88
- package/docs/src/components/maz-link.md +0 -178
- package/docs/src/components/maz-loading-bar.md +0 -26
- package/docs/src/components/maz-pagination.md +0 -79
- package/docs/src/components/maz-popover.md +0 -1416
- package/docs/src/components/maz-radio-buttons.md +0 -462
- package/docs/src/components/maz-radio.md +0 -142
- package/docs/src/components/maz-reading-progress-bar.md +0 -74
- package/docs/src/components/maz-spinner.md +0 -93
- package/docs/src/components/maz-switch.md +0 -92
- package/docs/src/components/maz-table.md +0 -732
- package/docs/src/components/maz-textarea.md +0 -400
- package/docs/src/components/maz-ticker.md +0 -692
- package/docs/src/components/maz-timeline.md +0 -478
- package/docs/src/composables/use-aos.md +0 -34
- package/docs/src/composables/use-breakpoints.md +0 -35
- package/docs/src/composables/use-dialog.md +0 -88
- package/docs/src/composables/use-string-matching.md +0 -63
- package/docs/src/composables/use-toast.md +0 -71
- package/docs/src/composables/use-wait.md +0 -62
- package/docs/src/composables/use-window-size.md +0 -18
- package/docs/src/ecosystem/icons/icon-set.md +0 -123
- package/docs/src/ecosystem/mcp.md +0 -210
- package/docs/src/ecosystem/node/index.md +0 -53
- package/docs/src/ecosystem/utils/camel-case.md +0 -31
- package/docs/src/ecosystem/utils/capitalize.md +0 -50
- package/docs/src/ecosystem/utils/country-code-to-unicode-flag.md +0 -213
- package/docs/src/ecosystem/utils/debounce-callback.md +0 -38
- package/docs/src/ecosystem/utils/fetch-locale-ip.md +0 -33
- package/docs/src/ecosystem/utils/get-browser-locale.md +0 -29
- package/docs/src/ecosystem/utils/get-country-flag-url.md +0 -156
- package/docs/src/ecosystem/utils/is-server.md +0 -31
- package/docs/src/ecosystem/utils/is-standalone-mode.md +0 -43
- package/docs/src/ecosystem/utils/truthy-filter.md +0 -31
- package/docs/src/ecosystem/utils/types/deep-required.md +0 -39
- package/docs/src/ecosystem/utils/types/flatten-object-keys.md +0 -44
- package/docs/src/ecosystem/utils/upper-first.md +0 -32
- package/docs/src/guide/cli.md +0 -144
- package/docs/src/guide/migration-v4.md +0 -925
- package/docs/src/guide/tailwind.md +0 -158
- package/docs/src/index.md +0 -603
- package/docs/src/made-with-maz-ui.md +0 -58
- package/docs/src/plugins/toast.md +0 -349
- package/docs/src/plugins/wait.md +0 -109
- package/docs/src/theme-editor.md +0 -21
|
@@ -1,29 +1,20 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: MazTabs
|
|
3
|
-
description: MazTabs is a standalone component to display content in tabs with animations
|
|
2
|
+
title: "MazTabs"
|
|
3
|
+
description: "MazTabs is a standalone component to display content in tabs with animations"
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-tabs"
|
|
4
6
|
---
|
|
5
7
|
|
|
6
|
-
#
|
|
8
|
+
# MazTabs
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
> MazTabs is a standalone component to display content in tabs with animations
|
|
9
11
|
|
|
10
|
-
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazTabs from 'maz-ui/components/MazTabs'` or `import MazTabsBar from 'maz-ui/components/MazTabsBar'` or `import MazTabsContent from 'maz-ui/components/MazTabsContent'` or `import MazTabsContentItem from 'maz-ui/components/MazTabsContentItem'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-tabs
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
<MazTabsBar :items="tabs" />
|
|
14
|
-
|
|
15
|
-
<MazTabsContent>
|
|
16
|
-
<MazTabsContentItem :tab="1" class="maz:py-4">
|
|
17
|
-
Tab 1
|
|
18
|
-
</MazTabsContentItem>
|
|
19
|
-
<MazTabsContentItem :tab="2" class="maz:py-4">
|
|
20
|
-
Tab 2
|
|
21
|
-
</MazTabsContentItem>
|
|
22
|
-
<MazTabsContentItem :tab="3" class="maz:py-4">
|
|
23
|
-
Tab 3
|
|
24
|
-
</MazTabsContentItem>
|
|
25
|
-
</MazTabsContent>
|
|
26
|
-
</MazTabs>
|
|
17
|
+
## Basic usage
|
|
27
18
|
|
|
28
19
|
```vue
|
|
29
20
|
<script lang="ts" setup>
|
|
@@ -41,13 +32,13 @@ const tabs: MazTabsBarItem[] = [
|
|
|
41
32
|
<MazTabsBar :items="tabs" />
|
|
42
33
|
|
|
43
34
|
<MazTabsContent>
|
|
44
|
-
<MazTabsContentItem :tab="1" class="
|
|
35
|
+
<MazTabsContentItem :tab="1" class="py-4">
|
|
45
36
|
Tab 1
|
|
46
37
|
</MazTabsContentItem>
|
|
47
|
-
<MazTabsContentItem :tab="2" class="
|
|
38
|
+
<MazTabsContentItem :tab="2" class="py-4">
|
|
48
39
|
Tab 2
|
|
49
40
|
</MazTabsContentItem>
|
|
50
|
-
<MazTabsContentItem :tab="3" class="
|
|
41
|
+
<MazTabsContentItem :tab="3" class="py-4">
|
|
51
42
|
Tab 3
|
|
52
43
|
</MazTabsContentItem>
|
|
53
44
|
</MazTabsContent>
|
|
@@ -57,29 +48,7 @@ const tabs: MazTabsBarItem[] = [
|
|
|
57
48
|
|
|
58
49
|
## With model-value
|
|
59
50
|
|
|
60
|
-
|
|
61
|
-
<MazTabsBar :items="tabs" />
|
|
62
|
-
|
|
63
|
-
<MazTabsContent>
|
|
64
|
-
<MazTabsContentItem :tab="1" class="maz:py-4">
|
|
65
|
-
Tab 1
|
|
66
|
-
</MazTabsContentItem>
|
|
67
|
-
<MazTabsContentItem :tab="2" class="maz:py-4">
|
|
68
|
-
Tab 2
|
|
69
|
-
</MazTabsContentItem>
|
|
70
|
-
<MazTabsContentItem :tab="3" class="maz:py-4">
|
|
71
|
-
Tab 3
|
|
72
|
-
</MazTabsContentItem>
|
|
73
|
-
</MazTabsContent>
|
|
74
|
-
</MazTabs>
|
|
75
|
-
|
|
76
|
-
<br />
|
|
77
|
-
|
|
78
|
-
<MazBtn @click="currentTab = currentTab === 1 ? 2 : 1">
|
|
79
|
-
Set model-value to {{currentTab === 1 ? 2 : 1}}
|
|
80
|
-
</MazBtn>
|
|
81
|
-
|
|
82
|
-
::: details View code
|
|
51
|
+
**Details: View code**
|
|
83
52
|
|
|
84
53
|
```vue
|
|
85
54
|
<script lang="ts" setup>
|
|
@@ -95,13 +64,13 @@ const tabs: MazTabsBarItem[] = ['First Tab', 'Second Tab', 'Third Tab']
|
|
|
95
64
|
<MazTabsBar :items="tabs" />
|
|
96
65
|
|
|
97
66
|
<MazTabsContent>
|
|
98
|
-
<MazTabsContentItem :tab="1" class="
|
|
67
|
+
<MazTabsContentItem :tab="1" class="py-4">
|
|
99
68
|
Tab 1
|
|
100
69
|
</MazTabsContentItem>
|
|
101
|
-
<MazTabsContentItem :tab="2" class="
|
|
70
|
+
<MazTabsContentItem :tab="2" class="py-4">
|
|
102
71
|
Tab 2
|
|
103
72
|
</MazTabsContentItem>
|
|
104
|
-
<MazTabsContentItem :tab="3" class="
|
|
73
|
+
<MazTabsContentItem :tab="3" class="py-4">
|
|
105
74
|
Tab 3
|
|
106
75
|
</MazTabsContentItem>
|
|
107
76
|
</MazTabsContent>
|
|
@@ -115,8 +84,6 @@ const tabs: MazTabsBarItem[] = ['First Tab', 'Second Tab', 'Third Tab']
|
|
|
115
84
|
</template>
|
|
116
85
|
```
|
|
117
86
|
|
|
118
|
-
:::
|
|
119
|
-
|
|
120
87
|
## Persistent tab
|
|
121
88
|
|
|
122
89
|
To keep the tab current when the page reloads, you can use the `persistent` props on the component `<MazTabsBar />`.
|
|
@@ -125,39 +92,8 @@ The component will save the current table index in the URL of the page via a que
|
|
|
125
92
|
|
|
126
93
|
You can choose the name of this query parameter with the props `query-param` `@default 'tab'`
|
|
127
94
|
|
|
128
|
-
<MazTabs>
|
|
129
|
-
<MazTabsBar :items="tabs2" persistent />
|
|
130
|
-
|
|
131
|
-
<MazTabsContent>
|
|
132
|
-
<MazTabsContentItem :tab="1" class="maz:py-4">
|
|
133
|
-
Tab 1
|
|
134
|
-
</MazTabsContentItem>
|
|
135
|
-
<MazTabsContentItem :tab="2" class="maz:py-4">
|
|
136
|
-
Tab 2
|
|
137
|
-
</MazTabsContentItem>
|
|
138
|
-
<MazTabsContentItem :tab="3" class="maz:py-4">
|
|
139
|
-
Tab 3
|
|
140
|
-
</MazTabsContentItem>
|
|
141
|
-
</MazTabsContent>
|
|
142
|
-
</MazTabs>
|
|
143
|
-
|
|
144
95
|
## Custom tabs with slot
|
|
145
96
|
|
|
146
|
-
<MazTabs>
|
|
147
|
-
<MazTabsBar :items="tabs2">
|
|
148
|
-
<template #item="{ item, index, active }">
|
|
149
|
-
{{ item.label }}
|
|
150
|
-
<MazBadge
|
|
151
|
-
size="mini"
|
|
152
|
-
rounded-size="full"
|
|
153
|
-
:color="active ? 'primary' : 'transparent'"
|
|
154
|
-
>
|
|
155
|
-
{{ index}}
|
|
156
|
-
</MazBadge>
|
|
157
|
-
</template>
|
|
158
|
-
</MazTabsBar>
|
|
159
|
-
</MazTabs>
|
|
160
|
-
|
|
161
97
|
```html
|
|
162
98
|
<MazTabs>
|
|
163
99
|
<MazTabsBar :items="tabs">
|
|
@@ -170,37 +106,11 @@ You can choose the name of this query parameter with the props `query-param` `@d
|
|
|
170
106
|
</MazTabs>
|
|
171
107
|
```
|
|
172
108
|
|
|
173
|
-
<script lang="ts" setup>
|
|
174
|
-
import { ref } from 'vue'
|
|
175
|
-
|
|
176
|
-
const currentTab = ref(2)
|
|
177
|
-
|
|
178
|
-
const tabs: MazTabsBarItem[] = [
|
|
179
|
-
{ label: 'First Tab', disabled: false },
|
|
180
|
-
{ label: 'Second Tab', disabled: false, badge: { color: 'destructive', content: 1, roundedSize: 'full' } },
|
|
181
|
-
{ label: 'Third Tab', disabled: true },
|
|
182
|
-
]
|
|
183
|
-
|
|
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
|
-
]
|
|
193
|
-
</script>
|
|
194
|
-
|
|
195
109
|
## Size and rounded size
|
|
196
110
|
|
|
197
111
|
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
112
|
|
|
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](
|
|
200
|
-
|
|
201
|
-
<MazTabs size="sm" rounded-size="lg">
|
|
202
|
-
<MazTabsBar :items="tabs2" />
|
|
203
|
-
</MazTabs>
|
|
113
|
+
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).
|
|
204
114
|
|
|
205
115
|
```vue
|
|
206
116
|
<template>
|
|
@@ -221,10 +131,6 @@ Each item can also override the `size` and `rounded-size` (and accepts every oth
|
|
|
221
131
|
|
|
222
132
|
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
133
|
|
|
224
|
-
<MazTabs>
|
|
225
|
-
<MazTabsBar :items="tabs2" color="primary" />
|
|
226
|
-
</MazTabs>
|
|
227
|
-
|
|
228
134
|
```vue
|
|
229
135
|
<template>
|
|
230
136
|
<MazTabsBar :items="tabs" color="primary" />
|
|
@@ -235,22 +141,16 @@ The active tab is highlighted by the indicator. Use the `color` prop (`MazColor`
|
|
|
235
141
|
|
|
236
142
|
`MazTabsBar` can be used on its own, without `MazTabs`, as an independent switcher with its own `v-model`.
|
|
237
143
|
|
|
238
|
-
|
|
144
|
+
**Tip: Nested inside a `MazTabs`**
|
|
145
|
+
|
|
239
146
|
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
147
|
|
|
241
148
|
```vue
|
|
242
149
|
<MazTabsBar v-model="selected" :items="items" standalone />
|
|
243
150
|
```
|
|
244
|
-
:::
|
|
245
151
|
|
|
246
152
|
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
153
|
|
|
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
154
|
```vue
|
|
255
155
|
<script lang="ts" setup>
|
|
256
156
|
import { MazTabsBar, type MazTabsBarItem } from 'maz-ui/components'
|
|
@@ -324,22 +224,85 @@ type MazTabsBarItem<Value extends string | number = string | number>
|
|
|
324
224
|
The tabs follow the [WAI-ARIA tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/):
|
|
325
225
|
|
|
326
226
|
- `MazTabsBar` is a `tablist` (pass an `aria-label` to name it), each item is a `tab` with `aria-selected`, linked to its `MazTabsContentItem` (`tabpanel`) through `aria-controls` / `aria-labelledby`.
|
|
327
|
-
- **Keyboard**: only the selected tab is in the tab sequence,
|
|
227
|
+
- **Keyboard**: only the selected tab is in the tab sequence, ← / → select the previous / next tab (reversed in RTL), Home / End the first / last one. Disabled tabs are skipped.
|
|
328
228
|
|
|
329
229
|
## Props & Events emitted
|
|
330
230
|
|
|
331
231
|
## MazTabs
|
|
332
232
|
|
|
333
|
-
|
|
233
|
+
## MazTabs API
|
|
234
|
+
|
|
235
|
+
`import MazTabs from 'maz-ui/components/MazTabs'`
|
|
236
|
+
|
|
237
|
+
### Props
|
|
238
|
+
|
|
239
|
+
- `model-value` (`number`, `v-model`): The the selected tab number.
|
|
240
|
+
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`): Size of the tabs, forwarded to MazTabsBar (and each tab button).
|
|
241
|
+
- `rounded-size` (`MazRoundedSize`): Size of the rounded, forwarded to MazTabsBar. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
242
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`): Color of the active tab indicator, forwarded to MazTabsBar.
|
|
243
|
+
|
|
244
|
+
### Events
|
|
245
|
+
|
|
246
|
+
- `@update:model-value` (payload: `value: number`): Emitted when the selected tab change
|
|
247
|
+
|
|
248
|
+
### Slots
|
|
249
|
+
|
|
250
|
+
- `#default`
|
|
334
251
|
|
|
335
252
|
## MazTabsBar
|
|
336
253
|
|
|
337
|
-
|
|
254
|
+
## MazTabsBar API
|
|
255
|
+
|
|
256
|
+
`import MazTabsBar from 'maz-ui/components/MazTabsBar'`
|
|
257
|
+
|
|
258
|
+
### Props
|
|
259
|
+
|
|
260
|
+
- `items` (`readonly Item[]`, required): The items to display in the tabs bar.
|
|
261
|
+
- `model-value` (`MazTabsBarItemValue<Item>`, `v-model`): Selected tab (standalone usage, without MazTabs). Holds the item `value` when provided, otherwise the 1-based index. Pass items `as const` (or with literal `value`) to infer a union type.
|
|
262
|
+
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): Size of the tabs (forwarded to each MazBtn).
|
|
263
|
+
- `rounded-size` (`MazRoundedSize`, default: `'md'`): Size of the rounded applied to the bar, the indicator and each tab. Values: `'none'`, `'sm'`, `'md'`, `'lg'`, `'xl'`, `'full'` (non exhaustive).
|
|
264
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`): Color of the active tab indicator. When omitted, the default neutral indicator is used.
|
|
265
|
+
- `standalone` (`boolean`, default: `false`): Force the standalone mode: the tabs bar ignores any surrounding `MazTabs` (selection, size, rounded-size and color are no longer inherited) and is driven only by its own `v-model`. Useful for a nested switcher inside a page already wrapped by `MazTabs`.
|
|
266
|
+
- `persistent` (`boolean`, default: `false`): Will add a query param to the url to keep the selected tab on page refresh.
|
|
267
|
+
- `query-param` (`string`, default: `"tab"`): The name of the query param to add to the url.
|
|
268
|
+
- `block` (`boolean`, default: `false`): Will make the tabs bar full width.
|
|
269
|
+
- `elevation` (`boolean`, default: `false`): Will remove the elevation.
|
|
270
|
+
- `auto-scroll` (`boolean`, default: `true`): Will add a scroll on the tabs bar to show selected element.
|
|
271
|
+
- `bordered` (`boolean`, default: `true`): Will add a border to the tabs bar.
|
|
272
|
+
|
|
273
|
+
### Events
|
|
274
|
+
|
|
275
|
+
- `@update:model-value` (payload: `value: MazTabsBarItemValue<Item>`): Emitted when the selected tab changes (standalone usage).
|
|
276
|
+
|
|
277
|
+
### Slots
|
|
278
|
+
|
|
279
|
+
- `#item`: Content of item to display in the tabs bar Bindings: `item: { label: Item & string; value: string | number | undefined; disabled: boolean; size: "xs" | "sm" | "md" | "lg" | "xl" | "mini" | undefined; roundedSize: MazRoundedSize | undefined; color: NonNullable<"primary" | "secondary" | "accent" | ...` (all data of the item), `active: boolean` (`true` if the tab is active), `index: number` (index of the item).
|
|
280
|
+
- `#badge-content`: Content in the badge Bindings: `content: string | number | boolean` (content of the badge provided in item).
|
|
338
281
|
|
|
339
282
|
## MazTabsContent
|
|
340
283
|
|
|
341
|
-
|
|
284
|
+
## MazTabsContent API
|
|
285
|
+
|
|
286
|
+
`import MazTabsContent from 'maz-ui/components/MazTabsContent'`
|
|
287
|
+
|
|
288
|
+
### Props
|
|
289
|
+
|
|
290
|
+
No props.
|
|
291
|
+
|
|
292
|
+
### Slots
|
|
293
|
+
|
|
294
|
+
- `#default`
|
|
342
295
|
|
|
343
296
|
## MazTabsContentItem
|
|
344
297
|
|
|
345
|
-
|
|
298
|
+
## MazTabsContentItem API
|
|
299
|
+
|
|
300
|
+
`import MazTabsContentItem from 'maz-ui/components/MazTabsContentItem'`
|
|
301
|
+
|
|
302
|
+
### Props
|
|
303
|
+
|
|
304
|
+
- `tab` (`number`, required)
|
|
305
|
+
|
|
306
|
+
### Slots
|
|
307
|
+
|
|
308
|
+
- `#default`
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "MazTextarea"
|
|
3
|
+
description: "MazTextarea is a standalone component that replaces the standard html textarea input with a beautiful design system. Many options like colors, disabled, error, warning, success and error messages are available."
|
|
4
|
+
package: "maz-ui"
|
|
5
|
+
url: "https://maz-ui.com/components/maz-textarea"
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# MazTextarea
|
|
9
|
+
|
|
10
|
+
> MazTextarea is a standalone component that replaces the standard html textarea input with a beautiful design system. Many options like colors, disabled, error, warning, success and error messages are available.
|
|
11
|
+
|
|
12
|
+
- Package: `maz-ui`
|
|
13
|
+
- Import: `import MazTextarea from 'maz-ui/components/MazTextarea'`
|
|
14
|
+
- Nuxt: auto-imported by `@maz-ui/nuxt`, no import needed in a Nuxt app
|
|
15
|
+
- Web: https://maz-ui.com/components/maz-textarea
|
|
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
|
+
**Note:**
|
|
20
|
+
|
|
21
|
+
This component uses the native CSS `field-sizing: content` property for autogrow - the textarea expands automatically as the user types, with zero JavaScript overhead.
|
|
22
|
+
|
|
23
|
+
## Basic usage
|
|
24
|
+
|
|
25
|
+
```vue
|
|
26
|
+
<script lang="ts" setup>
|
|
27
|
+
import MazTextarea from 'maz-ui/components/MazTextarea'
|
|
28
|
+
import { ref } from 'vue'
|
|
29
|
+
|
|
30
|
+
const value = ref()
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<MazTextarea
|
|
35
|
+
v-model="value"
|
|
36
|
+
name="comment"
|
|
37
|
+
label="Enter your comment"
|
|
38
|
+
/>
|
|
39
|
+
</template>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## With top-label
|
|
43
|
+
|
|
44
|
+
You can use the `top-label` attribute to display a top label above the textarea.
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<MazTextarea
|
|
48
|
+
v-model="value"
|
|
49
|
+
top-label="Your message"
|
|
50
|
+
placeholder="Type your message..."
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## With assistive text
|
|
55
|
+
|
|
56
|
+
You can use the `assistive-text` attribute to display a assistive text below the textarea.
|
|
57
|
+
|
|
58
|
+
```html
|
|
59
|
+
<MazTextarea
|
|
60
|
+
v-model="value"
|
|
61
|
+
top-label="Your message"
|
|
62
|
+
placeholder="Type your message..."
|
|
63
|
+
assistive-text="This is an assistive text"
|
|
64
|
+
/>
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## With label and append slots
|
|
68
|
+
|
|
69
|
+
You can use the `label` and `append` slots to customize the label and the append element.
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<script lang="ts" setup>
|
|
73
|
+
import { useToast } from 'maz-ui/composables'
|
|
74
|
+
import { ref } from 'vue'
|
|
75
|
+
|
|
76
|
+
const value = ref<string>()
|
|
77
|
+
|
|
78
|
+
const toast = useToast()
|
|
79
|
+
|
|
80
|
+
function sendMessage() {
|
|
81
|
+
toast.success('Message sent', {
|
|
82
|
+
position: 'top-right',
|
|
83
|
+
})
|
|
84
|
+
value.value = ''
|
|
85
|
+
}
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<template>
|
|
89
|
+
<MazTextarea
|
|
90
|
+
v-model="value"
|
|
91
|
+
name="comment"
|
|
92
|
+
>
|
|
93
|
+
<template #label>
|
|
94
|
+
<MazIcon icon="/envelope.svg" class="text-xl" />
|
|
95
|
+
<span class="ms-2">
|
|
96
|
+
The custom label
|
|
97
|
+
</span>
|
|
98
|
+
</template>
|
|
99
|
+
<template #append>
|
|
100
|
+
<MazBtn icon="paper-airplane" size="sm" @click="sendMessage" />
|
|
101
|
+
</template>
|
|
102
|
+
</MazTextarea>
|
|
103
|
+
</template>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## With hint and state
|
|
107
|
+
|
|
108
|
+
You can use the `hint` attribute to display a hint message. This will replace the label.
|
|
109
|
+
|
|
110
|
+
```vue
|
|
111
|
+
<template>
|
|
112
|
+
<MazTextarea
|
|
113
|
+
v-model="value"
|
|
114
|
+
name="comment"
|
|
115
|
+
label="This is a label"
|
|
116
|
+
hint="This is a hint message"
|
|
117
|
+
/>
|
|
118
|
+
<MazTextarea
|
|
119
|
+
v-model="value"
|
|
120
|
+
name="comment"
|
|
121
|
+
label="This is a label"
|
|
122
|
+
hint="This is a hint message"
|
|
123
|
+
error
|
|
124
|
+
/>
|
|
125
|
+
<MazTextarea
|
|
126
|
+
v-model="value"
|
|
127
|
+
name="comment"
|
|
128
|
+
label="This is a label"
|
|
129
|
+
hint="This is a hint message"
|
|
130
|
+
success
|
|
131
|
+
/>
|
|
132
|
+
<MazTextarea
|
|
133
|
+
v-model="value"
|
|
134
|
+
name="comment"
|
|
135
|
+
label="This is a label"
|
|
136
|
+
hint="This is a hint message"
|
|
137
|
+
warning
|
|
138
|
+
/>
|
|
139
|
+
<hr class="my-4">
|
|
140
|
+
<MazTextarea
|
|
141
|
+
v-model="value"
|
|
142
|
+
name="comment"
|
|
143
|
+
top-label="This is a label"
|
|
144
|
+
hint="This is a hint message"
|
|
145
|
+
/>
|
|
146
|
+
<MazTextarea
|
|
147
|
+
v-model="value"
|
|
148
|
+
name="comment"
|
|
149
|
+
top-label="This is a label"
|
|
150
|
+
hint="This is a hint message"
|
|
151
|
+
error
|
|
152
|
+
/>
|
|
153
|
+
<MazTextarea
|
|
154
|
+
v-model="value"
|
|
155
|
+
name="comment"
|
|
156
|
+
top-label="This is a label"
|
|
157
|
+
hint="This is a hint message"
|
|
158
|
+
success
|
|
159
|
+
/>
|
|
160
|
+
<MazTextarea
|
|
161
|
+
v-model="value"
|
|
162
|
+
name="comment"
|
|
163
|
+
top-label="This is a label"
|
|
164
|
+
hint="This is a hint message"
|
|
165
|
+
warning
|
|
166
|
+
/>
|
|
167
|
+
</template>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## Disable autogrow
|
|
171
|
+
|
|
172
|
+
By default, the textarea automatically expands as the user types. You can disable this behavior with the `autogrow` prop set to `false` - the textarea will then have a fixed height with a manual resize handle.
|
|
173
|
+
|
|
174
|
+
```html
|
|
175
|
+
<MazTextarea v-model="value" name="comment" label="Fixed height textarea" :autogrow="false" />
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Minimum rows (compact / input-like)
|
|
179
|
+
|
|
180
|
+
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.
|
|
181
|
+
|
|
182
|
+
```vue
|
|
183
|
+
<template>
|
|
184
|
+
<MazTextarea
|
|
185
|
+
v-model="value"
|
|
186
|
+
name="comment"
|
|
187
|
+
:min-rows="1"
|
|
188
|
+
rounded-size="xl"
|
|
189
|
+
placeholder="Send your message"
|
|
190
|
+
/>
|
|
191
|
+
</template>
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Sizes
|
|
195
|
+
|
|
196
|
+
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.
|
|
197
|
+
|
|
198
|
+
```vue
|
|
199
|
+
<template>
|
|
200
|
+
<MazTextarea v-model="value" name="comment" size="xs" :min-rows="1" placeholder="Size xs" />
|
|
201
|
+
<MazTextarea v-model="value" name="comment" size="sm" :min-rows="1" placeholder="Size sm" />
|
|
202
|
+
<MazTextarea v-model="value" name="comment" size="md" :min-rows="1" placeholder="Size md" />
|
|
203
|
+
<MazTextarea v-model="value" name="comment" size="lg" :min-rows="1" placeholder="Size lg" />
|
|
204
|
+
<MazTextarea v-model="value" name="comment" size="xl" :min-rows="1" placeholder="Size xl" />
|
|
205
|
+
</template>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
## Disabled
|
|
209
|
+
|
|
210
|
+
```html
|
|
211
|
+
<MazTextarea v-model="value" name="comment" label="This is a label" disabled />
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
## MazTextarea API
|
|
215
|
+
|
|
216
|
+
`import MazTextarea from 'maz-ui/components/MazTextarea'`
|
|
217
|
+
|
|
218
|
+
### Props
|
|
219
|
+
|
|
220
|
+
- `model-value` (`T`, `v-model`): The value of the textarea.
|
|
221
|
+
- `id` (`string`): The id of the textarea.
|
|
222
|
+
- `name` (`string`, default: `"MazTextarea"`): The name of the textarea.
|
|
223
|
+
- `label` (`string`): The label of the textarea.
|
|
224
|
+
- `placeholder` (`string`): The placeholder of the textarea.
|
|
225
|
+
- `required` (`boolean`, default: `false`): If the textarea is required.
|
|
226
|
+
- `disabled` (`boolean`, default: `false`): If the textarea is disabled.
|
|
227
|
+
- `readonly` (`boolean`, default: `false`): If the textarea is readonly.
|
|
228
|
+
- `error` (`boolean`, default: `false`): If the textarea has an error.
|
|
229
|
+
- `success` (`boolean`, default: `false`): If the textarea has a success.
|
|
230
|
+
- `warning` (`boolean`, default: `false`): If the textarea has a warning.
|
|
231
|
+
- `hint` (`string`): The hint of the textarea.
|
|
232
|
+
- `color` (`"primary" | "secondary" | "accent" | "info" | "success" | "warning" | "destructive" | "contrast" | "transparent"`, default: `"primary"`): The color of the textarea.
|
|
233
|
+
- `rounded-size` (`MazRoundedSize`, default: `'md'`): Size radius of the component's border.
|
|
234
|
+
- `size` (`"xs" | "sm" | "md" | "lg" | "xl" | "mini"`, default: `'md'`): Controls the padding (height) and text size of the textarea, mirroring MazInput sizes. Combined with `minRows`, e.g. `size="md" :min-rows="1"` matches a regular input height.
|
|
235
|
+
- `padding` (`boolean`, default: `true`): If the textarea has a padding.
|
|
236
|
+
- `transparent` (`boolean`, default: `false`): If the textarea has a transparent background.
|
|
237
|
+
- `border` (`boolean`, default: `true`): If the textarea has no border.
|
|
238
|
+
- `autogrow` (`boolean`, default: `true`): If the textarea should autogrow based on its content.
|
|
239
|
+
- `min-rows` (`number`, default: `3`): Minimum number of rows displayed by the textarea (initial/minimum height). With autogrow enabled, the textarea still grows beyond this with its content.
|
|
240
|
+
- `append-justify` (`"center" | "end" | "start" | "space-between" | "space-around" | "space-evenly"`, default: `"end"`): The alignment of the append slot.
|
|
241
|
+
- `top-label` (`string`): Static label displayed above the textarea. Unlike the floating label, this remains fixed.
|
|
242
|
+
- `assistive-text` (`string`): Helper text displayed below the input to provide additional context or validation feedback.
|
|
243
|
+
|
|
244
|
+
### Events
|
|
245
|
+
|
|
246
|
+
- `@update:model-value` (payload: `T | undefined`): Emitted when the value of the textarea change
|
|
247
|
+
- `@input` (payload: `T | undefined`): Emitted when the value of the textarea change
|
|
248
|
+
- `@focus` (payload: `FocusEvent`): Emitted when the textarea is focused
|
|
249
|
+
- `@blur` (payload: `FocusEvent`): Emitted when the textarea is blurred
|
|
250
|
+
- `@change` (payload: `Event`): Emitted when the textarea value change
|
|
251
|
+
|
|
252
|
+
### Slots
|
|
253
|
+
|
|
254
|
+
- `#label`
|
|
255
|
+
- `#append`
|