diff --git a/src/stories/Button.stories.js b/src/stories/Button.stories.jsx similarity index 50% rename from src/stories/Button.stories.js rename to src/stories/Button.stories.jsx index 6438e9e..3f86188 100644 --- a/src/stories/Button.stories.js +++ b/src/stories/Button.stories.jsx @@ -2,25 +2,38 @@ import { fn } from 'storybook/test'; import Button from '../components/ui/button/button.jsx'; -// More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export + export default { title: 'UI/Button', component: Button, parameters: { - // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout layout: 'centered', }, - // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs tags: ['autodocs'], - // More on argTypes: https://storybook.js.org/docs/api/argtypes argTypes: { - backgroundColor: { control: 'color' }, + children: { + control: "text", + description: "Texte/Composant à afficher dans le bouton", + }, + variant: { + control: { type: 'select' }, + options: ["primary", "default", "danger", "transparent"], + description: "Style du bouton" + }, + onClick: { + control: "function", + description: "Fonction appelée lors du clique du bouton", + } + }, + + args: { + children: "Button", + variant: "Primary", + onClick: fn() + }, - // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args - args: { onClick: fn() }, }; -// More on writing stories with args: https://storybook.js.org/docs/writing-stories/args export const Primary = { args: { children: "Button", @@ -52,3 +65,11 @@ export const Danger = { onClick: fn(), }, }; + +export const Icon = { + args: { + children: icon, + variant: 'transparent', + onClick: fn(), + } +} \ No newline at end of file