@coinbase/cds-mcp-server 8.17.3 → 8.17.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
1
|
# useTheme
|
|
2
|
+
|
|
3
3
|
Returns the currently active theme including color schemes, spacing, typography, and other design tokens.
|
|
4
4
|
|
|
5
5
|
## Import
|
|
@@ -8,6 +8,266 @@ Returns the currently active theme including color schemes, spacing, typography,
|
|
|
8
8
|
import { useTheme } from '@coinbase/cds-web'
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
## API
|
|
12
|
+
|
|
13
|
+
### Overview
|
|
14
|
+
|
|
15
|
+
The `useTheme` hook returns the currently active theme based on the `ThemeProvider's` active color scheme. All values are optimized for web usage, with numeric values in rem units and CSS-compatible formats.
|
|
16
|
+
|
|
17
|
+
### Parameters
|
|
18
|
+
|
|
19
|
+
None. The hook takes no parameters.
|
|
20
|
+
|
|
21
|
+
### Returns
|
|
22
|
+
|
|
23
|
+
Returns a `Theme` object containing the following categories of design tokens:
|
|
24
|
+
|
|
25
|
+
#### Color Tokens
|
|
26
|
+
|
|
27
|
+
##### Color Scheme
|
|
28
|
+
|
|
29
|
+
- `colorScheme`: `'light' | 'dark'`
|
|
30
|
+
- `spectrum`: Raw color values in RGB format (e.g., `'245,248,255'` for `blue0`)
|
|
31
|
+
|
|
32
|
+
##### Semantic Colors
|
|
33
|
+
|
|
34
|
+
- Text Colors
|
|
35
|
+
- `color.fg`: Primary text color (RGB format)
|
|
36
|
+
- `color.fgMuted`: Secondary text color
|
|
37
|
+
- `color.fgInverse`: Inverted text color
|
|
38
|
+
- `color.fgPrimary`: Primary brand text color
|
|
39
|
+
- `color.fgWarning`: Warning text color
|
|
40
|
+
- `color.fgPositive`: Success text color
|
|
41
|
+
- `color.fgNegative`: Error text color
|
|
42
|
+
|
|
43
|
+
- Background Colors
|
|
44
|
+
- `color.bg`: Primary background color
|
|
45
|
+
- `color.bgAlternate`: Secondary background color
|
|
46
|
+
- `color.bgInverse`: Inverted background color
|
|
47
|
+
- `color.bgOverlay`: Semi-transparent overlay
|
|
48
|
+
- `color.bgPrimary`: Primary brand background
|
|
49
|
+
- `color.bgPrimaryWash`: Light primary background
|
|
50
|
+
- `color.bgSecondary`: Secondary background
|
|
51
|
+
- `color.bgTertiary`: Tertiary background
|
|
52
|
+
- `color.bgSecondaryWash`: Light secondary background
|
|
53
|
+
- `color.bgNegative`: Error background
|
|
54
|
+
- `color.bgNegativeWash`: Light error background
|
|
55
|
+
- `color.bgPositive`: Success background
|
|
56
|
+
- `color.bgPositiveWash`: Light success background
|
|
57
|
+
- `color.bgWarning`: Warning background
|
|
58
|
+
- `color.bgWarningWash`: Light warning background
|
|
59
|
+
- `color.currentColor`: Current color context
|
|
60
|
+
- `color.bgElevation1`: First level elevation background
|
|
61
|
+
- `color.bgElevation2`: Second level elevation background
|
|
62
|
+
|
|
63
|
+
- Line Colors
|
|
64
|
+
- `color.bgLine`: Default line color (semi-transparent)
|
|
65
|
+
- `color.bgLineHeavy`: Emphasized line color
|
|
66
|
+
- `color.bgLineInverse`: Inverted line color
|
|
67
|
+
- `color.bgLinePrimary`: Primary brand line color
|
|
68
|
+
- `color.bgLinePrimarySubtle`: Subtle primary line color
|
|
69
|
+
|
|
70
|
+
- Accent Colors
|
|
71
|
+
- `color.accentSubtleGreen`: Subtle green accent
|
|
72
|
+
- `color.accentBoldGreen`: Bold green accent
|
|
73
|
+
- `color.accentSubtleBlue`: Subtle blue accent
|
|
74
|
+
- `color.accentBoldBlue`: Bold blue accent
|
|
75
|
+
- `color.accentSubtlePurple`: Subtle purple accent
|
|
76
|
+
- `color.accentBoldPurple`: Bold purple accent
|
|
77
|
+
- `color.accentSubtleYellow`: Subtle yellow accent
|
|
78
|
+
- `color.accentBoldYellow`: Bold yellow accent
|
|
79
|
+
- `color.accentSubtleRed`: Subtle red accent
|
|
80
|
+
- `color.accentBoldRed`: Bold red accent
|
|
81
|
+
- `color.accentSubtleGray`: Subtle gray accent
|
|
82
|
+
- `color.accentBoldGray`: Bold gray accent
|
|
83
|
+
- `color.transparent`: Transparent color
|
|
84
|
+
|
|
85
|
+
#### Layout Tokens
|
|
86
|
+
|
|
87
|
+
##### Spacing
|
|
88
|
+
|
|
89
|
+
- `space`: Object containing spacing values from `0` to `10` in rem units
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
{
|
|
93
|
+
0: 0,
|
|
94
|
+
'0.25': 2,
|
|
95
|
+
'0.5': 4,
|
|
96
|
+
'0.75': 6,
|
|
97
|
+
1: 8,
|
|
98
|
+
'1.5': 12,
|
|
99
|
+
2: 16,
|
|
100
|
+
3: 24,
|
|
101
|
+
4: 32,
|
|
102
|
+
5: 40,
|
|
103
|
+
6: 48,
|
|
104
|
+
7: 56,
|
|
105
|
+
8: 64,
|
|
106
|
+
9: 72,
|
|
107
|
+
10: 80
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
##### Component Sizes
|
|
112
|
+
|
|
113
|
+
- `iconSize`: `{ xs: 12, s: 16, m: 24, l: 32 }`
|
|
114
|
+
- `avatarSize`: `{ s: 16, m: 24, l: 32, xl: 40, xxl: 48, xxxl: 56 }`
|
|
115
|
+
- `controlSize`: Form control sizes
|
|
116
|
+
|
|
117
|
+
```tsx
|
|
118
|
+
{
|
|
119
|
+
checkboxSize: 20,
|
|
120
|
+
radioSize: 20,
|
|
121
|
+
switchWidth: 52,
|
|
122
|
+
switchHeight: 32,
|
|
123
|
+
switchThumbSize: 30,
|
|
124
|
+
tileSize: 106
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
##### Borders
|
|
129
|
+
|
|
130
|
+
- `borderWidth`: Values from `0` to `500` in pixels
|
|
131
|
+
|
|
132
|
+
```tsx
|
|
133
|
+
{
|
|
134
|
+
0: 0,
|
|
135
|
+
100: 1,
|
|
136
|
+
200: 2,
|
|
137
|
+
300: 4,
|
|
138
|
+
400: 6,
|
|
139
|
+
500: 8
|
|
140
|
+
}
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
- `borderRadius`: Values from `0` to `1000` in pixels
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
{
|
|
147
|
+
0: 0,
|
|
148
|
+
100: 4,
|
|
149
|
+
200: 8,
|
|
150
|
+
300: 12,
|
|
151
|
+
400: 16,
|
|
152
|
+
500: 24,
|
|
153
|
+
600: 32,
|
|
154
|
+
700: 40,
|
|
155
|
+
800: 48,
|
|
156
|
+
900: 56,
|
|
157
|
+
1000: 1e5
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
#### Typography Tokens
|
|
162
|
+
|
|
163
|
+
##### Font Families
|
|
164
|
+
|
|
165
|
+
- `fontFamily`: Base font families for each text style using CSS variables
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
{
|
|
169
|
+
display1: 'var(--cds-font-display)',
|
|
170
|
+
display2: 'var(--cds-font-display)',
|
|
171
|
+
display3: 'var(--cds-font-display)',
|
|
172
|
+
title1: 'var(--cds-font-display)',
|
|
173
|
+
// ...and more variants
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
- `fontFamilyMono`: Monospace font families using CSS variables
|
|
178
|
+
|
|
179
|
+
```tsx
|
|
180
|
+
{
|
|
181
|
+
display1: 'var(--cds-font-mono)',
|
|
182
|
+
display2: 'var(--cds-font-mono)',
|
|
183
|
+
// ...and more variants
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
##### Text Styles
|
|
188
|
+
|
|
189
|
+
- `fontSize`: Font sizes in rem units
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
{
|
|
193
|
+
display1: '4rem', // 64px
|
|
194
|
+
display2: '3rem', // 48px
|
|
195
|
+
display3: '2.5rem', // 40px
|
|
196
|
+
title1: '1.75rem', // 28px
|
|
197
|
+
title2: '1.75rem', // 28px
|
|
198
|
+
title3: '1.25rem', // 20px
|
|
199
|
+
title4: '1.25rem', // 20px
|
|
200
|
+
headline: '1rem', // 16px
|
|
201
|
+
body: '1rem', // 16px
|
|
202
|
+
label1: '0.875rem', // 14px
|
|
203
|
+
label2: '0.875rem', // 14px
|
|
204
|
+
caption: '0.8125rem', // 13px
|
|
205
|
+
legal: '0.8125rem' // 13px
|
|
206
|
+
}
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
- `fontWeight`: Font weights as CSS values
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
{
|
|
213
|
+
display1: '400',
|
|
214
|
+
title1: '600',
|
|
215
|
+
// ...and more variants
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
- `lineHeight`: Line heights in rem units
|
|
220
|
+
|
|
221
|
+
```tsx
|
|
222
|
+
{
|
|
223
|
+
display1: '4.5rem', // 72px
|
|
224
|
+
display2: '3.5rem', // 56px
|
|
225
|
+
display3: '3rem', // 48px
|
|
226
|
+
title1: '2.25rem', // 36px
|
|
227
|
+
title2: '2.25rem', // 36px
|
|
228
|
+
title3: '1.75rem', // 28px
|
|
229
|
+
title4: '1.75rem', // 28px
|
|
230
|
+
headline: '1.5rem', // 24px
|
|
231
|
+
body: '1.5rem', // 24px
|
|
232
|
+
label1: '1.25rem', // 20px
|
|
233
|
+
label2: '1.25rem', // 20px
|
|
234
|
+
caption: '1rem', // 16px
|
|
235
|
+
legal: '1rem' // 16px
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
- `textTransform`: Text transformations as CSS values
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
{
|
|
243
|
+
caption: 'uppercase',
|
|
244
|
+
body: 'none',
|
|
245
|
+
// ...and more variants
|
|
246
|
+
}
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
#### Effect Tokens
|
|
250
|
+
|
|
251
|
+
##### Shadows
|
|
252
|
+
|
|
253
|
+
- `shadow`: CSS box-shadow values
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
{
|
|
257
|
+
elevation1: '0px 8px 12px rgba(0, 0, 0, 0.12)',
|
|
258
|
+
elevation2: '0px 8px 24px rgba(0, 0, 0, 0.12)'
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Notes
|
|
263
|
+
|
|
264
|
+
1. The hook must be used within a `ThemeProvider` component, or it will throw an error.
|
|
265
|
+
2. All numeric values are in rem units for consistent scaling with browser font size.
|
|
266
|
+
3. Colors are provided in RGB format for text and background colors, allowing for opacity adjustments.
|
|
267
|
+
4. Font families use CSS variables (`--cds-font-*`) for dynamic loading and fallback handling.
|
|
268
|
+
5. All values are CSS-compatible and can be used directly in CSS-in-JS solutions.
|
|
269
|
+
6. The theme automatically generates CSS variables for all tokens, making them available in stylesheets.
|
|
270
|
+
|
|
11
271
|
## Examples
|
|
12
272
|
|
|
13
273
|
### `useTheme` hook
|
|
@@ -102,4 +362,3 @@ function Example() {
|
|
|
102
362
|
}
|
|
103
363
|
```
|
|
104
364
|
|
|
105
|
-
|
package/mcp-docs/web/routes.txt
CHANGED
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
## Getting Started
|
|
5
5
|
|
|
6
|
+
- [theming](web/getting-started/theming.txt): The theme contains design tokens like colors, fonts, spacing, and more. The ThemeProvider provides access to these values via CSS Variables for web, and React Context for both web and React Native.
|
|
7
|
+
- [templates](web/getting-started/templates.txt): Get started quickly with pre-built templates for common app architectures. Choose from Next.js, Vite, or Webpack templates, all configured with CDS components and best practices.
|
|
8
|
+
- [styling](web/getting-started/styling.txt): CDS includes powerful and flexible APIs for styling components. Easily access values from the theme, or go rogue with full customization.
|
|
6
9
|
- [playground](web/getting-started/playground.txt)
|
|
7
|
-
- [mcp-server](web/getting-started/mcp-server.txt)
|
|
8
10
|
- [introduction](web/getting-started/introduction.txt)
|
|
11
|
+
- [installation](web/getting-started/installation.txt): This guide will help you get started with installing CDS in your React project. Follow the instructions below to set up CDS and start building with our cross-platform components.
|
|
12
|
+
- [ai-overview](web/getting-started/ai-overview.txt)
|
|
9
13
|
|
|
10
14
|
## Components
|
|
11
15
|
|
|
@@ -147,9 +151,13 @@
|
|
|
147
151
|
|
|
148
152
|
- [useTheme](web/hooks/useTheme.txt): Returns the currently active theme including color schemes, spacing, typography, and other design tokens.
|
|
149
153
|
- [useScrollBlocker](web/hooks/useScrollBlocker.txt): Block and unblock page scrolling.
|
|
154
|
+
- [useRefMap](web/hooks/useRefMap.txt): Manages a collection of refs using a key-value map structure, allowing dynamic registration and retrieval of refs by their unique identifiers. Commonly used in components that need to track multiple DOM elements, such as tabs, tours, or complex navigation systems.
|
|
155
|
+
- [usePreviousValue](web/hooks/usePreviousValue.txt): Returns the previous value of a given variable, useful for comparing current and previous states in effects or for tracking changes over time.
|
|
150
156
|
- [useOverlayContentContext](web/hooks/useOverlayContentContext.txt): A React context and hook for detecting if components are rendered inside overlay containers like modals, drawers, tours, and trays.
|
|
157
|
+
- [useMergeRefs](web/hooks/useMergeRefs.txt): Combines multiple refs into a single ref callback, allowing a component to work with multiple ref instances simultaneously. Useful when you need to combine refs from different sources, such as forwarded refs and internal component state.
|
|
151
158
|
- [useMediaQuery](web/hooks/useMediaQuery.txt): Subscribes to window.matchMedia changes with SSR support.
|
|
152
159
|
- [useIsoEffect](web/hooks/useIsoEffect.txt): A safe way of calling useLayoutEffect only on the client. Does nothing on the server.
|
|
153
160
|
- [useHasMounted](web/hooks/useHasMounted.txt): Returns a boolean indicating if the component has mounted.
|
|
161
|
+
- [useEventHandler](web/hooks/useEventHandler.txt): Creates event handlers for components based on the EventHandlerProvider configuration. It enables centralized event handling and analytics tracking by mapping component actions to configured handlers.
|
|
154
162
|
- [useDimensions](web/hooks/useDimensions.txt): Measures an element's dimensions using ResizeObserver.
|
|
155
163
|
- [useBreakpoints](web/hooks/useBreakpoints.txt): Returns an object with a boolean for each breakpoint of the window. Useful for conditionally rendering components or component trees based on the current window breakpoint.
|