@expo/ui 56.0.9 → 56.0.10
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 +13 -0
- package/CLAUDE.md +1 -1
- package/android/build.gradle +2 -2
- package/android/src/main/java/expo/modules/ui/ExpoUIModule.kt +11 -5
- package/android/src/main/java/expo/modules/ui/HorizontalPagerView.kt +97 -16
- package/android/src/main/java/expo/modules/ui/colors/MaterialColors.kt +2 -0
- package/build/State/index.d.ts +6 -0
- package/build/State/index.d.ts.map +1 -0
- package/build/community/pager-view/PagerView.android.d.ts +7 -0
- package/build/community/pager-view/PagerView.android.d.ts.map +1 -0
- package/build/community/pager-view/PagerView.d.ts +8 -0
- package/build/community/pager-view/PagerView.d.ts.map +1 -0
- package/build/community/pager-view/PagerView.ios.d.ts +15 -0
- package/build/community/pager-view/PagerView.ios.d.ts.map +1 -0
- package/build/community/pager-view/index.d.ts +3 -0
- package/build/community/pager-view/index.d.ts.map +1 -0
- package/build/community/pager-view/types.d.ts +128 -0
- package/build/community/pager-view/types.d.ts.map +1 -0
- package/build/community/segmented-control/vendor/SegmentsSeparators.d.ts.map +1 -1
- package/build/jetpack-compose/HorizontalPager/index.d.ts +27 -0
- package/build/jetpack-compose/HorizontalPager/index.d.ts.map +1 -1
- package/build/jetpack-compose/Host/index.d.ts +1 -0
- package/build/jetpack-compose/Host/index.d.ts.map +1 -1
- package/build/jetpack-compose/LoadingIndicator/index.d.ts +1 -1
- package/build/jetpack-compose/LoadingIndicator/index.d.ts.map +1 -1
- package/build/jetpack-compose/SyncSwitch/index.d.ts +1 -1
- package/build/jetpack-compose/SyncSwitch/index.d.ts.map +1 -1
- package/build/jetpack-compose/TextField/index.d.ts +1 -1
- package/build/jetpack-compose/TextField/index.d.ts.map +1 -1
- package/build/jetpack-compose/index.d.ts +1 -2
- package/build/jetpack-compose/index.d.ts.map +1 -1
- package/build/swift-ui/Host/index.d.ts +1 -0
- package/build/swift-ui/Host/index.d.ts.map +1 -1
- package/build/swift-ui/ScrollView/index.d.ts +30 -0
- package/build/swift-ui/ScrollView/index.d.ts.map +1 -1
- package/build/swift-ui/SecureField/index.d.ts +1 -1
- package/build/swift-ui/SecureField/index.d.ts.map +1 -1
- package/build/swift-ui/SyncToggle/index.d.ts +1 -1
- package/build/swift-ui/SyncToggle/index.d.ts.map +1 -1
- package/build/swift-ui/TextField/index.d.ts +1 -1
- package/build/swift-ui/TextField/index.d.ts.map +1 -1
- package/build/swift-ui/index.d.ts +1 -2
- package/build/swift-ui/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/index.d.ts +25 -15
- package/build/swift-ui/modifiers/index.d.ts.map +1 -1
- package/build/swift-ui/modifiers/scrollObservation.d.ts +52 -0
- package/build/swift-ui/modifiers/scrollObservation.d.ts.map +1 -0
- package/build/swift-ui/modifiers/scrollPosition.d.ts +1 -1
- package/build/swift-ui/modifiers/scrollPosition.d.ts.map +1 -1
- package/build/swift-ui/modifiers/symbolEffect.d.ts +1 -1
- package/build/swift-ui/modifiers/symbolEffect.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.android.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.d.ts.map +1 -1
- package/build/universal/BottomSheet/index.ios.d.ts.map +1 -1
- package/build/universal/Checkbox/index.d.ts.map +1 -1
- package/build/universal/Collapsible/index.d.ts.map +1 -1
- package/build/universal/ListItem/ListItem.d.ts.map +1 -1
- package/build/universal/RNHostView/index.android.d.ts +7 -0
- package/build/universal/RNHostView/index.android.d.ts.map +1 -0
- package/build/universal/RNHostView/index.d.ts +7 -0
- package/build/universal/RNHostView/index.d.ts.map +1 -0
- package/build/universal/RNHostView/index.ios.d.ts +7 -0
- package/build/universal/RNHostView/index.ios.d.ts.map +1 -0
- package/build/universal/RNHostView/types.d.ts +23 -0
- package/build/universal/RNHostView/types.d.ts.map +1 -0
- package/build/universal/Switch/index.d.ts.map +1 -1
- package/build/universal/TextInput/index.d.ts.map +1 -1
- package/build/universal/index.d.ts +1 -0
- package/build/universal/index.d.ts.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/ExpoUIModule.swift +6 -3
- package/ios/HostView.swift +21 -18
- package/ios/Modifiers/FontModifier.swift +72 -20
- package/ios/Modifiers/ScrollObservationModifiers.swift +107 -0
- package/ios/Modifiers/ViewModifierRegistry.swift +8 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.9/expo.modules.ui-56.0.9-sources.jar → 56.0.10/expo.modules.ui-56.0.10-sources.jar} +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10-sources.jar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10-sources.jar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10-sources.jar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10-sources.jar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.9/expo.modules.ui-56.0.9.module → 56.0.10/expo.modules.ui-56.0.10.module} +22 -22
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.module.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/{56.0.9/expo.modules.ui-56.0.9.pom → 56.0.10/expo.modules.ui-56.0.10.pom} +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.10/expo.modules.ui-56.0.10.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/maven-metadata.xml.sha512 +1 -1
- package/package.json +7 -3
- package/src/State/index.ts +10 -0
- package/src/State/useNativeState.ts +8 -0
- package/src/community/pager-view/PagerView.android.tsx +223 -0
- package/src/community/pager-view/PagerView.ios.tsx +267 -0
- package/src/community/pager-view/PagerView.tsx +14 -0
- package/src/community/pager-view/index.tsx +13 -0
- package/src/community/pager-view/types.tsx +137 -0
- package/src/community/picker/Picker.android.tsx +1 -1
- package/src/community/segmented-control/vendor/SegmentsSeparators.tsx +3 -6
- package/src/jetpack-compose/HorizontalPager/index.tsx +89 -18
- package/src/jetpack-compose/Host/index.tsx +1 -0
- package/src/jetpack-compose/LoadingIndicator/index.tsx +1 -2
- package/src/jetpack-compose/SyncSwitch/index.tsx +1 -3
- package/src/jetpack-compose/TextField/index.tsx +1 -4
- package/src/jetpack-compose/index.ts +1 -2
- package/src/swift-ui/Host/index.tsx +1 -0
- package/src/swift-ui/ScrollView/index.tsx +33 -0
- package/src/swift-ui/SecureField/index.tsx +1 -4
- package/src/swift-ui/SyncToggle/index.tsx +1 -3
- package/src/swift-ui/TextField/index.tsx +1 -4
- package/src/swift-ui/index.tsx +1 -3
- package/src/swift-ui/modifiers/index.ts +37 -14
- package/src/swift-ui/modifiers/scrollObservation.ts +80 -0
- package/src/swift-ui/modifiers/scrollPosition.ts +1 -2
- package/src/swift-ui/modifiers/symbolEffect.ts +1 -2
- package/src/swift-ui/withAnimation.ts +1 -1
- package/src/universal/BottomSheet/index.android.tsx +33 -10
- package/src/universal/BottomSheet/index.ios.tsx +12 -10
- package/src/universal/BottomSheet/index.tsx +3 -0
- package/src/universal/Checkbox/index.tsx +14 -2
- package/src/universal/Collapsible/index.tsx +17 -4
- package/src/universal/ListItem/ListItem.tsx +7 -2
- package/src/universal/RNHostView/index.android.tsx +33 -0
- package/src/universal/RNHostView/index.ios.tsx +12 -0
- package/src/universal/RNHostView/index.tsx +39 -0
- package/src/universal/RNHostView/types.ts +25 -0
- package/src/universal/Switch/index.tsx +7 -2
- package/src/universal/TextInput/index.tsx +12 -2
- package/src/universal/index.ts +1 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9-sources.jar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar +0 -0
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha512 +0 -1
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { ComponentProps } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
Text,
|
|
5
|
+
unstable_createElement,
|
|
6
|
+
useColorScheme,
|
|
7
|
+
View,
|
|
8
|
+
type ViewProps,
|
|
9
|
+
} from 'react-native';
|
|
3
10
|
|
|
4
11
|
import type { CheckboxProps } from './types';
|
|
5
12
|
|
|
@@ -19,6 +26,9 @@ const styles = StyleSheet.create({
|
|
|
19
26
|
// @ts-expect-error
|
|
20
27
|
cursor: 'inherit',
|
|
21
28
|
},
|
|
29
|
+
darkText: {
|
|
30
|
+
color: '#fff',
|
|
31
|
+
},
|
|
22
32
|
});
|
|
23
33
|
|
|
24
34
|
const NativeCheckbox = (
|
|
@@ -29,6 +39,8 @@ const NativeCheckbox = (
|
|
|
29
39
|
* A toggle control that represents a checked or unchecked state.
|
|
30
40
|
*/
|
|
31
41
|
export function Checkbox({ value, onValueChange, label, disabled = false, testID }: CheckboxProps) {
|
|
42
|
+
const isDark = useColorScheme() === 'dark';
|
|
43
|
+
|
|
32
44
|
return (
|
|
33
45
|
<View role="label" aria-disabled={disabled} style={[styles.label, disabled && styles.disabled]}>
|
|
34
46
|
<NativeCheckbox
|
|
@@ -38,7 +50,7 @@ export function Checkbox({ value, onValueChange, label, disabled = false, testID
|
|
|
38
50
|
data-testid={testID}
|
|
39
51
|
style={styles.cursorInherit}
|
|
40
52
|
/>
|
|
41
|
-
{label != null && <Text>{label}</Text>}
|
|
53
|
+
{label != null && <Text style={isDark && styles.darkText}>{label}</Text>}
|
|
42
54
|
</View>
|
|
43
55
|
);
|
|
44
56
|
}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import type { ComponentProps, SyntheticEvent } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
StyleSheet,
|
|
4
|
+
Text,
|
|
5
|
+
unstable_createElement,
|
|
6
|
+
useColorScheme,
|
|
7
|
+
View,
|
|
8
|
+
type TextProps,
|
|
9
|
+
type ViewProps,
|
|
10
|
+
} from 'react-native';
|
|
3
11
|
|
|
4
12
|
import type { CollapsibleProps } from './types';
|
|
5
13
|
|
|
6
14
|
const Details = (
|
|
7
|
-
props: Omit<ComponentProps<'details'>, 'style'> & { style?:
|
|
15
|
+
props: Omit<ComponentProps<'details'>, 'style'> & { style?: TextProps['style'] }
|
|
8
16
|
) => unstable_createElement('details', props);
|
|
9
17
|
|
|
10
18
|
const Summary = (
|
|
@@ -16,6 +24,8 @@ const Summary = (
|
|
|
16
24
|
* header. Controlled via `isOpen` + `onOpenChange`.
|
|
17
25
|
*/
|
|
18
26
|
export function Collapsible({ isOpen, onOpenChange, label = '', children }: CollapsibleProps) {
|
|
27
|
+
const isDark = useColorScheme() === 'dark';
|
|
28
|
+
|
|
19
29
|
return (
|
|
20
30
|
<Details
|
|
21
31
|
open={isOpen}
|
|
@@ -25,9 +35,9 @@ export function Collapsible({ isOpen, onOpenChange, label = '', children }: Coll
|
|
|
25
35
|
onOpenChange(nextOpen);
|
|
26
36
|
}
|
|
27
37
|
}}
|
|
28
|
-
style={styles.container}>
|
|
38
|
+
style={[styles.container, isDark && styles.darkText]}>
|
|
29
39
|
<Summary style={styles.summary}>
|
|
30
|
-
<Text>{label}</Text>
|
|
40
|
+
<Text style={isDark && styles.darkText}>{label}</Text>
|
|
31
41
|
</Summary>
|
|
32
42
|
<View style={styles.content}>{children}</View>
|
|
33
43
|
</Details>
|
|
@@ -53,6 +63,9 @@ const styles = StyleSheet.create({
|
|
|
53
63
|
paddingHorizontal: 16,
|
|
54
64
|
paddingBottom: 12,
|
|
55
65
|
},
|
|
66
|
+
darkText: {
|
|
67
|
+
color: '#fff',
|
|
68
|
+
},
|
|
56
69
|
});
|
|
57
70
|
|
|
58
71
|
export * from './types';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
-
import { Pressable, StyleSheet, Text, View } from 'react-native';
|
|
2
|
+
import { Pressable, StyleSheet, Text, useColorScheme, View } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { extractListItemSlots } from './ListItemSlots';
|
|
5
5
|
import type { ListItemProps } from './types';
|
|
@@ -25,6 +25,8 @@ export function ListItem(props: ListItemProps) {
|
|
|
25
25
|
supportingText,
|
|
26
26
|
testID,
|
|
27
27
|
} = props;
|
|
28
|
+
|
|
29
|
+
const isDark = useColorScheme() === 'dark';
|
|
28
30
|
const slots = extractListItemSlots(children);
|
|
29
31
|
const leading = slots.leading ?? leadingProp;
|
|
30
32
|
const trailing = slots.trailing ?? trailingProp;
|
|
@@ -34,7 +36,7 @@ export function ListItem(props: ListItemProps) {
|
|
|
34
36
|
<Pressable onPress={onPress} style={styles.row} testID={testID}>
|
|
35
37
|
{leading != null ? <View style={styles.slot}>{leading}</View> : null}
|
|
36
38
|
<View style={styles.main}>
|
|
37
|
-
<Text>{slots.headline}</Text>
|
|
39
|
+
<Text style={isDark && styles.darkText}>{slots.headline}</Text>
|
|
38
40
|
{supporting != null ? renderSupporting(supporting) : null}
|
|
39
41
|
</View>
|
|
40
42
|
{trailing != null ? <View style={styles.slot}>{trailing}</View> : null}
|
|
@@ -67,6 +69,9 @@ const styles = StyleSheet.create({
|
|
|
67
69
|
fontSize: 13,
|
|
68
70
|
color: '#6b7280',
|
|
69
71
|
},
|
|
72
|
+
darkText: {
|
|
73
|
+
color: '#fff',
|
|
74
|
+
},
|
|
70
75
|
});
|
|
71
76
|
|
|
72
77
|
export * from './types';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RNHostView as ComposeRNHostView } from '@expo/ui/jetpack-compose';
|
|
2
|
+
|
|
3
|
+
import { transformToModifiers } from '../transformStyle';
|
|
4
|
+
import type { RNHostViewProps } from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Hosts React Native views inside Jetpack Compose views.
|
|
8
|
+
*/
|
|
9
|
+
export function RNHostView({
|
|
10
|
+
children,
|
|
11
|
+
matchContents,
|
|
12
|
+
style,
|
|
13
|
+
onAppear,
|
|
14
|
+
onDisappear,
|
|
15
|
+
disabled,
|
|
16
|
+
hidden,
|
|
17
|
+
testID,
|
|
18
|
+
modifiers: extraModifiers,
|
|
19
|
+
}: RNHostViewProps) {
|
|
20
|
+
const modifiers = transformToModifiers(
|
|
21
|
+
style,
|
|
22
|
+
{ onAppear, onDisappear, disabled, hidden, testID },
|
|
23
|
+
extraModifiers
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<ComposeRNHostView matchContents={matchContents} modifiers={modifiers}>
|
|
28
|
+
{children}
|
|
29
|
+
</ComposeRNHostView>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export * from './types';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { RNHostView as SwiftUIRNHostView } from '@expo/ui/swift-ui';
|
|
2
|
+
|
|
3
|
+
import type { RNHostViewProps } from './types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Hosts React Native views inside SwiftUI views.
|
|
7
|
+
*/
|
|
8
|
+
export function RNHostView({ children, matchContents }: RNHostViewProps) {
|
|
9
|
+
return <SwiftUIRNHostView matchContents={matchContents}>{children}</SwiftUIRNHostView>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export * from './types';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { StyleSheet, View } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { RNHostViewProps } from './types';
|
|
4
|
+
import { useUniversalLifecycle } from '../hooks';
|
|
5
|
+
|
|
6
|
+
const styles = StyleSheet.create({
|
|
7
|
+
fillParent: { width: '100%', height: '100%' },
|
|
8
|
+
matchContents: { width: 'fit-content', height: 'fit-content' },
|
|
9
|
+
hidden: { display: 'none' },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Hosts React Native views inside Jetpack Compose or SwiftUI views.
|
|
14
|
+
*/
|
|
15
|
+
export function RNHostView({
|
|
16
|
+
children,
|
|
17
|
+
style,
|
|
18
|
+
onAppear,
|
|
19
|
+
onDisappear,
|
|
20
|
+
hidden = false,
|
|
21
|
+
testID,
|
|
22
|
+
matchContents = false,
|
|
23
|
+
}: RNHostViewProps) {
|
|
24
|
+
useUniversalLifecycle(onAppear, onDisappear);
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<View
|
|
28
|
+
testID={testID}
|
|
29
|
+
style={[
|
|
30
|
+
matchContents ? styles.matchContents : styles.fillParent,
|
|
31
|
+
style,
|
|
32
|
+
hidden && styles.hidden,
|
|
33
|
+
]}>
|
|
34
|
+
{children}
|
|
35
|
+
</View>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export * from './types';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ReactElement } from 'react';
|
|
2
|
+
|
|
3
|
+
import type { UniversalBaseProps } from '../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props for the [`RNHostView`](#rnhostview) component.
|
|
7
|
+
*/
|
|
8
|
+
export interface RNHostViewProps extends UniversalBaseProps {
|
|
9
|
+
/**
|
|
10
|
+
* When `true`, the host updates its size in the native view tree to match
|
|
11
|
+
* the children's size. When `false`, the host uses the size of the parent
|
|
12
|
+
* native view.
|
|
13
|
+
*
|
|
14
|
+
* Can only be set once on mount; changing it remounts the component.
|
|
15
|
+
* @default false
|
|
16
|
+
* @platform android
|
|
17
|
+
* @platform ios
|
|
18
|
+
*/
|
|
19
|
+
matchContents?: boolean;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* The React Native view to host.
|
|
23
|
+
*/
|
|
24
|
+
children: ReactElement;
|
|
25
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Switch as RNSwitch, View, Text, StyleSheet } from 'react-native';
|
|
1
|
+
import { Switch as RNSwitch, View, Text, StyleSheet, useColorScheme } from 'react-native';
|
|
2
2
|
|
|
3
3
|
import type { SwitchProps } from './types';
|
|
4
4
|
|
|
@@ -12,16 +12,21 @@ const styles = StyleSheet.create({
|
|
|
12
12
|
disabled: {
|
|
13
13
|
opacity: 0.5,
|
|
14
14
|
},
|
|
15
|
+
darkText: {
|
|
16
|
+
color: '#fff',
|
|
17
|
+
},
|
|
15
18
|
});
|
|
16
19
|
|
|
17
20
|
/**
|
|
18
21
|
* A toggle control that switches between on and off states.
|
|
19
22
|
*/
|
|
20
23
|
export function Switch({ value, onValueChange, label, disabled = false, testID }: SwitchProps) {
|
|
24
|
+
const isDark = useColorScheme() === 'dark';
|
|
25
|
+
|
|
21
26
|
if (label) {
|
|
22
27
|
return (
|
|
23
28
|
<View style={[styles.view, disabled && styles.disabled]}>
|
|
24
|
-
<Text>{label}</Text>
|
|
29
|
+
<Text style={isDark && styles.darkText}>{label}</Text>
|
|
25
30
|
<RNSwitch value={value} onValueChange={onValueChange} disabled={disabled} testID={testID} />
|
|
26
31
|
</View>
|
|
27
32
|
);
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { useImperativeHandle, useRef } from 'react';
|
|
2
|
-
import { TextInput as RNTextInput } from 'react-native';
|
|
2
|
+
import { TextInput as RNTextInput, StyleSheet, useColorScheme } from 'react-native';
|
|
3
3
|
|
|
4
4
|
import { useNativeState } from '../State';
|
|
5
5
|
import type { TextInputProps } from './types';
|
|
6
6
|
|
|
7
|
+
const styles = StyleSheet.create({
|
|
8
|
+
darkInput: { color: '#fff' },
|
|
9
|
+
});
|
|
10
|
+
|
|
7
11
|
export function TextInput({
|
|
8
12
|
ref,
|
|
9
13
|
value,
|
|
@@ -41,6 +45,7 @@ export function TextInput({
|
|
|
41
45
|
onSelectionChange,
|
|
42
46
|
selectTextOnFocus,
|
|
43
47
|
}: TextInputProps) {
|
|
48
|
+
const isDark = useColorScheme() === 'dark';
|
|
44
49
|
const initialFallbackRef = useRef(defaultValue ?? '');
|
|
45
50
|
const fallback = useNativeState<string>(initialFallbackRef.current);
|
|
46
51
|
const state = value ?? fallback;
|
|
@@ -93,7 +98,12 @@ export function TextInput({
|
|
|
93
98
|
returnKeyType={returnKeyType}
|
|
94
99
|
enterKeyHint={enterKeyHint}
|
|
95
100
|
cursorColor={cursorColor}
|
|
96
|
-
style={[
|
|
101
|
+
style={[
|
|
102
|
+
isDark && styles.darkInput,
|
|
103
|
+
style,
|
|
104
|
+
textStyle,
|
|
105
|
+
textAlign && textAlign !== 'auto' ? { textAlign } : null,
|
|
106
|
+
]}
|
|
97
107
|
onSubmitEditing={onSubmitEditing ? (e) => onSubmitEditing(e.nativeEvent.text) : undefined}
|
|
98
108
|
onFocus={onFocus ? () => onFocus() : undefined}
|
|
99
109
|
onBlur={onBlur ? () => onBlur() : undefined}
|
package/src/universal/index.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './Icon';
|
|
|
14
14
|
export * from './List';
|
|
15
15
|
export * from './ListItem';
|
|
16
16
|
export * from './Picker';
|
|
17
|
+
export * from './RNHostView';
|
|
17
18
|
export * from './Spacer';
|
|
18
19
|
export * from './State';
|
|
19
20
|
export { TextInput, type TextInputProps, type TextInputRef } from './TextInput';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
792086c87c80e11e11b3e96d4b0a27d5
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b68d51962848180ac90fcb20a9766fabd72327ad
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e068f417d7a302f7d37e1d8648b7f61d2da46d215aede6ad991e35f780e794ea
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
408e70adeb3b30e509e418a2a6edbd5afb888a27f8fcd5c04032a1089ef32c4483e542854cd1621a74aa2763094cd2e6ba98b30e99e213dd06734167e6d4083c
|
|
Binary file
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1375a9ac8dc803a405dd2fa39159a0bc
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
4631f8e63a9536ef63c03c7666fbaa0e5a4f60a1
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7f2175675f65b6caaf5ce6580cdd24a10f208ae6d80b894e4460796fe2f0dc05
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.aar.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
ba0dfa2c02b2ad1f248bfe43a5a922a95dbb83c493eb23cd8d3b98f3e790d9be19133002ac2ab408f3a9268af3c5718072f0646c2e13b0ce2d01b8198ae8ccc6
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
485b997d6738de54d6dc1a04d29b4c9a
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
9fc748a23b388982628ba7ea8fb7beb7ce8673b9
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
824aeb287c84a0ae7a903bbcd2ed28e02606bb63ff7b752f67f12469461f5b75
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.module.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7a87a1877c5555ab2b67f662d16481ef097240be1ac1ffaf3866ce167bf086cd272977ed945aafaf0143ee82c0fba1af5a5edc9fd6dd3715976708eea8beb901
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.md5
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
f2d9d3bd7c4ea14a224a23d28ed45f95
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha1
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
5f7de9f68a75a8180e441e1d8f88d38db511ea4d
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha256
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d8cabffaed7874f9cdaa99bdb3148847466647b3d8e38175a0d6129f42fc54ea
|
package/local-maven-repo/expo/modules/ui/expo.modules.ui/56.0.9/expo.modules.ui-56.0.9.pom.sha512
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
d1b858cfe33845e3584fe8fe75da774a06c2d6ddef4c44e59671a832d9c5df04dad92780c7aa6f1a0183e337e4998d89598f6c08e91fda083ae0cd5c4a7cfb37
|