@coinbase/cds-mcp-server 8.41.0 → 8.42.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 +4 -0
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +1 -1
- package/mcp-docs/mobile/components/ContentCard.txt +220 -174
- package/mcp-docs/mobile/components/ContentCardBody.txt +127 -19
- package/mcp-docs/mobile/components/ContentCardFooter.txt +63 -1
- package/mcp-docs/mobile/components/ContentCardHeader.txt +71 -16
- package/mcp-docs/mobile/components/DataCard.txt +723 -0
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +1 -1
- package/mcp-docs/mobile/components/MediaCard.txt +526 -0
- package/mcp-docs/mobile/components/MessagingCard.txt +1025 -0
- package/mcp-docs/mobile/components/Scrubber.txt +140 -0
- package/mcp-docs/mobile/routes.txt +6 -3
- package/mcp-docs/web/components/ContentCard.txt +419 -327
- package/mcp-docs/web/components/ContentCardBody.txt +91 -16
- package/mcp-docs/web/components/ContentCardFooter.txt +231 -165
- package/mcp-docs/web/components/ContentCardHeader.txt +237 -177
- package/mcp-docs/web/components/DataCard.txt +800 -0
- package/mcp-docs/web/components/MediaCard.txt +559 -0
- package/mcp-docs/web/components/MessagingCard.txt +1054 -0
- package/mcp-docs/web/components/ReferenceLine.txt +1 -0
- package/mcp-docs/web/components/Scrubber.txt +106 -0
- package/mcp-docs/web/routes.txt +3 -0
- package/package.json +1 -1
|
@@ -13,21 +13,124 @@ import { ContentCardBody } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
13
13
|
### Basic Example
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
function Example() {
|
|
17
|
+
const { spectrum } = useTheme();
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
21
|
+
<ContentCardBody
|
|
22
|
+
title="Bitcoin Network Shatters Records"
|
|
23
|
+
description={
|
|
24
|
+
<VStack gap={0.5}>
|
|
25
|
+
<Text font="body2">Hashrate Climbing to 464 EH/s</Text>
|
|
26
|
+
<HStack alignItems="flex-end" flexWrap="wrap" gap={0.5}>
|
|
27
|
+
<Text as="p" font="label2" color="fgMuted" numberOfLines={1}>
|
|
28
|
+
BTC
|
|
29
|
+
</Text>
|
|
30
|
+
<Text
|
|
31
|
+
font="label2"
|
|
32
|
+
accessibilityLabel="Up 5.12%"
|
|
33
|
+
as="p"
|
|
34
|
+
dangerouslySetColor={`rgb(${spectrum.green70})`}
|
|
35
|
+
>
|
|
36
|
+
↗ 5.12%
|
|
37
|
+
</Text>
|
|
38
|
+
</HStack>
|
|
39
|
+
</VStack>
|
|
40
|
+
}
|
|
41
|
+
/>
|
|
42
|
+
</VStack>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### With Media (Top Placement)
|
|
48
|
+
|
|
49
|
+
```jsx
|
|
50
|
+
function Example() {
|
|
51
|
+
return (
|
|
52
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
53
|
+
<ContentCardBody
|
|
54
|
+
title="Ethereum Update"
|
|
55
|
+
description="The latest developments in the Ethereum ecosystem and network upgrades."
|
|
56
|
+
media={
|
|
57
|
+
<RemoteImage
|
|
58
|
+
alt="Ethereum background"
|
|
59
|
+
resizeMode="cover"
|
|
60
|
+
shape="rectangle"
|
|
61
|
+
source={{ uri: ethBackground }}
|
|
62
|
+
width="100%"
|
|
63
|
+
/>
|
|
64
|
+
}
|
|
65
|
+
mediaPlacement="top"
|
|
66
|
+
/>
|
|
67
|
+
</VStack>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### With Media (End Placement - Horizontal)
|
|
73
|
+
|
|
74
|
+
```jsx
|
|
75
|
+
function Example() {
|
|
76
|
+
return (
|
|
77
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
78
|
+
<ContentCardBody
|
|
79
|
+
title="Bitcoin Holdings"
|
|
80
|
+
description="Your current portfolio performance and asset allocation details."
|
|
81
|
+
media={
|
|
82
|
+
<RemoteImage
|
|
83
|
+
alt="Ethereum background"
|
|
84
|
+
resizeMode="cover"
|
|
85
|
+
shape="rectangle"
|
|
86
|
+
source={{ uri: ethBackground }}
|
|
87
|
+
width="100%"
|
|
88
|
+
/>
|
|
89
|
+
}
|
|
90
|
+
mediaPlacement="end"
|
|
91
|
+
/>
|
|
92
|
+
</VStack>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### With Custom Children
|
|
98
|
+
|
|
99
|
+
Use the `children` prop to render custom content below the title and description. This is useful when you need to display additional data, charts, or interactive elements that don't fit the standard media/title/description layout.
|
|
100
|
+
|
|
101
|
+
```jsx
|
|
102
|
+
function Example() {
|
|
103
|
+
const { spectrum } = useTheme();
|
|
104
|
+
|
|
105
|
+
return (
|
|
106
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
107
|
+
<ContentCardBody title="Weekly Summary" description="Your trading activity this week.">
|
|
108
|
+
<HStack gap={2} justifyContent="space-between">
|
|
109
|
+
<VStack gap={0.5}>
|
|
110
|
+
<Text font="legal" color="fgMuted">
|
|
111
|
+
Trades
|
|
112
|
+
</Text>
|
|
113
|
+
<Text font="title3">24</Text>
|
|
114
|
+
</VStack>
|
|
115
|
+
<VStack gap={0.5}>
|
|
116
|
+
<Text font="legal" color="fgMuted">
|
|
117
|
+
Volume
|
|
118
|
+
</Text>
|
|
119
|
+
<Text font="title3">$12,450</Text>
|
|
120
|
+
</VStack>
|
|
121
|
+
<VStack gap={0.5}>
|
|
122
|
+
<Text font="legal" color="fgMuted">
|
|
123
|
+
P&L
|
|
124
|
+
</Text>
|
|
125
|
+
<Text font="title3" dangerouslySetColor={`rgb(${spectrum.green70})`}>
|
|
126
|
+
+$890
|
|
127
|
+
</Text>
|
|
128
|
+
</VStack>
|
|
129
|
+
</HStack>
|
|
130
|
+
</ContentCardBody>
|
|
131
|
+
</VStack>
|
|
132
|
+
);
|
|
133
|
+
}
|
|
31
134
|
```
|
|
32
135
|
|
|
33
136
|
## Props
|
|
@@ -40,7 +143,7 @@ import { ContentCardBody } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
40
143
|
| `animated` | `boolean` | No | `-` | - |
|
|
41
144
|
| `aspectRatio` | `string \| number` | No | `-` | - |
|
|
42
145
|
| `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
|
|
43
|
-
| `body` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` |
|
|
146
|
+
| `body` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
44
147
|
| `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
45
148
|
| `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
46
149
|
| `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
@@ -60,9 +163,11 @@ import { ContentCardBody } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
60
163
|
| `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
|
|
61
164
|
| `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
|
|
62
165
|
| `bottom` | `string \| number` | No | `-` | - |
|
|
166
|
+
| `children` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Custom content to display below the main content box (title/description/media). Use this when you need to render custom content that doesnt fit the standard media/title/description layout. |
|
|
63
167
|
| `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
|
|
64
168
|
| `columnGap` | `0 \| 1 \| 2 \| 0.25 \| 0.5 \| 0.75 \| 1.5 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10` | No | `-` | - |
|
|
65
169
|
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
170
|
+
| `description` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Text or React node to display as the card description. Use a Text component to override default color and font. |
|
|
66
171
|
| `display` | `flex \| none` | No | `-` | - |
|
|
67
172
|
| `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
|
|
68
173
|
| `flexBasis` | `string \| number` | No | `-` | - |
|
|
@@ -78,7 +183,7 @@ import { ContentCardBody } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
78
183
|
| `height` | `string \| number` | No | `-` | - |
|
|
79
184
|
| `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
80
185
|
| `key` | `Key \| null` | No | `-` | - |
|
|
81
|
-
| `label` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` |
|
|
186
|
+
| `label` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
82
187
|
| `left` | `string \| number` | No | `-` | - |
|
|
83
188
|
| `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
|
|
84
189
|
| `margin` | `0 \| -1 \| -2 \| -0.25 \| -0.5 \| -0.75 \| -1.5 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10` | No | `-` | - |
|
|
@@ -90,8 +195,9 @@ import { ContentCardBody } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
90
195
|
| `marginY` | `0 \| -1 \| -2 \| -0.25 \| -0.5 \| -0.75 \| -1.5 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10` | No | `-` | - |
|
|
91
196
|
| `maxHeight` | `string \| number` | No | `-` | - |
|
|
92
197
|
| `maxWidth` | `string \| number` | No | `-` | - |
|
|
93
|
-
| `media` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` |
|
|
94
|
-
| `
|
|
198
|
+
| `media` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | React node to display as media content (e.g., Image or RemoteImage). |
|
|
199
|
+
| `mediaPlacement` | `top \| bottom \| end \| start` | No | `'top'` | Placement of the media content relative to the text content. |
|
|
200
|
+
| `mediaPosition` | `top \| bottom \| left \| right` | No | `-` | - |
|
|
95
201
|
| `minHeight` | `string \| number` | No | `-` | - |
|
|
96
202
|
| `minWidth` | `string \| number` | No | `-` | - |
|
|
97
203
|
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
@@ -121,11 +227,13 @@ import { ContentCardBody } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
121
227
|
| `right` | `string \| number` | No | `-` | - |
|
|
122
228
|
| `rowGap` | `0 \| 1 \| 2 \| 0.25 \| 0.5 \| 0.75 \| 1.5 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10` | No | `-` | - |
|
|
123
229
|
| `style` | `false \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]> \| null` | No | `-` | - |
|
|
230
|
+
| `styles` | `{ root?: StyleProp<ViewStyle>; contentContainer?: StyleProp<ViewStyle>; textContainer?: StyleProp<ViewStyle>; mediaContainer?: StyleProp<ViewStyle>; }` | No | `-` | - |
|
|
124
231
|
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID Used to locate this element in unit and end-to-end tests. Used to locate this view in end-to-end tests. |
|
|
125
232
|
| `textAlign` | `left \| right \| auto \| center \| justify` | No | `-` | - |
|
|
126
233
|
| `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
|
|
127
234
|
| `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
|
|
128
235
|
| `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
|
|
236
|
+
| `title` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Text or React node to display as the card title. Use a Text component to override default color and font. |
|
|
129
237
|
| `top` | `string \| number` | No | `-` | - |
|
|
130
238
|
| `transform` | `string \| (({ scaleX: AnimatableNumericValue; } & { scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scaleY: AnimatableNumericValue; } & { scaleX?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateX: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateY: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ perspective: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotate: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateZ: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scale: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; matrix?: undefined; }) \| ({ matrix: AnimatableNumericValue[]; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; }))[]` | No | `-` | - |
|
|
131
239
|
| `userSelect` | `none \| auto \| contain \| text \| all` | No | `-` | - |
|
|
@@ -10,7 +10,7 @@ import { ContentCardFooter } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
10
10
|
|
|
11
11
|
## Examples
|
|
12
12
|
|
|
13
|
-
###
|
|
13
|
+
### With Icon Counter Buttons
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
16
|
function Example() {
|
|
@@ -26,6 +26,68 @@ function Example() {
|
|
|
26
26
|
}
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
+
### With Image Group and Button
|
|
30
|
+
|
|
31
|
+
```jsx
|
|
32
|
+
function Example() {
|
|
33
|
+
return (
|
|
34
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
35
|
+
<ContentCardFooter>
|
|
36
|
+
<RemoteImageGroup shape="circle" size={32}>
|
|
37
|
+
<RemoteImage source={{ uri: assets.eth.imageUrl }} />
|
|
38
|
+
<RemoteImage source={{ uri: assets.btc.imageUrl }} />
|
|
39
|
+
<RemoteImage source={{ uri: assets.polygon.imageUrl }} />
|
|
40
|
+
</RemoteImageGroup>
|
|
41
|
+
<Button compact variant="secondary">
|
|
42
|
+
Share
|
|
43
|
+
</Button>
|
|
44
|
+
</ContentCardFooter>
|
|
45
|
+
</VStack>
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### With Text and Actions
|
|
51
|
+
|
|
52
|
+
```jsx
|
|
53
|
+
function Example() {
|
|
54
|
+
return (
|
|
55
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
56
|
+
<ContentCardFooter alignItems="center">
|
|
57
|
+
<Text font="label2" color="fgMuted">
|
|
58
|
+
Updated 2 hours ago
|
|
59
|
+
</Text>
|
|
60
|
+
<HStack gap={1}>
|
|
61
|
+
<IconButton
|
|
62
|
+
transparent
|
|
63
|
+
accessibilityLabel="Bookmark"
|
|
64
|
+
name="bookmark"
|
|
65
|
+
variant="secondary"
|
|
66
|
+
/>
|
|
67
|
+
<IconButton transparent accessibilityLabel="Share" name="share" variant="secondary" />
|
|
68
|
+
</HStack>
|
|
69
|
+
</ContentCardFooter>
|
|
70
|
+
</VStack>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Centered Content
|
|
76
|
+
|
|
77
|
+
```jsx
|
|
78
|
+
function Example() {
|
|
79
|
+
return (
|
|
80
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
81
|
+
<ContentCardFooter justifyContent="center">
|
|
82
|
+
<Button compact variant="secondary">
|
|
83
|
+
View All Assets
|
|
84
|
+
</Button>
|
|
85
|
+
</ContentCardFooter>
|
|
86
|
+
</VStack>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
29
91
|
## Props
|
|
30
92
|
|
|
31
93
|
| Prop | Type | Required | Default | Description |
|
|
@@ -15,21 +15,15 @@ import { ContentCardHeader } from '@coinbase/cds-mobile/cards/ContentCard'
|
|
|
15
15
|
```jsx
|
|
16
16
|
function Example() {
|
|
17
17
|
return (
|
|
18
|
-
<VStack bordered borderRadius="400" maxWidth={375} padding={
|
|
18
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
19
19
|
<ContentCardHeader
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
・News・5 hrs
|
|
25
|
-
</Text>
|
|
26
|
-
</Box>
|
|
27
|
-
}
|
|
28
|
-
title="Description"
|
|
29
|
-
end={
|
|
20
|
+
thumbnail={<Avatar src={assets.eth.imageUrl} size="l" />}
|
|
21
|
+
title="CoinDesk"
|
|
22
|
+
subtitle="News・5 hrs"
|
|
23
|
+
actions={
|
|
30
24
|
<IconButton
|
|
31
25
|
transparent
|
|
32
|
-
accessibilityLabel="More
|
|
26
|
+
accessibilityLabel="More options"
|
|
33
27
|
name="more"
|
|
34
28
|
variant="secondary"
|
|
35
29
|
/>
|
|
@@ -40,17 +34,75 @@ function Example() {
|
|
|
40
34
|
}
|
|
41
35
|
```
|
|
42
36
|
|
|
37
|
+
### With Multiple Actions
|
|
38
|
+
|
|
39
|
+
```jsx
|
|
40
|
+
function Example() {
|
|
41
|
+
return (
|
|
42
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
43
|
+
<ContentCardHeader
|
|
44
|
+
thumbnail={<Avatar src={assets.btc.imageUrl} size="l" />}
|
|
45
|
+
title="Bitcoin News"
|
|
46
|
+
subtitle="Markets・2 hrs"
|
|
47
|
+
actions={
|
|
48
|
+
<HStack gap={0}>
|
|
49
|
+
<IconButton transparent accessibilityLabel="Bookmark" name="star" variant="secondary" />
|
|
50
|
+
<IconButton
|
|
51
|
+
transparent
|
|
52
|
+
accessibilityLabel="More options"
|
|
53
|
+
name="more"
|
|
54
|
+
variant="secondary"
|
|
55
|
+
/>
|
|
56
|
+
</HStack>
|
|
57
|
+
}
|
|
58
|
+
/>
|
|
59
|
+
</VStack>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Without Thumbnail
|
|
65
|
+
|
|
66
|
+
```jsx
|
|
67
|
+
function Example() {
|
|
68
|
+
return (
|
|
69
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
70
|
+
<ContentCardHeader
|
|
71
|
+
title="Market Update"
|
|
72
|
+
subtitle="Posted 3 hours ago"
|
|
73
|
+
actions={
|
|
74
|
+
<IconButton transparent accessibilityLabel="Share" name="share" variant="secondary" />
|
|
75
|
+
}
|
|
76
|
+
/>
|
|
77
|
+
</VStack>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Title Only
|
|
83
|
+
|
|
84
|
+
```jsx
|
|
85
|
+
function Example() {
|
|
86
|
+
return (
|
|
87
|
+
<VStack bordered borderRadius="400" maxWidth={375} padding={2}>
|
|
88
|
+
<ContentCardHeader title="Simple Header" />
|
|
89
|
+
</VStack>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
43
94
|
## Props
|
|
44
95
|
|
|
45
96
|
| Prop | Type | Required | Default | Description |
|
|
46
97
|
| --- | --- | --- | --- | --- |
|
|
47
|
-
| `title` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | Yes | `-` |
|
|
98
|
+
| `title` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | Yes | `-` | Text or React node to display as the header title. Use a Text component to override default color and font. |
|
|
99
|
+
| `actions` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Slot for action buttons. |
|
|
48
100
|
| `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
|
|
49
101
|
| `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
|
|
50
102
|
| `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
|
|
51
103
|
| `animated` | `boolean` | No | `-` | - |
|
|
52
104
|
| `aspectRatio` | `string \| number` | No | `-` | - |
|
|
53
|
-
| `avatar` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` |
|
|
105
|
+
| `avatar` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
54
106
|
| `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
|
|
55
107
|
| `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
56
108
|
| `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
@@ -76,7 +128,7 @@ function Example() {
|
|
|
76
128
|
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
77
129
|
| `display` | `flex \| none` | No | `-` | - |
|
|
78
130
|
| `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
|
|
79
|
-
| `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` |
|
|
131
|
+
| `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
80
132
|
| `flexBasis` | `string \| number` | No | `-` | - |
|
|
81
133
|
| `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
|
|
82
134
|
| `flexGrow` | `number` | No | `-` | - |
|
|
@@ -101,7 +153,7 @@ function Example() {
|
|
|
101
153
|
| `marginY` | `0 \| -1 \| -2 \| -0.25 \| -0.5 \| -0.75 \| -1.5 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10` | No | `-` | - |
|
|
102
154
|
| `maxHeight` | `string \| number` | No | `-` | - |
|
|
103
155
|
| `maxWidth` | `string \| number` | No | `-` | - |
|
|
104
|
-
| `meta` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` |
|
|
156
|
+
| `meta` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
105
157
|
| `minHeight` | `string \| number` | No | `-` | - |
|
|
106
158
|
| `minWidth` | `string \| number` | No | `-` | - |
|
|
107
159
|
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
@@ -131,11 +183,14 @@ function Example() {
|
|
|
131
183
|
| `right` | `string \| number` | No | `-` | - |
|
|
132
184
|
| `rowGap` | `0 \| 1 \| 2 \| 0.25 \| 0.5 \| 0.75 \| 1.5 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10` | No | `-` | - |
|
|
133
185
|
| `style` | `false \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]> \| null` | No | `-` | - |
|
|
186
|
+
| `styles` | `{ root?: StyleProp<ViewStyle>; textContainer?: StyleProp<ViewStyle>; contentContainer?: StyleProp<ViewStyle>; }` | No | `-` | - |
|
|
187
|
+
| `subtitle` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Text or React node to display as the header subtitle. Use a Text component to override default color and font. |
|
|
134
188
|
| `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID Used to locate this element in unit and end-to-end tests. Used to locate this view in end-to-end tests. |
|
|
135
189
|
| `textAlign` | `left \| right \| auto \| center \| justify` | No | `-` | - |
|
|
136
190
|
| `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
|
|
137
191
|
| `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
|
|
138
192
|
| `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
|
|
193
|
+
| `thumbnail` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | A media object like an image, avatar, illustration, or cryptocurrency asset. |
|
|
139
194
|
| `top` | `string \| number` | No | `-` | - |
|
|
140
195
|
| `transform` | `string \| (({ scaleX: AnimatableNumericValue; } & { scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scaleY: AnimatableNumericValue; } & { scaleX?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateX: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateY: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ perspective: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotate: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateZ: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scale: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; matrix?: undefined; }) \| ({ matrix: AnimatableNumericValue[]; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; }))[]` | No | `-` | - |
|
|
141
196
|
| `userSelect` | `none \| auto \| contain \| text \| all` | No | `-` | - |
|