@kiosinc/commons-rn 0.1.7
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/LICENSE +20 -0
- package/README.md +31 -0
- package/lib/commonjs/auth/api/authentication.js +20 -0
- package/lib/commonjs/auth/api/authentication.js.map +1 -0
- package/lib/commonjs/auth/appLogo.svg +9 -0
- package/lib/commonjs/auth/hooks/useAuthenticateRequests.js +52 -0
- package/lib/commonjs/auth/hooks/useAuthenticateRequests.js.map +1 -0
- package/lib/commonjs/auth/hooks/useAuthentication.js +89 -0
- package/lib/commonjs/auth/hooks/useAuthentication.js.map +1 -0
- package/lib/commonjs/auth/index.js +33 -0
- package/lib/commonjs/auth/index.js.map +1 -0
- package/lib/commonjs/auth/providers/authentication/AuthenticationProvider.js +57 -0
- package/lib/commonjs/auth/providers/authentication/AuthenticationProvider.js.map +1 -0
- package/lib/commonjs/auth/providers/authentication/actions/authentication.actions.js +13 -0
- package/lib/commonjs/auth/providers/authentication/actions/authentication.actions.js.map +1 -0
- package/lib/commonjs/auth/providers/authentication/index.js +50 -0
- package/lib/commonjs/auth/providers/authentication/index.js.map +1 -0
- package/lib/commonjs/auth/providers/authentication/reducer/authentication.reducer.js +21 -0
- package/lib/commonjs/auth/providers/authentication/reducer/authentication.reducer.js.map +1 -0
- package/lib/commonjs/auth/providers/authentication/types/authentication.types.js +11 -0
- package/lib/commonjs/auth/providers/authentication/types/authentication.types.js.map +1 -0
- package/lib/commonjs/auth/screens/LoginScreen.js +131 -0
- package/lib/commonjs/auth/screens/LoginScreen.js.map +1 -0
- package/lib/commonjs/auth/screens/ResetPassword.js +90 -0
- package/lib/commonjs/auth/screens/ResetPassword.js.map +1 -0
- package/lib/commonjs/auth/screens/ResetPasswordInstructionsSent.js +34 -0
- package/lib/commonjs/auth/screens/ResetPasswordInstructionsSent.js.map +1 -0
- package/lib/commonjs/auth/screens/SignUp.js +176 -0
- package/lib/commonjs/auth/screens/SignUp.js.map +1 -0
- package/lib/commonjs/auth/screens/SignUpPassword.js +103 -0
- package/lib/commonjs/auth/screens/SignUpPassword.js.map +1 -0
- package/lib/commonjs/auth/screens/VerifyPhoneNumber.js +95 -0
- package/lib/commonjs/auth/screens/VerifyPhoneNumber.js.map +1 -0
- package/lib/commonjs/auth/screens/index.js +37 -0
- package/lib/commonjs/auth/screens/index.js.map +1 -0
- package/lib/commonjs/auth/screens/validators.js +39 -0
- package/lib/commonjs/auth/screens/validators.js.map +1 -0
- package/lib/commonjs/components/Alert.js +109 -0
- package/lib/commonjs/components/Alert.js.map +1 -0
- package/lib/commonjs/components/Badge.js +20 -0
- package/lib/commonjs/components/Badge.js.map +1 -0
- package/lib/commonjs/components/BottomSheet.js +60 -0
- package/lib/commonjs/components/BottomSheet.js.map +1 -0
- package/lib/commonjs/components/Button.js +20 -0
- package/lib/commonjs/components/Button.js.map +1 -0
- package/lib/commonjs/components/Card.js +19 -0
- package/lib/commonjs/components/Card.js.map +1 -0
- package/lib/commonjs/components/Divider.js +19 -0
- package/lib/commonjs/components/Divider.js.map +1 -0
- package/lib/commonjs/components/FAB.js +19 -0
- package/lib/commonjs/components/FAB.js.map +1 -0
- package/lib/commonjs/components/Header.js +73 -0
- package/lib/commonjs/components/Header.js.map +1 -0
- package/lib/commonjs/components/IconButton.js +19 -0
- package/lib/commonjs/components/IconButton.js.map +1 -0
- package/lib/commonjs/components/Image.js +45 -0
- package/lib/commonjs/components/Image.js.map +1 -0
- package/lib/commonjs/components/KeyboardAvoidingView.js +23 -0
- package/lib/commonjs/components/KeyboardAvoidingView.js.map +1 -0
- package/lib/commonjs/components/LineLoader.js +61 -0
- package/lib/commonjs/components/LineLoader.js.map +1 -0
- package/lib/commonjs/components/LinkButton.js +32 -0
- package/lib/commonjs/components/LinkButton.js.map +1 -0
- package/lib/commonjs/components/OtpInputs.js +97 -0
- package/lib/commonjs/components/OtpInputs.js.map +1 -0
- package/lib/commonjs/components/ParentView.js +81 -0
- package/lib/commonjs/components/ParentView.js.map +1 -0
- package/lib/commonjs/components/Searchbar.js +22 -0
- package/lib/commonjs/components/Searchbar.js.map +1 -0
- package/lib/commonjs/components/SelectionDialog.js +130 -0
- package/lib/commonjs/components/SelectionDialog.js.map +1 -0
- package/lib/commonjs/components/Snackbar.js +69 -0
- package/lib/commonjs/components/Snackbar.js.map +1 -0
- package/lib/commonjs/components/Surface.js +19 -0
- package/lib/commonjs/components/Surface.js.map +1 -0
- package/lib/commonjs/components/Text.js +20 -0
- package/lib/commonjs/components/Text.js.map +1 -0
- package/lib/commonjs/components/TextInput.js +65 -0
- package/lib/commonjs/components/TextInput.js.map +1 -0
- package/lib/commonjs/components/ToggleButton.js +19 -0
- package/lib/commonjs/components/ToggleButton.js.map +1 -0
- package/lib/commonjs/components/Video.js +42 -0
- package/lib/commonjs/components/Video.js.map +1 -0
- package/lib/commonjs/components/View.js +20 -0
- package/lib/commonjs/components/View.js.map +1 -0
- package/lib/commonjs/components/index.js +174 -0
- package/lib/commonjs/components/index.js.map +1 -0
- package/lib/commonjs/index.js +37 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/theme/index.js +43 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/theme.js +126 -0
- package/lib/commonjs/theme/theme.js.map +1 -0
- package/lib/commonjs/theme/tokens.js +204 -0
- package/lib/commonjs/theme/tokens.js.map +1 -0
- package/lib/commonjs/types/index.d.js +2 -0
- package/lib/commonjs/types/index.d.js.map +1 -0
- package/lib/commonjs/types/svg.d.js +2 -0
- package/lib/commonjs/types/svg.d.js.map +1 -0
- package/lib/module/auth/api/authentication.js +11 -0
- package/lib/module/auth/api/authentication.js.map +1 -0
- package/lib/module/auth/appLogo.svg +9 -0
- package/lib/module/auth/hooks/useAuthenticateRequests.js +44 -0
- package/lib/module/auth/hooks/useAuthenticateRequests.js.map +1 -0
- package/lib/module/auth/hooks/useAuthentication.js +81 -0
- package/lib/module/auth/hooks/useAuthentication.js.map +1 -0
- package/lib/module/auth/index.js +5 -0
- package/lib/module/auth/index.js.map +1 -0
- package/lib/module/auth/providers/authentication/AuthenticationProvider.js +45 -0
- package/lib/module/auth/providers/authentication/AuthenticationProvider.js.map +1 -0
- package/lib/module/auth/providers/authentication/actions/authentication.actions.js +6 -0
- package/lib/module/auth/providers/authentication/actions/authentication.actions.js.map +1 -0
- package/lib/module/auth/providers/authentication/index.js +5 -0
- package/lib/module/auth/providers/authentication/index.js.map +1 -0
- package/lib/module/auth/providers/authentication/reducer/authentication.reducer.js +14 -0
- package/lib/module/auth/providers/authentication/reducer/authentication.reducer.js.map +1 -0
- package/lib/module/auth/providers/authentication/types/authentication.types.js +5 -0
- package/lib/module/auth/providers/authentication/types/authentication.types.js.map +1 -0
- package/lib/module/auth/screens/LoginScreen.js +121 -0
- package/lib/module/auth/screens/LoginScreen.js.map +1 -0
- package/lib/module/auth/screens/ResetPassword.js +82 -0
- package/lib/module/auth/screens/ResetPassword.js.map +1 -0
- package/lib/module/auth/screens/ResetPasswordInstructionsSent.js +26 -0
- package/lib/module/auth/screens/ResetPasswordInstructionsSent.js.map +1 -0
- package/lib/module/auth/screens/SignUp.js +168 -0
- package/lib/module/auth/screens/SignUp.js.map +1 -0
- package/lib/module/auth/screens/SignUpPassword.js +95 -0
- package/lib/module/auth/screens/SignUpPassword.js.map +1 -0
- package/lib/module/auth/screens/VerifyPhoneNumber.js +87 -0
- package/lib/module/auth/screens/VerifyPhoneNumber.js.map +1 -0
- package/lib/module/auth/screens/index.js +29 -0
- package/lib/module/auth/screens/index.js.map +1 -0
- package/lib/module/auth/screens/validators.js +31 -0
- package/lib/module/auth/screens/validators.js.map +1 -0
- package/lib/module/components/Alert.js +100 -0
- package/lib/module/components/Alert.js.map +1 -0
- package/lib/module/components/Badge.js +12 -0
- package/lib/module/components/Badge.js.map +1 -0
- package/lib/module/components/BottomSheet.js +52 -0
- package/lib/module/components/BottomSheet.js.map +1 -0
- package/lib/module/components/Button.js +12 -0
- package/lib/module/components/Button.js.map +1 -0
- package/lib/module/components/Card.js +11 -0
- package/lib/module/components/Card.js.map +1 -0
- package/lib/module/components/Divider.js +11 -0
- package/lib/module/components/Divider.js.map +1 -0
- package/lib/module/components/FAB.js +11 -0
- package/lib/module/components/FAB.js.map +1 -0
- package/lib/module/components/Header.js +66 -0
- package/lib/module/components/Header.js.map +1 -0
- package/lib/module/components/IconButton.js +11 -0
- package/lib/module/components/IconButton.js.map +1 -0
- package/lib/module/components/Image.js +35 -0
- package/lib/module/components/Image.js.map +1 -0
- package/lib/module/components/KeyboardAvoidingView.js +15 -0
- package/lib/module/components/KeyboardAvoidingView.js.map +1 -0
- package/lib/module/components/LineLoader.js +52 -0
- package/lib/module/components/LineLoader.js.map +1 -0
- package/lib/module/components/LinkButton.js +24 -0
- package/lib/module/components/LinkButton.js.map +1 -0
- package/lib/module/components/OtpInputs.js +87 -0
- package/lib/module/components/OtpInputs.js.map +1 -0
- package/lib/module/components/ParentView.js +72 -0
- package/lib/module/components/ParentView.js.map +1 -0
- package/lib/module/components/Searchbar.js +14 -0
- package/lib/module/components/Searchbar.js.map +1 -0
- package/lib/module/components/SelectionDialog.js +121 -0
- package/lib/module/components/SelectionDialog.js.map +1 -0
- package/lib/module/components/Snackbar.js +60 -0
- package/lib/module/components/Snackbar.js.map +1 -0
- package/lib/module/components/Surface.js +11 -0
- package/lib/module/components/Surface.js.map +1 -0
- package/lib/module/components/Text.js +12 -0
- package/lib/module/components/Text.js.map +1 -0
- package/lib/module/components/TextInput.js +56 -0
- package/lib/module/components/TextInput.js.map +1 -0
- package/lib/module/components/ToggleButton.js +11 -0
- package/lib/module/components/ToggleButton.js.map +1 -0
- package/lib/module/components/Video.js +32 -0
- package/lib/module/components/Video.js.map +1 -0
- package/lib/module/components/View.js +12 -0
- package/lib/module/components/View.js.map +1 -0
- package/lib/module/components/index.js +25 -0
- package/lib/module/components/index.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/theme/index.js +36 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/theme.js +119 -0
- package/lib/module/theme/theme.js.map +1 -0
- package/lib/module/theme/tokens.js +198 -0
- package/lib/module/theme/tokens.js.map +1 -0
- package/lib/module/types/index.d.js +2 -0
- package/lib/module/types/index.d.js.map +1 -0
- package/lib/module/types/svg.d.js +2 -0
- package/lib/module/types/svg.d.js.map +1 -0
- package/lib/typescript/src/auth/api/authentication.d.ts +4 -0
- package/lib/typescript/src/auth/api/authentication.d.ts.map +1 -0
- package/lib/typescript/src/auth/hooks/useAuthenticateRequests.d.ts +2 -0
- package/lib/typescript/src/auth/hooks/useAuthenticateRequests.d.ts.map +1 -0
- package/lib/typescript/src/auth/hooks/useAuthentication.d.ts +19 -0
- package/lib/typescript/src/auth/hooks/useAuthentication.d.ts.map +1 -0
- package/lib/typescript/src/auth/index.d.ts +5 -0
- package/lib/typescript/src/auth/index.d.ts.map +1 -0
- package/lib/typescript/src/auth/providers/authentication/AuthenticationProvider.d.ts +8 -0
- package/lib/typescript/src/auth/providers/authentication/AuthenticationProvider.d.ts.map +1 -0
- package/lib/typescript/src/auth/providers/authentication/actions/authentication.actions.d.ts +3 -0
- package/lib/typescript/src/auth/providers/authentication/actions/authentication.actions.d.ts.map +1 -0
- package/lib/typescript/src/auth/providers/authentication/index.d.ts +5 -0
- package/lib/typescript/src/auth/providers/authentication/index.d.ts.map +1 -0
- package/lib/typescript/src/auth/providers/authentication/reducer/authentication.reducer.d.ts +3 -0
- package/lib/typescript/src/auth/providers/authentication/reducer/authentication.reducer.d.ts.map +1 -0
- package/lib/typescript/src/auth/providers/authentication/types/authentication.types.d.ts +15 -0
- package/lib/typescript/src/auth/providers/authentication/types/authentication.types.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/LoginScreen.d.ts +3 -0
- package/lib/typescript/src/auth/screens/LoginScreen.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/ResetPassword.d.ts +3 -0
- package/lib/typescript/src/auth/screens/ResetPassword.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/ResetPasswordInstructionsSent.d.ts +8 -0
- package/lib/typescript/src/auth/screens/ResetPasswordInstructionsSent.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/SignUp.d.ts +9 -0
- package/lib/typescript/src/auth/screens/SignUp.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/SignUpPassword.d.ts +8 -0
- package/lib/typescript/src/auth/screens/SignUpPassword.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/VerifyPhoneNumber.d.ts +8 -0
- package/lib/typescript/src/auth/screens/VerifyPhoneNumber.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/index.d.ts +3 -0
- package/lib/typescript/src/auth/screens/index.d.ts.map +1 -0
- package/lib/typescript/src/auth/screens/validators.d.ts +36 -0
- package/lib/typescript/src/auth/screens/validators.d.ts.map +1 -0
- package/lib/typescript/src/components/Alert.d.ts +19 -0
- package/lib/typescript/src/components/Alert.d.ts.map +1 -0
- package/lib/typescript/src/components/Badge.d.ts +9 -0
- package/lib/typescript/src/components/Badge.d.ts.map +1 -0
- package/lib/typescript/src/components/BottomSheet.d.ts +7 -0
- package/lib/typescript/src/components/BottomSheet.d.ts.map +1 -0
- package/lib/typescript/src/components/Button.d.ts +9 -0
- package/lib/typescript/src/components/Button.d.ts.map +1 -0
- package/lib/typescript/src/components/Card.d.ts +9 -0
- package/lib/typescript/src/components/Card.d.ts.map +1 -0
- package/lib/typescript/src/components/Divider.d.ts +9 -0
- package/lib/typescript/src/components/Divider.d.ts.map +1 -0
- package/lib/typescript/src/components/FAB.d.ts +9 -0
- package/lib/typescript/src/components/FAB.d.ts.map +1 -0
- package/lib/typescript/src/components/Header.d.ts +18 -0
- package/lib/typescript/src/components/Header.d.ts.map +1 -0
- package/lib/typescript/src/components/IconButton.d.ts +9 -0
- package/lib/typescript/src/components/IconButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Image.d.ts +9 -0
- package/lib/typescript/src/components/Image.d.ts.map +1 -0
- package/lib/typescript/src/components/KeyboardAvoidingView.d.ts +9 -0
- package/lib/typescript/src/components/KeyboardAvoidingView.d.ts.map +1 -0
- package/lib/typescript/src/components/LineLoader.d.ts +10 -0
- package/lib/typescript/src/components/LineLoader.d.ts.map +1 -0
- package/lib/typescript/src/components/LinkButton.d.ts +9 -0
- package/lib/typescript/src/components/LinkButton.d.ts.map +1 -0
- package/lib/typescript/src/components/OtpInputs.d.ts +18 -0
- package/lib/typescript/src/components/OtpInputs.d.ts.map +1 -0
- package/lib/typescript/src/components/ParentView.d.ts +19 -0
- package/lib/typescript/src/components/ParentView.d.ts.map +1 -0
- package/lib/typescript/src/components/Searchbar.d.ts +9 -0
- package/lib/typescript/src/components/Searchbar.d.ts.map +1 -0
- package/lib/typescript/src/components/SelectionDialog.d.ts +20 -0
- package/lib/typescript/src/components/SelectionDialog.d.ts.map +1 -0
- package/lib/typescript/src/components/Snackbar.d.ts +15 -0
- package/lib/typescript/src/components/Snackbar.d.ts.map +1 -0
- package/lib/typescript/src/components/Surface.d.ts +9 -0
- package/lib/typescript/src/components/Surface.d.ts.map +1 -0
- package/lib/typescript/src/components/Text.d.ts +13 -0
- package/lib/typescript/src/components/Text.d.ts.map +1 -0
- package/lib/typescript/src/components/TextInput.d.ts +12 -0
- package/lib/typescript/src/components/TextInput.d.ts.map +1 -0
- package/lib/typescript/src/components/ToggleButton.d.ts +9 -0
- package/lib/typescript/src/components/ToggleButton.d.ts.map +1 -0
- package/lib/typescript/src/components/Video.d.ts +4 -0
- package/lib/typescript/src/components/Video.d.ts.map +1 -0
- package/lib/typescript/src/components/View.d.ts +9 -0
- package/lib/typescript/src/components/View.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +25 -0
- package/lib/typescript/src/components/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/index.d.ts +284 -0
- package/lib/typescript/src/theme/index.d.ts.map +1 -0
- package/lib/typescript/src/theme/theme.d.ts +4 -0
- package/lib/typescript/src/theme/theme.d.ts.map +1 -0
- package/lib/typescript/src/theme/tokens.d.ts +371 -0
- package/lib/typescript/src/theme/tokens.d.ts.map +1 -0
- package/package.json +191 -0
- package/src/auth/api/authentication.ts +13 -0
- package/src/auth/appLogo.svg +9 -0
- package/src/auth/hooks/useAuthenticateRequests.ts +56 -0
- package/src/auth/hooks/useAuthentication.ts +106 -0
- package/src/auth/index.ts +4 -0
- package/src/auth/providers/authentication/AuthenticationProvider.tsx +68 -0
- package/src/auth/providers/authentication/actions/authentication.actions.ts +10 -0
- package/src/auth/providers/authentication/index.ts +4 -0
- package/src/auth/providers/authentication/reducer/authentication.reducer.ts +21 -0
- package/src/auth/providers/authentication/types/authentication.types.ts +17 -0
- package/src/auth/screens/LoginScreen.tsx +140 -0
- package/src/auth/screens/ResetPassword.tsx +85 -0
- package/src/auth/screens/ResetPasswordInstructionsSent.tsx +32 -0
- package/src/auth/screens/SignUp.tsx +176 -0
- package/src/auth/screens/SignUpPassword.tsx +124 -0
- package/src/auth/screens/VerifyPhoneNumber.tsx +100 -0
- package/src/auth/screens/index.tsx +26 -0
- package/src/auth/screens/validators.ts +73 -0
- package/src/components/Alert.tsx +157 -0
- package/src/components/Badge.tsx +50 -0
- package/src/components/BottomSheet.tsx +72 -0
- package/src/components/Button.tsx +47 -0
- package/src/components/Card.tsx +47 -0
- package/src/components/Divider.tsx +47 -0
- package/src/components/FAB.tsx +47 -0
- package/src/components/Header.tsx +123 -0
- package/src/components/IconButton.tsx +47 -0
- package/src/components/Image.tsx +78 -0
- package/src/components/KeyboardAvoidingView.tsx +55 -0
- package/src/components/LineLoader.tsx +70 -0
- package/src/components/LinkButton.tsx +64 -0
- package/src/components/OtpInputs.tsx +149 -0
- package/src/components/ParentView.tsx +164 -0
- package/src/components/Searchbar.tsx +47 -0
- package/src/components/SelectionDialog.tsx +191 -0
- package/src/components/Snackbar.tsx +83 -0
- package/src/components/Surface.tsx +47 -0
- package/src/components/Text.tsx +70 -0
- package/src/components/TextInput.tsx +116 -0
- package/src/components/ToggleButton.tsx +47 -0
- package/src/components/Video.tsx +37 -0
- package/src/components/View.tsx +55 -0
- package/src/components/index.ts +24 -0
- package/src/index.tsx +5 -0
- package/src/theme/index.ts +37 -0
- package/src/theme/theme.ts +125 -0
- package/src/theme/tokens.ts +209 -0
- package/src/types/index.d.ts +1 -0
- package/src/types/svg.d.ts +4 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { useEffect } from 'react';
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
import { useTheme } from 'react-native-paper';
|
|
4
|
+
import Animated, { useSharedValue, useAnimatedStyle, withTiming, Easing } from 'react-native-reanimated';
|
|
5
|
+
export const LineLoader = ({
|
|
6
|
+
backgroundColor,
|
|
7
|
+
foregroundColor,
|
|
8
|
+
height = 4,
|
|
9
|
+
progress = 0
|
|
10
|
+
}) => {
|
|
11
|
+
const theme = useTheme();
|
|
12
|
+
const animatedProgress = useSharedValue(0);
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
animatedProgress.value = withTiming(progress, {
|
|
15
|
+
duration: 500,
|
|
16
|
+
easing: Easing.linear
|
|
17
|
+
});
|
|
18
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
19
|
+
}, [progress]);
|
|
20
|
+
const lineStyle = useAnimatedStyle(() => {
|
|
21
|
+
return {
|
|
22
|
+
width: `${animatedProgress.value * 100}%`,
|
|
23
|
+
backgroundColor: foregroundColor ?? theme.colors.primary,
|
|
24
|
+
height
|
|
25
|
+
};
|
|
26
|
+
});
|
|
27
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
28
|
+
style: [styles.container, {
|
|
29
|
+
height
|
|
30
|
+
}]
|
|
31
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
32
|
+
style: [styles.background, {
|
|
33
|
+
backgroundColor: backgroundColor ?? theme.colors.onSurfaceDisabled
|
|
34
|
+
}]
|
|
35
|
+
}), /*#__PURE__*/React.createElement(Animated.View, {
|
|
36
|
+
style: [styles.line, lineStyle]
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
container: {
|
|
41
|
+
overflow: 'hidden'
|
|
42
|
+
},
|
|
43
|
+
background: {
|
|
44
|
+
flex: 1
|
|
45
|
+
},
|
|
46
|
+
line: {
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
top: 0,
|
|
49
|
+
left: 0
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=LineLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","View","StyleSheet","useTheme","Animated","useSharedValue","useAnimatedStyle","withTiming","Easing","LineLoader","backgroundColor","foregroundColor","height","progress","theme","animatedProgress","value","duration","easing","linear","lineStyle","width","colors","primary","createElement","style","styles","container","background","onSurfaceDisabled","line","create","overflow","flex","position","top","left"],"sourceRoot":"../../../src","sources":["components/LineLoader.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,IAAI,EAAEC,UAAU,QAAQ,cAAc;AAC/C,SAASC,QAAQ,QAAQ,oBAAoB;AAC7C,OAAOC,QAAQ,IACbC,cAAc,EACdC,gBAAgB,EAChBC,UAAU,EACVC,MAAM,QACD,yBAAyB;AAShC,OAAO,MAAMC,UAAyC,GAAGA,CAAC;EACxDC,eAAe;EACfC,eAAe;EACfC,MAAM,GAAG,CAAC;EACVC,QAAQ,GAAG;AACb,CAAC,KAAK;EACJ,MAAMC,KAAK,GAAGX,QAAQ,CAAC,CAAC;EACxB,MAAMY,gBAAgB,GAAGV,cAAc,CAAC,CAAC,CAAC;EAE1CL,SAAS,CAAC,MAAM;IACde,gBAAgB,CAACC,KAAK,GAAGT,UAAU,CAACM,QAAQ,EAAE;MAC5CI,QAAQ,EAAE,GAAG;MACbC,MAAM,EAAEV,MAAM,CAACW;IACjB,CAAC,CAAC;IACF;EACF,CAAC,EAAE,CAACN,QAAQ,CAAC,CAAC;EAEd,MAAMO,SAAS,GAAGd,gBAAgB,CAAC,MAAM;IACvC,OAAO;MACLe,KAAK,EAAG,GAAEN,gBAAgB,CAACC,KAAK,GAAG,GAAI,GAAE;MACzCN,eAAe,EAAEC,eAAe,IAAIG,KAAK,CAACQ,MAAM,CAACC,OAAO;MACxDX;IACF,CAAC;EACH,CAAC,CAAC;EAEF,oBACEb,KAAA,CAAAyB,aAAA,CAACvB,IAAI;IAACwB,KAAK,EAAE,CAACC,MAAM,CAACC,SAAS,EAAE;MAAEf;IAAO,CAAC;EAAE,gBAC1Cb,KAAA,CAAAyB,aAAA,CAACvB,IAAI;IACHwB,KAAK,EAAE,CACLC,MAAM,CAACE,UAAU,EACjB;MACElB,eAAe,EAAEA,eAAe,IAAII,KAAK,CAACQ,MAAM,CAACO;IACnD,CAAC;EACD,CACH,CAAC,eACF9B,KAAA,CAAAyB,aAAA,CAACpB,QAAQ,CAACH,IAAI;IAACwB,KAAK,EAAE,CAACC,MAAM,CAACI,IAAI,EAAEV,SAAS;EAAE,CAAE,CAC7C,CAAC;AAEX,CAAC;AAED,MAAMM,MAAM,GAAGxB,UAAU,CAAC6B,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,QAAQ,EAAE;EACZ,CAAC;EACDJ,UAAU,EAAE;IACVK,IAAI,EAAE;EACR,CAAC;EACDH,IAAI,EAAE;IACJI,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Button as B } from 'react-native-paper';
|
|
4
|
+
import { useRestyle, spacing, border, composeRestyleFunctions, backgroundColor, backgroundColorShorthand, layout, position, spacingShorthand } from '@shopify/restyle';
|
|
5
|
+
import { StyleSheet } from 'react-native';
|
|
6
|
+
const restyleFunctions = composeRestyleFunctions([spacing, spacingShorthand, layout, position, border, backgroundColor, backgroundColorShorthand]);
|
|
7
|
+
export const LinkButton = ({
|
|
8
|
+
children,
|
|
9
|
+
...rest
|
|
10
|
+
}) => {
|
|
11
|
+
const restyleProps = useRestyle(restyleFunctions, rest);
|
|
12
|
+
return /*#__PURE__*/React.createElement(B, _extends({
|
|
13
|
+
labelStyle: {
|
|
14
|
+
...styles.underline,
|
|
15
|
+
...(restyleProps.labelStyle ? restyleProps.labelStyle : {})
|
|
16
|
+
}
|
|
17
|
+
}, restyleProps), children);
|
|
18
|
+
};
|
|
19
|
+
const styles = StyleSheet.create({
|
|
20
|
+
underline: {
|
|
21
|
+
textDecorationLine: 'underline'
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=LinkButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Button","B","useRestyle","spacing","border","composeRestyleFunctions","backgroundColor","backgroundColorShorthand","layout","position","spacingShorthand","StyleSheet","restyleFunctions","LinkButton","children","rest","restyleProps","createElement","_extends","labelStyle","styles","underline","create","textDecorationLine"],"sourceRoot":"../../../src","sources":["components/LinkButton.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,MAAM,IAAIC,CAAC,QAA0B,oBAAoB;AAClE,SACEC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,uBAAuB,EAIvBC,eAAe,EACfC,wBAAwB,EACxBC,MAAM,EACNC,QAAQ,EACRC,gBAAgB,QAKX,kBAAkB;AAEzB,SAASC,UAAU,QAAQ,cAAc;AAUzC,MAAMC,gBAAgB,GAAGP,uBAAuB,CAA0B,CACxEF,OAAO,EACPO,gBAAgB,EAChBF,MAAM,EACNC,QAAQ,EACRL,MAAM,EACNE,eAAe,EACfC,wBAAwB,CACzB,CAAC;AAIF,OAAO,MAAMM,UAA+B,GAAGA,CAAC;EAAEC,QAAQ;EAAE,GAAGC;AAAK,CAAC,KAAK;EACxE,MAAMC,YAAY,GAAGd,UAAU,CAACU,gBAAgB,EAAEG,IAAI,CAAC;EAEvD,oBACEhB,KAAA,CAAAkB,aAAA,CAAChB,CAAC,EAAAiB,QAAA;IACAC,UAAU,EAAE;MACV,GAAGC,MAAM,CAACC,SAAS;MACnB,IAAKL,YAAY,CAACG,UAAU,GACvBH,YAAY,CAACG,UAAU,GACxB,CAAC,CAAC;IACR;EAAE,GACEH,YAAY,GAEfF,QACA,CAAC;AAER,CAAC;AAED,MAAMM,MAAM,GAAGT,UAAU,CAACW,MAAM,CAAC;EAC/BD,SAAS,EAAE;IAAEE,kBAAkB,EAAE;EAAY;AAC/C,CAAC,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { InteractionManager, Keyboard, StyleSheet } from 'react-native';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
|
+
import { TextInput as T, useTheme } from 'react-native-paper';
|
|
4
|
+
import { View, Text } from '../index';
|
|
5
|
+
import { useRestyle, spacing, border, backgroundColor, backgroundColorShorthand, composeRestyleFunctions, spacingShorthand, layout, position } from '@shopify/restyle';
|
|
6
|
+
const restyleFunctions = composeRestyleFunctions([spacing, spacingShorthand, layout, position, border, backgroundColor, backgroundColorShorthand]);
|
|
7
|
+
export const TextInput = ({
|
|
8
|
+
...rest
|
|
9
|
+
}) => {
|
|
10
|
+
const props = useRestyle(restyleFunctions, rest);
|
|
11
|
+
return /*#__PURE__*/React.createElement(T, props);
|
|
12
|
+
};
|
|
13
|
+
export const OtpInputs = ({
|
|
14
|
+
handleChange = () => {},
|
|
15
|
+
numberOfInputs = 4,
|
|
16
|
+
error = false,
|
|
17
|
+
code = ''
|
|
18
|
+
}) => {
|
|
19
|
+
const inputRef = React.useRef();
|
|
20
|
+
const theme = useTheme();
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
// Must run after animations for keyboard to automatically open
|
|
23
|
+
InteractionManager.runAfterInteractions(() => {
|
|
24
|
+
if (inputRef?.current) {
|
|
25
|
+
inputRef.current.focus();
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}, [inputRef]);
|
|
29
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
30
|
+
overflow: "hidden"
|
|
31
|
+
}, /*#__PURE__*/React.createElement(View, {
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
justifyContent: "center"
|
|
35
|
+
}, Array(numberOfInputs).fill('').map((_number, index) => /*#__PURE__*/React.createElement(View, {
|
|
36
|
+
key: index,
|
|
37
|
+
borderColor: code[index] ? 'primary' : 'outline',
|
|
38
|
+
borderWidth: 1,
|
|
39
|
+
margin: "2",
|
|
40
|
+
borderRadius: "8",
|
|
41
|
+
backgroundColor: "background",
|
|
42
|
+
justifyContent: "center",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
minHeight: 42,
|
|
45
|
+
minWidth: 42
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
47
|
+
borderColor: "primary"
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
,
|
|
50
|
+
accessibilityLabel: "otp",
|
|
51
|
+
color: error ? 'error' : 'onBackground',
|
|
52
|
+
fontSize: 20,
|
|
53
|
+
style: theme.fonts.bodyLarge
|
|
54
|
+
}, code[index] || ''))), /*#__PURE__*/React.createElement(TextInput, {
|
|
55
|
+
textContentType: "oneTimeCode",
|
|
56
|
+
autoFocus: true,
|
|
57
|
+
keyboardType: "phone-pad",
|
|
58
|
+
ref: inputRef,
|
|
59
|
+
mode: "flat",
|
|
60
|
+
autoComplete: "one-time-code",
|
|
61
|
+
selectionColor: "transparent",
|
|
62
|
+
value: code || '',
|
|
63
|
+
onChangeText: value => {
|
|
64
|
+
if (!isNaN(Number(value))) {
|
|
65
|
+
if (value.length <= numberOfInputs) {
|
|
66
|
+
handleChange && handleChange(value);
|
|
67
|
+
}
|
|
68
|
+
if (value.length >= numberOfInputs) {
|
|
69
|
+
return Keyboard.dismiss();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return null;
|
|
73
|
+
},
|
|
74
|
+
style: styles.hiddenFont,
|
|
75
|
+
backgroundColor: "transparent",
|
|
76
|
+
bottom: -10,
|
|
77
|
+
width: "100%",
|
|
78
|
+
height: 60,
|
|
79
|
+
position: "absolute"
|
|
80
|
+
})));
|
|
81
|
+
};
|
|
82
|
+
const styles = StyleSheet.create({
|
|
83
|
+
hiddenFont: {
|
|
84
|
+
fontSize: 0.001
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=OtpInputs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["InteractionManager","Keyboard","StyleSheet","React","useEffect","TextInput","T","useTheme","View","Text","useRestyle","spacing","border","backgroundColor","backgroundColorShorthand","composeRestyleFunctions","spacingShorthand","layout","position","restyleFunctions","rest","props","createElement","OtpInputs","handleChange","numberOfInputs","error","code","inputRef","useRef","theme","runAfterInteractions","current","focus","overflow","alignItems","flexDirection","justifyContent","Array","fill","map","_number","index","key","borderColor","borderWidth","margin","borderRadius","minHeight","minWidth","accessibilityLabel","color","fontSize","style","fonts","bodyLarge","textContentType","autoFocus","keyboardType","ref","mode","autoComplete","selectionColor","value","onChangeText","isNaN","Number","length","dismiss","styles","hiddenFont","bottom","width","height","create"],"sourceRoot":"../../../src","sources":["components/OtpInputs.tsx"],"mappings":"AAAA,SAASA,kBAAkB,EAAEC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACvE,OAAOC,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,SAAS,IAAIC,CAAC,EAEdC,QAAQ,QACH,oBAAoB;AAC3B,SAASC,IAAI,EAAEC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IAAI1C,cAAc,EAAE;UAClC,OAAOxB,QAAQ,CAACmE,OAAO,CAAC,CAAC;QAC3B;MACF;MAEA,OAAO,IAAI;IACb,CAAE;IACFf,KAAK,EAAEgB,MAAM,CAACC,UAAW;IACzBzD,eAAe,EAAC,aAAa;IAC7B0D,MAAM,EAAE,CAAC,EAAG;IACZC,KAAK,EAAC,MAAM;IACZC,MAAM,EAAE,EAAG;IACXvD,QAAQ,EAAC;EAAU,CACpB,CACG,CACF,CAAC;AAEX,CAAC;AAED,MAAMmD,MAAM,GAAGnE,UAAU,CAACwE,MAAM,CAAC;EAC/BJ,UAAU,EAAE;IAAElB,QAAQ,EAAE;EAAM;AAChC,CAAC,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { StatusBar, Keyboard, StyleSheet } from 'react-native';
|
|
5
|
+
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
|
+
import { View } from '../components';
|
|
7
|
+
import { useTheme } from 'react-native-paper';
|
|
8
|
+
import { useRestyle, spacing, border, backgroundColor, backgroundColorShorthand, composeRestyleFunctions, spacingShorthand, layout, position } from '@shopify/restyle';
|
|
9
|
+
const restyleFunctions = composeRestyleFunctions([spacing, spacingShorthand, layout, position, border, backgroundColor, backgroundColorShorthand]);
|
|
10
|
+
export function useKeyboard() {
|
|
11
|
+
const [keyboardHeight, setKeyboardHeight] = useState(0);
|
|
12
|
+
function onKeyboardDidShow(e) {
|
|
13
|
+
setKeyboardHeight(e.endCoordinates.height);
|
|
14
|
+
}
|
|
15
|
+
function onKeyboardDidHide() {
|
|
16
|
+
setKeyboardHeight(0);
|
|
17
|
+
}
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
const keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', onKeyboardDidShow);
|
|
20
|
+
const keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', onKeyboardDidHide);
|
|
21
|
+
return () => {
|
|
22
|
+
keyboardDidHideListener.remove();
|
|
23
|
+
keyboardDidShowListener.remove();
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
return keyboardHeight;
|
|
27
|
+
}
|
|
28
|
+
export const ParentView = ({
|
|
29
|
+
children,
|
|
30
|
+
bg,
|
|
31
|
+
topInset = true,
|
|
32
|
+
rightInset = true,
|
|
33
|
+
leftInset = true,
|
|
34
|
+
bottomInset = true,
|
|
35
|
+
shouldDismissKeyboardOnTap = true,
|
|
36
|
+
...rest
|
|
37
|
+
}) => {
|
|
38
|
+
const props = useRestyle(restyleFunctions, rest);
|
|
39
|
+
const keyboardHeight = useKeyboard();
|
|
40
|
+
const safeAreaViewProps = {
|
|
41
|
+
edges: [...(topInset ? ['top'] : []), ...(rightInset ? ['right'] : []), ...(leftInset ? ['left'] : [])]
|
|
42
|
+
};
|
|
43
|
+
const insets = useSafeAreaInsets();
|
|
44
|
+
const handleOnTouchStart = e => {
|
|
45
|
+
if (keyboardHeight && e?.target?._internalFiberInstanceHandleDEV?.elementType?.indexOf('TextInput') === -1) {
|
|
46
|
+
Keyboard.dismiss();
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const theme = useTheme();
|
|
50
|
+
return /*#__PURE__*/React.createElement(SafeAreaView, _extends({
|
|
51
|
+
style: [style.safeAreaView, {
|
|
52
|
+
backgroundColor: theme.colors.background
|
|
53
|
+
}]
|
|
54
|
+
}, safeAreaViewProps), /*#__PURE__*/React.createElement(StatusBar, {
|
|
55
|
+
barStyle: theme.dark ? 'light-content' : 'dark-content',
|
|
56
|
+
translucent: true,
|
|
57
|
+
backgroundColor: "transparent"
|
|
58
|
+
}), /*#__PURE__*/React.createElement(View, _extends({
|
|
59
|
+
flex: 1,
|
|
60
|
+
bg: bg ?? 'background'
|
|
61
|
+
}, props, bottomInset && {
|
|
62
|
+
pb: insets.bottom
|
|
63
|
+
}, shouldDismissKeyboardOnTap ? {
|
|
64
|
+
onTouchStart: handleOnTouchStart
|
|
65
|
+
} : {}), children));
|
|
66
|
+
};
|
|
67
|
+
const style = StyleSheet.create({
|
|
68
|
+
safeAreaView: {
|
|
69
|
+
flex: 1
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=ParentView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useState","StatusBar","Keyboard","StyleSheet","SafeAreaView","useSafeAreaInsets","View","useTheme","useRestyle","spacing","border","backgroundColor","backgroundColorShorthand","composeRestyleFunctions","spacingShorthand","layout","position","restyleFunctions","useKeyboard","keyboardHeight","setKeyboardHeight","onKeyboardDidShow","e","endCoordinates","height","onKeyboardDidHide","keyboardDidShowListener","addListener","keyboardDidHideListener","remove","ParentView","children","bg","topInset","rightInset","leftInset","bottomInset","shouldDismissKeyboardOnTap","rest","props","safeAreaViewProps","edges","insets","handleOnTouchStart","target","_internalFiberInstanceHandleDEV","elementType","indexOf","dismiss","theme","createElement","_extends","style","safeAreaView","colors","background","barStyle","dark","translucent","flex","pb","bottom","onTouchStart","create"],"sourceRoot":"../../../src","sources":["components/ParentView.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE3C,SACEC,SAAS,EACTC,QAAQ,EACRC,UAAU,QAEL,cAAc;AACrB,SAEEC,YAAY,EACZC,iBAAiB,QACZ,gCAAgC;AAEvC,SAASC,IAAI,QAAQ,eAAe;AACpC,SAASC,QAAQ,QAAQ,oBAAoB;AAG7C,SACEC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,eAAe,EACfC,wBAAwB,EAIxBC,uBAAuB,EAI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D,MAAM,CAAC;EAC9BV,YAAY,EAAE;IACZM,IAAI,EAAE;EACR;AACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Searchbar as S } from 'react-native-paper';
|
|
4
|
+
import { useRestyle, spacing, border, backgroundColor, backgroundColorShorthand, composeRestyleFunctions, spacingShorthand, layout, position } from '@shopify/restyle';
|
|
5
|
+
const restyleFunctions = composeRestyleFunctions([spacing, spacingShorthand, layout, position, border, backgroundColor, backgroundColorShorthand]);
|
|
6
|
+
export const Searchbar = ({
|
|
7
|
+
...rest
|
|
8
|
+
}) => {
|
|
9
|
+
const props = useRestyle(restyleFunctions, rest);
|
|
10
|
+
return /*#__PURE__*/React.createElement(S, _extends({}, props, {
|
|
11
|
+
right: null
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=Searchbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Searchbar","S","useRestyle","spacing","border","backgroundColor","backgroundColorShorthand","composeRestyleFunctions","spacingShorthand","layout","position","restyleFunctions","rest","props","createElement","_extends","right"],"sourceRoot":"../../../src","sources":["components/Searchbar.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,SAAS,IAAIC,CAAC,QAA6B,oBAAoB;AACxE,SACEC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,eAAe,EACfC,wBAAwB,EAIxBC,uBAAuB,EAIvBC,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,QAEH,kBAAkB;AAWzB,MAAMC,gBAAgB,GAAGJ,uBAAuB,CAA0B,CACxEJ,OAAO,EACPK,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACRN,MAAM,EACNC,eAAe,EACfC,wBAAwB,CACzB,CAAC;AAIF,OAAO,MAAMN,SAAS,GAAGA,CAAC;EAAE,GAAGY;AAAY,CAAC,KAAK;EAC/C,MAAMC,KAAK,GAAGX,UAAU,CAACS,gBAAgB,EAASC,IAAI,CAAC;EAEvD,oBAAOb,KAAA,CAAAe,aAAA,CAACb,CAAC,EAAAc,QAAA,KAAKF,KAAK;IAAEG,KAAK,EAAE;EAAY,EAAE,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React, { useState, useCallback, useEffect } from 'react';
|
|
2
|
+
import { Dialog, RadioButton, Text, useTheme } from 'react-native-paper';
|
|
3
|
+
import { t } from 'i18next';
|
|
4
|
+
import { Button } from './Button';
|
|
5
|
+
import { View } from './View';
|
|
6
|
+
const useSelectionDialogHook = () => {
|
|
7
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
8
|
+
const [params, setParams] = useState({});
|
|
9
|
+
const {
|
|
10
|
+
title = '',
|
|
11
|
+
description = '',
|
|
12
|
+
isDismissable = true,
|
|
13
|
+
buttons = [],
|
|
14
|
+
selectionOptions = []
|
|
15
|
+
} = params;
|
|
16
|
+
const show = useCallback(parameters => {
|
|
17
|
+
setParams(parameters);
|
|
18
|
+
setIsVisible(true);
|
|
19
|
+
}, []);
|
|
20
|
+
const hide = useCallback(() => {
|
|
21
|
+
setIsVisible(false);
|
|
22
|
+
}, []);
|
|
23
|
+
return {
|
|
24
|
+
isVisible,
|
|
25
|
+
show,
|
|
26
|
+
hide,
|
|
27
|
+
title,
|
|
28
|
+
description,
|
|
29
|
+
isDismissable,
|
|
30
|
+
buttons,
|
|
31
|
+
selectionOptions
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
let rootLevelRef = null;
|
|
35
|
+
export const SelectionDialog = () => {
|
|
36
|
+
const {
|
|
37
|
+
isVisible,
|
|
38
|
+
show,
|
|
39
|
+
hide,
|
|
40
|
+
buttons,
|
|
41
|
+
isDismissable,
|
|
42
|
+
selectionOptions,
|
|
43
|
+
title,
|
|
44
|
+
description
|
|
45
|
+
} = useSelectionDialogHook();
|
|
46
|
+
const theme = useTheme();
|
|
47
|
+
const [selectedOptionIndex, setSelectedOptionIndex] = useState(0);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
if (isVisible) {
|
|
50
|
+
setSelectedOptionIndex(0);
|
|
51
|
+
}
|
|
52
|
+
}, [isVisible]);
|
|
53
|
+
const [button1 = {
|
|
54
|
+
label: t('ok'),
|
|
55
|
+
onPress: () => {},
|
|
56
|
+
mode: 'text'
|
|
57
|
+
}, button2, button3] = buttons;
|
|
58
|
+
const ref = React.useRef(null);
|
|
59
|
+
React.useImperativeHandle(ref, React.useCallback(() => ({
|
|
60
|
+
show
|
|
61
|
+
}), [show]));
|
|
62
|
+
React.useEffect(() => {
|
|
63
|
+
rootLevelRef = ref.current;
|
|
64
|
+
}, [ref]);
|
|
65
|
+
return /*#__PURE__*/React.createElement(Dialog, {
|
|
66
|
+
style: {
|
|
67
|
+
backgroundColor: theme.colors.background
|
|
68
|
+
},
|
|
69
|
+
dismissable: isDismissable,
|
|
70
|
+
dismissableBackButton: isDismissable,
|
|
71
|
+
onDismiss: () => {
|
|
72
|
+
if (isVisible) {
|
|
73
|
+
hide();
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
visible: isVisible
|
|
77
|
+
}, Boolean(title) && /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(Text, {
|
|
78
|
+
variant: "titleMedium"
|
|
79
|
+
}, title)), Boolean(description) && /*#__PURE__*/React.createElement(Dialog.Content, null, /*#__PURE__*/React.createElement(Text, {
|
|
80
|
+
variant: "bodyMedium"
|
|
81
|
+
}, description)), /*#__PURE__*/React.createElement(Dialog.Content, null, selectionOptions.map((option, index) => {
|
|
82
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
83
|
+
flexDirection: "row",
|
|
84
|
+
alignItems: "center"
|
|
85
|
+
}, /*#__PURE__*/React.createElement(RadioButton.Android, {
|
|
86
|
+
value: "",
|
|
87
|
+
status: selectedOptionIndex === index ? 'checked' : 'unchecked',
|
|
88
|
+
onPress: () => setSelectedOptionIndex(index)
|
|
89
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
90
|
+
variant: "bodyMedium"
|
|
91
|
+
}, option));
|
|
92
|
+
})), /*#__PURE__*/React.createElement(Dialog.Actions, null, button3 && /*#__PURE__*/React.createElement(Button, {
|
|
93
|
+
mx: "8",
|
|
94
|
+
mode: button3?.mode || 'text',
|
|
95
|
+
onPress: () => {
|
|
96
|
+
hide();
|
|
97
|
+
button3?.onPress?.(selectedOptionIndex);
|
|
98
|
+
}
|
|
99
|
+
}, button3.label), button2 && /*#__PURE__*/React.createElement(Button, {
|
|
100
|
+
ml: "2",
|
|
101
|
+
mode: button2?.mode || 'text',
|
|
102
|
+
onPress: () => {
|
|
103
|
+
hide();
|
|
104
|
+
button2?.onPress?.(selectedOptionIndex);
|
|
105
|
+
}
|
|
106
|
+
}, button2?.label), button1 && /*#__PURE__*/React.createElement(Button, {
|
|
107
|
+
ml: "2",
|
|
108
|
+
mode: button1?.mode || 'text',
|
|
109
|
+
onPress: () => {
|
|
110
|
+
hide();
|
|
111
|
+
button1?.onPress?.(selectedOptionIndex);
|
|
112
|
+
}
|
|
113
|
+
}, button1.label)));
|
|
114
|
+
};
|
|
115
|
+
SelectionDialog.displayName = 'SelectionDialog';
|
|
116
|
+
|
|
117
|
+
//@ts-ignore
|
|
118
|
+
SelectionDialog.show = params => {
|
|
119
|
+
rootLevelRef?.show(params);
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=SelectionDialog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useCallback","useEffect","Dialog","RadioButton","Text","useTheme","t","Button","View","useSelectionDialogHook","isVisible","setIsVisible","params","setParams","title","description","isDismissable","buttons","selectionOptions","show","parameters","hide","rootLevelRef","SelectionDialog","theme","selectedOptionIndex","setSelectedOptionIndex","button1","label","onPress","mode","button2","button3","ref","useRef","useImperativeHandle","current","createElement","style","backgroundColor","colors","background","dismissable","dismissableBackButton","onDismiss","visible","Boolean","Content","variant","map","option","index","flexDirection","alignItems","Android","value","status","Actions","mx","ml","displayName"],"sourceRoot":"../../../src","sources":["components/SelectionDialog.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,QAAQ,EAAEC,WAAW,EAAEC,SAAS,QAAQ,OAAO;AAC/D,SAASC,MAAM,EAAEC,WAAW,EAAEC,IAAI,EAAEC,QAAQ,QAAQ,oBAAoB;AACxE,SAASC,CAAC,QAAQ,SAAS;AAC3B,SAASC,MAAM,QAAQ,UAAU;AACjC,SAASC,IAAI,QAAQ,QAAQ;AAoB7B,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EACnC,MAAM,CAACC,SAAS,EAAEC,YAAY,CAAC,GAAGZ,QAAQ,CAAC,KAAK,CAAC;EACjD,MAAM,CAACa,MAAM,EAAEC,SAAS,CAAC,GAAGd,QAAQ,CAAwB,CAAC,CAAC,CAAC;EAC/D,MAAM;IACJe,KAAK,GAAG,EAAE;IACVC,WAAW,GAAG,EAAE;IAChBC,aAAa,GAAG,IAAI;IACpBC,OAAO,GAAG,EAAE;IACZC,gBAAgB,GAAG;EACrB,CAAC,GAAGN,MAAM;EAEV,MAAMO,IAAI,GAAGnB,WAAW,CAAEoB,UAAiC,IAAK;IAC9DP,SAAS,CAACO,UAAU,CAAC;IACrBT,YAAY,CAAC,IAAI,CAAC;EACpB,CAAC,EAAE,EAAE,CAAC;EAEN,MAAMU,IAAI,GAAGrB,WAAW,CAAC,MAAM;IAC7BW,YAAY,CAAC,KAAK,CAAC;EACrB,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IACLD,SAAS;IACTS,IAAI;IACJE,IAAI;IACJP,KAAK;IACLC,WAAW;IACXC,aAAa;IACbC,OAAO;IACPC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AC9BD,OAAO,EAAEA,CAAA,KAAM;MACbR,IAAI,CAAC,CAAC;MACNW,OAAO,EAAEH,OAAO,GAAGJ,mBAAmB,CAAC;IACzC;EAAE,GAEDO,OAAO,CAACJ,KACH,CACT,EACAG,OAAO,iBACNjC,KAAA,CAAAuC,aAAA,CAAC9B,MAAM;IACLoD,EAAE,EAAC,GAAG;IACN7B,IAAI,EAAEC,OAAO,EAAED,IAAI,IAAI,MAAO;IAC9BD,OAAO,EAAEA,CAAA,KAAM;MACbR,IAAI,CAAC,CAAC;MACNU,OAAO,EAAEF,OAAO,GAAGJ,mBAAmB,CAAC;IACzC;EAAE,GAEDM,OAAO,EAAEH,KACJ,CACT,EACAD,OAAO,iBACN7B,KAAA,CAAAuC,aAAA,CAAC9B,MAAM;IACLoD,EAAE,EAAC,GAAG;IACN7B,IAAI,EAAEH,OAAO,EAAEG,IAAI,IAAI,MAAO;IAC9BD,OAAO,EAAEA,CAAA,KAAM;MACbR,IAAI,CAAC,CAAC;MACNM,OAAO,EAAEE,OAAO,GAAGJ,mBAAmB,CAAC;IACzC;EAAE,GAEDE,OAAO,CAACC,KACH,CAEI,CACV,CAAC;AAEb,CAAC;AAEDL,eAAe,CAACqC,WAAW,GAAG,iBAAiB;;AAE/C;AACArC,eAAe,CAACJ,IAAI,GAAIP,MAA6B,IAAK;EACxDU,YAAY,EAAEH,IAAI,CAACP,MAAM,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { useState, useCallback } from 'react';
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Snackbar as PSnackbar } from 'react-native-paper';
|
|
4
|
+
const useAlertHook = () => {
|
|
5
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
6
|
+
const [params, setParams] = useState({});
|
|
7
|
+
const {
|
|
8
|
+
title = '',
|
|
9
|
+
action
|
|
10
|
+
} = params;
|
|
11
|
+
const show = useCallback(parameters => {
|
|
12
|
+
setParams(parameters);
|
|
13
|
+
setIsVisible(true);
|
|
14
|
+
}, []);
|
|
15
|
+
const hide = useCallback(() => {
|
|
16
|
+
setIsVisible(false);
|
|
17
|
+
}, []);
|
|
18
|
+
return {
|
|
19
|
+
isVisible,
|
|
20
|
+
show,
|
|
21
|
+
hide,
|
|
22
|
+
title,
|
|
23
|
+
action
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
let rootLevelRef = null;
|
|
27
|
+
export const Snackbar = () => {
|
|
28
|
+
const {
|
|
29
|
+
t
|
|
30
|
+
} = useTranslation();
|
|
31
|
+
const {
|
|
32
|
+
isVisible,
|
|
33
|
+
show,
|
|
34
|
+
hide,
|
|
35
|
+
title,
|
|
36
|
+
action
|
|
37
|
+
} = useAlertHook();
|
|
38
|
+
const ref = React.useRef(null);
|
|
39
|
+
React.useImperativeHandle(ref, React.useCallback(() => ({
|
|
40
|
+
show
|
|
41
|
+
}), [show]));
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
rootLevelRef = ref.current;
|
|
44
|
+
}, [ref]);
|
|
45
|
+
return /*#__PURE__*/React.createElement(PSnackbar, {
|
|
46
|
+
visible: isVisible,
|
|
47
|
+
onDismiss: hide,
|
|
48
|
+
action: action ?? {
|
|
49
|
+
label: t('close'),
|
|
50
|
+
onPress: hide
|
|
51
|
+
}
|
|
52
|
+
}, title);
|
|
53
|
+
};
|
|
54
|
+
Snackbar.displayName = 'Snackbar';
|
|
55
|
+
|
|
56
|
+
//@ts-ignore
|
|
57
|
+
Snackbar.show = params => {
|
|
58
|
+
rootLevelRef?.show(params);
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=Snackbar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useState","useCallback","useTranslation","Snackbar","PSnackbar","useAlertHook","isVisible","setIsVisible","params","setParams","title","action","show","parameters","hide","rootLevelRef","t","ref","useRef","useImperativeHandle","useEffect","current","createElement","visible","onDismiss","label","onPress","displayName"],"sourceRoot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F,CAAC;EAEDb,KAAK,CAACqB,SAAS,CAAC,MAAM;IACpBL,YAAY,GAAGE,GAAG,CAACI,OAAO;EAC5B,CAAC,EAAE,CAACJ,GAAG,CAAC,CAAC;EAET,oBACElB,KAAA,CAAAuB,aAAA,CAAClB,SAAS;IACRmB,OAAO,EAAEjB,SAAU;IACnBkB,SAAS,EAAEV,IAAK;IAChBH,MAAM,EACJA,MAAM,IAAI;MACRc,KAAK,EAAET,CAAC,CAAC,OAAO,CAAC;MACjBU,OAAO,EAAEZ;IACX;EACD,GAEAJ,KACQ,CAAC;AAEhB,CAAC;AAEDP,QAAQ,CAACwB,WAAW,GAAG,UAAU;;AAEjC;AACAxB,QAAQ,CAACS,IAAI,GAAIJ,MAAsB,IAAK;EAC1CO,YAAY,EAAEH,IAAI,CAACJ,MAAM,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Surface as S } from 'react-native-paper';
|
|
3
|
+
import { useRestyle, spacing, border, backgroundColor, backgroundColorShorthand, composeRestyleFunctions, spacingShorthand, layout, position } from '@shopify/restyle';
|
|
4
|
+
const restyleFunctions = composeRestyleFunctions([spacing, spacingShorthand, layout, position, border, backgroundColor, backgroundColorShorthand]);
|
|
5
|
+
export const Surface = ({
|
|
6
|
+
...rest
|
|
7
|
+
}) => {
|
|
8
|
+
const props = useRestyle(restyleFunctions, rest);
|
|
9
|
+
return /*#__PURE__*/React.createElement(S, props);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=Surface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Surface","S","useRestyle","spacing","border","backgroundColor","backgroundColorShorthand","composeRestyleFunctions","spacingShorthand","layout","position","restyleFunctions","rest","props","createElement"],"sourceRoot":"../../../src","sources":["components/Surface.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,OAAO,IAAIC,CAAC,QAA2B,oBAAoB;AACpE,SACEC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,eAAe,EACfC,wBAAwB,EAIxBC,uBAAuB,EAIvBC,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,QAEH,kBAAkB;AAWzB,MAAMC,gBAAgB,GAAGJ,uBAAuB,CAA0B,CACxEJ,OAAO,EACPK,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACRN,MAAM,EACNC,eAAe,EACfC,wBAAwB,CACzB,CAAC;AAIF,OAAO,MAAMN,OAAO,GAAGA,CAAC;EAAE,GAAGY;AAAY,CAAC,KAAK;EAC7C,MAAMC,KAAK,GAAGX,UAAU,CAACS,gBAAgB,EAASC,IAAI,CAAC;EAEvD,oBAAOb,KAAA,CAAAe,aAAA,CAACb,CAAC,EAAKY,KAAQ,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text as T } from 'react-native-paper';
|
|
3
|
+
import { useRestyle, spacing, border, composeRestyleFunctions, backgroundColor, backgroundColorShorthand, color, layout, position, typography, spacingShorthand, opacity } from '@shopify/restyle';
|
|
4
|
+
const restyleFunctions = composeRestyleFunctions([color, spacing, spacingShorthand, layout, position, opacity, typography, border, backgroundColor, backgroundColorShorthand]);
|
|
5
|
+
export const Text = ({
|
|
6
|
+
children,
|
|
7
|
+
...rest
|
|
8
|
+
}) => {
|
|
9
|
+
const restyleProps = useRestyle(restyleFunctions, rest);
|
|
10
|
+
return /*#__PURE__*/React.createElement(T, restyleProps, children);
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=Text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","Text","T","useRestyle","spacing","border","composeRestyleFunctions","backgroundColor","backgroundColorShorthand","color","layout","position","typography","spacingShorthand","opacity","restyleFunctions","children","rest","restyleProps","createElement"],"sourceRoot":"../../../src","sources":["components/Text.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,IAAI,IAAIC,CAAC,QAAwB,oBAAoB;AAC9D,SACEC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,uBAAuB,EAIvBC,eAAe,EACfC,wBAAwB,EACxBC,KAAK,EACLC,MAAM,EACNC,QAAQ,EACRC,UAAU,EACVC,gBAAgB,EAOhBC,OAAO,QAEF,kBAAkB;AAezB,MAAMC,gBAAgB,GAAGT,uBAAuB,CAA0B,CACxEG,KAAK,EACLL,OAAO,EACPS,gBAAgB,EAChBH,MAAM,EACNC,QAAQ,EACRG,OAAO,EACPF,UAAU,EACVP,MAAM,EACNE,eAAe,EACfC,wBAAwB,CACzB,CAAC;AAOF,OAAO,MAAMP,IAAsC,GAAGA,CAAC;EACrDe,QAAQ;EACR,GAAGC;AACL,CAAC,KAAK;EACJ,MAAMC,YAAY,GAAGf,UAAU,CAACY,gBAAgB,EAAEE,IAAI,CAAC;EAEvD,oBACEjB,KAAA,CAAAmB,aAAA,CAACjB,CAAC,EAAMgB,YAAY,EACjBF,QACA,CAAC;AAER,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { TextInput as T, ToggleButton, useTheme } from 'react-native-paper';
|
|
4
|
+
import { View } from './View';
|
|
5
|
+
import { IconButton } from './IconButton';
|
|
6
|
+
import { Text } from './Text';
|
|
7
|
+
import { useRestyle, spacing, border, backgroundColor, backgroundColorShorthand, composeRestyleFunctions, spacingShorthand, layout, position } from '@shopify/restyle';
|
|
8
|
+
const restyleFunctions = composeRestyleFunctions([spacing, spacingShorthand, layout, position, border, backgroundColor, backgroundColorShorthand]);
|
|
9
|
+
export const TextInputStyled = ({
|
|
10
|
+
...rest
|
|
11
|
+
}) => {
|
|
12
|
+
const props = useRestyle(restyleFunctions, rest);
|
|
13
|
+
return /*#__PURE__*/React.createElement(T, props);
|
|
14
|
+
};
|
|
15
|
+
export const TextInput = ({
|
|
16
|
+
errorMessage,
|
|
17
|
+
secureTextEntry,
|
|
18
|
+
...rest
|
|
19
|
+
}) => {
|
|
20
|
+
const [status, setStatus] = React.useState('checked');
|
|
21
|
+
const onButtonToggle = () => {
|
|
22
|
+
setStatus(status === 'checked' ? 'unchecked' : 'checked');
|
|
23
|
+
};
|
|
24
|
+
const shouldShowPassword = status === 'checked';
|
|
25
|
+
const theme = useTheme();
|
|
26
|
+
return /*#__PURE__*/React.createElement(View, null, /*#__PURE__*/React.createElement(View, {
|
|
27
|
+
justifyContent: "center"
|
|
28
|
+
}, /*#__PURE__*/React.createElement(TextInputStyled, _extends({
|
|
29
|
+
width: "100%",
|
|
30
|
+
secureTextEntry: shouldShowPassword && secureTextEntry
|
|
31
|
+
}, rest)), secureTextEntry && /*#__PURE__*/React.createElement(View, {
|
|
32
|
+
pt: "4",
|
|
33
|
+
justifyContent: "center",
|
|
34
|
+
alignSelf: "flex-end",
|
|
35
|
+
position: "absolute",
|
|
36
|
+
width: 48
|
|
37
|
+
}, /*#__PURE__*/React.createElement(ToggleButton, {
|
|
38
|
+
icon: shouldShowPassword ? 'eye' : 'eye-off',
|
|
39
|
+
size: 20,
|
|
40
|
+
onPress: onButtonToggle
|
|
41
|
+
}))), !!errorMessage && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(View, {
|
|
42
|
+
flexDirection: "row",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
pb: "2"
|
|
45
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
46
|
+
icon: "alert-circle-outline",
|
|
47
|
+
size: 14,
|
|
48
|
+
width: 20,
|
|
49
|
+
margin: "0",
|
|
50
|
+
iconColor: theme.colors.error
|
|
51
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
52
|
+
variant: "bodySmall",
|
|
53
|
+
color: "error"
|
|
54
|
+
}, errorMessage))));
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=TextInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","TextInput","T","ToggleButton","useTheme","View","IconButton","Text","useRestyle","spacing","border","backgroundColor","backgroundColorShorthand","composeRestyleFunctions","spacingShorthand","layout","position","restyleFunctions","TextInputStyled","rest","props","createElement","errorMessage","secureTextEntry","status","setStatus","useState","onButtonToggle","shouldShowPassword","theme","justifyContent","_extends","width","pt","alignSelf","icon","size","onPress","Fragment","flexDirection","alignItems","pb","margin","iconColor","colors","error","variant","color"],"sourceRoot":"../../../src","sources":["components/TextInput.tsx"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SACEC,SAAS,IAAIC,CAAC,EAEdC,YAAY,EACZC,QAAQ,QACH,oBAAoB;AAC3B,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SACEC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,eAAe,EACfC,wBAAwB,EAIxBC,uBAAuB,EAIvBC,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,QAEH,kBAAkB;AAWzB,MAAMC,gBAAgB,GAAGJ,uBAAuB,CAA0B,CACxEJ,OAAO,EACPK,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACRN,MAAM,EACNC,eAAe,EACfC,wBAAwB,CACzB,CAAC;AAOF,OAAO,MAAMM,eAAe,GAAGA,CAAC;EAAE,GAAGC;AAAY,CAAC,KAAK;EACrD,MAAMC,KAAK,GAAGZ,UAAU,CAACS,gBAAgB,EAASE,IAAI,CAAC;EAEvD,oBAAOnB,KAAA,CAAAqB,aAAA,CAACnB,CAAC,EAAKkB,KAAQ,CAAC;AACzB,CAAC;AAED,OAAO,MAAMnB,SAA0B,GAAGA,CAA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,IAAI,EAAC,sBAAsB;IAC3BC,IAAI,EAAE,EAAG;IACTJ,KAAK,EAAE,EAAG;IACVU,MAAM,EAAC,GAAG;IACVC,SAAS,EAAEd,KAAK,CAACe,MAAM,CAACC;EAAM,CAC/B,CAAC,eACF7C,KAAA,CAAAqB,aAAA,CAACd,IAAI;IAACuC,OAAO,EAAC,WAAW;IAACC,KAAK,EAAC;EAAO,GACpCzB,YACG,CACF,CACN,CAEA,CAAC;AAEX,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ToggleButton as TB } from 'react-native-paper';
|
|
3
|
+
import { useRestyle, spacing, border, backgroundColor, backgroundColorShorthand, composeRestyleFunctions, spacingShorthand, layout, position } from '@shopify/restyle';
|
|
4
|
+
const restyleFunctions = composeRestyleFunctions([spacing, spacingShorthand, layout, position, border, backgroundColor, backgroundColorShorthand]);
|
|
5
|
+
export const ToggleButton = ({
|
|
6
|
+
...rest
|
|
7
|
+
}) => {
|
|
8
|
+
const props = useRestyle(restyleFunctions, rest);
|
|
9
|
+
return /*#__PURE__*/React.createElement(TB, props);
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=ToggleButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","ToggleButton","TB","useRestyle","spacing","border","backgroundColor","backgroundColorShorthand","composeRestyleFunctions","spacingShorthand","layout","position","restyleFunctions","rest","props","createElement"],"sourceRoot":"../../../src","sources":["components/ToggleButton.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,IAAIC,EAAE,QAAgC,oBAAoB;AAC/E,SACEC,UAAU,EACVC,OAAO,EACPC,MAAM,EACNC,eAAe,EACfC,wBAAwB,EAIxBC,uBAAuB,EAIvBC,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,QAEH,kBAAkB;AAWzB,MAAMC,gBAAgB,GAAGJ,uBAAuB,CAA0B,CACxEJ,OAAO,EACPK,gBAAgB,EAChBC,MAAM,EACNC,QAAQ,EACRN,MAAM,EACNC,eAAe,EACfC,wBAAwB,CACzB,CAAC;AAIF,OAAO,MAAMN,YAAY,GAAGA,CAAC;EAAE,GAAGY;AAAY,CAAC,KAAK;EAClD,MAAMC,KAAK,GAAGX,UAAU,CAACS,gBAAgB,EAASC,IAAW,CAAC;EAE9D,oBAAOb,KAAA,CAAAe,aAAA,CAACb,EAAE,EAAMY,KAAkB,CAAC;AACrC,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import { View } from './View';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { ActivityIndicator } from 'react-native-paper';
|
|
5
|
+
import { IconButton } from './IconButton';
|
|
6
|
+
import VideoOriginal from 'react-native-video';
|
|
7
|
+
export const Video = ({
|
|
8
|
+
...rest
|
|
9
|
+
}) => {
|
|
10
|
+
const [status, setStatus] = useState('loading');
|
|
11
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
12
|
+
flex: 1
|
|
13
|
+
}, /*#__PURE__*/React.createElement(VideoOriginal, _extends({}, rest, {
|
|
14
|
+
onLoad: () => {
|
|
15
|
+
setStatus('success');
|
|
16
|
+
},
|
|
17
|
+
onError: () => {
|
|
18
|
+
setStatus('failed');
|
|
19
|
+
}
|
|
20
|
+
})), /*#__PURE__*/React.createElement(View, {
|
|
21
|
+
top: 0,
|
|
22
|
+
bottom: 0,
|
|
23
|
+
right: 0,
|
|
24
|
+
left: 0,
|
|
25
|
+
position: "absolute",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
justifyContent: "center"
|
|
28
|
+
}, status === 'loading' && /*#__PURE__*/React.createElement(ActivityIndicator, null), status === 'failed' && /*#__PURE__*/React.createElement(IconButton, {
|
|
29
|
+
icon: "image-broken-variant"
|
|
30
|
+
})));
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=Video.js.map
|