@zendeskgarden/react-avatars 8.62.0 → 8.62.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +39 -42
- package/dist/index.esm.js +7 -7
- package/package.json +3 -3
package/dist/index.cjs.js
CHANGED
|
@@ -7,15 +7,13 @@
|
|
|
7
7
|
|
|
8
8
|
'use strict';
|
|
9
9
|
|
|
10
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
11
|
-
|
|
12
10
|
var React = require('react');
|
|
13
11
|
var PropTypes = require('prop-types');
|
|
14
12
|
var reactTheming = require('@zendeskgarden/react-theming');
|
|
15
13
|
var styled = require('styled-components');
|
|
16
14
|
var polished = require('polished');
|
|
17
15
|
|
|
18
|
-
function
|
|
16
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
17
|
|
|
20
18
|
function _interopNamespace(e) {
|
|
21
19
|
if (e && e.__esModule) return e;
|
|
@@ -31,14 +29,13 @@ function _interopNamespace(e) {
|
|
|
31
29
|
}
|
|
32
30
|
});
|
|
33
31
|
}
|
|
34
|
-
n
|
|
32
|
+
n.default = e;
|
|
35
33
|
return Object.freeze(n);
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var styled__default = /*#__PURE__*/_interopDefaultLegacy(styled);
|
|
37
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
38
|
+
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
42
39
|
|
|
43
40
|
function _extends$4() {
|
|
44
41
|
_extends$4 = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -151,9 +148,9 @@ const SIZE = ['extraextrasmall', 'extrasmall', 'small', 'medium', 'large'];
|
|
|
151
148
|
const STATUS = ['available', 'away', 'transfers', 'offline'];
|
|
152
149
|
|
|
153
150
|
const COMPONENT_ID$6 = 'avatars.text';
|
|
154
|
-
const StyledText = styled__default
|
|
151
|
+
const StyledText = styled__default.default.span.attrs({
|
|
155
152
|
'data-garden-id': COMPONENT_ID$6,
|
|
156
|
-
'data-garden-version': '8.62.
|
|
153
|
+
'data-garden-version': '8.62.2'
|
|
157
154
|
}).withConfig({
|
|
158
155
|
displayName: "StyledText",
|
|
159
156
|
componentId: "sc-1a6hivh-0"
|
|
@@ -219,9 +216,9 @@ const colorStyles$2 = props => {
|
|
|
219
216
|
}
|
|
220
217
|
return styled.css(["border-color:", ";background-color:", ";color:", ";"], borderColor, backgroundColor, props.theme.palette.white);
|
|
221
218
|
};
|
|
222
|
-
const StyledStatusIndicatorBase = styled__default
|
|
219
|
+
const StyledStatusIndicatorBase = styled__default.default.div.attrs({
|
|
223
220
|
'data-garden-id': COMPONENT_ID$5,
|
|
224
|
-
'data-garden-version': '8.62.
|
|
221
|
+
'data-garden-version': '8.62.2'
|
|
225
222
|
}).withConfig({
|
|
226
223
|
displayName: "StyledStatusIndicatorBase",
|
|
227
224
|
componentId: "sc-1rininy-0"
|
|
@@ -258,9 +255,9 @@ const colorStyles$1 = props => {
|
|
|
258
255
|
}
|
|
259
256
|
return styled.css(["border-color:", ";box-shadow:", ";"], borderColor, boxShadow);
|
|
260
257
|
};
|
|
261
|
-
const StyledStatusIndicator = styled__default
|
|
258
|
+
const StyledStatusIndicator = styled__default.default(StyledStatusIndicatorBase).attrs({
|
|
262
259
|
'data-garden-id': COMPONENT_ID$4,
|
|
263
|
-
'data-garden-version': '8.62.
|
|
260
|
+
'data-garden-version': '8.62.2'
|
|
264
261
|
}).withConfig({
|
|
265
262
|
displayName: "StyledStatusIndicator",
|
|
266
263
|
componentId: "sc-16t9if3-0"
|
|
@@ -334,9 +331,9 @@ const sizeStyles$1 = props => {
|
|
|
334
331
|
}
|
|
335
332
|
return styled.css(["border-radius:", ";width:", " !important;height:", " !important;::before{box-shadow:", ";}& > svg{font-size:", ";}& ", "{line-height:", ";font-size:", ";}"], borderRadius, size, size, boxShadow, svgSize, StyledText, size, fontSize);
|
|
336
333
|
};
|
|
337
|
-
const StyledAvatar = styled__default
|
|
334
|
+
const StyledAvatar = styled__default.default.figure.attrs({
|
|
338
335
|
'data-garden-id': COMPONENT_ID$3,
|
|
339
|
-
'data-garden-version': '8.62.
|
|
336
|
+
'data-garden-version': '8.62.2'
|
|
340
337
|
}).withConfig({
|
|
341
338
|
displayName: "StyledAvatar",
|
|
342
339
|
componentId: "sc-608m04-0"
|
|
@@ -347,9 +344,9 @@ StyledAvatar.defaultProps = {
|
|
|
347
344
|
};
|
|
348
345
|
|
|
349
346
|
const COMPONENT_ID$2 = 'avatars.status-indicator.status';
|
|
350
|
-
const StyledStandaloneStatus = styled__default
|
|
347
|
+
const StyledStandaloneStatus = styled__default.default.figure.attrs({
|
|
351
348
|
'data-garden-id': COMPONENT_ID$2,
|
|
352
|
-
'data-garden-version': '8.62.
|
|
349
|
+
'data-garden-version': '8.62.2'
|
|
353
350
|
}).withConfig({
|
|
354
351
|
displayName: "StyledStandaloneStatus",
|
|
355
352
|
componentId: "sc-1ow4nfj-0"
|
|
@@ -363,9 +360,9 @@ function sizeStyles(props) {
|
|
|
363
360
|
const marginRule = `margin-${props.theme.rtl ? 'right' : 'left'}: ${props.theme.space.base * 2}px;`;
|
|
364
361
|
return styled.css(["", " line-height:", ";font-size:", ";"], marginRule, reactTheming.getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props.theme.fontSizes.md);
|
|
365
362
|
}
|
|
366
|
-
const StyledStandaloneStatusCaption = styled__default
|
|
363
|
+
const StyledStandaloneStatusCaption = styled__default.default.figcaption.attrs({
|
|
367
364
|
'data-garden-id': COMPONENT_ID$1,
|
|
368
|
-
'data-garden-version': '8.62.
|
|
365
|
+
'data-garden-version': '8.62.2'
|
|
369
366
|
}).withConfig({
|
|
370
367
|
displayName: "StyledStandaloneStatusCaption",
|
|
371
368
|
componentId: "sc-aalyk1-0"
|
|
@@ -375,9 +372,9 @@ StyledStandaloneStatusCaption.defaultProps = {
|
|
|
375
372
|
};
|
|
376
373
|
|
|
377
374
|
const COMPONENT_ID = 'avatars.status-indicator.indicator';
|
|
378
|
-
const StyledStandaloneStatusIndicator = styled__default
|
|
375
|
+
const StyledStandaloneStatusIndicator = styled__default.default(StyledStatusIndicatorBase).attrs({
|
|
379
376
|
'data-garden-id': COMPONENT_ID,
|
|
380
|
-
'data-garden-version': '8.62.
|
|
377
|
+
'data-garden-version': '8.62.2'
|
|
381
378
|
}).withConfig({
|
|
382
379
|
displayName: "StyledStandaloneStatusIndicator",
|
|
383
380
|
componentId: "sc-1xt1heq-0"
|
|
@@ -387,7 +384,7 @@ StyledStandaloneStatusIndicator.defaultProps = {
|
|
|
387
384
|
theme: reactTheming.DEFAULT_THEME
|
|
388
385
|
};
|
|
389
386
|
|
|
390
|
-
const TextComponent = React.forwardRef((props, ref) =>
|
|
387
|
+
const TextComponent = React.forwardRef((props, ref) => React__namespace.default.createElement(StyledText, _extends$4({
|
|
391
388
|
ref: ref
|
|
392
389
|
}, props)));
|
|
393
390
|
TextComponent.displayName = 'Avatar.Text';
|
|
@@ -421,7 +418,7 @@ const AvatarComponent = React.forwardRef((_ref, ref) => {
|
|
|
421
418
|
return ['status'].concat(statusMessage || []).join(': ');
|
|
422
419
|
}, [computedStatus, badge]);
|
|
423
420
|
const statusLabel = reactTheming.useText(AvatarComponent, props, 'statusLabel', defaultStatusLabel);
|
|
424
|
-
return
|
|
421
|
+
return React__namespace.default.createElement(StyledAvatar, _extends$4({
|
|
425
422
|
ref: ref,
|
|
426
423
|
isSystem: isSystem,
|
|
427
424
|
size: size,
|
|
@@ -431,30 +428,30 @@ const AvatarComponent = React.forwardRef((_ref, ref) => {
|
|
|
431
428
|
foregroundColor: foregroundColor,
|
|
432
429
|
"aria-atomic": "true",
|
|
433
430
|
"aria-live": "polite"
|
|
434
|
-
}, props), React.Children.only(children), computedStatus &&
|
|
431
|
+
}, props), React.Children.only(children), computedStatus && React__namespace.default.createElement(StyledStatusIndicator, {
|
|
435
432
|
size: size,
|
|
436
433
|
type: computedStatus,
|
|
437
434
|
surfaceColor: surfaceColor,
|
|
438
435
|
"aria-label": statusLabel,
|
|
439
436
|
role: "img"
|
|
440
|
-
}, computedStatus === 'active' ?
|
|
437
|
+
}, computedStatus === 'active' ? React__namespace.default.createElement("span", {
|
|
441
438
|
"aria-hidden": "true"
|
|
442
|
-
}, badge) :
|
|
439
|
+
}, badge) : React__namespace.default.createElement(React__namespace.default.Fragment, null, computedStatus === 'away' ? React__namespace.default.createElement(ClockIcon, {
|
|
443
440
|
"data-icon-status": computedStatus
|
|
444
|
-
}) : null, computedStatus === 'transfers' ?
|
|
441
|
+
}) : null, computedStatus === 'transfers' ? React__namespace.default.createElement(ArrowLeftIcon, {
|
|
445
442
|
"data-icon-status": computedStatus
|
|
446
443
|
}) : null)));
|
|
447
444
|
});
|
|
448
445
|
AvatarComponent.displayName = 'Avatar';
|
|
449
446
|
AvatarComponent.propTypes = {
|
|
450
|
-
backgroundColor: PropTypes__default
|
|
451
|
-
foregroundColor: PropTypes__default
|
|
452
|
-
surfaceColor: PropTypes__default
|
|
453
|
-
isSystem: PropTypes__default
|
|
454
|
-
badge: PropTypes__default
|
|
455
|
-
size: PropTypes__default
|
|
456
|
-
status: PropTypes__default
|
|
457
|
-
statusLabel: PropTypes__default
|
|
447
|
+
backgroundColor: PropTypes__default.default.string,
|
|
448
|
+
foregroundColor: PropTypes__default.default.string,
|
|
449
|
+
surfaceColor: PropTypes__default.default.string,
|
|
450
|
+
isSystem: PropTypes__default.default.bool,
|
|
451
|
+
badge: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
452
|
+
size: PropTypes__default.default.oneOf(SIZE),
|
|
453
|
+
status: PropTypes__default.default.oneOf(STATUS),
|
|
454
|
+
statusLabel: PropTypes__default.default.string
|
|
458
455
|
};
|
|
459
456
|
AvatarComponent.defaultProps = {
|
|
460
457
|
size: 'medium'
|
|
@@ -480,26 +477,26 @@ const StatusIndicator = React.forwardRef((_ref, ref) => {
|
|
|
480
477
|
const ariaLabel = reactTheming.useText(StatusIndicator, {
|
|
481
478
|
'aria-label': label
|
|
482
479
|
}, 'aria-label', defaultLabel);
|
|
483
|
-
return
|
|
480
|
+
return React__namespace.default.createElement(StyledStandaloneStatus, _extends$4({
|
|
484
481
|
role: "status",
|
|
485
482
|
ref: ref
|
|
486
|
-
}, props),
|
|
483
|
+
}, props), React__namespace.default.createElement(StyledStandaloneStatusIndicator, {
|
|
487
484
|
role: "img",
|
|
488
485
|
type: type,
|
|
489
486
|
size: isCompact ? 'small' : 'medium',
|
|
490
487
|
"aria-label": ariaLabel
|
|
491
|
-
}, type === 'away' ?
|
|
488
|
+
}, type === 'away' ? React__namespace.default.createElement(ClockIcon, {
|
|
492
489
|
"data-icon-status": type,
|
|
493
490
|
"aria-hidden": "true"
|
|
494
|
-
}) : null, type === 'transfers' ?
|
|
491
|
+
}) : null, type === 'transfers' ? React__namespace.default.createElement(ArrowLeftIcon, {
|
|
495
492
|
"data-icon-status": type,
|
|
496
493
|
"aria-hidden": "true"
|
|
497
|
-
}) : null), children &&
|
|
494
|
+
}) : null), children && React__namespace.default.createElement(StyledStandaloneStatusCaption, null, children));
|
|
498
495
|
});
|
|
499
496
|
StatusIndicator.displayName = 'StatusIndicator';
|
|
500
497
|
StatusIndicator.propTypes = {
|
|
501
|
-
type: PropTypes__default
|
|
502
|
-
isCompact: PropTypes__default
|
|
498
|
+
type: PropTypes__default.default.oneOf(STATUS),
|
|
499
|
+
isCompact: PropTypes__default.default.bool
|
|
503
500
|
};
|
|
504
501
|
StatusIndicator.defaultProps = {
|
|
505
502
|
type: 'offline'
|
package/dist/index.esm.js
CHANGED
|
@@ -125,7 +125,7 @@ const STATUS = ['available', 'away', 'transfers', 'offline'];
|
|
|
125
125
|
const COMPONENT_ID$6 = 'avatars.text';
|
|
126
126
|
const StyledText = styled.span.attrs({
|
|
127
127
|
'data-garden-id': COMPONENT_ID$6,
|
|
128
|
-
'data-garden-version': '8.62.
|
|
128
|
+
'data-garden-version': '8.62.2'
|
|
129
129
|
}).withConfig({
|
|
130
130
|
displayName: "StyledText",
|
|
131
131
|
componentId: "sc-1a6hivh-0"
|
|
@@ -193,7 +193,7 @@ const colorStyles$2 = props => {
|
|
|
193
193
|
};
|
|
194
194
|
const StyledStatusIndicatorBase = styled.div.attrs({
|
|
195
195
|
'data-garden-id': COMPONENT_ID$5,
|
|
196
|
-
'data-garden-version': '8.62.
|
|
196
|
+
'data-garden-version': '8.62.2'
|
|
197
197
|
}).withConfig({
|
|
198
198
|
displayName: "StyledStatusIndicatorBase",
|
|
199
199
|
componentId: "sc-1rininy-0"
|
|
@@ -232,7 +232,7 @@ const colorStyles$1 = props => {
|
|
|
232
232
|
};
|
|
233
233
|
const StyledStatusIndicator = styled(StyledStatusIndicatorBase).attrs({
|
|
234
234
|
'data-garden-id': COMPONENT_ID$4,
|
|
235
|
-
'data-garden-version': '8.62.
|
|
235
|
+
'data-garden-version': '8.62.2'
|
|
236
236
|
}).withConfig({
|
|
237
237
|
displayName: "StyledStatusIndicator",
|
|
238
238
|
componentId: "sc-16t9if3-0"
|
|
@@ -308,7 +308,7 @@ const sizeStyles$1 = props => {
|
|
|
308
308
|
};
|
|
309
309
|
const StyledAvatar = styled.figure.attrs({
|
|
310
310
|
'data-garden-id': COMPONENT_ID$3,
|
|
311
|
-
'data-garden-version': '8.62.
|
|
311
|
+
'data-garden-version': '8.62.2'
|
|
312
312
|
}).withConfig({
|
|
313
313
|
displayName: "StyledAvatar",
|
|
314
314
|
componentId: "sc-608m04-0"
|
|
@@ -321,7 +321,7 @@ StyledAvatar.defaultProps = {
|
|
|
321
321
|
const COMPONENT_ID$2 = 'avatars.status-indicator.status';
|
|
322
322
|
const StyledStandaloneStatus = styled.figure.attrs({
|
|
323
323
|
'data-garden-id': COMPONENT_ID$2,
|
|
324
|
-
'data-garden-version': '8.62.
|
|
324
|
+
'data-garden-version': '8.62.2'
|
|
325
325
|
}).withConfig({
|
|
326
326
|
displayName: "StyledStandaloneStatus",
|
|
327
327
|
componentId: "sc-1ow4nfj-0"
|
|
@@ -337,7 +337,7 @@ function sizeStyles(props) {
|
|
|
337
337
|
}
|
|
338
338
|
const StyledStandaloneStatusCaption = styled.figcaption.attrs({
|
|
339
339
|
'data-garden-id': COMPONENT_ID$1,
|
|
340
|
-
'data-garden-version': '8.62.
|
|
340
|
+
'data-garden-version': '8.62.2'
|
|
341
341
|
}).withConfig({
|
|
342
342
|
displayName: "StyledStandaloneStatusCaption",
|
|
343
343
|
componentId: "sc-aalyk1-0"
|
|
@@ -349,7 +349,7 @@ StyledStandaloneStatusCaption.defaultProps = {
|
|
|
349
349
|
const COMPONENT_ID = 'avatars.status-indicator.indicator';
|
|
350
350
|
const StyledStandaloneStatusIndicator = styled(StyledStatusIndicatorBase).attrs({
|
|
351
351
|
'data-garden-id': COMPONENT_ID,
|
|
352
|
-
'data-garden-version': '8.62.
|
|
352
|
+
'data-garden-version': '8.62.2'
|
|
353
353
|
}).withConfig({
|
|
354
354
|
displayName: "StyledStandaloneStatusIndicator",
|
|
355
355
|
componentId: "sc-1xt1heq-0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-avatars",
|
|
3
|
-
"version": "8.62.
|
|
3
|
+
"version": "8.62.2",
|
|
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.62.
|
|
34
|
+
"@zendeskgarden/react-theming": "^8.62.2",
|
|
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": "27a7d6c021f3360396af60d51ecbf66e9076a405"
|
|
48
48
|
}
|