@atlaskit/avatar 24.0.1 → 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.
Files changed (59) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/avatar-content.compiled.css +71 -0
  3. package/dist/cjs/avatar-content.js +32 -155
  4. package/dist/cjs/avatar-item.compiled.css +56 -0
  5. package/dist/cjs/avatar-item.js +27 -89
  6. package/dist/cjs/avatar.compiled.css +5 -0
  7. package/dist/cjs/avatar.js +20 -21
  8. package/dist/cjs/internal/avatar-image.compiled.css +25 -0
  9. package/dist/cjs/internal/avatar-image.js +48 -64
  10. package/dist/cjs/internal/icon-wrapper.compiled.css +13 -0
  11. package/dist/cjs/internal/icon-wrapper.js +18 -25
  12. package/dist/cjs/presence.compiled.css +18 -0
  13. package/dist/cjs/presence.js +32 -24
  14. package/dist/cjs/skeleton.compiled.css +24 -0
  15. package/dist/cjs/skeleton.js +36 -54
  16. package/dist/cjs/status.compiled.css +15 -0
  17. package/dist/cjs/status.js +31 -22
  18. package/dist/cjs/utilities.js +1 -14
  19. package/dist/es2019/avatar-content.compiled.css +71 -0
  20. package/dist/es2019/avatar-content.js +28 -153
  21. package/dist/es2019/avatar-item.compiled.css +56 -0
  22. package/dist/es2019/avatar-item.js +23 -87
  23. package/dist/es2019/avatar.compiled.css +5 -0
  24. package/dist/es2019/avatar.js +15 -22
  25. package/dist/es2019/internal/avatar-image.compiled.css +25 -0
  26. package/dist/es2019/internal/avatar-image.js +37 -54
  27. package/dist/es2019/internal/icon-wrapper.compiled.css +13 -0
  28. package/dist/es2019/internal/icon-wrapper.js +15 -24
  29. package/dist/es2019/presence.compiled.css +18 -0
  30. package/dist/es2019/presence.js +23 -15
  31. package/dist/es2019/skeleton.compiled.css +24 -0
  32. package/dist/es2019/skeleton.js +29 -51
  33. package/dist/es2019/status.compiled.css +15 -0
  34. package/dist/es2019/status.js +22 -13
  35. package/dist/es2019/utilities.js +0 -9
  36. package/dist/esm/avatar-content.compiled.css +71 -0
  37. package/dist/esm/avatar-content.js +28 -153
  38. package/dist/esm/avatar-item.compiled.css +56 -0
  39. package/dist/esm/avatar-item.js +23 -87
  40. package/dist/esm/avatar.compiled.css +5 -0
  41. package/dist/esm/avatar.js +15 -22
  42. package/dist/esm/internal/avatar-image.compiled.css +25 -0
  43. package/dist/esm/internal/avatar-image.js +44 -64
  44. package/dist/esm/internal/icon-wrapper.compiled.css +13 -0
  45. package/dist/esm/internal/icon-wrapper.js +15 -25
  46. package/dist/esm/presence.compiled.css +18 -0
  47. package/dist/esm/presence.js +23 -15
  48. package/dist/esm/skeleton.compiled.css +24 -0
  49. package/dist/esm/skeleton.js +33 -56
  50. package/dist/esm/status.compiled.css +15 -0
  51. package/dist/esm/status.js +22 -13
  52. package/dist/esm/utilities.js +0 -13
  53. package/dist/types/presence.d.ts +4 -0
  54. package/dist/types/status.d.ts +4 -0
  55. package/dist/types/utilities.d.ts +0 -9
  56. package/dist/types-ts4.5/presence.d.ts +4 -0
  57. package/dist/types-ts4.5/status.d.ts +4 -0
  58. package/dist/types-ts4.5/utilities.d.ts +0 -9
  59. package/package.json +13 -14
