@atlaskit/avatar
Version:
An avatar is a visual representation of a user or entity.
40 lines (39 loc) • 1.52 kB
JavaScript
/* skeleton.tsx generated by @compiled/babel-plugin v0.39.1 */
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import "./skeleton.compiled.css";
import * as React from 'react';
import { ax, ix } from "@compiled/react/runtime";
var bgColorCssVar = '--avatar-skeleton-background-color';
var styles = {
root: "_2rko1qll _189e1dm9 _1dqonqa1 _1h6d1j28 _1e0c1o8l _bfhk1r8p _tzy4nh7s",
square: "_2rkol0p1",
hexagon: "_mkrz1k6g",
strongOpacity: "_tzy4clii"
};
var sizeStyles = {
xsmall: "_1bsb7vkz _4t3i7vkz",
small: "_1bsb1tcg _4t3i1tcg",
medium: "_1bsbzwfg _4t3izwfg",
large: "_1bsb1ylp _4t3i1ylp",
xlarge: "_1bsb16xz _4t3i16xz",
xxlarge: "_1bsb1qr7 _4t3i1qr7"
};
/**
* __Skeleton__
*
* A skeleton is the loading state for the avatar component.
*
* - [Examples](https://atlassian.design/components/avatar/avatar-skeleton/examples)
* - [Code](https://atlassian.design/components/avatar/avatar-skeleton/code)
*/
var Skeleton = function Skeleton(_ref) {
var size = _ref.size,
appearance = _ref.appearance,
color = _ref.color,
weight = _ref.weight;
return /*#__PURE__*/React.createElement("div", {
style: _defineProperty({}, bgColorCssVar, color !== null && color !== void 0 ? color : 'currentColor'),
className: ax([styles.root, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
});
};
export default Skeleton;