@atlaskit/avatar 21.3.4 → 21.3.6
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 +12 -0
- package/dist/cjs/Avatar.js +3 -3
- package/dist/cjs/AvatarItem.js +2 -2
- package/dist/cjs/IconWrapper.js +1 -1
- package/dist/cjs/Presence.js +1 -3
- package/dist/cjs/Skeleton.js +2 -1
- package/dist/cjs/Status.js +1 -3
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/Avatar.js +3 -3
- package/dist/es2019/AvatarItem.js +2 -2
- package/dist/es2019/IconWrapper.js +1 -1
- package/dist/es2019/Presence.js +1 -4
- package/dist/es2019/Skeleton.js +2 -1
- package/dist/es2019/Status.js +1 -4
- package/dist/es2019/version.json +1 -1
- package/dist/esm/Avatar.js +3 -3
- package/dist/esm/AvatarItem.js +2 -2
- package/dist/esm/IconWrapper.js +1 -1
- package/dist/esm/Presence.js +1 -4
- package/dist/esm/Skeleton.js +2 -1
- package/dist/esm/Status.js +1 -4
- package/dist/esm/version.json +1 -1
- package/dist/types/Avatar.d.ts +3 -3
- package/dist/types/Presence.d.ts +2 -3
- package/dist/types/Status.d.ts +2 -3
- package/dist/types/entry-points/presence.d.ts +2 -1
- package/dist/types/entry-points/status.d.ts +2 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/types.d.ts +2 -0
- package/dist/types-ts4.5/Avatar.d.ts +3 -3
- package/dist/types-ts4.5/Presence.d.ts +2 -3
- package/dist/types-ts4.5/Status.d.ts +2 -3
- package/dist/types-ts4.5/entry-points/presence.d.ts +2 -1
- package/dist/types-ts4.5/entry-points/status.d.ts +2 -1
- package/dist/types-ts4.5/index.d.ts +3 -3
- package/dist/types-ts4.5/types.d.ts +2 -0
- package/package.json +3 -3
- package/report.api.md +4 -4
- package/tmp/api-report-tmp.d.ts +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/avatar
|
|
2
2
|
|
|
3
|
+
## 21.3.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`599bfe90ee3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/599bfe90ee3) - Internal change to use shape tokens. There is no expected visual change.
|
|
8
|
+
|
|
9
|
+
## 21.3.5
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`342bd17ba74`](https://bitbucket.org/atlassian/atlassian-frontend/commits/342bd17ba74) - Fix presence and status props being expanded to all strings instead of the allowed values.
|
|
14
|
+
|
|
3
15
|
## 21.3.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/Avatar.js
CHANGED
|
@@ -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.
|
|
25
|
+
var packageVersion = "21.3.6";
|
|
26
26
|
|
|
27
27
|
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
28
28
|
|
|
@@ -166,13 +166,13 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref) {
|
|
|
166
166
|
}), isValidIconSize && presence && !status && (0, _react2.jsx)(_Presence.PresenceWrapper, {
|
|
167
167
|
appearance: appearance,
|
|
168
168
|
size: size,
|
|
169
|
-
presence:
|
|
169
|
+
presence: typeof presence === 'string' ? presence : undefined,
|
|
170
170
|
testId: testId
|
|
171
171
|
}, customPresenceNode), isValidIconSize && status && (0, _react2.jsx)(_Status.StatusWrapper, {
|
|
172
172
|
appearance: appearance,
|
|
173
173
|
size: size,
|
|
174
174
|
borderColor: borderColor,
|
|
175
|
-
status:
|
|
175
|
+
status: typeof status === 'string' ? status : undefined,
|
|
176
176
|
testId: testId
|
|
177
177
|
}, customStatusNode));
|
|
178
178
|
});
|
package/dist/cjs/AvatarItem.js
CHANGED
|
@@ -24,14 +24,14 @@ var avatarItemStyles = (0, _react2.css)({
|
|
|
24
24
|
maxWidth: '100%',
|
|
25
25
|
paddingLeft: "var(--ds-space-100, 8px)",
|
|
26
26
|
flex: '1 1 100%',
|
|
27
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
27
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
28
28
|
lineHeight: '1.4'
|
|
29
29
|
});
|
|
30
30
|
var getStyles = function getStyles(css, _ref) {
|
|
31
31
|
var backgroundColor = _ref.backgroundColor,
|
|
32
32
|
isInteractive = _ref.isInteractive,
|
|
33
33
|
isDisabled = _ref.isDisabled;
|
|
34
|
-
return (// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
34
|
+
return (// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @repo/internal/react/no-css-string-literals
|
|
35
35
|
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: ", ";\n padding: ", ";\n text-align: left;\n text-decoration: none;\n width: 100%;\n\n ", "\n\n ", "\n "])), backgroundColor, (0, _constants.borderRadius)(), _constants2.BORDER_WIDTH, "var(--ds-space-0, 0px)", "var(--ds-space-050, 4px)", isInteractive && "\n :hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(_colors.N30, ")"), ";\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(_colors.B50, ")"), ";\n }\n "), isDisabled && "\n cursor: not-allowed;\n opacity: ".concat("var(--ds-opacity-disabled, 0.5)", ";\n pointer-events: none;\n "))
|
|
36
36
|
);
|
|
37
37
|
};
|
package/dist/cjs/IconWrapper.js
CHANGED
package/dist/cjs/Presence.js
CHANGED
|
@@ -14,8 +14,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
16
16
|
|
|
17
|
-
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
18
|
-
|
|
19
17
|
var BusyIndicator = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("circle", {
|
|
20
18
|
fill: "var(--ds-icon-danger, ".concat(_colors.R300, ")"),
|
|
21
19
|
cx: "4",
|
|
@@ -108,7 +106,7 @@ var PresenceWrapper = function PresenceWrapper(_ref2) {
|
|
|
108
106
|
}
|
|
109
107
|
}, /*#__PURE__*/_react.default.createElement(AvatarPresence, {
|
|
110
108
|
borderColor: borderColor,
|
|
111
|
-
presence: !children
|
|
109
|
+
presence: !children ? presence : undefined
|
|
112
110
|
}, children));
|
|
113
111
|
};
|
|
114
112
|
exports.PresenceWrapper = PresenceWrapper;
|
package/dist/cjs/Skeleton.js
CHANGED
|
@@ -32,11 +32,12 @@ var radiusStyles = Object.entries(_constants.AVATAR_RADIUS).reduce(function (sty
|
|
|
32
32
|
key = _ref4[0],
|
|
33
33
|
size = _ref4[1];
|
|
34
34
|
return _objectSpread(_objectSpread({}, styles), {}, (0, _defineProperty2.default)({}, key, (0, _react.css)({
|
|
35
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
35
36
|
borderRadius: "".concat(size, "px")
|
|
36
37
|
})));
|
|
37
38
|
}, {});
|
|
38
39
|
var defaultRadiusStyles = (0, _react.css)({
|
|
39
|
-
borderRadius:
|
|
40
|
+
borderRadius: "var(--ds-border-radius-circle, 50%)"
|
|
40
41
|
});
|
|
41
42
|
var strongOpacityStyles = (0, _react.css)({
|
|
42
43
|
opacity: 0.3
|
package/dist/cjs/Status.js
CHANGED
|
@@ -14,8 +14,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
14
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
15
|
// eslint-disable-next-line @repo/internal/fs/filename-pattern-match
|
|
16
16
|
|
|
17
|
-
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
18
|
-
|
|
19
17
|
var ApprovedIndicator = /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("circle", {
|
|
20
18
|
fill: "var(--ds-icon-success, ".concat(_colors.G400, ")"),
|
|
21
19
|
cx: "4",
|
|
@@ -105,7 +103,7 @@ var StatusWrapper = function StatusWrapper(_ref2) {
|
|
|
105
103
|
}
|
|
106
104
|
}, /*#__PURE__*/_react.default.createElement(AvatarStatus, {
|
|
107
105
|
borderColor: borderColor,
|
|
108
|
-
status: !children
|
|
106
|
+
status: !children ? status : undefined
|
|
109
107
|
}, children));
|
|
110
108
|
};
|
|
111
109
|
exports.StatusWrapper = StatusWrapper;
|
package/dist/cjs/version.json
CHANGED
package/dist/es2019/Avatar.js
CHANGED
|
@@ -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.
|
|
13
|
+
const packageVersion = "21.3.6";
|
|
14
14
|
|
|
15
15
|
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
16
16
|
|
|
@@ -246,13 +246,13 @@ const Avatar = /*#__PURE__*/forwardRef(({
|
|
|
246
246
|
}), isValidIconSize && presence && !status && jsx(PresenceWrapper, {
|
|
247
247
|
appearance: appearance,
|
|
248
248
|
size: size,
|
|
249
|
-
presence:
|
|
249
|
+
presence: typeof presence === 'string' ? presence : undefined,
|
|
250
250
|
testId: testId
|
|
251
251
|
}, customPresenceNode), isValidIconSize && status && jsx(StatusWrapper, {
|
|
252
252
|
appearance: appearance,
|
|
253
253
|
size: size,
|
|
254
254
|
borderColor: borderColor,
|
|
255
|
-
status:
|
|
255
|
+
status: typeof status === 'string' ? status : undefined,
|
|
256
256
|
testId: testId
|
|
257
257
|
}, customStatusNode));
|
|
258
258
|
});
|
|
@@ -12,7 +12,7 @@ const avatarItemStyles = css({
|
|
|
12
12
|
maxWidth: '100%',
|
|
13
13
|
paddingLeft: "var(--ds-space-100, 8px)",
|
|
14
14
|
flex: '1 1 100%',
|
|
15
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
15
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
16
16
|
lineHeight: '1.4'
|
|
17
17
|
});
|
|
18
18
|
const getStyles = (css, {
|
|
@@ -20,7 +20,7 @@ const getStyles = (css, {
|
|
|
20
20
|
isInteractive,
|
|
21
21
|
isDisabled
|
|
22
22
|
}) =>
|
|
23
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
23
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @repo/internal/react/no-css-string-literals
|
|
24
24
|
css`
|
|
25
25
|
align-items: center;
|
|
26
26
|
background-color: ${backgroundColor};
|
package/dist/es2019/Presence.js
CHANGED
|
@@ -3,9 +3,6 @@ import React, { Fragment } from 'react';
|
|
|
3
3
|
import { G300, N0, N200, N40, P300, R300 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { ICON_OFFSET, ICON_SIZES } from './constants';
|
|
5
5
|
import IconWrapper from './IconWrapper';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
8
|
-
|
|
9
6
|
const BusyIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
|
|
10
7
|
fill: `var(--ds-icon-danger, ${R300})`,
|
|
11
8
|
cx: "4",
|
|
@@ -97,6 +94,6 @@ export const PresenceWrapper = ({
|
|
|
97
94
|
}
|
|
98
95
|
}, /*#__PURE__*/React.createElement(AvatarPresence, {
|
|
99
96
|
borderColor: borderColor,
|
|
100
|
-
presence: !children
|
|
97
|
+
presence: !children ? presence : undefined
|
|
101
98
|
}, children));
|
|
102
99
|
};
|
package/dist/es2019/Skeleton.js
CHANGED
|
@@ -23,12 +23,13 @@ const radiusStyles = Object.entries(AVATAR_RADIUS).reduce((styles, [key, size])
|
|
|
23
23
|
return {
|
|
24
24
|
...styles,
|
|
25
25
|
[key]: css({
|
|
26
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
26
27
|
borderRadius: `${size}px`
|
|
27
28
|
})
|
|
28
29
|
};
|
|
29
30
|
}, {});
|
|
30
31
|
const defaultRadiusStyles = css({
|
|
31
|
-
borderRadius:
|
|
32
|
+
borderRadius: "var(--ds-border-radius-circle, 50%)"
|
|
32
33
|
});
|
|
33
34
|
const strongOpacityStyles = css({
|
|
34
35
|
opacity: 0.3
|
package/dist/es2019/Status.js
CHANGED
|
@@ -3,9 +3,6 @@ import React, { Fragment } from 'react';
|
|
|
3
3
|
import { G400, N0, N40, N500, R400 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { ICON_OFFSET, ICON_SIZES } from './constants';
|
|
5
5
|
import IconWrapper from './IconWrapper';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
8
|
-
|
|
9
6
|
const ApprovedIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
|
|
10
7
|
fill: `var(--ds-icon-success, ${G400})`,
|
|
11
8
|
cx: "4",
|
|
@@ -94,6 +91,6 @@ export const StatusWrapper = ({
|
|
|
94
91
|
}
|
|
95
92
|
}, /*#__PURE__*/React.createElement(AvatarStatus, {
|
|
96
93
|
borderColor: borderColor,
|
|
97
|
-
status: !children
|
|
94
|
+
status: !children ? status : undefined
|
|
98
95
|
}, children));
|
|
99
96
|
};
|
package/dist/es2019/version.json
CHANGED
package/dist/esm/Avatar.js
CHANGED
|
@@ -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.
|
|
18
|
+
var packageVersion = "21.3.6";
|
|
19
19
|
|
|
20
20
|
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
21
21
|
|
|
@@ -159,13 +159,13 @@ var Avatar = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
159
159
|
}), isValidIconSize && presence && !status && jsx(PresenceWrapper, {
|
|
160
160
|
appearance: appearance,
|
|
161
161
|
size: size,
|
|
162
|
-
presence:
|
|
162
|
+
presence: typeof presence === 'string' ? presence : undefined,
|
|
163
163
|
testId: testId
|
|
164
164
|
}, customPresenceNode), isValidIconSize && status && jsx(StatusWrapper, {
|
|
165
165
|
appearance: appearance,
|
|
166
166
|
size: size,
|
|
167
167
|
borderColor: borderColor,
|
|
168
|
-
status:
|
|
168
|
+
status: typeof status === 'string' ? status : undefined,
|
|
169
169
|
testId: testId
|
|
170
170
|
}, customStatusNode));
|
|
171
171
|
});
|
package/dist/esm/AvatarItem.js
CHANGED
|
@@ -17,14 +17,14 @@ var avatarItemStyles = css({
|
|
|
17
17
|
maxWidth: '100%',
|
|
18
18
|
paddingLeft: "var(--ds-space-100, 8px)",
|
|
19
19
|
flex: '1 1 100%',
|
|
20
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
20
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
21
21
|
lineHeight: '1.4'
|
|
22
22
|
});
|
|
23
23
|
var getStyles = function getStyles(css, _ref) {
|
|
24
24
|
var backgroundColor = _ref.backgroundColor,
|
|
25
25
|
isInteractive = _ref.isInteractive,
|
|
26
26
|
isDisabled = _ref.isDisabled;
|
|
27
|
-
return (// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
27
|
+
return (// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @repo/internal/react/no-css-string-literals
|
|
28
28
|
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: ", ";\n padding: ", ";\n text-align: left;\n text-decoration: none;\n width: 100%;\n\n ", "\n\n ", "\n "])), backgroundColor, borderRadius(), BORDER_WIDTH, "var(--ds-space-0, 0px)", "var(--ds-space-050, 4px)", isInteractive && "\n :hover {\n background-color: ".concat("var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")"), ";\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(B50, ")"), ";\n }\n "), isDisabled && "\n cursor: not-allowed;\n opacity: ".concat("var(--ds-opacity-disabled, 0.5)", ";\n pointer-events: none;\n "))
|
|
29
29
|
);
|
|
30
30
|
};
|
package/dist/esm/IconWrapper.js
CHANGED
package/dist/esm/Presence.js
CHANGED
|
@@ -3,9 +3,6 @@ import React, { Fragment } from 'react';
|
|
|
3
3
|
import { G300, N0, N200, N40, P300, R300 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { ICON_OFFSET, ICON_SIZES } from './constants';
|
|
5
5
|
import IconWrapper from './IconWrapper';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
8
|
-
|
|
9
6
|
var BusyIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
|
|
10
7
|
fill: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
11
8
|
cx: "4",
|
|
@@ -97,6 +94,6 @@ export var PresenceWrapper = function PresenceWrapper(_ref2) {
|
|
|
97
94
|
}
|
|
98
95
|
}, /*#__PURE__*/React.createElement(AvatarPresence, {
|
|
99
96
|
borderColor: borderColor,
|
|
100
|
-
presence: !children
|
|
97
|
+
presence: !children ? presence : undefined
|
|
101
98
|
}, children));
|
|
102
99
|
};
|
package/dist/esm/Skeleton.js
CHANGED
|
@@ -28,11 +28,12 @@ var radiusStyles = Object.entries(AVATAR_RADIUS).reduce(function (styles, _ref3)
|
|
|
28
28
|
key = _ref4[0],
|
|
29
29
|
size = _ref4[1];
|
|
30
30
|
return _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, key, css({
|
|
31
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
31
32
|
borderRadius: "".concat(size, "px")
|
|
32
33
|
})));
|
|
33
34
|
}, {});
|
|
34
35
|
var defaultRadiusStyles = css({
|
|
35
|
-
borderRadius:
|
|
36
|
+
borderRadius: "var(--ds-border-radius-circle, 50%)"
|
|
36
37
|
});
|
|
37
38
|
var strongOpacityStyles = css({
|
|
38
39
|
opacity: 0.3
|
package/dist/esm/Status.js
CHANGED
|
@@ -3,9 +3,6 @@ import React, { Fragment } from 'react';
|
|
|
3
3
|
import { G400, N0, N40, N500, R400 } from '@atlaskit/theme/colors';
|
|
4
4
|
import { ICON_OFFSET, ICON_SIZES } from './constants';
|
|
5
5
|
import IconWrapper from './IconWrapper';
|
|
6
|
-
|
|
7
|
-
// eslint-disable-next-line @repo/internal/react/consistent-types-definitions
|
|
8
|
-
|
|
9
6
|
var ApprovedIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
|
|
10
7
|
fill: "var(--ds-icon-success, ".concat(G400, ")"),
|
|
11
8
|
cx: "4",
|
|
@@ -94,6 +91,6 @@ export var StatusWrapper = function StatusWrapper(_ref2) {
|
|
|
94
91
|
}
|
|
95
92
|
}, /*#__PURE__*/React.createElement(AvatarStatus, {
|
|
96
93
|
borderColor: borderColor,
|
|
97
|
-
status: !children
|
|
94
|
+
status: !children ? status : undefined
|
|
98
95
|
}, children));
|
|
99
96
|
};
|
package/dist/esm/version.json
CHANGED
package/dist/types/Avatar.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { MouseEventHandler, ReactNode, Ref } from 'react';
|
|
3
|
-
import { AppearanceType, AvatarClickEventHandler, SizeType } from './types';
|
|
3
|
+
import { AppearanceType, AvatarClickEventHandler, Presence, SizeType, Status } from './types';
|
|
4
4
|
export interface CustomAvatarProps {
|
|
5
5
|
/**
|
|
6
6
|
* This is used in render props so is okay to be defined.
|
|
@@ -54,7 +54,7 @@ export interface AvatarPropTypes {
|
|
|
54
54
|
* Alternatively accepts any React element. For best results, it is recommended to
|
|
55
55
|
* use square content with height and width of 100%.
|
|
56
56
|
*/
|
|
57
|
-
presence?:
|
|
57
|
+
presence?: Presence | Omit<ReactNode, string> | (string & {}) | null;
|
|
58
58
|
/**
|
|
59
59
|
* Defines the size of the avatar
|
|
60
60
|
*/
|
|
@@ -67,7 +67,7 @@ export interface AvatarPropTypes {
|
|
|
67
67
|
* Indicates contextual information by showing a small icon on the avatar.
|
|
68
68
|
* Refer to status values on the Status component.
|
|
69
69
|
*/
|
|
70
|
-
status?:
|
|
70
|
+
status?: Status | Omit<ReactNode, string> | (string & {}) | null;
|
|
71
71
|
/**
|
|
72
72
|
* The index of where this avatar is in the group `stack`.
|
|
73
73
|
*/
|
package/dist/types/Presence.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { AppearanceType, IndicatorSizeType } from './types';
|
|
3
|
-
export type PresenceType = 'busy' | 'focus' | 'offline' | 'online' | ReactNode;
|
|
2
|
+
import { AppearanceType, IndicatorSizeType, Presence } from './types';
|
|
4
3
|
export interface PresenceProps {
|
|
5
4
|
/**
|
|
6
5
|
* Used to override the default border color of the presence indicator.
|
|
@@ -15,7 +14,7 @@ export interface PresenceProps {
|
|
|
15
14
|
/**
|
|
16
15
|
* The type of presence indicator to show
|
|
17
16
|
*/
|
|
18
|
-
presence?:
|
|
17
|
+
presence?: Presence;
|
|
19
18
|
/**
|
|
20
19
|
* Test Id
|
|
21
20
|
*/
|
package/dist/types/Status.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { AppearanceType, IndicatorSizeType } from './types';
|
|
3
|
-
export type StatusType = ('approved' | 'declined' | 'locked') | ReactNode;
|
|
2
|
+
import { AppearanceType, IndicatorSizeType, Status } from './types';
|
|
4
3
|
export interface StatusProps {
|
|
5
4
|
/**
|
|
6
5
|
* Override the default border color of the status indicator. This accepts
|
|
@@ -16,7 +15,7 @@ export interface StatusProps {
|
|
|
16
15
|
* Content to use as a custom status indicator. Not needed if consuming
|
|
17
16
|
* `Status` separate to `Avatar`.
|
|
18
17
|
*/
|
|
19
|
-
status?:
|
|
18
|
+
status?: Status;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
21
|
* __Avatar status__
|
package/dist/types/index.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ export type { AvatarPropTypes, CustomAvatarProps } from './Avatar';
|
|
|
3
3
|
export { default as AvatarItem } from './AvatarItem';
|
|
4
4
|
export type { AvatarItemProps, CustomAvatarItemProps } from './AvatarItem';
|
|
5
5
|
export { default as Presence } from './Presence';
|
|
6
|
-
export type { PresenceProps
|
|
6
|
+
export type { PresenceProps } from './Presence';
|
|
7
7
|
export { default as Status } from './Status';
|
|
8
|
-
export type { StatusProps
|
|
8
|
+
export type { StatusProps } from './Status';
|
|
9
9
|
export { default as Skeleton } from './Skeleton';
|
|
10
10
|
export type { SkeletonProps } from './Skeleton';
|
|
11
11
|
export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR, } from './constants';
|
|
12
|
-
export type { AvatarClickEventHandler, AppearanceType, SizeType, IndicatorSizeType, } from './types';
|
|
12
|
+
export type { AvatarClickEventHandler, AppearanceType, SizeType, Presence as PresenceType, Status as StatusType, IndicatorSizeType, } from './types';
|
package/dist/types/types.d.ts
CHANGED
|
@@ -5,3 +5,5 @@ export type AppearanceType = 'circle' | 'square';
|
|
|
5
5
|
export type SizeType = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
6
6
|
export type IndicatorSizeType = 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
7
|
export type AvatarClickEventHandler = (event: React.MouseEvent, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
8
|
+
export type Status = 'approved' | 'declined' | 'locked';
|
|
9
|
+
export type Presence = 'online' | 'busy' | 'focus' | 'offline';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import { MouseEventHandler, ReactNode, Ref } from 'react';
|
|
3
|
-
import { AppearanceType, AvatarClickEventHandler, SizeType } from './types';
|
|
3
|
+
import { AppearanceType, AvatarClickEventHandler, Presence, SizeType, Status } from './types';
|
|
4
4
|
export interface CustomAvatarProps {
|
|
5
5
|
/**
|
|
6
6
|
* This is used in render props so is okay to be defined.
|
|
@@ -54,7 +54,7 @@ export interface AvatarPropTypes {
|
|
|
54
54
|
* Alternatively accepts any React element. For best results, it is recommended to
|
|
55
55
|
* use square content with height and width of 100%.
|
|
56
56
|
*/
|
|
57
|
-
presence?:
|
|
57
|
+
presence?: Presence | Omit<ReactNode, string> | (string & {}) | null;
|
|
58
58
|
/**
|
|
59
59
|
* Defines the size of the avatar
|
|
60
60
|
*/
|
|
@@ -67,7 +67,7 @@ export interface AvatarPropTypes {
|
|
|
67
67
|
* Indicates contextual information by showing a small icon on the avatar.
|
|
68
68
|
* Refer to status values on the Status component.
|
|
69
69
|
*/
|
|
70
|
-
status?:
|
|
70
|
+
status?: Status | Omit<ReactNode, string> | (string & {}) | null;
|
|
71
71
|
/**
|
|
72
72
|
* The index of where this avatar is in the group `stack`.
|
|
73
73
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { AppearanceType, IndicatorSizeType } from './types';
|
|
3
|
-
export type PresenceType = 'busy' | 'focus' | 'offline' | 'online' | ReactNode;
|
|
2
|
+
import { AppearanceType, IndicatorSizeType, Presence } from './types';
|
|
4
3
|
export interface PresenceProps {
|
|
5
4
|
/**
|
|
6
5
|
* Used to override the default border color of the presence indicator.
|
|
@@ -15,7 +14,7 @@ export interface PresenceProps {
|
|
|
15
14
|
/**
|
|
16
15
|
* The type of presence indicator to show
|
|
17
16
|
*/
|
|
18
|
-
presence?:
|
|
17
|
+
presence?: Presence;
|
|
19
18
|
/**
|
|
20
19
|
* Test Id
|
|
21
20
|
*/
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { FC, ReactNode } from 'react';
|
|
2
|
-
import { AppearanceType, IndicatorSizeType } from './types';
|
|
3
|
-
export type StatusType = ('approved' | 'declined' | 'locked') | ReactNode;
|
|
2
|
+
import { AppearanceType, IndicatorSizeType, Status } from './types';
|
|
4
3
|
export interface StatusProps {
|
|
5
4
|
/**
|
|
6
5
|
* Override the default border color of the status indicator. This accepts
|
|
@@ -16,7 +15,7 @@ export interface StatusProps {
|
|
|
16
15
|
* Content to use as a custom status indicator. Not needed if consuming
|
|
17
16
|
* `Status` separate to `Avatar`.
|
|
18
17
|
*/
|
|
19
|
-
status?:
|
|
18
|
+
status?: Status;
|
|
20
19
|
}
|
|
21
20
|
/**
|
|
22
21
|
* __Avatar status__
|
|
@@ -3,10 +3,10 @@ export type { AvatarPropTypes, CustomAvatarProps } from './Avatar';
|
|
|
3
3
|
export { default as AvatarItem } from './AvatarItem';
|
|
4
4
|
export type { AvatarItemProps, CustomAvatarItemProps } from './AvatarItem';
|
|
5
5
|
export { default as Presence } from './Presence';
|
|
6
|
-
export type { PresenceProps
|
|
6
|
+
export type { PresenceProps } from './Presence';
|
|
7
7
|
export { default as Status } from './Status';
|
|
8
|
-
export type { StatusProps
|
|
8
|
+
export type { StatusProps } from './Status';
|
|
9
9
|
export { default as Skeleton } from './Skeleton';
|
|
10
10
|
export type { SkeletonProps } from './Skeleton';
|
|
11
11
|
export { AVATAR_SIZES, BORDER_WIDTH, AVATAR_RADIUS, ACTIVE_SCALE_FACTOR, } from './constants';
|
|
12
|
-
export type { AvatarClickEventHandler, AppearanceType, SizeType, IndicatorSizeType, } from './types';
|
|
12
|
+
export type { AvatarClickEventHandler, AppearanceType, SizeType, Presence as PresenceType, Status as StatusType, IndicatorSizeType, } from './types';
|
|
@@ -5,3 +5,5 @@ export type AppearanceType = 'circle' | 'square';
|
|
|
5
5
|
export type SizeType = 'xsmall' | 'small' | 'medium' | 'large' | 'xlarge' | 'xxlarge';
|
|
6
6
|
export type IndicatorSizeType = 'small' | 'medium' | 'large' | 'xlarge';
|
|
7
7
|
export type AvatarClickEventHandler = (event: React.MouseEvent, analyticsEvent?: UIAnalyticsEvent) => void;
|
|
8
|
+
export type Status = 'approved' | 'declined' | 'locked';
|
|
9
|
+
export type Presence = 'online' | 'busy' | 'focus' | 'offline';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/avatar",
|
|
3
|
-
"version": "21.3.
|
|
3
|
+
"version": "21.3.6",
|
|
4
4
|
"description": "An avatar is a visual representation of a user or entity.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -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.
|
|
46
|
+
"@atlaskit/tokens": "^1.11.0",
|
|
47
47
|
"@babel/runtime": "^7.0.0",
|
|
48
48
|
"@emotion/react": "^11.7.1",
|
|
49
49
|
"@emotion/serialize": "^1.1.0"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"react": "^16.8.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@atlaskit/button": "^16.
|
|
55
|
+
"@atlaskit/button": "^16.8.0",
|
|
56
56
|
"@atlaskit/docs": "*",
|
|
57
57
|
"@atlaskit/ds-lib": "^2.2.0",
|
|
58
58
|
"@atlaskit/icon": "^21.12.0",
|
package/report.api.md
CHANGED
|
@@ -81,11 +81,11 @@ export interface AvatarPropTypes {
|
|
|
81
81
|
label?: string;
|
|
82
82
|
name?: string;
|
|
83
83
|
onClick?: AvatarClickEventHandler;
|
|
84
|
-
presence?: (
|
|
84
|
+
presence?: (string & {}) | Omit<ReactNode, string> | PresenceType | null;
|
|
85
85
|
size?: SizeType;
|
|
86
86
|
src?: string;
|
|
87
87
|
stackIndex?: number;
|
|
88
|
-
status?: (
|
|
88
|
+
status?: (string & {}) | Omit<ReactNode, string> | StatusType | null;
|
|
89
89
|
tabIndex?: number;
|
|
90
90
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
91
91
|
testId?: string;
|
|
@@ -150,7 +150,7 @@ export interface PresenceProps {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
// @public (undocumented)
|
|
153
|
-
export type PresenceType = 'busy' | 'focus' | 'offline' | 'online'
|
|
153
|
+
export type PresenceType = 'busy' | 'focus' | 'offline' | 'online';
|
|
154
154
|
|
|
155
155
|
// @public (undocumented)
|
|
156
156
|
export type SizeType =
|
|
@@ -187,7 +187,7 @@ export interface StatusProps {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
// @public (undocumented)
|
|
190
|
-
export type StatusType =
|
|
190
|
+
export type StatusType = 'approved' | 'declined' | 'locked';
|
|
191
191
|
|
|
192
192
|
// (No @packageDocumentation comment for this package)
|
|
193
193
|
```
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -63,11 +63,11 @@ export interface AvatarPropTypes {
|
|
|
63
63
|
label?: string;
|
|
64
64
|
name?: string;
|
|
65
65
|
onClick?: AvatarClickEventHandler;
|
|
66
|
-
presence?: (
|
|
66
|
+
presence?: (string & {}) | Omit<ReactNode, string> | PresenceType | null;
|
|
67
67
|
size?: SizeType;
|
|
68
68
|
src?: string;
|
|
69
69
|
stackIndex?: number;
|
|
70
|
-
status?: (
|
|
70
|
+
status?: (string & {}) | Omit<ReactNode, string> | StatusType | null;
|
|
71
71
|
tabIndex?: number;
|
|
72
72
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
73
73
|
testId?: string;
|
|
@@ -132,7 +132,7 @@ export interface PresenceProps {
|
|
|
132
132
|
}
|
|
133
133
|
|
|
134
134
|
// @public (undocumented)
|
|
135
|
-
export type PresenceType = 'busy' | 'focus' | 'offline' | 'online'
|
|
135
|
+
export type PresenceType = 'busy' | 'focus' | 'offline' | 'online';
|
|
136
136
|
|
|
137
137
|
// @public (undocumented)
|
|
138
138
|
export type SizeType = 'large' | 'medium' | 'small' | 'xlarge' | 'xsmall' | 'xxlarge';
|
|
@@ -163,7 +163,7 @@ export interface StatusProps {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
// @public (undocumented)
|
|
166
|
-
export type StatusType =
|
|
166
|
+
export type StatusType = 'approved' | 'declined' | 'locked';
|
|
167
167
|
|
|
168
168
|
// (No @packageDocumentation comment for this package)
|
|
169
169
|
|