From 06b478c7e4ae05ef51ad669624dd242bb41dec51 Mon Sep 17 00:00:00 2001 From: Brent Swisher Date: Wed, 26 Feb 2020 11:45:26 -0500 Subject: [PATCH] Add storybook story for the TextAreaControl component --- .../src/textarea-control/stories/index.js | 45 +++++++++++++++++++ storybook/test/__snapshots__/index.js.snap | 30 +++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 packages/components/src/textarea-control/stories/index.js diff --git a/packages/components/src/textarea-control/stories/index.js b/packages/components/src/textarea-control/stories/index.js new file mode 100644 index 00000000000000..64f0d140c6d7c0 --- /dev/null +++ b/packages/components/src/textarea-control/stories/index.js @@ -0,0 +1,45 @@ +/** + * External dependencies + */ +import { boolean, number, text } from '@storybook/addon-knobs'; + +/** + * WordPress dependencies + */ +import { useState } from '@wordpress/element'; + +/** + * Internal dependencies + */ +import TextareaControl from '../'; + +export default { + title: 'Components/TextareaControl', + component: TextareaControl, +}; + +const TextareaControlWithState = ( props ) => { + const [ value, setValue ] = useState(); + + return ( + + ); +}; + +export const _default = () => { + const label = text( 'Label', 'Label Text' ); + const hideLabelFromVision = boolean( 'Hide Label From Vision', false ); + const help = text( 'Help Text', 'Help text to explain the textarea.' ); + const rows = number( 'Rows', 4 ); + const className = text( 'Class Name', '' ); + + return ( + + ); +}; diff --git a/storybook/test/__snapshots__/index.js.snap b/storybook/test/__snapshots__/index.js.snap index d17f24d407078a..3aa1e80d2b0e3f 100644 --- a/storybook/test/__snapshots__/index.js.snap +++ b/storybook/test/__snapshots__/index.js.snap @@ -7993,6 +7993,36 @@ Array [ ] `; +exports[`Storyshots Components/TextareaControl Default 1`] = ` +
+
+ +