The best way to control Claude Code, Codex and more from any computer or phone
feat(mobile): map native hosts to the app theme (#18567)
Julius Marminge committed
Oct 15, 2026 at 15:46 UTC
df83cfa233a7d00a7525b364ea7ce0d641aa7ddd
10 files changed
+335
-17
apps/mobile/package.json
+2
-1
@@ -50,7 +50,7 @@
50
"@effect/atom-react": "catalog:",
51
"@expo-google-fonts/dm-sans": "^0.4.2",
52
"@expo/metro-runtime": "~58.0.10",
53
- "@expo/ui": "~58.0.11",
53
+ "@expo/ui": "58.0.11",
54
"@legendapp/list": "catalog:",
55
"@material/material-color-utilities": "0.3.0",
56
"@noble/curves": "catalog:",
@@ -164,6 +164,7 @@
164
},
165
"autolinking": {
166
"buildFromSource": [
167
+ "expo-ui",
168
"expo-notifications",
169
"react-native-screens",
170
"react-native-reanimated",
apps/mobile/src/components/NativeThemeHost.android.tsx
new
+18
@@ -0,0 +1,18 @@
1
+import { Host } from "@expo/ui/jetpack-compose";
2
+import type { ComponentProps } from "react";
3
+import { createNativeThemeColors } from "../lib/nativeTheme";
4
+import { useControlTheme } from "./useControlTheme";
5
+
6
+/** One native island, using T3's resolved colors or the user's Material You palette. */
7
+export function NativeThemeHost(
8
+ props: Omit<ComponentProps<typeof Host>, "colorScheme" | "seedColor" | "colorOverrides">,
9
+) {
10
+ const { colors, colorScheme, systemColorsActive } = useControlTheme();
11
+ return (
12
+ <Host
13
+ {...props}
14
+ colorScheme={colorScheme}
15
+ colorOverrides={systemColorsActive ? undefined : createNativeThemeColors(colors)}
16
+ />
17
+ );
18
+}
apps/mobile/src/components/NativeThemeHost.tsx
new
+11
@@ -0,0 +1,11 @@
1
+import { Host } from "@expo/ui/swift-ui";
2
+import type { ComponentProps } from "react";
3
+import { useControlTheme } from "./useControlTheme";
4
+
5
+/** SwiftUI shares the app's appearance and action tint. Row fills stay explicit. */
6
+export function NativeThemeHost(
7
+ props: Omit<ComponentProps<typeof Host>, "colorScheme" | "seedColor">,
8
+) {
9
+ const { colors, colorScheme } = useControlTheme();
10
+ return <Host {...props} colorScheme={colorScheme} seedColor={colors["--color-primary"]} />;
11
+}
apps/mobile/src/components/NumberField.ios.tsx
+5
-4
@@ -1,4 +1,4 @@
1
-import { Button, Host, HStack, Picker, Popover, Text, VStack } from "@expo/ui/swift-ui";
1
+import { Button, HStack, Picker, Popover, Text, VStack } from "@expo/ui/swift-ui";
2
import {
3
accessibilityLabel,
4
buttonStyle,
@@ -13,16 +13,17 @@ import {
13
} from "@expo/ui/swift-ui/modifiers";
14
import { useState } from "react";
15
16
+import { NativeThemeHost } from "./NativeThemeHost";
17
import { useControlTheme } from "./useControlTheme";
18
import type { NumberFieldProps } from "./NumberField";
19
20
export function NumberField(props: NumberFieldProps) {
20
- const { colorScheme, colors, fontSize } = useControlTheme();
21
+ const { colors, fontSize } = useControlTheme();
22
const values = Array.from({ length: props.max - props.min + 1 }, (_, index) => props.min + index);
23
const [open, setOpen] = useState(false);
24
const [draft, setDraft] = useState(props.value);
25
return (
25
- <Host matchContents colorScheme={colorScheme} seedColor={colors["--color-primary"]}>
26
+ <NativeThemeHost matchContents>
27
<Popover isPresented={open} onIsPresentedChange={setOpen}>
28
<Popover.Trigger>
29
<Button
@@ -86,6 +87,6 @@ export function NumberField(props: NumberFieldProps) {
87
</VStack>
88
</Popover.Content>
89
</Popover>
89
- </Host>
90
+ </NativeThemeHost>
91
);
92
}
apps/mobile/src/components/SliderRow.android.tsx
+5
-8
@@ -1,4 +1,4 @@
1
-import { Host, Slider } from "@expo/ui/jetpack-compose";
1
+import { Slider } from "@expo/ui/jetpack-compose";
2
import { fillMaxWidth } from "@expo/ui/jetpack-compose/modifiers";
3
import * as Haptics from "expo-haptics";
4
import { useRef, type ComponentProps } from "react";
@@ -6,11 +6,12 @@ import { View } from "react-native";
6
7
import { AppText as Text } from "./AppText";
8
import { SymbolView } from "./AppSymbol";
9
+import { NativeThemeHost } from "./NativeThemeHost";
10
import { useControlTheme } from "./useControlTheme";
11
import type { SliderRow as SharedSliderRow } from "./SliderRow";
12
13
export function SliderRow(props: ComponentProps<typeof SharedSliderRow>) {
13
- const { colorScheme, systemColorsActive, colors } = useControlTheme();
14
+ const { colors } = useControlTheme();
15
const draft = useRef(props.value);
16
const commit = (value: number) => {
17
if (props.disabled) return;
@@ -47,11 +48,7 @@ export function SliderRow(props: ComponentProps<typeof SharedSliderRow>) {
48
}}
49
>
50
<View importantForAccessibility="no-hide-descendants">
50
- <Host
51
- colorScheme={colorScheme}
52
- seedColor={systemColorsActive ? undefined : colors["--color-primary"]}
53
- style={{ height: 48, width: "100%" }}
54
- >
51
+ <NativeThemeHost style={{ height: 48, width: "100%" }}>
52
<Slider
53
min={props.min}
54
max={props.max}
@@ -69,7 +66,7 @@ export function SliderRow(props: ComponentProps<typeof SharedSliderRow>) {
66
}}
67
onValueChangeFinished={() => commit(draft.current)}
68
/>
72
- </Host>
69
+ </NativeThemeHost>
70
</View>
71
</View>
72
</View>
apps/mobile/src/lib/nativeTheme.test.ts
new
+45
@@ -0,0 +1,45 @@
1
+import { describe, expect, it } from "vite-plus/test";
2
+import { getMobileThemeVariables, MOBILE_THEME_OPTIONS } from "./mobileTheme";
3
+import { createNativeThemeColors } from "./nativeTheme";
4
+
5
+function luminance(hex: string) {
6
+ const channels = [1, 3, 5].map((offset) => {
7
+ const value = Number.parseInt(hex.slice(offset, offset + 2), 16) / 255;
8
+ return value <= 0.04045 ? value / 12.92 : ((value + 0.055) / 1.055) ** 2.4;
9
+ });
10
+ return channels[0]! * 0.2126 + channels[1]! * 0.7152 + channels[2]! * 0.0722;
11
+}
12
+
13
+function contrast(a: string, b: string) {
14
+ const values = [luminance(a), luminance(b)].sort((x, y) => y - x);
15
+ return (values[0]! + 0.05) / (values[1]! + 0.05);
16
+}
17
+
18
+const cases = MOBILE_THEME_OPTIONS.flatMap((theme) => {
19
+ if (theme.id === "material-you") return [];
20
+ const themeId = theme.id;
21
+ return (["light", "dark"] as const).map((appearance) => ({
22
+ label: theme.label,
23
+ themeId,
24
+ appearance,
25
+ }));
26
+});
27
+
28
+describe("native theme colors", () => {
29
+ it.each(cases)(
30
+ "$label $appearance keeps native labels legible on every container",
31
+ ({ themeId, appearance }) => {
32
+ const colors = createNativeThemeColors(getMobileThemeVariables(themeId, appearance));
33
+ for (const surface of [
34
+ colors.surface,
35
+ colors.surfaceContainer,
36
+ colors.surfaceContainerHigh,
37
+ colors.surfaceContainerHighest,
38
+ ]) {
39
+ expect(contrast(colors.onSurface, surface)).toBeGreaterThanOrEqual(4.5);
40
+ }
41
+ expect(contrast(colors.onPrimary, colors.primary)).toBeGreaterThanOrEqual(4.5);
42
+ for (const color of Object.values(colors)) expect(color).toMatch(/^#[0-9a-f]{6}$/i);
43
+ },
44
+ );
45
+});
apps/mobile/src/lib/nativeTheme.ts
new
+63
@@ -0,0 +1,63 @@
1
+import type { MaterialColors } from "@expo/ui/jetpack-compose";
2
+import { flattenThemeColor, type MobileThemeVariables } from "./mobileTheme";
3
+
4
+/** Native controls use the same resolved palette as RN, without generating new hues. */
5
+export function createNativeThemeColors(colors: MobileThemeVariables): MaterialColors {
6
+ const roles = {
7
+ primary: colors["--color-primary"],
8
+ onPrimary: colors["--color-primary-foreground"],
9
+ primaryContainer: colors["--color-thread-selected"],
10
+ onPrimaryContainer: colors["--color-thread-selected-foreground"],
11
+ inversePrimary: colors["--color-primary-foreground"],
12
+ secondary: colors["--color-secondary"],
13
+ onSecondary: colors["--color-secondary-foreground"],
14
+ secondaryContainer: colors["--color-subtle-strong"],
15
+ onSecondaryContainer: colors["--color-secondary-foreground"],
16
+ tertiary: colors["--color-primary"],
17
+ onTertiary: colors["--color-primary-foreground"],
18
+ tertiaryContainer: colors["--color-thread-selected"],
19
+ onTertiaryContainer: colors["--color-thread-selected-foreground"],
20
+ background: colors["--color-screen"],
21
+ onBackground: colors["--color-foreground"],
22
+ surface: colors["--color-screen"],
23
+ onSurface: colors["--color-foreground"],
24
+ surfaceVariant: colors["--color-card-alt"],
25
+ onSurfaceVariant: colors["--color-foreground-muted"],
26
+ surfaceTint: colors["--color-primary"],
27
+ inverseSurface: colors["--color-foreground"],
28
+ inverseOnSurface: colors["--color-screen"],
29
+ error: colors["--color-danger-foreground"],
30
+ onError: colors["--color-danger"],
31
+ errorContainer: colors["--color-danger"],
32
+ onErrorContainer: colors["--color-danger-foreground"],
33
+ outline: colors["--color-input-border"],
34
+ outlineVariant: colors["--color-separator"],
35
+ scrim: "#000000",
36
+ surfaceBright: colors["--color-card-alt"],
37
+ surfaceDim: colors["--color-input"],
38
+ surfaceContainer: colors["--color-grouped-card"],
39
+ surfaceContainerHigh: colors["--color-card-alt"],
40
+ surfaceContainerHighest: colors["--color-subtle-strong"],
41
+ surfaceContainerLow: colors["--color-sheet-solid"],
42
+ surfaceContainerLowest: colors["--color-input"],
43
+ primaryFixed: colors["--color-primary"],
44
+ primaryFixedDim: colors["--color-primary"],
45
+ onPrimaryFixed: colors["--color-primary-foreground"],
46
+ onPrimaryFixedVariant: colors["--color-primary-foreground"],
47
+ secondaryFixed: colors["--color-secondary"],
48
+ secondaryFixedDim: colors["--color-secondary"],
49
+ onSecondaryFixed: colors["--color-secondary-foreground"],
50
+ onSecondaryFixedVariant: colors["--color-secondary-foreground"],
51
+ tertiaryFixed: colors["--color-primary"],
52
+ tertiaryFixedDim: colors["--color-primary"],
53
+ onTertiaryFixed: colors["--color-primary-foreground"],
54
+ onTertiaryFixedVariant: colors["--color-primary-foreground"],
55
+ } satisfies Record<keyof MaterialColors, string>;
56
+ // Material scheme roles are opaque. Composite translucent RN fills onto the canvas.
57
+ return Object.fromEntries(
58
+ Object.entries(roles).map(([role, color]) => [
59
+ role,
60
+ flattenThemeColor(color, colors["--color-screen"]),
61
+ ]),
62
+ ) as MaterialColors;
63
+}
patches/@expo__ui@58.0.11.patch
new
+180
@@ -0,0 +1,180 @@
1
+diff --git a/android/src/main/java/expo/modules/ui/HostView.kt b/android/src/main/java/expo/modules/ui/HostView.kt
2
+index eac1903ae62f66081211101a0de408215fea6b44..1a3feb98cfb2e6bb38832ae96a22217b990ee888 100644
3
+--- a/android/src/main/java/expo/modules/ui/HostView.kt
4
++++ b/android/src/main/java/expo/modules/ui/HostView.kt
5
+@@ -68,6 +68,7 @@ internal enum class ExpoLayoutDirection(val value: String) : Enumerable {
6
+ internal data class HostProps(
7
+ val colorScheme: MutableState<ExpoColorScheme?> = mutableStateOf(null),
8
+ val seedColor: MutableState<android.graphics.Color?> = mutableStateOf(null),
9
++ val colorOverrides: MutableState<Map<String, android.graphics.Color>?> = mutableStateOf(null),
10
+ val layoutDirection: MutableState<ExpoLayoutDirection> = mutableStateOf(ExpoLayoutDirection.LeftToRight),
11
+ val useViewportSizeMeasurement: MutableState<Boolean> = mutableStateOf(false),
12
+ val ignoreSafeAreaKeyboardInsets: MutableState<Boolean> = mutableStateOf(false),
13
+@@ -132,9 +133,60 @@ internal class HostView(context: Context, appContext: AppContext) :
14
+ val seededScheme = remember(seedArgb, isDark) {
15
+ seedArgb?.let { seedColorScheme(it, isDark) }
16
+ }
17
+- val colorScheme = seededScheme
18
++ val baseColorScheme = seededScheme
19
+ ?: props.colorScheme.value?.toColorScheme(context)
20
+ ?: ExpoColorScheme.defaultColorScheme(context, isSystemInDarkTheme())
21
++ val overrides = props.colorOverrides.value.orEmpty()
22
++ val colorScheme = baseColorScheme.copy(
23
++ primary = overrides["primary"]?.composeOrNull ?: baseColorScheme.primary,
24
++ onPrimary = overrides["onPrimary"]?.composeOrNull ?: baseColorScheme.onPrimary,
25
++ primaryContainer = overrides["primaryContainer"]?.composeOrNull ?: baseColorScheme.primaryContainer,
26
++ onPrimaryContainer = overrides["onPrimaryContainer"]?.composeOrNull ?: baseColorScheme.onPrimaryContainer,
27
++ inversePrimary = overrides["inversePrimary"]?.composeOrNull ?: baseColorScheme.inversePrimary,
28
++ secondary = overrides["secondary"]?.composeOrNull ?: baseColorScheme.secondary,
29
++ onSecondary = overrides["onSecondary"]?.composeOrNull ?: baseColorScheme.onSecondary,
30
++ secondaryContainer = overrides["secondaryContainer"]?.composeOrNull ?: baseColorScheme.secondaryContainer,
31
++ onSecondaryContainer = overrides["onSecondaryContainer"]?.composeOrNull ?: baseColorScheme.onSecondaryContainer,
32
++ tertiary = overrides["tertiary"]?.composeOrNull ?: baseColorScheme.tertiary,
33
++ onTertiary = overrides["onTertiary"]?.composeOrNull ?: baseColorScheme.onTertiary,
34
++ tertiaryContainer = overrides["tertiaryContainer"]?.composeOrNull ?: baseColorScheme.tertiaryContainer,
35
++ onTertiaryContainer = overrides["onTertiaryContainer"]?.composeOrNull ?: baseColorScheme.onTertiaryContainer,
36
++ background = overrides["background"]?.composeOrNull ?: baseColorScheme.background,
37
++ onBackground = overrides["onBackground"]?.composeOrNull ?: baseColorScheme.onBackground,
38
++ surface = overrides["surface"]?.composeOrNull ?: baseColorScheme.surface,
39
++ onSurface = overrides["onSurface"]?.composeOrNull ?: baseColorScheme.onSurface,
40
++ surfaceVariant = overrides["surfaceVariant"]?.composeOrNull ?: baseColorScheme.surfaceVariant,
41
++ onSurfaceVariant = overrides["onSurfaceVariant"]?.composeOrNull ?: baseColorScheme.onSurfaceVariant,
42
++ surfaceTint = overrides["surfaceTint"]?.composeOrNull ?: baseColorScheme.surfaceTint,
43
++ inverseSurface = overrides["inverseSurface"]?.composeOrNull ?: baseColorScheme.inverseSurface,
44
++ inverseOnSurface = overrides["inverseOnSurface"]?.composeOrNull ?: baseColorScheme.inverseOnSurface,
45
++ error = overrides["error"]?.composeOrNull ?: baseColorScheme.error,
46
++ onError = overrides["onError"]?.composeOrNull ?: baseColorScheme.onError,
47
++ errorContainer = overrides["errorContainer"]?.composeOrNull ?: baseColorScheme.errorContainer,
48
++ onErrorContainer = overrides["onErrorContainer"]?.composeOrNull ?: baseColorScheme.onErrorContainer,
49
++ outline = overrides["outline"]?.composeOrNull ?: baseColorScheme.outline,
50
++ outlineVariant = overrides["outlineVariant"]?.composeOrNull ?: baseColorScheme.outlineVariant,
51
++ scrim = overrides["scrim"]?.composeOrNull ?: baseColorScheme.scrim,
52
++ surfaceBright = overrides["surfaceBright"]?.composeOrNull ?: baseColorScheme.surfaceBright,
53
++ surfaceDim = overrides["surfaceDim"]?.composeOrNull ?: baseColorScheme.surfaceDim,
54
++ surfaceContainer = overrides["surfaceContainer"]?.composeOrNull ?: baseColorScheme.surfaceContainer,
55
++ surfaceContainerHigh = overrides["surfaceContainerHigh"]?.composeOrNull ?: baseColorScheme.surfaceContainerHigh,
56
++ surfaceContainerHighest = overrides["surfaceContainerHighest"]?.composeOrNull ?: baseColorScheme.surfaceContainerHighest,
57
++ surfaceContainerLow = overrides["surfaceContainerLow"]?.composeOrNull ?: baseColorScheme.surfaceContainerLow,
58
++ surfaceContainerLowest = overrides["surfaceContainerLowest"]?.composeOrNull ?: baseColorScheme.surfaceContainerLowest,
59
++ primaryFixed = overrides["primaryFixed"]?.composeOrNull ?: baseColorScheme.primaryFixed,
60
++ primaryFixedDim = overrides["primaryFixedDim"]?.composeOrNull ?: baseColorScheme.primaryFixedDim,
61
++ onPrimaryFixed = overrides["onPrimaryFixed"]?.composeOrNull ?: baseColorScheme.onPrimaryFixed,
62
++ onPrimaryFixedVariant = overrides["onPrimaryFixedVariant"]?.composeOrNull ?: baseColorScheme.onPrimaryFixedVariant,
63
++ secondaryFixed = overrides["secondaryFixed"]?.composeOrNull ?: baseColorScheme.secondaryFixed,
64
++ secondaryFixedDim = overrides["secondaryFixedDim"]?.composeOrNull ?: baseColorScheme.secondaryFixedDim,
65
++ onSecondaryFixed = overrides["onSecondaryFixed"]?.composeOrNull ?: baseColorScheme.onSecondaryFixed,
66
++ onSecondaryFixedVariant = overrides["onSecondaryFixedVariant"]?.composeOrNull ?: baseColorScheme.onSecondaryFixedVariant,
67
++ tertiaryFixed = overrides["tertiaryFixed"]?.composeOrNull ?: baseColorScheme.tertiaryFixed,
68
++ tertiaryFixedDim = overrides["tertiaryFixedDim"]?.composeOrNull ?: baseColorScheme.tertiaryFixedDim,
69
++ onTertiaryFixed = overrides["onTertiaryFixed"]?.composeOrNull ?: baseColorScheme.onTertiaryFixed,
70
++ onTertiaryFixedVariant = overrides["onTertiaryFixedVariant"]?.composeOrNull ?: baseColorScheme.onTertiaryFixedVariant
71
++ )
72
+ val layoutDirection = props.layoutDirection.value.toLayoutDirection()
73
+
74
+ // Material3's `MaterialTheme` does not provide `LocalContentColor` — only `Surface` does — so
75
+diff --git a/build/jetpack-compose/Host/index.d.ts b/build/jetpack-compose/Host/index.d.ts
76
+index b586b653a991ce8840b9994a6fe1e6af75480ece..e32f6e093fde22e9cfc9d7ff612cddb59e036945 100644
77
+--- a/build/jetpack-compose/Host/index.d.ts
78
++++ b/build/jetpack-compose/Host/index.d.ts
79
+@@ -1,6 +1,7 @@
80
+ import { type Ref } from 'react';
81
+ import { type ColorSchemeName, type ColorValue, type StyleProp, type ViewStyle } from 'react-native';
82
+ import { type PrimitiveBaseProps } from '../layout';
83
++import type { MaterialColors } from '../colors';
84
+ export interface HostProps extends PrimitiveBaseProps {
85
+ /**
86
+ * When true, the host view will update its size in the React Native view tree to match the content's layout from Jetpack Compose.
87
+@@ -41,6 +42,7 @@ export interface HostProps extends PrimitiveBaseProps {
88
+ * available to descendants via `useMaterialColors()`.
89
+ */
90
+ seedColor?: ColorValue;
91
++ colorOverrides?: Partial<MaterialColors>;
92
+ /**
93
+ * The layout direction for the content.
94
+ * Defaults to the current locale direction from I18nManager.
95
+diff --git a/build/jetpack-compose/Host/index.js b/build/jetpack-compose/Host/index.js
96
+index 3e785c1667bcba137c3369da15aa7b397aa0fb37..80dba6ac4dd6ac8caf53fb7839ff3ed38c27b7f3 100644
97
+--- a/build/jetpack-compose/Host/index.js
98
++++ b/build/jetpack-compose/Host/index.js
99
+@@ -7,17 +7,14 @@ import { useMergeRefs } from '../../utils/useMergeRefs';
100
+ import { getMaterialColors, HostPaletteContext } from '../colors';
101
+ const HostNativeView = requireNativeView('ExpoUI', 'HostView');
102
+ export function Host(props) {
103
+- const { matchContents, modifiers, onLayoutContent, layoutDirection, colorScheme, seedColor, ref, ...restProps } = props;
104
++ const { matchContents, modifiers, onLayoutContent, layoutDirection, colorScheme, seedColor, colorOverrides, ref, ...restProps } = props;
105
+ const schemeString = colorScheme === 'light' || colorScheme === 'dark' ? colorScheme : undefined;
106
+ const systemScheme = useRNColorScheme();
107
+ const resolvedScheme = schemeString ?? (systemScheme === 'dark' ? 'dark' : 'light');
108
+- const palette = useMemo(()=>getMaterialColors({
109
+- scheme: resolvedScheme,
110
+- seedColor
111
+- }), [
112
+- resolvedScheme,
113
+- seedColor
114
+- ]);
115
++ const palette = useMemo(() => ({
116
++ ...getMaterialColors({ scheme: resolvedScheme, seedColor }),
117
++ ...colorOverrides
118
++ }), [resolvedScheme, seedColor, colorOverrides]);
119
+ const hostRef = useTextInputHostRef();
120
+ const mergedRef = useMergeRefs(ref, hostRef);
121
+ return /*#__PURE__*/ _jsx(HostPaletteContext.Provider, {
122
+@@ -30,7 +27,7 @@ export function Host(props) {
123
+ matchContentsVertical: typeof matchContents === 'object' ? matchContents.vertical : matchContents,
124
+ matchContentsHorizontal: typeof matchContents === 'object' ? matchContents.horizontal : matchContents,
125
+ colorScheme: schemeString,
126
+- seedColor: seedColor,
127
++ seedColor: seedColor, colorOverrides: colorOverrides,
128
+ onLayoutContent: onLayoutContent,
129
+ layoutDirection: layoutDirection ?? (I18nManager.getConstants().isRTL ? 'rightToLeft' : 'leftToRight'),
130
+ ref: mergedRef
131
+diff --git a/src/jetpack-compose/Host/index.tsx b/src/jetpack-compose/Host/index.tsx
132
+index c38eb76691942ee8515776cb443cd3b003052db3..ca3b901fc7c31768cce9d7923070332ac0d79760 100644
133
+--- a/src/jetpack-compose/Host/index.tsx
134
++++ b/src/jetpack-compose/Host/index.tsx
135
+@@ -11,7 +11,7 @@ import {
136
+
137
+ import { TextInputHostProvider, useTextInputHostRef } from '../../keyboard';
138
+ import { useMergeRefs } from '../../utils/useMergeRefs';
139
+-import { getMaterialColors, HostPaletteContext } from '../colors';
140
++import { getMaterialColors, HostPaletteContext, type MaterialColors } from '../colors';
141
+ import { type PrimitiveBaseProps } from '../layout';
142
+
143
+ export interface HostProps extends PrimitiveBaseProps {
144
+@@ -51,6 +51,9 @@ export interface HostProps extends PrimitiveBaseProps {
145
+ */
146
+ seedColor?: ColorValue;
147
+
148
++ /** Explicit Material roles, applied after the seed or system palette. */
149
++ colorOverrides?: Partial<MaterialColors>;
150
++
151
+ /**
152
+ * The layout direction for the content.
153
+ * Defaults to the current locale direction from I18nManager.
154
+@@ -92,6 +95,7 @@ export function Host(props: HostProps) {
155
+ layoutDirection,
156
+ colorScheme,
157
+ seedColor,
158
++ colorOverrides,
159
+ ref,
160
+ ...restProps
161
+ } = props;
162
+@@ -100,8 +104,8 @@ export function Host(props: HostProps) {
163
+ const systemScheme = useRNColorScheme();
164
+ const resolvedScheme = schemeString ?? (systemScheme === 'dark' ? 'dark' : 'light');
165
+ const palette = useMemo(
166
+- () => getMaterialColors({ scheme: resolvedScheme, seedColor }),
167
+- [resolvedScheme, seedColor]
168
++ () => ({ ...getMaterialColors({ scheme: resolvedScheme, seedColor }), ...colorOverrides }),
169
++ [resolvedScheme, seedColor, colorOverrides]
170
+ );
171
+ const hostRef = useTextInputHostRef();
172
+ const mergedRef = useMergeRefs(ref, hostRef);
173
+@@ -120,6 +124,7 @@ export function Host(props: HostProps) {
174
+ }
175
+ colorScheme={schemeString}
176
+ seedColor={seedColor}
177
++ colorOverrides={colorOverrides}
178
+ onLayoutContent={onLayoutContent}
179
+ layoutDirection={
180
+ layoutDirection ?? (I18nManager.getConstants().isRTL ? 'rightToLeft' : 'leftToRight')
pnpm-lock.yaml
+5
-4
@@ -152,6 +152,7 @@ patchedDependencies:
152
'@clerk/expo@4.6.8': b8b22ab733de5bea846ad9e88046c10582352fe9ad86f314f368b2a823f0f281
153
'@effect/vitest@4.0.5': 2731c9c3761c595f25ddc625a7d61ca376b389d5b3049ecb837c8940f21cfa02
154
'@expo/metro-config@58.0.6': 90fa980e8b6480631fb2fbb04559834e3c612db40c550cd828f11be297d8d760
155
+ '@expo/ui@58.0.11': d1efeb3611dec747fce7a526860697187e82ba87b5b75993d115f73e2ef0e1f7
156
'@ff-labs/fff-node@0.11.0': cc71fcec015f4d39bc96ae2e2bf6b0ca678124c722c66a7841efce9d34b5983c
157
'@legendapp/list@3.3.5': 680cc6a5c5b4a4032e467e7b3fde22f89a84c0ee2e6eac6fda737d6277cc0806
158
'@pierre/diffs@1.5.2': 298e94372dbd51846a4e26ece2ecc3e22eb1f94b0450b1f1a9c6fec127809be7
@@ -321,8 +322,8 @@ importers:
322
specifier: ~58.0.10
323
version: 58.0.10(@expo/log-box@58.0.8)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
324
'@expo/ui':
324
- specifier: ~58.0.11
325
- version: 58.0.11(@babel/core@7.29.7)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
325
+ specifier: 58.0.11
326
+ version: 58.0.11(patch_hash=d1efeb3611dec747fce7a526860697187e82ba87b5b75993d115f73e2ef0e1f7)(@babel/core@7.29.7)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
327
'@legendapp/list':
328
specifier: 'catalog:'
329
version: 3.3.5(patch_hash=680cc6a5c5b4a4032e467e7b3fde22f89a84c0ee2e6eac6fda737d6277cc0806)(react-dom@19.3.0(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
@@ -14762,7 +14763,7 @@ snapshots:
14763
14764
'@expo/sudo-prompt@9.3.2': {}
14765
14765
- '@expo/ui@58.0.11(@babel/core@7.29.7)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)':
14766
+ '@expo/ui@58.0.11(patch_hash=d1efeb3611dec747fce7a526860697187e82ba87b5b75993d115f73e2ef0e1f7)(@babel/core@7.29.7)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)':
14767
dependencies:
14768
expo: 58.0.2(bd4444e61fed72e958d45f73733b7f54)
14769
react: 19.3.0
@@ -19461,7 +19462,7 @@ snapshots:
19462
expo-widgets@58.0.11(patch_hash=d00838b5b215a4c45f89b8b7d34878d158528756fbcf281bae1cbd6f0752deed)(@babel/core@7.29.7)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0):
19463
dependencies:
19464
'@expo/plist': 0.10.1
19464
- '@expo/ui': 58.0.11(@babel/core@7.29.7)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
19465
+ '@expo/ui': 58.0.11(patch_hash=d1efeb3611dec747fce7a526860697187e82ba87b5b75993d115f73e2ef0e1f7)(@babel/core@7.29.7)(expo@58.0.2)(react-dom@19.3.0(react@19.3.0))(react-native-worklets@0.13.0(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0))(react-native@0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6))(react@19.3.0)
19466
expo: 58.0.2(bd4444e61fed72e958d45f73733b7f54)
19467
react: 19.3.0
19468
react-native: 0.88.0-rc.3(@babel/core@7.29.7)(@react-native/metro-config@0.88.0-rc.3(@babel/core@7.29.7)(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(utf-8-validate@6.0.6)
pnpm-workspace.yaml
+1
@@ -310,6 +310,7 @@ patchedDependencies:
310
react-native-keyboard-controller@1.22.6: patches/react-native-keyboard-controller@1.22.6.patch
311
# Android: a nested WebView hands a vertical drag to its scrolling parent at the page's edge.
312
react-native-webview@14.0.1: patches/react-native-webview@14.0.1.patch
313
+ "@expo/ui@58.0.11": patches/@expo__ui@58.0.11.patch
314
315
peerDependencyRules:
316
allowAny: