@atlaskit/avatar 24.0.0 → 25.0.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/CHANGELOG.md +25 -0
- package/dist/cjs/avatar-content.compiled.css +71 -0
- package/dist/cjs/avatar-content.js +32 -155
- package/dist/cjs/avatar-item.compiled.css +56 -0
- package/dist/cjs/avatar-item.js +27 -89
- package/dist/cjs/avatar.compiled.css +5 -0
- package/dist/cjs/avatar.js +20 -21
- package/dist/cjs/internal/avatar-image.compiled.css +25 -0
- package/dist/cjs/internal/avatar-image.js +48 -64
- package/dist/cjs/internal/icon-wrapper.compiled.css +13 -0
- package/dist/cjs/internal/icon-wrapper.js +18 -25
- package/dist/cjs/presence.compiled.css +18 -0
- package/dist/cjs/presence.js +32 -24
- package/dist/cjs/skeleton.compiled.css +24 -0
- package/dist/cjs/skeleton.js +36 -54
- package/dist/cjs/status.compiled.css +15 -0
- package/dist/cjs/status.js +31 -22
- package/dist/cjs/utilities.js +1 -14
- package/dist/es2019/avatar-content.compiled.css +71 -0
- package/dist/es2019/avatar-content.js +28 -153
- package/dist/es2019/avatar-item.compiled.css +56 -0
- package/dist/es2019/avatar-item.js +23 -87
- package/dist/es2019/avatar.compiled.css +5 -0
- package/dist/es2019/avatar.js +15 -22
- package/dist/es2019/internal/avatar-image.compiled.css +25 -0
- package/dist/es2019/internal/avatar-image.js +37 -54
- package/dist/es2019/internal/icon-wrapper.compiled.css +13 -0
- package/dist/es2019/internal/icon-wrapper.js +15 -24
- package/dist/es2019/presence.compiled.css +18 -0
- package/dist/es2019/presence.js +23 -15
- package/dist/es2019/skeleton.compiled.css +24 -0
- package/dist/es2019/skeleton.js +29 -51
- package/dist/es2019/status.compiled.css +15 -0
- package/dist/es2019/status.js +22 -13
- package/dist/es2019/utilities.js +0 -9
- package/dist/esm/avatar-content.compiled.css +71 -0
- package/dist/esm/avatar-content.js +28 -153
- package/dist/esm/avatar-item.compiled.css +56 -0
- package/dist/esm/avatar-item.js +23 -87
- package/dist/esm/avatar.compiled.css +5 -0
- package/dist/esm/avatar.js +15 -22
- package/dist/esm/internal/avatar-image.compiled.css +25 -0
- package/dist/esm/internal/avatar-image.js +44 -64
- package/dist/esm/internal/icon-wrapper.compiled.css +13 -0
- package/dist/esm/internal/icon-wrapper.js +15 -25
- package/dist/esm/presence.compiled.css +18 -0
- package/dist/esm/presence.js +23 -15
- package/dist/esm/skeleton.compiled.css +24 -0
- package/dist/esm/skeleton.js +33 -56
- package/dist/esm/status.compiled.css +15 -0
- package/dist/esm/status.js +22 -13
- package/dist/esm/utilities.js +0 -13
- package/dist/types/presence.d.ts +4 -0
- package/dist/types/status.d.ts +4 -0
- package/dist/types/utilities.d.ts +0 -9
- package/dist/types-ts4.5/presence.d.ts +4 -0
- package/dist/types-ts4.5/status.d.ts +4 -0
- package/dist/types-ts4.5/utilities.d.ts +0 -9
- package/package.json +14 -15
|
@@ -1,96 +1,80 @@
|
|
|
1
|
-
|
|
1
|
+
/* avatar-image.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* @jsxRuntime classic
|
|
7
|
-
* @jsx jsx
|
|
8
|
-
*/
|
|
3
|
+
import "./avatar-image.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
9
6
|
import { useEffect, useState } from 'react';
|
|
10
|
-
import { css, jsx } from '@emotion/react';
|
|
11
7
|
import PersonIconLegacy from '@atlaskit/icon/core/migration/person';
|
|
12
8
|
import ReleaseIconMigration from '@atlaskit/icon/core/migration/release--ship';
|
|
13
9
|
import PersonIcon from '@atlaskit/icon/core/person';
|
|
14
10
|
import ReleaseIcon from '@atlaskit/icon/core/release';
|
|
15
11
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
16
12
|
import { N0, N90 } from '@atlaskit/theme/colors';
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
height: "".concat(size, "px")
|
|
41
|
-
}
|
|
42
|
-
})));
|
|
43
|
-
}, {});
|
|
44
|
-
var avatarImageStyles = css({
|
|
45
|
-
display: 'flex',
|
|
46
|
-
width: '100%',
|
|
47
|
-
height: '100%',
|
|
48
|
-
flex: '1 1 100%'
|
|
49
|
-
});
|
|
13
|
+
var styles = {
|
|
14
|
+
image: "_16jlkb7n _1o9zkb7n _i0dl1osq _1e0c1txw _1bsb1osq _4t3i1osq",
|
|
15
|
+
icon: "_1e0c1txw _1bsb1osq _4t3i1osq",
|
|
16
|
+
iconBg: "_bfhkr4aa",
|
|
17
|
+
iconBGVisualRefresh: "_bfhk1v33",
|
|
18
|
+
circle: "_2rko1q5u"
|
|
19
|
+
};
|
|
20
|
+
var borderRadiusMap = {
|
|
21
|
+
xsmall: "_2rkogqwt",
|
|
22
|
+
small: "_2rkogqwt",
|
|
23
|
+
medium: "_2rko1l7b",
|
|
24
|
+
large: "_2rko1l7b",
|
|
25
|
+
xlarge: "_2rkoi2wt",
|
|
26
|
+
xxlarge: "_2rkob7nn"
|
|
27
|
+
};
|
|
28
|
+
var nestedSvgStylesMap = {
|
|
29
|
+
xsmall: "_w8l57vkz _17527vkz",
|
|
30
|
+
small: "_w8l51tcg _17521tcg",
|
|
31
|
+
medium: "_w8l5zwfg _1752zwfg",
|
|
32
|
+
large: "_w8l51ylp _17521ylp",
|
|
33
|
+
xlarge: "_w8l516xz _175216xz",
|
|
34
|
+
xxlarge: "_w8l51qr7 _17521qr7"
|
|
35
|
+
};
|
|
50
36
|
|
|
51
37
|
/**
|
|
52
38
|
* __Avatar image__
|
|
53
39
|
*
|
|
54
40
|
* An avatar image is an internal component used to control the rendering phases of an image.
|
|
55
41
|
*/
|
|
56
|
-
var AvatarImage = function AvatarImage(
|
|
57
|
-
var
|
|
58
|
-
alt =
|
|
59
|
-
src =
|
|
60
|
-
appearance =
|
|
61
|
-
size =
|
|
62
|
-
testId =
|
|
42
|
+
var AvatarImage = function AvatarImage(_ref) {
|
|
43
|
+
var _ref$alt = _ref.alt,
|
|
44
|
+
alt = _ref$alt === void 0 ? '' : _ref$alt,
|
|
45
|
+
src = _ref.src,
|
|
46
|
+
appearance = _ref.appearance,
|
|
47
|
+
size = _ref.size,
|
|
48
|
+
testId = _ref.testId;
|
|
63
49
|
var _useState = useState(false),
|
|
64
50
|
_useState2 = _slicedToArray(_useState, 2),
|
|
65
51
|
hasImageErrored = _useState2[0],
|
|
66
52
|
setHasImageErrored = _useState2[1];
|
|
67
|
-
var borderRadius = appearance === 'circle' ? '50%' : "".concat(AVATAR_RADIUS[size], "px");
|
|
68
|
-
var isHidden = !alt ? true : undefined;
|
|
69
53
|
|
|
70
54
|
// If src changes, reset state
|
|
71
55
|
useEffect(function () {
|
|
72
56
|
setHasImageErrored(false);
|
|
73
57
|
}, [src]);
|
|
74
58
|
if (!src || hasImageErrored) {
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
}, appearance === 'circle' ? fg('platform-component-visual-refresh') ?
|
|
59
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
60
|
+
className: ax([styles.icon, fg('platform-component-visual-refresh') ? styles.iconBGVisualRefresh : styles.iconBg, nestedSvgStylesMap[size]])
|
|
61
|
+
}, appearance === 'circle' ? fg('platform-component-visual-refresh') ? /*#__PURE__*/React.createElement(PersonIcon, {
|
|
78
62
|
label: alt,
|
|
79
63
|
color: "var(--ds-icon-subtle, #626F86)",
|
|
80
64
|
testId: testId && "".concat(testId, "--person"),
|
|
81
65
|
spacing: "spacious"
|
|
82
|
-
}) :
|
|
66
|
+
}) : /*#__PURE__*/React.createElement(PersonIconLegacy, {
|
|
83
67
|
label: alt,
|
|
84
68
|
color: "var(--ds-icon-inverse, ".concat(N0, ")"),
|
|
85
69
|
LEGACY_secondaryColor: "var(--ds-icon-subtle, ".concat(N90, ")"),
|
|
86
70
|
testId: testId && "".concat(testId, "--person"),
|
|
87
71
|
spacing: "spacious"
|
|
88
|
-
}) : fg('platform-component-visual-refresh') ?
|
|
72
|
+
}) : fg('platform-component-visual-refresh') ? /*#__PURE__*/React.createElement(ReleaseIcon, {
|
|
89
73
|
label: alt,
|
|
90
74
|
color: "var(--ds-icon-subtle, #626F86)",
|
|
91
75
|
testId: testId && "".concat(testId, "--ship"),
|
|
92
76
|
spacing: "spacious"
|
|
93
|
-
}) :
|
|
77
|
+
}) : /*#__PURE__*/React.createElement(ReleaseIconMigration, {
|
|
94
78
|
label: alt,
|
|
95
79
|
color: "var(--ds-icon-inverse, ".concat(N0, ")"),
|
|
96
80
|
LEGACY_secondaryColor: "var(--ds-icon-subtle, ".concat(N90, ")"),
|
|
@@ -98,21 +82,17 @@ var AvatarImage = function AvatarImage(_ref3) {
|
|
|
98
82
|
spacing: "spacious"
|
|
99
83
|
}));
|
|
100
84
|
}
|
|
101
|
-
return
|
|
85
|
+
return /*#__PURE__*/React.createElement("img", {
|
|
102
86
|
src: src,
|
|
103
87
|
alt: alt,
|
|
104
88
|
"data-testid": testId && "".concat(testId, "--image"),
|
|
105
|
-
css: avatarImageStyles,
|
|
106
|
-
style: {
|
|
107
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
108
|
-
borderRadius: borderRadius
|
|
109
|
-
},
|
|
110
89
|
onError: function onError() {
|
|
111
90
|
return setHasImageErrored(true);
|
|
112
91
|
},
|
|
113
|
-
"aria-hidden":
|
|
92
|
+
"aria-hidden": !alt ? true : undefined,
|
|
114
93
|
"data-vc": testId ? "".concat(testId, "--image") : 'avatar-image',
|
|
115
|
-
"data-ssr-placeholder-ignored": true
|
|
94
|
+
"data-ssr-placeholder-ignored": true,
|
|
95
|
+
className: ax([styles.image, borderRadiusMap[size], appearance === 'circle' && styles.circle])
|
|
116
96
|
});
|
|
117
97
|
};
|
|
118
98
|
export default AvatarImage;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1q5u{border-radius:var(--ds-border-radius-circle,50%)}._189e1bk5{border-width:var(--ds-border-width-outline,2px)}
|
|
3
|
+
._1dqonqa1{border-style:solid}
|
|
4
|
+
._1h6d1bhr{border-color:var(--ds-surface-overlay,#fff)}
|
|
5
|
+
._18m915vq{overflow-y:hidden}
|
|
6
|
+
._1bsb1osq{width:100%}
|
|
7
|
+
._1e0c1txw{display:flex}
|
|
8
|
+
._1reo15vq{overflow-x:hidden}
|
|
9
|
+
._4cvr1h6o{align-items:center}
|
|
10
|
+
._4t3i1osq{height:100%}
|
|
11
|
+
._ae4v1h6o{align-content:center}
|
|
12
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
13
|
+
._vchhusvi{box-sizing:border-box}
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
boxSizing: 'border-box',
|
|
12
|
-
width: '100%',
|
|
13
|
-
height: '100%',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
alignContent: 'center',
|
|
16
|
-
borderRadius: "var(--ds-border-radius-circle, 50%)",
|
|
17
|
-
overflow: 'hidden'
|
|
18
|
-
});
|
|
1
|
+
/* icon-wrapper.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./icon-wrapper.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
var styles = {
|
|
6
|
+
root: "_2rko1q5u _1reo15vq _18m915vq _189e1bk5 _1dqonqa1 _1e0c1txw _vchhusvi _1bsb1osq _4t3i1osq _4cvr1h6o _ae4v1h6o _bfhk1bhr"
|
|
7
|
+
};
|
|
8
|
+
var unboundStyles = {
|
|
9
|
+
root: "_1h6d1bhr"
|
|
10
|
+
};
|
|
19
11
|
|
|
20
12
|
/**
|
|
21
13
|
* __Icon wrapper__
|
|
@@ -23,17 +15,15 @@ var iconWrapperStyles = css({
|
|
|
23
15
|
* An icon wrapper is used internally only.
|
|
24
16
|
*/
|
|
25
17
|
var IconWrapper = function IconWrapper(_ref) {
|
|
26
|
-
var
|
|
27
|
-
bgColor = _ref$bgColor === void 0 ? "var(--ds-surface-overlay, ".concat(N0, ")") : _ref$bgColor,
|
|
18
|
+
var bgColor = _ref.bgColor,
|
|
28
19
|
children = _ref.children;
|
|
29
|
-
return
|
|
30
|
-
css: iconWrapperStyles,
|
|
20
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
31
21
|
role: "presentation",
|
|
32
22
|
style: {
|
|
33
|
-
|
|
34
|
-
border: "".concat(BORDER_WIDTH, "px solid ").concat(bgColor),
|
|
23
|
+
borderColor: bgColor,
|
|
35
24
|
backgroundColor: bgColor
|
|
36
|
-
}
|
|
25
|
+
},
|
|
26
|
+
className: ax([styles.root, unboundStyles.root])
|
|
37
27
|
}, children);
|
|
38
28
|
};
|
|
39
29
|
export default IconWrapper;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
._1bsb1crf{width:9pt}
|
|
2
|
+
._1bsbdlk8{width:14px}
|
|
3
|
+
._1bsbf6fq{width:18px}
|
|
4
|
+
._1bsbo7ao{width:15px}
|
|
5
|
+
._1xi21v6z{right:7px}
|
|
6
|
+
._1xi2idpf{right:0}
|
|
7
|
+
._1xi2myb0{right:-4px}
|
|
8
|
+
._1xi2t94y{right:1px}
|
|
9
|
+
._4t3i1crf{height:9pt}
|
|
10
|
+
._4t3idlk8{height:14px}
|
|
11
|
+
._4t3if6fq{height:18px}
|
|
12
|
+
._4t3io7ao{height:15px}
|
|
13
|
+
._94n51v6z{bottom:7px}
|
|
14
|
+
._94n5idpf{bottom:0}
|
|
15
|
+
._94n5myb0{bottom:-4px}
|
|
16
|
+
._94n5t94y{bottom:1px}
|
|
17
|
+
._kqswstnw{position:absolute}
|
|
18
|
+
._lcxvglyw{pointer-events:none}
|
package/dist/esm/presence.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/* presence.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./presence.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { Fragment } from 'react';
|
|
2
6
|
import { G300, N0, N200, N40, P300, R300 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { ICON_OFFSET, ICON_SIZES } from './constants';
|
|
4
7
|
import IconWrapper from './internal/icon-wrapper';
|
|
5
8
|
var BusyIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
|
|
6
9
|
fill: "var(--ds-icon-danger, ".concat(R300, ")"),
|
|
@@ -65,6 +68,23 @@ var AvatarPresence = function AvatarPresence(_ref) {
|
|
|
65
68
|
}, getPresence(presence)) : children);
|
|
66
69
|
};
|
|
67
70
|
export default AvatarPresence;
|
|
71
|
+
var styles = {
|
|
72
|
+
root: "_kqswstnw _lcxvglyw"
|
|
73
|
+
};
|
|
74
|
+
var iconSizeMap = {
|
|
75
|
+
small: "_4t3i1crf _1bsb1crf",
|
|
76
|
+
medium: "_4t3idlk8 _1bsbdlk8",
|
|
77
|
+
large: "_4t3io7ao _1bsbo7ao",
|
|
78
|
+
xlarge: "_4t3if6fq _1bsbf6fq"
|
|
79
|
+
};
|
|
80
|
+
var iconOffsetMap = {
|
|
81
|
+
square: "_94n5myb0 _1xi2myb0",
|
|
82
|
+
small: "_94n5idpf _1xi2idpf",
|
|
83
|
+
medium: "_94n5idpf _1xi2idpf",
|
|
84
|
+
large: "_94n5t94y _1xi2t94y",
|
|
85
|
+
xlarge: "_94n51v6z _1xi21v6z"
|
|
86
|
+
};
|
|
87
|
+
|
|
68
88
|
/**
|
|
69
89
|
* __Presence wrapper__
|
|
70
90
|
*
|
|
@@ -77,22 +97,10 @@ export var PresenceWrapper = function PresenceWrapper(_ref2) {
|
|
|
77
97
|
borderColor = _ref2.borderColor,
|
|
78
98
|
presence = _ref2.presence,
|
|
79
99
|
testId = _ref2.testId;
|
|
80
|
-
var position = appearance === 'square' ? -4 : ICON_OFFSET[size];
|
|
81
100
|
return /*#__PURE__*/React.createElement("span", {
|
|
82
101
|
"aria-hidden": "true",
|
|
83
102
|
"data-testid": testId && "".concat(testId, "--presence"),
|
|
84
|
-
|
|
85
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
86
|
-
pointerEvents: 'none',
|
|
87
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
88
|
-
position: 'absolute',
|
|
89
|
-
bottom: "".concat(position, "px"),
|
|
90
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
91
|
-
height: "".concat(ICON_SIZES[size], "px"),
|
|
92
|
-
right: "".concat(position, "px"),
|
|
93
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
94
|
-
width: "".concat(ICON_SIZES[size], "px")
|
|
95
|
-
}
|
|
103
|
+
className: ax([styles.root, iconSizeMap[size], iconOffsetMap[size], appearance === 'square' && iconOffsetMap['square']])
|
|
96
104
|
}, /*#__PURE__*/React.createElement(AvatarPresence, {
|
|
97
105
|
borderColor: borderColor,
|
|
98
106
|
presence: !children ? presence : undefined
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1l7b{border-radius:3px}
|
|
3
|
+
._2rko1q5u{border-radius:var(--ds-border-radius-circle,50%)}
|
|
4
|
+
._2rkob7nn{border-radius:var(--ds-border-radius-300,9pt)}
|
|
5
|
+
._2rkogqwt{border-radius:var(--ds-border-radius-050,2px)}
|
|
6
|
+
._2rkoi2wt{border-radius:6px}._189e1bk5{border-width:var(--ds-border-width-outline,2px)}
|
|
7
|
+
._1dqonqa1{border-style:solid}
|
|
8
|
+
._1h6d1j28{border-color:transparent}
|
|
9
|
+
._1bsb16xz{width:6pc}
|
|
10
|
+
._1bsb1qr7{width:8pc}
|
|
11
|
+
._1bsb1tcg{width:24px}
|
|
12
|
+
._1bsb1ylp{width:40px}
|
|
13
|
+
._1bsb7vkz{width:1pc}
|
|
14
|
+
._1bsbzwfg{width:2pc}
|
|
15
|
+
._1e0c1o8l{display:inline-block}
|
|
16
|
+
._4t3i16xz{height:6pc}
|
|
17
|
+
._4t3i1qr7{height:8pc}
|
|
18
|
+
._4t3i1tcg{height:24px}
|
|
19
|
+
._4t3i1ylp{height:40px}
|
|
20
|
+
._4t3i7vkz{height:1pc}
|
|
21
|
+
._4t3izwfg{height:2pc}
|
|
22
|
+
._bfhk1r8p{background-color:var(--avatar-skeleton-background-color)}
|
|
23
|
+
._tzy4clii{opacity:.3}
|
|
24
|
+
._tzy4nh7s{opacity:.15}
|
package/dist/esm/skeleton.js
CHANGED
|
@@ -1,50 +1,29 @@
|
|
|
1
|
+
/* skeleton.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
1
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
27
|
-
height: "".concat(size, "px")
|
|
28
|
-
})));
|
|
29
|
-
}, {});
|
|
30
|
-
var radiusStyles = Object.entries(AVATAR_RADIUS).reduce(function (styles, _ref3) {
|
|
31
|
-
var _ref4 = _slicedToArray(_ref3, 2),
|
|
32
|
-
key = _ref4[0],
|
|
33
|
-
size = _ref4[1];
|
|
34
|
-
return _objectSpread(_objectSpread({}, styles), {}, _defineProperty({}, key, css({
|
|
35
|
-
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
36
|
-
borderRadius: "".concat(size, "px")
|
|
37
|
-
})));
|
|
38
|
-
}, {});
|
|
39
|
-
var defaultRadiusStyles = css({
|
|
40
|
-
borderRadius: "var(--ds-border-radius-circle, 50%)"
|
|
41
|
-
});
|
|
42
|
-
var strongOpacityStyles = css({
|
|
43
|
-
opacity: 0.3
|
|
44
|
-
});
|
|
45
|
-
var defaultOpacityStyles = css({
|
|
46
|
-
opacity: 0.15
|
|
47
|
-
});
|
|
3
|
+
import "./skeleton.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
var bgColorCssVar = '--avatar-skeleton-background-color';
|
|
7
|
+
var styles = {
|
|
8
|
+
root: "_2rko1q5u _189e1bk5 _1dqonqa1 _1h6d1j28 _1e0c1o8l _bfhk1r8p _tzy4nh7s",
|
|
9
|
+
strongOpacity: "_tzy4clii"
|
|
10
|
+
};
|
|
11
|
+
var sizeStyles = {
|
|
12
|
+
xsmall: "_1bsb7vkz _4t3i7vkz",
|
|
13
|
+
small: "_1bsb1tcg _4t3i1tcg",
|
|
14
|
+
medium: "_1bsbzwfg _4t3izwfg",
|
|
15
|
+
large: "_1bsb1ylp _4t3i1ylp",
|
|
16
|
+
xlarge: "_1bsb16xz _4t3i16xz",
|
|
17
|
+
xxlarge: "_1bsb1qr7 _4t3i1qr7"
|
|
18
|
+
};
|
|
19
|
+
var borderRadiusMap = {
|
|
20
|
+
xsmall: "_2rkogqwt",
|
|
21
|
+
small: "_2rkogqwt",
|
|
22
|
+
medium: "_2rko1l7b",
|
|
23
|
+
large: "_2rko1l7b",
|
|
24
|
+
xlarge: "_2rkoi2wt",
|
|
25
|
+
xxlarge: "_2rkob7nn"
|
|
26
|
+
};
|
|
48
27
|
|
|
49
28
|
/**
|
|
50
29
|
* __Skeleton__
|
|
@@ -54,16 +33,14 @@ var defaultOpacityStyles = css({
|
|
|
54
33
|
* - [Examples](https://atlassian.design/components/avatar/avatar-skeleton/examples)
|
|
55
34
|
* - [Code](https://atlassian.design/components/avatar/avatar-skeleton/code)
|
|
56
35
|
*/
|
|
57
|
-
var Skeleton = function Skeleton(
|
|
58
|
-
var size =
|
|
59
|
-
appearance =
|
|
60
|
-
color =
|
|
61
|
-
weight =
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
,
|
|
66
|
-
style: _defineProperty({}, CSS_VAR_AVATAR_BGCOLOR, color !== null && color !== void 0 ? color : 'currentColor')
|
|
36
|
+
var Skeleton = function Skeleton(_ref) {
|
|
37
|
+
var size = _ref.size,
|
|
38
|
+
appearance = _ref.appearance,
|
|
39
|
+
color = _ref.color,
|
|
40
|
+
weight = _ref.weight;
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
+
style: _defineProperty({}, bgColorCssVar, color !== null && color !== void 0 ? color : 'currentColor'),
|
|
43
|
+
className: ax([styles.root, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && borderRadiusMap[size !== null && size !== void 0 ? size : 'medium'], weight === 'strong' && styles.strongOpacity])
|
|
67
44
|
});
|
|
68
45
|
};
|
|
69
46
|
export default Skeleton;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
._154i1v6z{top:7px}
|
|
2
|
+
._154iidpf{top:0}
|
|
3
|
+
._154it94y{top:1px}
|
|
4
|
+
._1bsb1crf{width:9pt}
|
|
5
|
+
._1bsbdlk8{width:14px}
|
|
6
|
+
._1bsbf6fq{width:18px}
|
|
7
|
+
._1bsbo7ao{width:15px}
|
|
8
|
+
._1xi21v6z{right:7px}
|
|
9
|
+
._1xi2idpf{right:0}
|
|
10
|
+
._1xi2t94y{right:1px}
|
|
11
|
+
._4t3i1crf{height:9pt}
|
|
12
|
+
._4t3idlk8{height:14px}
|
|
13
|
+
._4t3if6fq{height:18px}
|
|
14
|
+
._4t3io7ao{height:15px}
|
|
15
|
+
._kqswstnw{position:absolute}
|
package/dist/esm/status.js
CHANGED
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
|
|
1
|
+
/* status.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./status.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { Fragment } from 'react';
|
|
2
6
|
import { G400, N0, N40, N500, R400 } from '@atlaskit/theme/colors';
|
|
3
|
-
import { ICON_OFFSET, ICON_SIZES } from './constants';
|
|
4
7
|
import IconWrapper from './internal/icon-wrapper';
|
|
8
|
+
var styles = {
|
|
9
|
+
root: "_kqswstnw"
|
|
10
|
+
};
|
|
11
|
+
var iconSizeMap = {
|
|
12
|
+
small: "_4t3i1crf _1bsb1crf",
|
|
13
|
+
medium: "_4t3idlk8 _1bsbdlk8",
|
|
14
|
+
large: "_4t3io7ao _1bsbo7ao",
|
|
15
|
+
xlarge: "_4t3if6fq _1bsbf6fq"
|
|
16
|
+
};
|
|
17
|
+
var iconOffsetMap = {
|
|
18
|
+
square: "_1xi2idpf _154iidpf",
|
|
19
|
+
small: "_1xi2idpf _154iidpf",
|
|
20
|
+
medium: "_1xi2idpf _154iidpf",
|
|
21
|
+
large: "_1xi2t94y _154it94y",
|
|
22
|
+
xlarge: "_1xi21v6z _154i1v6z"
|
|
23
|
+
};
|
|
5
24
|
var ApprovedIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
|
|
6
25
|
fill: "var(--ds-icon-success, ".concat(G400, ")"),
|
|
7
26
|
cx: "4",
|
|
@@ -75,20 +94,10 @@ export var StatusWrapper = function StatusWrapper(_ref2) {
|
|
|
75
94
|
borderColor = _ref2.borderColor,
|
|
76
95
|
children = _ref2.children,
|
|
77
96
|
testId = _ref2.testId;
|
|
78
|
-
var position = appearance === 'square' ? 0 : ICON_OFFSET[size];
|
|
79
97
|
return /*#__PURE__*/React.createElement("span", {
|
|
80
98
|
"aria-hidden": "true",
|
|
81
99
|
"data-testid": testId && "".concat(testId, "--status"),
|
|
82
|
-
|
|
83
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
84
|
-
position: 'absolute',
|
|
85
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
86
|
-
height: "".concat(ICON_SIZES[size], "px"),
|
|
87
|
-
right: "".concat(position, "px"),
|
|
88
|
-
top: "".concat(position, "px"),
|
|
89
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
90
|
-
width: "".concat(ICON_SIZES[size], "px")
|
|
91
|
-
}
|
|
100
|
+
className: ax([styles.root, iconSizeMap[size], iconOffsetMap[size], appearance === 'square' && iconOffsetMap['square']])
|
|
92
101
|
}, /*#__PURE__*/React.createElement(AvatarStatus, {
|
|
93
102
|
borderColor: borderColor,
|
|
94
103
|
status: !children ? status : undefined
|
package/dist/esm/utilities.js
CHANGED
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
export var getLinkProps = function getLinkProps(href, target) {
|
|
2
|
-
return {
|
|
3
|
-
href: href,
|
|
4
|
-
rel: target === '_blank' ? 'noopener noreferrer' : null,
|
|
5
|
-
target: target
|
|
6
|
-
};
|
|
7
|
-
};
|
|
8
|
-
export var getButtonProps = function getButtonProps(onClick) {
|
|
9
|
-
return {
|
|
10
|
-
type: 'button',
|
|
11
|
-
onClick: onClick
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
1
|
export var getCustomElement = function getCustomElement(isDisabled, href, onClick) {
|
|
15
2
|
if (href && !isDisabled) {
|
|
16
3
|
return 'a';
|
package/dist/types/presence.d.ts
CHANGED
package/dist/types/status.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import { type MouseEventHandler } from 'react';
|
|
2
|
-
export declare const getLinkProps: (href: string, target?: string) => {
|
|
3
|
-
href: string;
|
|
4
|
-
rel: string | null;
|
|
5
|
-
target: string | undefined;
|
|
6
|
-
};
|
|
7
|
-
export declare const getButtonProps: (onClick: MouseEventHandler) => {
|
|
8
|
-
type: string;
|
|
9
|
-
onClick: MouseEventHandler;
|
|
10
|
-
};
|
|
11
2
|
export declare const getCustomElement: (isDisabled?: boolean, href?: string, onClick?: MouseEventHandler) => "a" | "button" | "span";
|
|
@@ -1,11 +1,2 @@
|
|
|
1
1
|
import { type MouseEventHandler } from 'react';
|
|
2
|
-
export declare const getLinkProps: (href: string, target?: string) => {
|
|
3
|
-
href: string;
|
|
4
|
-
rel: string | null;
|
|
5
|
-
target: string | undefined;
|
|
6
|
-
};
|
|
7
|
-
export declare const getButtonProps: (onClick: MouseEventHandler) => {
|
|
8
|
-
type: string;
|
|
9
|
-
onClick: MouseEventHandler;
|
|
10
|
-
};
|
|
11
2
|
export declare const getCustomElement: (isDisabled?: boolean, href?: string, onClick?: MouseEventHandler) => "a" | "button" | "span";
|