@atlaskit/avatar 25.9.1 → 25.10.0

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.
Files changed (80) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/avatar-content.compiled.css +1 -0
  3. package/dist/cjs/avatar-content.js +26 -23
  4. package/dist/cjs/avatar-item.js +2 -2
  5. package/dist/cjs/avatar.js +11 -9
  6. package/dist/cjs/constants.js +2 -15
  7. package/dist/cjs/context.js +1 -31
  8. package/dist/cjs/get-appearance.js +17 -0
  9. package/dist/cjs/index.js +2 -2
  10. package/dist/cjs/internal/content-context.js +22 -0
  11. package/dist/cjs/internal/ensure-is-inside-avatar-context.js +18 -0
  12. package/dist/cjs/internal/get-custom-element.js +16 -0
  13. package/dist/cjs/internal/presence-wrapper.js +61 -0
  14. package/dist/cjs/internal/status-wrapper.js +60 -0
  15. package/dist/cjs/presence.js +2 -49
  16. package/dist/cjs/status.js +2 -48
  17. package/dist/es2019/avatar-content.compiled.css +1 -0
  18. package/dist/es2019/avatar-content.js +8 -5
  19. package/dist/es2019/avatar-item.js +1 -1
  20. package/dist/es2019/avatar.js +7 -5
  21. package/dist/es2019/constants.js +1 -14
  22. package/dist/es2019/context.js +1 -29
  23. package/dist/es2019/get-appearance.js +11 -0
  24. package/dist/es2019/index.js +1 -1
  25. package/dist/es2019/internal/content-context.js +16 -0
  26. package/dist/es2019/internal/ensure-is-inside-avatar-context.js +13 -0
  27. package/dist/es2019/internal/get-custom-element.js +10 -0
  28. package/dist/es2019/internal/presence-wrapper.js +53 -0
  29. package/dist/es2019/internal/status-wrapper.js +52 -0
  30. package/dist/es2019/presence.js +1 -49
  31. package/dist/es2019/status.js +1 -48
  32. package/dist/esm/avatar-content.compiled.css +1 -0
  33. package/dist/esm/avatar-content.js +26 -23
  34. package/dist/esm/avatar-item.js +1 -1
  35. package/dist/esm/avatar.js +7 -5
  36. package/dist/esm/constants.js +1 -14
  37. package/dist/esm/context.js +0 -30
  38. package/dist/esm/get-appearance.js +11 -0
  39. package/dist/esm/index.js +1 -1
  40. package/dist/esm/internal/content-context.js +16 -0
  41. package/dist/esm/internal/ensure-is-inside-avatar-context.js +13 -0
  42. package/dist/esm/internal/get-custom-element.js +10 -0
  43. package/dist/esm/internal/presence-wrapper.js +52 -0
  44. package/dist/esm/internal/status-wrapper.js +51 -0
  45. package/dist/esm/presence.js +1 -48
  46. package/dist/esm/status.js +1 -47
  47. package/dist/types/constants.d.ts +1 -4
  48. package/dist/types/context.d.ts +1 -36
  49. package/dist/types/get-appearance.d.ts +3 -0
  50. package/dist/types/index.d.ts +1 -1
  51. package/dist/types/internal/content-context.d.ts +29 -0
  52. package/dist/types/internal/ensure-is-inside-avatar-context.d.ts +6 -0
  53. package/dist/types/internal/get-custom-element.d.ts +3 -0
  54. package/dist/types/internal/presence-wrapper.d.ts +19 -0
  55. package/dist/types/internal/status-wrapper.d.ts +19 -0
  56. package/dist/types/presence.d.ts +1 -12
  57. package/dist/types/status.d.ts +1 -12
  58. package/dist/types-ts4.5/constants.d.ts +1 -4
  59. package/dist/types-ts4.5/context.d.ts +1 -36
  60. package/dist/types-ts4.5/get-appearance.d.ts +3 -0
  61. package/dist/types-ts4.5/index.d.ts +1 -1
  62. package/dist/types-ts4.5/internal/content-context.d.ts +29 -0
  63. package/dist/types-ts4.5/internal/ensure-is-inside-avatar-context.d.ts +6 -0
  64. package/dist/types-ts4.5/internal/get-custom-element.d.ts +3 -0
  65. package/dist/types-ts4.5/internal/presence-wrapper.d.ts +19 -0
  66. package/dist/types-ts4.5/internal/status-wrapper.d.ts +19 -0
  67. package/dist/types-ts4.5/presence.d.ts +1 -12
  68. package/dist/types-ts4.5/status.d.ts +1 -12
  69. package/package.json +6 -1
  70. package/dist/cjs/utilities.js +0 -26
  71. package/dist/es2019/utilities.js +0 -19
  72. package/dist/esm/utilities.js +0 -19
  73. package/dist/types/utilities.d.ts +0 -4
  74. package/dist/types-ts4.5/utilities.d.ts +0 -4
  75. /package/dist/cjs/{presence.compiled.css → internal/presence-wrapper.compiled.css} +0 -0
  76. /package/dist/cjs/{status.compiled.css → internal/status-wrapper.compiled.css} +0 -0
  77. /package/dist/es2019/{presence.compiled.css → internal/presence-wrapper.compiled.css} +0 -0
  78. /package/dist/es2019/{status.compiled.css → internal/status-wrapper.compiled.css} +0 -0
  79. /package/dist/esm/{presence.compiled.css → internal/presence-wrapper.compiled.css} +0 -0
  80. /package/dist/esm/{status.compiled.css → internal/status-wrapper.compiled.css} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "25.9.1",
