@oxyhq/services 5.12.11 → 5.13.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.
- package/lib/commonjs/core/OxyServices.js +86 -8
- package/lib/commonjs/core/OxyServices.js.map +1 -1
- package/lib/commonjs/i18n/index.js +37 -1
- package/lib/commonjs/i18n/index.js.map +1 -1
- package/lib/commonjs/i18n/locales/ar-SA.json +128 -0
- package/lib/commonjs/i18n/locales/ca-ES.json +128 -0
- package/lib/commonjs/i18n/locales/de-DE.json +128 -0
- package/lib/commonjs/i18n/locales/en-US.json +85 -12
- package/lib/commonjs/i18n/locales/es-ES.json +58 -6
- package/lib/commonjs/i18n/locales/fr-FR.json +128 -0
- package/lib/commonjs/i18n/locales/it-IT.json +128 -0
- package/lib/commonjs/i18n/locales/ja-JP.json +127 -0
- package/lib/commonjs/i18n/locales/ko-KR.json +128 -0
- package/lib/commonjs/i18n/locales/pt-PT.json +128 -0
- package/lib/commonjs/i18n/locales/zh-CN.json +128 -0
- package/lib/commonjs/ui/components/FontLoader.js +22 -42
- package/lib/commonjs/ui/components/FontLoader.js.map +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +5 -8
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/StepBasedScreen.js +64 -44
- package/lib/commonjs/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +14 -35
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +2 -2
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/context/OxyContext.js +434 -321
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +56 -5
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignInScreen.js +43 -39
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js +139 -125
- package/lib/commonjs/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js +2 -4
- package/lib/commonjs/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js +45 -25
- package/lib/commonjs/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js +88 -53
- package/lib/commonjs/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js +79 -58
- package/lib/commonjs/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js +61 -52
- package/lib/commonjs/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js +220 -31
- package/lib/commonjs/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js +77 -50
- package/lib/commonjs/ui/screens/steps/SignInTotpStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js +527 -66
- package/lib/commonjs/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js +55 -30
- package/lib/commonjs/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js +64 -46
- package/lib/commonjs/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js +84 -146
- package/lib/commonjs/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js +113 -34
- package/lib/commonjs/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/commonjs/ui/stores/authStore.js +16 -20
- package/lib/commonjs/ui/stores/authStore.js.map +1 -1
- package/lib/commonjs/ui/styles/authStyles.js +2 -1
- package/lib/commonjs/ui/styles/authStyles.js.map +1 -1
- package/lib/commonjs/ui/styles/index.js +11 -0
- package/lib/commonjs/ui/styles/index.js.map +1 -1
- package/lib/commonjs/ui/styles/spacing.js +51 -0
- package/lib/commonjs/ui/styles/spacing.js.map +1 -0
- package/lib/commonjs/utils/validationUtils.js +1 -1
- package/lib/module/core/OxyServices.js +86 -8
- package/lib/module/core/OxyServices.js.map +1 -1
- package/lib/module/i18n/index.js +37 -1
- package/lib/module/i18n/index.js.map +1 -1
- package/lib/module/i18n/locales/ar-SA.json +128 -0
- package/lib/module/i18n/locales/ca-ES.json +128 -0
- package/lib/module/i18n/locales/de-DE.json +128 -0
- package/lib/module/i18n/locales/en-US.json +85 -12
- package/lib/module/i18n/locales/es-ES.json +58 -6
- package/lib/module/i18n/locales/fr-FR.json +128 -0
- package/lib/module/i18n/locales/it-IT.json +128 -0
- package/lib/module/i18n/locales/ja-JP.json +127 -0
- package/lib/module/i18n/locales/ko-KR.json +128 -0
- package/lib/module/i18n/locales/pt-PT.json +128 -0
- package/lib/module/i18n/locales/zh-CN.json +128 -0
- package/lib/module/ui/components/FontLoader.js +23 -43
- package/lib/module/ui/components/FontLoader.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +6 -8
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/StepBasedScreen.js +65 -45
- package/lib/module/ui/components/StepBasedScreen.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +14 -35
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +2 -2
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +434 -321
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +56 -5
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +44 -40
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/WelcomeNewUserScreen.js +138 -126
- package/lib/module/ui/screens/WelcomeNewUserScreen.js.map +1 -1
- package/lib/module/ui/screens/internal/SignInUsernameStep.js +2 -4
- package/lib/module/ui/screens/internal/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverRequestStep.js +45 -25
- package/lib/module/ui/screens/steps/RecoverRequestStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js +89 -54
- package/lib/module/ui/screens/steps/RecoverResetPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js +80 -59
- package/lib/module/ui/screens/steps/RecoverSuccessStep.js.map +1 -1
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js +62 -53
- package/lib/module/ui/screens/steps/RecoverVerifyStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInPasswordStep.js +221 -32
- package/lib/module/ui/screens/steps/SignInPasswordStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInTotpStep.js +78 -51
- package/lib/module/ui/screens/steps/SignInTotpStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignInUsernameStep.js +530 -68
- package/lib/module/ui/screens/steps/SignInUsernameStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js +55 -30
- package/lib/module/ui/screens/steps/SignUpIdentityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js +65 -47
- package/lib/module/ui/screens/steps/SignUpSecurityStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js +84 -146
- package/lib/module/ui/screens/steps/SignUpSummaryStep.js.map +1 -1
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js +114 -35
- package/lib/module/ui/screens/steps/SignUpWelcomeStep.js.map +1 -1
- package/lib/module/ui/stores/authStore.js +16 -20
- package/lib/module/ui/stores/authStore.js.map +1 -1
- package/lib/module/ui/styles/authStyles.js +2 -1
- package/lib/module/ui/styles/authStyles.js.map +1 -1
- package/lib/module/ui/styles/index.js +1 -0
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/styles/spacing.js +48 -0
- package/lib/module/ui/styles/spacing.js.map +1 -0
- package/lib/module/utils/validationUtils.js +1 -1
- package/lib/typescript/core/OxyServices.d.ts +38 -2
- package/lib/typescript/core/OxyServices.d.ts.map +1 -1
- package/lib/typescript/i18n/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/FontLoader.d.ts +3 -3
- package/lib/typescript/ui/components/FontLoader.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts +2 -2
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/components/StepBasedScreen.d.ts.map +1 -1
- package/lib/typescript/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts +1 -0
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts +10 -0
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/WelcomeNewUserScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverRequestStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverResetPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverSuccessStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/RecoverVerifyStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts +2 -0
- package/lib/typescript/ui/screens/steps/SignInPasswordStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInTotpStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignInUsernameStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpIdentityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSecurityStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpSummaryStep.d.ts.map +1 -1
- package/lib/typescript/ui/screens/steps/SignUpWelcomeStep.d.ts.map +1 -1
- package/lib/typescript/ui/stores/authStore.d.ts +7 -3
- package/lib/typescript/ui/stores/authStore.d.ts.map +1 -1
- package/lib/typescript/ui/styles/authStyles.d.ts +1 -0
- package/lib/typescript/ui/styles/authStyles.d.ts.map +1 -1
- package/lib/typescript/ui/styles/index.d.ts +1 -0
- package/lib/typescript/ui/styles/index.d.ts.map +1 -1
- package/lib/typescript/ui/styles/spacing.d.ts +43 -0
- package/lib/typescript/ui/styles/spacing.d.ts.map +1 -0
- package/lib/typescript/utils/validationUtils.d.ts +1 -1
- package/package.json +1 -1
- package/src/core/OxyServices.ts +96 -10
- package/src/i18n/index.ts +36 -0
- package/src/i18n/locales/ar-SA.json +128 -0
- package/src/i18n/locales/ca-ES.json +128 -0
- package/src/i18n/locales/de-DE.json +128 -0
- package/src/i18n/locales/en-US.json +85 -12
- package/src/i18n/locales/es-ES.json +58 -6
- package/src/i18n/locales/fr-FR.json +128 -0
- package/src/i18n/locales/it-IT.json +128 -0
- package/src/i18n/locales/ja-JP.json +127 -0
- package/src/i18n/locales/ko-KR.json +128 -0
- package/src/i18n/locales/pt-PT.json +128 -0
- package/src/i18n/locales/zh-CN.json +128 -0
- package/src/ui/components/FontLoader.tsx +17 -37
- package/src/ui/components/OxyProvider.tsx +14 -13
- package/src/ui/components/StepBasedScreen.tsx +66 -43
- package/src/ui/components/internal/GroupedPillButtons.tsx +15 -31
- package/src/ui/components/internal/PinInput.tsx +2 -2
- package/src/ui/context/OxyContext.tsx +404 -285
- package/src/ui/screens/FileManagementScreen.tsx +81 -4
- package/src/ui/screens/SignInScreen.tsx +59 -36
- package/src/ui/screens/WelcomeNewUserScreen.tsx +102 -91
- package/src/ui/screens/internal/SignInUsernameStep.tsx +1 -1
- package/src/ui/screens/steps/RecoverRequestStep.tsx +34 -24
- package/src/ui/screens/steps/RecoverResetPasswordStep.tsx +65 -36
- package/src/ui/screens/steps/RecoverSuccessStep.tsx +71 -47
- package/src/ui/screens/steps/RecoverVerifyStep.tsx +60 -50
- package/src/ui/screens/steps/SignInPasswordStep.tsx +191 -29
- package/src/ui/screens/steps/SignInTotpStep.tsx +68 -34
- package/src/ui/screens/steps/SignInUsernameStep.tsx +586 -57
- package/src/ui/screens/steps/SignUpIdentityStep.tsx +49 -35
- package/src/ui/screens/steps/SignUpSecurityStep.tsx +56 -39
- package/src/ui/screens/steps/SignUpSummaryStep.tsx +99 -89
- package/src/ui/screens/steps/SignUpWelcomeStep.tsx +88 -20
- package/src/ui/stores/authStore.ts +15 -19
- package/src/ui/styles/authStyles.ts +2 -1
- package/src/ui/styles/index.ts +1 -0
- package/src/ui/styles/spacing.ts +46 -0
- package/src/utils/validationUtils.ts +1 -1
|
@@ -13,11 +13,7 @@ import Animated, {
|
|
|
13
13
|
useSharedValue,
|
|
14
14
|
useAnimatedStyle,
|
|
15
15
|
withTiming,
|
|
16
|
-
withSequence,
|
|
17
|
-
withDelay,
|
|
18
|
-
withSpring,
|
|
19
16
|
runOnJS,
|
|
20
|
-
interpolate,
|
|
21
17
|
type SharedValue,
|
|
22
18
|
} from 'react-native-reanimated';
|
|
23
19
|
import { useThemeColors, createAuthStyles } from '../styles';
|
|
@@ -51,6 +47,38 @@ interface StepBasedScreenState {
|
|
|
51
47
|
isTransitioning: boolean;
|
|
52
48
|
}
|
|
53
49
|
|
|
50
|
+
// Individual animated progress dot
|
|
51
|
+
const AnimatedProgressDot: React.FC<{
|
|
52
|
+
isActive: boolean;
|
|
53
|
+
colors: any;
|
|
54
|
+
styles: any;
|
|
55
|
+
}> = ({ isActive, colors, styles }) => {
|
|
56
|
+
const width = useSharedValue(isActive ? 12 : 6);
|
|
57
|
+
const backgroundColor = useSharedValue(isActive ? colors.primary : colors.border);
|
|
58
|
+
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
width.value = withTiming(isActive ? 12 : 6, { duration: 300 });
|
|
61
|
+
backgroundColor.value = withTiming(
|
|
62
|
+
isActive ? colors.primary : colors.border,
|
|
63
|
+
{ duration: 300 }
|
|
64
|
+
);
|
|
65
|
+
}, [isActive, colors.primary, colors.border, width, backgroundColor]);
|
|
66
|
+
|
|
67
|
+
const animatedStyle = useAnimatedStyle(() => ({
|
|
68
|
+
width: width.value,
|
|
69
|
+
backgroundColor: backgroundColor.value,
|
|
70
|
+
}));
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Animated.View
|
|
74
|
+
style={[
|
|
75
|
+
styles.progressDot,
|
|
76
|
+
animatedStyle,
|
|
77
|
+
]}
|
|
78
|
+
/>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
54
82
|
// Progress indicator component
|
|
55
83
|
const ProgressIndicator: React.FC<{
|
|
56
84
|
currentStep: number;
|
|
@@ -60,14 +88,11 @@ const ProgressIndicator: React.FC<{
|
|
|
60
88
|
}> = ({ currentStep, totalSteps, colors, styles }) => (
|
|
61
89
|
<View style={styles.progressContainer}>
|
|
62
90
|
{Array.from({ length: totalSteps }, (_, index) => (
|
|
63
|
-
<
|
|
91
|
+
<AnimatedProgressDot
|
|
64
92
|
key={index}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
? { backgroundColor: colors.primary, width: 24 }
|
|
69
|
-
: { backgroundColor: colors.border }
|
|
70
|
-
]}
|
|
93
|
+
isActive={currentStep === index}
|
|
94
|
+
colors={colors}
|
|
95
|
+
styles={styles}
|
|
71
96
|
/>
|
|
72
97
|
))}
|
|
73
98
|
</View>
|
|
@@ -183,6 +208,20 @@ const StepBasedScreen: React.FC<StepBasedScreenProps> = ({
|
|
|
183
208
|
fontWeight: '600' as const,
|
|
184
209
|
textDecorationLine: 'underline' as const,
|
|
185
210
|
},
|
|
211
|
+
progressContainer: {
|
|
212
|
+
flexDirection: 'row' as const,
|
|
213
|
+
width: '100%',
|
|
214
|
+
justifyContent: 'center' as const,
|
|
215
|
+
marginTop: 24, // Space for bottom sheet handle (~20px) + small buffer
|
|
216
|
+
marginBottom: 24, // Equal spacing below dots
|
|
217
|
+
},
|
|
218
|
+
progressDot: {
|
|
219
|
+
height: 6,
|
|
220
|
+
width: 6,
|
|
221
|
+
borderRadius: 3,
|
|
222
|
+
marginHorizontal: 3,
|
|
223
|
+
backgroundColor: colors.border,
|
|
224
|
+
},
|
|
186
225
|
}), [colors, theme]);
|
|
187
226
|
|
|
188
227
|
// State management
|
|
@@ -231,13 +270,6 @@ const StepBasedScreen: React.FC<StepBasedScreenProps> = ({
|
|
|
231
270
|
|
|
232
271
|
setState(prev => ({ ...prev, isTransitioning: true }));
|
|
233
272
|
|
|
234
|
-
// Scale down current content
|
|
235
|
-
scaleAnim.value = withSequence(
|
|
236
|
-
withTiming(0.95, { duration: 150 }),
|
|
237
|
-
withTiming(0.95, { duration: 50 })
|
|
238
|
-
);
|
|
239
|
-
|
|
240
|
-
// Define a JS function for runOnJS to avoid inline closures
|
|
241
273
|
const applyStepChange = (targetStep: number, totalSteps: number) => {
|
|
242
274
|
setState(prev => ({
|
|
243
275
|
...prev,
|
|
@@ -245,33 +277,24 @@ const StepBasedScreen: React.FC<StepBasedScreenProps> = ({
|
|
|
245
277
|
isTransitioning: false,
|
|
246
278
|
}));
|
|
247
279
|
onStepChangeRef.current?.(targetStep, totalSteps);
|
|
280
|
+
|
|
281
|
+
// Prepare next step animation
|
|
282
|
+
fadeAnim.value = 0;
|
|
283
|
+
scaleAnim.value = 0.98;
|
|
284
|
+
slideAnim.value = 0;
|
|
285
|
+
|
|
286
|
+
fadeAnim.value = withTiming(1, { duration: 220 });
|
|
287
|
+
scaleAnim.value = withTiming(1, { duration: 220 });
|
|
248
288
|
};
|
|
249
289
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
slideAnim.value = withDelay(16, withTiming(-50, { duration: 0 }));
|
|
259
|
-
scaleAnim.value = withDelay(16, withTiming(0.95, { duration: 0 }));
|
|
260
|
-
|
|
261
|
-
// Animate in new content
|
|
262
|
-
fadeAnim.value = withDelay(16, withTiming(1, { duration: 300 }));
|
|
263
|
-
slideAnim.value = withDelay(16, withSpring(0, {
|
|
264
|
-
damping: 15,
|
|
265
|
-
stiffness: 200,
|
|
266
|
-
}));
|
|
267
|
-
scaleAnim.value = withDelay(16, withSpring(1, {
|
|
268
|
-
damping: 15,
|
|
269
|
-
stiffness: 200,
|
|
270
|
-
}));
|
|
271
|
-
}
|
|
272
|
-
})
|
|
273
|
-
);
|
|
274
|
-
}, [enableAnimations, steps.length]);
|
|
290
|
+
// Animate current step out
|
|
291
|
+
scaleAnim.value = withTiming(0.98, { duration: 180 });
|
|
292
|
+
fadeAnim.value = withTiming(0, { duration: 180 }, (finished) => {
|
|
293
|
+
if (finished) {
|
|
294
|
+
runOnJS(applyStepChange)(nextStep, steps.length);
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
}, [enableAnimations, steps.length, fadeAnim, scaleAnim, slideAnim]);
|
|
275
298
|
|
|
276
299
|
// Navigation functions
|
|
277
300
|
const nextStep = useCallback(() => {
|
|
@@ -33,17 +33,6 @@ const GroupedPillButtons: React.FC<GroupedPillButtonsProps> = ({
|
|
|
33
33
|
minWidth: 70,
|
|
34
34
|
borderWidth: 1,
|
|
35
35
|
flexShrink: 0,
|
|
36
|
-
...Platform.select({
|
|
37
|
-
web: {
|
|
38
|
-
boxShadow: '0 2px 4px rgba(0,0,0,0.1)',
|
|
39
|
-
},
|
|
40
|
-
default: {
|
|
41
|
-
shadowOffset: { width: 0, height: 2 },
|
|
42
|
-
shadowOpacity: 0.1,
|
|
43
|
-
shadowRadius: 4,
|
|
44
|
-
elevation: 2,
|
|
45
|
-
}
|
|
46
|
-
}),
|
|
47
36
|
};
|
|
48
37
|
|
|
49
38
|
// Determine border radius based on position
|
|
@@ -85,28 +74,21 @@ const GroupedPillButtons: React.FC<GroupedPillButtonsProps> = ({
|
|
|
85
74
|
// Determine colors based on variant
|
|
86
75
|
let backgroundColor = 'transparent';
|
|
87
76
|
let borderColor = colors.border;
|
|
88
|
-
|
|
89
|
-
let textColor = colors.text;
|
|
77
|
+
const isDisabled = button.disabled || button.loading;
|
|
90
78
|
|
|
91
79
|
switch (button.variant) {
|
|
92
80
|
case 'primary':
|
|
93
|
-
backgroundColor = colors.primary;
|
|
94
|
-
borderColor = colors.primary;
|
|
95
|
-
shadowColor = colors.primary;
|
|
96
|
-
textColor = '#FFFFFF';
|
|
81
|
+
backgroundColor = isDisabled ? '#CCCCCC' : colors.primary;
|
|
82
|
+
borderColor = isDisabled ? '#CCCCCC' : colors.primary;
|
|
97
83
|
break;
|
|
98
84
|
case 'secondary':
|
|
99
|
-
backgroundColor = colors.secondary || colors.primary;
|
|
100
|
-
borderColor = colors.secondary || colors.primary;
|
|
101
|
-
shadowColor = colors.secondary || colors.primary;
|
|
102
|
-
textColor = '#FFFFFF';
|
|
85
|
+
backgroundColor = isDisabled ? '#CCCCCC' : (colors.secondary || colors.primary);
|
|
86
|
+
borderColor = isDisabled ? '#CCCCCC' : (colors.secondary || colors.primary);
|
|
103
87
|
break;
|
|
104
88
|
case 'transparent':
|
|
105
89
|
default:
|
|
106
90
|
backgroundColor = 'transparent';
|
|
107
|
-
borderColor = colors.border;
|
|
108
|
-
shadowColor = colors.border;
|
|
109
|
-
textColor = colors.text;
|
|
91
|
+
borderColor = isDisabled ? '#CCCCCC' : colors.border;
|
|
110
92
|
break;
|
|
111
93
|
}
|
|
112
94
|
|
|
@@ -115,7 +97,7 @@ const GroupedPillButtons: React.FC<GroupedPillButtonsProps> = ({
|
|
|
115
97
|
...borderRadius,
|
|
116
98
|
backgroundColor,
|
|
117
99
|
borderColor,
|
|
118
|
-
|
|
100
|
+
opacity: isDisabled ? 0.6 : 1,
|
|
119
101
|
};
|
|
120
102
|
};
|
|
121
103
|
|
|
@@ -127,15 +109,17 @@ const GroupedPillButtons: React.FC<GroupedPillButtonsProps> = ({
|
|
|
127
109
|
flexShrink: 1,
|
|
128
110
|
};
|
|
129
111
|
|
|
112
|
+
const isDisabled = button.disabled || button.loading;
|
|
130
113
|
let textColor = colors.text;
|
|
114
|
+
|
|
131
115
|
switch (button.variant) {
|
|
132
116
|
case 'primary':
|
|
133
117
|
case 'secondary':
|
|
134
|
-
textColor = '#FFFFFF';
|
|
118
|
+
textColor = isDisabled ? '#999999' : '#FFFFFF';
|
|
135
119
|
break;
|
|
136
120
|
case 'transparent':
|
|
137
121
|
default:
|
|
138
|
-
textColor = colors.text;
|
|
122
|
+
textColor = isDisabled ? '#999999' : colors.text;
|
|
139
123
|
break;
|
|
140
124
|
}
|
|
141
125
|
|
|
@@ -147,13 +131,15 @@ const GroupedPillButtons: React.FC<GroupedPillButtonsProps> = ({
|
|
|
147
131
|
};
|
|
148
132
|
|
|
149
133
|
const getIconColor = (button: ButtonConfig, colors: any) => {
|
|
134
|
+
const isDisabled = button.disabled || button.loading;
|
|
135
|
+
|
|
150
136
|
switch (button.variant) {
|
|
151
137
|
case 'primary':
|
|
152
138
|
case 'secondary':
|
|
153
|
-
return '#FFFFFF';
|
|
139
|
+
return isDisabled ? '#999999' : '#FFFFFF';
|
|
154
140
|
case 'transparent':
|
|
155
141
|
default:
|
|
156
|
-
return colors.text;
|
|
142
|
+
return isDisabled ? '#999999' : colors.text;
|
|
157
143
|
}
|
|
158
144
|
};
|
|
159
145
|
|
|
@@ -252,8 +238,6 @@ const styles = StyleSheet.create({
|
|
|
252
238
|
container: {
|
|
253
239
|
flexDirection: 'row',
|
|
254
240
|
justifyContent: 'flex-end',
|
|
255
|
-
marginTop: 16,
|
|
256
|
-
marginBottom: 8,
|
|
257
241
|
width: '100%',
|
|
258
242
|
},
|
|
259
243
|
});
|