@atlaskit/avatar 25.14.2 → 25.15.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 25.15.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`d39a9f06a8508`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d39a9f06a8508) -
8
+ [ux] Bug fix: square avatars allow size to be set to xlarge and xxlarge, which are invalid sizes
9
+ that should not be available for square avatars (only circle and hexagonal avatars).
10
+
11
+ ## 25.15.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`e52f0046ff01d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e52f0046ff01d) -
16
+ Cleanup feature gate `platform_dst_hexagon_avatar_unified_size`. Hexagonal avatars now
17
+ consistently use unified sizing to align with other avatar types. We have not seen any regression
18
+ with this breaking alignment, but it's possible to have subtle breaking changes with unsafe style
19
+ overrides.
20
+
3
21
  ## 25.14.2
4
22
 
5
23
  ### Patch Changes
@@ -13,10 +13,6 @@
13
13
  ._18zr1dm9{padding-inline:var(--ds-border-width-selected,2px)}
14
14
  ._18zruxly{padding-inline:calc(var(--ds-border-width-selected, 2px)*.4)}
15
15
  ._195g1ksc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1)}
16
- ._195g1ukp{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 8px)}
17
- ._195g8ocb{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 4px)}
18
- ._195gcwjc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 1px)}
19
- ._195gs7t4{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 2px)}
20
16
  ._195gzwb8{margin-inline:calc(var(--ds-border-width-selected, 2px)*.4*-1)}
21
17
  ._1mou18m8{margin-block:calc(var(--ds-border-width-selected, 2px)*.5*-1)}
22
18
  ._1mou5h37{margin-block:calc(var(--ds-border-width-selected, 2px)*1.25*-1)}
@@ -29,11 +29,9 @@ var styles = {
29
29
  var unboundStyles = {
30
30
  rootCustomBorder: "_11q7cxp3",
31
31
  root: "_vchh1ntv _bfhkcxp3 _16qs1nhn",
32
- hexagonFocusContainer: "_1rjc1wgn _18zr1dm9 _1mou5h37 _bfhk1j28 _mkrz1k6g _1o9o1v1w",
33
- hexagonFocusContainerMarginFg: "_195g1ksc",
32
+ hexagonFocusContainer: "_1rjc1wgn _18zr1dm9 _1mou5h37 _195g1ksc _bfhk1j28 _mkrz1k6g _1o9o1v1w",
34
33
  hexagonBorderContainerCustomBorder: "_11q7cxp3",
35
- hexagonBorderContainer: "_1rjcf6hp _18zruxly _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
36
- hexagonBorderContainerMarginFg: "_1mou18m8 _195gzwb8",
34
+ hexagonBorderContainer: "_1rjcf6hp _18zruxly _1mou18m8 _195gzwb8 _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
37
35
  hexagon: "_2rkoidpf _mkrz1kw7 _16qsn7od _14mjidpf _1ejjn7od _128midpf _4davidpf",
38
36
  interactive: "_80omtlke _4tpu1f0r _ez1ykb7n _gcm1jer9 _eeh8kb7n _jlxit94y",
39
37
  interactiveMotion: "_v5641krm _1llweo6y"
@@ -46,14 +44,6 @@ var widthHeightMap = {
46
44
  xlarge: "_1bsb16xz _4t3i16xz",
47
45
  xxlarge: "_1bsb1qr7 _4t3i1qr7"
48
46
  };
49
- var marginAdjustmentMap = {
50
- xsmall: "_195gcwjc",
51
- small: "_195gcwjc",
52
- medium: "_195gs7t4",
53
- large: "_195gs7t4",
54
- xlarge: "_195g8ocb",
55
- xxlarge: "_195g1ukp"
56
- };
57
47
  /**
58
48
  * __Avatar content__
59
49
  *
@@ -115,9 +105,9 @@ var AvatarContent = exports.AvatarContent = /*#__PURE__*/(0, _react.forwardRef)(
115
105
  return /*#__PURE__*/React.createElement("div", {
116
106
  style: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, bgColorCssVar, borderColor), boxShadowCssVar, "0 0 0 2px ".concat(borderColor)),
117
107
  "data-testid": testId ? "".concat(testId, "-hexagon-focus-container") : 'hexagon-focus-container',
118
- className: (0, _runtime.ax)([unboundStyles.hexagonFocusContainer, !(0, _platformFeatureFlags.fg)('platform_dst_hexagon_avatar_unified_size') && marginAdjustmentMap[size], (0, _platformFeatureFlags.fg)('platform_dst_hexagon_avatar_unified_size') && unboundStyles.hexagonFocusContainerMarginFg, isInteractive && !isDisabled && (0, _platformFeatureFlags.fg)('platform-dst-motion-uplift') && unboundStyles.interactiveMotion])
108
+ className: (0, _runtime.ax)([unboundStyles.hexagonFocusContainer, isInteractive && !isDisabled && (0, _platformFeatureFlags.fg)('platform-dst-motion-uplift') && unboundStyles.interactiveMotion])
119
109
  }, /*#__PURE__*/React.createElement("div", {
120
110
  "data-testid": testId ? "".concat(testId, "-hexagon-border-container") : 'hexagon-border-container',
121
- className: (0, _runtime.ax)([unboundStyles.hexagonBorderContainer, (0, _platformFeatureFlags.fg)('avatar-custom-border') && unboundStyles.hexagonBorderContainerCustomBorder, (0, _platformFeatureFlags.fg)('platform_dst_hexagon_avatar_unified_size') && unboundStyles.hexagonBorderContainerMarginFg])
111
+ className: (0, _runtime.ax)([unboundStyles.hexagonBorderContainer, (0, _platformFeatureFlags.fg)('avatar-custom-border') && unboundStyles.hexagonBorderContainerCustomBorder])
122
112
  }, renderedContent));
123
113
  });
