@coinbase/cds-mcp-server 8.17.2 → 8.17.3

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 (269) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/mcp-docs/mobile/components/Accordion.txt +189 -0
  3. package/mcp-docs/mobile/components/AccordionItem.txt +30 -0
  4. package/mcp-docs/mobile/components/Alert.txt +156 -0
  5. package/mcp-docs/mobile/components/AreaChart.txt +266 -0
  6. package/mcp-docs/mobile/components/Avatar.txt +196 -0
  7. package/mcp-docs/mobile/components/AvatarButton.txt +226 -0
  8. package/mcp-docs/mobile/components/Banner.txt +222 -0
  9. package/mcp-docs/mobile/components/BarChart.txt +816 -0
  10. package/mcp-docs/mobile/components/Box.txt +174 -0
  11. package/mcp-docs/mobile/components/BrowserBar.txt +147 -0
  12. package/mcp-docs/mobile/components/Button.txt +199 -0
  13. package/mcp-docs/mobile/components/ButtonGroup.txt +80 -0
  14. package/mcp-docs/mobile/components/Carousel.txt +1084 -0
  15. package/mcp-docs/mobile/components/CartesianChart.txt +826 -0
  16. package/mcp-docs/mobile/components/CellMedia.txt +71 -0
  17. package/mcp-docs/mobile/components/Checkbox.txt +246 -0
  18. package/mcp-docs/mobile/components/CheckboxCell.txt +202 -0
  19. package/mcp-docs/mobile/components/CheckboxGroup.txt +285 -0
  20. package/mcp-docs/mobile/components/Chip.txt +195 -0
  21. package/mcp-docs/mobile/components/Coachmark.txt +158 -0
  22. package/mcp-docs/mobile/components/Collapsible.txt +105 -0
  23. package/mcp-docs/mobile/components/ContainedAssetCard.txt +135 -0
  24. package/mcp-docs/mobile/components/ContentCard.txt +366 -0
  25. package/mcp-docs/mobile/components/ContentCardBody.txt +136 -0
  26. package/mcp-docs/mobile/components/ContentCardFooter.txt +128 -0
  27. package/mcp-docs/mobile/components/ContentCardHeader.txt +146 -0
  28. package/mcp-docs/mobile/components/ContentCell.txt +227 -0
  29. package/mcp-docs/mobile/components/ControlGroup.txt +444 -0
  30. package/mcp-docs/mobile/components/DatePicker.txt +497 -0
  31. package/mcp-docs/mobile/components/Divider.txt +139 -0
  32. package/mcp-docs/mobile/components/DotCount.txt +146 -0
  33. package/mcp-docs/mobile/components/DotStatusColor.txt +59 -0
  34. package/mcp-docs/mobile/components/DotSymbol.txt +135 -0
  35. package/mcp-docs/mobile/components/Fallback.txt +158 -0
  36. package/mcp-docs/mobile/components/FloatingAssetCard.txt +156 -0
  37. package/mcp-docs/mobile/components/HStack.txt +235 -0
  38. package/mcp-docs/mobile/components/HeroSquare.txt +48 -0
  39. package/mcp-docs/mobile/components/Icon.txt +52 -0
  40. package/mcp-docs/mobile/components/IconButton.txt +269 -0
  41. package/mcp-docs/mobile/components/InputChip.txt +188 -0
  42. package/mcp-docs/mobile/components/Interactable.txt +187 -0
  43. package/mcp-docs/mobile/components/LineChart.txt +1325 -0
  44. package/mcp-docs/mobile/components/Link.txt +292 -0
  45. package/mcp-docs/mobile/components/ListCell.txt +391 -0
  46. package/mcp-docs/mobile/components/LogoMark.txt +85 -0
  47. package/mcp-docs/mobile/components/LogoWordMark.txt +94 -0
  48. package/mcp-docs/mobile/components/Lottie.txt +139 -0
  49. package/mcp-docs/mobile/components/LottieStatusAnimation.txt +47 -0
  50. package/mcp-docs/mobile/components/Modal.txt +84 -0
  51. package/mcp-docs/mobile/components/ModalBody.txt +34 -0
  52. package/mcp-docs/mobile/components/ModalFooter.txt +25 -0
  53. package/mcp-docs/mobile/components/ModalHeader.txt +28 -0
  54. package/mcp-docs/mobile/components/MultiContentModule.txt +380 -0
  55. package/mcp-docs/mobile/components/NavigationTitle.txt +132 -0
  56. package/mcp-docs/mobile/components/NavigationTitleSelect.txt +142 -0
  57. package/mcp-docs/mobile/components/NudgeCard.txt +90 -0
  58. package/mcp-docs/mobile/components/Numpad.txt +341 -0
  59. package/mcp-docs/mobile/components/Overlay.txt +152 -0
  60. package/mcp-docs/mobile/components/PageFooter.txt +161 -0
  61. package/mcp-docs/mobile/components/PageHeader.txt +186 -0
  62. package/mcp-docs/mobile/components/PeriodSelector.txt +408 -0
  63. package/mcp-docs/mobile/components/Pictogram.txt +48 -0
  64. package/mcp-docs/mobile/components/Point.txt +205 -0
  65. package/mcp-docs/mobile/components/PortalProvider.txt +79 -0
  66. package/mcp-docs/mobile/components/Pressable.txt +211 -0
  67. package/mcp-docs/mobile/components/ProgressBar.txt +130 -0
  68. package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +161 -0
  69. package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +138 -0
  70. package/mcp-docs/mobile/components/ProgressCircle.txt +237 -0
  71. package/mcp-docs/mobile/components/Radio.txt +242 -0
  72. package/mcp-docs/mobile/components/RadioCell.txt +202 -0
  73. package/mcp-docs/mobile/components/RadioGroup.txt +282 -0
  74. package/mcp-docs/mobile/components/ReferenceLine.txt +153 -0
  75. package/mcp-docs/mobile/components/RemoteImage.txt +106 -0
  76. package/mcp-docs/mobile/components/RemoteImageGroup.txt +61 -0
  77. package/mcp-docs/mobile/components/RollingNumber.txt +789 -0
  78. package/mcp-docs/mobile/components/Scrubber.txt +204 -0
  79. package/mcp-docs/mobile/components/SearchInput.txt +192 -0
  80. package/mcp-docs/mobile/components/SectionHeader.txt +205 -0
  81. package/mcp-docs/mobile/components/SegmentedTabs.txt +316 -0
  82. package/mcp-docs/mobile/components/Select.txt +212 -0
  83. package/mcp-docs/mobile/components/SelectChip.txt +324 -0
  84. package/mcp-docs/mobile/components/SelectOption.txt +85 -0
  85. package/mcp-docs/mobile/components/SlideButton.txt +331 -0
  86. package/mcp-docs/mobile/components/Spacer.txt +84 -0
  87. package/mcp-docs/mobile/components/Sparkline.txt +123 -0
  88. package/mcp-docs/mobile/components/SparklineGradient.txt +107 -0
  89. package/mcp-docs/mobile/components/SparklineInteractive.txt +157 -0
  90. package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +73 -0
  91. package/mcp-docs/mobile/components/Spinner.txt +49 -0
  92. package/mcp-docs/mobile/components/SpotIcon.txt +48 -0
  93. package/mcp-docs/mobile/components/SpotRectangle.txt +48 -0
  94. package/mcp-docs/mobile/components/SpotSquare.txt +48 -0
  95. package/mcp-docs/mobile/components/Stepper.txt +528 -0
  96. package/mcp-docs/mobile/components/SubBrandLogoMark.txt +126 -0
  97. package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +126 -0
  98. package/mcp-docs/mobile/components/Switch.txt +98 -0
  99. package/mcp-docs/mobile/components/TabIndicator.txt +49 -0
  100. package/mcp-docs/mobile/components/TabLabel.txt +154 -0
  101. package/mcp-docs/mobile/components/TabNavigation.txt +147 -0
  102. package/mcp-docs/mobile/components/TabbedChips.txt +143 -0
  103. package/mcp-docs/mobile/components/Tabs.txt +191 -0
  104. package/mcp-docs/mobile/components/Tag.txt +301 -0
  105. package/mcp-docs/mobile/components/Text.txt +212 -0
  106. package/mcp-docs/mobile/components/TextInput.txt +718 -0
  107. package/mcp-docs/mobile/components/ThemeProvider.txt +133 -0
  108. package/mcp-docs/mobile/components/Toast.txt +197 -0
  109. package/mcp-docs/mobile/components/Tooltip.txt +60 -0
  110. package/mcp-docs/mobile/components/TopNavBar.txt +162 -0
  111. package/mcp-docs/mobile/components/Tour.txt +159 -0
  112. package/mcp-docs/mobile/components/Tray.txt +253 -0
  113. package/mcp-docs/mobile/components/UpsellCard.txt +322 -0
  114. package/mcp-docs/mobile/components/VStack.txt +223 -0
  115. package/mcp-docs/mobile/components/XAxis.txt +622 -0
  116. package/mcp-docs/mobile/components/YAxis.txt +568 -0
  117. package/mcp-docs/mobile/getting-started/introduction.txt +99 -0
  118. package/mcp-docs/mobile/getting-started/mcp-server.txt +94 -0
  119. package/mcp-docs/mobile/getting-started/playground.txt +25 -0
  120. package/mcp-docs/mobile/hooks/useDimensions.txt +47 -0
  121. package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +215 -0
  122. package/mcp-docs/mobile/hooks/useTheme.txt +110 -0
  123. package/mcp-docs/mobile/routes.txt +132 -0
  124. package/mcp-docs/web/components/Accordion.txt +190 -0
  125. package/mcp-docs/web/components/AccordionItem.txt +32 -0
  126. package/mcp-docs/web/components/Alert.txt +165 -0
  127. package/mcp-docs/web/components/AreaChart.txt +511 -0
  128. package/mcp-docs/web/components/Avatar.txt +212 -0
  129. package/mcp-docs/web/components/AvatarButton.txt +241 -0
  130. package/mcp-docs/web/components/Banner.txt +227 -0
  131. package/mcp-docs/web/components/BarChart.txt +1268 -0
  132. package/mcp-docs/web/components/Box.txt +176 -0
  133. package/mcp-docs/web/components/Button.txt +213 -0
  134. package/mcp-docs/web/components/ButtonGroup.txt +80 -0
  135. package/mcp-docs/web/components/Calendar.txt +182 -0
  136. package/mcp-docs/web/components/Carousel.txt +1576 -0
  137. package/mcp-docs/web/components/CartesianChart.txt +1045 -0
  138. package/mcp-docs/web/components/CellMedia.txt +57 -0
  139. package/mcp-docs/web/components/Checkbox.txt +189 -0
  140. package/mcp-docs/web/components/CheckboxCell.txt +203 -0
  141. package/mcp-docs/web/components/CheckboxGroup.txt +220 -0
  142. package/mcp-docs/web/components/Chip.txt +197 -0
  143. package/mcp-docs/web/components/Coachmark.txt +189 -0
  144. package/mcp-docs/web/components/Collapsible.txt +120 -0
  145. package/mcp-docs/web/components/ContainedAssetCard.txt +233 -0
  146. package/mcp-docs/web/components/ContentCard.txt +368 -0
  147. package/mcp-docs/web/components/ContentCardBody.txt +138 -0
  148. package/mcp-docs/web/components/ContentCardFooter.txt +130 -0
  149. package/mcp-docs/web/components/ContentCardHeader.txt +148 -0
  150. package/mcp-docs/web/components/ContentCell.txt +220 -0
  151. package/mcp-docs/web/components/ControlGroup.txt +437 -0
  152. package/mcp-docs/web/components/DatePicker.txt +506 -0
  153. package/mcp-docs/web/components/Divider.txt +144 -0
  154. package/mcp-docs/web/components/DotCount.txt +150 -0
  155. package/mcp-docs/web/components/DotStatusColor.txt +59 -0
  156. package/mcp-docs/web/components/DotSymbol.txt +138 -0
  157. package/mcp-docs/web/components/Dropdown.txt +120 -0
  158. package/mcp-docs/web/components/Fallback.txt +164 -0
  159. package/mcp-docs/web/components/FloatingAssetCard.txt +251 -0
  160. package/mcp-docs/web/components/FullscreenAlert.txt +70 -0
  161. package/mcp-docs/web/components/FullscreenModal.txt +146 -0
  162. package/mcp-docs/web/components/FullscreenModalLayout.txt +188 -0
  163. package/mcp-docs/web/components/Grid.txt +237 -0
  164. package/mcp-docs/web/components/GridColumn.txt +210 -0
  165. package/mcp-docs/web/components/HStack.txt +237 -0
  166. package/mcp-docs/web/components/HeroSquare.txt +49 -0
  167. package/mcp-docs/web/components/Icon.txt +146 -0
  168. package/mcp-docs/web/components/IconButton.txt +391 -0
  169. package/mcp-docs/web/components/InputChip.txt +188 -0
  170. package/mcp-docs/web/components/Interactable.txt +194 -0
  171. package/mcp-docs/web/components/LineChart.txt +1577 -0
  172. package/mcp-docs/web/components/Link.txt +244 -0
  173. package/mcp-docs/web/components/ListCell.txt +397 -0
  174. package/mcp-docs/web/components/LogoMark.txt +85 -0
  175. package/mcp-docs/web/components/LogoWordMark.txt +94 -0
  176. package/mcp-docs/web/components/Lottie.txt +158 -0
  177. package/mcp-docs/web/components/LottieStatusAnimation.txt +58 -0
  178. package/mcp-docs/web/components/MediaQueryProvider.txt +109 -0
  179. package/mcp-docs/web/components/Modal.txt +193 -0
  180. package/mcp-docs/web/components/ModalBody.txt +118 -0
  181. package/mcp-docs/web/components/ModalFooter.txt +120 -0
  182. package/mcp-docs/web/components/ModalHeader.txt +124 -0
  183. package/mcp-docs/web/components/MultiContentModule.txt +382 -0
  184. package/mcp-docs/web/components/NavigationBar.txt +103 -0
  185. package/mcp-docs/web/components/NavigationTitle.txt +26 -0
  186. package/mcp-docs/web/components/NavigationTitleSelect.txt +46 -0
  187. package/mcp-docs/web/components/NudgeCard.txt +182 -0
  188. package/mcp-docs/web/components/Overlay.txt +172 -0
  189. package/mcp-docs/web/components/PageFooter.txt +185 -0
  190. package/mcp-docs/web/components/PageHeader.txt +244 -0
  191. package/mcp-docs/web/components/Pagination.txt +500 -0
  192. package/mcp-docs/web/components/PeriodSelector.txt +704 -0
  193. package/mcp-docs/web/components/Pictogram.txt +49 -0
  194. package/mcp-docs/web/components/Point.txt +461 -0
  195. package/mcp-docs/web/components/PortalProvider.txt +77 -0
  196. package/mcp-docs/web/components/Pressable.txt +194 -0
  197. package/mcp-docs/web/components/ProgressBar.txt +164 -0
  198. package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +213 -0
  199. package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +182 -0
  200. package/mcp-docs/web/components/ProgressCircle.txt +444 -0
  201. package/mcp-docs/web/components/Radio.txt +220 -0
  202. package/mcp-docs/web/components/RadioCell.txt +216 -0
  203. package/mcp-docs/web/components/RadioGroup.txt +289 -0
  204. package/mcp-docs/web/components/ReferenceLine.txt +452 -0
  205. package/mcp-docs/web/components/RemoteImage.txt +166 -0
  206. package/mcp-docs/web/components/RemoteImageGroup.txt +87 -0
  207. package/mcp-docs/web/components/RollingNumber.txt +1022 -0
  208. package/mcp-docs/web/components/Scrubber.txt +232 -0
  209. package/mcp-docs/web/components/SearchInput.txt +118 -0
  210. package/mcp-docs/web/components/SectionHeader.txt +218 -0
  211. package/mcp-docs/web/components/SegmentedTabs.txt +325 -0
  212. package/mcp-docs/web/components/Select.txt +225 -0
  213. package/mcp-docs/web/components/SelectChip.txt +315 -0
  214. package/mcp-docs/web/components/SelectOption.txt +166 -0
  215. package/mcp-docs/web/components/Sidebar.txt +350 -0
  216. package/mcp-docs/web/components/SidebarItem.txt +132 -0
  217. package/mcp-docs/web/components/SidebarMoreMenu.txt +31 -0
  218. package/mcp-docs/web/components/Spacer.txt +174 -0
  219. package/mcp-docs/web/components/Sparkline.txt +123 -0
  220. package/mcp-docs/web/components/SparklineGradient.txt +107 -0
  221. package/mcp-docs/web/components/SparklineInteractive.txt +154 -0
  222. package/mcp-docs/web/components/SparklineInteractiveHeader.txt +77 -0
  223. package/mcp-docs/web/components/Spinner.txt +129 -0
  224. package/mcp-docs/web/components/SpotIcon.txt +49 -0
  225. package/mcp-docs/web/components/SpotRectangle.txt +49 -0
  226. package/mcp-docs/web/components/SpotSquare.txt +49 -0
  227. package/mcp-docs/web/components/Stepper.txt +683 -0
  228. package/mcp-docs/web/components/SubBrandLogoMark.txt +126 -0
  229. package/mcp-docs/web/components/SubBrandLogoWordMark.txt +126 -0
  230. package/mcp-docs/web/components/Switch.txt +86 -0
  231. package/mcp-docs/web/components/TabIndicator.txt +49 -0
  232. package/mcp-docs/web/components/TabLabel.txt +159 -0
  233. package/mcp-docs/web/components/TabNavigation.txt +160 -0
  234. package/mcp-docs/web/components/TabbedChips.txt +156 -0
  235. package/mcp-docs/web/components/Table.txt +368 -0
  236. package/mcp-docs/web/components/TableBody.txt +84 -0
  237. package/mcp-docs/web/components/TableCaption.txt +103 -0
  238. package/mcp-docs/web/components/TableCell.txt +166 -0
  239. package/mcp-docs/web/components/TableCellFallback.txt +98 -0
  240. package/mcp-docs/web/components/TableFooter.txt +84 -0
  241. package/mcp-docs/web/components/TableHeader.txt +101 -0
  242. package/mcp-docs/web/components/TableRow.txt +141 -0
  243. package/mcp-docs/web/components/Tabs.txt +213 -0
  244. package/mcp-docs/web/components/Tag.txt +305 -0
  245. package/mcp-docs/web/components/Text.txt +233 -0
  246. package/mcp-docs/web/components/TextInput.txt +653 -0
  247. package/mcp-docs/web/components/ThemeProvider.txt +200 -0
  248. package/mcp-docs/web/components/TileButton.txt +159 -0
  249. package/mcp-docs/web/components/Toast.txt +204 -0
  250. package/mcp-docs/web/components/Tooltip.txt +90 -0
  251. package/mcp-docs/web/components/Tour.txt +180 -0
  252. package/mcp-docs/web/components/Tray.txt +289 -0
  253. package/mcp-docs/web/components/UpsellCard.txt +320 -0
  254. package/mcp-docs/web/components/VStack.txt +225 -0
  255. package/mcp-docs/web/components/XAxis.txt +620 -0
  256. package/mcp-docs/web/components/YAxis.txt +549 -0
  257. package/mcp-docs/web/getting-started/introduction.txt +99 -0
  258. package/mcp-docs/web/getting-started/mcp-server.txt +94 -0
  259. package/mcp-docs/web/getting-started/playground.txt +25 -0
  260. package/mcp-docs/web/hooks/useBreakpoints.txt +33 -0
  261. package/mcp-docs/web/hooks/useDimensions.txt +55 -0
  262. package/mcp-docs/web/hooks/useHasMounted.txt +55 -0
  263. package/mcp-docs/web/hooks/useIsoEffect.txt +42 -0
  264. package/mcp-docs/web/hooks/useMediaQuery.txt +94 -0
  265. package/mcp-docs/web/hooks/useOverlayContentContext.txt +217 -0
  266. package/mcp-docs/web/hooks/useScrollBlocker.txt +63 -0
  267. package/mcp-docs/web/hooks/useTheme.txt +105 -0
  268. package/mcp-docs/web/routes.txt +155 -0
  269. package/package.json +1 -1
