@coinbase/cds-web 8.21.1 → 8.21.2

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 CHANGED
@@ -8,6 +8,12 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 8.21.2 (11/13/2025 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Uniform flex alignment for all Avatar variants. [[#162](https://github.com/coinbase/cds/pull/162)] [DX-4991]
16
+
11
17
  ## 8.21.1 (11/13/2025 PST)
12
18
 
13
19
  #### 🐞 Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"Avatar.d.ts","sourceRoot":"","sources":["../../src/media/Avatar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAIhG,OAAO,EAAO,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAM3E,eAAO,MAAM,gBAAgB,4iDAC8gD,CAAC;AAoF5iD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,iIAAiI;IACjI,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,+BAA+B;IAC/B,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,kCAAkC;IAClC,WAAW,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC;IAC9B;;;OAGG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,oGAAoG;IACpG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,QAAQ,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AEF,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAExE,eAAO,MAAM,MAAM,0JAed,WAAW,6CAqHf,CAAC"}
@@ -2,4 +2,5 @@
2
2
  .avatarCss-arpga7l{overflow:hidden;border:solid 1px var(--avatar-borderColor);}.avatarCss-arpga7l[data-bordered='true']{border-width:2px;}.avatarCss-arpga7l[data-selected='true']{box-shadow:0 0 0 2px currentColor;}.avatarCss-arpga7l[data-shape='hexagon']{border:none;box-shadow:none;-webkit-clip-path:url(#cds-hexagon-avatar-clipper);clip-path:url(#cds-hexagon-avatar-clipper);}
3
3
  .circle-cfv7qmm{border-radius:100%;}
4
4
  .square-s917yqm{border-radius:4px;}
5
- .hexagon-hsci9wn{border-radius:0;}}
5
+ .hexagon-hsci9wn{border-radius:0;}
6
+ .contentWrapperCss-ck6a13w{position:absolute;top:0;right:0;bottom:0;left:0;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;}}
@@ -21,6 +21,7 @@ const borderRadiusCss = {
21
21
  square: "square-s917yqm",
22
22
  hexagon: "hexagon-hsci9wn"
23
23
  };
24
+ const contentWrapperCss = "contentWrapperCss-ck6a13w";
24
25
  export const Avatar = /*#__PURE__*/memo(_ref => {
25
26
  var _ref2, _style$width;
26
27
  let {
@@ -75,6 +76,10 @@ export const Avatar = /*#__PURE__*/memo(_ref => {
75
76
  });
76
77
  }, [name, size, dangerouslySetSize]);
77
78
  const shouldShowBorder = Boolean((src || !name) && borderColor);
79
+ const dimensionProps = useMemo(() => ({
80
+ width: computedSize,
81
+ height: computedSize
82
+ }), [computedSize]);
78
83
  const avatarInlineStyles = useMemo(() => _objectSpread({
79
84
  width: computedSize,
80
85
  height: computedSize,
@@ -90,31 +95,30 @@ export const Avatar = /*#__PURE__*/memo(_ref => {
90
95
  testID: "".concat(testID, "-wrapper")
91
96
  }, props), {}, {
92
97
  children: [/*#__PURE__*/_jsx(Box, {
93
- alignItems: "center",
94
98
  className: cx(avatarCss, borderRadiusCss[shape], className),
95
99
  "data-bordered": shouldShowBorder,
96
100
  "data-selected": selected,
97
101
  "data-shape": shape,
98
102
  flexGrow: 0,
99
103
  flexShrink: 0,
100
- justifyContent: "center",
104
+ position: "relative",
101
105
  style: avatarInlineStyles,
102
106
  testID: testID,
103
- children: !!src || !name ? /*#__PURE__*/_jsx(RemoteImage, {
104
- alt: alt,
105
- height: computedSize,
106
- shape: shape,
107
- source: src || fallbackImageSrc,
108
- width: computedSize
109
- }) : /*#__PURE__*/_jsx(Box, {
110
- alignItems: "center",
111
- background: "currentColor",
112
- className: borderRadiusCss[shape],
113
- flexGrow: 1,
114
- height: "100%",
115
- justifyContent: "center",
116
- testID: "".concat(testID, "-fallback"),
117
- children: avatarText
107
+ children: /*#__PURE__*/_jsx(Box, {
108
+ className: contentWrapperCss,
109
+ children: !!src || !name ? /*#__PURE__*/_jsx(RemoteImage, _objectSpread(_objectSpread({}, dimensionProps), {}, {
110
+ alt: alt,
111
+ shape: shape,
112
+ source: src || fallbackImageSrc
113
+ })) : /*#__PURE__*/_jsx(Box, _objectSpread(_objectSpread({}, dimensionProps), {}, {
114
+ alignItems: "center",
115
+ background: "currentColor",
116
+ className: borderRadiusCss[shape],
117
+ justifyContent: "center",
118
+ position: "relative",
119
+ testID: "".concat(testID, "-fallback"),
120
+ children: avatarText
121
+ }))
118
122
  })
119
123
  }), shape === 'hexagon' && selected && /*#__PURE__*/_jsx(HexagonBorder, {
120
124
  offset: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-web",
3
- "version": "8.21.1",
3
+ "version": "8.21.2",
4
4
  "description": "Coinbase Design System - Web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -147,9 +147,9 @@
147
147
  "react-dom": "^18.3.1"
148
148
  },
149
149
  "dependencies": {
150
- "@coinbase/cds-common": "^8.21.1",
151
- "@coinbase/cds-icons": "^5.5.1",
152
- "@coinbase/cds-illustrations": "^4.26.1",
150
+ "@coinbase/cds-common": "^8.21.2",
151
+ "@coinbase/cds-icons": "^5.6.0",
152
+ "@coinbase/cds-illustrations": "^4.27.0",
153
153
  "@coinbase/cds-lottie-files": "^3.3.3",
154
154
  "@coinbase/cds-utils": "^2.3.4",
155
155
  "@floating-ui/react-dom": "^2.1.1",