From b769fc87d00b6368061c5113aedf475188df3eff Mon Sep 17 00:00:00 2001 From: Sivin Varghese <64252451+iamsivin@users.noreply.github.com> Date: Fri, 25 Jun 2021 13:18:24 +0530 Subject: [PATCH] chore: Adds storybook for woot textarea (#2451) * chore: Adds storybook for woot textarea * Review fixes * Minor fixes Co-authored-by: Muhsin Keloth Co-authored-by: Nithin David Thomas <1277421+nithindavid@users.noreply.github.com> --- .../components/Form/TextArea.stories.js | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 app/javascript/widget/components/Form/TextArea.stories.js diff --git a/app/javascript/widget/components/Form/TextArea.stories.js b/app/javascript/widget/components/Form/TextArea.stories.js new file mode 100644 index 000000000..3f47c3323 --- /dev/null +++ b/app/javascript/widget/components/Form/TextArea.stories.js @@ -0,0 +1,51 @@ +import { action } from '@storybook/addon-actions'; +import wootTextArea from './TextArea'; + +export default { + title: 'Components/Form/Text Area', + component: wootTextArea, + argTypes: { + label: { + defaultValue: 'Message', + control: { + type: 'text', + }, + }, + type: { + defaultValue: '', + control: { + type: 'text', + }, + }, + placeholder: { + defaultValue: 'Please enter your message', + control: { + type: 'text', + }, + }, + value: { + defaultValue: 'Lorem ipsum is a placeholder text commonly used', + control: { + type: 'text ,number', + }, + }, + error: { + defaultValue: '', + control: { + type: 'text', + }, + }, + }, +}; + +const Template = (args, { argTypes }) => ({ + props: Object.keys(argTypes), + components: { wootTextArea }, + template: + '', +}); + +export const TextArea = Template.bind({}); +TextArea.args = { + onClick: action('Added'), +};