diff --git a/src/stories/Input.stories.jsx b/src/stories/Input.stories.jsx new file mode 100644 index 0000000..1d3cc0c --- /dev/null +++ b/src/stories/Input.stories.jsx @@ -0,0 +1,53 @@ +import { useState } from "react"; +import TextInput from "../components/ui/input/input.jsx"; + + +export default { + title: 'UI/Input', + component: TextInput, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], + args: { + placeholder: "Placeholder", + borderStyle: "square", + value: "", + onChange: () => {} + }, + argTypes: { + placeholder: { + control: 'text', + description: 'Texte affiché quand le champ est vide.', + }, + borderStyle: { + control: { type: 'select' }, + options: ['square', 'rounded'], + description: 'Style de bordure du champ.', + }, + value: { + control: 'text', + description: 'Valeur actuelle du champ de texte.', + }, + onChange: { + action: 'changed', + description: 'Fonction appelée à chaque changement de valeur.', + }, + }, +}; + +const InputRender = ({ placeholder, borderStyle }) => { + const [value, setValue] = useState(""); + + return
Value: {value}
+