@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,165 @@
|
|
|
1
|
+
# TableCell
|
|
2
|
+
|
|
3
|
+
Defines individual cells within a Table.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TableCell } from '@coinbase/cds-web/tables/TableCell'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic usage
|
|
14
|
+
|
|
15
|
+
```tsx live
|
|
16
|
+
<Table variant="ruled" bordered>
|
|
17
|
+
<TableHeader>
|
|
18
|
+
<TableRow backgroundColor="bgAlternate">
|
|
19
|
+
<TableCell title="First Header" />
|
|
20
|
+
<TableCell>
|
|
21
|
+
<TextHeadline as="p" color="currentColor">
|
|
22
|
+
Second Header
|
|
23
|
+
</TextHeadline>
|
|
24
|
+
</TableCell>
|
|
25
|
+
<TableCell title="Third Header" />
|
|
26
|
+
</TableRow>
|
|
27
|
+
</TableHeader>
|
|
28
|
+
<TableBody>
|
|
29
|
+
<TableRow>
|
|
30
|
+
<TableCell
|
|
31
|
+
overflow="truncate"
|
|
32
|
+
start={
|
|
33
|
+
<Box spacingEnd={1}>
|
|
34
|
+
<Avatar
|
|
35
|
+
name="John Doe"
|
|
36
|
+
src="https://avatars.slack-edge.com/2019-12-09/865473396980_e8c83b072b452e4d03f7_192.jpg"
|
|
37
|
+
/>
|
|
38
|
+
</Box>
|
|
39
|
+
}
|
|
40
|
+
title="Bitcoin"
|
|
41
|
+
subtitle="BTC and I'm like please please truncate me"
|
|
42
|
+
/>
|
|
43
|
+
<TableCell
|
|
44
|
+
overflow="truncate"
|
|
45
|
+
alignItems="flex-start"
|
|
46
|
+
title="$2,475.68"
|
|
47
|
+
subtitle="0.11882557"
|
|
48
|
+
/>
|
|
49
|
+
<TableCell>
|
|
50
|
+
<TextHeadline as="h2" color="currentColor">
|
|
51
|
+
$2,221.01
|
|
52
|
+
</TextHeadline>
|
|
53
|
+
<TextLabel2 as="p" color="foregroundMuted">
|
|
54
|
+
0.1519581 BTC
|
|
55
|
+
</TextLabel2>
|
|
56
|
+
</TableCell>
|
|
57
|
+
</TableRow>
|
|
58
|
+
</TableBody>
|
|
59
|
+
<TableFooter>
|
|
60
|
+
<TableRow>
|
|
61
|
+
<TableCell title="First Item (footer)" />
|
|
62
|
+
<TableCell title="Second Item (footer)" />
|
|
63
|
+
<TableCell title="Third Item (footer)" />
|
|
64
|
+
</TableRow>
|
|
65
|
+
</TableFooter>
|
|
66
|
+
</Table>
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Custom Cell Spacing
|
|
70
|
+
|
|
71
|
+
```tsx live
|
|
72
|
+
<Table
|
|
73
|
+
variant="ruled"
|
|
74
|
+
bordered
|
|
75
|
+
cellSpacing={{
|
|
76
|
+
outer: { spacingHorizontal: 2, spacingVertical: 2 },
|
|
77
|
+
inner: { spacingHorizontal: 2, spacingVertical: 2 },
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
<TableHeader>
|
|
81
|
+
<TableRow>
|
|
82
|
+
<TableCell title="Name" />
|
|
83
|
+
<TableCell title="Email" />
|
|
84
|
+
<TableCell title="Role" />
|
|
85
|
+
</TableRow>
|
|
86
|
+
</TableHeader>
|
|
87
|
+
<TableBody>
|
|
88
|
+
<TableRow>
|
|
89
|
+
<TableCell
|
|
90
|
+
innerSpacing={{ spacingHorizontal: 2, spacingVertical: 0 }}
|
|
91
|
+
outerSpacing={{ spacingHorizontal: 2, spacingVertical: 0 }}
|
|
92
|
+
start={<Avatar name="Bob Smith" />}
|
|
93
|
+
title="Bob Smith"
|
|
94
|
+
subtitle="Junior Developer"
|
|
95
|
+
/>
|
|
96
|
+
<TableCell title="example@example.com" />
|
|
97
|
+
<TableCell title="Engineering" subtitle="Full-time" />
|
|
98
|
+
</TableRow>
|
|
99
|
+
<TableRow>
|
|
100
|
+
<TableCell
|
|
101
|
+
innerSpacing={{ spacingHorizontal: 5, spacingVertical: 5 }}
|
|
102
|
+
outerSpacing={{ spacingHorizontal: 5, spacingVertical: 5 }}
|
|
103
|
+
start={<Avatar name="Alice Smith" />}
|
|
104
|
+
title="Alice Smith"
|
|
105
|
+
subtitle="Senior Developer"
|
|
106
|
+
/>
|
|
107
|
+
<TableCell title="example@example.com" />
|
|
108
|
+
<TableCell title="Engineering" subtitle="Full-time" />
|
|
109
|
+
</TableRow>
|
|
110
|
+
</TableBody>
|
|
111
|
+
</Table>
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Accessibility Example - Multiple Headers
|
|
115
|
+
|
|
116
|
+
```tsx live
|
|
117
|
+
<Table maxHeight={300} bordered variant="ruled">
|
|
118
|
+
<TableHeader sticky>
|
|
119
|
+
<TableRow backgroundColor="bgAlternate">
|
|
120
|
+
<TableCell title="Currency" />
|
|
121
|
+
<TableCell title="Balance" />
|
|
122
|
+
<TableCell title="Status" alignItems="flex-end" />
|
|
123
|
+
</TableRow>
|
|
124
|
+
</TableHeader>
|
|
125
|
+
<TableBody>
|
|
126
|
+
<TableRow>
|
|
127
|
+
<TableCell title="BTC" as="th" scope="row" />
|
|
128
|
+
<TableCell title="$100" />
|
|
129
|
+
<TableCell title="Pending" alignItems="flex-end" />
|
|
130
|
+
</TableRow>
|
|
131
|
+
<TableRow>
|
|
132
|
+
<TableCell title="ETH" as="th" scope="row" />
|
|
133
|
+
<TableCell title="$200" />
|
|
134
|
+
<TableCell title="Complete" alignItems="flex-end" />
|
|
135
|
+
</TableRow>
|
|
136
|
+
<TableRow>
|
|
137
|
+
<TableCell title="APE" as="th" scope="row" />
|
|
138
|
+
<TableCell title="$300" />
|
|
139
|
+
<TableCell title="Complete" alignItems="flex-end" />
|
|
140
|
+
</TableRow>
|
|
141
|
+
</TableBody>
|
|
142
|
+
</Table>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Props
|
|
146
|
+
|
|
147
|
+
| Prop | Type | Required | Default | Description |
|
|
148
|
+
| --- | --- | --- | --- | --- |
|
|
149
|
+
| `alignItems` | `ResponsiveProp<center \| normal \| start \| end \| flex-start \| flex-end \| self-start \| self-end \| stretch \| baseline \| first baseline \| last baseline>` | No | `'center'` | This prop us useful for aligning the last item to the right, or top-aligning cells |
|
|
150
|
+
| `as` | `td \| th` | No | ``th` when rendered inside a TableHeader, `td` when rendered inside a TableBody or TableFooter` | Use as=th to mark this cell as a header for screen readers |
|
|
151
|
+
| `dangerouslySetHtmlWidth` | `string \| number` | No | `undefined` | - |
|
|
152
|
+
| `direction` | `horizontal \| vertical` | No | `vertical` | Direction provides content flow control. Use vertical to inherit a VStask, horizontal for an HStack |
|
|
153
|
+
| `end` | `ReactElement` | No | `undefined` | Element (icon, asset, image, etc) to display at the end of the cell |
|
|
154
|
+
| `innerSpacing` | `CellSpacing` | No | `{ spacingHorizontal: 0 }` | The spacing to use on the inner content of Cell |
|
|
155
|
+
| `justifyContent` | `space-evenly \| FlexAxisValue \| FlexSpaceCommon` | No | `'flex-start'` | This prop us useful for right-aligning the last column |
|
|
156
|
+
| `onChange` | `FormEventHandler<HTMLTableCellElement>` | No | `-` | - |
|
|
157
|
+
| `outerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the parent wrapper of Cell |
|
|
158
|
+
| `overflow` | `clip \| wrap \| truncate \| break` | No | `false` | Should the title/subtitle text truncate |
|
|
159
|
+
| `start` | `ReactElement` | No | `undefined` | Element (icon, asset, image, etc) to display at the start of the cell |
|
|
160
|
+
| `subtitle` | `string` | No | `undefined` | A subtitle will appear below the title with font=label2. |
|
|
161
|
+
| `subtitleColor` | `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 | `-` | - |
|
|
162
|
+
| `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 |
|
|
163
|
+
| `titleColor` | `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 | `-` | - |
|
|
164
|
+
|
|
165
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# TableCellFallback
|
|
2
|
+
|
|
3
|
+
Shows a loading state for Table cells.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TableCellFallback } from '@coinbase/cds-web/tables/TableCellFallback'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic usage
|
|
14
|
+
|
|
15
|
+
```tsx live
|
|
16
|
+
<Table bordered variant="graph">
|
|
17
|
+
<TableHeader>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableCellFallback title />
|
|
20
|
+
<TableCellFallback title subtitle />
|
|
21
|
+
</TableRow>
|
|
22
|
+
</TableHeader>
|
|
23
|
+
<TableBody>
|
|
24
|
+
<TableRow>
|
|
25
|
+
<TableCellFallback title subtitle start="image" />
|
|
26
|
+
<TableCellFallback title subtitle end="image" />
|
|
27
|
+
</TableRow>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableCellFallback title subtitle start="asset" />
|
|
30
|
+
<TableCellFallback title subtitle end="asset" />
|
|
31
|
+
</TableRow>
|
|
32
|
+
</TableBody>
|
|
33
|
+
</Table>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Media Types
|
|
37
|
+
|
|
38
|
+
```tsx live
|
|
39
|
+
<Table bordered variant="graph">
|
|
40
|
+
<TableBody>
|
|
41
|
+
<TableRow>
|
|
42
|
+
<TableCellFallback title subtitle start="avatar" />
|
|
43
|
+
<TableCellFallback title subtitle start="icon" />
|
|
44
|
+
</TableRow>
|
|
45
|
+
<TableRow>
|
|
46
|
+
<TableCellFallback title subtitle start="pictogram" />
|
|
47
|
+
<TableCellFallback title subtitle start="image" />
|
|
48
|
+
</TableRow>
|
|
49
|
+
</TableBody>
|
|
50
|
+
</Table>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Custom Rectangle Widths
|
|
54
|
+
|
|
55
|
+
:::tip Rectangular fallback widths
|
|
56
|
+
|
|
57
|
+
This component contains rectangular fallbacks, the widths for which are randomized within a predetermined threshold by default (e.g. to add some variety when mulitple fallbacks are presented together). If this behavior is undesirable (e.g. in server-side rendered web apps), randomization can be disabled with the `disableRandomRectWidth` prop.
|
|
58
|
+
|
|
59
|
+
<br />
|
|
60
|
+
|
|
61
|
+
Alternatively, you may create a variant with different rectangle widths by setting a number value on the `rectWidthVariant` prop. Variants map to a predetermined set of width values, which are cycled through repeatedly when the set is exhausted. Therefore, it's still possible to achieve some variety in your fallbacks, but in a deterministic manner (i.e. safe for server-side rendering). Here's an example:
|
|
62
|
+
|
|
63
|
+
<br />
|
|
64
|
+
:::
|
|
65
|
+
<br />
|
|
66
|
+
|
|
67
|
+
```tsx live
|
|
68
|
+
<Table bordered variant="graph">
|
|
69
|
+
<TableBody>
|
|
70
|
+
<TableRow>
|
|
71
|
+
<TableCellFallback title subtitle start="image" rectWidthVariant={0} disableRandomRectWidth />
|
|
72
|
+
<TableCellFallback title subtitle end="image" rectWidthVariant={1} disableRandomRectWidth />
|
|
73
|
+
</TableRow>
|
|
74
|
+
<TableRow>
|
|
75
|
+
<TableCellFallback title subtitle start="asset" rectWidthVariant={2} disableRandomRectWidth />
|
|
76
|
+
<TableCellFallback title subtitle end="asset" rectWidthVariant={3} disableRandomRectWidth />
|
|
77
|
+
</TableRow>
|
|
78
|
+
</TableBody>
|
|
79
|
+
</Table>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Props
|
|
83
|
+
|
|
84
|
+
| Prop | Type | Required | Default | Description |
|
|
85
|
+
| --- | --- | --- | --- | --- |
|
|
86
|
+
| `as` | `td \| th` | No | ``th` when rendered inside a TableHeader, `td` when rendered inside a TableBody or TableFooter` | Use as=th to mark this cell as a header for screen readers |
|
|
87
|
+
| `disableRandomRectWidth` | `boolean` | No | `-` | Disables randomization of rectangle fallback width. |
|
|
88
|
+
| `end` | `avatar \| image \| icon \| pictogram \| asset` | No | `-` | Display end shimmer with a shape according to type. |
|
|
89
|
+
| `innerSpacing` | `CellSpacing` | No | `{ spacingHorizontal: 0 }` | The spacing to use on the inner content of Cell |
|
|
90
|
+
| `outerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the parent wrapper of Cell |
|
|
91
|
+
| `rectWidthVariant` | `number` | No | `-` | Creates a variant that contains rectangle fallbacks of deterministic width. Variants map to a predetermined set of width values, which are cycled through repeatedly when the set is exhausted. |
|
|
92
|
+
| `start` | `avatar \| image \| icon \| pictogram \| asset` | No | `-` | Display start shimmer with a shape according to type. |
|
|
93
|
+
| `subtitle` | `boolean` | No | `-` | Display subtitle shimmer. |
|
|
94
|
+
| `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 |
|
|
95
|
+
| `title` | `boolean` | No | `-` | Display title shimmer. |
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# TableFooter
|
|
2
|
+
|
|
3
|
+
Defines the footer section of Table.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TableFooter } from '@coinbase/cds-web/tables/TableFooter'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic usage
|
|
14
|
+
|
|
15
|
+
```tsx live
|
|
16
|
+
<Table bordered variant="ruled">
|
|
17
|
+
<TableHeader>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableCell title="Item" />
|
|
20
|
+
<TableCell title="Price" />
|
|
21
|
+
</TableRow>
|
|
22
|
+
</TableHeader>
|
|
23
|
+
<TableBody>
|
|
24
|
+
<TableRow>
|
|
25
|
+
<TableCell title="Product A" />
|
|
26
|
+
<TableCell title="$100" />
|
|
27
|
+
</TableRow>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableCell title="Product B" />
|
|
30
|
+
<TableCell title="$200" />
|
|
31
|
+
</TableRow>
|
|
32
|
+
</TableBody>
|
|
33
|
+
<TableFooter>
|
|
34
|
+
<TableRow>
|
|
35
|
+
<TableCell title="Total" />
|
|
36
|
+
<TableCell title="$300" />
|
|
37
|
+
</TableRow>
|
|
38
|
+
</TableFooter>
|
|
39
|
+
</Table>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### Footer with Summary Data
|
|
43
|
+
|
|
44
|
+
```tsx live
|
|
45
|
+
<Table bordered variant="ruled">
|
|
46
|
+
<TableHeader>
|
|
47
|
+
<TableRow>
|
|
48
|
+
<TableCell title="Quarter" />
|
|
49
|
+
<TableCell title="Revenue" />
|
|
50
|
+
<TableCell title="Growth" alignItems="flex-end" />
|
|
51
|
+
</TableRow>
|
|
52
|
+
</TableHeader>
|
|
53
|
+
<TableBody>
|
|
54
|
+
<TableRow>
|
|
55
|
+
<TableCell title="Q1" />
|
|
56
|
+
<TableCell title="$1.2M" />
|
|
57
|
+
<TableCell title="+5%" alignItems="flex-end" />
|
|
58
|
+
</TableRow>
|
|
59
|
+
<TableRow>
|
|
60
|
+
<TableCell title="Q2" />
|
|
61
|
+
<TableCell title="$1.4M" />
|
|
62
|
+
<TableCell title="+16%" alignItems="flex-end" />
|
|
63
|
+
</TableRow>
|
|
64
|
+
</TableBody>
|
|
65
|
+
<TableFooter>
|
|
66
|
+
<TableRow backgroundColor="bgAlternate">
|
|
67
|
+
<TableCell title="YTD" color="primary" />
|
|
68
|
+
<TableCell title="$2.6M" color="primary" />
|
|
69
|
+
<TableCell title="+21%" color="primary" alignItems="flex-end" />
|
|
70
|
+
</TableRow>
|
|
71
|
+
</TableFooter>
|
|
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,100 @@
|
|
|
1
|
+
# TableHeader
|
|
2
|
+
|
|
3
|
+
Defines the header section of Table.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TableHeader } from '@coinbase/cds-web/tables/TableHeader'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic usage
|
|
14
|
+
|
|
15
|
+
```tsx live
|
|
16
|
+
<Table bordered variant="ruled">
|
|
17
|
+
<TableHeader>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableCell title="TableHeader" subtitle="This is the TableHeader" />
|
|
20
|
+
</TableRow>
|
|
21
|
+
</TableHeader>
|
|
22
|
+
<TableBody>
|
|
23
|
+
<TableRow>
|
|
24
|
+
<TableCell title="TableBody" subtitle="This is the TableBody" />
|
|
25
|
+
</TableRow>
|
|
26
|
+
</TableBody>
|
|
27
|
+
<TableFooter>
|
|
28
|
+
<TableRow>
|
|
29
|
+
<TableCell title="TableFooter" subtitle="This is the TableFooter" />
|
|
30
|
+
</TableRow>
|
|
31
|
+
</TableFooter>
|
|
32
|
+
</Table>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Sticky Header Example
|
|
36
|
+
|
|
37
|
+
```tsx live
|
|
38
|
+
<Box height={300} overflow="auto" border="1px solid" borderColor="border">
|
|
39
|
+
<Table>
|
|
40
|
+
<TableHeader sticky>
|
|
41
|
+
<TableRow>
|
|
42
|
+
<TableCell>Name</TableCell>
|
|
43
|
+
<TableCell>Role</TableCell>
|
|
44
|
+
<TableCell>Department</TableCell>
|
|
45
|
+
<TableCell>Location</TableCell>
|
|
46
|
+
</TableRow>
|
|
47
|
+
</TableHeader>
|
|
48
|
+
<TableBody>
|
|
49
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
50
|
+
<TableRow key={i}>
|
|
51
|
+
<TableCell>Employee {i + 1}</TableCell>
|
|
52
|
+
<TableCell>{['Developer', 'Designer', 'Manager', 'Analyst'][i % 4]}</TableCell>
|
|
53
|
+
<TableCell>{['Engineering', 'Design', 'Product', 'Sales'][i % 4]}</TableCell>
|
|
54
|
+
<TableCell>{['New York', 'London', 'Tokyo', 'Berlin'][i % 4]}</TableCell>
|
|
55
|
+
</TableRow>
|
|
56
|
+
))}
|
|
57
|
+
</TableBody>
|
|
58
|
+
</Table>
|
|
59
|
+
</Box>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Multiple Columns Example
|
|
63
|
+
|
|
64
|
+
```tsx live
|
|
65
|
+
<Table bordered>
|
|
66
|
+
<TableHeader>
|
|
67
|
+
<TableRow>
|
|
68
|
+
<TableCell>ID</TableCell>
|
|
69
|
+
<TableCell>Name</TableCell>
|
|
70
|
+
<TableCell>Status</TableCell>
|
|
71
|
+
<TableCell>Date</TableCell>
|
|
72
|
+
</TableRow>
|
|
73
|
+
</TableHeader>
|
|
74
|
+
<TableBody>
|
|
75
|
+
<TableRow>
|
|
76
|
+
<TableCell>001</TableCell>
|
|
77
|
+
<TableCell>Project Alpha</TableCell>
|
|
78
|
+
<TableCell>Active</TableCell>
|
|
79
|
+
<TableCell>2024-03-20</TableCell>
|
|
80
|
+
</TableRow>
|
|
81
|
+
<TableRow>
|
|
82
|
+
<TableCell>002</TableCell>
|
|
83
|
+
<TableCell>Project Beta</TableCell>
|
|
84
|
+
<TableCell>Pending</TableCell>
|
|
85
|
+
<TableCell>2024-03-21</TableCell>
|
|
86
|
+
</TableRow>
|
|
87
|
+
</TableBody>
|
|
88
|
+
</Table>
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Props
|
|
92
|
+
|
|
93
|
+
| Prop | Type | Required | Default | Description |
|
|
94
|
+
| --- | --- | --- | --- | --- |
|
|
95
|
+
| `as` | `div \| tbody \| tfoot \| thead` | No | `undefined` | Internal only |
|
|
96
|
+
| `className` | `string` | No | `-` | - |
|
|
97
|
+
| `sticky` | `boolean` | No | `false` | Use to make a header stick to the top of the table when scrolled This will require setting a height or maxHeight on the Table or its parent |
|
|
98
|
+
| `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 |
|
|
99
|
+
|
|
100
|
+
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# TableRow
|
|
2
|
+
|
|
3
|
+
Defines rows within a Table.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```tsx
|
|
8
|
+
import { TableRow } from '@coinbase/cds-web/tables/TableRow'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic usage
|
|
14
|
+
|
|
15
|
+
```tsx live
|
|
16
|
+
<Table bordered variant="ruled">
|
|
17
|
+
<TableBody>
|
|
18
|
+
<TableRow>
|
|
19
|
+
<TableCell title="Basic Row" />
|
|
20
|
+
</TableRow>
|
|
21
|
+
<TableRow backgroundColor="bgAlternate">
|
|
22
|
+
<TableCell title="Row with Background" />
|
|
23
|
+
</TableRow>
|
|
24
|
+
<TableRow color="fgPrimary">
|
|
25
|
+
<TableCell title="Row with Custom Text Color" />
|
|
26
|
+
</TableRow>
|
|
27
|
+
</TableBody>
|
|
28
|
+
</Table>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Interactive Rows
|
|
32
|
+
|
|
33
|
+
```tsx live
|
|
34
|
+
function InteractiveExample() {
|
|
35
|
+
const handlePress = () => console.log('Row clicked');
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<Table bordered>
|
|
39
|
+
<TableBody>
|
|
40
|
+
<TableRow onClick={handlePress}>
|
|
41
|
+
<TableCell
|
|
42
|
+
direction="horizontal"
|
|
43
|
+
title="Clickable Row"
|
|
44
|
+
end={
|
|
45
|
+
<Button variant="secondary" compact>
|
|
46
|
+
Action
|
|
47
|
+
</Button>
|
|
48
|
+
}
|
|
49
|
+
/>
|
|
50
|
+
</TableRow>
|
|
51
|
+
<TableRow onClick={handlePress} disableHoverIndicator>
|
|
52
|
+
<TableCell
|
|
53
|
+
direction="horizontal"
|
|
54
|
+
title="Clickable Row (No Hover)"
|
|
55
|
+
end={
|
|
56
|
+
<Button variant="secondary" compact>
|
|
57
|
+
Action
|
|
58
|
+
</Button>
|
|
59
|
+
}
|
|
60
|
+
/>
|
|
61
|
+
</TableRow>
|
|
62
|
+
</TableBody>
|
|
63
|
+
</Table>
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Full Width Rows
|
|
69
|
+
|
|
70
|
+
```tsx live
|
|
71
|
+
<Table bordered>
|
|
72
|
+
<TableBody>
|
|
73
|
+
<TableRow fullWidth>
|
|
74
|
+
<HStack gap={2} alignItems="center">
|
|
75
|
+
<Icon name="check" />
|
|
76
|
+
<Text>Full Width Content</Text>
|
|
77
|
+
<Button variant="secondary" compact>
|
|
78
|
+
Action
|
|
79
|
+
</Button>
|
|
80
|
+
</HStack>
|
|
81
|
+
</TableRow>
|
|
82
|
+
<TableRow fullWidth>
|
|
83
|
+
<HStack gap={2} alignItems="center">
|
|
84
|
+
<Icon active name="warning" />
|
|
85
|
+
<Text>Another Full Width Row</Text>
|
|
86
|
+
<Button variant="secondary" compact>
|
|
87
|
+
Action
|
|
88
|
+
</Button>
|
|
89
|
+
</HStack>
|
|
90
|
+
</TableRow>
|
|
91
|
+
</TableBody>
|
|
92
|
+
</Table>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Responsive Spacing
|
|
96
|
+
|
|
97
|
+
```tsx live
|
|
98
|
+
function ResponsiveExample() {
|
|
99
|
+
const responsiveConfig = {
|
|
100
|
+
phone: {
|
|
101
|
+
innerSpacing: { spacingHorizontal: 2 },
|
|
102
|
+
outerSpacing: { spacingVertical: 1 },
|
|
103
|
+
},
|
|
104
|
+
desktop: {
|
|
105
|
+
innerSpacing: { spacingHorizontal: 4 },
|
|
106
|
+
outerSpacing: { spacingVertical: 2 },
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return (
|
|
111
|
+
<Table bordered>
|
|
112
|
+
<TableBody>
|
|
113
|
+
<TableRow fullWidth innerSpacing={responsiveConfig.phone.innerSpacing}>
|
|
114
|
+
<HStack gap={2} alignItems="center">
|
|
115
|
+
<Icon name="check" />
|
|
116
|
+
<Text>Responsive Spacing Row</Text>
|
|
117
|
+
<Button variant="secondary" compact>
|
|
118
|
+
Action
|
|
119
|
+
</Button>
|
|
120
|
+
</HStack>
|
|
121
|
+
</TableRow>
|
|
122
|
+
</TableBody>
|
|
123
|
+
</Table>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Props
|
|
129
|
+
|
|
130
|
+
| Prop | Type | Required | Default | Description |
|
|
131
|
+
| --- | --- | --- | --- | --- |
|
|
132
|
+
| `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 | `undefined` | Set the background color for this entire row to some CDS Palette background color name |
|
|
133
|
+
| `disableHoverIndicator` | `boolean` | No | `false` | By default, we set a hover background color of palette.backgroundAlternate on hover for the row. Use this prop to disable this behavior |
|
|
134
|
+
| `fullWidth` | `boolean` | No | `undefined` | Should this row span the entire width of the table? Useful for treating a row as a Control Strip. |
|
|
135
|
+
| `innerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the inner content of Cell. Will only take effect when fullWidth is set to true |
|
|
136
|
+
| `onChange` | `FormEventHandler<HTMLTableRowElement>` | No | `-` | - |
|
|
137
|
+
| `outerSpacing` | `CellSpacing` | No | `-` | The spacing to use on the parent wrapper of Cell. Will only take effect when fullWidth is set to true |
|
|
138
|
+
| `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 |
|
|
139
|
+
|
|
140
|
+
|