2019-06-27 07:18:56 +00:00
|
|
|
import React from 'react';
|
|
|
|
import { storiesOf } from '@storybook/react';
|
|
|
|
import { text, boolean, withKnobs, select, number } from '@storybook/addon-knobs/react';
|
|
|
|
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
|
|
|
|
2019-06-27 13:29:39 +00:00
|
|
|
const elementType = ['h1','h2','h3','p', 'moduleName', 'mainTitle'];
|
|
|
|
const styleType = ['default','grayBackground','metaInfo'];
|
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))
|
|
|
|
.add('text', () => {
|
2019-06-27 07:18:56 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<Section>
|
|
|
|
<Text
|
|
|
|
elementType={select('elementType', elementType, 'p')}
|
|
|
|
styleType={select('styleType', styleType, 'default')}
|
|
|
|
title={text('title', '')}
|
|
|
|
truncate={boolean('truncate', false)}
|
2019-06-27 13:29:39 +00:00
|
|
|
isDisabled={boolean('isDisabled', false)}
|
2019-06-27 07:18:56 +00:00
|
|
|
>
|
2019-06-27 13:29:39 +00:00
|
|
|
{text('Text', 'Sample text Headline')}
|
2019-06-27 07:18:56 +00:00
|
|
|
</Text>
|
|
|
|
</Section>
|
|
|
|
)});
|