@sudobility/building_blocks_rn 0.0.23 → 0.0.25
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/**
|
|
3
3
|
* @fileoverview Login screen component for React Native.
|
|
4
4
|
*
|
|
@@ -61,7 +61,12 @@ export function LoginScreen({ appName, logo, onLogin, onSignUp, onGoogleSignIn,
|
|
|
61
61
|
return (_jsx(KeyboardAvoidingView, { style: [styles.container, style], behavior: Platform.OS === 'ios' ? 'padding' : 'height', children: _jsxs(View, { style: styles.card, accessibilityLabel: 'Login form', children: [logo && (_jsx(Image, { source: logo, style: styles.logo, resizeMode: 'contain', accessibilityLabel: `${appName} logo` })), _jsx(Text, { style: styles.title, accessibilityRole: 'header', accessibilityLabel: isSignUp ? `Sign up for ${appName}` : `Sign in to ${appName}`, children: isSignUp ? `Sign up for ${appName}` : `Sign in to ${appName}` }), error && (_jsx(View, { style: styles.errorBox, accessibilityRole: 'alert', accessibilityLabel: `Error: ${error}`, children: _jsx(Text, { style: styles.errorText, children: error }) })), _jsxs(View, { style: styles.form, children: [_jsx(Text, { style: styles.label, accessibilityLabel: 'Email address', children: "Email" }), _jsx(TextInput, { style: styles.input, value: email, onChangeText: setEmail, placeholder: 'you@example.com', autoCapitalize: 'none', autoCorrect: false, keyboardType: 'email-address', textContentType: 'emailAddress', editable: !loading, accessibilityLabel: 'Email address input', accessibilityHint: 'Enter your email address' }), _jsx(Text, { style: styles.label, accessibilityLabel: 'Password', children: "Password" }), _jsx(TextInput, { style: styles.input, value: password, onChangeText: setPassword, placeholder: 'Password', secureTextEntry: true, textContentType: isSignUp ? 'newPassword' : 'password', editable: !loading, onSubmitEditing: handleSubmit, accessibilityLabel: 'Password input', accessibilityHint: 'Enter your password' }), _jsx(Pressable, { style: [
|
|
62
62
|
styles.submitButton,
|
|
63
63
|
loading && styles.submitButtonDisabled,
|
|
64
|
-
], onPress: handleSubmit, disabled: loading, accessibilityRole: 'button', accessibilityLabel: isSignUp ? 'Sign Up' : 'Sign In', accessibilityState: { disabled: loading, busy: loading }, children: loading ? (_jsx(ActivityIndicator, { color: designColors.raw.neutral[0], size: 'small' })) : (_jsx(Text, { style: styles.submitButtonText, children: isSignUp ? 'Sign Up' : 'Sign In' })) })] }), (showGoogleSignIn || showAppleSignIn) && (_jsxs(View, { style: styles.socialSection, children: [_jsxs(View, { style: styles.divider, children: [_jsx(View, { style: styles.dividerLine }), _jsx(Text, { style: styles.dividerText, children: "or" }), _jsx(View, { style: styles.dividerLine })] }),
|
|
64
|
+
], onPress: handleSubmit, disabled: loading, accessibilityRole: 'button', accessibilityLabel: isSignUp ? 'Sign Up' : 'Sign In', accessibilityState: { disabled: loading, busy: loading }, children: loading ? (_jsx(ActivityIndicator, { color: designColors.raw.neutral[0], size: 'small' })) : (_jsx(Text, { style: styles.submitButtonText, children: isSignUp ? 'Sign Up' : 'Sign In' })) })] }), (showGoogleSignIn || showAppleSignIn) && (_jsxs(View, { style: styles.socialSection, children: [_jsxs(View, { style: styles.divider, children: [_jsx(View, { style: styles.dividerLine }), _jsx(Text, { style: styles.dividerText, children: "or" }), _jsx(View, { style: styles.dividerLine })] }), (() => {
|
|
65
|
+
const appleFirst = Platform.OS === 'ios' || Platform.OS === 'macos';
|
|
66
|
+
const googleButton = showGoogleSignIn && onGoogleSignIn && (_jsx(Pressable, { style: styles.socialButton, onPress: () => handleSocialSignIn(onGoogleSignIn), disabled: loading, accessibilityRole: 'button', accessibilityLabel: 'Continue with Google', accessibilityState: { disabled: loading }, children: _jsx(Text, { style: styles.socialButtonText, children: "Continue with Google" }) }));
|
|
67
|
+
const appleButton = showAppleSignIn && onAppleSignIn && (_jsx(Pressable, { style: [styles.socialButton, styles.appleButton], onPress: () => handleSocialSignIn(onAppleSignIn), disabled: loading, accessibilityRole: 'button', accessibilityLabel: 'Continue with Apple', accessibilityState: { disabled: loading }, children: _jsx(Text, { style: [styles.socialButtonText, styles.appleButtonText], children: "Continue with Apple" }) }));
|
|
68
|
+
return appleFirst ? (_jsxs(_Fragment, { children: [appleButton, googleButton] })) : (_jsxs(_Fragment, { children: [googleButton, appleButton] }));
|
|
69
|
+
})()] })), showSignUp && onSignUp && (_jsx(Pressable, { style: styles.toggleLink, onPress: () => {
|
|
65
70
|
setIsSignUp(!isSignUp);
|
|
66
71
|
setError(null);
|
|
67
72
|
}, accessibilityRole: 'button', accessibilityLabel: isSignUp
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sudobility/building_blocks_rn",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "Higher-level shared UI building blocks for Sudobility React Native apps",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"i18next": "^23.0.0 || ^24.0.0 || ^25.0.0",
|
|
45
45
|
"react-i18next": "^14.0.0 || ^15.0.0 || ^16.0.0",
|
|
46
46
|
"@react-native-async-storage/async-storage": ">=1.0.0",
|
|
47
|
-
"@sudobility/design": "^1.1.
|
|
47
|
+
"@sudobility/design": "^1.1.29"
|
|
48
48
|
},
|
|
49
49
|
"peerDependenciesMeta": {
|
|
50
50
|
"firebase": {
|