Skip to content

Commit

Permalink
test(slash): fix group textarea stories
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinWeb committed Jan 22, 2025
1 parent 776b15a commit f220345
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 47 deletions.
47 changes: 47 additions & 0 deletions slash/react/src/Form/Textarea/Textarea.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { Canvas, Controls, Meta } from "@storybook/addon-docs";
import * as TextareaStories from "./Textarea.stories";
import * as TextareaInputStories from "./TextareaInput.stories";

<Meta of={TextareaStories} />

1. [Textarea](#textarea)
1. [TextareaInput](#textareainput)

## Textarea

### Import
Expand Down Expand Up @@ -33,3 +37,46 @@ export default TextareaReturn;

<Canvas of={TextareaStories.TextareaStory} />
<Controls of={TextareaStories.TextareaStory} />

## TextareaInput

### Import

```javascript
import { MessageTypes, TextareaInput } from "@axa-fr/design-system-slash-react";
```

### Use

```javascript
const TextareaInputReturn = () => (
<form className="af-form" name="myform">
<TextareaInput
id="uniqueId"
value=""
onChange={(e) => {
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"
/>
</form>
);
export default TextareaInputReturn;
```

<Canvas of={TextareaInputStories.TextareaInputStory} />
<Controls of={TextareaInputStories.TextareaInputStory} />

## 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.

46 changes: 0 additions & 46 deletions slash/react/src/Form/Textarea/TextareaInput.mdx

This file was deleted.

2 changes: 1 addition & 1 deletion slash/react/src/Form/Textarea/TextareaInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { TextareaInput } from "./TextareaInput";

const meta: Meta<typeof TextareaInput> = {
component: TextareaInput,
title: "Components/Form/Input/TextareaInput",
title: "Components/Form/Input/Textarea",
argTypes: { onChange: { action: "onChange" } },
args: { onChange: fn() },
};
Expand Down

0 comments on commit f220345

Please sign in to comment.