UNPKG

@atlaskit/avatar

Version:

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

51 lines 1.64 kB
/* status-wrapper.tsx generated by @compiled/babel-plugin v0.39.1 */ import "./status-wrapper.compiled.css"; import * as React from 'react'; import { ax, ix } from "@compiled/react/runtime"; import AvatarStatus from '../status'; var styles = { root: "_kqswstnw" }; var iconSizeMap = { small: "_4t3i1crf _1bsb1crf", medium: "_4t3idlk8 _1bsbdlk8", large: "_4t3io7ao _1bsbo7ao", xlarge: "_4t3if6fq _1bsbf6fq" }; var circleIconOffsetMap = { small: "_rjxpidpf _152tidpf", medium: "_rjxpidpf _152tidpf", large: "_rjxpt94y _152tt94y", xlarge: "_rjxp1v6z _152t1v6z" }; var squareIconOffsetMap = { root: "_rjxpidpf _152tidpf" }; var hexagonIconOffsetMap = { small: "_rjxp1n1a _152t1n1a", medium: "_rjxp1n1a _152t1n1a", large: "_rjxpmyb0 _152t1y44", xlarge: "_rjxp1lpd _152tl52n" }; /** * __Status wrapper__ * * A status wrapper is used internally to position status on top of the avatar. */ var StatusWrapper = function StatusWrapper(_ref) { var size = _ref.size, status = _ref.status, appearance = _ref.appearance, borderColor = _ref.borderColor, children = _ref.children, testId = _ref.testId; return /*#__PURE__*/React.createElement("span", { "aria-hidden": "true", "data-testid": testId && "".concat(testId, "--status"), className: ax([styles.root, iconSizeMap[size], circleIconOffsetMap[size], appearance === 'square' && squareIconOffsetMap.root, appearance === 'hexagon' && hexagonIconOffsetMap[size]]) }, /*#__PURE__*/React.createElement(AvatarStatus, { borderColor: borderColor, status: !children ? status : undefined }, children)); }; export default StatusWrapper;