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
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[terra-avatar] Changed Shared user variant to Generic Avatar variant (#…
…2620) * Changed Shared user to Generic Avatar Varaint * Added upgrade Guide for Breaking Changes * Upgrade Guide Corrections * export added for constants * Changed Examples for Generic Icon * Updating documentation for Generic variant Co-Authored-By: Derek Yu <yuderekyu@gmail.com> * Update packages/terra-avatar/CHANGELOG.md Co-Authored-By: Matt Henkes <mjhenkes@gmail.com> * removed theme variables update from upgrade guide * Added user Icon example in upgrade guide * updated changelogs and upgrade guide * corrections to changelog and upgradeguide * Update CONTRIBUTORS.md * Update screenshots Co-authored-by: Derek Yu <yuderekyu@gmail.com> Co-authored-by: Matt Henkes <mjhenkes@gmail.com> Co-authored-by: Ryan Manuel <rfmanuel@gmail.com> Co-authored-by: Jeremy Fuksa <hello@orangefla.me> Co-authored-by: Manuel,Ryan <Ryan.Manuel@Cerner.com>
- Loading branch information
1 parent
2db9369
commit ed26635
Showing
31 changed files
with
629 additions
and
246 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 |
---|---|---|
@@ -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 }; |
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
40 changes: 40 additions & 0 deletions
40
packages/terra-avatar/src/terra-dev-site/doc/avatar/Generic.4.doc.mdx
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,40 @@ | ||
import { Badge } from 'terra-avatar/package.json?dev-site-package'; | ||
|
||
import GenericAvatarVariants from '../example/generic/GenericAvatarVariants?dev-site-example'; | ||
|
||
import GenericPropsTable from 'terra-avatar/src/variants/Generic?dev-site-props-table'; | ||
|
||
<Badge /> | ||
|
||
# Generic | ||
|
||
The `Generic` variant represents multiple users - it displays a shared user icon in a circular frame. | ||
|
||
## Getting Started | ||
|
||
- Install with [npmjs](https://www.npmjs.com): | ||
- `npm install terra-avatar` | ||
|
||
## Usage | ||
|
||
```jsx | ||
import React from 'react'; | ||
import { Generic } from 'terra-avatar'; | ||
|
||
<Generic | ||
alt="Generic Users" | ||
/> | ||
``` | ||
|
||
## Component Features | ||
|
||
* [Cross-Browser Support](https://engineering.cerner.com/terra-ui/contributing/terra-ui/component-standards#cross-browser-support) | ||
* [Mobile Support](https://engineering.cerner.com/terra-ui/contributing/terra-ui/component-standards#mobile-support) | ||
|
||
[View component source code](https://github.com/cerner/terra-core/tree/master/packages/terra-avatar) | ||
|
||
## Examples | ||
<GenericAvatarVariants title="Generic Avatar - Icons" /> | ||
|
||
## Shared User Props | ||
<GenericPropsTable /> |
44 changes: 0 additions & 44 deletions
44
packages/terra-avatar/src/terra-dev-site/doc/avatar/SharedUser.4.doc.mdx
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
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.