@codecademy/brand-components
Advanced tools
Comparing version 0.0.2-alpha.1a294c.1457 to 0.0.2-alpha.42d72b.1461
@@ -11,17 +11,19 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
import { VisualTheme } from '../../../gamut/src/theming/VisualTheme'; | ||
export function Avatar(_ref) { | ||
export var Avatar = function Avatar(_ref) { | ||
var _ref$size = _ref.size, | ||
size = _ref$size === void 0 ? 'regular' : _ref$size, | ||
label = _ref.label, | ||
_ref$theme = _ref.theme, | ||
theme = _ref$theme === void 0 ? VisualTheme.LightMode : _ref$theme, | ||
props = _objectWithoutProperties(_ref, ["size", "theme"]); | ||
imageProps = _objectWithoutProperties(_ref, ["size", "label", "theme"]); | ||
var imageProps = _extends({}, props); | ||
return React.createElement("div", { | ||
className: cx(s.container, s["".concat(size, "Container")], theme === VisualTheme.DarkMode ? s.darkContainer : s.lightContainer) | ||
className: cx(s.container, s["".concat(size, "Container")], theme === VisualTheme.DarkMode ? s.darkContainer : s.lightContainer), | ||
"aria-labelledby": label | ||
}, React.createElement("img", _extends({ | ||
className: cx(s.image, s["".concat(size, "Image")]) | ||
}, imageProps))); | ||
} | ||
}, imageProps, { | ||
alt: label | ||
}))); | ||
}; | ||
export default Avatar; |
@@ -1,10 +0,11 @@ | ||
import { HTMLAttributes } from 'react'; | ||
import React, { HTMLAttributes } from 'react'; | ||
import { VisualTheme } from '../../../gamut/src/theming/VisualTheme'; | ||
export declare type AvatarProps = HTMLAttributes<HTMLImageElement> & { | ||
export declare type AvatarProps = { | ||
src: string; | ||
alt: string; | ||
label: string; | ||
size?: 'regular' | 'large'; | ||
theme: VisualTheme; | ||
theme?: VisualTheme; | ||
imageProps?: HTMLAttributes<HTMLImageElement>; | ||
}; | ||
export declare function Avatar({ size, theme, ...props }: AvatarProps): JSX.Element; | ||
export declare const Avatar: React.FC<AvatarProps>; | ||
export default Avatar; |
{ | ||
"name": "@codecademy/brand-components", | ||
"description": "Brand component library for Codecademy", | ||
"version": "0.0.2-alpha.1a294c.1457+1a294cf2", | ||
"version": "0.0.2-alpha.42d72b.1461+42d72b10", | ||
"author": "Codecademy Engineering <dev@codecademy.com>", | ||
@@ -37,3 +37,3 @@ "sideEffects": [ | ||
}, | ||
"gitHead": "1a294cf2e69c16f4484440232824827c0a0696db" | ||
"gitHead": "42d72b1022727cf4c7924280afb74a9bb4d85fd9" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
9544
19
115