@atlaskit/avatar 21.3.2 → 21.3.3

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,11 @@
1
1
  # @atlaskit/avatar
2
2
 
3
+ ## 21.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e2d375fa634`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2d375fa634) - Refactor how some internal styles are applied; no functional changes.
8
+
3
9
  ## 21.3.2
4
10
 
5
11
  ### Patch Changes
@@ -22,7 +22,7 @@ var _templateObject;
22
22
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
23
23
  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; }
24
24
  var packageName = "@atlaskit/avatar";
25
- var packageVersion = "21.3.2";
25
+ var packageVersion = "21.3.3";
26
26
 
27
27
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
28
28
 
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = exports.ICON_COLOR = exports.ICON_BACKGROUND = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
10
  var _react = require("react");
10
11
  var _react2 = require("@emotion/react");
@@ -12,9 +13,8 @@ var _person = _interopRequireDefault(require("@atlaskit/icon/glyph/person"));
12
13
  var _ship = _interopRequireDefault(require("@atlaskit/icon/glyph/ship"));
13
14
  var _colors = require("@atlaskit/theme/colors");
14
15
  var _constants = require("./constants");
15
- /** @jsx jsx */
16
- // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
17
-
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
17
+ 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; } /** @jsx jsx */ // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
18
18
  var ICON_BACKGROUND = "var(--ds-icon-inverse, ".concat((0, _colors.background)(), ")");
19
19
  exports.ICON_BACKGROUND = ICON_BACKGROUND;
20
20
  var ICON_COLOR = "var(--ds-icon-subtle, ".concat(_colors.N90, ")");
@@ -25,24 +25,37 @@ var avatarDefaultIconStyles = (0, _react2.css)({
25
25
  height: '100%',
26
26
  backgroundColor: ICON_COLOR
27
27
  });
28
+ var nestedAvatarStyles = Object.entries(_constants.AVATAR_SIZES).reduce(function (styles, _ref) {
29
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
30
+ key = _ref2[0],
31
+ size = _ref2[1];
32
+ return _objectSpread(_objectSpread({}, styles), {}, (0, _defineProperty2.default)({}, key, (0, _react2.css)({
33
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
34
+ '& svg': {
35
+ width: "".concat(size, "px"),
36
+ height: "".concat(size, "px")
37
+ }
38
+ })));
39
+ }, {});
28
40
  var avatarImageStyles = (0, _react2.css)({
29
41
  display: 'flex',
30
42
  width: '100%',
31
43
  height: '100%',
32
44
  flex: '1 1 100%'
33
45
  });
46
+
34
47
  /**
35
48
  * __Avatar image__
36
49
  *
37
50
  * An avatar image is an internal component used to control the rendering phases of an image.
38
51
  */
