@atlaskit/avatar 21.0.0 → 21.0.2

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 (35) hide show
  1. package/Avatar/package.json +8 -1
  2. package/AvatarItem/package.json +8 -1
  3. package/CHANGELOG.md +12 -0
  4. package/Presence/package.json +8 -1
  5. package/Skeleton/package.json +8 -1
  6. package/Status/package.json +8 -1
  7. package/dist/cjs/Avatar.js +2 -2
  8. package/dist/cjs/AvatarItem.js +1 -1
  9. package/dist/cjs/version.json +1 -1
  10. package/dist/es2019/Avatar.js +1 -1
  11. package/dist/es2019/version.json +1 -1
  12. package/dist/esm/Avatar.js +2 -2
  13. package/dist/esm/AvatarItem.js +1 -1
  14. package/dist/esm/version.json +1 -1
  15. package/dist/types-ts4.0/Avatar.d.ts +106 -0
  16. package/dist/types-ts4.0/AvatarImage.d.ts +19 -0
  17. package/dist/types-ts4.0/AvatarItem.d.ts +79 -0
  18. package/dist/types-ts4.0/IconWrapper.d.ts +13 -0
  19. package/dist/types-ts4.0/Presence.d.ts +45 -0
  20. package/dist/types-ts4.0/Skeleton.d.ts +19 -0
  21. package/dist/types-ts4.0/Status.d.ts +42 -0
  22. package/dist/types-ts4.0/Text.d.ts +13 -0
  23. package/dist/types-ts4.0/constants.d.ts +7 -0
  24. package/dist/types-ts4.0/entry-points/avatar-item.d.ts +2 -0
  25. package/dist/types-ts4.0/entry-points/avatar.d.ts +1 -0
  26. package/dist/types-ts4.0/entry-points/presence.d.ts +2 -0
  27. package/dist/types-ts4.0/entry-points/skeleton.d.ts +2 -0
  28. package/dist/types-ts4.0/entry-points/status.d.ts +2 -0
  29. package/dist/types-ts4.0/entry-points/types.d.ts +1 -0
  30. package/dist/types-ts4.0/index.d.ts +12 -0
  31. package/dist/types-ts4.0/types.d.ts +7 -0
  32. package/dist/types-ts4.0/utilities.d.ts +11 -0
  33. package/package.json +18 -8
  34. package/report.api.md +320 -0
  35. package/types/package.json +8 -1
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/avatar.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/avatar.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/avatar.d.ts"
7
+ "types": "../dist/types/entry-points/avatar.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/avatar.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/avatar-item.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/avatar-item.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/avatar-item.d.ts"
7
+ "types": "../dist/types/entry-points/avatar-item.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/avatar-item.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 21.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade Typescript from `4.3.5` to `4.5.5`
8
+
9
+ ## 21.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade Typescript from `4.2.4` to `4.3.5`.
14
+
3
15
  ## 21.0.0
4
16
 
5
17
  ### Major Changes
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/presence.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/presence.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/presence.d.ts"
7
+ "types": "../dist/types/entry-points/presence.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/presence.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/skeleton.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/skeleton.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/skeleton.d.ts"
7
+ "types": "../dist/types/entry-points/skeleton.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/skeleton.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/status.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/status.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/status.d.ts"
7
+ "types": "../dist/types/entry-points/status.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/status.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }
@@ -38,7 +38,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
38
38
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
39
39
 
40
40
  var packageName = "@atlaskit/avatar";
41
- var packageVersion = "21.0.0";
41
+ var packageVersion = "21.0.2";
42
42
 
