@coinbase/cds-mcp-server 8.47.1 → 8.47.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 +8 -0
- package/mcp-docs/mobile/components/BarChart.txt +8 -8
- package/mcp-docs/mobile/components/CartesianChart.txt +85 -30
- package/mcp-docs/mobile/components/LineChart.txt +16 -16
- package/mcp-docs/mobile/components/MessagingCard.txt +18 -11
- package/mcp-docs/mobile/components/Numpad.txt +2 -2
- package/mcp-docs/mobile/components/Point.txt +2 -2
- package/mcp-docs/mobile/components/ReferenceLine.txt +151 -65
- package/mcp-docs/mobile/components/Scrubber.txt +12 -19
- package/mcp-docs/mobile/components/Select.txt +1 -1
- package/mcp-docs/mobile/components/SelectAlpha.txt +1 -1
- package/mcp-docs/mobile/components/SelectOption.txt +1 -1
- package/mcp-docs/mobile/components/SlideButton.txt +1 -1
- package/mcp-docs/mobile/components/SparklineInteractive.txt +239 -46
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +55 -13
- package/mcp-docs/mobile/components/XAxis.txt +4 -5
- package/mcp-docs/mobile/components/YAxis.txt +2 -2
- package/mcp-docs/mobile/getting-started/theming.txt +1 -1
- package/mcp-docs/web/components/BarChart.txt +40 -48
- package/mcp-docs/web/components/Carousel.txt +2 -2
- package/mcp-docs/web/components/CartesianChart.txt +82 -45
- package/mcp-docs/web/components/Combobox.txt +61 -61
- package/mcp-docs/web/components/LineChart.txt +87 -110
- package/mcp-docs/web/components/MediaQueryProvider.txt +10 -2
- package/mcp-docs/web/components/MessagingCard.txt +21 -12
- package/mcp-docs/web/components/PeriodSelector.txt +57 -39
- package/mcp-docs/web/components/Point.txt +3 -3
- package/mcp-docs/web/components/ReferenceLine.txt +341 -279
- package/mcp-docs/web/components/Scrubber.txt +48 -52
- package/mcp-docs/web/components/SelectChipAlpha.txt +1 -1
- package/mcp-docs/web/components/SparklineInteractive.txt +399 -54
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +368 -28
- package/mcp-docs/web/components/TabbedChipsAlpha.txt +1 -1
- package/mcp-docs/web/components/XAxis.txt +5 -6
- package/mcp-docs/web/components/YAxis.txt +2 -2
- package/mcp-docs/web/getting-started/theming.txt +1 -1
- package/mcp-docs/web/hooks/useBreakpoints.txt +5 -4
- package/mcp-docs/web/hooks/useMediaQuery.txt +10 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,14 @@ All notable changes to this project will be documented in this file.
|
|
|
8
8
|
|
|
9
9
|
<!-- template-start -->
|
|
10
10
|
|
|
11
|
+
## 8.47.3 ((2/20/2026, 09:16 AM PST))
|
|
12
|
+
|
|
13
|
+
This is an artificial version bump with no new change.
|
|
14
|
+
|
|
15
|
+
## 8.47.2 ((2/19/2026, 03:18 PM PST))
|
|
16
|
+
|
|
17
|
+
This is an artificial version bump with no new change.
|
|
18
|
+
|
|
11
19
|
## 8.47.1 ((2/19/2026, 01:18 PM PST))
|
|
12
20
|
|
|
13
21
|
This is an artificial version bump with no new change.
|
|
@@ -38,7 +38,7 @@ To start, pass in a series of data to the chart.
|
|
|
38
38
|
|
|
39
39
|
You can also provide multiple series of data to the chart. Series will have their bars for each data point rendered side by side.
|
|
40
40
|
|
|
41
|
-
```
|
|
41
|
+
```tsx
|
|
42
42
|
function MonthlyGainsByAsset() {
|
|
43
43
|
const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
|
|
44
44
|
|
|
@@ -89,7 +89,7 @@ function MonthlyGainsByAsset() {
|
|
|
89
89
|
|
|
90
90
|
You can also configure stacking for your chart using the `stacked` prop.
|
|
91
91
|
|
|
92
|
-
```
|
|
92
|
+
```tsx
|
|
93
93
|
function MonthlyGainsByAsset() {
|
|
94
94
|
const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
|
|
95
95
|
|
|
@@ -155,7 +155,7 @@ function MonthlyGainsByAsset() {
|
|
|
155
155
|
|
|
156
156
|
You can also configure multiple stacks by setting the `stackId` prop on each series.
|
|
157
157
|
|
|
158
|
-
```
|
|
158
|
+
```tsx
|
|
159
159
|
function MonthlyGainsMultipleStacks() {
|
|
160
160
|
const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
|
|
161
161
|
|
|
@@ -225,7 +225,7 @@ function MonthlyGainsMultipleStacks() {
|
|
|
225
225
|
|
|
226
226
|
#### Stack Gap
|
|
227
227
|
|
|
228
|
-
```
|
|
228
|
+
```tsx
|
|
229
229
|
function MonthlyGainsByAsset() {
|
|
230
230
|
const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
|
|
231
231
|
|
|
@@ -284,7 +284,7 @@ function MonthlyGainsByAsset() {
|
|
|
284
284
|
GridLineComponent: ThinSolidLine,
|
|
285
285
|
tickLabelFormatter: tickFormatter,
|
|
286
286
|
width: 70,
|
|
287
|
-
domainLimit: 'strict'
|
|
287
|
+
domainLimit: 'strict',
|
|
288
288
|
}}
|
|
289
289
|
/>
|
|
290
290
|
);
|
|
@@ -366,7 +366,7 @@ You can also round the baseline of the bars by setting the `roundBaseline` prop
|
|
|
366
366
|
|
|
367
367
|
### Negative Data
|
|
368
368
|
|
|
369
|
-
```
|
|
369
|
+
```tsx
|
|
370
370
|
function PositiveAndNegativeCashFlow() {
|
|
371
371
|
const ThinSolidLine = memo((props: SolidLineProps) => <SolidLine {...props} strokeWidth={1} />);
|
|
372
372
|
|
|
@@ -439,7 +439,7 @@ You can pass in `null` or `0` values to not render a bar for that data point.
|
|
|
439
439
|
|
|
440
440
|
You can also use the `BarStackComponent` prop to render an empty circle for zero values.
|
|
441
441
|
|
|
442
|
-
```
|
|
442
|
+
```tsx
|
|
443
443
|
function MonthlyRewards() {
|
|
444
444
|
const months = ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'];
|
|
445
445
|
const currentMonth = 7;
|
|
@@ -499,7 +499,7 @@ function MonthlyRewards() {
|
|
|
499
499
|
}}
|
|
500
500
|
/>
|
|
501
501
|
);
|
|
502
|
-
}
|
|
502
|
+
}
|
|
503
503
|
```
|
|
504
504
|
|
|
505
505
|
### Customization
|
|
@@ -297,7 +297,7 @@ You can adjust the inset around the entire chart (outside the axes) with the `in
|
|
|
297
297
|
|
|
298
298
|
You can also remove the default inset, such as to have a compact line chart.
|
|
299
299
|
|
|
300
|
-
```
|
|
300
|
+
```tsx
|
|
301
301
|
function Insets() {
|
|
302
302
|
const theme = useTheme();
|
|
303
303
|
|
|
@@ -325,7 +325,6 @@ function Insets() {
|
|
|
325
325
|
},
|
|
326
326
|
]}
|
|
327
327
|
yAxis={{ domainLimit: 'strict' }}
|
|
328
|
-
|
|
329
328
|
showArea
|
|
330
329
|
style={{ border: `2px solid ${theme.color.fgPrimary}` }}
|
|
331
330
|
/>
|
|
@@ -343,7 +342,6 @@ function Insets() {
|
|
|
343
342
|
},
|
|
344
343
|
]}
|
|
345
344
|
yAxis={{ domainLimit: 'strict' }}
|
|
346
|
-
|
|
347
345
|
showArea
|
|
348
346
|
style={{ border: `2px solid ${theme.color.fgPrimary}` }}
|
|
349
347
|
>
|
|
@@ -362,7 +360,6 @@ function Insets() {
|
|
|
362
360
|
},
|
|
363
361
|
]}
|
|
364
362
|
yAxis={{ domainLimit: 'strict' }}
|
|
365
|
-
|
|
366
363
|
showArea
|
|
367
364
|
style={{ border: `2px solid ${theme.color.fgPrimary}` }}
|
|
368
365
|
>
|
|
@@ -442,14 +439,12 @@ By default, the scrubber will not allow overflow gestures. You can allow overflo
|
|
|
442
439
|
|
|
443
440
|
You can showcase the price and volume of an asset over time within one chart.
|
|
444
441
|
|
|
445
|
-
```
|
|
442
|
+
```tsx
|
|
446
443
|
function PriceWithVolume() {
|
|
447
444
|
const theme = useTheme();
|
|
448
445
|
|
|
449
446
|
const [scrubIndex, setScrubIndex] = useState(null);
|
|
450
|
-
const btcData = btcCandles
|
|
451
|
-
.slice(0, 180)
|
|
452
|
-
.reverse()
|
|
447
|
+
const btcData = btcCandles.slice(0, 180).reverse();
|
|
453
448
|
|
|
454
449
|
const btcPrices = btcData.map((candle) => parseFloat(candle.close));
|
|
455
450
|
const btcVolumes = btcData.map((candle) => parseFloat(candle.volume));
|
|
@@ -484,12 +479,14 @@ function PriceWithVolume() {
|
|
|
484
479
|
const currentPrice = btcPrices[displayIndex];
|
|
485
480
|
const currentVolume = btcVolumes[displayIndex];
|
|
486
481
|
const currentDate = btcDates[displayIndex];
|
|
487
|
-
const priceChange =
|
|
488
|
-
|
|
489
|
-
|
|
482
|
+
const priceChange =
|
|
483
|
+
displayIndex > 0
|
|
484
|
+
? (currentPrice - btcPrices[displayIndex - 1]) / btcPrices[displayIndex - 1]
|
|
485
|
+
: 0;
|
|
490
486
|
|
|
491
487
|
const accessibilityLabel = useMemo(() => {
|
|
492
|
-
if (scrubIndex === null)
|
|
488
|
+
if (scrubIndex === null)
|
|
489
|
+
return `Current Bitcoin price: ${formatPrice(currentPrice)}, Volume: ${formatVolume(currentVolume)}`;
|
|
493
490
|
return `Bitcoin price at ${formatDate(currentDate)}: ${formatPrice(currentPrice)}, Volume: ${formatVolume(currentVolume)}`;
|
|
494
491
|
}, [scrubIndex, currentPrice, currentVolume, currentDate, formatPrice, formatVolume, formatDate]);
|
|
495
492
|
|
|
@@ -499,7 +496,7 @@ function PriceWithVolume() {
|
|
|
499
496
|
|
|
500
497
|
return (
|
|
501
498
|
<VStack gap={2}>
|
|
502
|
-
|
|
499
|
+
<SectionHeader
|
|
503
500
|
id={headerId}
|
|
504
501
|
style={{ padding: 0 }}
|
|
505
502
|
title={<Text font="title1">Bitcoin</Text>}
|
|
@@ -549,9 +546,15 @@ function PriceWithVolume() {
|
|
|
549
546
|
aria-labelledby={headerId}
|
|
550
547
|
inset={{ top: 8, left: 8, right: 0, bottom: 0 }}
|
|
551
548
|
>
|
|
552
|
-
<YAxis
|
|
549
|
+
<YAxis
|
|
550
|
+
axisId="price"
|
|
551
|
+
showGrid
|
|
552
|
+
tickLabelFormatter={formatPriceInThousands}
|
|
553
|
+
width={48}
|
|
554
|
+
GridLineComponent={ThinSolidLine}
|
|
555
|
+
/>
|
|
553
556
|
<BarPlot seriesIds={['volume']} />
|
|
554
|
-
<Line seriesId="prices"
|
|
557
|
+
<Line seriesId="prices" showArea />
|
|
555
558
|
<Scrubber seriesIds={['prices']} />
|
|
556
559
|
</CartesianChart>
|
|
557
560
|
</VStack>
|
|
@@ -563,11 +566,12 @@ function PriceWithVolume() {
|
|
|
563
566
|
|
|
564
567
|
You can also create your own type of cartesian chart by using `getSeriesData`, `getXScale`, and `getYScale` directly.
|
|
565
568
|
|
|
566
|
-
```
|
|
569
|
+
```tsx
|
|
567
570
|
function EarningsHistory() {
|
|
568
571
|
const theme = useTheme();
|
|
569
|
-
const CirclePlot = memo(({ seriesId, opacity = 1 }: { seriesId: string
|
|
570
|
-
const { drawingArea, getSeries, getSeriesData, getXScale, getYScale } =
|
|
572
|
+
const CirclePlot = memo(({ seriesId, opacity = 1 }: { seriesId: string; opacity?: number }) => {
|
|
573
|
+
const { drawingArea, getSeries, getSeriesData, getXScale, getYScale } =
|
|
574
|
+
useCartesianChartContext();
|
|
571
575
|
const series = getSeries(seriesId);
|
|
572
576
|
const data = getSeriesData(seriesId);
|
|
573
577
|
const xScale = getXScale();
|
|
@@ -646,7 +650,7 @@ function EarningsHistory() {
|
|
|
646
650
|
[actualEPS, estimatedEPS],
|
|
647
651
|
);
|
|
648
652
|
|
|
649
|
-
const LegendEntry = memo(({ opacity = 1, label }: { opacity?: number
|
|
653
|
+
const LegendEntry = memo(({ opacity = 1, label }: { opacity?: number; label: string }) => {
|
|
650
654
|
return (
|
|
651
655
|
<Box alignItems="center" gap={0.5}>
|
|
652
656
|
<LegendDot opacity={opacity} />
|
|
@@ -699,7 +703,7 @@ function EarningsHistory() {
|
|
|
699
703
|
|
|
700
704
|
You can have multiple axes with different domains and ranges to showcase different pieces of data over the time time period.
|
|
701
705
|
|
|
702
|
-
```
|
|
706
|
+
```tsx
|
|
703
707
|
function TradingTrends() {
|
|
704
708
|
const theme = useTheme();
|
|
705
709
|
|
|
@@ -712,15 +716,31 @@ function TradingTrends() {
|
|
|
712
716
|
return `$${value}M`;
|
|
713
717
|
}, []);
|
|
714
718
|
|
|
715
|
-
const ThinSolidLine = memo((props: SolidLineProps) =>
|
|
716
|
-
|
|
719
|
+
const ThinSolidLine = memo((props: SolidLineProps) => (
|
|
720
|
+
<SolidLine {...props} strokeWidth={1} strokeLinecap="butt" />
|
|
721
|
+
));
|
|
722
|
+
const ThickSolidLine = memo((props: SolidLineProps) => (
|
|
723
|
+
<SolidLine {...props} strokeWidth={2} strokeLinecap="butt" />
|
|
724
|
+
));
|
|
717
725
|
|
|
718
726
|
return (
|
|
719
727
|
<CartesianChart
|
|
720
728
|
height={150}
|
|
721
729
|
series={[
|
|
722
|
-
{
|
|
723
|
-
|
|
730
|
+
{
|
|
731
|
+
id: 'gains',
|
|
732
|
+
data: gains,
|
|
733
|
+
yAxisId: 'profit',
|
|
734
|
+
color: theme.color.bgPositive,
|
|
735
|
+
stackId: 'bars',
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
id: 'losses',
|
|
739
|
+
data: losses,
|
|
740
|
+
yAxisId: 'profit',
|
|
741
|
+
color: theme.color.bgNegative,
|
|
742
|
+
stackId: 'bars',
|
|
743
|
+
},
|
|
724
744
|
{
|
|
725
745
|
id: 'revenue',
|
|
726
746
|
data: [128, 118, 122, 116, 120, 114, 118, 122, 126, 130, 134, 138],
|
|
@@ -728,17 +748,52 @@ function TradingTrends() {
|
|
|
728
748
|
color: theme.color.fgMuted,
|
|
729
749
|
},
|
|
730
750
|
]}
|
|
731
|
-
xAxis={{
|
|
751
|
+
xAxis={{
|
|
752
|
+
scaleType: 'band',
|
|
753
|
+
data: [
|
|
754
|
+
'Jan',
|
|
755
|
+
'Feb',
|
|
756
|
+
'Mar',
|
|
757
|
+
'Apr',
|
|
758
|
+
'May',
|
|
759
|
+
'Jun',
|
|
760
|
+
'Jul',
|
|
761
|
+
'Aug',
|
|
762
|
+
'Sep',
|
|
763
|
+
'Oct',
|
|
764
|
+
'Nov',
|
|
765
|
+
'Dec',
|
|
766
|
+
],
|
|
767
|
+
}}
|
|
732
768
|
yAxis={[
|
|
733
|
-
{
|
|
734
|
-
|
|
769
|
+
{
|
|
770
|
+
id: 'profit',
|
|
771
|
+
range: ({ min, max }) => ({ min: min, max: max - 64 }),
|
|
772
|
+
domain: { min: -40, max: 40 },
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
id: 'revenue',
|
|
776
|
+
range: ({ min, max }) => ({ min: max - 64, max }),
|
|
777
|
+
domain: { min: 100 },
|
|
778
|
+
},
|
|
735
779
|
]}
|
|
736
780
|
>
|
|
737
|
-
<YAxis
|
|
781
|
+
<YAxis
|
|
782
|
+
axisId="profit"
|
|
783
|
+
position="left"
|
|
784
|
+
showGrid
|
|
785
|
+
tickLabelFormatter={renderProfit}
|
|
786
|
+
GridLineComponent={ThinSolidLine}
|
|
787
|
+
/>
|
|
738
788
|
<XAxis />
|
|
739
|
-
<ReferenceLine
|
|
789
|
+
<ReferenceLine
|
|
790
|
+
LineComponent={ThickSolidLine}
|
|
791
|
+
dataY={0}
|
|
792
|
+
yAxisId="profit"
|
|
793
|
+
stroke={`rgba(${theme.color.gray15.slice(4)})`}
|
|
794
|
+
/>
|
|
740
795
|
<BarPlot seriesIds={['gains', 'losses']} />
|
|
741
|
-
<Line seriesId="revenue"
|
|
796
|
+
<Line seriesId="revenue" showArea />
|
|
742
797
|
</CartesianChart>
|
|
743
798
|
);
|
|
744
799
|
}
|
|
@@ -184,7 +184,7 @@ function LiveUpdates() {
|
|
|
184
184
|
By default, null values in data create gaps in a line. Use `connectNulls` to skip null values and draw a continuous line.
|
|
185
185
|
Note that scrubber beacons and points are still only shown at non-null data values.
|
|
186
186
|
|
|
187
|
-
```
|
|
187
|
+
```tsx
|
|
188
188
|
function MissingData() {
|
|
189
189
|
const theme = useTheme();
|
|
190
190
|
const pages = ['Page A', 'Page B', 'Page C', 'Page D', 'Page E', 'Page F', 'Page G'];
|
|
@@ -359,8 +359,7 @@ function Points() {
|
|
|
359
359
|
|
|
360
360
|
Renders are done on JS thread, other code is in UI
|
|
361
361
|
|
|
362
|
-
```
|
|
363
|
-
|
|
362
|
+
```tsx
|
|
364
363
|
function Performance() {
|
|
365
364
|
const tabs = useMemo(
|
|
366
365
|
() => [
|
|
@@ -557,7 +556,7 @@ By default, charts will not track gestures that go outside of the chart bounds.
|
|
|
557
556
|
|
|
558
557
|
You can configure chart transitions using `transition` on LineChart and `beaconTransitions` on [Scrubber](/components/graphs/Scrubber). You can also disable animations by setting the `animate` on LineChart to `false`.
|
|
559
558
|
|
|
560
|
-
```
|
|
559
|
+
```tsx
|
|
561
560
|
function Transitions() {
|
|
562
561
|
const theme = useTheme();
|
|
563
562
|
const dataCount = 20;
|
|
@@ -698,7 +697,7 @@ function Transitions() {
|
|
|
698
697
|
|
|
699
698
|
You can use `accessibilityLabel` on the chart to provide a descriptive label.
|
|
700
699
|
|
|
701
|
-
```
|
|
700
|
+
```tsx
|
|
702
701
|
function BasicAccessible() {
|
|
703
702
|
const [scrubberPosition, setScrubberPosition] = useState<number | undefined>();
|
|
704
703
|
const data = useMemo(() => [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58], []);
|
|
@@ -754,7 +753,7 @@ function BasicAccessible() {
|
|
|
754
753
|
|
|
755
754
|
Using `showXAxis` and `showYAxis` allows you to display the axes. For more information, such as adjusting domain and range, see [XAxis](/components/graphs/XAxis) and [YAxis](/components/graphs/YAxis).
|
|
756
755
|
|
|
757
|
-
```
|
|
756
|
+
```tsx
|
|
758
757
|
<LineChart
|
|
759
758
|
showArea
|
|
760
759
|
showXAxis
|
|
@@ -820,7 +819,7 @@ Gradients can be applied to the y-axis (default) or x-axis. Each stop requires a
|
|
|
820
819
|
|
|
821
820
|
Values in between stops will be interpolated smoothly using [srgb color space](https://www.w3.org/TR/SVG11/painting.html#ColorInterpolationProperty).
|
|
822
821
|
|
|
823
|
-
```
|
|
822
|
+
```tsx
|
|
824
823
|
function Gradients() {
|
|
825
824
|
const theme = useTheme();
|
|
826
825
|
const spectrumColors: ThemeVars.SpectrumHue[] = [
|
|
@@ -937,7 +936,7 @@ function Gradients() {
|
|
|
937
936
|
|
|
938
937
|
You can even pass in a separate gradient for your `Line` and `Area` components.
|
|
939
938
|
|
|
940
|
-
```
|
|
939
|
+
```tsx
|
|
941
940
|
function GainLossChart() {
|
|
942
941
|
const theme = useTheme();
|
|
943
942
|
const data = useMemo(() => [-40, -28, -21, -5, 48, -5, -28, 2, -29, -46, 16, -30, -29, 8], []);
|
|
@@ -1005,7 +1004,7 @@ Using `legend` will add a default [Legend](/components/graphs/Legend) to your ch
|
|
|
1005
1004
|
|
|
1006
1005
|
You can use `legendPosition` to place the legend at different positions around the chart.
|
|
1007
1006
|
|
|
1008
|
-
```
|
|
1007
|
+
```tsx
|
|
1009
1008
|
<LineChart
|
|
1010
1009
|
legend
|
|
1011
1010
|
showArea
|
|
@@ -1035,7 +1034,8 @@ You can use `legendPosition` to place the legend at different positions around t
|
|
|
1035
1034
|
}}
|
|
1036
1035
|
yAxis={{
|
|
1037
1036
|
showGrid: true,
|
|
1038
|
-
tickLabelFormatter: (value: number) =>
|
|
1037
|
+
tickLabelFormatter: (value: number) =>
|
|
1038
|
+
new Intl.NumberFormat('en-US', { maximumFractionDigits: 0 }).format(value),
|
|
1039
1039
|
}}
|
|
1040
1040
|
/>
|
|
1041
1041
|
```
|
|
@@ -1116,7 +1116,7 @@ You can also add instances of [ReferenceLine](/components/graphs/ReferenceLine)
|
|
|
1116
1116
|
|
|
1117
1117
|
You can also add instances of [Point](/components/graphs/Point) directly inside of a LineChart.
|
|
1118
1118
|
|
|
1119
|
-
```
|
|
1119
|
+
```tsx
|
|
1120
1120
|
function HighLowPrice() {
|
|
1121
1121
|
const data = [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58];
|
|
1122
1122
|
const minPrice = Math.min(...data);
|
|
@@ -1168,7 +1168,7 @@ You can customize the line used for and which series will render a scrubber beac
|
|
|
1168
1168
|
|
|
1169
1169
|
You can have scrubber beacon's pulse by either adding `idlePulse` to Scrubber or use Scrubber's ref to dynamically pulse.
|
|
1170
1170
|
|
|
1171
|
-
```
|
|
1171
|
+
```tsx
|
|
1172
1172
|
function StylingScrubber() {
|
|
1173
1173
|
const theme = useTheme();
|
|
1174
1174
|
const pages = ['Page A', 'Page B', 'Page C', 'Page D', 'Page E', 'Page F', 'Page G'];
|
|
@@ -1227,7 +1227,7 @@ Charts by default take up `100%` of the `width` and `height` available, but can
|
|
|
1227
1227
|
|
|
1228
1228
|
You can also have charts in a compact form.
|
|
1229
1229
|
|
|
1230
|
-
```
|
|
1230
|
+
```tsx
|
|
1231
1231
|
function Compact() {
|
|
1232
1232
|
const theme = useTheme();
|
|
1233
1233
|
const dimensions = { width: 62, height: 18 };
|
|
@@ -1338,7 +1338,7 @@ function Compact() {
|
|
|
1338
1338
|
|
|
1339
1339
|
You can use [PeriodSelector](/components/graphs/PeriodSelector) to have a chart where the user can select a time period and the chart automatically animates.
|
|
1340
1340
|
|
|
1341
|
-
```
|
|
1341
|
+
```tsx
|
|
1342
1342
|
function AssetPriceWithDottedArea() {
|
|
1343
1343
|
const fontMgr = useMemo(() => {
|
|
1344
1344
|
const fontProvider = Skia.TypefaceFontProvider.Make();
|
|
@@ -1533,7 +1533,7 @@ function AssetPriceWithDottedArea() {
|
|
|
1533
1533
|
|
|
1534
1534
|
You can adjust [YAxis](/components/graphs/YAxis) and [Scrubber](/components/graphs/Scrubber) to have a chart where the y-axis is overlaid and the beacon is inverted in style.
|
|
1535
1535
|
|
|
1536
|
-
```
|
|
1536
|
+
```tsx
|
|
1537
1537
|
function MonotoneAssetPrice() {
|
|
1538
1538
|
const theme = useTheme();
|
|
1539
1539
|
const prices = sparklineInteractiveData.hour;
|
|
@@ -1775,7 +1775,7 @@ function ServiceAvailability() {
|
|
|
1775
1775
|
|
|
1776
1776
|
You can combine multiple lines within a series to change styles dynamically.
|
|
1777
1777
|
|
|
1778
|
-
```
|
|
1778
|
+
```tsx
|
|
1779
1779
|
function ForecastAssetPrice() {
|
|
1780
1780
|
const startYear = 2020;
|
|
1781
1781
|
const data = [50, 45, 47, 46, 54, 54, 60, 61, 63, 66, 70];
|
|
@@ -87,7 +87,12 @@ Use `mediaPlacement` to control the position of media content.
|
|
|
87
87
|
|
|
88
88
|
### Upsell Card Styles
|
|
89
89
|
|
|
90
|
-
MessagingCard with `type="upsell"` supports various background colors to match different promotional purposes. Use the `background` prop for semantic tokens
|
|
90
|
+
MessagingCard with `type="upsell"` supports various background colors to match different promotional purposes. Use the `background` prop for semantic tokens.
|
|
91
|
+
|
|
92
|
+
For **custom background colors**, use the recommended approach:
|
|
93
|
+
|
|
94
|
+
- **Non-interactive cards** (`renderAsPressable={false}` or omitted): set the background via `styles.root` (e.g. `styles={{ root: { backgroundColor: 'rgb(...)' } }}`).
|
|
95
|
+
- **Interactive cards** (`renderAsPressable` with `onPress`): set the background via `blendStyles.background` (e.g. `blendStyles={{ background: 'rgb(...)' }}`) so press states are handled correctly.
|
|
91
96
|
|
|
92
97
|
#### General Upsell
|
|
93
98
|
|
|
@@ -152,7 +157,7 @@ function FeatureUpsell() {
|
|
|
152
157
|
<MessagingCard
|
|
153
158
|
key={i}
|
|
154
159
|
type="upsell"
|
|
155
|
-
|
|
160
|
+
styles={{ root: { backgroundColor: card.bg } }}
|
|
156
161
|
title={
|
|
157
162
|
<Text color="fgInverse" font="headline">
|
|
158
163
|
Up to 3.29% APR on ETH
|
|
@@ -194,7 +199,7 @@ function CommunityUpsell() {
|
|
|
194
199
|
<MessagingCard
|
|
195
200
|
key={i}
|
|
196
201
|
type="upsell"
|
|
197
|
-
|
|
202
|
+
styles={{ root: { backgroundColor: card.bg } }}
|
|
198
203
|
title={
|
|
199
204
|
<Text color="fgInverse" font="headline">
|
|
200
205
|
Join the community
|
|
@@ -256,7 +261,7 @@ function ProductUpsell() {
|
|
|
256
261
|
<MessagingCard
|
|
257
262
|
key={card.title}
|
|
258
263
|
type="upsell"
|
|
259
|
-
|
|
264
|
+
styles={{ root: { backgroundColor: card.bg } }}
|
|
260
265
|
title={
|
|
261
266
|
<Text color="fgInverse" font="headline">
|
|
262
267
|
{card.title}
|
|
@@ -303,7 +308,7 @@ function NewsUpsell() {
|
|
|
303
308
|
<MessagingCard
|
|
304
309
|
key={i}
|
|
305
310
|
type="upsell"
|
|
306
|
-
|
|
311
|
+
styles={{ root: { backgroundColor: card.bg } }}
|
|
307
312
|
title={
|
|
308
313
|
<Text color="fgInverse" font="headline">
|
|
309
314
|
Help defend crypto in America
|
|
@@ -378,7 +383,7 @@ function DismissibleCards() {
|
|
|
378
383
|
<VStack gap={2}>
|
|
379
384
|
<MessagingCard
|
|
380
385
|
type="upsell"
|
|
381
|
-
|
|
386
|
+
styles={{ root: { backgroundColor: `rgb(${spectrum.teal70})` } }}
|
|
382
387
|
title="Dismissible Upsell"
|
|
383
388
|
description="Upsell card with dismiss button"
|
|
384
389
|
width={320}
|
|
@@ -578,8 +583,10 @@ function DismissibleCardsList() {
|
|
|
578
583
|
<MessagingCard
|
|
579
584
|
key={card.id}
|
|
580
585
|
type={card.type}
|
|
581
|
-
|
|
582
|
-
card.type === 'upsell'
|
|
586
|
+
styles={
|
|
587
|
+
card.type === 'upsell'
|
|
588
|
+
? { root: { backgroundColor: `rgb(${spectrum.gray100})` } }
|
|
589
|
+
: undefined
|
|
583
590
|
}
|
|
584
591
|
title={card.title}
|
|
585
592
|
description={card.description}
|
|
@@ -629,7 +636,7 @@ function InteractiveCards() {
|
|
|
629
636
|
renderAsPressable
|
|
630
637
|
onPress={() => console.log('Card pressed!')}
|
|
631
638
|
type="upsell"
|
|
632
|
-
|
|
639
|
+
blendStyles={{ background: `rgb(${spectrum.teal70})` }}
|
|
633
640
|
title="Interactive Upsell"
|
|
634
641
|
description="Tap to interact"
|
|
635
642
|
width={320}
|
|
@@ -757,7 +764,7 @@ function MultipleCards() {
|
|
|
757
764
|
renderAsPressable
|
|
758
765
|
onPress={() => console.log('clicked')}
|
|
759
766
|
type="upsell"
|
|
760
|
-
|
|
767
|
+
blendStyles={{ background: `rgb(${spectrum.purple70})` }}
|
|
761
768
|
title="Card 3"
|
|
762
769
|
description="Card with onPress handler"
|
|
763
770
|
tag="Action"
|
|
@@ -832,7 +839,7 @@ When you need both `onDismissButtonPress` and want the entire card to be pressab
|
|
|
832
839
|
|
|
833
840
|
#### Color Contrast
|
|
834
841
|
|
|
835
|
-
MessagingCard supports custom backgrounds via `background` and `
|
|
842
|
+
MessagingCard supports custom backgrounds via the `background` prop and, for custom colors, `styles.root` (non-interactive) or `blendStyles.background` (interactive). When using custom background colors, ensure sufficient color contrast between text and background:
|
|
836
843
|
|
|
837
844
|
- Use `fgInverse` text color with dark backgrounds (e.g., `accentBoldPurple`, `bgInverse`)
|
|
838
845
|
- Use `fg` text color with light backgrounds (e.g., `bgPrimaryWash`, `bgAlternate`)
|
|
@@ -25,7 +25,7 @@ Primary use case for this is when a user is inputing a PIN code. Notice it does
|
|
|
25
25
|
alt="Pin Numpad"
|
|
26
26
|
/>
|
|
27
27
|
|
|
28
|
-
```
|
|
28
|
+
```tsx
|
|
29
29
|
const PinNumpadExample = () => {
|
|
30
30
|
// localState
|
|
31
31
|
const [visible, { toggleOn, toggleOff }] = useToggler(false);
|
|
@@ -100,7 +100,7 @@ Best when used in the context of a transactional scenario. This could range from
|
|
|
100
100
|
alt="Transactional Numpad"
|
|
101
101
|
/>
|
|
102
102
|
|
|
103
|
-
```
|
|
103
|
+
```tsx
|
|
104
104
|
const VALUE_MAX = 1000000;
|
|
105
105
|
const TransactionalNumpadExample = () => {
|
|
106
106
|
const [visible, { toggleOn, toggleOff }] = useToggler(false);
|
|
@@ -81,7 +81,7 @@ function MyChart() {
|
|
|
81
81
|
|
|
82
82
|
You can conditionally render points to highlight specific values in your data, such as maximum/minimum values or outliers.
|
|
83
83
|
|
|
84
|
-
```
|
|
84
|
+
```tsx
|
|
85
85
|
function AssetPriceWithMinMax() {
|
|
86
86
|
const data = sparklineInteractiveData.hour.map((d) => d.value);
|
|
87
87
|
|
|
@@ -121,7 +121,7 @@ function AssetPriceWithMinMax() {
|
|
|
121
121
|
]}
|
|
122
122
|
/>
|
|
123
123
|
);
|
|
124
|
-
}
|
|
124
|
+
}
|
|
125
125
|
```
|
|
126
126
|
|
|
127
127
|
### Styling
|