39
- var AvatarImage = function AvatarImage(_ref) {
40
- var _ref$alt = _ref.alt,
41
- alt = _ref$alt === void 0 ? '' : _ref$alt,
42
- src = _ref.src,
43
- appearance = _ref.appearance,
44
- size = _ref.size,
45
- testId = _ref.testId;
52
+ var AvatarImage = function AvatarImage(_ref3) {
53
+ var _ref3$alt = _ref3.alt,
54
+ alt = _ref3$alt === void 0 ? '' : _ref3$alt,
55
+ src = _ref3.src,
56
+ appearance = _ref3.appearance,
57
+ size = _ref3.size,
58
+ testId = _ref3.testId;
46
59
  var _useState = (0, _react.useState)(false),
47
60
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
48
61
  hasImageErrored = _useState2[0],
@@ -55,15 +68,7 @@ var AvatarImage = function AvatarImage(_ref) {
55
68
  }, [src]);
56
69
  if (!src || hasImageErrored) {
57
70
  return (0, _react2.jsx)("span", {
58
- css: [avatarDefaultIconStyles,
59
- // TODO: These dynamic SVG styles can't be set in 'style'. On a refactor, use a css custom property to pass down the size
60
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
61
- {
62
- '& svg': {
63
- width: "".concat(_constants.AVATAR_SIZES[size], "px"),
64
- height: "".concat(_constants.AVATAR_SIZES[size], "px")
65
- }
66
- }]
71
+ css: [avatarDefaultIconStyles, nestedAvatarStyles[size]]
67
72
  }, appearance === 'circle' ? (0, _react2.jsx)(_person.default, {
68
73
  label: alt,
69
74
  primaryColor: ICON_BACKGROUND,
@@ -1,33 +1,49 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.default = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
7
10
  var _react = require("@emotion/react");
8
11
  var _constants = require("./constants");
9
- /** @jsx jsx */
10
- // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
12
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
13
+ 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; } /** @jsx jsx */ // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
14
+ var skeletonStyles = (0, _react.css)({
15
+ display: 'inline-block',
16
+ backgroundColor: "var(".concat(_constants.CSS_VAR_AVATAR_BGCOLOR, ")"),
17
+ border: "".concat(_constants.BORDER_WIDTH, "px solid transparent")
18
+ });
19
+ var sizeStyles = Object.entries(_constants.AVATAR_SIZES).reduce(function (styles, _ref) {
20
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
21
+ key = _ref2[0],
22
+ size = _ref2[1];
23
+ return _objectSpread(_objectSpread({}, styles), {}, (0, _defineProperty2.default)({}, key, (0, _react.css)({
24
+ width: "".concat(size, "px"),
25
+ height: "".concat(size, "px")
26
+ })));
27
+ }, {});
11
28
 
12
- var getStyles = function getStyles(_ref) {
13
- var _ref$size = _ref.size,
14
- size = _ref$size === void 0 ? 'medium' : _ref$size,
15
- _ref$appearance = _ref.appearance,
16
- appearance = _ref$appearance === void 0 ? 'circle' : _ref$appearance,
17
- _ref$color = _ref.color,
18
- color = _ref$color === void 0 ? 'currentColor' : _ref$color,
19
- _ref$weight = _ref.weight,
20
- weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
21
- return (0, _react.css)({
22
- display: 'inline-block',
23
- width: "".concat(_constants.AVATAR_SIZES[size], "px"),
24
- height: "".concat(_constants.AVATAR_SIZES[size], "px"),
25
- backgroundColor: color,
26
- border: "".concat(_constants.BORDER_WIDTH, "px solid transparent"),
27
- borderRadius: "".concat(appearance === 'square' ? "".concat(_constants.AVATAR_RADIUS[size], "px") : '50%'),
28
- opacity: "".concat(weight === 'strong' ? 0.3 : 0.15)
29
- });
30
- };
29
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
30
+ var radiusStyles = Object.entries(_constants.AVATAR_RADIUS).reduce(function (styles, _ref3) {
31
+ var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
32
+ key = _ref4[0],
33
+ size = _ref4[1];
34
+ return _objectSpread(_objectSpread({}, styles), {}, (0, _defineProperty2.default)({}, key, (0, _react.css)({
35
+ borderRadius: "".concat(size, "px")
36
+ })));
37
+ }, {});
38
+ var defaultRadiusStyles = (0, _react.css)({
39
+ borderRadius: '50%'
40
+ });
41
+ var strongOpacityStyles = (0, _react.css)({
42
+ opacity: 0.3
43
+ });
44
+ var defaultOpacityStyles = (0, _react.css)({
45
+ opacity: 0.15
46
+ });
31
47
 
32
48
  /**
33
49
  * __Skeleton__
@@ -37,20 +53,14 @@ var getStyles = function getStyles(_ref) {
37
53
  * - [Examples](https://atlassian.design/components/avatar/avatar-skeleton/examples)
38
54
  * - [Code](https://atlassian.design/components/avatar/avatar-skeleton/code)
39
55
  */
40
- var Skeleton = function Skeleton(_ref2) {
41
- var size = _ref2.size,
42
- appearance = _ref2.appearance,
43
- color = _ref2.color,
44
- weight = _ref2.weight;
56
+ var Skeleton = function Skeleton(_ref5) {
57
+ var size = _ref5.size,
58
+ appearance = _ref5.appearance,
59
+ color = _ref5.color,
60
+ weight = _ref5.weight;
45
61
  return (0, _react.jsx)("div", {
46
- // TODO: Refactor styles to follow css prop rules
47
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
48
- css: getStyles({
49
- size: size,
50
- appearance: appearance,
51
- color: color,
52
- weight: weight
53
- })
62
+ css: [skeletonStyles, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' ? radiusStyles[size !== null && size !== void 0 ? size : 'medium'] : defaultRadiusStyles, weight === 'strong' ? strongOpacityStyles : defaultOpacityStyles],
63
+ style: (0, _defineProperty2.default)({}, _constants.CSS_VAR_AVATAR_BGCOLOR, color !== null && color !== void 0 ? color : 'currentColor')
54
64
  });
55
65
  };
56
66
  var _default = Skeleton;
package/dist/cjs/Text.js CHANGED
@@ -1,29 +1,28 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.default = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _react = require("@emotion/react");
10
8
  var _colors = require("@atlaskit/theme/colors");
11
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
- 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; } /** @jsx jsx */ // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
13
- var getStyles = function getStyles(isSecondary, shouldTruncate) {
14
- return (0, _react.css)(_objectSpread(_objectSpread({
15
- display: 'block',
16
- margin: "var(--ds-space-0, 0px)",
17
- color: "var(--ds-text, ".concat(_colors.N900, ")")
18
- }, shouldTruncate && {
19
- overflowX: 'hidden',
20
- textOverflow: 'ellipsis',
21
- whiteSpace: 'nowrap'
22
- }), isSecondary && {
23
- color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
24
- fontSize: '0.85em'
25
- }));
26
- };
9
+ /** @jsx jsx */
10
+ // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
11
+
12
+ var baseStyles = (0, _react.css)({
13
+ display: 'block',
14
+ margin: "var(--ds-space-0, 0px)",
15
+ color: "var(--ds-text, ".concat(_colors.N900, ")")
16
+ });
17
+ var truncateStyles = (0, _react.css)({
18
+ overflowX: 'hidden',
19
+ textOverflow: 'ellipsis',
20
+ whiteSpace: 'nowrap'
21
+ });
22
+ var secondaryStyles = (0, _react.css)({
23
+ color: "var(--ds-text-subtlest, ".concat(_colors.N200, ")"),
24
+ fontSize: '0.85em'
25
+ });
27
26
 
28
27
  /**
29
28
  * __Text__
@@ -34,13 +33,9 @@ var Text = function Text(_ref) {
34
33
  var isSecondary = _ref.isSecondary,
35
34
  children = _ref.children,
36
35
  shouldTruncate = _ref.shouldTruncate;
37
- return (
38
- // TODO: Refactor styles to follow css prop rules
39
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
40
- (0, _react.jsx)("span", {
41
- css: getStyles(isSecondary, shouldTruncate)
42
- }, children)
43
- );
36
+ return (0, _react.jsx)("span", {
37
+ css: [baseStyles, isSecondary && secondaryStyles, shouldTruncate && truncateStyles]
38
+ }, children);
44
39
  };
45
40
  var _default = Text;
46
41
  exports.default = _default;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ICON_SIZES = exports.ICON_OFFSET = exports.BORDER_WIDTH = exports.AVATAR_SIZES = exports.AVATAR_RADIUS = exports.ACTIVE_SCALE_FACTOR = void 0;
6
+ exports.ICON_SIZES = exports.ICON_OFFSET = exports.CSS_VAR_AVATAR_BGCOLOR = exports.BORDER_WIDTH = exports.AVATAR_SIZES = exports.AVATAR_RADIUS = exports.ACTIVE_SCALE_FACTOR = void 0;
7
7
  var _constants = require("@atlaskit/theme/constants");
8
8
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match, @atlaskit/design-system/no-deprecated-imports
9
9
 
@@ -31,6 +31,8 @@ var BORDER_WIDTH = 2;
31
31
  exports.BORDER_WIDTH = BORDER_WIDTH;
32
32
  var ACTIVE_SCALE_FACTOR = 0.9;
33
33
  exports.ACTIVE_SCALE_FACTOR = ACTIVE_SCALE_FACTOR;
34
+ var CSS_VAR_AVATAR_BGCOLOR = '--avatar-background-color';
35
+ exports.CSS_VAR_AVATAR_BGCOLOR = CSS_VAR_AVATAR_BGCOLOR;
34
36
  var ICON_SIZES = {
35
37
  small: 12,
36
38
  medium: 14,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.3.2",
3
+ "version": "21.3.3",
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.3.2";
13
+ const packageVersion = "21.3.3";
14
14
 
15
15
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
16
16
 
@@ -14,12 +14,25 @@ const avatarDefaultIconStyles = css({
14
14
  height: '100%',
15
15
  backgroundColor: ICON_COLOR
16
16
  });
17
+ const nestedAvatarStyles = Object.entries(AVATAR_SIZES).reduce((styles, [key, size]) => {
18
+ return {
19
+ ...styles,
20
+ [key]: css({
21
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
22
+ '& svg': {
23
+ width: `${size}px`,
24
+ height: `${size}px`
25
+ }
26
+ })
27
+ };
28
+ }, {});
17
29
  const avatarImageStyles = css({
18
30
  display: 'flex',
19
31
  width: '100%',
20
32
  height: '100%',
21
33
  flex: '1 1 100%'
22
34
  });
35
+
23
36
  /**
24
37
  * __Avatar image__
25
38
  *
@@ -41,15 +54,7 @@ const AvatarImage = ({
41
54
  }, [src]);
42
55
  if (!src || hasImageErrored) {
43
56
  return jsx("span", {
44
- css: [avatarDefaultIconStyles,
45
- // TODO: These dynamic SVG styles can't be set in 'style'. On a refactor, use a css custom property to pass down the size
46
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
47
- {
48
- '& svg': {
49
- width: `${AVATAR_SIZES[size]}px`,
50
- height: `${AVATAR_SIZES[size]}px`
51
- }
52
- }]
57
+ css: [avatarDefaultIconStyles, nestedAvatarStyles[size]]
53
58
  }, appearance === 'circle' ? jsx(PersonIcon, {
54
59
  label: alt,
55
60
  primaryColor: ICON_BACKGROUND,
@@ -2,20 +2,39 @@
2
2
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
3
3
 
4
4
  import { css, jsx } from '@emotion/react';
5
- import { AVATAR_RADIUS, AVATAR_SIZES, BORDER_WIDTH } from './constants';
6
- const getStyles = ({
7
- size = 'medium',
8
- appearance = 'circle',
9
- color = 'currentColor',
10
- weight = 'normal'
11
- }) => css({
5
+ import { AVATAR_RADIUS, AVATAR_SIZES, BORDER_WIDTH, CSS_VAR_AVATAR_BGCOLOR } from './constants';
6
+ const skeletonStyles = css({
12
7
  display: 'inline-block',
13
- width: `${AVATAR_SIZES[size]}px`,
14
- height: `${AVATAR_SIZES[size]}px`,
15
- backgroundColor: color,
16
- border: `${BORDER_WIDTH}px solid transparent`,
17
- borderRadius: `${appearance === 'square' ? `${AVATAR_RADIUS[size]}px` : '50%'}`,
18
- opacity: `${weight === 'strong' ? 0.3 : 0.15}`
8
+ backgroundColor: `var(${CSS_VAR_AVATAR_BGCOLOR})`,
9
+ border: `${BORDER_WIDTH}px solid transparent`
10
+ });
11
+ const sizeStyles = Object.entries(AVATAR_SIZES).reduce((styles, [key, size]) => {
12
+ return {
13
+ ...styles,
14
+ [key]: css({
15
+ width: `${size}px`,
16
+ height: `${size}px`
17
+ })
18
+ };
19
+ }, {});
20
+
21
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
22
+ const radiusStyles = Object.entries(AVATAR_RADIUS).reduce((styles, [key, size]) => {
23
+ return {
24
+ ...styles,
25
+ [key]: css({
26
+ borderRadius: `${size}px`
27
+ })
28
+ };
29
+ }, {});
30
+ const defaultRadiusStyles = css({
31
+ borderRadius: '50%'
32
+ });
33
+ const strongOpacityStyles = css({
34
+ opacity: 0.3
35
+ });
36
+ const defaultOpacityStyles = css({
37
+ opacity: 0.15
19
38
  });
20
39
 
21
40
  /**
@@ -32,13 +51,9 @@ const Skeleton = ({
32
51
  color,
33
52
  weight
34
53
  }) => jsx("div", {
35
- // TODO: Refactor styles to follow css prop rules
36
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
37
- css: getStyles({
38
- size,
39
- appearance,
40
- color,
41
- weight
42
- })
54
+ css: [skeletonStyles, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' ? radiusStyles[size !== null && size !== void 0 ? size : 'medium'] : defaultRadiusStyles, weight === 'strong' ? strongOpacityStyles : defaultOpacityStyles],
55
+ style: {
56
+ [CSS_VAR_AVATAR_BGCOLOR]: color !== null && color !== void 0 ? color : 'currentColor'
57
+ }
43
58
  });
44
59
  export default Skeleton;
@@ -3,19 +3,19 @@
3
3
 
4
4
  import { css, jsx } from '@emotion/react';
5
5
  import { N200, N900 } from '@atlaskit/theme/colors';
6
- const getStyles = (isSecondary, shouldTruncate) => css({
6
+ const baseStyles = css({
7
7
  display: 'block',
8
8
  margin: "var(--ds-space-0, 0px)",
9
- color: `var(--ds-text, ${N900})`,
10
- ...(shouldTruncate && {
11
- overflowX: 'hidden',
12
- textOverflow: 'ellipsis',
13
- whiteSpace: 'nowrap'
14
- }),
15
- ...(isSecondary && {
16
- color: `var(--ds-text-subtlest, ${N200})`,
17
- fontSize: '0.85em'
18
- })
9
+ color: `var(--ds-text, ${N900})`
10
+ });
11
+ const truncateStyles = css({
12
+ overflowX: 'hidden',
13
+ textOverflow: 'ellipsis',
14
+ whiteSpace: 'nowrap'
15
+ });
16
+ const secondaryStyles = css({
17
+ color: `var(--ds-text-subtlest, ${N200})`,
18
+ fontSize: '0.85em'
19
19
  });
20
20
 
21
21
  /**
@@ -27,10 +27,7 @@ const Text = ({
27
27
  isSecondary,
28
28
  children,
29
29
  shouldTruncate
30
- }) =>
31
- // TODO: Refactor styles to follow css prop rules
32
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
33
- jsx("span", {
34
- css: getStyles(isSecondary, shouldTruncate)
30
+ }) => jsx("span", {
31
+ css: [baseStyles, isSecondary && secondaryStyles, shouldTruncate && truncateStyles]
35
32
  }, children);
36
33
  export default Text;
@@ -20,6 +20,7 @@ export const AVATAR_RADIUS = {
20
20
  };
21
21
  export const BORDER_WIDTH = 2;
22
22
  export const ACTIVE_SCALE_FACTOR = 0.9;
23
+ export const CSS_VAR_AVATAR_BGCOLOR = '--avatar-background-color';
23
24
  export const ICON_SIZES = {
24
25
  small: 12,
25
26
  medium: 14,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.3.2",
3
+ "version": "21.3.3",
4
4
  "sideEffects": false
5
5
  }
@@ -15,7 +15,7 @@ import { PresenceWrapper } from './Presence';
15
15
  import { StatusWrapper } from './Status';
16
16
  import { getButtonProps, getCustomElement, getLinkProps } from './utilities';
17
17
  var packageName = "@atlaskit/avatar";
18
- var packageVersion = "21.3.2";
18
+ var packageVersion = "21.3.3";
19
19
 
20
20
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
21
21
 
@@ -1,4 +1,7 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ 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) { _defineProperty(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; }
2
5
  /** @jsx jsx */
3
6
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
4
7
  import { useEffect, useState } from 'react';
@@ -15,24 +18,37 @@ var avatarDefaultIconStyles = css({
15
18
  height: '100%',
16
19
  backgroundColor: ICON_COLOR
17
20
  });
21
+ var nestedAvatarStyles = Object.entries(AVATAR_SIZES).reduce(function (styles, _ref) {
22
+ var _ref2 = _slicedToArray(_ref, 2),
23
+ key = _ref2[0],
24
+ size = _ref2[1];
25
+ return _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, key, css({
26
+ // eslint-disable-next-line @repo/internal/styles/no-nested-styles
27
+ '& svg': {
28
+ width: "".concat(size, "px"),
29
+ height: "".concat(size, "px")
30
+ }
31
+ })));
32
+ }, {});
18
33
  var avatarImageStyles = css({
19
34
  display: 'flex',
20
35
  width: '100%',
21
36
  height: '100%',
22
37
  flex: '1 1 100%'
23
38
  });
39
+
24
40
  /**
25
41
  * __Avatar image__
26
42
  *
27
43
  * An avatar image is an internal component used to control the rendering phases of an image.
28
44
  */
29
- var AvatarImage = function AvatarImage(_ref) {
30
- var _ref$alt = _ref.alt,
31
- alt = _ref$alt === void 0 ? '' : _ref$alt,
32
- src = _ref.src,
33
- appearance = _ref.appearance,
34
- size = _ref.size,
35
- testId = _ref.testId;
45
+ var AvatarImage = function AvatarImage(_ref3) {
46
+ var _ref3$alt = _ref3.alt,
47
+ alt = _ref3$alt === void 0 ? '' : _ref3$alt,
48
+ src = _ref3.src,
49
+ appearance = _ref3.appearance,
50
+ size = _ref3.size,
51
+ testId = _ref3.testId;
36
52
  var _useState = useState(false),
37
53
  _useState2 = _slicedToArray(_useState, 2),
38
54
  hasImageErrored = _useState2[0],
@@ -45,15 +61,7 @@ var AvatarImage = function AvatarImage(_ref) {
45
61
  }, [src]);
46
62
  if (!src || hasImageErrored) {
47
63
  return jsx("span", {
48
- css: [avatarDefaultIconStyles,
49
- // TODO: These dynamic SVG styles can't be set in 'style'. On a refactor, use a css custom property to pass down the size
50
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
51
- {
52
- '& svg': {
53
- width: "".concat(AVATAR_SIZES[size], "px"),
54
- height: "".concat(AVATAR_SIZES[size], "px")
55
- }
56
- }]
64
+ css: [avatarDefaultIconStyles, nestedAvatarStyles[size]]
57
65
  }, appearance === 'circle' ? jsx(PersonIcon, {
58
66
  label: alt,
59
67
  primaryColor: ICON_BACKGROUND,
@@ -1,27 +1,45 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ 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) { _defineProperty(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; }
1
5
  /** @jsx jsx */
2
6
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
3
7
 
4
8
  import { css, jsx } from '@emotion/react';
5
- import { AVATAR_RADIUS, AVATAR_SIZES, BORDER_WIDTH } from './constants';
6
- var getStyles = function getStyles(_ref) {
7
- var _ref$size = _ref.size,
8
- size = _ref$size === void 0 ? 'medium' : _ref$size,
9
- _ref$appearance = _ref.appearance,
10
- appearance = _ref$appearance === void 0 ? 'circle' : _ref$appearance,
11
- _ref$color = _ref.color,
12
- color = _ref$color === void 0 ? 'currentColor' : _ref$color,
13
- _ref$weight = _ref.weight,
14
- weight = _ref$weight === void 0 ? 'normal' : _ref$weight;
15
- return css({
16
- display: 'inline-block',
17
- width: "".concat(AVATAR_SIZES[size], "px"),
18
- height: "".concat(AVATAR_SIZES[size], "px"),
19
- backgroundColor: color,
20
- border: "".concat(BORDER_WIDTH, "px solid transparent"),
21
- borderRadius: "".concat(appearance === 'square' ? "".concat(AVATAR_RADIUS[size], "px") : '50%'),
22
- opacity: "".concat(weight === 'strong' ? 0.3 : 0.15)
23
- });
24
- };
9
+ import { AVATAR_RADIUS, AVATAR_SIZES, BORDER_WIDTH, CSS_VAR_AVATAR_BGCOLOR } from './constants';
10
+ var skeletonStyles = css({
11
+ display: 'inline-block',
12
+ backgroundColor: "var(".concat(CSS_VAR_AVATAR_BGCOLOR, ")"),
13
+ border: "".concat(BORDER_WIDTH, "px solid transparent")
14
+ });
15
+ var sizeStyles = Object.entries(AVATAR_SIZES).reduce(function (styles, _ref) {
16
+ var _ref2 = _slicedToArray(_ref, 2),
17
+ key = _ref2[0],
18
+ size = _ref2[1];
19
+ return _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, key, css({
20
+ width: "".concat(size, "px"),
21
+ height: "".concat(size, "px")
22
+ })));
23
+ }, {});
24
+
25
+ // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
26
+ var radiusStyles = Object.entries(AVATAR_RADIUS).reduce(function (styles, _ref3) {
27
+ var _ref4 = _slicedToArray(_ref3, 2),
28
+ key = _ref4[0],
29
+ size = _ref4[1];
30
+ return _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, key, css({
31
+ borderRadius: "".concat(size, "px")
32
+ })));
33
+ }, {});
34
+ var defaultRadiusStyles = css({
35
+ borderRadius: '50%'
36
+ });
37
+ var strongOpacityStyles = css({
38
+ opacity: 0.3
39
+ });
40
+ var defaultOpacityStyles = css({
41
+ opacity: 0.15
42
+ });
25
43
 
26
44
  /**
27
45
  * __Skeleton__
@@ -31,20 +49,14 @@ var getStyles = function getStyles(_ref) {
31
49
  * - [Examples](https://atlassian.design/components/avatar/avatar-skeleton/examples)
32
50
  * - [Code](https://atlassian.design/components/avatar/avatar-skeleton/code)
33
51
  */
34
- var Skeleton = function Skeleton(_ref2) {
35
- var size = _ref2.size,
36
- appearance = _ref2.appearance,
37
- color = _ref2.color,
38
- weight = _ref2.weight;
52
+ var Skeleton = function Skeleton(_ref5) {
53
+ var size = _ref5.size,
54
+ appearance = _ref5.appearance,
55
+ color = _ref5.color,
56
+ weight = _ref5.weight;
39
57
  return jsx("div", {
40
- // TODO: Refactor styles to follow css prop rules
41
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
42
- css: getStyles({
43
- size: size,
44
- appearance: appearance,
45
- color: color,
46
- weight: weight
47
- })
58
+ css: [skeletonStyles, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' ? radiusStyles[size !== null && size !== void 0 ? size : 'medium'] : defaultRadiusStyles, weight === 'strong' ? strongOpacityStyles : defaultOpacityStyles],
59
+ style: _defineProperty({}, CSS_VAR_AVATAR_BGCOLOR, color !== null && color !== void 0 ? color : 'currentColor')
48
60
  });
49
61
  };
50
62
  export default Skeleton;
package/dist/esm/Text.js CHANGED
@@ -1,25 +1,22 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- 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) { _defineProperty(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; }
4
1
  /** @jsx jsx */
5
2
  // eslint-disable-next-line @repo/internal/fs/filename-pattern-match
6
3
 
7
4
  import { css, jsx } from '@emotion/react';
8
5
  import { N200, N900 } from '@atlaskit/theme/colors';
9
- var getStyles = function getStyles(isSecondary, shouldTruncate) {
10
- return css(_objectSpread(_objectSpread({
11
- display: 'block',
12
- margin: "var(--ds-space-0, 0px)",
13
- color: "var(--ds-text, ".concat(N900, ")")
14
- }, shouldTruncate && {
15
- overflowX: 'hidden',
16
- textOverflow: 'ellipsis',
17
- whiteSpace: 'nowrap'
18
- }), isSecondary && {
19
- color: "var(--ds-text-subtlest, ".concat(N200, ")"),
20
- fontSize: '0.85em'
21
- }));
22
- };
6
+ var baseStyles = css({
7
+ display: 'block',
8
+ margin: "var(--ds-space-0, 0px)",
9
+ color: "var(--ds-text, ".concat(N900, ")")
10
+ });
11
+ var truncateStyles = css({
12
+ overflowX: 'hidden',
13
+ textOverflow: 'ellipsis',
14
+ whiteSpace: 'nowrap'
15
+ });
16
+ var secondaryStyles = css({
17
+ color: "var(--ds-text-subtlest, ".concat(N200, ")"),
18
+ fontSize: '0.85em'
19
+ });
23
20
 
24
21
  /**
25
22
  * __Text__
@@ -30,12 +27,8 @@ var Text = function Text(_ref) {
30
27
  var isSecondary = _ref.isSecondary,
31
28
  children = _ref.children,
32
29
  shouldTruncate = _ref.shouldTruncate;
33
- return (
34
- // TODO: Refactor styles to follow css prop rules
35
- // eslint-disable-next-line @repo/internal/react/consistent-css-prop-usage
36
- jsx("span", {
37
- css: getStyles(isSecondary, shouldTruncate)
38
- }, children)
39
- );
30
+ return jsx("span", {
31
+ css: [baseStyles, isSecondary && secondaryStyles, shouldTruncate && truncateStyles]
32
+ }, children);
40
33
  };
41
34
  export default Text;
@@ -20,6 +20,7 @@ export var AVATAR_RADIUS = {
20
20
  };
21
21
  export var BORDER_WIDTH = 2;
22
22
  export var ACTIVE_SCALE_FACTOR = 0.9;
23
+ export var CSS_VAR_AVATAR_BGCOLOR = '--avatar-background-color';
23
24
  export var ICON_SIZES = {
24
25
  small: 12,
25
26
  medium: 14,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.3.2",
3
+ "version": "21.3.3",
4
4
  "sideEffects": false
5
5
  }
@@ -3,5 +3,6 @@ export declare const AVATAR_SIZES: AvatarSizeMap;
3
3
  export declare const AVATAR_RADIUS: AvatarSizeMap;
4
4
  export declare const BORDER_WIDTH = 2;
5
5
  export declare const ACTIVE_SCALE_FACTOR = 0.9;
6
+ export declare const CSS_VAR_AVATAR_BGCOLOR = "--avatar-background-color";
6
7
  export declare const ICON_SIZES: Record<IndicatorSizeType, number>;
7
8
  export declare const ICON_OFFSET: Record<IndicatorSizeType, number>;
@@ -3,5 +3,6 @@ export declare const AVATAR_SIZES: AvatarSizeMap;
3
3
  export declare const AVATAR_RADIUS: AvatarSizeMap;
4
4
  export declare const BORDER_WIDTH = 2;
5
5
  export declare const ACTIVE_SCALE_FACTOR = 0.9;
6
+ export declare const CSS_VAR_AVATAR_BGCOLOR = "--avatar-background-color";
6
7
  export declare const ICON_SIZES: Record<IndicatorSizeType, number>;
7
8
  export declare const ICON_OFFSET: Record<IndicatorSizeType, number>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/avatar",
3
- "version": "21.3.2",
3
+ "version": "21.3.3",
4
4
  "description": "An avatar is a visual representation of a user or entity.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -24,7 +24,7 @@
24
24
  "atlaskit:src": "src/index.ts",
25
25
  "atlassian": {
26
26
  "team": "Design System Team",
27
- "releaseModel": "scheduled",
27
+ "releaseModel": "continuous",
28
28
  "website": {
29
29
  "name": "Avatar",
30
30
  "category": "Components"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/analytics-next": "^9.1.0",
44
44
  "@atlaskit/icon": "^21.12.0",
45
45
  "@atlaskit/theme": "^12.5.0",
46
- "@atlaskit/tokens": "^1.4.0",
46
+ "@atlaskit/tokens": "^1.5.0",
47
47
  "@babel/runtime": "^7.0.0",
48
48
  "@emotion/react": "^11.7.1",
49
49
  "@emotion/serialize": "^1.1.0"
@@ -68,6 +68,7 @@
68
68
  "@testing-library/react": "^12.1.5",
69
69
  "@types/jscodeshift": "^0.11.0",
70
70
  "color-contrast-checker": "^1.5.0",
71
+ "jest-axe": "^4.0.0",
71
72
  "jscodeshift": "^0.13.0",
72
73
  "react-dom": "^16.8.0",
73
74
  "typescript": "~4.9.5",
@@ -0,0 +1,170 @@
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
+
7
+ /// <reference types="react" />
8
+
9
+ import { FC } from 'react';
10
+ import { ForwardRefExoticComponent } from 'react';
11
+ import { MouseEventHandler } from 'react';
12
+ import { ReactNode } from 'react';
13
+ import { Ref } from 'react';
14
+ import { RefAttributes } from 'react';
15
+ import { UIAnalyticsEvent } from '@atlaskit/analytics-next';
16
+
17
+ // @public (undocumented)
18
+ export const ACTIVE_SCALE_FACTOR = 0.9;
19
+
20
+ // @public (undocumented)
21
+ export type AppearanceType = 'circle' | 'square';
22
+
23
+ // @public
24
+ const Avatar: ForwardRefExoticComponent<AvatarPropTypes & RefAttributes<HTMLElement>>;
25
+ export default Avatar;
26
+
27
+ // @public (undocumented)
28
+ export const AVATAR_RADIUS: AvatarSizeMap;
29
+
30
+ // @public (undocumented)
31
+ export const AVATAR_SIZES: AvatarSizeMap;
32
+
33
+ // @public (undocumented)
34
+ export type AvatarClickEventHandler = (event: React.MouseEvent, analyticsEvent?: UIAnalyticsEvent) => void;
35
+
36
+ // @public
37
+ export const AvatarItem: ForwardRefExoticComponent<AvatarItemProps & RefAttributes<HTMLElement>>;
38
+
39
+ // @public (undocumented)
40
+ export interface AvatarItemProps {
41
+ avatar: ReactNode;
42
+ backgroundColor?: string;
43
+ children?: (props: CustomAvatarItemProps) => ReactNode;
44
+ href?: string;
45
+ isDisabled?: boolean;
46
+ isTruncationDisabled?: boolean;
47
+ label?: string;
48
+ onClick?: AvatarClickEventHandler;
49
+ primaryText?: ReactNode;
50
+ secondaryText?: ReactNode;
51
+ target?: '_blank' | '_parent' | '_self' | '_top';
52
+ testId?: string;
53
+ }
54
+
55
+ // @public (undocumented)
56
+ export interface AvatarPropTypes {
57
+ analyticsContext?: Record<string, any>;
58
+ appearance?: AppearanceType;
59
+ borderColor?: string;
60
+ children?: (props: CustomAvatarProps) => ReactNode;
61
+ href?: string;
62
+ isDisabled?: boolean;
63
+ label?: string;
64
+ name?: string;
65
+ onClick?: AvatarClickEventHandler;
66
+ presence?: ('busy' | 'focus' | 'offline' | 'online') | ReactNode;
67
+ size?: SizeType;
68
+ src?: string;
69
+ stackIndex?: number;
70
+ status?: ('approved' | 'declined' | 'locked') | ReactNode;
71
+ tabIndex?: number;
72
+ target?: '_blank' | '_parent' | '_self' | '_top';
73
+ testId?: string;
74
+ }
75
+
76
+ // @public (undocumented)
77
+ type AvatarSizeMap = Record<SizeType, number>;
78
+
79
+ // @public (undocumented)
80
+ export const BORDER_WIDTH = 2;
81
+
82
+ // @public (undocumented)
83
+ export interface CustomAvatarItemProps {
84
+ // (undocumented)
85
+ 'aria-disabled'?: 'false' | 'true' | boolean | undefined;
86
+ 'aria-label'?: string;
87
+ // (undocumented)
88
+ children: ReactNode;
89
+ // (undocumented)
90
+ className?: string;
91
+ // (undocumented)
92
+ href?: string;
93
+ // (undocumented)
94
+ onClick?: MouseEventHandler;
95
+ // (undocumented)
96
+ ref: Ref<HTMLElement>;
97
+ // (undocumented)
98
+ testId?: string;
99
+ }
100
+
101
+ // @public (undocumented)
102
+ export interface CustomAvatarProps {
103
+ 'aria-label'?: string;
104
+ // (undocumented)
105
+ children: ReactNode;
106
+ // (undocumented)
107
+ className?: string;
108
+ // (undocumented)
109
+ href?: string;
110
+ // (undocumented)
111
+ onClick?: MouseEventHandler;
112
+ // (undocumented)
113
+ ref: Ref<HTMLElement>;
114
+ // (undocumented)
115
+ tabIndex?: number;
116
+ // (undocumented)
117
+ testId?: string;
118
+ }
119
+
120
+ // @public (undocumented)
121
+ export type IndicatorSizeType = 'large' | 'medium' | 'small' | 'xlarge';
122
+
123
+ // @public
124
+ export const Presence: FC<PresenceProps>;
125
+
126
+ // @public (undocumented)
127
+ export interface PresenceProps {
128
+ borderColor?: string;
129
+ children?: ReactNode;
130
+ presence?: PresenceType;
131
+ testId?: string;
132
+ }
133
+
134
+ // @public (undocumented)
135
+ export type PresenceType = 'busy' | 'focus' | 'offline' | 'online' | ReactNode;
136
+
137
+ // @public (undocumented)
138
+ export type SizeType = 'large' | 'medium' | 'small' | 'xlarge' | 'xsmall' | 'xxlarge';
139
+
140
+ // @public
141
+ export const Skeleton: FC<SkeletonProps>;
142
+
143
+ // @public (undocumented)
144
+ export interface SkeletonProps {
145
+ // (undocumented)
146
+ appearance?: AppearanceType;
147
+ // (undocumented)
148
+ color?: string;
149
+ // (undocumented)
150
+ size?: SizeType;
151
+ // (undocumented)
152
+ weight?: 'normal' | 'strong';
153
+ }
154
+
155
+ // @public
156
+ export const Status: FC<StatusProps>;
157
+
158
+ // @public (undocumented)
159
+ export interface StatusProps {
160
+ borderColor?: string;
161
+ children?: ReactNode;
162
+ status?: StatusType;
163
+ }
164
+
165
+ // @public (undocumented)
166
+ export type StatusType = ('approved' | 'declined' | 'locked') | ReactNode;
167
+
168
+ // (No @packageDocumentation comment for this package)
169
+
170
+ ```