-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/list examples #100
Merged
+621
−13
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
6bc782f
add list types examples
kyleturco 3e16840
add content and variations examples
kyleturco 44ddeaa
start transition to ListItem
kyleturco a7d55fa
continue ListItem update
kyleturco 23b7559
finish ListItem upates
kyleturco b1c5c05
add final updates and code cleanup
kyleturco 9815ffe
typo fixes
kyleturco 29e50e4
add list types examples
kyleturco 16dcb04
add content and variations examples
kyleturco 36f302d
continue ListItem update
kyleturco 62f4ab6
add final updates and code cleanup
kyleturco 47f05f7
update image to icon tag
kyleturco b722c70
update item component to handle images better
kyleturco f17a716
update images to faker
kyleturco 895bcf7
update util issue
kyleturco acaf3f6
add very relaxed example
kyleturco e2be907
fix valid-jsdoc rule
levithomason 5d3d604
update to latest ta webapp eslint config
levithomason 065dd73
gracefully handle missing Item image prop
levithomason 6d599fe
inline image return, make linter happy
levithomason File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
docs/app/Examples/elements/List/Content/ListContentExamples.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,42 @@ | ||
import React, {Component} from 'react'; | ||
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'; | ||
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'; | ||
|
||
export default class ListContentExamples extends Component { | ||
render() { | ||
return ( | ||
<ExampleSection title='Content'> | ||
<ComponentExample | ||
title='Item' | ||
description='A list item can contain a set of items' | ||
examplePath='elements/List/Content/ListItemExample' | ||
/> | ||
<ComponentExample | ||
title='Icon' | ||
description='A list item can contain an icon' | ||
examplePath='elements/List/Content/ListIconExample' | ||
/> | ||
<ComponentExample | ||
title='Image' | ||
description='A list can contain an image' | ||
examplePath='elements/List/Content/ListImageExample' | ||
/> | ||
<ComponentExample | ||
title='Link' | ||
description='A list can contain links' | ||
examplePath='elements/List/Content/ListLinkExample' | ||
/> | ||
<ComponentExample | ||
title='Header' | ||
description='A list can contain a header' | ||
examplePath='elements/List/Content/ListHeaderExample' | ||
/> | ||
<ComponentExample | ||
title='Description' | ||
description='A list can contain a description' | ||
examplePath='elements/List/Content/ListDescriptionExample' | ||
/> | ||
</ExampleSection> | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
docs/app/Examples/elements/List/Content/ListDescriptionExample.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,15 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListDescriptionExample extends Component { | ||
render() { | ||
const mapIcon = <i className='map marker icon' />; | ||
|
||
return ( | ||
<List> | ||
<ListItem icon={mapIcon} header='Chicago' description='This city is located in the state of Illinois' /> | ||
<ListItem icon={mapIcon} header='Nashville' description='This city is located in the state of Tennessee' /> | ||
</List> | ||
); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
docs/app/Examples/elements/List/Content/ListHeaderExample.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,14 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListHeaderExample extends Component { | ||
render() { | ||
return ( | ||
<List> | ||
<ListItem header='Chapter 1' description='The chapter in which we meet the characters' /> | ||
<ListItem header='Chapter 2' description='The chapter in which the bad guy is introduced' /> | ||
<ListItem header='Chapter 3' description='Spoiler alert: The chapter in which the good guy wins!'/> | ||
</List> | ||
); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
docs/app/Examples/elements/List/Content/ListIconExample.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,27 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListIconExample extends Component { | ||
render() { | ||
const helpIcon = <i className='help icon' />; | ||
const triangleIcon = <i className='right triangle icon' />; | ||
|
||
return ( | ||
<List> | ||
<ListItem | ||
icon={helpIcon} | ||
header='Floated Icon' | ||
description='This text will always have a left margin so it sits alongside the icon' | ||
/> | ||
<ListItem | ||
icon={triangleIcon} | ||
header='Icon Alignment' | ||
description='Floated icons are by default top aligned' | ||
/> | ||
<ListItem icon={helpIcon}> | ||
This item uses <code>child</code> text, check the code. | ||
</ListItem> | ||
</List> | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/elements/List/Content/ListImageExample.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,18 @@ | ||
import faker from 'faker'; | ||
import React, {Component} from 'react'; | ||
import {List, ListItem, Image} from 'stardust'; | ||
|
||
export default class ListImageExample extends Component { | ||
render() { | ||
const helenAvatar = <Image className='avatar' src={faker.image.internet.avatar()} />; | ||
const christianAvatar = <Image className='avatar' src={faker.image.internet.avatar()} />; | ||
const danielAvatar = <Image className='avatar' src={faker.image.internet.avatar()} />; | ||
return ( | ||
<List> | ||
<ListItem image={helenAvatar} header='Helen' /> | ||
<ListItem image={christianAvatar} header='Christian' /> | ||
<ListItem image={danielAvatar} header='Daniel' /> | ||
</List> | ||
); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
docs/app/Examples/elements/List/Content/ListItemExample.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,14 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListItemExample extends Component { | ||
render() { | ||
return ( | ||
<List> | ||
<ListItem description='1' /> | ||
<ListItem description='2' /> | ||
<ListItem description='3' /> | ||
</List> | ||
); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
docs/app/Examples/elements/List/Content/ListLinkExample.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,17 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListLinkExample extends Component { | ||
render() { | ||
const link1 = <a>What is a FAQ?</a>; | ||
const link2 = <a>Who is our user base?</a>; | ||
const link3 = <a>Where is our office located?</a>; | ||
return ( | ||
<List> | ||
<ListItem description={link1} /> | ||
<ListItem description={link2} /> | ||
<ListItem description={link3} /> | ||
</List> | ||
); | ||
} | ||
} |
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,16 @@ | ||
import React, {Component} from 'react'; | ||
import ListTypesExamples from './Types/ListTypesExamples'; | ||
import ListContentExamples from './Content/ListContentExamples'; | ||
import ListVariationsExamples from './Variations/ListVariationsExamples'; | ||
|
||
export default class ListExamples extends Component { | ||
render() { | ||
return ( | ||
<div> | ||
<ListTypesExamples /> | ||
<ListContentExamples /> | ||
<ListVariationsExamples /> | ||
</div> | ||
); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
docs/app/Examples/elements/List/Types/ListBulletedExample.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,14 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListBulletedExample extends Component { | ||
render() { | ||
return ( | ||
<List className='bulleted'> | ||
<ListItem description='Apples' /> | ||
<ListItem description='Pears' /> | ||
<ListItem description='Oranges' /> | ||
</List> | ||
); | ||
} | ||
} |
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,19 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListLinkExample extends Component { | ||
render() { | ||
const link1 = <a>Home</a>; | ||
const link2 = <a>About</a>; | ||
const link3 = <a>Services</a>; | ||
const link4 = <a>Careers</a>; | ||
return ( | ||
<List className='link'> | ||
<ListItem className='active' description={link1} /> | ||
<ListItem description={link2} /> | ||
<ListItem description={link3} /> | ||
<ListItem description={link4} /> | ||
</List> | ||
); | ||
} | ||
} |
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,14 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListListExample extends Component { | ||
render() { | ||
return ( | ||
<List> | ||
<ListItem description='Apples' /> | ||
<ListItem description='Pears' /> | ||
<ListItem description='Oranges' /> | ||
</List> | ||
); | ||
} | ||
} | ||
20 changes: 20 additions & 0 deletions
20
docs/app/Examples/elements/List/Types/ListOrderedExample.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,20 @@ | ||
import React, {Component} from 'react'; | ||
import {List, ListItem} from 'stardust'; | ||
|
||
export default class ListOrderedExample extends Component { | ||
render() { | ||
return ( | ||
<List className='ordered'> | ||
<ListItem description='Apples'> | ||
<List> | ||
<ListItem description='Fuji' /> | ||
<ListItem description='Granny Smith' /> | ||
<ListItem description='Honeycrisp' /> | ||
</List> | ||
</ListItem> | ||
<ListItem description='Pears' /> | ||
<ListItem description='Oranges' /> | ||
</List> | ||
); | ||
} | ||
} |
32 changes: 32 additions & 0 deletions
32
docs/app/Examples/elements/List/Types/ListTypesExamples.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,32 @@ | ||
import React, {Component} from 'react'; | ||
import ComponentExample from 'docs/app/Components/ComponentDoc/ComponentExample'; | ||
import ExampleSection from 'docs/app/Components/ComponentDoc/ExampleSection'; | ||
|
||
export default class ListTypesExamples extends Component { | ||
render() { | ||
return ( | ||
<ExampleSection title='Types'> | ||
<ComponentExample | ||
title='List' | ||
description='A list groups related content' | ||
examplePath='elements/List/Types/ListListExample' | ||
/> | ||
<ComponentExample | ||
title='Bulleted' | ||
description='A list can mark items with a bullet' | ||
examplePath='elements/List/Types/ListBulletedExample' | ||
/> | ||
<ComponentExample | ||
title='Ordered' | ||
description='A list can be ordered numerically' | ||
examplePath='elements/List/Types/ListOrderedExample' | ||
/> | ||
<ComponentExample | ||
title='Link' | ||
description='A list can be specially formatted for navigation links' | ||
examplePath='elements/List/Types/ListLinkExample' | ||
/> | ||
</ExampleSection> | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/elements/List/Variations/ListAnimatedExample.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,18 @@ | ||
import faker from 'faker'; | ||
import React, {Component} from 'react'; | ||
import {List, ListItem, Image} from 'stardust'; | ||
|
||
export default class ListAnimatedExample extends Component { | ||
render() { | ||
const avatar1 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar2 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar3 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
return ( | ||
<List className='middle aligned animated'> | ||
<ListItem image={avatar1} header='Helen' /> | ||
<ListItem image={avatar2} header='Christian' /> | ||
<ListItem image={avatar3} header='Daniel' /> | ||
</List> | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/elements/List/Variations/ListCelledExample.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,18 @@ | ||
import faker from 'faker'; | ||
import React, {Component} from 'react'; | ||
import {List, ListItem, Image} from 'stardust'; | ||
|
||
export default class ListCelledExample extends Component { | ||
render() { | ||
const avatar1 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar2 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar3 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
return ( | ||
<List className='celled'> | ||
<ListItem image={avatar1} header='Helen' /> | ||
<ListItem image={avatar2} header='Christian' /> | ||
<ListItem image={avatar3} header='Daniel' /> | ||
</List> | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/elements/List/Variations/ListDividedExample.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,18 @@ | ||
import faker from 'faker'; | ||
import React, {Component} from 'react'; | ||
import {List, ListItem, Image} from 'stardust'; | ||
|
||
export default class ListDividedExample extends Component { | ||
render() { | ||
const avatar1 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar2 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar3 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
return ( | ||
<List className='middle aligned divided'> | ||
<ListItem image={avatar1} header='Helen' /> | ||
<ListItem image={avatar2} header='Christian' /> | ||
<ListItem image={avatar3} header='Daniel' /> | ||
</List> | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/elements/List/Variations/ListHorizontalExample.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,18 @@ | ||
import faker from 'faker'; | ||
import React, {Component} from 'react'; | ||
import {List, ListItem, Image} from 'stardust'; | ||
|
||
export default class ListHorizontalExample extends Component { | ||
render() { | ||
const image1 = <Image className='avatar' src={faker.image.city(100, 100)} />; | ||
const image2 = <Image className='avatar' src={faker.image.city(100, 100)} />; | ||
const image3 = <Image className='avatar' src={faker.image.city(100, 100)} />; | ||
return ( | ||
<List className='horizontal'> | ||
<ListItem image={image1} header='Chicago' description='This city is located in the state of Illinois' /> | ||
<ListItem image={image2} header='Indianapolis' description='This city is located in the state of Indiana' /> | ||
<ListItem image={image3} header='Nashville' description='This city is located in the state of Tennessee' /> | ||
</List> | ||
); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
docs/app/Examples/elements/List/Variations/ListInvertedExample.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,16 @@ | ||
import React, {Component} from 'react'; | ||
import {Segment, List, ListItem} from 'stardust'; | ||
|
||
export default class ListInvertedExample extends Component { | ||
render() { | ||
return ( | ||
<Segment className='inverted'> | ||
<List className='inverted relaxed divided'> | ||
<ListItem header='Chicago' description='Located in the state of Illinois' /> | ||
<ListItem header='Indianapolis' description='Located in the state of Indiana' /> | ||
<ListItem header='Nashville' description='Located in the state of Tennessee' /> | ||
</List> | ||
</Segment> | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
docs/app/Examples/elements/List/Variations/ListRelaxedExample.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,18 @@ | ||
import faker from 'faker'; | ||
import React, {Component} from 'react'; | ||
import {List, ListItem, Image} from 'stardust'; | ||
|
||
export default class ListRelaxedExample extends Component { | ||
render() { | ||
const avatar1 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar2 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
const avatar3 = <Image className='avatar' src={faker.internet.avatar()} />; | ||
return ( | ||
<List className='relaxed'> | ||
<ListItem image={avatar1} header='Helen' /> | ||
<ListItem image={avatar2} header='Christian' /> | ||
<ListItem image={avatar3} header='Daniel' /> | ||
</List> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth adding a |
||
); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only did one example for the basic list - Semantic has a handful, would adding some variations be useful or necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see what you mean. It looks like they just show a mashup of various lists at the top, then dive into each specific capability. I think we're good with the basics up top if we have links/icons/etc down below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