This repository has been archived by the owner on Aug 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Heading: Add wordWrap (and other props from Text) (#576)
* Heading: Add wordWrap (and other props from Text) This update enhances the `Heading` component to have similar props as the base `Text` component, including `wordWrap`, `noWrap`, `truncate`, and `lineHeightInherit`. * Improve story for Heading with knobs/artboard example
- Loading branch information
Jon Quach
committed
Apr 16, 2019
1 parent
29d216b
commit 5f7fa8c
Showing
7 changed files
with
169 additions
and
68 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
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
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,70 @@ | ||
import * as React from 'react' | ||
import { storiesOf } from '@storybook/react' | ||
import { boolean, select, text } from '@storybook/addon-knobs' | ||
import { withArtboard } from '@helpscout/artboard' | ||
import Heading from '../src/components/Heading' | ||
|
||
const stories = storiesOf('Heading', module) | ||
stories.addDecorator( | ||
withArtboard({ width: 400, height: 200, withCenterGuides: false }) | ||
) | ||
|
||
stories.add('Default', () => { | ||
const props = { | ||
children: text('children', 'Heading'), | ||
center: boolean('center', false), | ||
disableSelect: boolean('disableSelect', false), | ||
light: boolean('light', false), | ||
linkStyle: boolean('linkStyle', false), | ||
lineHeightInherit: boolean('lineHeightInherit', false), | ||
lineHeightReset: boolean('lineHeightReset', false), | ||
noWrap: boolean('noWrap', false), | ||
size: select( | ||
'size', | ||
{ | ||
h1: 'h1', | ||
h2: 'h2', | ||
h3: 'h3', | ||
h4: 'h4', | ||
h5: 'h5', | ||
h6: 'h6', | ||
}, | ||
'h1' | ||
), | ||
truncate: boolean('truncate', false), | ||
wordWrap: boolean('wordWrap', false), | ||
} | ||
return <Heading {...props} /> | ||
}) | ||
|
||
stories.add('sizes', () => ( | ||
<div> | ||
<Heading size="h1">Font size: h1</Heading> | ||
<br /> | ||
<Heading size="h2">Font size: h2</Heading> | ||
<br /> | ||
<Heading size="h3">Font size: h3</Heading> | ||
<br /> | ||
<Heading size="h4">Font size: h4</Heading> | ||
<br /> | ||
<Heading size="h5">Font size: h5</Heading> | ||
<br /> | ||
<Heading size="h6">Font size: h6</Heading> | ||
<br /> | ||
<Heading size="big">Font size: Big</Heading> | ||
<br /> | ||
<Heading size="small">Font size: Small</Heading> | ||
<br /> | ||
</div> | ||
)) | ||
|
||
stories.add('shades', () => ( | ||
<div> | ||
<Heading size="small">Small Heading Dark</Heading> | ||
<br /> | ||
<Heading size="small" light> | ||
Small Heading Light | ||
</Heading> | ||
<br /> | ||
</div> | ||
)) |
This file was deleted.
Oops, something went wrong.