@coinbase/cds-mobile-visualization 3.4.0-beta.9 → 3.4.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.
Files changed (167) hide show
  1. package/CHANGELOG.md +132 -0
  2. package/dts/chart/CartesianChart.d.ts +92 -7
  3. package/dts/chart/CartesianChart.d.ts.map +1 -1
  4. package/dts/chart/ChartContextBridge.d.ts.map +1 -1
  5. package/dts/chart/ChartProvider.d.ts +3 -0
  6. package/dts/chart/ChartProvider.d.ts.map +1 -1
  7. package/dts/chart/Path.d.ts +36 -13
  8. package/dts/chart/Path.d.ts.map +1 -1
  9. package/dts/chart/PeriodSelector.d.ts +20 -5
  10. package/dts/chart/PeriodSelector.d.ts.map +1 -1
  11. package/dts/chart/area/Area.d.ts +14 -11
  12. package/dts/chart/area/Area.d.ts.map +1 -1
  13. package/dts/chart/area/AreaChart.d.ts +33 -9
  14. package/dts/chart/area/AreaChart.d.ts.map +1 -1
  15. package/dts/chart/area/DottedArea.d.ts.map +1 -1
  16. package/dts/chart/area/GradientArea.d.ts.map +1 -1
  17. package/dts/chart/area/SolidArea.d.ts.map +1 -1
  18. package/dts/chart/axis/Axis.d.ts +22 -42
  19. package/dts/chart/axis/Axis.d.ts.map +1 -1
  20. package/dts/chart/axis/XAxis.d.ts +6 -0
  21. package/dts/chart/axis/XAxis.d.ts.map +1 -1
  22. package/dts/chart/axis/YAxis.d.ts +1 -0
  23. package/dts/chart/axis/YAxis.d.ts.map +1 -1
  24. package/dts/chart/bar/Bar.d.ts +51 -51
  25. package/dts/chart/bar/Bar.d.ts.map +1 -1
  26. package/dts/chart/bar/BarChart.d.ts +56 -11
  27. package/dts/chart/bar/BarChart.d.ts.map +1 -1
  28. package/dts/chart/bar/BarPlot.d.ts +2 -1
  29. package/dts/chart/bar/BarPlot.d.ts.map +1 -1
  30. package/dts/chart/bar/BarStack.d.ts +45 -20
  31. package/dts/chart/bar/BarStack.d.ts.map +1 -1
  32. package/dts/chart/bar/BarStackGroup.d.ts +2 -1
  33. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
  34. package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
  35. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
  36. package/dts/chart/gradient/Gradient.d.ts +5 -0
  37. package/dts/chart/gradient/Gradient.d.ts.map +1 -1
  38. package/dts/chart/index.d.ts +1 -0
  39. package/dts/chart/index.d.ts.map +1 -1
  40. package/dts/chart/legend/DefaultLegendEntry.d.ts +5 -0
  41. package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
  42. package/dts/chart/legend/DefaultLegendShape.d.ts +5 -0
  43. package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
  44. package/dts/chart/legend/Legend.d.ts +168 -0
  45. package/dts/chart/legend/Legend.d.ts.map +1 -0
  46. package/dts/chart/legend/index.d.ts +4 -0
  47. package/dts/chart/legend/index.d.ts.map +1 -0
  48. package/dts/chart/line/DottedLine.d.ts.map +1 -1
  49. package/dts/chart/line/Line.d.ts +23 -19
  50. package/dts/chart/line/Line.d.ts.map +1 -1
  51. package/dts/chart/line/LineChart.d.ts +26 -9
  52. package/dts/chart/line/LineChart.d.ts.map +1 -1
  53. package/dts/chart/line/ReferenceLine.d.ts +1 -0
  54. package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
  55. package/dts/chart/line/SolidLine.d.ts.map +1 -1
  56. package/dts/chart/point/Point.d.ts +26 -2
  57. package/dts/chart/point/Point.d.ts.map +1 -1
  58. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +32 -2
  59. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -1
  60. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +2 -1
  61. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -1
  62. package/dts/chart/scrubber/Scrubber.d.ts +86 -17
  63. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
  64. package/dts/chart/scrubber/ScrubberAccessibilityView.d.ts +12 -0
  65. package/dts/chart/scrubber/ScrubberAccessibilityView.d.ts.map +1 -0
  66. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +10 -0
  67. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -1
  68. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +16 -1
  69. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -1
  70. package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
  71. package/dts/chart/utils/axis.d.ts +45 -10
  72. package/dts/chart/utils/axis.d.ts.map +1 -1
  73. package/dts/chart/utils/bar.d.ts +190 -0
  74. package/dts/chart/utils/bar.d.ts.map +1 -1
  75. package/dts/chart/utils/chart.d.ts +32 -0
  76. package/dts/chart/utils/chart.d.ts.map +1 -1
  77. package/dts/chart/utils/context.d.ts +21 -6
  78. package/dts/chart/utils/context.d.ts.map +1 -1
  79. package/dts/chart/utils/gradient.d.ts +3 -1
  80. package/dts/chart/utils/gradient.d.ts.map +1 -1
  81. package/dts/chart/utils/path.d.ts +26 -0
  82. package/dts/chart/utils/path.d.ts.map +1 -1
  83. package/dts/chart/utils/point.d.ts +24 -12
  84. package/dts/chart/utils/point.d.ts.map +1 -1
  85. package/dts/chart/utils/scale.d.ts +11 -0
  86. package/dts/chart/utils/scale.d.ts.map +1 -1
  87. package/dts/chart/utils/scrubber.d.ts +2 -1
  88. package/dts/chart/utils/scrubber.d.ts.map +1 -1
  89. package/dts/chart/utils/transition.d.ts +63 -22
  90. package/dts/chart/utils/transition.d.ts.map +1 -1
  91. package/dts/sparkline/Sparkline.d.ts +2 -1
  92. package/dts/sparkline/Sparkline.d.ts.map +1 -1
  93. package/dts/sparkline/SparklineArea.d.ts +2 -1
  94. package/dts/sparkline/SparklineArea.d.ts.map +1 -1
  95. package/dts/sparkline/SparklineGradient.d.ts +2 -1
  96. package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
  97. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +2 -1
  98. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
  99. package/esm/chart/CartesianChart.js +176 -82
  100. package/esm/chart/ChartContextBridge.js +14 -3
  101. package/esm/chart/ChartProvider.js +2 -2
  102. package/esm/chart/Path.js +34 -29
  103. package/esm/chart/PeriodSelector.js +5 -1
  104. package/esm/chart/__stories__/CartesianChart.stories.js +16 -80
  105. package/esm/chart/__stories__/ChartAccessibility.stories.js +721 -0
  106. package/esm/chart/__stories__/ChartTransitions.stories.js +625 -0
  107. package/esm/chart/__stories__/PeriodSelector.stories.js +99 -1
  108. package/esm/chart/area/Area.js +21 -9
  109. package/esm/chart/area/AreaChart.js +18 -13
  110. package/esm/chart/area/DottedArea.js +28 -18
  111. package/esm/chart/area/GradientArea.js +14 -7
  112. package/esm/chart/area/SolidArea.js +6 -2
  113. package/esm/chart/area/__stories__/AreaChart.stories.js +47 -5
  114. package/esm/chart/axis/Axis.js +5 -41
  115. package/esm/chart/axis/XAxis.js +116 -47
  116. package/esm/chart/axis/YAxis.js +105 -26
  117. package/esm/chart/axis/__stories__/Axis.stories.js +324 -48
  118. package/esm/chart/bar/Bar.js +17 -15
  119. package/esm/chart/bar/BarChart.js +38 -33
  120. package/esm/chart/bar/BarPlot.js +40 -45
  121. package/esm/chart/bar/BarStack.js +92 -475
  122. package/esm/chart/bar/BarStackGroup.js +37 -27
  123. package/esm/chart/bar/DefaultBar.js +27 -18
  124. package/esm/chart/bar/DefaultBarStack.js +25 -9
  125. package/esm/chart/bar/__stories__/BarChart.stories.js +728 -54
  126. package/esm/chart/gradient/Gradient.js +2 -1
  127. package/esm/chart/index.js +1 -0
  128. package/esm/chart/legend/DefaultLegendEntry.js +42 -0
  129. package/esm/chart/legend/DefaultLegendShape.js +64 -0
  130. package/esm/chart/legend/Legend.js +59 -0
  131. package/esm/chart/legend/__stories__/Legend.stories.js +574 -0
  132. package/esm/chart/legend/index.js +3 -0
  133. package/esm/chart/line/DottedLine.js +6 -2
  134. package/esm/chart/line/Line.js +42 -38
  135. package/esm/chart/line/LineChart.js +36 -12
  136. package/esm/chart/line/SolidLine.js +6 -2
  137. package/esm/chart/line/__stories__/LineChart.stories.js +236 -590
  138. package/esm/chart/line/__stories__/ReferenceLine.stories.js +95 -1
  139. package/esm/chart/point/Point.js +35 -36
  140. package/esm/chart/scrubber/DefaultScrubberBeacon.js +41 -38
  141. package/esm/chart/scrubber/DefaultScrubberLabel.js +26 -10
  142. package/esm/chart/scrubber/Scrubber.js +67 -35
  143. package/esm/chart/scrubber/ScrubberAccessibilityView.js +177 -0
  144. package/esm/chart/scrubber/ScrubberBeaconGroup.js +30 -22
  145. package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +35 -8
  146. package/esm/chart/scrubber/ScrubberProvider.js +29 -24
  147. package/esm/chart/scrubber/__stories__/Scrubber.stories.js +946 -0
  148. package/esm/chart/utils/axis.js +88 -44
  149. package/esm/chart/utils/bar.js +820 -0
  150. package/esm/chart/utils/chart.js +34 -7
  151. package/esm/chart/utils/context.js +7 -0
  152. package/esm/chart/utils/gradient.js +8 -4
  153. package/esm/chart/utils/path.js +91 -61
  154. package/esm/chart/utils/point.js +92 -39
  155. package/esm/chart/utils/scale.js +13 -2
  156. package/esm/chart/utils/scrubber.js +12 -5
  157. package/esm/chart/utils/transition.js +108 -60
  158. package/esm/sparkline/Sparkline.js +2 -1
  159. package/esm/sparkline/SparklineArea.js +2 -1
  160. package/esm/sparkline/SparklineGradient.js +2 -1
  161. package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
  162. package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +2 -1
  163. package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
  164. package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
  165. package/esm/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.js +2 -0
  166. package/package.json +5 -6
  167. package/esm/chart/__stories__/Chart.stories.js +0 -77