@@ -1,11 +1,8 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /* avatar.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./avatar.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
5
  import { forwardRef, isValidElement, useCallback, useEffect, useRef } from 'react';
6
-
7
- // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
8
- import { css, jsx } from '@emotion/react';
9
6
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
10
7
  import { useId } from '@atlaskit/ds-lib/use-id';
11
8
  import { AvatarContent } from './avatar-content';
@@ -15,12 +12,8 @@ import { PresenceWrapper } from './presence';
15
12
  import { StatusWrapper } from './status';
16
13
  import { getCustomElement } from './utilities';
17
14
  const packageName = "@atlaskit/avatar";
18
- const packageVersion = "24.0.1";
19
- const containerStyles = css({
20
- display: 'inline-block',
21
- position: 'relative',
22
- outline: 0
23
- });
15
+ const packageVersion = "25.0.0";
16
+ const containerStyles = null;
24
17
 
25
18
  // eslint-disable-next-line @repo/internal/react/consistent-types-definitions
26
19
 
@@ -108,17 +101,17 @@ const Avatar = /*#__PURE__*/forwardRef(({
108
101
  const defaultLabel = [name, isStatus && !customStatusNode && `(${status})`, isPresence && !customPresenceNode && `(${presence})`].filter(Boolean).join(' ');
109
102
  const isInteractive = onClick || href || isDisabled;
110
103
  const containerShouldBeImage = Boolean(!isInteractive && defaultLabel);
111
- return jsx(EnsureIsInsideAvatarContext.Provider, {
104
+ return /*#__PURE__*/React.createElement(EnsureIsInsideAvatarContext.Provider, {
112
105
  value: true
113
- }, jsx(AvatarContainer, {
106
+ }, /*#__PURE__*/React.createElement(AvatarContainer, {
114
107
  "data-testid": testId,
115
108
  role: containerShouldBeImage ? 'img' : undefined,
116
109
  "aria-labelledby": containerShouldBeImage ? labelId : undefined,
117
- css: containerStyles,
118
110
  style: {
119
111
  zIndex: stackIndex
120
- }
121
- }, jsx(AvatarContentContext.Provider, {
112
+ },
113
+ className: ax(["_12ji1r31 _1qu2glyw _12y3idpf _1e0c1o8l _kqswh2mm"])
114
+ }, /*#__PURE__*/React.createElement(AvatarContentContext.Provider, {
122
115
  value: {
123
116
  as: getCustomElement(isDisabled, href, onClick),
124
117
  appearance,
@@ -132,7 +125,7 @@ const Avatar = /*#__PURE__*/forwardRef(({
132
125
  stackIndex,
133
126
  target,
134
127
  testId: testId ? `${testId}--inner` : undefined,
135
- avatarImage: jsx(AvatarImage, {
128
+ avatarImage: /*#__PURE__*/React.createElement(AvatarImage, {
136
129
  alt: !containerShouldBeImage && src ? name : undefined,
137
130
  src: src,
138
131
  appearance: appearance,
@@ -140,18 +133,18 @@ const Avatar = /*#__PURE__*/forwardRef(({
140
133
  testId: testId
141
134
  })
142
135
  }
143
- }, children || jsx(AvatarContent, null)), isPresence && jsx(PresenceWrapper, {
136
+ }, children || /*#__PURE__*/React.createElement(AvatarContent, null)), isPresence && /*#__PURE__*/React.createElement(PresenceWrapper, {
144
137
  appearance: appearance,
145
138
  size: size,
146
139
  presence: typeof presence === 'string' ? presence : undefined,
147
140
  testId: testId
148
- }, customPresenceNode), isStatus && jsx(StatusWrapper, {
141
+ }, customPresenceNode), isStatus && /*#__PURE__*/React.createElement(StatusWrapper, {
149
142
  appearance: appearance,
150
143
  size: size,
151
144
  borderColor: borderColor,
152
145
  status: typeof status === 'string' ? status : undefined,
153
146
  testId: testId
154
- }, customStatusNode), containerShouldBeImage ? jsx("span", {
147
+ }, customStatusNode), containerShouldBeImage ? /*#__PURE__*/React.createElement("span", {
155
148
  "data-testid": testId && `${testId}--label`,
156
149
  id: labelId,
157
150
  hidden: true
@@ -0,0 +1,25 @@
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}._16jlkb7n{flex-grow:1}
7
+ ._175216xz svg{height:6pc}
8
+ ._17521qr7 svg{height:8pc}
9
+ ._17521tcg svg{height:24px}
10
+ ._17521ylp svg{height:40px}
11
+ ._17527vkz svg{height:1pc}
12
+ ._1752zwfg svg{height:2pc}
13
+ ._1bsb1osq{width:100%}
14
+ ._1e0c1txw{display:flex}
15
+ ._1o9zkb7n{flex-shrink:1}
16
+ ._4t3i1osq{height:100%}
17
+ ._bfhk1v33{background-color:var(--ds-background-accent-gray-subtler,#dcdfe4)}
18
+ ._bfhkr4aa{background-color:var(--ds-icon-subtle,#8993a4)}
19
+ ._i0dl1osq{flex-basis:100%}
20
+ ._w8l516xz svg{width:6pc}
21
+ ._w8l51qr7 svg{width:8pc}
22
+ ._w8l51tcg svg{width:24px}
23
+ ._w8l51ylp svg{width:40px}
24
+ ._w8l57vkz svg{width:1pc}
25
+ ._w8l5zwfg svg{width:2pc}
@@ -1,48 +1,37 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
1
+ /* avatar-image.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./avatar-image.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
5
  import { useEffect, useState } from 'react';
6
- import { css, jsx } from '@emotion/react';
7
6
  import PersonIconLegacy from '@atlaskit/icon/core/migration/person';
8
7
  import ReleaseIconMigration from '@atlaskit/icon/core/migration/release--ship';
9
8
  import PersonIcon from '@atlaskit/icon/core/person';
10
9
  import ReleaseIcon from '@atlaskit/icon/core/release';
11
10
  import { fg } from '@atlaskit/platform-feature-flags';
12
11
  import { N0, N90 } from '@atlaskit/theme/colors';
13
- import { AVATAR_RADIUS, AVATAR_SIZES } from '../constants';
14
- const avatarDefaultIconStyles = css({
15
- display: 'flex',
16
- width: '100%',
17
- height: '100%',
18
- backgroundColor: `var(--ds-icon-subtle, ${N90})`
19
- });
20
- const avatarDefaultIconVisualRefreshStyles = css({
21
- display: 'flex',
22
- width: '100%',
23
- height: '100%',
24
- backgroundColor: "var(--ds-background-accent-gray-subtler, #DCDFE4)"
25
- });
26
- const nestedAvatarStyles = Object.entries(AVATAR_SIZES).reduce((styles, [key, size]) => {
27
- return {
28
- ...styles,
29
- [key]: css({
30
- // eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
31
- '& svg': {
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
33
- width: `${size}px`,
34
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
35
- height: `${size}px`
36
- }
37
- })
38
- };
39
- }, {});
40
- const avatarImageStyles = css({
41
- display: 'flex',
42
- width: '100%',
43
- height: '100%',
44
- flex: '1 1 100%'
45
- });
12
+ const styles = {
13
+ image: "_16jlkb7n _1o9zkb7n _i0dl1osq _1e0c1txw _1bsb1osq _4t3i1osq",
14
+ icon: "_1e0c1txw _1bsb1osq _4t3i1osq",
15
+ iconBg: "_bfhkr4aa",
16
+ iconBGVisualRefresh: "_bfhk1v33",
17
+ circle: "_2rko1q5u"
18
+ };
19
+ const borderRadiusMap = {
20
+ xsmall: "_2rkogqwt",
21
+ small: "_2rkogqwt",
22
+ medium: "_2rko1l7b",
23
+ large: "_2rko1l7b",
24
+ xlarge: "_2rkoi2wt",
25
+ xxlarge: "_2rkob7nn"
26
+ };
27
+ const nestedSvgStylesMap = {
28
+ xsmall: "_w8l57vkz _17527vkz",
29
+ small: "_w8l51tcg _17521tcg",
30
+ medium: "_w8l5zwfg _1752zwfg",
31
+ large: "_w8l51ylp _17521ylp",
32
+ xlarge: "_w8l516xz _175216xz",
33
+ xxlarge: "_w8l51qr7 _17521qr7"
34
+ };
46
35
 
47
36
  /**
48
37
  * __Avatar image__
@@ -57,33 +46,31 @@ const AvatarImage = ({
57
46
  testId
58
47
  }) => {
59
48
  const [hasImageErrored, setHasImageErrored] = useState(false);
60
- const borderRadius = appearance === 'circle' ? '50%' : `${AVATAR_RADIUS[size]}px`;
61
- const isHidden = !alt ? true : undefined;
62
49
 
63
50
  // If src changes, reset state
64
51
  useEffect(() => {
65
52
  setHasImageErrored(false);
66
53
  }, [src]);
67
54
  if (!src || hasImageErrored) {
68
- return jsx("span", {
69
- css: [fg('platform-component-visual-refresh') ? avatarDefaultIconVisualRefreshStyles : avatarDefaultIconStyles, nestedAvatarStyles[size]]
70
- }, appearance === 'circle' ? fg('platform-component-visual-refresh') ? jsx(PersonIcon, {
55
+ return /*#__PURE__*/React.createElement("span", {
56
+ className: ax([styles.icon, fg('platform-component-visual-refresh') ? styles.iconBGVisualRefresh : styles.iconBg, nestedSvgStylesMap[size]])
57
+ }, appearance === 'circle' ? fg('platform-component-visual-refresh') ? /*#__PURE__*/React.createElement(PersonIcon, {
71
58
  label: alt,
72
59
  color: "var(--ds-icon-subtle, #626F86)",
73
60
  testId: testId && `${testId}--person`,
74
61
  spacing: "spacious"
75
- }) : jsx(PersonIconLegacy, {
62
+ }) : /*#__PURE__*/React.createElement(PersonIconLegacy, {
76
63
  label: alt,
77
64
  color: `var(--ds-icon-inverse, ${N0})`,
78
65
  LEGACY_secondaryColor: `var(--ds-icon-subtle, ${N90})`,
79
66
  testId: testId && `${testId}--person`,
80
67
  spacing: "spacious"
81
- }) : fg('platform-component-visual-refresh') ? jsx(ReleaseIcon, {
68
+ }) : fg('platform-component-visual-refresh') ? /*#__PURE__*/React.createElement(ReleaseIcon, {
82
69
  label: alt,
83
70
  color: "var(--ds-icon-subtle, #626F86)",
84
71
  testId: testId && `${testId}--ship`,
85
72
  spacing: "spacious"
86
- }) : jsx(ReleaseIconMigration, {
73
+ }) : /*#__PURE__*/React.createElement(ReleaseIconMigration, {
87
74
  label: alt,
88
75
  color: `var(--ds-icon-inverse, ${N0})`,
89
76
  LEGACY_secondaryColor: `var(--ds-icon-subtle, ${N90})`,
@@ -91,19 +78,15 @@ const AvatarImage = ({
91
78
  spacing: "spacious"
92
79
  }));
93
80
  }
94
- return jsx("img", {
81
+ return /*#__PURE__*/React.createElement("img", {
95
82
  src: src,
96
83
  alt: alt,
97
84
  "data-testid": testId && `${testId}--image`,
98
- css: avatarImageStyles,
99
- style: {
100
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
101
- borderRadius: borderRadius
102
- },
103
85
  onError: () => setHasImageErrored(true),
104
- "aria-hidden": isHidden,
86
+ "aria-hidden": !alt ? true : undefined,
105
87
  "data-vc": testId ? `${testId}--image` : 'avatar-image',
106
- "data-ssr-placeholder-ignored": true
88
+ "data-ssr-placeholder-ignored": true,
89
+ className: ax([styles.image, borderRadiusMap[size], appearance === 'circle' && styles.circle])
107
90
  });
108
91
  };
109
92
  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
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- import { css, jsx } from '@emotion/react';
7
- import { N0 } from '@atlaskit/theme/colors';
8
- import { BORDER_WIDTH } from '../constants';
9
- const iconWrapperStyles = css({
10
- display: 'flex',
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
+ const styles = {
6
+ root: "_2rko1q5u _1reo15vq _18m915vq _189e1bk5 _1dqonqa1 _1e0c1txw _vchhusvi _1bsb1osq _4t3i1osq _4cvr1h6o _ae4v1h6o _bfhk1bhr"
7
+ };
8
+ const unboundStyles = {
9
+ root: "_1h6d1bhr"
10
+ };
19
11
 
20
12
  /**
21
13
  * __Icon wrapper__
@@ -23,15 +15,14 @@ const iconWrapperStyles = css({
23
15
  * An icon wrapper is used internally only.
24
16
  */
25
17
  const IconWrapper = ({
26
- bgColor = `var(--ds-surface-overlay, ${N0})`,
18
+ bgColor,
27
19
  children
28
- }) => jsx("span", {
29
- css: iconWrapperStyles,
20
+ }) => /*#__PURE__*/React.createElement("span", {
30
21
  role: "presentation",
31
22
  style: {
32
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
33
- border: `${BORDER_WIDTH}px solid ${bgColor}`,
23
+ borderColor: bgColor,
34
24
  backgroundColor: bgColor
35
- }
25
+ },
26
+ className: ax([styles.root, unboundStyles.root])
36
27
  }, children);
37
28
  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}
@@ -1,6 +1,9 @@
1
- import React, { Fragment } from 'react';
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
  const BusyIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
6
9
  fill: `var(--ds-icon-danger, ${R300})`,
@@ -64,6 +67,23 @@ const AvatarPresence = ({
64
67
  xmlns: "http://www.w3.org/2000/svg"
65
68
  }, getPresence(presence)) : children);
66
69
  export default AvatarPresence;
70
+ const styles = {
71
+ root: "_kqswstnw _lcxvglyw"
72
+ };
73
+ const iconSizeMap = {
74
+ small: "_4t3i1crf _1bsb1crf",
75
+ medium: "_4t3idlk8 _1bsbdlk8",
76
+ large: "_4t3io7ao _1bsbo7ao",
77
+ xlarge: "_4t3if6fq _1bsbf6fq"
78
+ };
79
+ const iconOffsetMap = {
80
+ square: "_94n5myb0 _1xi2myb0",
81
+ small: "_94n5idpf _1xi2idpf",
82
+ medium: "_94n5idpf _1xi2idpf",
83
+ large: "_94n5t94y _1xi2t94y",
84
+ xlarge: "_94n51v6z _1xi21v6z"
85
+ };
86
+
67
87
  /**
68
88
  * __Presence wrapper__
69
89
  *
@@ -77,22 +97,10 @@ export const PresenceWrapper = ({
77
97
  presence,
78
98
  testId
79
99
  }) => {
80
- const position = appearance === 'square' ? -4 : ICON_OFFSET[size];
81
100
  return /*#__PURE__*/React.createElement("span", {
82
101
  "aria-hidden": "true",
83
102
  "data-testid": testId && `${testId}--presence`,
84
- style: {
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: `${position}px`,
90
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
91
- height: `${ICON_SIZES[size]}px`,
92
- right: `${position}px`,
93
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
94
- width: `${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}
@@ -1,46 +1,28 @@
1
- /**
2
- * @jsxRuntime classic
3
- * @jsx jsx
4
- */
5
-
6
- import { css, jsx } from '@emotion/react';
7
- import { AVATAR_RADIUS, AVATAR_SIZES, BORDER_WIDTH, CSS_VAR_AVATAR_BGCOLOR } from './constants';
8
- const skeletonStyles = css({
9
- display: 'inline-block',
10
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
11
- backgroundColor: `var(${CSS_VAR_AVATAR_BGCOLOR})`,
12
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
13
- border: `${BORDER_WIDTH}px solid transparent`
14
- });
15
- const sizeStyles = Object.entries(AVATAR_SIZES).reduce((styles, [key, size]) => {
16
- return {
17
- ...styles,
18
- [key]: css({
19
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
20
- width: `${size}px`,
21
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
22
- height: `${size}px`
23
- })
24
- };
25
- }, {});
26
- const radiusStyles = Object.entries(AVATAR_RADIUS).reduce((styles, [key, size]) => {
27
- return {
28
- ...styles,
29
- [key]: css({
30
- // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
31
- borderRadius: `${size}px`
32
- })
33
- };
34
- }, {});
35
- const defaultRadiusStyles = css({
36
- borderRadius: "var(--ds-border-radius-circle, 50%)"
37
- });
38
- const strongOpacityStyles = css({
39
- opacity: 0.3
40
- });
41
- const defaultOpacityStyles = css({
42
- opacity: 0.15
43
- });
1
+ /* skeleton.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import "./skeleton.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ const bgColorCssVar = '--avatar-skeleton-background-color';
6
+ const styles = {
7
+ root: "_2rko1q5u _189e1bk5 _1dqonqa1 _1h6d1j28 _1e0c1o8l _bfhk1r8p _tzy4nh7s",
8
+ strongOpacity: "_tzy4clii"
9
+ };
10
+ const sizeStyles = {
11
+ xsmall: "_1bsb7vkz _4t3i7vkz",
12
+ small: "_1bsb1tcg _4t3i1tcg",
13
+ medium: "_1bsbzwfg _4t3izwfg",
14
+ large: "_1bsb1ylp _4t3i1ylp",
15
+ xlarge: "_1bsb16xz _4t3i16xz",
16
+ xxlarge: "_1bsb1qr7 _4t3i1qr7"
17
+ };
18
+ const borderRadiusMap = {
19
+ xsmall: "_2rkogqwt",
20
+ small: "_2rkogqwt",
21
+ medium: "_2rko1l7b",
22
+ large: "_2rko1l7b",
23
+ xlarge: "_2rkoi2wt",
24
+ xxlarge: "_2rkob7nn"
25
+ };
44
26
 
45
27
  /**
46
28
  * __Skeleton__
@@ -55,14 +37,10 @@ const Skeleton = ({
55
37
  appearance,
56
38
  color,
57
39
  weight
58
- }) => jsx("div", {
59
- css: [skeletonStyles, sizeStyles[size !== null && size !== void 0 ? size : 'medium'], appearance === 'square' ? radiusStyles[size !== null && size !== void 0 ? size : 'medium'] : defaultRadiusStyles, weight === 'strong' ? strongOpacityStyles : defaultOpacityStyles]
60
- // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
61
- ,
40
+ }) => /*#__PURE__*/React.createElement("div", {
62
41
  style: {
63
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
64
- [CSS_VAR_AVATAR_BGCOLOR]: color !== null && color !== void 0 ? color : 'currentColor'
65
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
66
- }
42
+ [bgColorCssVar]: color !== null && color !== void 0 ? color : 'currentColor'
43
+ },
44
+ 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
45
  });
68
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}
@@ -1,7 +1,26 @@
1
- import React, { Fragment } from 'react';
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
+ const styles = {
9
+ root: "_kqswstnw"
10
+ };
11
+ const iconSizeMap = {
12
+ small: "_4t3i1crf _1bsb1crf",
13
+ medium: "_4t3idlk8 _1bsbdlk8",
14
+ large: "_4t3io7ao _1bsbo7ao",
15
+ xlarge: "_4t3if6fq _1bsbf6fq"
16
+ };
17
+ const iconOffsetMap = {
18
+ square: "_1xi2idpf _154iidpf",
19
+ small: "_1xi2idpf _154iidpf",
20
+ medium: "_1xi2idpf _154iidpf",
21
+ large: "_1xi2t94y _154it94y",
22
+ xlarge: "_1xi21v6z _154i1v6z"
23
+ };
5
24
  const ApprovedIndicator = /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("circle", {
6
25
  fill: `var(--ds-icon-success, ${G400})`,
7
26
  cx: "4",
@@ -75,20 +94,10 @@ export const StatusWrapper = ({
75
94
  children,
76
95
  testId
77
96
  }) => {
78
- const position = appearance === 'square' ? 0 : ICON_OFFSET[size];
79
97
  return /*#__PURE__*/React.createElement("span", {
80
98
  "aria-hidden": "true",
81
99
  "data-testid": testId && `${testId}--status`,
82
- style: {
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: `${ICON_SIZES[size]}px`,
87
- right: `${position}px`,
88
- top: `${position}px`,
89
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
90
- width: `${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
@@ -1,12 +1,3 @@
1
- export const getLinkProps = (href, target) => ({
2
- href,
3
- rel: target === '_blank' ? 'noopener noreferrer' : null,
4
- target
5
- });
6
- export const getButtonProps = onClick => ({
7
- type: 'button',
8
- onClick
9
- });
10
1
  export const getCustomElement = (isDisabled, href, onClick) => {
11
2
  if (href && !isDisabled) {
12
3
  return 'a';