@coinbase/cds-mcp-server 8.17.2 → 8.17.4

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.
Files changed (284) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/mcp-docs/mobile/components/Accordion.txt +188 -0
  3. package/mcp-docs/mobile/components/AccordionItem.txt +29 -0
  4. package/mcp-docs/mobile/components/Alert.txt +155 -0
  5. package/mcp-docs/mobile/components/AreaChart.txt +265 -0
  6. package/mcp-docs/mobile/components/Avatar.txt +195 -0
  7. package/mcp-docs/mobile/components/AvatarButton.txt +225 -0
  8. package/mcp-docs/mobile/components/Banner.txt +221 -0
  9. package/mcp-docs/mobile/components/BarChart.txt +815 -0
  10. package/mcp-docs/mobile/components/Box.txt +173 -0
  11. package/mcp-docs/mobile/components/BrowserBar.txt +146 -0
  12. package/mcp-docs/mobile/components/Button.txt +198 -0
  13. package/mcp-docs/mobile/components/ButtonGroup.txt +79 -0
  14. package/mcp-docs/mobile/components/Carousel.txt +1083 -0
  15. package/mcp-docs/mobile/components/CartesianChart.txt +825 -0
  16. package/mcp-docs/mobile/components/CellMedia.txt +70 -0
  17. package/mcp-docs/mobile/components/Checkbox.txt +245 -0
  18. package/mcp-docs/mobile/components/CheckboxCell.txt +201 -0
  19. package/mcp-docs/mobile/components/CheckboxGroup.txt +284 -0
  20. package/mcp-docs/mobile/components/Chip.txt +194 -0
  21. package/mcp-docs/mobile/components/Coachmark.txt +157 -0
  22. package/mcp-docs/mobile/components/Collapsible.txt +104 -0
  23. package/mcp-docs/mobile/components/ContainedAssetCard.txt +134 -0
  24. package/mcp-docs/mobile/components/ContentCard.txt +365 -0
  25. package/mcp-docs/mobile/components/ContentCardBody.txt +135 -0
  26. package/mcp-docs/mobile/components/ContentCardFooter.txt +127 -0
  27. package/mcp-docs/mobile/components/ContentCardHeader.txt +145 -0
  28. package/mcp-docs/mobile/components/ContentCell.txt +226 -0
  29. package/mcp-docs/mobile/components/ControlGroup.txt +443 -0
  30. package/mcp-docs/mobile/components/DatePicker.txt +496 -0
  31. package/mcp-docs/mobile/components/Divider.txt +138 -0
  32. package/mcp-docs/mobile/components/DotCount.txt +145 -0
  33. package/mcp-docs/mobile/components/DotStatusColor.txt +58 -0
  34. package/mcp-docs/mobile/components/DotSymbol.txt +134 -0
  35. package/mcp-docs/mobile/components/Fallback.txt +157 -0
  36. package/mcp-docs/mobile/components/FloatingAssetCard.txt +155 -0
  37. package/mcp-docs/mobile/components/HStack.txt +234 -0
  38. package/mcp-docs/mobile/components/HeroSquare.txt +47 -0
  39. package/mcp-docs/mobile/components/Icon.txt +51 -0
  40. package/mcp-docs/mobile/components/IconButton.txt +268 -0
  41. package/mcp-docs/mobile/components/InputChip.txt +187 -0
  42. package/mcp-docs/mobile/components/Interactable.txt +186 -0
  43. package/mcp-docs/mobile/components/LineChart.txt +1324 -0
  44. package/mcp-docs/mobile/components/Link.txt +291 -0
  45. package/mcp-docs/mobile/components/ListCell.txt +412 -0
  46. package/mcp-docs/mobile/components/LogoMark.txt +84 -0
  47. package/mcp-docs/mobile/components/LogoWordMark.txt +93 -0
  48. package/mcp-docs/mobile/components/Lottie.txt +138 -0
  49. package/mcp-docs/mobile/components/LottieStatusAnimation.txt +46 -0
  50. package/mcp-docs/mobile/components/Modal.txt +83 -0
  51. package/mcp-docs/mobile/components/ModalBody.txt +33 -0
  52. package/mcp-docs/mobile/components/ModalFooter.txt +24 -0
  53. package/mcp-docs/mobile/components/ModalHeader.txt +27 -0
  54. package/mcp-docs/mobile/components/MultiContentModule.txt +379 -0
  55. package/mcp-docs/mobile/components/NavigationTitle.txt +131 -0
  56. package/mcp-docs/mobile/components/NavigationTitleSelect.txt +141 -0
  57. package/mcp-docs/mobile/components/NudgeCard.txt +89 -0
  58. package/mcp-docs/mobile/components/Numpad.txt +340 -0
  59. package/mcp-docs/mobile/components/Overlay.txt +151 -0
  60. package/mcp-docs/mobile/components/PageFooter.txt +160 -0
  61. package/mcp-docs/mobile/components/PageHeader.txt +185 -0
  62. package/mcp-docs/mobile/components/PeriodSelector.txt +407 -0
  63. package/mcp-docs/mobile/components/Pictogram.txt +47 -0
  64. package/mcp-docs/mobile/components/Point.txt +204 -0
  65. package/mcp-docs/mobile/components/PortalProvider.txt +78 -0
  66. package/mcp-docs/mobile/components/Pressable.txt +210 -0
  67. package/mcp-docs/mobile/components/ProgressBar.txt +129 -0
  68. package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +160 -0
  69. package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +137 -0
  70. package/mcp-docs/mobile/components/ProgressCircle.txt +236 -0
  71. package/mcp-docs/mobile/components/Radio.txt +241 -0
  72. package/mcp-docs/mobile/components/RadioCell.txt +201 -0
  73. package/mcp-docs/mobile/components/RadioGroup.txt +281 -0
  74. package/mcp-docs/mobile/components/ReferenceLine.txt +152 -0
  75. package/mcp-docs/mobile/components/RemoteImage.txt +105 -0
  76. package/mcp-docs/mobile/components/RemoteImageGroup.txt +60 -0
  77. package/mcp-docs/mobile/components/RollingNumber.txt +788 -0
  78. package/mcp-docs/mobile/components/Scrubber.txt +203 -0
  79. package/mcp-docs/mobile/components/SearchInput.txt +191 -0
  80. package/mcp-docs/mobile/components/SectionHeader.txt +204 -0
  81. package/mcp-docs/mobile/components/SegmentedTabs.txt +315 -0
  82. package/mcp-docs/mobile/components/Select.txt +211 -0
  83. package/mcp-docs/mobile/components/SelectChip.txt +323 -0
  84. package/mcp-docs/mobile/components/SelectOption.txt +84 -0
  85. package/mcp-docs/mobile/components/SlideButton.txt +330 -0
  86. package/mcp-docs/mobile/components/Spacer.txt +83 -0
  87. package/mcp-docs/mobile/components/Sparkline.txt +122 -0
  88. package/mcp-docs/mobile/components/SparklineGradient.txt +106 -0
  89. package/mcp-docs/mobile/components/SparklineInteractive.txt +156 -0
  90. package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +72 -0
  91. package/mcp-docs/mobile/components/Spinner.txt +48 -0
  92. package/mcp-docs/mobile/components/SpotIcon.txt +47 -0
  93. package/mcp-docs/mobile/components/SpotRectangle.txt +47 -0
  94. package/mcp-docs/mobile/components/SpotSquare.txt +47 -0
  95. package/mcp-docs/mobile/components/Stepper.txt +527 -0
  96. package/mcp-docs/mobile/components/SubBrandLogoMark.txt +125 -0
  97. package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +125 -0
  98. package/mcp-docs/mobile/components/Switch.txt +97 -0
  99. package/mcp-docs/mobile/components/TabIndicator.txt +48 -0
  100. package/mcp-docs/mobile/components/TabLabel.txt +153 -0
  101. package/mcp-docs/mobile/components/TabNavigation.txt +146 -0
  102. package/mcp-docs/mobile/components/TabbedChips.txt +142 -0
  103. package/mcp-docs/mobile/components/Tabs.txt +190 -0
  104. package/mcp-docs/mobile/components/Tag.txt +300 -0
  105. package/mcp-docs/mobile/components/Text.txt +211 -0
  106. package/mcp-docs/mobile/components/TextInput.txt +717 -0
  107. package/mcp-docs/mobile/components/ThemeProvider.txt +132 -0
  108. package/mcp-docs/mobile/components/Toast.txt +196 -0
  109. package/mcp-docs/mobile/components/Tooltip.txt +59 -0
  110. package/mcp-docs/mobile/components/TopNavBar.txt +161 -0
  111. package/mcp-docs/mobile/components/Tour.txt +158 -0
  112. package/mcp-docs/mobile/components/Tray.txt +252 -0
  113. package/mcp-docs/mobile/components/UpsellCard.txt +321 -0
  114. package/mcp-docs/mobile/components/VStack.txt +222 -0
  115. package/mcp-docs/mobile/components/XAxis.txt +621 -0
  116. package/mcp-docs/mobile/components/YAxis.txt +567 -0
  117. package/mcp-docs/mobile/getting-started/ai-overview.txt +108 -0
  118. package/mcp-docs/mobile/getting-started/installation.txt +57 -0
  119. package/mcp-docs/mobile/getting-started/introduction.txt +102 -0
  120. package/mcp-docs/mobile/getting-started/playground.txt +28 -0
  121. package/mcp-docs/mobile/getting-started/styling.txt +84 -0
  122. package/mcp-docs/mobile/getting-started/theming.txt +286 -0
  123. package/mcp-docs/mobile/hooks/useDimensions.txt +72 -0
  124. package/mcp-docs/mobile/hooks/useEventHandler.txt +120 -0
  125. package/mcp-docs/mobile/hooks/useMergeRefs.txt +116 -0
  126. package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +280 -0
  127. package/mcp-docs/mobile/hooks/usePreviousValue.txt +74 -0
  128. package/mcp-docs/mobile/hooks/useRefMap.txt +178 -0
  129. package/mcp-docs/mobile/hooks/useTheme.txt +321 -0
  130. package/mcp-docs/mobile/routes.txt +139 -0
  131. package/mcp-docs/web/components/Accordion.txt +189 -0
  132. package/mcp-docs/web/components/AccordionItem.txt +31 -0
  133. package/mcp-docs/web/components/Alert.txt +164 -0
  134. package/mcp-docs/web/components/AreaChart.txt +510 -0
  135. package/mcp-docs/web/components/Avatar.txt +211 -0
  136. package/mcp-docs/web/components/AvatarButton.txt +240 -0
  137. package/mcp-docs/web/components/Banner.txt +226 -0
  138. package/mcp-docs/web/components/BarChart.txt +1267 -0
  139. package/mcp-docs/web/components/Box.txt +175 -0
  140. package/mcp-docs/web/components/Button.txt +212 -0
  141. package/mcp-docs/web/components/ButtonGroup.txt +79 -0
  142. package/mcp-docs/web/components/Calendar.txt +181 -0
  143. package/mcp-docs/web/components/Carousel.txt +1575 -0
  144. package/mcp-docs/web/components/CartesianChart.txt +1044 -0
  145. package/mcp-docs/web/components/CellMedia.txt +56 -0
  146. package/mcp-docs/web/components/Checkbox.txt +188 -0
  147. package/mcp-docs/web/components/CheckboxCell.txt +202 -0
  148. package/mcp-docs/web/components/CheckboxGroup.txt +219 -0
  149. package/mcp-docs/web/components/Chip.txt +196 -0
  150. package/mcp-docs/web/components/Coachmark.txt +188 -0
  151. package/mcp-docs/web/components/Collapsible.txt +119 -0
  152. package/mcp-docs/web/components/ContainedAssetCard.txt +232 -0
  153. package/mcp-docs/web/components/ContentCard.txt +367 -0
  154. package/mcp-docs/web/components/ContentCardBody.txt +137 -0
  155. package/mcp-docs/web/components/ContentCardFooter.txt +129 -0
  156. package/mcp-docs/web/components/ContentCardHeader.txt +147 -0
  157. package/mcp-docs/web/components/ContentCell.txt +219 -0
  158. package/mcp-docs/web/components/ControlGroup.txt +436 -0
  159. package/mcp-docs/web/components/DatePicker.txt +505 -0
  160. package/mcp-docs/web/components/Divider.txt +143 -0
  161. package/mcp-docs/web/components/DotCount.txt +149 -0
  162. package/mcp-docs/web/components/DotStatusColor.txt +58 -0
  163. package/mcp-docs/web/components/DotSymbol.txt +137 -0
  164. package/mcp-docs/web/components/Dropdown.txt +119 -0
  165. package/mcp-docs/web/components/Fallback.txt +163 -0
  166. package/mcp-docs/web/components/FloatingAssetCard.txt +250 -0
  167. package/mcp-docs/web/components/FullscreenAlert.txt +69 -0
  168. package/mcp-docs/web/components/FullscreenModal.txt +145 -0
  169. package/mcp-docs/web/components/FullscreenModalLayout.txt +187 -0
  170. package/mcp-docs/web/components/Grid.txt +236 -0
  171. package/mcp-docs/web/components/GridColumn.txt +209 -0
  172. package/mcp-docs/web/components/HStack.txt +236 -0
  173. package/mcp-docs/web/components/HeroSquare.txt +48 -0
  174. package/mcp-docs/web/components/Icon.txt +145 -0
  175. package/mcp-docs/web/components/IconButton.txt +390 -0
  176. package/mcp-docs/web/components/InputChip.txt +187 -0
  177. package/mcp-docs/web/components/Interactable.txt +193 -0
  178. package/mcp-docs/web/components/LineChart.txt +1576 -0
  179. package/mcp-docs/web/components/Link.txt +243 -0
  180. package/mcp-docs/web/components/ListCell.txt +418 -0
  181. package/mcp-docs/web/components/LogoMark.txt +84 -0
  182. package/mcp-docs/web/components/LogoWordMark.txt +93 -0
  183. package/mcp-docs/web/components/Lottie.txt +157 -0
  184. package/mcp-docs/web/components/LottieStatusAnimation.txt +57 -0
  185. package/mcp-docs/web/components/MediaQueryProvider.txt +108 -0
  186. package/mcp-docs/web/components/Modal.txt +196 -0
  187. package/mcp-docs/web/components/ModalBody.txt +117 -0
  188. package/mcp-docs/web/components/ModalFooter.txt +119 -0
  189. package/mcp-docs/web/components/ModalHeader.txt +123 -0
  190. package/mcp-docs/web/components/MultiContentModule.txt +381 -0
  191. package/mcp-docs/web/components/NavigationBar.txt +102 -0
  192. package/mcp-docs/web/components/NavigationTitle.txt +25 -0
  193. package/mcp-docs/web/components/NavigationTitleSelect.txt +45 -0
  194. package/mcp-docs/web/components/NudgeCard.txt +181 -0
  195. package/mcp-docs/web/components/Overlay.txt +171 -0
  196. package/mcp-docs/web/components/PageFooter.txt +184 -0
  197. package/mcp-docs/web/components/PageHeader.txt +243 -0
  198. package/mcp-docs/web/components/Pagination.txt +499 -0
  199. package/mcp-docs/web/components/PeriodSelector.txt +703 -0
  200. package/mcp-docs/web/components/Pictogram.txt +48 -0
  201. package/mcp-docs/web/components/Point.txt +460 -0
  202. package/mcp-docs/web/components/PortalProvider.txt +76 -0
  203. package/mcp-docs/web/components/Pressable.txt +193 -0
  204. package/mcp-docs/web/components/ProgressBar.txt +163 -0
  205. package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +212 -0
  206. package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +181 -0
  207. package/mcp-docs/web/components/ProgressCircle.txt +443 -0
  208. package/mcp-docs/web/components/Radio.txt +219 -0
  209. package/mcp-docs/web/components/RadioCell.txt +215 -0
  210. package/mcp-docs/web/components/RadioGroup.txt +288 -0
  211. package/mcp-docs/web/components/ReferenceLine.txt +451 -0
  212. package/mcp-docs/web/components/RemoteImage.txt +165 -0
  213. package/mcp-docs/web/components/RemoteImageGroup.txt +86 -0
  214. package/mcp-docs/web/components/RollingNumber.txt +1021 -0
  215. package/mcp-docs/web/components/Scrubber.txt +231 -0
  216. package/mcp-docs/web/components/SearchInput.txt +117 -0
  217. package/mcp-docs/web/components/SectionHeader.txt +217 -0
  218. package/mcp-docs/web/components/SegmentedTabs.txt +324 -0
  219. package/mcp-docs/web/components/Select.txt +224 -0
  220. package/mcp-docs/web/components/SelectChip.txt +314 -0
  221. package/mcp-docs/web/components/SelectOption.txt +165 -0
  222. package/mcp-docs/web/components/Sidebar.txt +349 -0
  223. package/mcp-docs/web/components/SidebarItem.txt +131 -0
  224. package/mcp-docs/web/components/SidebarMoreMenu.txt +30 -0
  225. package/mcp-docs/web/components/Spacer.txt +173 -0
  226. package/mcp-docs/web/components/Sparkline.txt +122 -0
  227. package/mcp-docs/web/components/SparklineGradient.txt +106 -0
  228. package/mcp-docs/web/components/SparklineInteractive.txt +153 -0
  229. package/mcp-docs/web/components/SparklineInteractiveHeader.txt +76 -0
  230. package/mcp-docs/web/components/Spinner.txt +128 -0
  231. package/mcp-docs/web/components/SpotIcon.txt +48 -0
  232. package/mcp-docs/web/components/SpotRectangle.txt +48 -0
  233. package/mcp-docs/web/components/SpotSquare.txt +48 -0
  234. package/mcp-docs/web/components/Stepper.txt +682 -0
  235. package/mcp-docs/web/components/SubBrandLogoMark.txt +125 -0
  236. package/mcp-docs/web/components/SubBrandLogoWordMark.txt +125 -0
  237. package/mcp-docs/web/components/Switch.txt +85 -0
  238. package/mcp-docs/web/components/TabIndicator.txt +48 -0
  239. package/mcp-docs/web/components/TabLabel.txt +158 -0
  240. package/mcp-docs/web/components/TabNavigation.txt +159 -0
  241. package/mcp-docs/web/components/TabbedChips.txt +155 -0
  242. package/mcp-docs/web/components/Table.txt +367 -0
  243. package/mcp-docs/web/components/TableBody.txt +83 -0
  244. package/mcp-docs/web/components/TableCaption.txt +102 -0
  245. package/mcp-docs/web/components/TableCell.txt +165 -0
  246. package/mcp-docs/web/components/TableCellFallback.txt +97 -0
  247. package/mcp-docs/web/components/TableFooter.txt +83 -0
  248. package/mcp-docs/web/components/TableHeader.txt +100 -0
  249. package/mcp-docs/web/components/TableRow.txt +140 -0
  250. package/mcp-docs/web/components/Tabs.txt +212 -0
  251. package/mcp-docs/web/components/Tag.txt +304 -0
  252. package/mcp-docs/web/components/Text.txt +232 -0
  253. package/mcp-docs/web/components/TextInput.txt +652 -0
  254. package/mcp-docs/web/components/ThemeProvider.txt +199 -0
  255. package/mcp-docs/web/components/TileButton.txt +158 -0
  256. package/mcp-docs/web/components/Toast.txt +203 -0
  257. package/mcp-docs/web/components/Tooltip.txt +89 -0
  258. package/mcp-docs/web/components/Tour.txt +179 -0
  259. package/mcp-docs/web/components/Tray.txt +288 -0
  260. package/mcp-docs/web/components/UpsellCard.txt +319 -0
  261. package/mcp-docs/web/components/VStack.txt +224 -0
  262. package/mcp-docs/web/components/XAxis.txt +619 -0
  263. package/mcp-docs/web/components/YAxis.txt +548 -0
  264. package/mcp-docs/web/getting-started/ai-overview.txt +108 -0
  265. package/mcp-docs/web/getting-started/installation.txt +103 -0
  266. package/mcp-docs/web/getting-started/introduction.txt +102 -0
  267. package/mcp-docs/web/getting-started/playground.txt +28 -0
  268. package/mcp-docs/web/getting-started/styling.txt +161 -0
  269. package/mcp-docs/web/getting-started/templates.txt +121 -0
  270. package/mcp-docs/web/getting-started/theming.txt +426 -0
  271. package/mcp-docs/web/hooks/useBreakpoints.txt +61 -0
  272. package/mcp-docs/web/hooks/useDimensions.txt +114 -0
  273. package/mcp-docs/web/hooks/useEventHandler.txt +120 -0
  274. package/mcp-docs/web/hooks/useHasMounted.txt +75 -0
  275. package/mcp-docs/web/hooks/useIsoEffect.txt +58 -0
  276. package/mcp-docs/web/hooks/useMediaQuery.txt +114 -0
  277. package/mcp-docs/web/hooks/useMergeRefs.txt +116 -0
  278. package/mcp-docs/web/hooks/useOverlayContentContext.txt +279 -0
  279. package/mcp-docs/web/hooks/usePreviousValue.txt +74 -0
  280. package/mcp-docs/web/hooks/useRefMap.txt +178 -0
  281. package/mcp-docs/web/hooks/useScrollBlocker.txt +82 -0
  282. package/mcp-docs/web/hooks/useTheme.txt +364 -0
  283. package/mcp-docs/web/routes.txt +163 -0
  284. package/package.json +1 -1
