This repository has been archived by the owner on May 24, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
[terra-avatar] Changed Shared user variant to Generic Avatar variant #2620
Merged
Merged
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
aac0063
Changed Shared user to Generic Avatar Varaint
supreethmr c7d376e
Added upgrade Guide for Breaking Changes
supreethmr 5f17135
Upgrade Guide Corrections
supreethmr 4a470cf
export added for constants
supreethmr 07b365e
mergeconflicts
supreethmr 71741fd
Changed Examples for Generic Icon
supreethmr b30d6b9
Merge branch 'master' into Avatar-Provider-Variant
supreethmr 881586c
Updating documentation for Generic variant
supreethmr 8a3b15f
Merge branch 'master' into Avatar-Provider-Variant
supreethmr 8c90d71
Merge branch 'master' into Avatar-Provider-Variant
supreethmr c4a3798
Merge branch 'master' into Avatar-Provider-Variant
supreethmr f944aab
Merge branch 'master' into Avatar-Provider-Variant
supreethmr 4efa018
Merge branch 'master' into Avatar-Provider-Variant
mjhenkes 10260c7
Update packages/terra-avatar/CHANGELOG.md
supreethmr bee5afb
Merge branch 'master' into Avatar-Provider-Variant
supreethmr c03aa55
removed theme variables update from upgrade guide
supreethmr 5d5682b
Added user Icon example in upgrade guide
supreethmr 128dd37
updated changelogs and upgrade guide
supreethmr 8b523a7
corrections to changelog and upgradeguide
supreethmr e921aca
Merge branch 'master' into Avatar-Provider-Variant
ryanthemanuel 5c4d57f
Merge branch 'master' into Avatar-Provider-Variant
supreethmr 4da2553
Update CONTRIBUTORS.md
jeremyfuksa 0990768
Merge remote-tracking branch 'origin/master' into Avatar-Provider-Var…
rm012685 c5d1843
Merge branch 'master' into Avatar-Provider-Variant
ryanthemanuel 46c15fe
Update screenshots
rm012685 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
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
11 changes: 5 additions & 6 deletions
11
packages/terra-avatar/docs/shared-user.md → packages/terra-avatar/docs/generic.md
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import Avatar from './variants/Avatar'; | ||
import Facility from './variants/Facility'; | ||
import SharedUser from './variants/SharedUser'; | ||
import Generic from './variants/Generic'; | ||
|
||
export default Avatar; | ||
export { Facility, SharedUser }; | ||
export { Facility, Generic }; |
33 changes: 33 additions & 0 deletions
33
packages/terra-avatar/src/terra-dev-site/doc/avatar/Generic.d.doc.jsx
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,33 @@ | ||
import React from 'react'; | ||
import DocTemplate from 'terra-doc-template'; | ||
import ReadMe from '../../../../docs/generic.md'; | ||
import { name, version } from '../../../../package.json'; | ||
|
||
// Component Source | ||
import GenericSrc from '!raw-loader!../../../../src/variants/Generic.jsx'; | ||
import GenericAvatarVariants from '../example/generic/GenericAvatarVariants'; | ||
import GenericAvatarVariantsSrc from '!raw-loader!../../../../src/terra-dev-site/doc/example/generic/GenericAvatarVariants'; | ||
|
||
const DocPage = () => ( | ||
<DocTemplate | ||
packageName={name} | ||
packageVersion={version} | ||
readme={ReadMe} | ||
srcPath={`https://github.com/cerner/terra-core/tree/master/packages/${name}`} | ||
examples={[ | ||
{ | ||
title: 'Generic Avatar - Icons', | ||
example: <GenericAvatarVariants />, | ||
source: GenericAvatarVariantsSrc, | ||
}, | ||
]} | ||
propsTables={[ | ||
{ | ||
componentName: 'Generic', | ||
componentSrc: GenericSrc, | ||
}, | ||
]} | ||
/> | ||
); | ||
|
||
export default DocPage; |
47 changes: 0 additions & 47 deletions
47
packages/terra-avatar/src/terra-dev-site/doc/avatar/SharedUser.d.doc.jsx
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
packages/terra-avatar/src/terra-dev-site/doc/example/generic/GenericAvatarVariants.jsx
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 from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { Generic } from 'terra-avatar'; | ||
import GenericAvatarVariantsWrapper from 'terra-avatar/lib/terra-dev-site/doc/example/generic/GenericAvatarVariantsWrapper'; | ||
|
||
const propTypes = { color: PropTypes.string, size: PropTypes.string, variant: PropTypes.string }; | ||
|
||
const GenericAvatarVariants = ({ | ||
...props | ||
}) => ( | ||
<Generic variant={props.variant} alt={props.variant} color={props.color} size={props.size} /> | ||
); | ||
|
||
GenericAvatarVariants.propTypes = propTypes; | ||
export default GenericAvatarVariantsWrapper(GenericAvatarVariants); |
52 changes: 52 additions & 0 deletions
52
...ages/terra-avatar/src/terra-dev-site/doc/example/generic/GenericAvatarVariantsWrapper.jsx
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,52 @@ | ||
import React from 'react'; | ||
|
||
function GenericAvatarVariantsWrapper(WrappedComponent) { | ||
return class GenericVariants extends React.Component { | ||
constructor(props) { | ||
super(props); | ||
this.handleOnSelect = this.handleOnSelect.bind(this); | ||
this.state = { colorVariant: 'auto', size: undefined, variant: 'single-user' }; | ||
} | ||
|
||
handleOnSelect(event) { | ||
this.setState({ [event.target.name]: event.target.value }); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<WrappedComponent color={this.state.colorVariant} variant={this.state.variant} size={this.state.size} {...this.props} /> | ||
<p><label htmlFor="variant">Select a generic variant type:</label></p> | ||
<select id="variant" name="variant" value={this.state.variant} onChange={this.handleOnSelect}> | ||
<option value="single-user">Single-User</option> | ||
<option value="shared-user">Shared-User</option> | ||
<option value="provider">Provider</option> | ||
</select> | ||
<p><label htmlFor="colorVariant">Select a color variant:</label></p> | ||
<select id="colorVariant" name="colorVariant" value={this.state.colorVariant} onChange={this.handleOnSelect}> | ||
<option value="auto">Auto</option> | ||
<option value="neutral">Neutral</option> | ||
<option value="one">One</option> | ||
<option value="two">Two</option> | ||
<option value="three">Three</option> | ||
<option value="four">Four</option> | ||
<option value="five">Five</option> | ||
<option value="six">Six</option> | ||
<option value="seven">Seven</option> | ||
<option value="eight">Eight</option> | ||
<option value="nine">Nine</option> | ||
<option value="ten">Ten</option> | ||
</select> | ||
<p><label htmlFor="size">Select a size:</label></p> | ||
<select id="size" name="size" value={this.state.size} onChange={this.handleOnSelect}> | ||
<option value="1em">Default</option> | ||
<option value="2em">2em</option> | ||
<option value="3em">3em</option> | ||
</select> | ||
</div> | ||
); | ||
} | ||
}; | ||
} | ||
|
||
export default GenericAvatarVariantsWrapper; |
8 changes: 0 additions & 8 deletions
8
packages/terra-avatar/src/terra-dev-site/doc/example/shared-user/SharedUser.jsx
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
packages/terra-avatar/src/terra-dev-site/doc/example/shared-user/SharedUserColorVariants.jsx
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
packages/terra-avatar/src/terra-dev-site/doc/example/shared-user/SharedUserSize.jsx
This file was deleted.
Oops, something went wrong.
4 changes: 4 additions & 0 deletions
4
packages/terra-avatar/src/terra-dev-site/test/avatar/generic/Provider.test.jsx
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,4 @@ | ||
import React from 'react'; | ||
import { Generic } from '../../../../index'; | ||
|
||
export default () => <Generic variant="provider" id="provider" alt="provider" color="seven" />; |
4 changes: 4 additions & 0 deletions
4
packages/terra-avatar/src/terra-dev-site/test/avatar/generic/SharedUser.test.jsx
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,4 @@ | ||
import React from 'react'; | ||
import { Generic } from '../../../../index'; | ||
|
||
export default () => <Generic id="shared-user" variant="shared-user" alt="shared user" color="eight" />; |
4 changes: 4 additions & 0 deletions
4
packages/terra-avatar/src/terra-dev-site/test/avatar/generic/SingleUser.test.jsx
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,4 @@ | ||
import React from 'react'; | ||
import { Generic } from '../../../../index'; | ||
|
||
export default () => <Generic id="single-user" alt="single user" color="four" />; |
4 changes: 0 additions & 4 deletions
4
packages/terra-avatar/src/terra-dev-site/test/avatar/shared-user/DefaultSharedUser.test.jsx
This file was deleted.
Oops, something went wrong.
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.
@ryanthemanuel, do we want to add a 'Reason for change' section? If so, what should it say?
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.
+1. We should add that in the upgrade guide as well as the change log.