DocSpace-buildtools/web/ASC.Web.Storybook/stories/text/body/index.stories.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

2019-06-27 07:18:56 +00:00
import React from 'react';
import { storiesOf } from '@storybook/react';
import { text, boolean, withKnobs, color, number, select } from '@storybook/addon-knobs/react';
2019-06-27 07:18:56 +00:00
import { Text } from 'asc-web-components';
import Section from '../../../.storybook/decorators/section';
2019-06-27 13:29:39 +00:00
import withReadme from 'storybook-readme/with-readme';
import Readme from './README.md';
2019-06-27 07:18:56 +00:00
const textTags = ['p', 'span', 'div'];
2019-06-27 07:18:56 +00:00
storiesOf('Components|Text', module)
.addDecorator(withKnobs)
2019-06-27 13:29:39 +00:00
.addDecorator(withReadme(Readme))
2019-07-01 14:05:28 +00:00
.add('body', () => (
<Section>
<div style={{ width: "100%" }}>
<Text.Body
title={text('title', '')}
as={select('as', textTags , 'p')}
fontSize={number('fontSize', 13)}
fontWeight={number('fontWeight')}
truncate={boolean('truncate', false)}
color={color('color', '#333333')}
backgroundColor={color('backgroundColor', '')}
isBold={boolean('isBold', false)}
isItalic={boolean('isItalic', false)}
isInline={boolean('isInline', false)}
>
{text('Text', 'Sample text Headline')}
</Text.Body>
</div>
2019-07-01 14:05:28 +00:00
</Section>
));