-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Statistic): enhance shorthand props and propTypes (#390)
* fix(README) Update entry about Step * fix(Docs) Update message usage * fix(Statistic) Update docs * fix(Statistic) Lint fix
- Loading branch information
1 parent
e1bbafd
commit a15d37c
Showing
31 changed files
with
256 additions
and
259 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React from 'react' | ||
import { Statistic } from 'stardust' | ||
|
||
const items = [ | ||
{ label: 'Saves', value: '22' }, | ||
{ label: 'Signups', text: true, value: 'Three Thousand' }, | ||
{ label: 'Flights', value: '5' }, | ||
{ label: 'Team Members', value: '42' }, | ||
] | ||
|
||
const Props = () => ( | ||
<div> | ||
<Statistic.Group> | ||
<Statistic label='Saves' value='22' /> | ||
<Statistic label='Signups' value='Three Thousand' text /> | ||
<Statistic label='Flights' value='5' /> | ||
<Statistic label='Team Members' value='42' /> | ||
</Statistic.Group> | ||
|
||
<Statistic.Group items={items} /> | ||
</div> | ||
) | ||
|
||
export default Props |
39 changes: 0 additions & 39 deletions
39
docs/app/Examples/views/Statistic/Content/StatisticValuePropsExample.js
This file was deleted.
Oops, something went wrong.
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,23 @@ | ||
import React from 'react' | ||
|
||
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection' | ||
|
||
const Content = () => ( | ||
<ExampleSection title='Content'> | ||
<ComponentExample | ||
title='Value' | ||
description='A statistic can contain a numeric, icon, image, or text value' | ||
examplePath='views/Statistic/Content/Values' | ||
/> | ||
<ComponentExample examplePath='views/Statistic/Content/Props' /> | ||
|
||
<ComponentExample | ||
title='Label' | ||
description='A statistic can contain a label to help provide context for the presented value' | ||
examplePath='views/Statistic/Content/Labels' | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default Content |
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,23 @@ | ||
import React from 'react' | ||
|
||
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample' | ||
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection' | ||
|
||
const Types = () => ( | ||
<ExampleSection title='Types'> | ||
<ComponentExample | ||
title='Statistic' | ||
description='A statistic can display a value with a label above or below it' | ||
examplePath='views/Statistic/Types/BottomLabel' | ||
/> | ||
<ComponentExample examplePath='views/Statistic/Types/TopLabel' /> | ||
|
||
<ComponentExample | ||
title='Statistic Group' | ||
description='A group of statistics' | ||
examplePath='views/Statistic/Types/Groups' | ||
/> | ||
</ExampleSection> | ||
) | ||
|
||
export default Types |
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
39 changes: 39 additions & 0 deletions
39
docs/app/Examples/views/Statistic/Variations/EvenlyDivided.js
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,39 @@ | ||
import React from 'react' | ||
import { Icon, Image, Statistic } from 'stardust' | ||
|
||
const { Group, Label, Value } = Statistic | ||
|
||
const EvenlyDivided = () => ( | ||
<Group widths='four'> | ||
<Statistic> | ||
<Value>22</Value> | ||
<Label>Saves</Label> | ||
</Statistic> | ||
|
||
<Statistic> | ||
<Value text> | ||
Three | ||
<br />Thousand | ||
</Value> | ||
<Label>Signups</Label> | ||
</Statistic> | ||
|
||
<Statistic> | ||
<Value> | ||
<Icon name='plane' /> | ||
5 | ||
</Value> | ||
<Label>Flights</Label> | ||
</Statistic> | ||
|
||
<Statistic> | ||
<Value> | ||
<Image src='http://semantic-ui.com/images/avatar/small/joe.jpg' className='circular inline' /> | ||
42 | ||
</Value> | ||
<Label>Team Members</Label> | ||
</Statistic> | ||
</Group> | ||
) | ||
|
||
export default EvenlyDivided |
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,6 @@ | ||
import React from 'react' | ||
import { Statistic } from 'stardust' | ||
|
||
const Horizontal = () => <Statistic horizontal value='2,204' label='Views' /> | ||
|
||
export default Horizontal |
12 changes: 12 additions & 0 deletions
12
docs/app/Examples/views/Statistic/Variations/HorizontalGroup.js
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,12 @@ | ||
import React from 'react' | ||
import { Statistic } from 'stardust' | ||
|
||
const items = [ | ||
{ label: 'Views', value: '2,204' }, | ||
{ label: 'Downloads', value: '3,322' }, | ||
{ label: 'Tasks', value: '22' }, | ||
] | ||
|
||
const HorizontalGroup = () => <Statistic.Group horizontal items={items} /> | ||
|
||
export default HorizontalGroup |
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
Oops, something went wrong.