@atlaskit/avatar 25.11.3 → 25.11.4

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,14 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 25.11.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`02483200273ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/02483200273ec) -
8
+ Enrol all Design System UI packages into the React Compiler with platform gating via
9
+ isReactCompilerActivePlatform.
10
+ - Updated dependencies
11
+
3
12
  ## 25.11.3
4
13
 
5
14
  ### Patch Changes
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.AvatarContext = void 0;
7
+ var _react = require("react");
8
+ /**
9
+ * __Avatar context__
10
+ *
11
+ * An avatar context that provides the size of the avatar to children. Used by AvatarGroup
12
+ *
13
+ * - [Examples](https://atlassian.design/components/avatar/examples)
14
+ * - [Code](https://atlassian.design/components/avatar/code)
15
+ * - [Usage](https://atlassian.design/components/avatar/usage)
16
+ */
17
+ var AvatarContext = exports.AvatarContext = /*#__PURE__*/(0, _react.createContext)(undefined);
@@ -15,18 +15,18 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
15
15
  var _analyticsNext = require("@atlaskit/analytics-next");
16
16
  var _useId = require("@atlaskit/ds-lib/use-id");
17
17
  var _avatarContent = require("./avatar-content");
18
- var _context = require("./context");
19
18
  var _avatarImage = _interopRequireDefault(require("./internal/avatar-image"));
20
19
  var _contentContext = require("./internal/content-context");
21
20
  var _ensureIsInsideAvatarContext = require("./internal/ensure-is-inside-avatar-context");
22
21
  var _getCustomElement = _interopRequireDefault(require("./internal/get-custom-element"));
23
22
  var _presenceWrapper = _interopRequireDefault(require("./internal/presence-wrapper"));
24
23
  var _statusWrapper = _interopRequireDefault(require("./internal/status-wrapper"));
24
+ var _useAvatarContext = require("./use-avatar-context");
25
25
  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
26
  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
27
  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
28
  var packageName = "@atlaskit/avatar";
29
- var packageVersion = "25.11.2";
29
+ var packageVersion = "25.11.3";
30
30
  var containerStyles = null;
31
31
 
32
32
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -68,7 +68,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
68
68
  ariaHasPopup = _ref['aria-haspopup'];
69
69
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
70
70
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
71
- var context = (0, _context.useAvatarContext)();
71
+ var context = (0, _useAvatarContext.useAvatarContext)();
72
72
  var size = sizeProp || (context === null || context === void 0 ? void 0 : context.size) || 'medium';
73
73
  var customPresenceNode = /*#__PURE__*/(0, _react.isValidElement)(presence) ? presence : null;
74
74
  var customStatusNode = /*#__PURE__*/(0, _react.isValidElement)(status) ? status : null;
package/dist/cjs/index.js CHANGED
@@ -31,7 +31,7 @@ Object.defineProperty(exports, "AvatarContent", {
31
31
  Object.defineProperty(exports, "AvatarContext", {
32
32
  enumerable: true,
33
33
  get: function get() {
34
- return _context.AvatarContext;
34
+ return _avatarContext.AvatarContext;
35
35
  }
36
36
  });
37
37
  Object.defineProperty(exports, "AvatarItem", {
@@ -79,7 +79,7 @@ Object.defineProperty(exports, "getAppearanceForAppType", {
79
79
  Object.defineProperty(exports, "useAvatarContext", {
80
80
  enumerable: true,
81
81
  get: function get() {
82
- return _context.useAvatarContext;
82
+ return _useAvatarContext.useAvatarContext;
83
83
  }
84
84
  });
85
85
  var _avatar = _interopRequireDefault(require("./avatar"));
@@ -89,5 +89,6 @@ var _presence = _interopRequireDefault(require("./presence"));
89
89
  var _status = _interopRequireDefault(require("./status"));
90
90
  var _skeleton = _interopRequireDefault(require("./skeleton"));
91
91
  var _getAppearance = _interopRequireDefault(require("./get-appearance"));
92
- var _context = require("./context");
92
+ var _avatarContext = require("./avatar-context");
93
+ var _useAvatarContext = require("./use-avatar-context");
93
94
  var _constants = require("./constants");
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useAvatarContext = void 0;
7
+ var _react = require("react");
8
+ var _avatarContext = require("./avatar-context");
9
+ var useAvatarContext = exports.useAvatarContext = function useAvatarContext() {
10
+ return (0, _react.useContext)(_avatarContext.AvatarContext);
11
+ };
@@ -0,0 +1,11 @@
1
+ import { createContext } from 'react';
2
+ /**
3
+ * __Avatar context__
4
+ *
5
+ * An avatar context that provides the size of the avatar to children. Used by AvatarGroup
6
+ *
7
+ * - [Examples](https://atlassian.design/components/avatar/examples)
8
+ * - [Code](https://atlassian.design/components/avatar/code)
9
+ * - [Usage](https://atlassian.design/components/avatar/usage)
10
+ */
11
+ export const AvatarContext = /*#__PURE__*/createContext(undefined);
@@ -6,15 +6,15 @@ import { forwardRef, isValidElement, useCallback, useEffect, useRef } from 'reac
6
6
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
7
7
  import { useId } from '@atlaskit/ds-lib/use-id';
8
8
  import { AvatarContent } from './avatar-content';
9
- import { useAvatarContext } from './context';
10
9
  import AvatarImage from './internal/avatar-image';
11
10
  import { AvatarContentContext } from './internal/content-context';
12
11
  import { EnsureIsInsideAvatarContext } from './internal/ensure-is-inside-avatar-context';
13
12
  import getCustomElement from './internal/get-custom-element';
14
13
  import PresenceWrapper from './internal/presence-wrapper';
15
14
  import StatusWrapper from './internal/status-wrapper';
15
+ import { useAvatarContext } from './use-avatar-context';
16
16
  const packageName = "@atlaskit/avatar";
17
- const packageVersion = "25.11.2";
17
+ const packageVersion = "25.11.3";
18
18
  const containerStyles = null;
19
19
 
20
20
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
@@ -5,5 +5,6 @@ export { default as Presence } from './presence';
5
5
  export { default as Status } from './status';
6
6
  export { default as Skeleton } from './skeleton';
7
7
  export { default as getAppearanceForAppType } from './get-appearance';
8
- export { AvatarContext, useAvatarContext } from './context';
8
+ export { AvatarContext } from './avatar-context';
9
+ export { useAvatarContext } from './use-avatar-context';
9
10
  export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR } from './constants';
@@ -0,0 +1,3 @@
1
+ import { useContext } from 'react';
2
+ import { AvatarContext } from './avatar-context';
3
+ export const useAvatarContext = () => useContext(AvatarContext);
@@ -0,0 +1,11 @@
1
+ import { createContext } from 'react';
2
+ /**
3
+ * __Avatar context__
4
+ *
5
+ * An avatar context that provides the size of the avatar to children. Used by AvatarGroup
6
+ *
7
+ * - [Examples](https://atlassian.design/components/avatar/examples)
8
+ * - [Code](https://atlassian.design/components/avatar/code)
9
+ * - [Usage](https://atlassian.design/components/avatar/usage)
10
+ */
11
+ export var AvatarContext = /*#__PURE__*/createContext(undefined);
@@ -9,15 +9,15 @@ import { forwardRef, isValidElement, useCallback, useEffect, useRef } from 'reac
9
9
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
10
10
  import { useId } from '@atlaskit/ds-lib/use-id';
11
11
  import { AvatarContent } from './avatar-content';
12
- import { useAvatarContext } from './context';
13
12
  import AvatarImage from './internal/avatar-image';
14
13
  import { AvatarContentContext } from './internal/content-context';
15
14
  import { EnsureIsInsideAvatarContext } from './internal/ensure-is-inside-avatar-context';
16
15
  import getCustomElement from './internal/get-custom-element';
17
16
  import PresenceWrapper from './internal/presence-wrapper';
18
17
  import StatusWrapper from './internal/status-wrapper';
18
+ import { useAvatarContext } from './use-avatar-context';
19
19
  var packageName = "@atlaskit/avatar";
20
- var packageVersion = "25.11.2";
20
+ var packageVersion = "25.11.3";
21
21
  var containerStyles = null;
22
22
 
23
23
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
package/dist/esm/index.js CHANGED
@@ -5,5 +5,6 @@ export { default as Presence } from './presence';
5
5
  export { default as Status } from './status';
6
6
  export { default as Skeleton } from './skeleton';
7
7
  export { default as getAppearanceForAppType } from './get-appearance';
8
- export { AvatarContext, useAvatarContext } from './context';
8
+ export { AvatarContext } from './avatar-context';
9
+ export { useAvatarContext } from './use-avatar-context';
9
10
  export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR } from './constants';
@@ -0,0 +1,5 @@
1
+ import { useContext } from 'react';
2
+ import { AvatarContext } from './avatar-context';
3
+ export var useAvatarContext = function useAvatarContext() {
4
+ return useContext(AvatarContext);
5
+ };
@@ -0,0 +1,14 @@
1
+ import { type SizeType } from './types';
2
+ export type AvatarContextProps = {
3
+ size: SizeType;
4
+ };
5
+ /**
6
+ * __Avatar context__
7
+ *
8
+ * An avatar context that provides the size of the avatar to children. Used by AvatarGroup
9
+ *
10
+ * - [Examples](https://atlassian.design/components/avatar/examples)
11
+ * - [Code](https://atlassian.design/components/avatar/code)
12
+ * - [Usage](https://atlassian.design/components/avatar/usage)
13
+ */
14
+ export declare const AvatarContext: import('react').Context<AvatarContextProps | undefined>;
@@ -10,6 +10,8 @@ export type { StatusProps } from './status';
10
10
  export { default as Skeleton } from './skeleton';
11
11
  export type { SkeletonProps } from './skeleton';
12
12
  export { default as getAppearanceForAppType } from './get-appearance';
13
- export { AvatarContext, type AvatarContextProps, useAvatarContext } from './context';
13
+ export { AvatarContext } from './avatar-context';
14
+ export type { AvatarContextProps } from './avatar-context';
15
+ export { useAvatarContext } from './use-avatar-context';
14
16
  export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR } from './constants';
15
17
  export type { AvatarClickEventHandler, AppearanceType, SizeType, Presence as PresenceType, Status as StatusType, IndicatorSizeType, } from './types';
@@ -0,0 +1,2 @@
1
+ import { type AvatarContextProps } from './avatar-context';
2
+ export declare const useAvatarContext: () => AvatarContextProps | undefined;
@@ -0,0 +1,14 @@
1
+ import { type SizeType } from './types';
2
+ export type AvatarContextProps = {
3
+ size: SizeType;
4
+ };
5
+ /**
6
+ * __Avatar context__
7
+ *
8
+ * An avatar context that provides the size of the avatar to children. Used by AvatarGroup
9
+ *
10
+ * - [Examples](https://atlassian.design/components/avatar/examples)
11
+ * - [Code](https://atlassian.design/components/avatar/code)
12
+ * - [Usage](https://atlassian.design/components/avatar/usage)
13
+ */
14
+ export declare const AvatarContext: import('react').Context<AvatarContextProps | undefined>;
@@ -10,6 +10,8 @@ export type { StatusProps } from './status';
10
10
  export { default as Skeleton } from './skeleton';
11
11
  export type { SkeletonProps } from './skeleton';
12
12
  export { default as getAppearanceForAppType } from './get-appearance';
13
- export { AvatarContext, type AvatarContextProps, useAvatarContext } from './context';
13
+ export { AvatarContext } from './avatar-context';
14
+ export type { AvatarContextProps } from './avatar-context';
15
+ export { useAvatarContext } from './use-avatar-context';
14
16
  export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR } from './constants';
15
17
  export type { AvatarClickEventHandler, AppearanceType, SizeType, Presence as PresenceType, Status as StatusType, IndicatorSizeType, } from './types';
@@ -0,0 +1,2 @@
1
+ import { type AvatarContextProps } from './avatar-context';
2
+ export declare const useAvatarContext: () => AvatarContextProps | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "25.11.3",
3
+ "version": "25.11.4",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -25,6 +25,13 @@
25
25
  ],
26
26
  "atlaskit:src": "src/index.tsx",
27
27
  "atlassian": {
28
+ "react-compiler": {
29
+ "enabled": true,
30
+ "gating": {
31
+ "source": "@atlassian/react-compiler-gating",
32
+ "importSpecifierName": "isReactCompilerActivePlatform"
33
+ }
34
+ },
28
35
  "team": "Design System Team",
29
36
  "website": {
30
37
  "name": "Avatar",
@@ -60,6 +67,7 @@
60
67
  "@atlaskit/textfield": "^8.2.0",
61
68
  "@atlaskit/tooltip": "^21.1.0",
62
69
  "@atlassian/feature-flags-test-utils": "^1.0.0",
70
+ "@atlassian/react-compiler-gating": "workspace:^",
63
71
  "@atlassian/ssr-tests": "workspace:^",
64
72
  "@atlassian/structured-docs-types": "workspace:^",
65
73
  "@atlassian/testing-library": "^0.5.0",
@@ -1,24 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useAvatarContext = exports.AvatarContext = void 0;
7
- var _react = require("react");
8
- /**
9
- * __Avatar context__
10
- *
11
- * This allows setting the size of all avatars under a context provider.
12
- *
13
- * ```tsx
14
- * <AvatarContext.Provider value={{ size: 'small' }}>
15
- * <Avatar
16
- * // ...props
17
- * />
18
- * </AvatarContext.Provider>
19
- * ```
20
- */
21
- var AvatarContext = exports.AvatarContext = /*#__PURE__*/(0, _react.createContext)(undefined);
22
- var useAvatarContext = exports.useAvatarContext = function useAvatarContext() {
23
- return (0, _react.useContext)(AvatarContext);
24
- };
@@ -1,16 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
- /**
3
- * __Avatar context__
4
- *
5
- * This allows setting the size of all avatars under a context provider.
6
- *
7
- * ```tsx
8
- * <AvatarContext.Provider value={{ size: 'small' }}>
9
- * <Avatar
10
- * // ...props
11
- * />
12
- * </AvatarContext.Provider>
13
- * ```
14
- */
15
- export const AvatarContext = /*#__PURE__*/createContext(undefined);
16
- export const useAvatarContext = () => useContext(AvatarContext);
@@ -1,18 +0,0 @@
1
- import { createContext, useContext } from 'react';
2
- /**
3
- * __Avatar context__
4
- *
5
- * This allows setting the size of all avatars under a context provider.
6
- *
7
- * ```tsx
8
- * <AvatarContext.Provider value={{ size: 'small' }}>
9
- * <Avatar
10
- * // ...props
11
- * />
12
- * </AvatarContext.Provider>
13
- * ```
14
- */
15
- export var AvatarContext = /*#__PURE__*/createContext(undefined);
16
- export var useAvatarContext = function useAvatarContext() {
17
- return useContext(AvatarContext);
18
- };
@@ -1,19 +0,0 @@
1
- import { type SizeType } from './types';
2
- export type AvatarContextProps = {
3
- size: SizeType;
4
- };
5
- /**
6
- * __Avatar context__
7
- *
8
- * This allows setting the size of all avatars under a context provider.
9
- *
10
- * ```tsx
11
- * <AvatarContext.Provider value={{ size: 'small' }}>
12
- * <Avatar
13
- * // ...props
14
- * />
15
- * </AvatarContext.Provider>
16
- * ```
17
- */
18
- export declare const AvatarContext: import('react').Context<AvatarContextProps | undefined>;
19
- export declare const useAvatarContext: () => AvatarContextProps | undefined;
@@ -1,19 +0,0 @@
1
- import { type SizeType } from './types';
2
- export type AvatarContextProps = {
3
- size: SizeType;
4
- };
5
- /**
6
- * __Avatar context__
7
- *
8
- * This allows setting the size of all avatars under a context provider.
9
- *
10
- * ```tsx
11
- * <AvatarContext.Provider value={{ size: 'small' }}>
12
- * <Avatar
13
- * // ...props
14
- * />
15
- * </AvatarContext.Provider>
16
- * ```
17
- */
18
- export declare const AvatarContext: import('react').Context<AvatarContextProps | undefined>;
19
- export declare const useAvatarContext: () => AvatarContextProps | undefined;