@oxyhq/services 6.9.25 → 6.9.27

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.
Files changed (129) hide show
  1. package/lib/commonjs/ui/components/BottomSheet.js +15 -19
  2. package/lib/commonjs/ui/components/BottomSheet.js.map +1 -1
  3. package/lib/commonjs/ui/components/BottomSheetRouter.js +6 -9
  4. package/lib/commonjs/ui/components/BottomSheetRouter.js.map +1 -1
  5. package/lib/commonjs/ui/components/Header.js +9 -12
  6. package/lib/commonjs/ui/components/Header.js.map +1 -1
  7. package/lib/commonjs/ui/components/SignInModal.js +24 -53
  8. package/lib/commonjs/ui/components/SignInModal.js.map +1 -1
  9. package/lib/commonjs/ui/components/StepBasedScreen.js +20 -7
  10. package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
  11. package/lib/commonjs/ui/components/feedback/feedbackStyles.js +2 -2
  12. package/lib/commonjs/ui/components/feedback/feedbackStyles.js.map +1 -1
  13. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +32 -29
  14. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  15. package/lib/commonjs/ui/components/payment/paymentStyles.js +6 -6
  16. package/lib/commonjs/ui/components/payment/paymentStyles.js.map +1 -1
  17. package/lib/commonjs/ui/constants/theme.js +3 -2
  18. package/lib/commonjs/ui/constants/theme.js.map +1 -1
  19. package/lib/commonjs/ui/hooks/useAuth.js +6 -1
  20. package/lib/commonjs/ui/hooks/useAuth.js.map +1 -1
  21. package/lib/commonjs/ui/hooks/useThemeColors.js +19 -17
  22. package/lib/commonjs/ui/hooks/useThemeColors.js.map +1 -1
  23. package/lib/commonjs/ui/hooks/useThemeStyles.js +20 -51
  24. package/lib/commonjs/ui/hooks/useThemeStyles.js.map +1 -1
  25. package/lib/commonjs/ui/hooks/useWebSSO.js +6 -1
  26. package/lib/commonjs/ui/hooks/useWebSSO.js.map +1 -1
  27. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +0 -8
  28. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/OxyAuthScreen.js +37 -40
  30. package/lib/commonjs/ui/screens/OxyAuthScreen.js.map +1 -1
  31. package/lib/commonjs/ui/styles/authStyles.js +3 -3
  32. package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
  33. package/lib/commonjs/ui/styles/theme.js +45 -9
  34. package/lib/commonjs/ui/styles/theme.js.map +1 -1
  35. package/lib/module/ui/components/BottomSheet.js +15 -19
  36. package/lib/module/ui/components/BottomSheet.js.map +1 -1
  37. package/lib/module/ui/components/BottomSheetRouter.js +6 -9
  38. package/lib/module/ui/components/BottomSheetRouter.js.map +1 -1
  39. package/lib/module/ui/components/Header.js +9 -12
  40. package/lib/module/ui/components/Header.js.map +1 -1
  41. package/lib/module/ui/components/SignInModal.js +25 -54
  42. package/lib/module/ui/components/SignInModal.js.map +1 -1
  43. package/lib/module/ui/components/StepBasedScreen.js +21 -8
  44. package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
  45. package/lib/module/ui/components/feedback/feedbackStyles.js +2 -2
  46. package/lib/module/ui/components/feedback/feedbackStyles.js.map +1 -1
  47. package/lib/module/ui/components/modals/DeleteAccountModal.js +33 -30
  48. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  49. package/lib/module/ui/components/payment/paymentStyles.js +6 -6
  50. package/lib/module/ui/components/payment/paymentStyles.js.map +1 -1
  51. package/lib/module/ui/constants/theme.js +3 -2
  52. package/lib/module/ui/constants/theme.js.map +1 -1
  53. package/lib/module/ui/hooks/useAuth.js +6 -1
  54. package/lib/module/ui/hooks/useAuth.js.map +1 -1
  55. package/lib/module/ui/hooks/useThemeColors.js +18 -16
  56. package/lib/module/ui/hooks/useThemeColors.js.map +1 -1
  57. package/lib/module/ui/hooks/useThemeStyles.js +18 -49
  58. package/lib/module/ui/hooks/useThemeStyles.js.map +1 -1
  59. package/lib/module/ui/hooks/useWebSSO.js +6 -1
  60. package/lib/module/ui/hooks/useWebSSO.js.map +1 -1
  61. package/lib/module/ui/screens/AccountOverviewScreen.js +0 -8
  62. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  63. package/lib/module/ui/screens/OxyAuthScreen.js +38 -41
  64. package/lib/module/ui/screens/OxyAuthScreen.js.map +1 -1
  65. package/lib/module/ui/styles/authStyles.js +3 -3
  66. package/lib/module/ui/styles/authStyles.js.map +1 -1
  67. package/lib/module/ui/styles/theme.js +46 -9
  68. package/lib/module/ui/styles/theme.js.map +1 -1
  69. package/lib/typescript/commonjs/ui/components/BottomSheet.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/ui/components/BottomSheetRouter.d.ts.map +1 -1
  71. package/lib/typescript/commonjs/ui/components/Header.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/ui/components/SignInModal.d.ts.map +1 -1
  73. package/lib/typescript/commonjs/ui/components/StepBasedScreen.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +0 -8
  75. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/ui/components/payment/types.d.ts +2 -0
  77. package/lib/typescript/commonjs/ui/components/payment/types.d.ts.map +1 -1
  78. package/lib/typescript/commonjs/ui/constants/theme.d.ts +3 -2
  79. package/lib/typescript/commonjs/ui/constants/theme.d.ts.map +1 -1
  80. package/lib/typescript/commonjs/ui/hooks/useAuth.d.ts.map +1 -1
  81. package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts +13 -20
  82. package/lib/typescript/commonjs/ui/hooks/useThemeColors.d.ts.map +1 -1
  83. package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts +5 -28
  84. package/lib/typescript/commonjs/ui/hooks/useThemeStyles.d.ts.map +1 -1
  85. package/lib/typescript/commonjs/ui/hooks/useWebSSO.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  87. package/lib/typescript/commonjs/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/ui/styles/theme.d.ts +8 -0
  89. package/lib/typescript/commonjs/ui/styles/theme.d.ts.map +1 -1
  90. package/lib/typescript/module/ui/components/BottomSheet.d.ts.map +1 -1
  91. package/lib/typescript/module/ui/components/BottomSheetRouter.d.ts.map +1 -1
  92. package/lib/typescript/module/ui/components/Header.d.ts.map +1 -1
  93. package/lib/typescript/module/ui/components/SignInModal.d.ts.map +1 -1
  94. package/lib/typescript/module/ui/components/StepBasedScreen.d.ts.map +1 -1
  95. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +0 -8
  96. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  97. package/lib/typescript/module/ui/components/payment/types.d.ts +2 -0
  98. package/lib/typescript/module/ui/components/payment/types.d.ts.map +1 -1
  99. package/lib/typescript/module/ui/constants/theme.d.ts +3 -2
  100. package/lib/typescript/module/ui/constants/theme.d.ts.map +1 -1
  101. package/lib/typescript/module/ui/hooks/useAuth.d.ts.map +1 -1
  102. package/lib/typescript/module/ui/hooks/useThemeColors.d.ts +13 -20
  103. package/lib/typescript/module/ui/hooks/useThemeColors.d.ts.map +1 -1
  104. package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts +5 -28
  105. package/lib/typescript/module/ui/hooks/useThemeStyles.d.ts.map +1 -1
  106. package/lib/typescript/module/ui/hooks/useWebSSO.d.ts.map +1 -1
  107. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  108. package/lib/typescript/module/ui/screens/OxyAuthScreen.d.ts.map +1 -1
  109. package/lib/typescript/module/ui/styles/theme.d.ts +8 -0
  110. package/lib/typescript/module/ui/styles/theme.d.ts.map +1 -1
  111. package/package.json +1 -1
  112. package/src/ui/components/BottomSheet.tsx +12 -18
  113. package/src/ui/components/BottomSheetRouter.tsx +7 -9
  114. package/src/ui/components/Header.tsx +9 -12
  115. package/src/ui/components/SignInModal.tsx +17 -40
  116. package/src/ui/components/StepBasedScreen.tsx +22 -9
  117. package/src/ui/components/feedback/feedbackStyles.ts +2 -2
  118. package/src/ui/components/modals/DeleteAccountModal.tsx +25 -34
  119. package/src/ui/components/payment/paymentStyles.ts +6 -6
  120. package/src/ui/components/payment/types.ts +2 -0
  121. package/src/ui/constants/theme.ts +3 -2
  122. package/src/ui/hooks/useAuth.ts +4 -1
  123. package/src/ui/hooks/useThemeColors.ts +19 -18
  124. package/src/ui/hooks/useThemeStyles.ts +21 -56
  125. package/src/ui/hooks/useWebSSO.ts +4 -1
  126. package/src/ui/screens/AccountOverviewScreen.tsx +0 -8
  127. package/src/ui/screens/OxyAuthScreen.tsx +25 -31
  128. package/src/ui/styles/authStyles.ts +3 -3
  129. package/src/ui/styles/theme.ts +44 -10
