@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.
- package/CHANGELOG.md +4 -0
- package/mcp-docs/mobile/components/Accordion.txt +189 -0
- package/mcp-docs/mobile/components/AccordionItem.txt +30 -0
- package/mcp-docs/mobile/components/Alert.txt +156 -0
- package/mcp-docs/mobile/components/AreaChart.txt +266 -0
- package/mcp-docs/mobile/components/Avatar.txt +196 -0
- package/mcp-docs/mobile/components/AvatarButton.txt +226 -0
- package/mcp-docs/mobile/components/Banner.txt +222 -0
- package/mcp-docs/mobile/components/BarChart.txt +816 -0
- package/mcp-docs/mobile/components/Box.txt +174 -0
- package/mcp-docs/mobile/components/BrowserBar.txt +147 -0
- package/mcp-docs/mobile/components/Button.txt +199 -0
- package/mcp-docs/mobile/components/ButtonGroup.txt +80 -0
- package/mcp-docs/mobile/components/Carousel.txt +1084 -0
- package/mcp-docs/mobile/components/CartesianChart.txt +826 -0
- package/mcp-docs/mobile/components/CellMedia.txt +71 -0
- package/mcp-docs/mobile/components/Checkbox.txt +246 -0
- package/mcp-docs/mobile/components/CheckboxCell.txt +202 -0
- package/mcp-docs/mobile/components/CheckboxGroup.txt +285 -0
- package/mcp-docs/mobile/components/Chip.txt +195 -0
- package/mcp-docs/mobile/components/Coachmark.txt +158 -0
- package/mcp-docs/mobile/components/Collapsible.txt +105 -0
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +135 -0
- package/mcp-docs/mobile/components/ContentCard.txt +366 -0
- package/mcp-docs/mobile/components/ContentCardBody.txt +136 -0
- package/mcp-docs/mobile/components/ContentCardFooter.txt +128 -0
- package/mcp-docs/mobile/components/ContentCardHeader.txt +146 -0
- package/mcp-docs/mobile/components/ContentCell.txt +227 -0
- package/mcp-docs/mobile/components/ControlGroup.txt +444 -0
- package/mcp-docs/mobile/components/DatePicker.txt +497 -0
- package/mcp-docs/mobile/components/Divider.txt +139 -0
- package/mcp-docs/mobile/components/DotCount.txt +146 -0
- package/mcp-docs/mobile/components/DotStatusColor.txt +59 -0
- package/mcp-docs/mobile/components/DotSymbol.txt +135 -0
- package/mcp-docs/mobile/components/Fallback.txt +158 -0
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +156 -0
- package/mcp-docs/mobile/components/HStack.txt +235 -0
- package/mcp-docs/mobile/components/HeroSquare.txt +48 -0
- package/mcp-docs/mobile/components/Icon.txt +52 -0
- package/mcp-docs/mobile/components/IconButton.txt +269 -0
- package/mcp-docs/mobile/components/InputChip.txt +188 -0
- package/mcp-docs/mobile/components/Interactable.txt +187 -0
- package/mcp-docs/mobile/components/LineChart.txt +1325 -0
- package/mcp-docs/mobile/components/Link.txt +292 -0
- package/mcp-docs/mobile/components/ListCell.txt +391 -0
- package/mcp-docs/mobile/components/LogoMark.txt +85 -0
- package/mcp-docs/mobile/components/LogoWordMark.txt +94 -0
- package/mcp-docs/mobile/components/Lottie.txt +139 -0
- package/mcp-docs/mobile/components/LottieStatusAnimation.txt +47 -0
- package/mcp-docs/mobile/components/Modal.txt +84 -0
- package/mcp-docs/mobile/components/ModalBody.txt +34 -0
- package/mcp-docs/mobile/components/ModalFooter.txt +25 -0
- package/mcp-docs/mobile/components/ModalHeader.txt +28 -0
- package/mcp-docs/mobile/components/MultiContentModule.txt +380 -0
- package/mcp-docs/mobile/components/NavigationTitle.txt +132 -0
- package/mcp-docs/mobile/components/NavigationTitleSelect.txt +142 -0
- package/mcp-docs/mobile/components/NudgeCard.txt +90 -0
- package/mcp-docs/mobile/components/Numpad.txt +341 -0
- package/mcp-docs/mobile/components/Overlay.txt +152 -0
- package/mcp-docs/mobile/components/PageFooter.txt +161 -0
- package/mcp-docs/mobile/components/PageHeader.txt +186 -0
- package/mcp-docs/mobile/components/PeriodSelector.txt +408 -0
- package/mcp-docs/mobile/components/Pictogram.txt +48 -0
- package/mcp-docs/mobile/components/Point.txt +205 -0
- package/mcp-docs/mobile/components/PortalProvider.txt +79 -0
- package/mcp-docs/mobile/components/Pressable.txt +211 -0
- package/mcp-docs/mobile/components/ProgressBar.txt +130 -0
- package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +161 -0
- package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +138 -0
- package/mcp-docs/mobile/components/ProgressCircle.txt +237 -0
- package/mcp-docs/mobile/components/Radio.txt +242 -0
- package/mcp-docs/mobile/components/RadioCell.txt +202 -0
- package/mcp-docs/mobile/components/RadioGroup.txt +282 -0
- package/mcp-docs/mobile/components/ReferenceLine.txt +153 -0
- package/mcp-docs/mobile/components/RemoteImage.txt +106 -0
- package/mcp-docs/mobile/components/RemoteImageGroup.txt +61 -0
- package/mcp-docs/mobile/components/RollingNumber.txt +789 -0
- package/mcp-docs/mobile/components/Scrubber.txt +204 -0
- package/mcp-docs/mobile/components/SearchInput.txt +192 -0
- package/mcp-docs/mobile/components/SectionHeader.txt +205 -0
- package/mcp-docs/mobile/components/SegmentedTabs.txt +316 -0
- package/mcp-docs/mobile/components/Select.txt +212 -0
- package/mcp-docs/mobile/components/SelectChip.txt +324 -0
- package/mcp-docs/mobile/components/SelectOption.txt +85 -0
- package/mcp-docs/mobile/components/SlideButton.txt +331 -0
- package/mcp-docs/mobile/components/Spacer.txt +84 -0
- package/mcp-docs/mobile/components/Sparkline.txt +123 -0
- package/mcp-docs/mobile/components/SparklineGradient.txt +107 -0
- package/mcp-docs/mobile/components/SparklineInteractive.txt +157 -0
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +73 -0
- package/mcp-docs/mobile/components/Spinner.txt +49 -0
- package/mcp-docs/mobile/components/SpotIcon.txt +48 -0
- package/mcp-docs/mobile/components/SpotRectangle.txt +48 -0
- package/mcp-docs/mobile/components/SpotSquare.txt +48 -0
- package/mcp-docs/mobile/components/Stepper.txt +528 -0
- package/mcp-docs/mobile/components/SubBrandLogoMark.txt +126 -0
- package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +126 -0
- package/mcp-docs/mobile/components/Switch.txt +98 -0
- package/mcp-docs/mobile/components/TabIndicator.txt +49 -0
- package/mcp-docs/mobile/components/TabLabel.txt +154 -0
- package/mcp-docs/mobile/components/TabNavigation.txt +147 -0
- package/mcp-docs/mobile/components/TabbedChips.txt +143 -0
- package/mcp-docs/mobile/components/Tabs.txt +191 -0
- package/mcp-docs/mobile/components/Tag.txt +301 -0
- package/mcp-docs/mobile/components/Text.txt +212 -0
- package/mcp-docs/mobile/components/TextInput.txt +718 -0
- package/mcp-docs/mobile/components/ThemeProvider.txt +133 -0
- package/mcp-docs/mobile/components/Toast.txt +197 -0
- package/mcp-docs/mobile/components/Tooltip.txt +60 -0
- package/mcp-docs/mobile/components/TopNavBar.txt +162 -0
- package/mcp-docs/mobile/components/Tour.txt +159 -0
- package/mcp-docs/mobile/components/Tray.txt +253 -0
- package/mcp-docs/mobile/components/UpsellCard.txt +322 -0
- package/mcp-docs/mobile/components/VStack.txt +223 -0
- package/mcp-docs/mobile/components/XAxis.txt +622 -0
- package/mcp-docs/mobile/components/YAxis.txt +568 -0
- package/mcp-docs/mobile/getting-started/introduction.txt +99 -0
- package/mcp-docs/mobile/getting-started/mcp-server.txt +94 -0
- package/mcp-docs/mobile/getting-started/playground.txt +25 -0
- package/mcp-docs/mobile/hooks/useDimensions.txt +47 -0
- package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +215 -0
- package/mcp-docs/mobile/hooks/useTheme.txt +110 -0
- package/mcp-docs/mobile/routes.txt +132 -0
- package/mcp-docs/web/components/Accordion.txt +190 -0
- package/mcp-docs/web/components/AccordionItem.txt +32 -0
- package/mcp-docs/web/components/Alert.txt +165 -0
- package/mcp-docs/web/components/AreaChart.txt +511 -0
- package/mcp-docs/web/components/Avatar.txt +212 -0
- package/mcp-docs/web/components/AvatarButton.txt +241 -0
- package/mcp-docs/web/components/Banner.txt +227 -0
- package/mcp-docs/web/components/BarChart.txt +1268 -0
- package/mcp-docs/web/components/Box.txt +176 -0
- package/mcp-docs/web/components/Button.txt +213 -0
- package/mcp-docs/web/components/ButtonGroup.txt +80 -0
- package/mcp-docs/web/components/Calendar.txt +182 -0
- package/mcp-docs/web/components/Carousel.txt +1576 -0
- package/mcp-docs/web/components/CartesianChart.txt +1045 -0
- package/mcp-docs/web/components/CellMedia.txt +57 -0
- package/mcp-docs/web/components/Checkbox.txt +189 -0
- package/mcp-docs/web/components/CheckboxCell.txt +203 -0
- package/mcp-docs/web/components/CheckboxGroup.txt +220 -0
- package/mcp-docs/web/components/Chip.txt +197 -0
- package/mcp-docs/web/components/Coachmark.txt +189 -0
- package/mcp-docs/web/components/Collapsible.txt +120 -0
- package/mcp-docs/web/components/ContainedAssetCard.txt +233 -0
- package/mcp-docs/web/components/ContentCard.txt +368 -0
- package/mcp-docs/web/components/ContentCardBody.txt +138 -0
- package/mcp-docs/web/components/ContentCardFooter.txt +130 -0
- package/mcp-docs/web/components/ContentCardHeader.txt +148 -0
- package/mcp-docs/web/components/ContentCell.txt +220 -0
- package/mcp-docs/web/components/ControlGroup.txt +437 -0
- package/mcp-docs/web/components/DatePicker.txt +506 -0
- package/mcp-docs/web/components/Divider.txt +144 -0
- package/mcp-docs/web/components/DotCount.txt +150 -0
- package/mcp-docs/web/components/DotStatusColor.txt +59 -0
- package/mcp-docs/web/components/DotSymbol.txt +138 -0
- package/mcp-docs/web/components/Dropdown.txt +120 -0
- package/mcp-docs/web/components/Fallback.txt +164 -0
- package/mcp-docs/web/components/FloatingAssetCard.txt +251 -0
- package/mcp-docs/web/components/FullscreenAlert.txt +70 -0
- package/mcp-docs/web/components/FullscreenModal.txt +146 -0
- package/mcp-docs/web/components/FullscreenModalLayout.txt +188 -0
- package/mcp-docs/web/components/Grid.txt +237 -0
- package/mcp-docs/web/components/GridColumn.txt +210 -0
- package/mcp-docs/web/components/HStack.txt +237 -0
- package/mcp-docs/web/components/HeroSquare.txt +49 -0
- package/mcp-docs/web/components/Icon.txt +146 -0
- package/mcp-docs/web/components/IconButton.txt +391 -0
- package/mcp-docs/web/components/InputChip.txt +188 -0
- package/mcp-docs/web/components/Interactable.txt +194 -0
- package/mcp-docs/web/components/LineChart.txt +1577 -0
- package/mcp-docs/web/components/Link.txt +244 -0
- package/mcp-docs/web/components/ListCell.txt +397 -0
- package/mcp-docs/web/components/LogoMark.txt +85 -0
- package/mcp-docs/web/components/LogoWordMark.txt +94 -0
- package/mcp-docs/web/components/Lottie.txt +158 -0
- package/mcp-docs/web/components/LottieStatusAnimation.txt +58 -0
- package/mcp-docs/web/components/MediaQueryProvider.txt +109 -0
- package/mcp-docs/web/components/Modal.txt +193 -0
- package/mcp-docs/web/components/ModalBody.txt +118 -0
- package/mcp-docs/web/components/ModalFooter.txt +120 -0
- package/mcp-docs/web/components/ModalHeader.txt +124 -0
- package/mcp-docs/web/components/MultiContentModule.txt +382 -0
- package/mcp-docs/web/components/NavigationBar.txt +103 -0
- package/mcp-docs/web/components/NavigationTitle.txt +26 -0
- package/mcp-docs/web/components/NavigationTitleSelect.txt +46 -0
- package/mcp-docs/web/components/NudgeCard.txt +182 -0
- package/mcp-docs/web/components/Overlay.txt +172 -0
- package/mcp-docs/web/components/PageFooter.txt +185 -0
- package/mcp-docs/web/components/PageHeader.txt +244 -0
- package/mcp-docs/web/components/Pagination.txt +500 -0
- package/mcp-docs/web/components/PeriodSelector.txt +704 -0
- package/mcp-docs/web/components/Pictogram.txt +49 -0
- package/mcp-docs/web/components/Point.txt +461 -0
- package/mcp-docs/web/components/PortalProvider.txt +77 -0
- package/mcp-docs/web/components/Pressable.txt +194 -0
- package/mcp-docs/web/components/ProgressBar.txt +164 -0
- package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +213 -0
- package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +182 -0
- package/mcp-docs/web/components/ProgressCircle.txt +444 -0
- package/mcp-docs/web/components/Radio.txt +220 -0
- package/mcp-docs/web/components/RadioCell.txt +216 -0
- package/mcp-docs/web/components/RadioGroup.txt +289 -0
- package/mcp-docs/web/components/ReferenceLine.txt +452 -0
- package/mcp-docs/web/components/RemoteImage.txt +166 -0
- package/mcp-docs/web/components/RemoteImageGroup.txt +87 -0
- package/mcp-docs/web/components/RollingNumber.txt +1022 -0
- package/mcp-docs/web/components/Scrubber.txt +232 -0
- package/mcp-docs/web/components/SearchInput.txt +118 -0
- package/mcp-docs/web/components/SectionHeader.txt +218 -0
- package/mcp-docs/web/components/SegmentedTabs.txt +325 -0
- package/mcp-docs/web/components/Select.txt +225 -0
- package/mcp-docs/web/components/SelectChip.txt +315 -0
- package/mcp-docs/web/components/SelectOption.txt +166 -0
- package/mcp-docs/web/components/Sidebar.txt +350 -0
- package/mcp-docs/web/components/SidebarItem.txt +132 -0
- package/mcp-docs/web/components/SidebarMoreMenu.txt +31 -0
- package/mcp-docs/web/components/Spacer.txt +174 -0
- package/mcp-docs/web/components/Sparkline.txt +123 -0
- package/mcp-docs/web/components/SparklineGradient.txt +107 -0
- package/mcp-docs/web/components/SparklineInteractive.txt +154 -0
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +77 -0
- package/mcp-docs/web/components/Spinner.txt +129 -0
- package/mcp-docs/web/components/SpotIcon.txt +49 -0
- package/mcp-docs/web/components/SpotRectangle.txt +49 -0
- package/mcp-docs/web/components/SpotSquare.txt +49 -0
- package/mcp-docs/web/components/Stepper.txt +683 -0
- package/mcp-docs/web/components/SubBrandLogoMark.txt +126 -0
- package/mcp-docs/web/components/SubBrandLogoWordMark.txt +126 -0
- package/mcp-docs/web/components/Switch.txt +86 -0
- package/mcp-docs/web/components/TabIndicator.txt +49 -0
- package/mcp-docs/web/components/TabLabel.txt +159 -0
- package/mcp-docs/web/components/TabNavigation.txt +160 -0
- package/mcp-docs/web/components/TabbedChips.txt +156 -0
- package/mcp-docs/web/components/Table.txt +368 -0
- package/mcp-docs/web/components/TableBody.txt +84 -0
- package/mcp-docs/web/components/TableCaption.txt +103 -0
- package/mcp-docs/web/components/TableCell.txt +166 -0
- package/mcp-docs/web/components/TableCellFallback.txt +98 -0
- package/mcp-docs/web/components/TableFooter.txt +84 -0
- package/mcp-docs/web/components/TableHeader.txt +101 -0
- package/mcp-docs/web/components/TableRow.txt +141 -0
- package/mcp-docs/web/components/Tabs.txt +213 -0
- package/mcp-docs/web/components/Tag.txt +305 -0
- package/mcp-docs/web/components/Text.txt +233 -0
- package/mcp-docs/web/components/TextInput.txt +653 -0
- package/mcp-docs/web/components/ThemeProvider.txt +200 -0
- package/mcp-docs/web/components/TileButton.txt +159 -0
- package/mcp-docs/web/components/Toast.txt +204 -0
- package/mcp-docs/web/components/Tooltip.txt +90 -0
- package/mcp-docs/web/components/Tour.txt +180 -0
- package/mcp-docs/web/components/Tray.txt +289 -0
- package/mcp-docs/web/components/UpsellCard.txt +320 -0
- package/mcp-docs/web/components/VStack.txt +225 -0
- package/mcp-docs/web/components/XAxis.txt +620 -0
- package/mcp-docs/web/components/YAxis.txt +549 -0
- package/mcp-docs/web/getting-started/introduction.txt +99 -0
- package/mcp-docs/web/getting-started/mcp-server.txt +94 -0
- package/mcp-docs/web/getting-started/playground.txt +25 -0
- package/mcp-docs/web/hooks/useBreakpoints.txt +33 -0
- package/mcp-docs/web/hooks/useDimensions.txt +55 -0
- package/mcp-docs/web/hooks/useHasMounted.txt +55 -0
- package/mcp-docs/web/hooks/useIsoEffect.txt +42 -0
- package/mcp-docs/web/hooks/useMediaQuery.txt +94 -0
- package/mcp-docs/web/hooks/useOverlayContentContext.txt +217 -0
- package/mcp-docs/web/hooks/useScrollBlocker.txt +63 -0
- package/mcp-docs/web/hooks/useTheme.txt +105 -0
- package/mcp-docs/web/routes.txt +155 -0
- package/package.json +1 -1
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# Scrubber
|
|
2
|
+
|
|
3
|
+
An interactive scrubber component for exploring individual data points in charts. Displays values on hover or drag and supports custom labels and formatting.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { Scrubber } from '@coinbase/cds-web-visualization'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `BeaconComponent` | `ComponentClass<ScrubberBeaconProps, any> \| FunctionComponent<ScrubberBeaconProps>` | No | `-` | Custom component for the scrubber beacon. |
|
|
16
|
+
| `BeaconLabelComponent` | `ComponentClass<ChartTextProps, any> \| FunctionComponent<ChartTextProps>` | No | `-` | Custom component for the scrubber beacon label. |
|
|
17
|
+
| `LineComponent` | `FunctionComponent<ReferenceLineProps> \| ComponentClass<ReferenceLineProps, any>` | No | `-` | Custom component for the scrubber line. |
|
|
18
|
+
| `classNames` | `{ overlay?: string; beacon?: string \| undefined; line?: string \| undefined; beaconLabel?: string \| undefined; } \| undefined` | No | `-` | Custom class names for scrubber elements. |
|
|
19
|
+
| `hideLine` | `boolean` | No | `-` | Hides the scrubber line |
|
|
20
|
+
| `hideOverlay` | `boolean` | No | `-` | Whether to hide the overlay rect which obscures future data. |
|
|
21
|
+
| `idlePulse` | `boolean` | No | `-` | Pulse the scrubber beacon while it is at rest. |
|
|
22
|
+
| `key` | `Key \| null` | No | `-` | - |
|
|
23
|
+
| `label` | `ChartTextChildren \| ((dataIndex: number) => ChartTextChildren)` | No | `-` | Label text displayed above the scrubber line. |
|
|
24
|
+
| `labelProps` | `ReferenceLineLabelProps` | No | `-` | Props passed to the scrubber lines label. |
|
|
25
|
+
| `lineStroke` | `string` | No | `-` | Stroke color for the scrubber line. |
|
|
26
|
+
| `overlayOffset` | `number` | No | `2` | Offset of the overlay rect relative to the drawing area. Useful for when scrubbing over lines, where the stroke width would cause part of the line to be visible. |
|
|
27
|
+
| `ref` | `((instance: ScrubberBeaconRef \| null) => void) \| RefObject<ScrubberBeaconRef> \| null` | No | `-` | - |
|
|
28
|
+
| `seriesIds` | `string[]` | No | `-` | An array of series IDs that will receive visual emphasis as the user scrubs through the chart. Use this prop to restrict the scrubbing visual behavior to specific series. By default, all series will be highlighted by the Scrubber. |
|
|
29
|
+
| `styles` | `{ overlay?: CSSProperties; beacon?: CSSProperties \| undefined; line?: CSSProperties \| undefined; beaconLabel?: CSSProperties \| undefined; } \| undefined` | No | `-` | Custom styles for scrubber elements. |
|
|
30
|
+
| `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 |
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
### Basic Example
|
|
36
|
+
|
|
37
|
+
Scrubber can be used to provide horizontal interaction with a chart. As your mouse hovers over the chart, you will see a reference line and scrubber head following your cursor.
|
|
38
|
+
|
|
39
|
+
```jsx live
|
|
40
|
+
<LineChart
|
|
41
|
+
enableScrubbing
|
|
42
|
+
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
43
|
+
series={[
|
|
44
|
+
{
|
|
45
|
+
id: 'prices',
|
|
46
|
+
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
|
|
47
|
+
},
|
|
48
|
+
]}
|
|
49
|
+
curve="monotone"
|
|
50
|
+
showYAxis
|
|
51
|
+
showArea
|
|
52
|
+
yAxis={{
|
|
53
|
+
showGrid: true,
|
|
54
|
+
}}
|
|
55
|
+
>
|
|
56
|
+
<Scrubber />
|
|
57
|
+
</LineChart>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Multiple Series
|
|
61
|
+
|
|
62
|
+
All series will be scrubbed by default. You can set the `seriesIds` prop to restrict the scrubbing to specific series.
|
|
63
|
+
|
|
64
|
+
```jsx live
|
|
65
|
+
<LineChart
|
|
66
|
+
enableScrubbing
|
|
67
|
+
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
68
|
+
series={[
|
|
69
|
+
{
|
|
70
|
+
id: 'top',
|
|
71
|
+
data: [15, 28, 32, 44, 46, 36, 40, 45, 48, 38],
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: 'upperMiddle',
|
|
75
|
+
data: [12, 23, 21, 29, 34, 28, 31, 38, 42, 35],
|
|
76
|
+
color: '#ef4444',
|
|
77
|
+
type: 'dotted',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'lowerMiddle',
|
|
81
|
+
data: [8, 15, 14, 25, 20, 18, 22, 28, 24, 30],
|
|
82
|
+
color: '#f59e0b',
|
|
83
|
+
curve: 'natural',
|
|
84
|
+
LineComponent: (props) => (
|
|
85
|
+
<GradientLine {...props} endColor="#F7931A" startColor="#E3D74D" strokeWidth={4} />
|
|
86
|
+
),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'bottom',
|
|
90
|
+
data: [4, 8, 11, 15, 16, 14, 16, 10, 12, 14],
|
|
91
|
+
color: '#800080',
|
|
92
|
+
curve: 'step',
|
|
93
|
+
AreaComponent: DottedArea,
|
|
94
|
+
showArea: true,
|
|
95
|
+
},
|
|
96
|
+
]}
|
|
97
|
+
>
|
|
98
|
+
<Scrubber seriesIds={['top', 'lowerMiddle']} />
|
|
99
|
+
</LineChart>
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Labels
|
|
103
|
+
|
|
104
|
+
Setting the `label` prop for a series will display a label above the scrubber head.
|
|
105
|
+
|
|
106
|
+
```jsx live
|
|
107
|
+
<LineChart
|
|
108
|
+
enableScrubbing
|
|
109
|
+
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
110
|
+
series={[
|
|
111
|
+
{
|
|
112
|
+
id: 'prices',
|
|
113
|
+
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
|
|
114
|
+
label: 'Price',
|
|
115
|
+
},
|
|
116
|
+
]}
|
|
117
|
+
curve="monotone"
|
|
118
|
+
showArea
|
|
119
|
+
>
|
|
120
|
+
<Scrubber />
|
|
121
|
+
</LineChart>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Pulsing
|
|
125
|
+
|
|
126
|
+
Setting the `idlePulse` prop will cause the scrubber heads to pulse when the user is not actively scrubbing.
|
|
127
|
+
|
|
128
|
+
```jsx live
|
|
129
|
+
<LineChart
|
|
130
|
+
enableScrubbing
|
|
131
|
+
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
132
|
+
series={[
|
|
133
|
+
{
|
|
134
|
+
id: 'prices',
|
|
135
|
+
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
|
|
136
|
+
},
|
|
137
|
+
]}
|
|
138
|
+
curve="monotone"
|
|
139
|
+
showArea
|
|
140
|
+
>
|
|
141
|
+
<Scrubber idlePulse />
|
|
142
|
+
</LineChart>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### With Imperative Handle
|
|
146
|
+
|
|
147
|
+
You can also use the imperative handle to pulse the scrubber heads programmatically.
|
|
148
|
+
|
|
149
|
+
```jsx live
|
|
150
|
+
function ImperativeHandle() {
|
|
151
|
+
const scrubberRef = useRef(null);
|
|
152
|
+
return (
|
|
153
|
+
<VStack gap={2}>
|
|
154
|
+
<LineChart
|
|
155
|
+
enableScrubbing
|
|
156
|
+
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
157
|
+
series={[
|
|
158
|
+
{
|
|
159
|
+
id: 'priceA',
|
|
160
|
+
data: [2400, 1398, 9800, 3908, 4800, 3800, 4300],
|
|
161
|
+
label: 'Price A',
|
|
162
|
+
color: 'var(--color-accentBoldBlue)',
|
|
163
|
+
curve: 'natural',
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: 'priceB',
|
|
167
|
+
data: [2000, 2491, 4501, 6049, 5019, 4930, 5910],
|
|
168
|
+
label: 'Price B',
|
|
169
|
+
color: 'var(--color-accentBoldGreen)',
|
|
170
|
+
curve: 'natural',
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'priceC',
|
|
174
|
+
data: [1000, 4910, 2300, 5910, 3940, 2940, 1940],
|
|
175
|
+
label: 'Price C',
|
|
176
|
+
color: 'var(--color-accentBoldPurple)',
|
|
177
|
+
curve: 'natural',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: 'priceD',
|
|
181
|
+
data: [4810, 2030, 5810, 3940, 2940, 1940, 940],
|
|
182
|
+
label: 'Price D',
|
|
183
|
+
color: 'var(--color-accentBoldYellow)',
|
|
184
|
+
curve: 'natural',
|
|
185
|
+
},
|
|
186
|
+
]}
|
|
187
|
+
xAxis={{
|
|
188
|
+
range: ({ min, max }) => ({ min, max: max - 32 }),
|
|
189
|
+
}}
|
|
190
|
+
showYAxis
|
|
191
|
+
yAxis={{
|
|
192
|
+
domain: {
|
|
193
|
+
min: 0,
|
|
194
|
+
},
|
|
195
|
+
showGrid: true,
|
|
196
|
+
tickLabelFormatter: (value) => value.toLocaleString(),
|
|
197
|
+
}}
|
|
198
|
+
>
|
|
199
|
+
<Scrubber ref={scrubberRef} />
|
|
200
|
+
</LineChart>
|
|
201
|
+
<Button onClick={() => scrubberRef.current?.pulse()}>Pulse</Button>
|
|
202
|
+
</VStack>
|
|
203
|
+
);
|
|
204
|
+
}
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Disable Overlay When Scrubbing
|
|
208
|
+
|
|
209
|
+
By default, the scrubber will show an overlay to de-emphasize future data. You can hide this by setting the `hideOverlay` prop to `true`.
|
|
210
|
+
|
|
211
|
+
```jsx live
|
|
212
|
+
<LineChart
|
|
213
|
+
enableScrubbing
|
|
214
|
+
height={{ base: 150, tablet: 200, desktop: 250 }}
|
|
215
|
+
series={[
|
|
216
|
+
{
|
|
217
|
+
id: 'prices',
|
|
218
|
+
data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
|
|
219
|
+
},
|
|
220
|
+
]}
|
|
221
|
+
curve="monotone"
|
|
222
|
+
showYAxis
|
|
223
|
+
showArea
|
|
224
|
+
yAxis={{
|
|
225
|
+
showGrid: true,
|
|
226
|
+
}}
|
|
227
|
+
>
|
|
228
|
+
<Scrubber hideOverlay />
|
|
229
|
+
</LineChart>
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# SearchInput
|
|
2
|
+
|
|
3
|
+
A control for searching a dataset.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { SearchInput } from '@coinbase/cds-web/controls/SearchInput'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `onChangeText` | `(text: string) => void` | Yes | `-` | - |
|
|
16
|
+
| `bordered` | `boolean` | No | `true` | Adds border to input |
|
|
17
|
+
| `clearIconAccessibilityLabel` | `string` | No | `-` | Set the a11y label for the clear icon |
|
|
18
|
+
| `compact` | `boolean` | No | `false` | Enables compact variation |
|
|
19
|
+
| `disabled` | `boolean` | No | `false` | Toggles input interactability and opacity |
|
|
20
|
+
| `enableColorSurge` | `boolean` | No | `-` | Enable Color Surge motion |
|
|
21
|
+
| `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `undefined` | Set the end node |
|
|
22
|
+
| `helperTextErrorIconAccessibilityLabel` | `string` | No | `'error'` | Accessibility label for helper text error icon when variant=negative |
|
|
23
|
+
| `hideEndIcon` | `boolean` | No | `undefined` | hide the end icon |
|
|
24
|
+
| `hideStartIcon` | `boolean` | No | `false` | hide the start icon |
|
|
25
|
+
| `key` | `Key \| null` | No | `-` | - |
|
|
26
|
+
| `onChange` | `ChangeEventHandler<HTMLInputElement>` | No | `-` | - |
|
|
27
|
+
| `onClear` | `MouseEventHandler<Element>` | No | `-` | - |
|
|
28
|
+
| `onSearch` | `((str: string) => void)` | No | `-` | Callback is fired when a user hits enter on the keyboard. Can obtain the query through str parameter |
|
|
29
|
+
| `placeholder` | `string` | No | `-` | Placeholder text displayed inside of the input. Will be replaced if there is a value. |
|
|
30
|
+
| `ref` | `((instance: HTMLInputElement \| null) => void) \| RefObject<HTMLInputElement> \| null` | No | `-` | - |
|
|
31
|
+
| `startIcon` | `search \| backArrow` | No | `search` | Set the start icon. You can only set it to search \| backArrow icon. If you set this, the icon would not toggle between search and backArrow depending on the focus state |
|
|
32
|
+
| `startIconAccessibilityLabel` | `string` | No | `-` | Set the a11y label for the start icon |
|
|
33
|
+
| `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 |
|
|
34
|
+
| `testIDMap` | `{ start?: string; end?: string \| undefined; label?: string \| undefined; helperText?: string \| undefined; } \| undefined` | No | `-` | Add ability to test individual parts of the input |
|
|
35
|
+
| `type` | `number \| color \| button \| search \| time \| image \| text \| hidden \| string & {} \| email \| checkbox \| radio \| tel \| url \| date \| submit \| reset \| datetime-local \| file \| month \| password \| range \| week` | No | `-` | - |
|
|
36
|
+
| `value` | `string \| (readonly string[] & string)` | No | `-` | The **value** property of the HTMLInputElement interface represents the current value of the input element as a string. [MDN Reference](https://developer.mozilla.org/docs/Web/API/HTMLInputElement/value) |
|
|
37
|
+
| `width` | `((Width<string \| number> \| { base?: Width<string \| number>; phone?: Width<string \| number> \| undefined; tablet?: Width<string \| number> \| undefined; desktop?: Width<string \| number> \| undefined; }) & (string \| number)) \| undefined` | No | `100%` | Width of input as a percentage string. |
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
### Basic usage
|
|
43
|
+
|
|
44
|
+
```tsx live
|
|
45
|
+
function BasicSearchInput() {
|
|
46
|
+
const [value, setValue] = useState('');
|
|
47
|
+
return (
|
|
48
|
+
<VStack gap={2}>
|
|
49
|
+
<SearchInput
|
|
50
|
+
value={value}
|
|
51
|
+
onChangeText={setValue}
|
|
52
|
+
onClear={() => setValue('')}
|
|
53
|
+
onSearch={(searchTerm) => console.log('Searching for:', searchTerm)}
|
|
54
|
+
placeholder="Search..."
|
|
55
|
+
/>
|
|
56
|
+
<Text color="foregroundMuted" font="caption">
|
|
57
|
+
Press Enter to trigger search
|
|
58
|
+
</Text>
|
|
59
|
+
</VStack>
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Variants
|
|
65
|
+
|
|
66
|
+
```tsx live
|
|
67
|
+
function SearchInputVariants() {
|
|
68
|
+
const [value1, setValue1] = useState('');
|
|
69
|
+
const [value2, setValue2] = useState('');
|
|
70
|
+
const [value3, setValue3] = useState('');
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<VStack gap={2}>
|
|
74
|
+
<SearchInput
|
|
75
|
+
value={value1}
|
|
76
|
+
onChangeText={setValue1}
|
|
77
|
+
onClear={() => setValue1('')}
|
|
78
|
+
placeholder="Compact search..."
|
|
79
|
+
compact
|
|
80
|
+
/>
|
|
81
|
+
<SearchInput
|
|
82
|
+
value={value2}
|
|
83
|
+
onChangeText={setValue2}
|
|
84
|
+
onClear={() => setValue2('')}
|
|
85
|
+
placeholder="Borderless search..."
|
|
86
|
+
bordered={false}
|
|
87
|
+
/>
|
|
88
|
+
<SearchInput
|
|
89
|
+
value={value3}
|
|
90
|
+
onChangeText={setValue3}
|
|
91
|
+
onClear={() => setValue3('')}
|
|
92
|
+
placeholder="No icons..."
|
|
93
|
+
hideStartIcon
|
|
94
|
+
hideEndIcon
|
|
95
|
+
/>
|
|
96
|
+
</VStack>
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### With Custom End Element
|
|
102
|
+
|
|
103
|
+
```tsx live
|
|
104
|
+
function CustomEndSearchInput() {
|
|
105
|
+
const [value, setValue] = useState('');
|
|
106
|
+
return (
|
|
107
|
+
<SearchInput
|
|
108
|
+
value={value}
|
|
109
|
+
onChangeText={setValue}
|
|
110
|
+
onClear={() => setValue('')}
|
|
111
|
+
placeholder="Custom end element..."
|
|
112
|
+
end={<InputIconButton name="filter" onClick={() => console.log('Filter clicked')} />}
|
|
113
|
+
/>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
# SectionHeader
|
|
2
|
+
|
|
3
|
+
A header component used to organize and label sections of content, with support for icons, descriptions, and additional content.
|
|
4
|
+
|
|
5
|
+
## Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import { SectionHeader } from '@coinbase/cds-web/section-header/SectionHeader'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Props
|
|
12
|
+
|
|
13
|
+
| Prop | Type | Required | Default | Description |
|
|
14
|
+
| --- | --- | --- | --- | --- |
|
|
15
|
+
| `title` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | Yes | `-` | Text or ReactNode to be displayed in Title |
|
|
16
|
+
| `alignContent` | `ResponsiveProp<center \| normal \| start \| end \| flex-start \| flex-end \| stretch \| baseline \| first baseline \| last baseline \| space-between \| space-around \| space-evenly>` | No | `-` | - |
|
|
17
|
+
| `alignItems` | `ResponsiveProp<center \| normal \| start \| end \| flex-start \| flex-end \| self-start \| self-end \| stretch \| baseline \| first baseline \| last baseline>` | No | `-` | - |
|
|
18
|
+
| `alignSelf` | `ResponsiveProp<center \| normal \| auto \| start \| end \| flex-start \| flex-end \| self-start \| self-end \| stretch \| baseline \| first baseline \| last baseline>` | No | `-` | - |
|
|
19
|
+
| `as` | `div` | No | `-` | - |
|
|
20
|
+
| `aspectRatio` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
21
|
+
| `background` | `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 | `-` | - |
|
|
22
|
+
| `balance` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | ReactNode or IconName to present balances wherever it is necessary |
|
|
23
|
+
| `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
24
|
+
| `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
25
|
+
| `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
26
|
+
| `borderColor` | `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 | `-` | - |
|
|
27
|
+
| `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
28
|
+
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
29
|
+
| `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
30
|
+
| `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
31
|
+
| `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
|
|
32
|
+
| `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
33
|
+
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
|
|
34
|
+
| `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
|
|
35
|
+
| `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
|
|
36
|
+
| `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
|
|
37
|
+
| `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
|
|
38
|
+
| `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
|
|
39
|
+
| `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
|
|
40
|
+
| `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
|
|
41
|
+
| `bottom` | `ResponsiveProp<Bottom<string \| number>>` | No | `-` | - |
|
|
42
|
+
| `color` | `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 | `-` | - |
|
|
43
|
+
| `columnGap` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
44
|
+
| `dangerouslySetBackground` | `string` | No | `-` | - |
|
|
45
|
+
| `description` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | ReactNode to display up to 2 lines of copy that frames the sections purpose and relevance |
|
|
46
|
+
| `display` | `ResponsiveProp<grid \| revert \| none \| block \| inline \| inline-block \| flex \| inline-flex \| inline-grid \| contents \| flow-root \| list-item>` | No | `-` | - |
|
|
47
|
+
| `elevation` | `0 \| 1 \| 2` | No | `-` | - |
|
|
48
|
+
| `end` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
49
|
+
| `flexBasis` | `ResponsiveProp<FlexBasis<string \| number>>` | No | `-` | - |
|
|
50
|
+
| `flexDirection` | `ResponsiveProp<column \| row \| row-reverse \| column-reverse>` | No | `-` | - |
|
|
51
|
+
| `flexGrow` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset` | No | `-` | - |
|
|
52
|
+
| `flexShrink` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset` | No | `-` | - |
|
|
53
|
+
| `flexWrap` | `ResponsiveProp<nowrap \| wrap \| wrap-reverse>` | No | `-` | - |
|
|
54
|
+
| `font` | `ResponsiveProp<FontFamily \| inherit>` | No | `-` | - |
|
|
55
|
+
| `fontFamily` | `ResponsiveProp<FontFamily \| inherit>` | No | `-` | - |
|
|
56
|
+
| `fontSize` | `ResponsiveProp<FontSize \| inherit>` | No | `-` | - |
|
|
57
|
+
| `fontWeight` | `ResponsiveProp<FontWeight \| inherit>` | No | `-` | - |
|
|
58
|
+
| `gap` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
59
|
+
| `grid` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
|
|
60
|
+
| `gridArea` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
61
|
+
| `gridAutoColumns` | `ResponsiveProp<GridAutoColumns<string \| number>>` | No | `-` | - |
|
|
62
|
+
| `gridAutoFlow` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| row \| column \| dense` | No | `-` | - |
|
|
63
|
+
| `gridAutoRows` | `ResponsiveProp<GridAutoRows<string \| number>>` | No | `-` | - |
|
|
64
|
+
| `gridColumn` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
65
|
+
| `gridColumnEnd` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
66
|
+
| `gridColumnStart` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
67
|
+
| `gridRow` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
68
|
+
| `gridRowEnd` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
69
|
+
| `gridRowStart` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
70
|
+
| `gridTemplate` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
|
|
71
|
+
| `gridTemplateAreas` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
|
|
72
|
+
| `gridTemplateColumns` | `ResponsiveProp<GridTemplateColumns<string \| number>>` | No | `-` | - |
|
|
73
|
+
| `gridTemplateRows` | `ResponsiveProp<GridTemplateRows<string \| number>>` | No | `-` | - |
|
|
74
|
+
| `height` | `ResponsiveProp<Height<string \| number>>` | No | `-` | - |
|
|
75
|
+
| `icon` | `string \| number \| boolean \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal \| null` | No | `-` | - |
|
|
76
|
+
| `iconActive` | `boolean` | No | `-` | Whether the icon is active |
|
|
77
|
+
| `justifyContent` | `ResponsiveProp<left \| right \| center \| normal \| start \| end \| flex-start \| flex-end \| stretch \| space-between \| space-around \| space-evenly>` | No | `-` | - |
|
|
78
|
+
| `key` | `Key \| null` | No | `-` | - |
|
|
79
|
+
| `left` | `ResponsiveProp<Left<string \| number>>` | No | `-` | - |
|
|
80
|
+
| `lineHeight` | `ResponsiveProp<LineHeight \| inherit>` | No | `-` | - |
|
|
81
|
+
| `margin` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
|
|
82
|
+
| `marginBottom` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
|
|
83
|
+
| `marginEnd` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
|
|
84
|
+
| `marginStart` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
|
|
85
|
+
| `marginTop` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
|
|
86
|
+
| `marginX` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
|
|
87
|
+
| `marginY` | `ResponsiveProp<0 \| -5 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1 \| -1.5 \| -2 \| -3 \| -4 \| -6 \| -7 \| -8 \| -9>` | No | `-` | - |
|
|
88
|
+
| `maxHeight` | `ResponsiveProp<MaxHeight<string \| number>>` | No | `-` | - |
|
|
89
|
+
| `maxWidth` | `ResponsiveProp<MaxWidth<string \| number>>` | No | `-` | - |
|
|
90
|
+
| `minHeight` | `ResponsiveProp<MinHeight<string \| number>>` | No | `-` | - |
|
|
91
|
+
| `minWidth` | `ResponsiveProp<MinWidth<string \| number>>` | No | `-` | - |
|
|
92
|
+
| `onChange` | `FormEventHandler<HTMLDivElement>` | No | `-` | - |
|
|
93
|
+
| `opacity` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset` | No | `-` | - |
|
|
94
|
+
| `overflow` | `ResponsiveProp<hidden \| auto \| visible \| clip \| scroll>` | No | `-` | - |
|
|
95
|
+
| `padding` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
96
|
+
| `paddingBottom` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
97
|
+
| `paddingEnd` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
98
|
+
| `paddingStart` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
99
|
+
| `paddingTop` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
100
|
+
| `paddingX` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
101
|
+
| `paddingY` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
102
|
+
| `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
|
|
103
|
+
| `position` | `ResponsiveProp<fixed \| static \| relative \| absolute \| sticky>` | No | `-` | - |
|
|
104
|
+
| `ref` | `RefObject<HTMLDivElement> \| ((instance: HTMLDivElement \| null) => void) \| null` | No | `-` | - |
|
|
105
|
+
| `right` | `ResponsiveProp<Right<string \| number>>` | No | `-` | - |
|
|
106
|
+
| `rowGap` | `0 \| 5 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1 \| 1.5 \| 2 \| 3 \| 4 \| 6 \| 7 \| 8 \| 9` | No | `-` | - |
|
|
107
|
+
| `start` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | - |
|
|
108
|
+
| `style` | `CSSProperties` | No | `-` | - |
|
|
109
|
+
| `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 |
|
|
110
|
+
| `textAlign` | `ResponsiveProp<center \| start \| end \| justify>` | No | `-` | - |
|
|
111
|
+
| `textDecoration` | `ResponsiveProp<none \| underline \| overline \| line-through \| underline overline \| underline double>` | No | `-` | - |
|
|
112
|
+
| `textTransform` | `ResponsiveProp<capitalize \| lowercase \| none \| uppercase>` | No | `-` | - |
|
|
113
|
+
| `top` | `ResponsiveProp<Top<string \| number>>` | No | `-` | - |
|
|
114
|
+
| `transform` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| none` | No | `-` | - |
|
|
115
|
+
| `userSelect` | `ResponsiveProp<text \| none \| auto \| all>` | No | `-` | - |
|
|
116
|
+
| `visibility` | `ResponsiveProp<hidden \| visible>` | No | `-` | - |
|
|
117
|
+
| `width` | `ResponsiveProp<Width<string \| number>>` | No | `-` | - |
|
|
118
|
+
| `zIndex` | `-moz-initial \| inherit \| initial \| revert \| revert-layer \| unset \| auto` | No | `-` | - |
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## Examples
|
|
122
|
+
|
|
123
|
+
### Basic usage
|
|
124
|
+
|
|
125
|
+
```tsx live
|
|
126
|
+
<SectionHeader title="Basic Section Header" />
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### With Description
|
|
130
|
+
|
|
131
|
+
```tsx live
|
|
132
|
+
<SectionHeader
|
|
133
|
+
title="Section with Description"
|
|
134
|
+
description="This is a helpful description that provides more context about this section. It can span multiple lines and will be truncated after two lines of text if it's too long."
|
|
135
|
+
/>
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### With Icons
|
|
139
|
+
|
|
140
|
+
```tsx live
|
|
141
|
+
<VStack gap={2}>
|
|
142
|
+
<SectionHeader title="Start Icon Example" start={<Icon active name="star" />} />
|
|
143
|
+
<SectionHeader
|
|
144
|
+
title="Info Icon Example"
|
|
145
|
+
icon="info-circle"
|
|
146
|
+
description="The info icon is automatically sized and colored"
|
|
147
|
+
/>
|
|
148
|
+
</VStack>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### With Balance and Actions
|
|
152
|
+
|
|
153
|
+
```tsx live
|
|
154
|
+
<VStack gap={2}>
|
|
155
|
+
<SectionHeader
|
|
156
|
+
title="Account Balance"
|
|
157
|
+
balance="$1,234.56"
|
|
158
|
+
end={
|
|
159
|
+
<Button variant="secondary" compact onClick={() => console.log('View history')}>
|
|
160
|
+
View History
|
|
161
|
+
</Button>
|
|
162
|
+
}
|
|
163
|
+
/>
|
|
164
|
+
<SectionHeader
|
|
165
|
+
title="Portfolio Value"
|
|
166
|
+
balance="$5,678.90"
|
|
167
|
+
description="Total value across all accounts"
|
|
168
|
+
end={
|
|
169
|
+
<HStack gap={1}>
|
|
170
|
+
<Button variant="secondary" compact onClick={() => console.log('Export')}>
|
|
171
|
+
Export
|
|
172
|
+
</Button>
|
|
173
|
+
<Button variant="primary" compact onClick={() => console.log('Details')}>
|
|
174
|
+
Details
|
|
175
|
+
</Button>
|
|
176
|
+
</HStack>
|
|
177
|
+
}
|
|
178
|
+
/>
|
|
179
|
+
</VStack>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Layout Customization
|
|
183
|
+
|
|
184
|
+
```tsx live
|
|
185
|
+
<VStack gap={2}>
|
|
186
|
+
{/* Custom spacing */}
|
|
187
|
+
<SectionHeader
|
|
188
|
+
title="Custom Padding"
|
|
189
|
+
description="Modified padding and gap"
|
|
190
|
+
paddingX={6}
|
|
191
|
+
paddingY={3}
|
|
192
|
+
gap={2}
|
|
193
|
+
/>
|
|
194
|
+
|
|
195
|
+
{/* Custom background and borders */}
|
|
196
|
+
<SectionHeader
|
|
197
|
+
title="Styled Background"
|
|
198
|
+
description="With custom background and border radius"
|
|
199
|
+
background="bgSecondary"
|
|
200
|
+
borderRadius={2}
|
|
201
|
+
paddingX={4}
|
|
202
|
+
/>
|
|
203
|
+
|
|
204
|
+
{/* Custom alignment */}
|
|
205
|
+
<SectionHeader
|
|
206
|
+
title="Center Aligned"
|
|
207
|
+
description="Content centered instead of space-between"
|
|
208
|
+
justifyContent="center"
|
|
209
|
+
end={
|
|
210
|
+
<Button variant="secondary" compact onClick={() => console.log('Action')}>
|
|
211
|
+
Action
|
|
212
|
+
</Button>
|
|
213
|
+
}
|
|
214
|
+
/>
|
|
215
|
+
</VStack>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
|