@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
|
@@ -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;
|
|
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"}
|
|
@@ -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
|
-
},
|
|
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
|
-
|
|
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.
|
|
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.
|
|
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",
|