43
43
  var getStyles = function getStyles(css, _ref) {
44
44
  var size = _ref.size,
@@ -50,7 +50,7 @@ var getStyles = function getStyles(css, _ref) {
50
50
  isInteractive = _ref.isInteractive,
51
51
  isDisabled = _ref.isDisabled;
52
52
  return (//eslint-disable-next-line @repo/internal/react/no-css-string-literals
53
- css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", "px;\n width: ", "px;\n align-items: stretch;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: content-box;\n cursor: inherit;\n display: flex;\n flex-direction: column;\n justify-content: center;\n outline: none;\n overflow: hidden;\n position: static;\n transform: translateZ(0);\n transition: transform 200ms, opacity 200ms;\n box-shadow: 0 0 0 ", "px ", ";\n border: none;\n margin: ", "px;\n padding: 0;\n\n /* Added font-size and font-family styles to fix alignment issue in firefox for interactive button avatar */\n font-size: inherit;\n font-family: inherit;\n\n &::-moz-focus-inner {\n border: 0;\n margin: 0;\n padding: 0;\n }\n\n &::after {\n background-color: transparent;\n bottom: 0px;\n\n /* Added border-radius style to fix hover issue in safari */\n border-radius: ", ";\n content: ' ';\n left: 0px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n right: 0px;\n top: 0px;\n transition: opacity 200ms;\n width: 100%;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), size, size, borderColor, appearance === 'circle' ? '50%' : "".concat(radius, "px"), _constants.BORDER_WIDTH, borderColor, _constants.BORDER_WIDTH, appearance === 'circle' ? '50%' : "".concat(radius, "px"), stackIndex && "position: relative;", isInteractive && "\n cursor: pointer;\n\n :focus {\n outline: none;\n box-shadow: 0 0 0 ".concat(_constants.BORDER_WIDTH, "px ").concat("var(--ds-border-focused, ".concat(_colors.B300, ")"), "\n }\n\n :hover {\n &::after {\n background-color: ").concat("var(--ds-interaction-hovered, ".concat(_colors.N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n &::after {\n background-color: ").concat("var(--ds-interaction-pressed, ".concat(_colors.N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n transform: scale(").concat(_constants.ACTIVE_SCALE_FACTOR, ");\n }\n\n @media screen and (forced-colors: active) {\n &:focus-visible {\n outline: 1px solid\n }\n }\n "), isDisabled && "\n cursor: not-allowed;\n\n &::after {\n opacity: 0.7;\n pointer-events: none;\n background-color: ".concat("var(--ds-surface, ".concat(_colors.N0, ")"), ";\n }\n "))
53
+ css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n height: ", "px;\n width: ", "px;\n align-items: stretch;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: content-box;\n cursor: inherit;\n display: flex;\n flex-direction: column;\n justify-content: center;\n outline: none;\n overflow: hidden;\n position: static;\n transform: translateZ(0);\n transition: transform 200ms, opacity 200ms;\n box-shadow: 0 0 0 ", "px ", ";\n border: none;\n margin: ", "px;\n padding: 0;\n\n /* Added font-size and font-family styles to fix alignment issue in firefox for interactive button avatar */\n font-size: inherit;\n font-family: inherit;\n\n &::-moz-focus-inner {\n border: 0;\n margin: 0;\n padding: 0;\n }\n\n &::after {\n background-color: transparent;\n bottom: 0px;\n\n /* Added border-radius style to fix hover issue in safari */\n border-radius: ", ";\n content: ' ';\n left: 0px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n right: 0px;\n top: 0px;\n transition: opacity 200ms;\n width: 100%;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), size, size, borderColor, appearance === 'circle' ? '50%' : "".concat(radius, "px"), _constants.BORDER_WIDTH, borderColor, _constants.BORDER_WIDTH, appearance === 'circle' ? '50%' : "".concat(radius, "px"), stackIndex && "position: relative;", isInteractive && "\n cursor: pointer;\n\n :focus {\n outline: none;\n box-shadow: 0 0 0 ".concat(_constants.BORDER_WIDTH, "px ", "var(--ds-border-focused, ".concat(_colors.B300, ")"), "\n }\n\n :hover {\n &::after {\n background-color: ", "var(--ds-interaction-hovered, ".concat(_colors.N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n &::after {\n background-color: ", "var(--ds-interaction-pressed, ".concat(_colors.N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n transform: scale(").concat(_constants.ACTIVE_SCALE_FACTOR, ");\n }\n\n @media screen and (forced-colors: active) {\n &:focus-visible {\n outline: 1px solid\n }\n }\n "), isDisabled && "\n cursor: not-allowed;\n\n &::after {\n opacity: 0.7;\n pointer-events: none;\n background-color: ".concat("var(--ds-surface, ".concat(_colors.N0, ")"), ";\n }\n "))
54
54
  );
55
55
  };
56
56
  /**
@@ -44,7 +44,7 @@ var getStyles = function getStyles(css, _ref) {
44
44
  isInteractive = _ref.isInteractive,
45
45
  isDisabled = _ref.isDisabled;
46
46
  return (//eslint-disable-next-line @repo/internal/react/no-css-string-literals
47
- css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background-color: ", ";\n border-radius: ", "px;\n border: ", "px solid transparent;\n box-sizing: border-box;\n color: inherit;\n display: flex;\n font-size: inherit;\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n outline: none;\n margin: 0;\n padding: ", "px;\n text-align: left;\n text-decoration: none;\n width: 100%;\n\n ", "\n\n ", "\n "])), backgroundColor, (0, _constants.borderRadius)(), _constants2.BORDER_WIDTH, (0, _constants.gridSize)() / 2, isInteractive && "\n :hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat((0, _colors.backgroundHover)(), ")"), ";\n cursor: pointer;\n text-decoration: none;\n }\n\n :focus {\n outline: none;\n border-color: ").concat("var(--ds-border-focused, ".concat(_colors.B200, ")"), ";\n }\n\n :active {\n background-color: ").concat("var(--ds-background-neutral-subtle-pressed, ".concat((0, _colors.backgroundActive)(), ")"), ";\n }\n "), isDisabled && "\n cursor: not-allowed;\n opacity: 0.5;\n pointer-events: none;\n ")
47
+ css(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n background-color: ", ";\n border-radius: ", "px;\n border: ", "px solid transparent;\n box-sizing: border-box;\n color: inherit;\n display: flex;\n font-size: inherit;\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n outline: none;\n margin: 0;\n padding: ", "px;\n text-align: left;\n text-decoration: none;\n width: 100%;\n\n ", "\n\n ", "\n "])), backgroundColor, (0, _constants.borderRadius)(), _constants2.BORDER_WIDTH, (0, _constants.gridSize)() / 2, isInteractive && "\n :hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat((0, _colors.backgroundHover)(), ")"), ";\n cursor: pointer;\n text-decoration: none;\n }\n\n :focus {\n outline: none;\n border-color: ", "var(--ds-border-focused, ".concat(_colors.B200, ")"), ";\n }\n\n :active {\n background-color: ", "var(--ds-background-neutral-subtle-pressed, ".concat((0, _colors.backgroundActive)(), ")"), ";\n }\n "), isDisabled && "\n cursor: not-allowed;\n opacity: 0.5;\n pointer-events: none;\n ")
48
48
  );
49
49
  };
50
50
  /**
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.0.0",
3
+ "version": "21.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -10,7 +10,7 @@ import { PresenceWrapper } from './Presence';
10
10
  import { StatusWrapper } from './Status';
11
11
  import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
12
12
  const packageName = "@atlaskit/avatar";
13
- const packageVersion = "21.0.0";
13
+ const packageVersion = "21.0.2";
14
14
 
15
15
  const getStyles = (css, {
16
16
  size,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.0.0",
3
+ "version": "21.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -20,7 +20,7 @@ import { PresenceWrapper } from './Presence';
20
20
  import { StatusWrapper } from './Status';
21
21
  import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
22
22
  var packageName = "@atlaskit/avatar";
23
- var packageVersion = "21.0.0";
23
+ var packageVersion = "21.0.2";
24
24
 
25
25
  var getStyles = function getStyles(css, _ref) {
26
26
  var size = _ref.size,
@@ -32,7 +32,7 @@ var getStyles = function getStyles(css, _ref) {
32
32
  isInteractive = _ref.isInteractive,
33
33
  isDisabled = _ref.isDisabled;
34
34
  return (//eslint-disable-next-line @repo/internal/react/no-css-string-literals
35
- css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", "px;\n width: ", "px;\n align-items: stretch;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: content-box;\n cursor: inherit;\n display: flex;\n flex-direction: column;\n justify-content: center;\n outline: none;\n overflow: hidden;\n position: static;\n transform: translateZ(0);\n transition: transform 200ms, opacity 200ms;\n box-shadow: 0 0 0 ", "px ", ";\n border: none;\n margin: ", "px;\n padding: 0;\n\n /* Added font-size and font-family styles to fix alignment issue in firefox for interactive button avatar */\n font-size: inherit;\n font-family: inherit;\n\n &::-moz-focus-inner {\n border: 0;\n margin: 0;\n padding: 0;\n }\n\n &::after {\n background-color: transparent;\n bottom: 0px;\n\n /* Added border-radius style to fix hover issue in safari */\n border-radius: ", ";\n content: ' ';\n left: 0px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n right: 0px;\n top: 0px;\n transition: opacity 200ms;\n width: 100%;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), size, size, borderColor, appearance === 'circle' ? '50%' : "".concat(radius, "px"), BORDER_WIDTH, borderColor, BORDER_WIDTH, appearance === 'circle' ? '50%' : "".concat(radius, "px"), stackIndex && "position: relative;", isInteractive && "\n cursor: pointer;\n\n :focus {\n outline: none;\n box-shadow: 0 0 0 ".concat(BORDER_WIDTH, "px ").concat("var(--ds-border-focused, ".concat(B300, ")"), "\n }\n\n :hover {\n &::after {\n background-color: ").concat("var(--ds-interaction-hovered, ".concat(N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n &::after {\n background-color: ").concat("var(--ds-interaction-pressed, ".concat(N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n transform: scale(").concat(ACTIVE_SCALE_FACTOR, ");\n }\n\n @media screen and (forced-colors: active) {\n &:focus-visible {\n outline: 1px solid\n }\n }\n "), isDisabled && "\n cursor: not-allowed;\n\n &::after {\n opacity: 0.7;\n pointer-events: none;\n background-color: ".concat("var(--ds-surface, ".concat(N0, ")"), ";\n }\n "))
35
+ css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", "px;\n width: ", "px;\n align-items: stretch;\n background-color: ", ";\n border-radius: ", ";\n box-sizing: content-box;\n cursor: inherit;\n display: flex;\n flex-direction: column;\n justify-content: center;\n outline: none;\n overflow: hidden;\n position: static;\n transform: translateZ(0);\n transition: transform 200ms, opacity 200ms;\n box-shadow: 0 0 0 ", "px ", ";\n border: none;\n margin: ", "px;\n padding: 0;\n\n /* Added font-size and font-family styles to fix alignment issue in firefox for interactive button avatar */\n font-size: inherit;\n font-family: inherit;\n\n &::-moz-focus-inner {\n border: 0;\n margin: 0;\n padding: 0;\n }\n\n &::after {\n background-color: transparent;\n bottom: 0px;\n\n /* Added border-radius style to fix hover issue in safari */\n border-radius: ", ";\n content: ' ';\n left: 0px;\n opacity: 0;\n pointer-events: none;\n position: absolute;\n right: 0px;\n top: 0px;\n transition: opacity 200ms;\n width: 100%;\n }\n\n ", "\n\n ", "\n\n ", "\n "])), size, size, borderColor, appearance === 'circle' ? '50%' : "".concat(radius, "px"), BORDER_WIDTH, borderColor, BORDER_WIDTH, appearance === 'circle' ? '50%' : "".concat(radius, "px"), stackIndex && "position: relative;", isInteractive && "\n cursor: pointer;\n\n :focus {\n outline: none;\n box-shadow: 0 0 0 ".concat(BORDER_WIDTH, "px ", "var(--ds-border-focused, ".concat(B300, ")"), "\n }\n\n :hover {\n &::after {\n background-color: ", "var(--ds-interaction-hovered, ".concat(N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n &::after {\n background-color: ", "var(--ds-interaction-pressed, ".concat(N70A, ")"), ";\n opacity: 1;\n }\n }\n\n :active {\n transform: scale(").concat(ACTIVE_SCALE_FACTOR, ");\n }\n\n @media screen and (forced-colors: active) {\n &:focus-visible {\n outline: 1px solid\n }\n }\n "), isDisabled && "\n cursor: not-allowed;\n\n &::after {\n opacity: 0.7;\n pointer-events: none;\n background-color: ".concat("var(--ds-surface, ".concat(N0, ")"), ";\n }\n "))
36
36
  );
37
37
  };
38
38
  /**
@@ -29,7 +29,7 @@ var getStyles = function getStyles(css, _ref) {
29
29
  isInteractive = _ref.isInteractive,
30
30
  isDisabled = _ref.isDisabled;
31
31
  return (//eslint-disable-next-line @repo/internal/react/no-css-string-literals
32
- css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n background-color: ", ";\n border-radius: ", "px;\n border: ", "px solid transparent;\n box-sizing: border-box;\n color: inherit;\n display: flex;\n font-size: inherit;\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n outline: none;\n margin: 0;\n padding: ", "px;\n text-align: left;\n text-decoration: none;\n width: 100%;\n\n ", "\n\n ", "\n "])), backgroundColor, borderRadius(), BORDER_WIDTH, gridSize() / 2, isInteractive && "\n :hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(backgroundHover(), ")"), ";\n cursor: pointer;\n text-decoration: none;\n }\n\n :focus {\n outline: none;\n border-color: ").concat("var(--ds-border-focused, ".concat(B200, ")"), ";\n }\n\n :active {\n background-color: ").concat("var(--ds-background-neutral-subtle-pressed, ".concat(backgroundActive(), ")"), ";\n }\n "), isDisabled && "\n cursor: not-allowed;\n opacity: 0.5;\n pointer-events: none;\n ")
32
+ css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n background-color: ", ";\n border-radius: ", "px;\n border: ", "px solid transparent;\n box-sizing: border-box;\n color: inherit;\n display: flex;\n font-size: inherit;\n font-style: normal;\n font-weight: normal;\n line-height: 1;\n outline: none;\n margin: 0;\n padding: ", "px;\n text-align: left;\n text-decoration: none;\n width: 100%;\n\n ", "\n\n ", "\n "])), backgroundColor, borderRadius(), BORDER_WIDTH, gridSize() / 2, isInteractive && "\n :hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(backgroundHover(), ")"), ";\n cursor: pointer;\n text-decoration: none;\n }\n\n :focus {\n outline: none;\n border-color: ", "var(--ds-border-focused, ".concat(B200, ")"), ";\n }\n\n :active {\n background-color: ", "var(--ds-background-neutral-subtle-pressed, ".concat(backgroundActive(), ")"), ";\n }\n "), isDisabled && "\n cursor: not-allowed;\n opacity: 0.5;\n pointer-events: none;\n ")
33
33
  );
34
34
  };
35
35
  /**
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.0.0",
3
+ "version": "21.0.2",
4
4
  "sideEffects": false
5
5
  }
@@ -0,0 +1,106 @@
1
+ /** @jsx jsx */
2
+ import { MouseEventHandler, ReactNode, Ref } from 'react';
3
+ import { AppearanceType, AvatarClickEventHandler, SizeType } from './types';
4
+ export interface CustomAvatarProps {
5
+ /**
6
+ * This is used in render props so is okay to be defined.
7
+ * eslint-disable-next-line consistent-props-definitions
8
+ */
9
+ 'aria-label'?: string;
10
+ tabIndex?: number;
11
+ testId?: string;
12
+ onClick?: MouseEventHandler;
13
+ className?: string;
14
+ href?: string;
15
+ children: ReactNode;
16
+ ref: Ref<HTMLElement>;
17
+ }
18
+ export interface AvatarPropTypes {
19
+ /**
20
+ * Indicates the shape of the avatar. Most avatars are circular, but square avatars
21
+ * can be used for 'container' objects.
22
+ */
23
+ appearance?: AppearanceType;
24
+ /**
25
+ * Used to provide better content to screen readers when using presence/status. Rather
26
+ * than a screen reader speaking "online, approved, John Smith", passing in a label
27
+ * allows a custom message like "John Smith (approved and online)".
28
+ */
29
+ label?: string;
30
+ /**
31
+ * Used to override the default border color around the avatar body.
32
+ * Accepts any color argument that the border-color CSS property accepts.
33
+ */
34
+ borderColor?: string;
35
+ /**
36
+ * Supply a custom avatar component instead of the default
37
+ */
38
+ children?: (props: CustomAvatarProps) => ReactNode;
39
+ /**
40
+ * Provides a url for avatars being used as a link.
41
+ */
42
+ href?: string;
43
+ /**
44
+ * Change the style to indicate the avatar is disabled.
45
+ */
46
+ isDisabled?: boolean;
47
+ /**
48
+ * Provides alt text for the avatar image.
49
+ */
50
+ name?: string;
51
+ /**
52
+ * Indicates a user's online status by showing a small icon on the avatar.
53
+ * Refer to presence values on the Presence component.
54
+ * Alternatively accepts any React element. For best results, it is recommended to
55
+ * use square content with height and width of 100%.
56
+ */
57
+ presence?: ('online' | 'busy' | 'focus' | 'offline') | ReactNode;
58
+ /**
59
+ * Defines the size of the avatar
60
+ */
61
+ size?: SizeType;
62
+ /**
63
+ * A url to load an image from (this can also be a base64 encoded image).
64
+ */
65
+ src?: string;
66
+ /**
67
+ * Indicates contextual information by showing a small icon on the avatar.
68
+ * Refer to status values on the Status component.
69
+ */
70
+ status?: ('approved' | 'declined' | 'locked') | ReactNode;
71
+ /**
72
+ * The index of where this avatar is in the group `stack`.
73
+ */
74
+ stackIndex?: number;
75
+ /**
76
+ * Assign specific tabIndex order to the underlying node.
77
+ */
78
+ tabIndex?: number;
79
+ /**
80
+ * Pass target down to the anchor, if href is provided.
81
+ */
82
+ target?: '_blank' | '_self' | '_top' | '_parent';
83
+ /**
84
+ * Handler to be called on click.
85
+ */
86
+ onClick?: AvatarClickEventHandler;
87
+ /**
88
+ * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
89
+ */
90
+ testId?: string;
91
+ /**
92
+ * Analytics context meta data
93
+ */
94
+ analyticsContext?: Record<string, any>;
95
+ }
96
+ /**
97
+ * __Avatar__
98
+ *
99
+ * An avatar is a visual representation of a user or entity.
100
+ *
101
+ * - [Examples](https://atlassian.design/components/avatar/examples)
102
+ * - [Code](https://atlassian.design/components/avatar/code)
103
+ * - [Usage](https://atlassian.design/components/avatar/usage)
104
+ */
105
+ declare const Avatar: import("react").ForwardRefExoticComponent<AvatarPropTypes & import("react").RefAttributes<HTMLElement>>;
106
+ export default Avatar;
@@ -0,0 +1,19 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ import { AppearanceType, SizeType } from './types';
4
+ interface AvatarImageProps {
5
+ appearance: AppearanceType;
6
+ size: SizeType;
7
+ alt?: string;
8
+ src?: string;
9
+ testId?: string;
10
+ }
11
+ export declare const ICON_BACKGROUND: "var(--ds-icon-inverse)";
12
+ export declare const ICON_COLOR: "var(--ds-icon-subtle)";
13
+ /**
14
+ * __Avatar image__
15
+ *
16
+ * An avatar image is an internal component used to control the rendering phases of an image.
17
+ */
18
+ declare const AvatarImage: FC<AvatarImageProps>;
19
+ export default AvatarImage;
@@ -0,0 +1,79 @@
1
+ /** @jsx jsx */
2
+ import { MouseEventHandler, ReactNode, Ref } from 'react';
3
+ import { AvatarClickEventHandler } from './types';
4
+ export interface CustomAvatarItemProps {
5
+ testId?: string;
6
+ onClick?: MouseEventHandler;
7
+ className?: string;
8
+ href?: string;
9
+ children: ReactNode;
10
+ ref: Ref<HTMLElement>;
11
+ /**
12
+ * This is used in render props so is okay to be defined.
13
+ * eslint-disable-next-line consistent-props-definitions
14
+ */
15
+ 'aria-label'?: string;
16
+ 'aria-disabled'?: boolean | 'false' | 'true' | undefined;
17
+ }
18
+ export interface AvatarItemProps {
19
+ /**
20
+ * Used to provide better content to screen readers when using presence/status. Rather
21
+ * than a screen reader speaking "online, approved, John Smith", passing in an label
22
+ * allows a custom message like "John Smith (approved and online)".
23
+ */
24
+ label?: string;
25
+ /**
26
+ * Slot to place an avatar element. Use @atlaskit/avatar.
27
+ */
28
+ avatar: ReactNode;
29
+ /**
30
+ * Change background color.
31
+ */
32
+ backgroundColor?: string;
33
+ /**
34
+ * Use a custom component instead of the default span.
35
+ */
36
+ children?: (props: CustomAvatarItemProps) => ReactNode;
37
+ /**
38
+ * URL for avatars being used as a link.
39
+ */
40
+ href?: string;
41
+ /**
42
+ * Disable the item from being interactive
43
+ */
44
+ isDisabled?: boolean;
45
+ /**
46
+ * Handler to be called on click.
47
+ */
48
+ onClick?: AvatarClickEventHandler;
49
+ /**
50
+ * PrimaryText text.
51
+ */
52
+ primaryText?: ReactNode;
53
+ /**
54
+ * SecondaryText text.
55
+ */
56
+ secondaryText?: ReactNode;
57
+ /**
58
+ * Pass target down to the anchor, if href is provided.
59
+ */
60
+ target?: '_blank' | '_self' | '_top' | '_parent';
61
+ /**
62
+ * By default, overflowing text is truncated if it exceeds the container width. Use this prop to disable this.
63
+ */
64
+ isTruncationDisabled?: boolean;
65
+ /**
66
+ * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
67
+ */
68
+ testId?: string;
69
+ }
70
+ /**
71
+ * __Avatar item__
72
+ *
73
+ * An avatar item is a wrapper that goes around an avatar when it's displayed alongside text, such as a name or status.
74
+ *
75
+ * - [Examples](https://atlassian.design/components/avatar/avatar-item/examples)
76
+ * - [Code](https://atlassian.design/components/avatar/avatar-item/code)
77
+ */
78
+ declare const AvatarItem: import("react").ForwardRefExoticComponent<AvatarItemProps & import("react").RefAttributes<HTMLElement>>;
79
+ export default AvatarItem;
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ interface IconWrapperProps {
4
+ bgColor?: string;
5
+ children?: ReactNode;
6
+ }
7
+ /**
8
+ * __Icon wrapper__
9
+ *
10
+ * An icon wrapper is used internally only.
11
+ */
12
+ declare const IconWrapper: FC<IconWrapperProps>;
13
+ export default IconWrapper;
@@ -0,0 +1,45 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { AppearanceType, IndicatorSizeType } from './types';
3
+ export declare type PresenceType = 'busy' | 'focus' | 'offline' | 'online' | ReactNode;
4
+ export interface PresenceProps {
5
+ /**
6
+ * Used to override the default border color of the presence indicator.
7
+ * Accepts any color argument that the border-color CSS property accepts.
8
+ */
9
+ borderColor?: string;
10
+ /**
11
+ * Content to use as a custom presence indicator (usually not required if
12
+ * consuming Presence separate to Avatar).
13
+ */
14
+ children?: ReactNode;
15
+ /**
16
+ * The type of presence indicator to show
17
+ */
18
+ presence?: PresenceType;
19
+ /**
20
+ * Test Id
21
+ */
22
+ testId?: string;
23
+ }
24
+ /**
25
+ * __Avatar presence__
26
+ *
27
+ * A presence shows an avatar’s availability.
28
+ *
29
+ * - [Examples](https://atlassian.design/components/avatar/avatar-presence/examples)
30
+ * - [Code](https://atlassian.design/components/avatar/avatar-presence/code)
31
+ * - [Usage](https://atlassian.design/components/avatar/avatar-presence/usage)
32
+ */
33
+ declare const AvatarPresence: FC<PresenceProps>;
34
+ export default AvatarPresence;
35
+ export interface PresenceWrapperProps extends PresenceProps {
36
+ appearance: AppearanceType;
37
+ size: IndicatorSizeType;
38
+ testId?: string;
39
+ }
40
+ /**
41
+ * __Presence wrapper__
42
+ *
43
+ * A presence wrapper is used internally to position presence ontop of the avatar.
44
+ */
45
+ export declare const PresenceWrapper: FC<PresenceWrapperProps>;
@@ -0,0 +1,19 @@
1
+ /** @jsx jsx */
2
+ import { FC } from 'react';
3
+ import { AppearanceType, SizeType } from './types';
4
+ export interface SkeletonProps {
5
+ appearance?: AppearanceType;
6
+ color?: string;
7
+ size?: SizeType;
8
+ weight?: 'normal' | 'strong';
9
+ }
10
+ /**
11
+ * __Skeleton__
12
+ *
13
+ * A skeleton is the loading state for the avatar component.
14
+ *
15
+ * - [Examples](https://atlassian.design/components/avatar/avatar-skeleton/examples)
16
+ * - [Code](https://atlassian.design/components/avatar/avatar-skeleton/code)
17
+ */
18
+ declare const Skeleton: FC<SkeletonProps>;
19
+ export default Skeleton;
@@ -0,0 +1,42 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { AppearanceType, IndicatorSizeType } from './types';
3
+ export declare type StatusType = ('approved' | 'declined' | 'locked') | ReactNode;
4
+ export interface StatusProps {
5
+ /**
6
+ * Override the default border color of the status indicator. This accepts
7
+ * any color argument that the CSS property `border-color` accepts.
8
+ */
9
+ borderColor?: string;
10
+ /**
11
+ * Content to use as a custom status indicator. Not needed if consuming
12
+ * `Status` separate to `Avatar`.
13
+ */
14
+ children?: ReactNode;
15
+ /**
16
+ * Content to use as a custom status indicator. Not needed if consuming
17
+ * `Status` separate to `Avatar`.
18
+ */
19
+ status?: StatusType;
20
+ }
21
+ /**
22
+ * __Avatar status__
23
+ *
24
+ * An avatar status shows contextual information, such as if someone approves or declines something.
25
+ *
26
+ * - [Examples](https://atlassian.design/components/avatar/avatar-status/examples)
27
+ * - [Code](https://atlassian.design/components/avatar/avatar-status/code)
28
+ */
29
+ declare const AvatarStatus: FC<StatusProps>;
30
+ export default AvatarStatus;
31
+ interface StatusWrapperProps extends StatusProps {
32
+ appearance: AppearanceType;
33
+ size: IndicatorSizeType;
34
+ children: ReactNode;
35
+ testId?: string;
36
+ }
37
+ /**
38
+ * Status wrapper**
39
+ *
40
+ * A status wrapper is used internally to position status ontop of the avatar.
41
+ */
42
+ export declare const StatusWrapper: FC<StatusWrapperProps>;
@@ -0,0 +1,13 @@
1
+ /** @jsx jsx */
2
+ import { FC, ReactNode } from 'react';
3
+ /**
4
+ * __Text__
5
+ *
6
+ * Text is used internally only.
7
+ */
8
+ declare const Text: FC<{
9
+ isSecondary?: boolean;
10
+ children: ReactNode;
11
+ shouldTruncate: boolean;
12
+ }>;
13
+ export default Text;
@@ -0,0 +1,7 @@
1
+ import { AvatarSizeMap, IndicatorSizeType } from './types';
2
+ export declare const AVATAR_SIZES: AvatarSizeMap;
3
+ export declare const AVATAR_RADIUS: AvatarSizeMap;
4
+ export declare const BORDER_WIDTH = 2;
5
+ export declare const ACTIVE_SCALE_FACTOR = 0.9;
6
+ export declare const ICON_SIZES: Record<IndicatorSizeType, number>;
7
+ export declare const ICON_OFFSET: Record<IndicatorSizeType, number>;
@@ -0,0 +1,2 @@
1
+ export { default } from '../AvatarItem';
2
+ export type { AvatarItemProps, CustomAvatarItemProps } from '../AvatarItem';
@@ -0,0 +1 @@
1
+ export { default } from '../Avatar';
@@ -0,0 +1,2 @@
1
+ export { default } from '../Presence';
2
+ export type { PresenceType, PresenceProps } from '../Presence';
@@ -0,0 +1,2 @@
1
+ export { default } from '../Skeleton';
2
+ export type { SkeletonProps } from '../Skeleton';
@@ -0,0 +1,2 @@
1
+ export { default } from '../Status';
2
+ export type { StatusType, StatusProps } from '../Status';
@@ -0,0 +1 @@
1
+ export type { AppearanceType, SizeType, IndicatorSizeType, AvatarClickEventHandler, } from '../types';
@@ -0,0 +1,12 @@
1
+ export { default } from './Avatar';
2
+ export type { AvatarPropTypes, CustomAvatarProps } from './Avatar';
3
+ export { default as AvatarItem } from './AvatarItem';
4
+ export type { AvatarItemProps, CustomAvatarItemProps } from './AvatarItem';
5
+ export { default as Presence } from './Presence';
6
+ export type { PresenceProps, PresenceType } from './Presence';
7
+ export { default as Status } from './Status';
8
+ export type { StatusProps, StatusType } from './Status';
9
+ export { default as Skeleton } from './Skeleton';
10
+ export type { SkeletonProps } from './Skeleton';
11
+ export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR, } from './constants';
12
+ export type { AvatarClickEventHandler, AppearanceType, SizeType, IndicatorSizeType, } from './types';
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
3
+ export declare type AvatarSizeMap = Record<SizeType, number>;
4
+ export declare type AppearanceType = 'circle' | 'square';
5
+ export declare type SizeType = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
6
+ export declare type IndicatorSizeType = 'small' | 'medium' | 'large' | 'xlarge';
7
+ export declare type AvatarClickEventHandler = (event: React.MouseEvent, analyticsEvent?: UIAnalyticsEvent) => void;
@@ -0,0 +1,11 @@
1
+ import { MouseEventHandler } from 'react';
2
+ export declare const getLinkProps: (href: string, target?: string | undefined) => {
3
+ href: string;
4
+ rel: string | null;
5
+ target: string | undefined;
6
+ };
7
+ export declare const getButtonProps: (onClick: MouseEventHandler) => {
8
+ type: string;
9
+ onClick: MouseEventHandler<Element>;
10
+ };
11
+ export declare const getCustomElement: (isDisabled?: boolean | undefined, href?: string | undefined, onClick?: MouseEventHandler<Element> | undefined) => "button" | "a" | "span";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.0.0",
3
+ "version": "21.0.2",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,13 +12,21 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
+ "typesVersions": {
16
+ ">=4.0 <4.5": {
17
+ "*": [
18
+ "dist/types-ts4.0/*"
19
+ ]
20
+ }
21
+ },
15
22
  "sideEffects": false,
16
23
  "atlaskit:src": "src/index.ts",
17
24
  "atlassian": {
18
25
  "team": "Design System Team",
19
26
  "releaseModel": "scheduled",
20
27
  "website": {
21
- "name": "Avatar"
28
+ "name": "Avatar",
29
+ "category": "Components"
22
30
  }
23
31
  },
24
32
  "af:exports": {
@@ -33,7 +41,7 @@
33
41
  "dependencies": {
34
42
  "@atlaskit/analytics-next": "^8.0.0",
35
43
  "@atlaskit/icon": "^21.10.0",
36
- "@atlaskit/theme": "^12.1.0",
44
+ "@atlaskit/theme": "^12.2.0",
37
45
  "@atlaskit/tokens": "^0.10.0",
38
46
  "@babel/runtime": "^7.0.0",
39
47
  "@emotion/core": "^10.0.9"
@@ -44,22 +52,23 @@
44
52
  "devDependencies": {
45
53
  "@atlaskit/button": "^16.3.0",
46
54
  "@atlaskit/docs": "*",
55
+ "@atlaskit/ds-lib": "^2.1.1",
47
56
  "@atlaskit/field-base": "^15.0.0",
48
57
  "@atlaskit/icon": "^21.10.0",
49
- "@atlaskit/section-message": "^6.1.0",
58
+ "@atlaskit/section-message": "^6.2.0",
50
59
  "@atlaskit/ssr": "*",
51
- "@atlaskit/toggle": "^12.4.0",
60
+ "@atlaskit/toggle": "^12.5.0",
52
61
  "@atlaskit/tooltip": "^17.5.0",
53
62
  "@atlaskit/visual-regression": "*",
54
63
  "@atlaskit/webdriver-runner": "*",
55
64
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
56
- "@emotion/styled": "^10.0.7",
57
- "@testing-library/react": "^8.0.1",
65
+ "@emotion/styled": "^11.0.0",
66
+ "@testing-library/react": "^12.1.5",
58
67
  "@types/jscodeshift": "^0.11.0",
59
68
  "color-contrast-checker": "^1.5.0",
60
69
  "jscodeshift": "^0.13.0",
61
70
  "react-dom": "^16.8.0",
62
- "typescript": "4.2.4",
71
+ "typescript": "4.5.5",
63
72
  "wait-for-expect": "^1.2.0"
64
73
  },
65
74
  "keywords": [
@@ -72,6 +81,7 @@
72
81
  "import-structure": "atlassian-conventions"
73
82
  },
74
83
  "@repo/internal": {
84
+ "dom-events": "use-bind-event-listener",
75
85
  "design-system": "v1",
76
86
  "ui-components": "lite-mode",
77
87
  "analytics": "analytics-next",
package/report.api.md ADDED
@@ -0,0 +1,320 @@
1
+ ## API Report File for "@atlaskit/avatar"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+ /// <reference types="react" />
7
+
8
+ import { FC } from 'react';
9
+ import { ForwardRefExoticComponent } from 'react';
10
+ import { MouseEventHandler } from 'react';
11
+ import { ReactNode } from 'react';
12
+ import { Ref } from 'react';
13
+ import { RefAttributes } from 'react';
14
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
15
+
16
+ export declare const ACTIVE_SCALE_FACTOR = 0.9;
17
+
18
+ export declare type AppearanceType = 'circle' | 'square';
19
+
20
+ /**
21
+ * __Avatar__
22
+ *
23
+ * An avatar is a visual representation of a user or entity.
24
+ *
25
+ * - [Examples](https://atlassian.design/components/avatar/examples)
26
+ * - [Code](https://atlassian.design/components/avatar/code)
27
+ * - [Usage](https://atlassian.design/components/avatar/usage)
28
+ */
29
+ declare const Avatar: ForwardRefExoticComponent<
30
+ AvatarPropTypes & RefAttributes<HTMLElement>
31
+ >;
32
+ export default Avatar;
33
+
34
+ export declare const AVATAR_RADIUS: AvatarSizeMap;
35
+
36
+ export declare const AVATAR_SIZES: AvatarSizeMap;
37
+
38
+ export declare type AvatarClickEventHandler = (
39
+ event: React.MouseEvent,
40
+ analyticsEvent?: UIAnalyticsEvent,
41
+ ) => void;
42
+
43
+ /**
44
+ * __Avatar item__
45
+ *
46
+ * An avatar item is a wrapper that goes around an avatar when it's displayed alongside text, such as a name or status.
47
+ *
48
+ * - [Examples](https://atlassian.design/components/avatar/avatar-item/examples)
49
+ * - [Code](https://atlassian.design/components/avatar/avatar-item/code)
50
+ */
51
+ export declare const AvatarItem: ForwardRefExoticComponent<
52
+ AvatarItemProps & RefAttributes<HTMLElement>
53
+ >;
54
+
55
+ export declare interface AvatarItemProps {
56
+ /**
57
+ * Used to provide better content to screen readers when using presence/status. Rather
58
+ * than a screen reader speaking "online, approved, John Smith", passing in an label
59
+ * allows a custom message like "John Smith (approved and online)".
60
+ */
61
+ label?: string;
62
+ /**
63
+ * Slot to place an avatar element. Use @atlaskit/avatar.
64
+ */
65
+ avatar: ReactNode;
66
+ /**
67
+ * Change background color.
68
+ */
69
+ backgroundColor?: string;
70
+ /**
71
+ * Use a custom component instead of the default span.
72
+ */
73
+ children?: (props: CustomAvatarItemProps) => ReactNode;
74
+ /**
75
+ * URL for avatars being used as a link.
76
+ */
77
+ href?: string;
78
+ /**
79
+ * Disable the item from being interactive
80
+ */
81
+ isDisabled?: boolean;
82
+ /**
83
+ * Handler to be called on click.
84
+ */
85
+ onClick?: AvatarClickEventHandler;
86
+ /**
87
+ * PrimaryText text.
88
+ */
89
+ primaryText?: ReactNode;
90
+ /**
91
+ * SecondaryText text.
92
+ */
93
+ secondaryText?: ReactNode;
94
+ /**
95
+ * Pass target down to the anchor, if href is provided.
96
+ */
97
+ target?: '_blank' | '_self' | '_top' | '_parent';
98
+ /**
99
+ * By default, overflowing text is truncated if it exceeds the container width. Use this prop to disable this.
100
+ */
101
+ isTruncationDisabled?: boolean;
102
+ /**
103
+ * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
104
+ */
105
+ testId?: string;
106
+ }
107
+
108
+ export declare interface AvatarPropTypes {
109
+ /**
110
+ * Indicates the shape of the avatar. Most avatars are circular, but square avatars
111
+ * can be used for 'container' objects.
112
+ */
113
+ appearance?: AppearanceType;
114
+ /**
115
+ * Used to provide better content to screen readers when using presence/status. Rather
116
+ * than a screen reader speaking "online, approved, John Smith", passing in a label
117
+ * allows a custom message like "John Smith (approved and online)".
118
+ */
119
+ label?: string;
120
+ /**
121
+ * Used to override the default border color around the avatar body.
122
+ * Accepts any color argument that the border-color CSS property accepts.
123
+ */
124
+ borderColor?: string;
125
+ /**
126
+ * Supply a custom avatar component instead of the default
127
+ */
128
+ children?: (props: CustomAvatarProps) => ReactNode;
129
+ /**
130
+ * Provides a url for avatars being used as a link.
131
+ */
132
+ href?: string;
133
+ /**
134
+ * Change the style to indicate the avatar is disabled.
135
+ */
136
+ isDisabled?: boolean;
137
+ /**
138
+ * Provides alt text for the avatar image.
139
+ */
140
+ name?: string;
141
+ /**
142
+ * Indicates a user's online status by showing a small icon on the avatar.
143
+ * Refer to presence values on the Presence component.
144
+ * Alternatively accepts any React element. For best results, it is recommended to
145
+ * use square content with height and width of 100%.
146
+ */
147
+ presence?: ('online' | 'busy' | 'focus' | 'offline') | ReactNode;
148
+ /**
149
+ * Defines the size of the avatar
150
+ */
151
+ size?: SizeType;
152
+ /**
153
+ * A url to load an image from (this can also be a base64 encoded image).
154
+ */
155
+ src?: string;
156
+ /**
157
+ * Indicates contextual information by showing a small icon on the avatar.
158
+ * Refer to status values on the Status component.
159
+ */
160
+ status?: ('approved' | 'declined' | 'locked') | ReactNode;
161
+ /**
162
+ * The index of where this avatar is in the group `stack`.
163
+ */
164
+ stackIndex?: number;
165
+ /**
166
+ * Assign specific tabIndex order to the underlying node.
167
+ */
168
+ tabIndex?: number;
169
+ /**
170
+ * Pass target down to the anchor, if href is provided.
171
+ */
172
+ target?: '_blank' | '_self' | '_top' | '_parent';
173
+ /**
174
+ * Handler to be called on click.
175
+ */
176
+ onClick?: AvatarClickEventHandler;
177
+ /**
178
+ * A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests
179
+ */
180
+ testId?: string;
181
+ /**
182
+ * Analytics context meta data
183
+ */
184
+ analyticsContext?: Record<string, any>;
185
+ }
186
+
187
+ declare type AvatarSizeMap = Record<SizeType, number>;
188
+
189
+ export declare const BORDER_WIDTH = 2;
190
+
191
+ export declare interface CustomAvatarItemProps {
192
+ testId?: string;
193
+ onClick?: MouseEventHandler;
194
+ className?: string;
195
+ href?: string;
196
+ children: ReactNode;
197
+ ref: Ref<HTMLElement>;
198
+ /**
199
+ * This is used in render props so is okay to be defined.
200
+ * eslint-disable-next-line consistent-props-definitions
201
+ */
202
+ 'aria-label'?: string;
203
+ 'aria-disabled'?: boolean | 'false' | 'true' | undefined;
204
+ }
205
+
206
+ export declare interface CustomAvatarProps {
207
+ /**
208
+ * This is used in render props so is okay to be defined.
209
+ * eslint-disable-next-line consistent-props-definitions
210
+ */
211
+ 'aria-label'?: string;
212
+ tabIndex?: number;
213
+ testId?: string;
214
+ onClick?: MouseEventHandler;
215
+ className?: string;
216
+ href?: string;
217
+ children: ReactNode;
218
+ ref: Ref<HTMLElement>;
219
+ }
220
+
221
+ export declare type IndicatorSizeType = 'small' | 'medium' | 'large' | 'xlarge';
222
+
223
+ /**
224
+ * __Avatar presence__
225
+ *
226
+ * A presence shows an avatar’s availability.
227
+ *
228
+ * - [Examples](https://atlassian.design/components/avatar/avatar-presence/examples)
229
+ * - [Code](https://atlassian.design/components/avatar/avatar-presence/code)
230
+ * - [Usage](https://atlassian.design/components/avatar/avatar-presence/usage)
231
+ */
232
+ export declare const Presence: FC<PresenceProps>;
233
+
234
+ export declare interface PresenceProps {
235
+ /**
236
+ * Used to override the default border color of the presence indicator.
237
+ * Accepts any color argument that the border-color CSS property accepts.
238
+ */
239
+ borderColor?: string;
240
+ /**
241
+ * Content to use as a custom presence indicator (usually not required if
242
+ * consuming Presence separate to Avatar).
243
+ */
244
+ children?: ReactNode;
245
+ /**
246
+ * The type of presence indicator to show
247
+ */
248
+ presence?: PresenceType;
249
+ /**
250
+ * Test Id
251
+ */
252
+ testId?: string;
253
+ }
254
+
255
+ export declare type PresenceType =
256
+ | 'busy'
257
+ | 'focus'
258
+ | 'offline'
259
+ | 'online'
260
+ | ReactNode;
261
+
262
+ export declare type SizeType =
263
+ | 'xsmall'
264
+ | 'small'
265
+ | 'medium'
266
+ | 'large'
267
+ | 'xlarge'
268
+ | 'xxlarge';
269
+
270
+ /**
271
+ * __Skeleton__
272
+ *
273
+ * A skeleton is the loading state for the avatar component.
274
+ *
275
+ * - [Examples](https://atlassian.design/components/avatar/avatar-skeleton/examples)
276
+ * - [Code](https://atlassian.design/components/avatar/avatar-skeleton/code)
277
+ */
278
+ export declare const Skeleton: FC<SkeletonProps>;
279
+
280
+ export declare interface SkeletonProps {
281
+ appearance?: AppearanceType;
282
+ color?: string;
283
+ size?: SizeType;
284
+ weight?: 'normal' | 'strong';
285
+ }
286
+
287
+ /**
288
+ * __Avatar status__
289
+ *
290
+ * An avatar status shows contextual information, such as if someone approves or declines something.
291
+ *
292
+ * - [Examples](https://atlassian.design/components/avatar/avatar-status/examples)
293
+ * - [Code](https://atlassian.design/components/avatar/avatar-status/code)
294
+ */
295
+ export declare const Status: FC<StatusProps>;
296
+
297
+ export declare interface StatusProps {
298
+ /**
299
+ * Override the default border color of the status indicator. This accepts
300
+ * any color argument that the CSS property `border-color` accepts.
301
+ */
302
+ borderColor?: string;
303
+ /**
304
+ * Content to use as a custom status indicator. Not needed if consuming
305
+ * `Status` separate to `Avatar`.
306
+ */
307
+ children?: ReactNode;
308
+ /**
309
+ * Content to use as a custom status indicator. Not needed if consuming
310
+ * `Status` separate to `Avatar`.
311
+ */
312
+ status?: StatusType;
313
+ }
314
+
315
+ export declare type StatusType =
316
+ | ('approved' | 'declined' | 'locked')
317
+ | ReactNode;
318
+
319
+ export {};
320
+ ```
@@ -4,5 +4,12 @@
4
4
  "module": "../dist/esm/entry-points/types.js",
5
5
  "module:es2019": "../dist/es2019/entry-points/types.js",
6
6
  "sideEffects": false,
7
- "types": "../dist/types/entry-points/types.d.ts"
7
+ "types": "../dist/types/entry-points/types.d.ts",
8
+ "typesVersions": {
9
+ ">=4.0 <4.5": {
10
+ "*": [
11
+ "../dist/types-ts4.0/entry-points/types.d.ts"
12
+ ]
13
+ }
14
+ }
8
15
  }