docs : page playground Modal (#MUI-36)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-26 08:48:21 +02:00
parent ab2810118f
commit 3e01c4ca28
2 changed files with 72 additions and 0 deletions
@@ -0,0 +1,71 @@
<script setup lang="ts">
import { ref } from 'vue'
const modalBase = ref(false)
const modalForm = ref(false)
const modalLong = ref(false)
const modalNoDismiss = ref(false)
</script>
<template>
<div class="grid grid-cols-1 items-start gap-6 md:grid-cols-2">
<div class="rounded-lg border p-6">
<h2 class="mb-6 text-xl font-bold">Modal simple</h2>
<MalioButton label="Ouvrir" @click="modalBase = true" />
<MalioModal v-model="modalBase">
<template #header>
<h2 class="text-[24px] font-bold text-black">Détails</h2>
</template>
<p class="text-m-text">Contenu de la modal. Échap, clic backdrop et croix la ferment.</p>
</MalioModal>
</div>
<div class="rounded-lg border p-6">
<h2 class="mb-6 text-xl font-bold">Avec footer d'actions</h2>
<MalioButton label="Ouvrir le formulaire" variant="tertiary" @click="modalForm = true" />
<MalioModal v-model="modalForm" modal-class="max-w-lg">
<template #header>
<h2 class="text-[24px] font-bold text-black">Nouveau contact</h2>
</template>
<div class="flex flex-col gap-4 py-2">
<MalioInputText label="Nom" />
<MalioInputText label="Prénom" />
<MalioInputText label="Email" />
</div>
<template #footer>
<MalioButton label="Annuler" variant="secondary" button-class="flex-1" @click="modalForm = false" />
<MalioButton label="Enregistrer" button-class="flex-1" @click="modalForm = false" />
</template>
</MalioModal>
</div>
<div class="rounded-lg border p-6">
<h2 class="mb-6 text-xl font-bold">Contenu long (body scrollable)</h2>
<MalioButton label="Ouvrir" variant="tertiary" @click="modalLong = true" />
<MalioModal v-model="modalLong">
<template #header>
<h2 class="text-[24px] font-bold text-black">Conditions</h2>
</template>
<div class="flex flex-col gap-4">
<p v-for="n in 20" :key="n" class="text-m-text">
Paragraphe {{ n }} contenu long pour forcer le scroll interne ; le header et le footer restent fixes.
</p>
</div>
<template #footer>
<MalioButton label="Accepter" button-class="w-full" @click="modalLong = false" />
</template>
</MalioModal>
</div>
<div class="rounded-lg border p-6">
<h2 class="mb-6 text-xl font-bold">Non dismissable (croix uniquement)</h2>
<MalioButton label="Ouvrir" variant="danger" @click="modalNoDismiss = true" />
<MalioModal v-model="modalNoDismiss" :dismissable="false" :close-on-escape="false">
<template #header>
<h2 class="text-[24px] font-bold text-black">Action requise</h2>
</template>
<p class="text-m-text">Ni le backdrop ni Échap ne ferment cette modal. Utilisez la croix.</p>
</MalioModal>
</div>
</div>
</template>
+1
View File
@@ -52,6 +52,7 @@ export const navSections: SidebarSection[] = [
items: [
{label: 'Sidebar', to: '/composant/sidebar/sidebar'},
{label: 'Drawer', to: '/composant/drawer/drawer'},
{label: 'Modal', to: '/composant/modal/modal'},
{label: 'Onglets', to: '/composant/tab/tabList'},
],
},