@cimpress/react-components
Version:
React components to support the MCP styleguide
43 lines • 1.12 kB
JavaScript
import React, { useState } from 'react';
import { TextArea } from '../TextInput';
import { Button } from '../Button';
const meta = {
title: 'Components/TextArea',
component: TextArea,
};
export default meta;
function TextAreaStory(props) {
const [value, setValue] = useState('');
return (React.createElement(TextArea, Object.assign({}, props, { value: value, onChange: e => {
setValue(e.currentTarget.value);
} })));
}
export const Default = {
args: {
label: 'Description',
},
render: TextAreaStory,
};
/** Example of `TextArea` with a placeholder and without a label. */
export const Placeholder = {
args: {
placeholder: 'Description',
},
render: TextAreaStory,
};
export const Rows = {
args: {
label: 'Description',
rows: 10,
},
render: TextAreaStory,
};
/** Example of deprecated `rightAddon` prop. */
export const Addon = {
args: {
label: 'Description',
rightAddon: React.createElement(Button, null, "Button"),
},
render: TextAreaStory,
};
//# sourceMappingURL=TextArea.stories.js.map