@zendeskgarden/react-avatars 9.0.0-next.23 → 9.0.0-next.25
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/styled/StyledAvatar.js +7 -7
- package/dist/esm/styled/StyledStandaloneStatus.js +2 -5
- package/dist/esm/styled/StyledStandaloneStatusCaption.js +2 -5
- package/dist/esm/styled/StyledStandaloneStatusIndicator.js +1 -1
- package/dist/esm/styled/StyledStatusIndicator.js +7 -3
- package/dist/esm/styled/StyledStatusIndicatorBase.js +2 -2
- package/dist/esm/styled/StyledText.js +2 -5
- package/dist/index.cjs.js +20 -25
- package/package.json +4 -4
|
@@ -17,15 +17,15 @@ const badgeStyles = props => {
|
|
|
17
17
|
const [xxs, xs, s, m, l] = SIZE;
|
|
18
18
|
let position = `${props.theme.space.base * -1}px`;
|
|
19
19
|
switch (props.$size) {
|
|
20
|
-
case s:
|
|
21
|
-
case m:
|
|
22
|
-
position = math(`${position} + 2`);
|
|
23
|
-
break;
|
|
24
20
|
case xxs:
|
|
25
21
|
case xs:
|
|
26
|
-
case l:
|
|
27
22
|
position = math(`${position} + 3`);
|
|
28
23
|
break;
|
|
24
|
+
case s:
|
|
25
|
+
case m:
|
|
26
|
+
case l:
|
|
27
|
+
position = math(`${position} + 2`);
|
|
28
|
+
break;
|
|
29
29
|
}
|
|
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));
|
|
@@ -63,7 +63,7 @@ const colorStyles = _ref => {
|
|
|
63
63
|
theme
|
|
64
64
|
});
|
|
65
65
|
} else {
|
|
66
|
-
surfaceColor =
|
|
66
|
+
surfaceColor = 'transparent';
|
|
67
67
|
}
|
|
68
68
|
return css(["box-shadow:", ";background-color:", ";&&{color:", ";}& > svg,& ", "{color:", ";}"], theme.shadows.sm(statusColor), backgroundColor, surfaceColor, StyledText, foregroundColor);
|
|
69
69
|
};
|
|
@@ -108,7 +108,7 @@ const sizeStyles = props => {
|
|
|
108
108
|
};
|
|
109
109
|
const StyledAvatar = styled.figure.attrs({
|
|
110
110
|
'data-garden-id': COMPONENT_ID,
|
|
111
|
-
'data-garden-version': '9.0.0-next.
|
|
111
|
+
'data-garden-version': '9.0.0-next.25'
|
|
112
112
|
}).withConfig({
|
|
113
113
|
displayName: "StyledAvatar",
|
|
114
114
|
componentId: "sc-608m04-0"
|
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
import { TRANSITION_DURATION } from './utility.js';
|
|
10
10
|
|
|
11
11
|
const COMPONENT_ID = 'avatars.status-indicator.status';
|
|
12
12
|
const StyledStandaloneStatus = styled.figure.attrs({
|
|
13
13
|
'data-garden-id': COMPONENT_ID,
|
|
14
|
-
'data-garden-version': '9.0.0-next.
|
|
14
|
+
'data-garden-version': '9.0.0-next.25'
|
|
15
15
|
}).withConfig({
|
|
16
16
|
displayName: "StyledStandaloneStatus",
|
|
17
17
|
componentId: "sc-1ow4nfj-0"
|
|
18
18
|
})(["display:inline-flex;flex-flow:row nowrap;transition:all ", "s ease-in-out;margin:0;box-sizing:content-box;", ";"], TRANSITION_DURATION, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
19
|
-
StyledStandaloneStatus.defaultProps = {
|
|
20
|
-
theme: DEFAULT_THEME
|
|
21
|
-
};
|
|
22
19
|
|
|
23
20
|
export { StyledStandaloneStatus };
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled, { css } from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles,
|
|
8
|
+
import { retrieveComponentStyles, getLineHeight } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'avatars.status-indicator.caption';
|
|
11
11
|
function sizeStyles(props) {
|
|
@@ -14,13 +14,10 @@ function sizeStyles(props) {
|
|
|
14
14
|
}
|
|
15
15
|
const StyledStandaloneStatusCaption = styled.figcaption.attrs({
|
|
16
16
|
'data-garden-id': COMPONENT_ID,
|
|
17
|
-
'data-garden-version': '9.0.0-next.
|
|
17
|
+
'data-garden-version': '9.0.0-next.25'
|
|
18
18
|
}).withConfig({
|
|
19
19
|
displayName: "StyledStandaloneStatusCaption",
|
|
20
20
|
componentId: "sc-aalyk1-0"
|
|
21
21
|
})(["", " ", ";"], sizeStyles, props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
22
|
-
StyledStandaloneStatusCaption.defaultProps = {
|
|
23
|
-
theme: DEFAULT_THEME
|
|
24
|
-
};
|
|
25
22
|
|
|
26
23
|
export { StyledStandaloneStatusCaption };
|
|
@@ -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({
|
|
14
14
|
'data-garden-id': COMPONENT_ID,
|
|
15
|
-
'data-garden-version': '9.0.0-next.
|
|
15
|
+
'data-garden-version': '9.0.0-next.25'
|
|
16
16
|
}).withConfig({
|
|
17
17
|
displayName: "StyledStandaloneStatusIndicator",
|
|
18
18
|
componentId: "sc-1xt1heq-0"
|
|
@@ -34,19 +34,23 @@ const colorStyles = _ref => {
|
|
|
34
34
|
} = _ref;
|
|
35
35
|
const shadowSize = $size === xxs ? 'xs' : 'sm';
|
|
36
36
|
let boxShadow;
|
|
37
|
+
const surfaceColor = $surfaceColor?.includes('.') ? getColor({
|
|
38
|
+
variable: $surfaceColor,
|
|
39
|
+
theme
|
|
40
|
+
}) : $surfaceColor;
|
|
37
41
|
if ($type) {
|
|
38
|
-
boxShadow = theme.shadows[shadowSize](
|
|
42
|
+
boxShadow = theme.shadows[shadowSize](surfaceColor || getColor({
|
|
39
43
|
theme,
|
|
40
44
|
variable: 'background.default'
|
|
41
45
|
}));
|
|
42
46
|
} else {
|
|
43
|
-
boxShadow = theme.shadows[shadowSize](
|
|
47
|
+
boxShadow = theme.shadows[shadowSize](surfaceColor || theme.palette.white);
|
|
44
48
|
}
|
|
45
49
|
return css(["border-color:", ";box-shadow:", ";"], $borderColor, boxShadow);
|
|
46
50
|
};
|
|
47
51
|
const StyledStatusIndicator = styled(StyledStatusIndicatorBase).attrs({
|
|
48
52
|
'data-garden-id': COMPONENT_ID,
|
|
49
|
-
'data-garden-version': '9.0.0-next.
|
|
53
|
+
'data-garden-version': '9.0.0-next.25'
|
|
50
54
|
}).withConfig({
|
|
51
55
|
displayName: "StyledStatusIndicator",
|
|
52
56
|
componentId: "sc-16t9if3-0"
|
|
@@ -13,7 +13,7 @@ const iconFadeIn = keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
|
13
13
|
const sizeStyles = props => {
|
|
14
14
|
const offset = getStatusBorderOffset(props);
|
|
15
15
|
const size = getStatusSize(props, offset);
|
|
16
|
-
return css(["border:", " ", ";border-radius:", ";
|
|
16
|
+
return css(["border:", " ", ";border-radius:", ";min-width:", ";height:", ";line-height:", ";& > svg{position:absolute;top:-", ";left:-", ";transform-origin:50% 50%;animation:", " ", "s;max-height:unset;&[data-icon-status='transfers']{transform:scale(", ",1);}&[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);
|
|
17
17
|
};
|
|
18
18
|
const colorStyles = _ref => {
|
|
19
19
|
let {
|
|
@@ -40,7 +40,7 @@ const colorStyles = _ref => {
|
|
|
40
40
|
};
|
|
41
41
|
const StyledStatusIndicatorBase = styled.div.attrs({
|
|
42
42
|
'data-garden-id': COMPONENT_ID,
|
|
43
|
-
'data-garden-version': '9.0.0-next.
|
|
43
|
+
'data-garden-version': '9.0.0-next.25'
|
|
44
44
|
}).withConfig({
|
|
45
45
|
displayName: "StyledStatusIndicatorBase",
|
|
46
46
|
componentId: "sc-1rininy-0"
|
|
@@ -5,18 +5,15 @@
|
|
|
5
5
|
* found at http://www.apache.org/licenses/LICENSE-2.0.
|
|
6
6
|
*/
|
|
7
7
|
import styled from 'styled-components';
|
|
8
|
-
import { retrieveComponentStyles
|
|
8
|
+
import { retrieveComponentStyles } from '@zendeskgarden/react-theming';
|
|
9
9
|
|
|
10
10
|
const COMPONENT_ID = 'avatars.text';
|
|
11
11
|
const StyledText = styled.span.attrs({
|
|
12
12
|
'data-garden-id': COMPONENT_ID,
|
|
13
|
-
'data-garden-version': '9.0.0-next.
|
|
13
|
+
'data-garden-version': '9.0.0-next.25'
|
|
14
14
|
}).withConfig({
|
|
15
15
|
displayName: "StyledText",
|
|
16
16
|
componentId: "sc-1a6hivh-0"
|
|
17
17
|
})(["overflow:hidden;text-align:center;white-space:nowrap;", ";"], props => retrieveComponentStyles(COMPONENT_ID, props));
|
|
18
|
-
StyledText.defaultProps = {
|
|
19
|
-
theme: DEFAULT_THEME
|
|
20
|
-
};
|
|
21
18
|
|
|
22
19
|
export { StyledText };
|
package/dist/index.cjs.js
CHANGED
|
@@ -122,14 +122,11 @@ const STATUS = ['available', 'away', 'transfers', 'offline'];
|
|
|
122
122
|
const COMPONENT_ID$6 = 'avatars.text';
|
|
123
123
|
const StyledText = styled__default.default.span.attrs({
|
|
124
124
|
'data-garden-id': COMPONENT_ID$6,
|
|
125
|
-
'data-garden-version': '9.0.0-next.
|
|
125
|
+
'data-garden-version': '9.0.0-next.25'
|
|
126
126
|
}).withConfig({
|
|
127
127
|
displayName: "StyledText",
|
|
128
128
|
componentId: "sc-1a6hivh-0"
|
|
129
129
|
})(["overflow:hidden;text-align:center;white-space:nowrap;", ";"], props => reactTheming.retrieveComponentStyles(COMPONENT_ID$6, props));
|
|
130
|
-
StyledText.defaultProps = {
|
|
131
|
-
theme: reactTheming.DEFAULT_THEME
|
|
132
|
-
};
|
|
133
130
|
|
|
134
131
|
const [xxs$1, xs$1, s$1, m$1, l$1] = SIZE;
|
|
135
132
|
const TRANSITION_DURATION = 0.25;
|
|
@@ -218,7 +215,7 @@ const iconFadeIn = styled.keyframes(["0%{opacity:0;}100%{opacity:1;}"]);
|
|
|
218
215
|
const sizeStyles$3 = props => {
|
|
219
216
|
const offset = getStatusBorderOffset(props);
|
|
220
217
|
const size = getStatusSize(props, offset);
|
|
221
|
-
return styled.css(["border:", " ", ";border-radius:", ";
|
|
218
|
+
return styled.css(["border:", " ", ";border-radius:", ";min-width:", ";height:", ";line-height:", ";& > svg{position:absolute;top:-", ";left:-", ";transform-origin:50% 50%;animation:", " ", "s;max-height:unset;&[data-icon-status='transfers']{transform:scale(", ",1);}&[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);
|
|
222
219
|
};
|
|
223
220
|
const colorStyles$2 = _ref => {
|
|
224
221
|
let {
|
|
@@ -245,7 +242,7 @@ const colorStyles$2 = _ref => {
|
|
|
245
242
|
};
|
|
246
243
|
const StyledStatusIndicatorBase = styled__default.default.div.attrs({
|
|
247
244
|
'data-garden-id': COMPONENT_ID$5,
|
|
248
|
-
'data-garden-version': '9.0.0-next.
|
|
245
|
+
'data-garden-version': '9.0.0-next.25'
|
|
249
246
|
}).withConfig({
|
|
250
247
|
displayName: "StyledStatusIndicatorBase",
|
|
251
248
|
componentId: "sc-1rininy-0"
|
|
@@ -278,19 +275,23 @@ const colorStyles$1 = _ref => {
|
|
|
278
275
|
} = _ref;
|
|
279
276
|
const shadowSize = $size === xxs ? 'xs' : 'sm';
|
|
280
277
|
let boxShadow;
|
|
278
|
+
const surfaceColor = $surfaceColor?.includes('.') ? reactTheming.getColor({
|
|
279
|
+
variable: $surfaceColor,
|
|
280
|
+
theme
|
|
281
|
+
}) : $surfaceColor;
|
|
281
282
|
if ($type) {
|
|
282
|
-
boxShadow = theme.shadows[shadowSize](
|
|
283
|
+
boxShadow = theme.shadows[shadowSize](surfaceColor || reactTheming.getColor({
|
|
283
284
|
theme,
|
|
284
285
|
variable: 'background.default'
|
|
285
286
|
}));
|
|
286
287
|
} else {
|
|
287
|
-
boxShadow = theme.shadows[shadowSize](
|
|
288
|
+
boxShadow = theme.shadows[shadowSize](surfaceColor || theme.palette.white);
|
|
288
289
|
}
|
|
289
290
|
return styled.css(["border-color:", ";box-shadow:", ";"], $borderColor, boxShadow);
|
|
290
291
|
};
|
|
291
292
|
const StyledStatusIndicator = styled__default.default(StyledStatusIndicatorBase).attrs({
|
|
292
293
|
'data-garden-id': COMPONENT_ID$4,
|
|
293
|
-
'data-garden-version': '9.0.0-next.
|
|
294
|
+
'data-garden-version': '9.0.0-next.25'
|
|
294
295
|
}).withConfig({
|
|
295
296
|
displayName: "StyledStatusIndicator",
|
|
296
297
|
componentId: "sc-16t9if3-0"
|
|
@@ -305,15 +306,15 @@ const badgeStyles = props => {
|
|
|
305
306
|
const [xxs, xs, s, m, l] = SIZE;
|
|
306
307
|
let position = `${props.theme.space.base * -1}px`;
|
|
307
308
|
switch (props.$size) {
|
|
308
|
-
case s:
|
|
309
|
-
case m:
|
|
310
|
-
position = polished.math(`${position} + 2`);
|
|
311
|
-
break;
|
|
312
309
|
case xxs:
|
|
313
310
|
case xs:
|
|
314
|
-
case l:
|
|
315
311
|
position = polished.math(`${position} + 3`);
|
|
316
312
|
break;
|
|
313
|
+
case s:
|
|
314
|
+
case m:
|
|
315
|
+
case l:
|
|
316
|
+
position = polished.math(`${position} + 2`);
|
|
317
|
+
break;
|
|
317
318
|
}
|
|
318
319
|
const animation = styled.keyframes(["0%{transform:scale(.1);}"]);
|
|
319
320
|
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));
|
|
@@ -351,7 +352,7 @@ const colorStyles = _ref => {
|
|
|
351
352
|
theme
|
|
352
353
|
});
|
|
353
354
|
} else {
|
|
354
|
-
surfaceColor =
|
|
355
|
+
surfaceColor = 'transparent';
|
|
355
356
|
}
|
|
356
357
|
return styled.css(["box-shadow:", ";background-color:", ";&&{color:", ";}& > svg,& ", "{color:", ";}"], theme.shadows.sm(statusColor), backgroundColor, surfaceColor, StyledText, foregroundColor);
|
|
357
358
|
};
|
|
@@ -396,7 +397,7 @@ const sizeStyles$1 = props => {
|
|
|
396
397
|
};
|
|
397
398
|
const StyledAvatar = styled__default.default.figure.attrs({
|
|
398
399
|
'data-garden-id': COMPONENT_ID$3,
|
|
399
|
-
'data-garden-version': '9.0.0-next.
|
|
400
|
+
'data-garden-version': '9.0.0-next.25'
|
|
400
401
|
}).withConfig({
|
|
401
402
|
displayName: "StyledAvatar",
|
|
402
403
|
componentId: "sc-608m04-0"
|
|
@@ -409,14 +410,11 @@ StyledAvatar.defaultProps = {
|
|
|
409
410
|
const COMPONENT_ID$2 = 'avatars.status-indicator.status';
|
|
410
411
|
const StyledStandaloneStatus = styled__default.default.figure.attrs({
|
|
411
412
|
'data-garden-id': COMPONENT_ID$2,
|
|
412
|
-
'data-garden-version': '9.0.0-next.
|
|
413
|
+
'data-garden-version': '9.0.0-next.25'
|
|
413
414
|
}).withConfig({
|
|
414
415
|
displayName: "StyledStandaloneStatus",
|
|
415
416
|
componentId: "sc-1ow4nfj-0"
|
|
416
417
|
})(["display:inline-flex;flex-flow:row nowrap;transition:all ", "s ease-in-out;margin:0;box-sizing:content-box;", ";"], TRANSITION_DURATION, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$2, props));
|
|
417
|
-
StyledStandaloneStatus.defaultProps = {
|
|
418
|
-
theme: reactTheming.DEFAULT_THEME
|
|
419
|
-
};
|
|
420
418
|
|
|
421
419
|
const COMPONENT_ID$1 = 'avatars.status-indicator.caption';
|
|
422
420
|
function sizeStyles(props) {
|
|
@@ -425,19 +423,16 @@ function sizeStyles(props) {
|
|
|
425
423
|
}
|
|
426
424
|
const StyledStandaloneStatusCaption = styled__default.default.figcaption.attrs({
|
|
427
425
|
'data-garden-id': COMPONENT_ID$1,
|
|
428
|
-
'data-garden-version': '9.0.0-next.
|
|
426
|
+
'data-garden-version': '9.0.0-next.25'
|
|
429
427
|
}).withConfig({
|
|
430
428
|
displayName: "StyledStandaloneStatusCaption",
|
|
431
429
|
componentId: "sc-aalyk1-0"
|
|
432
430
|
})(["", " ", ";"], sizeStyles, props => reactTheming.retrieveComponentStyles(COMPONENT_ID$1, props));
|
|
433
|
-
StyledStandaloneStatusCaption.defaultProps = {
|
|
434
|
-
theme: reactTheming.DEFAULT_THEME
|
|
435
|
-
};
|
|
436
431
|
|
|
437
432
|
const COMPONENT_ID = 'avatars.status-indicator.indicator';
|
|
438
433
|
const StyledStandaloneStatusIndicator = styled__default.default(StyledStatusIndicatorBase).attrs({
|
|
439
434
|
'data-garden-id': COMPONENT_ID,
|
|
440
|
-
'data-garden-version': '9.0.0-next.
|
|
435
|
+
'data-garden-version': '9.0.0-next.25'
|
|
441
436
|
}).withConfig({
|
|
442
437
|
displayName: "StyledStandaloneStatusIndicator",
|
|
443
438
|
componentId: "sc-1xt1heq-0"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zendeskgarden/react-avatars",
|
|
3
|
-
"version": "9.0.0-next.
|
|
3
|
+
"version": "9.0.0-next.25",
|
|
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,8 +31,8 @@
|
|
|
31
31
|
"styled-components": "^5.3.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@zendeskgarden/react-dropdowns": "^9.0.0-next.
|
|
35
|
-
"@zendeskgarden/react-theming": "^9.0.0-next.
|
|
34
|
+
"@zendeskgarden/react-dropdowns": "^9.0.0-next.25",
|
|
35
|
+
"@zendeskgarden/react-theming": "^9.0.0-next.25",
|
|
36
36
|
"@zendeskgarden/svg-icons": "7.2.0"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"zendeskgarden:src": "src/index.ts",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "460751d630ab1c46e11810d60e4d7701b9d30b8f"
|
|
49
49
|
}
|