import type { Meta, StoryObj } from '@storybook/vue3' import { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowItem, VStepperActions, } from 'vuetify/components' import { ref } from 'vue' const meta: Meta = { title: 'Composants/Composants Vuetify/VStepper', tags: ['!dev'], component: VStepper, parameters: { docs: { source: { transform: (src: string) => src .replace(/VStepper/g, 'v-stepper') .replace(/VStepperHeader/g, 'v-stepper-header') .replace(/VStepperItem/g, 'v-stepper-item') .replace(/VStepperWindow/g, 'v-stepper-window') .replace(/VStepperWindowItem/g, 'v-stepper-window-item') .replace(/VStepperActions/g, 'v-stepper-actions'), }, }, }, argTypes: { color: { control: { type: 'text' }, description: 'Couleur du stepper', }, disabled: { control: { type: 'boolean' }, description: 'Désactive le stepper', }, altLabels: { control: { type: 'boolean' }, description: 'Affiche les labels en dessous des étapes', }, flat: { control: { type: 'boolean' }, description: 'Supprime l\'élévation du stepper', }, hideActions: { control: { type: 'boolean' }, description: 'Masque les boutons d\'action', }, }, } export default meta type Story = StoryObj // Primary export const Primary: Story = { render: args => ({ components: { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowItem, VStepperActions, }, setup() { const step = ref(1) return { args, step } }, template: ` `, }), args: { color: 'primary', }, parameters: { docs: { source: { code: ` `, }, }, }, } export const PrimaryAltLabels: Story = { render: args => ({ components: { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowItem, VStepperActions, }, setup() { const step = ref(2) return { args, step } }, template: ` `, }), args: { color: 'primary', altLabels: true, }, parameters: { docs: { source: { code: ` `, }, }, }, } export const PrimaryFlat: Story = { render: args => ({ components: { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowItem, VStepperActions, }, setup() { const step = ref(3) return { args, step } }, template: ` `, }), args: { color: 'primary', flat: true, }, parameters: { docs: { source: { code: ` `, }, }, }, } export const PrimaryDisabled: Story = { render: args => ({ components: { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowItem, VStepperActions, }, setup() { const step = ref(2) return { args, step } }, template: ` `, }), args: { color: 'primary', disabled: true, }, parameters: { docs: { source: { code: ` `, }, }, }, } export const PrimaryWithIcons: Story = { render: args => ({ components: { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowItem, VStepperActions, }, setup() { const step = ref(2) return { args, step } }, template: ` `, }), args: { color: 'primary', }, parameters: { docs: { source: { code: ` `, }, }, }, } export const PrimaryWithError: Story = { render: args => ({ components: { VStepper, VStepperHeader, VStepperItem, VStepperWindow, VStepperWindowItem, VStepperActions, }, setup() { const step = ref(2) return { args, step } }, template: ` `, }), args: { color: 'primary', }, parameters: { docs: { source: { code: ` `, }, }, }, }