@atlaskit/avatar 25.3.1 → 25.4.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 +17 -0
- package/dist/cjs/avatar-content.compiled.css +23 -4
- package/dist/cjs/avatar-content.js +27 -4
- package/dist/cjs/avatar.js +2 -5
- package/dist/cjs/internal/avatar-image.compiled.css +1 -0
- package/dist/cjs/internal/avatar-image.js +35 -15
- package/dist/cjs/presence.compiled.css +5 -0
- package/dist/cjs/presence.js +11 -3
- package/dist/cjs/skeleton.compiled.css +2 -1
- package/dist/cjs/skeleton.js +4 -3
- package/dist/cjs/status.compiled.css +13 -7
- package/dist/cjs/status.js +15 -7
- package/dist/es2019/avatar-content.compiled.css +23 -4
- package/dist/es2019/avatar-content.js +30 -4
- package/dist/es2019/avatar.js +2 -5
- package/dist/es2019/internal/avatar-image.compiled.css +1 -0
- package/dist/es2019/internal/avatar-image.js +35 -15
- package/dist/es2019/presence.compiled.css +5 -0
- package/dist/es2019/presence.js +11 -3
- package/dist/es2019/skeleton.compiled.css +2 -1
- package/dist/es2019/skeleton.js +4 -3
- package/dist/es2019/status.compiled.css +13 -7
- package/dist/es2019/status.js +15 -7
- package/dist/esm/avatar-content.compiled.css +23 -4
- package/dist/esm/avatar-content.js +27 -4
- package/dist/esm/avatar.js +2 -5
- package/dist/esm/internal/avatar-image.compiled.css +1 -0
- package/dist/esm/internal/avatar-image.js +35 -15
- package/dist/esm/presence.compiled.css +5 -0
- package/dist/esm/presence.js +11 -3
- package/dist/esm/skeleton.compiled.css +2 -1
- package/dist/esm/skeleton.js +4 -3
- package/dist/esm/status.compiled.css +13 -7
- package/dist/esm/status.js +15 -7
- package/dist/types/avatar.d.ts +0 -9
- package/dist/types/types.d.ts +1 -1
- package/dist/types-ts4.5/avatar.d.ts +0 -9
- package/dist/types-ts4.5/types.d.ts +1 -1
- package/offerings.json +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/avatar
|
|
2
2
|
|
|
3
|
+
## 25.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`a37090c1d91de`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a37090c1d91de) -
|
|
8
|
+
Adds a new hexagon appearance (`<Avatar appearance="hexagon">`) as well as a
|
|
9
|
+
`<Skeleton appearance="hexagon">` and internal Image default loader for this. The intent with this
|
|
10
|
+
appearance is documented as displaying AI agents: `circle` for users, `square` for app entities
|
|
11
|
+
(teams, projects, spaces), and`hexagon` for agent entities.
|
|
12
|
+
|
|
13
|
+
## 25.3.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`2e422847ee061`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2e422847ee061) -
|
|
18
|
+
[ux] Revert PR (Add a new prop to set the container element for avatar content)
|
|
19
|
+
|
|
3
20
|
## 25.3.1
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
._14mj12b0:after{border-radius:var(--ds-radius-small,4px)}
|
|
2
3
|
._14mj1qi0:after{border-radius:var(--ds-radius-medium,6px)}
|
|
3
4
|
._14mj1qll:after{border-radius:var(--ds-radius-full,50%)}
|
|
4
|
-
.
|
|
5
|
+
._14mjidpf:after{border-radius:0}
|
|
5
6
|
._14mjlb4i:after{border-radius:var(--ds-radius-xsmall,2px)}
|
|
6
7
|
._14mjpb1k:after{border-radius:var(--ds-radius-xlarge,9pt)}
|
|
7
8
|
._19itglyw{border:none}
|
|
9
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
8
10
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
9
11
|
._2rko1qll{border-radius:var(--ds-radius-full,50%)}
|
|
10
|
-
.
|
|
12
|
+
._2rkoidpf{border-radius:0}
|
|
11
13
|
._2rkol0p1{border-radius:var(--ds-radius-tile,25%)}
|
|
12
14
|
._2rkolb4i{border-radius:var(--ds-radius-xsmall,2px)}
|
|
13
15
|
._2rkopb1k{border-radius:var(--ds-radius-xlarge,9pt)}
|
|
14
16
|
._9v7aze3t:after{inset:var(--ds-space-0,0)}
|
|
15
17
|
._qc5o1p41:after{transition:opacity .2s}
|
|
16
|
-
._v564ieh6{transition:transform .2s,opacity .2s}
|
|
18
|
+
._v564ieh6{transition:transform .2s,opacity .2s}
|
|
19
|
+
._18zr1dm9{padding-inline:var(--ds-border-width-selected,2px)}
|
|
20
|
+
._18zruxly{padding-inline:calc(var(--ds-border-width-selected, 2px)*.4)}
|
|
21
|
+
._195g1ukp{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 8px)}
|
|
22
|
+
._195g8ocb{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 4px)}
|
|
23
|
+
._195gcwjc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 1px)}
|
|
24
|
+
._195gs7t4{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 2px)}
|
|
25
|
+
._1moult7l{margin-block:calc(var(--ds-border-width-selected, 2px)*1.22*-1)}
|
|
26
|
+
._1rjcf6hp{padding-block:calc(var(--ds-border-width-selected, 2px)*.5)}
|
|
27
|
+
._1rjcyvr3{padding-block:calc(var(--ds-border-width-selected, 2px)*1.22)}._11fnglyw:after{pointer-events:none}
|
|
17
28
|
._12ji1r31{outline-color:currentColor}
|
|
18
29
|
._12l2v77o{margin-inline-end:var(--ds-space-025,2px)}
|
|
19
30
|
._12y31o36{outline-width:medium}
|
|
20
31
|
._16qs1nhn{box-shadow:var(--avatar-box-shadow)}
|
|
32
|
+
._16qsn7od{box-shadow:unset}
|
|
21
33
|
._18m915vq{overflow-y:hidden}
|
|
22
34
|
._18postnw:after{position:absolute}
|
|
23
35
|
._1bah1h6o{justify-content:center}
|
|
@@ -30,6 +42,8 @@
|
|
|
30
42
|
._1e0c1txw{display:flex}
|
|
31
43
|
._1hfk1j28:after{background-color:transparent}
|
|
32
44
|
._1hfkvuon:after{background-color:var(--ds-surface,#fff)}
|
|
45
|
+
._1o9o1p6i:has(:focus-visible){background-color:var(--ds-border-focused,#388bff)}
|
|
46
|
+
._1o9ovuon:has(:focus-visible){background-color:var(--ds-surface,#fff)}
|
|
33
47
|
._1peqidpf:after{opacity:0}
|
|
34
48
|
._1peqs237:after{opacity:var(--ds-opacity-disabled,.7)}
|
|
35
49
|
._1pfhv77o{margin-block-start:var(--ds-space-025,2px)}
|
|
@@ -52,6 +66,7 @@
|
|
|
52
66
|
._85i5ze3t{padding-block-end:var(--ds-space-0,0)}
|
|
53
67
|
._aetrf705:after{content:" "}
|
|
54
68
|
._ahbqv77o{margin-inline-start:var(--ds-space-025,2px)}
|
|
69
|
+
._bfhk1j28{background-color:transparent}
|
|
55
70
|
._bfhkcxp3{background-color:var(--avatar-bg-color)}
|
|
56
71
|
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
57
72
|
._eeh8kb7n:active:after{opacity:1}
|
|
@@ -59,14 +74,18 @@
|
|
|
59
74
|
._gcm1182g:active:after{background-color:var(--ds-interaction-pressed,rgba(9,30,66,.36))}
|
|
60
75
|
._kqswh2mm{position:relative}
|
|
61
76
|
._kqswpfqs{position:static}
|
|
77
|
+
._mkrz1kw7{clip-path:inherit}
|
|
78
|
+
._mkrz1nd3{clip-path:polygon(45% 1.33975%,46.5798% .60307%,48.26352% .15192%,50% 0,51.73648% .15192%,53.4202% .60307%,55% 1.33975%,92.64102% 21.33975%,94.06889% 22.33956%,95.30146% 23.57212%,96.30127% 25%,97.03794% 26.5798%,97.48909% 28.26352%,97.64102% 30%,97.64102% 70%,97.48909% 71.73648%,97.03794% 73.4202%,96.30127% 75%,95.30146% 76.42788%,94.06889% 77.66044%,92.64102% 78.66025%,55% 98.66025%,53.4202% 99.39693%,51.73648% 99.84808%,50% 100%,48.26352% 99.84808%,46.5798% 99.39693%,45% 98.66025%,7.35898% 78.66025%,5.93111% 77.66044%,4.69854% 76.42788%,3.69873% 75%,2.96206% 73.4202%,2.51091% 71.73648%,2.35898% 70%,2.35898% 30%,2.51091% 28.26352%,2.96206% 26.5798%,3.69873% 25%,4.69854% 23.57212%,5.93111% 22.33956%,7.35898% 21.33975%)}
|
|
62
79
|
._t9ec1aqe{transform:translateZ(0)}
|
|
63
80
|
._vchh1ntv{box-sizing:content-box}
|
|
64
81
|
._y4tize3t{padding-inline-end:var(--ds-space-0,0)}
|
|
65
82
|
._z0ai1osq:after{width:100%}
|
|
66
83
|
._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
84
|
+
._128midpf:focus-visible{outline-width:0}
|
|
67
85
|
._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
|
|
68
86
|
._1ejjglyw:focus-visible{box-shadow:none}
|
|
87
|
+
._1ejjn7od:focus-visible{box-shadow:unset}
|
|
69
88
|
._mizu194a:focus-visible{outline-color:var(--ds-border-focused,#2684ff)}
|
|
70
89
|
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
71
|
-
@media screen and (-ms-high-contrast:active),screen and (forced-colors:active){._4dave4h9:focus-visible{outline-width:var(--ds-border-width,1px)}}
|
|
90
|
+
@media screen and (-ms-high-contrast:active),screen and (forced-colors:active){._4dave4h9:focus-visible{outline-width:var(--ds-border-width,1px)}._4davidpf:focus-visible{outline-width:0}}
|
|
72
91
|
@media screen and (forced-colors:active){._jlxit94y:focus-visible{outline-width:1px}}
|
|
@@ -27,6 +27,9 @@ var styles = {
|
|
|
27
27
|
};
|
|
28
28
|
var unboundStyles = {
|
|
29
29
|
root: "_vchh1ntv _bfhkcxp3 _16qs1nhn",
|
|
30
|
+
hexagonFocusContainer: "_1rjcyvr3 _18zr1dm9 _1moult7l _bfhk1j28 _mkrz1nd3 _1o9o1p6i",
|
|
31
|
+
hexagonBorderContainer: "_1rjcf6hp _18zruxly _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
|
|
32
|
+
hexagon: "_2rkoidpf _mkrz1kw7 _16qsn7od _14mjidpf _1ejjn7od _128midpf _4davidpf",
|
|
30
33
|
interactive: "_80omtlke _4tpu1g4v _ez1ykb7n _gcm1182g _eeh8kb7n _jlxit94y"
|
|
31
34
|
};
|
|
32
35
|
var widthHeightMap = {
|
|
@@ -37,11 +40,19 @@ var widthHeightMap = {
|
|
|
37
40
|
xlarge: "_1bsb16xz _4t3i16xz",
|
|
38
41
|
xxlarge: "_1bsb1qr7 _4t3i1qr7"
|
|
39
42
|
};
|
|
43
|
+
var marginAdjustmentMap = {
|
|
44
|
+
xsmall: "_195gcwjc",
|
|
45
|
+
small: "_195gcwjc",
|
|
46
|
+
medium: "_195gs7t4",
|
|
47
|
+
large: "_195gs7t4",
|
|
48
|
+
xlarge: "_195g8ocb",
|
|
49
|
+
xxlarge: "_195g1ukp"
|
|
50
|
+
};
|
|
40
51
|
var borderRadiusMap = {
|
|
41
52
|
xsmall: "_2rkolb4i _14mjlb4i",
|
|
42
53
|
small: "_2rkolb4i _14mjlb4i",
|
|
43
|
-
medium: "
|
|
44
|
-
large: "
|
|
54
|
+
medium: "_2rko12b0 _14mj12b0",
|
|
55
|
+
large: "_2rko12b0 _14mj12b0",
|
|
45
56
|
xlarge: "_2rko1qi0 _14mj1qi0",
|
|
46
57
|
xxlarge: "_2rkopb1k _14mjpb1k"
|
|
47
58
|
};
|
|
@@ -75,7 +86,7 @@ var AvatarContent = exports.AvatarContent = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
75
86
|
size = _useAvatarContent.size,
|
|
76
87
|
stackIndex = _useAvatarContent.stackIndex;
|
|
77
88
|
var isInteractive = Boolean(onClick || href || isDisabled);
|
|
78
|
-
|
|
89
|
+
var renderedContent = /*#__PURE__*/React.createElement(Container, (0, _extends2.default)({
|
|
79
90
|
style: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, bgColorCssVar, borderColor), boxShadowCssVar, "0 0 0 2px ".concat(borderColor)),
|
|
80
91
|
ref: ref || contextRef,
|
|
81
92
|
"aria-label": isInteractive ? label : undefined,
|
|
@@ -89,6 +100,18 @@ var AvatarContent = exports.AvatarContent = /*#__PURE__*/(0, _react.forwardRef)(
|
|
|
89
100
|
target: target,
|
|
90
101
|
rel: target === '_blank' ? 'noopener noreferrer' : undefined
|
|
91
102
|
}, {
|
|
92
|
-
className: (0, _runtime.ax)([unboundStyles.root, styles.root, !(0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && borderRadiusMap[size], appearance === 'square' && (0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && styles.square, appearance === 'circle' && styles.circle, widthHeightMap[size], stackIndex !== undefined && styles.positionRelative, isInteractive && !isDisabled && unboundStyles.interactive, isDisabled && styles.disabled])
|
|
103
|
+
className: (0, _runtime.ax)([unboundStyles.root, styles.root, !(0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && borderRadiusMap[size], appearance === 'square' && (0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && styles.square, appearance === 'circle' && styles.circle, appearance === 'hexagon' && unboundStyles.hexagon, widthHeightMap[size], stackIndex !== undefined && styles.positionRelative, isInteractive && !isDisabled && unboundStyles.interactive, isDisabled && styles.disabled])
|
|
93
104
|
}), children || avatarImage);
|
|
105
|
+
if (appearance !== 'hexagon') {
|
|
106
|
+
return renderedContent;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// For a Hexagon Avatar in order to have hexagonal "border" and "outline", we have to
|
|
110
|
+
// layer multiple elements and use their background colors to create the different layers.
|
|
111
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
style: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, bgColorCssVar, borderColor), boxShadowCssVar, "0 0 0 2px ".concat(borderColor)),
|
|
113
|
+
className: (0, _runtime.ax)([unboundStyles.hexagonFocusContainer, marginAdjustmentMap[size]])
|
|
114
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
115
|
+
className: (0, _runtime.ax)([unboundStyles.hexagonBorderContainer])
|
|
116
|
+
}, renderedContent));
|
|
94
117
|
});
|
package/dist/cjs/avatar.js
CHANGED
|
@@ -58,8 +58,6 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
58
58
|
testId = _ref.testId,
|
|
59
59
|
_ref$as = _ref.as,
|
|
60
60
|
AvatarContainer = _ref$as === void 0 ? 'div' : _ref$as,
|
|
61
|
-
contentAs = _ref.contentAs,
|
|
62
|
-
containerRole = _ref.containerRole,
|
|
63
61
|
_ref$isDecorative = _ref.isDecorative,
|
|
64
62
|
isDecorative = _ref$isDecorative === void 0 ? false : _ref$isDecorative,
|
|
65
63
|
imgLoading = _ref.imgLoading;
|
|
@@ -117,12 +115,11 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
117
115
|
var defaultLabel = [name, isStatus && !customStatusNode && "(".concat(status, ")"), isPresence && !customPresenceNode && "(".concat(presence, ")")].filter(Boolean).join(' ');
|
|
118
116
|
var isInteractive = onClick || href || isDisabled;
|
|
119
117
|
var containerShouldBeImage = Boolean(!isInteractive && defaultLabel);
|
|
120
|
-
var avatarContainerRole = containerRole || (containerShouldBeImage ? 'img' : undefined);
|
|
121
118
|
return /*#__PURE__*/React.createElement(_context.EnsureIsInsideAvatarContext.Provider, {
|
|
122
119
|
value: true
|
|
123
120
|
}, /*#__PURE__*/React.createElement(AvatarContainer, {
|
|
124
121
|
"data-testid": testId,
|
|
125
|
-
role:
|
|
122
|
+
role: containerShouldBeImage ? 'img' : undefined,
|
|
126
123
|
"aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
|
|
127
124
|
style: {
|
|
128
125
|
zIndex: stackIndex
|
|
@@ -130,7 +127,7 @@ var Avatar = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
|
|
|
130
127
|
className: (0, _runtime.ax)(["_12ji1r31 _1qu2glyw _12y3idpf _1e0c1o8l _kqswh2mm"])
|
|
131
128
|
}, /*#__PURE__*/React.createElement(_context.AvatarContentContext.Provider, {
|
|
132
129
|
value: {
|
|
133
|
-
as:
|
|
130
|
+
as: (0, _utilities.getCustomElement)(isDisabled, href, onClick),
|
|
134
131
|
appearance: appearance,
|
|
135
132
|
borderColor: borderColor,
|
|
136
133
|
href: href,
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
._4t3i1osq{height:100%}
|
|
17
17
|
._bfhk1v33{background-color:var(--ds-background-accent-gray-subtler,#dcdfe4)}
|
|
18
18
|
._i0dl1osq{flex-basis:100%}
|
|
19
|
+
._mkrz1nd3{clip-path:polygon(45% 1.33975%,46.5798% .60307%,48.26352% .15192%,50% 0,51.73648% .15192%,53.4202% .60307%,55% 1.33975%,92.64102% 21.33975%,94.06889% 22.33956%,95.30146% 23.57212%,96.30127% 25%,97.03794% 26.5798%,97.48909% 28.26352%,97.64102% 30%,97.64102% 70%,97.48909% 71.73648%,97.03794% 73.4202%,96.30127% 75%,95.30146% 76.42788%,94.06889% 77.66044%,92.64102% 78.66025%,55% 98.66025%,53.4202% 99.39693%,51.73648% 99.84808%,50% 100%,48.26352% 99.84808%,46.5798% 99.39693%,45% 98.66025%,7.35898% 78.66025%,5.93111% 77.66044%,4.69854% 76.42788%,3.69873% 75%,2.96206% 73.4202%,2.51091% 71.73648%,2.35898% 70%,2.35898% 30%,2.51091% 28.26352%,2.96206% 26.5798%,3.69873% 25%,4.69854% 23.57212%,5.93111% 22.33956%,7.35898% 21.33975%)}
|
|
19
20
|
._w8l516xz svg{width:6pc}
|
|
20
21
|
._w8l51qr7 svg{width:8pc}
|
|
21
22
|
._w8l51tcg svg{width:24px}
|
|
@@ -12,13 +12,15 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
|
+
var _aiAgent = _interopRequireDefault(require("@atlaskit/icon/core/ai-agent"));
|
|
15
16
|
var _person = _interopRequireDefault(require("@atlaskit/icon/core/migration/person"));
|
|
16
17
|
var _releaseShip = _interopRequireDefault(require("@atlaskit/icon/core/migration/release--ship"));
|
|
17
18
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
18
19
|
var styles = {
|
|
19
20
|
image: "_16jlkb7n _1o9zkb7n _i0dl1osq _1e0c1txw _1bsb1osq _4t3i1osq",
|
|
20
21
|
icon: "_1e0c1txw _1bsb1osq _4t3i1osq _bfhk1v33",
|
|
21
|
-
circle: "_2rko1rr0"
|
|
22
|
+
circle: "_2rko1rr0",
|
|
23
|
+
hexagon: "_mkrz1nd3"
|
|
22
24
|
};
|
|
23
25
|
var borderRadiusMap = {
|
|
24
26
|
xsmall: "_2rkolb4i",
|
|
@@ -60,21 +62,39 @@ var AvatarImage = function AvatarImage(_ref) {
|
|
|
60
62
|
setHasImageErrored(false);
|
|
61
63
|
}, [src]);
|
|
62
64
|
if (!src || hasImageErrored) {
|
|
65
|
+
var renderedIcon;
|
|
66
|
+
switch (appearance) {
|
|
67
|
+
case 'circle':
|
|
68
|
+
renderedIcon = /*#__PURE__*/React.createElement(_person.default, {
|
|
69
|
+
label: alt,
|
|
70
|
+
color: "var(--ds-icon-subtle, #626F86)",
|
|
71
|
+
testId: testId && "".concat(testId, "--person"),
|
|
72
|
+
spacing: "spacious",
|
|
73
|
+
LEGACY_secondaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
74
|
+
});
|
|
75
|
+
break;
|
|
76
|
+
case 'hexagon':
|
|
77
|
+
renderedIcon = /*#__PURE__*/React.createElement(_aiAgent.default, {
|
|
78
|
+
label: alt,
|
|
79
|
+
color: "var(--ds-icon-subtle, #626F86)",
|
|
80
|
+
testId: testId && "".concat(testId, "--agent"),
|
|
81
|
+
spacing: "spacious"
|
|
82
|
+
});
|
|
83
|
+
break;
|
|
84
|
+
default: // historical default for safety
|
|
85
|
+
case 'square':
|
|
86
|
+
renderedIcon = /*#__PURE__*/React.createElement(_releaseShip.default, {
|
|
87
|
+
label: alt,
|
|
88
|
+
color: "var(--ds-icon-subtle, #626F86)",
|
|
89
|
+
testId: testId && "".concat(testId, "--ship"),
|
|
90
|
+
spacing: "spacious",
|
|
91
|
+
LEGACY_secondaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
92
|
+
});
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
63
95
|
return /*#__PURE__*/React.createElement("span", {
|
|
64
96
|
className: (0, _runtime.ax)([styles.icon, nestedSvgStylesMap[size]])
|
|
65
|
-
},
|
|
66
|
-
label: alt,
|
|
67
|
-
color: "var(--ds-icon-subtle, #626F86)",
|
|
68
|
-
testId: testId && "".concat(testId, "--person"),
|
|
69
|
-
spacing: "spacious",
|
|
70
|
-
LEGACY_secondaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
71
|
-
}) : /*#__PURE__*/React.createElement(_releaseShip.default, {
|
|
72
|
-
label: alt,
|
|
73
|
-
color: "var(--ds-icon-subtle, #626F86)",
|
|
74
|
-
testId: testId && "".concat(testId, "--ship"),
|
|
75
|
-
spacing: "spacious",
|
|
76
|
-
LEGACY_secondaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
77
|
-
}));
|
|
97
|
+
}, renderedIcon);
|
|
78
98
|
}
|
|
79
99
|
return /*#__PURE__*/React.createElement("img", {
|
|
80
100
|
loading: imgLoading,
|
|
@@ -87,7 +107,7 @@ var AvatarImage = function AvatarImage(_ref) {
|
|
|
87
107
|
"aria-hidden": !alt ? true : undefined,
|
|
88
108
|
"data-vc": testId ? "".concat(testId, "--image") : 'avatar-image',
|
|
89
109
|
"data-ssr-placeholder-ignored": true,
|
|
90
|
-
className: (0, _runtime.ax)([styles.image, borderRadiusMap[size], appearance === 'circle' && styles.circle])
|
|
110
|
+
className: (0, _runtime.ax)([styles.image, borderRadiusMap[size], appearance === 'circle' && styles.circle, appearance === 'hexagon' && styles.hexagon])
|
|
91
111
|
});
|
|
92
112
|
};
|
|
93
113
|
var _default = exports.default = AvatarImage;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
._1bsbdlk8{width:14px}
|
|
3
3
|
._1bsbf6fq{width:18px}
|
|
4
4
|
._1bsbo7ao{width:15px}
|
|
5
|
+
._1xi21lpd{right:-5px}
|
|
6
|
+
._1xi21n1a{right:-1px}
|
|
5
7
|
._1xi21v6z{right:7px}
|
|
6
8
|
._1xi2idpf{right:0}
|
|
7
9
|
._1xi2myb0{right:-4px}
|
|
@@ -10,8 +12,11 @@
|
|
|
10
12
|
._4t3idlk8{height:14px}
|
|
11
13
|
._4t3if6fq{height:18px}
|
|
12
14
|
._4t3io7ao{height:15px}
|
|
15
|
+
._94n51n1a{bottom:-1px}
|
|
13
16
|
._94n51v6z{bottom:7px}
|
|
17
|
+
._94n51y44{bottom:4px}
|
|
14
18
|
._94n5idpf{bottom:0}
|
|
19
|
+
._94n5l52n{bottom:17px}
|
|
15
20
|
._94n5myb0{bottom:-4px}
|
|
16
21
|
._94n5t94y{bottom:1px}
|
|
17
22
|
._kqswstnw{position:absolute}
|
package/dist/cjs/presence.js
CHANGED
|
@@ -86,13 +86,21 @@ var iconSizeMap = {
|
|
|
86
86
|
large: "_4t3io7ao _1bsbo7ao",
|
|
87
87
|
xlarge: "_4t3if6fq _1bsbf6fq"
|
|
88
88
|
};
|
|
89
|
-
var
|
|
90
|
-
square: "_94n5myb0 _1xi2myb0",
|
|
89
|
+
var circleIconOffsetMap = {
|
|
91
90
|
small: "_94n5idpf _1xi2idpf",
|
|
92
91
|
medium: "_94n5idpf _1xi2idpf",
|
|
93
92
|
large: "_94n5t94y _1xi2t94y",
|
|
94
93
|
xlarge: "_94n51v6z _1xi21v6z"
|
|
95
94
|
};
|
|
95
|
+
var squareIconOffsetMap = {
|
|
96
|
+
root: "_94n5myb0 _1xi2myb0"
|
|
97
|
+
};
|
|
98
|
+
var hexagonIconOffsetMap = {
|
|
99
|
+
small: "_94n51n1a _1xi21n1a",
|
|
100
|
+
medium: "_94n51n1a _1xi21n1a",
|
|
101
|
+
large: "_94n51y44 _1xi2myb0",
|
|
102
|
+
xlarge: "_94n5l52n _1xi21lpd"
|
|
103
|
+
};
|
|
96
104
|
|
|
97
105
|
/**
|
|
98
106
|
* __Presence wrapper__
|
|
@@ -109,7 +117,7 @@ var PresenceWrapper = exports.PresenceWrapper = function PresenceWrapper(_ref2)
|
|
|
109
117
|
return /*#__PURE__*/React.createElement("span", {
|
|
110
118
|
"aria-hidden": "true",
|
|
111
119
|
"data-testid": testId && "".concat(testId, "--presence"),
|
|
112
|
-
className: (0, _runtime.ax)([styles.root, iconSizeMap[size],
|
|
120
|
+
className: (0, _runtime.ax)([styles.root, iconSizeMap[size], circleIconOffsetMap[size], appearance === 'square' && squareIconOffsetMap.root, appearance === 'hexagon' && hexagonIconOffsetMap[size]])
|
|
113
121
|
}, /*#__PURE__*/React.createElement(AvatarPresence, {
|
|
114
122
|
borderColor: borderColor,
|
|
115
123
|
presence: !children ? presence : undefined
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
2
3
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
3
4
|
._2rko1qll{border-radius:var(--ds-radius-full,50%)}
|
|
4
|
-
._2rkofajl{border-radius:var(--ds-radius-small,3px)}
|
|
5
5
|
._2rkol0p1{border-radius:var(--ds-radius-tile,25%)}
|
|
6
6
|
._2rkolb4i{border-radius:var(--ds-radius-xsmall,2px)}
|
|
7
7
|
._2rkopb1k{border-radius:var(--ds-radius-xlarge,9pt)}._189e1dm9{border-width:var(--ds-border-width-selected,2px)}
|
|
@@ -21,5 +21,6 @@
|
|
|
21
21
|
._4t3i7vkz{height:1pc}
|
|
22
22
|
._4t3izwfg{height:2pc}
|
|
23
23
|
._bfhk1r8p{background-color:var(--avatar-skeleton-background-color)}
|
|
24
|
+
._mkrz1nd3{clip-path:polygon(45% 1.33975%,46.5798% .60307%,48.26352% .15192%,50% 0,51.73648% .15192%,53.4202% .60307%,55% 1.33975%,92.64102% 21.33975%,94.06889% 22.33956%,95.30146% 23.57212%,96.30127% 25%,97.03794% 26.5798%,97.48909% 28.26352%,97.64102% 30%,97.64102% 70%,97.48909% 71.73648%,97.03794% 73.4202%,96.30127% 75%,95.30146% 76.42788%,94.06889% 77.66044%,92.64102% 78.66025%,55% 98.66025%,53.4202% 99.39693%,51.73648% 99.84808%,50% 100%,48.26352% 99.84808%,46.5798% 99.39693%,45% 98.66025%,7.35898% 78.66025%,5.93111% 77.66044%,4.69854% 76.42788%,3.69873% 75%,2.96206% 73.4202%,2.51091% 71.73648%,2.35898% 70%,2.35898% 30%,2.51091% 28.26352%,2.96206% 26.5798%,3.69873% 25%,4.69854% 23.57212%,5.93111% 22.33956%,7.35898% 21.33975%)}
|
|
24
25
|
._tzy4clii{opacity:.3}
|
|
25
26
|
._tzy4nh7s{opacity:.15}
|
package/dist/cjs/skeleton.js
CHANGED
|
@@ -17,6 +17,7 @@ var bgColorCssVar = '--avatar-skeleton-background-color';
|
|
|
17
17
|
var styles = {
|
|
18
18
|
root: "_2rko1qll _189e1dm9 _1dqonqa1 _1h6d1j28 _1e0c1o8l _bfhk1r8p _tzy4nh7s",
|
|
19
19
|
square: "_2rkol0p1",
|
|
20
|
+
hexagon: "_mkrz1nd3",
|
|
20
21
|
strongOpacity: "_tzy4clii"
|
|
21
22
|
};
|
|
22
23
|
var sizeStyles = {
|
|
@@ -30,8 +31,8 @@ var sizeStyles = {
|
|
|
30
31
|
var borderRadiusMap = {
|
|
31
32
|
xsmall: "_2rkolb4i",
|
|
32
33
|
small: "_2rkolb4i",
|
|
33
|
-
medium: "
|
|
34
|
-
large: "
|
|
34
|
+
medium: "_2rko12b0",
|
|
35
|
+
large: "_2rko12b0",
|
|
35
36
|
xlarge: "_2rko1qi0",
|
|
36
37
|
xxlarge: "_2rkopb1k"
|
|
37
38
|
};
|
|
@@ -51,7 +52,7 @@ var Skeleton = function Skeleton(_ref) {
|
|
|
51
52
|
weight = _ref.weight;
|
|
52
53
|
return /*#__PURE__*/React.createElement("div", {
|
|
53
54
|
style: (0, _defineProperty2.default)({}, bgColorCssVar, color !== null && color !== void 0 ? color : 'currentColor'),
|
|
54
|
-
className: (0, _runtime.ax)([styles.root, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && !(0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && borderRadiusMap[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && (0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && styles.square, weight === 'strong' && styles.strongOpacity])
|
|
55
|
+
className: (0, _runtime.ax)([styles.root, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && !(0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && borderRadiusMap[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' && (0, _platformFeatureFlags.fg)('platform_dst_avatar_tile') && styles.square, appearance === 'hexagon' && styles.hexagon, weight === 'strong' && styles.strongOpacity])
|
|
55
56
|
});
|
|
56
57
|
};
|
|
57
58
|
var _default = exports.default = Skeleton;
|
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
.
|
|
2
|
-
.
|
|
3
|
-
.
|
|
1
|
+
._152t1n1a{inset-block-start:-1px}
|
|
2
|
+
._152t1v6z{inset-block-start:7px}
|
|
3
|
+
._152t1y44{inset-block-start:4px}
|
|
4
|
+
._152tidpf{inset-block-start:0}
|
|
5
|
+
._152tl52n{inset-block-start:17px}
|
|
6
|
+
._152tt94y{inset-block-start:1px}
|
|
4
7
|
._1bsb1crf{width:9pt}
|
|
5
8
|
._1bsbdlk8{width:14px}
|
|
6
9
|
._1bsbf6fq{width:18px}
|
|
7
10
|
._1bsbo7ao{width:15px}
|
|
8
|
-
._1xi21v6z{right:7px}
|
|
9
|
-
._1xi2idpf{right:0}
|
|
10
|
-
._1xi2t94y{right:1px}
|
|
11
11
|
._4t3i1crf{height:9pt}
|
|
12
12
|
._4t3idlk8{height:14px}
|
|
13
13
|
._4t3if6fq{height:18px}
|
|
14
14
|
._4t3io7ao{height:15px}
|
|
15
|
-
._kqswstnw{position:absolute}
|
|
15
|
+
._kqswstnw{position:absolute}
|
|
16
|
+
._rjxp1lpd{inset-inline-end:-5px}
|
|
17
|
+
._rjxp1n1a{inset-inline-end:-1px}
|
|
18
|
+
._rjxp1v6z{inset-inline-end:7px}
|
|
19
|
+
._rjxpidpf{inset-inline-end:0}
|
|
20
|
+
._rjxpmyb0{inset-inline-end:-4px}
|
|
21
|
+
._rjxpt94y{inset-inline-end:1px}
|
package/dist/cjs/status.js
CHANGED
|
@@ -23,12 +23,20 @@ var iconSizeMap = {
|
|
|
23
23
|
large: "_4t3io7ao _1bsbo7ao",
|
|
24
24
|
xlarge: "_4t3if6fq _1bsbf6fq"
|
|
25
25
|
};
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
var circleIconOffsetMap = {
|
|
27
|
+
small: "_rjxpidpf _152tidpf",
|
|
28
|
+
medium: "_rjxpidpf _152tidpf",
|
|
29
|
+
large: "_rjxpt94y _152tt94y",
|
|
30
|
+
xlarge: "_rjxp1v6z _152t1v6z"
|
|
31
|
+
};
|
|
32
|
+
var squareIconOffsetMap = {
|
|
33
|
+
root: "_rjxpidpf _152tidpf"
|
|
34
|
+
};
|
|
35
|
+
var hexagonIconOffsetMap = {
|
|
36
|
+
small: "_rjxp1n1a _152t1n1a",
|
|
37
|
+
medium: "_rjxp1n1a _152t1n1a",
|
|
38
|
+
large: "_rjxpmyb0 _152t1y44",
|
|
39
|
+
xlarge: "_rjxp1lpd _152tl52n"
|
|
32
40
|
};
|
|
33
41
|
var ApprovedIndicator = /*#__PURE__*/React.createElement(_react.Fragment, null, /*#__PURE__*/React.createElement("circle", {
|
|
34
42
|
fill: "var(--ds-icon-success, ".concat(_colors.G400, ")"),
|
|
@@ -106,7 +114,7 @@ var StatusWrapper = exports.StatusWrapper = function StatusWrapper(_ref2) {
|
|
|
106
114
|
return /*#__PURE__*/React.createElement("span", {
|
|
107
115
|
"aria-hidden": "true",
|
|
108
116
|
"data-testid": testId && "".concat(testId, "--status"),
|
|
109
|
-
className: (0, _runtime.ax)([styles.root, iconSizeMap[size],
|
|
117
|
+
className: (0, _runtime.ax)([styles.root, iconSizeMap[size], circleIconOffsetMap[size], appearance === 'square' && squareIconOffsetMap.root, appearance === 'hexagon' && hexagonIconOffsetMap[size]])
|
|
110
118
|
}, /*#__PURE__*/React.createElement(AvatarStatus, {
|
|
111
119
|
borderColor: borderColor,
|
|
112
120
|
status: !children ? status : undefined
|
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
._14mj12b0:after{border-radius:var(--ds-radius-small,4px)}
|
|
2
3
|
._14mj1qi0:after{border-radius:var(--ds-radius-medium,6px)}
|
|
3
4
|
._14mj1qll:after{border-radius:var(--ds-radius-full,50%)}
|
|
4
|
-
.
|
|
5
|
+
._14mjidpf:after{border-radius:0}
|
|
5
6
|
._14mjlb4i:after{border-radius:var(--ds-radius-xsmall,2px)}
|
|
6
7
|
._14mjpb1k:after{border-radius:var(--ds-radius-xlarge,9pt)}
|
|
7
8
|
._19itglyw{border:none}
|
|
9
|
+
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
8
10
|
._2rko1qi0{border-radius:var(--ds-radius-medium,6px)}
|
|
9
11
|
._2rko1qll{border-radius:var(--ds-radius-full,50%)}
|
|
10
|
-
.
|
|
12
|
+
._2rkoidpf{border-radius:0}
|
|
11
13
|
._2rkol0p1{border-radius:var(--ds-radius-tile,25%)}
|
|
12
14
|
._2rkolb4i{border-radius:var(--ds-radius-xsmall,2px)}
|
|
13
15
|
._2rkopb1k{border-radius:var(--ds-radius-xlarge,9pt)}
|
|
14
16
|
._9v7aze3t:after{inset:var(--ds-space-0,0)}
|
|
15
17
|
._qc5o1p41:after{transition:opacity .2s}
|
|
16
|
-
._v564ieh6{transition:transform .2s,opacity .2s}
|
|
18
|
+
._v564ieh6{transition:transform .2s,opacity .2s}
|
|
19
|
+
._18zr1dm9{padding-inline:var(--ds-border-width-selected,2px)}
|
|
20
|
+
._18zruxly{padding-inline:calc(var(--ds-border-width-selected, 2px)*.4)}
|
|
21
|
+
._195g1ukp{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 8px)}
|
|
22
|
+
._195g8ocb{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 4px)}
|
|
23
|
+
._195gcwjc{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 1px)}
|
|
24
|
+
._195gs7t4{margin-inline:calc(var(--ds-border-width-selected, 2px)*-1 - 2px)}
|
|
25
|
+
._1moult7l{margin-block:calc(var(--ds-border-width-selected, 2px)*1.22*-1)}
|
|
26
|
+
._1rjcf6hp{padding-block:calc(var(--ds-border-width-selected, 2px)*.5)}
|
|
27
|
+
._1rjcyvr3{padding-block:calc(var(--ds-border-width-selected, 2px)*1.22)}._11fnglyw:after{pointer-events:none}
|
|
17
28
|
._12ji1r31{outline-color:currentColor}
|
|
18
29
|
._12l2v77o{margin-inline-end:var(--ds-space-025,2px)}
|
|
19
30
|
._12y31o36{outline-width:medium}
|
|
20
31
|
._16qs1nhn{box-shadow:var(--avatar-box-shadow)}
|
|
32
|
+
._16qsn7od{box-shadow:unset}
|
|
21
33
|
._18m915vq{overflow-y:hidden}
|
|
22
34
|
._18postnw:after{position:absolute}
|
|
23
35
|
._1bah1h6o{justify-content:center}
|
|
@@ -30,6 +42,8 @@
|
|
|
30
42
|
._1e0c1txw{display:flex}
|
|
31
43
|
._1hfk1j28:after{background-color:transparent}
|
|
32
44
|
._1hfkvuon:after{background-color:var(--ds-surface,#fff)}
|
|
45
|
+
._1o9o1p6i:has(:focus-visible){background-color:var(--ds-border-focused,#388bff)}
|
|
46
|
+
._1o9ovuon:has(:focus-visible){background-color:var(--ds-surface,#fff)}
|
|
33
47
|
._1peqidpf:after{opacity:0}
|
|
34
48
|
._1peqs237:after{opacity:var(--ds-opacity-disabled,.7)}
|
|
35
49
|
._1pfhv77o{margin-block-start:var(--ds-space-025,2px)}
|
|
@@ -52,6 +66,7 @@
|
|
|
52
66
|
._85i5ze3t{padding-block-end:var(--ds-space-0,0)}
|
|
53
67
|
._aetrf705:after{content:" "}
|
|
54
68
|
._ahbqv77o{margin-inline-start:var(--ds-space-025,2px)}
|
|
69
|
+
._bfhk1j28{background-color:transparent}
|
|
55
70
|
._bfhkcxp3{background-color:var(--avatar-bg-color)}
|
|
56
71
|
._bozgze3t{padding-inline-start:var(--ds-space-0,0)}
|
|
57
72
|
._eeh8kb7n:active:after{opacity:1}
|
|
@@ -59,14 +74,18 @@
|
|
|
59
74
|
._gcm1182g:active:after{background-color:var(--ds-interaction-pressed,rgba(9,30,66,.36))}
|
|
60
75
|
._kqswh2mm{position:relative}
|
|
61
76
|
._kqswpfqs{position:static}
|
|
77
|
+
._mkrz1kw7{clip-path:inherit}
|
|
78
|
+
._mkrz1nd3{clip-path:polygon(45% 1.33975%,46.5798% .60307%,48.26352% .15192%,50% 0,51.73648% .15192%,53.4202% .60307%,55% 1.33975%,92.64102% 21.33975%,94.06889% 22.33956%,95.30146% 23.57212%,96.30127% 25%,97.03794% 26.5798%,97.48909% 28.26352%,97.64102% 30%,97.64102% 70%,97.48909% 71.73648%,97.03794% 73.4202%,96.30127% 75%,95.30146% 76.42788%,94.06889% 77.66044%,92.64102% 78.66025%,55% 98.66025%,53.4202% 99.39693%,51.73648% 99.84808%,50% 100%,48.26352% 99.84808%,46.5798% 99.39693%,45% 98.66025%,7.35898% 78.66025%,5.93111% 77.66044%,4.69854% 76.42788%,3.69873% 75%,2.96206% 73.4202%,2.51091% 71.73648%,2.35898% 70%,2.35898% 30%,2.51091% 28.26352%,2.96206% 26.5798%,3.69873% 25%,4.69854% 23.57212%,5.93111% 22.33956%,7.35898% 21.33975%)}
|
|
62
79
|
._t9ec1aqe{transform:translateZ(0)}
|
|
63
80
|
._vchh1ntv{box-sizing:content-box}
|
|
64
81
|
._y4tize3t{padding-inline-end:var(--ds-space-0,0)}
|
|
65
82
|
._z0ai1osq:after{width:100%}
|
|
66
83
|
._128mdkaa:focus-visible{outline-width:var(--ds-border-width-focused,2px)}
|
|
84
|
+
._128midpf:focus-visible{outline-width:0}
|
|
67
85
|
._1ah3v77o:focus-visible{outline-offset:var(--ds-space-025,2px)}
|
|
68
86
|
._1ejjglyw:focus-visible{box-shadow:none}
|
|
87
|
+
._1ejjn7od:focus-visible{box-shadow:unset}
|
|
69
88
|
._mizu194a:focus-visible{outline-color:var(--ds-border-focused,#2684ff)}
|
|
70
89
|
._ra3xnqa1:focus-visible{outline-style:solid}
|
|
71
|
-
@media screen and (-ms-high-contrast:active),screen and (forced-colors:active){._4dave4h9:focus-visible{outline-width:var(--ds-border-width,1px)}}
|
|
90
|
+
@media screen and (-ms-high-contrast:active),screen and (forced-colors:active){._4dave4h9:focus-visible{outline-width:var(--ds-border-width,1px)}._4davidpf:focus-visible{outline-width:0}}
|
|
72
91
|
@media screen and (forced-colors:active){._jlxit94y:focus-visible{outline-width:1px}}
|
|
@@ -17,6 +17,9 @@ const styles = {
|
|
|
17
17
|
};
|
|
18
18
|
const unboundStyles = {
|
|
19
19
|
root: "_vchh1ntv _bfhkcxp3 _16qs1nhn",
|
|
20
|
+
hexagonFocusContainer: "_1rjcyvr3 _18zr1dm9 _1moult7l _bfhk1j28 _mkrz1nd3 _1o9o1p6i",
|
|
21
|
+
hexagonBorderContainer: "_1rjcf6hp _18zruxly _bfhkcxp3 _mkrz1kw7 _1o9ovuon",
|
|
22
|
+
hexagon: "_2rkoidpf _mkrz1kw7 _16qsn7od _14mjidpf _1ejjn7od _128midpf _4davidpf",
|
|
20
23
|
interactive: "_80omtlke _4tpu1g4v _ez1ykb7n _gcm1182g _eeh8kb7n _jlxit94y"
|
|
21
24
|
};
|
|
22
25
|
const widthHeightMap = {
|
|
@@ -27,11 +30,19 @@ const widthHeightMap = {
|
|
|
27
30
|
xlarge: "_1bsb16xz _4t3i16xz",
|
|
28
31
|
xxlarge: "_1bsb1qr7 _4t3i1qr7"
|
|
29
32
|
};
|
|
33
|
+
const marginAdjustmentMap = {
|
|
34
|
+
xsmall: "_195gcwjc",
|
|
35
|
+
small: "_195gcwjc",
|
|
36
|
+
medium: "_195gs7t4",
|
|
37
|
+
large: "_195gs7t4",
|
|
38
|
+
xlarge: "_195g8ocb",
|
|
39
|
+
xxlarge: "_195g1ukp"
|
|
40
|
+
};
|
|
30
41
|
const borderRadiusMap = {
|
|
31
42
|
xsmall: "_2rkolb4i _14mjlb4i",
|
|
32
43
|
small: "_2rkolb4i _14mjlb4i",
|
|
33
|
-
medium: "
|
|
34
|
-
large: "
|
|
44
|
+
medium: "_2rko12b0 _14mj12b0",
|
|
45
|
+
large: "_2rko12b0 _14mj12b0",
|
|
35
46
|
xlarge: "_2rko1qi0 _14mj1qi0",
|
|
36
47
|
xxlarge: "_2rkopb1k _14mjpb1k"
|
|
37
48
|
};
|
|
@@ -66,7 +77,7 @@ export const AvatarContent = /*#__PURE__*/forwardRef(({
|
|
|
66
77
|
stackIndex
|
|
67
78
|
} = useAvatarContent();
|
|
68
79
|
const isInteractive = Boolean(onClick || href || isDisabled);
|
|
69
|
-
|
|
80
|
+
const renderedContent = /*#__PURE__*/React.createElement(Container, _extends({
|
|
70
81
|
style: {
|
|
71
82
|
[bgColorCssVar]: borderColor,
|
|
72
83
|
[boxShadowCssVar]: `0 0 0 2px ${borderColor}`
|
|
@@ -83,6 +94,21 @@ export const AvatarContent = /*#__PURE__*/forwardRef(({
|
|
|
83
94
|
target,
|
|
84
95
|
rel: target === '_blank' ? 'noopener noreferrer' : undefined
|
|
85
96
|
}, {
|
|
86
|
-
className: ax([unboundStyles.root, styles.root, !fg('platform_dst_avatar_tile') && borderRadiusMap[size], appearance === 'square' && fg('platform_dst_avatar_tile') && styles.square, appearance === 'circle' && styles.circle, widthHeightMap[size], stackIndex !== undefined && styles.positionRelative, isInteractive && !isDisabled && unboundStyles.interactive, isDisabled && styles.disabled])
|
|
97
|
+
className: ax([unboundStyles.root, styles.root, !fg('platform_dst_avatar_tile') && borderRadiusMap[size], appearance === 'square' && fg('platform_dst_avatar_tile') && styles.square, appearance === 'circle' && styles.circle, appearance === 'hexagon' && unboundStyles.hexagon, widthHeightMap[size], stackIndex !== undefined && styles.positionRelative, isInteractive && !isDisabled && unboundStyles.interactive, isDisabled && styles.disabled])
|
|
87
98
|
}), children || avatarImage);
|
|
99
|
+
if (appearance !== 'hexagon') {
|
|
100
|
+
return renderedContent;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// For a Hexagon Avatar in order to have hexagonal "border" and "outline", we have to
|
|
104
|
+
// layer multiple elements and use their background colors to create the different layers.
|
|
105
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
style: {
|
|
107
|
+
[bgColorCssVar]: borderColor,
|
|
108
|
+
[boxShadowCssVar]: `0 0 0 2px ${borderColor}`
|
|
109
|
+
},
|
|
110
|
+
className: ax([unboundStyles.hexagonFocusContainer, marginAdjustmentMap[size]])
|
|
111
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: ax([unboundStyles.hexagonBorderContainer])
|
|
113
|
+
}, renderedContent));
|
|
88
114
|
});
|
package/dist/es2019/avatar.js
CHANGED
|
@@ -44,8 +44,6 @@ const Avatar = /*#__PURE__*/forwardRef(({
|
|
|
44
44
|
target,
|
|
45
45
|
testId,
|
|
46
46
|
as: AvatarContainer = 'div',
|
|
47
|
-
contentAs,
|
|
48
|
-
containerRole,
|
|
49
47
|
isDecorative = false,
|
|
50
48
|
imgLoading
|
|
51
49
|
}, ref) => {
|
|
@@ -105,12 +103,11 @@ const Avatar = /*#__PURE__*/forwardRef(({
|
|
|
105
103
|
const defaultLabel = [name, isStatus && !customStatusNode && `(${status})`, isPresence && !customPresenceNode && `(${presence})`].filter(Boolean).join(' ');
|
|
106
104
|
const isInteractive = onClick || href || isDisabled;
|
|
107
105
|
const containerShouldBeImage = Boolean(!isInteractive && defaultLabel);
|
|
108
|
-
const avatarContainerRole = containerRole || (containerShouldBeImage ? 'img' : undefined);
|
|
109
106
|
return /*#__PURE__*/React.createElement(EnsureIsInsideAvatarContext.Provider, {
|
|
110
107
|
value: true
|
|
111
108
|
}, /*#__PURE__*/React.createElement(AvatarContainer, {
|
|
112
109
|
"data-testid": testId,
|
|
113
|
-
role:
|
|
110
|
+
role: containerShouldBeImage ? 'img' : undefined,
|
|
114
111
|
"aria-labelledby": containerShouldBeImage && !isDecorative ? labelId : undefined,
|
|
115
112
|
style: {
|
|
116
113
|
zIndex: stackIndex
|
|
@@ -118,7 +115,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
|
|
|
118
115
|
className: ax(["_12ji1r31 _1qu2glyw _12y3idpf _1e0c1o8l _kqswh2mm"])
|
|
119
116
|
}, /*#__PURE__*/React.createElement(AvatarContentContext.Provider, {
|
|
120
117
|
value: {
|
|
121
|
-
as:
|
|
118
|
+
as: getCustomElement(isDisabled, href, onClick),
|
|
122
119
|
appearance,
|
|
123
120
|
borderColor,
|
|
124
121
|
href,
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
._4t3i1osq{height:100%}
|
|
17
17
|
._bfhk1v33{background-color:var(--ds-background-accent-gray-subtler,#dcdfe4)}
|
|
18
18
|
._i0dl1osq{flex-basis:100%}
|
|
19
|
+
._mkrz1nd3{clip-path:polygon(45% 1.33975%,46.5798% .60307%,48.26352% .15192%,50% 0,51.73648% .15192%,53.4202% .60307%,55% 1.33975%,92.64102% 21.33975%,94.06889% 22.33956%,95.30146% 23.57212%,96.30127% 25%,97.03794% 26.5798%,97.48909% 28.26352%,97.64102% 30%,97.64102% 70%,97.48909% 71.73648%,97.03794% 73.4202%,96.30127% 75%,95.30146% 76.42788%,94.06889% 77.66044%,92.64102% 78.66025%,55% 98.66025%,53.4202% 99.39693%,51.73648% 99.84808%,50% 100%,48.26352% 99.84808%,46.5798% 99.39693%,45% 98.66025%,7.35898% 78.66025%,5.93111% 77.66044%,4.69854% 76.42788%,3.69873% 75%,2.96206% 73.4202%,2.51091% 71.73648%,2.35898% 70%,2.35898% 30%,2.51091% 28.26352%,2.96206% 26.5798%,3.69873% 25%,4.69854% 23.57212%,5.93111% 22.33956%,7.35898% 21.33975%)}
|
|
19
20
|
._w8l516xz svg{width:6pc}
|
|
20
21
|
._w8l51qr7 svg{width:8pc}
|
|
21
22
|
._w8l51tcg svg{width:24px}
|