@coinbase/cds-mobile 8.33.0 → 8.33.1

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.33.1 (12/19/2025 PST)
12
+
13
+ #### 🐞 Fixes
14
+
15
+ - Fix RemoteImageGroup zIndex and trailing space issue. [[#170](https://github.com/coinbase/cds/pull/170)]
16
+
11
17
  ## 8.33.0 (12/18/2025 PST)
12
18
 
13
19
  #### 🚀 Updates
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteImageGroup.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImageGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,wBAAwB,EACxB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAOpC,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;AAE9D,eAAO,MAAM,gBAAgB,GAAI,kDAO9B,qBAAqB,4CAqFvB,CAAC;AAQF,eAAO,MAAM,WAAW,0BAgBtB,CAAC"}
1
+ {"version":3,"file":"RemoteImageGroup.d.ts","sourceRoot":"","sources":["../../src/media/RemoteImageGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4C,MAAM,OAAO,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,KAAK,EACV,UAAU,EAEV,KAAK,EACL,wBAAwB,EACxB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAOpC,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;AAE9D,eAAO,MAAM,gBAAgB,GAAI,kDAO9B,qBAAqB,4CAqFvB,CAAC;AAQF,eAAO,MAAM,WAAW,0BAgBtB,CAAC"}
@@ -1,10 +1,10 @@
1
- import { useState } from 'react';
1
+ import { useMemo, useState } from 'react';
2
2
  import { assets } from '@coinbase/cds-common/internal/data/assets';
3
3
  import { useMultiSelect } from '@coinbase/cds-common/select/useMultiSelect';
4
4
  import { Example, ExampleScreen } from '../../../examples/ExampleScreen';
5
5
  import { HStack } from '../../../layout/HStack';
6
6
  import { VStack } from '../../../layout/VStack';
7
- import { RemoteImage } from '../../../media';
7
+ import { RemoteImage, RemoteImageGroup } from '../../../media';
8
8
  import { Text } from '../../../typography/Text';
9
9
  import { SelectChip } from '../SelectChip';
10
10
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -138,49 +138,58 @@ const assetImageMap = {
138
138
  ltc: assets.ltc.imageUrl,
139
139
  xrp: assets.xrp.imageUrl
140
140
  };
141
+ export const MultiSelectWithAssets = () => {
142
+ const exampleOptions = [{
143
+ value: 'btc',
144
+ label: assets.btc.name
145
+ }, {
146
+ value: 'eth',
147
+ label: assets.eth.name
148
+ }, {
149
+ value: 'dai',
150
+ label: assets.dai.name
151
+ }, {
152
+ value: 'ltc',
153
+ label: assets.ltc.name
154
+ }, {
155
+ value: 'xrp',
156
+ label: assets.xrp.name
157
+ }];
158
+ const {
159
+ value,
160
+ onChange
161
+ } = useMultiSelect({
162
+ initialValue: ['eth', 'btc']
163
+ });
141
164
 
142
- // TODO: Add multi-select with assets story when RemoteImageGroup is fixed
143
- // export const MultiSelectWithAssets = () => {
144
- // const exampleOptions = [
145
- // { value: 'btc', label: assets.btc.name },
146
- // { value: 'eth', label: assets.eth.name },
147
- // { value: 'dai', label: assets.dai.name },
148
- // { value: 'ltc', label: assets.ltc.name },
149
- // { value: 'xrp', label: assets.xrp.name },
150
- // ];
151
- // const { value, onChange } = useMultiSelect({
152
- // initialValue: ['eth', 'btc'],
153
- // });
154
-
155
- // // Get startNode based on selected assets
156
- // const startNode = useMemo(() => {
157
- // if (value.length === 0) return null;
158
-
159
- // // Multiple assets selected - use RemoteImageGroup
160
- // return (
161
- // <RemoteImageGroup shape="circle" size={24}>
162
- // {value.map((assetValue) => {
163
- // const imageUrl = assetImageMap[assetValue];
164
- // if (!imageUrl) return null;
165
- // return <RemoteImage key={assetValue} source={imageUrl} />;
166
- // })}
167
- // </RemoteImageGroup>
168
- // );
169
- // }, [value]);
170
-
171
- // return (
172
- // <SelectChip
173
- // accessibilityLabel="Select multiple assets"
174
- // onChange={onChange}
175
- // options={exampleOptions}
176
- // placeholder="Choose assets"
177
- // startNode={startNode}
178
- // type="multi"
179
- // value={value}
180
- // />
181
- // );
182
- // };
165
+ // Get startNode based on selected assets
166
+ const startNode = useMemo(() => {
167
+ if (value.length === 0) return null;
183
168
 
169
+ // Multiple assets selected - use RemoteImageGroup
170
+ return /*#__PURE__*/_jsx(RemoteImageGroup, {
171
+ shape: "circle",
172
+ size: 24,
173
+ children: value.map(assetValue => {
174
+ const imageUrl = assetImageMap[assetValue];
175
+ if (!imageUrl) return null;
176
+ return /*#__PURE__*/_jsx(RemoteImage, {
177
+ source: imageUrl
178
+ }, assetValue);
179
+ })
180
+ });
181
+ }, [value]);
182
+ return /*#__PURE__*/_jsx(SelectChip, {
183
+ accessibilityLabel: "Select multiple assets",
184
+ maxWidth: 400,
185
+ onChange: onChange,
186
+ options: exampleOptions,
187
+ placeholder: "Choose assets",
188
+ startNode: startNode,
189
+ type: "multi",
190
+ value: value
191
+ });
192
+ };
184
193
  export const InvertColorScheme = () => {
185
194
  const exampleOptions = [{
186
195
  value: '1',
@@ -544,6 +553,9 @@ const SelectChipScreen = () => {
544
553
  }), /*#__PURE__*/_jsx(Example, {
545
554
  title: "With Start End Nodes",
546
555
  children: /*#__PURE__*/_jsx(WithStartEndNodes, {})
556
+ }), /*#__PURE__*/_jsx(Example, {
557
+ title: "Multi-Select with Assets",
558
+ children: /*#__PURE__*/_jsx(MultiSelectWithAssets, {})
547
559
  }), /*#__PURE__*/_jsx(Example, {
548
560
  title: "Invert Color Scheme",
549
561
  children: /*#__PURE__*/_jsx(InvertColorScheme, {})
@@ -23,7 +23,7 @@ export const RemoteImageGroup = _ref => {
23
23
  } = useTheme();
24
24
  const shapeStyle = shapeStyles[shape];
25
25
  const sizeAsNumber = typeof size === 'number' ? size : avatarSize[size];
26
- const overlapSpacing = sizeAsNumber <= 40 ? 8 : 16;
26
+ const overlapSpacing = sizeAsNumber <= 40 ? -1 : -2;
27
27
  const excess = Children.count(children) - max;
28
28
  const groupChildren = useMemo(() => {
29
29
  const arrayChildren = Children.toArray(children);
@@ -63,7 +63,7 @@ export const RemoteImageGroup = _ref => {
63
63
  // zIndex is progressively lower so that each child is stacked below the previous one
64
64
  const zIndex = -index;
65
65
  return /*#__PURE__*/_jsx(Box, {
66
- left: index === 0 ? 'initial' : overlapSpacing * zIndex,
66
+ marginStart: index === 0 ? undefined : overlapSpacing,
67
67
  position: "relative",
68
68
  testID: (testID ? testID + "-" : '') + "inner-box-" + index,
69
69
  zIndex: zIndex,
@@ -74,7 +74,7 @@ export const RemoteImageGroup = _ref => {
74
74
  background: "bgOverlay",
75
75
  height: sizeAsNumber,
76
76
  justifyContent: "center",
77
- left: groupChildren.length * overlapSpacing * -1,
77
+ marginStart: overlapSpacing,
78
78
  position: "relative",
79
79
  style: shapeStyle,
80
80
  width: sizeAsNumber,
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { assets, squareAssets } from '@coinbase/cds-common/internal/data/assets';
3
2
  import { avatarSizes } from '@coinbase/cds-common/internal/data/avatars';
4
3
  import { Example, ExampleScreen } from '../../examples/ExampleScreen';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-mobile",
3
- "version": "8.33.0",
3
+ "version": "8.33.1",
4
4
  "description": "Coinbase Design System - Mobile",
5
5
  "repository": {
6
6
  "type": "git",
@@ -198,7 +198,7 @@
198
198
  "react-native-svg": "^14.1.0"
199
199
  },
200
200
  "dependencies": {
201
- "@coinbase/cds-common": "^8.33.0",
201
+ "@coinbase/cds-common": "^8.33.1",
202
202
  "@coinbase/cds-icons": "^5.8.0",
203
203
  "@coinbase/cds-illustrations": "^4.29.0",
204
204
  "@coinbase/cds-lottie-files": "^3.3.4",