@coinbase/cds-mcp-server 8.17.2 → 8.17.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/mcp-docs/mobile/components/Accordion.txt +189 -0
  3. package/mcp-docs/mobile/components/AccordionItem.txt +30 -0
  4. package/mcp-docs/mobile/components/Alert.txt +156 -0
  5. package/mcp-docs/mobile/components/AreaChart.txt +266 -0
  6. package/mcp-docs/mobile/components/Avatar.txt +196 -0
  7. package/mcp-docs/mobile/components/AvatarButton.txt +226 -0
  8. package/mcp-docs/mobile/components/Banner.txt +222 -0
  9. package/mcp-docs/mobile/components/BarChart.txt +816 -0
  10. package/mcp-docs/mobile/components/Box.txt +174 -0
  11. package/mcp-docs/mobile/components/BrowserBar.txt +147 -0
  12. package/mcp-docs/mobile/components/Button.txt +199 -0
  13. package/mcp-docs/mobile/components/ButtonGroup.txt +80 -0
  14. package/mcp-docs/mobile/components/Carousel.txt +1084 -0
  15. package/mcp-docs/mobile/components/CartesianChart.txt +826 -0
  16. package/mcp-docs/mobile/components/CellMedia.txt +71 -0
  17. package/mcp-docs/mobile/components/Checkbox.txt +246 -0
  18. package/mcp-docs/mobile/components/CheckboxCell.txt +202 -0
  19. package/mcp-docs/mobile/components/CheckboxGroup.txt +285 -0
  20. package/mcp-docs/mobile/components/Chip.txt +195 -0
  21. package/mcp-docs/mobile/components/Coachmark.txt +158 -0
  22. package/mcp-docs/mobile/components/Collapsible.txt +105 -0
  23. package/mcp-docs/mobile/components/ContainedAssetCard.txt +135 -0
  24. package/mcp-docs/mobile/components/ContentCard.txt +366 -0
  25. package/mcp-docs/mobile/components/ContentCardBody.txt +136 -0
  26. package/mcp-docs/mobile/components/ContentCardFooter.txt +128 -0
  27. package/mcp-docs/mobile/components/ContentCardHeader.txt +146 -0
  28. package/mcp-docs/mobile/components/ContentCell.txt +227 -0
  29. package/mcp-docs/mobile/components/ControlGroup.txt +444 -0
  30. package/mcp-docs/mobile/components/DatePicker.txt +497 -0
  31. package/mcp-docs/mobile/components/Divider.txt +139 -0
  32. package/mcp-docs/mobile/components/DotCount.txt +146 -0
  33. package/mcp-docs/mobile/components/DotStatusColor.txt +59 -0
  34. package/mcp-docs/mobile/components/DotSymbol.txt +135 -0
  35. package/mcp-docs/mobile/components/Fallback.txt +158 -0
  36. package/mcp-docs/mobile/components/FloatingAssetCard.txt +156 -0
  37. package/mcp-docs/mobile/components/HStack.txt +235 -0
  38. package/mcp-docs/mobile/components/HeroSquare.txt +48 -0
  39. package/mcp-docs/mobile/components/Icon.txt +52 -0
  40. package/mcp-docs/mobile/components/IconButton.txt +269 -0
  41. package/mcp-docs/mobile/components/InputChip.txt +188 -0
  42. package/mcp-docs/mobile/components/Interactable.txt +187 -0
  43. package/mcp-docs/mobile/components/LineChart.txt +1325 -0
  44. package/mcp-docs/mobile/components/Link.txt +292 -0
  45. package/mcp-docs/mobile/components/ListCell.txt +391 -0
  46. package/mcp-docs/mobile/components/LogoMark.txt +85 -0
  47. package/mcp-docs/mobile/components/LogoWordMark.txt +94 -0
  48. package/mcp-docs/mobile/components/Lottie.txt +139 -0
  49. package/mcp-docs/mobile/components/LottieStatusAnimation.txt +47 -0
  50. package/mcp-docs/mobile/components/Modal.txt +84 -0
  51. package/mcp-docs/mobile/components/ModalBody.txt +34 -0
  52. package/mcp-docs/mobile/components/ModalFooter.txt +25 -0
  53. package/mcp-docs/mobile/components/ModalHeader.txt +28 -0
  54. package/mcp-docs/mobile/components/MultiContentModule.txt +380 -0
  55. package/mcp-docs/mobile/components/NavigationTitle.txt +132 -0
  56. package/mcp-docs/mobile/components/NavigationTitleSelect.txt +142 -0
  57. package/mcp-docs/mobile/components/NudgeCard.txt +90 -0
  58. package/mcp-docs/mobile/components/Numpad.txt +341 -0
  59. package/mcp-docs/mobile/components/Overlay.txt +152 -0
  60. package/mcp-docs/mobile/components/PageFooter.txt +161 -0
  61. package/mcp-docs/mobile/components/PageHeader.txt +186 -0
  62. package/mcp-docs/mobile/components/PeriodSelector.txt +408 -0
  63. package/mcp-docs/mobile/components/Pictogram.txt +48 -0
  64. package/mcp-docs/mobile/components/Point.txt +205 -0
  65. package/mcp-docs/mobile/components/PortalProvider.txt +79 -0
  66. package/mcp-docs/mobile/components/Pressable.txt +211 -0
  67. package/mcp-docs/mobile/components/ProgressBar.txt +130 -0
  68. package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +161 -0
  69. package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +138 -0
  70. package/mcp-docs/mobile/components/ProgressCircle.txt +237 -0
  71. package/mcp-docs/mobile/components/Radio.txt +242 -0
  72. package/mcp-docs/mobile/components/RadioCell.txt +202 -0
  73. package/mcp-docs/mobile/components/RadioGroup.txt +282 -0
  74. package/mcp-docs/mobile/components/ReferenceLine.txt +153 -0
  75. package/mcp-docs/mobile/components/RemoteImage.txt +106 -0
  76. package/mcp-docs/mobile/components/RemoteImageGroup.txt +61 -0
  77. package/mcp-docs/mobile/components/RollingNumber.txt +789 -0
  78. package/mcp-docs/mobile/components/Scrubber.txt +204 -0
  79. package/mcp-docs/mobile/components/SearchInput.txt +192 -0
  80. package/mcp-docs/mobile/components/SectionHeader.txt +205 -0
  81. package/mcp-docs/mobile/components/SegmentedTabs.txt +316 -0
  82. package/mcp-docs/mobile/components/Select.txt +212 -0
  83. package/mcp-docs/mobile/components/SelectChip.txt +324 -0
  84. package/mcp-docs/mobile/components/SelectOption.txt +85 -0
  85. package/mcp-docs/mobile/components/SlideButton.txt +331 -0
  86. package/mcp-docs/mobile/components/Spacer.txt +84 -0
  87. package/mcp-docs/mobile/components/Sparkline.txt +123 -0
  88. package/mcp-docs/mobile/components/SparklineGradient.txt +107 -0
  89. package/mcp-docs/mobile/components/SparklineInteractive.txt +157 -0
  90. package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +73 -0
  91. package/mcp-docs/mobile/components/Spinner.txt +49 -0
  92. package/mcp-docs/mobile/components/SpotIcon.txt +48 -0
  93. package/mcp-docs/mobile/components/SpotRectangle.txt +48 -0
  94. package/mcp-docs/mobile/components/SpotSquare.txt +48 -0
  95. package/mcp-docs/mobile/components/Stepper.txt +528 -0
  96. package/mcp-docs/mobile/components/SubBrandLogoMark.txt +126 -0
  97. package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +126 -0
  98. package/mcp-docs/mobile/components/Switch.txt +98 -0
  99. package/mcp-docs/mobile/components/TabIndicator.txt +49 -0
  100. package/mcp-docs/mobile/components/TabLabel.txt +154 -0
  101. package/mcp-docs/mobile/components/TabNavigation.txt +147 -0
  102. package/mcp-docs/mobile/components/TabbedChips.txt +143 -0
  103. package/mcp-docs/mobile/components/Tabs.txt +191 -0
  104. package/mcp-docs/mobile/components/Tag.txt +301 -0
  105. package/mcp-docs/mobile/components/Text.txt +212 -0
  106. package/mcp-docs/mobile/components/TextInput.txt +718 -0
  107. package/mcp-docs/mobile/components/ThemeProvider.txt +133 -0
  108. package/mcp-docs/mobile/components/Toast.txt +197 -0
  109. package/mcp-docs/mobile/components/Tooltip.txt +60 -0
  110. package/mcp-docs/mobile/components/TopNavBar.txt +162 -0
  111. package/mcp-docs/mobile/components/Tour.txt +159 -0
  112. package/mcp-docs/mobile/components/Tray.txt +253 -0
  113. package/mcp-docs/mobile/components/UpsellCard.txt +322 -0
  114. package/mcp-docs/mobile/components/VStack.txt +223 -0
  115. package/mcp-docs/mobile/components/XAxis.txt +622 -0
  116. package/mcp-docs/mobile/components/YAxis.txt +568 -0
  117. package/mcp-docs/mobile/getting-started/introduction.txt +99 -0
  118. package/mcp-docs/mobile/getting-started/mcp-server.txt +94 -0
  119. package/mcp-docs/mobile/getting-started/playground.txt +25 -0
  120. package/mcp-docs/mobile/hooks/useDimensions.txt +47 -0
  121. package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +215 -0
  122. package/mcp-docs/mobile/hooks/useTheme.txt +110 -0
  123. package/mcp-docs/mobile/routes.txt +132 -0
  124. package/mcp-docs/web/components/Accordion.txt +190 -0
  125. package/mcp-docs/web/components/AccordionItem.txt +32 -0
  126. package/mcp-docs/web/components/Alert.txt +165 -0
  127. package/mcp-docs/web/components/AreaChart.txt +511 -0
  128. package/mcp-docs/web/components/Avatar.txt +212 -0
  129. package/mcp-docs/web/components/AvatarButton.txt +241 -0
  130. package/mcp-docs/web/components/Banner.txt +227 -0
  131. package/mcp-docs/web/components/BarChart.txt +1268 -0
  132. package/mcp-docs/web/components/Box.txt +176 -0
  133. package/mcp-docs/web/components/Button.txt +213 -0
  134. package/mcp-docs/web/components/ButtonGroup.txt +80 -0
  135. package/mcp-docs/web/components/Calendar.txt +182 -0
  136. package/mcp-docs/web/components/Carousel.txt +1576 -0
  137. package/mcp-docs/web/components/CartesianChart.txt +1045 -0
  138. package/mcp-docs/web/components/CellMedia.txt +57 -0
  139. package/mcp-docs/web/components/Checkbox.txt +189 -0
  140. package/mcp-docs/web/components/CheckboxCell.txt +203 -0
  141. package/mcp-docs/web/components/CheckboxGroup.txt +220 -0
  142. package/mcp-docs/web/components/Chip.txt +197 -0
  143. package/mcp-docs/web/components/Coachmark.txt +189 -0
  144. package/mcp-docs/web/components/Collapsible.txt +120 -0
  145. package/mcp-docs/web/components/ContainedAssetCard.txt +233 -0
  146. package/mcp-docs/web/components/ContentCard.txt +368 -0
  147. package/mcp-docs/web/components/ContentCardBody.txt +138 -0
  148. package/mcp-docs/web/components/ContentCardFooter.txt +130 -0
  149. package/mcp-docs/web/components/ContentCardHeader.txt +148 -0
  150. package/mcp-docs/web/components/ContentCell.txt +220 -0
  151. package/mcp-docs/web/components/ControlGroup.txt +437 -0
  152. package/mcp-docs/web/components/DatePicker.txt +506 -0
  153. package/mcp-docs/web/components/Divider.txt +144 -0
  154. package/mcp-docs/web/components/DotCount.txt +150 -0
  155. package/mcp-docs/web/components/DotStatusColor.txt +59 -0
  156. package/mcp-docs/web/components/DotSymbol.txt +138 -0
  157. package/mcp-docs/web/components/Dropdown.txt +120 -0
  158. package/mcp-docs/web/components/Fallback.txt +164 -0
  159. package/mcp-docs/web/components/FloatingAssetCard.txt +251 -0
  160. package/mcp-docs/web/components/FullscreenAlert.txt +70 -0
  161. package/mcp-docs/web/components/FullscreenModal.txt +146 -0
  162. package/mcp-docs/web/components/FullscreenModalLayout.txt +188 -0
  163. package/mcp-docs/web/components/Grid.txt +237 -0
  164. package/mcp-docs/web/components/GridColumn.txt +210 -0
  165. package/mcp-docs/web/components/HStack.txt +237 -0
  166. package/mcp-docs/web/components/HeroSquare.txt +49 -0
  167. package/mcp-docs/web/components/Icon.txt +146 -0
  168. package/mcp-docs/web/components/IconButton.txt +391 -0
  169. package/mcp-docs/web/components/InputChip.txt +188 -0
  170. package/mcp-docs/web/components/Interactable.txt +194 -0
  171. package/mcp-docs/web/components/LineChart.txt +1577 -0
  172. package/mcp-docs/web/components/Link.txt +244 -0
  173. package/mcp-docs/web/components/ListCell.txt +397 -0
  174. package/mcp-docs/web/components/LogoMark.txt +85 -0
  175. package/mcp-docs/web/components/LogoWordMark.txt +94 -0
  176. package/mcp-docs/web/components/Lottie.txt +158 -0
  177. package/mcp-docs/web/components/LottieStatusAnimation.txt +58 -0
  178. package/mcp-docs/web/components/MediaQueryProvider.txt +109 -0
  179. package/mcp-docs/web/components/Modal.txt +193 -0
  180. package/mcp-docs/web/components/ModalBody.txt +118 -0
  181. package/mcp-docs/web/components/ModalFooter.txt +120 -0
  182. package/mcp-docs/web/components/ModalHeader.txt +124 -0
  183. package/mcp-docs/web/components/MultiContentModule.txt +382 -0
  184. package/mcp-docs/web/components/NavigationBar.txt +103 -0
  185. package/mcp-docs/web/components/NavigationTitle.txt +26 -0
  186. package/mcp-docs/web/components/NavigationTitleSelect.txt +46 -0
  187. package/mcp-docs/web/components/NudgeCard.txt +182 -0
  188. package/mcp-docs/web/components/Overlay.txt +172 -0
  189. package/mcp-docs/web/components/PageFooter.txt +185 -0
  190. package/mcp-docs/web/components/PageHeader.txt +244 -0
  191. package/mcp-docs/web/components/Pagination.txt +500 -0
  192. package/mcp-docs/web/components/PeriodSelector.txt +704 -0
  193. package/mcp-docs/web/components/Pictogram.txt +49 -0
  194. package/mcp-docs/web/components/Point.txt +461 -0
  195. package/mcp-docs/web/components/PortalProvider.txt +77 -0
  196. package/mcp-docs/web/components/Pressable.txt +194 -0
  197. package/mcp-docs/web/components/ProgressBar.txt +164 -0
  198. package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +213 -0
  199. package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +182 -0
  200. package/mcp-docs/web/components/ProgressCircle.txt +444 -0
  201. package/mcp-docs/web/components/Radio.txt +220 -0
  202. package/mcp-docs/web/components/RadioCell.txt +216 -0
  203. package/mcp-docs/web/components/RadioGroup.txt +289 -0
  204. package/mcp-docs/web/components/ReferenceLine.txt +452 -0
  205. package/mcp-docs/web/components/RemoteImage.txt +166 -0
  206. package/mcp-docs/web/components/RemoteImageGroup.txt +87 -0
  207. package/mcp-docs/web/components/RollingNumber.txt +1022 -0
  208. package/mcp-docs/web/components/Scrubber.txt +232 -0
  209. package/mcp-docs/web/components/SearchInput.txt +118 -0
  210. package/mcp-docs/web/components/SectionHeader.txt +218 -0
  211. package/mcp-docs/web/components/SegmentedTabs.txt +325 -0
  212. package/mcp-docs/web/components/Select.txt +225 -0
  213. package/mcp-docs/web/components/SelectChip.txt +315 -0
  214. package/mcp-docs/web/components/SelectOption.txt +166 -0
  215. package/mcp-docs/web/components/Sidebar.txt +350 -0
  216. package/mcp-docs/web/components/SidebarItem.txt +132 -0
  217. package/mcp-docs/web/components/SidebarMoreMenu.txt +31 -0
  218. package/mcp-docs/web/components/Spacer.txt +174 -0
  219. package/mcp-docs/web/components/Sparkline.txt +123 -0
  220. package/mcp-docs/web/components/SparklineGradient.txt +107 -0
  221. package/mcp-docs/web/components/SparklineInteractive.txt +154 -0
  222. package/mcp-docs/web/components/SparklineInteractiveHeader.txt +77 -0
  223. package/mcp-docs/web/components/Spinner.txt +129 -0
  224. package/mcp-docs/web/components/SpotIcon.txt +49 -0
  225. package/mcp-docs/web/components/SpotRectangle.txt +49 -0
  226. package/mcp-docs/web/components/SpotSquare.txt +49 -0
  227. package/mcp-docs/web/components/Stepper.txt +683 -0
  228. package/mcp-docs/web/components/SubBrandLogoMark.txt +126 -0
  229. package/mcp-docs/web/components/SubBrandLogoWordMark.txt +126 -0
  230. package/mcp-docs/web/components/Switch.txt +86 -0
  231. package/mcp-docs/web/components/TabIndicator.txt +49 -0
  232. package/mcp-docs/web/components/TabLabel.txt +159 -0
  233. package/mcp-docs/web/components/TabNavigation.txt +160 -0
  234. package/mcp-docs/web/components/TabbedChips.txt +156 -0
  235. package/mcp-docs/web/components/Table.txt +368 -0
  236. package/mcp-docs/web/components/TableBody.txt +84 -0
  237. package/mcp-docs/web/components/TableCaption.txt +103 -0
  238. package/mcp-docs/web/components/TableCell.txt +166 -0
  239. package/mcp-docs/web/components/TableCellFallback.txt +98 -0
  240. package/mcp-docs/web/components/TableFooter.txt +84 -0
  241. package/mcp-docs/web/components/TableHeader.txt +101 -0
  242. package/mcp-docs/web/components/TableRow.txt +141 -0
  243. package/mcp-docs/web/components/Tabs.txt +213 -0
  244. package/mcp-docs/web/components/Tag.txt +305 -0
  245. package/mcp-docs/web/components/Text.txt +233 -0
  246. package/mcp-docs/web/components/TextInput.txt +653 -0
  247. package/mcp-docs/web/components/ThemeProvider.txt +200 -0
  248. package/mcp-docs/web/components/TileButton.txt +159 -0
  249. package/mcp-docs/web/components/Toast.txt +204 -0
  250. package/mcp-docs/web/components/Tooltip.txt +90 -0
  251. package/mcp-docs/web/components/Tour.txt +180 -0
  252. package/mcp-docs/web/components/Tray.txt +289 -0
  253. package/mcp-docs/web/components/UpsellCard.txt +320 -0
  254. package/mcp-docs/web/components/VStack.txt +225 -0
  255. package/mcp-docs/web/components/XAxis.txt +620 -0
  256. package/mcp-docs/web/components/YAxis.txt +549 -0
  257. package/mcp-docs/web/getting-started/introduction.txt +99 -0
  258. package/mcp-docs/web/getting-started/mcp-server.txt +94 -0
  259. package/mcp-docs/web/getting-started/playground.txt +25 -0
  260. package/mcp-docs/web/hooks/useBreakpoints.txt +33 -0
  261. package/mcp-docs/web/hooks/useDimensions.txt +55 -0
  262. package/mcp-docs/web/hooks/useHasMounted.txt +55 -0
  263. package/mcp-docs/web/hooks/useIsoEffect.txt +42 -0
  264. package/mcp-docs/web/hooks/useMediaQuery.txt +94 -0
  265. package/mcp-docs/web/hooks/useOverlayContentContext.txt +217 -0
  266. package/mcp-docs/web/hooks/useScrollBlocker.txt +63 -0
  267. package/mcp-docs/web/hooks/useTheme.txt +105 -0
  268. package/mcp-docs/web/routes.txt +155 -0
  269. package/package.json +1 -1