@@ -21,12 +21,13 @@ var _ensureIsInsideAvatarContext = require("./internal/ensure-is-inside-avatar-c
21
21
  var _getCustomElement = _interopRequireDefault(require("./internal/get-custom-element"));
22
22
  var _presenceWrapper = _interopRequireDefault(require("./internal/presence-wrapper"));
23
23
  var _statusWrapper = _interopRequireDefault(require("./internal/status-wrapper"));
24
+ var _sizeUtils = require("./size-utils");
24
25
  var _useAvatarContext = require("./use-avatar-context");
25
26
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
26
27
  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; }
27
28
  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) { (0, _defineProperty2.default)(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; }
28
29
  var packageName = "@atlaskit/avatar";
29
- var packageVersion = "25.14.1";
30
+ var packageVersion = "25.15.0";
30
31
  var containerStyles = null;
31
32
 
32
33
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -69,7 +70,10 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
69
70
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
70
71
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
71
72
  var context = (0, _useAvatarContext.useAvatarContext)();
72
- var size = sizeProp || (context === null || context === void 0 ? void 0 : context.size) || 'medium';
73
+ var size = (0, _sizeUtils.getAvatarSize)({
74
+ appearance: appearance,
75
+ size: sizeProp || (context === null || context === void 0 ? void 0 : context.size) || 'medium'
76
+ });
73
77
  var customPresenceNode = /*#__PURE__*/(0, _react.isValidElement)(presence) ? presence : null;
74
78
  var customStatusNode = /*#__PURE__*/(0, _react.isValidElement)(status) ? status : null;
75
79
  var isValidIconSize = size !== 'xxlarge' && size !== 'xsmall';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.getAvatarSize = exports.SQUARE_AVATAR_MAX_SIZE_FF = void 0;
7
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
+ var SQUARE_AVATAR_MAX_SIZE_FF = exports.SQUARE_AVATAR_MAX_SIZE_FF = 'platform_square_avatar_remove_xlarge_xxlarge_sizes';
9
+ var getAvatarSize = exports.getAvatarSize = function getAvatarSize(_ref) {
10
+ var appearance = _ref.appearance,
11
+ size = _ref.size;
12
+ if (appearance === 'square' && (size === 'xlarge' || size === 'xxlarge') && (0, _platformFeatureFlags.fg)('platform_square_avatar_remove_xlarge_xxlarge_sizes')) {
13
+ return 'large';
14
+ }
15
+ return size;
16
+ };
@@ -11,6 +11,7 @@ require("./skeleton.compiled.css");
11
11
  var React = _interopRequireWildcard(require("react"));
12
12
  var _runtime = require("@compiled/react/runtime");
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
+ var _sizeUtils = require("./size-utils");
14
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
15
16
  var bgColorCssVar = '--avatar-skeleton-background-color';
16
17
  var styles = {
@@ -38,12 +39,17 @@ var sizeStyles = {
38
39
  */
39
40
  var Skeleton = function Skeleton(_ref) {
40
41
  var size = _ref.size,
41
- appearance = _ref.appearance,
42
+ _ref$appearance = _ref.appearance,
43
+ appearance = _ref$appearance === void 0 ? 'circle' : _ref$appearance,
42
44
  color = _ref.color,
43
45
  weight = _ref.weight;
46
+ var avatarSize = (0, _sizeUtils.getAvatarSize)({
47
+ appearance: appearance,
48
+ size: size !== null && size !== void 0 ? size : 'medium'
49
+ });
44
50
  return /*#__PURE__*/React.createElement("div", {
45
51
  style: (0, _defineProperty2.default)({}, bgColorCssVar, color !== null && color !== void 0 ? color : 'currentColor'),
46
- className: (0, _runtime.ax)([styles.root, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
52
+ className: (0, _runtime.ax)([styles.root, sizeStyles[avatarSize], appearance === 'square' && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
47
53
  });
48
54
  };
49
55
  var _default = exports.default = Skeleton;
@@ -13,10 +13,6 @@
13
13
  ._18zr1dm9{padding-inline:var(--ds-border-width-selected,2px)}
14
14
  ._18zruxly{padding-inline:calc(var(--ds-border-width-selected, 2px)*.4)}
15
15
  ._195g1ksc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1)}
16
- ._195g1ukp{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 8px)}
17
- ._195g8ocb{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 4px)}
18
- ._195gcwjc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 1px)}
19
- ._195gs7t4{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 2px)}
20
16
  ._195gzwb8{margin-inline:calc(var(--ds-border-width-selected, 2px)*.4*-1)}
