2026-02-03 08:56:11 +00:00
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
|
|
|
import { fn } from '@storybook/test';
|
|
|
|
|
import { ChangeUsernameModal } from './ChangeUsernameModal';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* ChangeUsernameModal - Modal de changement de nom d'utilisateur
|
|
|
|
|
*
|
|
|
|
|
* Modal permettant de changer le nom d'utilisateur avec
|
|
|
|
|
* vérification de disponibilité en temps réel.
|
|
|
|
|
*/
|
|
|
|
|
const meta: Meta<typeof ChangeUsernameModal> = {
|
2026-02-05 13:20:06 +00:00
|
|
|
title: 'Components/Features/Settings/Account/ChangeUsernameModal',
|
2026-02-03 08:56:11 +00:00
|
|
|
component: ChangeUsernameModal,
|
|
|
|
|
parameters: {
|
|
|
|
|
layout: 'centered',
|
|
|
|
|
docs: {
|
|
|
|
|
description: {
|
|
|
|
|
component: 'Modal de changement de nom d\'utilisateur avec vérification.',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
args: {
|
|
|
|
|
onClose: fn(),
|
|
|
|
|
},
|
|
|
|
|
decorators: [
|
|
|
|
|
(Story) => (
|
2026-02-07 14:10:32 +00:00
|
|
|
<div className="bg-background min-h-screen flex items-center justify-center">
|
2026-02-03 08:56:11 +00:00
|
|
|
<Story />
|
|
|
|
|
</div>
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* État par défaut de la modal.
|
|
|
|
|
*/
|
|
|
|
|
export const Default: Story = {
|
|
|
|
|
name: 'Par défaut',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* État de vérification de disponibilité.
|
|
|
|
|
*/
|
|
|
|
|
export const Checking: Story = {
|
|
|
|
|
name: 'Vérification',
|
|
|
|
|
parameters: {
|
|
|
|
|
docs: {
|
|
|
|
|
description: {
|
|
|
|
|
story: 'Spinner pendant la vérification de disponibilité.',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* État nom disponible.
|
|
|
|
|
*/
|
|
|
|
|
export const Available: Story = {
|
|
|
|
|
name: 'Disponible',
|
|
|
|
|
parameters: {
|
|
|
|
|
docs: {
|
|
|
|
|
description: {
|
|
|
|
|
story: 'Indicateur vert quand le nom est disponible.',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|