@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,367 @@
1
+ # Table
2
+
3
+ Displays data in rows and columns.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Table } from '@coinbase/cds-web/tables/Table'
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ CDS Data Tables allow product teams to place their content in an organized display of rows and columns enabling them to group their data by different classifications so their product users can make comparisons, glean insights and make informed decisions.
14
+
15
+ Display of content in rows and columns allows data to be organized for further analysis, allowing large amounts of raw data to be sorted and reorganized in a neat format, and allows the inclusion of only the most important or relevant data.
16
+
17
+ ### Principles
18
+
19
+ A defining element of CDS Data Tables is the ability to "manipulate" the data view. This defining attribute is represented in the table header row; the first row of a table.
20
+
21
+ The table header row not only labels the columns with a descriptive title but it also provides functionality to re-organize or re-configure what is being displayed in the corresponding cols.
22
+
23
+ A Data Table requires a header row. However it is not required that a header row have actions (sorting, filtering, etc.)
24
+
25
+ ### When to use
26
+
27
+ Use Data Tables when you want to:
28
+
29
+ - Organize data that is too detailed or complicated to be described adequately in the text
30
+ - Show many numerical values and other specific data in a small space
31
+ - Compare and contrast data values with several shared characteristics or variables
32
+ - Organize the order of content
33
+
34
+ Data Tables can contain:
35
+
36
+ - Static/Read-only content (text/strings, labels, etc)
37
+ - Interactive elements (input fields, buttons, etc)
38
+ - Actions to query and/or manipulate data (sorting, filtering, etc)
39
+
40
+ ### Cross-Platform
41
+
42
+ Data Tables are intended for and built for desktop screens. When displaying complex data sets on mobile devices we recommend using CDS Lists View.
43
+
44
+ ### Complicated tables
45
+
46
+ Sometimes you need to use a more complicated layout to fit your data. That's okay, but please be aware more complex tables come with... [more complexity](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table#complicated_tables) 🤯
47
+
48
+ ### Accessibility
49
+
50
+ :::tip Accessibility tip
51
+ Tables should have an accessible label for people using assistive technologies. The preferred and most semantic method is to add a TableCaption as the first child of your Table component (see code examples below). However, if you need more flexibility or your design does not include a caption or title, you can set a label using the `accessibilityLabelledBy` or `accessibilityLabel` props.
52
+ :::
53
+
54
+ ### Table Variants
55
+
56
+ The Table component supports three variants: `default`, `graph`, and `ruled`.
57
+
58
+ ```tsx live
59
+ <VStack gap={4}>
60
+ <Table variant="default">
61
+ <TableCaption>Default variant - Simple and clean</TableCaption>
62
+ <TableBody>
63
+ <TableRow>
64
+ <TableCell title="Default variant" />
65
+ <TableCell title="Simple and clean" />
66
+ </TableRow>
67
+ </TableBody>
68
+ </Table>
69
+
70
+ <Table variant="graph" bordered>
71
+ <TableCaption>Graph variant - With grid lines</TableCaption>
72
+ <TableBody>
73
+ <TableRow>
74
+ <TableCell title="Graph variant" />
75
+ <TableCell title="With grid lines" />
76
+ </TableRow>
77
+ </TableBody>
78
+ </Table>
79
+
80
+ <Table variant="ruled" bordered>
81
+ <TableCaption>Ruled variant - With horizontal lines</TableCaption>
82
+ <TableBody>
83
+ <TableRow>
84
+ <TableCell title="Ruled variant" />
85
+ <TableCell title="With horizontal lines" />
86
+ </TableRow>
87
+ </TableBody>
88
+ </Table>
89
+ </VStack>
90
+ ```
91
+
92
+ ### Basic usage with Layout Control
93
+
94
+ ```tsx live
95
+ function Example() {
96
+ const totalResults = accounts.length;
97
+ const PAGE_SIZE = 7;
98
+ const [page, setPage] = useState(1);
99
+ const [isFixed, setIsFixed] = useState(false);
100
+ const startIdx = (page - 1) * PAGE_SIZE;
101
+ const endIdx = Math.min(startIdx + PAGE_SIZE, totalResults);
102
+ const slicedAccounts = accounts.slice(startIdx, endIdx);
103
+
104
+ return (
105
+ <VStack gap={3}>
106
+ <HStack justifyContent="flex-end">
107
+ <Switch onChange={() => setIsFixed((isFixed) => !isFixed)} checked={isFixed}>
108
+ Fixed Layout
109
+ </Switch>
110
+ </HStack>
111
+ <Table
112
+ bordered
113
+ variant="ruled"
114
+ tableLayout={isFixed ? 'fixed' : 'auto'}
115
+ accessibilityLabel="Accounts table with pagination"
116
+ >
117
+ <TableCaption>Example</TableCaption>
118
+ <TableHeader>
119
+ <TableRow>
120
+ <TableCell title="Currency" width="30%" />
121
+ <TableCell title="Balance" width="50%" />
122
+ <TableCell title="Status" alignItems="flex-end" width="20%" />
123
+ </TableRow>
124
+ </TableHeader>
125
+ <TableBody>
126
+ {slicedAccounts.map((account) => {
127
+ return (
128
+ <TableRow key={`row--${account.name}`}>
129
+ <TableCell
130
+ start={<Icon active name="currencies" size="m" />}
131
+ title={account.name}
132
+ subtitle={account.currency.name}
133
+ />
134
+ <TableCell
135
+ title={`$${account.balance.amount}`}
136
+ subtitle={account.balance.currency}
137
+ />
138
+ <TableCell direction="horizontal" justifyContent="flex-end">
139
+ <Icon
140
+ name={account.primary ? 'circleCheckmark' : 'circleCross'}
141
+ size="m"
142
+ color={account.primary ? 'positive' : 'negative'}
143
+ />
144
+ </TableCell>
145
+ </TableRow>
146
+ );
147
+ })}
148
+ </TableBody>
149
+ <TableFooter>
150
+ <TableRow fullWidth>
151
+ <TableCell direction="horizontal">
152
+ {[1, 2, 3, 4, 5].map((pg) => (
153
+ <Button
154
+ key={pg}
155
+ compact
156
+ variant={page === pg ? 'primary' : 'secondary'}
157
+ onPress={() => setPage(pg)}
158
+ >
159
+ {pg}
160
+ </Button>
161
+ ))}
162
+ </TableCell>
163
+ </TableRow>
164
+ </TableFooter>
165
+ </Table>
166
+ </VStack>
167
+ );
168
+ }
169
+ ```
170
+
171
+ ### Cell Spacing and Compact Mode
172
+
173
+ ```tsx live
174
+ function TableCellCompactExample() {
175
+ const MOCK_DATA = Object.entries(assets).slice(0, 20);
176
+ const mediaTypes = ['Text', 'Asset', 'Image', 'Avatar'];
177
+ const [isCompact, setIsCompact] = useState(true);
178
+
179
+ return (
180
+ <VStack gap={3}>
181
+ <HStack justifyContent="flex-end">
182
+ <Switch onChange={() => setIsCompact((isCompact) => !isCompact)} checked={isCompact}>
183
+ Compact
184
+ </Switch>
185
+ </HStack>
186
+ <Table
187
+ variant="ruled"
188
+ bordered
189
+ compact={isCompact}
190
+ cellSpacing={{
191
+ inner: { horizontal: 2, vertical: 1 },
192
+ outer: { horizontal: 3, vertical: 2 },
193
+ }}
194
+ >
195
+ <TableCaption>Compact Example</TableCaption>
196
+ <TableHeader>
197
+ <TableRow backgroundColor="bgAlternate">
198
+ {mediaTypes.map((label) => (
199
+ <TableCell key={`header-cell-${label}`} title={label} />
200
+ ))}
201
+ </TableRow>
202
+ </TableHeader>
203
+ <TableBody>
204
+ <TableRow>
205
+ <TableCellFallback title subtitle />
206
+ <TableCellFallback title subtitle start="media" />
207
+ <TableCellFallback title />
208
+ <TableCellFallback title subtitle />
209
+ </TableRow>
210
+ {MOCK_DATA.map((row) => (
211
+ <TableRow key={`row-${row[0]}`}>
212
+ {mediaTypes.map((mediaType) => (
213
+ <TableCell
214
+ key={`cell-${row}--${mediaType}`}
215
+ title={`${row[1].name}`}
216
+ subtitle={row[1].symbol}
217
+ start={
218
+ mediaType === 'Text' ? null : (
219
+ <CellMedia type={mediaType.toLowerCase()} source={row[1].imageUrl} />
220
+ )
221
+ }
222
+ />
223
+ ))}
224
+ </TableRow>
225
+ ))}
226
+ </TableBody>
227
+ </Table>
228
+ </VStack>
229
+ );
230
+ }
231
+ ```
232
+
233
+ ### Height-Constrained Table with Sticky Header
234
+
235
+ ```tsx live
236
+ <Table maxHeight={360} bordered variant="ruled" accessibilityLabel="Cryptocurrency prices table">
237
+ <TableCaption>Sticky Header Example</TableCaption>
238
+ <TableHeader sticky>
239
+ <TableRow backgroundColor="bgAlternate">
240
+ <TableCell title="Currency" />
241
+ <TableCell title="Balance" />
242
+ <TableCell title="Status" alignItems="flex-end" />
243
+ </TableRow>
244
+ </TableHeader>
245
+ <TableBody>
246
+ {Array.from({ length: 6 }).map((_, i) => (
247
+ <TableRow key={i}>
248
+ <TableCell title={['BTC', 'ETH', 'APE', 'SOL', 'CVX', 'AVX'][i]} />
249
+ <TableCell title={`$${(i + 1) * 100}`} />
250
+ <TableCell title={i === 0 ? 'Pending' : 'Complete'} alignItems="flex-end" />
251
+ </TableRow>
252
+ ))}
253
+ </TableBody>
254
+ </Table>
255
+ ```
256
+
257
+ ### Complex Table Structure with Row/Column Spans
258
+
259
+ ```tsx live
260
+ <Table variant="graph" bordered accessibilityLabel="Transfer conditions and outcomes matrix">
261
+ <TableCaption>Complex Table Example</TableCaption>
262
+ <TableHeader>
263
+ <TableRow>
264
+ <TableCell title="Transfer type" rowSpan={2} />
265
+ <TableCell title="Conditions" colSpan={3} />
266
+ <TableCell title="Outcomes" colSpan={2} />
267
+ </TableRow>
268
+ <TableRow>
269
+ <TableCell title="Destination" />
270
+ <TableCell title="Currency" />
271
+ <TableCell title="Transaction size" />
272
+ <TableCell title="Consensus approvals" />
273
+ <TableCell title="Video approvals" />
274
+ </TableRow>
275
+ </TableHeader>
276
+ <TableBody>
277
+ <TableRow>
278
+ <TableCell title="Vault withdrawal" />
279
+ <TableCell title="External address" />
280
+ <TableCell title="Crypto" />
281
+ <TableCell title="Up to 0.1 BTC" />
282
+ <TableCell title="2 in 24h" />
283
+ <TableCell title="1" />
284
+ </TableRow>
285
+ <TableRow>
286
+ <TableCell title="Another row" />
287
+ <TableCell title="Addy" />
288
+ <TableCell title="Fiat" />
289
+ <TableCell title="> $100,000" />
290
+ <TableCell title="1 in 6mo" />
291
+ <TableCell title="0" />
292
+ </TableRow>
293
+ </TableBody>
294
+ </Table>
295
+ ```
296
+
297
+ ### Sortable Table
298
+
299
+ ```tsx live
300
+ function SortingExample() {
301
+ const [{ sortBy, sortDirection }, setSort] = useState({
302
+ sortBy: 'name',
303
+ sortDirection: 'ascending',
304
+ });
305
+
306
+ const onChange = (key) => {
307
+ const isAscending = key === sortBy && sortDirection === 'ascending';
308
+ const ascendingOrDescending = isAscending ? 'descending' : 'ascending';
309
+ setSort({ sortBy: key, sortDirection: ascendingOrDescending });
310
+ };
311
+
312
+ const data = useSort({ data: accounts, sortDirection, sortBy });
313
+ const getSortableProps = useSortableCell({ sortBy, sortDirection, onChange });
314
+
315
+ return (
316
+ <Table maxHeight={360} bordered accessibilityLabel="Sortable accounts table">
317
+ <TableCaption>Sorting Example</TableCaption>
318
+ <TableHeader sticky>
319
+ <TableRow>
320
+ <TableCell title="Asset" {...getSortableProps('name')} />
321
+ <TableCell title="Balance" {...getSortableProps('balance.amount')} />
322
+ <TableCell title="Status" alignItems="flex-end" />
323
+ </TableRow>
324
+ </TableHeader>
325
+ <TableBody>
326
+ {data.map((account) => {
327
+ return (
328
+ <TableRow key={`row--${account.name}`}>
329
+ <TableCell
330
+ start={<Icon active name="currencies" size="m" />}
331
+ title={account.name}
332
+ subtitle={account.currency.name}
333
+ />
334
+ <TableCell title={`$${account.balance.amount}`} subtitle={account.balance.currency} />
335
+ <TableCell direction="horizontal" justifyContent="flex-end">
336
+ <Icon
337
+ name={account.primary ? 'circleCheckmark' : 'circleCross'}
338
+ size="m"
339
+ color={account.primary ? 'positive' : 'negative'}
340
+ />
341
+ </TableCell>
342
+ </TableRow>
343
+ );
344
+ })}
345
+ </TableBody>
346
+ </Table>
347
+ );
348
+ }
349
+ ```
350
+
351
+ ## Props
352
+
353
+ | Prop | Type | Required | Default | Description |
354
+ | --- | --- | --- | --- | --- |
355
+ | `bordered` | `boolean` | No | `-` | When set, a border will be applied around the entire table |
356
+ | `cellSpacing` | `TableCellSpacing` | No | `-` | Provide custom cell spacing for all child TableCells |
357
+ | `compact` | `boolean` | No | `-` | Use compact cell spacing. If set, cellSpacing will override these defaults |
358
+ | `height` | `string \| number` | No | `-` | Set a fixed height. |
359
+ | `key` | `Key \| null` | No | `-` | - |
360
+ | `maxHeight` | `string \| number` | No | `-` | Set a maximum height. |
361
+ | `onChange` | `FormEventHandler<HTMLTableElement>` | No | `-` | - |
362
+ | `ref` | `((instance: HTMLTableElement \| null) => void) \| RefObject<HTMLTableElement> \| null` | No | `-` | - |
363
+ | `tableLayout` | `fixed \| auto` | No | `'auto'` | Use tableLayout=fixed if you need full control over cell width |
364
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
365
+ | `variant` | `default \| graph \| ruled` | No | `undefined` | The variant prop allows clients to use a CDS approved style for their Table. |
366
+
367
+
@@ -0,0 +1,83 @@
1
+ # TableBody
2
+
3
+ Defines the body section of Table.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { TableBody } from '@coinbase/cds-web/tables/TableBody'
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ ### Basic usage
14
+
15
+ ```tsx live
16
+ <Table bordered>
17
+ <TableHeader>
18
+ <TableRow>
19
+ <TableCell>Header</TableCell>
20
+ </TableRow>
21
+ </TableHeader>
22
+ <TableBody>
23
+ <TableRow>
24
+ <TableCell>Content</TableCell>
25
+ </TableRow>
26
+ </TableBody>
27
+ </Table>
28
+ ```
29
+
30
+ ### Loading State Example
31
+
32
+ ```tsx live
33
+ <Table bordered variant="ruled">
34
+ <TableHeader>
35
+ <TableRow>
36
+ <TableCell title="TableHeader" />
37
+ </TableRow>
38
+ </TableHeader>
39
+ <TableBody>
40
+ <TableRow>
41
+ <TableCell height={320} alignItems="center" justifyContent="center">
42
+ <Spinner size={4} color="primary" />
43
+ <TextHeadline as="p" spacingTop={2} color="foregroundMuted">
44
+ Loading content...
45
+ </TextHeadline>
46
+ </TableCell>
47
+ </TableRow>
48
+ </TableBody>
49
+ </Table>
50
+ ```
51
+
52
+ ### Multiple Rows Example
53
+
54
+ ```tsx live
55
+ <Table bordered>
56
+ <TableHeader>
57
+ <TableRow>
58
+ <TableCell>Name</TableCell>
59
+ <TableCell>Role</TableCell>
60
+ </TableRow>
61
+ </TableHeader>
62
+ <TableBody>
63
+ <TableRow>
64
+ <TableCell>John Doe</TableCell>
65
+ <TableCell>Developer</TableCell>
66
+ </TableRow>
67
+ <TableRow>
68
+ <TableCell>Jane Smith</TableCell>
69
+ <TableCell>Designer</TableCell>
70
+ </TableRow>
71
+ </TableBody>
72
+ </Table>
73
+ ```
74
+
75
+ ## Props
76
+
77
+ | Prop | Type | Required | Default | Description |
78
+ | --- | --- | --- | --- | --- |
79
+ | `as` | `div \| tbody \| tfoot \| thead` | No | `undefined` | Internal only |
80
+ | `className` | `string` | No | `-` | - |
81
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
82
+
83
+
@@ -0,0 +1,102 @@
1
+ # TableCaption
2
+
3
+ Sets an accessible title or caption for Table.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { TableCaption } from '@coinbase/cds-web/tables/TableCaption'
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ ### Basic usage
14
+
15
+ ```tsx live
16
+ <Table bordered>
17
+ <TableCaption>Simple Table Caption</TableCaption>
18
+ <TableHeader>
19
+ <TableRow>
20
+ <TableCell title="Name" />
21
+ <TableCell title="Role" />
22
+ </TableRow>
23
+ </TableHeader>
24
+ <TableBody>
25
+ <TableRow>
26
+ <TableCell title="John Doe" />
27
+ <TableCell title="Developer" />
28
+ </TableRow>
29
+ </TableBody>
30
+ </Table>
31
+ ```
32
+
33
+ ### Custom Content
34
+
35
+ ```tsx live
36
+ <Table bordered>
37
+ <TableCaption>
38
+ <VStack gap={1}>
39
+ <TextTitle2 as="h2" color="primary">
40
+ Project Team
41
+ </TextTitle2>
42
+ <Text as="p" color="foregroundMuted">
43
+ Updated as of March 2024
44
+ </Text>
45
+ </VStack>
46
+ </TableCaption>
47
+ <TableHeader>
48
+ <TableRow>
49
+ <TableCell title="Name" />
50
+ <TableCell title="Role" />
51
+ </TableRow>
52
+ </TableHeader>
53
+ <TableBody>
54
+ <TableRow>
55
+ <TableCell title="John Doe" />
56
+ <TableCell title="Developer" />
57
+ </TableRow>
58
+ </TableBody>
59
+ </Table>
60
+ ```
61
+
62
+ ### Styling Options
63
+
64
+ ```tsx live
65
+ <Table bordered>
66
+ <TableCaption
67
+ align="center"
68
+ color="fgPrimary"
69
+ backgroundColor="bgAlternate"
70
+ innerSpacing={{ spacingHorizontal: 2, spacingVertical: 1 }}
71
+ outerSpacing={{ spacingHorizontal: 0, spacingVertical: 1 }}
72
+ >
73
+ Quarterly Revenue Report
74
+ </TableCaption>
75
+ <TableHeader>
76
+ <TableRow>
77
+ <TableCell title="Quarter" />
78
+ <TableCell title="Revenue" />
79
+ </TableRow>
80
+ </TableHeader>
81
+ <TableBody>
82
+ <TableRow>
83
+ <TableCell title="Q1 2024" />
84
+ <TableCell title="$1.2M" />
85
+ </TableRow>
86
+ </TableBody>
87
+ </Table>
88
+ ```
89
+
90
+ ## Props
91
+
92
+ | Prop | Type | Required | Default | Description |
93
+ | --- | --- | --- | --- | --- |
94
+ | `align` | `center \| start \| end \| justify` | No | `'start'` | Specify text alignment. Only applicable when children is a string. |
95
+ | `as` | `div \| abbr \| code \| dd \| del \| dl \| dt \| h1 \| h2 \| h3 \| h4 \| ins \| kbd \| label \| li \| output \| p \| pre \| q \| s \| span \| strong \| sub \| sup \| time` | No | `'span'` | A semantic HTML element or a React component to be rendered. Only applicable when children is a string. |
96
+ | `backgroundColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | Set the background color to a CDS palette background color name. |
97
+ | `innerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the inner content of the caption. Overrides table cell spacing defaults. |
98
+ | `onChange` | `FormEventHandler<HTMLTableCaptionElement>` | No | `-` | - |
99
+ | `outerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the parent wrapper of the caption. Overrides table cell spacing defaults. |
100
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
101
+
102
+