21
17
  ._1mou18m8{margin-block:calc(var(--ds-border-width-selected, 2px)*.5*-1)}
22
18
  ._1mou5h37{margin-block:calc(var(--ds-border-width-selected, 2px)*1.25*-1)}
@@ -19,11 +19,9 @@ const styles = {
19
19
  const unboundStyles = {
20
20
  rootCustomBorder: "_11q7cxp3",
21
21
  root: "_vchh1ntv _bfhkcxp3 _16qs1nhn",
22
- hexagonFocusContainer: "_1rjc1wgn _18zr1dm9 _1mou5h37 _bfhk1j28 _mkrz1k6g _1o9o1v1w",
23
- hexagonFocusContainerMarginFg: "_195g1ksc",
22
+ hexagonFocusContainer: "_1rjc1wgn _18zr1dm9 _1mou5h37 _195g1ksc _bfhk1j28 _mkrz1k6g _1o9o1v1w",
24
23
  hexagonBorderContainerCustomBorder: "_11q7cxp3",
25
- hexagonBorderContainer: "_1rjcf6hp _18zruxly _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
26
- hexagonBorderContainerMarginFg: "_1mou18m8 _195gzwb8",
24
+ hexagonBorderContainer: "_1rjcf6hp _18zruxly _1mou18m8 _195gzwb8 _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
27
25
  hexagon: "_2rkoidpf _mkrz1kw7 _16qsn7od _14mjidpf _1ejjn7od _128midpf _4davidpf",
28
26
  interactive: "_80omtlke _4tpu1f0r _ez1ykb7n _gcm1jer9 _eeh8kb7n _jlxit94y",
29
27
  interactiveMotion: "_v5641krm _1llweo6y"
@@ -36,14 +34,6 @@ const widthHeightMap = {
36
34
  xlarge: "_1bsb16xz _4t3i16xz",
37
35
  xxlarge: "_1bsb1qr7 _4t3i1qr7"
38
36
  };
39
- const marginAdjustmentMap = {
40
- xsmall: "_195gcwjc",
41
- small: "_195gcwjc",
42
- medium: "_195gs7t4",
43
- large: "_195gs7t4",
44
- xlarge: "_195g8ocb",
45
- xxlarge: "_195g1ukp"
46
- };
47
37
  /**
48
38
  * __Avatar content__
49
39
  *
@@ -112,9 +102,9 @@ export const AvatarContent = /*#__PURE__*/forwardRef(({
112
102
  [boxShadowCssVar]: `0 0 0 2px ${borderColor}`
113
103
  },
114
104
  "data-testid": testId ? `${testId}-hexagon-focus-container` : 'hexagon-focus-container',
115
- className: ax([unboundStyles.hexagonFocusContainer, !fg('platform_dst_hexagon_avatar_unified_size') && marginAdjustmentMap[size], fg('platform_dst_hexagon_avatar_unified_size') && unboundStyles.hexagonFocusContainerMarginFg, isInteractive && !isDisabled && fg('platform-dst-motion-uplift') && unboundStyles.interactiveMotion])
105
+ className: ax([unboundStyles.hexagonFocusContainer, isInteractive && !isDisabled && fg('platform-dst-motion-uplift') && unboundStyles.interactiveMotion])
116
106
  }, /*#__PURE__*/React.createElement("div", {
117
107
  "data-testid": testId ? `${testId}-hexagon-border-container` : 'hexagon-border-container',
118
- className: ax([unboundStyles.hexagonBorderContainer, fg('avatar-custom-border') && unboundStyles.hexagonBorderContainerCustomBorder, fg('platform_dst_hexagon_avatar_unified_size') && unboundStyles.hexagonBorderContainerMarginFg])
108
+ className: ax([unboundStyles.hexagonBorderContainer, fg('avatar-custom-border') && unboundStyles.hexagonBorderContainerCustomBorder])
119
109
  }, renderedContent));
120
110
  });
