@lobehub/ui 2.21.0 → 2.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
- var _excluded = ["bordered", "className", "avatar", "title", "animation", "borderedColor", "size", "shape", "background", "style", "unoptimized", "alt", "variant", "shadow", "loading", "sliceText", "ref"];
4
+ var _excluded = ["bordered", "className", "avatar", "title", "animation", "borderedColor", "size", "shape", "background", "style", "unoptimized", "alt", "variant", "shadow", "loading", "sliceText", "emojiScaleWithBackground", "ref"];
5
5
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
6
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
7
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -44,6 +44,7 @@ var Avatar = /*#__PURE__*/memo(function (_ref) {
44
44
  loading = _ref.loading,
45
45
  _ref$sliceText = _ref.sliceText,
46
46
  sliceText = _ref$sliceText === void 0 ? true : _ref$sliceText,
47
+ emojiScaleWithBackground = _ref.emojiScaleWithBackground,
47
48
  ref = _ref.ref,
48
49
  rest = _objectWithoutProperties(_ref, _excluded);
49
50
  var isStringAvatar = typeof avatar === 'string';
@@ -92,7 +93,7 @@ var Avatar = /*#__PURE__*/memo(function (_ref) {
92
93
  }) : avatar;
93
94
  var customAvatar = emoji ? /*#__PURE__*/_jsx(FluentEmoji, {
94
95
  emoji: emoji,
95
- size: size * 0.8,
96
+ size: emojiScaleWithBackground ? background ? size * 0.8 : size : size * 0.8,
96
97
  type: animation ? 'anim' : '3d',
97
98
  unoptimized: unoptimized
98
99
  }) : sliceText ? text === null || text === void 0 ? void 0 : text.toUpperCase().slice(0, 2) : text === null || text === void 0 ? void 0 : text.toUpperCase();
@@ -108,7 +109,7 @@ var Avatar = /*#__PURE__*/memo(function (_ref) {
108
109
  size: size,
109
110
  src: isDefaultAntAvatar ? defualtAvatar : undefined,
110
111
  style: _objectSpread({
111
- background: customAvatar && !emoji ? background || theme.colorFill : background,
112
+ background: background,
112
113
  boxShadow: bordered ? "".concat(theme.colorBgLayout, " 0 0 0 2px, ").concat(borderedColor || theme.colorTextTertiary, " 0 0 0 4px") : undefined,
113
114
  color: readableColor(background || theme.colorBorder),
114
115
  cursor: rest !== null && rest !== void 0 && rest.onClick ? 'pointer' : undefined,
@@ -8,6 +8,7 @@ export interface AvatarProps extends AntAvatarProps {
8
8
  background?: string;
9
9
  bordered?: boolean;
10
10
  borderedColor?: string;
11
+ emojiScaleWithBackground?: boolean;
11
12
  loading?: boolean;
12
13
  ref?: Ref<HTMLDivElement>;
13
14
  shadow?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "2.21.0",
3
+ "version": "2.21.1",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",