@coinbase/cds-mcp-server 8.46.0 → 8.47.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 +8 -0
- package/mcp-docs/mobile/components/Button.txt +19 -0
- package/mcp-docs/mobile/components/SlideButton.txt +115 -18
- package/mcp-docs/mobile/getting-started/installation.txt +4 -0
- package/mcp-docs/mobile/getting-started/templates.txt +78 -0
- package/mcp-docs/mobile/routes.txt +1 -0
- package/mcp-docs/web/components/Button.txt +19 -0
- package/mcp-docs/web/getting-started/installation.txt +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.47.0 ((2/19/2026, 08:05 AM PST))
|
|
12
|
+
|
|
13
|
+
This is an artificial version bump with no new change.
|
|
14
|
+
|
|
15
|
+
## 8.46.1 ((2/12/2026, 01:01 PM PST))
|
|
16
|
+
|
|
17
|
+
This is an artificial version bump with no new change.
|
|
18
|
+
|
|
11
19
|
## 8.46.0 ((2/12/2026, 11:34 AM PST))
|
|
12
20
|
|
|
13
21
|
This is an artificial version bump with no new change.
|
|
@@ -129,6 +129,25 @@ Use `block` to make the button expand to fill its container width.
|
|
|
129
129
|
</VStack>
|
|
130
130
|
```
|
|
131
131
|
|
|
132
|
+
### Typography
|
|
133
|
+
|
|
134
|
+
Button forwards text-related font props to the internal `Text` label, so you can customize typography without rendering a custom child.
|
|
135
|
+
|
|
136
|
+
```jsx
|
|
137
|
+
<VStack alignItems="flex-start" gap={2}>
|
|
138
|
+
<Button onPress={console.log}>Default (headline)</Button>
|
|
139
|
+
<Button font="body" onPress={console.log}>
|
|
140
|
+
Body font
|
|
141
|
+
</Button>
|
|
142
|
+
<Button font="title3" onPress={console.log}>
|
|
143
|
+
Title3 font
|
|
144
|
+
</Button>
|
|
145
|
+
<Button fontSize="title3" fontWeight="body" onPress={console.log}>
|
|
146
|
+
Custom fontSize + fontWeight
|
|
147
|
+
</Button>
|
|
148
|
+
</VStack>
|
|
149
|
+
```
|
|
150
|
+
|
|
132
151
|
### Icons
|
|
133
152
|
|
|
134
153
|
#### End Icon
|
|
@@ -13,9 +13,9 @@ import { SlideButton } from '@coinbase/cds-mobile/buttons/SlideButton'
|
|
|
13
13
|
import useBaseUrl from '@docusaurus/useBaseUrl';
|
|
14
14
|
import ThemedImage from '@theme/ThemedImage';
|
|
15
15
|
|
|
16
|
-
###
|
|
16
|
+
### Basics
|
|
17
17
|
|
|
18
|
-
Use the `onChange`
|
|
18
|
+
Use the `onChange` callback to update the `checked` state. This is the primary callback that controls both the visual and accessible state of the component.
|
|
19
19
|
|
|
20
20
|
<ThemedImage
|
|
21
21
|
sources={{
|
|
@@ -37,7 +37,6 @@ function Example() {
|
|
|
37
37
|
<SlideButton
|
|
38
38
|
checked={checked}
|
|
39
39
|
onChange={setChecked}
|
|
40
|
-
onSlideComplete={() => console.log('Completed')}
|
|
41
40
|
uncheckedLabel="Swipe to confirm"
|
|
42
41
|
checkedLabel="Confirming..."
|
|
43
42
|
/>
|
|
@@ -45,9 +44,9 @@ function Example() {
|
|
|
45
44
|
}
|
|
46
45
|
```
|
|
47
46
|
|
|
48
|
-
###
|
|
47
|
+
### Variants
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
Use the `variant` prop to change the color of the button. The default variant is `primary`. Available variants are `negative` and `positive`.
|
|
51
50
|
|
|
52
51
|
<ThemedImage
|
|
53
52
|
sources={{
|
|
@@ -69,7 +68,6 @@ function Example() {
|
|
|
69
68
|
<SlideButton
|
|
70
69
|
checked={checked}
|
|
71
70
|
onChange={setChecked}
|
|
72
|
-
onSlideComplete={() => console.log('Completed')}
|
|
73
71
|
uncheckedLabel="Swipe to confirm"
|
|
74
72
|
checkedLabel="Confirming..."
|
|
75
73
|
variant="negative"
|
|
@@ -78,7 +76,7 @@ function Example() {
|
|
|
78
76
|
}
|
|
79
77
|
```
|
|
80
78
|
|
|
81
|
-
### Compact
|
|
79
|
+
### Compact
|
|
82
80
|
|
|
83
81
|
Use the `compact` prop to reduce the height, border-radius and padding of the button:
|
|
84
82
|
|
|
@@ -90,7 +88,6 @@ function Example() {
|
|
|
90
88
|
<SlideButton
|
|
91
89
|
checked={checked}
|
|
92
90
|
onChange={setChecked}
|
|
93
|
-
onSlideComplete={() => console.log('Completed')}
|
|
94
91
|
uncheckedLabel="Swipe to confirm"
|
|
95
92
|
checkedLabel="Confirming..."
|
|
96
93
|
compact
|
|
@@ -99,9 +96,31 @@ function Example() {
|
|
|
99
96
|
}
|
|
100
97
|
```
|
|
101
98
|
|
|
99
|
+
### Disabled
|
|
100
|
+
|
|
101
|
+
Use the `disabled` prop to prevent interaction. This works for both unchecked and checked states.
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
function Example() {
|
|
105
|
+
return (
|
|
106
|
+
<VStack gap={2}>
|
|
107
|
+
<SlideButton
|
|
108
|
+
checked={false}
|
|
109
|
+
disabled
|
|
110
|
+
uncheckedLabel="Swipe to confirm"
|
|
111
|
+
checkedLabel="Confirming..."
|
|
112
|
+
/>
|
|
113
|
+
<SlideButton checked disabled uncheckedLabel="Swipe to confirm" checkedLabel="Confirmed" />
|
|
114
|
+
</VStack>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
102
119
|
### Auto Complete on Threshold
|
|
103
120
|
|
|
104
|
-
|
|
121
|
+
By default, the user must release the handle past the threshold to complete. Set `autoCompleteSlideOnThresholdMet` to automatically complete as soon as the threshold is reached, without requiring release.
|
|
122
|
+
|
|
123
|
+
You can also adjust the threshold via `checkThreshold` (a value from 0 to 1, defaulting to 0.7).
|
|
105
124
|
|
|
106
125
|
```jsx
|
|
107
126
|
function Example() {
|
|
@@ -111,7 +130,6 @@ function Example() {
|
|
|
111
130
|
<SlideButton
|
|
112
131
|
checked={checked}
|
|
113
132
|
onChange={setChecked}
|
|
114
|
-
onSlideComplete={() => console.log('Completed')}
|
|
115
133
|
uncheckedLabel="Swipe to confirm"
|
|
116
134
|
checkedLabel="Confirming..."
|
|
117
135
|
autoCompleteSlideOnThresholdMet
|
|
@@ -120,9 +138,41 @@ function Example() {
|
|
|
120
138
|
}
|
|
121
139
|
```
|
|
122
140
|
|
|
123
|
-
###
|
|
141
|
+
### Callback Lifecycle
|
|
142
|
+
|
|
143
|
+
SlideButton fires callbacks in a specific order during the slide gesture:
|
|
144
|
+
|
|
145
|
+
1. `onSlideStart` -- when the gesture begins
|
|
146
|
+
2. `onChange` -- when the slide completes past the threshold (sets `checked` to `true`)
|
|
147
|
+
3. `onSlideComplete` -- immediately after `onChange`
|
|
148
|
+
4. `onSlideEnd` -- always fires last
|
|
149
|
+
|
|
150
|
+
If the user releases before the threshold, `onSlideCancel` fires instead, followed by `onSlideEnd`.
|
|
151
|
+
|
|
152
|
+
**Important:** Always use `onChange` to manage the `checked` state. The `checked` prop drives the component's `accessibilityLabel` (switching between `uncheckedLabel` and `checkedLabel`), so failing to update it means screen readers won't announce the state change. Use `onSlideComplete` only for supplementary side effects (e.g. analytics, haptic feedback) that don't affect accessible state.
|
|
153
|
+
|
|
154
|
+
```jsx
|
|
155
|
+
function Example() {
|
|
156
|
+
const [checked, setChecked] = useState(false);
|
|
157
|
+
|
|
158
|
+
return (
|
|
159
|
+
<SlideButton
|
|
160
|
+
checked={checked}
|
|
161
|
+
onChange={setChecked}
|
|
162
|
+
onSlideStart={() => console.log('Started')}
|
|
163
|
+
onSlideComplete={() => console.log('Completed')}
|
|
164
|
+
onSlideCancel={() => console.log('Cancelled')}
|
|
165
|
+
onSlideEnd={() => console.log('Ended')}
|
|
166
|
+
uncheckedLabel="Swipe to confirm"
|
|
167
|
+
checkedLabel="Confirming..."
|
|
168
|
+
/>
|
|
169
|
+
);
|
|
170
|
+
}
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### Custom Nodes
|
|
124
174
|
|
|
125
|
-
|
|
175
|
+
Use `startUncheckedNode` and `endCheckedNode` to replace the default arrow icon and loading indicator on the handle.
|
|
126
176
|
|
|
127
177
|
<ThemedImage
|
|
128
178
|
sources={{
|
|
@@ -133,7 +183,7 @@ You can also use SlideButton with custom nodes.
|
|
|
133
183
|
borderRadius: 'var(--borderRadius-400)',
|
|
134
184
|
border: '1.5px solid var(--color-bgLine)',
|
|
135
185
|
}}
|
|
136
|
-
alt="
|
|
186
|
+
alt="Slide button with custom bell icons on the handle"
|
|
137
187
|
/>
|
|
138
188
|
|
|
139
189
|
```jsx
|
|
@@ -144,11 +194,33 @@ function Example() {
|
|
|
144
194
|
<SlideButton
|
|
145
195
|
checked={checked}
|
|
146
196
|
onChange={setChecked}
|
|
147
|
-
onSlideComplete={() => console.log('Completed')}
|
|
148
197
|
uncheckedLabel="Swipe to enable notifications"
|
|
149
198
|
checkedLabel="Enabling..."
|
|
150
|
-
startUncheckedNode={<Icon color="fgInverse" name="
|
|
151
|
-
endCheckedNode={<Icon color="fgInverse" name="
|
|
199
|
+
startUncheckedNode={<Icon color="fgInverse" name="bell" size="m" />}
|
|
200
|
+
endCheckedNode={<Icon color="fgInverse" name="bellCheck" size="m" />}
|
|
201
|
+
/>
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Labels as Nodes
|
|
207
|
+
|
|
208
|
+
The `uncheckedLabel` and `checkedLabel` props accept `ReactNode`, so you can pass custom styled text or other components. When using non-string labels, the component uses `accessibilityLabelledBy` to associate the handle with the container element, so ensure your label nodes contain meaningful text content.
|
|
209
|
+
|
|
210
|
+
```jsx
|
|
211
|
+
function Example() {
|
|
212
|
+
const [checked, setChecked] = useState(false);
|
|
213
|
+
|
|
214
|
+
return (
|
|
215
|
+
<SlideButton
|
|
216
|
+
checked={checked}
|
|
217
|
+
onChange={setChecked}
|
|
218
|
+
uncheckedLabel={<Text font="label2">Swipe to confirm</Text>}
|
|
219
|
+
checkedLabel={
|
|
220
|
+
<Text color="fgInverse" font="label2">
|
|
221
|
+
Confirming...
|
|
222
|
+
</Text>
|
|
223
|
+
}
|
|
152
224
|
/>
|
|
153
225
|
);
|
|
154
226
|
}
|
|
@@ -156,7 +228,7 @@ function Example() {
|
|
|
156
228
|
|
|
157
229
|
### Custom Background and Handle Components
|
|
158
230
|
|
|
159
|
-
You can customize the background and handle components
|
|
231
|
+
You can fully customize the background and handle by providing your own components via `SlideButtonBackgroundComponent` and `SlideButtonHandleComponent`. Your components receive typed props (`SlideButtonBackgroundProps` and `SlideButtonHandleProps`) including a `progress` spring value and the current `checked` state.
|
|
160
232
|
|
|
161
233
|
<ThemedImage
|
|
162
234
|
sources={{
|
|
@@ -167,7 +239,7 @@ You can customize the background and handle components of the SlideButton.
|
|
|
167
239
|
borderRadius: 'var(--borderRadius-400)',
|
|
168
240
|
border: '1.5px solid var(--color-bgLine)',
|
|
169
241
|
}}
|
|
170
|
-
alt="
|
|
242
|
+
alt="Slide button with custom green/red background and handle"
|
|
171
243
|
/>
|
|
172
244
|
|
|
173
245
|
```jsx
|
|
@@ -221,6 +293,31 @@ function Example() {
|
|
|
221
293
|
}
|
|
222
294
|
```
|
|
223
295
|
|
|
296
|
+
### Accessibility
|
|
297
|
+
|
|
298
|
+
SlideButton has built-in accessibility support. The component automatically derives its `accessibilityLabel` from the `checked` state -- displaying `uncheckedLabel` when unchecked and `checkedLabel` when checked. It also registers an `activate` accessibility action so screen readers can trigger the slide without performing a gesture.
|
|
299
|
+
|
|
300
|
+
**Use `onChange` as your primary callback.** The `onChange` callback updates the `checked` prop, which controls the accessible label. Placing critical logic in `onSlideComplete` without updating `checked` via `onChange` will leave the accessible state stale, meaning screen readers won't announce the confirmation.
|
|
301
|
+
|
|
302
|
+
When providing a custom `SlideButtonHandleComponent`, always spread the incoming props to preserve the built-in `accessibilityActions` and `onAccessibilityAction` handlers, and set `accessibilityLabel` and `accessibilityRole="button"` on the handle element.
|
|
303
|
+
|
|
304
|
+
When using `ReactNode` labels instead of strings, the component uses `accessibilityLabelledBy` to link to the container element, so ensure your custom label nodes contain meaningful text.
|
|
305
|
+
|
|
306
|
+
```jsx
|
|
307
|
+
function Example() {
|
|
308
|
+
const [checked, setChecked] = useState(false);
|
|
309
|
+
|
|
310
|
+
return (
|
|
311
|
+
<SlideButton
|
|
312
|
+
checked={checked}
|
|
313
|
+
onChange={setChecked}
|
|
314
|
+
uncheckedLabel="Swipe to send payment"
|
|
315
|
+
checkedLabel="Sending payment..."
|
|
316
|
+
/>
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
```
|
|
320
|
+
|
|
224
321
|
## Props
|
|
225
322
|
|
|
226
323
|
| Prop | Type | Required | Default | Description |
|
|
@@ -4,6 +4,10 @@ This guide will help you get started with installing CDS in your React Native pr
|
|
|
4
4
|
|
|
5
5
|
### Installation
|
|
6
6
|
|
|
7
|
+
:::tip Starting a new project?
|
|
8
|
+
Check out our [templates](/getting-started/templates) for pre-configured starter apps with CDS already set up.
|
|
9
|
+
:::
|
|
10
|
+
|
|
7
11
|
To install the CDS library for React Native applications, run the following command:
|
|
8
12
|
|
|
9
13
|
```bash
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# templates
|
|
2
|
+
|
|
3
|
+
Get started quickly with a pre-built Expo template configured with CDS components and best practices.
|
|
4
|
+
|
|
5
|
+
import { TemplateCard } from '@site/src/components/page/TemplateCard';
|
|
6
|
+
import { HStack } from '@coinbase/cds-web/layout';
|
|
7
|
+
import ThemedImage from '@theme/ThemedImage';
|
|
8
|
+
|
|
9
|
+
### Get started
|
|
10
|
+
|
|
11
|
+
The easiest way to get started with CDS on mobile is with a template. The Expo template includes the required CDS packages, dependencies, and pre-configured settings with a working example application to help you start building.
|
|
12
|
+
|
|
13
|
+
<HStack gap={2} style={{ marginTop: '1.5rem', flexWrap: 'wrap', alignItems: 'stretch' }}>
|
|
14
|
+
<TemplateCard
|
|
15
|
+
name="Expo"
|
|
16
|
+
description="Built for cross-platform mobile applications with React Native"
|
|
17
|
+
href="https://github.com/coinbase/cds/tree/master/templates/expo-app"
|
|
18
|
+
icon={
|
|
19
|
+
<ThemedImage
|
|
20
|
+
sources={{
|
|
21
|
+
light: '/img/logos/frameworks/expo_light.png',
|
|
22
|
+
dark: '/img/logos/frameworks/expo_dark.png',
|
|
23
|
+
}}
|
|
24
|
+
alt="Expo"
|
|
25
|
+
style={{ paddingTop: 'var(--space-0_75)', paddingBottom: 'var(--space-0_75)' }}
|
|
26
|
+
height="100%"
|
|
27
|
+
/>
|
|
28
|
+
}
|
|
29
|
+
/>
|
|
30
|
+
</HStack>
|
|
31
|
+
|
|
32
|
+
### Installation
|
|
33
|
+
|
|
34
|
+
To create a new project from the template, use `gitpick` to bootstrap your application:
|
|
35
|
+
|
|
36
|
+
#### Expo
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx -y gitpick coinbase/cds/tree/master/templates/expo-app cds-expo
|
|
40
|
+
cd cds-expo
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Setup
|
|
44
|
+
|
|
45
|
+
After creating your project, install dependencies and start developing:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
## We suggest using nvm to manage Node.js versions
|
|
49
|
+
nvm install
|
|
50
|
+
nvm use
|
|
51
|
+
|
|
52
|
+
## Enable corepack for package manager setup
|
|
53
|
+
corepack enable
|
|
54
|
+
|
|
55
|
+
## Install dependencies
|
|
56
|
+
yarn
|
|
57
|
+
|
|
58
|
+
## Start development server
|
|
59
|
+
yarn start
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### What's included
|
|
63
|
+
|
|
64
|
+
All templates come pre-configured with:
|
|
65
|
+
|
|
66
|
+
- Latest CDS packages (`@coinbase/cds-mobile`, `@coinbase/cds-icons`, etc.)
|
|
67
|
+
- TypeScript configuration
|
|
68
|
+
- Example components demonstrating common UI patterns
|
|
69
|
+
- Theme setup with CDS default theme
|
|
70
|
+
- Navigation with React Navigation
|
|
71
|
+
|
|
72
|
+
### Next steps
|
|
73
|
+
|
|
74
|
+
After setting up your template, learn how to customize and extend CDS:
|
|
75
|
+
|
|
76
|
+
- [Theming](/getting-started/theming) - Customize colors, spacing, and typography
|
|
77
|
+
- [Installation](/getting-started/installation) - Manual installation and setup options
|
|
78
|
+
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
## Getting Started
|
|
5
5
|
|
|
6
6
|
- [theming](mobile/getting-started/theming.txt): The theme contains design tokens like colors, fonts, spacing, and more. The ThemeProvider provides access to these values via CSS Variables for web, and React Context for both web and React Native.
|
|
7
|
+
- [templates](mobile/getting-started/templates.txt): Get started quickly with a pre-built Expo template configured with CDS components and best practices.
|
|
7
8
|
- [styling](mobile/getting-started/styling.txt): CDS includes powerful and flexible APIs for styling components. Easily access values from the theme, or go rogue with full customization.
|
|
8
9
|
- [playground](mobile/getting-started/playground.txt)
|
|
9
10
|
- [introduction](mobile/getting-started/introduction.txt)
|
|
@@ -143,6 +143,25 @@ Use `block` to make the button expand to fill its container width.
|
|
|
143
143
|
</VStack>
|
|
144
144
|
```
|
|
145
145
|
|
|
146
|
+
### Typography
|
|
147
|
+
|
|
148
|
+
Button forwards text-related font props to the internal `Text` label, so you can customize typography without rendering a custom child.
|
|
149
|
+
|
|
150
|
+
```jsx live
|
|
151
|
+
<VStack alignItems="flex-start" gap={2}>
|
|
152
|
+
<Button onClick={console.log}>Default (headline)</Button>
|
|
153
|
+
<Button font="body" onClick={console.log}>
|
|
154
|
+
Body font
|
|
155
|
+
</Button>
|
|
156
|
+
<Button font="title3" onClick={console.log}>
|
|
157
|
+
Title3 font
|
|
158
|
+
</Button>
|
|
159
|
+
<Button fontSize="title3" fontWeight="body" onClick={console.log}>
|
|
160
|
+
Custom fontSize + fontWeight
|
|
161
|
+
</Button>
|
|
162
|
+
</VStack>
|
|
163
|
+
```
|
|
164
|
+
|
|
146
165
|
### Icons
|
|
147
166
|
|
|
148
167
|
#### End Icon
|
|
@@ -4,6 +4,10 @@ This guide will help you get started with installing CDS in your React project.
|
|
|
4
4
|
|
|
5
5
|
### Installation
|
|
6
6
|
|
|
7
|
+
:::tip Starting a new project?
|
|
8
|
+
Check out our [templates](/getting-started/templates) for pre-configured starter apps with CDS already set up.
|
|
9
|
+
:::
|
|
10
|
+
|
|
7
11
|
To install the CDS library for React web applications, run the following command:
|
|
8
12
|
|
|
9
13
|
```bash
|