@@ -1,20 +1,32 @@
1
1
  const _excluded = ["children"],
2
- _excluded2 = ["animate"];
2
+ _excluded2 = ["animate"],
3
+ _excluded3 = ["x", "y", "width", "height", "dataX"],
4
+ _excluded4 = ["data", "height"],
5
+ _excluded5 = ["buy", "sell", "animate", "borderRadius", "height", "inset", "layout", "stackGap", "xAxis", "yAxis", "barMinSize"];
3
6
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
4
7
  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); }
5
- import { memo, useEffect, useState } from 'react';
6
- import { Button } from '@coinbase/cds-mobile/buttons';
7
- import { Example, ExampleScreen } from '@coinbase/cds-mobile/examples/ExampleScreen';
8
+ import { memo, useCallback, useEffect, useId, useMemo, useState } from 'react';
9
+ import { useDerivedValue } from 'react-native-reanimated';
10
+ import { assets } from '@coinbase/cds-common/internal/data/assets';
11
+ import { candles as btcCandles } from '@coinbase/cds-common/internal/data/candles';
12
+ import { Button, IconButton } from '@coinbase/cds-mobile/buttons';
13
+ import { ExampleScreen } from '@coinbase/cds-mobile/examples/ExampleScreen';
8
14
  import { useTheme } from '@coinbase/cds-mobile/hooks/useTheme';
