@umituz/react-native-auth 4.3.94 → 4.3.95

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@umituz/react-native-auth",
3
- "version": "4.3.94",
3
+ "version": "4.3.95",
4
4
  "description": "Authentication service for React Native apps - Secure, type-safe, and production-ready. Provider-agnostic design with dependency injection, configurable validation, and comprehensive error handling.",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -11,8 +11,8 @@ export const styles = StyleSheet.create({
11
11
  borderRadius: 2,
12
12
  },
13
13
  scrollContent: {
14
- paddingHorizontal: 24,
15
- paddingBottom: 80,
14
+ // paddingHorizontal ve paddingBottom artık component içinden responsive olarak verilecek
15
+ flexGrow: 1,
16
16
  },
17
17
  closeButton: {
18
18
  position: "absolute",
@@ -23,9 +23,9 @@ export const styles = StyleSheet.create({
23
23
  },
24
24
  header: {
25
25
  alignItems: "center",
26
- marginBottom: 24,
27
- marginTop: 8,
28
- paddingTop: 16,
26
+ // marginBottom artık component içinden responsive olarak verilecek
27
+ // marginTop artık component içinden responsive olarak verilecek
28
+ // paddingTop artık component içinden responsive olarak verilecek
29
29
  },
30
30
  title: {
31
31
  marginBottom: 8,
@@ -1,6 +1,7 @@
1
- import React from "react";
1
+ import React, { useMemo } from "react";
2
2
  import { View, TouchableOpacity, ScrollView } from "react-native";
3
3
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
4
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
4
5
  import { AtomicText, AtomicIcon, AtomicKeyboardAvoidingView } from "@umituz/react-native-design-system/atoms";
5
6
  import { BottomSheetModal } from "@umituz/react-native-design-system/molecules";
6
7
  import { useAuthBottomSheet, type SocialAuthConfiguration } from "../hooks/useAuthBottomSheet";
@@ -44,6 +45,7 @@ export const AuthBottomSheet: React.FC<AuthBottomSheetProps> = ({
44
45
  onAuthSuccess,
45
46
  }) => {
46
47
  const tokens = useAppDesignTokens();
48
+ const responsive = useResponsive();
47
49
 
48
50
  const {
49
51
  modalRef,
@@ -59,6 +61,23 @@ export const AuthBottomSheet: React.FC<AuthBottomSheetProps> = ({
59
61
  handleAppleSignIn,
60
62
  } = useAuthBottomSheet({ socialConfig, onGoogleSignIn, onAppleSignIn, onAuthSuccess });
61
63
 
64
+ const scrollContentStyle = useMemo(() => [
65
+ styles.scrollContent,
66
+ {
67
+ paddingHorizontal: responsive.horizontalPadding,
68
+ paddingBottom: responsive.verticalPadding * 3,
69
+ },
70
+ ], [responsive.horizontalPadding, responsive.verticalPadding]);
71
+
72
+ const headerStyle = useMemo(() => [
73
+ styles.header,
74
+ {
75
+ marginBottom: responsive.verticalPadding,
76
+ marginTop: responsive.horizontalPadding,
77
+ paddingTop: responsive.horizontalPadding,
78
+ },
79
+ ], [responsive.verticalPadding, responsive.horizontalPadding]);
80
+
62
81
  return (
63
82
  <BottomSheetModal
64
83
  ref={modalRef}
@@ -80,11 +99,11 @@ export const AuthBottomSheet: React.FC<AuthBottomSheetProps> = ({
80
99
  </TouchableOpacity>
81
100
 
82
101
  <ScrollView
83
- contentContainerStyle={styles.scrollContent}
102
+ contentContainerStyle={scrollContentStyle}
84
103
  showsVerticalScrollIndicator={false}
85
104
  keyboardShouldPersistTaps="handled"
86
105
  >
87
- <View style={styles.header}>
106
+ <View style={headerStyle}>
88
107
  <AtomicText type="headlineLarge" color="textPrimary" style={styles.title}>
89
108
  {mode === "login" ? translations.signIn : translations.createAccount}
90
109
  </AtomicText>
@@ -7,6 +7,7 @@
7
7
  import React, { memo } from "react";
8
8
  import { View, StyleSheet } from "react-native";
9
9
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
10
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
10
11
  import { AtomicText } from "@umituz/react-native-design-system/atoms";
11
12
 
12
13
  interface AuthHeaderProps {
@@ -16,9 +17,10 @@ interface AuthHeaderProps {
16
17
 
17
18
  export const AuthHeader = memo<AuthHeaderProps>(({ title, subtitle }) => {
18
19
  const tokens = useAppDesignTokens();
20
+ const responsive = useResponsive();
19
21
 
20
22
  return (
21
- <View style={[styles.header, { marginBottom: tokens.spacing.xl, paddingHorizontal: tokens.spacing.md }]}>
23
+ <View style={[styles.header, { marginBottom: tokens.spacing.xl, paddingHorizontal: responsive.horizontalPadding }]}>
22
24
  <AtomicText
23
25
  type="headlineLarge"
24
26
  color="textPrimary"
@@ -1,6 +1,7 @@
1
- import React, { useRef, memo } from "react";
1
+ import React, { useRef, memo, useMemo } from "react";
2
2
  import { StyleSheet, TextInput } from "react-native";
3
3
  import { AtomicButton } from "@umituz/react-native-design-system/atoms";
4
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
4
5
  import { useLoginForm } from "../hooks/useLoginForm";
5
6
  import { AuthErrorDisplay } from "./AuthErrorDisplay";
6
7
  import { AuthLink } from "./AuthLink";
@@ -27,6 +28,7 @@ export const LoginForm = memo<LoginFormProps>(({
27
28
  onNavigateToRegister,
28
29
  }) => {
29
30
  const passwordRef = useRef<React.ElementRef<typeof TextInput>>(null);
31
+ const responsive = useResponsive();
30
32
  const {
31
33
  email,
32
34
  password,
@@ -39,6 +41,11 @@ export const LoginForm = memo<LoginFormProps>(({
39
41
  displayError,
40
42
  } = useLoginForm();
41
43
 
44
+ const signInButtonStyle = useMemo(() => [
45
+ styles.signInButton,
46
+ { marginBottom: responsive.verticalPadding },
47
+ ], [responsive.verticalPadding]);
48
+
42
49
  return (
43
50
  <>
44
51
  <FormEmailInput
@@ -71,7 +78,7 @@ export const LoginForm = memo<LoginFormProps>(({
71
78
  onPress={() => { void handleSignIn(); }}
72
79
  disabled={loading || !email.trim() || !password}
73
80
  fullWidth
74
- style={styles.signInButton}
81
+ style={signInButtonStyle}
75
82
  >
76
83
  {translations.signIn}
77
84
  </AtomicButton>
@@ -87,9 +94,7 @@ export const LoginForm = memo<LoginFormProps>(({
87
94
  });
88
95
 
89
96
  const styles = StyleSheet.create({
90
- signInButton: {
91
- marginBottom: 16,
92
- },
97
+ signInButton: {},
93
98
  });
94
99
 
95
100
  LoginForm.displayName = 'LoginForm';
@@ -7,6 +7,7 @@
7
7
  import React, { useMemo, memo } from "react";
8
8
  import { View, StyleSheet } from "react-native";
9
9
  import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
10
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
10
11
  import { AtomicText, AtomicButton } from "@umituz/react-native-design-system/atoms";
11
12
  import type { SocialAuthProvider } from "../../domain/value-objects/AuthConfig";
12
13
 
@@ -27,6 +28,7 @@ interface SocialLoginButtonsProps {
27
28
 
28
29
  export const SocialLoginButtons = memo<SocialLoginButtonsProps>(({ translations, enabledProviders, onGooglePress, onApplePress, googleLoading = false, appleLoading = false }) => {
29
30
  const tokens = useAppDesignTokens();
31
+ const responsive = useResponsive();
30
32
 
31
33
  // PERFORMANCE: Memoize provider checks to prevent recalculation on every render
32
34
  const { hasGoogle, hasApple } = useMemo(() => ({
@@ -34,12 +36,17 @@ export const SocialLoginButtons = memo<SocialLoginButtonsProps>(({ translations,
34
36
  hasApple: enabledProviders.includes("apple"),
35
37
  }), [enabledProviders]);
36
38
 
39
+ const containerStyle = useMemo(() => [
40
+ styles.container,
41
+ { marginTop: responsive.verticalPadding },
42
+ ], [responsive.verticalPadding]);
43
+
37
44
  if (!hasGoogle && !hasApple) {
38
45
  return null;
39
46
  }
40
47
 
41
48
  return (
42
- <View style={[styles.container, { marginTop: tokens.spacing.lg }]}>
49
+ <View style={containerStyle}>
43
50
  <View style={styles.dividerContainer}>
44
51
  <View style={[styles.divider, { backgroundColor: tokens.colors.border }]} />
45
52
  <AtomicText type="bodySmall" color="textSecondary" style={styles.dividerText}>
@@ -9,6 +9,7 @@ import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
9
9
  import { AtomicCard } from "@umituz/react-native-design-system/atoms";
10
10
  import { useAppNavigation } from "@umituz/react-native-design-system/molecules";
11
11
  import { ScreenLayout } from "@umituz/react-native-design-system/layouts";
12
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
12
13
  import { AuthHeader } from "../components/AuthHeader";
13
14
  import { LoginForm, type LoginFormTranslations } from "../components/LoginForm";
14
15
 
@@ -25,6 +26,7 @@ export interface LoginScreenProps {
25
26
  export const LoginScreen = memo<LoginScreenProps>(({ translations }) => {
26
27
  const navigation = useAppNavigation();
27
28
  const tokens = useAppDesignTokens();
29
+ const responsive = useResponsive();
28
30
 
29
31
  // PERFORMANCE: Stable callback reference
30
32
  const handleNavigateToRegister = useCallback(() => {
@@ -35,7 +37,7 @@ export const LoginScreen = memo<LoginScreenProps>(({ translations }) => {
35
37
  <ScreenLayout
36
38
  scrollable
37
39
  keyboardAvoiding
38
- maxWidth={440}
40
+ maxWidth={responsive.maxContentWidth}
39
41
  contentContainerStyle={{ justifyContent: "center" }}
40
42
  backgroundColor={tokens.colors.backgroundPrimary}
41
43
  >
@@ -9,6 +9,7 @@ import { useAppDesignTokens } from "@umituz/react-native-design-system/theme";
9
9
  import { AtomicCard } from "@umituz/react-native-design-system/atoms";
10
10
  import { useAppNavigation } from "@umituz/react-native-design-system/molecules";
11
11
  import { ScreenLayout } from "@umituz/react-native-design-system/layouts";
12
+ import { useResponsive } from "@umituz/react-native-design-system/responsive";
12
13
  import { AuthHeader } from "../components/AuthHeader";
13
14
  import { RegisterForm, type RegisterFormTranslations } from "../components/RegisterForm";
14
15
 
@@ -29,6 +30,7 @@ export interface RegisterScreenProps {
29
30
  export const RegisterScreen = memo<RegisterScreenProps>(({ translations, termsUrl, privacyUrl, onTermsPress, onPrivacyPress }) => {
30
31
  const navigation = useAppNavigation();
31
32
  const tokens = useAppDesignTokens();
33
+ const responsive = useResponsive();
32
34
 
33
35
  // PERFORMANCE: Stable callback reference
34
36
  const handleNavigateToLogin = useCallback(() => {
@@ -39,7 +41,7 @@ export const RegisterScreen = memo<RegisterScreenProps>(({ translations, termsUr
39
41
  <ScreenLayout
40
42
  scrollable
41
43
  keyboardAvoiding
42
- maxWidth={440}
44
+ maxWidth={responsive.maxContentWidth}
43
45
  contentContainerStyle={{ justifyContent: "center" }}
44
46
  backgroundColor={tokens.colors.backgroundPrimary}
45
47
  >