@coinbase/cds-mcp-server 8.17.2 → 8.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (284) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/mcp-docs/mobile/components/Accordion.txt +188 -0
  3. package/mcp-docs/mobile/components/AccordionItem.txt +29 -0
  4. package/mcp-docs/mobile/components/Alert.txt +155 -0
  5. package/mcp-docs/mobile/components/AreaChart.txt +265 -0
  6. package/mcp-docs/mobile/components/Avatar.txt +195 -0
  7. package/mcp-docs/mobile/components/AvatarButton.txt +225 -0
  8. package/mcp-docs/mobile/components/Banner.txt +221 -0
  9. package/mcp-docs/mobile/components/BarChart.txt +815 -0
  10. package/mcp-docs/mobile/components/Box.txt +173 -0
  11. package/mcp-docs/mobile/components/BrowserBar.txt +146 -0
  12. package/mcp-docs/mobile/components/Button.txt +198 -0
  13. package/mcp-docs/mobile/components/ButtonGroup.txt +79 -0
  14. package/mcp-docs/mobile/components/Carousel.txt +1083 -0
  15. package/mcp-docs/mobile/components/CartesianChart.txt +825 -0
  16. package/mcp-docs/mobile/components/CellMedia.txt +70 -0
  17. package/mcp-docs/mobile/components/Checkbox.txt +245 -0
  18. package/mcp-docs/mobile/components/CheckboxCell.txt +201 -0
  19. package/mcp-docs/mobile/components/CheckboxGroup.txt +284 -0
  20. package/mcp-docs/mobile/components/Chip.txt +194 -0
  21. package/mcp-docs/mobile/components/Coachmark.txt +157 -0
  22. package/mcp-docs/mobile/components/Collapsible.txt +104 -0
  23. package/mcp-docs/mobile/components/ContainedAssetCard.txt +134 -0
  24. package/mcp-docs/mobile/components/ContentCard.txt +365 -0
  25. package/mcp-docs/mobile/components/ContentCardBody.txt +135 -0
  26. package/mcp-docs/mobile/components/ContentCardFooter.txt +127 -0
  27. package/mcp-docs/mobile/components/ContentCardHeader.txt +145 -0
  28. package/mcp-docs/mobile/components/ContentCell.txt +226 -0
  29. package/mcp-docs/mobile/components/ControlGroup.txt +443 -0
  30. package/mcp-docs/mobile/components/DatePicker.txt +496 -0
  31. package/mcp-docs/mobile/components/Divider.txt +138 -0
  32. package/mcp-docs/mobile/components/DotCount.txt +145 -0
  33. package/mcp-docs/mobile/components/DotStatusColor.txt +58 -0
  34. package/mcp-docs/mobile/components/DotSymbol.txt +134 -0
  35. package/mcp-docs/mobile/components/Fallback.txt +157 -0
  36. package/mcp-docs/mobile/components/FloatingAssetCard.txt +155 -0
  37. package/mcp-docs/mobile/components/HStack.txt +234 -0
  38. package/mcp-docs/mobile/components/HeroSquare.txt +47 -0
  39. package/mcp-docs/mobile/components/Icon.txt +51 -0
  40. package/mcp-docs/mobile/components/IconButton.txt +268 -0
  41. package/mcp-docs/mobile/components/InputChip.txt +187 -0
  42. package/mcp-docs/mobile/components/Interactable.txt +186 -0
  43. package/mcp-docs/mobile/components/LineChart.txt +1324 -0
  44. package/mcp-docs/mobile/components/Link.txt +291 -0
  45. package/mcp-docs/mobile/components/ListCell.txt +412 -0
  46. package/mcp-docs/mobile/components/LogoMark.txt +84 -0
  47. package/mcp-docs/mobile/components/LogoWordMark.txt +93 -0
  48. package/mcp-docs/mobile/components/Lottie.txt +138 -0
  49. package/mcp-docs/mobile/components/LottieStatusAnimation.txt +46 -0
  50. package/mcp-docs/mobile/components/Modal.txt +83 -0
  51. package/mcp-docs/mobile/components/ModalBody.txt +33 -0
  52. package/mcp-docs/mobile/components/ModalFooter.txt +24 -0
  53. package/mcp-docs/mobile/components/ModalHeader.txt +27 -0
  54. package/mcp-docs/mobile/components/MultiContentModule.txt +379 -0
  55. package/mcp-docs/mobile/components/NavigationTitle.txt +131 -0
  56. package/mcp-docs/mobile/components/NavigationTitleSelect.txt +141 -0
  57. package/mcp-docs/mobile/components/NudgeCard.txt +89 -0
  58. package/mcp-docs/mobile/components/Numpad.txt +340 -0
  59. package/mcp-docs/mobile/components/Overlay.txt +151 -0
  60. package/mcp-docs/mobile/components/PageFooter.txt +160 -0
  61. package/mcp-docs/mobile/components/PageHeader.txt +185 -0
  62. package/mcp-docs/mobile/components/PeriodSelector.txt +407 -0
  63. package/mcp-docs/mobile/components/Pictogram.txt +47 -0
  64. package/mcp-docs/mobile/components/Point.txt +204 -0
  65. package/mcp-docs/mobile/components/PortalProvider.txt +78 -0
  66. package/mcp-docs/mobile/components/Pressable.txt +210 -0
  67. package/mcp-docs/mobile/components/ProgressBar.txt +129 -0
  68. package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +160 -0
  69. package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +137 -0
  70. package/mcp-docs/mobile/components/ProgressCircle.txt +236 -0
  71. package/mcp-docs/mobile/components/Radio.txt +241 -0
  72. package/mcp-docs/mobile/components/RadioCell.txt +201 -0
  73. package/mcp-docs/mobile/components/RadioGroup.txt +281 -0
  74. package/mcp-docs/mobile/components/ReferenceLine.txt +152 -0
  75. package/mcp-docs/mobile/components/RemoteImage.txt +105 -0
  76. package/mcp-docs/mobile/components/RemoteImageGroup.txt +60 -0
  77. package/mcp-docs/mobile/components/RollingNumber.txt +788 -0
  78. package/mcp-docs/mobile/components/Scrubber.txt +203 -0
  79. package/mcp-docs/mobile/components/SearchInput.txt +191 -0
  80. package/mcp-docs/mobile/components/SectionHeader.txt +204 -0
  81. package/mcp-docs/mobile/components/SegmentedTabs.txt +315 -0
  82. package/mcp-docs/mobile/components/Select.txt +211 -0
  83. package/mcp-docs/mobile/components/SelectChip.txt +323 -0
  84. package/mcp-docs/mobile/components/SelectOption.txt +84 -0
  85. package/mcp-docs/mobile/components/SlideButton.txt +330 -0
  86. package/mcp-docs/mobile/components/Spacer.txt +83 -0
  87. package/mcp-docs/mobile/components/Sparkline.txt +122 -0
  88. package/mcp-docs/mobile/components/SparklineGradient.txt +106 -0
  89. package/mcp-docs/mobile/components/SparklineInteractive.txt +156 -0
  90. package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +72 -0
  91. package/mcp-docs/mobile/components/Spinner.txt +48 -0
  92. package/mcp-docs/mobile/components/SpotIcon.txt +47 -0
  93. package/mcp-docs/mobile/components/SpotRectangle.txt +47 -0
  94. package/mcp-docs/mobile/components/SpotSquare.txt +47 -0
  95. package/mcp-docs/mobile/components/Stepper.txt +527 -0
  96. package/mcp-docs/mobile/components/SubBrandLogoMark.txt +125 -0
  97. package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +125 -0
  98. package/mcp-docs/mobile/components/Switch.txt +97 -0
  99. package/mcp-docs/mobile/components/TabIndicator.txt +48 -0
  100. package/mcp-docs/mobile/components/TabLabel.txt +153 -0
  101. package/mcp-docs/mobile/components/TabNavigation.txt +146 -0
  102. package/mcp-docs/mobile/components/TabbedChips.txt +142 -0
  103. package/mcp-docs/mobile/components/Tabs.txt +190 -0
  104. package/mcp-docs/mobile/components/Tag.txt +300 -0
  105. package/mcp-docs/mobile/components/Text.txt +211 -0
  106. package/mcp-docs/mobile/components/TextInput.txt +717 -0
  107. package/mcp-docs/mobile/components/ThemeProvider.txt +132 -0
  108. package/mcp-docs/mobile/components/Toast.txt +196 -0
  109. package/mcp-docs/mobile/components/Tooltip.txt +59 -0
  110. package/mcp-docs/mobile/components/TopNavBar.txt +161 -0
  111. package/mcp-docs/mobile/components/Tour.txt +158 -0
  112. package/mcp-docs/mobile/components/Tray.txt +252 -0
  113. package/mcp-docs/mobile/components/UpsellCard.txt +321 -0
  114. package/mcp-docs/mobile/components/VStack.txt +222 -0
  115. package/mcp-docs/mobile/components/XAxis.txt +621 -0
  116. package/mcp-docs/mobile/components/YAxis.txt +567 -0
  117. package/mcp-docs/mobile/getting-started/ai-overview.txt +108 -0
  118. package/mcp-docs/mobile/getting-started/installation.txt +57 -0
  119. package/mcp-docs/mobile/getting-started/introduction.txt +102 -0
  120. package/mcp-docs/mobile/getting-started/playground.txt +28 -0
  121. package/mcp-docs/mobile/getting-started/styling.txt +84 -0
  122. package/mcp-docs/mobile/getting-started/theming.txt +286 -0
  123. package/mcp-docs/mobile/hooks/useDimensions.txt +72 -0
  124. package/mcp-docs/mobile/hooks/useEventHandler.txt +120 -0
  125. package/mcp-docs/mobile/hooks/useMergeRefs.txt +116 -0
  126. package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +280 -0
  127. package/mcp-docs/mobile/hooks/usePreviousValue.txt +74 -0
  128. package/mcp-docs/mobile/hooks/useRefMap.txt +178 -0
  129. package/mcp-docs/mobile/hooks/useTheme.txt +321 -0
  130. package/mcp-docs/mobile/routes.txt +139 -0
  131. package/mcp-docs/web/components/Accordion.txt +189 -0
  132. package/mcp-docs/web/components/AccordionItem.txt +31 -0
  133. package/mcp-docs/web/components/Alert.txt +164 -0
  134. package/mcp-docs/web/components/AreaChart.txt +510 -0
  135. package/mcp-docs/web/components/Avatar.txt +211 -0
  136. package/mcp-docs/web/components/AvatarButton.txt +240 -0
  137. package/mcp-docs/web/components/Banner.txt +226 -0
  138. package/mcp-docs/web/components/BarChart.txt +1267 -0
  139. package/mcp-docs/web/components/Box.txt +175 -0
  140. package/mcp-docs/web/components/Button.txt +212 -0
  141. package/mcp-docs/web/components/ButtonGroup.txt +79 -0
  142. package/mcp-docs/web/components/Calendar.txt +181 -0
  143. package/mcp-docs/web/components/Carousel.txt +1575 -0
  144. package/mcp-docs/web/components/CartesianChart.txt +1044 -0
  145. package/mcp-docs/web/components/CellMedia.txt +56 -0
  146. package/mcp-docs/web/components/Checkbox.txt +188 -0
  147. package/mcp-docs/web/components/CheckboxCell.txt +202 -0
  148. package/mcp-docs/web/components/CheckboxGroup.txt +219 -0
  149. package/mcp-docs/web/components/Chip.txt +196 -0
  150. package/mcp-docs/web/components/Coachmark.txt +188 -0
  151. package/mcp-docs/web/components/Collapsible.txt +119 -0
  152. package/mcp-docs/web/components/ContainedAssetCard.txt +232 -0
  153. package/mcp-docs/web/components/ContentCard.txt +367 -0
  154. package/mcp-docs/web/components/ContentCardBody.txt +137 -0
  155. package/mcp-docs/web/components/ContentCardFooter.txt +129 -0
  156. package/mcp-docs/web/components/ContentCardHeader.txt +147 -0
  157. package/mcp-docs/web/components/ContentCell.txt +219 -0
  158. package/mcp-docs/web/components/ControlGroup.txt +436 -0
  159. package/mcp-docs/web/components/DatePicker.txt +505 -0
  160. package/mcp-docs/web/components/Divider.txt +143 -0
  161. package/mcp-docs/web/components/DotCount.txt +149 -0
  162. package/mcp-docs/web/components/DotStatusColor.txt +58 -0
  163. package/mcp-docs/web/components/DotSymbol.txt +137 -0
  164. package/mcp-docs/web/components/Dropdown.txt +119 -0
  165. package/mcp-docs/web/components/Fallback.txt +163 -0
  166. package/mcp-docs/web/components/FloatingAssetCard.txt +250 -0
  167. package/mcp-docs/web/components/FullscreenAlert.txt +69 -0
  168. package/mcp-docs/web/components/FullscreenModal.txt +145 -0
  169. package/mcp-docs/web/components/FullscreenModalLayout.txt +187 -0
  170. package/mcp-docs/web/components/Grid.txt +236 -0
  171. package/mcp-docs/web/components/GridColumn.txt +209 -0
  172. package/mcp-docs/web/components/HStack.txt +236 -0
  173. package/mcp-docs/web/components/HeroSquare.txt +48 -0
  174. package/mcp-docs/web/components/Icon.txt +145 -0
  175. package/mcp-docs/web/components/IconButton.txt +390 -0
  176. package/mcp-docs/web/components/InputChip.txt +187 -0
  177. package/mcp-docs/web/components/Interactable.txt +193 -0
  178. package/mcp-docs/web/components/LineChart.txt +1576 -0
  179. package/mcp-docs/web/components/Link.txt +243 -0
  180. package/mcp-docs/web/components/ListCell.txt +418 -0
  181. package/mcp-docs/web/components/LogoMark.txt +84 -0
  182. package/mcp-docs/web/components/LogoWordMark.txt +93 -0
  183. package/mcp-docs/web/components/Lottie.txt +157 -0
  184. package/mcp-docs/web/components/LottieStatusAnimation.txt +57 -0
  185. package/mcp-docs/web/components/MediaQueryProvider.txt +108 -0
  186. package/mcp-docs/web/components/Modal.txt +196 -0
  187. package/mcp-docs/web/components/ModalBody.txt +117 -0
  188. package/mcp-docs/web/components/ModalFooter.txt +119 -0
  189. package/mcp-docs/web/components/ModalHeader.txt +123 -0
  190. package/mcp-docs/web/components/MultiContentModule.txt +381 -0
  191. package/mcp-docs/web/components/NavigationBar.txt +102 -0
  192. package/mcp-docs/web/components/NavigationTitle.txt +25 -0
  193. package/mcp-docs/web/components/NavigationTitleSelect.txt +45 -0
  194. package/mcp-docs/web/components/NudgeCard.txt +181 -0
  195. package/mcp-docs/web/components/Overlay.txt +171 -0
  196. package/mcp-docs/web/components/PageFooter.txt +184 -0
  197. package/mcp-docs/web/components/PageHeader.txt +243 -0
  198. package/mcp-docs/web/components/Pagination.txt +499 -0
  199. package/mcp-docs/web/components/PeriodSelector.txt +703 -0
  200. package/mcp-docs/web/components/Pictogram.txt +48 -0
  201. package/mcp-docs/web/components/Point.txt +460 -0
  202. package/mcp-docs/web/components/PortalProvider.txt +76 -0
  203. package/mcp-docs/web/components/Pressable.txt +193 -0
  204. package/mcp-docs/web/components/ProgressBar.txt +163 -0
  205. package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +212 -0
  206. package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +181 -0
  207. package/mcp-docs/web/components/ProgressCircle.txt +443 -0
  208. package/mcp-docs/web/components/Radio.txt +219 -0
  209. package/mcp-docs/web/components/RadioCell.txt +215 -0
  210. package/mcp-docs/web/components/RadioGroup.txt +288 -0
  211. package/mcp-docs/web/components/ReferenceLine.txt +451 -0
  212. package/mcp-docs/web/components/RemoteImage.txt +165 -0
  213. package/mcp-docs/web/components/RemoteImageGroup.txt +86 -0
  214. package/mcp-docs/web/components/RollingNumber.txt +1021 -0
  215. package/mcp-docs/web/components/Scrubber.txt +231 -0
  216. package/mcp-docs/web/components/SearchInput.txt +117 -0
  217. package/mcp-docs/web/components/SectionHeader.txt +217 -0
  218. package/mcp-docs/web/components/SegmentedTabs.txt +324 -0
  219. package/mcp-docs/web/components/Select.txt +224 -0
  220. package/mcp-docs/web/components/SelectChip.txt +314 -0
  221. package/mcp-docs/web/components/SelectOption.txt +165 -0
  222. package/mcp-docs/web/components/Sidebar.txt +349 -0
  223. package/mcp-docs/web/components/SidebarItem.txt +131 -0
  224. package/mcp-docs/web/components/SidebarMoreMenu.txt +30 -0
  225. package/mcp-docs/web/components/Spacer.txt +173 -0
  226. package/mcp-docs/web/components/Sparkline.txt +122 -0
  227. package/mcp-docs/web/components/SparklineGradient.txt +106 -0
  228. package/mcp-docs/web/components/SparklineInteractive.txt +153 -0
  229. package/mcp-docs/web/components/SparklineInteractiveHeader.txt +76 -0
  230. package/mcp-docs/web/components/Spinner.txt +128 -0
  231. package/mcp-docs/web/components/SpotIcon.txt +48 -0
  232. package/mcp-docs/web/components/SpotRectangle.txt +48 -0
  233. package/mcp-docs/web/components/SpotSquare.txt +48 -0
  234. package/mcp-docs/web/components/Stepper.txt +682 -0
  235. package/mcp-docs/web/components/SubBrandLogoMark.txt +125 -0
  236. package/mcp-docs/web/components/SubBrandLogoWordMark.txt +125 -0
  237. package/mcp-docs/web/components/Switch.txt +85 -0
  238. package/mcp-docs/web/components/TabIndicator.txt +48 -0
  239. package/mcp-docs/web/components/TabLabel.txt +158 -0
  240. package/mcp-docs/web/components/TabNavigation.txt +159 -0
  241. package/mcp-docs/web/components/TabbedChips.txt +155 -0
  242. package/mcp-docs/web/components/Table.txt +367 -0
  243. package/mcp-docs/web/components/TableBody.txt +83 -0
  244. package/mcp-docs/web/components/TableCaption.txt +102 -0
  245. package/mcp-docs/web/components/TableCell.txt +165 -0
  246. package/mcp-docs/web/components/TableCellFallback.txt +97 -0
  247. package/mcp-docs/web/components/TableFooter.txt +83 -0
  248. package/mcp-docs/web/components/TableHeader.txt +100 -0
  249. package/mcp-docs/web/components/TableRow.txt +140 -0
  250. package/mcp-docs/web/components/Tabs.txt +212 -0
  251. package/mcp-docs/web/components/Tag.txt +304 -0
  252. package/mcp-docs/web/components/Text.txt +232 -0
  253. package/mcp-docs/web/components/TextInput.txt +652 -0
  254. package/mcp-docs/web/components/ThemeProvider.txt +199 -0
  255. package/mcp-docs/web/components/TileButton.txt +158 -0
  256. package/mcp-docs/web/components/Toast.txt +203 -0
  257. package/mcp-docs/web/components/Tooltip.txt +89 -0
  258. package/mcp-docs/web/components/Tour.txt +179 -0
  259. package/mcp-docs/web/components/Tray.txt +288 -0
  260. package/mcp-docs/web/components/UpsellCard.txt +319 -0
  261. package/mcp-docs/web/components/VStack.txt +224 -0
  262. package/mcp-docs/web/components/XAxis.txt +619 -0
  263. package/mcp-docs/web/components/YAxis.txt +548 -0
  264. package/mcp-docs/web/getting-started/ai-overview.txt +108 -0
  265. package/mcp-docs/web/getting-started/installation.txt +103 -0
  266. package/mcp-docs/web/getting-started/introduction.txt +102 -0
  267. package/mcp-docs/web/getting-started/playground.txt +28 -0
  268. package/mcp-docs/web/getting-started/styling.txt +161 -0
  269. package/mcp-docs/web/getting-started/templates.txt +121 -0
  270. package/mcp-docs/web/getting-started/theming.txt +426 -0
  271. package/mcp-docs/web/hooks/useBreakpoints.txt +61 -0
  272. package/mcp-docs/web/hooks/useDimensions.txt +114 -0
  273. package/mcp-docs/web/hooks/useEventHandler.txt +120 -0
  274. package/mcp-docs/web/hooks/useHasMounted.txt +75 -0
  275. package/mcp-docs/web/hooks/useIsoEffect.txt +58 -0
  276. package/mcp-docs/web/hooks/useMediaQuery.txt +114 -0
  277. package/mcp-docs/web/hooks/useMergeRefs.txt +116 -0
  278. package/mcp-docs/web/hooks/useOverlayContentContext.txt +279 -0
  279. package/mcp-docs/web/hooks/usePreviousValue.txt +74 -0
  280. package/mcp-docs/web/hooks/useRefMap.txt +178 -0
  281. package/mcp-docs/web/hooks/useScrollBlocker.txt +82 -0
  282. package/mcp-docs/web/hooks/useTheme.txt +364 -0
  283. package/mcp-docs/web/routes.txt +163 -0
  284. package/package.json +1 -1