@@ -12,9 +12,10 @@ import { EnsureIsInsideAvatarContext } from './internal/ensure-is-inside-avatar-
12
12
  import getCustomElement from './internal/get-custom-element';
13
13
  import PresenceWrapper from './internal/presence-wrapper';
14
14
  import StatusWrapper from './internal/status-wrapper';
15
+ import { getAvatarSize } from './size-utils';
15
16
  import { useAvatarContext } from './use-avatar-context';
16
17
  const packageName = "@atlaskit/avatar";
17
- const packageVersion = "25.14.1";
18
+ const packageVersion = "25.15.0";
18
19
  const containerStyles = null;
19
20
 
20
21
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -56,7 +57,10 @@ const Avatar = /*#__PURE__*/forwardRef(({
56
57
  createAnalyticsEvent
57
58
  } = useAnalyticsEvents();
58
59
  const context = useAvatarContext();
59
- const size = sizeProp || (context === null || context === void 0 ? void 0 : context.size) || 'medium';
60
+ const size = getAvatarSize({
61
+ appearance,
62
+ size: sizeProp || (context === null || context === void 0 ? void 0 : context.size) || 'medium'
63
+ });
60
64
  const customPresenceNode = /*#__PURE__*/isValidElement(presence) ? presence : null;
61
65
  const customStatusNode = /*#__PURE__*/isValidElement(status) ? status : null;
62
66
  const isValidIconSize = size !== 'xxlarge' && size !== 'xsmall';
@@ -0,0 +1,11 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
2
+ export const SQUARE_AVATAR_MAX_SIZE_FF = 'platform_square_avatar_remove_xlarge_xxlarge_sizes';
3
+ export const getAvatarSize = ({
4
+ appearance,
5
+ size
6
+ }) => {
7
+ if (appearance === 'square' && (size === 'xlarge' || size === 'xxlarge') && fg('platform_square_avatar_remove_xlarge_xxlarge_sizes')) {
8
+ return 'large';
9
+ }
10
+ return size;
11
+ };
@@ -2,6 +2,7 @@
2
2
  import "./skeleton.compiled.css";
3
3
  import * as React from 'react';
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
+ import { getAvatarSize } from './size-utils';
5
6
  const bgColorCssVar = '--avatar-skeleton-background-color';
6
7
  const styles = {
7
8
  root: "_2rko1qll _189e1dm9 _1dqonqa1 _1h6d1j28 _1e0c1o8l _bfhk1r8p _tzy4nh7s",
@@ -28,13 +29,19 @@ const sizeStyles = {
28
29
  */
29
30
  const Skeleton = ({
30
31
  size,
31
- appearance,
32
+ appearance = 'circle',
32
33
  color,
33
34
  weight
34
- }) => /*#__PURE__*/React.createElement("div", {
35
- style: {
36
- [bgColorCssVar]: color !== null && color !== void 0 ? color : 'currentColor'
37
- },
38
- className: ax([styles.root, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
39
- });
35
+ }) => {
36
+ const avatarSize = getAvatarSize({
37
+ appearance,
38
+ size: size !== null && size !== void 0 ? size : 'medium'
39
+ });
40
+ return /*#__PURE__*/React.createElement("div", {
41
+ style: {
42
+ [bgColorCssVar]: color !== null && color !== void 0 ? color : 'currentColor'
43
+ },
44
+ className: ax([styles.root, sizeStyles[avatarSize], appearance === 'square' && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
45
+ });
46
+ };
40
47
  export default Skeleton;
@@ -13,10 +13,6 @@
13
13
  ._18zr1dm9{padding-inline:var(--ds-border-width-selected,2px)}
14
14
  ._18zruxly{padding-inline:calc(var(--ds-border-width-selected, 2px)*.4)}
15
15
  ._195g1ksc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1)}
16
- ._195g1ukp{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 8px)}
17
- ._195g8ocb{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 4px)}
18
- ._195gcwjc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 1px)}
19
- ._195gs7t4{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 2px)}
20
16
  ._195gzwb8{margin-inline:calc(var(--ds-border-width-selected, 2px)*.4*-1)}
