@oxyhq/services 6.9.44 → 6.9.45

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 (160) hide show
  1. package/lib/commonjs/ui/components/OxyPayButton.js +4 -2
  2. package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
  3. package/lib/commonjs/ui/components/OxySignInButton.js +83 -82
  4. package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
  5. package/lib/commonjs/ui/components/SettingRow.js +11 -5
  6. package/lib/commonjs/ui/components/SettingRow.js.map +1 -1
  7. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +76 -121
  8. package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  9. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +32 -18
  10. package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
  11. package/lib/commonjs/ui/components/icon/OxyIcon.js +5 -4
  12. package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -1
  13. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +11 -9
  14. package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
  15. package/lib/commonjs/ui/components/internal/PinInput.js +3 -2
  16. package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
  17. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +83 -219
  18. package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
  19. package/lib/commonjs/ui/constants/theme.js +2 -2
  20. package/lib/commonjs/ui/constants/theme.js.map +1 -1
  21. package/lib/commonjs/ui/screens/AccountCenterScreen.js +12 -10
  22. package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
  23. package/lib/commonjs/ui/screens/AccountOverviewScreen.js +70 -79
  24. package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
  25. package/lib/commonjs/ui/screens/AccountSettingsScreen.js +22 -10
  26. package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
  27. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +141 -81
  28. package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
  29. package/lib/commonjs/ui/screens/AccountVerificationScreen.js +21 -9
  30. package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
  31. package/lib/commonjs/ui/screens/FileManagementScreen.js +83 -50
  32. package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
  33. package/lib/commonjs/ui/screens/HistoryViewScreen.js +80 -101
  34. package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
  35. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +66 -93
  36. package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  37. package/lib/commonjs/ui/screens/SessionManagementScreen.js +101 -66
  38. package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
  39. package/lib/commonjs/ui/utils/fileManagement.js +0 -21
  40. package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
  41. package/lib/module/ui/components/OxyPayButton.js +4 -2
  42. package/lib/module/ui/components/OxyPayButton.js.map +1 -1
  43. package/lib/module/ui/components/OxySignInButton.js +84 -83
  44. package/lib/module/ui/components/OxySignInButton.js.map +1 -1
  45. package/lib/module/ui/components/SettingRow.js +11 -5
  46. package/lib/module/ui/components/SettingRow.js.map +1 -1
  47. package/lib/module/ui/components/fileManagement/FileDetailsModal.js +76 -122
  48. package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
  49. package/lib/module/ui/components/fileManagement/UploadPreview.js +32 -19
  50. package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
  51. package/lib/module/ui/components/icon/OxyIcon.js +5 -4
  52. package/lib/module/ui/components/icon/OxyIcon.js.map +1 -1
  53. package/lib/module/ui/components/internal/GroupedPillButtons.js +11 -9
  54. package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
  55. package/lib/module/ui/components/internal/PinInput.js +3 -2
  56. package/lib/module/ui/components/internal/PinInput.js.map +1 -1
  57. package/lib/module/ui/components/modals/DeleteAccountModal.js +83 -220
  58. package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
  59. package/lib/module/ui/constants/theme.js +2 -2
  60. package/lib/module/ui/constants/theme.js.map +1 -1
  61. package/lib/module/ui/screens/AccountCenterScreen.js +11 -10
  62. package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
  63. package/lib/module/ui/screens/AccountOverviewScreen.js +71 -80
  64. package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
  65. package/lib/module/ui/screens/AccountSettingsScreen.js +22 -10
  66. package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
  67. package/lib/module/ui/screens/AccountSwitcherScreen.js +140 -81
  68. package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
  69. package/lib/module/ui/screens/AccountVerificationScreen.js +22 -10
  70. package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
  71. package/lib/module/ui/screens/FileManagementScreen.js +85 -52
  72. package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
  73. package/lib/module/ui/screens/HistoryViewScreen.js +80 -101
  74. package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
  75. package/lib/module/ui/screens/PremiumSubscriptionScreen.js +66 -94
  76. package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
  77. package/lib/module/ui/screens/SessionManagementScreen.js +101 -67
  78. package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
  79. package/lib/module/ui/utils/fileManagement.js +0 -20
  80. package/lib/module/ui/utils/fileManagement.js.map +1 -1
  81. package/lib/typescript/commonjs/ui/components/OxyPayButton.d.ts.map +1 -1
  82. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +0 -1
  83. package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
  84. package/lib/typescript/commonjs/ui/components/SettingRow.d.ts +2 -2
  85. package/lib/typescript/commonjs/ui/components/SettingRow.d.ts.map +1 -1
  86. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +3 -4
  87. package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  88. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +2 -3
  89. package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  90. package/lib/typescript/commonjs/ui/components/icon/OxyIcon.d.ts.map +1 -1
  91. package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  92. package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
  93. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +2 -2
  94. package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  95. package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  96. package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  97. package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  98. package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  99. package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  100. package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
  101. package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  102. package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  103. package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  104. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +0 -4
  105. package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
  106. package/lib/typescript/module/ui/components/OxyPayButton.d.ts.map +1 -1
  107. package/lib/typescript/module/ui/components/OxySignInButton.d.ts +0 -1
  108. package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
  109. package/lib/typescript/module/ui/components/SettingRow.d.ts +2 -2
  110. package/lib/typescript/module/ui/components/SettingRow.d.ts.map +1 -1
  111. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +3 -4
  112. package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
  113. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +2 -3
  114. package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
  115. package/lib/typescript/module/ui/components/icon/OxyIcon.d.ts.map +1 -1
  116. package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
  117. package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
  118. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +2 -2
  119. package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
  120. package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
  121. package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
  122. package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
  123. package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
  124. package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
  125. package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
  126. package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
  127. package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
  128. package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
  129. package/lib/typescript/module/ui/utils/fileManagement.d.ts +0 -4
  130. package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
  131. package/package.json +2 -2
  132. package/src/ui/components/OxyPayButton.tsx +5 -3
  133. package/src/ui/components/OxySignInButton.tsx +82 -81
  134. package/src/ui/components/SettingRow.tsx +14 -7
  135. package/src/ui/components/fileManagement/FileDetailsModal.tsx +69 -99
  136. package/src/ui/components/fileManagement/UploadPreview.tsx +58 -46
  137. package/src/ui/components/icon/OxyIcon.tsx +5 -4
  138. package/src/ui/components/internal/GroupedPillButtons.tsx +15 -12
  139. package/src/ui/components/internal/PinInput.tsx +4 -3
  140. package/src/ui/components/modals/DeleteAccountModal.tsx +79 -221
  141. package/src/ui/constants/theme.ts +2 -2
  142. package/src/ui/screens/AccountCenterScreen.tsx +34 -136
  143. package/src/ui/screens/AccountOverviewScreen.tsx +63 -98
  144. package/src/ui/screens/AccountSettingsScreen.tsx +21 -7
  145. package/src/ui/screens/AccountSwitcherScreen.tsx +135 -87
  146. package/src/ui/screens/AccountVerificationScreen.tsx +24 -16
  147. package/src/ui/screens/FileManagementScreen.tsx +62 -54
  148. package/src/ui/screens/HistoryViewScreen.tsx +57 -204
  149. package/src/ui/screens/PremiumSubscriptionScreen.tsx +73 -93
  150. package/src/ui/screens/SessionManagementScreen.tsx +101 -73
  151. package/src/ui/utils/fileManagement.ts +0 -30
  152. package/lib/commonjs/ui/utils/confirmAction.js +0 -28
  153. package/lib/commonjs/ui/utils/confirmAction.js.map +0 -1
  154. package/lib/module/ui/utils/confirmAction.js +0 -25
  155. package/lib/module/ui/utils/confirmAction.js.map +0 -1
  156. package/lib/typescript/commonjs/ui/utils/confirmAction.d.ts +0 -7
  157. package/lib/typescript/commonjs/ui/utils/confirmAction.d.ts.map +0 -1
  158. package/lib/typescript/module/ui/utils/confirmAction.d.ts +0 -7
  159. package/lib/typescript/module/ui/utils/confirmAction.d.ts.map +0 -1
  160. package/src/ui/utils/confirmAction.ts +0 -23
