@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.
- package/CHANGELOG.md +8 -0
- package/mcp-docs/mobile/components/Accordion.txt +188 -0
- package/mcp-docs/mobile/components/AccordionItem.txt +29 -0
- package/mcp-docs/mobile/components/Alert.txt +155 -0
- package/mcp-docs/mobile/components/AreaChart.txt +265 -0
- package/mcp-docs/mobile/components/Avatar.txt +195 -0
- package/mcp-docs/mobile/components/AvatarButton.txt +225 -0
- package/mcp-docs/mobile/components/Banner.txt +221 -0
- package/mcp-docs/mobile/components/BarChart.txt +815 -0
- package/mcp-docs/mobile/components/Box.txt +173 -0
- package/mcp-docs/mobile/components/BrowserBar.txt +146 -0
- package/mcp-docs/mobile/components/Button.txt +198 -0
- package/mcp-docs/mobile/components/ButtonGroup.txt +79 -0
- package/mcp-docs/mobile/components/Carousel.txt +1083 -0
- package/mcp-docs/mobile/components/CartesianChart.txt +825 -0
- package/mcp-docs/mobile/components/CellMedia.txt +70 -0
- package/mcp-docs/mobile/components/Checkbox.txt +245 -0
- package/mcp-docs/mobile/components/CheckboxCell.txt +201 -0
- package/mcp-docs/mobile/components/CheckboxGroup.txt +284 -0
- package/mcp-docs/mobile/components/Chip.txt +194 -0
- package/mcp-docs/mobile/components/Coachmark.txt +157 -0
- package/mcp-docs/mobile/components/Collapsible.txt +104 -0
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +134 -0
- package/mcp-docs/mobile/components/ContentCard.txt +365 -0
- package/mcp-docs/mobile/components/ContentCardBody.txt +135 -0
- package/mcp-docs/mobile/components/ContentCardFooter.txt +127 -0
- package/mcp-docs/mobile/components/ContentCardHeader.txt +145 -0
- package/mcp-docs/mobile/components/ContentCell.txt +226 -0
- package/mcp-docs/mobile/components/ControlGroup.txt +443 -0
- package/mcp-docs/mobile/components/DatePicker.txt +496 -0
- package/mcp-docs/mobile/components/Divider.txt +138 -0
- package/mcp-docs/mobile/components/DotCount.txt +145 -0
- package/mcp-docs/mobile/components/DotStatusColor.txt +58 -0
- package/mcp-docs/mobile/components/DotSymbol.txt +134 -0
- package/mcp-docs/mobile/components/Fallback.txt +157 -0
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +155 -0
- package/mcp-docs/mobile/components/HStack.txt +234 -0
- package/mcp-docs/mobile/components/HeroSquare.txt +47 -0
- package/mcp-docs/mobile/components/Icon.txt +51 -0
- package/mcp-docs/mobile/components/IconButton.txt +268 -0
- package/mcp-docs/mobile/components/InputChip.txt +187 -0
- package/mcp-docs/mobile/components/Interactable.txt +186 -0
- package/mcp-docs/mobile/components/LineChart.txt +1324 -0
- package/mcp-docs/mobile/components/Link.txt +291 -0
- package/mcp-docs/mobile/components/ListCell.txt +412 -0
- package/mcp-docs/mobile/components/LogoMark.txt +84 -0
- package/mcp-docs/mobile/components/LogoWordMark.txt +93 -0
- package/mcp-docs/mobile/components/Lottie.txt +138 -0
- package/mcp-docs/mobile/components/LottieStatusAnimation.txt +46 -0
- package/mcp-docs/mobile/components/Modal.txt +83 -0
- package/mcp-docs/mobile/components/ModalBody.txt +33 -0
- package/mcp-docs/mobile/components/ModalFooter.txt +24 -0
- package/mcp-docs/mobile/components/ModalHeader.txt +27 -0
- package/mcp-docs/mobile/components/MultiContentModule.txt +379 -0
- package/mcp-docs/mobile/components/NavigationTitle.txt +131 -0
- package/mcp-docs/mobile/components/NavigationTitleSelect.txt +141 -0
- package/mcp-docs/mobile/components/NudgeCard.txt +89 -0
- package/mcp-docs/mobile/components/Numpad.txt +340 -0
- package/mcp-docs/mobile/components/Overlay.txt +151 -0
- package/mcp-docs/mobile/components/PageFooter.txt +160 -0
- package/mcp-docs/mobile/components/PageHeader.txt +185 -0
- package/mcp-docs/mobile/components/PeriodSelector.txt +407 -0
- package/mcp-docs/mobile/components/Pictogram.txt +47 -0
- package/mcp-docs/mobile/components/Point.txt +204 -0
- package/mcp-docs/mobile/components/PortalProvider.txt +78 -0
- package/mcp-docs/mobile/components/Pressable.txt +210 -0
- package/mcp-docs/mobile/components/ProgressBar.txt +129 -0
- package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +160 -0
- package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +137 -0
- package/mcp-docs/mobile/components/ProgressCircle.txt +236 -0
- package/mcp-docs/mobile/components/Radio.txt +241 -0
- package/mcp-docs/mobile/components/RadioCell.txt +201 -0
- package/mcp-docs/mobile/components/RadioGroup.txt +281 -0
- package/mcp-docs/mobile/components/ReferenceLine.txt +152 -0
- package/mcp-docs/mobile/components/RemoteImage.txt +105 -0
- package/mcp-docs/mobile/components/RemoteImageGroup.txt +60 -0
- package/mcp-docs/mobile/components/RollingNumber.txt +788 -0
- package/mcp-docs/mobile/components/Scrubber.txt +203 -0
- package/mcp-docs/mobile/components/SearchInput.txt +191 -0
- package/mcp-docs/mobile/components/SectionHeader.txt +204 -0
- package/mcp-docs/mobile/components/SegmentedTabs.txt +315 -0
- package/mcp-docs/mobile/components/Select.txt +211 -0
- package/mcp-docs/mobile/components/SelectChip.txt +323 -0
- package/mcp-docs/mobile/components/SelectOption.txt +84 -0
- package/mcp-docs/mobile/components/SlideButton.txt +330 -0
- package/mcp-docs/mobile/components/Spacer.txt +83 -0
- package/mcp-docs/mobile/components/Sparkline.txt +122 -0
- package/mcp-docs/mobile/components/SparklineGradient.txt +106 -0
- package/mcp-docs/mobile/components/SparklineInteractive.txt +156 -0
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +72 -0
- package/mcp-docs/mobile/components/Spinner.txt +48 -0
- package/mcp-docs/mobile/components/SpotIcon.txt +47 -0
- package/mcp-docs/mobile/components/SpotRectangle.txt +47 -0
- package/mcp-docs/mobile/components/SpotSquare.txt +47 -0
- package/mcp-docs/mobile/components/Stepper.txt +527 -0
- package/mcp-docs/mobile/components/SubBrandLogoMark.txt +125 -0
- package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +125 -0
- package/mcp-docs/mobile/components/Switch.txt +97 -0
- package/mcp-docs/mobile/components/TabIndicator.txt +48 -0
- package/mcp-docs/mobile/components/TabLabel.txt +153 -0
- package/mcp-docs/mobile/components/TabNavigation.txt +146 -0
- package/mcp-docs/mobile/components/TabbedChips.txt +142 -0
- package/mcp-docs/mobile/components/Tabs.txt +190 -0
- package/mcp-docs/mobile/components/Tag.txt +300 -0
- package/mcp-docs/mobile/components/Text.txt +211 -0
- package/mcp-docs/mobile/components/TextInput.txt +717 -0
- package/mcp-docs/mobile/components/ThemeProvider.txt +132 -0
- package/mcp-docs/mobile/components/Toast.txt +196 -0
- package/mcp-docs/mobile/components/Tooltip.txt +59 -0
- package/mcp-docs/mobile/components/TopNavBar.txt +161 -0
- package/mcp-docs/mobile/components/Tour.txt +158 -0
- package/mcp-docs/mobile/components/Tray.txt +252 -0
- package/mcp-docs/mobile/components/UpsellCard.txt +321 -0
- package/mcp-docs/mobile/components/VStack.txt +222 -0
- package/mcp-docs/mobile/components/XAxis.txt +621 -0
- package/mcp-docs/mobile/components/YAxis.txt +567 -0
- package/mcp-docs/mobile/getting-started/ai-overview.txt +108 -0
- package/mcp-docs/mobile/getting-started/installation.txt +57 -0
- package/mcp-docs/mobile/getting-started/introduction.txt +102 -0
- package/mcp-docs/mobile/getting-started/playground.txt +28 -0
- package/mcp-docs/mobile/getting-started/styling.txt +84 -0
- package/mcp-docs/mobile/getting-started/theming.txt +286 -0
- package/mcp-docs/mobile/hooks/useDimensions.txt +72 -0
- package/mcp-docs/mobile/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/mobile/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +280 -0
- package/mcp-docs/mobile/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/mobile/hooks/useRefMap.txt +178 -0
- package/mcp-docs/mobile/hooks/useTheme.txt +321 -0
- package/mcp-docs/mobile/routes.txt +139 -0
- package/mcp-docs/web/components/Accordion.txt +189 -0
- package/mcp-docs/web/components/AccordionItem.txt +31 -0
- package/mcp-docs/web/components/Alert.txt +164 -0
- package/mcp-docs/web/components/AreaChart.txt +510 -0
- package/mcp-docs/web/components/Avatar.txt +211 -0
- package/mcp-docs/web/components/AvatarButton.txt +240 -0
- package/mcp-docs/web/components/Banner.txt +226 -0
- package/mcp-docs/web/components/BarChart.txt +1267 -0
- package/mcp-docs/web/components/Box.txt +175 -0
- package/mcp-docs/web/components/Button.txt +212 -0
- package/mcp-docs/web/components/ButtonGroup.txt +79 -0
- package/mcp-docs/web/components/Calendar.txt +181 -0
- package/mcp-docs/web/components/Carousel.txt +1575 -0
- package/mcp-docs/web/components/CartesianChart.txt +1044 -0
- package/mcp-docs/web/components/CellMedia.txt +56 -0
- package/mcp-docs/web/components/Checkbox.txt +188 -0
- package/mcp-docs/web/components/CheckboxCell.txt +202 -0
- package/mcp-docs/web/components/CheckboxGroup.txt +219 -0
- package/mcp-docs/web/components/Chip.txt +196 -0
- package/mcp-docs/web/components/Coachmark.txt +188 -0
- package/mcp-docs/web/components/Collapsible.txt +119 -0
- package/mcp-docs/web/components/ContainedAssetCard.txt +232 -0
- package/mcp-docs/web/components/ContentCard.txt +367 -0
- package/mcp-docs/web/components/ContentCardBody.txt +137 -0
- package/mcp-docs/web/components/ContentCardFooter.txt +129 -0
- package/mcp-docs/web/components/ContentCardHeader.txt +147 -0
- package/mcp-docs/web/components/ContentCell.txt +219 -0
- package/mcp-docs/web/components/ControlGroup.txt +436 -0
- package/mcp-docs/web/components/DatePicker.txt +505 -0
- package/mcp-docs/web/components/Divider.txt +143 -0
- package/mcp-docs/web/components/DotCount.txt +149 -0
- package/mcp-docs/web/components/DotStatusColor.txt +58 -0
- package/mcp-docs/web/components/DotSymbol.txt +137 -0
- package/mcp-docs/web/components/Dropdown.txt +119 -0
- package/mcp-docs/web/components/Fallback.txt +163 -0
- package/mcp-docs/web/components/FloatingAssetCard.txt +250 -0
- package/mcp-docs/web/components/FullscreenAlert.txt +69 -0
- package/mcp-docs/web/components/FullscreenModal.txt +145 -0
- package/mcp-docs/web/components/FullscreenModalLayout.txt +187 -0
- package/mcp-docs/web/components/Grid.txt +236 -0
- package/mcp-docs/web/components/GridColumn.txt +209 -0
- package/mcp-docs/web/components/HStack.txt +236 -0
- package/mcp-docs/web/components/HeroSquare.txt +48 -0
- package/mcp-docs/web/components/Icon.txt +145 -0
- package/mcp-docs/web/components/IconButton.txt +390 -0
- package/mcp-docs/web/components/InputChip.txt +187 -0
- package/mcp-docs/web/components/Interactable.txt +193 -0
- package/mcp-docs/web/components/LineChart.txt +1576 -0
- package/mcp-docs/web/components/Link.txt +243 -0
- package/mcp-docs/web/components/ListCell.txt +418 -0
- package/mcp-docs/web/components/LogoMark.txt +84 -0
- package/mcp-docs/web/components/LogoWordMark.txt +93 -0
- package/mcp-docs/web/components/Lottie.txt +157 -0
- package/mcp-docs/web/components/LottieStatusAnimation.txt +57 -0
- package/mcp-docs/web/components/MediaQueryProvider.txt +108 -0
- package/mcp-docs/web/components/Modal.txt +196 -0
- package/mcp-docs/web/components/ModalBody.txt +117 -0
- package/mcp-docs/web/components/ModalFooter.txt +119 -0
- package/mcp-docs/web/components/ModalHeader.txt +123 -0
- package/mcp-docs/web/components/MultiContentModule.txt +381 -0
- package/mcp-docs/web/components/NavigationBar.txt +102 -0
- package/mcp-docs/web/components/NavigationTitle.txt +25 -0
- package/mcp-docs/web/components/NavigationTitleSelect.txt +45 -0
- package/mcp-docs/web/components/NudgeCard.txt +181 -0
- package/mcp-docs/web/components/Overlay.txt +171 -0
- package/mcp-docs/web/components/PageFooter.txt +184 -0
- package/mcp-docs/web/components/PageHeader.txt +243 -0
- package/mcp-docs/web/components/Pagination.txt +499 -0
- package/mcp-docs/web/components/PeriodSelector.txt +703 -0
- package/mcp-docs/web/components/Pictogram.txt +48 -0
- package/mcp-docs/web/components/Point.txt +460 -0
- package/mcp-docs/web/components/PortalProvider.txt +76 -0
- package/mcp-docs/web/components/Pressable.txt +193 -0
- package/mcp-docs/web/components/ProgressBar.txt +163 -0
- package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +212 -0
- package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +181 -0
- package/mcp-docs/web/components/ProgressCircle.txt +443 -0
- package/mcp-docs/web/components/Radio.txt +219 -0
- package/mcp-docs/web/components/RadioCell.txt +215 -0
- package/mcp-docs/web/components/RadioGroup.txt +288 -0
- package/mcp-docs/web/components/ReferenceLine.txt +451 -0
- package/mcp-docs/web/components/RemoteImage.txt +165 -0
- package/mcp-docs/web/components/RemoteImageGroup.txt +86 -0
- package/mcp-docs/web/components/RollingNumber.txt +1021 -0
- package/mcp-docs/web/components/Scrubber.txt +231 -0
- package/mcp-docs/web/components/SearchInput.txt +117 -0
- package/mcp-docs/web/components/SectionHeader.txt +217 -0
- package/mcp-docs/web/components/SegmentedTabs.txt +324 -0
- package/mcp-docs/web/components/Select.txt +224 -0
- package/mcp-docs/web/components/SelectChip.txt +314 -0
- package/mcp-docs/web/components/SelectOption.txt +165 -0
- package/mcp-docs/web/components/Sidebar.txt +349 -0
- package/mcp-docs/web/components/SidebarItem.txt +131 -0
- package/mcp-docs/web/components/SidebarMoreMenu.txt +30 -0
- package/mcp-docs/web/components/Spacer.txt +173 -0
- package/mcp-docs/web/components/Sparkline.txt +122 -0
- package/mcp-docs/web/components/SparklineGradient.txt +106 -0
- package/mcp-docs/web/components/SparklineInteractive.txt +153 -0
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +76 -0
- package/mcp-docs/web/components/Spinner.txt +128 -0
- package/mcp-docs/web/components/SpotIcon.txt +48 -0
- package/mcp-docs/web/components/SpotRectangle.txt +48 -0
- package/mcp-docs/web/components/SpotSquare.txt +48 -0
- package/mcp-docs/web/components/Stepper.txt +682 -0
- package/mcp-docs/web/components/SubBrandLogoMark.txt +125 -0
- package/mcp-docs/web/components/SubBrandLogoWordMark.txt +125 -0
- package/mcp-docs/web/components/Switch.txt +85 -0
- package/mcp-docs/web/components/TabIndicator.txt +48 -0
- package/mcp-docs/web/components/TabLabel.txt +158 -0
- package/mcp-docs/web/components/TabNavigation.txt +159 -0
- package/mcp-docs/web/components/TabbedChips.txt +155 -0
- package/mcp-docs/web/components/Table.txt +367 -0
- package/mcp-docs/web/components/TableBody.txt +83 -0
- package/mcp-docs/web/components/TableCaption.txt +102 -0
- package/mcp-docs/web/components/TableCell.txt +165 -0
- package/mcp-docs/web/components/TableCellFallback.txt +97 -0
- package/mcp-docs/web/components/TableFooter.txt +83 -0
- package/mcp-docs/web/components/TableHeader.txt +100 -0
- package/mcp-docs/web/components/TableRow.txt +140 -0
- package/mcp-docs/web/components/Tabs.txt +212 -0
- package/mcp-docs/web/components/Tag.txt +304 -0
- package/mcp-docs/web/components/Text.txt +232 -0
- package/mcp-docs/web/components/TextInput.txt +652 -0
- package/mcp-docs/web/components/ThemeProvider.txt +199 -0
- package/mcp-docs/web/components/TileButton.txt +158 -0
- package/mcp-docs/web/components/Toast.txt +203 -0
- package/mcp-docs/web/components/Tooltip.txt +89 -0
- package/mcp-docs/web/components/Tour.txt +179 -0
- package/mcp-docs/web/components/Tray.txt +288 -0
- package/mcp-docs/web/components/UpsellCard.txt +319 -0
- package/mcp-docs/web/components/VStack.txt +224 -0
- package/mcp-docs/web/components/XAxis.txt +619 -0
- package/mcp-docs/web/components/YAxis.txt +548 -0
- package/mcp-docs/web/getting-started/ai-overview.txt +108 -0
- package/mcp-docs/web/getting-started/installation.txt +103 -0
- package/mcp-docs/web/getting-started/introduction.txt +102 -0
- package/mcp-docs/web/getting-started/playground.txt +28 -0
- package/mcp-docs/web/getting-started/styling.txt +161 -0
- package/mcp-docs/web/getting-started/templates.txt +121 -0
- package/mcp-docs/web/getting-started/theming.txt +426 -0
- package/mcp-docs/web/hooks/useBreakpoints.txt +61 -0
- package/mcp-docs/web/hooks/useDimensions.txt +114 -0
- package/mcp-docs/web/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/web/hooks/useHasMounted.txt +75 -0
- package/mcp-docs/web/hooks/useIsoEffect.txt +58 -0
- package/mcp-docs/web/hooks/useMediaQuery.txt +114 -0
- package/mcp-docs/web/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/web/hooks/useOverlayContentContext.txt +279 -0
- package/mcp-docs/web/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/web/hooks/useRefMap.txt +178 -0
- package/mcp-docs/web/hooks/useScrollBlocker.txt +82 -0
- package/mcp-docs/web/hooks/useTheme.txt +364 -0
- package/mcp-docs/web/routes.txt +163 -0
- package/package.json +1 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
# installation
|
|
2
|
+
|
|
3
|
+
This guide will help you get started with installing CDS in your React 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 web applications, run the following command:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @coinbase/cds-web framer-motion@^10
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Alternatively, if you are using Yarn:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add @coinbase/cds-web framer-motion@^10
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### Getting started
|
|
20
|
+
#### 1. Import global styles
|
|
21
|
+
|
|
22
|
+
Some global and icon styles are required for components to render correctly. Import these styles near your application entry point.
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import '@coinbase/cds-icons/fonts/web/icon-font.css';
|
|
26
|
+
import '@coinbase/cds-web/globalStyles';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
[See the `globalStyles` source code here →](https://github.com/coinbase/cds/blob/master/packages/web/src/styles/global.ts)
|
|
30
|
+
|
|
31
|
+
If you are using the CDS `defaultTheme` you should also import the default font styles.
|
|
32
|
+
|
|
33
|
+
```tsx
|
|
34
|
+
import '@coinbase/cds-web/defaultFontStyles';
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
#### 2. Render a ThemeProvider and MediaQueryProvider
|
|
38
|
+
|
|
39
|
+
Render a ThemeProvider at the root of your application, and pass the `theme` and `activeColorScheme`.
|
|
40
|
+
|
|
41
|
+
Render a MediaQueryProvider for components that use the `useMediaQuery` hook.
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { ThemeProvider, MediaQueryProvider } from '@coinbase/cds-web/system';
|
|
45
|
+
import { defaultTheme } from '@coinbase/cds-web/themes/defaultTheme';
|
|
46
|
+
import App from './App';
|
|
47
|
+
|
|
48
|
+
const Index = () => (
|
|
49
|
+
<MediaQueryProvider>
|
|
50
|
+
<ThemeProvider theme={defaultTheme} activeColorScheme="light">
|
|
51
|
+
<App />
|
|
52
|
+
</ThemeProvider>
|
|
53
|
+
</MediaQueryProvider>
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
export default Index;
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
:::tip
|
|
60
|
+
The MediaQueryProvider prevents issues with `window.matchMedia()` in SSR environments.
|
|
61
|
+
[Read more here →](/components/other/MediaQueryProvider#server-side-rendering)
|
|
62
|
+
:::
|
|
63
|
+
|
|
64
|
+
#### 3. Verify the installation
|
|
65
|
+
|
|
66
|
+
Try importing and rendering a simple CDS component.
|
|
67
|
+
|
|
68
|
+
```tsx
|
|
69
|
+
import { Button } from '@coinbase/cds-web/buttons';
|
|
70
|
+
|
|
71
|
+
const Test = () => <Button>Click Me</Button>;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### Example implementation
|
|
75
|
+
|
|
76
|
+
Here's an example React DOM app using the `defaultTheme`.
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import '@coinbase/cds-icons/fonts/web/icon-font.css';
|
|
80
|
+
import '@coinbase/cds-web/defaultFontStyles';
|
|
81
|
+
import '@coinbase/cds-web/globalStyles';
|
|
82
|
+
import { createRoot } from 'react-dom/client';
|
|
83
|
+
import { ThemeProvider, MediaQueryProvider } from '@coinbase/cds-web/system';
|
|
84
|
+
import { defaultTheme } from '@coinbase/cds-web/themes/defaultTheme';
|
|
85
|
+
import App from './App';
|
|
86
|
+
|
|
87
|
+
const root = createRoot(document.getElementById('root'));
|
|
88
|
+
|
|
89
|
+
root.render(
|
|
90
|
+
<MediaQueryProvider>
|
|
91
|
+
<ThemeProvider theme={defaultTheme} activeColorScheme="light">
|
|
92
|
+
<App />
|
|
93
|
+
</ThemeProvider>
|
|
94
|
+
</MediaQueryProvider>,
|
|
95
|
+
);
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Next steps
|
|
99
|
+
|
|
100
|
+
Learn how to customize CDS's appearance.
|
|
101
|
+
|
|
102
|
+
[See the theming docs here →](/getting-started/theming)
|
|
103
|
+
|
|
@@ -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,161 @@
|
|
|
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
|
+
import { media } from '@coinbase/cds-web/styles/media';
|
|
6
|
+
### `StyleProps` API
|
|
7
|
+
|
|
8
|
+
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.
|
|
9
|
+
|
|
10
|
+
[See the full list of StyleProps here →](/components/layout/Box/?platform=web&tab=props)
|
|
11
|
+
|
|
12
|
+
```jsx
|
|
13
|
+
// ✅ The `bgNegative` token will automatically update with the theme!
|
|
14
|
+
<Box background="bgNegative" width={100} />
|
|
15
|
+
|
|
16
|
+
// ❌ Error: Type '"#0000ff"' is not assignable to type 'Color | undefined'.
|
|
17
|
+
<Box background="#0000ff" width={100} />
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
:::tip
|
|
21
|
+
The docs page of every component has a props table listing all the available props!
|
|
22
|
+
:::
|
|
23
|
+
|
|
24
|
+
:::note
|
|
25
|
+
The StyleProps API applies static atomic classnames under the hood. These classnames reference CSS Variables set by the ThemeProvider to enable dynamic theming.
|
|
26
|
+
:::
|
|
27
|
+
|
|
28
|
+
#### Responsive styles
|
|
29
|
+
|
|
30
|
+
On web, all StyleProps support an optional responsive syntax for device-specific styles.
|
|
31
|
+
|
|
32
|
+
```jsx
|
|
33
|
+
<Box
|
|
34
|
+
width={{ base: 200, tablet: 200, desktop: 400 }}
|
|
35
|
+
background={{ base: 'bgPrimary', phone: 'bgSecondary' }}
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- **base:** no media query
|
|
40
|
+
- **phone:** <code>{media.phone}</code>
|
|
41
|
+
- **tablet:** <code>{media.tablet}</code>
|
|
42
|
+
- **desktop:** <code>{media.desktop}</code>
|
|
43
|
+
|
|
44
|
+
It is not possible to customize the breakpoint values unless you compile CDS from the source code.
|
|
45
|
+
|
|
46
|
+
Import the `media` object to use CDS breakpoints and media queries in your own custom styles.
|
|
47
|
+
|
|
48
|
+
[See how breakpoints are defined in the `media` object →](https://github.com/coinbase/cds/blob/master/packages/web/src/styles/media.ts)
|
|
49
|
+
|
|
50
|
+
```jsx
|
|
51
|
+
import styled from 'styled-components';
|
|
52
|
+
import { media } from '@coinbase/cds-web/styles/media';
|
|
53
|
+
|
|
54
|
+
const MyCustomThing = styled.div`
|
|
55
|
+
${media.phone} {
|
|
56
|
+
width: 100px;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### `style` and `styles` props
|
|
62
|
+
|
|
63
|
+
Most components support the native `style` prop for inline styles.
|
|
64
|
+
|
|
65
|
+
```jsx
|
|
66
|
+
<Box style={{ backgroundColor: '#0000ff' }} />
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Some complex components support passing inline styles to subcomponents with the `styles` prop.
|
|
70
|
+
|
|
71
|
+
```jsx
|
|
72
|
+
<ProgressCircle
|
|
73
|
+
styles={{
|
|
74
|
+
circle: {
|
|
75
|
+
stroke: 'transparent',
|
|
76
|
+
},
|
|
77
|
+
progress: {
|
|
78
|
+
strokeLinecap: 'square',
|
|
79
|
+
},
|
|
80
|
+
}}
|
|
81
|
+
color="fgPositive"
|
|
82
|
+
progress={0.75}
|
|
83
|
+
size={100}
|
|
84
|
+
/>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Styles are merged together as objects in order of specificity.
|
|
88
|
+
|
|
89
|
+
```jsx
|
|
90
|
+
<PageHeader style={{ backgroundColor: 'red' }} styles={{ root: { backgroundColor: 'blue' } }} />
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
In the example above, `backgroundColor` will be blue.
|
|
94
|
+
|
|
95
|
+
:::tip
|
|
96
|
+
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.
|
|
97
|
+
:::
|
|
98
|
+
|
|
99
|
+
### `className` and `classNames` props
|
|
100
|
+
|
|
101
|
+
Most components support the native `className` prop for inline styles.
|
|
102
|
+
|
|
103
|
+
```jsx
|
|
104
|
+
<Box className="my-custom-box" />
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Some complex components support passing classnames to subcomponents with the `classNames` prop.
|
|
108
|
+
|
|
109
|
+
```jsx
|
|
110
|
+
<ProgressCircle
|
|
111
|
+
classNames={{
|
|
112
|
+
circle: 'my-custom-circle',
|
|
113
|
+
progress: 'my-custom-progress',
|
|
114
|
+
}}
|
|
115
|
+
color="fgPositive"
|
|
116
|
+
progress={0.75}
|
|
117
|
+
size={100}
|
|
118
|
+
/>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
:::tip
|
|
122
|
+
We will continue to add the `classNames` prop to more components over time. Please feel free to request specific components that you think would benefit from this API.
|
|
123
|
+
:::
|
|
124
|
+
|
|
125
|
+
### Component specific props
|
|
126
|
+
|
|
127
|
+
Many components have their own specific props that can affect styling.
|
|
128
|
+
|
|
129
|
+
```jsx
|
|
130
|
+
<Button compact variant="primary">
|
|
131
|
+
Click me
|
|
132
|
+
</Button>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Combining techniques
|
|
136
|
+
|
|
137
|
+
Mix and match these styling techniques for complete customization!
|
|
138
|
+
|
|
139
|
+
```jsx
|
|
140
|
+
<Button variant="primary" borderColor="accentBoldPurple" style={{ fontFamily: 'Times' }}>
|
|
141
|
+
Click me
|
|
142
|
+
</Button>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### Global CSS reset
|
|
146
|
+
|
|
147
|
+
CDS web global styles include a CSS reset which override the browser default styles for some elements. This ensures that polymorphic components render correctly, regardless of their HTML element.
|
|
148
|
+
|
|
149
|
+
[See the global CSS reset here →](https://github.com/coinbase/cds/blob/master/packages/web/src/styles/global.ts)
|
|
150
|
+
|
|
151
|
+
### Polymorphic components
|
|
152
|
+
|
|
153
|
+
Many CDS web components have the polymorphic `as` prop, which allows you to change what component or element is being rendered under the hood.
|
|
154
|
+
|
|
155
|
+
Using the polymorphic `as` prop will change the component's type to allow the relevant native props.
|
|
156
|
+
|
|
157
|
+
```jsx
|
|
158
|
+
<Button as="a" href="google.com" />
|
|
159
|
+
<Link as="button" type="submit" />
|
|
160
|
+
```
|
|
161
|
+
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# templates
|
|
2
|
+
|
|
3
|
+
Get started quickly with pre-built templates for common app architectures. Choose from Next.js, Vite, or Webpack templates, all 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 is with a template. All templates include the required CDS packages, dependencies, and pre-configured settings. Each template provides a working example application with common UI patterns to help you start building.
|
|
12
|
+
|
|
13
|
+
<HStack gap={2} style={{ marginTop: '1.5rem', flexWrap: 'wrap', alignItems: 'stretch' }}>
|
|
14
|
+
<TemplateCard
|
|
15
|
+
description="Built for web applications with SSR and full-stack capabilities"
|
|
16
|
+
href="https://github.com/coinbase/cds/tree/master/templates/next-app"
|
|
17
|
+
icon={
|
|
18
|
+
<ThemedImage
|
|
19
|
+
sources={{
|
|
20
|
+
light: '/img/logos/frameworks/nextjs_light.png',
|
|
21
|
+
dark: '/img/logos/frameworks/nextjs_dark.png',
|
|
22
|
+
}}
|
|
23
|
+
alt="Next.js"
|
|
24
|
+
style={{ paddingTop: 'var(--space-1_5)', paddingBottom: 'var(--space-1_5)' }}
|
|
25
|
+
height="100%"
|
|
26
|
+
/>
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
<TemplateCard
|
|
30
|
+
name="Vite"
|
|
31
|
+
description="Built for fast, modern single page applications"
|
|
32
|
+
href="https://github.com/coinbase/cds/tree/master/templates/vite-app"
|
|
33
|
+
icon={
|
|
34
|
+
<ThemedImage
|
|
35
|
+
sources={{
|
|
36
|
+
light: '/img/logos/frameworks/vite.png',
|
|
37
|
+
dark: '/img/logos/frameworks/vite.png',
|
|
38
|
+
}}
|
|
39
|
+
alt=""
|
|
40
|
+
style={{ paddingTop: 'var(--space-0_5)', paddingBottom: 'var(--space-0_5)' }}
|
|
41
|
+
height="100%"
|
|
42
|
+
/>
|
|
43
|
+
}
|
|
44
|
+
/>
|
|
45
|
+
<TemplateCard
|
|
46
|
+
description="Built for customizable build setups"
|
|
47
|
+
href="https://github.com/coinbase/cds/tree/master/templates/webpack-app"
|
|
48
|
+
icon={
|
|
49
|
+
<ThemedImage
|
|
50
|
+
sources={{
|
|
51
|
+
light: '/img/logos/frameworks/webpack_light.png',
|
|
52
|
+
dark: '/img/logos/frameworks/webpack_dark.png',
|
|
53
|
+
}}
|
|
54
|
+
alt="Webpack"
|
|
55
|
+
height="100%"
|
|
56
|
+
/>
|
|
57
|
+
}
|
|
58
|
+
/>
|
|
59
|
+
</HStack>
|
|
60
|
+
|
|
61
|
+
### Installation
|
|
62
|
+
|
|
63
|
+
To create a new project from a template, use `gitpick` to bootstrap your application:
|
|
64
|
+
|
|
65
|
+
#### Next.js
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
npx -y gitpick coinbase/cds/tree/master/templates/next-app cds-next
|
|
69
|
+
cd cds-next
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### Vite
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npx -y gitpick coinbase/cds/tree/master/templates/vite-app cds-vite
|
|
76
|
+
cd cds-vite
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### Webpack
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx -y gitpick coinbase/cds/tree/master/templates/webpack-app cds-webpack
|
|
83
|
+
cd cds-webpack
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Setup
|
|
87
|
+
|
|
88
|
+
After creating your project, install dependencies and start developing:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
## We suggest using nvm to manage Node.js versions
|
|
92
|
+
nvm install
|
|
93
|
+
nvm use
|
|
94
|
+
|
|
95
|
+
## Enable corepack for package manager setup
|
|
96
|
+
corepack enable
|
|
97
|
+
|
|
98
|
+
## Install dependencies
|
|
99
|
+
yarn
|
|
100
|
+
|
|
101
|
+
## Start development server
|
|
102
|
+
yarn dev
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### What's included
|
|
106
|
+
|
|
107
|
+
All templates come pre-configured with:
|
|
108
|
+
|
|
109
|
+
- Latest CDS packages (`@coinbase/cds-web`, `@coinbase/cds-icons`, etc.)
|
|
110
|
+
- TypeScript configuration
|
|
111
|
+
- Example components demonstrating common UI patterns
|
|
112
|
+
- Theme setup with CDS default theme
|
|
113
|
+
- Responsive layouts using CDS layout components
|
|
114
|
+
|
|
115
|
+
### Next steps
|
|
116
|
+
|
|
117
|
+
After setting up your template, learn how to customize and extend CDS:
|
|
118
|
+
|
|
119
|
+
- [Theming](/getting-started/theming) - Customize colors, spacing, and typography
|
|
120
|
+
- [Installation](/getting-started/installation) - Manual installation and setup options
|
|
121
|
+
|