@@ -0,0 +1,407 @@
1
+ # PeriodSelector
2
+
3
+ A selector component for choosing time periods in charts.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { PeriodSelector } from '@coinbase/cds-mobile-visualization'
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ ### Basic Example
14
+
15
+ ```jsx
16
+ function BasicExample() {
17
+ const tabs = [
18
+ { id: '1H', label: '1H' },
19
+ { id: '1D', label: '1D' },
20
+ { id: '1W', label: '1W' },
21
+ { id: '1M', label: '1M' },
22
+ { id: '1Y', label: '1Y' },
23
+ { id: 'All', label: 'All' },
24
+ ];
25
+
26
+ const [activeTab, setActiveTab] = useState(tabs[0]);
27
+
28
+ return <PeriodSelector activeTab={activeTab} onChange={setActiveTab} tabs={tabs} />;
29
+ }
30
+ ```
31
+
32
+ ### Minimum Width
33
+
34
+ You can set the `width` prop to `fit-content` to make the period selector as small as possible.
35
+
36
+ ```jsx
37
+ function MinimumWidthExample() {
38
+ const tabs = [
39
+ { id: '1W', label: '1W' },
40
+ { id: '1M', label: '1M' },
41
+ { id: 'YTD', label: 'YTD' },
42
+ ];
43
+
44
+ const [activeTab, setActiveTab] = useState(tabs[0]);
45
+
46
+ return (
47
+ <PeriodSelector
48
+ activeTab={activeTab}
49
+ onChange={setActiveTab}
50
+ tabs={tabs}
51
+ width="fit-content"
52
+ gap={0.5}
53
+ />
54
+ );
55
+ }
56
+ ```
57
+
58
+ ### Many Periods with Overflow
59
+
60
+ ```jsx
61
+ function ManyPeriodsExample() {
62
+ const tabs = useMemo(
63
+ () => [
64
+ {
65
+ id: '1H',
66
+ label: <LiveTabLabel />,
67
+ },
68
+ { id: '1D', label: '1D' },
69
+ { id: '1W', label: '1W' },
70
+ { id: '1M', label: '1M' },
71
+ { id: 'YTD', label: 'YTD' },
72
+ { id: '1Y', label: '1Y' },
73
+ { id: '5Y', label: '5Y' },
74
+ { id: 'All', label: 'All' },
75
+ ],
76
+ [],
77
+ );
78
+
79
+ const [activeTab, setActiveTab] = useState(tabs[0]);
80
+ const isLive = useMemo(() => activeTab?.id === '1H', [activeTab]);
81
+
82
+ const activeBackground = useMemo(() => (!isLive ? 'bgPrimaryWash' : 'bgNegativeWash'), [isLive]);
83
+
84
+ return (
85
+ <HStack alignItems="center" justifyContent="space-between" maxWidth="100%" width="100%">
86
+ <ScrollView
87
+ horizontal
88
+ contentContainerStyle={{ paddingEnd: 8, flexGrow: 1 }}
89
+ showsHorizontalScrollIndicator={false}
90
+ >
91
+ <PeriodSelector
92
+ activeBackground={activeBackground}
93
+ activeTab={activeTab}
94
+ gap={1}
95
+ justifyContent="flex-start"
96
+ onChange={setActiveTab}
97
+ tabs={tabs}
98
+ width="fit-content"
99
+ />
100
+ </ScrollView>
101
+ <IconButton
102
+ compact
103
+ accessibilityLabel="Configure chart"
104
+ flexShrink={0}
105
+ name="filter"
106
+ variant="secondary"
107
+ />
108
+ </HStack>
109
+ );
110
+ }
111
+ ```
112
+
113
+ ### Live Indicator
114
+
115
+ ```jsx
116
+ function LiveExample() {
117
+ const tabs = useMemo(
118
+ () => [
119
+ // LiveTabLabel is exported from PeriodSelector
120
+ { id: '1H', label: <LiveTabLabel /> },
121
+ { id: '1D', label: '1D' },
122
+ { id: '1W', label: '1W' },
123
+ { id: '1M', label: '1M' },
124
+ { id: '1Y', label: '1Y' },
125
+ { id: 'All', label: 'All' },
126
+ ],
127
+ [],
128
+ );
129
+
130
+ const [activeTab, setActiveTab] = useState(tabs[0]);
131
+ const isLive = useMemo(() => activeTab?.id === '1H', [activeTab]);
132
+
133
+ const activeBackground = useMemo(() => (isLive ? 'bgNegativeWash' : 'bgPrimaryWash'), [isLive]);
134
+
135
+ return (
136
+ <PeriodSelector
137
+ activeBackground={activeBackground}
138
+ activeTab={activeTab}
139
+ onChange={setActiveTab}
140
+ tabs={tabs}
141
+ />
142
+ );
143
+ }
144
+ ```
145
+
146
+ ### Customization
147
+
148
+ #### Custom Colors
149
+
150
+ ```jsx
151
+ function ColoredBTCExample() {
152
+ const btcColor = assets.btc.color;
153
+
154
+ // Custom active indicator with BTC color
155
+ const BTCActiveIndicator = memo((props) => {
156
+ const theme = useTheme();
157
+ const { activeTab } = useTabsContext();
158
+ const isLive = useMemo(() => activeTab?.id === '1H', [activeTab]);
159
+
160
+ const backgroundColor = useMemo(
161
+ () => (isLive ? theme.color.bgNegativeWash : `${btcColor}1A`),
162
+ [isLive, theme.color.bgNegativeWash],
163
+ );
164
+
165
+ return <PeriodSelectorActiveIndicator {...props} background={backgroundColor} />;
166
+ });
167
+
168
+ // Custom tab component with BTC color
169
+ const BTCTab = memo(
170
+ forwardRef(({ label, ...props }, ref) => {
171
+ const { activeTab } = useTabsContext();
172
+ const isActive = activeTab?.id === props.id;
173
+ const theme = useTheme();
174
+
175
+ const wrappedLabel =
176
+ typeof label === 'string' ? (
177
+ <TextLabel1 dangerouslySetColor={isActive ? btcColor : theme.color.fg}>
178
+ {label}
179
+ </TextLabel1>
180
+ ) : (
181
+ label
182
+ );
183
+
184
+ return <SegmentedTab ref={ref} label={wrappedLabel} {...props} />;
185
+ }),
186
+ );
187
+
188
+ // Custom live label with BTC color
189
+ const BTCLiveLabel = memo(
190
+ forwardRef(({ label = 'LIVE', font = 'label1', hideDot, style, ...props }, ref) => {
191
+ const theme = useTheme();
192
+
193
+ const dotStyle = useMemo(
194
+ () => ({
195
+ width: theme.space[1],
196
+ height: theme.space[1],
197
+ borderRadius: 1000,
198
+ marginRight: theme.space[0.75],
199
+ backgroundColor: btcColor,
200
+ }),
201
+ [theme.space],
202
+ );
203
+
204
+ return (
205
+ <View
206
+ ref={ref}
207
+ style={[
208
+ {
209
+ flexDirection: 'row',
210
+ alignItems: 'center',
211
+ },
212
+ style,
213
+ ]}
214
+ >
215
+ {!hideDot && <View style={dotStyle} />}
216
+ <Text font={font} style={{ color: btcColor }} {...props}>
217
+ {label}
218
+ </Text>
219
+ </View>
220
+ );
221
+ }),
222
+ );
223
+
224
+ const tabs = [
225
+ { id: '1H', label: <BTCLiveLabel /> },
226
+ { id: '1D', label: '1D' },
227
+ { id: '1W', label: '1W' },
228
+ { id: '1M', label: '1M' },
229
+ { id: '1Y', label: '1Y' },
230
+ { id: 'All', label: 'All' },
231
+ ];
232
+ const [activeTab, setActiveTab] = useState(tabs[0]);
233
+
234
+ return (
235
+ <PeriodSelector
236
+ TabComponent={BTCTab}
237
+ TabsActiveIndicatorComponent={BTCActiveIndicator}
238
+ activeTab={activeTab}
239
+ onChange={setActiveTab}
240
+ tabs={tabs}
241
+ />
242
+ );
243
+ }
244
+ ```
245
+
246
+ #### Custom Colors Excluding Live
247
+
248
+ Customize colors for regular periods while keeping the default red styling for live periods.
249
+
250
+ ```jsx
251
+ function ColoredExcludingLiveExample() {
252
+ const btcColor = assets.btc.color;
253
+
254
+ // Custom active indicator that only applies BTC color to non-live periods
255
+ const BTCActiveExcludingLiveIndicator = memo((props) => {
256
+ const theme = useTheme();
257
+ const { activeTab } = useTabsContext();
258
+ const isLive = useMemo(() => activeTab?.id === '1H', [activeTab]);
259
+
260
+ const backgroundColor = useMemo(
261
+ () => (isLive ? theme.color.bgNegativeWash : `${btcColor}1A`),
262
+ [isLive, theme.color.bgNegativeWash],
263
+ );
264
+
265
+ return <PeriodSelectorActiveIndicator {...props} background={backgroundColor} />;
266
+ });
267
+
268
+ // Custom tab component with BTC color
269
+ const BTCTab = memo(
270
+ forwardRef(({ label, ...props }, ref) => {
271
+ const { activeTab } = useTabsContext();
272
+ const isActive = activeTab?.id === props.id;
273
+ const theme = useTheme();
274
+
275
+ const wrappedLabel =
276
+ typeof label === 'string' ? (
277
+ <TextLabel1 dangerouslySetColor={isActive ? btcColor : theme.color.fg}>
278
+ {label}
279
+ </TextLabel1>
280
+ ) : (
281
+ label
282
+ );
283
+
284
+ return <SegmentedTab ref={ref} label={wrappedLabel} {...props} />;
285
+ }),
286
+ );
287
+
288
+ const tabs = [
289
+ { id: '1H', label: <LiveTabLabel /> },
290
+ { id: '1D', label: '1D' },
291
+ { id: '1W', label: '1W' },
292
+ { id: '1M', label: '1M' },
293
+ { id: '1Y', label: '1Y' },
294
+ { id: 'All', label: 'All' },
295
+ ];
296
+ const [activeTab, setActiveTab] = useState(tabs[0]);
297
+
298
+ return (
299
+ <PeriodSelector
300
+ TabComponent={BTCTab}
301
+ TabsActiveIndicatorComponent={BTCActiveExcludingLiveIndicator}
302
+ activeTab={activeTab}
303
+ onChange={setActiveTab}
304
+ tabs={tabs}
305
+ />
306
+ );
307
+ }
308
+ ```
309
+
310
+ ## Props
311
+
312
+ | Prop | Type | Required | Default | Description |
313
+ | --- | --- | --- | --- | --- |
314
+ | `activeTabRect` | `Rect` | Yes | `-` | - |
315
+ | `alignContent` | `flex-start \| flex-end \| center \| stretch \| space-between \| space-around \| space-evenly` | No | `-` | - |
316
+ | `alignItems` | `flex-start \| flex-end \| center \| stretch \| baseline` | No | `-` | - |
317
+ | `alignSelf` | `auto \| FlexAlignType` | No | `-` | - |
318
+ | `animated` | `boolean` | No | `-` | - |
319
+ | `aspectRatio` | `string \| number` | No | `-` | - |
320
+ | `background` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `bgPrimaryWash` | - |
321
+ | `borderBottomLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
322
+ | `borderBottomRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
323
+ | `borderBottomWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
324
+ | `borderColor` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
325
+ | `borderEndWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
326
+ | `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `1000` | - |
327
+ | `borderStartWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
328
+ | `borderTopLeftRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
329
+ | `borderTopRightRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `-` | - |
330
+ | `borderTopWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
331
+ | `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `-` | - |
332
+ | `bordered` | `boolean` | No | `-` | Add a border around all sides of the box. |
333
+ | `borderedBottom` | `boolean` | No | `-` | Add a border to the bottom side of the box. |
334
+ | `borderedEnd` | `boolean` | No | `-` | Add a border to the trailing side of the box. |
335
+ | `borderedHorizontal` | `boolean` | No | `-` | Add a border to the leading and trailing sides of the box. |
336
+ | `borderedStart` | `boolean` | No | `-` | Add a border to the leading side of the box. |
337
+ | `borderedTop` | `boolean` | No | `-` | Add a border to the top side of the box. |
338
+ | `borderedVertical` | `boolean` | No | `-` | Add a border to the top and bottom sides of the box. |
339
+ | `bottom` | `string \| number` | No | `-` | - |
340
+ | `color` | `currentColor \| fg \| fgMuted \| fgInverse \| fgPrimary \| fgWarning \| fgPositive \| fgNegative \| bg \| bgAlternate \| bgInverse \| bgOverlay \| bgElevation1 \| bgElevation2 \| bgPrimary \| bgPrimaryWash \| bgSecondary \| bgTertiary \| bgSecondaryWash \| bgNegative \| bgNegativeWash \| bgPositive \| bgPositiveWash \| bgWarning \| bgWarningWash \| bgLine \| bgLineHeavy \| bgLineInverse \| bgLinePrimary \| bgLinePrimarySubtle \| accentSubtleRed \| accentBoldRed \| accentSubtleGreen \| accentBoldGreen \| accentSubtleBlue \| accentBoldBlue \| accentSubtlePurple \| accentBoldPurple \| accentSubtleYellow \| accentBoldYellow \| accentSubtleGray \| accentBoldGray \| transparent` | No | `-` | - |
341
+ | `columnGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
342
+ | `dangerouslySetBackground` | `string` | No | `-` | - |
343
+ | `display` | `flex \| none` | No | `-` | - |
344
+ | `elevation` | `0 \| 1 \| 2` | No | `-` | Determines box shadow styles. Parent should have overflow set to visible to ensure styles are not clipped. |
345
+ | `flexBasis` | `string \| number` | No | `-` | - |
346
+ | `flexDirection` | `row \| column \| row-reverse \| column-reverse` | No | `-` | - |
347
+ | `flexGrow` | `number` | No | `-` | - |
348
+ | `flexShrink` | `number` | No | `-` | - |
349
+ | `flexWrap` | `wrap \| nowrap \| wrap-reverse` | No | `-` | - |
350
+ | `font` | `inherit \| FontFamily` | No | `-` | - |
351
+ | `fontFamily` | `inherit \| FontFamily` | No | `-` | - |
352
+ | `fontSize` | `inherit \| FontSize` | No | `-` | - |
353
+ | `fontWeight` | `inherit \| FontWeight` | No | `-` | - |
354
+ | `gap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
355
+ | `height` | `string \| number` | No | `-` | - |
356
+ | `justifyContent` | `flex-start \| flex-end \| center \| space-between \| space-around \| space-evenly` | No | `-` | - |
357
+ | `left` | `string \| number` | No | `-` | - |
358
+ | `lineHeight` | `inherit \| LineHeight` | No | `-` | - |
359
+ | `margin` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
360
+ | `marginBottom` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
361
+ | `marginEnd` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
362
+ | `marginStart` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
363
+ | `marginTop` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
364
+ | `marginX` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
365
+ | `marginY` | `0 \| -1 \| -2 \| -3 \| -4 \| -5 \| -6 \| -7 \| -8 \| -9 \| -10 \| -0.25 \| -0.5 \| -0.75 \| -1.5` | No | `-` | - |
366
+ | `maxHeight` | `string \| number` | No | `-` | - |
367
+ | `maxWidth` | `string \| number` | No | `-` | - |
368
+ | `minHeight` | `string \| number` | No | `-` | - |
369
+ | `minWidth` | `string \| number` | No | `-` | - |
370
+ | `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
371
+ | `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
372
+ | `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
373
+ | `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
374
+ | `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
375
+ | `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
376
+ | `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
377
+ | `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
378
+ | `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
379
+ | `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
380
+ | `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
381
+ | `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
382
+ | `opacity` | `number \| AnimatedNode` | No | `-` | - |
383
+ | `overflow` | `visible \| hidden \| scroll` | No | `-` | - |
384
+ | `padding` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
385
+ | `paddingBottom` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
386
+ | `paddingEnd` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
387
+ | `paddingStart` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
388
+ | `paddingTop` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
389
+ | `paddingX` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
390
+ | `paddingY` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
391
+ | `pin` | `top \| bottom \| left \| right \| all` | No | `-` | Direction in which to absolutely pin the box. |
392
+ | `position` | `absolute \| relative \| static \| fixed \| sticky` | No | `absolute` | - |
393
+ | `right` | `string \| number` | No | `-` | - |
394
+ | `rowGap` | `0 \| 1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 7 \| 8 \| 9 \| 10 \| 0.25 \| 0.5 \| 0.75 \| 1.5` | No | `-` | - |
395
+ | `style` | `false \| RegisteredStyle<ViewStyle> \| Value \| AnimatedInterpolation<string \| number> \| WithAnimatedObject<ViewStyle> \| WithAnimatedArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle> \| RecursiveArray<Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>> \| readonly (Falsy \| ViewStyle \| RegisteredStyle<ViewStyle>)[]> \| null` | No | `-` | - |
396
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Used to locate this view in end-to-end tests. |
397
+ | `textAlign` | `auto \| left \| right \| center \| justify` | No | `-` | - |
398
+ | `textDecorationLine` | `none \| underline \| line-through \| underline line-through` | No | `-` | - |
399
+ | `textDecorationStyle` | `solid \| dotted \| dashed \| double` | No | `-` | - |
400
+ | `textTransform` | `none \| capitalize \| uppercase \| lowercase` | No | `-` | - |
401
+ | `top` | `string \| number` | No | `-` | - |
402
+ | `transform` | `string \| (({ scaleX: AnimatableNumericValue; } & { scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scaleY: AnimatableNumericValue; } & { scaleX?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateX: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ translateY: AnimatableNumericValue \| ${number}%; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ perspective: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotate: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ rotateZ: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ scale: AnimatableNumericValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; skewX?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewX: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewY?: undefined; matrix?: undefined; }) \| ({ skewY: AnimatableStringValue; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; matrix?: undefined; }) \| ({ matrix: AnimatableNumericValue[]; } & { scaleX?: undefined; scaleY?: undefined; translateX?: undefined; translateY?: undefined; perspective?: undefined; rotate?: undefined; rotateX?: undefined; rotateY?: undefined; rotateZ?: undefined; scale?: undefined; skewX?: undefined; skewY?: undefined; }))[]` | No | `-` | - |
403
+ | `userSelect` | `auto \| none \| text \| contain \| all` | No | `-` | - |
404
+ | `width` | `string \| number` | No | `-` | - |
405
+ | `zIndex` | `number` | No | `-` | - |
406
+
407
+
@@ -0,0 +1,47 @@
1
+ # Pictogram
2
+
3
+ Displays elevated product icons.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Pictogram } from '@coinbase/cds-mobile/illustrations/Pictogram'
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ ### Basic example
14
+
15
+ ```jsx
16
+ <Pictogram name="shield" dimension="64x64" />
17
+ ```
18
+
19
+ ### `scaleMultiplier` prop
20
+
21
+ If no predefined dimensions fit your use case, you can use the `scaleMultiplier` prop to scale the illustration.
22
+
23
+ Use `scaleMultiplier` sparingly and with caution. We have predefined dimensions to ensure that illustrations scale elegantly.
24
+
25
+ ```jsx
26
+ <Pictogram name="shield" scaleMultiplier={1.5} />
27
+ ```
28
+
29
+ ### Scaling with dimension
30
+
31
+ If `dimension` and `scaleMultiplier` are both provided the component will scale based on the provided dimension.
32
+
33
+ ```jsx
34
+ <Pictogram name="shield" dimension="48x48" scaleMultiplier={2.5} />
35
+ ```
36
+
37
+ ## Props
38
+
39
+ | Prop | Type | Required | Default | Description |
40
+ | --- | --- | --- | --- | --- |
41
+ | `name` | `key \| done \| cardSuccess \| warning \| error \| add \| browser \| calculator \| calendar \| checkmark \| clock \| coinbaseOneLogo \| derivativesProduct \| email \| gasFees \| identityCard \| instantUnstakingClock \| laptop \| learningRewardsProduct \| lock \| passport \| paypal \| phone \| planet \| safe \| securityKey \| settings \| shield \| support \| taxes \| tokenSales \| trading \| verifiedPools \| wallet \| 2fa \| accountsNavigation \| accreditedInvestor \| addCard \| addPayment \| addPhone \| addressBook \| addToWatchlist \| addWallet \| advancedTradingDesktop \| advancedTradingNavigation \| advancedTradingRebates \| agent \| alerts \| alertsCoinbaseOne \| analyticsNavigation \| apartOfDropsNft \| applyForHigherLimits \| apyInterest \| assetEncryption \| assetHubNavigation \| assetManagement \| assetManagementNavigation \| assetMeasurements \| assetMovement \| authenticationApp \| authenticator \| authenticatorAlt \| authenticatorProgress \| avatarAa \| avatarAb \| avatarAc \| avatarAd \| avatarAe \| avatarAf \| avatarAg \| avatarAh \| avatarAi \| avatarAj \| avatarBa \| avatarBb \| avatarBc \| avatarBd \| avatarBe \| avatarBf \| avatarBg \| avatarBh \| avatarBi \| avatarBj \| avatarCa \| avatarCb \| avatarCc \| avatarCd \| avatarCe \| avatarCf \| avatarCg \| avatarCh \| avatarCi \| avatarCj \| avatarDa \| avatarDb \| avatarDc \| avatarDd \| avatarDe \| avatarDf \| avatarDg \| avatarDh \| avatarDi \| avatarDj \| avatarEa \| avatarEb \| avatarEc \| avatarEd \| avatarEe \| avatarEf \| avatarEg \| avatarEh \| avatarEi \| avatarEj \| avatarFa \| avatarFb \| avatarFc \| avatarFd \| avatarFe \| avatarFf \| avatarFg \| avatarFh \| avatarFi \| avatarFj \| avatarGa \| avatarGb \| avatarGc \| avatarGd \| avatarGe \| avatarGf \| avatarGg \| avatarGh \| avatarGi \| avatarGj \| avatarHa \| avatarHb \| avatarHc \| avatarHd \| avatarHe \| avatarHf \| avatarHg \| avatarHh \| avatarHi \| avatarHj \| avatarIa \| avatarIb \| avatarIc \| avatarId \| avatarIe \| avatarIf \| avatarIg \| avatarIh \| avatarIi \| avatarIj \| avatarJa \| avatarJb \| avatarJc \| avatarJd \| avatarJe \| avatarJf \| avatarJg \| avatarJh \| avatarJi \| avatarJj \| barChart \| baseChartSmall \| baseCheckSmall \| baseCoinCryptoSmall \| baseCoinNetworkSmall \| baseCoinStack \| baseConnectApps \| baseConnectSmall \| baseDecentralizationSmall \| baseDiamondSmall \| baseDiamondTrophy \| baseEmptySmall \| baseErrorButterflySmall \| baseErrorSmall \| baseLoadingSmall \| baseLocationSmall \| baseLogo \| baseLogoNavigation \| baseMessaging \| baseMintNftSmall \| baseNetworkSmall \| baseNftSmall \| basePaycoinSmall \| basePeopleSmall \| basePiechartSmall \| baseSecuritySmall \| baseSendSmall \| baseSignin \| baseTargetSmall \| bitcoin \| bitcoinPizza \| bitcoinRewards \| bitcoinWhitePaper \| blockchainConnection \| bonusFivePercent \| bonusTwoPercent \| borrowCoins \| borrowingLending \| borrowNavigation \| browserMultiPlatform \| browserTransaction \| bundle \| businessProduct \| calendarCaution \| candleSticksGraph \| cardBlocked \| cardDeclined \| cardNavigation \| cb1BankTransfers \| chart \| chat \| cloudNavigation \| coinbaseLogoAdvancedBrand \| coinbaseLogoNavigation \| coinbaseOneAuthenticator \| coinbaseOneChat \| coinbaseOneEarn \| coinbaseOneEarnCoins \| coinbaseOneEarnCoinsLogo \| coinbaseOneFiat \| coinbaseOneProductIcon \| coinbaseOneProductInvestWeekly \| coinbaseOneRefreshed \| coinbaseOneShield \| coinbaseOneTrade \| coinbaseOneTrusted \| coinbaseOneUnlimitedRewards \| coinbaseUnlockOffers \| coinbaseWalletApp \| coinFocus \| coinShare \| coldStorageCheck \| collectionOfAssets \| commerceCheckout \| commerceInvoice \| commerceNavigation \| completeQuiz \| complianceNavigation \| congratulations \| connectNavigation \| contactInfo \| controlWalletStorage \| creative \| creditCard \| crypto101 \| cryptoCard \| cryptoFolder \| custodialJourney \| custodyNavigation \| dataMarketplaceNavigation \| decentralizationEverything \| decentralizedExchange \| decentralizedIdentity \| decentralizedWeb3 \| defiEarnMoment \| delegate \| delegateNavigation \| derivativesNavigation \| developerPlatformNavigation \| developerSDKNavigation \| directDepositNavigation \| dollarShowcase \| driversLicense \| driversLicenseWheel \| earnCoins \| earnGraph \| earnNavigation \| easyToUse \| economyGlobal \| emailAndMessages \| enableVoting \| envelope \| ethereumFocus \| ethRewards \| ethStaking \| ethStakingChart \| ethStakingRewards \| ethToken \| exchangeNavigation \| explore \| fast \| faucetNavigation \| feesRestriction \| fiat \| finance \| findYourSelection \| formDownload \| futures \| futuresCoinbaseOne \| gem \| genericCountryIDCard \| getStarted \| giftbox \| globalConnections \| globalPayments \| globalTransactions \| googleAuthenticator \| governance \| hardwareWallet \| helpCenterNavigation \| higherLimits \| holdingCoin \| idBlock \| idError \| idVerification \| increaseLimits \| institutionalNavigation \| institutions \| internationalExchangeNavigation \| internet \| investGraph \| laptopCharts \| laptopVideo \| layerNetworks \| leadGraph \| learn \| learningRewardsNavigation \| lightbulbLearn \| lightningNetworkSend \| linkYourAccount \| listingFees \| locationUsa \| lowFees \| manageWeb3SignersAcct \| miningCoins \| mintedNft \| mobileCharts \| mobileError \| mobileNotifcation \| mobileSuccess \| mobileWarning \| moneyEarn \| moneySwift \| monitoringPerformance \| moreThanBitcoin \| multiAccountsAndCards \| multiPlatform \| multipleAssets \| musicAndSounds \| myNumberCard \| newUserChecklistBuyCrypto \| newUserChecklistCompleteAccount \| newUserChecklistVerifyId \| nftAvatar \| nftLibrary \| nftNavigation \| noAnnualFee \| noNftFound \| notificationHubAnalysis \| notificationHubNews \| notificationHubPortfolio \| notificationHubSocial \| notifications \| noVisibility \| noWiFi \| orders \| outage \| partialCoins \| participateNavigation \| passwordWalletLocked \| payNavigation \| peerToPeer \| pieChart \| pizza \| pluginBrowser \| positiveReviews \| predictionMarkets \| premiumInvestor \| priceTracking \| primeMobileApp \| primeNavigation \| privateClientNavigation \| proNavigation \| protectionPlan \| queryTransactNavigation \| receipt \| recurringPurchases \| restaking \| reviewAndAdd \| rewardsNavigation \| riskStaking \| rosettaNavigation \| securedAssets \| security \| securityCoinShield \| seedPhrase \| selectAddNft \| selfCustodyWallet \| selfServe \| sellSendAnytime \| sendPaymentToOthers \| settled \| sideChainSide \| signInNavigation \| smsAuthenticate \| sparkleCoinbaseOne \| ssnCard \| stableCoinMetaphor \| stacking \| stakingGraph \| standWithCryptoLogoNavigation \| startToday \| strongInfo \| strongWarning \| successPhone \| supportChat \| takeQuiz \| target \| taxBeta \| taxCenterNavigation \| taxesArrangement \| taxSeason \| timingCheck \| tokenBaskets \| transferSend \| transistor \| trendingAssets \| trusted \| tryAgainLater \| twoBonus \| typeScript \| ubiKey \| usaProduct \| usdcEarn \| usdcInterest \| usdcLoan \| usdcLogo \| usdcRewards \| usdcRewardsRibbon \| usdcToken \| venturesNavigation \| videoCalendar \| videoContent \| waiting \| waitingForConsensus \| walletAsServiceNavigation \| walletDeposit \| walletError \| walletExchange \| walletLinkNavigation \| walletLogoNavigation \| walletNavigation \| walletPassword \| walletSuccess \| walletWarning \| winBTC \| worldwide \| wrapEth` | Yes | `-` | Name of illustration as defined in Figma |
42
+ | `dimension` | `48x48 \| 64x64` | No | `-` | HeroSquare Default: 240x240 SpotSquare Default: 96x96 Pictogram Default: 48x48 SpotRectangle Default: 240x120 |
43
+ | `fallback` | `ReactElement<any, string \| JSXElementConstructor<any>> \| null` | No | `null` | Fallback element to render if unable to find an illustration with the matching name |
44
+ | `scaleMultiplier` | `number` | No | `-` | Multiply the width & height while maintaining aspect ratio |
45
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
46
+
47
+
@@ -0,0 +1,204 @@
1
+ # Point
2
+
3
+ Visual markers that highlight specific data values on a chart. Points can be customized with different colors, sizes, and interactivity.
4
+
5
+ ## Import
6
+
7
+ ```tsx
8
+ import { Point } from '@coinbase/cds-mobile-visualization'
9
+ ```
10
+
11
+ ## Examples
12
+
13
+ ### Basic Example
14
+
15
+ Points are visual markers that highlight specific data values on a chart. They can be used to emphasize important data points, show discrete values, or provide interactive elements.
16
+
17
+ ```jsx
18
+ <LineChart
19
+ enableScrubbing
20
+ height={{ base: 150, tablet: 200, desktop: 250 }}
21
+ series={[
22
+ {
23
+ id: 'prices',
24
+ data: [10, 22, 29, 45, 98, 45, 22, 52, 21, 4, 68, 20, 21, 58],
25
+ },
26
+ ]}
27
+ curve="monotone"
28
+ showYAxis
29
+ showArea
30
+ yAxis={{
31
+ showGrid: true,
32
+ }}
33
+ renderPoints={() => true}
34
+ >
35
+ <Scrubber />
36
+ </LineChart>
37
+ ```
38
+
39
+ ### Conditional Points
40
+
41
+ You can conditionally render points to highlight specific values in your data, such as maximum/minimum values or outliers.
42
+
43
+ ```jsx
44
+ function AssetPriceWithMinMax() {
45
+ const data = sparklineInteractiveData.hour.map((d) => d.value);
46
+
47
+ const minPrice = Math.min(...data);
48
+ const maxPrice = Math.max(...data);
49
+
50
+ const formatPrice = useCallback((price: number) => {
51
+ return new Intl.NumberFormat('en-US', {
52
+ style: 'currency',
53
+ currency: 'USD',
54
+ }).format(price);
55
+ }, []);
56
+
57
+ return (
58
+ <LineChart
59
+ series={[
60
+ {
61
+ id: 'btc',
62
+ data: data,
63
+ color: assets.btc.color,
64
+ },
65
+ ]}
66
+ showArea
67
+ areaType="dotted"
68
+ height={{ base: 150, tablet: 200, desktop: 250 }}
69
+ style={{ outlineColor: assets.btc.color }}
70
+ renderPoints={({ dataX, dataY }) => {
71
+ const isMin = dataY === minPrice;
72
+ const isMax = dataY === maxPrice;
73
+
74
+ if (isMin) {
75
+ return { label: formatPrice(dataY), labelProps: { dy: 6, verticalAlignment: 'top' } };
76
+ }
77
+
78
+ if (isMax) {
79
+ return { label: formatPrice(dataY), labelProps: { dy: -6, verticalAlignment: 'bottom' } };
80
+ }
81
+ }}
82
+ />
83
+ );
84
+ };
85
+ ```
86
+
87
+ ### Interactive Points
88
+
89
+ Points can be made interactive by adding click handlers, allowing users to explore data in more detail.
90
+
91
+ ```jsx
92
+ <LineChart
93
+ height={{ base: 150, tablet: 200, desktop: 250 }}
94
+ series={[
95
+ {
96
+ id: 'sales',
97
+ data: [120, 132, 101, 134, 90, 230, 210, 120, 180, 190, 210, 176],
98
+ },
99
+ ]}
100
+ curve="monotone"
101
+ showYAxis
102
+ showArea
103
+ yAxis={{
104
+ showGrid: true,
105
+ label: 'Sales (units)',
106
+ }}
107
+ renderPoints={({ dataX, dataY }) => {
108
+ const months = [
109
+ 'Jan',
110
+ 'Feb',
111
+ 'Mar',
112
+ 'Apr',
113
+ 'May',
114
+ 'Jun',
115
+ 'Jul',
116
+ 'Aug',
117
+ 'Sep',
118
+ 'Oct',
119
+ 'Nov',
120
+ 'Dec',
121
+ ];
122
+ return {
123
+ radius: 4,
124
+ onClick: () => alert(`${months[dataX]}: ${dataY} units sold`),
125
+ accessibilityLabel: `${months[dataX]} sales: ${dataY} units`,
126
+ };
127
+ }}
128
+ />
129
+ ```
130
+
131
+ ### Customization
132
+
133
+ Points support extensive customization through various properties including colors, sizes, animations, and labels.
134
+
135
+ ```jsx
136
+ function CustomizedPoints() {
137
+ const theme = useTheme();
138
+ return (
139
+ <LineChart
140
+ height={{ base: 150, tablet: 200, desktop: 250 }}
141
+ series={[
142
+ {
143
+ id: 'performance',
144
+ data: [65, 70, 72, 85, 88, 92, 78, 82, 90, 95, 91, 94],
145
+ },
146
+ ]}
147
+ curve="monotone"
148
+ showYAxis
149
+ showArea
150
+ yAxis={{
151
+ showGrid: true,
152
+ label: 'Performance Score',
153
+ }}
154
+ renderPoints={({ dataX, dataY }) => {
155
+ const isHighPerformance = dataY >= 90;
156
+ const isLowPerformance = dataY < 75;
157
+
158
+ return {
159
+ fill: isHighPerformance
160
+ ? theme.color.bgPositive
161
+ : isLowPerformance
162
+ ? theme.color.bgNegative
163
+ : theme.color.fgPrimary,
164
+ radius: isHighPerformance ? 6 : 4,
165
+ strokeWidth: 2,
166
+ stroke: theme.color.bg,
167
+ label: isHighPerformance || isLowPerformance ? `${dataY}%` : undefined,
168
+ labelProps: {
169
+ verticalAlignment: isHighPerformance ? 'bottom' : 'top',
170
+ dy: isHighPerformance ? -10 : 10,
171
+ color: isHighPerformance
172
+ ? theme.color.fgPositive
173
+ : isLowPerformance
174
+ ? theme.color.fgNegative
175
+ : undefined,
176
+ },
177
+ };
178
+ }}
179
+ />
180
+ );
181
+ }
182
+ ```
183
+
184
+ ## Props
185
+
186
+ | Prop | Type | Required | Default | Description |
187
+ | --- | --- | --- | --- | --- |
188
+ | `dataX` | `number` | Yes | `-` | X coordinate in data space (not pixel coordinates). |
189
+ | `dataY` | `number` | Yes | `-` | Y coordinate in data space (not pixel coordinates). |
190
+ | `accessibilityLabel` | `string` | No | `-` | Accessibility label for screen readers to describe the point. If not provided, a default label will be generated using the data coordinates. |
191
+ | `fill` | `string` | No | `-` | The fill color of the point. |
192
+ | `label` | `null \| string \| number \| ReactElement<TSpanProps, TSpan> \| ReactElement<TextPathProps, TextPath> \| ValidChartTextChildElements[]` | No | `-` | Simple text label to display at the point position. If provided, a ChartText will be automatically rendered. |
193
+ | `labelProps` | `Omit<ChartTextProps, children \| x \| y>` | No | `-` | Configuration for the automatically rendered label. Only used when label prop is provided. |
194
+ | `onPress` | `((point: { x: number; y: number; dataX: number; dataY: number; }) => void)` | No | `-` | Handler for when the point is clicked. |
195
+ | `onScrubberEnter` | `((point: { x: number; y: number; }) => void)` | No | `-` | Handler for when the scrubber enters this point. |
196
+ | `opacity` | `number` | No | `-` | Opacity of the point. |
197
+ | `pixelCoordinates` | `{ x: number; y: number; }` | No | `-` | Optional pixel coordinates to use instead of calculating from dataX/dataY. Useful for performance when coordinates are already calculated. |
198
+ | `radius` | `number` | No | `4` | Radius of the point. |
199
+ | `stroke` | `string` | No | `theme.color.bg` | Color of the outer stroke around the point. |
200
+ | `strokeWidth` | `number` | No | `2` | Outer stroke width of the point. Set to 0 to remove the stroke. |
201
+ | `testID` | `string` | No | `-` | Used to locate this element in unit and end-to-end tests. Under the hood, testID translates to data-testid on Web. On Mobile, testID stays the same - testID |
202
+ | `yAxisId` | `string` | No | `-` | Optional Y-axis id to specify which axis to plot along. Defaults to the first y-axis |
203
+
204
+