@@ -1,7 +1,6 @@
1
1
  import { useMemo } from 'react';
2
- import { useColorScheme } from './useColorScheme';
2
+ import { useTheme } from '@oxyhq/bloom/theme';
3
3
  import { Colors } from '../constants/theme';
4
- import { normalizeColorScheme } from '../utils/themeUtils';
5
4
 
6
5
  export interface ThemeStyles {
7
6
  textColor: string;
@@ -10,76 +9,42 @@ export interface ThemeStyles {
10
9
  borderColor: string;
11
10
  mutedTextColor: string;
12
11
  isDarkTheme: boolean;
13
- // Common semantic colors used across screens
14
12
  primaryColor: string;
15
13
  dangerColor: string;
16
14
  successColor: string;
17
- // Normalized color scheme and theme colors
18
15
  colorScheme: 'light' | 'dark';
19
16
  colors: typeof Colors.light;
20
17
  }
21
18
 
22
19
  /**
23
- * Reusable hook for theme styles
24
- * Replaces duplicated themeStyles useMemo pattern across multiple screens
25
- *
26
- * Provides consistent theme colors across all service screens:
27
- * - Base colors (text, background, borders)
28
- * - Semantic colors (primary, danger, success)
29
- * - Theme-aware calculations
30
- * - Normalized color scheme and Colors object
31
- *
32
- * @param theme - Theme string ('light' | 'dark')
33
- * @param colorSchemeFromHook - Optional color scheme from useColorScheme() hook. If not provided, will call useColorScheme() internally.
34
- * @returns ThemeStyles object with consistent color values
35
- *
36
- * @example
37
- * ```tsx
38
- * const themeStyles = useThemeStyles(theme);
39
- * <View style={{ backgroundColor: themeStyles.backgroundColor }}>
40
- * <Text style={{ color: themeStyles.textColor }}>Hello</Text>
41
- * </View>
42
- * ```
43
- *
44
- * @example
45
- * ```tsx
46
- * const colorScheme = useColorScheme();
47
- * const themeStyles = useThemeStyles(theme, colorScheme);
48
- * const iconColor = themeStyles.colors.iconSecurity;
49
- * ```
20
+ * Returns theme styles for service screens.
21
+ * Delegates to bloom's useTheme() for all color values.
22
+ * The `theme` param is kept for backward compatibility but ignored —
23
+ * bloom's resolved mode (from BloomThemeProvider) is used instead.
50
24
  */
51
25
  export const useThemeStyles = (
52
- theme: string,
53
- colorSchemeFromHook?: string | null
26
+ _theme?: string,
27
+ _colorSchemeFromHook?: string | null
54
28
  ): ThemeStyles => {
55
- const hookColorScheme = useColorScheme();
56
- const colorSchemeToUse = colorSchemeFromHook ?? hookColorScheme;
57
-
29
+ const bloomTheme = useTheme();
30
+
58
31
  return useMemo(() => {
59
- const colorScheme = normalizeColorScheme(colorSchemeToUse, theme);
60
- const isDarkTheme = colorScheme === 'dark';
32
+ const isDarkTheme = bloomTheme.isDark;
33
+ const colorScheme = isDarkTheme ? 'dark' : 'light';
61
34
  const colors = Colors[colorScheme];
62
-
35
+
63
36
  return {
64
- // Base colors
65
- textColor: isDarkTheme ? '#FFFFFF' : '#000000',
66
- backgroundColor: isDarkTheme ? '#121212' : '#FFFFFF',
67
- secondaryBackgroundColor: isDarkTheme ? '#222222' : '#F5F5F5',
68
- borderColor: isDarkTheme ? '#444444' : '#E0E0E0',
69
- mutedTextColor: '#8E8E93', // Same for both themes
70
-
71
- // Semantic colors (consistent across themes)
72
- primaryColor: '#007AFF',
73
- dangerColor: '#FF3B30',
74
- successColor: '#34C759',
75
-
76
- // Theme flag
37
+ textColor: bloomTheme.colors.text,
38
+ backgroundColor: bloomTheme.colors.background,
39
+ secondaryBackgroundColor: bloomTheme.colors.backgroundSecondary,
40
+ borderColor: bloomTheme.colors.border,
41
+ mutedTextColor: bloomTheme.colors.textSecondary,
42
+ primaryColor: bloomTheme.colors.primary,
43
+ dangerColor: bloomTheme.colors.error,
44
+ successColor: bloomTheme.colors.success,
77
45
  isDarkTheme,
78
-
79
- // Normalized color scheme and theme colors
80
46
  colorScheme,
81
47
  colors,
82
48
  };
83
- }, [theme, colorSchemeToUse]);
49
+ }, [bloomTheme]);
84
50
  };
