@onairos/react-native 3.7.2 → 3.7.3
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/lib/commonjs/api/index.js +219 -9
- package/lib/commonjs/components/BodyText.js +27 -9
- package/lib/commonjs/components/BrandMark.js +111 -10
- package/lib/commonjs/components/CodeInput.js +116 -9
- package/lib/commonjs/components/EmailInput.js +30 -8
- package/lib/commonjs/components/GoogleButton.js +56 -9
- package/lib/commonjs/components/HeadingGroup.js +43 -9
- package/lib/commonjs/components/LLMDataInputModal.js +664 -14
- package/lib/commonjs/components/ModalHeader.js +99 -9
- package/lib/commonjs/components/ModalSheet.js +47 -9
- package/lib/commonjs/components/Onairos.js +380 -14
- package/lib/commonjs/components/OnairosButton.js +313 -13
- package/lib/commonjs/components/OnairosSignInButton.js +130 -12
- package/lib/commonjs/components/Overlay.js +465 -13
- package/lib/commonjs/components/PersonaImage.js +137 -10
- package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
- package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
- package/lib/commonjs/components/PinCreationScreen.js +403 -12
- package/lib/commonjs/components/PinInput.js +464 -9
- package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
- package/lib/commonjs/components/PlatformList.js +137 -10
- package/lib/commonjs/components/PlatformToggle.js +180 -9
- package/lib/commonjs/components/PrimaryButton.js +180 -10
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
- package/lib/commonjs/components/SignInStep.js +345 -12
- package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
- package/lib/commonjs/components/VerificationStep.js +176 -11
- package/lib/commonjs/components/WelcomeScreen.js +461 -22
- package/lib/commonjs/components/icons/Basicproficon.js +37 -8
- package/lib/commonjs/components/icons/Basicprofile.js +21 -8
- package/lib/commonjs/components/icons/Checkbox.js +21 -8
- package/lib/commonjs/components/icons/Checkmark.js +27 -8
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
- package/lib/commonjs/components/icons/Contenticon.js +39 -8
- package/lib/commonjs/components/icons/EnochE.js +41 -8
- package/lib/commonjs/components/icons/Personalityicon.js +30 -8
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
- package/lib/commonjs/components/icons/Userpreferences.js +21 -8
- package/lib/commonjs/components/icons/index.js +84 -17
- package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
- package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
- package/lib/commonjs/components/onboarding/PinInput.js +283 -10
- package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
- package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
- package/lib/commonjs/config/api.js +56 -7
- package/lib/commonjs/constants/index.js +120 -7
- package/lib/commonjs/context/AuthContext.js +345 -10
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
- package/lib/commonjs/hooks/useConnections.js +102 -8
- package/lib/commonjs/hooks/useCredentials.js +178 -10
- package/lib/commonjs/hooks/useUserConnections.js +148 -10
- package/lib/commonjs/index.js +439 -34
- package/lib/commonjs/services/apiClient.js +298 -8
- package/lib/commonjs/services/biometricPinService.js +180 -8
- package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
- package/lib/commonjs/services/chatGPTConversationService.js +275 -9
- package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
- package/lib/commonjs/services/claudeConversationService.js +158 -9
- package/lib/commonjs/services/connectedAccountsService.js +310 -10
- package/lib/commonjs/services/googleAuthService.js +252 -11
- package/lib/commonjs/services/hingeDataExtractor.js +105 -8
- package/lib/commonjs/services/hingeDataService.js +150 -9
- package/lib/commonjs/services/imageCompressionService.js +260 -7
- package/lib/commonjs/services/instagramDataExtractor.js +126 -8
- package/lib/commonjs/services/instagramDataService.js +163 -9
- package/lib/commonjs/services/jwtStorageService.js +276 -7
- package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
- package/lib/commonjs/services/linkedinProfileService.js +222 -9
- package/lib/commonjs/services/linkedinScrapingService.js +230 -8
- package/lib/commonjs/services/llmDataStorage.js +294 -8
- package/lib/commonjs/services/mobileTrainingService.js +186 -8
- package/lib/commonjs/services/netflixDataExtractor.js +120 -8
- package/lib/commonjs/services/netflixDataService.js +198 -9
- package/lib/commonjs/services/pinEncryptionService.js +84 -8
- package/lib/commonjs/services/pinStorageUtils.js +105 -7
- package/lib/commonjs/services/platformAuthService.js +1484 -12
- package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
- package/lib/commonjs/services/sephoraDataService.js +200 -9
- package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
- package/lib/commonjs/services/spotifyDataService.js +241 -9
- package/lib/commonjs/services/storageService.js +404 -8
- package/lib/commonjs/services/telegramDataExtractor.js +115 -8
- package/lib/commonjs/services/telegramDataService.js +499 -9
- package/lib/commonjs/services/trainingApiHelpers.js +73 -7
- package/lib/commonjs/services/userConnectionsService.js +340 -10
- package/lib/commonjs/services/youtubeMigrationService.js +416 -10
- package/lib/commonjs/theme/index.js +250 -7
- package/lib/commonjs/types/ambient.d.js +2 -1
- package/lib/commonjs/types/declarations.d.js +2 -1
- package/lib/commonjs/types/index.js +6 -1
- package/lib/commonjs/types/node-fix.d.js +2 -1
- package/lib/commonjs/types/node-override.d.js +2 -1
- package/lib/commonjs/types/opacity.d.js +2 -1
- package/lib/commonjs/types.js +14 -1
- package/lib/commonjs/utils/Portal.js +98 -8
- package/lib/commonjs/utils/api.js +130 -9
- package/lib/commonjs/utils/assetRegistry.js +210 -35
- package/lib/commonjs/utils/auth.js +112 -9
- package/lib/commonjs/utils/connectorTests.js +613 -29
- package/lib/commonjs/utils/crypto.js +62 -8
- package/lib/commonjs/utils/debugHelper.js +64 -1
- package/lib/commonjs/utils/encryption.js +76 -7
- package/lib/commonjs/utils/eventUtils.js +288 -1
- package/lib/commonjs/utils/haptics.js +66 -9
- package/lib/commonjs/utils/imagePreloader.js +6 -1
- package/lib/commonjs/utils/networkDiagnostics.js +226 -8
- package/lib/commonjs/utils/onairosApi.js +350 -9
- package/lib/commonjs/utils/programmaticFlow.js +117 -9
- package/lib/commonjs/utils/retryHelper.js +220 -1
- package/lib/commonjs/utils/secureStorage.js +349 -10
- package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
- package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
- package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
- package/lib/commonjs/utils/webviewScripts/index.js +698 -15
- package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
- package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
- package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
- package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
- package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
- package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
- package/lib/module/api/index.js +211 -1
- package/lib/module/components/BodyText.js +20 -1
- package/lib/module/components/BrandMark.js +104 -1
- package/lib/module/components/CodeInput.js +109 -1
- package/lib/module/components/EmailInput.js +23 -1
- package/lib/module/components/GoogleButton.js +49 -1
- package/lib/module/components/HeadingGroup.js +36 -1
- package/lib/module/components/LLMDataInputModal.js +656 -7
- package/lib/module/components/ModalHeader.js +92 -1
- package/lib/module/components/ModalSheet.js +39 -1
- package/lib/module/components/Onairos.js +373 -1
- package/lib/module/components/OnairosButton.js +305 -1
- package/lib/module/components/OnairosSignInButton.js +121 -1
- package/lib/module/components/Overlay.js +456 -1
- package/lib/module/components/PersonaImage.js +129 -1
- package/lib/module/components/PersonaLoadingScreen.js +310 -1
- package/lib/module/components/PersonalizationConsentScreen.js +460 -1
- package/lib/module/components/PinCreationScreen.js +396 -1
- package/lib/module/components/PinInput.js +456 -1
- package/lib/module/components/PlatformConnectorsStep.js +1302 -6
- package/lib/module/components/PlatformList.js +129 -1
- package/lib/module/components/PlatformToggle.js +173 -1
- package/lib/module/components/PrimaryButton.js +172 -1
- package/lib/module/components/SignInMatchAnimation.js +189 -1
- package/lib/module/components/SignInStep.js +338 -1
- package/lib/module/components/UniversalOnboarding.js +2770 -1
- package/lib/module/components/VerificationStep.js +168 -1
- package/lib/module/components/WelcomeScreen.js +453 -1
- package/lib/module/components/icons/Basicproficon.js +30 -1
- package/lib/module/components/icons/Basicprofile.js +14 -1
- package/lib/module/components/icons/Checkbox.js +14 -1
- package/lib/module/components/icons/Checkmark.js +20 -1
- package/lib/module/components/icons/Contentanalysis.js +14 -1
- package/lib/module/components/icons/Contenticon.js +32 -1
- package/lib/module/components/icons/EnochE.js +34 -1
- package/lib/module/components/icons/Personalityicon.js +23 -1
- package/lib/module/components/icons/Personalityprofile.js +14 -1
- package/lib/module/components/icons/Personalitytraits.js +14 -1
- package/lib/module/components/icons/Userpreferences.js +14 -1
- package/lib/module/components/icons/index.js +13 -1
- package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
- package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
- package/lib/module/components/onboarding/PinInput.js +274 -1
- package/lib/module/components/onboarding/PlatformConnector.js +240 -1
- package/lib/module/config/PLATFORM_APIS.md +849 -0
- package/lib/module/config/api.js +47 -1
- package/lib/module/constants/index.js +114 -1
- package/lib/module/context/AuthContext.js +335 -1
- package/lib/module/hooks/useConnectedAccounts.js +106 -1
- package/lib/module/hooks/useConnections.js +95 -1
- package/lib/module/hooks/useCredentials.js +171 -6
- package/lib/module/hooks/useUserConnections.js +140 -1
- package/lib/module/index.js +172 -1
- package/lib/module/services/apiClient.js +295 -1
- package/lib/module/services/biometricPinService.js +169 -1
- package/lib/module/services/chatGPTConversationExtractor.js +149 -1
- package/lib/module/services/chatGPTConversationService.js +268 -1
- package/lib/module/services/claudeConversationExtractor.js +97 -1
- package/lib/module/services/claudeConversationService.js +151 -1
- package/lib/module/services/connectedAccountsService.js +293 -1
- package/lib/module/services/googleAuthService.js +241 -1
- package/lib/module/services/hingeDataExtractor.js +99 -1
- package/lib/module/services/hingeDataService.js +143 -1
- package/lib/module/services/imageCompressionService.js +250 -1
- package/lib/module/services/instagramDataExtractor.js +120 -1
- package/lib/module/services/instagramDataService.js +156 -1
- package/lib/module/services/jwtStorageService.js +257 -1
- package/lib/module/services/linkedinDOMExtractor.js +234 -1
- package/lib/module/services/linkedinProfileService.js +210 -1
- package/lib/module/services/linkedinScrapingService.js +219 -1
- package/lib/module/services/llmDataStorage.js +277 -1
- package/lib/module/services/mobileTrainingService.js +173 -1
- package/lib/module/services/netflixDataExtractor.js +114 -1
- package/lib/module/services/netflixDataService.js +191 -1
- package/lib/module/services/pinEncryptionService.js +74 -6
- package/lib/module/services/pinStorageUtils.js +93 -1
- package/lib/module/services/platformAuthService.js +1461 -1
- package/lib/module/services/sephoraDataExtractor.js +134 -1
- package/lib/module/services/sephoraDataService.js +193 -1
- package/lib/module/services/spotifyDataExtractor.js +142 -1
- package/lib/module/services/spotifyDataService.js +234 -1
- package/lib/module/services/storageService.js +383 -1
- package/lib/module/services/telegramDataExtractor.js +109 -1
- package/lib/module/services/telegramDataService.js +493 -1
- package/lib/module/services/trainingApiHelpers.js +67 -1
- package/lib/module/services/userConnectionsService.js +329 -1
- package/lib/module/services/youtubeMigrationService.js +405 -1
- package/lib/module/theme/index.js +245 -1
- package/lib/module/types.js +10 -1
- package/lib/module/utils/Portal.js +90 -1
- package/lib/module/utils/api.js +118 -1
- package/lib/module/utils/assetRegistry.js +200 -34
- package/lib/module/utils/auth.js +100 -1
- package/lib/module/utils/connectorTests.js +600 -27
- package/lib/module/utils/crypto.js +54 -1
- package/lib/module/utils/debugHelper.js +54 -1
- package/lib/module/utils/encryption.js +67 -1
- package/lib/module/utils/eventUtils.js +270 -1
- package/lib/module/utils/haptics.js +59 -8
- package/lib/module/utils/imagePreloader.js +3 -1
- package/lib/module/utils/networkDiagnostics.js +217 -1
- package/lib/module/utils/onairosApi.js +333 -1
- package/lib/module/utils/programmaticFlow.js +111 -1
- package/lib/module/utils/retryHelper.js +211 -1
- package/lib/module/utils/secureStorage.js +330 -6
- package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
- package/lib/module/utils/webviewScripts/claude.js +370 -1
- package/lib/module/utils/webviewScripts/hinge.js +405 -1
- package/lib/module/utils/webviewScripts/index.js +434 -1
- package/lib/module/utils/webviewScripts/instagram.js +448 -1
- package/lib/module/utils/webviewScripts/linkedin.js +874 -1
- package/lib/module/utils/webviewScripts/netflix.js +376 -1
- package/lib/module/utils/webviewScripts/sephora.js +510 -1
- package/lib/module/utils/webviewScripts/spotify.js +413 -1
- package/lib/module/utils/webviewScripts/telegram.js +672 -1
- package/package.json +2 -2
|
@@ -1 +1,129 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, StyleSheet, TouchableOpacity, ActivityIndicator } from 'react-native';
|
|
3
|
+
import Icon from 'react-native-vector-icons/MaterialIcons';
|
|
4
|
+
import { COLORS, PLATFORMS } from '../constants';
|
|
5
|
+
export const PlatformList = ({
|
|
6
|
+
connections,
|
|
7
|
+
onToggle,
|
|
8
|
+
isLoading,
|
|
9
|
+
canProceed,
|
|
10
|
+
onProceed
|
|
11
|
+
}) => {
|
|
12
|
+
const renderPlatformItem = (platform, isConnected) => {
|
|
13
|
+
const platformConfig = PLATFORMS[platform];
|
|
14
|
+
if (!platformConfig) return null;
|
|
15
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
16
|
+
key: platform,
|
|
17
|
+
style: styles.platformContainer
|
|
18
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
19
|
+
style: styles.platformHeader
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
21
|
+
name: platformConfig.icon,
|
|
22
|
+
size: 24,
|
|
23
|
+
color: platformConfig.color
|
|
24
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
25
|
+
style: styles.platformName
|
|
26
|
+
}, platformConfig.name)), platformConfig.description && /*#__PURE__*/React.createElement(Text, {
|
|
27
|
+
style: styles.platformDescription
|
|
28
|
+
}, platformConfig.description), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
29
|
+
style: [styles.connectButton, isConnected ? styles.connectedButton : styles.disconnectedButton],
|
|
30
|
+
onPress: () => onToggle(platform, !isConnected),
|
|
31
|
+
disabled: isLoading
|
|
32
|
+
}, isLoading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
33
|
+
color: "#fff"
|
|
34
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
35
|
+
style: styles.buttonText
|
|
36
|
+
}, isConnected ? 'Disconnect' : 'Connect')));
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
39
|
+
style: styles.container
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
41
|
+
style: styles.title
|
|
42
|
+
}, "Connect your platforms"), /*#__PURE__*/React.createElement(Text, {
|
|
43
|
+
style: styles.subtitle
|
|
44
|
+
}, "Connect at least 2 platforms to proceed"), /*#__PURE__*/React.createElement(View, {
|
|
45
|
+
style: styles.platformsList
|
|
46
|
+
}, Object.entries(connections).map(([platform, status]) => renderPlatformItem(platform, !!status))), /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
47
|
+
style: [styles.proceedButton, !canProceed && styles.disabledButton],
|
|
48
|
+
onPress: onProceed,
|
|
49
|
+
disabled: !canProceed || isLoading
|
|
50
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
51
|
+
style: styles.proceedButtonText
|
|
52
|
+
}, "Proceed")));
|
|
53
|
+
};
|
|
54
|
+
const styles = StyleSheet.create({
|
|
55
|
+
container: {
|
|
56
|
+
flex: 1,
|
|
57
|
+
padding: 16
|
|
58
|
+
},
|
|
59
|
+
title: {
|
|
60
|
+
fontSize: 20,
|
|
61
|
+
fontWeight: '600',
|
|
62
|
+
marginBottom: 8,
|
|
63
|
+
color: COLORS.text.primary
|
|
64
|
+
},
|
|
65
|
+
subtitle: {
|
|
66
|
+
fontSize: 14,
|
|
67
|
+
color: COLORS.text.secondary,
|
|
68
|
+
marginBottom: 24
|
|
69
|
+
},
|
|
70
|
+
platformsList: {
|
|
71
|
+
flex: 1
|
|
72
|
+
},
|
|
73
|
+
platformContainer: {
|
|
74
|
+
backgroundColor: '#fff',
|
|
75
|
+
borderRadius: 12,
|
|
76
|
+
padding: 16,
|
|
77
|
+
marginBottom: 16,
|
|
78
|
+
borderWidth: 1,
|
|
79
|
+
borderColor: COLORS.border
|
|
80
|
+
},
|
|
81
|
+
platformHeader: {
|
|
82
|
+
flexDirection: 'row',
|
|
83
|
+
alignItems: 'center',
|
|
84
|
+
marginBottom: 8
|
|
85
|
+
},
|
|
86
|
+
platformName: {
|
|
87
|
+
fontSize: 16,
|
|
88
|
+
fontWeight: '600',
|
|
89
|
+
marginLeft: 12,
|
|
90
|
+
color: COLORS.text.primary
|
|
91
|
+
},
|
|
92
|
+
platformDescription: {
|
|
93
|
+
fontSize: 14,
|
|
94
|
+
color: COLORS.text.secondary,
|
|
95
|
+
marginBottom: 16
|
|
96
|
+
},
|
|
97
|
+
connectButton: {
|
|
98
|
+
paddingVertical: 8,
|
|
99
|
+
paddingHorizontal: 16,
|
|
100
|
+
borderRadius: 8,
|
|
101
|
+
alignItems: 'center'
|
|
102
|
+
},
|
|
103
|
+
connectedButton: {
|
|
104
|
+
backgroundColor: COLORS.success
|
|
105
|
+
},
|
|
106
|
+
disconnectedButton: {
|
|
107
|
+
backgroundColor: COLORS.primary
|
|
108
|
+
},
|
|
109
|
+
buttonText: {
|
|
110
|
+
color: '#fff',
|
|
111
|
+
fontWeight: '600'
|
|
112
|
+
},
|
|
113
|
+
proceedButton: {
|
|
114
|
+
backgroundColor: COLORS.primary,
|
|
115
|
+
paddingVertical: 16,
|
|
116
|
+
borderRadius: 12,
|
|
117
|
+
alignItems: 'center',
|
|
118
|
+
marginTop: 16
|
|
119
|
+
},
|
|
120
|
+
disabledButton: {
|
|
121
|
+
opacity: 0.5
|
|
122
|
+
},
|
|
123
|
+
proceedButtonText: {
|
|
124
|
+
color: '#fff',
|
|
125
|
+
fontSize: 16,
|
|
126
|
+
fontWeight: '600'
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=PlatformList.js.map
|
|
@@ -1 +1,173 @@
|
|
|
1
|
-
import React from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, Image, StyleSheet, Switch, Platform } from 'react-native';
|
|
3
|
+
import { COLORS } from '../theme';
|
|
4
|
+
const PlatformToggle = ({
|
|
5
|
+
platform,
|
|
6
|
+
isEnabled,
|
|
7
|
+
onToggle,
|
|
8
|
+
compact = false,
|
|
9
|
+
isLast = false,
|
|
10
|
+
fullWidth = false,
|
|
11
|
+
customIconSize,
|
|
12
|
+
onLongPress,
|
|
13
|
+
onPressOut
|
|
14
|
+
}) => {
|
|
15
|
+
const handleToggle = () => {
|
|
16
|
+
onToggle(platform.id, !isEnabled);
|
|
17
|
+
};
|
|
18
|
+
const containerStyle = fullWidth ? styles.fullWidthContainer : compact ? styles.compactContainer : styles.container;
|
|
19
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
20
|
+
style: [containerStyle, !isLast && compact && styles.borderBottom],
|
|
21
|
+
onLongPress: onLongPress,
|
|
22
|
+
onPressOut: onPressOut,
|
|
23
|
+
activeOpacity: onLongPress ? 0.7 : 1.0,
|
|
24
|
+
disabled: !onLongPress
|
|
25
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
26
|
+
style: styles.topRow
|
|
27
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: styles.leftContent
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
30
|
+
source: platform.icon,
|
|
31
|
+
style: customIconSize ? {
|
|
32
|
+
width: customIconSize,
|
|
33
|
+
height: customIconSize,
|
|
34
|
+
marginRight: 12 - (customIconSize - 28) // Reduce margin more to align text properly
|
|
35
|
+
} : fullWidth ? styles.compactIcon : compact ? styles.compactIcon : styles.icon,
|
|
36
|
+
resizeMode: "contain"
|
|
37
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
38
|
+
style: styles.textContent
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
40
|
+
style: fullWidth ? styles.compactPlatformName : compact ? styles.compactPlatformName : styles.platformName
|
|
41
|
+
}, platform.name))), /*#__PURE__*/React.createElement(Switch, {
|
|
42
|
+
value: isEnabled,
|
|
43
|
+
onValueChange: handleToggle,
|
|
44
|
+
trackColor: {
|
|
45
|
+
false: '#E5E5E5',
|
|
46
|
+
true: '#4CD964' // Green when enabled
|
|
47
|
+
},
|
|
48
|
+
thumbColor: Platform.OS === 'ios' ? undefined : isEnabled ? '#FFFFFF' : '#FFFFFF',
|
|
49
|
+
ios_backgroundColor: "#E5E5E5",
|
|
50
|
+
style: compact ? styles.compactSwitch : undefined
|
|
51
|
+
})), fullWidth && /*#__PURE__*/React.createElement(View, {
|
|
52
|
+
style: styles.descriptionBox
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
54
|
+
style: styles.fullWidthDescription
|
|
55
|
+
}, platform.description)), !fullWidth && /*#__PURE__*/React.createElement(Text, {
|
|
56
|
+
style: compact ? styles.compactDescription : styles.description
|
|
57
|
+
}, platform.description));
|
|
58
|
+
};
|
|
59
|
+
const styles = StyleSheet.create({
|
|
60
|
+
container: {
|
|
61
|
+
flexDirection: 'row',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
justifyContent: 'space-between',
|
|
64
|
+
paddingVertical: 16,
|
|
65
|
+
paddingHorizontal: 16,
|
|
66
|
+
backgroundColor: COLORS.surface,
|
|
67
|
+
borderRadius: 12,
|
|
68
|
+
marginBottom: 12,
|
|
69
|
+
borderWidth: 1,
|
|
70
|
+
borderColor: '#E5E5E5'
|
|
71
|
+
},
|
|
72
|
+
compactContainer: {
|
|
73
|
+
flexDirection: 'row',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
justifyContent: 'space-between',
|
|
76
|
+
paddingVertical: 16,
|
|
77
|
+
paddingHorizontal: 16,
|
|
78
|
+
backgroundColor: COLORS.surface
|
|
79
|
+
},
|
|
80
|
+
fullWidthContainer: {
|
|
81
|
+
flexDirection: 'column',
|
|
82
|
+
// Changed to column to stack rows
|
|
83
|
+
paddingVertical: 8,
|
|
84
|
+
// Reduced from 16 to bring platforms closer
|
|
85
|
+
paddingHorizontal: 2,
|
|
86
|
+
// Much closer to edges
|
|
87
|
+
backgroundColor: COLORS.surface,
|
|
88
|
+
marginBottom: 4,
|
|
89
|
+
// Reduced from 12 to bring platforms closer
|
|
90
|
+
marginHorizontal: 0 // Ensure it spans full width
|
|
91
|
+
},
|
|
92
|
+
topRow: {
|
|
93
|
+
flexDirection: 'row',
|
|
94
|
+
alignItems: 'center',
|
|
95
|
+
justifyContent: 'space-between',
|
|
96
|
+
marginBottom: 4 // Reduced space between icon row and description box
|
|
97
|
+
},
|
|
98
|
+
descriptionBox: {
|
|
99
|
+
backgroundColor: '#F5F5F5',
|
|
100
|
+
borderRadius: 8,
|
|
101
|
+
paddingVertical: 8,
|
|
102
|
+
// Reduced from 10 to make description box smaller
|
|
103
|
+
paddingHorizontal: 4,
|
|
104
|
+
// Much closer to edges
|
|
105
|
+
marginTop: 2 // Reduced from 4 to bring closer to icon row
|
|
106
|
+
},
|
|
107
|
+
borderBottom: {
|
|
108
|
+
borderBottomWidth: 1,
|
|
109
|
+
borderBottomColor: '#E5E5E5'
|
|
110
|
+
},
|
|
111
|
+
leftContent: {
|
|
112
|
+
flexDirection: 'row',
|
|
113
|
+
alignItems: 'center',
|
|
114
|
+
flex: 1
|
|
115
|
+
},
|
|
116
|
+
icon: {
|
|
117
|
+
width: 32,
|
|
118
|
+
height: 32,
|
|
119
|
+
marginRight: 12
|
|
120
|
+
},
|
|
121
|
+
compactIcon: {
|
|
122
|
+
width: 28,
|
|
123
|
+
height: 28,
|
|
124
|
+
marginRight: 12
|
|
125
|
+
},
|
|
126
|
+
textContent: {
|
|
127
|
+
flex: 1
|
|
128
|
+
},
|
|
129
|
+
platformName: {
|
|
130
|
+
fontSize: 16,
|
|
131
|
+
fontFamily: 'Inter',
|
|
132
|
+
fontWeight: '600',
|
|
133
|
+
color: COLORS.grey800,
|
|
134
|
+
marginBottom: 2
|
|
135
|
+
},
|
|
136
|
+
compactPlatformName: {
|
|
137
|
+
fontSize: 16,
|
|
138
|
+
fontFamily: 'Inter',
|
|
139
|
+
fontWeight: '600',
|
|
140
|
+
color: COLORS.grey800,
|
|
141
|
+
marginBottom: 2
|
|
142
|
+
},
|
|
143
|
+
description: {
|
|
144
|
+
fontSize: 14,
|
|
145
|
+
fontFamily: 'Inter',
|
|
146
|
+
fontWeight: '400',
|
|
147
|
+
color: COLORS.grey600,
|
|
148
|
+
lineHeight: 20
|
|
149
|
+
},
|
|
150
|
+
compactDescription: {
|
|
151
|
+
fontSize: 12,
|
|
152
|
+
fontFamily: 'Inter',
|
|
153
|
+
fontWeight: '400',
|
|
154
|
+
color: COLORS.grey600,
|
|
155
|
+
lineHeight: 16
|
|
156
|
+
},
|
|
157
|
+
fullWidthDescription: {
|
|
158
|
+
fontSize: 13,
|
|
159
|
+
fontFamily: 'Inter',
|
|
160
|
+
fontWeight: '400',
|
|
161
|
+
color: COLORS.grey600,
|
|
162
|
+
lineHeight: 18
|
|
163
|
+
},
|
|
164
|
+
compactSwitch: {
|
|
165
|
+
transform: [{
|
|
166
|
+
scaleX: 0.9
|
|
167
|
+
}, {
|
|
168
|
+
scaleY: 0.9
|
|
169
|
+
}]
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
export default PlatformToggle;
|
|
173
|
+
//# sourceMappingURL=PlatformToggle.js.map
|
|
@@ -1 +1,172 @@
|
|
|
1
|
-
import React,
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, StyleSheet, ActivityIndicator } from 'react-native';
|
|
3
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
4
|
+
import { COLORS } from '../theme';
|
|
5
|
+
const IconCircle = ({
|
|
6
|
+
size = 40,
|
|
7
|
+
children
|
|
8
|
+
}) => {
|
|
9
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
10
|
+
style: [styles.iconCircle, {
|
|
11
|
+
width: size,
|
|
12
|
+
height: size,
|
|
13
|
+
borderRadius: size / 2
|
|
14
|
+
}]
|
|
15
|
+
}, /*#__PURE__*/React.createElement(LinearGradient, {
|
|
16
|
+
colors: [COLORS.iconCircleGradientStart, COLORS.iconCircleGradientEnd],
|
|
17
|
+
style: [StyleSheet.absoluteFill, {
|
|
18
|
+
borderRadius: size / 2
|
|
19
|
+
}],
|
|
20
|
+
start: {
|
|
21
|
+
x: 0,
|
|
22
|
+
y: 0
|
|
23
|
+
},
|
|
24
|
+
end: {
|
|
25
|
+
x: 0,
|
|
26
|
+
y: 1
|
|
27
|
+
}
|
|
28
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
29
|
+
style: styles.iconContent
|
|
30
|
+
}, children || /*#__PURE__*/React.createElement(Text, {
|
|
31
|
+
style: styles.arrowText
|
|
32
|
+
}, "\u2192")));
|
|
33
|
+
};
|
|
34
|
+
const PrimaryButton = ({
|
|
35
|
+
label = "Get Started",
|
|
36
|
+
onPress,
|
|
37
|
+
iconRight,
|
|
38
|
+
loading = false,
|
|
39
|
+
disabled = false,
|
|
40
|
+
testID,
|
|
41
|
+
style,
|
|
42
|
+
textStyle
|
|
43
|
+
}) => {
|
|
44
|
+
const [pressed, setPressed] = useState(false);
|
|
45
|
+
const handlePressIn = () => setPressed(true);
|
|
46
|
+
const handlePressOut = () => setPressed(false);
|
|
47
|
+
return /*#__PURE__*/React.createElement(TouchableOpacity, {
|
|
48
|
+
style: [styles.outerPill, !disabled && styles.outerShadow, disabled && styles.disabled, style],
|
|
49
|
+
onPress: onPress,
|
|
50
|
+
onPressIn: handlePressIn,
|
|
51
|
+
onPressOut: handlePressOut,
|
|
52
|
+
disabled: disabled || loading,
|
|
53
|
+
activeOpacity: 1,
|
|
54
|
+
testID: testID,
|
|
55
|
+
accessibilityLabel: label,
|
|
56
|
+
accessibilityRole: "button"
|
|
57
|
+
}, /*#__PURE__*/React.createElement(LinearGradient, {
|
|
58
|
+
colors: [COLORS.btnGradStart, COLORS.btnGradEnd],
|
|
59
|
+
style: styles.baseGradient,
|
|
60
|
+
start: {
|
|
61
|
+
x: 0,
|
|
62
|
+
y: 0
|
|
63
|
+
},
|
|
64
|
+
end: {
|
|
65
|
+
x: 0,
|
|
66
|
+
y: 1
|
|
67
|
+
}
|
|
68
|
+
}), pressed && /*#__PURE__*/React.createElement(View, {
|
|
69
|
+
style: styles.pressedOverlay
|
|
70
|
+
}), /*#__PURE__*/React.createElement(View, {
|
|
71
|
+
style: styles.textContainer
|
|
72
|
+
}, loading ? /*#__PURE__*/React.createElement(ActivityIndicator, {
|
|
73
|
+
color: COLORS.btnLabel,
|
|
74
|
+
size: "small"
|
|
75
|
+
}) : /*#__PURE__*/React.createElement(Text, {
|
|
76
|
+
style: [styles.label, textStyle]
|
|
77
|
+
}, label)), /*#__PURE__*/React.createElement(View, {
|
|
78
|
+
style: styles.iconPosition
|
|
79
|
+
}, !loading && (iconRight || /*#__PURE__*/React.createElement(IconCircle, null))));
|
|
80
|
+
};
|
|
81
|
+
const styles = StyleSheet.create({
|
|
82
|
+
// Outer pill container - owns all backgrounds, border, shadow
|
|
83
|
+
outerPill: {
|
|
84
|
+
height: 48,
|
|
85
|
+
borderRadius: 100,
|
|
86
|
+
borderWidth: 1,
|
|
87
|
+
borderColor: COLORS.btnBorder,
|
|
88
|
+
// ≈20% black
|
|
89
|
+
overflow: 'hidden',
|
|
90
|
+
width: '100%',
|
|
91
|
+
position: 'relative'
|
|
92
|
+
},
|
|
93
|
+
outerShadow: {
|
|
94
|
+
// Outer shadow: 20px 30px 40px rgba(0,0,0,0.10)
|
|
95
|
+
shadowColor: '#000000',
|
|
96
|
+
shadowOffset: {
|
|
97
|
+
width: 20,
|
|
98
|
+
height: 30
|
|
99
|
+
},
|
|
100
|
+
shadowOpacity: 0.10,
|
|
101
|
+
shadowRadius: 40,
|
|
102
|
+
elevation: 8
|
|
103
|
+
},
|
|
104
|
+
disabled: {
|
|
105
|
+
opacity: 0.65,
|
|
106
|
+
shadowOpacity: 0,
|
|
107
|
+
elevation: 0
|
|
108
|
+
},
|
|
109
|
+
// Single base gradient - fills entire button
|
|
110
|
+
baseGradient: {
|
|
111
|
+
...StyleSheet.absoluteFillObject,
|
|
112
|
+
borderRadius: 100
|
|
113
|
+
},
|
|
114
|
+
pressedOverlay: {
|
|
115
|
+
...StyleSheet.absoluteFillObject,
|
|
116
|
+
backgroundColor: 'rgba(0,0,0,0.1)',
|
|
117
|
+
borderRadius: 100
|
|
118
|
+
},
|
|
119
|
+
// Absolutely centered text container
|
|
120
|
+
textContainer: {
|
|
121
|
+
position: 'absolute',
|
|
122
|
+
left: 0,
|
|
123
|
+
right: 0,
|
|
124
|
+
top: 0,
|
|
125
|
+
bottom: 0,
|
|
126
|
+
justifyContent: 'center',
|
|
127
|
+
alignItems: 'center',
|
|
128
|
+
backgroundColor: 'transparent'
|
|
129
|
+
},
|
|
130
|
+
// Fixed icon position on right
|
|
131
|
+
iconPosition: {
|
|
132
|
+
position: 'absolute',
|
|
133
|
+
right: 4,
|
|
134
|
+
top: 4,
|
|
135
|
+
bottom: 4,
|
|
136
|
+
width: 40,
|
|
137
|
+
justifyContent: 'center',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
backgroundColor: 'transparent'
|
|
140
|
+
},
|
|
141
|
+
label: {
|
|
142
|
+
fontFamily: 'Inter',
|
|
143
|
+
fontWeight: '600',
|
|
144
|
+
fontSize: 16,
|
|
145
|
+
color: COLORS.btnLabel,
|
|
146
|
+
textAlign: 'center',
|
|
147
|
+
backgroundColor: 'transparent' // Must be transparent
|
|
148
|
+
},
|
|
149
|
+
// IconCircle styles - ONLY child with background
|
|
150
|
+
iconCircle: {
|
|
151
|
+
justifyContent: 'center',
|
|
152
|
+
alignItems: 'center',
|
|
153
|
+
borderWidth: 1,
|
|
154
|
+
borderColor: 'rgba(0,0,0,0.25)'
|
|
155
|
+
},
|
|
156
|
+
iconContent: {
|
|
157
|
+
justifyContent: 'center',
|
|
158
|
+
alignItems: 'center',
|
|
159
|
+
backgroundColor: 'transparent'
|
|
160
|
+
},
|
|
161
|
+
arrowText: {
|
|
162
|
+
fontSize: 20,
|
|
163
|
+
color: COLORS.btnLabel,
|
|
164
|
+
fontWeight: '600',
|
|
165
|
+
opacity: 0.95,
|
|
166
|
+
backgroundColor: 'transparent'
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
export { IconCircle };
|
|
170
|
+
export { PrimaryButton };
|
|
171
|
+
export default PrimaryButton;
|
|
172
|
+
//# sourceMappingURL=PrimaryButton.js.map
|