From f220345aec0088279e3f80a8d6734a25f8c959cd Mon Sep 17 00:00:00 2001 From: Martin Stievenart Date: Wed, 22 Jan 2025 15:59:01 +0100 Subject: [PATCH] test(slash): fix group textarea stories --- slash/react/src/Form/Textarea/Textarea.mdx | 47 +++++++++++++++++++ .../react/src/Form/Textarea/TextareaInput.mdx | 46 ------------------ .../Form/Textarea/TextareaInput.stories.tsx | 2 +- 3 files changed, 48 insertions(+), 47 deletions(-) delete mode 100644 slash/react/src/Form/Textarea/TextareaInput.mdx diff --git a/slash/react/src/Form/Textarea/Textarea.mdx b/slash/react/src/Form/Textarea/Textarea.mdx index 99eb82d37..855561c20 100644 --- a/slash/react/src/Form/Textarea/Textarea.mdx +++ b/slash/react/src/Form/Textarea/Textarea.mdx @@ -1,8 +1,12 @@ import { Canvas, Controls, Meta } from "@storybook/addon-docs"; import * as TextareaStories from "./Textarea.stories"; +import * as TextareaInputStories from "./TextareaInput.stories"; +1. [Textarea](#textarea) +1. [TextareaInput](#textareainput) + ## Textarea ### Import @@ -33,3 +37,46 @@ export default TextareaReturn; + +## TextareaInput + +### Import + +```javascript +import { MessageTypes, TextareaInput } from "@axa-fr/design-system-slash-react"; +``` + +### Use + +```javascript +const TextareaInputReturn = () => ( +
+ { + console.log(e); + }} + label="Place type" + name="textareainputName" + rows={6} + cols={60} + helpMessage="Enter the place type" + messageType={MessageTypes.error} + classNameContainerLabel="col-md-2" + classNameContainerInput="col-md-10" + /> + +); +export default TextareaInputReturn; +``` + + + + +## Required + +The component can be required. In that case, the label will be followed by a red asterisk. In order to make the component required, set the `required` prop to `true`. + +Alternatively you can to add to the `classModifier` the value `required`. This behaviour exists to keep backward compatibility but might disapear in the future. + diff --git a/slash/react/src/Form/Textarea/TextareaInput.mdx b/slash/react/src/Form/Textarea/TextareaInput.mdx deleted file mode 100644 index 5c8b8ecf0..000000000 --- a/slash/react/src/Form/Textarea/TextareaInput.mdx +++ /dev/null @@ -1,46 +0,0 @@ -import { Canvas, Controls, Meta } from "@storybook/addon-docs"; -import * as TextareaInputStories from "./TextareaInput.stories"; - - - -## TextareaInput - -### Import - -```javascript -import { MessageTypes, TextareaInput } from "@axa-fr/design-system-slash-react"; -``` - -### Use - -```javascript -const TextareaInputReturn = () => ( -
- { - console.log(e); - }} - label="Place type" - name="textareainputName" - rows={6} - cols={60} - helpMessage="Enter the place type" - messageType={MessageTypes.error} - classNameContainerLabel="col-md-2" - classNameContainerInput="col-md-10" - /> - -); -export default TextareaInputReturn; -``` - - - - -## Required - -The component can be required. In that case, the label will be followed by a red asterisk. In order to make the component required, set the `required` prop to `true`. - -Alternatively you can to add to the `classModifier` the value `required`. This behaviour exists to keep backward compatibility but might disapear in the future. diff --git a/slash/react/src/Form/Textarea/TextareaInput.stories.tsx b/slash/react/src/Form/Textarea/TextareaInput.stories.tsx index f74dc0e63..9effab64e 100644 --- a/slash/react/src/Form/Textarea/TextareaInput.stories.tsx +++ b/slash/react/src/Form/Textarea/TextareaInput.stories.tsx @@ -5,7 +5,7 @@ import { TextareaInput } from "./TextareaInput"; const meta: Meta = { component: TextareaInput, - title: "Components/Form/Input/TextareaInput", + title: "Components/Form/Input/Textarea", argTypes: { onChange: { action: "onChange" } }, args: { onChange: fn() }, };