@@ -0,0 +1,57 @@
1
+ # installation
2
+
3
+ This guide will help you get started with installing CDS in your React Native project. Follow the instructions below to set up CDS and start building with our cross-platform components.
4
+
5
+ ### Installation
6
+
7
+ To install the CDS library for React Native applications, run the following command:
8
+
9
+ ```bash
10
+ npm install @coinbase/cds-mobile
11
+ ```
12
+
13
+ Alternatively, if you are using Yarn:
14
+
15
+ ```bash
16
+ yarn add @coinbase/cds-mobile
17
+ ```
18
+
19
+ :::tip
20
+ For React Native projects, ensure you have set up your environment for React Native development. Refer to the [React Native Environment Setup Guide](https://reactnative.dev/docs/environment-setup) if needed.
21
+ :::
22
+
23
+ ### Getting started
24
+ #### 1. Render a ThemeProvider
25
+
26
+ Render a ThemeProvider at the root of your application, and pass the `theme` and `activeColorScheme`.
27
+
28
+ ```tsx
29
+ import { ThemeProvider } from '@coinbase/cds-mobile';
30
+ import { defaultTheme } from '@coinbase/cds-mobile/themes/defaultTheme';
31
+ import App from './App';
32
+
33
+ const Index = () => (
34
+ <ThemeProvider theme={defaultTheme} activeColorScheme="light">
35
+ <App />
36
+ </ThemeProvider>
37
+ );
38
+
39
+ export default Index;
40
+ ```
41
+
42
+ #### 2. Verify the installation
43
+
44
+ Try importing and rendering a simple CDS component.
45
+
46
+ ```tsx
47
+ import { Button } from '@coinbase/cds-mobile/buttons';
48
+
49
+ const Test = () => <Button>Click Me</Button>;
50
+ ```
51
+
52
+ ### Next steps
53
+
54
+ Learn how to customize CDS's appearance.
55
+
56
+ [See the theming docs here &rarr;](/getting-started/theming)
57
+
@@ -0,0 +1,102 @@
1
+ ---
2
+ id: introduction
3
+ title: Introduction
4
+ hide_title: true
5
+ ---
6
+
7
+ import { VStack } from '@coinbase/cds-web/layout';
8
+ import { MDXSection } from '@site/src/components/page/MDXSection';
9
+ import { MDXArticle } from '@site/src/components/page/MDXArticle';
10
+ import { ContentHeader } from '@site/src/components/page/ContentHeader';
11
+ import { GettingStartedBanner } from '@site/src/components/page/ComponentBanner/GettingStartedBanner';
12
+
13
+ <VStack gap={5}>
14
+ <ContentHeader
15
+ title="Introduction"
16
+ description="Coinbase Design System is a cross-platform component library for React and React Native. CDS has high adoption in every product at Coinbase, accelerating development and ensuring a consistent user experience across all platforms."
17
+ banner={<GettingStartedBanner />}
18
+ />
19
+
20
+ <MDXSection>
21
+ <MDXArticle>
22
+ ## Key features
23
+
24
+ - **Cross-platform** - CDS provides components for both React DOM and React Native. We go to great lengths to ensure that the source code is as identical as possible across React and React Native without compromising on platform-specific features.
25
+
26
+ - **Powerful theming** - The ThemeProvider can be used to define a custom theme for your application supporting light and dark mode.
27
+
28
+ - **Rich styling capabilities** - Components are designed to integrate with third-party libraries like styled-components, and to be customizable via theming, props, StyleProps, classnames, and inline styles.
29
+
30
+ - **Subcomponent composition** - Components are built using smaller subcomponents that can be fully customized or replaced via props.
31
+
32
+ - **Accessibility** - Components are accessible out of the box, and can be customized to different accessibility standards.
33
+
34
+ </MDXArticle>
35
+ </MDXSection>
36
+
37
+ <MDXSection>
38
+ <MDXArticle>
39
+ ## Web-only features
40
+
41
+ - **Atomic static CSS** - CSS is compiled to atomic static classnames at library build time.
42
+
43
+ - **Responsive styles** - Components support responsive styles out of the box. Use the responsive syntax to adjust layouts and styles based on device breakpoints without writing custom media queries.
44
+
45
+ - **CSS layers** - All CSS is added to the `cds` layer. This allows you to easily override CDS styles with your own styles.
46
+
47
+ - **Polymorphic components** - Components can be rendered as different HTML elements or as other components.
48
+
49
+ </MDXArticle>
50
+ </MDXSection>
51
+
52
+ <MDXSection>
53
+ <MDXArticle>
54
+ ## Developer experience
55
+
56
+ CDS is designed to make your development workflow as smooth as possible.
57
+
58
+ - **TypeScript first** - Full type safety with excellent IDE autocomplete for props, theme values, and style props. Most mistakes are caught at compile time.
59
+
60
+ - **Flexible styling** - Use the StyleProps API for rapid development with theme-aware values, or drop down to className and style props for full control. Mix and match approaches as needed.
61
+
62
+ - **Component composition** - Build complex UIs by composing simple primitives. Most components expose subcomponents that can be customized or replaced entirely.
63
+
64
+ - **Performance optimized** - All web components use atomic CSS with zero runtime overhead. CSS is generated at build time and styles are applied via static classnames.
65
+
66
+ - **Extensive documentation** - Every component includes Storybook stories, interactive examples, detailed prop tables, and usage guidelines.
67
+
68
+ ```jsx
69
+ import { ThemeProvider } from '@coinbase/cds-web';
70
+ import { defaultTheme } from '@coinbase/cds-web/themes/defaultTheme';
71
+ import { Box } from '@coinbase/cds-web/layout';
72
+ import { Text } from '@coinbase/cds-web/typography';
73
+ import { Button } from '@coinbase/cds-web/buttons';
74
+
75
+ const App = () => (
76
+ <ThemeProvider theme={defaultTheme} activeColorScheme="light">
77
+ <Box padding={4} background="bgPrimary" borderRadius={200}>
78
+ <Text font="title1" color="fg">
79
+ Welcome to CDS
80
+ </Text>
81
+ <Button variant="positive" marginTop={2}>
82
+ Get started
83
+ </Button>
84
+ </Box>
85
+ </ThemeProvider>
86
+ );
87
+ ```
88
+
89
+ </MDXArticle>
90
+ </MDXSection>
91
+
92
+ <MDXSection>
93
+ <MDXArticle>
94
+ ## Next steps
95
+
96
+ Learn how to install and use CDS.
97
+
98
+ [See the installation docs here →](/getting-started/installation)
99
+
100
+ </MDXArticle>
101
+ </MDXSection>
102
+ </VStack>
@@ -0,0 +1,28 @@
1
+ ---
2
+ id: playground
3
+ title: Playground
4
+ hide_title: true
5
+ ---
6
+
7
+ import { VStack } from '@coinbase/cds-web/layout';
8
+ import { MDXSection } from '@site/src/components/page/MDXSection';
9
+ import { MDXArticle } from '@site/src/components/page/MDXArticle';
10
+ import { ContentHeader } from '@site/src/components/page/ContentHeader';
11
+ import { PlaygroundBanner } from '@site/src/components/page/ComponentBanner/PlaygroundBanner';
12
+ import { ShareablePlayground } from '@site/src/components/page/ShareablePlayground';
13
+
14
+ <VStack gap={5}>
15
+ <ContentHeader
16
+ title="Playground"
17
+ description="Live code playground for testing and sharing CDS components and code examples. All CDS components and hooks and all React exports are available to use in the playground without importing them. You must call render() to render your code."
18
+ banner={<PlaygroundBanner />}
19
+ />
20
+
21
+ <MDXSection>
22
+ <MDXArticle>
23
+
24
+ <ShareablePlayground />
25
+
26
+ </MDXArticle>
27
+ </MDXSection>
28
+ </VStack>
@@ -0,0 +1,84 @@
1
+ # styling
2
+
3
+ CDS includes powerful and flexible APIs for styling components. Easily access values from the theme, or go rogue with full customization.
4
+
5
+ ### `StyleProps` API
6
+
7
+ Most components support the StyleProps API. StyleProps automatically have access to the values in the theme, and some StyleProps are limited to only the theme values.
8
+
9
+ [See the full list of StyleProps here &rarr;](/components/layout/Box/?platform=mobile&tab=props)
10
+
11
+ ```jsx
12
+ // ✅ The `bgNegative` token will automatically update with the theme!
13
+ <Box background="bgNegative" width={100} />
14
+
15
+ // ❌ Error: Type '"#0000ff"' is not assignable to type 'Color | undefined'.
16
+ <Box background="#0000ff" width={100} />
17
+ ```
18
+
19
+ :::tip
20
+ The docs page of every component has a props table listing all the available props!
21
+ :::
22
+
23
+ :::note
24
+ The StyleProps API uses the ThemeProvider Context under the hood to enable dynamic theming.
25
+ :::
26
+
27
+ ### `style` and `styles` props
28
+
29
+ Most components support the native `style` prop for inline styles.
30
+
31
+ ```jsx
32
+ <Box style={{ backgroundColor: '#0000ff' }} />
33
+ ```
34
+
35
+ Some complex components support passing inline styles to subcomponents with the `styles` prop.
36
+
37
+ ```jsx
38
+ <ProgressCircle
39
+ styles={{
40
+ circle: {
41
+ stroke: 'transparent',
42
+ },
43
+ progress: {
44
+ strokeLinecap: 'square',
45
+ },
46
+ }}
47
+ color="fgPositive"
48
+ progress={0.75}
49
+ size={100}
50
+ />
51
+ ```
52
+
53
+ Styles are combined using React Native's style arrays, and are added in order of specificity.
54
+
55
+ ```jsx
56
+ <PageHeader style={{ backgroundColor: 'red' }} styles={{ root: { backgroundColor: 'blue' } }} />
57
+ ```
58
+
59
+ In the example above, `backgroundColor` will be blue.
60
+
61
+ :::tip
62
+ We will continue to add the `styles` prop to more components over time. Please feel free to request specific components that you think would benefit from this API.
63
+ :::
64
+
65
+ ### Component specific props
66
+
67
+ Many components have their own specific props that can affect styling.
68
+
69
+ ```jsx
70
+ <Button compact variant="primary">
71
+ Click me
72
+ </Button>
73
+ ```
74
+
75
+ ### Combining techniques
76
+
77
+ Mix and match these styling techniques for complete customization!
78
+
79
+ ```jsx
80
+ <Button variant="primary" borderColor="accentBoldPurple" style={{ fontFamily: 'Times' }}>
81
+ Click me
82
+ </Button>
83
+ ```
84
+
@@ -0,0 +1,286 @@
1
+ # theming
2
+
3
+ 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.
4
+
5
+ import { defaultTheme } from '@coinbase/cds-mobile/themes/defaultTheme';
6
+ import { JSONCodeBlock } from '@site/src/components/page/JSONCodeBlock';
7
+
8
+ ### ThemeProvider component
9
+
10
+ The ThemeProvider provides the theme context to all child components.
11
+
12
+ You must pass the `theme` prop to configure the theme, and the `activeColorScheme` prop to set light or dark mode.
13
+
14
+ [See the ThemeProvider docs here &rarr;](/components/other/ThemeProvider)
15
+
16
+ ```tsx
17
+ import { ThemeProvider } from '@coinbase/cds-mobile/system/ThemeProvider';
18
+ import { defaultTheme } from '@coinbase/cds-mobile/themes/defaultTheme';
19
+
20
+ const App = () => (
21
+ <ThemeProvider theme={defaultTheme} activeColorScheme="light">
22
+ {/* Your app components */}
23
+ </ThemeProvider>
24
+ );
25
+ ```
26
+
27
+ :::tip
28
+ Changing the `activeColorScheme` automatically updates the values returned from the `useTheme` hook.
29
+ :::
30
+
31
+ #### `useTheme` hook
32
+
33
+ The `useTheme` hook provides access to the current `theme` and `activeColorScheme`.
34
+
35
+ The `color` and `spectrum` objects automatically change based on the `activeColorScheme`.
36
+
37
+ [See the `useTheme` docs here &rarr;](/hooks/useTheme)
38
+
39
+ ```jsx
40
+ const theme = useTheme();
41
+ theme.activeColorScheme; // "light" or "dark"
42
+ theme.spectrum; // Resolves to lightSpectrum or darkSpectrum, depends on activeColorScheme
43
+ theme.color; // Resolves to lightColor or darkColor, depends on activeColorScheme
44
+ theme.color.bgPrimary; // "rgb(0,82,255)" or "rgb(87,139,250)", depends on activeColorScheme
45
+ theme.space[2]; // 16
46
+ theme.borderRadius[200]; // 8
47
+ theme.fontSize.display3; // 40
48
+ ```
49
+
50
+ #### Nested themes
51
+
52
+ ThemeProviders can be nested to create theme overrides for specific sections.
53
+
54
+ ```jsx
55
+ <ThemeProvider theme={defaultTheme} activeColorScheme="light">
56
+ {/* Default theme in light color scheme */}
57
+
58
+ <ThemeProvider theme={customTheme} activeColorScheme="dark">
59
+ {/* Custom theme in dark color scheme */}
60
+ </ThemeProvider>
61
+ </ThemeProvider>
62
+ ```
63
+
64
+ When nesting, you may want to override specific color values from the current theme. Overrides must be conditionally applied because we don't enforce that a theme has both light and dark colors defined.
65
+
66
+ ```jsx
67
+ // Override parts of the parent theme
68
+ const theme = useTheme();
69
+ const customTheme = {
70
+ ...theme,
71
+ ...(theme.lightColor &&
72
+ theme.lightSpectrum && {
73
+ lightColor: {
74
+ ...theme.lightColor,
75
+ bg: `rgb(${theme.lightSpectrum.orange50})`,
76
+ bgPrimary: `rgb(${theme.lightSpectrum.red20})`,
77
+ bgSecondary: `rgb(${theme.lightSpectrum.blue50})`,
78
+ },
79
+ }),
80
+ ...(theme.darkColor &&
81
+ theme.darkSpectrum && {
82
+ darkColor: {
83
+ ...theme.darkColor,
84
+ bg: `rgb(${theme.darkSpectrum.orange50})`,
85
+ bgPrimary: `rgb(${theme.darkSpectrum.red20})`,
86
+ bgSecondary: `rgb(${theme.darkSpectrum.blue50})`,
87
+ },
88
+ }),
89
+ } as const satisfies Theme;
90
+ ```
91
+
92
+ #### Theme inheritence
93
+
94
+ Nested ThemeProviders do not automatically inherit the theme from their parent provider. You can manually inherit the theme with the `useTheme` hook.
95
+
96
+ ```jsx
97
+ const Example = () => {
98
+ // Pass the parent theme down to another ThemeProvider
99
+ const theme = useTheme();
100
+ return (
101
+ <ThemeProvider theme={theme} activeColorScheme={theme.activeColorScheme}>
102
+ {children}
103
+ </ThemeProvider>
104
+ );
105
+ };
106
+ ```
107
+
108
+ #### InvertedThemeProvider component
109
+
110
+ The InvertedThemeProvider automatically inherits from its parent theme and flips the `activeColorScheme` to the opposite value.
111
+
112
+ ```jsx
113
+ <ThemeProvider theme={defaultTheme} activeColorScheme="light">
114
+ {/* Default theme in light color scheme */}
115
+
116
+ <InvertedThemeProvider>
117
+ {/* Default theme in inverse (dark) color scheme */}
118
+ </InvertedThemeProvider>
119
+ </ThemeProvider>
120
+ ```
121
+
122
+ ### `ThemeConfig` vs `Theme` type
123
+
124
+ Use the `ThemeConfig` type when creating a theme, or when passing the `theme` prop to the ThemeProvider.
125
+
126
+ Use the `Theme` type for the return value of the `useTheme` hook. The `Theme` type includes all the properties of `ThemeConfig` - plus the `activeColorScheme`, `color`, and `spectrum` properties.
127
+
128
+ [See the `ThemeConfig` type definition here &rarr;](https://github.com/coinbase/cds/blob/master/packages/mobile/src/core/theme.ts#L11)
129
+
130
+ [See the `Theme` type definition here &rarr;](https://github.com/coinbase/cds/blob/master/packages/mobile/src/core/theme.ts#L50)
131
+
132
+ :::tip
133
+ Although the `Theme` type includes extra properties, you can still pass the `useTheme` return value directly to the ThemeProvider `theme` prop as shown in the [theme inheritence section.](#theme-inheritence)
134
+ :::
135
+
136
+ ### `spectrum` vs `color` values
137
+
138
+ The `spectrum` variables are partial `"r,g,b"` strings while `color` variables are complete CSS color values.
139
+
140
+ Both `color` and `spectrum` behave inversely in light and dark mode.
141
+
142
+ For example with the `defaultTheme` config, `spectrum.gray0` is white in light mode and black in dark mode. We use `spectrum` variables to define `color` variables, so this same behavior extends to `color`.
143
+
144
+ The `color` variables have semantic names which describe their application in the UI. You should prefer to use `color` variables instead of `spectrum` variables when styling UI.
145
+
146
+ ```jsx
147
+ const theme = useTheme();
148
+ theme.lightSpectrum.gray0; // "255,255,255"
149
+ theme.darkSpectrum.gray0; // "10,11,13"
150
+ theme.spectrum.gray100; // "255,255,255" or "10,11,13", depends on activeColorScheme
151
+ theme.lightColor.bg; // "rgb(255,255,255)"
152
+ theme.darkColor.bg; // "rgb(10,11,13)"
153
+ theme.color.bg; // "rgb(255,255,255)" or "rgb(10,11,13)", depends on activeColorScheme
154
+ ```
155
+
156
+ :::tip
157
+ Prefer to use semantic `color` variables for UI styles. Direct usage of `spectrum` values should be a rare exception.
158
+ :::
159
+
160
+ ### Creating a theme
161
+ #### Defining colors
162
+
163
+ We recommend defining `lightSpectrum` and `darkSpectrum` as separate objects. This makes it easier to reference them when defining the `lightColor` and `darkColor` values.
164
+
165
+ The `lightColor` and `darkColor` values must be raw color strings (hex, rgba, hsl, etc), they cannot contain CSS Variables or CSS functions.
166
+
167
+ #### The `space` scale
168
+
169
+ CDS expects that the theme `space` values will be multiples of some base number.
170
+
171
+ For example, the `defaultTheme` uses `8px` as the base number:
172
+
173
+ ```jsx
174
+ theme.space[0]; // 0
175
+ theme.space[0.25]; // 2
176
+ theme.space[0.5]; // 4
177
+ theme.space[1]; // 8
178
+ theme.space[1.5]; // 12
179
+ theme.space[2]; // 16
180
+ theme.space[3]; // 24
181
+ // etc.
182
+ ```
183
+
184
+ While it is possible to customize the `space` values in any way, deviating from this expectation may produce broken styles.
185
+
186
+ #### Example new theme
187
+
188
+ In this example we'll start with the `defaultTheme` and customize a couple values.
189
+
190
+ ```tsx
191
+ import type { ThemeConfig } from '@coinbase/cds-mobile/core/theme';
192
+ import { ThemeProvider } from '@coinbase/cds-mobile/system/ThemeProvider';
193
+ import { defaultTheme } from '@coinbase/cds-mobile/themes/defaultTheme';
194
+
195
+ // Define lightSpectrum and darkSpectrum as separate objects
196
+ const lightSpectrum = {
197
+ ...defaultTheme.lightSpectrum,
198
+ blue60: '8,90,255',
199
+ };
200
+
201
+ const darkSpectrum = {
202
+ ...defaultTheme.darkSpectrum,
203
+ blue60: '65,125,245',
204
+ };
205
+
206
+ // Use lightSpectrum and darkSpectrum to define the lightColor and darkColor values
207
+ const myTheme = {
208
+ ...defaultTheme,
209
+ id: 'my-custom-theme',
210
+ lightSpectrum,
211
+ darkSpectrum,
212
+ lightColor: {
213
+ ...defaultTheme.lightColor,
214
+ bgPrimary: `rgb(${lightSpectrum.red60})`,
215
+ },
216
+ darkColor: {
217
+ ...defaultTheme.darkColor,
218
+ bgPrimary: `rgb(${darkSpectrum.red60})`,
219
+ },
220
+ } as const satisfies ThemeConfig;
221
+
222
+ const App = () => (
223
+ <ThemeProvider theme={myTheme} activeColorScheme="light">
224
+ {/* Your app components */}
225
+ </ThemeProvider>
226
+ );
227
+ ```
228
+
229
+ :::tip
230
+ Use the `ThemeConfig` type with TypeScript's `satisfies` keyword to enforce type safety for your theme.
231
+ :::
232
+
233
+ ### `defaultTheme` config
234
+
235
+ The `defaultTheme` is a good example of a complete `ThemeConfig`. You can use it as an example when developing your own themes.
236
+
237
+ [See the `defaultTheme` source code here &rarr;](https://github.com/coinbase/cds/blob/master/packages/mobile/src/themes/defaultTheme.ts)
238
+
239
+ <JSONCodeBlock json={defaultTheme} />
240
+
241
+ ### `ThemeVars` namespace
242
+
243
+ The `ThemeVars` namespace contains type definitions for all themeable variable names in CDS. It includes any custom theme variables added in `ThemeVarsExtended`.
244
+
245
+ ```tsx
246
+ import type { ThemeVars } from '@coinbase/cds-common/core/theme';
247
+
248
+ // All theme variables are accessible through ThemeVars
249
+ ThemeVars.Color; // 'fg' | 'bg' | 'bgPrimary' | 'bgSecondary' | ...
250
+ ThemeVars.SpectrumColor; // 'blue60' | 'red40' | 'gray100' | ...
251
+ ThemeVars.SpectrumHue; // 'blue' | 'green' | 'orange' | 'gray' | ...
252
+ ThemeVars.SpectrumHueStep; // 0 | 5 | 10 | 20 | ...
253
+ ThemeVars.Space; // 0 | 0.25 | 0.5 | 1 | 2 | ...
254
+ ThemeVars.BorderWidth; // 0 | 100 | 200 | ...
255
+ ThemeVars.BorderRadius; // 0 | 100 | 200 | ...
256
+ ThemeVars.Font; // 'display1' | 'title1' | 'body' | ...
257
+ ThemeVars.FontFamily; // 'display1' | 'title1' | 'body' | ...
258
+ ThemeVars.FontSize; // 'display1' | 'title1' | 'body' | ...
259
+ ThemeVars.FontWeight; // 'display1' | 'title1' | 'body' | ...
260
+ ThemeVars.LineHeight; // 'display1' | 'title1' | 'body' | ...
261
+ ThemeVars.TextTransform; // 'display1' | 'title1' | 'body' | ...
262
+ ThemeVars.IconSize; // 'xs' | 's' | 'm' | 'l'
263
+ ThemeVars.AvatarSize; // 's' | 'm' | 'l' | 'xl' | ...
264
+ ThemeVars.ControlSize; // 'checkboxSize' | 'radioSize' | ...
265
+ ```
266
+
267
+ ### Extending the theme
268
+
269
+ You can extend the theme by adding custom theme variables. In this example we'll show how to add a custom color variable, but you can extend other types of `ThemeVars` as well.
270
+
271
+ Start by overriding interfaces in the `ThemeVarsExtended` namespace to add new theme variables. Only the key names are used, the `void` type is just a necessary placeholder.
272
+
273
+ ```jsx
274
+ declare module '@coinbase/cds-common/core/theme' {
275
+ export namespace ThemeVarsExtended {
276
+ export interface Color {
277
+ myCustomColor: void;
278
+ }
279
+ }
280
+ }
281
+ ```
282
+
283
+ This adds `myCustomColor` to `ThemeVars.Color` - which enforces that this variable must be defined in your theme to satisfy the `ThemeConfig` type, and allows this variable name to be passed to the `StyleProps` API anywhere that theme colors are accepted.
284
+
285
+ Now that `myCustomColor` is defined in your theme the `useTheme` hook will include it in the return value.
286
+
@@ -0,0 +1,72 @@
1
+ # useDimensions
2
+
3
+ Measures the screen dimensions and status bar height.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { useDimensions } from '@coinbase/cds-mobile/hooks/useDimensions'
9
+ ```
10
+
11
+ ## API
12
+
13
+ ### Parameters
14
+
15
+ None. The hook takes no parameters.
16
+
17
+ ### Returns
18
+
19
+ Returns an object with the following properties:
20
+
21
+ ```tsx
22
+ type Return = {
23
+ screenHeight: number;
24
+ screenWidth: number;
25
+ statusBarHeight: number;
26
+ };
27
+ ```
28
+
29
+ - `screenHeight`: The total height of the device screen in points (DIP).
30
+ - `screenWidth`: The total width of the device screen in points (DIP).
31
+ - `statusBarHeight`: The height of the device's status bar in points (DIP).
32
+
33
+ :::tip
34
+ All dimensions are in points (DIP - Density Independent Pixels), not physical pixels. Values automatically update on device orientation changes. The status bar height varies by device type, orientation, and presence of notches or dynamic islands.
35
+ :::
36
+
37
+ ## Examples
38
+
39
+ ### Basic usage
40
+
41
+ ```tsx
42
+ function Example() {
43
+ const { screenWidth, screenHeight, statusBarHeight } = useDimensions();
44
+
45
+ return (
46
+ <Box backgroundColor="bgAlternate" padding={3} borderRadius={300} width="100%">
47
+ <VStack gap={2}>
48
+ <TextHeadline>
49
+ Screen dimensions: {screenWidth}x{screenHeight}
50
+ </TextHeadline>
51
+ <TextHeadline>Status bar height: {statusBarHeight}px</TextHeadline>
52
+ </VStack>
53
+ </Box>
54
+ );
55
+ }
56
+ ```
57
+
58
+ ### With Safe Area Layout
59
+
60
+ ```tsx
61
+ function Example() {
62
+ const { screenHeight, statusBarHeight } = useDimensions();
63
+ const contentHeight = screenHeight - statusBarHeight;
64
+
65
+ return (
66
+ <Box backgroundColor="bgAlternate" height={contentHeight} paddingTop={statusBarHeight}>
67
+ <TextHeadline>Content below status bar</TextHeadline>
68
+ </Box>
69
+ );
70
+ }
71
+ ```
72
+