21
17
  ._1mou18m8{margin-block:calc(var(--ds-border-width-selected, 2px)*.5*-1)}
22
18
  ._1mou5h37{margin-block:calc(var(--ds-border-width-selected, 2px)*1.25*-1)}
@@ -20,11 +20,9 @@ var styles = {
20
20
  var unboundStyles = {
21
21
  rootCustomBorder: "_11q7cxp3",
22
22
  root: "_vchh1ntv _bfhkcxp3 _16qs1nhn",
23
- hexagonFocusContainer: "_1rjc1wgn _18zr1dm9 _1mou5h37 _bfhk1j28 _mkrz1k6g _1o9o1v1w",
24
- hexagonFocusContainerMarginFg: "_195g1ksc",
23
+ hexagonFocusContainer: "_1rjc1wgn _18zr1dm9 _1mou5h37 _195g1ksc _bfhk1j28 _mkrz1k6g _1o9o1v1w",
25
24
  hexagonBorderContainerCustomBorder: "_11q7cxp3",
26
- hexagonBorderContainer: "_1rjcf6hp _18zruxly _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
27
- hexagonBorderContainerMarginFg: "_1mou18m8 _195gzwb8",
25
+ hexagonBorderContainer: "_1rjcf6hp _18zruxly _1mou18m8 _195gzwb8 _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
28
26
  hexagon: "_2rkoidpf _mkrz1kw7 _16qsn7od _14mjidpf _1ejjn7od _128midpf _4davidpf",
29
27
  interactive: "_80omtlke _4tpu1f0r _ez1ykb7n _gcm1jer9 _eeh8kb7n _jlxit94y",
30
28
  interactiveMotion: "_v5641krm _1llweo6y"
@@ -37,14 +35,6 @@ var widthHeightMap = {
37
35
  xlarge: "_1bsb16xz _4t3i16xz",
38
36
  xxlarge: "_1bsb1qr7 _4t3i1qr7"
39
37
  };
40
- var marginAdjustmentMap = {
41
- xsmall: "_195gcwjc",
42
- small: "_195gcwjc",
43
- medium: "_195gs7t4",
44
- large: "_195gs7t4",
45
- xlarge: "_195g8ocb",
46
- xxlarge: "_195g1ukp"
47
- };
48
38
  /**
49
39
  * __Avatar content__
50
40
  *
@@ -106,9 +96,9 @@ export var AvatarContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
106
96
  return /*#__PURE__*/React.createElement("div", {
107
97
  style: _defineProperty(_defineProperty({}, bgColorCssVar, borderColor), boxShadowCssVar, "0 0 0 2px ".concat(borderColor)),
108
98
  "data-testid": testId ? "".concat(testId, "-hexagon-focus-container") : 'hexagon-focus-container',
109
- className: ax([unboundStyles.hexagonFocusContainer, !fg('platform_dst_hexagon_avatar_unified_size') && marginAdjustmentMap[size], fg('platform_dst_hexagon_avatar_unified_size') && unboundStyles.hexagonFocusContainerMarginFg, isInteractive && !isDisabled && fg('platform-dst-motion-uplift') && unboundStyles.interactiveMotion])
99
+ className: ax([unboundStyles.hexagonFocusContainer, isInteractive && !isDisabled && fg('platform-dst-motion-uplift') && unboundStyles.interactiveMotion])
110
100
  }, /*#__PURE__*/React.createElement("div", {
111
101
  "data-testid": testId ? "".concat(testId, "-hexagon-border-container") : 'hexagon-border-container',
112
- className: ax([unboundStyles.hexagonBorderContainer, fg('avatar-custom-border') && unboundStyles.hexagonBorderContainerCustomBorder, fg('platform_dst_hexagon_avatar_unified_size') && unboundStyles.hexagonBorderContainerMarginFg])
102
+ className: ax([unboundStyles.hexagonBorderContainer, fg('avatar-custom-border') && unboundStyles.hexagonBorderContainerCustomBorder])
113
103
  }, renderedContent));
114
104
  });
