UNPKG

@atlaskit/avatar

Version:

An avatar is a visual representation of a user or entity.

46 lines (45 loc) 1.65 kB
/* skeleton.tsx generated by @compiled/babel-plugin v0.36.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: "_2rko1q5u _189e1bk5 _1dqonqa1 _1h6d1j28 _1e0c1o8l _bfhk1r8p _tzy4nh7s", strongOpacity: "_tzy4clii" }; var sizeStyles = { xsmall: "_1bsb7vkz _4t3i7vkz", small: "_1bsb1tcg _4t3i1tcg", medium: "_1bsbzwfg _4t3izwfg", large: "_1bsb1ylp _4t3i1ylp", xlarge: "_1bsb16xz _4t3i16xz", xxlarge: "_1bsb1qr7 _4t3i1qr7" }; var borderRadiusMap = { xsmall: "_2rkogqwt", small: "_2rkogqwt", medium: "_2rko1l7b", large: "_2rko1l7b", xlarge: "_2rkoi2wt", xxlarge: "_2rkob7nn" }; /** * __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' && borderRadiusMap[size !== null && size !== void 0 ? size : 'medium'], weight === 'strong' && styles.strongOpacity]) }); }; export default Skeleton;