@kyper/avatar
Advanced tools
Comparing version 1.0.3 to 1.0.4
@@ -1,6 +0,12 @@ | ||
# Avatar Changelog | ||
## [1.0.4](https://gitlab.mx.com/mx/kyper-react/-/commits/@kyper/avatar@1.0.4) - 01-05-2021 | ||
## [1.0.0] - 05-26-2020 | ||
- **FIXED** - use correct BackgroundColor.Avatar token for correct Light/Dark mode color | ||
- **ADDED** - className prop now gets captured so we don't override the default styles | ||
### Added | ||
- Initial implementation | ||
## [1.0.3](https://gitlab.mx.com/mx/kyper-react/-/commits/@kyper/avatar@1.0.3) - 12-18-2020 | ||
- **CHANGED** - updated to a consistent file structure _NO ACTUAL COMPONENT CHANGES_ | ||
## [1.0.0](https://gitlab.mx.com/mx/kyper-react/-/commits/@kyper/avatar@1.0.0) - 05-26-2020 | ||
- **ADDED** - Initial release of `Avatar` component |
@@ -7,3 +7,3 @@ import React, { useState } from 'react' | ||
export const Avatar = ({ children, src, size = 16, alt, ...rest }) => { | ||
export const Avatar = ({ children, className = '', src, size = 16, alt, ...rest }) => { | ||
const tokens = useTokens() | ||
@@ -40,3 +40,3 @@ const styles = getStyles(tokens, size) | ||
return ( | ||
<div className={`${styles} avatar-${size}`} {...rest}> | ||
<div className={`${styles} avatar-${size} ${className}`} {...rest}> | ||
{!children && src && <img alt={alt} onError={() => setError(true)} src={src} />} | ||
@@ -54,3 +54,3 @@ {children && !src && children} | ||
lineHeight: tokens.LineHeight.Small, | ||
backgroundColor: tokens.Color.Neutral300, | ||
backgroundColor: tokens.BackgroundColor.Avatar, | ||
textAlign: 'center', | ||
@@ -87,2 +87,3 @@ display: 'inline-flex', | ||
children: PropTypes.any, | ||
className: PropTypes.string, | ||
size: PropTypes.oneOf([16, 24, 32, 44]).isRequired, | ||
@@ -89,0 +90,0 @@ src: PropTypes.string, |
{ | ||
"name": "@kyper/avatar", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Avatar", | ||
@@ -35,3 +35,3 @@ "author": "MX", | ||
}, | ||
"gitHead": "f212a1c748ea0f68c46cdee1cea77f0dd77b3c3b" | ||
"gitHead": "f069a2b8923224b70405a8785ea2a84fd26e07fa" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
3764
84
0