@@ -0,0 +1,159 @@
1
+ # Tour
2
+
3
+ Creates guided tours of a user interface.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { Tour, TourStep } from '@coinbase/cds-mobile/tour'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `activeTourStep` | `TourStepValue<T> \| null` | Yes | `-` | - |
16
+ | `onChange` | `(tourStep: TourStepValue<T> \| null) => void` | Yes | `-` | - |
17
+ | `steps` | `TourStepValue<T>[]` | Yes | `-` | - |
18
+ | `TourMaskComponent` | `TourMaskComponent` | No | `DefaultTourMask` | The Component to render as a tour overlay and mask. |
19
+ | `TourStepArrowComponent` | `TourStepArrowComponent` | No | `DefaultTourStepArrow` | The default Component to render for each TourStep arrow element. |
20
+ | `hideOverlay` | `boolean` | No | `false` | Hide overlay when tour is active |
21
+ | `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 |
22
+ | `tourMaskBorderRadius` | `string \| number` | No | `-` | Corner radius for the TourMasks content mask. Uses SVG rect elements rx and ry attributes https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/rx. |
23
+ | `tourMaskPadding` | `string \| number` | No | `-` | Padding to add around the edges of the TourMasks content mask. |
24
+ | `tourStepAutoPlacement` | `Partial<Partial<{ boundary: any; rootBoundary: RootBoundary; elementContext: ElementContext; altBoundary: boolean; padding: Padding; }> & { crossAxis: boolean; alignment: Alignment \| null; autoAlignment: boolean; allowedPlacements: Placement[]; }>` | No | `24` | Configures @floating-ui autoPlacement options for Tour Step component. See https://floating-ui.com/docs/autoplacement. |
25
+ | `tourStepOffset` | `number \| Partial<{ mainAxis: number; crossAxis: number; alignmentAxis: number \| null; }> \| Derivable<OffsetValue>` | No | `24` | Configures @floating-ui offset options for Tour Step component. See https://floating-ui.com/docs/offset. |
26
+ | `tourStepShift` | `Partial<Partial<{ boundary: any; rootBoundary: RootBoundary; elementContext: ElementContext; altBoundary: boolean; padding: Padding; }> & { mainAxis: boolean; crossAxis: boolean; limiter: { fn: (state: MiddlewareState) => Coords; options?: any; }; }>` | No | `-` | Configures @floating-ui shift options for Tour Step component. See https://floating-ui.com/docs/shift. |
27
+
28
+
29
+ ## Examples
30
+
31
+ ### Basic usage
32
+
33
+ ```tsx live
34
+ function Example() {
35
+ const [activeTourStep, setActiveTourStep] = useState(null);
36
+
37
+ const StepOne = () => {
38
+ const [checked, setChecked] = useState(false);
39
+
40
+ const { goNextTourStep, stopTour } = useTourContext();
41
+
42
+ return (
43
+ <Coachmark
44
+ action={<Button variant="secondary" onPress={goNextTourStep} compact label="Next" />}
45
+ checkbox={
46
+ <Checkbox checked={checked} onChange={setChecked}>
47
+ Don&apos;t show again
48
+ </Checkbox>
49
+ }
50
+ content="Add up to 3 lines of body copy. Deliver your message with clarity and impact"
51
+ onClose={stopTour}
52
+ title="My first step"
53
+ />
54
+ );
55
+ };
56
+
57
+ const StepTwo = () => {
58
+ const { goNextTourStep, stopTour } = useTourContext();
59
+ return (
60
+ <Coachmark
61
+ action={<Button variant="secondary" onPress={goNextTourStep} compact label="Next" />}
62
+ content={
63
+ <VStack gap={2}>
64
+ <TextCaption as="p" color="fgMuted">
65
+ 50%
66
+ </TextCaption>
67
+ <ProgressBar progress={0.5} />
68
+ <TextBody as="p">
69
+ Add up to 3 lines of body copy. Deliver your message with clarity and impact
70
+ </TextBody>
71
+ </VStack>
72
+ }
73
+ media={<RemoteImage height={150} source={ethBackground} width="100%" />}
74
+ onClose={stopTour}
75
+ title="My second step"
76
+ />
77
+ );
78
+ };
79
+
80
+ const StepThree = () => {
81
+ const { stopTour, goNextTourStep, goPreviousTourStep } = useTourContext();
82
+ return (
83
+ <Coachmark
84
+ action={
85
+ <HStack gap={1}>
86
+ <Button variant="secondary" onPress={goPreviousTourStep} compact label="Back" />
87
+ <Button variant="secondary" onPress={goNextTourStep} compact label="Next" />
88
+ <Button variant="secondary" onPress={stopTour} compact label="Done" />
89
+ </HStack>
90
+ }
91
+ content="Add up to 3 lines of body copy. Deliver your message with clarity and impact"
92
+ title="My third step"
93
+ width={350}
94
+ />
95
+ );
96
+ };
97
+
98
+ const tourSteps = [
99
+ {
100
+ id: 'step1',
101
+ onBeforeActive: () => console.log('step1 before'),
102
+ Component: StepOne,
103
+ },
104
+ {
105
+ id: 'step2',
106
+ onBeforeActive: () => console.log('step2 before'),
107
+ Component: StepTwo,
108
+ },
109
+ {
110
+ id: 'step3',
111
+ onBeforeActive: () => console.log('step3 before'),
112
+ Component: StepThree,
113
+ },
114
+ ];
115
+
116
+ const TourExample = ({ spacerWidthIncrement = 0, spacerHeightIncrement = 500 }) => {
117
+ const { startTour } = useTourContext();
118
+
119
+ const handlePress = useCallback(() => startTour(), [startTour]);
120
+
121
+ return (
122
+ <VStack flexGrow={1} gap={2} justifyContent="space-between">
123
+ <Button onPress={handlePress} compact label="Start tour" />
124
+ <TourStep id="step1">
125
+ <Box backgroundColor="secondary" padding={4}>
126
+ <Text>This is step 1</Text>
127
+ </Box>
128
+ </TourStep>
129
+ <Box height={spacerHeightIncrement} />
130
+ <HStack justifyContent="flex-end">
131
+ <Box flexShrink={0} width={spacerWidthIncrement} />
132
+ <TourStep id="step2">
133
+ <Box backgroundColor="secondary" padding={4} width={150}>
134
+ <Text>This is step 2</Text>
135
+ </Box>
136
+ </TourStep>
137
+ </HStack>
138
+ <Box height={spacerHeightIncrement} />
139
+ <HStack>
140
+ <Box flexShrink={0} width={spacerWidthIncrement * 2} />
141
+ <TourStep id="step3">
142
+ <VStack backgroundColor="secondary" padding={4} width={150}>
143
+ <Text>This is step 3</Text>
144
+ </VStack>
145
+ </TourStep>
146
+ </HStack>
147
+ </VStack>
148
+ );
149
+ };
150
+
151
+ return (
152
+ <Tour activeTourStep={activeTourStep} onChange={setActiveTourStep} steps={tourSteps}>
153
+ <TourExample />
154
+ </Tour>
155
+ );
156
+ }
157
+ ```
158
+
159
+
@@ -0,0 +1,253 @@
1
+ # Tray
2
+
3
+ An elevated container pinned to the bottom of the screen.
4
+
5
+ ## Import
6
+
7
+ ```jsx
8
+ import { Tray } from '@coinbase/cds-mobile/overlays/tray/Tray'
9
+ ```
10
+
11
+ ## Props
12
+
13
+ | Prop | Type | Required | Default | Description |
14
+ | --- | --- | --- | --- | --- |
15
+ | `onCloseComplete` | `() => void` | Yes | `-` | Action that will happen when drawer is dismissed |
16
+ | `animated` | `boolean` | No | `-` | - |
17
+ | `animationType` | `none \| slide \| fade` | No | `-` | The animationType prop controls how the modal animates. - slide slides in from the bottom - fade fades into view - none appears without an animation |
18
+ | `disableCapturePanGestureToDismiss` | `boolean` | No | `false` | Prevents the Drawer from capturing pan gestures on children. Set to true when using a ScrollView as a child |
19
+ | `handleBarAccessibilityLabel` | `string` | No | `-` | Accessibility label for handlebar |
20
+ | `hardwareAccelerated` | `boolean` | No | `-` | Controls whether to force hardware acceleration for the underlying window. |
21
+ | `hideHandleBar` | `boolean` | No | `false` | The HandleBar by default only is used for a bottom pinned drawer. This removes it. |
22
+ | `key` | `Key \| null` | No | `-` | - |
23
+ | `onBlur` | `(() => void)` | No | `-` | Callback fired when the overlay is pressed, or swipe to close |
24
+ | `onDismiss` | `(() => void)` | No | `-` | The onDismiss prop allows passing a function that will be called once the modal has been dismissed. |
25
+ | `onOrientationChange` | `((event: NativeSyntheticEvent<any>) => void)` | No | `-` | The onOrientationChange callback is called when the orientation changes while the modal is being displayed. The orientation provided is only portrait or landscape. This callback is also called on initial render, regardless of the current orientation. |
26
+ | `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
27
+ | `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
28
+ | `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
29
+ | `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
30
+ | `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
31
+ | `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
32
+ | `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
33
+ | `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
34
+ | `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
35
+ | `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
36
+ | `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
37
+ | `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
38
+ | `onShow` | `((event: NativeSyntheticEvent<any>) => void)` | No | `-` | The onShow prop allows passing a function that will be called once the modal has been shown. |
39
+ | `onVisibilityChange` | `((context: visible \| hidden) => void)` | No | `-` | Optional callback that, if provided, will be triggered when the Tray is toggled open/ closed If used for analytics, context (visible \| hidden) can be bundled with the event info to track whether the multiselect was toggled into or out of view |
40
+ | `presentationStyle` | `fullScreen \| pageSheet \| formSheet \| overFullScreen` | No | `-` | The presentationStyle determines the style of modal to show |
41
+ | `preventDismissGestures` | `boolean` | No | `false` | Prevents a user from dismissing the drawer by pressing the overlay or swiping |
42
+ | `preventHardwareBackBehaviorAndroid` | `boolean` | No | `false` | Prevents a user from dismissing the drawer by pressing hardware back button on Android |
43
+ | `ref` | `((instance: DrawerRefBaseProps \| null) => void) \| RefObject<DrawerRefBaseProps> \| null` | No | `-` | - |
44
+ | `statusBarTranslucent` | `boolean` | No | `-` | Determines whether your modal should go under the system statusbar. |
45
+ | `stickyFooter` | `ReactNode \| DrawerRenderChildren` | No | `-` | StickyFooter to be rendered at bottom of Drawer |
46
+ | `supportedOrientations` | `(portrait \| portrait-upside-down \| landscape \| landscape-left \| landscape-right)[]` | No | `-` | The supportedOrientations prop allows the modal to be rotated to any of the specified orientations. On iOS, the modal is still restricted by whats specified in your apps Info.plists UISupportedInterfaceOrientations field. |
47
+ | `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 Used to locate this view in end-to-end tests. |
48
+ | `title` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Text or ReactNode for optional Tray title |
49
+ | `transparent` | `boolean` | No | `-` | The transparent prop determines whether your modal will fill the entire view. Setting this to true will render the modal over a transparent background. |
50
+ | `verticalDrawerPercentageOfView` | `number` | No | `-` | Allow user of component to define maximum percentage of screen that can be taken up by the Drawer |
51
+ | `visible` | `boolean` | No | `-` | The visible prop determines whether your modal is visible. |
52
+
53
+
54
+ ## Examples
55
+
56
+ ### Basic usage with Callback
57
+
58
+ The recommended way to use a `Tray` is by passing a callback as children, which receives a `handleClose` function:
59
+
60
+ ```tsx
61
+ function BasicTray() {
62
+ const [visible, setVisible] = useState(false);
63
+ const handleOpen = () => setVisible(true);
64
+ const handleClose = () => setVisible(false);
65
+
66
+ return (
67
+ <VStack gap={2}>
68
+ <Button onPress={handleOpen}>Open Tray</Button>
69
+ {visible && (
70
+ <Tray title="Example Title" onCloseComplete={handleClose}>
71
+ {({ handleClose }) => (
72
+ <VStack gap={2} padding={3}>
73
+ <Text>This is the content of the tray.</Text>
74
+ <Button onPress={handleClose}>Close</Button>
75
+ </VStack>
76
+ )}
77
+ </Tray>
78
+ )}
79
+ </VStack>
80
+ );
81
+ }
82
+ ```
83
+
84
+ ### Using Ref to Control the Tray
85
+
86
+ You can also control the Tray using a ref, which provides `open()` and `close()` methods:
87
+
88
+ ```tsx
89
+ function TrayWithRef() {
90
+ const [visible, setVisible] = useState(false);
91
+ const trayRef = useRef<DrawerRefBaseProps>(null);
92
+
93
+ const handleOpen = () => setVisible(true);
94
+ const handleClose = () => setVisible(false);
95
+
96
+ return (
97
+ <VStack gap={2}>
98
+ <Button onPress={handleOpen}>Open Tray</Button>
99
+ {visible && (
100
+ <Tray ref={trayRef} title="Ref Controlled Tray" onCloseComplete={handleClose}>
101
+ <VStack gap={2} padding={3}>
102
+ <Text>Control this tray using the ref.</Text>
103
+ <Button onPress={() => trayRef.current?.close()}>Close</Button>
104
+ </VStack>
105
+ </Tray>
106
+ )}
107
+ </VStack>
108
+ );
109
+ }
110
+ ```
111
+
112
+ ### Scrollable Content
113
+
114
+ To enable scrolling in a Tray, use `ScrollView` and set `disablePanGesture`:
115
+
116
+ ```tsx
117
+ function ScrollableTray() {
118
+ const [visible, setVisible] = useState(false);
119
+ const handleOpen = () => setVisible(true);
120
+ const handleClose = () => setVisible(false);
121
+
122
+ return (
123
+ <VStack gap={2}>
124
+ <Button onPress={handleOpen}>Open Scrollable Tray</Button>
125
+ {visible && (
126
+ <Tray title="Scrollable Content" onCloseComplete={handleClose} disablePanGesture>
127
+ {({ handleClose }) => (
128
+ <VStack gap={2}>
129
+ <ScrollView style={{ maxHeight: 200 }}>
130
+ <Pressable>
131
+ <VStack padding={3} gap={2}>
132
+ <Text>
133
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
134
+ incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
135
+ nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
136
+ </Text>
137
+ <Text>
138
+ Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore
139
+ eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
140
+ in culpa qui officia deserunt mollit anim id est laborum.
141
+ </Text>
142
+ </VStack>
143
+ </Pressable>
144
+ </ScrollView>
145
+ <HStack padding={3} justifyContent="flex-end">
146
+ <Button onPress={handleClose}>Close</Button>
147
+ </HStack>
148
+ </VStack>
149
+ )}
150
+ </Tray>
151
+ )}
152
+ </VStack>
153
+ );
154
+ }
155
+ ```
156
+
157
+ ### With Selection Menu
158
+
159
+ When using a Tray for selection, wrap the options in a `Menu` component:
160
+
161
+ ```tsx
162
+ function TrayWithMenu() {
163
+ const [visible, setVisible] = useState(false);
164
+ const [selectedValue, setSelectedValue] = useState<string>();
165
+ const trayRef = useRef<DrawerRefBaseProps>(null);
166
+
167
+ const handleOpen = () => setVisible(true);
168
+ const handleClose = () => setVisible(false);
169
+
170
+ const options = ['Option 1', 'Option 2', 'Option 3'];
171
+
172
+ const handleSelect = (value: string) => {
173
+ setSelectedValue(value);
174
+ trayRef.current?.close();
175
+ };
176
+
177
+ return (
178
+ <VStack gap={2}>
179
+ <Button onPress={handleOpen}>Open Menu Tray</Button>
180
+ {visible && (
181
+ <Tray ref={trayRef} title="Select an Option" onCloseComplete={handleClose}>
182
+ <Menu value={selectedValue} onChange={handleSelect}>
183
+ {options.map((option) => (
184
+ <SelectOption
185
+ key={option}
186
+ title={option}
187
+ value={option}
188
+ onPress={() => handleSelect(option)}
189
+ />
190
+ ))}
191
+ </Menu>
192
+ </Tray>
193
+ )}
194
+ </VStack>
195
+ );
196
+ }
197
+ ```
198
+
199
+ ### Multiple Overlay Flow
200
+
201
+ When transitioning between overlays, ensure proper dismounting using `onCloseComplete`:
202
+
203
+ ```tsx
204
+ function TrayToModalFlow() {
205
+ const [isTrayVisible, setIsTrayVisible] = useState(false);
206
+ const [isModalVisible, setIsModalVisible] = useState(false);
207
+
208
+ const openTray = () => setIsTrayVisible(true);
209
+ const closeTray = () => setIsTrayVisible(false);
210
+ const openModal = () => setIsModalVisible(true);
211
+ const closeModal = () => setIsModalVisible(false);
212
+
213
+ const handleTrayClose = useCallback(() => {
214
+ closeTray();
215
+ openModal();
216
+ }, []);
217
+
218
+ return (
219
+ <VStack gap={2}>
220
+ <Button onPress={openTray}>Start Flow</Button>
221
+ {isTrayVisible && (
222
+ <Tray title="First Step" onCloseComplete={handleTrayClose}>
223
+ {({ handleClose }) => (
224
+ <VStack gap={2} padding={3}>
225
+ <Text>Click below to continue to the modal</Text>
226
+ <Button onPress={handleClose}>Continue to Modal</Button>
227
+ </VStack>
228
+ )}
229
+ </Tray>
230
+ )}
231
+ <Modal visible={isModalVisible} onRequestClose={closeModal}>
232
+ <ModalHeader title="Second Step" />
233
+ <ModalBody>
234
+ <VStack gap={2} padding={3}>
235
+ <Text>This is the second step in the flow.</Text>
236
+ <Button onPress={closeModal}>Finish</Button>
237
+ </VStack>
238
+ </ModalBody>
239
+ </Modal>
240
+ </VStack>
241
+ );
242
+ }
243
+ ```
244
+
245
+ Note: The Tray component is built on top of the Drawer component and provides a standardized way to present bottom sheets in your mobile application. Key points:
246
+
247
+ - Use `onCloseComplete` for cleanup when the tray is dismissed
248
+ - Children can be either a React node or a render function that receives a `handleClose` function
249
+ - The `ref` provides `open()` and `close()` methods for controlling the tray
250
+ - Use `disablePanGesture` when implementing scrollable content
251
+ - When transitioning between overlays, ensure proper dismounting using lifecycle methods
252
+
253
+