diff --git a/packages/docs-reanimated/src/css/colors.css b/packages/docs-reanimated/src/css/colors.css index 12adbfb86b2f..164898b1aec4 100644 --- a/packages/docs-reanimated/src/css/colors.css +++ b/packages/docs-reanimated/src/css/colors.css @@ -258,7 +258,7 @@ /* Versions dropdown */ --swm-dropdown-versions-background: var(--swm-off-white); - --swm-dropdown-versions-item: var(--swm-off-white); + --swm-dropdown-versions-item: var(--swm-navy-light-100); --swm-dropdown-versions-item-border: var(--swm-purple-light-40); --swm-dropdown-versions-item-background: var(--swm-purple-light-20); diff --git a/packages/docs-reanimated/src/css/overrides.css b/packages/docs-reanimated/src/css/overrides.css index 7c66c09bc33c..1e304e376296 100644 --- a/packages/docs-reanimated/src/css/overrides.css +++ b/packages/docs-reanimated/src/css/overrides.css @@ -110,7 +110,23 @@ table thead tr { font-size: var(--swm-h1-font-size); } -/* TODO: Remove after @swmansion-t-rex-ui 0.0.10 patch */ +/* TODO: Remove after @swmansion-t-rex-ui 0.0.11 patch */ button[class*='DocSearch-Button'] { margin: 0 !important; } + +/* versions dropdown on landing */ + +[class*='plugin-pages'] [class*='dropdown--right'] > a:first-child { + color: var(--swm-off-white) !important; +} + +[class*='plugin-pages'] [class*='dropdown__menu'] a:hover { + color: var(--swm-dropdown-versions-item-hover) !important; +} + +/* examples sidebar */ + +[class*='plugin-blog'] [class*='sidebar'] { + background-color: transparent; +} diff --git a/packages/docs-reanimated/src/examples/DecayBasic.tsx b/packages/docs-reanimated/src/examples/DecayBasic.tsx index ea35e81fa7fc..8ea16c04d853 100644 --- a/packages/docs-reanimated/src/examples/DecayBasic.tsx +++ b/packages/docs-reanimated/src/examples/DecayBasic.tsx @@ -12,6 +12,7 @@ import { } from 'react-native-gesture-handler'; const SIZE = 120; +const BOUNDARY_OFFSET = 50; export default function App() { const offset = useSharedValue(0); @@ -31,7 +32,10 @@ export default function App() { offset.value = withDecay({ velocity: event.velocityX, rubberBandEffect: true, - clamp: [-(width.value / 2) + SIZE / 2, width.value / 2 - SIZE / 2], + clamp: [ + -(width.value / 2) + SIZE / 2 + BOUNDARY_OFFSET, + width.value / 2 - SIZE / 2 - BOUNDARY_OFFSET, + ], }); // highlight-end }); diff --git a/packages/docs-reanimated/static/examples/BottomSheet.js b/packages/docs-reanimated/static/examples/BottomSheet.js index eecc21c7dd26..3d3b40ea8a5d 100644 --- a/packages/docs-reanimated/static/examples/BottomSheet.js +++ b/packages/docs-reanimated/static/examples/BottomSheet.js @@ -1,4 +1,5 @@ import React from 'react'; +import { useColorScheme } from '@mui/material'; import { Pressable, SafeAreaView, @@ -16,6 +17,7 @@ import Animated, { } from 'react-native-reanimated'; function BottomSheet({ isOpen, toggleSheet, duration = 500, children }) { + const { colorScheme } = useColorScheme(); const height = useSharedValue(0); const progress = useDerivedValue(() => withTiming(isOpen.value ? 0 : 1, { duration }) @@ -25,6 +27,10 @@ function BottomSheet({ isOpen, toggleSheet, duration = 500, children }) { transform: [{ translateY: progress.value * 2 * height.value }], })); + const backgroundColorSheetStyle = { + backgroundColor: colorScheme === 'light' ? '#f8f9ff' : '#272B3C', + }; + const backdropStyle = useAnimatedStyle(() => ({ opacity: 1 - progress.value, zIndex: isOpen.value @@ -41,7 +47,7 @@ function BottomSheet({ isOpen, toggleSheet, duration = 500, children }) { onLayout={(e) => { height.value = e.nativeEvent.layout.height; }} - style={[sheetStyles.sheet, sheetStyle]}> + style={[sheetStyles.sheet, sheetStyle, backgroundColorSheetStyle]}> {children} @@ -50,7 +56,6 @@ function BottomSheet({ isOpen, toggleSheet, duration = 500, children }) { const sheetStyles = StyleSheet.create({ sheet: { - backgroundColor: '#f8f9ff', padding: 16, paddingRight: '2rem', paddingLeft: '2rem', @@ -71,12 +76,18 @@ const sheetStyles = StyleSheet.create({ }); export default function App() { + const { colorScheme } = useColorScheme(); const isOpen = useSharedValue(false); const toggleSheet = () => { isOpen.value = !isOpen.value; }; + const contentStyle = { + color: colorScheme === 'light' ? '#001a72' : '#f8f9ff', + textDecorationColor: colorScheme === 'light' ? '#001a72' : '#f8f9ff', + }; + return ( @@ -87,14 +98,16 @@ export default function App() { - + Discover the indispensable convenience of a bottom sheet in mobile app. Seamlessly integrated, it provides quick access to supplementary features and refined details. - + - - Read more + + + Read more + @@ -136,15 +149,10 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', gap: 8, - borderBottomWidth: 1, - borderBottomColor: '#001a72', paddingBottom: 2, }, bottomSheetButtonText: { fontWeight: 600, - color: '#001a72', - }, - bottomSheetContent: { - color: '#001a72', + textDecorationLine: 'underline', }, }); diff --git a/packages/docs-reanimated/static/examples/SectionList.js b/packages/docs-reanimated/static/examples/SectionList.js index fdf48352f76c..eb702a3ede28 100644 --- a/packages/docs-reanimated/static/examples/SectionList.js +++ b/packages/docs-reanimated/static/examples/SectionList.js @@ -1,5 +1,6 @@ import { FlashList } from '@shopify/flash-list'; import React, { useRef, useState } from 'react'; +import { useColorScheme } from '@mui/material'; import { Pressable, StyleSheet, Text, View, SafeAreaView } from 'react-native'; import Animated, { useAnimatedStyle, @@ -105,16 +106,27 @@ const TableOfContentsElement = ({ visibleIndex, sectionCardsRef, }) => { + const { colorScheme } = useColorScheme(); const style = useSelectedStyle(visibleIndex, index); + const tableOfContentsElementTextStyle = { + color: colorScheme === 'light' ? '#001a72' : '#f8f9ff', + borderBottomColor: colorScheme === 'light' ? '#001a72' : '#f8f9ff', + }; + return ( { sectionCardsRef.current?.scrollToIndex({ index, animated: true }); visibleIndex.value = index; }} - style={sectionListStyles.tableOfContentsElement}> - + style={[sectionListStyles.tableOfContentsElement]}> + {item} @@ -184,9 +196,7 @@ const sectionListStyles = StyleSheet.create({ }, tableOfContentsElement: { padding: 4, - color: '#001a72', marginHorizontal: 4, - borderBottomColor: '#001a72', margin: 8, overflow: 'hidden', }, @@ -201,6 +211,7 @@ const SectionCards = ({ sectionCardsRef, tableOfContentsRef, }) => { + const { colorScheme } = useColorScheme(); const heights = sections.map((_) => SECTION_HEIGHT); const getOffsetStarts = () => @@ -226,10 +237,16 @@ const SectionCards = ({ } }; + const sectionNameStyle = useAnimatedStyle(() => ({ + color: colorScheme === 'light' ? '#001a72' : '#f8f9ff', + })); + const renderItem = ({ item }) => { return ( - {item.name} + + {item.name} + {item.content} @@ -287,7 +304,6 @@ const sectionCardStyles = StyleSheet.create({ borderRadius: 24, }, header: { - color: '#001a72', textAlign: 'center', fontSize: 24, fontWeight: 'bold',