@maz-ui/mcp 5.0.1-beta.0 → 5.1.0-beta.1
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 +16 -0
- package/dist/index.d.mts +345 -0
- package/dist/index.d.ts +345 -0
- package/dist/index.mjs +16 -0
- package/dist/shared/mcp.DseFuKdl.mjs +2968 -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 +78 -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 +27 -189
- package/docs/{src/components → components}/maz-btn.md +62 -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 +107 -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 +48 -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 +21 -15
- 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 +50 -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 +239 -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 +507 -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 +59 -0
- package/package.json +86 -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,533 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: MazBottomSheet
|
|
3
|
-
description: MazBottomSheet is a standalone component like a simple dialog but anchored at the bottom of the screen. Full-width on mobile and constrained/centered on desktop, with a header (icon, title, close button), a footer and many replaceable slots. Useful for mobile UX.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# {{ $frontmatter.title }}
|
|
7
|
-
|
|
8
|
-
{{ $frontmatter.description }}
|
|
9
|
-
|
|
10
|
-
<!--@include: ./../../.vitepress/mixins/getting-started.md-->
|
|
11
|
-
|
|
12
|
-
::: tip
|
|
13
|
-
This component uses the `<Teleport to="body">` with [MazBackdrop](./maz-backdrop.md), so you can implement this component anywhere and it inherits all its props (`persistent`, `closeOnEscape`, etc.)
|
|
14
|
-
:::
|
|
15
|
-
|
|
16
|
-
## Basic usage
|
|
17
|
-
|
|
18
|
-
The sheet has a header (with the `title` and a close button) and an optional `footer` slot. It opens full-width on mobile and is constrained/centered on desktop (see [Max width](#max-width)).
|
|
19
|
-
|
|
20
|
-
<ComponentDemo expanded>
|
|
21
|
-
<MazBtn @click="basicOpened = true">Open Bottom Sheet</MazBtn>
|
|
22
|
-
|
|
23
|
-
<MazBottomSheet v-model="basicOpened" title="Bottom Sheet Title">
|
|
24
|
-
<p>Your content goes here.</p>
|
|
25
|
-
<template #footer="{ close }">
|
|
26
|
-
<MazBtn color="transparent" @click="close">Cancel</MazBtn>
|
|
27
|
-
<MazBtn @click="close">Confirm</MazBtn>
|
|
28
|
-
</template>
|
|
29
|
-
</MazBottomSheet>
|
|
30
|
-
|
|
31
|
-
<template #code>
|
|
32
|
-
|
|
33
|
-
```vue
|
|
34
|
-
<script setup>
|
|
35
|
-
import MazBottomSheet from 'maz-ui/components/MazBottomSheet'
|
|
36
|
-
import { ref } from 'vue'
|
|
37
|
-
|
|
38
|
-
const basicOpened = ref(false)
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<template>
|
|
42
|
-
<MazBtn @click="basicOpened = true">
|
|
43
|
-
Open Bottom Sheet
|
|
44
|
-
</MazBtn>
|
|
45
|
-
|
|
46
|
-
<MazBottomSheet v-model="basicOpened" title="Bottom Sheet Title">
|
|
47
|
-
<p>Your content goes here.</p>
|
|
48
|
-
|
|
49
|
-
<template #footer="{ close }">
|
|
50
|
-
<MazBtn color="transparent" @click="close">
|
|
51
|
-
Cancel
|
|
52
|
-
</MazBtn>
|
|
53
|
-
<MazBtn @click="close">
|
|
54
|
-
Confirm
|
|
55
|
-
</MazBtn>
|
|
56
|
-
</template>
|
|
57
|
-
</MazBottomSheet>
|
|
58
|
-
</template>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
</template>
|
|
62
|
-
</ComponentDemo>
|
|
63
|
-
|
|
64
|
-
## Swipe to close (iOS-like)
|
|
65
|
-
|
|
66
|
-
By default a drag handle (grab bar) is shown at the top of the sheet, and you can **close the sheet by dragging that handle down** - the sheet follows your pointer and either dismisses (past the threshold) or snaps back. This works with both touch and mouse.
|
|
67
|
-
|
|
68
|
-
Disable it with `:swipe-to-close="false"` (the handle is then hidden too), or replace the handle with the `#handle` slot. A `persistent` sheet never dismisses on swipe: it snaps back instead.
|
|
69
|
-
|
|
70
|
-
<ComponentDemo>
|
|
71
|
-
<MazBtn @click="swipeOpened = true">Open swipeable sheet</MazBtn>
|
|
72
|
-
|
|
73
|
-
<MazBottomSheet v-model="swipeOpened" title="Drag me down">
|
|
74
|
-
<p>Grab the bar at the top and drag down to close, or release before the threshold to snap back.</p>
|
|
75
|
-
</MazBottomSheet>
|
|
76
|
-
|
|
77
|
-
<template #code>
|
|
78
|
-
|
|
79
|
-
```html
|
|
80
|
-
<!-- enabled by default -->
|
|
81
|
-
<MazBottomSheet v-model="swipeOpened" title="Drag me down">
|
|
82
|
-
<p>Grab the bar at the top and drag down to close.</p>
|
|
83
|
-
</MazBottomSheet>
|
|
84
|
-
|
|
85
|
-
<!-- disable the handle and the gesture -->
|
|
86
|
-
<MazBottomSheet v-model="swipeOpened" :swipe-to-close="false" title="No swipe" />
|
|
87
|
-
|
|
88
|
-
<!-- custom handle -->
|
|
89
|
-
<MazBottomSheet v-model="swipeOpened" title="Custom handle">
|
|
90
|
-
<template #handle>
|
|
91
|
-
<span class="maz:h-1.5 maz:w-12 maz:rounded-full maz:bg-primary" />
|
|
92
|
-
</template>
|
|
93
|
-
</MazBottomSheet>
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
</template>
|
|
97
|
-
</ComponentDemo>
|
|
98
|
-
|
|
99
|
-
## Header with an icon
|
|
100
|
-
|
|
101
|
-
Pass an `icon` (an icon value or a full `MazIconProps` object) to display it on the left of the title.
|
|
102
|
-
|
|
103
|
-
<ComponentDemo>
|
|
104
|
-
<MazBtn @click="iconOpened = true">Open with icon</MazBtn>
|
|
105
|
-
|
|
106
|
-
<MazBottomSheet v-model="iconOpened" title="Notifications" icon="/bell.svg">
|
|
107
|
-
<p>You have 3 new notifications.</p>
|
|
108
|
-
<template #footer="{ close }">
|
|
109
|
-
<MazBtn @click="close">Mark all as read</MazBtn>
|
|
110
|
-
</template>
|
|
111
|
-
</MazBottomSheet>
|
|
112
|
-
|
|
113
|
-
<template #code>
|
|
114
|
-
|
|
115
|
-
```html
|
|
116
|
-
<MazBottomSheet v-model="iconOpened" title="Notifications" icon="/bell.svg">
|
|
117
|
-
<p>You have 3 new notifications.</p>
|
|
118
|
-
|
|
119
|
-
<template #footer="{ close }">
|
|
120
|
-
<MazBtn @click="close">Mark all as read</MazBtn>
|
|
121
|
-
</template>
|
|
122
|
-
</MazBottomSheet>
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
</template>
|
|
126
|
-
</ComponentDemo>
|
|
127
|
-
|
|
128
|
-
## Replaceable slots
|
|
129
|
-
|
|
130
|
-
Everything in the header is replaceable: use `#icon` and `#title` to customize parts of the default header, or `#header` to replace the whole header (you get the `close` function as a binding).
|
|
131
|
-
|
|
132
|
-
<ComponentDemo>
|
|
133
|
-
<MazBtn @click="slotsOpened = true">Open custom header</MazBtn>
|
|
134
|
-
|
|
135
|
-
<MazBottomSheet v-model="slotsOpened">
|
|
136
|
-
<template #icon>
|
|
137
|
-
<MazAvatar src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100" size="sm" />
|
|
138
|
-
</template>
|
|
139
|
-
<template #title>
|
|
140
|
-
<span class="maz:text-primary">Custom title</span>
|
|
141
|
-
</template>
|
|
142
|
-
<p>The icon and the title slots are fully replaceable.</p>
|
|
143
|
-
</MazBottomSheet>
|
|
144
|
-
|
|
145
|
-
<template #code>
|
|
146
|
-
|
|
147
|
-
```html
|
|
148
|
-
<MazBottomSheet v-model="slotsOpened">
|
|
149
|
-
<template #icon>
|
|
150
|
-
<MazAvatar src="/avatar.jpg" size="sm" />
|
|
151
|
-
</template>
|
|
152
|
-
|
|
153
|
-
<template #title>
|
|
154
|
-
<span class="maz:text-primary">Custom title</span>
|
|
155
|
-
</template>
|
|
156
|
-
|
|
157
|
-
<p>The icon and the title slots are fully replaceable.</p>
|
|
158
|
-
</MazBottomSheet>
|
|
159
|
-
|
|
160
|
-
<!-- or replace the whole header -->
|
|
161
|
-
<MazBottomSheet v-model="slotsOpened">
|
|
162
|
-
<template #header="{ close }">
|
|
163
|
-
<div class="maz:flex maz:items-center maz:justify-between maz:p-4">
|
|
164
|
-
<strong>My header</strong>
|
|
165
|
-
<MazBtn size="sm" color="transparent" @click="close">Close</MazBtn>
|
|
166
|
-
</div>
|
|
167
|
-
</template>
|
|
168
|
-
</MazBottomSheet>
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
</template>
|
|
172
|
-
</ComponentDemo>
|
|
173
|
-
|
|
174
|
-
## Max width
|
|
175
|
-
|
|
176
|
-
On mobile the sheet is always **full-width**. From the tablet breakpoint and up, it is **constrained** to `max-width` and centered horizontally. The default `max-width` is `35rem`; pass the `max-width` prop (a [`MazSizeUnit`](#props)) to override it.
|
|
177
|
-
|
|
178
|
-
<ComponentDemo>
|
|
179
|
-
<MazBtn @click="wideOpened = true">Open wide sheet</MazBtn>
|
|
180
|
-
|
|
181
|
-
<MazBottomSheet v-model="wideOpened" title="Wide sheet" max-width="60rem">
|
|
182
|
-
<p>This sheet is constrained to 60rem on desktop and full-width on mobile.</p>
|
|
183
|
-
</MazBottomSheet>
|
|
184
|
-
|
|
185
|
-
<template #code>
|
|
186
|
-
|
|
187
|
-
```html
|
|
188
|
-
<MazBottomSheet v-model="wideOpened" title="Wide sheet" max-width="60rem">
|
|
189
|
-
<p>This sheet is constrained to 60rem on desktop and full-width on mobile.</p>
|
|
190
|
-
</MazBottomSheet>
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
</template>
|
|
194
|
-
</ComponentDemo>
|
|
195
|
-
|
|
196
|
-
## Without header
|
|
197
|
-
|
|
198
|
-
Hide the whole header with `hide-header`, or only the close button with `hide-close-button`.
|
|
199
|
-
|
|
200
|
-
<ComponentDemo>
|
|
201
|
-
<MazBtn @click="noHeaderOpened = true">Open without header</MazBtn>
|
|
202
|
-
|
|
203
|
-
<MazBottomSheet v-model="noHeaderOpened" hide-header>
|
|
204
|
-
<div class="maz:flex maz:flex-col maz:gap-3 maz:text-center">
|
|
205
|
-
<p>No header here, you control the whole layout.</p>
|
|
206
|
-
<MazBtn @click="noHeaderOpened = false">Got it</MazBtn>
|
|
207
|
-
</div>
|
|
208
|
-
</MazBottomSheet>
|
|
209
|
-
|
|
210
|
-
<template #code>
|
|
211
|
-
|
|
212
|
-
```html
|
|
213
|
-
<MazBottomSheet v-model="noHeaderOpened" hide-header>
|
|
214
|
-
<div class="maz:flex maz:flex-col maz:gap-3 maz:text-center">
|
|
215
|
-
<p>No header here, you control the whole layout.</p>
|
|
216
|
-
<MazBtn @click="noHeaderOpened = false">Got it</MazBtn>
|
|
217
|
-
</div>
|
|
218
|
-
</MazBottomSheet>
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
</template>
|
|
222
|
-
</ComponentDemo>
|
|
223
|
-
|
|
224
|
-
## Persistent
|
|
225
|
-
|
|
226
|
-
A `persistent` sheet cannot be closed by clicking outside or pressing escape, and the close button is removed. Provide your own action to close it.
|
|
227
|
-
|
|
228
|
-
<ComponentDemo>
|
|
229
|
-
<MazBtn @click="persistentOpened = true">Open persistent sheet</MazBtn>
|
|
230
|
-
|
|
231
|
-
<MazBottomSheet v-model="persistentOpened" title="Action required" icon="/exclamation-triangle.svg" persistent>
|
|
232
|
-
<p>You must confirm before closing this sheet.</p>
|
|
233
|
-
<template #footer>
|
|
234
|
-
<MazBtn @click="persistentOpened = false">I understand</MazBtn>
|
|
235
|
-
</template>
|
|
236
|
-
</MazBottomSheet>
|
|
237
|
-
|
|
238
|
-
<template #code>
|
|
239
|
-
|
|
240
|
-
```html
|
|
241
|
-
<MazBottomSheet v-model="persistentOpened" title="Action required" persistent>
|
|
242
|
-
<p>You must confirm before closing this sheet.</p>
|
|
243
|
-
|
|
244
|
-
<template #footer>
|
|
245
|
-
<MazBtn @click="persistentOpened = false">I understand</MazBtn>
|
|
246
|
-
</template>
|
|
247
|
-
</MazBottomSheet>
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
</template>
|
|
251
|
-
</ComponentDemo>
|
|
252
|
-
|
|
253
|
-
## Full example
|
|
254
|
-
|
|
255
|
-
<ComponentDemo expanded>
|
|
256
|
-
<div class="maz:flex maz:flex-col maz:gap-4">
|
|
257
|
-
<MazCard>
|
|
258
|
-
<template #title>
|
|
259
|
-
<div class="maz:flex maz:items-center maz:gap-3">
|
|
260
|
-
<MazAvatar src="https://images.unsplash.com/photo-1542291026-7eec264c27ff?w=100" size="lg" />
|
|
261
|
-
<div>
|
|
262
|
-
<h3 class="maz:text-lg maz:font-semibold">Nike Air Max</h3>
|
|
263
|
-
<p class="maz:text-muted maz:text-sm">Premium Running Shoes</p>
|
|
264
|
-
</div>
|
|
265
|
-
</div>
|
|
266
|
-
</template>
|
|
267
|
-
<div class="maz:space-y-4">
|
|
268
|
-
<div class="maz:flex maz:items-center maz:justify-between">
|
|
269
|
-
<span class="maz:font-medium">Price:</span>
|
|
270
|
-
<span class="maz:text-xl maz:font-bold maz:text-primary">$129.99</span>
|
|
271
|
-
</div>
|
|
272
|
-
<div class="maz:flex maz:gap-2">
|
|
273
|
-
<MazBtn color="primary" @click="openProductOptions">
|
|
274
|
-
<MazIcon icon="/cog.svg" class="maz:me-2" />
|
|
275
|
-
Customize Options
|
|
276
|
-
</MazBtn>
|
|
277
|
-
<MazBtn color="secondary" @click="openUserSettings">
|
|
278
|
-
<MazIcon icon="/user.svg" class="maz:me-2" />
|
|
279
|
-
Profile Settings
|
|
280
|
-
</MazBtn>
|
|
281
|
-
</div>
|
|
282
|
-
</div>
|
|
283
|
-
</MazCard>
|
|
284
|
-
<MazCard v-if="selectedOptions.size || selectedOptions.color" class="maz:bg-secondary/10">
|
|
285
|
-
<template #title>Selected Options</template>
|
|
286
|
-
<div class="maz:flex maz:gap-4">
|
|
287
|
-
<MazBadge v-if="selectedOptions.size" color="info">
|
|
288
|
-
Size: {{ selectedOptions.size }}
|
|
289
|
-
</MazBadge>
|
|
290
|
-
<MazBadge v-if="selectedOptions.color" color="success">
|
|
291
|
-
Color: {{ selectedOptions.color }}
|
|
292
|
-
</MazBadge>
|
|
293
|
-
<MazBadge v-if="quantity > 1" color="warning">
|
|
294
|
-
Qty: {{ quantity }}
|
|
295
|
-
</MazBadge>
|
|
296
|
-
</div>
|
|
297
|
-
</MazCard>
|
|
298
|
-
</div>
|
|
299
|
-
<MazBottomSheet v-model="isProductOpen" title="Customize Your Shoes" icon="/cog.svg" :padding="false">
|
|
300
|
-
<div class="maz:space-y-6 maz:p-6">
|
|
301
|
-
<div>
|
|
302
|
-
<h4 class="maz:text-lg maz:font-semibold maz:mb-3">Select Size</h4>
|
|
303
|
-
<div class="maz:grid maz:grid-cols-4 maz:gap-2">
|
|
304
|
-
<MazBtn
|
|
305
|
-
v-for="size in sizes"
|
|
306
|
-
:key="size"
|
|
307
|
-
:color="selectedOptions.size === size ? 'primary' : 'secondary'"
|
|
308
|
-
size="sm"
|
|
309
|
-
@click="selectedOptions.size = size"
|
|
310
|
-
>
|
|
311
|
-
{{ size }}
|
|
312
|
-
</MazBtn>
|
|
313
|
-
</div>
|
|
314
|
-
</div>
|
|
315
|
-
<div>
|
|
316
|
-
<h4 class="maz:text-lg maz:font-semibold maz:mb-3">Select Color</h4>
|
|
317
|
-
<div class="maz:grid maz:grid-cols-3 maz:gap-3">
|
|
318
|
-
<div
|
|
319
|
-
v-for="color in colors"
|
|
320
|
-
:key="color.name"
|
|
321
|
-
class="maz:flex maz:flex-col maz:items-center maz:cursor-pointer maz:p-3 maz:rounded-lg maz:border-2 maz:transition-all"
|
|
322
|
-
:class="selectedOptions.color === color.name ? 'maz:border-primary maz:bg-primary/10' : 'maz:border-divider maz:hover:border-primary/50'"
|
|
323
|
-
@click="selectedOptions.color = color.name"
|
|
324
|
-
>
|
|
325
|
-
<div
|
|
326
|
-
class="maz:w-8 maz:h-8 maz:rounded-full maz:mb-2"
|
|
327
|
-
:style="{ backgroundColor: color.value }"
|
|
328
|
-
/>
|
|
329
|
-
<span class="maz:text-sm maz:font-medium">{{ color.name }}</span>
|
|
330
|
-
</div>
|
|
331
|
-
</div>
|
|
332
|
-
</div>
|
|
333
|
-
<div>
|
|
334
|
-
<MazInputNumber
|
|
335
|
-
v-model="quantity"
|
|
336
|
-
label="Quantity"
|
|
337
|
-
:min="1"
|
|
338
|
-
:max="10"
|
|
339
|
-
/>
|
|
340
|
-
</div>
|
|
341
|
-
</div>
|
|
342
|
-
<template #footer="{ close }">
|
|
343
|
-
<MazBtn color="transparent" @click="close">Cancel</MazBtn>
|
|
344
|
-
<MazBtn color="primary" @click="addToCart">
|
|
345
|
-
<MazIcon icon="/shopping-cart.svg" class="maz:me-2" />
|
|
346
|
-
Add to Cart (${{ (129.99 * quantity).toFixed(2) }})
|
|
347
|
-
</MazBtn>
|
|
348
|
-
</template>
|
|
349
|
-
</MazBottomSheet>
|
|
350
|
-
|
|
351
|
-
<MazBottomSheet v-model="isUserOpen" title="Profile Settings" icon="/user.svg" max-width="48rem" :padding="false">
|
|
352
|
-
<div class="maz:space-y-6 maz:p-6">
|
|
353
|
-
<div class="maz:flex maz:items-center maz:gap-4 maz:p-4 maz:bg-secondary/10 maz:rounded-lg">
|
|
354
|
-
<MazAvatar src="https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?w=100" size="xl" />
|
|
355
|
-
<div>
|
|
356
|
-
<h4 class="maz:font-semibold">John Doe</h4>
|
|
357
|
-
<p class="maz:text-muted maz:text-sm">john.doe@example.com</p>
|
|
358
|
-
<MazBadge color="success" size="xs">Premium Member</MazBadge>
|
|
359
|
-
</div>
|
|
360
|
-
</div>
|
|
361
|
-
<div class="maz:flex maz:gap-4 maz:items-start">
|
|
362
|
-
<MazInput
|
|
363
|
-
v-model="userForm.name"
|
|
364
|
-
label="Full Name"
|
|
365
|
-
placeholder="Enter your name"
|
|
366
|
-
/>
|
|
367
|
-
<MazInput
|
|
368
|
-
v-model="userForm.email"
|
|
369
|
-
label="Email"
|
|
370
|
-
type="email"
|
|
371
|
-
placeholder="Enter your email"
|
|
372
|
-
/>
|
|
373
|
-
<MazSelect
|
|
374
|
-
v-model="userForm.country"
|
|
375
|
-
label="Country"
|
|
376
|
-
:options="countries"
|
|
377
|
-
placeholder="Select your country"
|
|
378
|
-
/>
|
|
379
|
-
</div>
|
|
380
|
-
<div class="maz:flex maz:gap-4">
|
|
381
|
-
<div class="maz:flex maz:items-center maz:justify-between maz:p-4 maz:border maz:border-divider maz:rounded-lg">
|
|
382
|
-
<div>
|
|
383
|
-
<p class="maz:font-medium">Email Notifications</p>
|
|
384
|
-
<p class="maz:text-sm maz:text-muted">Receive updates about your orders</p>
|
|
385
|
-
</div>
|
|
386
|
-
<MazSwitch v-model="userForm.notifications" />
|
|
387
|
-
</div>
|
|
388
|
-
<div class="maz:flex maz:items-center maz:justify-between maz:p-4 maz:border maz:border-divider maz:rounded-lg">
|
|
389
|
-
<div>
|
|
390
|
-
<p class="maz:font-medium">Dark Mode</p>
|
|
391
|
-
<p class="maz:text-sm maz:text-muted">Switch to dark theme</p>
|
|
392
|
-
</div>
|
|
393
|
-
<MazSwitch v-model="userForm.darkMode" />
|
|
394
|
-
</div>
|
|
395
|
-
</div>
|
|
396
|
-
</div>
|
|
397
|
-
<template #footer="{ close }">
|
|
398
|
-
<MazBtn color="transparent" @click="close">Cancel</MazBtn>
|
|
399
|
-
<MazBtn color="primary" @click="saveSettings">
|
|
400
|
-
<MazIcon icon="/check.svg" class="maz:me-2" />
|
|
401
|
-
Save Changes
|
|
402
|
-
</MazBtn>
|
|
403
|
-
</template>
|
|
404
|
-
</MazBottomSheet>
|
|
405
|
-
|
|
406
|
-
<template #code>
|
|
407
|
-
|
|
408
|
-
```vue
|
|
409
|
-
<script setup>
|
|
410
|
-
import MazBottomSheet from 'maz-ui/components/MazBottomSheet'
|
|
411
|
-
import { reactive, ref } from 'vue'
|
|
412
|
-
|
|
413
|
-
const isProductOpen = ref(false)
|
|
414
|
-
const quantity = ref(1)
|
|
415
|
-
const selectedOptions = reactive({ size: '', color: '' })
|
|
416
|
-
|
|
417
|
-
function openProductOptions() {
|
|
418
|
-
isProductOpen.value = true
|
|
419
|
-
}
|
|
420
|
-
</script>
|
|
421
|
-
|
|
422
|
-
<template>
|
|
423
|
-
<MazBtn color="primary" @click="openProductOptions">
|
|
424
|
-
Customize Options
|
|
425
|
-
</MazBtn>
|
|
426
|
-
|
|
427
|
-
<MazBottomSheet v-model="isProductOpen" title="Customize Your Shoes" icon="/cog.svg" :padding="false">
|
|
428
|
-
<div class="maz:space-y-6 maz:p-6">
|
|
429
|
-
<h4 class="maz:mb-3 maz:text-lg maz:font-semibold">
|
|
430
|
-
Select Size
|
|
431
|
-
</h4>
|
|
432
|
-
<div class="maz:grid maz:grid-cols-4 maz:gap-2">
|
|
433
|
-
<MazBtn
|
|
434
|
-
v-for="size in sizes"
|
|
435
|
-
:key="size"
|
|
436
|
-
:color="selectedOptions.size === size ? 'primary' : 'secondary'"
|
|
437
|
-
size="sm"
|
|
438
|
-
@click="selectedOptions.size = size"
|
|
439
|
-
>
|
|
440
|
-
{{ size }}
|
|
441
|
-
</MazBtn>
|
|
442
|
-
</div>
|
|
443
|
-
</div>
|
|
444
|
-
|
|
445
|
-
<template #footer="{ close }">
|
|
446
|
-
<MazBtn color="transparent" @click="close">
|
|
447
|
-
Cancel
|
|
448
|
-
</MazBtn>
|
|
449
|
-
<MazBtn color="primary" @click="addToCart">
|
|
450
|
-
Add to Cart (${{ (129.99 * quantity).toFixed(2) }})
|
|
451
|
-
</MazBtn>
|
|
452
|
-
</template>
|
|
453
|
-
</MazBottomSheet>
|
|
454
|
-
</template>
|
|
455
|
-
```
|
|
456
|
-
|
|
457
|
-
</template>
|
|
458
|
-
</ComponentDemo>
|
|
459
|
-
|
|
460
|
-
## Accessibility
|
|
461
|
-
|
|
462
|
-
The bottom sheet is a modal `dialog` labelled by its `title` and described by its content. The focus is trapped inside while it is open, <kbd>Esc</kbd> closes it, and the rest of the page is `inert` (except the toasts and the live regions).
|
|
463
|
-
|
|
464
|
-
<!--@include: ./../../.vitepress/generated-docs/maz-bottom-sheet.doc.md-->
|
|
465
|
-
|
|
466
|
-
<script setup>
|
|
467
|
-
import { ref, reactive } from 'vue'
|
|
468
|
-
|
|
469
|
-
const basicOpened = ref(false)
|
|
470
|
-
const swipeOpened = ref(false)
|
|
471
|
-
const iconOpened = ref(false)
|
|
472
|
-
const slotsOpened = ref(false)
|
|
473
|
-
const wideOpened = ref(false)
|
|
474
|
-
const noHeaderOpened = ref(false)
|
|
475
|
-
const persistentOpened = ref(false)
|
|
476
|
-
|
|
477
|
-
const isProductOpen = ref(false)
|
|
478
|
-
const isUserOpen = ref(false)
|
|
479
|
-
const quantity = ref(1)
|
|
480
|
-
|
|
481
|
-
const selectedOptions = reactive({
|
|
482
|
-
size: '',
|
|
483
|
-
color: ''
|
|
484
|
-
})
|
|
485
|
-
|
|
486
|
-
const userForm = reactive({
|
|
487
|
-
name: 'John Doe',
|
|
488
|
-
email: 'john.doe@example.com',
|
|
489
|
-
country: 'US',
|
|
490
|
-
notifications: true,
|
|
491
|
-
darkMode: false
|
|
492
|
-
})
|
|
493
|
-
|
|
494
|
-
const sizes = ['7', '8', '9', '10', '11', '12']
|
|
495
|
-
const colors = [
|
|
496
|
-
{ name: 'Black', value: '#000000' },
|
|
497
|
-
{ name: 'White', value: '#FFFFFF' },
|
|
498
|
-
{ name: 'Red', value: '#EF4444' },
|
|
499
|
-
{ name: 'Blue', value: '#3B82F6' },
|
|
500
|
-
{ name: 'Green', value: '#10B981' },
|
|
501
|
-
{ name: 'Purple', value: '#8B5CF6' }
|
|
502
|
-
]
|
|
503
|
-
|
|
504
|
-
const countries = [
|
|
505
|
-
{ label: 'United States', value: 'US' },
|
|
506
|
-
{ label: 'Canada', value: 'CA' },
|
|
507
|
-
{ label: 'United Kingdom', value: 'UK' },
|
|
508
|
-
{ label: 'France', value: 'FR' },
|
|
509
|
-
{ label: 'Germany', value: 'DE' }
|
|
510
|
-
]
|
|
511
|
-
|
|
512
|
-
function openProductOptions() {
|
|
513
|
-
isProductOpen.value = true
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
function openUserSettings() {
|
|
517
|
-
isUserOpen.value = true
|
|
518
|
-
}
|
|
519
|
-
|
|
520
|
-
function addToCart() {
|
|
521
|
-
if (!selectedOptions.size || !selectedOptions.color) {
|
|
522
|
-
alert('Please select size and color first!')
|
|
523
|
-
return
|
|
524
|
-
}
|
|
525
|
-
alert(`Added ${quantity.value} ${selectedOptions.color} shoes (size ${selectedOptions.size}) to cart!`)
|
|
526
|
-
isProductOpen.value = false
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
function saveSettings() {
|
|
530
|
-
alert('Settings saved successfully!')
|
|
531
|
-
isUserOpen.value = false
|
|
532
|
-
}
|
|
533
|
-
</script>
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: MazCardSpotlight
|
|
3
|
-
description: MazCardSpotlight is a standalone component
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# {{ $frontmatter.title }}
|
|
7
|
-
|
|
8
|
-
{{ $frontmatter.description }}
|
|
9
|
-
|
|
10
|
-
<!--@include: ./../../.vitepress/mixins/getting-started.md-->
|
|
11
|
-
|
|
12
|
-
**This component is better in dark mode**
|
|
13
|
-
|
|
14
|
-
<MazBtn @click="setColorMode('dark')" color="warning">
|
|
15
|
-
Switch to dark theme
|
|
16
|
-
</MazBtn>
|
|
17
|
-
|
|
18
|
-
::: tip
|
|
19
|
-
If you want to increase the border width, you must just add padding @default: `var(--maz-border-width)` (1px)
|
|
20
|
-
:::
|
|
21
|
-
|
|
22
|
-
## Basic usage
|
|
23
|
-
|
|
24
|
-
<ComponentDemo>
|
|
25
|
-
<MazCardSpotlight style="width: 500px; max-width: 100%;">
|
|
26
|
-
<h3 style="margin-top: 0; margin-bottom: 30px;">
|
|
27
|
-
Hover this component <br />
|
|
28
|
-
To see the magic appear
|
|
29
|
-
</h3>
|
|
30
|
-
<div class="maz:flex maz:gap-2">
|
|
31
|
-
<MazBtn color="contrast" @click="setColorMode('light')">
|
|
32
|
-
Switch to light mode
|
|
33
|
-
</MazBtn>
|
|
34
|
-
<MazBtn color="contrast" @click="setColorMode('dark')">
|
|
35
|
-
Switch to dark mode
|
|
36
|
-
</MazBtn>
|
|
37
|
-
</div>
|
|
38
|
-
</MazCardSpotlight>
|
|
39
|
-
|
|
40
|
-
<template #code>
|
|
41
|
-
|
|
42
|
-
```vue
|
|
43
|
-
<script lang="ts" setup>
|
|
44
|
-
import { useTheme } from '@maz-ui/themes/composables/useTheme'
|
|
45
|
-
import MazCardSpotlight from 'maz-ui/components/MazCardSpotlight'
|
|
46
|
-
|
|
47
|
-
const { setColorMode } = useTheme()
|
|
48
|
-
</script>
|
|
49
|
-
|
|
50
|
-
<template>
|
|
51
|
-
<MazCardSpotlight style="width: 500px; max-width: 100%;">
|
|
52
|
-
<h3 style="margin-top: 0; Fmargin-bottom: 30px;">
|
|
53
|
-
Hover this component <br>
|
|
54
|
-
To see the magic appear
|
|
55
|
-
</h3>
|
|
56
|
-
<MazBtn color="contrast" @click="setColorMode('light')">
|
|
57
|
-
Switch to light theme
|
|
58
|
-
</MazBtn>
|
|
59
|
-
</MazCardSpotlight>
|
|
60
|
-
</template>
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
</template>
|
|
64
|
-
</ComponentDemo>
|
|
65
|
-
|
|
66
|
-
## Effect with multiple cards and with secondary color
|
|
67
|
-
|
|
68
|
-
<ComponentDemo>
|
|
69
|
-
<div class="maz:grid maz:gap-4 maz:grid-cols-1 maz:mob-l:grid-cols-2 maz:tab-l:grid-cols-3">
|
|
70
|
-
<MazCardSpotlight v-for="competition of competitions" :key="competition.label" color="secondary">
|
|
71
|
-
<div style="display: flex;">
|
|
72
|
-
<MazAvatar
|
|
73
|
-
v-if="competition.areaEnsignUrl"
|
|
74
|
-
:src="competition.areaEnsignUrl"
|
|
75
|
-
style="margin-right: 16px;"
|
|
76
|
-
size="0.8rem"
|
|
77
|
-
/>
|
|
78
|
-
<div style="display: flex; flex-direction: column;" class="maz:truncate">
|
|
79
|
-
<span class="maz:truncate">
|
|
80
|
-
{{ competition.label }}
|
|
81
|
-
</span>
|
|
82
|
-
<span class="maz:truncate">
|
|
83
|
-
{{ competition.area }}
|
|
84
|
-
</span>
|
|
85
|
-
</div>
|
|
86
|
-
</div>
|
|
87
|
-
</MazCardSpotlight>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
<template #code>
|
|
91
|
-
|
|
92
|
-
```html
|
|
93
|
-
<div class="grid gap-4 grid-cols-1 mob-l:grid-cols-2 tab-l:grid-cols-3">
|
|
94
|
-
<MazCardSpotlight v-for="competition of competitions" :key="competition.label" color="secondary">
|
|
95
|
-
<div class="flex p-4">
|
|
96
|
-
<MazAvatar
|
|
97
|
-
v-if="competition.areaEnsignUrl"
|
|
98
|
-
:src="competition.areaEnsignUrl"
|
|
99
|
-
style="margin-right: 16px"
|
|
100
|
-
size="0.8rem"
|
|
101
|
-
/>
|
|
102
|
-
<div class="truncate flex column">
|
|
103
|
-
<span class="truncate"> {{ competition.label }} </span>
|
|
104
|
-
<span class="truncate"> {{ competition.area }} </span>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
</MazCardSpotlight>
|
|
108
|
-
</div>
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
</template>
|
|
112
|
-
</ComponentDemo>
|
|
113
|
-
|
|
114
|
-
<!--@include: ./../../.vitepress/generated-docs/maz-card-spotlight.doc.md-->
|
|
115
|
-
|
|
116
|
-
<script lang="ts" setup>
|
|
117
|
-
import { useTheme } from '@maz-ui/themes/composables/useTheme'
|
|
118
|
-
|
|
119
|
-
const { setColorMode } = useTheme()
|
|
120
|
-
|
|
121
|
-
const competitions = [
|
|
122
|
-
{
|
|
123
|
-
label: "Ligue 1",
|
|
124
|
-
area: "France",
|
|
125
|
-
areaEnsignUrl: "https://upload.wikimedia.org/wikipedia/en/c/c3/Flag_of_France.svg",
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
label: "Premier League",
|
|
129
|
-
area: "England",
|
|
130
|
-
areaEnsignUrl: "https://crests.football-data.org/770.svg",
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
label: "Bundesliga",
|
|
134
|
-
area: "Germany",
|
|
135
|
-
areaEnsignUrl: "https://upload.wikimedia.org/wikipedia/commons/b/ba/Flag_of_Germany.svg",
|
|
136
|
-
},
|
|
137
|
-
{
|
|
138
|
-
label: "Eredivisie",
|
|
139
|
-
area: "Netherlands",
|
|
140
|
-
areaEnsignUrl: "https://upload.wikimedia.org/wikipedia/commons/2/20/Flag_of_the_Netherlands.svg",
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
label: "Serie A",
|
|
144
|
-
area: "Italy",
|
|
145
|
-
areaEnsignUrl: "https://upload.wikimedia.org/wikipedia/en/0/03/Flag_of_Italy.svg",
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
label: "Primera Division",
|
|
149
|
-
area: "Spain",
|
|
150
|
-
areaEnsignUrl: "https://upload.wikimedia.org/wikipedia/en/9/9a/Flag_of_Spain.svg",
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
label: "Primeira Liga",
|
|
154
|
-
area: "Portugal",
|
|
155
|
-
areaEnsignUrl: "https://upload.wikimedia.org/wikipedia/commons/5/5c/Flag_of_Portugal.svg",
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
label: "UEFA Champions League",
|
|
159
|
-
area: "Europe",
|
|
160
|
-
areaEnsignUrl: "https://crests.football-data.org/EUR.svg",
|
|
161
|
-
}
|
|
162
|
-
]
|
|
163
|
-
</script>
|