@zendeskgarden/react-avatars 9.12.3 → 9.12.5
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/esm/elements/Avatar.js +14 -15
- package/dist/esm/elements/StatusIndicator.js +7 -8
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/arrow-left-sm-stroke.svg.js +6 -6
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/12/clock-stroke.svg.js +6 -6
- package/dist/esm/node_modules/@zendeskgarden/svg-icons/src/16/clock-stroke.svg.js +2 -2
- package/dist/esm/styled/StyledAvatar.js +13 -14
- package/dist/esm/styled/StyledStandaloneStatus.js +3 -3
- package/dist/esm/styled/StyledStandaloneStatusCaption.js +3 -3
- package/dist/esm/styled/StyledStandaloneStatusIndicator.js +1 -1
- package/dist/esm/styled/StyledStatusIndicator.js +12 -13
- package/dist/esm/styled/StyledStatusIndicatorBase.js +9 -10
- package/dist/esm/styled/StyledText.js +3 -3
- package/dist/esm/styled/utility.js +7 -7
- package/dist/index.cjs.js +45 -50
- package/package.json +6 -6
|
@@ -12,7 +12,7 @@ import SvgClockStroke from '../node_modules/@zendeskgarden/svg-icons/src/12/cloc
|
|
|
12
12
|
import SvgClockStroke$1 from '../node_modules/@zendeskgarden/svg-icons/src/16/clock-stroke.svg.js';
|
|
13
13
|
import SvgArrowLeftSmStroke from '../node_modules/@zendeskgarden/svg-icons/src/12/arrow-left-sm-stroke.svg.js';
|
|
14
14
|
import SvgArrowLeftSmStroke$1 from '../node_modules/@zendeskgarden/svg-icons/src/16/arrow-left-sm-stroke.svg.js';
|
|
15
|
-
import {
|
|
15
|
+
import { STATUS, SIZE } from '../types/index.js';
|
|
16
16
|
import { StyledAvatar } from '../styled/StyledAvatar.js';
|
|
17
17
|
import '../styled/StyledStandaloneStatus.js';
|
|
18
18
|
import '../styled/StyledStandaloneStatusCaption.js';
|
|
@@ -21,20 +21,19 @@ import { StyledStatusIndicator } from '../styled/StyledStatusIndicator.js';
|
|
|
21
21
|
import '../styled/StyledText.js';
|
|
22
22
|
import { Text } from './components/Text.js';
|
|
23
23
|
|
|
24
|
-
const AvatarComponent = forwardRef((
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
24
|
+
const AvatarComponent = forwardRef(({
|
|
25
|
+
'aria-hidden': ariaHidden,
|
|
26
|
+
backgroundColor,
|
|
27
|
+
badge,
|
|
28
|
+
children,
|
|
29
|
+
foregroundColor,
|
|
30
|
+
isSystem,
|
|
31
|
+
size = 'medium',
|
|
32
|
+
status,
|
|
33
|
+
statusLabel,
|
|
34
|
+
surfaceColor,
|
|
35
|
+
...other
|
|
36
|
+
}, ref) => {
|
|
38
37
|
const computedStatus = badge === undefined ? status : 'active';
|
|
39
38
|
let ClockIcon = SvgClockStroke;
|
|
40
39
|
let ArrowLeftIcon = SvgArrowLeftSmStroke;
|
|
@@ -19,14 +19,13 @@ import { StyledStandaloneStatusIndicator } from '../styled/StyledStandaloneStatu
|
|
|
19
19
|
import '../styled/StyledStatusIndicator.js';
|
|
20
20
|
import '../styled/StyledText.js';
|
|
21
21
|
|
|
22
|
-
const StatusIndicator = forwardRef((
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
22
|
+
const StatusIndicator = forwardRef(({
|
|
23
|
+
children,
|
|
24
|
+
type = 'offline',
|
|
25
|
+
isCompact,
|
|
26
|
+
'aria-label': label,
|
|
27
|
+
...props
|
|
28
|
+
}, ref) => {
|
|
30
29
|
let ClockIcon = SvgClockStroke;
|
|
31
30
|
let ArrowLeftIcon = SvgArrowLeftSmStroke;
|
|
32
31
|
if (isCompact) {
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
|
-
var _path;
|
|
10
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
-
var SvgArrowLeftSmStroke = function SvgArrowLeftSmStroke(props) {
|
|
12
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
9
|
+
var _path$1;
|
|
10
|
+
function _extends$1() { return _extends$1 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$1.apply(null, arguments); }
|
|
11
|
+
var SvgArrowLeftSmStroke$1 = function SvgArrowLeftSmStroke(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends$1({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
width: 12,
|
|
15
15
|
height: 12,
|
|
16
16
|
focusable: "false",
|
|
17
17
|
viewBox: "0 0 12 12",
|
|
18
18
|
"aria-hidden": "true"
|
|
19
|
-
}, props), _path || (_path = /*#__PURE__*/React.createElement("path", {
|
|
19
|
+
}, props), _path$1 || (_path$1 = /*#__PURE__*/React.createElement("path", {
|
|
20
20
|
fill: "currentColor",
|
|
21
21
|
d: "M2.146 6.854a.5.5 0 0 1 0-.708l2-2a.5.5 0 1 1 .708.708L3.707 6H9.5a.5.5 0 0 1 0 1H3.707l1.147 1.146a.5.5 0 1 1-.708.708l-2-2Z"
|
|
22
22
|
})));
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export { SvgArrowLeftSmStroke as default };
|
|
25
|
+
export { SvgArrowLeftSmStroke$1 as default };
|
|
@@ -6,17 +6,17 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
|
-
var _g;
|
|
10
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
11
|
-
var SvgClockStroke = function SvgClockStroke(props) {
|
|
12
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
9
|
+
var _g$1;
|
|
10
|
+
function _extends$3() { return _extends$3 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$3.apply(null, arguments); }
|
|
11
|
+
var SvgClockStroke$1 = function SvgClockStroke(props) {
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends$3({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
width: 12,
|
|
15
15
|
height: 12,
|
|
16
16
|
focusable: "false",
|
|
17
17
|
viewBox: "0 0 12 12",
|
|
18
18
|
"aria-hidden": "true"
|
|
19
|
-
}, props), _g || (_g = /*#__PURE__*/React.createElement("g", {
|
|
19
|
+
}, props), _g$1 || (_g$1 = /*#__PURE__*/React.createElement("g", {
|
|
20
20
|
fill: "none",
|
|
21
21
|
stroke: "currentColor"
|
|
22
22
|
}, /*#__PURE__*/React.createElement("circle", {
|
|
@@ -30,4 +30,4 @@ var SvgClockStroke = function SvgClockStroke(props) {
|
|
|
30
30
|
}))));
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
export { SvgClockStroke as default };
|
|
33
|
+
export { SvgClockStroke$1 as default };
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
import * as React from 'react';
|
|
8
8
|
|
|
9
9
|
var _g;
|
|
10
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
10
|
+
function _extends$2() { return _extends$2 = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends$2.apply(null, arguments); }
|
|
11
11
|
var SvgClockStroke = function SvgClockStroke(props) {
|
|
12
|
-
return /*#__PURE__*/React.createElement("svg", _extends({
|
|
12
|
+
return /*#__PURE__*/React.createElement("svg", _extends$2({
|
|
13
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
14
14
|
width: 16,
|
|
15
15
|
height: 16,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Use of this source code is governed under the Apache License, Version 2.0
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
|
-
import styled, {
|
|
7
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
8
8
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { math } from 'polished';
|
|
10
10
|
import { SIZE } from '../types/index.js';
|
|
@@ -12,7 +12,7 @@ import { StyledText } from './StyledText.js';
|
|
|
12
12
|
import { StyledStatusIndicator } from './StyledStatusIndicator.js';
|
|
13
13
|
import { TRANSITION_DURATION, getStatusColor } from './utility.js';
|
|
14
14
|
|
|
15
|
-
const COMPONENT_ID = 'avatars.avatar';
|
|
15
|
+
const COMPONENT_ID$3 = 'avatars.avatar';
|
|
16
16
|
const badgeStyles = props => {
|
|
17
17
|
const [xxs, xs, s, m, l] = SIZE;
|
|
18
18
|
let position = `${props.theme.space.base * -1}px`;
|
|
@@ -30,14 +30,13 @@ const badgeStyles = props => {
|
|
|
30
30
|
const animation = keyframes(["0%{transform:scale(.1);}"]);
|
|
31
31
|
return css(["position:absolute;", ":", ";bottom:", ";transition:all ", "s ease-in-out;", ""], props.theme.rtl ? 'left' : 'right', position, position, TRANSITION_DURATION, props.$status === 'active' && css(["animation:", " ", "s ease-in-out;"], animation, TRANSITION_DURATION * 1.5));
|
|
32
32
|
};
|
|
33
|
-
const colorStyles =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
} = _ref;
|
|
33
|
+
const colorStyles = ({
|
|
34
|
+
theme,
|
|
35
|
+
$foregroundColor,
|
|
36
|
+
$surfaceColor,
|
|
37
|
+
$backgroundColor,
|
|
38
|
+
$status
|
|
39
|
+
}) => {
|
|
41
40
|
const statusColor = getStatusColor(theme, $status);
|
|
42
41
|
let backgroundColor = 'transparent';
|
|
43
42
|
let foregroundColor = theme.palette.white;
|
|
@@ -67,7 +66,7 @@ const colorStyles = _ref => {
|
|
|
67
66
|
}
|
|
68
67
|
return css(["box-shadow:", ";background-color:", ";&&{color:", ";}& > svg,& ", "{color:", ";}"], theme.shadows.sm(statusColor), backgroundColor, surfaceColor, StyledText, foregroundColor);
|
|
69
68
|
};
|
|
70
|
-
const sizeStyles = props => {
|
|
69
|
+
const sizeStyles$1 = props => {
|
|
71
70
|
let boxShadow;
|
|
72
71
|
let borderRadius;
|
|
73
72
|
let size;
|
|
@@ -107,12 +106,12 @@ const sizeStyles = props => {
|
|
|
107
106
|
return 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);
|
|
108
107
|
};
|
|
109
108
|
const StyledAvatar = styled.figure.attrs(props => ({
|
|
110
|
-
'data-garden-id': COMPONENT_ID,
|
|
111
|
-
'data-garden-version': '9.12.
|
|
109
|
+
'data-garden-id': COMPONENT_ID$3,
|
|
110
|
+
'data-garden-version': '9.12.5',
|
|
112
111
|
$size: props.$size ?? 'medium'
|
|
113
112
|
})).withConfig({
|
|
114
113
|
displayName: "StyledAvatar",
|
|
115
114
|
componentId: "sc-608m04-0"
|
|
116
|
-
})(["display:inline-flex;position:relative;align-items:center;justify-content:center;transition:box-shadow ", "s ease-in-out,color 0.1s ease-in-out;margin:0;vertical-align:middle;box-sizing:border-box;", ";", ";&::before{position:absolute;top:0;left:0;transition:box-shadow ", "s ease-in-out;content:'';}&::before,&& > img{border-radius:inherit;width:100%;height:100%;}&& > img{box-sizing:inherit;vertical-align:bottom;object-fit:cover;}&& > svg{width:1em;height:1em;}& > ", "{", ";}", ";"], TRANSITION_DURATION, props => sizeStyles(props), props => colorStyles(props), TRANSITION_DURATION, StyledStatusIndicator, badgeStyles, componentStyles);
|
|
115
|
+
})(["display:inline-flex;position:relative;align-items:center;justify-content:center;transition:box-shadow ", "s ease-in-out,color 0.1s ease-in-out;margin:0;vertical-align:middle;box-sizing:border-box;", ";", ";&::before{position:absolute;top:0;left:0;transition:box-shadow ", "s ease-in-out;content:'';}&::before,&& > img{border-radius:inherit;width:100%;height:100%;}&& > img{box-sizing:inherit;vertical-align:bottom;object-fit:cover;}&& > svg{width:1em;height:1em;}& > ", "{", ";}", ";"], TRANSITION_DURATION, props => sizeStyles$1(props), props => colorStyles(props), TRANSITION_DURATION, StyledStatusIndicator, badgeStyles, componentStyles);
|
|
117
116
|
|
|
118
117
|
export { StyledAvatar };
|
|
@@ -8,10 +8,10 @@ import styled from 'styled-components';
|
|
|
8
8
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { TRANSITION_DURATION } from './utility.js';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'avatars.status-indicator.status';
|
|
11
|
+
const COMPONENT_ID$2 = 'avatars.status-indicator.status';
|
|
12
12
|
const StyledStandaloneStatus = styled.figure.attrs({
|
|
13
|
-
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.12.
|
|
13
|
+
'data-garden-id': COMPONENT_ID$2,
|
|
14
|
+
'data-garden-version': '9.12.5'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledStandaloneStatus",
|
|
17
17
|
componentId: "sc-1ow4nfj-0"
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
8
|
import { componentStyles, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'avatars.status-indicator.caption';
|
|
10
|
+
const COMPONENT_ID$1 = 'avatars.status-indicator.caption';
|
|
11
11
|
function sizeStyles(props) {
|
|
12
12
|
const marginRule = `margin-${props.theme.rtl ? 'right' : 'left'}: ${props.theme.space.base * 2}px;`;
|
|
13
13
|
return css(["", " line-height:", ";font-size:", ";"], marginRule, getLineHeight(props.theme.lineHeights.md, props.theme.fontSizes.md), props.theme.fontSizes.md);
|
|
14
14
|
}
|
|
15
15
|
const StyledStandaloneStatusCaption = styled.figcaption.attrs({
|
|
16
|
-
'data-garden-id': COMPONENT_ID,
|
|
17
|
-
'data-garden-version': '9.12.
|
|
16
|
+
'data-garden-id': COMPONENT_ID$1,
|
|
17
|
+
'data-garden-version': '9.12.5'
|
|
18
18
|
}).withConfig({
|
|
19
19
|
displayName: "StyledStandaloneStatusCaption",
|
|
20
20
|
componentId: "sc-aalyk1-0"
|
|
@@ -12,7 +12,7 @@ import { StyledStatusIndicatorBase } from './StyledStatusIndicatorBase.js';
|
|
|
12
12
|
const COMPONENT_ID = 'avatars.status-indicator.indicator';
|
|
13
13
|
const StyledStandaloneStatusIndicator = styled(StyledStatusIndicatorBase).attrs(props => ({
|
|
14
14
|
'data-garden-id': COMPONENT_ID,
|
|
15
|
-
'data-garden-version': '9.12.
|
|
15
|
+
'data-garden-version': '9.12.5',
|
|
16
16
|
$type: props.$type ?? 'offline'
|
|
17
17
|
})).withConfig({
|
|
18
18
|
displayName: "StyledStandaloneStatusIndicator",
|
|
@@ -11,9 +11,9 @@ import { SIZE } from '../types/index.js';
|
|
|
11
11
|
import { StyledStatusIndicatorBase } from './StyledStatusIndicatorBase.js';
|
|
12
12
|
import { getStatusBorderOffset, includes } from './utility.js';
|
|
13
13
|
|
|
14
|
-
const COMPONENT_ID = 'avatars.status_indicator';
|
|
14
|
+
const COMPONENT_ID$4 = 'avatars.status_indicator';
|
|
15
15
|
const [xxs, xs, s, m, l] = SIZE;
|
|
16
|
-
const sizeStyles = props => {
|
|
16
|
+
const sizeStyles$2 = props => {
|
|
17
17
|
const isVisible = props.$size !== xxs;
|
|
18
18
|
const iconSize = props.$size === xs ? `${props.theme.space.base * 2}px` : undefined;
|
|
19
19
|
const borderWidth = getStatusBorderOffset(props);
|
|
@@ -25,14 +25,13 @@ const sizeStyles = props => {
|
|
|
25
25
|
}
|
|
26
26
|
return css(["max-width:calc(2em + (", " * 3));box-sizing:content-box;overflow:hidden;text-align:center;text-overflow:ellipsis;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{", " width:", ";height:", ";}"], borderWidth, props.theme.fontSizes.xs, props.theme.fontWeights.semibold, isVisible ? 'inline-block' : 'none', padding, !isVisible && 'display: none;', iconSize, iconSize);
|
|
27
27
|
};
|
|
28
|
-
const colorStyles =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = _ref;
|
|
28
|
+
const colorStyles$1 = ({
|
|
29
|
+
theme,
|
|
30
|
+
$type,
|
|
31
|
+
$size,
|
|
32
|
+
$borderColor,
|
|
33
|
+
$surfaceColor
|
|
34
|
+
}) => {
|
|
36
35
|
const shadowSize = $size === xxs ? 'xs' : 'sm';
|
|
37
36
|
let boxShadow;
|
|
38
37
|
const surfaceColor = $surfaceColor?.includes('.') ? getColor({
|
|
@@ -50,12 +49,12 @@ const colorStyles = _ref => {
|
|
|
50
49
|
return css(["border-color:", ";box-shadow:", ";"], $borderColor, boxShadow);
|
|
51
50
|
};
|
|
52
51
|
const StyledStatusIndicator = styled(StyledStatusIndicatorBase).attrs(props => ({
|
|
53
|
-
'data-garden-id': COMPONENT_ID,
|
|
54
|
-
'data-garden-version': '9.12.
|
|
52
|
+
'data-garden-id': COMPONENT_ID$4,
|
|
53
|
+
'data-garden-version': '9.12.5',
|
|
55
54
|
$size: props.$size ?? 'medium'
|
|
56
55
|
})).withConfig({
|
|
57
56
|
displayName: "StyledStatusIndicator",
|
|
58
57
|
componentId: "sc-16t9if3-0"
|
|
59
|
-
})(["", " ", " ", ";"], sizeStyles, colorStyles, componentStyles);
|
|
58
|
+
})(["", " ", " ", ";"], sizeStyles$2, colorStyles$1, componentStyles);
|
|
60
59
|
|
|
61
60
|
export { StyledStatusIndicator };
|
|
@@ -8,18 +8,17 @@ import styled, { keyframes, css } from 'styled-components';
|
|
|
8
8
|
import { componentStyles, getColor } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { getStatusBorderOffset, getStatusSize, TRANSITION_DURATION, getStatusColor } from './utility.js';
|
|
10
10
|
|
|
11
|
-
const COMPONENT_ID = 'avatars.status-indicator.base';
|
|
11
|
+
const COMPONENT_ID$5 = 'avatars.status-indicator.base';
|
|
12
12
|
const iconFadeIn = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
13
|
-
const sizeStyles = props => {
|
|
13
|
+
const sizeStyles$3 = props => {
|
|
14
14
|
const offset = getStatusBorderOffset(props);
|
|
15
15
|
const size = getStatusSize(props, offset);
|
|
16
16
|
return css(["border:", " ", ";border-radius:", ";min-width:", ";height:", ";line-height:", ";& > svg{position:absolute;top:-", ";inset-inline-start:-", ";transform-origin:50% 50%;animation:", " ", "s;max-height:unset;&[data-icon-status='transfers']{transform:scale(", ",1);inset-inline-start:", ";}&[data-icon-status='away'] circle{display:none;}}"], offset, props.theme.borderStyles.solid, size, size, size, size, offset, offset, iconFadeIn, TRANSITION_DURATION, props.theme.rtl ? -1 : 1, props.$size === 'extrasmall' ? '-1px' : undefined);
|
|
17
17
|
};
|
|
18
|
-
const colorStyles =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
} = _ref;
|
|
18
|
+
const colorStyles$2 = ({
|
|
19
|
+
theme,
|
|
20
|
+
$type
|
|
21
|
+
}) => {
|
|
23
22
|
const foregroundColor = getColor({
|
|
24
23
|
variable: 'foreground.onEmphasis',
|
|
25
24
|
theme
|
|
@@ -39,11 +38,11 @@ const colorStyles = _ref => {
|
|
|
39
38
|
return css(["border-color:", ";background-color:", ";color:", ";"], borderColor, backgroundColor, foregroundColor);
|
|
40
39
|
};
|
|
41
40
|
const StyledStatusIndicatorBase = styled.div.attrs({
|
|
42
|
-
'data-garden-id': COMPONENT_ID,
|
|
43
|
-
'data-garden-version': '9.12.
|
|
41
|
+
'data-garden-id': COMPONENT_ID$5,
|
|
42
|
+
'data-garden-version': '9.12.5'
|
|
44
43
|
}).withConfig({
|
|
45
44
|
displayName: "StyledStatusIndicatorBase",
|
|
46
45
|
componentId: "sc-1rininy-0"
|
|
47
|
-
})(["transition:inherit;", " ", " ", ";"], sizeStyles, colorStyles, componentStyles);
|
|
46
|
+
})(["transition:inherit;", " ", " ", ";"], sizeStyles$3, colorStyles$2, componentStyles);
|
|
48
47
|
|
|
49
48
|
export { StyledStatusIndicatorBase };
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
import styled from 'styled-components';
|
|
8
8
|
import { componentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
|
-
const COMPONENT_ID = 'avatars.text';
|
|
10
|
+
const COMPONENT_ID$6 = 'avatars.text';
|
|
11
11
|
const StyledText = styled.span.attrs({
|
|
12
|
-
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.12.
|
|
12
|
+
'data-garden-id': COMPONENT_ID$6,
|
|
13
|
+
'data-garden-version': '9.12.5'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledText",
|
|
16
16
|
componentId: "sc-1a6hivh-0"
|
|
@@ -8,7 +8,7 @@ import { getColor } from '@zendeskgarden/react-theming';
|
|
|
8
8
|
import { math } from 'polished';
|
|
9
9
|
import { SIZE } from '../types/index.js';
|
|
10
10
|
|
|
11
|
-
const [xxs, xs, s, m, l] = SIZE;
|
|
11
|
+
const [xxs$1, xs$1, s$1, m$1, l$1] = SIZE;
|
|
12
12
|
const TRANSITION_DURATION = 0.25;
|
|
13
13
|
const StatusColorParams = {
|
|
14
14
|
active: {
|
|
@@ -68,19 +68,19 @@ function getStatusColor(theme, type) {
|
|
|
68
68
|
}) : 'transparent';
|
|
69
69
|
}
|
|
70
70
|
function getStatusBorderOffset(props) {
|
|
71
|
-
return props.$size === xxs ? math(`${props.theme.shadowWidths.sm} - 1`) : props.theme.shadowWidths.sm;
|
|
71
|
+
return props.$size === xxs$1 ? math(`${props.theme.shadowWidths.sm} - 1`) : props.theme.shadowWidths.sm;
|
|
72
72
|
}
|
|
73
73
|
function getStatusSize(props, offset) {
|
|
74
74
|
const isActive = props.$type === 'active';
|
|
75
75
|
switch (props.$size) {
|
|
76
|
-
case xxs:
|
|
76
|
+
case xxs$1:
|
|
77
77
|
return math(`${props.theme.space.base}px - ${offset}`);
|
|
78
|
-
case xs:
|
|
78
|
+
case xs$1:
|
|
79
79
|
return math(`${props.theme.space.base * 2}px - (${offset} * 2)`);
|
|
80
|
-
case s:
|
|
80
|
+
case s$1:
|
|
81
81
|
return math(`${props.theme.space.base * 3}px ${isActive ? '' : `- (${offset} * 2)`}`);
|
|
82
|
-
case m:
|
|
83
|
-
case l:
|
|
82
|
+
case m$1:
|
|
83
|
+
case l$1:
|
|
84
84
|
return math(`${props.theme.space.base * 4}px ${isActive ? '' : `- (${offset} * 2)`}`);
|
|
85
85
|
default:
|
|
86
86
|
return '0';
|
package/dist/index.cjs.js
CHANGED
|
@@ -123,7 +123,7 @@ const STATUS = ['available', 'away', 'transfers', 'offline'];
|
|
|
123
123
|
const COMPONENT_ID$6 = 'avatars.text';
|
|
124
124
|
const StyledText = styled__default.default.span.attrs({
|
|
125
125
|
'data-garden-id': COMPONENT_ID$6,
|
|
126
|
-
'data-garden-version': '9.12.
|
|
126
|
+
'data-garden-version': '9.12.5'
|
|
127
127
|
}).withConfig({
|
|
128
128
|
displayName: "StyledText",
|
|
129
129
|
componentId: "sc-1a6hivh-0"
|
|
@@ -218,11 +218,10 @@ const sizeStyles$3 = props => {
|
|
|
218
218
|
const size = getStatusSize(props, offset);
|
|
219
219
|
return styled.css(["border:", " ", ";border-radius:", ";min-width:", ";height:", ";line-height:", ";& > svg{position:absolute;top:-", ";inset-inline-start:-", ";transform-origin:50% 50%;animation:", " ", "s;max-height:unset;&[data-icon-status='transfers']{transform:scale(", ",1);inset-inline-start:", ";}&[data-icon-status='away'] circle{display:none;}}"], offset, props.theme.borderStyles.solid, size, size, size, size, offset, offset, iconFadeIn, TRANSITION_DURATION, props.theme.rtl ? -1 : 1, props.$size === 'extrasmall' ? '-1px' : undefined);
|
|
220
220
|
};
|
|
221
|
-
const colorStyles$2 =
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
} = _ref;
|
|
221
|
+
const colorStyles$2 = ({
|
|
222
|
+
theme,
|
|
223
|
+
$type
|
|
224
|
+
}) => {
|
|
226
225
|
const foregroundColor = reactTheming.getColor({
|
|
227
226
|
variable: 'foreground.onEmphasis',
|
|
228
227
|
theme
|
|
@@ -243,7 +242,7 @@ const colorStyles$2 = _ref => {
|
|
|
243
242
|
};
|
|
244
243
|
const StyledStatusIndicatorBase = styled__default.default.div.attrs({
|
|
245
244
|
'data-garden-id': COMPONENT_ID$5,
|
|
246
|
-
'data-garden-version': '9.12.
|
|
245
|
+
'data-garden-version': '9.12.5'
|
|
247
246
|
}).withConfig({
|
|
248
247
|
displayName: "StyledStatusIndicatorBase",
|
|
249
248
|
componentId: "sc-1rininy-0"
|
|
@@ -263,14 +262,13 @@ const sizeStyles$2 = props => {
|
|
|
263
262
|
}
|
|
264
263
|
return styled.css(["max-width:calc(2em + (", " * 3));box-sizing:content-box;overflow:hidden;text-align:center;text-overflow:ellipsis;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{", " width:", ";height:", ";}"], borderWidth, props.theme.fontSizes.xs, props.theme.fontWeights.semibold, isVisible ? 'inline-block' : 'none', padding, !isVisible && 'display: none;', iconSize, iconSize);
|
|
265
264
|
};
|
|
266
|
-
const colorStyles$1 =
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
} = _ref;
|
|
265
|
+
const colorStyles$1 = ({
|
|
266
|
+
theme,
|
|
267
|
+
$type,
|
|
268
|
+
$size,
|
|
269
|
+
$borderColor,
|
|
270
|
+
$surfaceColor
|
|
271
|
+
}) => {
|
|
274
272
|
const shadowSize = $size === xxs ? 'xs' : 'sm';
|
|
275
273
|
let boxShadow;
|
|
276
274
|
const surfaceColor = $surfaceColor?.includes('.') ? reactTheming.getColor({
|
|
@@ -289,7 +287,7 @@ const colorStyles$1 = _ref => {
|
|
|
289
287
|
};
|
|
290
288
|
const StyledStatusIndicator = styled__default.default(StyledStatusIndicatorBase).attrs(props => ({
|
|
291
289
|
'data-garden-id': COMPONENT_ID$4,
|
|
292
|
-
'data-garden-version': '9.12.
|
|
290
|
+
'data-garden-version': '9.12.5',
|
|
293
291
|
$size: props.$size ?? 'medium'
|
|
294
292
|
})).withConfig({
|
|
295
293
|
displayName: "StyledStatusIndicator",
|
|
@@ -314,14 +312,13 @@ const badgeStyles = props => {
|
|
|
314
312
|
const animation = styled.keyframes(["0%{transform:scale(.1);}"]);
|
|
315
313
|
return styled.css(["position:absolute;", ":", ";bottom:", ";transition:all ", "s ease-in-out;", ""], props.theme.rtl ? 'left' : 'right', position, position, TRANSITION_DURATION, props.$status === 'active' && styled.css(["animation:", " ", "s ease-in-out;"], animation, TRANSITION_DURATION * 1.5));
|
|
316
314
|
};
|
|
317
|
-
const colorStyles =
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
} = _ref;
|
|
315
|
+
const colorStyles = ({
|
|
316
|
+
theme,
|
|
317
|
+
$foregroundColor,
|
|
318
|
+
$surfaceColor,
|
|
319
|
+
$backgroundColor,
|
|
320
|
+
$status
|
|
321
|
+
}) => {
|
|
325
322
|
const statusColor = getStatusColor(theme, $status);
|
|
326
323
|
let backgroundColor = 'transparent';
|
|
327
324
|
let foregroundColor = theme.palette.white;
|
|
@@ -392,7 +389,7 @@ const sizeStyles$1 = props => {
|
|
|
392
389
|
};
|
|
393
390
|
const StyledAvatar = styled__default.default.figure.attrs(props => ({
|
|
394
391
|
'data-garden-id': COMPONENT_ID$3,
|
|
395
|
-
'data-garden-version': '9.12.
|
|
392
|
+
'data-garden-version': '9.12.5',
|
|
396
393
|
$size: props.$size ?? 'medium'
|
|
397
394
|
})).withConfig({
|
|
398
395
|
displayName: "StyledAvatar",
|
|
@@ -402,7 +399,7 @@ const StyledAvatar = styled__default.default.figure.attrs(props => ({
|
|
|
402
399
|
const COMPONENT_ID$2 = 'avatars.status-indicator.status';
|
|
403
400
|
const StyledStandaloneStatus = styled__default.default.figure.attrs({
|
|
404
401
|
'data-garden-id': COMPONENT_ID$2,
|
|
405
|
-
'data-garden-version': '9.12.
|
|
402
|
+
'data-garden-version': '9.12.5'
|
|
406
403
|
}).withConfig({
|
|
407
404
|
displayName: "StyledStandaloneStatus",
|
|
408
405
|
componentId: "sc-1ow4nfj-0"
|
|
@@ -415,7 +412,7 @@ function sizeStyles(props) {
|
|
|
415
412
|
}
|
|
416
413
|
const StyledStandaloneStatusCaption = styled__default.default.figcaption.attrs({
|
|
417
414
|
'data-garden-id': COMPONENT_ID$1,
|
|
418
|
-
'data-garden-version': '9.12.
|
|
415
|
+
'data-garden-version': '9.12.5'
|
|
419
416
|
}).withConfig({
|
|
420
417
|
displayName: "StyledStandaloneStatusCaption",
|
|
421
418
|
componentId: "sc-aalyk1-0"
|
|
@@ -424,7 +421,7 @@ const StyledStandaloneStatusCaption = styled__default.default.figcaption.attrs({
|
|
|
424
421
|
const COMPONENT_ID = 'avatars.status-indicator.indicator';
|
|
425
422
|
const StyledStandaloneStatusIndicator = styled__default.default(StyledStatusIndicatorBase).attrs(props => ({
|
|
426
423
|
'data-garden-id': COMPONENT_ID,
|
|
427
|
-
'data-garden-version': '9.12.
|
|
424
|
+
'data-garden-version': '9.12.5',
|
|
428
425
|
$type: props.$type ?? 'offline'
|
|
429
426
|
})).withConfig({
|
|
430
427
|
displayName: "StyledStandaloneStatusIndicator",
|
|
@@ -437,20 +434,19 @@ const TextComponent = React.forwardRef((props, ref) => React__namespace.default.
|
|
|
437
434
|
TextComponent.displayName = 'Avatar.Text';
|
|
438
435
|
const Text = TextComponent;
|
|
439
436
|
|
|
440
|
-
const AvatarComponent = React.forwardRef((
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
} = _ref;
|
|
437
|
+
const AvatarComponent = React.forwardRef(({
|
|
438
|
+
'aria-hidden': ariaHidden,
|
|
439
|
+
backgroundColor,
|
|
440
|
+
badge,
|
|
441
|
+
children,
|
|
442
|
+
foregroundColor,
|
|
443
|
+
isSystem,
|
|
444
|
+
size = 'medium',
|
|
445
|
+
status,
|
|
446
|
+
statusLabel,
|
|
447
|
+
surfaceColor,
|
|
448
|
+
...other
|
|
449
|
+
}, ref) => {
|
|
454
450
|
const computedStatus = badge === undefined ? status : 'active';
|
|
455
451
|
let ClockIcon = SvgClockStroke$1;
|
|
456
452
|
let ArrowLeftIcon = SvgArrowLeftSmStroke$1;
|
|
@@ -510,14 +506,13 @@ AvatarComponent.propTypes = {
|
|
|
510
506
|
const Avatar = AvatarComponent;
|
|
511
507
|
Avatar.Text = Text;
|
|
512
508
|
|
|
513
|
-
const StatusIndicator = React.forwardRef((
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
} = _ref;
|
|
509
|
+
const StatusIndicator = React.forwardRef(({
|
|
510
|
+
children,
|
|
511
|
+
type = 'offline',
|
|
512
|
+
isCompact,
|
|
513
|
+
'aria-label': label,
|
|
514
|
+
...props
|
|
515
|
+
}, ref) => {
|
|
521
516
|
let ClockIcon = SvgClockStroke;
|
|
522
517
|
let ArrowLeftIcon = SvgArrowLeftSmStroke;
|
|
523
518
|
if (isCompact) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-avatars",
|
|
3
|
-
"version": "9.12.
|
|
3
|
+
"version": "9.12.5",
|
|
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>",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"sideEffects": false,
|
|
22
22
|
"types": "dist/typings/index.d.ts",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@zendeskgarden/react-typography": "^9.12.
|
|
24
|
+
"@zendeskgarden/react-typography": "^9.12.5",
|
|
25
25
|
"polished": "^4.3.1",
|
|
26
26
|
"prop-types": "^15.5.7"
|
|
27
27
|
},
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"styled-components": "^5.3.1 || ^6.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@zendeskgarden/react-dropdowns": "^9.12.
|
|
36
|
-
"@zendeskgarden/react-theming": "^9.12.
|
|
37
|
-
"@zendeskgarden/svg-icons": "7.
|
|
35
|
+
"@zendeskgarden/react-dropdowns": "^9.12.5",
|
|
36
|
+
"@zendeskgarden/react-theming": "^9.12.5",
|
|
37
|
+
"@zendeskgarden/svg-icons": "7.6.0"
|
|
38
38
|
},
|
|
39
39
|
"keywords": [
|
|
40
40
|
"components",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
"zendeskgarden:src": "src/index.ts",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "a4edcee778788b0e30fc17671b95a6e239e27912"
|
|
50
50
|
}
|