9
- import { VStack } from '@coinbase/cds-mobile/layout';
15
+ import { Box, HStack, VStack } from '@coinbase/cds-mobile/layout';
16
+ import { Text } from '@coinbase/cds-mobile/typography';
17
+ import { Line as SkiaLine, Rect } from '@shopify/react-native-skia';
10
18
  import { XAxis, YAxis } from '../../axis';
11
19
  import { CartesianChart } from '../../CartesianChart';
20
+ import { useCartesianChartContext } from '../../ChartProvider';
21
+ import { DefaultLegendEntry } from '../../legend';
12
22
  import { ReferenceLine, SolidLine } from '../../line';
23
+ import { Scrubber } from '../../scrubber';
24
+ import { getPointOnSerializableScale, unwrapAnimatedValue, useScrubberContext } from '../../utils';
13
25
  import { Bar } from '../Bar';
14
26
  import { BarChart } from '../BarChart';
15
27
  import { BarPlot } from '../BarPlot';
16
28
  import { DefaultBarStack } from '../DefaultBarStack';
17
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
30
  const ThinSolidLine = /*#__PURE__*/memo(props => /*#__PURE__*/_jsx(SolidLine, _extends({}, props, {
19
31
  strokeWidth: 1
20
32
  })));
@@ -104,7 +116,7 @@ const CustomBarStackComponent = /*#__PURE__*/memo(_ref => {
104
116
  borderRadius: 1000,
105
117
  fill: theme.color.bgTertiary,
106
118
  height: diameter,
107
- originY: props.y,
119
+ origin: props.y,
108
120
  width: diameter,
109
121
  x: props.x,
110
122
  y: props.y - diameter
@@ -115,6 +127,7 @@ const CustomBarStackComponent = /*#__PURE__*/memo(_ref => {
115
127
  }));
116
128
  });
