@coinbase/cds-mcp-server 8.17.3 → 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.
- package/CHANGELOG.md +4 -0
- package/mcp-docs/mobile/components/Accordion.txt +11 -12
- package/mcp-docs/mobile/components/AccordionItem.txt +5 -6
- package/mcp-docs/mobile/components/Alert.txt +21 -22
- package/mcp-docs/mobile/components/AreaChart.txt +118 -119
- package/mcp-docs/mobile/components/Avatar.txt +82 -83
- package/mcp-docs/mobile/components/AvatarButton.txt +103 -104
- package/mcp-docs/mobile/components/Banner.txt +100 -101
- package/mcp-docs/mobile/components/BarChart.txt +120 -121
- package/mcp-docs/mobile/components/Box.txt +65 -66
- package/mcp-docs/mobile/components/BrowserBar.txt +38 -39
- package/mcp-docs/mobile/components/Button.txt +78 -79
- package/mcp-docs/mobile/components/ButtonGroup.txt +10 -11
- package/mcp-docs/mobile/components/Carousel.txt +103 -104
- package/mcp-docs/mobile/components/CartesianChart.txt +107 -108
- package/mcp-docs/mobile/components/CellMedia.txt +15 -16
- package/mcp-docs/mobile/components/Checkbox.txt +35 -36
- package/mcp-docs/mobile/components/CheckboxCell.txt +73 -74
- package/mcp-docs/mobile/components/CheckboxGroup.txt +24 -25
- package/mcp-docs/mobile/components/Chip.txt +67 -68
- package/mcp-docs/mobile/components/Coachmark.txt +42 -43
- package/mcp-docs/mobile/components/Collapsible.txt +15 -16
- package/mcp-docs/mobile/components/ContainedAssetCard.txt +16 -17
- package/mcp-docs/mobile/components/ContentCard.txt +99 -100
- package/mcp-docs/mobile/components/ContentCardBody.txt +23 -24
- package/mcp-docs/mobile/components/ContentCardFooter.txt +19 -20
- package/mcp-docs/mobile/components/ContentCardHeader.txt +33 -34
- package/mcp-docs/mobile/components/ContentCell.txt +102 -103
- package/mcp-docs/mobile/components/ControlGroup.txt +106 -107
- package/mcp-docs/mobile/components/DatePicker.txt +121 -122
- package/mcp-docs/mobile/components/Divider.txt +31 -32
- package/mcp-docs/mobile/components/DotCount.txt +15 -16
- package/mcp-docs/mobile/components/DotStatusColor.txt +12 -13
- package/mcp-docs/mobile/components/DotSymbol.txt +21 -22
- package/mcp-docs/mobile/components/Fallback.txt +49 -50
- package/mcp-docs/mobile/components/FloatingAssetCard.txt +13 -14
- package/mcp-docs/mobile/components/HStack.txt +99 -100
- package/mcp-docs/mobile/components/HeroSquare.txt +11 -12
- package/mcp-docs/mobile/components/Icon.txt +16 -17
- package/mcp-docs/mobile/components/IconButton.txt +104 -105
- package/mcp-docs/mobile/components/InputChip.txt +62 -63
- package/mcp-docs/mobile/components/Interactable.txt +72 -73
- package/mcp-docs/mobile/components/LineChart.txt +117 -118
- package/mcp-docs/mobile/components/Link.txt +113 -114
- package/mcp-docs/mobile/components/ListCell.txt +149 -128
- package/mcp-docs/mobile/components/LogoMark.txt +8 -9
- package/mcp-docs/mobile/components/LogoWordMark.txt +7 -8
- package/mcp-docs/mobile/components/Lottie.txt +39 -40
- package/mcp-docs/mobile/components/LottieStatusAnimation.txt +11 -12
- package/mcp-docs/mobile/components/Modal.txt +36 -37
- package/mcp-docs/mobile/components/ModalBody.txt +5 -6
- package/mcp-docs/mobile/components/ModalFooter.txt +5 -6
- package/mcp-docs/mobile/components/ModalHeader.txt +5 -6
- package/mcp-docs/mobile/components/MultiContentModule.txt +107 -108
- package/mcp-docs/mobile/components/NavigationTitle.txt +13 -14
- package/mcp-docs/mobile/components/NavigationTitleSelect.txt +20 -21
- package/mcp-docs/mobile/components/NudgeCard.txt +20 -21
- package/mcp-docs/mobile/components/Numpad.txt +108 -109
- package/mcp-docs/mobile/components/Overlay.txt +45 -46
- package/mcp-docs/mobile/components/PageFooter.txt +57 -58
- package/mcp-docs/mobile/components/PageHeader.txt +79 -80
- package/mcp-docs/mobile/components/PeriodSelector.txt +98 -99
- package/mcp-docs/mobile/components/Pictogram.txt +11 -12
- package/mcp-docs/mobile/components/Point.txt +21 -22
- package/mcp-docs/mobile/components/PortalProvider.txt +7 -8
- package/mcp-docs/mobile/components/Pressable.txt +67 -68
- package/mcp-docs/mobile/components/ProgressBar.txt +18 -19
- package/mcp-docs/mobile/components/ProgressBarWithFixedLabels.txt +13 -14
- package/mcp-docs/mobile/components/ProgressBarWithFloatLabel.txt +13 -14
- package/mcp-docs/mobile/components/ProgressCircle.txt +22 -23
- package/mcp-docs/mobile/components/Radio.txt +35 -36
- package/mcp-docs/mobile/components/RadioCell.txt +73 -74
- package/mcp-docs/mobile/components/RadioGroup.txt +35 -36
- package/mcp-docs/mobile/components/ReferenceLine.txt +15 -16
- package/mcp-docs/mobile/components/RemoteImage.txt +47 -48
- package/mcp-docs/mobile/components/RemoteImageGroup.txt +11 -12
- package/mcp-docs/mobile/components/RollingNumber.txt +130 -131
- package/mcp-docs/mobile/components/Scrubber.txt +19 -20
- package/mcp-docs/mobile/components/SearchInput.txt +77 -78
- package/mcp-docs/mobile/components/SectionHeader.txt +16 -17
- package/mcp-docs/mobile/components/SegmentedTabs.txt +105 -106
- package/mcp-docs/mobile/components/Select.txt +35 -36
- package/mcp-docs/mobile/components/SelectChip.txt +143 -144
- package/mcp-docs/mobile/components/SelectOption.txt +26 -27
- package/mcp-docs/mobile/components/SlideButton.txt +128 -129
- package/mcp-docs/mobile/components/Spacer.txt +27 -28
- package/mcp-docs/mobile/components/Sparkline.txt +18 -19
- package/mcp-docs/mobile/components/SparklineGradient.txt +18 -19
- package/mcp-docs/mobile/components/SparklineInteractive.txt +37 -38
- package/mcp-docs/mobile/components/SparklineInteractiveHeader.txt +12 -13
- package/mcp-docs/mobile/components/Spinner.txt +15 -16
- package/mcp-docs/mobile/components/SpotIcon.txt +11 -12
- package/mcp-docs/mobile/components/SpotRectangle.txt +11 -12
- package/mcp-docs/mobile/components/SpotSquare.txt +11 -12
- package/mcp-docs/mobile/components/Stepper.txt +113 -114
- package/mcp-docs/mobile/components/SubBrandLogoMark.txt +8 -9
- package/mcp-docs/mobile/components/SubBrandLogoWordMark.txt +8 -9
- package/mcp-docs/mobile/components/Switch.txt +35 -36
- package/mcp-docs/mobile/components/TabIndicator.txt +12 -13
- package/mcp-docs/mobile/components/TabLabel.txt +28 -29
- package/mcp-docs/mobile/components/TabNavigation.txt +41 -42
- package/mcp-docs/mobile/components/TabbedChips.txt +38 -39
- package/mcp-docs/mobile/components/Tabs.txt +76 -77
- package/mcp-docs/mobile/components/Tag.txt +102 -103
- package/mcp-docs/mobile/components/Text.txt +91 -92
- package/mcp-docs/mobile/components/TextInput.txt +107 -108
- package/mcp-docs/mobile/components/ThemeProvider.txt +8 -9
- package/mcp-docs/mobile/components/Toast.txt +82 -83
- package/mcp-docs/mobile/components/Tooltip.txt +20 -21
- package/mcp-docs/mobile/components/TopNavBar.txt +55 -56
- package/mcp-docs/mobile/components/Tour.txt +18 -19
- package/mcp-docs/mobile/components/Tray.txt +43 -44
- package/mcp-docs/mobile/components/UpsellCard.txt +16 -17
- package/mcp-docs/mobile/components/VStack.txt +99 -100
- package/mcp-docs/mobile/components/XAxis.txt +25 -26
- package/mcp-docs/mobile/components/YAxis.txt +26 -27
- package/mcp-docs/mobile/getting-started/{mcp-server.txt → ai-overview.txt} +51 -37
- package/mcp-docs/mobile/getting-started/installation.txt +57 -0
- package/mcp-docs/mobile/getting-started/introduction.txt +3 -0
- package/mcp-docs/mobile/getting-started/playground.txt +3 -0
- package/mcp-docs/mobile/getting-started/styling.txt +84 -0
- package/mcp-docs/mobile/getting-started/theming.txt +286 -0
- package/mcp-docs/mobile/hooks/useDimensions.txt +27 -2
- package/mcp-docs/mobile/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/mobile/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/mobile/hooks/useOverlayContentContext.txt +67 -2
- package/mcp-docs/mobile/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/mobile/hooks/useRefMap.txt +178 -0
- package/mcp-docs/mobile/hooks/useTheme.txt +213 -2
- package/mcp-docs/mobile/routes.txt +8 -1
- package/mcp-docs/web/components/Accordion.txt +12 -13
- package/mcp-docs/web/components/AccordionItem.txt +5 -6
- package/mcp-docs/web/components/Alert.txt +24 -25
- package/mcp-docs/web/components/AreaChart.txt +137 -138
- package/mcp-docs/web/components/Avatar.txt +91 -92
- package/mcp-docs/web/components/AvatarButton.txt +113 -114
- package/mcp-docs/web/components/Banner.txt +101 -102
- package/mcp-docs/web/components/BarChart.txt +367 -368
- package/mcp-docs/web/components/Box.txt +65 -66
- package/mcp-docs/web/components/Button.txt +81 -82
- package/mcp-docs/web/components/ButtonGroup.txt +10 -11
- package/mcp-docs/web/components/Calendar.txt +56 -57
- package/mcp-docs/web/components/Carousel.txt +116 -117
- package/mcp-docs/web/components/CartesianChart.txt +357 -358
- package/mcp-docs/web/components/CellMedia.txt +14 -15
- package/mcp-docs/web/components/Checkbox.txt +22 -23
- package/mcp-docs/web/components/CheckboxCell.txt +70 -71
- package/mcp-docs/web/components/CheckboxGroup.txt +15 -16
- package/mcp-docs/web/components/Chip.txt +67 -68
- package/mcp-docs/web/components/Coachmark.txt +69 -70
- package/mcp-docs/web/components/Collapsible.txt +15 -16
- package/mcp-docs/web/components/ContainedAssetCard.txt +108 -109
- package/mcp-docs/web/components/ContentCard.txt +101 -102
- package/mcp-docs/web/components/ContentCardBody.txt +23 -24
- package/mcp-docs/web/components/ContentCardFooter.txt +19 -20
- package/mcp-docs/web/components/ContentCardHeader.txt +33 -34
- package/mcp-docs/web/components/ContentCell.txt +85 -86
- package/mcp-docs/web/components/ControlGroup.txt +108 -109
- package/mcp-docs/web/components/DatePicker.txt +59 -60
- package/mcp-docs/web/components/Divider.txt +31 -32
- package/mcp-docs/web/components/DotCount.txt +17 -18
- package/mcp-docs/web/components/DotStatusColor.txt +12 -13
- package/mcp-docs/web/components/DotSymbol.txt +24 -25
- package/mcp-docs/web/components/Dropdown.txt +31 -32
- package/mcp-docs/web/components/Fallback.txt +49 -50
- package/mcp-docs/web/components/FloatingAssetCard.txt +108 -109
- package/mcp-docs/web/components/FullscreenAlert.txt +20 -21
- package/mcp-docs/web/components/FullscreenModal.txt +28 -29
- package/mcp-docs/web/components/FullscreenModalLayout.txt +19 -20
- package/mcp-docs/web/components/Grid.txt +106 -107
- package/mcp-docs/web/components/GridColumn.txt +96 -97
- package/mcp-docs/web/components/HStack.txt +101 -102
- package/mcp-docs/web/components/HeroSquare.txt +12 -13
- package/mcp-docs/web/components/Icon.txt +27 -28
- package/mcp-docs/web/components/IconButton.txt +117 -118
- package/mcp-docs/web/components/InputChip.txt +62 -63
- package/mcp-docs/web/components/Interactable.txt +75 -76
- package/mcp-docs/web/components/LineChart.txt +366 -367
- package/mcp-docs/web/components/Link.txt +114 -115
- package/mcp-docs/web/components/ListCell.txt +157 -136
- package/mcp-docs/web/components/LogoMark.txt +8 -9
- package/mcp-docs/web/components/LogoWordMark.txt +7 -8
- package/mcp-docs/web/components/Lottie.txt +44 -45
- package/mcp-docs/web/components/LottieStatusAnimation.txt +11 -12
- package/mcp-docs/web/components/MediaQueryProvider.txt +7 -8
- package/mcp-docs/web/components/Modal.txt +69 -66
- package/mcp-docs/web/components/ModalBody.txt +5 -6
- package/mcp-docs/web/components/ModalFooter.txt +5 -6
- package/mcp-docs/web/components/ModalHeader.txt +5 -6
- package/mcp-docs/web/components/MultiContentModule.txt +109 -110
- package/mcp-docs/web/components/NavigationBar.txt +18 -19
- package/mcp-docs/web/components/NavigationTitle.txt +7 -8
- package/mcp-docs/web/components/NavigationTitleSelect.txt +9 -10
- package/mcp-docs/web/components/NudgeCard.txt +61 -62
- package/mcp-docs/web/components/Overlay.txt +57 -58
- package/mcp-docs/web/components/PageFooter.txt +77 -78
- package/mcp-docs/web/components/PageHeader.txt +107 -108
- package/mcp-docs/web/components/Pagination.txt +115 -116
- package/mcp-docs/web/components/PeriodSelector.txt +158 -159
- package/mcp-docs/web/components/Pictogram.txt +13 -14
- package/mcp-docs/web/components/Point.txt +169 -170
- package/mcp-docs/web/components/PortalProvider.txt +6 -7
- package/mcp-docs/web/components/Pressable.txt +73 -74
- package/mcp-docs/web/components/ProgressBar.txt +20 -21
- package/mcp-docs/web/components/ProgressBarWithFixedLabels.txt +15 -16
- package/mcp-docs/web/components/ProgressBarWithFloatLabel.txt +15 -16
- package/mcp-docs/web/components/ProgressCircle.txt +24 -25
- package/mcp-docs/web/components/Radio.txt +22 -23
- package/mcp-docs/web/components/RadioCell.txt +83 -84
- package/mcp-docs/web/components/RadioGroup.txt +22 -23
- package/mcp-docs/web/components/ReferenceLine.txt +22 -23
- package/mcp-docs/web/components/RemoteImage.txt +49 -50
- package/mcp-docs/web/components/RemoteImageGroup.txt +11 -12
- package/mcp-docs/web/components/RollingNumber.txt +131 -132
- package/mcp-docs/web/components/Scrubber.txt +22 -23
- package/mcp-docs/web/components/SearchInput.txt +29 -30
- package/mcp-docs/web/components/SectionHeader.txt +98 -99
- package/mcp-docs/web/components/SegmentedTabs.txt +109 -110
- package/mcp-docs/web/components/Select.txt +22 -23
- package/mcp-docs/web/components/SelectChip.txt +134 -135
- package/mcp-docs/web/components/SelectOption.txt +31 -32
- package/mcp-docs/web/components/Sidebar.txt +109 -110
- package/mcp-docs/web/components/SidebarItem.txt +6 -7
- package/mcp-docs/web/components/SidebarMoreMenu.txt +5 -6
- package/mcp-docs/web/components/Spacer.txt +57 -58
- package/mcp-docs/web/components/Sparkline.txt +18 -19
- package/mcp-docs/web/components/SparklineGradient.txt +18 -19
- package/mcp-docs/web/components/SparklineInteractive.txt +34 -35
- package/mcp-docs/web/components/SparklineInteractiveHeader.txt +12 -13
- package/mcp-docs/web/components/Spinner.txt +15 -16
- package/mcp-docs/web/components/SpotIcon.txt +12 -13
- package/mcp-docs/web/components/SpotRectangle.txt +12 -13
- package/mcp-docs/web/components/SpotSquare.txt +12 -13
- package/mcp-docs/web/components/Stepper.txt +119 -120
- package/mcp-docs/web/components/SubBrandLogoMark.txt +8 -9
- package/mcp-docs/web/components/SubBrandLogoWordMark.txt +8 -9
- package/mcp-docs/web/components/Switch.txt +23 -24
- package/mcp-docs/web/components/TabIndicator.txt +12 -13
- package/mcp-docs/web/components/TabLabel.txt +28 -29
- package/mcp-docs/web/components/TabNavigation.txt +41 -42
- package/mcp-docs/web/components/TabbedChips.txt +38 -39
- package/mcp-docs/web/components/Table.txt +17 -18
- package/mcp-docs/web/components/TableBody.txt +9 -10
- package/mcp-docs/web/components/TableCaption.txt +13 -14
- package/mcp-docs/web/components/TableCell.txt +21 -22
- package/mcp-docs/web/components/TableCellFallback.txt +16 -17
- package/mcp-docs/web/components/TableFooter.txt +9 -10
- package/mcp-docs/web/components/TableHeader.txt +10 -11
- package/mcp-docs/web/components/TableRow.txt +13 -14
- package/mcp-docs/web/components/Tabs.txt +94 -95
- package/mcp-docs/web/components/Tag.txt +106 -107
- package/mcp-docs/web/components/Text.txt +110 -111
- package/mcp-docs/web/components/TextInput.txt +32 -33
- package/mcp-docs/web/components/ThemeProvider.txt +27 -28
- package/mcp-docs/web/components/TileButton.txt +37 -38
- package/mcp-docs/web/components/Toast.txt +82 -83
- package/mcp-docs/web/components/Tooltip.txt +22 -23
- package/mcp-docs/web/components/Tour.txt +21 -22
- package/mcp-docs/web/components/Tray.txt +23 -24
- package/mcp-docs/web/components/UpsellCard.txt +16 -17
- package/mcp-docs/web/components/VStack.txt +101 -102
- package/mcp-docs/web/components/XAxis.txt +25 -26
- package/mcp-docs/web/components/YAxis.txt +26 -27
- package/mcp-docs/web/getting-started/{mcp-server.txt → ai-overview.txt} +51 -37
- package/mcp-docs/web/getting-started/installation.txt +103 -0
- package/mcp-docs/web/getting-started/introduction.txt +3 -0
- package/mcp-docs/web/getting-started/playground.txt +3 -0
- package/mcp-docs/web/getting-started/styling.txt +161 -0
- package/mcp-docs/web/getting-started/templates.txt +121 -0
- package/mcp-docs/web/getting-started/theming.txt +426 -0
- package/mcp-docs/web/hooks/useBreakpoints.txt +30 -2
- package/mcp-docs/web/hooks/useDimensions.txt +61 -2
- package/mcp-docs/web/hooks/useEventHandler.txt +120 -0
- package/mcp-docs/web/hooks/useHasMounted.txt +22 -2
- package/mcp-docs/web/hooks/useIsoEffect.txt +18 -2
- package/mcp-docs/web/hooks/useMediaQuery.txt +22 -2
- package/mcp-docs/web/hooks/useMergeRefs.txt +116 -0
- package/mcp-docs/web/hooks/useOverlayContentContext.txt +64 -2
- package/mcp-docs/web/hooks/usePreviousValue.txt +74 -0
- package/mcp-docs/web/hooks/useRefMap.txt +178 -0
- package/mcp-docs/web/hooks/useScrollBlocker.txt +21 -2
- package/mcp-docs/web/hooks/useTheme.txt +261 -2
- package/mcp-docs/web/routes.txt +9 -1
- package/package.json +1 -1
|
@@ -4,45 +4,10 @@ A control for toggling between on and off.
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { Switch } from '@coinbase/cds-mobile/controls/Switch'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
| Prop | Type | Required | Default | Description |
|
|
14
|
-
| --- | --- | --- | --- | --- |
|
|
15
|
-
| `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 | `checked ? 'bgPrimary' : 'bgTertiary'` | Background color of the overlay (element being interacted with). |
|
|
16
|
-
| `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 | `-` | - |
|
|
17
|
-
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `1000` | - |
|
|
18
|
-
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `0` | - |
|
|
19
|
-
| `checked` | `boolean` | No | `-` | Set the control to selected/on. |
|
|
20
|
-
| `children` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Label for the control option. |
|
|
21
|
-
| `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 | `-` | - |
|
|
22
|
-
| `controlColor` | `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 | `bgPrimary` | Sets the checked/active color of the control. |
|
|
23
|
-
| `disabled` | `boolean` | No | `-` | Disable user interaction. |
|
|
24
|
-
| `indeterminate` | `boolean` | No | `-` | Enable indeterminate state. Useful when you want to indicate that sub-items of a control are partially filled. |
|
|
25
|
-
| `key` | `Key \| null` | No | `-` | - |
|
|
26
|
-
| `onChange` | `((value: string, checked?: boolean \| undefined) => void) \| undefined` | No | `-` | Toggle control selected state. |
|
|
27
|
-
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
28
|
-
| `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
29
|
-
| `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
30
|
-
| `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
31
|
-
| `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
32
|
-
| `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
33
|
-
| `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
34
|
-
| `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
35
|
-
| `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
36
|
-
| `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
37
|
-
| `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
38
|
-
| `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
39
|
-
| `onPress` | `((event: GestureResponderEvent) => void) \| null` | No | `-` | Called when a single tap gesture is detected. |
|
|
40
|
-
| `readOnly` | `boolean` | No | `-` | Set the control to ready-only. Similar effect as disabled. |
|
|
41
|
-
| `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
|
|
42
|
-
| `testID` | `string` | No | `-` | Used to locate this view in end-to-end tests. |
|
|
43
|
-
| `value` | `string` | No | `-` | Value of the option. Useful for multiple choice. |
|
|
44
|
-
|
|
45
|
-
|
|
46
11
|
## Examples
|
|
47
12
|
|
|
48
13
|
```jsx
|
|
@@ -95,4 +60,38 @@ function AdvancedCustomColors() {
|
|
|
95
60
|
}
|
|
96
61
|
```
|
|
97
62
|
|
|
63
|
+
## Props
|
|
64
|
+
|
|
65
|
+
| Prop | Type | Required | Default | Description |
|
|
66
|
+
| --- | --- | --- | --- | --- |
|
|
67
|
+
| `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 | `checked ? 'bgPrimary' : 'bgTertiary'` | Background color of the overlay (element being interacted with). |
|
|
68
|
+
| `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 | `-` | - |
|
|
69
|
+
| `borderRadius` | `0 \| 100 \| 200 \| 300 \| 400 \| 500 \| 600 \| 700 \| 800 \| 900 \| 1000` | No | `1000` | - |
|
|
70
|
+
| `borderWidth` | `0 \| 100 \| 200 \| 300 \| 400 \| 500` | No | `0` | - |
|
|
71
|
+
| `checked` | `boolean` | No | `-` | Set the control to selected/on. |
|
|
72
|
+
| `children` | `null \| string \| number \| false \| true \| ReactElement<any, string \| JSXElementConstructor<any>> \| Iterable<ReactNode> \| ReactPortal` | No | `-` | Label for the control option. |
|
|
73
|
+
| `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 | `-` | - |
|
|
74
|
+
| `controlColor` | `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 | `bgPrimary` | Sets the checked/active color of the control. |
|
|
75
|
+
| `disabled` | `boolean` | No | `-` | Disable user interaction. |
|
|
76
|
+
| `indeterminate` | `boolean` | No | `-` | Enable indeterminate state. Useful when you want to indicate that sub-items of a control are partially filled. |
|
|
77
|
+
| `key` | `Key \| null` | No | `-` | - |
|
|
78
|
+
| `onChange` | `((value: string, checked?: boolean \| undefined) => void) \| undefined` | No | `-` | Toggle control selected state. |
|
|
79
|
+
| `onPointerCancel` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
80
|
+
| `onPointerCancelCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
81
|
+
| `onPointerDown` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
82
|
+
| `onPointerDownCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
83
|
+
| `onPointerEnter` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
84
|
+
| `onPointerEnterCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
85
|
+
| `onPointerLeave` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
86
|
+
| `onPointerLeaveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
87
|
+
| `onPointerMove` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
88
|
+
| `onPointerMoveCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
89
|
+
| `onPointerUp` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
90
|
+
| `onPointerUpCapture` | `((event: PointerEvent) => void)` | No | `-` | - |
|
|
91
|
+
| `onPress` | `((event: GestureResponderEvent) => void) \| null` | No | `-` | Called when a single tap gesture is detected. |
|
|
92
|
+
| `readOnly` | `boolean` | No | `-` | Set the control to ready-only. Similar effect as disabled. |
|
|
93
|
+
| `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
|
|
94
|
+
| `testID` | `string` | No | `-` | Used to locate this view in end-to-end tests. |
|
|
95
|
+
| `value` | `string` | No | `-` | Value of the option. Useful for multiple choice. |
|
|
96
|
+
|
|
98
97
|
|
|
@@ -4,22 +4,10 @@ A visual indicator that shows the active tab position.
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { TabIndicator } from '@coinbase/cds-mobile/tabs/TabIndicator'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
## Props
|
|
12
|
-
|
|
13
|
-
| Prop | Type | Required | Default | Description |
|
|
14
|
-
| --- | --- | --- | --- | --- |
|
|
15
|
-
| `width` | `number` | Yes | `-` | The width of the active TabLabel. |
|
|
16
|
-
| `x` | `number` | Yes | `-` | The xPosition of the active TabLabel. |
|
|
17
|
-
| `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 | `: 'bg'` | This should always match the background color of the parent container |
|
|
18
|
-
| `key` | `Key \| null` | No | `-` | - |
|
|
19
|
-
| `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
|
|
20
|
-
| `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 |
|
|
21
|
-
|
|
22
|
-
|
|
23
11
|
## Examples
|
|
24
12
|
|
|
25
13
|
### Basic Example
|
|
@@ -46,4 +34,15 @@ function TabIndicatorExample() {
|
|
|
46
34
|
}
|
|
47
35
|
```
|
|
48
36
|
|
|
37
|
+
## Props
|
|
38
|
+
|
|
39
|
+
| Prop | Type | Required | Default | Description |
|
|
40
|
+
| --- | --- | --- | --- | --- |
|
|
41
|
+
| `width` | `number` | Yes | `-` | The width of the active TabLabel. |
|
|
42
|
+
| `x` | `number` | Yes | `-` | The xPosition of the active TabLabel. |
|
|
43
|
+
| `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 | `: 'bg'` | This should always match the background color of the parent container |
|
|
44
|
+
| `key` | `Key \| null` | No | `-` | - |
|
|
45
|
+
| `ref` | `((instance: View \| null) => void) \| RefObject<View> \| null` | No | `-` | - |
|
|
46
|
+
| `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 |
|
|
47
|
+
|
|
49
48
|
|
|
@@ -4,10 +4,37 @@ A text label component used within tab navigation.
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { TabLabel } from '@coinbase/cds-mobile/tabs/TabLabel'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic Example
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
<VStack gap={2}>
|
|
17
|
+
<HStack gap={2}>
|
|
18
|
+
<TabLabel>Primary tab</TabLabel>
|
|
19
|
+
<TabLabel count={1}>Primary tab</TabLabel>
|
|
20
|
+
<TabLabel count={10}>Primary tab</TabLabel>
|
|
21
|
+
<TabLabel count={100}>Primary tab</TabLabel>
|
|
22
|
+
</HStack>
|
|
23
|
+
<HStack gap={2}>
|
|
24
|
+
<TabLabel variant="secondary">Secondary tab</TabLabel>
|
|
25
|
+
<TabLabel variant="secondary" count={1}>
|
|
26
|
+
Secondary tab
|
|
27
|
+
</TabLabel>
|
|
28
|
+
<TabLabel variant="secondary" count={10}>
|
|
29
|
+
Secondary tab
|
|
30
|
+
</TabLabel>
|
|
31
|
+
<TabLabel variant="secondary" count={100}>
|
|
32
|
+
Secondary tab
|
|
33
|
+
</TabLabel>
|
|
34
|
+
</HStack>
|
|
35
|
+
</VStack>
|
|
36
|
+
```
|
|
37
|
+
|
|
11
38
|
## Props
|
|
12
39
|
|
|
13
40
|
| Prop | Type | Required | Default | Description |
|
|
@@ -124,31 +151,3 @@ import { TabLabel } from '@coinbase/cds-mobile/tabs/TabLabel'
|
|
|
124
151
|
| `zIndex` | `number` | No | `-` | - |
|
|
125
152
|
|
|
126
153
|
|
|
127
|
-
## Examples
|
|
128
|
-
|
|
129
|
-
### Basic Example
|
|
130
|
-
|
|
131
|
-
```jsx
|
|
132
|
-
<VStack gap={2}>
|
|
133
|
-
<HStack gap={2}>
|
|
134
|
-
<TabLabel>Primary tab</TabLabel>
|
|
135
|
-
<TabLabel count={1}>Primary tab</TabLabel>
|
|
136
|
-
<TabLabel count={10}>Primary tab</TabLabel>
|
|
137
|
-
<TabLabel count={100}>Primary tab</TabLabel>
|
|
138
|
-
</HStack>
|
|
139
|
-
<HStack gap={2}>
|
|
140
|
-
<TabLabel variant="secondary">Secondary tab</TabLabel>
|
|
141
|
-
<TabLabel variant="secondary" count={1}>
|
|
142
|
-
Secondary tab
|
|
143
|
-
</TabLabel>
|
|
144
|
-
<TabLabel variant="secondary" count={10}>
|
|
145
|
-
Secondary tab
|
|
146
|
-
</TabLabel>
|
|
147
|
-
<TabLabel variant="secondary" count={100}>
|
|
148
|
-
Secondary tab
|
|
149
|
-
</TabLabel>
|
|
150
|
-
</HStack>
|
|
151
|
-
</VStack>
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
|
|
@@ -4,10 +4,50 @@ Organizes content across different screens or data sets.
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { TabNavigation } from '@coinbase/cds-mobile/navigation/TabNavigation'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic Example
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
function TabNavigationExample() {
|
|
17
|
+
// TAB MOCK DATA
|
|
18
|
+
const tabs = useMemo(() => [
|
|
19
|
+
{ id: 'first_primary_tab', label: 'Tab one' },
|
|
20
|
+
{ id: 'second_primary_tab', label: 'Tab two' },
|
|
21
|
+
{ id: 'third_primary_tab', label: 'Tab three' },
|
|
22
|
+
{ id: 'fourth_primary_tab', label: 'Tab four' },
|
|
23
|
+
{ id: 'fifth_primary_tab', label: 'Tab five' },
|
|
24
|
+
]);
|
|
25
|
+
const secondaryTabs = useMemo(() => [
|
|
26
|
+
{ id: 'first_secondary_tab', label: 'Tab one' },
|
|
27
|
+
{ id: 'second_secondary_tab', label: 'Tab two' },
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
const [primary, setPrimary] = useState();
|
|
31
|
+
const [secondary, setSecondary] = useState();
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<VStack gap={2}>
|
|
35
|
+
<TabNavigation value={primary} tabs={tabs} onChange={setPrimary} />
|
|
36
|
+
<TabNavigation
|
|
37
|
+
variant="secondary"
|
|
38
|
+
value={secondary}
|
|
39
|
+
tabs={secondaryTabs}
|
|
40
|
+
onChange={setSecondary}
|
|
41
|
+
/>
|
|
42
|
+
</VStack>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
import A11y from './a11y.mdx';
|
|
48
|
+
|
|
49
|
+
<A11y />
|
|
50
|
+
|
|
11
51
|
## Props
|
|
12
52
|
|
|
13
53
|
| Prop | Type | Required | Default | Description |
|
|
@@ -104,44 +144,3 @@ import { TabNavigation } from '@coinbase/cds-mobile/navigation/TabNavigation'
|
|
|
104
144
|
| `zIndex` | `number` | No | `-` | - |
|
|
105
145
|
|
|
106
146
|
|
|
107
|
-
## Examples
|
|
108
|
-
|
|
109
|
-
### Basic Example
|
|
110
|
-
|
|
111
|
-
```jsx
|
|
112
|
-
function TabNavigationExample() {
|
|
113
|
-
// TAB MOCK DATA
|
|
114
|
-
const tabs = useMemo(() => [
|
|
115
|
-
{ id: 'first_primary_tab', label: 'Tab one' },
|
|
116
|
-
{ id: 'second_primary_tab', label: 'Tab two' },
|
|
117
|
-
{ id: 'third_primary_tab', label: 'Tab three' },
|
|
118
|
-
{ id: 'fourth_primary_tab', label: 'Tab four' },
|
|
119
|
-
{ id: 'fifth_primary_tab', label: 'Tab five' },
|
|
120
|
-
]);
|
|
121
|
-
const secondaryTabs = useMemo(() => [
|
|
122
|
-
{ id: 'first_secondary_tab', label: 'Tab one' },
|
|
123
|
-
{ id: 'second_secondary_tab', label: 'Tab two' },
|
|
124
|
-
]);
|
|
125
|
-
|
|
126
|
-
const [primary, setPrimary] = useState();
|
|
127
|
-
const [secondary, setSecondary] = useState();
|
|
128
|
-
|
|
129
|
-
return (
|
|
130
|
-
<VStack gap={2}>
|
|
131
|
-
<TabNavigation value={primary} tabs={tabs} onChange={setPrimary} />
|
|
132
|
-
<TabNavigation
|
|
133
|
-
variant="secondary"
|
|
134
|
-
value={secondary}
|
|
135
|
-
tabs={secondaryTabs}
|
|
136
|
-
onChange={setSecondary}
|
|
137
|
-
/>
|
|
138
|
-
</VStack>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
import A11y from './a11y.mdx';
|
|
144
|
-
|
|
145
|
-
<A11y />
|
|
146
|
-
|
|
147
|
-
|
|
@@ -4,10 +4,47 @@ Tab chips are to be used in a filter setting where the user is given the ability
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { TabbedChips } from '@coinbase/cds-mobile/chips/TabbedChips'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic Example
|
|
14
|
+
|
|
15
|
+
```jsx
|
|
16
|
+
function TabbedChipsExample() {
|
|
17
|
+
const tabs = [
|
|
18
|
+
{
|
|
19
|
+
id: 'all_tab',
|
|
20
|
+
label: 'All',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
id: 'swap_',
|
|
24
|
+
label: 'Swap',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: 'collect_tab',
|
|
28
|
+
label: 'Collect',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'bridge_tab',
|
|
32
|
+
label: 'Bridge',
|
|
33
|
+
},
|
|
34
|
+
];
|
|
35
|
+
const [value, setValue] = useState(tabs[0].id);
|
|
36
|
+
return (
|
|
37
|
+
<VStack maxWidth={375} borderRadius={400} bordered paddingX={2} gap={2} paddingY={2}>
|
|
38
|
+
<VStack paddingTop={1}>
|
|
39
|
+
<TextTitle3 as="p">Popular assets</TextTitle3>
|
|
40
|
+
</VStack>
|
|
41
|
+
<SearchInput compact placeholder="Search by name" />
|
|
42
|
+
<TabbedChips value={value} onChange={setValue} tabs={tabs} />
|
|
43
|
+
</VStack>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
11
48
|
## Props
|
|
12
49
|
|
|
13
50
|
| Prop | Type | Required | Default | Description |
|
|
@@ -103,41 +140,3 @@ import { TabbedChips } from '@coinbase/cds-mobile/chips/TabbedChips'
|
|
|
103
140
|
| `zIndex` | `number` | No | `-` | - |
|
|
104
141
|
|
|
105
142
|
|
|
106
|
-
## Examples
|
|
107
|
-
|
|
108
|
-
### Basic Example
|
|
109
|
-
|
|
110
|
-
```jsx
|
|
111
|
-
function TabbedChipsExample() {
|
|
112
|
-
const tabs = [
|
|
113
|
-
{
|
|
114
|
-
id: 'all_tab',
|
|
115
|
-
label: 'All',
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
id: 'swap_',
|
|
119
|
-
label: 'Swap',
|
|
120
|
-
},
|
|
121
|
-
{
|
|
122
|
-
id: 'collect_tab',
|
|
123
|
-
label: 'Collect',
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
id: 'bridge_tab',
|
|
127
|
-
label: 'Bridge',
|
|
128
|
-
},
|
|
129
|
-
];
|
|
130
|
-
const [value, setValue] = useState(tabs[0].id);
|
|
131
|
-
return (
|
|
132
|
-
<VStack maxWidth={375} borderRadius={400} bordered paddingX={2} gap={2} paddingY={2}>
|
|
133
|
-
<VStack paddingTop={1}>
|
|
134
|
-
<TextTitle3 as="p">Popular assets</TextTitle3>
|
|
135
|
-
</VStack>
|
|
136
|
-
<SearchInput compact placeholder="Search by name" />
|
|
137
|
-
<TabbedChips value={value} onChange={setValue} tabs={tabs} />
|
|
138
|
-
</VStack>
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
```
|
|
142
|
-
|
|
143
|
-
|
|
@@ -4,10 +4,85 @@ Tabs is a flexible, accessible tab navigation component for React Native, suppor
|
|
|
4
4
|
|
|
5
5
|
## Import
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```tsx
|
|
8
8
|
import { Tabs } from '@coinbase/cds-mobile/tabs/Tabs'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## Examples
|
|
12
|
+
|
|
13
|
+
### Basic usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
const tabs = [
|
|
17
|
+
{ id: 'tab1', label: 'Tab 1' },
|
|
18
|
+
{ id: 'tab2', label: 'Tab 2' },
|
|
19
|
+
{ id: 'tab3', label: 'Tab 3' },
|
|
20
|
+
];
|
|
21
|
+
|
|
22
|
+
const TabComponent = ({ id, label, disabled }) => {
|
|
23
|
+
const { activeTab, updateActiveTab } = useTabsContext();
|
|
24
|
+
const isActive = activeTab?.id === id;
|
|
25
|
+
return (
|
|
26
|
+
<Pressable
|
|
27
|
+
onPress={() => updateActiveTab(id)}
|
|
28
|
+
disabled={disabled}
|
|
29
|
+
accessibilityLabel={label}
|
|
30
|
+
accessibilityRole="tab"
|
|
31
|
+
accessibilityState={{ selected: isActive, disabled }}
|
|
32
|
+
>
|
|
33
|
+
<TabLabel id={id} active={isActive}>
|
|
34
|
+
{label}
|
|
35
|
+
</TabLabel>
|
|
36
|
+
</Pressable>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
<Tabs
|
|
41
|
+
tabs={tabs}
|
|
42
|
+
activeTab={tabs[0]}
|
|
43
|
+
onChange={() => {}}
|
|
44
|
+
TabComponent={TabComponent}
|
|
45
|
+
TabsActiveIndicatorComponent={TabsIndicator}
|
|
46
|
+
/>;
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Custom Tab Component
|
|
50
|
+
|
|
51
|
+
```tsx
|
|
52
|
+
const tabs = [
|
|
53
|
+
{ id: 'home', label: 'Home', icon: '🏠' },
|
|
54
|
+
{ id: 'profile', label: 'Profile', icon: '👤' },
|
|
55
|
+
{ id: 'settings', label: 'Settings', icon: '⚙️' },
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
const CustomTab = ({ id, label, icon, disabled }) => {
|
|
59
|
+
const { activeTab, updateActiveTab } = useTabsContext();
|
|
60
|
+
const isActive = activeTab?.id === id;
|
|
61
|
+
return (
|
|
62
|
+
<Pressable
|
|
63
|
+
onPress={() => updateActiveTab(id)}
|
|
64
|
+
disabled={disabled}
|
|
65
|
+
accessibilityLabel={label}
|
|
66
|
+
accessibilityRole="tab"
|
|
67
|
+
accessibilityState={{ selected: isActive, disabled }}
|
|
68
|
+
>
|
|
69
|
+
<TabLabel id={id} active={isActive}>
|
|
70
|
+
{label}
|
|
71
|
+
{icon}
|
|
72
|
+
</TabLabel>
|
|
73
|
+
</Pressable>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
<Tabs
|
|
78
|
+
tabs={tabs}
|
|
79
|
+
activeTab={tabs[0]}
|
|
80
|
+
onChange={() => {}}
|
|
81
|
+
TabComponent={CustomTab}
|
|
82
|
+
TabsActiveIndicatorComponent={TabsIndicator}
|
|
83
|
+
/>;
|
|
84
|
+
```
|
|
85
|
+
|
|
11
86
|
## Props
|
|
12
87
|
|
|
13
88
|
| Prop | Type | Required | Default | Description |
|
|
@@ -113,79 +188,3 @@ import { Tabs } from '@coinbase/cds-mobile/tabs/Tabs'
|
|
|
113
188
|
| `zIndex` | `number` | No | `-` | - |
|
|
114
189
|
|
|
115
190
|
|
|
116
|
-
## Examples
|
|
117
|
-
|
|
118
|
-
### Basic usage
|
|
119
|
-
|
|
120
|
-
```tsx
|
|
121
|
-
const tabs = [
|
|
122
|
-
{ id: 'tab1', label: 'Tab 1' },
|
|
123
|
-
{ id: 'tab2', label: 'Tab 2' },
|
|
124
|
-
{ id: 'tab3', label: 'Tab 3' },
|
|
125
|
-
];
|
|
126
|
-
|
|
127
|
-
const TabComponent = ({ id, label, disabled }) => {
|
|
128
|
-
const { activeTab, updateActiveTab } = useTabsContext();
|
|
129
|
-
const isActive = activeTab?.id === id;
|
|
130
|
-
return (
|
|
131
|
-
<Pressable
|
|
132
|
-
onPress={() => updateActiveTab(id)}
|
|
133
|
-
disabled={disabled}
|
|
134
|
-
accessibilityLabel={label}
|
|
135
|
-
accessibilityRole="tab"
|
|
136
|
-
accessibilityState={{ selected: isActive, disabled }}
|
|
137
|
-
>
|
|
138
|
-
<TabLabel id={id} active={isActive}>
|
|
139
|
-
{label}
|
|
140
|
-
</TabLabel>
|
|
141
|
-
</Pressable>
|
|
142
|
-
);
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
<Tabs
|
|
146
|
-
tabs={tabs}
|
|
147
|
-
activeTab={tabs[0]}
|
|
148
|
-
onChange={() => {}}
|
|
149
|
-
TabComponent={TabComponent}
|
|
150
|
-
TabsActiveIndicatorComponent={TabsIndicator}
|
|
151
|
-
/>;
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Custom Tab Component
|
|
155
|
-
|
|
156
|
-
```tsx
|
|
157
|
-
const tabs = [
|
|
158
|
-
{ id: 'home', label: 'Home', icon: '🏠' },
|
|
159
|
-
{ id: 'profile', label: 'Profile', icon: '👤' },
|
|
160
|
-
{ id: 'settings', label: 'Settings', icon: '⚙️' },
|
|
161
|
-
];
|
|
162
|
-
|
|
163
|
-
const CustomTab = ({ id, label, icon, disabled }) => {
|
|
164
|
-
const { activeTab, updateActiveTab } = useTabsContext();
|
|
165
|
-
const isActive = activeTab?.id === id;
|
|
166
|
-
return (
|
|
167
|
-
<Pressable
|
|
168
|
-
onPress={() => updateActiveTab(id)}
|
|
169
|
-
disabled={disabled}
|
|
170
|
-
accessibilityLabel={label}
|
|
171
|
-
accessibilityRole="tab"
|
|
172
|
-
accessibilityState={{ selected: isActive, disabled }}
|
|
173
|
-
>
|
|
174
|
-
<TabLabel id={id} active={isActive}>
|
|
175
|
-
{label}
|
|
176
|
-
{icon}
|
|
177
|
-
</TabLabel>
|
|
178
|
-
</Pressable>
|
|
179
|
-
);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
<Tabs
|
|
183
|
-
tabs={tabs}
|
|
184
|
-
activeTab={tabs[0]}
|
|
185
|
-
onChange={() => {}}
|
|
186
|
-
TabComponent={CustomTab}
|
|
187
|
-
TabsActiveIndicatorComponent={TabsIndicator}
|
|
188
|
-
/>;
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
|