@coinbase/cds-mobile 8.21.8 → 8.22.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 +18 -0
- package/dts/alpha/select/DefaultSelectControl.d.ts.map +1 -1
- package/dts/alpha/select/DefaultSelectOption.d.ts.map +1 -1
- package/dts/banner/Banner.d.ts +4 -2
- package/dts/banner/Banner.d.ts.map +1 -1
- package/dts/cells/ListCell.d.ts +5 -0
- package/dts/cells/ListCell.d.ts.map +1 -1
- package/dts/cells/ListCellFallback.d.ts +12 -0
- package/dts/cells/ListCellFallback.d.ts.map +1 -1
- package/esm/alpha/select/DefaultSelectControl.js +4 -2
- package/esm/alpha/select/DefaultSelectOption.js +6 -8
- package/esm/alpha/select/__stories__/Select.stories.js +24 -10
- package/esm/banner/Banner.js +3 -16
- package/esm/banner/__stories__/Banner.stories.js +30 -0
- package/esm/cells/ListCell.js +10 -1
- package/esm/cells/ListCellFallback.js +32 -8
- package/esm/cells/__stories__/ListCell.stories.js +82 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,24 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.22.2 (11/26/2025 PST)
|
|
12
|
+
|
|
13
|
+
#### 🐞 Fixes
|
|
14
|
+
|
|
15
|
+
- Wrap Select labels instead of truncating them. [[#179](https://github.com/coinbase/cds/pull/179)]
|
|
16
|
+
|
|
17
|
+
## 8.22.1 (11/24/2025 PST)
|
|
18
|
+
|
|
19
|
+
#### 🐞 Fixes
|
|
20
|
+
|
|
21
|
+
- Fix the borderRadius prop issue in Banner. [[#190](https://github.com/coinbase/cds/pull/190)]
|
|
22
|
+
|
|
23
|
+
## 8.22.0 (11/24/2025 PST)
|
|
24
|
+
|
|
25
|
+
#### 🚀 Updates
|
|
26
|
+
|
|
27
|
+
- Added `subtitle` for ListCell and accessory for `ListCellFallback`. [[#149](https://github.com/coinbase/cds/pull/149)] [DX-5015]
|
|
28
|
+
|
|
11
29
|
## 8.21.8 (11/21/2025 PST)
|
|
12
30
|
|
|
13
31
|
#### 🐞 Fixes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultSelectControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAc3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiB7E,KAAK,6BAA6B,GAAG,CACnC,IAAI,SAAS,UAAU,EACvB,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KACvF,KAAK,CAAC,YAAY,CAAC;AAExB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"DefaultSelectControl.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAa,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAc3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiB7E,KAAK,6BAA6B,GAAG,CACnC,IAAI,SAAS,UAAU,EACvB,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,kBAAkB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;CAAE,KACvF,KAAK,CAAC,YAAY,CAAC;AAExB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;wBA6I9B,CAAH;wBAMD,CAAC;wBAIc,CAAC;wBAIhB,CAAP;6BAI2B,CAAC;sBAIV,CAAC;;qDAiGnB,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAoC,6BAA6B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultSelectOption.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectOption.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAOzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultSelectOption.d.ts","sourceRoot":"","sources":["../../../src/alpha/select/DefaultSelectOption.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,cAAc,CAAC;AAOzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AA4F9D,eAAO,MAAM,mBAAmB,EAAqD,CACnF,IAAI,SAAS,UAAU,GAAG,QAAQ,EAClC,iBAAiB,SAAS,MAAM,GAAG,MAAM,EAEzC,KAAK,EAAE,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,GAAG;IAAE,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;CAAE,KAC1E,KAAK,CAAC,YAAY,CAAC"}
|
package/dts/banner/Banner.d.ts
CHANGED
|
@@ -52,7 +52,8 @@ export type BannerBaseProps = SharedProps & {
|
|
|
52
52
|
bordered?: boolean;
|
|
53
53
|
/**
|
|
54
54
|
* Determines banner's border radius
|
|
55
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* @default 400 for contextual, undefined for global and inline
|
|
56
57
|
* */
|
|
57
58
|
borderRadius?: ThemeVars.BorderRadius;
|
|
58
59
|
};
|
|
@@ -103,7 +104,8 @@ export declare const Banner: React.MemoExoticComponent<
|
|
|
103
104
|
bordered?: boolean;
|
|
104
105
|
/**
|
|
105
106
|
* Determines banner's border radius
|
|
106
|
-
*
|
|
107
|
+
*
|
|
108
|
+
* @default 400 for contextual, undefined for global and inline
|
|
107
109
|
* */
|
|
108
110
|
borderRadius?: ThemeVars.BorderRadius;
|
|
109
111
|
} & Omit<import('../layout').BoxProps, 'children'> &
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"Banner.d.ts","sourceRoot":"","sources":["../../src/banner/Banner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2E,MAAM,OAAO,CAAC;AAChG,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EACV,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACR,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAKpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAM7C,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC1C,2GAA2G;IAC3G,OAAO,EAAE,aAAa,CAAC;IACvB,6CAA6C;IAC7C,SAAS,EAAE,QAAQ,CAAC;IACpB,uCAAuC;IACvC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,4HAA4H;IAC5H,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,2HAA2H;IAC3H,eAAe,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAClC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,wBAAwB;IACxB,QAAQ,CAAC,EAAE,KAAK,CA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DetailProps &
|
|
|
84
84
|
title?: React.ReactNode;
|
|
85
85
|
/** React node to render title. Takes precedence over `title`. */
|
|
86
86
|
titleNode?: React.ReactNode;
|
|
87
|
+
/** Subtitle to display below the title and above the description. This prop is only intended to accept a string or Text component; other use cases, while allowed, are not supported and may result in unexpected behavior. For arbitrary content, use `subtitleNode`. */
|
|
88
|
+
subtitle?: React.ReactNode;
|
|
89
|
+
/** React node to render subtitle. Takes precedence over `subtitle`. */
|
|
90
|
+
subtitleNode?: React.ReactNode;
|
|
87
91
|
/** Styles for the components */
|
|
88
92
|
styles?: {
|
|
89
93
|
root?: StyleProp<ViewStyle>;
|
|
@@ -96,6 +100,7 @@ export type ListCellBaseProps = CellDetailProps &
|
|
|
96
100
|
mainContent?: StyleProp<ViewStyle>;
|
|
97
101
|
helperText?: StyleProp<ViewStyle>;
|
|
98
102
|
title?: StyleProp<TextStyle>;
|
|
103
|
+
subtitle?: StyleProp<TextStyle>;
|
|
99
104
|
description?: StyleProp<TextStyle>;
|
|
100
105
|
};
|
|
101
106
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCell.d.ts","sourceRoot":"","sources":["../../src/cells/ListCell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,OAAO,EAAQ,KAAK,aAAa,EAAE,KAAK,SAAS,EAAoB,MAAM,QAAQ,CAAC;AACpF,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAEhE,eAAO,MAAM,qBAAqB;;;;CAIF,CAAC;AAGjC,eAAO,MAAM,qBAAqB;;;;CAIF,CAAC;AAEjC,MAAM,MAAM,iBAAiB,GAAG,eAAe,GAC7C,IAAI,CAAC,aAAa,EAAE,WAAW,G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,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC3B,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACxC,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACjC,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QACnC,UAAU,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAClC,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAChC,WAAW,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KACpC,CAAC;CACH,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,IAAI,CAAC,SAAS,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;AAE1F,eAAO,MAAM,QAAQ,2CAoKnB,CAAC"}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
1
2
|
import type { StyleProp, ViewStyle } from 'react-native';
|
|
2
3
|
import type { FallbackRectWidthProps, SharedProps } from '@coinbase/cds-common/types';
|
|
4
|
+
import { type CellAccessoryType } from './CellAccessory';
|
|
3
5
|
import type { CellMediaType } from './CellMedia';
|
|
4
6
|
import { type ListCellBaseProps } from './ListCell';
|
|
5
7
|
export type ListCellFallbackBaseProps = SharedProps &
|
|
6
8
|
FallbackRectWidthProps &
|
|
7
9
|
Pick<ListCellBaseProps, 'compact' | 'innerSpacing' | 'outerSpacing' | 'spacingVariant'> & {
|
|
10
|
+
/** Accessory to display at the end of the cell. */
|
|
11
|
+
accessory?: CellAccessoryType;
|
|
12
|
+
/** Custom accessory rendered at the end of the cell. Takes precedence over `accessory`. */
|
|
13
|
+
accessoryNode?: ReactNode;
|
|
8
14
|
/** Display description shimmer. */
|
|
9
15
|
description?: boolean;
|
|
10
16
|
/** Display detail shimmer. */
|
|
@@ -15,6 +21,8 @@ export type ListCellFallbackBaseProps = SharedProps &
|
|
|
15
21
|
media?: CellMediaType;
|
|
16
22
|
/** Display subdetail shimmer. */
|
|
17
23
|
subdetail?: boolean;
|
|
24
|
+
/** Display subtitle shimmer. */
|
|
25
|
+
subtitle?: boolean;
|
|
18
26
|
/** Display title shimmer. */
|
|
19
27
|
title?: boolean;
|
|
20
28
|
};
|
|
@@ -31,6 +39,10 @@ export type ListCellFallbackProps = ListCellFallbackBaseProps & {
|
|
|
31
39
|
title?: StyleProp<ViewStyle>;
|
|
32
40
|
/** Style to apply to the description shimmer. */
|
|
33
41
|
description?: StyleProp<ViewStyle>;
|
|
42
|
+
/** Style to apply to the subtitle shimmer. */
|
|
43
|
+
subtitle?: StyleProp<ViewStyle>;
|
|
44
|
+
/** Style to apply to the accessory container. */
|
|
45
|
+
accessory?: StyleProp<ViewStyle>;
|
|
34
46
|
};
|
|
35
47
|
};
|
|
36
48
|
export declare const ListCellFallback: import('react').NamedExoticComponent<ListCellFallbackProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ListCellFallback.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListCellFallback.d.ts","sourceRoot":"","sources":["../../src/cells/ListCellFallback.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,KAAK,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAQtF,OAAO,EAAiB,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAgD,KAAK,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ClC,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,gBAAgB,6DAuL3B,CAAC"}
|
|
@@ -75,6 +75,8 @@ export const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forw
|
|
|
75
75
|
children: /*#__PURE__*/_jsx(InputLabel, {
|
|
76
76
|
alignSelf: labelVariant === 'inside' ? 'flex-start' : undefined,
|
|
77
77
|
color: "fg",
|
|
78
|
+
ellipsizeMode: "tail",
|
|
79
|
+
numberOfLines: 2,
|
|
78
80
|
paddingX: labelVariant === 'inside' ? 2 : 0,
|
|
79
81
|
paddingY: shouldShowCompactLabel || labelVariant === 'inside' ? 0 : 0.5,
|
|
80
82
|
children: label
|
|
@@ -151,12 +153,12 @@ export const DefaultSelectControlComponent = /*#__PURE__*/memo(/*#__PURE__*/forw
|
|
|
151
153
|
children: startNode
|
|
152
154
|
}), shouldShowCompactLabel ? /*#__PURE__*/_jsx(HStack, {
|
|
153
155
|
alignItems: "center",
|
|
154
|
-
maxWidth: "40%",
|
|
155
156
|
paddingEnd: 1,
|
|
157
|
+
width: "40%",
|
|
156
158
|
children: labelNode
|
|
157
159
|
}) : null, /*#__PURE__*/_jsx(VStack, {
|
|
158
160
|
justifyContent: "center",
|
|
159
|
-
maxWidth: startNode ? '70%' : '85%',
|
|
161
|
+
maxWidth: shouldShowCompactLabel ? '45%' : startNode ? '70%' : '85%',
|
|
160
162
|
style: styles == null ? void 0 : styles.controlValueNode,
|
|
161
163
|
children: valueNode
|
|
162
164
|
})]
|
|
@@ -17,7 +17,6 @@ const DefaultSelectOptionComponent = (_ref, ref) => {
|
|
|
17
17
|
indeterminate,
|
|
18
18
|
compact,
|
|
19
19
|
description,
|
|
20
|
-
multiline,
|
|
21
20
|
style,
|
|
22
21
|
styles,
|
|
23
22
|
type,
|
|
@@ -26,20 +25,20 @@ const DefaultSelectOptionComponent = (_ref, ref) => {
|
|
|
26
25
|
} = _ref,
|
|
27
26
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
28
27
|
const labelNode = useMemo(() => typeof label === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
29
|
-
ellipsize:
|
|
28
|
+
ellipsize: "tail",
|
|
30
29
|
font: "headline",
|
|
31
|
-
numberOfLines:
|
|
30
|
+
numberOfLines: 2,
|
|
32
31
|
style: styles == null ? void 0 : styles.optionLabel,
|
|
33
32
|
children: label
|
|
34
|
-
}) : label, [label,
|
|
33
|
+
}) : label, [label, styles == null ? void 0 : styles.optionLabel]);
|
|
35
34
|
const descriptionNode = useMemo(() => typeof description === 'string' ? /*#__PURE__*/_jsx(Text, {
|
|
36
35
|
color: "fgMuted",
|
|
37
|
-
ellipsize:
|
|
36
|
+
ellipsize: "tail",
|
|
38
37
|
font: "body",
|
|
39
|
-
numberOfLines:
|
|
38
|
+
numberOfLines: 2,
|
|
40
39
|
style: styles == null ? void 0 : styles.optionDescription,
|
|
41
40
|
children: description
|
|
42
|
-
}) : description, [description,
|
|
41
|
+
}) : description, [description, styles == null ? void 0 : styles.optionDescription]);
|
|
43
42
|
const handlePress = useCallback(() => onPress == null ? void 0 : onPress(value), [onPress, value]);
|
|
44
43
|
const multiSelectCheckedAccessibilityState = useMemo(() => {
|
|
45
44
|
if (selected) return true;
|
|
@@ -59,7 +58,6 @@ const DefaultSelectOptionComponent = (_ref, ref) => {
|
|
|
59
58
|
background: background,
|
|
60
59
|
borderRadius: 0,
|
|
61
60
|
disabled: disabled,
|
|
62
|
-
maxHeight: multiline ? undefined : compact ? 56 : 64,
|
|
63
61
|
minHeight: compact ? 40 : 56,
|
|
64
62
|
onPress: handlePress,
|
|
65
63
|
priority: "end",
|
|
@@ -994,24 +994,38 @@ const VeryLongLabelsExample = () => {
|
|
|
994
994
|
label: 'Remove selection'
|
|
995
995
|
}, {
|
|
996
996
|
value: '1',
|
|
997
|
-
label: 'This is an extremely long option label that should test how the component handles very long text content'
|
|
997
|
+
label: 'This is an extremely long option label that should test how the component handles very long text content',
|
|
998
|
+
description: 'This is an extremely long option description that should test how the component handles very long text content'
|
|
998
999
|
}, {
|
|
999
1000
|
value: '2',
|
|
1000
|
-
label: 'Another super long option label with even more text to see how it wraps or truncates in the UI'
|
|
1001
|
+
label: 'Another super long option label with even more text to see how it wraps or truncates in the UI',
|
|
1002
|
+
description: 'Another super long option description with even more text to see how it wraps or truncates in the UI'
|
|
1001
1003
|
}, {
|
|
1002
1004
|
value: '3',
|
|
1003
|
-
label: 'Short'
|
|
1005
|
+
label: 'Short',
|
|
1006
|
+
description: 'Short description'
|
|
1004
1007
|
}, {
|
|
1005
1008
|
value: '4',
|
|
1006
|
-
label: 'A moderately long label that is somewhere between short and extremely long'
|
|
1009
|
+
label: 'A moderately long label that is somewhere between short and extremely long',
|
|
1010
|
+
description: 'A moderately long description that is somewhere between short and extremely long'
|
|
1007
1011
|
}];
|
|
1008
1012
|
const [value, setValue] = useState('1');
|
|
1009
|
-
return /*#__PURE__*/
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1013
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
1014
|
+
gap: 2,
|
|
1015
|
+
children: [/*#__PURE__*/_jsx(Select, {
|
|
1016
|
+
label: "Single select - very long option labels",
|
|
1017
|
+
onChange: setValue,
|
|
1018
|
+
options: longOptions,
|
|
1019
|
+
placeholder: "Empty value",
|
|
1020
|
+
value: value
|
|
1021
|
+
}), /*#__PURE__*/_jsx(Select, {
|
|
1022
|
+
compact: true,
|
|
1023
|
+
label: "Single select - very long option labels - compact",
|
|
1024
|
+
onChange: setValue,
|
|
1025
|
+
options: longOptions,
|
|
1026
|
+
placeholder: "Empty value",
|
|
1027
|
+
value: value
|
|
1028
|
+
})]
|
|
1015
1029
|
});
|
|
1016
1030
|
};
|
|
1017
1031
|
const LongPlaceholder = () => {
|
package/esm/banner/Banner.js
CHANGED
|
@@ -11,20 +11,6 @@ import { Pressable } from '../system/Pressable';
|
|
|
11
11
|
import { Link } from '../typography';
|
|
12
12
|
import { Text } from '../typography/Text';
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const variantStyleProps = {
|
|
15
|
-
contextual: {
|
|
16
|
-
paddingX: 2,
|
|
17
|
-
borderRadius: 400
|
|
18
|
-
},
|
|
19
|
-
global: {
|
|
20
|
-
paddingX: 3,
|
|
21
|
-
borderRadius: undefined
|
|
22
|
-
},
|
|
23
|
-
inline: {
|
|
24
|
-
paddingX: 3,
|
|
25
|
-
borderRadius: undefined
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
14
|
export const Banner = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Banner(_ref, forwardedRef) {
|
|
29
15
|
let {
|
|
30
16
|
variant,
|
|
@@ -43,7 +29,7 @@ export const Banner = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Banner(
|
|
|
43
29
|
styleVariant = 'contextual',
|
|
44
30
|
startIconAccessibilityLabel,
|
|
45
31
|
closeAccessibilityLabel = 'close',
|
|
46
|
-
borderRadius = 400,
|
|
32
|
+
borderRadius = styleVariant === 'contextual' ? 400 : undefined,
|
|
47
33
|
margin,
|
|
48
34
|
marginX,
|
|
49
35
|
marginY,
|
|
@@ -120,10 +106,11 @@ export const Banner = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(function Banner(
|
|
|
120
106
|
background: background,
|
|
121
107
|
borderRadius: borderRadius,
|
|
122
108
|
gap: 1,
|
|
109
|
+
paddingX: styleVariant === 'contextual' ? 2 : 3,
|
|
123
110
|
paddingY: 2,
|
|
124
111
|
style: style,
|
|
125
112
|
testID: testID
|
|
126
|
-
},
|
|
113
|
+
}, props, {
|
|
127
114
|
children: [/*#__PURE__*/_jsx(Box, {
|
|
128
115
|
accessibilityLabel: startIconAccessibilityLabel,
|
|
129
116
|
accessibilityRole: "image",
|
|
@@ -31,6 +31,7 @@ const examplePropsWithOffset = _extends({}, exampleProps, {
|
|
|
31
31
|
marginX: -2,
|
|
32
32
|
children: 'Lorem ipsum dolar sit amet'
|
|
33
33
|
});
|
|
34
|
+
const borderRadiusValues = [0, 200, 400];
|
|
34
35
|
const styleProps = [{
|
|
35
36
|
variant: 'warning',
|
|
36
37
|
title: 'Warning message',
|
|
@@ -321,6 +322,35 @@ const BannerScreen = () => {
|
|
|
321
322
|
variant: "warning"
|
|
322
323
|
}))]
|
|
323
324
|
})]
|
|
325
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
326
|
+
title: "Border Radius",
|
|
327
|
+
children: /*#__PURE__*/_jsxs(VStack, {
|
|
328
|
+
gap: 2,
|
|
329
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
330
|
+
font: "title1",
|
|
331
|
+
children: "Contextual"
|
|
332
|
+
}), /*#__PURE__*/_jsx(VStack, {
|
|
333
|
+
gap: 2,
|
|
334
|
+
children: borderRadiusValues.map(radius => /*#__PURE__*/_jsx(Banner, _extends({}, exampleProps, {
|
|
335
|
+
borderRadius: radius,
|
|
336
|
+
title: "Contextual radius " + radius,
|
|
337
|
+
variant: "informational",
|
|
338
|
+
children: shortMessage
|
|
339
|
+
}), "mobile-contextual-" + radius))
|
|
340
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
341
|
+
font: "title1",
|
|
342
|
+
children: "Inline"
|
|
343
|
+
}), /*#__PURE__*/_jsx(VStack, {
|
|
344
|
+
gap: 2,
|
|
345
|
+
children: borderRadiusValues.map(radius => /*#__PURE__*/_jsx(Banner, _extends({}, exampleProps, {
|
|
346
|
+
borderRadius: radius,
|
|
347
|
+
styleVariant: "inline",
|
|
348
|
+
title: "Inline radius " + radius,
|
|
349
|
+
variant: "informational",
|
|
350
|
+
children: shortMessage
|
|
351
|
+
}), "mobile-inline-" + radius))
|
|
352
|
+
})]
|
|
353
|
+
})
|
|
324
354
|
})]
|
|
325
355
|
});
|
|
326
356
|
};
|
package/esm/cells/ListCell.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["accessory", "accessoryNode", "end", "action", "compact", "title", "titleNode", "disableMultilineTitle", "description", "descriptionNode", "detail", "detailNode", "detailWidth", "intermediary", "priority", "innerSpacing", "outerSpacing", "disabled", "disableSelectionAccessory", "helperText", "media", "multiline", "selected", "subdetail", "subdetailNode", "variant", "onPress", "spacingVariant", "style", "styles"];
|
|
1
|
+
const _excluded = ["accessory", "accessoryNode", "end", "action", "compact", "title", "titleNode", "disableMultilineTitle", "description", "descriptionNode", "subtitle", "subtitleNode", "detail", "detailNode", "detailWidth", "intermediary", "priority", "innerSpacing", "outerSpacing", "disabled", "disableSelectionAccessory", "helperText", "media", "multiline", "selected", "subdetail", "subdetailNode", "variant", "onPress", "spacingVariant", "style", "styles"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
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; }
|
|
4
4
|
import React, { memo, useMemo } from 'react';
|
|
@@ -34,6 +34,8 @@ export const ListCell = /*#__PURE__*/memo(function ListCell(_ref) {
|
|
|
34
34
|
disableMultilineTitle = false,
|
|
35
35
|
description,
|
|
36
36
|
descriptionNode,
|
|
37
|
+
subtitle,
|
|
38
|
+
subtitleNode,
|
|
37
39
|
detail,
|
|
38
40
|
detailNode,
|
|
39
41
|
detailWidth,
|
|
@@ -112,6 +114,13 @@ export const ListCell = /*#__PURE__*/memo(function ListCell(_ref) {
|
|
|
112
114
|
spacingVariant === 'condensed' ? 2 : description ? 1 : 2,
|
|
113
115
|
style: styles == null ? void 0 : styles.title,
|
|
114
116
|
children: title
|
|
117
|
+
}) : null, subtitleNode ? subtitleNode : subtitle ? /*#__PURE__*/_jsx(Text, {
|
|
118
|
+
color: "fgMuted",
|
|
119
|
+
ellipsize: "tail",
|
|
120
|
+
font: "label1",
|
|
121
|
+
numberOfLines: 1,
|
|
122
|
+
style: styles == null ? void 0 : styles.subtitle,
|
|
123
|
+
children: subtitle
|
|
115
124
|
}) : null, descriptionNode ? descriptionNode : description ? /*#__PURE__*/_jsx(Text, {
|
|
116
125
|
color: "fgMuted",
|
|
117
126
|
ellipsize: multiline ? undefined : 'tail',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const _excluded = ["title", "description", "detail", "subdetail", "media", "disableRandomRectWidth", "rectWidthVariant", "helperText", "styles", "compact", "spacingVariant", "innerSpacing", "outerSpacing"];
|
|
1
|
+
const _excluded = ["accessory", "accessoryNode", "title", "description", "detail", "subdetail", "media", "disableRandomRectWidth", "rectWidthVariant", "helperText", "subtitle", "styles", "compact", "spacingVariant", "innerSpacing", "outerSpacing"];
|
|
2
2
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
3
3
|
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; }
|
|
4
4
|
import { memo, useMemo } from 'react';
|
|
@@ -7,11 +7,14 @@ import { useTheme } from '../hooks/useTheme';
|
|
|
7
7
|
import { VStack } from '../layout';
|
|
8
8
|
import { Fallback } from '../layout/Fallback';
|
|
9
9
|
import { Cell } from './Cell';
|
|
10
|
+
import { CellAccessory } from './CellAccessory';
|
|
10
11
|
import { condensedInnerSpacing, condensedOuterSpacing } from './ListCell';
|
|
11
12
|
import { MediaFallback } from './MediaFallback';
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
14
|
export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref) {
|
|
14
15
|
let {
|
|
16
|
+
accessory,
|
|
17
|
+
accessoryNode,
|
|
15
18
|
title,
|
|
16
19
|
description,
|
|
17
20
|
detail,
|
|
@@ -20,6 +23,7 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
20
23
|
disableRandomRectWidth,
|
|
21
24
|
rectWidthVariant,
|
|
22
25
|
helperText,
|
|
26
|
+
subtitle,
|
|
23
27
|
styles,
|
|
24
28
|
compact,
|
|
25
29
|
spacingVariant = compact ? 'compact' : 'normal',
|
|
@@ -34,13 +38,13 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
34
38
|
}
|
|
35
39
|
return /*#__PURE__*/_jsx(Fallback, {
|
|
36
40
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
37
|
-
height: theme.lineHeight.body,
|
|
41
|
+
height: spacingVariant === 'condensed' ? theme.lineHeight.label2 : theme.lineHeight.body,
|
|
38
42
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 0),
|
|
39
43
|
style: styles == null ? void 0 : styles.description,
|
|
40
44
|
testID: "list-cell-fallback-description",
|
|
41
45
|
width: 110
|
|
42
46
|
});
|
|
43
|
-
}, [description, disableRandomRectWidth, rectWidthVariant, styles == null ? void 0 : styles.description, theme.lineHeight.body]);
|
|
47
|
+
}, [description, disableRandomRectWidth, rectWidthVariant, spacingVariant, styles == null ? void 0 : styles.description, theme.lineHeight.body, theme.lineHeight.label2]);
|
|
44
48
|
const detailFallback = useMemo(() => {
|
|
45
49
|
if (!detail && !subdetail) {
|
|
46
50
|
return null;
|
|
@@ -59,14 +63,14 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
59
63
|
width: 60
|
|
60
64
|
}), !!subdetail && /*#__PURE__*/_jsx(Fallback, {
|
|
61
65
|
disableRandomRectWidth: disableRandomRectWidth,
|
|
62
|
-
height: theme.lineHeight.body,
|
|
66
|
+
height: spacingVariant === 'condensed' ? theme.lineHeight.label2 : theme.lineHeight.body,
|
|
63
67
|
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 1),
|
|
64
68
|
style: styles == null ? void 0 : styles.subdetail,
|
|
65
69
|
testID: "list-cell-fallback-subdetail",
|
|
66
70
|
width: 60
|
|
67
71
|
})]
|
|
68
72
|
});
|
|
69
|
-
}, [detail, disableRandomRectWidth, rectWidthVariant, styles == null ? void 0 : styles.detail, styles == null ? void 0 : styles.subdetail, subdetail, theme.lineHeight.body]);
|
|
73
|
+
}, [detail, disableRandomRectWidth, rectWidthVariant, spacingVariant, styles == null ? void 0 : styles.detail, styles == null ? void 0 : styles.subdetail, subdetail, theme.lineHeight.body, theme.lineHeight.label2]);
|
|
70
74
|
const helperTextFallback = useMemo(() => {
|
|
71
75
|
if (!helperText) {
|
|
72
76
|
return null;
|
|
@@ -80,6 +84,19 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
80
84
|
width: "85%"
|
|
81
85
|
});
|
|
82
86
|
}, [disableRandomRectWidth, helperText, rectWidthVariant, styles == null ? void 0 : styles.helperText, theme.lineHeight.body]);
|
|
87
|
+
const subtitleFallback = useMemo(() => {
|
|
88
|
+
if (!subtitle) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return /*#__PURE__*/_jsx(Fallback, {
|
|
92
|
+
disableRandomRectWidth: disableRandomRectWidth,
|
|
93
|
+
height: theme.lineHeight.label1,
|
|
94
|
+
rectWidthVariant: getRectWidthVariant(rectWidthVariant, 2),
|
|
95
|
+
style: styles == null ? void 0 : styles.subtitle,
|
|
96
|
+
testID: "list-cell-fallback-subtitle",
|
|
97
|
+
width: 80
|
|
98
|
+
});
|
|
99
|
+
}, [disableRandomRectWidth, rectWidthVariant, styles == null ? void 0 : styles.subtitle, subtitle, theme.lineHeight.label1]);
|
|
83
100
|
const mediaFallback = useMemo(() => {
|
|
84
101
|
if (!media) {
|
|
85
102
|
return;
|
|
@@ -103,15 +120,22 @@ export const ListCellFallback = /*#__PURE__*/memo(function ListCellFallback(_ref
|
|
|
103
120
|
});
|
|
104
121
|
}, [disableRandomRectWidth, rectWidthVariant, styles == null ? void 0 : styles.title, theme.lineHeight.headline, title]);
|
|
105
122
|
return /*#__PURE__*/_jsx(Cell, _extends({
|
|
123
|
+
accessory: accessory ? /*#__PURE__*/_jsx(CellAccessory, {
|
|
124
|
+
type: accessory
|
|
125
|
+
}) : undefined,
|
|
126
|
+
accessoryNode: accessoryNode,
|
|
106
127
|
bottomContent: helperTextFallback,
|
|
107
|
-
|
|
128
|
+
end: detailFallback,
|
|
108
129
|
innerSpacing: innerSpacing != null ? innerSpacing : spacingVariant === 'condensed' ? condensedInnerSpacing : undefined,
|
|
109
130
|
media: mediaFallback,
|
|
110
|
-
outerSpacing: outerSpacing != null ? outerSpacing : spacingVariant === 'condensed' ? condensedOuterSpacing : undefined
|
|
131
|
+
outerSpacing: outerSpacing != null ? outerSpacing : spacingVariant === 'condensed' ? condensedOuterSpacing : undefined,
|
|
132
|
+
styles: {
|
|
133
|
+
accessory: styles == null ? void 0 : styles.accessory
|
|
134
|
+
}
|
|
111
135
|
}, props, {
|
|
112
136
|
children: /*#__PURE__*/_jsxs(VStack, {
|
|
113
137
|
gap: 0.5,
|
|
114
|
-
children: [titleFallback, descriptionFallback]
|
|
138
|
+
children: [titleFallback, subtitleFallback, descriptionFallback]
|
|
115
139
|
})
|
|
116
140
|
}));
|
|
117
141
|
});
|
|
@@ -5,6 +5,7 @@ import { selectCellSpacingConfig } from '@coinbase/cds-common/tokens/select';
|
|
|
5
5
|
import { gutter } from '@coinbase/cds-common/tokens/sizing';
|
|
6
6
|
import { Button } from '../../buttons/Button';
|
|
7
7
|
import { IconButton } from '../../buttons/IconButton';
|
|
8
|
+
import { Switch } from '../../controls/Switch';
|
|
8
9
|
import { Example, ExampleScreen } from '../../examples/ExampleScreen';
|
|
9
10
|
import { useTheme } from '../../hooks/useTheme';
|
|
10
11
|
import { Icon } from '../../icons/Icon';
|
|
@@ -16,6 +17,7 @@ import { Tag } from '../../tag/Tag';
|
|
|
16
17
|
import { Text } from '../../typography/Text';
|
|
17
18
|
import { CellHelperText } from '../CellHelperText';
|
|
18
19
|
import { ListCell } from '../ListCell';
|
|
20
|
+
import { ListCellFallback } from '../ListCellFallback';
|
|
19
21
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
22
|
const onPressConsole = () => console.log('onPress');
|
|
21
23
|
const cellPriorities = ['middle', 'end'];
|
|
@@ -641,6 +643,42 @@ const WithActions = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
|
641
643
|
title: "Title"
|
|
642
644
|
})]
|
|
643
645
|
});
|
|
646
|
+
const Fallback = () => {
|
|
647
|
+
const [showFallback, setShowFallback] = React.useState(false);
|
|
648
|
+
return /*#__PURE__*/_jsxs(VStack, {
|
|
649
|
+
gap: 2,
|
|
650
|
+
children: [/*#__PURE__*/_jsx(Switch, {
|
|
651
|
+
checked: showFallback,
|
|
652
|
+
onChange: (_, nextChecked) => setShowFallback(Boolean(nextChecked)),
|
|
653
|
+
children: "Show fallback state"
|
|
654
|
+
}), showFallback ? /*#__PURE__*/_jsx(ListCellFallback, {
|
|
655
|
+
description: true,
|
|
656
|
+
detail: true,
|
|
657
|
+
disableRandomRectWidth: true,
|
|
658
|
+
helperText: true,
|
|
659
|
+
subdetail: true,
|
|
660
|
+
subtitle: true,
|
|
661
|
+
title: true,
|
|
662
|
+
accessory: "more",
|
|
663
|
+
media: "asset",
|
|
664
|
+
spacingVariant: "condensed"
|
|
665
|
+
}) : /*#__PURE__*/_jsx(ListCell, {
|
|
666
|
+
accessory: "more",
|
|
667
|
+
description: "Review portfolio performance",
|
|
668
|
+
detail: "$12,345.00",
|
|
669
|
+
helperText: /*#__PURE__*/_jsx(CellHelperText, {
|
|
670
|
+
children: "Balance reflects live market data"
|
|
671
|
+
}),
|
|
672
|
+
media: /*#__PURE__*/_jsx(Avatar, {
|
|
673
|
+
src: assets.eth.imageUrl
|
|
674
|
+
}),
|
|
675
|
+
spacingVariant: "condensed",
|
|
676
|
+
subdetail: "+5.43%",
|
|
677
|
+
subtitle: "ETH",
|
|
678
|
+
title: "Ethereum"
|
|
679
|
+
})]
|
|
680
|
+
});
|
|
681
|
+
};
|
|
644
682
|
const WithIntermediary = () => /*#__PURE__*/_jsxs(_Fragment, {
|
|
645
683
|
children: [/*#__PURE__*/_jsx(ListCell, {
|
|
646
684
|
description: "Description",
|
|
@@ -871,6 +909,44 @@ const CondensedListCell = () => {
|
|
|
871
909
|
},
|
|
872
910
|
subdetail: "Subdetail",
|
|
873
911
|
title: "Title"
|
|
912
|
+
}), /*#__PURE__*/_jsx(ListCell, {
|
|
913
|
+
multiline: true,
|
|
914
|
+
description: "Long description with multiple lines. This section can be arbitrarily long and occupy many many lines.",
|
|
915
|
+
detail: "Detail",
|
|
916
|
+
end: /*#__PURE__*/_jsxs(HStack, {
|
|
917
|
+
alignItems: "center",
|
|
918
|
+
gap: 1,
|
|
919
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
920
|
+
color: "fgMuted",
|
|
921
|
+
font: "label2",
|
|
922
|
+
children: "Meta"
|
|
923
|
+
}), /*#__PURE__*/_jsx(Icon, {
|
|
924
|
+
color: "fg",
|
|
925
|
+
name: "caretRight",
|
|
926
|
+
size: "s"
|
|
927
|
+
})]
|
|
928
|
+
}),
|
|
929
|
+
media: /*#__PURE__*/_jsx(Avatar, {
|
|
930
|
+
shape: "circle",
|
|
931
|
+
size: "l",
|
|
932
|
+
src: assets.eth.imageUrl
|
|
933
|
+
}),
|
|
934
|
+
onPress: onPressConsole,
|
|
935
|
+
priority: "end",
|
|
936
|
+
spacingVariant: "condensed",
|
|
937
|
+
styles: {
|
|
938
|
+
media: {
|
|
939
|
+
marginTop: theme.space[1],
|
|
940
|
+
alignSelf: 'flex-start'
|
|
941
|
+
},
|
|
942
|
+
end: {
|
|
943
|
+
marginTop: theme.space[1],
|
|
944
|
+
alignSelf: 'flex-start'
|
|
945
|
+
}
|
|
946
|
+
},
|
|
947
|
+
subdetail: "Subdetail",
|
|
948
|
+
subtitle: "Subtitle",
|
|
949
|
+
title: "Title"
|
|
874
950
|
}), /*#__PURE__*/_jsx(ListCell, {
|
|
875
951
|
accessory: "more",
|
|
876
952
|
description: "Description",
|
|
@@ -1275,6 +1351,12 @@ const ListCellScreen = () => {
|
|
|
1275
1351
|
title: "WithActions",
|
|
1276
1352
|
titlePadding: titlePadding,
|
|
1277
1353
|
children: /*#__PURE__*/_jsx(WithActions, {})
|
|
1354
|
+
}), /*#__PURE__*/_jsx(Example, {
|
|
1355
|
+
inline: true,
|
|
1356
|
+
paddingX: 0,
|
|
1357
|
+
title: "Fallback",
|
|
1358
|
+
titlePadding: titlePadding,
|
|
1359
|
+
children: /*#__PURE__*/_jsx(Fallback, {})
|
|
1278
1360
|
}), /*#__PURE__*/_jsx(Example, {
|
|
1279
1361
|
inline: true,
|
|
1280
1362
|
paddingX: 0,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coinbase/cds-mobile",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.22.2",
|
|
4
4
|
"description": "Coinbase Design System - Mobile",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -154,7 +154,7 @@
|
|
|
154
154
|
"react-native-svg": "^14.1.0"
|
|
155
155
|
},
|
|
156
156
|
"dependencies": {
|
|
157
|
-
"@coinbase/cds-common": "^8.
|
|
157
|
+
"@coinbase/cds-common": "^8.22.2",
|
|
158
158
|
"@coinbase/cds-icons": "^5.7.0",
|
|
159
159
|
"@coinbase/cds-illustrations": "^4.28.0",
|
|
160
160
|
"@coinbase/cds-lottie-files": "^3.3.3",
|