117
129
  const MonthlyRewards = () => {
130
+ const theme = useTheme();
118
131
  const months = ['J', 'F', 'M', 'A', 'M', 'J', 'J', 'A', 'S', 'O', 'N', 'D'];
119
132
  const purple = [null, 6, 8, 10, 7, 6, 6, 8, null, null, null, null];
120
133
  const blue = [null, 10, 12, 11, 10, 9, 10, 11, null, null, null, null];
@@ -124,19 +137,19 @@ const MonthlyRewards = () => {
124
137
  const series = [{
125
138
  id: 'purple',
126
139
  data: purple,
127
- color: '#b399ff'
140
+ color: "rgb(" + theme.spectrum.purple30 + ")"
128
141
  }, {
129
142
  id: 'blue',
130
143
  data: blue,
131
- color: '#4f7cff'
144
+ color: "rgb(" + theme.spectrum.blue30 + ")"
132
145
  }, {
133
146
  id: 'cyan',
134
147
  data: cyan,
135
- color: '#00c2df'
148
+ color: "rgb(" + theme.spectrum.teal30 + ")"
136
149
  }, {
137
150
  id: 'green',
138
151
  data: green,
139
- color: '#33c481'
152
+ color: "rgb(" + theme.spectrum.green30 + ")"
140
153
  }];
141
154
  return /*#__PURE__*/_jsxs(VStack, {
142
155
  gap: 2,
@@ -155,7 +168,7 @@ const MonthlyRewards = () => {
155
168
  tickLabelFormatter: index => {
156
169
  return months[index];
157
170
  },
158
- categoryPadding: 0.27
171
+ categoryPadding: 0.25
159
172
  }
160
173
  }), /*#__PURE__*/_jsx(Button, {
161
174
  onPress: () => setRoundBaseline(!roundBaseline),
@@ -621,48 +634,709 @@ const ColorMapWithOpacity = () => {
621
634
  }
622
635
  });
623
636
  };
624
- const BarChartStories = () => {
625
- return /*#__PURE__*/_jsxs(ExampleScreen, {
626
- children: [/*#__PURE__*/_jsx(Example, {
627
- title: "Basic",
628
- children: /*#__PURE__*/_jsx(UpdatingChartValues, {})
629
- }), /*#__PURE__*/_jsx(Example, {
630
- title: "Animated Auto-Updating",
631
- children: /*#__PURE__*/_jsx(AnimatedUpdatingChartValues, {})
632
- }), /*#__PURE__*/_jsx(Example, {
633
- title: "Negative Values with Top Axis",
634
- children: /*#__PURE__*/_jsx(NegativeValuesWithTopAxis, {})
635
- }), /*#__PURE__*/_jsx(Example, {
636
- title: "Positive and Negative Cash Flow",
637
- children: /*#__PURE__*/_jsx(PositiveAndNegativeCashFlow, {})
638
- }), /*#__PURE__*/_jsx(Example, {
639
- title: "Fiat & Stablecoin Balance",
640
- children: /*#__PURE__*/_jsx(FiatAndStablecoinBalance, {})
641
- }), /*#__PURE__*/_jsx(Example, {
642
- title: "Monthly Rewards",
643
- children: /*#__PURE__*/_jsx(MonthlyRewards, {})
644
- }), /*#__PURE__*/_jsx(Example, {
645
- title: "Multiple Y Axes",
646
- children: /*#__PURE__*/_jsx(MultipleYAxes, {})
647
- }), /*#__PURE__*/_jsx(Example, {
648
- title: "Y-Axis Continuous ColorMap",
649
- children: /*#__PURE__*/_jsx(YAxisContinuousColorMap, {})
650
- }), /*#__PURE__*/_jsx(Example, {
651
- title: "Y-Axis Discrete ColorMap",
652
- children: /*#__PURE__*/_jsx(YAxisDiscreteColorMap, {})
653
- }), /*#__PURE__*/_jsx(Example, {
654
- title: "X-Axis Continuous ColorMap",
655
- children: /*#__PURE__*/_jsx(XAxisContinuousColorMap, {})
656
- }), /*#__PURE__*/_jsx(Example, {
657
- title: "X-Axis Discrete ColorMap",
658
- children: /*#__PURE__*/_jsx(XAxisDiscreteColorMap, {})
659
- }), /*#__PURE__*/_jsx(Example, {
660
- title: "X-Axis Multi-Segment ColorMap",
661
- children: /*#__PURE__*/_jsx(XAxisMultiSegmentColorMap, {})
662
- }), /*#__PURE__*/_jsx(Example, {
663
- title: "ColorMap with Opacity",
664
- children: /*#__PURE__*/_jsx(ColorMapWithOpacity, {})
637
+ const BandGridPositionExample = _ref6 => {
638
+ let {
639
+ position
640
+ } = _ref6;
641
+ return /*#__PURE__*/_jsxs(CartesianChart, {
642
+ height: 180,
643
+ inset: 4,
644
+ series: [{
645
+ id: 'data',
646
+ data: [30, 50, 40, 60, 35]
647
+ }],
648
+ xAxis: {
649
+ scaleType: 'band',
650
+ data: ['A', 'B', 'C', 'D', 'E']
651
+ },
652
+ yAxis: {
653
+ domain: {
654
+ min: 0
655
+ }
656
+ },
657
+ children: [/*#__PURE__*/_jsx(XAxis, {
658
+ showGrid: true,
659
+ showLine: true,
660
+ bandGridLinePlacement: position,
661
+ label: position
662
+ }), /*#__PURE__*/_jsx(BarPlot, {})]
663
+ });
664
+ };
665
+
666
+ // --- Composed Examples ---
667
+
668
+ const candlestickStockData = btcCandles.slice(0, 90).reverse();
669
+ const CandlesticksHeader = /*#__PURE__*/memo(_ref7 => {
670
+ let {
671
+ currentIndex
672
+ } = _ref7;
673
+ const formatPrice = useCallback(price => {
674
+ return new Intl.NumberFormat('en-US', {
675
+ style: 'currency',
676
+ currency: 'USD'
677
+ }).format(parseFloat(price));
678
+ }, []);
679
+ const formatThousandsPriceNumber = useCallback(price => {
680
+ const formattedPrice = new Intl.NumberFormat('en-US', {
681
+ style: 'currency',
682
+ currency: 'USD',
683
+ minimumFractionDigits: 0,
684
+ maximumFractionDigits: 0
685
+ }).format(price / 1000);
686
+ return formattedPrice + "k";
687
+ }, []);
688
+ const currentText = useMemo(() => {
689
+ if (currentIndex !== undefined) {
690
+ return "Open: " + formatThousandsPriceNumber(parseFloat(candlestickStockData[currentIndex].open)) + ", Close: " + formatThousandsPriceNumber(parseFloat(candlestickStockData[currentIndex].close)) + ", Volume: " + (parseFloat(candlestickStockData[currentIndex].volume) / 1000).toFixed(2) + "k";
691
+ }
692
+ return formatPrice(candlestickStockData[candlestickStockData.length - 1].close);
693
+ }, [currentIndex, formatThousandsPriceNumber, formatPrice]);
694
+ return /*#__PURE__*/_jsx(Text, {
695
+ "aria-live": "polite",
696
+ font: "headline",
697
+ children: currentText
698
+ });
699
+ });
700
+ const CandlesticksChart = /*#__PURE__*/memo(_ref8 => {
701
+ let {
702
+ infoTextId,
703
+ onScrubberPositionChange
704
+ } = _ref8;
705
+ const theme = useTheme();
706
+ const min = useMemo(() => Math.min(...candlestickStockData.map(data => parseFloat(data.low))), []);
707
+ const CandleThinSolidLine = /*#__PURE__*/memo(props => /*#__PURE__*/_jsx(SolidLine, _extends({}, props, {
708
+ strokeWidth: 1
709
+ })));
710
+ const BandwidthHighlight = /*#__PURE__*/memo(_ref9 => {
711
+ let {
712
+ stroke
713
+ } = _ref9;
714
+ const {
715
+ getXSerializableScale,
716
+ drawingArea
717
+ } = useCartesianChartContext();
718
+ const {
719
+ scrubberPosition
720
+ } = useScrubberContext();
721
+ const xScale = useMemo(() => getXSerializableScale(), [getXSerializableScale]);
722
+ const rectWidth = useMemo(() => {
723
+ if (xScale !== undefined && xScale.type === 'band') {
724
+ return xScale.bandwidth;
725
+ }
726
+ return 0;
727
+ }, [xScale]);
728
+ const xPos = useDerivedValue(() => {
729
+ const position = unwrapAnimatedValue(scrubberPosition);
730
+ const xPos = position !== undefined && xScale ? getPointOnSerializableScale(position, xScale) : undefined;
731
+ return xPos !== undefined ? xPos - rectWidth / 2 : 0;
732
+ }, [scrubberPosition, xScale]);
733
+ const opacity = useDerivedValue(() => xPos.value !== undefined ? 1 : 0, [xPos]);
734
+ return /*#__PURE__*/_jsx(Rect, {
735
+ color: stroke,
736
+ height: drawingArea.height,
737
+ opacity: opacity,
738
+ width: rectWidth,
739
+ x: xPos,
740
+ y: drawingArea.y
741
+ });
742
+ });
743
+ const candlesData = useMemo(() => candlestickStockData.map(data => [parseFloat(data.low), parseFloat(data.high)]), []);
744
+ const CandlestickBarComponent = /*#__PURE__*/memo(_ref0 => {
745
+ var _yScale, _yScale2;
746
+ let {
747
+ x,
748
+ y,
749
+ width,
750
+ height,
751
+ dataX
752
+ } = _ref0,
753
+ props = _objectWithoutPropertiesLoose(_ref0, _excluded3);
754
+ const {
755
+ getYScale
756
+ } = useCartesianChartContext();
757
+ const yScale = getYScale();
758
+ const wickX = x + width / 2;
759
+ const timePeriodValue = candlestickStockData[dataX];
760
+ const open = parseFloat(timePeriodValue.open);
761
+ const close = parseFloat(timePeriodValue.close);
762
+ const bullish = open < close;
763
+ const theme = useTheme();
764
+ const color = bullish ? theme.color.fgPositive : theme.color.fgNegative;
765
+ const openY = (_yScale = yScale == null ? void 0 : yScale(open)) != null ? _yScale : 0;
766
+ const closeY = (_yScale2 = yScale == null ? void 0 : yScale(close)) != null ? _yScale2 : 0;
767
+ const bodyHeight = Math.abs(openY - closeY);
768
+ const bodyY = openY < closeY ? openY : closeY;
769
+ return /*#__PURE__*/_jsxs(_Fragment, {
770
+ children: [/*#__PURE__*/_jsx(SkiaLine, {
771
+ color: color,
772
+ p1: {
773
+ x: wickX,
774
+ y
775
+ },
776
+ p2: {
777
+ x: wickX,
778
+ y: y + height
779
+ },
780
+ strokeWidth: 1
781
+ }), /*#__PURE__*/_jsx(Rect, {
782
+ color: color,
783
+ height: bodyHeight,
784
+ width: width,
785
+ x: x,
786
+ y: bodyY
787
+ })]
788
+ });
789
+ });
790
+ const formatThousandsPriceNumber = useCallback(price => {
791
+ const formattedPrice = new Intl.NumberFormat('en-US', {
792
+ style: 'currency',
793
+ currency: 'USD',
794
+ minimumFractionDigits: 0,
795
+ maximumFractionDigits: 0
796
+ }).format(price / 1000);
797
+ return formattedPrice + "k";
798
+ }, []);
799
+ const formatTime = useCallback(index => {
800
+ if (index === null || index === undefined || index >= candlestickStockData.length) return '';
801
+ const ts = parseInt(candlestickStockData[index].start);
802
+ return new Date(ts * 1000).toLocaleDateString('en-US', {
803
+ month: 'short',
804
+ day: 'numeric'
805
+ });
806
+ }, []);
807
+ const getScrubberAccessibilityLabel = useCallback(index => {
808
+ const candle = candlestickStockData[index];
809
+ return formatTime(index) + ": O " + formatThousandsPriceNumber(parseFloat(candle.open)) + " H " + formatThousandsPriceNumber(parseFloat(candle.high)) + " L " + formatThousandsPriceNumber(parseFloat(candle.low)) + " C " + formatThousandsPriceNumber(parseFloat(candle.close));
810
+ }, [formatTime, formatThousandsPriceNumber]);
811
+ return /*#__PURE__*/_jsxs(CartesianChart, {
812
+ enableScrubbing: true,
813
+ accessibilityLabel: "Candlestick chart with " + candlesData.length + " data points. Swipe to navigate.",
814
+ animate: false,
815
+ "aria-labelledby": infoTextId,
816
+ borderRadius: 0,
817
+ getScrubberAccessibilityLabel: getScrubberAccessibilityLabel,
818
+ height: 150,
819
+ inset: {
820
+ top: 8,
821
+ bottom: 8,
822
+ left: 0,
823
+ right: 0
824
+ },
825
+ onScrubberPositionChange: onScrubberPositionChange,
826
+ series: [{
827
+ id: 'stock-prices',
828
+ data: candlesData
829
+ }],
830
+ xAxis: {
831
+ scaleType: 'band'
832
+ },
833
+ yAxis: {
834
+ domain: {
835
+ min
836
+ }
837
+ },
838
+ children: [/*#__PURE__*/_jsx(XAxis, {
839
+ tickLabelFormatter: formatTime
840
+ }), /*#__PURE__*/_jsx(YAxis, {
841
+ showGrid: true,
842
+ GridLineComponent: CandleThinSolidLine,
843
+ tickLabelFormatter: formatThousandsPriceNumber,
844
+ width: 40
845
+ }), /*#__PURE__*/_jsx(Scrubber, {
846
+ hideOverlay: true,
847
+ LineComponent: BandwidthHighlight,
848
+ lineStroke: theme.color.fgMuted,
849
+ seriesIds: []
850
+ }), /*#__PURE__*/_jsx(BarPlot, {
851
+ BarComponent: CandlestickBarComponent,
852
+ BarStackComponent: _ref1 => {
853
+ let {
854
+ children
855
+ } = _ref1;
856
+ return /*#__PURE__*/_jsx(_Fragment, {
857
+ children: children
858
+ });
859
+ }
860
+ })]
861
+ });
862
+ });
863
+ const Candlesticks = () => {
864
+ const infoTextId = useId();
865
+ const [currentIndex, setCurrentIndex] = useState();
866
+ return /*#__PURE__*/_jsxs(VStack, {
867
+ gap: 2,
868
+ children: [/*#__PURE__*/_jsx(CandlesticksHeader, {
869
+ currentIndex: currentIndex
870
+ }), /*#__PURE__*/_jsx(CandlesticksChart, {
871
+ infoTextId: infoTextId,
872
+ onScrubberPositionChange: setCurrentIndex
665
873
  })]
666
874
  });
667
875
  };
668
- export default BarChartStories;
876
+ const DAY_LENGTH_MINUTES = 1440;
877
+ const sunlightData = [{
878
+ label: 'Jan',
879
+ value: 598
880
+ }, {
881
+ label: 'Feb',
882
+ value: 635
883
+ }, {
884
+ label: 'Mar',
885
+ value: 688
886
+ }, {
887
+ label: 'Apr',
888
+ value: 753
889
+ }, {
890
+ label: 'May',
891
+ value: 812
892
+ }, {
893
+ label: 'Jun',
894
+ value: 855
895
+ }, {
896
+ label: 'Jul',
897
+ value: 861
898
+ }, {
899
+ label: 'Aug',
900
+ value: 828
901
+ }, {
902
+ label: 'Sep',
903
+ value: 772
904
+ }, {
905
+ label: 'Oct',
906
+ value: 710
907
+ }, {
908
+ label: 'Nov',
909
+ value: 648
910
+ }, {
911
+ label: 'Dec',
912
+ value: 605
913
+ }];
914
+ const SunlightChartInner = /*#__PURE__*/memo(_ref10 => {
915
+ let {
916
+ data,
917
+ height = 300
918
+ } = _ref10,
919
+ props = _objectWithoutPropertiesLoose(_ref10, _excluded4);
920
+ const theme = useTheme();
921
+ const SunlightThinSolidLine = /*#__PURE__*/memo(props => /*#__PURE__*/_jsx(SolidLine, _extends({}, props, {
922
+ strokeWidth: 1
923
+ })));
924
+ return /*#__PURE__*/_jsxs(CartesianChart, _extends({}, props, {
925
+ height: height,
926
+ series: [{
927
+ id: 'sunlight',
928
+ data: data.map(_ref11 => {
929
+ let {
930
+ value
931
+ } = _ref11;
932
+ return value;
933
+ }),
934
+ yAxisId: 'sunlight',
935
+ color: "rgb(" + theme.spectrum.yellow40 + ")"
936
+ }, {
937
+ id: 'day',
938
+ data: data.map(() => DAY_LENGTH_MINUTES),
939
+ yAxisId: 'day',
940
+ color: "rgb(" + theme.spectrum.blue100 + ")"
941
+ }],
942
+ xAxis: _extends({}, props.xAxis, {
943
+ scaleType: 'band',
944
+ data: data.map(_ref12 => {
945
+ let {
946
+ label
947
+ } = _ref12;
948
+ return label;
949
+ })
950
+ }),
951
+ yAxis: [{
952
+ id: 'day',
953
+ domain: {
954
+ min: 0,
955
+ max: DAY_LENGTH_MINUTES
956
+ },
957
+ domainLimit: 'strict'
958
+ }, {
959
+ id: 'sunlight',
960
+ domain: {
961
+ min: 0,
962
+ max: DAY_LENGTH_MINUTES
963
+ },
964
+ domainLimit: 'strict'
965
+ }],
966
+ children: [/*#__PURE__*/_jsx(YAxis, {
967
+ showGrid: true,
968
+ showLine: true,
969
+ GridLineComponent: SunlightThinSolidLine,
970
+ axisId: "day",
971
+ position: "left"
972
+ }), /*#__PURE__*/_jsx(XAxis, {
973
+ showLine: true
974
+ }), /*#__PURE__*/_jsx(BarPlot, {
975
+ seriesIds: ['day'],
976
+ transitions: {
977
+ enter: null
978
+ }
979
+ }), /*#__PURE__*/_jsx(BarPlot, {
980
+ borderRadius: 0,
981
+ seriesIds: ['sunlight'],
982
+ transitions: {
983
+ enter: {
984
+ type: 'spring',
985
+ stiffness: 700,
986
+ damping: 40,
987
+ staggerDelay: 1000
988
+ }
989
+ }
990
+ })]
991
+ }));
992
+ });
993
+ const SunlightChart = () => {
994
+ return /*#__PURE__*/_jsxs(VStack, {
995
+ gap: 2,
996
+ children: [/*#__PURE__*/_jsx(SunlightChartInner, {
997
+ data: sunlightData
998
+ }), /*#__PURE__*/_jsx(Text, {
999
+ color: "fgMuted",
1000
+ font: "caption",
1001
+ textAlign: "center",
1002
+ children: "2026 Sunlight data for the first day of each month in Atlanta, Georgia, provided by NOAA."
1003
+ })]
1004
+ });
1005
+ };
1006
+ const PriceRange = () => {
1007
+ const candles = btcCandles.slice(0, 180).reverse();
1008
+ const data = useMemo(() => candles.map(candle => [parseFloat(candle.low), parseFloat(candle.high)]), [candles]);
1009
+ const min = useMemo(() => Math.min(...data.map(_ref13 => {
1010
+ let [low] = _ref13;
1011
+ return low;
1012
+ })), [data]);
1013
+ const max = useMemo(() => Math.max(...data.map(_ref14 => {
1014
+ let [, high] = _ref14;
1015
+ return high;
1016
+ })), [data]);
1017
+ const tickFormatter = useCallback(value => new Intl.NumberFormat('en-US', {
1018
+ style: 'currency',
1019
+ currency: 'USD',
1020
+ notation: 'compact',
1021
+ maximumFractionDigits: 0
1022
+ }).format(value), []);
1023
+ return /*#__PURE__*/_jsx(BarChart, {
1024
+ showYAxis: true,
1025
+ height: 150,
1026
+ series: [{
1027
+ id: 'prices',
1028
+ data,
1029
+ color: assets.btc.color
1030
+ }],
1031
+ yAxis: {
1032
+ domain: {
1033
+ min,
1034
+ max
1035
+ },
1036
+ showGrid: true,
1037
+ tickLabelFormatter: tickFormatter
1038
+ }
1039
+ });
1040
+ };
1041
+ const HorizontalBarChart = () => {
1042
+ const labels = ['BTC', 'ETH', 'SOL', 'ADA'];
1043
+ const allocation = [42, 28, 18, 12];
1044
+ return /*#__PURE__*/_jsx(BarChart, {
1045
+ showXAxis: true,
1046
+ showYAxis: true,
1047
+ height: 220,
1048
+ layout: "horizontal",
1049
+ series: [{
1050
+ id: 'allocation',
1051
+ data: allocation,
1052
+ color: assets.btc.color
1053
+ }],
1054
+ xAxis: {
1055
+ domain: {
1056
+ min: 0,
1057
+ max: 50
1058
+ },
1059
+ tickLabelFormatter: value => value + "%"
1060
+ },
1061
+ yAxis: {
1062
+ data: labels,
1063
+ scaleType: 'band'
1064
+ }
1065
+ });
1066
+ };
1067
+ function BuyVsSellExample() {
1068
+ function BuyVsSellLegend(_ref15) {
1069
+ let {
1070
+ buy,
1071
+ sell
1072
+ } = _ref15;
1073
+ const theme = useTheme();
1074
+ return /*#__PURE__*/_jsxs(HStack, {
1075
+ gap: 1,
1076
+ justifyContent: "space-between",
1077
+ children: [/*#__PURE__*/_jsx(DefaultLegendEntry, {
1078
+ color: theme.color.fgPositive,
1079
+ label: /*#__PURE__*/_jsxs(Text, {
1080
+ color: "fgMuted",
1081
+ font: "legal",
1082
+ children: [buy, "% bought"]
1083
+ }),
1084
+ seriesId: "buy"
1085
+ }), /*#__PURE__*/_jsx(DefaultLegendEntry, {
1086
+ color: theme.color.fgNegative,
1087
+ label: /*#__PURE__*/_jsxs(Text, {
1088
+ color: "fgMuted",
1089
+ font: "legal",
1090
+ children: [sell, "% sold"]
1091
+ }),
1092
+ seriesId: "sell"
1093
+ })]
1094
+ });
1095
+ }
1096
+ function BuyVsSellChart(_ref16) {
1097
+ let {
1098
+ buy,
1099
+ sell,
1100
+ animate = true,
1101
+ borderRadius = 3,
1102
+ height = 6,
1103
+ inset = 0,
1104
+ layout = 'horizontal',
1105
+ stackGap = 4,
1106
+ xAxis,
1107
+ yAxis,
1108
+ barMinSize = height
1109
+ } = _ref16,
1110
+ props = _objectWithoutPropertiesLoose(_ref16, _excluded5);
1111
+ const theme = useTheme();
1112
+ return /*#__PURE__*/_jsxs(VStack, {
1113
+ gap: 1.5,
1114
+ children: [/*#__PURE__*/_jsx(BarChart, _extends({
1115
+ roundBaseline: true,
1116
+ stacked: true,
1117
+ animate: animate,
1118
+ barMinSize: barMinSize,
1119
+ borderRadius: borderRadius,
1120
+ height: height,
1121
+ inset: inset,
1122
+ layout: layout,
1123
+ series: [{
1124
+ id: 'buy',
1125
+ data: [buy],
1126
+ color: theme.color.fgPositive,
1127
+ legendShape: 'circle'
1128
+ }, {
1129
+ id: 'sell',
1130
+ data: [sell],
1131
+ color: theme.color.fgNegative,
1132
+ legendShape: 'circle'
1133
+ }],
1134
+ stackGap: stackGap,
1135
+ transitions: {
1136
+ enter: {
1137
+ type: 'timing',
1138
+ duration: 5000,
1139
+ delay: 2000
1140
+ }
1141
+ },
1142
+ xAxis: _extends({
1143
+ domainLimit: 'strict'
1144
+ }, xAxis),
1145
+ yAxis: _extends({
1146
+ categoryPadding: 0
1147
+ }, yAxis)
1148
+ }, props)), /*#__PURE__*/_jsx(BuyVsSellLegend, {
1149
+ buy: buy,
1150
+ sell: sell
1151
+ })]
1152
+ });
1153
+ }
1154
+ return /*#__PURE__*/_jsx(BuyVsSellChart, {
1155
+ buy: 76,
1156
+ sell: 24
1157
+ });
1158
+ }
1159
+ const PopulationPyramid = () => {
1160
+ const theme = useTheme();
1161
+ const ageGroups = ['100+ yrs', '95-99 yrs', '90-94 yrs', '85-89 yrs', '80-84 yrs', '75-79 yrs', '70-74 yrs', '65-69 yrs', '60-64 yrs', '55-59 yrs', '50-54 yrs', '45-49 yrs', '40-44 yrs', '35-39 yrs', '30-34 yrs', '25-29 yrs', '20-24 yrs', '15-19 yrs', '10-14 yrs', '5-9 yrs', '0-4 yrs'];
1162
+ const malePopulation = [14587, 48604, 83560, 128957, 184152, 248505, 498683, 706420, 852333, 939629, 1002195, 1001264, 960282, 1161371, 1105023, 1061755, 1019343, 1023264, 1026330, 984773, 944071];
1163
+ const femalePopulation = [14122, 46974, 80768, 124663, 178043, 240293, 482271, 683270, 824525, 909115, 969807, 969070, 929571, 1122380, 1068050, 1026356, 985483, 989404, 992505, 952453, 913222];
1164
+ const numberWithSuffixFormatter = useMemo(() => new Intl.NumberFormat('en-US', {
1165
+ notation: 'compact'
1166
+ }), []);
1167
+ const tickLabelFormatter = useCallback(value => numberWithSuffixFormatter.format(Math.abs(value)), [numberWithSuffixFormatter]);
1168
+ const domainSymmetric = useCallback(bounds => {
1169
+ const extremum = Math.max(-bounds.min, bounds.max);
1170
+ const roundedExtremum = Math.ceil(extremum / 100000) * 100000;
1171
+ return {
1172
+ min: -roundedExtremum,
1173
+ max: roundedExtremum
1174
+ };
1175
+ }, []);
1176
+ const series = [{
1177
+ id: 'male',
1178
+ label: 'Male',
1179
+ data: malePopulation.map(population => -population),
1180
+ color: "rgb(" + theme.spectrum.blue40 + ")",
1181
+ stackId: 'population'
1182
+ }, {
1183
+ id: 'female',
1184
+ label: 'Female',
1185
+ data: femalePopulation,
1186
+ color: "rgb(" + theme.spectrum.pink40 + ")",
1187
+ stackId: 'population'
1188
+ }];
1189
+ return /*#__PURE__*/_jsx(VStack, {
1190
+ gap: 2,
1191
+ children: /*#__PURE__*/_jsx(BarChart, {
1192
+ showXAxis: true,
1193
+ showYAxis: true,
1194
+ stacked: true,
1195
+ borderRadius: 2,
1196
+ height: 550,
1197
+ inset: 0,
1198
+ layout: "horizontal",
1199
+ series: series,
1200
+ xAxis: {
1201
+ domain: domainSymmetric,
1202
+ GridLineComponent: ThinSolidLine,
1203
+ showGrid: true,
1204
+ showLine: true,
1205
+ showTickMarks: true,
1206
+ tickLabelFormatter
1207
+ },
1208
+ yAxis: {
1209
+ bandTickMarkPlacement: 'edges',
1210
+ data: ageGroups,
1211
+ position: 'left',
1212
+ showLine: true,
1213
+ showTickMarks: true,
1214
+ width: 80
1215
+ },
1216
+ children: /*#__PURE__*/_jsx(ReferenceLine, {
1217
+ LineComponent: SolidLine,
1218
+ dataX: 0
1219
+ })
1220
+ })
1221
+ });
1222
+ };
1223
+ function ExampleNavigator() {
1224
+ const [currentIndex, setCurrentIndex] = useState(0);
1225
+ const examples = useMemo(() => [{
1226
+ title: 'Basic',
1227
+ component: /*#__PURE__*/_jsx(UpdatingChartValues, {})
1228
+ }, {
1229
+ title: 'Animated Auto-Updating',
1230
+ component: /*#__PURE__*/_jsx(AnimatedUpdatingChartValues, {})
1231
+ }, {
1232
+ title: 'Negative Values with Top Axis',
1233
+ component: /*#__PURE__*/_jsx(NegativeValuesWithTopAxis, {})
1234
+ }, {
1235
+ title: 'Positive and Negative Cash Flow',
1236
+ component: /*#__PURE__*/_jsx(PositiveAndNegativeCashFlow, {})
1237
+ }, {
1238
+ title: 'Fiat & Stablecoin Balance',
1239
+ component: /*#__PURE__*/_jsx(FiatAndStablecoinBalance, {})
1240
+ }, {
1241
+ title: 'Monthly Rewards',
1242
+ component: /*#__PURE__*/_jsx(MonthlyRewards, {})
1243
+ }, {
1244
+ title: 'Multiple Y Axes',
1245
+ component: /*#__PURE__*/_jsx(MultipleYAxes, {})
1246
+ }, {
1247
+ title: 'Y-Axis Continuous ColorMap',
1248
+ component: /*#__PURE__*/_jsx(YAxisContinuousColorMap, {})
1249
+ }, {
1250
+ title: 'Y-Axis Discrete ColorMap',
1251
+ component: /*#__PURE__*/_jsx(YAxisDiscreteColorMap, {})
1252
+ }, {
1253
+ title: 'X-Axis Continuous ColorMap',
1254
+ component: /*#__PURE__*/_jsx(XAxisContinuousColorMap, {})
1255
+ }, {
1256
+ title: 'X-Axis Discrete ColorMap',
1257
+ component: /*#__PURE__*/_jsx(XAxisDiscreteColorMap, {})
1258
+ }, {
1259
+ title: 'X-Axis Multi-Segment ColorMap',
1260
+ component: /*#__PURE__*/_jsx(XAxisMultiSegmentColorMap, {})
1261
+ }, {
1262
+ title: 'ColorMap with Opacity',
1263
+ component: /*#__PURE__*/_jsx(ColorMapWithOpacity, {})
1264
+ }, {
1265
+ title: 'Band Grid Position',
1266
+ component: /*#__PURE__*/_jsxs(VStack, {
1267
+ gap: 2,
1268
+ children: [/*#__PURE__*/_jsx(BandGridPositionExample, {
1269
+ position: "edges"
1270
+ }), /*#__PURE__*/_jsx(BandGridPositionExample, {
1271
+ position: "start"
1272
+ }), /*#__PURE__*/_jsx(BandGridPositionExample, {
1273
+ position: "middle"
1274
+ }), /*#__PURE__*/_jsx(BandGridPositionExample, {
1275
+ position: "end"
1276
+ })]
1277
+ })
1278
+ }, {
1279
+ title: 'Candlesticks',
1280
+ component: /*#__PURE__*/_jsx(Candlesticks, {})
1281
+ }, {
1282
+ title: 'Monthly Sunlight',
1283
+ component: /*#__PURE__*/_jsx(SunlightChart, {})
1284
+ }, {
1285
+ title: 'Price Range',
1286
+ component: /*#__PURE__*/_jsx(PriceRange, {})
1287
+ }, {
1288
+ title: 'Horizontal Layout',
1289
+ component: /*#__PURE__*/_jsx(HorizontalBarChart, {})
1290
+ }, {
1291
+ title: 'Buy vs Sell',
1292
+ component: /*#__PURE__*/_jsx(BuyVsSellExample, {})
1293
+ }, {
1294
+ title: 'Population Pyramid',
1295
+ component: /*#__PURE__*/_jsx(PopulationPyramid, {})
1296
+ }], []);
1297
+ const currentExample = examples[currentIndex];
1298
+ const handlePrevious = useCallback(() => {
1299
+ setCurrentIndex(prev => (prev - 1 + examples.length) % examples.length);
1300
+ }, [examples.length]);
1301
+ const handleNext = useCallback(() => {
1302
+ setCurrentIndex(prev => (prev + 1 + examples.length) % examples.length);
1303
+ }, [examples.length]);
1304
+ return /*#__PURE__*/_jsx(ExampleScreen, {
1305
+ paddingX: 0,
1306
+ children: /*#__PURE__*/_jsxs(VStack, {
1307
+ gap: 4,
1308
+ children: [/*#__PURE__*/_jsxs(HStack, {
1309
+ alignItems: "center",
1310
+ justifyContent: "space-between",
1311
+ padding: 2,
1312
+ children: [/*#__PURE__*/_jsx(IconButton, {
1313
+ accessibilityHint: "Navigate to previous example",
1314
+ accessibilityLabel: "Previous",
1315
+ name: "arrowLeft",
1316
+ onPress: handlePrevious,
1317
+ variant: "secondary"
1318
+ }), /*#__PURE__*/_jsxs(VStack, {
1319
+ alignItems: "center",
1320
+ children: [/*#__PURE__*/_jsx(Text, {
1321
+ font: "title3",
1322
+ children: currentExample.title
1323
+ }), /*#__PURE__*/_jsxs(Text, {
1324
+ color: "fgMuted",
1325
+ font: "label1",
1326
+ children: [currentIndex + 1, " / ", examples.length]
1327
+ })]
1328
+ }), /*#__PURE__*/_jsx(IconButton, {
1329
+ accessibilityHint: "Navigate to next example",
1330
+ accessibilityLabel: "Next",
1331
+ name: "arrowRight",
1332
+ onPress: handleNext,
1333
+ variant: "secondary"
1334
+ })]
1335
+ }), /*#__PURE__*/_jsx(Box, {
1336
+ padding: 1,
1337
+ children: currentExample.component
1338
+ })]
1339
+ })
1340
+ });
1341
+ }
1342
+ export default ExampleNavigator;