-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ac8b04
commit a7bec08
Showing
2 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
import * as React from 'react'; | ||
import { storiesOf } from '@storybook/react'; | ||
import Screener from 'screener-storybook/src/screener'; | ||
import { | ||
Body, | ||
Caption, | ||
Display, | ||
Headline, | ||
LargeTitle, | ||
Subheadline, | ||
Text, | ||
Title1, | ||
Title2, | ||
Title3, | ||
} from '@fluentui/react-text'; | ||
import { FluentProviderDecorator } from '../utilities/index'; | ||
|
||
const ScreenerWrapper = (story: () => React.ReactNode) => ( | ||
<Screener steps={new Screener.Steps().snapshot('normal', { cropTo: '.testWrapper' }).end()}> | ||
<div className="testWrapper" style={{ width: '250px' }}> | ||
{story()} | ||
</div> | ||
</Screener> | ||
); | ||
|
||
storiesOf('react-text Text', module) | ||
.addDecorator(ScreenerWrapper) | ||
.addDecorator(FluentProviderDecorator) | ||
.addStory('Default', () => ( | ||
<> | ||
<p> | ||
<Title3 block>Default</Title3> | ||
<Text>Lorem ipsum dolor sit amet, nullam rhoncus tristique tellus in Portucale.</Text> | ||
</p> | ||
<p> | ||
<Title3 block>No wrapping</Title3> | ||
<Text block wrap={false}> | ||
Lorem ipsum dolor sit amet, nullam rhoncus tristique tellus in Portucale. | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Truncate</Title3> | ||
<Text block wrap={false} truncate> | ||
Lorem ipsum dolor sit amet, nullam rhoncus tristique tellus in Portucale. | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Italic</Title3> | ||
<Text block italic> | ||
Hello, world | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Underline</Title3> | ||
<Text block underline> | ||
Hello, world | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Strikethrough</Title3> | ||
<Text block strikethrough> | ||
Hello, world | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Sizes</Title3> | ||
<Text block size={100}> | ||
100 | ||
</Text> | ||
<Text block size={200}> | ||
200 | ||
</Text> | ||
<Text block size={300}> | ||
300 | ||
</Text> | ||
<Text block size={400}> | ||
400 | ||
</Text> | ||
<Text block size={500}> | ||
500 | ||
</Text> | ||
<Text block size={600}> | ||
600 | ||
</Text> | ||
<Text block size={700}> | ||
700 | ||
</Text> | ||
<Text block size={800}> | ||
800 | ||
</Text> | ||
<Text block size={900}> | ||
900 | ||
</Text> | ||
<Text block size={1000}> | ||
1000 | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Fonts</Title3> | ||
<Text block font="base"> | ||
Base | ||
</Text> | ||
<Text block font="monospace"> | ||
Monospace | ||
</Text> | ||
<Text block font="numeric"> | ||
Numeric | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Weights</Title3> | ||
<Text block weight="regular"> | ||
Regular | ||
</Text> | ||
<Text block weight="medium"> | ||
Medium | ||
</Text> | ||
<Text block weight="semibold"> | ||
Semibold | ||
</Text> | ||
</p> | ||
<p> | ||
<Title3 block>Alignments</Title3> | ||
<Text block align="start"> | ||
Start | ||
</Text> | ||
<Text block align="center"> | ||
Center | ||
</Text> | ||
<Text block align="end"> | ||
End | ||
</Text> | ||
<Text block align="justify"> | ||
Justified lorem ipsum dolor sit amet, nullam rhoncus tristique tellus in Portucale. | ||
</Text> | ||
</p> | ||
</> | ||
)); | ||
|
||
storiesOf('react-text Typography wrappers', module) | ||
.addDecorator(ScreenerWrapper) | ||
.addDecorator(FluentProviderDecorator) | ||
.addStory('Display', () => ( | ||
<> | ||
<Display block>Display</Display> | ||
<LargeTitle block>LargeTitle</LargeTitle> | ||
<Title1 block>Title1</Title1> | ||
<Title2 block>Title2</Title2> | ||
<Title3 block>Title3</Title3> | ||
<Headline block>Headline</Headline> | ||
<Subheadline block>Subheadline</Subheadline> | ||
<Body block>Body</Body> | ||
<Caption block>Caption</Caption> | ||
</> | ||
)); |