@@ -0,0 +1,368 @@
1
+ # Table
2
+
3
+ Displays data in rows and columns.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { Table } from '@coinbase/cds-web/tables/Table'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `bordered` | `boolean` | No | `-` | When set, a border will be applied around the entire table |
16
+ | `cellSpacing` | `TableCellSpacing` | No | `-` | Provide custom cell spacing for all child TableCells |
17
+ | `compact` | `boolean` | No | `-` | Use compact cell spacing. If set, cellSpacing will override these defaults |
18
+ | `height` | `string \| number` | No | `-` | Set a fixed height. |
19
+ | `key` | `Key \| null` | No | `-` | - |
20
+ | `maxHeight` | `string \| number` | No | `-` | Set a maximum height. |
21
+ | `onChange` | `FormEventHandler<HTMLTableElement>` | No | `-` | - |
22
+ | `ref` | `((instance: HTMLTableElement \| null) => void) \| RefObject<HTMLTableElement> \| null` | No | `-` | - |
23
+ | `tableLayout` | `fixed \| auto` | No | `'auto'` | Use tableLayout=fixed if you need full control over cell width |
24
+ | `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 |
25
+ | `variant` | `default \| graph \| ruled` | No | `undefined` | The variant prop allows clients to use a CDS approved style for their Table. |
26
+
27
+
28
+ ## Examples
29
+
30
+ 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.
31
+
32
+ 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.
33
+
34
+ ### Principles
35
+
36
+ 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.
37
+
38
+ 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.
39
+
40
+ A Data Table requires a header row. However it is not required that a header row have actions (sorting, filtering, etc.)
41
+
42
+ ### When to use
43
+
44
+ Use Data Tables when you want to:
45
+
46
+ - Organize data that is too detailed or complicated to be described adequately in the text
47
+ - Show many numerical values and other specific data in a small space
48
+ - Compare and contrast data values with several shared characteristics or variables
49
+ - Organize the order of content
50
+
51
+ Data Tables can contain:
52
+
53
+ - Static/Read-only content (text/strings, labels, etc)
54
+ - Interactive elements (input fields, buttons, etc)
55
+ - Actions to query and/or manipulate data (sorting, filtering, etc)
56
+
57
+ ### Cross-Platform
58
+
59
+ Data Tables are intended for and built for desktop screens. When displaying complex data sets on mobile devices we recommend using CDS Lists View.
60
+
61
+ ### Complicated tables
62
+
63
+ 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) 🤯
64
+
65
+ ### Accessibility
66
+
67
+ :::tip Accessibility tip
68
+ 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.
69
+ :::
70
+
71
+ ### Table Variants
72
+
73
+ The Table component supports three variants: `default`, `graph`, and `ruled`.
74
+
75
+ ```tsx live
76
+ <VStack gap={4}>
77
+ <Table variant="default">
78
+ <TableCaption>Default variant - Simple and clean</TableCaption>
79
+ <TableBody>
80
+ <TableRow>
81
+ <TableCell title="Default variant" />
82
+ <TableCell title="Simple and clean" />
83
+ </TableRow>
84
+ </TableBody>
85
+ </Table>
86
+
87
+ <Table variant="graph" bordered>
88
+ <TableCaption>Graph variant - With grid lines</TableCaption>
89
+ <TableBody>
90
+ <TableRow>
91
+ <TableCell title="Graph variant" />
92
+ <TableCell title="With grid lines" />
93
+ </TableRow>
94
+ </TableBody>
95
+ </Table>
96
+
97
+ <Table variant="ruled" bordered>
98
+ <TableCaption>Ruled variant - With horizontal lines</TableCaption>
99
+ <TableBody>
100
+ <TableRow>
101
+ <TableCell title="Ruled variant" />
102
+ <TableCell title="With horizontal lines" />
103
+ </TableRow>
104
+ </TableBody>
105
+ </Table>
106
+ </VStack>
107
+ ```
108
+
109
+ ### Basic usage with Layout Control
110
+
111
+ ```tsx live
112
+ function Example() {
113
+ const totalResults = accounts.length;
114
+ const PAGE_SIZE = 7;
115
+ const [page, setPage] = useState(1);
116
+ const [isFixed, setIsFixed] = useState(false);
117
+ const startIdx = (page - 1) * PAGE_SIZE;
118
+ const endIdx = Math.min(startIdx + PAGE_SIZE, totalResults);
119
+ const slicedAccounts = accounts.slice(startIdx, endIdx);
120
+
121
+ return (
122
+ <VStack gap={3}>
123
+ <HStack justifyContent="flex-end">
124
+ <Switch onChange={() => setIsFixed((isFixed) => !isFixed)} checked={isFixed}>
125
+ Fixed Layout
126
+ </Switch>
127
+ </HStack>
128
+ <Table
129
+ bordered
130
+ variant="ruled"
131
+ tableLayout={isFixed ? 'fixed' : 'auto'}
132
+ accessibilityLabel="Accounts table with pagination"
133
+ >
134
+ <TableCaption>Example</TableCaption>
135
+ <TableHeader>
136
+ <TableRow>
137
+ <TableCell title="Currency" width="30%" />
138
+ <TableCell title="Balance" width="50%" />
139
+ <TableCell title="Status" alignItems="flex-end" width="20%" />
140
+ </TableRow>
141
+ </TableHeader>
142
+ <TableBody>
143
+ {slicedAccounts.map((account) => {
144
+ return (
145
+ <TableRow key={`row--${account.name}`}>
146
+ <TableCell
147
+ start={<Icon active name="currencies" size="m" />}
148
+ title={account.name}
149
+ subtitle={account.currency.name}
150
+ />
151
+ <TableCell
152
+ title={`$${account.balance.amount}`}
153
+ subtitle={account.balance.currency}
154
+ />
155
+ <TableCell direction="horizontal" justifyContent="flex-end">
156
+ <Icon
157
+ name={account.primary ? 'circleCheckmark' : 'circleCross'}
158
+ size="m"
159
+ color={account.primary ? 'positive' : 'negative'}
160
+ />
161
+ </TableCell>
162
+ </TableRow>
163
+ );
164
+ })}
165
+ </TableBody>
166
+ <TableFooter>
167
+ <TableRow fullWidth>
168
+ <TableCell direction="horizontal">
169
+ {[1, 2, 3, 4, 5].map((pg) => (
170
+ <Button
171
+ key={pg}
172
+ compact
173
+ variant={page === pg ? 'primary' : 'secondary'}
174
+ onPress={() => setPage(pg)}
175
+ >
176
+ {pg}
177
+ </Button>
178
+ ))}
179
+ </TableCell>
180
+ </TableRow>
181
+ </TableFooter>
182
+ </Table>
183
+ </VStack>
184
+ );
185
+ }
186
+ ```
187
+
188
+ ### Cell Spacing and Compact Mode
189
+
190
+ ```tsx live
191
+ function TableCellCompactExample() {
192
+ const MOCK_DATA = Object.entries(assets).slice(0, 20);
193
+ const mediaTypes = ['Text', 'Asset', 'Image', 'Avatar'];
194
+ const [isCompact, setIsCompact] = useState(true);
195
+
196
+ return (
197
+ <VStack gap={3}>
198
+ <HStack justifyContent="flex-end">
199
+ <Switch onChange={() => setIsCompact((isCompact) => !isCompact)} checked={isCompact}>
200
+ Compact
201
+ </Switch>
202
+ </HStack>
203
+ <Table
204
+ variant="ruled"
205
+ bordered
206
+ compact={isCompact}
207
+ cellSpacing={{
208
+ inner: { horizontal: 2, vertical: 1 },
209
+ outer: { horizontal: 3, vertical: 2 },
210
+ }}
211
+ >
212
+ <TableCaption>Compact Example</TableCaption>
213
+ <TableHeader>
214
+ <TableRow backgroundColor="bgAlternate">
215
+ {mediaTypes.map((label) => (
216
+ <TableCell key={`header-cell-${label}`} title={label} />
217
+ ))}
218
+ </TableRow>
219
+ </TableHeader>
220
+ <TableBody>
221
+ <TableRow>
222
+ <TableCellFallback title subtitle />
223
+ <TableCellFallback title subtitle start="media" />
224
+ <TableCellFallback title />
225
+ <TableCellFallback title subtitle />
226
+ </TableRow>
227
+ {MOCK_DATA.map((row) => (
228
+ <TableRow key={`row-${row[0]}`}>
229
+ {mediaTypes.map((mediaType) => (
230
+ <TableCell
231
+ key={`cell-${row}--${mediaType}`}
232
+ title={`${row[1].name}`}
233
+ subtitle={row[1].symbol}
234
+ start={
235
+ mediaType === 'Text' ? null : (
236
+ <CellMedia type={mediaType.toLowerCase()} source={row[1].imageUrl} />
237
+ )
238
+ }
239
+ />
240
+ ))}
241
+ </TableRow>
242
+ ))}
243
+ </TableBody>
244
+ </Table>
245
+ </VStack>
246
+ );
247
+ }
248
+ ```
249
+
250
+ ### Height-Constrained Table with Sticky Header
251
+
252
+ ```tsx live
253
+ <Table maxHeight={360} bordered variant="ruled" accessibilityLabel="Cryptocurrency prices table">
254
+ <TableCaption>Sticky Header Example</TableCaption>
255
+ <TableHeader sticky>
256
+ <TableRow backgroundColor="bgAlternate">
257
+ <TableCell title="Currency" />
258
+ <TableCell title="Balance" />
259
+ <TableCell title="Status" alignItems="flex-end" />
260
+ </TableRow>
261
+ </TableHeader>
262
+ <TableBody>
263
+ {Array.from({ length: 6 }).map((_, i) => (
264
+ <TableRow key={i}>
265
+ <TableCell title={['BTC', 'ETH', 'APE', 'SOL', 'CVX', 'AVX'][i]} />
266
+ <TableCell title={`$${(i + 1) * 100}`} />
267
+ <TableCell title={i === 0 ? 'Pending' : 'Complete'} alignItems="flex-end" />
268
+ </TableRow>
269
+ ))}
270
+ </TableBody>
271
+ </Table>
272
+ ```
273
+
274
+ ### Complex Table Structure with Row/Column Spans
275
+
276
+ ```tsx live
277
+ <Table variant="graph" bordered accessibilityLabel="Transfer conditions and outcomes matrix">
278
+ <TableCaption>Complex Table Example</TableCaption>
279
+ <TableHeader>
280
+ <TableRow>
281
+ <TableCell title="Transfer type" rowSpan={2} />
282
+ <TableCell title="Conditions" colSpan={3} />
283
+ <TableCell title="Outcomes" colSpan={2} />
284
+ </TableRow>
285
+ <TableRow>
286
+ <TableCell title="Destination" />
287
+ <TableCell title="Currency" />
288
+ <TableCell title="Transaction size" />
289
+ <TableCell title="Consensus approvals" />
290
+ <TableCell title="Video approvals" />
291
+ </TableRow>
292
+ </TableHeader>
293
+ <TableBody>
294
+ <TableRow>
295
+ <TableCell title="Vault withdrawal" />
296
+ <TableCell title="External address" />
297
+ <TableCell title="Crypto" />
298
+ <TableCell title="Up to 0.1 BTC" />
299
+ <TableCell title="2 in 24h" />
300
+ <TableCell title="1" />
301
+ </TableRow>
302
+ <TableRow>
303
+ <TableCell title="Another row" />
304
+ <TableCell title="Addy" />
305
+ <TableCell title="Fiat" />
306
+ <TableCell title="> $100,000" />
307
+ <TableCell title="1 in 6mo" />
308
+ <TableCell title="0" />
309
+ </TableRow>
310
+ </TableBody>
311
+ </Table>
312
+ ```
313
+
314
+ ### Sortable Table
315
+
316
+ ```tsx live
317
+ function SortingExample() {
318
+ const [{ sortBy, sortDirection }, setSort] = useState({
319
+ sortBy: 'name',
320
+ sortDirection: 'ascending',
321
+ });
322
+
323
+ const onChange = (key) => {
324
+ const isAscending = key === sortBy && sortDirection === 'ascending';
325
+ const ascendingOrDescending = isAscending ? 'descending' : 'ascending';
326
+ setSort({ sortBy: key, sortDirection: ascendingOrDescending });
327
+ };
328
+
329
+ const data = useSort({ data: accounts, sortDirection, sortBy });
330
+ const getSortableProps = useSortableCell({ sortBy, sortDirection, onChange });
331
+
332
+ return (
333
+ <Table maxHeight={360} bordered accessibilityLabel="Sortable accounts table">
334
+ <TableCaption>Sorting Example</TableCaption>
335
+ <TableHeader sticky>
336
+ <TableRow>
337
+ <TableCell title="Asset" {...getSortableProps('name')} />
338
+ <TableCell title="Balance" {...getSortableProps('balance.amount')} />
339
+ <TableCell title="Status" alignItems="flex-end" />
340
+ </TableRow>
341
+ </TableHeader>
342
+ <TableBody>
343
+ {data.map((account) => {
344
+ return (
345
+ <TableRow key={`row--${account.name}`}>
346
+ <TableCell
347
+ start={<Icon active name="currencies" size="m" />}
348
+ title={account.name}
349
+ subtitle={account.currency.name}
350
+ />
351
+ <TableCell title={`$${account.balance.amount}`} subtitle={account.balance.currency} />
352
+ <TableCell direction="horizontal" justifyContent="flex-end">
353
+ <Icon
354
+ name={account.primary ? 'circleCheckmark' : 'circleCross'}
355
+ size="m"
356
+ color={account.primary ? 'positive' : 'negative'}
357
+ />
358
+ </TableCell>
359
+ </TableRow>
360
+ );
361
+ })}
362
+ </TableBody>
363
+ </Table>
364
+ );
365
+ }
366
+ ```
367
+
368
+
@@ -0,0 +1,84 @@
1
+ # TableBody
2
+
3
+ Defines the body section of Table.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { TableBody } from '@coinbase/cds-web/tables/TableBody'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `as` | `div \| tbody \| tfoot \| thead` | No | `undefined` | Internal only |
16
+ | `className` | `string` | No | `-` | - |
17
+ | `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 |
18
+
19
+
20
+ ## Examples
21
+
22
+ ### Basic usage
23
+
24
+ ```tsx live
25
+ <Table bordered>
26
+ <TableHeader>
27
+ <TableRow>
28
+ <TableCell>Header</TableCell>
29
+ </TableRow>
30
+ </TableHeader>
31
+ <TableBody>
32
+ <TableRow>
33
+ <TableCell>Content</TableCell>
34
+ </TableRow>
35
+ </TableBody>
36
+ </Table>
37
+ ```
38
+
39
+ ### Loading State Example
40
+
41
+ ```tsx live
42
+ <Table bordered variant="ruled">
43
+ <TableHeader>
44
+ <TableRow>
45
+ <TableCell title="TableHeader" />
46
+ </TableRow>
47
+ </TableHeader>
48
+ <TableBody>
49
+ <TableRow>
50
+ <TableCell height={320} alignItems="center" justifyContent="center">
51
+ <Spinner size={4} color="primary" />
52
+ <TextHeadline as="p" spacingTop={2} color="foregroundMuted">
53
+ Loading content...
54
+ </TextHeadline>
55
+ </TableCell>
56
+ </TableRow>
57
+ </TableBody>
58
+ </Table>
59
+ ```
60
+
61
+ ### Multiple Rows Example
62
+
63
+ ```tsx live
64
+ <Table bordered>
65
+ <TableHeader>
66
+ <TableRow>
67
+ <TableCell>Name</TableCell>
68
+ <TableCell>Role</TableCell>
69
+ </TableRow>
70
+ </TableHeader>
71
+ <TableBody>
72
+ <TableRow>
73
+ <TableCell>John Doe</TableCell>
74
+ <TableCell>Developer</TableCell>
75
+ </TableRow>
76
+ <TableRow>
77
+ <TableCell>Jane Smith</TableCell>
78
+ <TableCell>Designer</TableCell>
79
+ </TableRow>
80
+ </TableBody>
81
+ </Table>
82
+ ```
83
+
84
+
@@ -0,0 +1,103 @@
1
+ # TableCaption
2
+
3
+ Sets an accessible title or caption for Table.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { TableCaption } from '@coinbase/cds-web/tables/TableCaption'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `align` | `center \| start \| end \| justify` | No | `'start'` | Specify text alignment. Only applicable when children is a string. |
16
+ | `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. |
17
+ | `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. |
18
+ | `innerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the inner content of the caption. Overrides table cell spacing defaults. |
19
+ | `onChange` | `FormEventHandler<HTMLTableCaptionElement>` | No | `-` | - |
20
+ | `outerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the parent wrapper of the caption. Overrides table cell spacing defaults. |
21
+ | `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 |
22
+
23
+
24
+ ## Examples
25
+
26
+ ### Basic usage
27
+
28
+ ```tsx live
29
+ <Table bordered>
30
+ <TableCaption>Simple Table Caption</TableCaption>
31
+ <TableHeader>
32
+ <TableRow>
33
+ <TableCell title="Name" />
34
+ <TableCell title="Role" />
35
+ </TableRow>
36
+ </TableHeader>
37
+ <TableBody>
38
+ <TableRow>
39
+ <TableCell title="John Doe" />
40
+ <TableCell title="Developer" />
41
+ </TableRow>
42
+ </TableBody>
43
+ </Table>
44
+ ```
45
+
46
+ ### Custom Content
47
+
48
+ ```tsx live
49
+ <Table bordered>
50
+ <TableCaption>
51
+ <VStack gap={1}>
52
+ <TextTitle2 as="h2" color="primary">
53
+ Project Team
54
+ </TextTitle2>
55
+ <Text as="p" color="foregroundMuted">
56
+ Updated as of March 2024
57
+ </Text>
58
+ </VStack>
59
+ </TableCaption>
60
+ <TableHeader>
61
+ <TableRow>
62
+ <TableCell title="Name" />
63
+ <TableCell title="Role" />
64
+ </TableRow>
65
+ </TableHeader>
66
+ <TableBody>
67
+ <TableRow>
68
+ <TableCell title="John Doe" />
69
+ <TableCell title="Developer" />
70
+ </TableRow>
71
+ </TableBody>
72
+ </Table>
73
+ ```
74
+
75
+ ### Styling Options
76
+
77
+ ```tsx live
78
+ <Table bordered>
79
+ <TableCaption
80
+ align="center"
81
+ color="fgPrimary"
82
+ backgroundColor="bgAlternate"
83
+ innerSpacing={{ spacingHorizontal: 2, spacingVertical: 1 }}
84
+ outerSpacing={{ spacingHorizontal: 0, spacingVertical: 1 }}
85
+ >
86
+ Quarterly Revenue Report
87
+ </TableCaption>
88
+ <TableHeader>
89
+ <TableRow>
90
+ <TableCell title="Quarter" />
91
+ <TableCell title="Revenue" />
92
+ </TableRow>
93
+ </TableHeader>
94
+ <TableBody>
95
+ <TableRow>
96
+ <TableCell title="Q1 2024" />
97
+ <TableCell title="$1.2M" />
98
+ </TableRow>
99
+ </TableBody>
100
+ </Table>
101
+ ```
102
+
103
+