@@ -15,9 +15,10 @@ import { EnsureIsInsideAvatarContext } from './internal/ensure-is-inside-avatar-
15
15
  import getCustomElement from './internal/get-custom-element';
16
16
  import PresenceWrapper from './internal/presence-wrapper';
17
17
  import StatusWrapper from './internal/status-wrapper';
18
+ import { getAvatarSize } from './size-utils';
18
19
  import { useAvatarContext } from './use-avatar-context';
19
20
  var packageName = "@atlaskit/avatar";
20
- var packageVersion = "25.14.1";
21
+ var packageVersion = "25.15.0";
21
22
  var containerStyles = null;
22
23
 
23
24
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -60,7 +61,10 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref, ref) {
60
61
  var _useAnalyticsEvents = useAnalyticsEvents(),
61
62
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
62
63
  var context = useAvatarContext();
63
- var size = sizeProp || (context === null || context === void 0 ? void 0 : context.size) || 'medium';
64
+ var size = getAvatarSize({
65
+ appearance: appearance,
66
+ size: sizeProp || (context === null || context === void 0 ? void 0 : context.size) || 'medium'
67
+ });
64
68
  var customPresenceNode = /*#__PURE__*/isValidElement(presence) ? presence : null;
65
69
  var customStatusNode = /*#__PURE__*/isValidElement(status) ? status : null;
66
70
  var isValidIconSize = size !== 'xxlarge' && size !== 'xsmall';
@@ -0,0 +1,10 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
2
+ export var SQUARE_AVATAR_MAX_SIZE_FF = 'platform_square_avatar_remove_xlarge_xxlarge_sizes';
3
+ export var getAvatarSize = function getAvatarSize(_ref) {
4
+ var appearance = _ref.appearance,
5
+ size = _ref.size;
6
+ if (appearance === 'square' && (size === 'xlarge' || size === 'xxlarge') && fg('platform_square_avatar_remove_xlarge_xxlarge_sizes')) {
7
+ return 'large';
8
+ }
9
+ return size;
10
+ };
@@ -3,6 +3,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import "./skeleton.compiled.css";
4
4
  import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
+ import { getAvatarSize } from './size-utils';
6
7
  var bgColorCssVar = '--avatar-skeleton-background-color';
7
8
  var styles = {
8
9
  root: "_2rko1qll _189e1dm9 _1dqonqa1 _1h6d1j28 _1e0c1o8l _bfhk1r8p _tzy4nh7s",
@@ -29,12 +30,17 @@ var sizeStyles = {
29
30
  */
30
31
  var Skeleton = function Skeleton(_ref) {
31
32
  var size = _ref.size,
32
- appearance = _ref.appearance,
33
+ _ref$appearance = _ref.appearance,
34
+ appearance = _ref$appearance === void 0 ? 'circle' : _ref$appearance,
33
35
  color = _ref.color,
34
36
  weight = _ref.weight;
37
+ var avatarSize = getAvatarSize({
38
+ appearance: appearance,
39
+ size: size !== null && size !== void 0 ? size : 'medium'
40
+ });
35
41
  return /*#__PURE__*/React.createElement("div", {
36
42
  style: _defineProperty({}, bgColorCssVar, color !== null && color !== void 0 ? color : 'currentColor'),
37
- className: ax([styles.root, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
43
+ className: ax([styles.root, sizeStyles[avatarSize], appearance === 'square' && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
38
44
  });
39
45
  };
40
46
  export default Skeleton;
@@ -0,0 +1,6 @@
1
+ import { type AppearanceType, type SizeType } from './types';
2
+ export declare const SQUARE_AVATAR_MAX_SIZE_FF = "platform_square_avatar_remove_xlarge_xxlarge_sizes";
3
+ export declare const getAvatarSize: ({ appearance, size, }: {
4
+ appearance: AppearanceType;
5
+ size: SizeType;
6
+ }) => SizeType;
@@ -0,0 +1,6 @@
1
+ import { type AppearanceType, type SizeType } from './types';
2
+ export declare const SQUARE_AVATAR_MAX_SIZE_FF = "platform_square_avatar_remove_xlarge_xxlarge_sizes";
3
+ export declare const getAvatarSize: ({ appearance, size, }: {
4
+ appearance: AppearanceType;
5
+ size: SizeType;
6
+ }) => SizeType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "25.14.2",
3
+ "version": "25.15.1",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -63,7 +63,7 @@
63
63
  "@atlaskit/heading": "^5.4.0",
64
64
  "@atlaskit/link": "^3.4.0",
65
65
  "@atlaskit/range": "^10.1.0",
66
- "@atlaskit/section-message": "^8.12.0",
66
+ "@atlaskit/section-message": "^8.13.0",
67
67
  "@atlaskit/textfield": "^8.3.0",
68
68
  "@atlaskit/tooltip": "^22.2.0",
69
69
  "@atlassian/feature-flags-test-utils": "^1.1.0",
@@ -74,6 +74,7 @@
74
74
  "@testing-library/react": "^16.3.0",
75
75
  "@testing-library/user-event": "^14.4.3",
76
76
  "jest-in-case": "^1.0.2",
77
+ "react": "^18.2.0",
77
78
  "react-dom": "^18.2.0"
78
79
  },
79
80
  "keywords": [
@@ -109,12 +110,11 @@
109
110
  "avatar-custom-border": {
110
111
  "type": "boolean"
111
112
  },
112
- "platform_dst_hexagon_avatar_unified_size": {
113
- "type": "boolean",
114
- "showOnWebsiteForTransitiveDependencies": true
115
- },
116
113
  "platform-dst-motion-uplift": {
117
114
  "type": "boolean"
115
+ },
116
+ "platform_square_avatar_remove_xlarge_xxlarge_sizes": {
117
+ "type": "boolean"
118
118
  }
119
119
  }
120
120
  }