@@ -1,8 +1,9 @@
1
1
  import type React from 'react';
2
- import { useCallback, useState, useEffect } from 'react';
2
+ import { useCallback, useState, useEffect, useMemo } from 'react';
3
3
  import { TouchableOpacity, Text, View, StyleSheet, type ViewStyle, type TextStyle, type StyleProp, Platform } from 'react-native';
4
4
  import { useAuthStore } from '../stores/authStore';
5
5
  import { useShallow } from 'zustand/react/shallow';
6
+ import { useTheme } from '@oxyhq/bloom/theme';
6
7
  import { fontFamilies } from '../styles/fonts';
7
8
  import OxyLogo from './OxyLogo';
8
9
  import { showSignInModal, subscribeToSignInModal } from './SignInModal';
@@ -51,26 +52,25 @@ export interface OxySignInButtonProps {
51
52
 
52
53
  /**
53
54
  * A pre-styled button component for signing in with Oxy identity
54
- *
55
+ *
55
56
  * This component opens the Oxy Auth flow which allows users to authenticate
56
57
  * using their Oxy Accounts identity (via QR code or deep link).
57
- *
58
+ *
58
59
  * @example
59
60
  * ```tsx
60
61
  * // Basic usage
61
62
  * <OxySignInButton />
62
- *
63
+ *
63
64
  * // Custom styling
64
- * <OxySignInButton
65
- * variant="contained"
66
- * style={{ marginTop: 20 }}
67
- * text="Login with Oxy"
65
+ * <OxySignInButton
66
+ * variant="contained"
67
+ * style={{ marginTop: 20 }}
68
+ * text="Login with Oxy"
68
69
  * />
69
- *
70
+ *
70
71
  * // Custom handler
71
72
  * <OxySignInButton onPress={() => {
72
73
  * // Custom authentication flow
73
- * console.log('Custom auth flow initiated');
74
74
  * }} />
75
75
  * ```
76
76
  */
@@ -83,6 +83,7 @@ export const OxySignInButton: React.FC<OxySignInButtonProps> = ({
83
83
  disabled = false,
84
84
  showWhenAuthenticated = false,
85
85
  }) => {
86
+ const theme = useTheme();
86
87
  const { isAuthenticated, isLoading } = useAuthStore(
87
88
  useShallow((state) => ({ isAuthenticated: state.isAuthenticated, isLoading: state.isLoading }))
88
89
  );
@@ -105,6 +106,66 @@ export const OxySignInButton: React.FC<OxySignInButtonProps> = ({
105
106
  showSignInModal();
106
107
  }, [onPress]);
107
108
 
109
+ const themedStyles = useMemo(() => StyleSheet.create({
110
+ button: {
111
+ padding: 14,
112
+ borderRadius: 35,
113
+ alignItems: 'center',
114
+ justifyContent: 'center',
115
+ },
116
+ buttonDefault: {
117
+ backgroundColor: '#FFFFFF',
118
+ borderWidth: 1,
119
+ borderColor: theme.colors.borderLight,
120
+ ...Platform.select({
121
+ web: {
122
+ boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
123
+ },
124
+ default: {
125
+ shadowColor: '#000000',
126
+ shadowOffset: { width: 0, height: 2 },
127
+ shadowOpacity: 0.1,
128
+ shadowRadius: 4,
129
+ elevation: 2,
130
+ }
131
+ }),
132
+ },
133
+ buttonOutline: {
134
+ backgroundColor: 'transparent',
135
+ borderWidth: 1,
136
+ borderColor: theme.colors.primary,
137
+ },
138
+ buttonContained: {
139
+ backgroundColor: theme.colors.primary,
140
+ },
141
+ buttonDisabled: {
142
+ opacity: 0.6,
143
+ },
144
+ buttonContent: {
145
+ flexDirection: 'row',
146
+ alignItems: 'center',
147
+ justifyContent: 'center',
148
+ },
149
+ text: {
150
+ fontFamily: fontFamilies.interSemiBold,
151
+ fontWeight: Platform.OS === 'web' ? '600' : undefined,
152
+ fontSize: 16,
153
+ marginLeft: 10,
154
+ },
155
+ textDefault: {
156
+ color: theme.colors.text,
157
+ },
158
+ textOutline: {
159
+ color: theme.colors.primary,
160
+ },
161
+ textContained: {
162
+ color: '#FFFFFF',
163
+ },
164
+ textDisabled: {
165
+ color: theme.colors.textTertiary,
166
+ },
167
+ }), [theme]);
168
+
108
169
  // Don't show the button if already authenticated (unless explicitly overridden)
109
170
  if (isAuthenticated && !showWhenAuthenticated) return null;
110
171
 
@@ -114,11 +175,11 @@ export const OxySignInButton: React.FC<OxySignInButtonProps> = ({
114
175
  const getButtonStyle = () => {
115
176
  switch (variant) {
116
177
  case 'outline':
117
- return [styles.buttonOutline, style];
178
+ return [themedStyles.buttonOutline, style];
118
179
  case 'contained':
119
- return [styles.buttonContained, style];
180
+ return [themedStyles.buttonContained, style];
120
181
  default:
121
- return [styles.buttonDefault, style];
182
+ return [themedStyles.buttonDefault, style];
122
183
  }
123
184
  };
124
185
 
@@ -126,29 +187,29 @@ export const OxySignInButton: React.FC<OxySignInButtonProps> = ({
126
187
  const getTextStyle = () => {
127
188
  switch (variant) {
128
189
  case 'outline':
129
- return [styles.textOutline, textStyle];
190
+ return [themedStyles.textOutline, textStyle];
130
191
  case 'contained':
131
- return [styles.textContained, textStyle];
192
+ return [themedStyles.textContained, textStyle];
132
193
  default:
133
- return [styles.textDefault, textStyle];
194
+ return [themedStyles.textDefault, textStyle];
134
195
  }
135
196
  };
136
197
 
137
198
  return (
138
199
  <TouchableOpacity
139
- style={[styles.button, getButtonStyle(), isButtonDisabled && styles.buttonDisabled]}
200
+ style={[themedStyles.button, getButtonStyle(), isButtonDisabled && themedStyles.buttonDisabled]}
140
201
  onPress={handlePress}
141
202
  disabled={isButtonDisabled}
142
203
  >
143
- <View style={styles.buttonContent}>
204
+ <View style={themedStyles.buttonContent}>
144
205
  <OxyLogo
145
206
  variant="icon"
146
207
  size={20}
147
- fillColor={variant === 'contained' ? 'white' : '#d269e6'}
148
- innerFillColor={variant === 'contained' ? '#d269e6' : undefined}
208
+ fillColor={variant === 'contained' ? 'white' : theme.colors.primary}
209
+ innerFillColor={variant === 'contained' ? theme.colors.primary : undefined}
149
210
  style={isButtonDisabled ? { opacity: 0.6 } : undefined}
150
211
  />
151
- <Text style={[styles.text, getTextStyle(), isButtonDisabled && styles.textDisabled]}>
212
+ <Text style={[themedStyles.text, getTextStyle(), isButtonDisabled && themedStyles.textDisabled]}>
152
213
  {isLoading || isModalOpen ? 'Signing in...' : text}
153
214
  </Text>
154
215
  </View>
@@ -156,64 +217,4 @@ export const OxySignInButton: React.FC<OxySignInButtonProps> = ({
156
217
  );
157
218
  };
158
219
 
159
- const styles = StyleSheet.create({
160
- button: {
161
- padding: 14,
162
- borderRadius: 35,
163
- alignItems: 'center',
164
- justifyContent: 'center',
165
- },
166
- buttonDefault: {
167
- backgroundColor: '#FFFFFF',
168
- borderWidth: 1,
169
- borderColor: '#DDDDDD',
170
- ...Platform.select({
171
- web: {
172
- boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
173
- },
174
- default: {
175
- shadowColor: '#000000',
176
- shadowOffset: { width: 0, height: 2 },
177
- shadowOpacity: 0.1,
178
- shadowRadius: 4,
179
- elevation: 2,
180
- }
181
- }),
182
- },
183
- buttonOutline: {
184
- backgroundColor: 'transparent',
185
- borderWidth: 1,
186
- borderColor: '#d169e5',
187
- },
188
- buttonContained: {
189
- backgroundColor: '#d169e5',
190
- },
191
- buttonDisabled: {
192
- opacity: 0.6,
193
- },
194
- buttonContent: {
195
- flexDirection: 'row',
196
- alignItems: 'center',
197
- justifyContent: 'center',
198
- },
199
- text: {
200
- fontFamily: fontFamilies.interSemiBold,
201
- fontWeight: Platform.OS === 'web' ? '600' : undefined,
202
- fontSize: 16,
203
- marginLeft: 10,
204
- },
205
- textDefault: {
206
- color: '#333333',
207
- },
208
- textOutline: {
209
- color: '#d169e5',
210
- },
211
- textContained: {
212
- color: '#FFFFFF',
213
- },
214
- textDisabled: {
215
- color: '#888888',
216
- },
217
- });
218
-
219
220
  export default OxySignInButton;
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import { View, Text, Switch, StyleSheet } from 'react-native';
3
+ import { useTheme } from '@oxyhq/bloom/theme';
3
4
 
4
5
  export interface SettingRowProps {
5
6
  title: string;
@@ -10,9 +11,9 @@ export interface SettingRowProps {
10
11
  textColor?: string;
11
12
  mutedTextColor?: string;
12
13
  borderColor?: string;
13
- /** Active color for the switch track (default: #d169e5) */
14
+ /** Active color for the switch track */
14
15
  activeColor?: string;
15
- /** Inactive color for the switch track (default: #767577) */
16
+ /** Inactive color for the switch track */
16
17
  inactiveColor?: string;
17
18
  /** Accessibility label for the switch */
18
19
  accessibilityLabel?: string;
@@ -31,10 +32,17 @@ const SettingRow: React.FC<SettingRowProps> = ({
31
32
  textColor,
32
33
  mutedTextColor,
33
34
  borderColor,
34
- activeColor = '#d169e5',
35
- inactiveColor = '#767577',
35
+ activeColor,
36
+ inactiveColor,
36
37
  accessibilityLabel,
37
38
  }) => {
39
+ const theme = useTheme();
40
+
41
+ const resolvedActiveColor = activeColor ?? theme.colors.primary;
42
+ const resolvedInactiveColor = inactiveColor ?? theme.colors.textTertiary;
43
+ const thumbOn = theme.colors.background;
44
+ const thumbOff = theme.colors.backgroundSecondary;
45
+
38
46
  return (
39
47
  <View
40
48
  style={[styles.settingRow, borderColor ? { borderBottomColor: borderColor } : undefined]}
@@ -60,8 +68,8 @@ const SettingRow: React.FC<SettingRowProps> = ({
60
68
  value={value}
61
69
  onValueChange={onValueChange}
62
70
  disabled={disabled}
63
- trackColor={{ false: inactiveColor, true: activeColor }}
64
- thumbColor={value ? '#fff' : '#f4f3f4'}
71
+ trackColor={{ false: resolvedInactiveColor, true: resolvedActiveColor }}
72
+ thumbColor={value ? thumbOn : thumbOff}
65
73
  accessibilityRole="switch"
66
74
  accessibilityLabel={accessibilityLabel || title}
67
75
  accessibilityState={{ checked: value, disabled }}
@@ -95,4 +103,3 @@ const styles = StyleSheet.create({
95
103
  });
96
104
 
97
105
  export default React.memo(SettingRow);
98
-
@@ -1,138 +1,108 @@
1
1
  import type React from 'react';
2
- import { View, Text, TouchableOpacity, Modal, ScrollView } from 'react-native';
2
+ import { View, Text } from 'react-native';
3
3
  import { Ionicons } from '@expo/vector-icons';
4
+ import * as Dialog from '@oxyhq/bloom/dialog';
5
+ import type { DialogControlProps } from '@oxyhq/bloom/dialog';
6
+ import * as Prompt from '@oxyhq/bloom/prompt';
4
7
  import { useTheme } from '@oxyhq/bloom/theme';
5
8
  import type { FileMetadata } from '@oxyhq/core';
6
9
  import { formatFileSize, getFileIcon } from '../../utils/fileManagement';
7
10
  import { fileManagementStyles } from './styles';
8
11
 
9
12
  interface FileDetailsModalProps {
10
- visible: boolean;
13
+ control: DialogControlProps;
11
14
  file: FileMetadata | null;
12
- onClose: () => void;
13
15
  onDownload: (fileId: string, filename: string) => void;
14
16
  onDelete: (fileId: string, filename: string) => void;
15
17
  isOwner: boolean;
16
- /** @deprecated No longer used. Colors are sourced from useTheme() internally. */
17
- themeStyles?: unknown;
18
+ onClose?: () => void;
18
19
  }
19
20
 
20
21
  export const FileDetailsModal: React.FC<FileDetailsModalProps> = ({
21
- visible,
22
+ control,
22
23
  file,
23
- onClose,
24
24
  onDownload,
25
25
  onDelete,
26
26
  isOwner,
27
+ onClose,
27
28
  }) => {
28
29
  const { colors } = useTheme();
29
30
 
30
31
  if (!file) return null;
31
32
 
32
33
  return (
33
- <Modal
34
- visible={visible}
35
- animationType="slide"
36
- presentationStyle="pageSheet"
37
- onRequestClose={onClose}
38
- >
39
- <View style={[fileManagementStyles.modalContainer, { backgroundColor: colors.background }]}>
40
- <View className="border-b border-border" style={fileManagementStyles.modalHeader}>
41
- <TouchableOpacity
42
- style={fileManagementStyles.modalCloseButton}
43
- onPress={onClose}
44
- >
45
- <Ionicons name="close" size={24} color={colors.text} />
46
- </TouchableOpacity>
47
- <Text className="text-foreground" style={fileManagementStyles.modalTitle}>File Details</Text>
48
- <View style={fileManagementStyles.modalPlaceholder} />
49
- </View>
34
+ <Dialog.Outer control={control} onClose={onClose}>
35
+ <Dialog.Handle />
36
+ <Dialog.ScrollableInner label="File Details">
37
+ <View className="bg-secondary border-border" style={fileManagementStyles.fileDetailCard}>
38
+ <View style={fileManagementStyles.fileDetailIcon}>
39
+ <Ionicons
40
+ name={getFileIcon(file.contentType) as React.ComponentProps<typeof Ionicons>['name']}
41
+ size={64}
42
+ color={colors.primary}
43
+ />
44
+ </View>
50
45
 
51
- <ScrollView style={fileManagementStyles.modalContent}>
52
- <View className="bg-secondary border-border" style={fileManagementStyles.fileDetailCard}>
53
- <View style={fileManagementStyles.fileDetailIcon}>
54
- <Ionicons
55
- name={getFileIcon(file.contentType) as React.ComponentProps<typeof Ionicons>['name']}
56
- size={64}
57
- color={colors.primary}
58
- />
59
- </View>
46
+ <Text className="text-foreground" style={fileManagementStyles.fileDetailName}>
47
+ {file.filename}
48
+ </Text>
60
49
 
61
- <Text className="text-foreground" style={fileManagementStyles.fileDetailName}>
62
- {file.filename}
63
- </Text>
50
+ <View style={fileManagementStyles.fileDetailInfo}>
51
+ <View style={fileManagementStyles.detailRow}>
52
+ <Text className="text-muted-foreground" style={fileManagementStyles.detailLabel}>
53
+ Size:
54
+ </Text>
55
+ <Text className="text-foreground" style={fileManagementStyles.detailValue}>
56
+ {formatFileSize(file.length)}
57
+ </Text>
58
+ </View>
64
59
 
65
- <View style={fileManagementStyles.fileDetailInfo}>
66
- <View style={fileManagementStyles.detailRow}>
67
- <Text className="text-muted-foreground" style={fileManagementStyles.detailLabel}>
68
- Size:
69
- </Text>
70
- <Text className="text-foreground" style={fileManagementStyles.detailValue}>
71
- {formatFileSize(file.length)}
72
- </Text>
73
- </View>
60
+ <View style={fileManagementStyles.detailRow}>
61
+ <Text className="text-muted-foreground" style={fileManagementStyles.detailLabel}>
62
+ Type:
63
+ </Text>
64
+ <Text className="text-foreground" style={fileManagementStyles.detailValue}>
65
+ {file.contentType}
66
+ </Text>
67
+ </View>
74
68
 
75
- <View style={fileManagementStyles.detailRow}>
76
- <Text className="text-muted-foreground" style={fileManagementStyles.detailLabel}>
77
- Type:
78
- </Text>
79
- <Text className="text-foreground" style={fileManagementStyles.detailValue}>
80
- {file.contentType}
81
- </Text>
82
- </View>
69
+ <View style={fileManagementStyles.detailRow}>
70
+ <Text className="text-muted-foreground" style={fileManagementStyles.detailLabel}>
71
+ Uploaded:
72
+ </Text>
73
+ <Text className="text-foreground" style={fileManagementStyles.detailValue}>
74
+ {new Date(file.uploadDate).toLocaleString()}
75
+ </Text>
76
+ </View>
83
77
 
78
+ {file.metadata?.description && (
84
79
  <View style={fileManagementStyles.detailRow}>
85
80
  <Text className="text-muted-foreground" style={fileManagementStyles.detailLabel}>
86
- Uploaded:
81
+ Description:
87
82
  </Text>
88
83
  <Text className="text-foreground" style={fileManagementStyles.detailValue}>
89
- {new Date(file.uploadDate).toLocaleString()}
84
+ {file.metadata.description}
90
85
  </Text>
91
86
  </View>
92
-
93
- {file.metadata?.description && (
94
- <View style={fileManagementStyles.detailRow}>
95
- <Text className="text-muted-foreground" style={fileManagementStyles.detailLabel}>
96
- Description:
97
- </Text>
98
- <Text className="text-foreground" style={fileManagementStyles.detailValue}>
99
- {file.metadata.description}
100
- </Text>
101
- </View>
102
- )}
103
- </View>
104
-
105
- <View style={fileManagementStyles.modalActions}>
106
- <TouchableOpacity
107
- className="bg-primary"
108
- style={fileManagementStyles.modalActionButton}
109
- onPress={() => {
110
- onDownload(file.id, file.filename);
111
- onClose();
112
- }}
113
- >
114
- <Ionicons name="download" size={20} color="#FFFFFF" />
115
- <Text style={fileManagementStyles.modalActionText}>Download</Text>
116
- </TouchableOpacity>
117
-
118
- {isOwner && (
119
- <TouchableOpacity
120
- className="bg-destructive"
121
- style={fileManagementStyles.modalActionButton}
122
- onPress={() => {
123
- onClose();
124
- onDelete(file.id, file.filename);
125
- }}
126
- >
127
- <Ionicons name="trash" size={20} color="#FFFFFF" />
128
- <Text style={fileManagementStyles.modalActionText}>Delete</Text>
129
- </TouchableOpacity>
130
- )}
131
- </View>
87
+ )}
132
88
  </View>
133
- </ScrollView>
134
- </View>
135
- </Modal>
89
+
90
+ <Prompt.Actions>
91
+ <Prompt.Action
92
+ onPress={() => onDownload(file.id, file.filename)}
93
+ cta="Download"
94
+ color="primary"
95
+ />
96
+ {isOwner && (
97
+ <Prompt.Action
98
+ onPress={() => onDelete(file.id, file.filename)}
99
+ cta="Delete"
100
+ color="negative"
101
+ />
102
+ )}
103
+ </Prompt.Actions>
104
+ </View>
105
+ </Dialog.ScrollableInner>
106
+ </Dialog.Outer>
136
107
  );
137
108
  };
138
-
@@ -1,7 +1,10 @@
1
1
  import type React from 'react';
2
- import { View, Text, TouchableOpacity, Modal, ScrollView } from 'react-native';
2
+ import { View, Text, TouchableOpacity, ScrollView } from 'react-native';
3
3
  import { Image as ExpoImage } from 'expo-image';
4
4
  import { Ionicons } from '@expo/vector-icons';
5
+ import * as Dialog from '@oxyhq/bloom/dialog';
6
+ import type { DialogControlProps } from '@oxyhq/bloom/dialog';
7
+ import * as Prompt from '@oxyhq/bloom/prompt';
5
8
  import { useTheme } from '@oxyhq/bloom/theme';
6
9
  import { formatFileSize, getFileIcon } from '../../utils/fileManagement';
7
10
  import { fileManagementStyles } from './styles';
@@ -15,14 +18,12 @@ interface PendingFile {
15
18
  }
16
19
 
17
20
  interface UploadPreviewProps {
18
- visible: boolean;
21
+ control?: DialogControlProps;
19
22
  pendingFiles: PendingFile[];
20
23
  onConfirm: () => void;
21
24
  onCancel: () => void;
22
25
  onRemoveFile: (index: number) => void;
23
- inline?: boolean; // New prop to support inline rendering without Modal
24
- /** @deprecated No longer used. Colors are sourced from useTheme() internally. */
25
- themeStyles?: unknown;
26
+ inline?: boolean;
26
27
  }
27
28
 
28
29
  const UploadPreviewContent: React.FC<{
@@ -30,11 +31,13 @@ const UploadPreviewContent: React.FC<{
30
31
  onConfirm: () => void;
31
32
  onCancel: () => void;
32
33
  onRemoveFile: (index: number) => void;
34
+ showActions?: boolean;
33
35
  }> = ({
34
36
  pendingFiles,
35
37
  onConfirm,
36
38
  onCancel,
37
39
  onRemoveFile,
40
+ showActions = true,
38
41
  }) => {
39
42
  const { colors, isDark } = useTheme();
40
43
  const totalSize = pendingFiles.reduce((sum, f) => sum + f.size, 0);
@@ -66,7 +69,7 @@ const UploadPreviewContent: React.FC<{
66
69
  contentFit="cover"
67
70
  />
68
71
  ) : (
69
- <View style={[fileManagementStyles.uploadPreviewIconContainer, { backgroundColor: isDark ? '#333333' : '#F0F0F0' }]}>
72
+ <View style={[fileManagementStyles.uploadPreviewIconContainer, { backgroundColor: colors.backgroundSecondary }]}>
70
73
  <Ionicons
71
74
  name={getFileIcon(pendingFile.type) as React.ComponentProps<typeof Ionicons>['name']}
72
75
  size={32}
@@ -102,44 +105,45 @@ const UploadPreviewContent: React.FC<{
102
105
  {formatFileSize(totalSize)}
103
106
  </Text>
104
107
  </View>
105
- <View style={fileManagementStyles.uploadPreviewActions}>
106
- <TouchableOpacity
107
- className="border-border"
108
- style={[
109
- fileManagementStyles.uploadPreviewCancelButton,
110
- { backgroundColor: 'transparent' }
111
- ]}
112
- onPress={onCancel}
113
- >
114
- <Text className="text-foreground" style={fileManagementStyles.uploadPreviewCancelText}>
115
- Cancel
116
- </Text>
117
- </TouchableOpacity>
118
- <TouchableOpacity
119
- className="bg-primary"
120
- style={fileManagementStyles.uploadPreviewConfirmButton}
121
- onPress={onConfirm}
122
- >
123
- <Ionicons name="cloud-upload" size={20} color="#FFFFFF" />
124
- <Text style={fileManagementStyles.uploadPreviewConfirmText}>Upload</Text>
125
- </TouchableOpacity>
126
- </View>
108
+ {showActions && (
109
+ <View style={fileManagementStyles.uploadPreviewActions}>
110
+ <TouchableOpacity
111
+ className="border-border"
112
+ style={[
113
+ fileManagementStyles.uploadPreviewCancelButton,
114
+ { backgroundColor: 'transparent' }
115
+ ]}
116
+ onPress={onCancel}
117
+ >
118
+ <Text className="text-foreground" style={fileManagementStyles.uploadPreviewCancelText}>
119
+ Cancel
120
+ </Text>
121
+ </TouchableOpacity>
122
+ <TouchableOpacity
123
+ className="bg-primary"
124
+ style={fileManagementStyles.uploadPreviewConfirmButton}
125
+ onPress={onConfirm}
126
+ >
127
+ <Ionicons name="cloud-upload" size={20} color="#FFFFFF" />
128
+ <Text style={fileManagementStyles.uploadPreviewConfirmText}>Upload</Text>
129
+ </TouchableOpacity>
130
+ </View>
131
+ )}
127
132
  </View>
128
133
  </View>
129
134
  );
130
135
  };
131
136
 
132
137
  export const UploadPreview: React.FC<UploadPreviewProps> = ({
133
- visible,
138
+ control,
134
139
  pendingFiles,
135
140
  onConfirm,
136
141
  onCancel,
137
142
  onRemoveFile,
138
143
  inline = false,
139
144
  }) => {
140
- // If inline mode, render content directly without Modal
145
+ // Inline mode: render content directly without Dialog
141
146
  if (inline) {
142
- if (!visible) return null;
143
147
  return (
144
148
  <UploadPreviewContent
145
149
  pendingFiles={pendingFiles}
@@ -150,21 +154,29 @@ export const UploadPreview: React.FC<UploadPreviewProps> = ({
150
154
  );
151
155
  }
152
156
 
153
- // Default: render with Modal (for backward compatibility)
157
+ // Dialog mode: requires control prop
158
+ if (!control) return null;
159
+
154
160
  return (
155
- <Modal
156
- visible={visible}
157
- animationType="slide"
158
- presentationStyle="pageSheet"
159
- onRequestClose={onCancel}
160
- >
161
- <UploadPreviewContent
162
- pendingFiles={pendingFiles}
163
- onConfirm={onConfirm}
164
- onCancel={onCancel}
165
- onRemoveFile={onRemoveFile}
166
- />
167
- </Modal>
161
+ <Dialog.Outer control={control} onClose={onCancel}>
162
+ <Dialog.Handle />
163
+ <Dialog.ScrollableInner label="Review Files">
164
+ <UploadPreviewContent
165
+ pendingFiles={pendingFiles}
166
+ onConfirm={onConfirm}
167
+ onCancel={onCancel}
168
+ onRemoveFile={onRemoveFile}
169
+ showActions={false}
170
+ />
171
+ <Prompt.Actions>
172
+ <Prompt.Action
173
+ onPress={onConfirm}
174
+ cta="Upload"
175
+ color="primary"
176
+ />
177
+ <Prompt.Cancel cta="Cancel" />
178
+ </Prompt.Actions>
179
+ </Dialog.ScrollableInner>
180
+ </Dialog.Outer>
168
181
  );
169
182
  };
170
-