@gv-tech/ui-native 2.26.2 → 2.27.1

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.
@@ -1,6 +1,6 @@
1
1
  import { theme as designTokens } from '@gv-tech/design-tokens';
2
2
  import * as React from 'react';
3
- import { useColorScheme, View, ViewProps } from 'react-native';
3
+ import { Appearance, useColorScheme, View, ViewProps } from 'react-native';
4
4
  import { cn } from './lib/utils';
5
5
 
6
6
  export interface ThemeContextValue {
@@ -25,6 +25,24 @@ export function ThemeProvider({ children, className, style, value, ...props }: T
25
25
 
26
26
  const isDark = resolvedTheme === 'dark';
27
27
 
28
+ React.useEffect(() => {
29
+ if (typeof document !== 'undefined') {
30
+ document.documentElement.classList.toggle('dark', isDark);
31
+ if (document.body) {
32
+ document.body.classList.toggle('dark', isDark);
33
+ }
34
+ }
35
+ try {
36
+ if (theme === 'system') {
37
+ Appearance.setColorScheme('unspecified');
38
+ } else {
39
+ Appearance.setColorScheme(isDark ? 'dark' : 'light');
40
+ }
41
+ } catch {
42
+ // Fallback for platform limitations
43
+ }
44
+ }, [theme, isDark]);
45
+
28
46
  const contextValue = React.useMemo<ThemeContextValue>(
29
47
  () => ({
30
48
  theme,