@coinbase/cds-mobile-visualization 3.8.1 → 4.0.0
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/dts/chart/index.d.ts +1 -15
- package/dts/chart/index.d.ts.map +1 -1
- package/dts/index.d.ts.map +1 -1
- package/dts/sparkline/index.d.ts +1 -5
- package/dts/sparkline/index.d.ts.map +1 -1
- package/esm/chart/index.js +1 -17
- package/esm/index.js +1 -3
- package/esm/sparkline/index.js +1 -5
- package/package.json +26 -20
- package/dts/chart/CartesianChart.d.ts +0 -206
- package/dts/chart/CartesianChart.d.ts.map +0 -1
- package/dts/chart/ChartContextBridge.d.ts +0 -28
- package/dts/chart/ChartContextBridge.d.ts.map +0 -1
- package/dts/chart/ChartProvider.d.ts +0 -9
- package/dts/chart/ChartProvider.d.ts.map +0 -1
- package/dts/chart/Path.d.ts +0 -121
- package/dts/chart/Path.d.ts.map +0 -1
- package/dts/chart/PeriodSelector.d.ts +0 -100
- package/dts/chart/PeriodSelector.d.ts.map +0 -1
- package/dts/chart/area/Area.d.ts +0 -83
- package/dts/chart/area/Area.d.ts.map +0 -1
- package/dts/chart/area/AreaChart.d.ts +0 -155
- package/dts/chart/area/AreaChart.d.ts.map +0 -1
- package/dts/chart/area/DottedArea.d.ts +0 -46
- package/dts/chart/area/DottedArea.d.ts.map +0 -1
- package/dts/chart/area/GradientArea.d.ts +0 -36
- package/dts/chart/area/GradientArea.d.ts.map +0 -1
- package/dts/chart/area/SolidArea.d.ts +0 -23
- package/dts/chart/area/SolidArea.d.ts.map +0 -1
- package/dts/chart/area/index.d.ts +0 -6
- package/dts/chart/area/index.d.ts.map +0 -1
- package/dts/chart/axis/Axis.d.ts +0 -174
- package/dts/chart/axis/Axis.d.ts.map +0 -1
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts +0 -8
- package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +0 -1
- package/dts/chart/axis/XAxis.d.ts +0 -22
- package/dts/chart/axis/XAxis.d.ts.map +0 -1
- package/dts/chart/axis/YAxis.d.ts +0 -22
- package/dts/chart/axis/YAxis.d.ts.map +0 -1
- package/dts/chart/axis/index.d.ts +0 -5
- package/dts/chart/axis/index.d.ts.map +0 -1
- package/dts/chart/bar/Bar.d.ts +0 -100
- package/dts/chart/bar/Bar.d.ts.map +0 -1
- package/dts/chart/bar/BarChart.d.ts +0 -158
- package/dts/chart/bar/BarChart.d.ts.map +0 -1
- package/dts/chart/bar/BarPlot.d.ts +0 -31
- package/dts/chart/bar/BarPlot.d.ts.map +0 -1
- package/dts/chart/bar/BarStack.d.ts +0 -127
- package/dts/chart/bar/BarStack.d.ts.map +0 -1
- package/dts/chart/bar/BarStackGroup.d.ts +0 -37
- package/dts/chart/bar/BarStackGroup.d.ts.map +0 -1
- package/dts/chart/bar/DefaultBar.d.ts +0 -7
- package/dts/chart/bar/DefaultBar.d.ts.map +0 -1
- package/dts/chart/bar/DefaultBarStack.d.ts +0 -7
- package/dts/chart/bar/DefaultBarStack.d.ts.map +0 -1
- package/dts/chart/bar/PercentageBarChart.d.ts +0 -106
- package/dts/chart/bar/PercentageBarChart.d.ts.map +0 -1
- package/dts/chart/bar/index.d.ts +0 -9
- package/dts/chart/bar/index.d.ts.map +0 -1
- package/dts/chart/gradient/Gradient.d.ts +0 -41
- package/dts/chart/gradient/Gradient.d.ts.map +0 -1
- package/dts/chart/gradient/index.d.ts +0 -2
- package/dts/chart/gradient/index.d.ts.map +0 -1
- package/dts/chart/legend/DefaultLegendEntry.d.ts +0 -5
- package/dts/chart/legend/DefaultLegendEntry.d.ts.map +0 -1
- package/dts/chart/legend/DefaultLegendShape.d.ts +0 -5
- package/dts/chart/legend/DefaultLegendShape.d.ts.map +0 -1
- package/dts/chart/legend/Legend.d.ts +0 -168
- package/dts/chart/legend/Legend.d.ts.map +0 -1
- package/dts/chart/legend/index.d.ts +0 -4
- package/dts/chart/legend/index.d.ts.map +0 -1
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts +0 -9
- package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +0 -1
- package/dts/chart/line/DottedLine.d.ts +0 -20
- package/dts/chart/line/DottedLine.d.ts.map +0 -1
- package/dts/chart/line/Line.d.ts +0 -122
- package/dts/chart/line/Line.d.ts.map +0 -1
- package/dts/chart/line/LineChart.d.ts +0 -135
- package/dts/chart/line/LineChart.d.ts.map +0 -1
- package/dts/chart/line/ReferenceLine.d.ts +0 -140
- package/dts/chart/line/ReferenceLine.d.ts.map +0 -1
- package/dts/chart/line/SolidLine.d.ts +0 -15
- package/dts/chart/line/SolidLine.d.ts.map +0 -1
- package/dts/chart/line/index.d.ts +0 -7
- package/dts/chart/line/index.d.ts.map +0 -1
- package/dts/chart/point/DefaultPointLabel.d.ts +0 -10
- package/dts/chart/point/DefaultPointLabel.d.ts.map +0 -1
- package/dts/chart/point/Point.d.ts +0 -144
- package/dts/chart/point/Point.d.ts.map +0 -1
- package/dts/chart/point/index.d.ts +0 -3
- package/dts/chart/point/index.d.ts.map +0 -1
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +0 -38
- package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +0 -1
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +0 -12
- package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +0 -1
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +0 -12
- package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +0 -1
- package/dts/chart/scrubber/Scrubber.d.ts +0 -302
- package/dts/chart/scrubber/Scrubber.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberAccessibilityView.d.ts +0 -12
- package/dts/chart/scrubber/ScrubberAccessibilityView.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +0 -54
- package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +0 -46
- package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +0 -1
- package/dts/chart/scrubber/ScrubberProvider.d.ts +0 -20
- package/dts/chart/scrubber/ScrubberProvider.d.ts.map +0 -1
- package/dts/chart/scrubber/index.d.ts +0 -5
- package/dts/chart/scrubber/index.d.ts.map +0 -1
- package/dts/chart/text/ChartText.d.ts +0 -164
- package/dts/chart/text/ChartText.d.ts.map +0 -1
- package/dts/chart/text/ChartTextGroup.d.ts +0 -61
- package/dts/chart/text/ChartTextGroup.d.ts.map +0 -1
- package/dts/chart/text/index.d.ts +0 -3
- package/dts/chart/text/index.d.ts.map +0 -1
- package/dts/chart/utils/axis.d.ts +0 -387
- package/dts/chart/utils/axis.d.ts.map +0 -1
- package/dts/chart/utils/bar.d.ts +0 -225
- package/dts/chart/utils/bar.d.ts.map +0 -1
- package/dts/chart/utils/chart.d.ts +0 -165
- package/dts/chart/utils/chart.d.ts.map +0 -1
- package/dts/chart/utils/context.d.ts +0 -131
- package/dts/chart/utils/context.d.ts.map +0 -1
- package/dts/chart/utils/gradient.d.ts +0 -129
- package/dts/chart/utils/gradient.d.ts.map +0 -1
- package/dts/chart/utils/index.d.ts +0 -11
- package/dts/chart/utils/index.d.ts.map +0 -1
- package/dts/chart/utils/path.d.ts +0 -186
- package/dts/chart/utils/path.d.ts.map +0 -1
- package/dts/chart/utils/point.d.ts +0 -146
- package/dts/chart/utils/point.d.ts.map +0 -1
- package/dts/chart/utils/scale.d.ts +0 -145
- package/dts/chart/utils/scale.d.ts.map +0 -1
- package/dts/chart/utils/scrubber.d.ts +0 -40
- package/dts/chart/utils/scrubber.d.ts.map +0 -1
- package/dts/chart/utils/transition.d.ts +0 -181
- package/dts/chart/utils/transition.d.ts.map +0 -1
- package/dts/sparkline/Counter.d.ts +0 -8
- package/dts/sparkline/Counter.d.ts.map +0 -1
- package/dts/sparkline/Sparkline.d.ts +0 -74
- package/dts/sparkline/Sparkline.d.ts.map +0 -1
- package/dts/sparkline/SparklineArea.d.ts +0 -15
- package/dts/sparkline/SparklineArea.d.ts.map +0 -1
- package/dts/sparkline/SparklineAreaPattern.d.ts +0 -14
- package/dts/sparkline/SparklineAreaPattern.d.ts.map +0 -1
- package/dts/sparkline/SparklineGradient.d.ts +0 -24
- package/dts/sparkline/SparklineGradient.d.ts.map +0 -1
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts +0 -2
- package/dts/sparkline/__figma__/Sparkline.figma.d.ts.map +0 -1
- package/dts/sparkline/generateSparklineWithId.d.ts +0 -11
- package/dts/sparkline/generateSparklineWithId.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts +0 -23
- package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +0 -185
- package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +0 -25
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +0 -28
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +0 -13
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +0 -17
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts +0 -11
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts +0 -26
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +0 -25
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +0 -25
- package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +0 -39
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts +0 -31
- package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts +0 -13
- package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts +0 -16
- package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts +0 -6
- package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +0 -22
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts +0 -34
- package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +0 -118
- package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +0 -2
- package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts.map +0 -1
- package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts +0 -29
- package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts.map +0 -1
- package/esm/chart/CartesianChart.js +0 -431
- package/esm/chart/ChartContextBridge.js +0 -159
- package/esm/chart/ChartProvider.js +0 -10
- package/esm/chart/Path.js +0 -255
- package/esm/chart/PeriodSelector.js +0 -139
- package/esm/chart/__stories__/CartesianChart.stories.js +0 -659
- package/esm/chart/__stories__/ChartAccessibility.stories.js +0 -721
- package/esm/chart/__stories__/ChartTransitions.stories.js +0 -693
- package/esm/chart/__stories__/PeriodSelector.stories.js +0 -420
- package/esm/chart/area/Area.js +0 -85
- package/esm/chart/area/AreaChart.js +0 -152
- package/esm/chart/area/DottedArea.js +0 -92
- package/esm/chart/area/GradientArea.js +0 -63
- package/esm/chart/area/SolidArea.js +0 -45
- package/esm/chart/area/__stories__/AreaChart.stories.js +0 -370
- package/esm/chart/area/index.js +0 -7
- package/esm/chart/axis/Axis.js +0 -9
- package/esm/chart/axis/DefaultAxisTickLabel.js +0 -11
- package/esm/chart/axis/XAxis.js +0 -256
- package/esm/chart/axis/YAxis.js +0 -255
- package/esm/chart/axis/__stories__/Axis.stories.js +0 -552
- package/esm/chart/axis/index.js +0 -6
- package/esm/chart/bar/Bar.js +0 -71
- package/esm/chart/bar/BarChart.js +0 -122
- package/esm/chart/bar/BarPlot.js +0 -106
- package/esm/chart/bar/BarStack.js +0 -173
- package/esm/chart/bar/BarStackGroup.js +0 -89
- package/esm/chart/bar/DefaultBar.js +0 -79
- package/esm/chart/bar/DefaultBarStack.js +0 -68
- package/esm/chart/bar/PercentageBarChart.js +0 -99
- package/esm/chart/bar/__stories__/BarChart.stories.js +0 -1417
- package/esm/chart/bar/__stories__/PercentageBarChart.stories.js +0 -833
- package/esm/chart/bar/index.js +0 -10
- package/esm/chart/gradient/Gradient.js +0 -156
- package/esm/chart/gradient/index.js +0 -1
- package/esm/chart/legend/DefaultLegendEntry.js +0 -42
- package/esm/chart/legend/DefaultLegendShape.js +0 -64
- package/esm/chart/legend/Legend.js +0 -59
- package/esm/chart/legend/__stories__/Legend.stories.js +0 -574
- package/esm/chart/legend/index.js +0 -3
- package/esm/chart/line/DefaultReferenceLineLabel.js +0 -66
- package/esm/chart/line/DottedLine.js +0 -57
- package/esm/chart/line/Line.js +0 -180
- package/esm/chart/line/LineChart.js +0 -149
- package/esm/chart/line/ReferenceLine.js +0 -132
- package/esm/chart/line/SolidLine.js +0 -53
- package/esm/chart/line/__stories__/LineChart.stories.js +0 -2018
- package/esm/chart/line/__stories__/ReferenceLine.stories.js +0 -226
- package/esm/chart/line/index.js +0 -8
- package/esm/chart/point/DefaultPointLabel.js +0 -39
- package/esm/chart/point/Point.js +0 -187
- package/esm/chart/point/index.js +0 -2
- package/esm/chart/scrubber/DefaultScrubberBeacon.js +0 -182
- package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +0 -43
- package/esm/chart/scrubber/DefaultScrubberLabel.js +0 -44
- package/esm/chart/scrubber/Scrubber.js +0 -198
- package/esm/chart/scrubber/ScrubberAccessibilityView.js +0 -177
- package/esm/chart/scrubber/ScrubberBeaconGroup.js +0 -169
- package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +0 -212
- package/esm/chart/scrubber/ScrubberProvider.js +0 -140
- package/esm/chart/scrubber/__stories__/Scrubber.stories.js +0 -946
- package/esm/chart/scrubber/index.js +0 -4
- package/esm/chart/text/ChartText.js +0 -305
- package/esm/chart/text/ChartTextGroup.js +0 -211
- package/esm/chart/text/index.js +0 -4
- package/esm/chart/utils/axis.js +0 -664
- package/esm/chart/utils/bar.js +0 -906
- package/esm/chart/utils/chart.js +0 -329
- package/esm/chart/utils/context.js +0 -22
- package/esm/chart/utils/gradient.js +0 -319
- package/esm/chart/utils/index.js +0 -12
- package/esm/chart/utils/path.js +0 -304
- package/esm/chart/utils/point.js +0 -282
- package/esm/chart/utils/scale.js +0 -288
- package/esm/chart/utils/scrubber.js +0 -146
- package/esm/chart/utils/transition.js +0 -241
- package/esm/sparkline/Counter.js +0 -45
- package/esm/sparkline/Sparkline.js +0 -165
- package/esm/sparkline/SparklineArea.js +0 -20
- package/esm/sparkline/SparklineAreaPattern.js +0 -38
- package/esm/sparkline/SparklineGradient.js +0 -77
- package/esm/sparkline/__figma__/Sparkline.figma.js +0 -22
- package/esm/sparkline/__stories__/Sparkline.stories.js +0 -124
- package/esm/sparkline/__stories__/SparklineGradient.stories.js +0 -126
- package/esm/sparkline/generateSparklineWithId.js +0 -7
- package/esm/sparkline/sparkline-interactive/SparklineAccessibleView.js +0 -75
- package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +0 -308
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +0 -116
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.js +0 -131
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.js +0 -99
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +0 -82
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveMinMax.js +0 -103
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.js +0 -104
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +0 -57
- package/esm/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.js +0 -124
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveProvider.js +0 -80
- package/esm/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.js +0 -109
- package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +0 -85
- package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +0 -526
- package/esm/sparkline/sparkline-interactive/useInterruptiblePathAnimation.js +0 -58
- package/esm/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.js +0 -37
- package/esm/sparkline/sparkline-interactive/useMinMaxTransform.js +0 -56
- package/esm/sparkline/sparkline-interactive/useOpacityAnimation.js +0 -23
- package/esm/sparkline/sparkline-interactive/useSparklineInteractiveConstants.js +0 -47
- package/esm/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.js +0 -34
- package/esm/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.js +0 -233
- package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +0 -104
- package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +0 -565
- package/esm/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.js +0 -117
|
@@ -1,693 +0,0 @@
|
|
|
1
|
-
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
-
import { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
-
import { useTheme } from '@coinbase/cds-mobile';
|
|
4
|
-
import { Button } from '@coinbase/cds-mobile/buttons/Button';
|
|
5
|
-
import { IconButton } from '@coinbase/cds-mobile/buttons/IconButton';
|
|
6
|
-
import { ExampleScreen } from '@coinbase/cds-mobile/examples/ExampleScreen';
|
|
7
|
-
import { Box, HStack, VStack } from '@coinbase/cds-mobile/layout';
|
|
8
|
-
import { Text } from '@coinbase/cds-mobile/typography';
|
|
9
|
-
import { AreaChart } from '../area/AreaChart';
|
|
10
|
-
import { BarChart } from '../bar/BarChart';
|
|
11
|
-
import { CartesianChart } from '../CartesianChart';
|
|
12
|
-
import { Line } from '../line/Line';
|
|
13
|
-
import { Scrubber } from '../scrubber';
|
|
14
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
|
-
const dataCount = 15;
|
|
16
|
-
const updateInterval = 2500;
|
|
17
|
-
const rapidUpdateInterval = 800;
|
|
18
|
-
function generateNextValue(previousValue) {
|
|
19
|
-
const step = Math.random() * 30 - 15;
|
|
20
|
-
return Math.max(0, Math.min(100, previousValue + step));
|
|
21
|
-
}
|
|
22
|
-
function generateInitialData() {
|
|
23
|
-
const data = [50];
|
|
24
|
-
for (let i = 1; i < dataCount; i++) {
|
|
25
|
-
data.push(generateNextValue(data[i - 1]));
|
|
26
|
-
}
|
|
27
|
-
return data;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Transition presets
|
|
31
|
-
const enterOnly = {
|
|
32
|
-
update: null
|
|
33
|
-
};
|
|
34
|
-
const updateOnly = {
|
|
35
|
-
enter: null
|
|
36
|
-
};
|
|
37
|
-
const bothDisabled = {
|
|
38
|
-
enter: null,
|
|
39
|
-
update: null
|
|
40
|
-
};
|
|
41
|
-
const customEnterUpdate = {
|
|
42
|
-
enter: {
|
|
43
|
-
type: 'timing',
|
|
44
|
-
duration: 1500
|
|
45
|
-
},
|
|
46
|
-
update: {
|
|
47
|
-
type: 'spring',
|
|
48
|
-
stiffness: 400,
|
|
49
|
-
damping: 30
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
const customEnterUpdateBeacon = {
|
|
53
|
-
enter: {
|
|
54
|
-
type: 'timing',
|
|
55
|
-
duration: 500,
|
|
56
|
-
delay: 1000
|
|
57
|
-
},
|
|
58
|
-
update: {
|
|
59
|
-
type: 'spring',
|
|
60
|
-
stiffness: 400,
|
|
61
|
-
damping: 30
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const slowSpringBoth = {
|
|
65
|
-
enter: {
|
|
66
|
-
type: 'spring',
|
|
67
|
-
stiffness: 100,
|
|
68
|
-
damping: 10
|
|
69
|
-
},
|
|
70
|
-
update: {
|
|
71
|
-
type: 'spring',
|
|
72
|
-
stiffness: 100,
|
|
73
|
-
damping: 10
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const staggeredBoth = {
|
|
77
|
-
enter: {
|
|
78
|
-
type: 'timing',
|
|
79
|
-
duration: 750,
|
|
80
|
-
staggerDelay: 250
|
|
81
|
-
},
|
|
82
|
-
update: {
|
|
83
|
-
type: 'spring',
|
|
84
|
-
stiffness: 300,
|
|
85
|
-
damping: 20,
|
|
86
|
-
staggerDelay: 150
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
const slowTimingBoth = {
|
|
90
|
-
enter: {
|
|
91
|
-
type: 'timing',
|
|
92
|
-
duration: 2000
|
|
93
|
-
},
|
|
94
|
-
update: {
|
|
95
|
-
type: 'timing',
|
|
96
|
-
duration: 2000
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
// --- Reusable Chart Components ---
|
|
101
|
-
|
|
102
|
-
const TransitionLineChart = /*#__PURE__*/memo(_ref => {
|
|
103
|
-
let {
|
|
104
|
-
data,
|
|
105
|
-
transitions,
|
|
106
|
-
scrubberTransitions,
|
|
107
|
-
animate: animateProp,
|
|
108
|
-
idlePulse,
|
|
109
|
-
scrubberRef,
|
|
110
|
-
enableScrubbing = true,
|
|
111
|
-
points
|
|
112
|
-
} = _ref;
|
|
113
|
-
return /*#__PURE__*/_jsxs(CartesianChart, {
|
|
114
|
-
animate: animateProp,
|
|
115
|
-
enableScrubbing: enableScrubbing,
|
|
116
|
-
height: 200,
|
|
117
|
-
inset: {
|
|
118
|
-
top: 16,
|
|
119
|
-
bottom: 16,
|
|
120
|
-
left: 16,
|
|
121
|
-
right: 16
|
|
122
|
-
},
|
|
123
|
-
series: [{
|
|
124
|
-
id: 'values',
|
|
125
|
-
data
|
|
126
|
-
}],
|
|
127
|
-
children: [/*#__PURE__*/_jsx(Line, {
|
|
128
|
-
points: points,
|
|
129
|
-
seriesId: "values",
|
|
130
|
-
strokeWidth: 3,
|
|
131
|
-
transitions: transitions
|
|
132
|
-
}), enableScrubbing && /*#__PURE__*/_jsx(Scrubber, {
|
|
133
|
-
ref: scrubberRef,
|
|
134
|
-
hideOverlay: true,
|
|
135
|
-
idlePulse: idlePulse,
|
|
136
|
-
transitions: scrubberTransitions != null ? scrubberTransitions : transitions
|
|
137
|
-
})]
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
const TransitionAreaChart = /*#__PURE__*/memo(_ref2 => {
|
|
141
|
-
let {
|
|
142
|
-
data,
|
|
143
|
-
transitions,
|
|
144
|
-
idlePulse,
|
|
145
|
-
scrubberRef
|
|
146
|
-
} = _ref2;
|
|
147
|
-
return /*#__PURE__*/_jsx(AreaChart, {
|
|
148
|
-
enableScrubbing: true,
|
|
149
|
-
showLines: true,
|
|
150
|
-
height: 200,
|
|
151
|
-
inset: {
|
|
152
|
-
top: 16,
|
|
153
|
-
bottom: 16,
|
|
154
|
-
left: 16,
|
|
155
|
-
right: 16
|
|
156
|
-
},
|
|
157
|
-
series: [{
|
|
158
|
-
id: 'values',
|
|
159
|
-
data
|
|
160
|
-
}],
|
|
161
|
-
transitions: transitions,
|
|
162
|
-
children: /*#__PURE__*/_jsx(Scrubber, {
|
|
163
|
-
ref: scrubberRef,
|
|
164
|
-
hideOverlay: true,
|
|
165
|
-
idlePulse: idlePulse,
|
|
166
|
-
transitions: transitions
|
|
167
|
-
})
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
const MultiLineChart = /*#__PURE__*/memo(_ref3 => {
|
|
171
|
-
let {
|
|
172
|
-
data1,
|
|
173
|
-
data2,
|
|
174
|
-
transitions
|
|
175
|
-
} = _ref3;
|
|
176
|
-
return /*#__PURE__*/_jsxs(CartesianChart, {
|
|
177
|
-
enableScrubbing: true,
|
|
178
|
-
height: 200,
|
|
179
|
-
inset: {
|
|
180
|
-
top: 16,
|
|
181
|
-
bottom: 16,
|
|
182
|
-
left: 16,
|
|
183
|
-
right: 16
|
|
184
|
-
},
|
|
185
|
-
series: [{
|
|
186
|
-
id: 'series1',
|
|
187
|
-
data: data1,
|
|
188
|
-
label: 'Series 1'
|
|
189
|
-
}, {
|
|
190
|
-
id: 'series2',
|
|
191
|
-
data: data2,
|
|
192
|
-
label: 'Series 2'
|
|
193
|
-
}],
|
|
194
|
-
children: [/*#__PURE__*/_jsx(Line, {
|
|
195
|
-
seriesId: "series1",
|
|
196
|
-
strokeWidth: 3,
|
|
197
|
-
transitions: transitions
|
|
198
|
-
}), /*#__PURE__*/_jsx(Line, {
|
|
199
|
-
seriesId: "series2",
|
|
200
|
-
strokeWidth: 3,
|
|
201
|
-
transitions: transitions
|
|
202
|
-
}), /*#__PURE__*/_jsx(Scrubber, {
|
|
203
|
-
hideOverlay: true,
|
|
204
|
-
idlePulse: true,
|
|
205
|
-
transitions: transitions
|
|
206
|
-
})]
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
|
|
210
|
-
// --- Self-contained Example Wrappers ---
|
|
211
|
-
|
|
212
|
-
function LineExample(_ref4) {
|
|
213
|
-
let {
|
|
214
|
-
transitions,
|
|
215
|
-
scrubberTransitions,
|
|
216
|
-
pointTransitions,
|
|
217
|
-
animate,
|
|
218
|
-
idlePulse,
|
|
219
|
-
resettable = true,
|
|
220
|
-
imperative = false,
|
|
221
|
-
points
|
|
222
|
-
} = _ref4;
|
|
223
|
-
const scrubberRef = useRef(null);
|
|
224
|
-
const [data, setData] = useState(generateInitialData);
|
|
225
|
-
const [resetKey, setResetKey] = useState(0);
|
|
226
|
-
const handleReset = useCallback(() => setResetKey(k => k + 1), []);
|
|
227
|
-
useEffect(() => {
|
|
228
|
-
const intervalId = setInterval(() => {
|
|
229
|
-
var _scrubberRef$current;
|
|
230
|
-
setData(current => {
|
|
231
|
-
const last = current[current.length - 1];
|
|
232
|
-
return [...current.slice(1), generateNextValue(last)];
|
|
233
|
-
});
|
|
234
|
-
if (imperative) (_scrubberRef$current = scrubberRef.current) == null || _scrubberRef$current.pulse();
|
|
235
|
-
}, updateInterval);
|
|
236
|
-
return () => clearInterval(intervalId);
|
|
237
|
-
}, [imperative]);
|
|
238
|
-
const pointFunction = props => _extends({}, props, {
|
|
239
|
-
transitions: pointTransitions
|
|
240
|
-
});
|
|
241
|
-
const pointProps = points ? pointFunction : false;
|
|
242
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
243
|
-
gap: 2,
|
|
244
|
-
children: [/*#__PURE__*/_jsx(TransitionLineChart, {
|
|
245
|
-
animate: animate,
|
|
246
|
-
data: data,
|
|
247
|
-
idlePulse: idlePulse,
|
|
248
|
-
points: pointProps,
|
|
249
|
-
scrubberRef: imperative ? scrubberRef : undefined,
|
|
250
|
-
scrubberTransitions: scrubberTransitions,
|
|
251
|
-
transitions: transitions
|
|
252
|
-
}, resetKey), resettable && /*#__PURE__*/_jsx(Box, {
|
|
253
|
-
paddingX: 2,
|
|
254
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
255
|
-
compact: true,
|
|
256
|
-
onPress: handleReset,
|
|
257
|
-
variant: "secondary",
|
|
258
|
-
children: "Reset"
|
|
259
|
-
})
|
|
260
|
-
})]
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
function AreaExample(_ref5) {
|
|
264
|
-
let {
|
|
265
|
-
transitions,
|
|
266
|
-
idlePulse,
|
|
267
|
-
resettable = true,
|
|
268
|
-
imperative = false
|
|
269
|
-
} = _ref5;
|
|
270
|
-
const scrubberRef = useRef(null);
|
|
271
|
-
const [data, setData] = useState(generateInitialData);
|
|
272
|
-
const [resetKey, setResetKey] = useState(0);
|
|
273
|
-
const handleReset = useCallback(() => setResetKey(k => k + 1), []);
|
|
274
|
-
useEffect(() => {
|
|
275
|
-
const intervalId = setInterval(() => {
|
|
276
|
-
var _scrubberRef$current2;
|
|
277
|
-
setData(current => {
|
|
278
|
-
const last = current[current.length - 1];
|
|
279
|
-
return [...current.slice(1), generateNextValue(last)];
|
|
280
|
-
});
|
|
281
|
-
if (imperative) (_scrubberRef$current2 = scrubberRef.current) == null || _scrubberRef$current2.pulse();
|
|
282
|
-
}, updateInterval);
|
|
283
|
-
return () => clearInterval(intervalId);
|
|
284
|
-
}, [imperative]);
|
|
285
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
286
|
-
gap: 2,
|
|
287
|
-
children: [/*#__PURE__*/_jsx(TransitionAreaChart, {
|
|
288
|
-
data: data,
|
|
289
|
-
idlePulse: idlePulse,
|
|
290
|
-
scrubberRef: imperative ? scrubberRef : undefined,
|
|
291
|
-
transitions: transitions
|
|
292
|
-
}, resetKey), resettable && /*#__PURE__*/_jsx(Box, {
|
|
293
|
-
paddingX: 2,
|
|
294
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
295
|
-
compact: true,
|
|
296
|
-
onPress: handleReset,
|
|
297
|
-
variant: "secondary",
|
|
298
|
-
children: "Reset"
|
|
299
|
-
})
|
|
300
|
-
})]
|
|
301
|
-
});
|
|
302
|
-
}
|
|
303
|
-
function SessionBaselineAreaTransitionsExample() {
|
|
304
|
-
const theme = useTheme();
|
|
305
|
-
const [resetKey, setResetKey] = useState(0);
|
|
306
|
-
const [data, setData] = useState(generateInitialData());
|
|
307
|
-
const handleReset = useCallback(() => {
|
|
308
|
-
setData(generateInitialData());
|
|
309
|
-
setResetKey(k => k + 1);
|
|
310
|
-
}, []);
|
|
311
|
-
useEffect(() => {
|
|
312
|
-
const intervalId = setInterval(() => {
|
|
313
|
-
setData(d => [...d.slice(1), generateNextValue(d[d.length - 1])]);
|
|
314
|
-
}, updateInterval);
|
|
315
|
-
return () => clearInterval(intervalId);
|
|
316
|
-
}, []);
|
|
317
|
-
const baseline = data[0];
|
|
318
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
319
|
-
gap: 2,
|
|
320
|
-
children: [/*#__PURE__*/_jsx(AreaChart, {
|
|
321
|
-
enableScrubbing: true,
|
|
322
|
-
showLines: true,
|
|
323
|
-
height: 200,
|
|
324
|
-
inset: {
|
|
325
|
-
top: 16,
|
|
326
|
-
bottom: 16,
|
|
327
|
-
left: 16,
|
|
328
|
-
right: 16
|
|
329
|
-
},
|
|
330
|
-
series: [{
|
|
331
|
-
id: 'values',
|
|
332
|
-
data,
|
|
333
|
-
type: 'gradient',
|
|
334
|
-
gradient: {
|
|
335
|
-
stops: [{
|
|
336
|
-
offset: baseline,
|
|
337
|
-
color: theme.color.fgNegative
|
|
338
|
-
}, {
|
|
339
|
-
offset: baseline,
|
|
340
|
-
color: theme.color.fgPositive
|
|
341
|
-
}]
|
|
342
|
-
}
|
|
343
|
-
}],
|
|
344
|
-
yAxis: {
|
|
345
|
-
baseline: baseline,
|
|
346
|
-
domain: {
|
|
347
|
-
min: 0,
|
|
348
|
-
max: 100
|
|
349
|
-
}
|
|
350
|
-
},
|
|
351
|
-
children: /*#__PURE__*/_jsx(Scrubber, {
|
|
352
|
-
hideOverlay: true,
|
|
353
|
-
idlePulse: true
|
|
354
|
-
})
|
|
355
|
-
}, resetKey), /*#__PURE__*/_jsx(Box, {
|
|
356
|
-
paddingX: 2,
|
|
357
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
358
|
-
compact: true,
|
|
359
|
-
onPress: handleReset,
|
|
360
|
-
variant: "secondary",
|
|
361
|
-
children: "Reset"
|
|
362
|
-
})
|
|
363
|
-
})]
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
// --- Bar Chart Components ---
|
|
368
|
-
|
|
369
|
-
const barCategories = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'];
|
|
370
|
-
function generateBarData() {
|
|
371
|
-
return barCategories.map(() => Math.round(Math.random() * 80 + 10));
|
|
372
|
-
}
|
|
373
|
-
const barChartProps = {
|
|
374
|
-
showXAxis: true,
|
|
375
|
-
enableScrubbing: true,
|
|
376
|
-
height: 200,
|
|
377
|
-
xAxis: {
|
|
378
|
-
data: barCategories
|
|
379
|
-
},
|
|
380
|
-
yAxis: {
|
|
381
|
-
domain: {
|
|
382
|
-
min: 0,
|
|
383
|
-
max: 100
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
};
|
|
387
|
-
const TransitionBarChart = /*#__PURE__*/memo(_ref6 => {
|
|
388
|
-
let {
|
|
389
|
-
data,
|
|
390
|
-
transitions
|
|
391
|
-
} = _ref6;
|
|
392
|
-
return /*#__PURE__*/_jsx(BarChart, _extends({}, barChartProps, {
|
|
393
|
-
series: [{
|
|
394
|
-
id: 'values',
|
|
395
|
-
data
|
|
396
|
-
}],
|
|
397
|
-
transitions: transitions,
|
|
398
|
-
children: /*#__PURE__*/_jsx(Scrubber, {
|
|
399
|
-
hideOverlay: true,
|
|
400
|
-
seriesIds: [],
|
|
401
|
-
transitions: transitions
|
|
402
|
-
})
|
|
403
|
-
}));
|
|
404
|
-
});
|
|
405
|
-
function BarExample(_ref7) {
|
|
406
|
-
let {
|
|
407
|
-
transitions,
|
|
408
|
-
resettable = true
|
|
409
|
-
} = _ref7;
|
|
410
|
-
const [data, setData] = useState(generateBarData);
|
|
411
|
-
const [resetKey, setResetKey] = useState(0);
|
|
412
|
-
const handleReset = useCallback(() => setResetKey(k => k + 1), []);
|
|
413
|
-
useEffect(() => {
|
|
414
|
-
const intervalId = setInterval(() => {
|
|
415
|
-
setData(generateBarData());
|
|
416
|
-
}, updateInterval);
|
|
417
|
-
return () => clearInterval(intervalId);
|
|
418
|
-
}, []);
|
|
419
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
420
|
-
gap: 2,
|
|
421
|
-
children: [/*#__PURE__*/_jsx(TransitionBarChart, {
|
|
422
|
-
data: data,
|
|
423
|
-
transitions: transitions
|
|
424
|
-
}, resetKey), resettable && /*#__PURE__*/_jsx(Box, {
|
|
425
|
-
paddingX: 2,
|
|
426
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
427
|
-
compact: true,
|
|
428
|
-
onPress: handleReset,
|
|
429
|
-
variant: "secondary",
|
|
430
|
-
children: "Reset"
|
|
431
|
-
})
|
|
432
|
-
})]
|
|
433
|
-
});
|
|
434
|
-
}
|
|
435
|
-
function RapidLineExample(_ref8) {
|
|
436
|
-
let {
|
|
437
|
-
transitions
|
|
438
|
-
} = _ref8;
|
|
439
|
-
const [data, setData] = useState(generateInitialData);
|
|
440
|
-
const [resetKey, setResetKey] = useState(0);
|
|
441
|
-
const handleReset = useCallback(() => setResetKey(k => k + 1), []);
|
|
442
|
-
useEffect(() => {
|
|
443
|
-
const intervalId = setInterval(() => {
|
|
444
|
-
setData(current => {
|
|
445
|
-
const last = current[current.length - 1];
|
|
446
|
-
return [...current.slice(1), generateNextValue(last)];
|
|
447
|
-
});
|
|
448
|
-
}, rapidUpdateInterval);
|
|
449
|
-
return () => clearInterval(intervalId);
|
|
450
|
-
}, []);
|
|
451
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
452
|
-
gap: 2,
|
|
453
|
-
children: [/*#__PURE__*/_jsx(TransitionLineChart, {
|
|
454
|
-
data: data,
|
|
455
|
-
transitions: transitions
|
|
456
|
-
}, resetKey), /*#__PURE__*/_jsx(Box, {
|
|
457
|
-
paddingX: 2,
|
|
458
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
459
|
-
compact: true,
|
|
460
|
-
onPress: handleReset,
|
|
461
|
-
variant: "secondary",
|
|
462
|
-
children: "Reset"
|
|
463
|
-
})
|
|
464
|
-
})]
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
function RapidBarExample(_ref9) {
|
|
468
|
-
let {
|
|
469
|
-
transitions
|
|
470
|
-
} = _ref9;
|
|
471
|
-
const [data, setData] = useState(generateBarData);
|
|
472
|
-
const [resetKey, setResetKey] = useState(0);
|
|
473
|
-
const handleReset = useCallback(() => setResetKey(k => k + 1), []);
|
|
474
|
-
useEffect(() => {
|
|
475
|
-
const intervalId = setInterval(() => {
|
|
476
|
-
setData(generateBarData());
|
|
477
|
-
}, rapidUpdateInterval);
|
|
478
|
-
return () => clearInterval(intervalId);
|
|
479
|
-
}, []);
|
|
480
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
481
|
-
gap: 2,
|
|
482
|
-
children: [/*#__PURE__*/_jsx(TransitionBarChart, {
|
|
483
|
-
data: data,
|
|
484
|
-
transitions: transitions
|
|
485
|
-
}, resetKey), /*#__PURE__*/_jsx(Box, {
|
|
486
|
-
paddingX: 2,
|
|
487
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
488
|
-
compact: true,
|
|
489
|
-
onPress: handleReset,
|
|
490
|
-
variant: "secondary",
|
|
491
|
-
children: "Reset"
|
|
492
|
-
})
|
|
493
|
-
})]
|
|
494
|
-
});
|
|
495
|
-
}
|
|
496
|
-
function MultiLineExample(_ref0) {
|
|
497
|
-
let {
|
|
498
|
-
transitions
|
|
499
|
-
} = _ref0;
|
|
500
|
-
const [data1, setData1] = useState(generateInitialData);
|
|
501
|
-
const [data2, setData2] = useState(generateInitialData);
|
|
502
|
-
const [resetKey, setResetKey] = useState(0);
|
|
503
|
-
const handleReset = useCallback(() => setResetKey(k => k + 1), []);
|
|
504
|
-
useEffect(() => {
|
|
505
|
-
const intervalId = setInterval(() => {
|
|
506
|
-
setData1(current => {
|
|
507
|
-
const last = current[current.length - 1];
|
|
508
|
-
return [...current.slice(1), generateNextValue(last)];
|
|
509
|
-
});
|
|
510
|
-
setData2(current => {
|
|
511
|
-
const last = current[current.length - 1];
|
|
512
|
-
return [...current.slice(1), generateNextValue(last)];
|
|
513
|
-
});
|
|
514
|
-
}, updateInterval);
|
|
515
|
-
return () => clearInterval(intervalId);
|
|
516
|
-
}, []);
|
|
517
|
-
return /*#__PURE__*/_jsxs(VStack, {
|
|
518
|
-
gap: 2,
|
|
519
|
-
children: [/*#__PURE__*/_jsx(MultiLineChart, {
|
|
520
|
-
data1: data1,
|
|
521
|
-
data2: data2,
|
|
522
|
-
transitions: transitions
|
|
523
|
-
}, resetKey), /*#__PURE__*/_jsx(Box, {
|
|
524
|
-
paddingX: 2,
|
|
525
|
-
children: /*#__PURE__*/_jsx(Button, {
|
|
526
|
-
compact: true,
|
|
527
|
-
onPress: handleReset,
|
|
528
|
-
variant: "secondary",
|
|
529
|
-
children: "Reset"
|
|
530
|
-
})
|
|
531
|
-
})]
|
|
532
|
-
});
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
// --- Main Navigator ---
|
|
536
|
-
|
|
537
|
-
function ExampleNavigator() {
|
|
538
|
-
const [currentIndex, setCurrentIndex] = useState(0);
|
|
539
|
-
const examples = useMemo(() => [{
|
|
540
|
-
category: 'Line',
|
|
541
|
-
title: 'Enter Only',
|
|
542
|
-
component: /*#__PURE__*/_jsx(LineExample, {
|
|
543
|
-
idlePulse: true,
|
|
544
|
-
transitions: enterOnly
|
|
545
|
-
})
|
|
546
|
-
}, {
|
|
547
|
-
category: 'Line',
|
|
548
|
-
title: 'Update Only',
|
|
549
|
-
component: /*#__PURE__*/_jsx(LineExample, {
|
|
550
|
-
idlePulse: true,
|
|
551
|
-
points: true,
|
|
552
|
-
pointTransitions: updateOnly,
|
|
553
|
-
transitions: updateOnly
|
|
554
|
-
})
|
|
555
|
-
}, {
|
|
556
|
-
category: 'Line',
|
|
557
|
-
title: 'Both Disabled',
|
|
558
|
-
component: /*#__PURE__*/_jsx(LineExample, {
|
|
559
|
-
transitions: bothDisabled
|
|
560
|
-
})
|
|
561
|
-
}, {
|
|
562
|
-
category: 'Line',
|
|
563
|
-
title: 'Custom 2',
|
|
564
|
-
component: /*#__PURE__*/_jsx(LineExample, {
|
|
565
|
-
points: true,
|
|
566
|
-
pointTransitions: customEnterUpdateBeacon,
|
|
567
|
-
scrubberTransitions: customEnterUpdateBeacon,
|
|
568
|
-
transitions: customEnterUpdate
|
|
569
|
-
})
|
|
570
|
-
}, {
|
|
571
|
-
category: 'Line',
|
|
572
|
-
title: 'Imperative Pulse',
|
|
573
|
-
component: /*#__PURE__*/_jsx(LineExample, {
|
|
574
|
-
imperative: true,
|
|
575
|
-
resettable: false,
|
|
576
|
-
transitions: updateOnly
|
|
577
|
-
})
|
|
578
|
-
}, {
|
|
579
|
-
category: 'Multi-Line',
|
|
580
|
-
title: 'Update Only',
|
|
581
|
-
component: /*#__PURE__*/_jsx(MultiLineExample, {
|
|
582
|
-
transitions: updateOnly
|
|
583
|
-
})
|
|
584
|
-
}, {
|
|
585
|
-
category: 'Area',
|
|
586
|
-
title: 'Both Disabled',
|
|
587
|
-
component: /*#__PURE__*/_jsx(AreaExample, {
|
|
588
|
-
transitions: bothDisabled
|
|
589
|
-
})
|
|
590
|
-
}, {
|
|
591
|
-
category: 'Area',
|
|
592
|
-
title: 'Imperative Pulse',
|
|
593
|
-
component: /*#__PURE__*/_jsx(AreaExample, {
|
|
594
|
-
imperative: true,
|
|
595
|
-
resettable: false,
|
|
596
|
-
transitions: updateOnly
|
|
597
|
-
})
|
|
598
|
-
}, {
|
|
599
|
-
category: 'Area',
|
|
600
|
-
title: 'Session baseline',
|
|
601
|
-
component: /*#__PURE__*/_jsx(SessionBaselineAreaTransitionsExample, {})
|
|
602
|
-
}, {
|
|
603
|
-
category: 'Bar',
|
|
604
|
-
title: 'Enter Only',
|
|
605
|
-
component: /*#__PURE__*/_jsx(BarExample, {
|
|
606
|
-
transitions: enterOnly
|
|
607
|
-
})
|
|
608
|
-
}, {
|
|
609
|
-
category: 'Bar',
|
|
610
|
-
title: 'Update Only',
|
|
611
|
-
component: /*#__PURE__*/_jsx(BarExample, {
|
|
612
|
-
transitions: updateOnly
|
|
613
|
-
})
|
|
614
|
-
}, {
|
|
615
|
-
category: 'Bar',
|
|
616
|
-
title: 'Both Disabled',
|
|
617
|
-
component: /*#__PURE__*/_jsx(BarExample, {
|
|
618
|
-
transitions: bothDisabled
|
|
619
|
-
})
|
|
620
|
-
}, {
|
|
621
|
-
category: 'Bar',
|
|
622
|
-
title: 'Slow Spring Both',
|
|
623
|
-
component: /*#__PURE__*/_jsx(BarExample, {
|
|
624
|
-
transitions: slowSpringBoth
|
|
625
|
-
})
|
|
626
|
-
}, {
|
|
627
|
-
category: 'Bar',
|
|
628
|
-
title: 'Staggered Both',
|
|
629
|
-
component: /*#__PURE__*/_jsx(BarExample, {
|
|
630
|
-
transitions: staggeredBoth
|
|
631
|
-
})
|
|
632
|
-
}, {
|
|
633
|
-
category: 'Line',
|
|
634
|
-
title: 'Rapid Interrupts',
|
|
635
|
-
component: /*#__PURE__*/_jsx(RapidLineExample, {
|
|
636
|
-
transitions: slowTimingBoth
|
|
637
|
-
})
|
|
638
|
-
}, {
|
|
639
|
-
category: 'Bar',
|
|
640
|
-
title: 'Rapid Interrupts',
|
|
641
|
-
component: /*#__PURE__*/_jsx(RapidBarExample, {
|
|
642
|
-
transitions: slowTimingBoth
|
|
643
|
-
})
|
|
644
|
-
}], []);
|
|
645
|
-
const currentExample = examples[currentIndex];
|
|
646
|
-
const handlePrevious = useCallback(() => {
|
|
647
|
-
setCurrentIndex(prev => (prev - 1 + examples.length) % examples.length);
|
|
648
|
-
}, [examples.length]);
|
|
649
|
-
const handleNext = useCallback(() => {
|
|
650
|
-
setCurrentIndex(prev => (prev + 1) % examples.length);
|
|
651
|
-
}, [examples.length]);
|
|
652
|
-
return /*#__PURE__*/_jsx(ExampleScreen, {
|
|
653
|
-
paddingX: 0,
|
|
654
|
-
children: /*#__PURE__*/_jsxs(VStack, {
|
|
655
|
-
gap: 4,
|
|
656
|
-
children: [/*#__PURE__*/_jsxs(HStack, {
|
|
657
|
-
alignItems: "center",
|
|
658
|
-
justifyContent: "space-between",
|
|
659
|
-
paddingX: 1,
|
|
660
|
-
children: [/*#__PURE__*/_jsx(IconButton, {
|
|
661
|
-
accessibilityHint: "Navigate to previous example",
|
|
662
|
-
accessibilityLabel: "Previous",
|
|
663
|
-
name: "arrowLeft",
|
|
664
|
-
onPress: handlePrevious,
|
|
665
|
-
variant: "secondary"
|
|
666
|
-
}), /*#__PURE__*/_jsxs(VStack, {
|
|
667
|
-
alignItems: "center",
|
|
668
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
669
|
-
color: "fgMuted",
|
|
670
|
-
font: "label2",
|
|
671
|
-
children: currentExample.category
|
|
672
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
673
|
-
font: "title3",
|
|
674
|
-
children: currentExample.title
|
|
675
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
676
|
-
color: "fgMuted",
|
|
677
|
-
font: "label1",
|
|
678
|
-
children: [currentIndex + 1, " / ", examples.length]
|
|
679
|
-
})]
|
|
680
|
-
}), /*#__PURE__*/_jsx(IconButton, {
|
|
681
|
-
accessibilityHint: "Navigate to next example",
|
|
682
|
-
accessibilityLabel: "Next",
|
|
683
|
-
name: "arrowRight",
|
|
684
|
-
onPress: handleNext,
|
|
685
|
-
variant: "secondary"
|
|
686
|
-
})]
|
|
687
|
-
}), /*#__PURE__*/_jsx(Box, {
|
|
688
|
-
children: currentExample.component
|
|
689
|
-
}, currentIndex)]
|
|
690
|
-
})
|
|
691
|
-
});
|
|
692
|
-
}
|
|
693
|
-
export default ExampleNavigator;
|