feat : ajout de state dans les histoires des composants
This commit is contained in:
@@ -1,8 +1,77 @@
|
||||
<template>
|
||||
<Story
|
||||
title="Input/Text"
|
||||
>
|
||||
<MalioInputText/>
|
||||
<Story title="Input/Text">
|
||||
<div class="grid grid-cols-1 gap-6 md:grid-cols-2">
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Simple</h2>
|
||||
<MalioInputText
|
||||
v-model="simpleValue"
|
||||
label="Nom"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Avec hint</h2>
|
||||
<MalioInputText
|
||||
v-model="hintValue"
|
||||
label="Email"
|
||||
hint="Votre adresse email professionnelle"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Désactivé</h2>
|
||||
<MalioInputText
|
||||
v-model="disabledValue"
|
||||
label="Nom"
|
||||
disabled
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Readonly</h2>
|
||||
<MalioInputText
|
||||
v-model="readonlyValue"
|
||||
label="Nom"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Erreur</h2>
|
||||
<MalioInputText
|
||||
v-model="errorValue"
|
||||
label="Email"
|
||||
error="Adresse email invalide"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Succès</h2>
|
||||
<MalioInputText
|
||||
v-model="successValue"
|
||||
label="Email"
|
||||
success="Email valide"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Avec masque (téléphone)</h2>
|
||||
<MalioInputText
|
||||
v-model="maskValue"
|
||||
label="Téléphone"
|
||||
mask="## ## ## ## ##"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="rounded-lg border p-4">
|
||||
<h2 class="mb-4 text-xl font-bold">Avec icône</h2>
|
||||
<MalioInputText
|
||||
v-model="iconValue"
|
||||
label="Recherche"
|
||||
icon-name="mdi:magnify"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Story>
|
||||
</template>
|
||||
|
||||
@@ -196,5 +265,15 @@ largeur.
|
||||
</docs>
|
||||
|
||||
<script setup lang="ts">
|
||||
import {ref} from 'vue'
|
||||
import MalioInputText from '../components/malio/InputText.vue'
|
||||
|
||||
const simpleValue = ref('')
|
||||
const hintValue = ref('')
|
||||
const disabledValue = ref('Jean Dupont')
|
||||
const readonlyValue = ref('Marie Martin')
|
||||
const errorValue = ref('jean@')
|
||||
const successValue = ref('jean@example.com')
|
||||
const maskValue = ref('06 12 34 56 78')
|
||||
const iconValue = ref('')
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user