@coinbase/cds-web 8.34.2 → 8.35.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 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.35.0 (1/5/2026 PST)
12
+
13
+ #### 🚀 Updates
14
+
15
+ - Add border props to RemoteImageGroup.
16
+
11
17
  ## 8.34.2 (1/2/2026 PST)
12
18
 
13
19
  #### 🐞 Fixes
@@ -5,8 +5,10 @@ import type {
5
5
  SharedAccessibilityProps,
6
6
  SharedProps,
7
7
  } from '@coinbase/cds-common/types';
8
+ import { type BoxDefaultElement, type BoxProps } from '../layout/Box';
8
9
  export type RemoteImageGroupBaseProps = SharedProps &
9
- SharedAccessibilityProps & {
10
+ SharedAccessibilityProps &
11
+ Pick<BoxProps<BoxDefaultElement>, 'borderWidth' | 'borderColor'> & {
10
12
  /**
11
13
  * Indicates the number of remote image before it collapses
12
14
  * @default 4
@@ -32,6 +34,8 @@ export declare const RemoteImageGroup: ({
32
34
  max,
33
35
  shape,
34
36
  testID,
37
+ borderWidth,
38
+ borderColor,
35
39
  ...props
36
40
  }: RemoteImageGroupProps) => import('react/jsx-runtime').JSX.Element;
37
41
  //# sourceMappingURL=RemoteImageGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteImageGroup.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImageGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EACV,UAAU,EAGV,KAAK,EACL,wBAAwB,EACxB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AASpC,MAAM,MAAM,yBAAyB,GAAG,WAAW,GACjD,wBAAwB,GAAG;IACzB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,uBAAuB;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AAwB9D,eAAO,MAAM,gBAAgB,GAAI,kDAO9B,qBAAqB,4CAgFvB,CAAC"}
1
+ {"version":3,"file":"RemoteImageGroup.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImageGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AACjE,OAAO,KAAK,EACV,UAAU,EAGV,KAAK,EACL,wBAAwB,EACxB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAKpC,OAAO,EAAO,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAK3E,MAAM,MAAM,yBAAyB,GAAG,WAAW,GACjD,wBAAwB,GACxB,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,aAAa,GAAG,aAAa,CAAC,GAAG;IACjE;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CAAC;IAC3B;;;OAGG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,uBAAuB;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEJ,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC;AA4B9D,eAAO,MAAM,gBAAgB,GAAI,4EAS9B,qBAAqB,4CAwFvB,CAAC"}
@@ -3,4 +3,5 @@
3
3
  .hexagon-h112niag{border-radius:0;}
4
4
  .squircle-s8clfq8{border-radius:8px;}
5
5
  .rectangle-ra2rof2{border-radius:0;}
6
- .isolateCss-i1shf7o1{isolation:isolate;}}
6
+ .isolateCss-i1shf7o1{isolation:isolate;}
7
+ .excessContainerCss-e1lnj2ws{box-sizing:content-box;}}
@@ -1,4 +1,4 @@
1
- const _excluded = ["children", "size", "max", "shape", "testID"];
1
+ const _excluded = ["children", "size", "max", "shape", "testID", "borderWidth", "borderColor"];
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -7,6 +7,7 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
7
7
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
8
8
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
9
9
  import React, { Children, isValidElement, useMemo } from 'react';
10
+ import { cx } from '../cx';
10
11
  import { useTheme } from '../hooks/useTheme';
11
12
  import { Box } from '../layout/Box';
12
13
  import { Text } from '../typography/Text';
@@ -19,19 +20,21 @@ const borderRadiusCss = {
19
20
  rectangle: "rectangle-ra2rof2"
20
21
  };
21
22
  const isolateCss = "isolateCss-i1shf7o1";
23
+ const excessContainerCss = "excessContainerCss-e1lnj2ws";
22
24
  export const RemoteImageGroup = _ref => {
23
25
  let {
24
26
  children,
25
27
  size = 'm',
26
28
  max = 4,
27
29
  shape = 'circle',
28
- testID
30
+ testID,
31
+ borderWidth,
32
+ borderColor = borderWidth ? 'bg' : undefined
29
33
  } = _ref,
30
34
  props = _objectWithoutProperties(_ref, _excluded);
31
35
  const {
32
36
  avatarSize
33
37
  } = useTheme();
34
- const borderRadius = borderRadiusCss[shape];
35
38
  const sizeAsNumber = typeof size === 'number' ? size : avatarSize[size];
36
39
  const overlapSpacing = sizeAsNumber <= 40 ? -1 : -2;
37
40
  const excess = Children.count(children) - max;
@@ -54,18 +57,23 @@ export const RemoteImageGroup = _ref => {
54
57
  if (! /*#__PURE__*/isValidElement(child)) {
55
58
  return null;
56
59
  }
60
+ const childShape = child.props.shape;
57
61
 
58
62
  // dynamically apply uniform sizing and shape to all RemoteImage children elements
59
63
  const clonedChild = /*#__PURE__*/React.cloneElement(child, _objectSpread({
60
64
  width: sizeAsNumber,
61
65
  height: sizeAsNumber
62
- }, child.props.shape ? undefined : {
66
+ }, childShape ? undefined : {
63
67
  shape
64
68
  }));
65
69
 
66
70
  // zIndex is progressively lower so that each child is stacked below the previous one
67
71
  const zIndex = -index;
72
+ const childContainerCss = borderWidth ? borderRadiusCss[childShape !== null && childShape !== void 0 ? childShape : shape] : undefined;
68
73
  return /*#__PURE__*/_jsx(Box, {
74
+ borderColor: borderColor,
75
+ borderWidth: borderWidth,
76
+ className: childContainerCss,
69
77
  marginStart: index === 0 ? undefined : overlapSpacing,
70
78
  position: "relative",
71
79
  testID: "".concat(testID ? "".concat(testID, "-") : '', "inner-box-").concat(index),
@@ -75,7 +83,9 @@ export const RemoteImageGroup = _ref => {
75
83
  }), excess > 0 && /*#__PURE__*/_jsx(Box, {
76
84
  alignItems: "center",
77
85
  background: "bgOverlay",
78
- className: borderRadius,
86
+ borderColor: borderColor,
87
+ borderWidth: borderWidth,
88
+ className: cx(excessContainerCss, borderRadiusCss[shape]),
79
89
  height: sizeAsNumber,
80
90
  justifyContent: "center",
81
91
  marginStart: overlapSpacing,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-web",
3
- "version": "8.34.2",
3
+ "version": "8.35.0",
4
4
  "description": "Coinbase Design System - Web",
5
5
  "repository": {
6
6
  "type": "git",
@@ -203,7 +203,7 @@
203
203
  "react-dom": "^18.3.1"
204
204
  },
205
205
  "dependencies": {
206
- "@coinbase/cds-common": "^8.34.2",
206
+ "@coinbase/cds-common": "^8.35.0",
207
207
  "@coinbase/cds-icons": "^5.9.0",
208
208
  "@coinbase/cds-illustrations": "^4.29.0",
209
209
  "@coinbase/cds-lottie-files": "^3.3.4",