@zendeskgarden/react-avatars 8.54.3 → 8.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +29 -16
- package/dist/index.esm.js +30 -17
- package/dist/typings/types/index.d.ts +2 -0
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -11,8 +11,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
11
11
|
|
|
12
12
|
var React = require('react');
|
|
13
13
|
var PropTypes = require('prop-types');
|
|
14
|
-
var styled = require('styled-components');
|
|
15
14
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
15
|
+
var styled = require('styled-components');
|
|
16
16
|
var polished = require('polished');
|
|
17
17
|
|
|
18
18
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -41,7 +41,7 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
41
41
|
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
42
42
|
|
|
43
43
|
function _extends$4() {
|
|
44
|
-
_extends$4 = Object.assign
|
|
44
|
+
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
45
45
|
for (var i = 1; i < arguments.length; i++) {
|
|
46
46
|
var source = arguments[i];
|
|
47
47
|
|
|
@@ -54,7 +54,6 @@ function _extends$4() {
|
|
|
54
54
|
|
|
55
55
|
return target;
|
|
56
56
|
};
|
|
57
|
-
|
|
58
57
|
return _extends$4.apply(this, arguments);
|
|
59
58
|
}
|
|
60
59
|
|
|
@@ -171,7 +170,7 @@ function _nonIterableRest() {
|
|
|
171
170
|
|
|
172
171
|
var _g$1;
|
|
173
172
|
|
|
174
|
-
function _extends$3() { _extends$3 = Object.assign
|
|
173
|
+
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
175
174
|
|
|
176
175
|
var SvgClockStroke$1 = function SvgClockStroke(props) {
|
|
177
176
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$3({
|
|
@@ -197,7 +196,7 @@ var SvgClockStroke$1 = function SvgClockStroke(props) {
|
|
|
197
196
|
|
|
198
197
|
var _g;
|
|
199
198
|
|
|
200
|
-
function _extends$2() { _extends$2 = Object.assign
|
|
199
|
+
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
201
200
|
|
|
202
201
|
var SvgClockStroke = function SvgClockStroke(props) {
|
|
203
202
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$2({
|
|
@@ -223,7 +222,7 @@ var SvgClockStroke = function SvgClockStroke(props) {
|
|
|
223
222
|
|
|
224
223
|
var _path$1;
|
|
225
224
|
|
|
226
|
-
function _extends$1() { _extends$1 = Object.assign
|
|
225
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
227
226
|
|
|
228
227
|
var SvgArrowLeftSmStroke$1 = function SvgArrowLeftSmStroke(props) {
|
|
229
228
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
|
|
@@ -241,7 +240,7 @@ var SvgArrowLeftSmStroke$1 = function SvgArrowLeftSmStroke(props) {
|
|
|
241
240
|
|
|
242
241
|
var _path;
|
|
243
242
|
|
|
244
|
-
function _extends() { _extends = Object.assign
|
|
243
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
245
244
|
|
|
246
245
|
var SvgArrowLeftSmStroke = function SvgArrowLeftSmStroke(props) {
|
|
247
246
|
return /*#__PURE__*/React__namespace.createElement("svg", _extends({
|
|
@@ -263,7 +262,7 @@ var STATUS = ['available', 'away', 'transfers', 'offline'];
|
|
|
263
262
|
var COMPONENT_ID$2 = 'avatars.text';
|
|
264
263
|
var StyledText = styled__default["default"].span.attrs({
|
|
265
264
|
'data-garden-id': COMPONENT_ID$2,
|
|
266
|
-
'data-garden-version': '8.
|
|
265
|
+
'data-garden-version': '8.56.0'
|
|
267
266
|
}).withConfig({
|
|
268
267
|
displayName: "StyledText",
|
|
269
268
|
componentId: "sc-1a6hivh-0"
|
|
@@ -337,7 +336,7 @@ var sizeStyles$1 = function sizeStyles(props) {
|
|
|
337
336
|
padding = polished.math("".concat(props.theme.space.base + 3, "px - (").concat(borderWidth, " * 2)"));
|
|
338
337
|
break;
|
|
339
338
|
}
|
|
340
|
-
return styled.css(["border:", " ", ";border-radius:", ";min-width:", ";max-width:calc(2em + (", " * 3));height:", ";box-sizing:content-box;overflow:hidden;text-align:center;text-overflow:ellipsis;line-height:", ";white-space:nowrap;font-size:", ";font-weight:", ";& > span{display:", ";padding:0 ", ";max-width:2em;overflow:inherit;text-align:inherit;text-overflow:inherit;white-space:inherit;}& > svg{", " position:absolute;top:-", ";left:-", ";transform-origin:50% 50
|
|
339
|
+
return styled.css(["border:", " ", ";border-radius:", ";min-width:", ";max-width:calc(2em + (", " * 3));height:", ";box-sizing:content-box;overflow:hidden;text-align:center;text-overflow:ellipsis;line-height:", ";white-space:nowrap;font-size:", ";font-weight:", ";& > span{display:", ";padding:0 ", ";max-width:2em;overflow:inherit;text-align:inherit;text-overflow:inherit;white-space:inherit;}& > svg{", " position:absolute;top:-", ";left:-", ";transform-origin:50% 50%;max-height:unset;&[data-icon-status='transfers']{transform:scale(", ",1);}&[data-icon-status='away'] circle{display:none;}}"], borderWidth, props.theme.borderStyles.solid, height, height, borderWidth, height, height, props.theme.fontSizes.xs, props.theme.fontWeights.semibold, isVisible ? 'inline-block' : 'none', padding, !isVisible && 'display: none;', borderWidth, borderWidth, props.theme.rtl ? -1 : 1);
|
|
341
340
|
};
|
|
342
341
|
var colorStyles$1 = function colorStyles(props) {
|
|
343
342
|
var foregroundColor = props.foregroundColor || props.theme.palette.white;
|
|
@@ -365,7 +364,7 @@ var colorStyles$1 = function colorStyles(props) {
|
|
|
365
364
|
};
|
|
366
365
|
var StyledStatusIndicator = styled__default["default"].div.attrs({
|
|
367
366
|
'data-garden-id': COMPONENT_ID$1,
|
|
368
|
-
'data-garden-version': '8.
|
|
367
|
+
'data-garden-version': '8.56.0'
|
|
369
368
|
}).withConfig({
|
|
370
369
|
displayName: "StyledStatusIndicator",
|
|
371
370
|
componentId: "sc-16t9if3-0"
|
|
@@ -449,7 +448,7 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
449
448
|
};
|
|
450
449
|
var StyledAvatar = styled__default["default"].figure.attrs({
|
|
451
450
|
'data-garden-id': COMPONENT_ID,
|
|
452
|
-
'data-garden-version': '8.
|
|
451
|
+
'data-garden-version': '8.56.0'
|
|
453
452
|
}).withConfig({
|
|
454
453
|
displayName: "StyledAvatar",
|
|
455
454
|
componentId: "sc-608m04-0"
|
|
@@ -483,7 +482,7 @@ var AvatarComponent = React.forwardRef(function (_ref, ref) {
|
|
|
483
482
|
surfaceColor = _ref.surfaceColor,
|
|
484
483
|
backgroundColor = _ref.backgroundColor,
|
|
485
484
|
foregroundColor = _ref.foregroundColor,
|
|
486
|
-
|
|
485
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
487
486
|
var computedStatus = badge === undefined ? status : 'active';
|
|
488
487
|
var ClockIcon = SvgClockStroke$1;
|
|
489
488
|
var ArrowLeftIcon = SvgArrowLeftSmStroke$1;
|
|
@@ -491,6 +490,15 @@ var AvatarComponent = React.forwardRef(function (_ref, ref) {
|
|
|
491
490
|
ClockIcon = SvgClockStroke;
|
|
492
491
|
ArrowLeftIcon = SvgArrowLeftSmStroke;
|
|
493
492
|
}
|
|
493
|
+
var defaultStatusLabel = React.useMemo(function () {
|
|
494
|
+
var statusMessage = computedStatus;
|
|
495
|
+
if (computedStatus === 'active') {
|
|
496
|
+
var count = typeof badge === 'string' ? parseInt(badge, 10) : badge;
|
|
497
|
+
statusMessage = "active. ".concat(count > 0 ? "".concat(count, " notification").concat(count > 1 ? 's' : '') : 'no notifications');
|
|
498
|
+
}
|
|
499
|
+
return ['status'].concat(statusMessage || []).join(': ');
|
|
500
|
+
}, [computedStatus, badge]);
|
|
501
|
+
var statusLabel = reactTheming.useText(AvatarComponent, props, 'statusLabel', defaultStatusLabel);
|
|
494
502
|
return React__default["default"].createElement(StyledAvatar, _extends$4({
|
|
495
503
|
ref: ref,
|
|
496
504
|
isSystem: isSystem,
|
|
@@ -501,13 +509,17 @@ var AvatarComponent = React.forwardRef(function (_ref, ref) {
|
|
|
501
509
|
foregroundColor: foregroundColor,
|
|
502
510
|
"aria-atomic": "true",
|
|
503
511
|
"aria-live": "polite"
|
|
504
|
-
},
|
|
512
|
+
}, props), React.Children.only(children), computedStatus && React__default["default"].createElement(StyledStatusIndicator, {
|
|
505
513
|
size: size,
|
|
506
514
|
status: computedStatus,
|
|
507
515
|
backgroundColor: backgroundColor,
|
|
508
516
|
foregroundColor: foregroundColor,
|
|
509
|
-
surfaceColor: surfaceColor
|
|
510
|
-
|
|
517
|
+
surfaceColor: surfaceColor,
|
|
518
|
+
"aria-label": statusLabel,
|
|
519
|
+
role: "img"
|
|
520
|
+
}, computedStatus === 'active' ? React__default["default"].createElement("span", {
|
|
521
|
+
"aria-hidden": "true"
|
|
522
|
+
}, badge) : React__default["default"].createElement(React__default["default"].Fragment, null, computedStatus === 'away' ? React__default["default"].createElement(ClockIcon, {
|
|
511
523
|
"data-icon-status": computedStatus
|
|
512
524
|
}) : null, computedStatus === 'transfers' ? React__default["default"].createElement(ArrowLeftIcon, {
|
|
513
525
|
"data-icon-status": computedStatus
|
|
@@ -521,7 +533,8 @@ AvatarComponent.propTypes = {
|
|
|
521
533
|
isSystem: PropTypes__default["default"].bool,
|
|
522
534
|
badge: PropTypes__default["default"].oneOfType([PropTypes__default["default"].string, PropTypes__default["default"].number]),
|
|
523
535
|
size: PropTypes__default["default"].oneOf(SIZE),
|
|
524
|
-
status: PropTypes__default["default"].oneOf(STATUS)
|
|
536
|
+
status: PropTypes__default["default"].oneOf(STATUS),
|
|
537
|
+
statusLabel: PropTypes__default["default"].string
|
|
525
538
|
};
|
|
526
539
|
AvatarComponent.defaultProps = {
|
|
527
540
|
size: 'medium'
|
package/dist/index.esm.js
CHANGED
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
import * as React from 'react';
|
|
9
|
-
import React__default, { forwardRef, Children } from 'react';
|
|
9
|
+
import React__default, { forwardRef, useMemo, Children } from 'react';
|
|
10
10
|
import PropTypes from 'prop-types';
|
|
11
|
+
import { retrieveComponentStyles, DEFAULT_THEME, getColor, useText } from '@zendeskgarden/react-theming';
|
|
11
12
|
import styled, { css, keyframes } from 'styled-components';
|
|
12
|
-
import { retrieveComponentStyles, DEFAULT_THEME, getColor } from '@zendeskgarden/react-theming';
|
|
13
13
|
import { math } from 'polished';
|
|
14
14
|
|
|
15
15
|
function _extends$4() {
|
|
16
|
-
_extends$4 = Object.assign
|
|
16
|
+
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
17
17
|
for (var i = 1; i < arguments.length; i++) {
|
|
18
18
|
var source = arguments[i];
|
|
19
19
|
|
|
@@ -26,7 +26,6 @@ function _extends$4() {
|
|
|
26
26
|
|
|
27
27
|
return target;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
29
|
return _extends$4.apply(this, arguments);
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -143,7 +142,7 @@ function _nonIterableRest() {
|
|
|
143
142
|
|
|
144
143
|
var _g$1;
|
|
145
144
|
|
|
146
|
-
function _extends$3() { _extends$3 = Object.assign
|
|
145
|
+
function _extends$3() { _extends$3 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$3.apply(this, arguments); }
|
|
147
146
|
|
|
148
147
|
var SvgClockStroke$1 = function SvgClockStroke(props) {
|
|
149
148
|
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
@@ -169,7 +168,7 @@ var SvgClockStroke$1 = function SvgClockStroke(props) {
|
|
|
169
168
|
|
|
170
169
|
var _g;
|
|
171
170
|
|
|
172
|
-
function _extends$2() { _extends$2 = Object.assign
|
|
171
|
+
function _extends$2() { _extends$2 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$2.apply(this, arguments); }
|
|
173
172
|
|
|
174
173
|
var SvgClockStroke = function SvgClockStroke(props) {
|
|
175
174
|
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
@@ -195,7 +194,7 @@ var SvgClockStroke = function SvgClockStroke(props) {
|
|
|
195
194
|
|
|
196
195
|
var _path$1;
|
|
197
196
|
|
|
198
|
-
function _extends$1() { _extends$1 = Object.assign
|
|
197
|
+
function _extends$1() { _extends$1 = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
199
198
|
|
|
200
199
|
var SvgArrowLeftSmStroke$1 = function SvgArrowLeftSmStroke(props) {
|
|
201
200
|
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
@@ -213,7 +212,7 @@ var SvgArrowLeftSmStroke$1 = function SvgArrowLeftSmStroke(props) {
|
|
|
213
212
|
|
|
214
213
|
var _path;
|
|
215
214
|
|
|
216
|
-
function _extends() { _extends = Object.assign
|
|
215
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
217
216
|
|
|
218
217
|
var SvgArrowLeftSmStroke = function SvgArrowLeftSmStroke(props) {
|
|
219
218
|
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
@@ -235,7 +234,7 @@ var STATUS = ['available', 'away', 'transfers', 'offline'];
|
|
|
235
234
|
var COMPONENT_ID$2 = 'avatars.text';
|
|
236
235
|
var StyledText = styled.span.attrs({
|
|
237
236
|
'data-garden-id': COMPONENT_ID$2,
|
|
238
|
-
'data-garden-version': '8.
|
|
237
|
+
'data-garden-version': '8.56.0'
|
|
239
238
|
}).withConfig({
|
|
240
239
|
displayName: "StyledText",
|
|
241
240
|
componentId: "sc-1a6hivh-0"
|
|
@@ -309,7 +308,7 @@ var sizeStyles$1 = function sizeStyles(props) {
|
|
|
309
308
|
padding = math("".concat(props.theme.space.base + 3, "px - (").concat(borderWidth, " * 2)"));
|
|
310
309
|
break;
|
|
311
310
|
}
|
|
312
|
-
return css(["border:", " ", ";border-radius:", ";min-width:", ";max-width:calc(2em + (", " * 3));height:", ";box-sizing:content-box;overflow:hidden;text-align:center;text-overflow:ellipsis;line-height:", ";white-space:nowrap;font-size:", ";font-weight:", ";& > span{display:", ";padding:0 ", ";max-width:2em;overflow:inherit;text-align:inherit;text-overflow:inherit;white-space:inherit;}& > svg{", " position:absolute;top:-", ";left:-", ";transform-origin:50% 50
|
|
311
|
+
return css(["border:", " ", ";border-radius:", ";min-width:", ";max-width:calc(2em + (", " * 3));height:", ";box-sizing:content-box;overflow:hidden;text-align:center;text-overflow:ellipsis;line-height:", ";white-space:nowrap;font-size:", ";font-weight:", ";& > span{display:", ";padding:0 ", ";max-width:2em;overflow:inherit;text-align:inherit;text-overflow:inherit;white-space:inherit;}& > svg{", " position:absolute;top:-", ";left:-", ";transform-origin:50% 50%;max-height:unset;&[data-icon-status='transfers']{transform:scale(", ",1);}&[data-icon-status='away'] circle{display:none;}}"], borderWidth, props.theme.borderStyles.solid, height, height, borderWidth, height, height, props.theme.fontSizes.xs, props.theme.fontWeights.semibold, isVisible ? 'inline-block' : 'none', padding, !isVisible && 'display: none;', borderWidth, borderWidth, props.theme.rtl ? -1 : 1);
|
|
313
312
|
};
|
|
314
313
|
var colorStyles$1 = function colorStyles(props) {
|
|
315
314
|
var foregroundColor = props.foregroundColor || props.theme.palette.white;
|
|
@@ -337,7 +336,7 @@ var colorStyles$1 = function colorStyles(props) {
|
|
|
337
336
|
};
|
|
338
337
|
var StyledStatusIndicator = styled.div.attrs({
|
|
339
338
|
'data-garden-id': COMPONENT_ID$1,
|
|
340
|
-
'data-garden-version': '8.
|
|
339
|
+
'data-garden-version': '8.56.0'
|
|
341
340
|
}).withConfig({
|
|
342
341
|
displayName: "StyledStatusIndicator",
|
|
343
342
|
componentId: "sc-16t9if3-0"
|
|
@@ -421,7 +420,7 @@ var sizeStyles = function sizeStyles(props) {
|
|
|
421
420
|
};
|
|
422
421
|
var StyledAvatar = styled.figure.attrs({
|
|
423
422
|
'data-garden-id': COMPONENT_ID,
|
|
424
|
-
'data-garden-version': '8.
|
|
423
|
+
'data-garden-version': '8.56.0'
|
|
425
424
|
}).withConfig({
|
|
426
425
|
displayName: "StyledAvatar",
|
|
427
426
|
componentId: "sc-608m04-0"
|
|
@@ -455,7 +454,7 @@ var AvatarComponent = forwardRef(function (_ref, ref) {
|
|
|
455
454
|
surfaceColor = _ref.surfaceColor,
|
|
456
455
|
backgroundColor = _ref.backgroundColor,
|
|
457
456
|
foregroundColor = _ref.foregroundColor,
|
|
458
|
-
|
|
457
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
459
458
|
var computedStatus = badge === undefined ? status : 'active';
|
|
460
459
|
var ClockIcon = SvgClockStroke$1;
|
|
461
460
|
var ArrowLeftIcon = SvgArrowLeftSmStroke$1;
|
|
@@ -463,6 +462,15 @@ var AvatarComponent = forwardRef(function (_ref, ref) {
|
|
|
463
462
|
ClockIcon = SvgClockStroke;
|
|
464
463
|
ArrowLeftIcon = SvgArrowLeftSmStroke;
|
|
465
464
|
}
|
|
465
|
+
var defaultStatusLabel = useMemo(function () {
|
|
466
|
+
var statusMessage = computedStatus;
|
|
467
|
+
if (computedStatus === 'active') {
|
|
468
|
+
var count = typeof badge === 'string' ? parseInt(badge, 10) : badge;
|
|
469
|
+
statusMessage = "active. ".concat(count > 0 ? "".concat(count, " notification").concat(count > 1 ? 's' : '') : 'no notifications');
|
|
470
|
+
}
|
|
471
|
+
return ['status'].concat(statusMessage || []).join(': ');
|
|
472
|
+
}, [computedStatus, badge]);
|
|
473
|
+
var statusLabel = useText(AvatarComponent, props, 'statusLabel', defaultStatusLabel);
|
|
466
474
|
return React__default.createElement(StyledAvatar, _extends$4({
|
|
467
475
|
ref: ref,
|
|
468
476
|
isSystem: isSystem,
|
|
@@ -473,13 +481,17 @@ var AvatarComponent = forwardRef(function (_ref, ref) {
|
|
|
473
481
|
foregroundColor: foregroundColor,
|
|
474
482
|
"aria-atomic": "true",
|
|
475
483
|
"aria-live": "polite"
|
|
476
|
-
},
|
|
484
|
+
}, props), Children.only(children), computedStatus && React__default.createElement(StyledStatusIndicator, {
|
|
477
485
|
size: size,
|
|
478
486
|
status: computedStatus,
|
|
479
487
|
backgroundColor: backgroundColor,
|
|
480
488
|
foregroundColor: foregroundColor,
|
|
481
|
-
surfaceColor: surfaceColor
|
|
482
|
-
|
|
489
|
+
surfaceColor: surfaceColor,
|
|
490
|
+
"aria-label": statusLabel,
|
|
491
|
+
role: "img"
|
|
492
|
+
}, computedStatus === 'active' ? React__default.createElement("span", {
|
|
493
|
+
"aria-hidden": "true"
|
|
494
|
+
}, badge) : React__default.createElement(React__default.Fragment, null, computedStatus === 'away' ? React__default.createElement(ClockIcon, {
|
|
483
495
|
"data-icon-status": computedStatus
|
|
484
496
|
}) : null, computedStatus === 'transfers' ? React__default.createElement(ArrowLeftIcon, {
|
|
485
497
|
"data-icon-status": computedStatus
|
|
@@ -493,7 +505,8 @@ AvatarComponent.propTypes = {
|
|
|
493
505
|
isSystem: PropTypes.bool,
|
|
494
506
|
badge: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
495
507
|
size: PropTypes.oneOf(SIZE),
|
|
496
|
-
status: PropTypes.oneOf(STATUS)
|
|
508
|
+
status: PropTypes.oneOf(STATUS),
|
|
509
|
+
statusLabel: PropTypes.string
|
|
497
510
|
};
|
|
498
511
|
AvatarComponent.defaultProps = {
|
|
499
512
|
size: 'medium'
|
|
@@ -20,6 +20,8 @@ export interface IAvatarProps extends HTMLAttributes<HTMLElement> {
|
|
|
20
20
|
size?: typeof SIZE[number];
|
|
21
21
|
/** Applies status styling */
|
|
22
22
|
status?: typeof STATUS[number];
|
|
23
|
+
/** Specifies the status label */
|
|
24
|
+
statusLabel?: string;
|
|
23
25
|
/** Sets the badge text and applies active styling */
|
|
24
26
|
badge?: string | number;
|
|
25
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-avatars",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.56.0",
|
|
4
4
|
"description": "Components relating to avatars in the Garden Design System",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Zendesk Garden <garden@zendesk.com>",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"styled-components": "^4.2.0 || ^5.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@zendeskgarden/react-theming": "^8.
|
|
34
|
+
"@zendeskgarden/react-theming": "^8.56.0",
|
|
35
35
|
"@zendeskgarden/svg-icons": "6.33.0"
|
|
36
36
|
},
|
|
37
37
|
"keywords": [
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"zendeskgarden:src": "src/index.ts",
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "c0e1cb7669a366ff510cc9613e2b426d48019732"
|
|
48
48
|
}
|