3
+ "version": "25.10.0",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -60,7 +60,9 @@
60
60
  "@atlaskit/section-message": "^8.12.0",
61
61
  "@atlaskit/textfield": "^8.2.0",
62
62
  "@atlaskit/tooltip": "^20.14.0",
63
+ "@atlassian/feature-flags-test-utils": "^1.0.0",
63
64
  "@atlassian/ssr-tests": "workspace:^",
65
+ "@atlassian/testing-library": "^0.4.0",
64
66
  "@testing-library/react": "^16.3.0",
65
67
  "@testing-library/user-event": "^14.4.3",
66
68
  "jest-in-case": "^1.0.2",
@@ -96,6 +98,9 @@
96
98
  "platform.design-system-team.avatar-item-font-size_830x6": {
97
99
  "type": "boolean"
98
100
  },
101
+ "avatar-custom-border": {
102
+ "type": "boolean"
103
+ },
99
104
  "platform_dst_hexagon_avatar_unified_size": {
100
105
  "type": "boolean",
101
106
  "showOnWebsiteForTransitiveDependencies": true
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getAppearanceForAppType = getAppearanceForAppType;
7
- exports.getCustomElement = void 0;
8
- var getCustomElement = exports.getCustomElement = function getCustomElement(isDisabled, href, onClick, ariaHasPopup) {
9
- if (href && !isDisabled) {
10
- return 'a';
11
- }
12
- if (onClick || isDisabled || ariaHasPopup) {
13
- return 'button';
14
- }
15
- return 'span';
16
- };
17
- function getAppearanceForAppType(appType) {
18
- switch (appType) {
19
- case 'agent':
20
- return 'hexagon';
21
- case 'user':
22
- case 'system':
23
- default:
24
- return 'circle';
25
- }
26
- }
@@ -1,19 +0,0 @@
1
- export const getCustomElement = (isDisabled, href, onClick, ariaHasPopup) => {
2
- if (href && !isDisabled) {
3
- return 'a';
4
- }
5
- if (onClick || isDisabled || ariaHasPopup) {
6
- return 'button';
7
- }
8
- return 'span';
9
- };
10
- export function getAppearanceForAppType(appType) {
11
- switch (appType) {
12
- case 'agent':
13
- return 'hexagon';
14
- case 'user':
15
- case 'system':
16
- default:
17
- return 'circle';
18
- }
19
- }
@@ -1,19 +0,0 @@
1
- export var getCustomElement = function getCustomElement(isDisabled, href, onClick, ariaHasPopup) {
2
- if (href && !isDisabled) {
3
- return 'a';
4
- }
5
- if (onClick || isDisabled || ariaHasPopup) {
6
- return 'button';
7
- }
8
- return 'span';
9
- };
10
- export function getAppearanceForAppType(appType) {
11
- switch (appType) {
12
- case 'agent':
13
- return 'hexagon';
14
- case 'user':
15
- case 'system':
16
- default:
17
- return 'circle';
18
- }
19
- }
@@ -1,4 +0,0 @@
1
- import { type MouseEventHandler } from 'react';
2
- import type { AppearanceType } from './types';
3
- export declare const getCustomElement: (isDisabled?: boolean, href?: string, onClick?: MouseEventHandler, ariaHasPopup?: boolean | 'dialog') => 'a' | 'button' | 'span';
4
- export declare function getAppearanceForAppType(appType: string | null | undefined): AppearanceType;
@@ -1,4 +0,0 @@
1
- import { type MouseEventHandler } from 'react';
2
- import type { AppearanceType } from './types';
3
- export declare const getCustomElement: (isDisabled?: boolean, href?: string, onClick?: MouseEventHandler, ariaHasPopup?: boolean | 'dialog') => 'a' | 'button' | 'span';
4
- export declare function getAppearanceForAppType(appType: string | null | undefined): AppearanceType;