85
-
@@ -54,7 +54,10 @@ function isWebBrowser(): boolean {
54
54
  function isIdentityProvider(authWebUrl?: string): boolean {
55
55
  if (!isWebBrowser()) return false;
56
56
  const hostname = window.location.hostname;
57
- const idpHostname = authWebUrl ? new URL(authWebUrl).hostname : 'auth.oxy.so';
57
+ let idpHostname = 'auth.oxy.so';
58
+ if (authWebUrl) {
59
+ try { idpHostname = new URL(authWebUrl).hostname; } catch { /* malformed URL, use default */ }
60
+ }
58
61
  return hostname === idpHostname;
59
62
  }
60
63
 
@@ -698,14 +698,6 @@ const AccountOverviewScreen: React.FC<BaseScreenProps> = ({
698
698
  username={user.username || ''}
699
699
  onClose={() => setShowDeleteModal(false)}
700
700
  onDelete={handleConfirmDelete}
701
- colors={{
702
- background: themeStyles.backgroundColor,
703
- text: themeStyles.textColor,
704
- secondaryText: themeStyles.isDarkTheme ? '#888888' : '#666666',
705
- border: themeStyles.borderColor,
706
- danger: '#FF3B30',
707
- inputBackground: themeStyles.isDarkTheme ? '#333333' : '#F5F5F5',
708
- }}
709
701
  t={t}
710
702
  />
711
703
  )}
@@ -20,11 +20,12 @@ import {
20
20
  StyleSheet,
21
21
  Linking,
22
22
  Platform,
23
- ActivityIndicator,
24
23
  } from 'react-native';
25
24
  import io, { type Socket } from 'socket.io-client';
26
25
  import type { BaseScreenProps } from '../types/navigation';
27
- import { useThemeColors } from '../styles';
26
+ import { useTheme } from '@oxyhq/bloom/theme';
27
+ import { Button } from '@oxyhq/bloom/button';
28
+ import { Loading } from '@oxyhq/bloom/loading';
28
29
  import { useOxy } from '../context/OxyContext';
29
30
  import QRCode from 'react-native-qrcode-svg';
30
31
  import OxyLogo from '../components/OxyLogo';
@@ -117,8 +118,17 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
117
118
  onAuthenticated,
118
119
  theme,
119
120
  }) => {
120
- const themeValue = (theme === 'light' || theme === 'dark') ? theme : 'light';
121
- const colors = useThemeColors(themeValue);
121
+ const bloomTheme = useTheme();
122
+ const colors = {
123
+ background: bloomTheme.colors.background,
124
+ text: bloomTheme.colors.text,
125
+ secondaryText: bloomTheme.colors.textSecondary,
126
+ primary: bloomTheme.colors.primary,
127
+ error: bloomTheme.colors.error,
128
+ border: bloomTheme.colors.border,
129
+ card: bloomTheme.colors.card,
130
+ inputBackground: bloomTheme.colors.backgroundSecondary,
131
+ };
122
132
  const { oxyServices, signIn, switchSession } = useOxy();
123
133
 
124
134
  const [authSession, setAuthSession] = useState<AuthSession | null>(null);
@@ -401,7 +411,7 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
401
411
  if (isLoading) {
402
412
  return (
403
413
  <View style={[styles.container, { backgroundColor: colors.background }]}>
404
- <ActivityIndicator size="large" color={colors.primary} />
414
+ <Loading size="large" />
405
415
  <Text style={[styles.loadingText, { color: colors.secondaryText }]}>
406
416
  Preparing sign in...
407
417
  </Text>
@@ -413,12 +423,9 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
413
423
  return (
414
424
  <View style={[styles.container, { backgroundColor: colors.background }]}>
415
425
  <Text style={[styles.errorText, { color: colors.error }]}>{error}</Text>
416
- <TouchableOpacity
417
- style={[styles.button, { backgroundColor: colors.primary }]}
418
- onPress={handleRefresh}
419
- >
420
- <Text style={styles.buttonText}>Try Again</Text>
421
- </TouchableOpacity>
426
+ <Button variant="primary" onPress={handleRefresh} style={{ width: '100%', borderRadius: 12 }}>
427
+ Try Again
428
+ </Button>
422
429
  </View>
423
430
  );
424
431
  }
@@ -457,18 +464,19 @@ const OxyAuthScreen: React.FC<BaseScreenProps> = ({
457
464
  </View>
458
465
 
459
466
  {/* Open Oxy Auth Button */}
460
- <TouchableOpacity
461
- style={[styles.button, { backgroundColor: colors.primary }]}
467
+ <Button
468
+ variant="primary"
462
469
  onPress={handleOpenAuth}
470
+ icon={<OxyLogo width={20} height={20} fillColor={colors.card} style={styles.buttonIcon} />}
471
+ style={{ width: '100%', borderRadius: 12 }}
463
472
  >
464
- <OxyLogo width={20} height={20} fillColor="white" style={styles.buttonIcon} />
465
- <Text style={styles.buttonText}>Open Oxy Auth</Text>
466
- </TouchableOpacity>
473
+ Open Oxy Auth
474
+ </Button>
467
475
 
468
476
  {/* Status */}
469
477
  {isWaiting && (
470
478
  <View style={styles.statusContainer}>
471
- <ActivityIndicator size="small" color={colors.primary} />
479
+ <Loading size="small" style={{ flex: undefined }} />
472
480
  <Text style={[styles.statusText, { color: colors.secondaryText }]}>
473
481
  Waiting for authorization...
474
482
  </Text>
@@ -547,23 +555,9 @@ const styles = StyleSheet.create({
547
555
  marginHorizontal: 16,
548
556
  fontSize: 14,
549
557
  },
550
- button: {
551
- flexDirection: 'row',
552
- alignItems: 'center',
553
- justifyContent: 'center',
554
- paddingVertical: 16,
555
- paddingHorizontal: 24,
556
- borderRadius: 12,
557
- width: '100%',
558
- },
559
558
  buttonIcon: {
560
559
  marginRight: 10,
561
560
  },
562
- buttonText: {
563
- color: 'white',
564
- fontSize: 16,
565
- fontWeight: '600',
566
- },
567
561
  statusContainer: {
568
562
  flexDirection: 'row',
569
563
  alignItems: 'center',
@@ -203,7 +203,7 @@ export const createAuthStyles = (colors: AuthThemeColors, theme: string) => Styl
203
203
  width: '100%',
204
204
  },
205
205
  modernButtonText: {
206
- color: '#FFFFFF',
206
+ color: colors.background,
207
207
  fontSize: 16,
208
208
  fontWeight: '600',
209
209
  letterSpacing: 0.5,
@@ -244,7 +244,7 @@ export const createAuthStyles = (colors: AuthThemeColors, theme: string) => Styl
244
244
  },
245
245
  modernUserAvatar: {
246
246
  borderWidth: 4,
247
- borderColor: 'rgba(209, 105, 229, 0.2)',
247
+ borderColor: `${colors.primary}33`,
248
248
  },
249
249
  statusIndicator: {
250
250
  position: 'absolute',
@@ -254,7 +254,7 @@ export const createAuthStyles = (colors: AuthThemeColors, theme: string) => Styl
254
254
  height: 20,
255
255
  borderRadius: 10,
256
256
  borderWidth: 3,
257
- borderColor: '#FFFFFF',
257
+ borderColor: colors.background,
258
258
  },
259
259
  modernUserDisplayName: {
260
260
  fontFamily: fontFamilies.interBold,
@@ -1,6 +1,11 @@
1
1
  import { Platform, StyleSheet, type TextStyle } from 'react-native';
2
+ import { useTheme as useBloomThemeHook, type ThemeColors as BloomThemeColors } from '@oxyhq/bloom';
2
3
  import { fontFamilies } from './fonts';
3
4
 
5
+ /**
6
+ * ThemeColors used by services style files.
7
+ * Maps to bloom's ThemeColors, with a few convenience aliases.
8
+ */
4
9
  export interface ThemeColors {
5
10
  text: string;
6
11
  background: string;
@@ -24,7 +29,26 @@ export interface Theme {
24
29
  };
25
30
  }
26
31
 
27
- const lightColors: ThemeColors = {
32
+ /**
33
+ * Adapts bloom's ThemeColors into the services ThemeColors shape.
34
+ */
35
+ function bloomColorsToThemeColors(bloomColors: BloomThemeColors): ThemeColors {
36
+ return {
37
+ text: bloomColors.text,
38
+ background: bloomColors.background,
39
+ inputBackground: bloomColors.backgroundSecondary,
40
+ placeholder: bloomColors.textTertiary,
41
+ primary: bloomColors.primary,
42
+ border: bloomColors.border,
43
+ error: bloomColors.error,
44
+ success: bloomColors.success,
45
+ warning: bloomColors.warning,
46
+ secondaryText: bloomColors.textSecondary,
47
+ };
48
+ }
49
+
50
+ /** Fallback colors when bloom context is not available */
51
+ const fallbackLight: ThemeColors = {
28
52
  text: '#000000',
29
53
  background: '#FFFFFF',
30
54
  inputBackground: '#F5F5F5',
@@ -37,7 +61,7 @@ const lightColors: ThemeColors = {
37
61
  secondaryText: '#666666',
38
62
  };
39
63
 
40
- const darkColors: ThemeColors = {
64
+ const fallbackDark: ThemeColors = {
41
65
  text: '#FFFFFF',
42
66
  background: '#000000',
43
67
  inputBackground: '#333333',
@@ -50,11 +74,11 @@ const darkColors: ThemeColors = {
50
74
  secondaryText: '#BBBBBB',
51
75
  };
52
76
 
53
- const createTheme = (isDark: boolean): Theme => {
54
- const colors = isDark ? darkColors : lightColors;
55
-
77
+ const createTheme = (isDark: boolean, colors?: ThemeColors): Theme => {
78
+ const themeColors = colors ?? (isDark ? fallbackDark : fallbackLight);
79
+
56
80
  return {
57
- colors,
81
+ colors: themeColors,
58
82
  fonts: {
59
83
  title: {
60
84
  fontFamily: fontFamilies.interBold,
@@ -69,7 +93,7 @@ const createTheme = (isDark: boolean): Theme => {
69
93
  fontFamily: fontFamilies.interSemiBold,
70
94
  fontSize: 16,
71
95
  fontWeight: '600',
72
- color: '#FFFFFF',
96
+ color: themeColors.background,
73
97
  },
74
98
  label: {
75
99
  fontSize: 14,
@@ -84,8 +108,18 @@ export const getTheme = (theme: 'light' | 'dark'): Theme => {
84
108
  return createTheme(theme === 'dark');
85
109
  };
86
110
 
111
+ /**
112
+ * Returns theme colors from bloom when available, with fallback to local colors.
113
+ * Prefer this hook for new code — it reads from bloom's ThemeProvider.
114
+ */
87
115
  export const useThemeColors = (theme: 'light' | 'dark'): ThemeColors => {
88
- return getTheme(theme).colors;
116
+ try {
117
+ const bloomTheme = useBloomThemeHook();
118
+ return bloomColorsToThemeColors(bloomTheme.colors);
119
+ } catch {
120
+ // Bloom provider not available, fall back to local colors
121
+ return getTheme(theme).colors;
122
+ }
89
123
  };
90
124
 
91
125
  // Common styles that can be reused across components
@@ -122,10 +156,10 @@ export const createCommonStyles = (theme: 'light' | 'dark') => {
122
156
  fontFamily: fontFamilies.interSemiBold,
123
157
  fontSize: 16,
124
158
  fontWeight: '600',
125
- color: '#FFFFFF',
159
+ color: colors.background,
126
160
  },
127
161
  errorContainer: {
128
- backgroundColor: '#FFEBEE',
162
+ backgroundColor: `${colors.error}18`,
129
163
  padding: 12,
130
164
  borderRadius: 35,
131
165
  marginBottom: 16,