-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs(web-react): Add TextArea demo #DS-912
- TextArea demo in web-react is now same as demo in web and web-twig
- Loading branch information
1 parent
f126dca
commit 7bf400a
Showing
15 changed files
with
150 additions
and
135 deletions.
There are no files selected for viewing
16 changes: 0 additions & 16 deletions
16
packages/web-react/src/components/TextArea/demo/TextArea.tsx
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/web-react/src/components/TextArea/demo/TextAreaAutoResize.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import TextArea from '../TextArea'; | ||
|
||
const TextAreaAutoResize = () => { | ||
return <TextArea id="textareaAutoResize" label="Label" name="textareaAutoResize" isAutoResizing />; | ||
}; | ||
|
||
export default TextAreaAutoResize; |
12 changes: 12 additions & 0 deletions
12
packages/web-react/src/components/TextArea/demo/TextAreaDefault.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
import TextArea from '../TextArea'; | ||
|
||
const TextAreaDefault = () => ( | ||
<> | ||
<TextArea id="textareaDefault" label="Label" name="textareaDefault" placeholder="Placeholder" /> | ||
|
||
<TextArea id="textareaFilled" label="Label" name="textareaFilled" placeholder="Placeholder" value="Filled" /> | ||
</> | ||
); | ||
|
||
export default TextAreaDefault; |
23 changes: 12 additions & 11 deletions
23
packages/web-react/src/components/TextArea/demo/TextAreaDisabled.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,20 @@ | ||
import React from 'react'; | ||
import TextArea from '../TextArea'; | ||
|
||
// @see: https://github.com/storybookjs/storybook/issues/8104#issuecomment-932310244 | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const Story = (props: unknown) => ( | ||
<div style={{ display: 'flex', flexWrap: 'wrap', gap: '1.5rem 1rem' }}> | ||
<TextArea id="textarea-disabled" label="Disabled" name="textarea-disabled" isDisabled /> | ||
const TextAreaDisabled = () => ( | ||
<> | ||
<TextArea id="textareaDisabled" label="Label" name="textareaDisabled" placeholder="Placeholder" isDisabled /> | ||
|
||
<TextArea | ||
id="textarea-disabled-filled" | ||
label="Disabled filled" | ||
name="textarea-disabled-filled" | ||
value="TextArea value" | ||
id="textareaDisabledFilled" | ||
label="Label" | ||
name="textareaDisabledFilled" | ||
placeholder="Placeholder" | ||
value="Filled" | ||
isDisabled | ||
isRequired | ||
/> | ||
</div> | ||
</> | ||
); | ||
|
||
export default Story; | ||
export default TextAreaDisabled; |
8 changes: 4 additions & 4 deletions
8
packages/web-react/src/components/TextArea/demo/TextAreaFluid.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
import React from 'react'; | ||
import TextArea from '../TextArea'; | ||
|
||
// @see: https://github.com/storybookjs/storybook/issues/8104#issuecomment-932310244 | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const Story = (props: unknown) => <TextArea id="textarea-fluid" label="Fluid" name="textarea-fluid" isFluid />; | ||
const TextAreaFluid = () => ( | ||
<TextArea id="textareaFluid" isFluid label="Label" name="textareaFluid" placeholder="Placeholder" value="Filled" /> | ||
); | ||
|
||
export default Story; | ||
export default TextAreaFluid; |
24 changes: 10 additions & 14 deletions
24
packages/web-react/src/components/TextArea/demo/TextAreaHelperText.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,14 @@ | ||
// Because there is no `dist` directory during the CI run | ||
/* eslint-disable import/no-extraneous-dependencies, import/extensions, import/no-unresolved */ | ||
import React from 'react'; | ||
import { ComponentStory } from '@storybook/react'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
// @ts-ignore: No declaration file | ||
import { SpiritTextAreaProps } from '../../../types'; | ||
import TextArea from '../TextArea'; | ||
|
||
const Story: ComponentStory<typeof TextArea> = (args: SpiritTextAreaProps) => <TextArea {...args} />; | ||
const TextAreaHelperText = () => ( | ||
<TextArea | ||
helperText="Helper text" | ||
id="textareaHelperText" | ||
label="Label" | ||
name="textareaHelperText" | ||
placeholder="Placeholder" | ||
/> | ||
); | ||
|
||
Story.args = { | ||
id: 'textarea-helper-text-example', | ||
label: 'Label with helper text', | ||
helperText: 'Custom helper text', | ||
}; | ||
|
||
export default Story; | ||
export default TextAreaHelperText; |
8 changes: 8 additions & 0 deletions
8
packages/web-react/src/components/TextArea/demo/TextAreaHiddenLabel.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
import TextArea from '../TextArea'; | ||
|
||
const TextAreaHiddenLabel = () => ( | ||
<TextArea id="textareaHiddenLabel" label="Label" name="textareaHiddenLabel" placeholder="Placeholder" isLabelHidden /> | ||
); | ||
|
||
export default TextAreaHiddenLabel; |
19 changes: 19 additions & 0 deletions
19
packages/web-react/src/components/TextArea/demo/TextAreaInline.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { Button } from '../../Button'; | ||
import TextArea from '../TextArea'; | ||
|
||
const TextAreaInline = () => ( | ||
<div style={{ display: 'flex', gap: '1rem', alignItems: 'flex-start' }}> | ||
<TextArea | ||
id="textareaInline" | ||
isLabelHidden | ||
label="Hidden Label" | ||
name="textareaInline" | ||
placeholder="Placeholder" | ||
value="Filled" | ||
/> | ||
<Button>Button</Button> | ||
</div> | ||
); | ||
|
||
export default TextAreaInline; |
10 changes: 0 additions & 10 deletions
10
packages/web-react/src/components/TextArea/demo/TextAreaInputHeight.tsx
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
packages/web-react/src/components/TextArea/demo/TextAreaLabelHidden.tsx
This file was deleted.
Oops, something went wrong.
8 changes: 3 additions & 5 deletions
8
packages/web-react/src/components/TextArea/demo/TextAreaRequired.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
import React from 'react'; | ||
import TextArea from '../TextArea'; | ||
|
||
// @see: https://github.com/storybookjs/storybook/issues/8104#issuecomment-932310244 | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const Story = (props: unknown) => ( | ||
<TextArea id="textarea-required" label="Required" name="textarea-required" isRequired /> | ||
const TextAreaRequired = () => ( | ||
<TextArea id="textareaRequired" label="Label" name="textareaRequired" placeholder="Placeholder" isRequired /> | ||
); | ||
|
||
export default Story; | ||
export default TextAreaRequired; |
49 changes: 49 additions & 0 deletions
49
packages/web-react/src/components/TextArea/demo/TextAreaValidation.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import TextArea from '../TextArea'; | ||
|
||
const TextAreaValidation = () => ( | ||
<> | ||
<TextArea | ||
id="textareaSuccess" | ||
label="Label" | ||
name="textareaSuccess" | ||
placeholder="Placeholder" | ||
validationState="success" | ||
value="Filled" | ||
/> | ||
|
||
<TextArea | ||
id="textareaWarning" | ||
label="Label" | ||
validationText="Validation text" | ||
name="textareaWarning" | ||
placeholder="Placeholder" | ||
validationState="warning" | ||
value="Filled" | ||
/> | ||
|
||
<TextArea | ||
id="textareaDanger" | ||
label="Label" | ||
validationText={['Validation text', 'Second validation text']} | ||
name="textareaDanger" | ||
placeholder="Placeholder" | ||
validationState="danger" | ||
value="Filled" | ||
/> | ||
|
||
<TextArea | ||
id="textareaDangerHelper" | ||
isRequired | ||
label="Label" | ||
helperText="This is helper text" | ||
validationText="Danger validation text" | ||
validationState="danger" | ||
name="textareaDangerHelper" | ||
placeholder="Placeholder" | ||
value="Filled" | ||
/> | ||
</> | ||
); | ||
|
||
export default TextAreaValidation; |
32 changes: 0 additions & 32 deletions
32
packages/web-react/src/components/TextArea/demo/TextAreaValidationState.tsx
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
packages/web-react/src/components/TextArea/demo/TextAreaWithAutoResize.tsx
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters